aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/kernel/time.c4
-rw-r--r--arch/alpha/mm/numa.c3
-rw-r--r--arch/alpha/mm/remap.c6
-rw-r--r--arch/arm/Makefile14
-rw-r--r--arch/arm/boot/compressed/misc.c2
-rw-r--r--arch/arm/common/amba.c2
-rw-r--r--arch/arm/common/dmabounce.c165
-rw-r--r--arch/arm/common/scoop.c2
-rw-r--r--arch/arm/configs/ixdp2400_defconfig2
-rw-r--r--arch/arm/configs/ixdp2800_defconfig2
-rw-r--r--arch/arm/kernel/Makefile2
-rw-r--r--arch/arm/kernel/arthur.c1
-rw-r--r--arch/arm/kernel/asm-offsets.c1
-rw-r--r--arch/arm/kernel/entry-armv.S3
-rw-r--r--arch/arm/kernel/head.S57
-rw-r--r--arch/arm/kernel/ptrace.c2
-rw-r--r--arch/arm/kernel/signal.c96
-rw-r--r--arch/arm/kernel/time.c4
-rw-r--r--arch/arm/kernel/traps.c43
-rw-r--r--arch/arm/kernel/vmlinux.lds.S11
-rw-r--r--arch/arm/lib/ashldi3.S48
-rw-r--r--arch/arm/lib/ashldi3.c56
-rw-r--r--arch/arm/lib/ashrdi3.S48
-rw-r--r--arch/arm/lib/ashrdi3.c57
-rw-r--r--arch/arm/lib/gcclib.h22
-rw-r--r--arch/arm/lib/lshrdi3.S48
-rw-r--r--arch/arm/lib/lshrdi3.c56
-rw-r--r--arch/arm/lib/muldi3.S44
-rw-r--r--arch/arm/lib/muldi3.c72
-rw-r--r--arch/arm/lib/ucmpdi2.S35
-rw-r--r--arch/arm/lib/ucmpdi2.c49
-rw-r--r--arch/arm/mach-imx/generic.c2
-rw-r--r--arch/arm/mach-integrator/clock.c1
-rw-r--r--arch/arm/mach-integrator/integrator_ap.c1
-rw-r--r--arch/arm/mach-integrator/lm.c1
-rw-r--r--arch/arm/mach-iop3xx/iq31244-pci.c2
-rw-r--r--arch/arm/mach-iop3xx/iq80321-pci.c2
-rw-r--r--arch/arm/mach-iop3xx/iq80331-pci.c2
-rw-r--r--arch/arm/mach-iop3xx/iq80332-pci.c2
-rw-r--r--arch/arm/mach-pxa/corgi.c20
-rw-r--r--arch/arm/mach-pxa/generic.c1
-rw-r--r--arch/arm/mach-pxa/poodle.c21
-rw-r--r--arch/arm/mach-pxa/spitz.c19
-rw-r--r--arch/arm/mach-sa1100/generic.c3
-rw-r--r--arch/arm/mach-sa1100/jornada720.c64
-rw-r--r--arch/arm/mach-versatile/clock.c1
-rw-r--r--arch/arm/mm/consistent.c6
-rw-r--r--arch/arm/mm/copypage-v6.c16
-rw-r--r--arch/arm/mm/fault-armv.c7
-rw-r--r--arch/arm/mm/init.c30
-rw-r--r--arch/arm/mm/ioremap.c4
-rw-r--r--arch/arm/mm/mm-armv.c15
-rw-r--r--arch/arm/oprofile/backtrace.c46
-rw-r--r--arch/arm/plat-omap/clock.c1
-rw-r--r--arch/arm26/kernel/ptrace.c2
-rw-r--r--arch/arm26/kernel/time.c4
-rw-r--r--arch/arm26/mm/memc.c18
-rw-r--r--arch/cris/arch-v10/drivers/axisflashmap.c1
-rw-r--r--arch/cris/arch-v32/drivers/axisflashmap.c1
-rw-r--r--arch/cris/arch-v32/mm/tlb.c6
-rw-r--r--arch/cris/kernel/time.c5
-rw-r--r--arch/cris/mm/ioremap.c4
-rw-r--r--arch/frv/kernel/ptrace.c2
-rw-r--r--arch/frv/kernel/time.c4
-rw-r--r--arch/frv/mm/dma-alloc.c5
-rw-r--r--arch/frv/mm/pgalloc.c4
-rw-r--r--arch/h8300/kernel/ptrace.c2
-rw-r--r--arch/h8300/kernel/time.c4
-rw-r--r--arch/i386/Kconfig310
-rw-r--r--arch/i386/Kconfig.cpu309
-rw-r--r--arch/i386/Makefile31
-rw-r--r--arch/i386/Makefile.cpu41
-rw-r--r--arch/i386/kernel/apic.c82
-rw-r--r--arch/i386/kernel/apm.c40
-rw-r--r--arch/i386/kernel/cpu/common.c15
-rw-r--r--arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c1
-rw-r--r--arch/i386/kernel/cpu/cpufreq/p4-clockmod.c1
-rw-r--r--arch/i386/kernel/cpu/cpufreq/powernow-k8.c1
-rw-r--r--arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c1
-rw-r--r--arch/i386/kernel/cpu/intel_cacheinfo.c87
-rw-r--r--arch/i386/kernel/cpu/mcheck/p6.c11
-rw-r--r--arch/i386/kernel/cpu/mtrr/if.c119
-rw-r--r--arch/i386/kernel/cpu/proc.c2
-rw-r--r--arch/i386/kernel/crash.c7
-rw-r--r--arch/i386/kernel/i8259.c4
-rw-r--r--arch/i386/kernel/io_apic.c153
-rw-r--r--arch/i386/kernel/irq.c8
-rw-r--r--arch/i386/kernel/mpparse.c41
-rw-r--r--arch/i386/kernel/nmi.c39
-rw-r--r--arch/i386/kernel/ptrace.c2
-rw-r--r--arch/i386/kernel/reboot_fixups.c2
-rw-r--r--arch/i386/kernel/setup.c24
-rw-r--r--arch/i386/kernel/smpboot.c72
-rw-r--r--arch/i386/kernel/srat.c7
-rw-r--r--arch/i386/kernel/time.c16
-rw-r--r--arch/i386/kernel/time_hpet.c20
-rw-r--r--arch/i386/kernel/timers/timer_hpet.c17
-rw-r--r--arch/i386/kernel/timers/timer_tsc.c21
-rw-r--r--arch/i386/kernel/traps.c1
-rw-r--r--arch/i386/kernel/vm86.c17
-rw-r--r--arch/i386/mach-es7000/es7000.h11
-rw-r--r--arch/i386/mach-es7000/es7000plat.c11
-rw-r--r--arch/i386/mm/discontig.c4
-rw-r--r--arch/i386/mm/fault.c2
-rw-r--r--arch/i386/mm/init.c62
-rw-r--r--arch/i386/mm/ioremap.c4
-rw-r--r--arch/i386/mm/pgtable.c11
-rw-r--r--arch/i386/oprofile/backtrace.c38
-rw-r--r--arch/i386/pci/irq.c55
-rw-r--r--arch/i386/power/cpu.c12
-rw-r--r--arch/ia64/ia32/sys_ia32.c1
-rw-r--r--arch/ia64/kernel/cyclone.c1
-rw-r--r--arch/ia64/kernel/perfmon.c3
-rw-r--r--arch/ia64/kernel/time.c4
-rw-r--r--arch/ia64/mm/discontig.c7
-rw-r--r--arch/ia64/mm/fault.c34
-rw-r--r--arch/ia64/mm/init.c13
-rw-r--r--arch/ia64/mm/tlb.c2
-rw-r--r--arch/m32r/kernel/entry.S2
-rw-r--r--arch/m32r/kernel/io_m32700ut.c6
-rw-r--r--arch/m32r/kernel/io_mappi.c2
-rw-r--r--arch/m32r/kernel/io_mappi2.c11
-rw-r--r--arch/m32r/kernel/io_mappi3.c7
-rw-r--r--arch/m32r/kernel/io_oaks32r.c2
-rw-r--r--arch/m32r/kernel/io_opsput.c8
-rw-r--r--arch/m32r/kernel/io_usrv.c2
-rw-r--r--arch/m32r/kernel/ptrace.c2
-rw-r--r--arch/m32r/kernel/setup.c24
-rw-r--r--arch/m32r/kernel/time.c4
-rw-r--r--arch/m32r/lib/csum_partial_copy.c2
-rw-r--r--arch/m32r/mm/init.c9
-rw-r--r--arch/m32r/mm/ioremap.c4
-rw-r--r--arch/m68k/Kconfig24
-rw-r--r--arch/m68k/atari/stram.c918
-rw-r--r--arch/m68k/kernel/ptrace.c2
-rw-r--r--arch/m68k/kernel/time.c4
-rw-r--r--arch/m68k/mm/kmap.c2
-rw-r--r--arch/m68k/sun3x/dvma.c2
-rw-r--r--arch/m68knommu/kernel/ptrace.c2
-rw-r--r--arch/m68knommu/kernel/time.c4
-rw-r--r--arch/mips/Kconfig1510
-rw-r--r--arch/mips/Makefile118
-rw-r--r--arch/mips/arc/Makefile2
-rw-r--r--arch/mips/arc/identify.c5
-rw-r--r--arch/mips/au1000/common/Makefile2
-rw-r--r--arch/mips/au1000/common/au1xxx_irqmap.c32
-rw-r--r--arch/mips/au1000/common/cputable.c3
-rw-r--r--arch/mips/au1000/common/dbdma.c319
-rw-r--r--arch/mips/au1000/common/dma.c1
-rw-r--r--arch/mips/au1000/common/gpio.c119
-rw-r--r--arch/mips/au1000/common/irq.c105
-rw-r--r--arch/mips/au1000/common/platform.c249
-rw-r--r--arch/mips/au1000/common/power.c19
-rw-r--r--arch/mips/au1000/common/prom.c3
-rw-r--r--arch/mips/au1000/common/puts.c77
-rw-r--r--arch/mips/au1000/common/setup.c12
-rw-r--r--arch/mips/au1000/common/time.c26
-rw-r--r--arch/mips/au1000/common/usbdev.c12
-rw-r--r--arch/mips/au1000/csb250/init.c1
-rw-r--r--arch/mips/au1000/db1x00/irqmap.c32
-rw-r--r--arch/mips/au1000/db1x00/mirage_ts.c16
-rw-r--r--arch/mips/au1000/hydrogen3/init.c1
-rw-r--r--arch/mips/au1000/mtx-1/init.c1
-rw-r--r--arch/mips/au1000/mtx-1/irqmap.c11
-rw-r--r--arch/mips/au1000/pb1000/init.c1
-rw-r--r--arch/mips/au1000/pb1200/Makefile5
-rw-r--r--arch/mips/au1000/pb1200/board_setup.c193
-rw-r--r--arch/mips/au1000/pb1200/init.c69
-rw-r--r--arch/mips/au1000/pb1200/irqmap.c182
-rw-r--r--arch/mips/au1000/pb1500/irqmap.c5
-rw-r--r--arch/mips/au1000/pb1550/irqmap.c5
-rw-r--r--arch/mips/boot/Makefile4
-rw-r--r--arch/mips/cobalt/Makefile2
-rw-r--r--arch/mips/cobalt/int-handler.S4
-rw-r--r--arch/mips/cobalt/irq.c111
-rw-r--r--arch/mips/cobalt/promcon.c87
-rw-r--r--arch/mips/cobalt/reset.c59
-rw-r--r--arch/mips/cobalt/setup.c104
-rw-r--r--arch/mips/configs/atlas_defconfig660
-rw-r--r--arch/mips/configs/bigsur_defconfig881
-rw-r--r--arch/mips/configs/capcella_defconfig450
-rw-r--r--arch/mips/configs/cobalt_defconfig367
-rw-r--r--arch/mips/configs/db1000_defconfig498
-rw-r--r--arch/mips/configs/db1100_defconfig558
-rw-r--r--arch/mips/configs/db1200_defconfig987
-rw-r--r--arch/mips/configs/db1500_defconfig459
-rw-r--r--arch/mips/configs/db1550_defconfig441
-rw-r--r--arch/mips/configs/ddb5476_defconfig389
-rw-r--r--arch/mips/configs/ddb5477_defconfig377
-rw-r--r--arch/mips/configs/decstation_defconfig463
-rw-r--r--arch/mips/configs/e55_defconfig403
-rw-r--r--arch/mips/configs/ev64120_defconfig376
-rw-r--r--arch/mips/configs/ev96100_defconfig359
-rw-r--r--arch/mips/configs/ip22_defconfig479
-rw-r--r--arch/mips/configs/ip27_defconfig466
-rw-r--r--arch/mips/configs/ip32_defconfig390
-rw-r--r--arch/mips/configs/it8172_defconfig372
-rw-r--r--arch/mips/configs/ivr_defconfig376
-rw-r--r--arch/mips/configs/jaguar-atx_defconfig339
-rw-r--r--arch/mips/configs/jmr3927_defconfig388
-rw-r--r--arch/mips/configs/lasat200_defconfig378
-rw-r--r--arch/mips/configs/malta_defconfig724
-rw-r--r--arch/mips/configs/mipssim_defconfig775
-rw-r--r--arch/mips/configs/mpc30x_defconfig607
-rw-r--r--arch/mips/configs/ocelot_3_defconfig457
-rw-r--r--arch/mips/configs/ocelot_c_defconfig372
-rw-r--r--arch/mips/configs/ocelot_defconfig359
-rw-r--r--arch/mips/configs/ocelot_g_defconfig372
-rw-r--r--arch/mips/configs/pb1100_defconfig434
-rw-r--r--arch/mips/configs/pb1500_defconfig512
-rw-r--r--arch/mips/configs/pb1550_defconfig508
-rw-r--r--arch/mips/configs/pnx8550-jbs_defconfig1069
-rw-r--r--arch/mips/configs/pnx8550-v2pci_defconfig1251
-rw-r--r--arch/mips/configs/qemu_defconfig106
-rw-r--r--arch/mips/configs/rbhma4500_defconfig1259
-rw-r--r--arch/mips/configs/rm200_defconfig801
-rw-r--r--arch/mips/configs/sb1250-swarm_defconfig397
-rw-r--r--arch/mips/configs/sead_defconfig234
-rw-r--r--arch/mips/configs/tb0226_defconfig684
-rw-r--r--arch/mips/configs/tb0229_defconfig541
-rw-r--r--arch/mips/configs/tb0287_defconfig170
-rw-r--r--arch/mips/configs/workpad_defconfig416
-rw-r--r--arch/mips/configs/yosemite_defconfig346
-rw-r--r--arch/mips/ddb5xxx/Kconfig4
-rw-r--r--arch/mips/ddb5xxx/ddb5074/nile4_pic.c15
-rw-r--r--arch/mips/ddb5xxx/ddb5074/setup.c4
-rw-r--r--arch/mips/ddb5xxx/ddb5476/setup.c4
-rw-r--r--arch/mips/ddb5xxx/ddb5476/vrc5476_irq.c15
-rw-r--r--arch/mips/ddb5xxx/ddb5477/irq_5477.c15
-rw-r--r--arch/mips/ddb5xxx/ddb5477/setup.c6
-rw-r--r--arch/mips/dec/Makefile4
-rw-r--r--arch/mips/dec/ecc-berr.c48
-rw-r--r--arch/mips/dec/int-handler.S18
-rw-r--r--arch/mips/dec/kn01-berr.c201
-rw-r--r--arch/mips/dec/kn02-irq.c13
-rw-r--r--arch/mips/dec/kn02xa-berr.c139
-rw-r--r--arch/mips/dec/prom/identify.c28
-rw-r--r--arch/mips/dec/prom/init.c16
-rw-r--r--arch/mips/dec/prom/memory.c14
-rw-r--r--arch/mips/dec/reset.c2
-rw-r--r--arch/mips/dec/setup.c57
-rw-r--r--arch/mips/defconfig479
-rw-r--r--arch/mips/galileo-boards/ev96100/setup.c4
-rw-r--r--arch/mips/gt64120/ev64120/Kconfig3
-rw-r--r--arch/mips/gt64120/ev64120/setup.c4
-rw-r--r--arch/mips/gt64120/momenco_ocelot/setup.c4
-rw-r--r--arch/mips/ite-boards/Kconfig8
-rw-r--r--arch/mips/ite-boards/generic/irq.c30
-rw-r--r--arch/mips/ite-boards/generic/it8172_setup.c4
-rw-r--r--arch/mips/jazz/Kconfig33
-rw-r--r--arch/mips/jazz/irq.c15
-rw-r--r--arch/mips/jazz/setup.c4
-rw-r--r--arch/mips/jmr3927/rbhma3100/irq.c14
-rw-r--r--arch/mips/jmr3927/rbhma3100/setup.c38
-rw-r--r--arch/mips/kernel/Makefile14
-rw-r--r--arch/mips/kernel/asm-offsets.c25
-rw-r--r--arch/mips/kernel/binfmt_elfn32.c4
-rw-r--r--arch/mips/kernel/binfmt_elfo32.c35
-rw-r--r--arch/mips/kernel/branch.c29
-rw-r--r--arch/mips/kernel/cpu-probe.c256
-rw-r--r--arch/mips/kernel/dma-no-isa.c28
-rw-r--r--arch/mips/kernel/entry.S54
-rw-r--r--arch/mips/kernel/gdb-low.S5
-rw-r--r--arch/mips/kernel/gdb-stub.c23
-rw-r--r--arch/mips/kernel/genex.S44
-rw-r--r--arch/mips/kernel/genrtc.c64
-rw-r--r--arch/mips/kernel/head.S70
-rw-r--r--arch/mips/kernel/i8259.c21
-rw-r--r--arch/mips/kernel/ioctl32.c6
-rw-r--r--arch/mips/kernel/irixelf.c254
-rw-r--r--arch/mips/kernel/irixinv.c7
-rw-r--r--arch/mips/kernel/irixioctl.c63
-rw-r--r--arch/mips/kernel/irixsig.c408
-rw-r--r--arch/mips/kernel/irq-msc01.c38
-rw-r--r--arch/mips/kernel/irq-mv6434x.c15
-rw-r--r--arch/mips/kernel/irq-rm7000.c14
-rw-r--r--arch/mips/kernel/irq-rm9000.c28
-rw-r--r--arch/mips/kernel/irq_cpu.c91
-rw-r--r--arch/mips/kernel/linux32.c164
-rw-r--r--arch/mips/kernel/module-elf32.c250
-rw-r--r--arch/mips/kernel/module-elf64.c274
-rw-r--r--arch/mips/kernel/module.c336
-rw-r--r--arch/mips/kernel/proc.c135
-rw-r--r--arch/mips/kernel/process.c213
-rw-r--r--arch/mips/kernel/ptrace.c244
-rw-r--r--arch/mips/kernel/ptrace32.c150
-rw-r--r--arch/mips/kernel/r4k_fpu.S5
-rw-r--r--arch/mips/kernel/rtlx.c341
-rw-r--r--arch/mips/kernel/scall32-o32.S13
-rw-r--r--arch/mips/kernel/scall64-64.S4
-rw-r--r--arch/mips/kernel/scall64-n32.S32
-rw-r--r--arch/mips/kernel/scall64-o32.S14
-rw-r--r--arch/mips/kernel/semaphore.c12
-rw-r--r--arch/mips/kernel/setup.c46
-rw-r--r--arch/mips/kernel/signal-common.h90
-rw-r--r--arch/mips/kernel/signal.c143
-rw-r--r--arch/mips/kernel/signal32.c114
-rw-r--r--arch/mips/kernel/signal_n32.c37
-rw-r--r--arch/mips/kernel/smp.c51
-rw-r--r--arch/mips/kernel/smp_mt.c366
-rw-r--r--arch/mips/kernel/syscall.c34
-rw-r--r--arch/mips/kernel/sysirix.c539
-rw-r--r--arch/mips/kernel/time.c16
-rw-r--r--arch/mips/kernel/traps.c499
-rw-r--r--arch/mips/kernel/unaligned.c10
-rw-r--r--arch/mips/kernel/vmlinux.lds.S13
-rw-r--r--arch/mips/kernel/vpe.c1296
-rw-r--r--arch/mips/lasat/Kconfig15
-rw-r--r--arch/mips/lasat/interrupt.c15
-rw-r--r--arch/mips/lasat/setup.c6
-rw-r--r--arch/mips/lib-32/dump_tlb.c106
-rw-r--r--arch/mips/lib-32/r3k_dump_tlb.c10
-rw-r--r--arch/mips/lib-64/dump_tlb.c10
-rw-r--r--arch/mips/lib/Makefile4
-rw-r--r--arch/mips/lib/csum_partial_copy.c8
-rw-r--r--arch/mips/lib/memcpy.S15
-rw-r--r--arch/mips/lib/uncached.c76
-rw-r--r--arch/mips/math-emu/cp1emu.c229
-rw-r--r--arch/mips/math-emu/dp_sqrt.c2
-rw-r--r--arch/mips/math-emu/dsemul.c17
-rw-r--r--arch/mips/math-emu/dsemul.h10
-rw-r--r--arch/mips/math-emu/ieee754.c16
-rw-r--r--arch/mips/math-emu/ieee754.h180
-rw-r--r--arch/mips/math-emu/kernel_linkage.c6
-rw-r--r--arch/mips/mips-boards/atlas/atlas_int.c15
-rw-r--r--arch/mips/mips-boards/atlas/atlas_setup.c8
-rw-r--r--arch/mips/mips-boards/generic/init.c91
-rw-r--r--arch/mips/mips-boards/generic/memory.c29
-rw-r--r--arch/mips/mips-boards/generic/mipsIRQ.S110
-rw-r--r--arch/mips/mips-boards/generic/pci.c167
-rw-r--r--arch/mips/mips-boards/generic/time.c88
-rw-r--r--arch/mips/mips-boards/malta/malta_int.c153
-rw-r--r--arch/mips/mips-boards/malta/malta_setup.c8
-rw-r--r--arch/mips/mips-boards/sead/sead_int.c12
-rw-r--r--arch/mips/mips-boards/sead/sead_setup.c2
-rw-r--r--arch/mips/mips-boards/sim/Makefile20
-rw-r--r--arch/mips/mips-boards/sim/cmdline.c59
-rw-r--r--arch/mips/mips-boards/sim/sim_IRQ.c148
-rw-r--r--arch/mips/mips-boards/sim/sim_cmdline.c33
-rw-r--r--arch/mips/mips-boards/sim/sim_int.c41
-rw-r--r--arch/mips/mips-boards/sim/sim_irq.S99
-rw-r--r--arch/mips/mips-boards/sim/sim_mem.c129
-rw-r--r--arch/mips/mips-boards/sim/sim_printf.c74
-rw-r--r--arch/mips/mips-boards/sim/sim_setup.c101
-rw-r--r--arch/mips/mips-boards/sim/sim_smp.c151
-rw-r--r--arch/mips/mips-boards/sim/sim_time.c215
-rw-r--r--arch/mips/mm/Makefile2
-rw-r--r--arch/mips/mm/c-r3k.c6
-rw-r--r--arch/mips/mm/c-r4k.c145
-rw-r--r--arch/mips/mm/c-sb1.c10
-rw-r--r--arch/mips/mm/c-tx39.c16
-rw-r--r--arch/mips/mm/cache.c106
-rw-r--r--arch/mips/mm/cerr-sb1.c54
-rw-r--r--arch/mips/mm/cex-sb1.S5
-rw-r--r--arch/mips/mm/dma-coherent.c2
-rw-r--r--arch/mips/mm/dma-noncoherent.c46
-rw-r--r--arch/mips/mm/fault.c17
-rw-r--r--arch/mips/mm/highmem.c19
-rw-r--r--arch/mips/mm/init.c34
-rw-r--r--arch/mips/mm/ioremap.c32
-rw-r--r--arch/mips/mm/pg-r4k.c21
-rw-r--r--arch/mips/mm/pg-sb1.c65
-rw-r--r--arch/mips/mm/pgtable-32.c36
-rw-r--r--arch/mips/mm/sc-rm7k.c39
-rw-r--r--arch/mips/mm/tlb-andes.c4
-rw-r--r--arch/mips/mm/tlb-r4k.c70
-rw-r--r--arch/mips/mm/tlb-sb1.c376
-rw-r--r--arch/mips/mm/tlbex.c245
-rw-r--r--arch/mips/momentum/Kconfig6
-rw-r--r--arch/mips/momentum/jaguar_atx/prom.c3
-rw-r--r--arch/mips/momentum/jaguar_atx/setup.c6
-rw-r--r--arch/mips/momentum/ocelot_3/prom.c3
-rw-r--r--arch/mips/momentum/ocelot_3/setup.c6
-rw-r--r--arch/mips/momentum/ocelot_c/cpci-irq.c15
-rw-r--r--arch/mips/momentum/ocelot_c/setup.c4
-rw-r--r--arch/mips/momentum/ocelot_c/uart-irq.c15
-rw-r--r--arch/mips/momentum/ocelot_g/setup.c6
-rw-r--r--arch/mips/oprofile/Kconfig2
-rw-r--r--arch/mips/oprofile/common.c28
-rw-r--r--arch/mips/oprofile/op_impl.h5
-rw-r--r--arch/mips/oprofile/op_model_mipsxx.c215
-rw-r--r--arch/mips/oprofile/op_model_rm9000.c3
-rw-r--r--arch/mips/pci/Makefile3
-rw-r--r--arch/mips/pci/fixup-atlas.c41
-rw-r--r--arch/mips/pci/fixup-au1000.c78
-rw-r--r--arch/mips/pci/fixup-cobalt.c55
-rw-r--r--arch/mips/pci/fixup-pnx8550.c57
-rw-r--r--arch/mips/pci/fixup-tx4938.c92
-rw-r--r--arch/mips/pci/ops-au1000.c14
-rw-r--r--arch/mips/pci/ops-bonito64.c14
-rw-r--r--arch/mips/pci/ops-gt64111.c10
-rw-r--r--arch/mips/pci/ops-gt64120.c10
-rw-r--r--arch/mips/pci/ops-msc.c31
-rw-r--r--arch/mips/pci/ops-nile4.c2
-rw-r--r--arch/mips/pci/ops-pnx8550.c284
-rw-r--r--arch/mips/pci/ops-tx4938.c198
-rw-r--r--arch/mips/pci/pci-bcm1480.c265
-rw-r--r--arch/mips/pci/pci-bcm1480ht.c224
-rw-r--r--arch/mips/pci/pci-ip27.c7
-rw-r--r--arch/mips/pci/pci-ip32.c4
-rw-r--r--arch/mips/pci/pci-lasat.c56
-rw-r--r--arch/mips/pci/pci.c19
-rw-r--r--arch/mips/philips/pnx8550/common/Kconfig1
-rw-r--r--arch/mips/philips/pnx8550/common/Makefile27
-rw-r--r--arch/mips/philips/pnx8550/common/gdb_hook.c109
-rw-r--r--arch/mips/philips/pnx8550/common/int.c293
-rw-r--r--arch/mips/philips/pnx8550/common/mipsIRQ.S76
-rw-r--r--arch/mips/philips/pnx8550/common/pci.c133
-rw-r--r--arch/mips/philips/pnx8550/common/platform.c135
-rw-r--r--arch/mips/philips/pnx8550/common/proc.c113
-rw-r--r--arch/mips/philips/pnx8550/common/prom.c138
-rw-r--r--arch/mips/philips/pnx8550/common/reset.c49
-rw-r--r--arch/mips/philips/pnx8550/common/setup.c149
-rw-r--r--arch/mips/philips/pnx8550/common/time.c105
-rw-r--r--arch/mips/philips/pnx8550/jbs/Makefile4
-rw-r--r--arch/mips/philips/pnx8550/jbs/board_setup.c65
-rw-r--r--arch/mips/philips/pnx8550/jbs/init.c57
-rw-r--r--arch/mips/philips/pnx8550/jbs/irqmap.c36
-rw-r--r--arch/mips/pmc-sierra/Kconfig3
-rw-r--r--arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.h1
-rw-r--r--arch/mips/pmc-sierra/yosemite/ht-irq.c1
-rw-r--r--arch/mips/pmc-sierra/yosemite/ht.c1
-rw-r--r--arch/mips/pmc-sierra/yosemite/prom.c3
-rw-r--r--arch/mips/pmc-sierra/yosemite/setup.c6
-rw-r--r--arch/mips/pmc-sierra/yosemite/smp.c2
-rw-r--r--arch/mips/qemu/q-setup.c5
-rw-r--r--arch/mips/sgi-ip22/ip22-eisa.c148
-rw-r--r--arch/mips/sgi-ip22/ip22-setup.c6
-rw-r--r--arch/mips/sgi-ip27/Kconfig54
-rw-r--r--arch/mips/sgi-ip27/ip27-berr.c1
-rw-r--r--arch/mips/sgi-ip27/ip27-console.c4
-rw-r--r--arch/mips/sgi-ip27/ip27-init.c50
-rw-r--r--arch/mips/sgi-ip27/ip27-irq.c66
-rw-r--r--arch/mips/sgi-ip27/ip27-smp.c25
-rw-r--r--arch/mips/sgi-ip32/ip32-irq.c75
-rw-r--r--arch/mips/sgi-ip32/ip32-memory.c4
-rw-r--r--arch/mips/sgi-ip32/ip32-setup.c6
-rw-r--r--arch/mips/sibyte/Kconfig161
-rw-r--r--arch/mips/sibyte/bcm1480/Makefile5
-rw-r--r--arch/mips/sibyte/bcm1480/irq.c476
-rw-r--r--arch/mips/sibyte/bcm1480/irq_handler.S165
-rw-r--r--arch/mips/sibyte/bcm1480/setup.c136
-rw-r--r--arch/mips/sibyte/bcm1480/smp.c110
-rw-r--r--arch/mips/sibyte/bcm1480/time.c138
-rw-r--r--arch/mips/sibyte/cfe/smp.c14
-rw-r--r--arch/mips/sibyte/sb1250/bcm1250_tbprof.c154
-rw-r--r--arch/mips/sibyte/sb1250/bus_watcher.c2
-rw-r--r--arch/mips/sibyte/sb1250/irq.c121
-rw-r--r--arch/mips/sibyte/sb1250/setup.c4
-rw-r--r--arch/mips/sibyte/sb1250/smp.c18
-rw-r--r--arch/mips/sibyte/sb1250/time.c44
-rw-r--r--arch/mips/sibyte/swarm/rtc_m41t81.c47
-rw-r--r--arch/mips/sibyte/swarm/rtc_xicor1241.c42
-rw-r--r--arch/mips/sibyte/swarm/setup.c41
-rw-r--r--arch/mips/sibyte/swarm/time.c44
-rw-r--r--arch/mips/sni/irq.c15
-rw-r--r--arch/mips/sni/setup.c6
-rw-r--r--arch/mips/tx4927/Kconfig3
-rw-r--r--arch/mips/tx4927/common/tx4927_setup.c6
-rw-r--r--arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c23
-rw-r--r--arch/mips/tx4938/Kconfig24
-rw-r--r--arch/mips/tx4938/common/Makefile11
-rw-r--r--arch/mips/tx4938/common/dbgio.c50
-rw-r--r--arch/mips/tx4938/common/irq.c424
-rw-r--r--arch/mips/tx4938/common/irq_handler.S84
-rw-r--r--arch/mips/tx4938/common/prom.c129
-rw-r--r--arch/mips/tx4938/common/rtc_rx5c348.c202
-rw-r--r--arch/mips/tx4938/common/setup.c91
-rw-r--r--arch/mips/tx4938/toshiba_rbtx4938/Makefile9
-rw-r--r--arch/mips/tx4938/toshiba_rbtx4938/irq.c244
-rw-r--r--arch/mips/tx4938/toshiba_rbtx4938/prom.c78
-rw-r--r--arch/mips/tx4938/toshiba_rbtx4938/setup.c1035
-rw-r--r--arch/mips/tx4938/toshiba_rbtx4938/spi_eeprom.c219
-rw-r--r--arch/mips/tx4938/toshiba_rbtx4938/spi_txx9.c159
-rw-r--r--arch/mips/vr41xx/Kconfig88
-rw-r--r--arch/mips/vr41xx/common/cmu.c2
-rw-r--r--arch/mips/vr41xx/common/init.c14
-rw-r--r--arch/mips/vr41xx/common/vrc4173.c4
-rw-r--r--arch/mips/vr41xx/nec-cmbvr4133/setup.c5
-rw-r--r--arch/parisc/kernel/cache.c24
-rw-r--r--arch/parisc/kernel/ioctl32.c5
-rw-r--r--arch/parisc/kernel/pci-dma.c2
-rw-r--r--arch/parisc/kernel/ptrace.c2
-rw-r--r--arch/parisc/kernel/time.c4
-rw-r--r--arch/parisc/mm/init.c3
-rw-r--r--arch/parisc/mm/ioremap.c6
-rw-r--r--arch/powerpc/Kconfig900
-rw-r--r--arch/powerpc/Kconfig.debug128
-rw-r--r--arch/powerpc/Makefile222
-rw-r--r--arch/powerpc/kernel/Makefile56
-rw-r--r--arch/powerpc/kernel/asm-offsets.c273
-rw-r--r--arch/powerpc/kernel/binfmt_elf32.c (renamed from arch/ppc64/kernel/binfmt_elf32.c)3
-rw-r--r--arch/powerpc/kernel/btext.c853
-rw-r--r--arch/powerpc/kernel/cputable.c (renamed from arch/ppc/kernel/cputable.c)797
-rw-r--r--arch/powerpc/kernel/entry_32.S1000
-rw-r--r--arch/powerpc/kernel/entry_64.S (renamed from arch/ppc64/kernel/entry.S)47
-rw-r--r--arch/powerpc/kernel/fpu.S (renamed from arch/ppc/kernel/fpu.S)105
-rw-r--r--arch/powerpc/kernel/head_32.S1381
-rw-r--r--arch/powerpc/kernel/head_44x.S782
-rw-r--r--arch/powerpc/kernel/head_4xx.S1022
-rw-r--r--arch/powerpc/kernel/head_64.S1957
-rw-r--r--arch/powerpc/kernel/head_8xx.S860
-rw-r--r--arch/powerpc/kernel/head_fsl_booke.S1063
-rw-r--r--arch/powerpc/kernel/idle_6xx.S233
-rw-r--r--arch/powerpc/kernel/idle_power4.S (renamed from arch/ppc64/kernel/idle_power4.S)9
-rw-r--r--arch/powerpc/kernel/init_task.c (renamed from arch/ppc64/kernel/init_task.c)0
-rw-r--r--arch/powerpc/kernel/lparmap.c (renamed from arch/ppc64/kernel/lparmap.c)0
-rw-r--r--arch/powerpc/kernel/misc_32.S1037
-rw-r--r--arch/powerpc/kernel/misc_64.S880
-rw-r--r--arch/powerpc/kernel/of_device.c (renamed from arch/ppc64/kernel/of_device.c)6
-rw-r--r--arch/powerpc/kernel/pmc.c (renamed from arch/ppc64/kernel/pmc.c)30
-rw-r--r--arch/powerpc/kernel/ppc_ksyms.c273
-rw-r--r--arch/powerpc/kernel/process.c (renamed from arch/ppc64/kernel/process.c)486
-rw-r--r--arch/powerpc/kernel/prom.c2170
-rw-r--r--arch/powerpc/kernel/prom_init.c2109
-rw-r--r--arch/powerpc/kernel/ptrace.c (renamed from arch/ppc/kernel/ptrace.c)172
-rw-r--r--arch/powerpc/kernel/ptrace32.c (renamed from arch/ppc64/kernel/ptrace32.c)9
-rw-r--r--arch/powerpc/kernel/rtas.c (renamed from arch/ppc64/kernel/rtas.c)254
-rw-r--r--arch/powerpc/kernel/semaphore.c135
-rw-r--r--arch/powerpc/kernel/setup-common.c410
-rw-r--r--arch/powerpc/kernel/setup_32.c372
-rw-r--r--arch/powerpc/kernel/setup_64.c (renamed from arch/ppc64/kernel/setup.c)352
-rw-r--r--arch/powerpc/kernel/signal_32.c (renamed from arch/ppc64/kernel/signal32.c)993
-rw-r--r--arch/powerpc/kernel/sys_ppc32.c (renamed from arch/ppc64/kernel/sys_ppc32.c)320
-rw-r--r--arch/powerpc/kernel/syscalls.c (renamed from arch/ppc64/kernel/syscalls.c)187
-rw-r--r--arch/powerpc/kernel/systbl.S321
-rw-r--r--arch/powerpc/kernel/time.c (renamed from arch/ppc64/kernel/time.c)574
-rw-r--r--arch/powerpc/kernel/traps.c1101
-rw-r--r--arch/powerpc/kernel/vecemu.c (renamed from arch/ppc/kernel/vecemu.c)0
-rw-r--r--arch/powerpc/kernel/vector.S (renamed from arch/ppc64/kernel/vector.S)71
-rw-r--r--arch/powerpc/kernel/vio.c (renamed from arch/ppc64/kernel/vio.c)14
-rw-r--r--arch/powerpc/kernel/vmlinux.lds.S279
-rw-r--r--arch/powerpc/lib/Makefile19
-rw-r--r--arch/powerpc/lib/checksum_32.S225
-rw-r--r--arch/powerpc/lib/checksum_64.S (renamed from arch/ppc64/lib/checksum.S)0
-rw-r--r--arch/powerpc/lib/copy_32.S543
-rw-r--r--arch/powerpc/lib/copypage_64.S (renamed from arch/ppc64/lib/copypage.S)0
-rw-r--r--arch/powerpc/lib/copyuser_64.S (renamed from arch/ppc64/lib/copyuser.S)0
-rw-r--r--arch/powerpc/lib/div64.S59
-rw-r--r--arch/powerpc/lib/e2a.c (renamed from arch/ppc64/lib/e2a.c)0
-rw-r--r--arch/powerpc/lib/locks.c (renamed from arch/ppc64/lib/locks.c)5
-rw-r--r--arch/powerpc/lib/mem_64.S119
-rw-r--r--arch/powerpc/lib/memcpy_64.S (renamed from arch/ppc64/lib/memcpy.S)0
-rw-r--r--arch/powerpc/lib/rheap.c693
-rw-r--r--arch/powerpc/lib/sstep.c (renamed from arch/ppc64/lib/sstep.c)17
-rw-r--r--arch/powerpc/lib/strcase.c (renamed from arch/ppc64/lib/strcase.c)8
-rw-r--r--arch/powerpc/lib/string.S198
-rw-r--r--arch/powerpc/lib/usercopy_64.c (renamed from arch/ppc64/lib/usercopy.c)0
-rw-r--r--arch/powerpc/mm/44x_mmu.c120
-rw-r--r--arch/powerpc/mm/4xx_mmu.c141
-rw-r--r--arch/powerpc/mm/Makefile21
-rw-r--r--arch/powerpc/mm/fault.c (renamed from arch/ppc64/mm/fault.c)104
-rw-r--r--arch/powerpc/mm/fsl_booke_mmu.c237
-rw-r--r--arch/powerpc/mm/hash_low_32.S618
-rw-r--r--arch/powerpc/mm/hash_low_64.S (renamed from arch/ppc64/mm/hash_low.S)2
-rw-r--r--arch/powerpc/mm/hash_native_64.c (renamed from arch/ppc64/mm/hash_native.c)13
-rw-r--r--arch/powerpc/mm/hash_utils_64.c (renamed from arch/ppc64/mm/hash_utils.c)61
-rw-r--r--arch/powerpc/mm/hugetlbpage.c (renamed from arch/ppc64/mm/hugetlbpage.c)0
-rw-r--r--arch/powerpc/mm/imalloc.c (renamed from arch/ppc64/mm/imalloc.c)5
-rw-r--r--arch/powerpc/mm/init_32.c254
-rw-r--r--arch/powerpc/mm/init_64.c223
-rw-r--r--arch/powerpc/mm/lmb.c (renamed from arch/ppc64/kernel/lmb.c)105
-rw-r--r--arch/powerpc/mm/mem.c564
-rw-r--r--arch/powerpc/mm/mmap.c (renamed from arch/ppc64/mm/mmap.c)0
-rw-r--r--arch/powerpc/mm/mmu_context_32.c86
-rw-r--r--arch/powerpc/mm/mmu_context_64.c63
-rw-r--r--arch/powerpc/mm/mmu_decl.h87
-rw-r--r--arch/powerpc/mm/numa.c (renamed from arch/ppc64/mm/numa.c)2
-rw-r--r--arch/powerpc/mm/pgtable_32.c467
-rw-r--r--arch/powerpc/mm/pgtable_64.c347
-rw-r--r--arch/powerpc/mm/ppc_mmu_32.c285
-rw-r--r--arch/powerpc/mm/slb.c (renamed from arch/ppc64/mm/slb.c)0
-rw-r--r--arch/powerpc/mm/slb_low.S (renamed from arch/ppc64/mm/slb_low.S)0
-rw-r--r--arch/powerpc/mm/stab.c (renamed from arch/ppc64/mm/stab.c)0
-rw-r--r--arch/powerpc/mm/tlb_32.c183
-rw-r--r--arch/powerpc/mm/tlb_64.c (renamed from arch/ppc64/mm/tlb.c)23
-rw-r--r--arch/powerpc/oprofile/Kconfig (renamed from arch/ppc/oprofile/Kconfig)0
-rw-r--r--arch/powerpc/oprofile/Makefile (renamed from arch/ppc/oprofile/Makefile)7
-rw-r--r--arch/powerpc/oprofile/common.c (renamed from arch/ppc64/oprofile/common.c)84
-rw-r--r--arch/powerpc/oprofile/op_model_fsl_booke.c (renamed from arch/ppc/oprofile/op_model_fsl_booke.c)7
-rw-r--r--arch/powerpc/oprofile/op_model_power4.c (renamed from arch/ppc64/oprofile/op_model_power4.c)2
-rw-r--r--arch/powerpc/oprofile/op_model_rs64.c (renamed from arch/ppc64/oprofile/op_model_rs64.c)2
-rw-r--r--arch/powerpc/platforms/4xx/Kconfig280
-rw-r--r--arch/powerpc/platforms/4xx/Makefile1
-rw-r--r--arch/powerpc/platforms/85xx/Kconfig86
-rw-r--r--arch/powerpc/platforms/85xx/Makefile1
-rw-r--r--arch/powerpc/platforms/8xx/Kconfig352
-rw-r--r--arch/powerpc/platforms/Makefile13
-rw-r--r--arch/powerpc/platforms/apus/Kconfig130
-rw-r--r--arch/powerpc/platforms/chrp/Makefile4
-rw-r--r--arch/powerpc/platforms/chrp/chrp.h12
-rw-r--r--arch/powerpc/platforms/chrp/nvram.c84
-rw-r--r--arch/powerpc/platforms/chrp/pci.c310
-rw-r--r--arch/powerpc/platforms/chrp/pegasos_eth.c213
-rw-r--r--arch/powerpc/platforms/chrp/setup.c522
-rw-r--r--arch/powerpc/platforms/chrp/smp.c122
-rw-r--r--arch/powerpc/platforms/chrp/time.c188
-rw-r--r--arch/powerpc/platforms/embedded6xx/Kconfig318
-rw-r--r--arch/powerpc/platforms/iseries/Kconfig31
-rw-r--r--arch/powerpc/platforms/iseries/Makefile9
-rw-r--r--arch/powerpc/platforms/iseries/call_hpt.h101
-rw-r--r--arch/powerpc/platforms/iseries/call_pci.h290
-rw-r--r--arch/powerpc/platforms/iseries/call_sm.h37
-rw-r--r--arch/powerpc/platforms/iseries/htab.c (renamed from arch/ppc64/kernel/iSeries_htab.c)47
-rw-r--r--arch/powerpc/platforms/iseries/hvcall.S (renamed from arch/ppc64/kernel/hvCall.S)22
-rw-r--r--arch/powerpc/platforms/iseries/hvlog.c (renamed from arch/ppc64/kernel/HvCall.c)1
-rw-r--r--arch/powerpc/platforms/iseries/hvlpconfig.c (renamed from arch/ppc64/kernel/HvLpConfig.c)1
-rw-r--r--arch/powerpc/platforms/iseries/iommu.c (renamed from arch/ppc64/kernel/iSeries_iommu.c)44
-rw-r--r--arch/powerpc/platforms/iseries/ipl_parms.h70
-rw-r--r--arch/powerpc/platforms/iseries/irq.c (renamed from arch/ppc64/kernel/iSeries_irq.c)17
-rw-r--r--arch/powerpc/platforms/iseries/irq.h8
-rw-r--r--arch/powerpc/platforms/iseries/ksyms.c27
-rw-r--r--arch/powerpc/platforms/iseries/lpardata.c (renamed from arch/ppc64/kernel/LparData.c)28
-rw-r--r--arch/powerpc/platforms/iseries/lpevents.c (renamed from arch/ppc64/kernel/ItLpQueue.c)77
-rw-r--r--arch/powerpc/platforms/iseries/main_store.h165
-rw-r--r--arch/powerpc/platforms/iseries/mf.c (renamed from arch/ppc64/kernel/mf.c)98
-rw-r--r--arch/powerpc/platforms/iseries/misc.S55
-rw-r--r--arch/powerpc/platforms/iseries/pci.c (renamed from arch/ppc64/kernel/iSeries_pci.c)173
-rw-r--r--arch/powerpc/platforms/iseries/pci.h63
-rw-r--r--arch/powerpc/platforms/iseries/proc.c (renamed from arch/ppc64/kernel/iSeries_proc.c)15
-rw-r--r--arch/powerpc/platforms/iseries/processor_vpd.h85
-rw-r--r--arch/powerpc/platforms/iseries/release_data.h63
-rw-r--r--arch/powerpc/platforms/iseries/setup.c (renamed from arch/ppc64/kernel/iSeries_setup.c)495
-rw-r--r--arch/powerpc/platforms/iseries/setup.h (renamed from arch/ppc64/kernel/iSeries_setup.h)4
-rw-r--r--arch/powerpc/platforms/iseries/smp.c (renamed from arch/ppc64/kernel/iSeries_smp.c)46
-rw-r--r--arch/powerpc/platforms/iseries/spcomm_area.h36
-rw-r--r--arch/powerpc/platforms/iseries/vio.c (renamed from arch/ppc64/kernel/iSeries_vio.c)1
-rw-r--r--arch/powerpc/platforms/iseries/viopath.c (renamed from arch/ppc64/kernel/viopath.c)3
-rw-r--r--arch/powerpc/platforms/iseries/vpd_areas.h88
-rw-r--r--arch/powerpc/platforms/iseries/vpdinfo.c (renamed from arch/ppc64/kernel/iSeries_VpdInfo.c)21
-rw-r--r--arch/powerpc/platforms/maple/Makefile1
-rw-r--r--arch/powerpc/platforms/maple/maple.h12
-rw-r--r--arch/powerpc/platforms/maple/pci.c (renamed from arch/ppc64/kernel/maple_pci.c)7
-rw-r--r--arch/powerpc/platforms/maple/setup.c (renamed from arch/ppc64/kernel/maple_setup.c)13
-rw-r--r--arch/powerpc/platforms/maple/time.c (renamed from arch/ppc64/kernel/maple_time.c)9
-rw-r--r--arch/powerpc/platforms/powermac/Makefile8
-rw-r--r--arch/powerpc/platforms/powermac/backlight.c202
-rw-r--r--arch/powerpc/platforms/powermac/cache.S359
-rw-r--r--arch/powerpc/platforms/powermac/cpufreq.c726
-rw-r--r--arch/powerpc/platforms/powermac/feature.c3063
-rw-r--r--arch/powerpc/platforms/powermac/low_i2c.c (renamed from arch/ppc64/kernel/pmac_low_i2c.c)0
-rw-r--r--arch/powerpc/platforms/powermac/nvram.c (renamed from arch/ppc64/kernel/pmac_nvram.c)282
-rw-r--r--arch/powerpc/platforms/powermac/pci.c1170
-rw-r--r--arch/powerpc/platforms/powermac/pic.c678
-rw-r--r--arch/powerpc/platforms/powermac/pic.h11
-rw-r--r--arch/powerpc/platforms/powermac/pmac.h51
-rw-r--r--arch/powerpc/platforms/powermac/setup.c794
-rw-r--r--arch/powerpc/platforms/powermac/sleep.S396
-rw-r--r--arch/powerpc/platforms/powermac/smp.c865
-rw-r--r--arch/powerpc/platforms/powermac/time.c360
-rw-r--r--arch/powerpc/platforms/prep/Kconfig22
-rw-r--r--arch/powerpc/platforms/pseries/Kconfig42
-rw-r--r--arch/powerpc/platforms/pseries/Makefile5
-rw-r--r--arch/powerpc/platforms/pseries/hvCall.S (renamed from arch/ppc64/kernel/pSeries_hvCall.S)0
-rw-r--r--arch/powerpc/platforms/pseries/iommu.c (renamed from arch/ppc64/kernel/pSeries_iommu.c)28
-rw-r--r--arch/powerpc/platforms/pseries/lpar.c (renamed from arch/ppc64/kernel/pSeries_lpar.c)5
-rw-r--r--arch/powerpc/platforms/pseries/nvram.c (renamed from arch/ppc64/kernel/pSeries_nvram.c)0
-rw-r--r--arch/powerpc/platforms/pseries/pci.c (renamed from arch/ppc64/kernel/pSeries_pci.c)3
-rw-r--r--arch/powerpc/platforms/pseries/ras.c (renamed from arch/ppc64/kernel/ras.c)11
-rw-r--r--arch/powerpc/platforms/pseries/reconfig.c (renamed from arch/ppc64/kernel/pSeries_reconfig.c)0
-rw-r--r--arch/powerpc/platforms/pseries/rtas-fw.c138
-rw-r--r--arch/powerpc/platforms/pseries/rtas-fw.h3
-rw-r--r--arch/powerpc/platforms/pseries/setup.c (renamed from arch/ppc64/kernel/pSeries_setup.c)57
-rw-r--r--arch/powerpc/platforms/pseries/smp.c (renamed from arch/ppc64/kernel/pSeries_smp.c)52
-rw-r--r--arch/powerpc/platforms/pseries/vio.c (renamed from arch/ppc64/kernel/pSeries_vio.c)1
-rw-r--r--arch/powerpc/platforms/pseries/xics.c (renamed from arch/ppc64/kernel/xics.c)30
-rw-r--r--arch/powerpc/platforms/pseries/xics.h34
-rw-r--r--arch/powerpc/sysdev/Makefile7
-rw-r--r--arch/powerpc/sysdev/dcr.S (renamed from arch/ppc/syslib/dcr.S)0
-rw-r--r--arch/powerpc/sysdev/grackle.c64
-rw-r--r--arch/powerpc/sysdev/i8259.c (renamed from arch/ppc/syslib/i8259.c)65
-rw-r--r--arch/powerpc/sysdev/indirect_pci.c (renamed from arch/ppc/syslib/indirect_pci.c)0
-rw-r--r--arch/powerpc/sysdev/mpic.c (renamed from arch/ppc64/kernel/mpic.c)53
-rw-r--r--arch/powerpc/sysdev/u3_iommu.c (renamed from arch/ppc64/kernel/u3_iommu.c)50
-rw-r--r--arch/powerpc/xmon/Makefile11
-rw-r--r--arch/powerpc/xmon/ansidecl.h (renamed from arch/ppc64/xmon/ansidecl.h)0
-rw-r--r--arch/powerpc/xmon/nonstdio.h (renamed from arch/ppc64/xmon/nonstdio.h)0
-rw-r--r--arch/powerpc/xmon/ppc-dis.c (renamed from arch/ppc64/xmon/ppc-dis.c)0
-rw-r--r--arch/powerpc/xmon/ppc-opc.c (renamed from arch/ppc64/xmon/ppc-opc.c)0
-rw-r--r--arch/powerpc/xmon/ppc.h (renamed from arch/ppc64/xmon/ppc.h)0
-rw-r--r--arch/powerpc/xmon/setjmp.S135
-rw-r--r--arch/powerpc/xmon/start_32.c624
-rw-r--r--arch/powerpc/xmon/start_64.c (renamed from arch/ppc64/xmon/start.c)0
-rw-r--r--arch/powerpc/xmon/start_8xx.c287
-rw-r--r--arch/powerpc/xmon/subr_prf.c (renamed from arch/ppc64/xmon/subr_prf.c)11
-rw-r--r--arch/powerpc/xmon/xmon.c (renamed from arch/ppc64/xmon/xmon.c)399
-rw-r--r--arch/ppc/8xx_io/commproc.c20
-rw-r--r--arch/ppc/Kconfig40
-rw-r--r--arch/ppc/Makefile14
-rw-r--r--arch/ppc/boot/of1275/claim.c1
-rw-r--r--arch/ppc/boot/openfirmware/chrpmain.c2
-rw-r--r--arch/ppc/boot/openfirmware/coffmain.c2
-rw-r--r--arch/ppc/kernel/Makefile27
-rw-r--r--arch/ppc/kernel/align.c4
-rw-r--r--arch/ppc/kernel/asm-offsets.c3
-rw-r--r--arch/ppc/kernel/cpu_setup_6xx.S6
-rw-r--r--arch/ppc/kernel/cpu_setup_power4.S6
-rw-r--r--arch/ppc/kernel/dma-mapping.c6
-rw-r--r--arch/ppc/kernel/entry.S12
-rw-r--r--arch/ppc/kernel/head.S100
-rw-r--r--arch/ppc/kernel/head_44x.S32
-rw-r--r--arch/ppc/kernel/head_4xx.S68
-rw-r--r--arch/ppc/kernel/head_8xx.S42
-rw-r--r--arch/ppc/kernel/head_booke.h4
-rw-r--r--arch/ppc/kernel/head_fsl_booke.S47
-rw-r--r--arch/ppc/kernel/idle.c3
-rw-r--r--arch/ppc/kernel/irq.c1
-rw-r--r--arch/ppc/kernel/l2cr.S2
-rw-r--r--arch/ppc/kernel/misc.S235
-rw-r--r--arch/ppc/kernel/pci.c33
-rw-r--r--arch/ppc/kernel/perfmon.c96
-rw-r--r--arch/ppc/kernel/perfmon_fsl_booke.c2
-rw-r--r--arch/ppc/kernel/ppc_ksyms.c34
-rw-r--r--arch/ppc/kernel/process.c142
-rw-r--r--arch/ppc/kernel/setup.c39
-rw-r--r--arch/ppc/kernel/signal.c771
-rw-r--r--arch/ppc/kernel/smp.c22
-rw-r--r--arch/ppc/kernel/syscalls.c268
-rw-r--r--arch/ppc/kernel/time.c14
-rw-r--r--arch/ppc/kernel/traps.c42
-rw-r--r--arch/ppc/kernel/vector.S217
-rw-r--r--arch/ppc/kernel/vmlinux.lds.S26
-rw-r--r--arch/ppc/lib/string.S24
-rw-r--r--arch/ppc/math-emu/sfp-machine.h2
-rw-r--r--arch/ppc/mm/4xx_mmu.c4
-rw-r--r--arch/ppc/mm/init.c23
-rw-r--r--arch/ppc/mm/pgtable.c4
-rw-r--r--arch/ppc/oprofile/common.c161
-rw-r--r--arch/ppc/oprofile/op_impl.h45
-rw-r--r--arch/ppc/platforms/4xx/bamboo.c14
-rw-r--r--arch/ppc/platforms/4xx/ebony.c15
-rw-r--r--arch/ppc/platforms/4xx/luan.c13
-rw-r--r--arch/ppc/platforms/4xx/ocotea.c31
-rw-r--r--arch/ppc/platforms/83xx/mpc834x_sys.h1
-rw-r--r--arch/ppc/platforms/85xx/mpc8540_ads.c30
-rw-r--r--arch/ppc/platforms/85xx/mpc8560_ads.c25
-rw-r--r--arch/ppc/platforms/85xx/mpc85xx_ads_common.h1
-rw-r--r--arch/ppc/platforms/85xx/mpc85xx_cds_common.c39
-rw-r--r--arch/ppc/platforms/85xx/sbc8560.c22
-rw-r--r--arch/ppc/platforms/85xx/stx_gp3.c21
-rw-r--r--arch/ppc/platforms/85xx/stx_gp3.h1
-rw-r--r--arch/ppc/platforms/Makefile3
-rw-r--r--arch/ppc/platforms/chestnut.c1
-rw-r--r--arch/ppc/platforms/chrp_nvram.c83
-rw-r--r--arch/ppc/platforms/chrp_pci.c10
-rw-r--r--arch/ppc/platforms/chrp_pegasos_eth.c124
-rw-r--r--arch/ppc/platforms/chrp_setup.c33
-rw-r--r--arch/ppc/platforms/chrp_smp.c3
-rw-r--r--arch/ppc/platforms/chrp_time.c8
-rw-r--r--arch/ppc/platforms/ev64360.c1
-rw-r--r--arch/ppc/platforms/fads.h2
-rw-r--r--arch/ppc/platforms/gemini_setup.c4
-rw-r--r--arch/ppc/platforms/hdpu.c9
-rw-r--r--arch/ppc/platforms/katana.c3
-rw-r--r--arch/ppc/platforms/lite5200.c1
-rw-r--r--arch/ppc/platforms/lopec.c17
-rw-r--r--arch/ppc/platforms/mpc885ads.h2
-rw-r--r--arch/ppc/platforms/mvme5100.c6
-rw-r--r--arch/ppc/platforms/pal4_setup.c1
-rw-r--r--arch/ppc/platforms/pmac_backlight.c16
-rw-r--r--arch/ppc/platforms/pmac_cpufreq.c36
-rw-r--r--arch/ppc/platforms/pmac_feature.c176
-rw-r--r--arch/ppc/platforms/pmac_nvram.c42
-rw-r--r--arch/ppc/platforms/pmac_pci.c28
-rw-r--r--arch/ppc/platforms/pmac_pic.c27
-rw-r--r--arch/ppc/platforms/pmac_setup.c19
-rw-r--r--arch/ppc/platforms/pmac_sleep.S4
-rw-r--r--arch/ppc/platforms/pmac_smp.c11
-rw-r--r--arch/ppc/platforms/pmac_time.c8
-rw-r--r--arch/ppc/platforms/pplus.c17
-rw-r--r--arch/ppc/platforms/prep_pci.c64
-rw-r--r--arch/ppc/platforms/prep_setup.c70
-rw-r--r--arch/ppc/platforms/radstone_ppc7d.c15
-rw-r--r--arch/ppc/platforms/residual.c2
-rw-r--r--arch/ppc/platforms/sandpoint.c21
-rw-r--r--arch/ppc/syslib/Makefile57
-rw-r--r--arch/ppc/syslib/btext.c6
-rw-r--r--arch/ppc/syslib/gt64260_pic.c1
-rw-r--r--arch/ppc/syslib/ibm440gx_common.c6
-rw-r--r--arch/ppc/syslib/ibm44x_common.c37
-rw-r--r--arch/ppc/syslib/ibm44x_common.h3
-rw-r--r--arch/ppc/syslib/m8260_setup.c4
-rw-r--r--arch/ppc/syslib/m82xx_pci.c4
-rw-r--r--arch/ppc/syslib/m8xx_setup.c48
-rw-r--r--arch/ppc/syslib/m8xx_wdt.c14
-rw-r--r--arch/ppc/syslib/mpc52xx_pci.c3
-rw-r--r--arch/ppc/syslib/mpc83xx_devices.c1
-rw-r--r--arch/ppc/syslib/mpc85xx_devices.c17
-rw-r--r--arch/ppc/syslib/mpc85xx_sys.c44
-rw-r--r--arch/ppc/syslib/mpc8xx_sys.c4
-rw-r--r--arch/ppc/syslib/mv64360_pic.c1
-rw-r--r--arch/ppc/syslib/mv64x60.c2
-rw-r--r--arch/ppc/syslib/mv64x60_dbg.c1
-rw-r--r--arch/ppc/syslib/of_device.c276
-rw-r--r--arch/ppc/syslib/open_pic.c3
-rw-r--r--arch/ppc/syslib/open_pic2.c1
-rw-r--r--arch/ppc/syslib/ppc403_pic.c1
-rw-r--r--arch/ppc/syslib/ppc4xx_pic.c1
-rw-r--r--arch/ppc/syslib/ppc4xx_setup.c2
-rw-r--r--arch/ppc/syslib/ppc83xx_setup.c1
-rw-r--r--arch/ppc/syslib/ppc85xx_setup.c1
-rw-r--r--arch/ppc/syslib/ppc8xx_pic.c17
-rw-r--r--arch/ppc/syslib/ppc_sys.c3
-rw-r--r--arch/ppc/syslib/pq2_devices.c1
-rw-r--r--arch/ppc/syslib/prep_nvram.c13
-rw-r--r--arch/ppc/syslib/prom.c18
-rw-r--r--arch/ppc/syslib/xilinx_pic.c1
-rw-r--r--arch/ppc/xmon/start.c3
-rw-r--r--arch/ppc/xmon/xmon.c9
-rw-r--r--arch/ppc64/Kconfig33
-rw-r--r--arch/ppc64/Makefile18
-rw-r--r--arch/ppc64/boot/Makefile67
-rw-r--r--arch/ppc64/boot/crt0.S53
-rw-r--r--arch/ppc64/boot/install.sh2
-rw-r--r--arch/ppc64/boot/main.c268
-rw-r--r--arch/ppc64/boot/string.S4
-rw-r--r--arch/ppc64/boot/string.h1
-rw-r--r--arch/ppc64/boot/zImage.lds64
-rw-r--r--arch/ppc64/boot/zlib.c2195
-rw-r--r--arch/ppc64/boot/zlib.h432
-rw-r--r--arch/ppc64/defconfig4
-rw-r--r--arch/ppc64/kernel/HvLpEvent.c88
-rw-r--r--arch/ppc64/kernel/Makefile75
-rw-r--r--arch/ppc64/kernel/align.c4
-rw-r--r--arch/ppc64/kernel/asm-offsets.c3
-rw-r--r--arch/ppc64/kernel/bpa_iommu.c2
-rw-r--r--arch/ppc64/kernel/bpa_setup.c7
-rw-r--r--arch/ppc64/kernel/btext.c42
-rw-r--r--arch/ppc64/kernel/cputable.c308
-rw-r--r--arch/ppc64/kernel/eeh.c2
-rw-r--r--arch/ppc64/kernel/head.S290
-rw-r--r--arch/ppc64/kernel/hvcserver.c2
-rw-r--r--arch/ppc64/kernel/i8259.c177
-rw-r--r--arch/ppc64/kernel/i8259.h17
-rw-r--r--arch/ppc64/kernel/idle.c8
-rw-r--r--arch/ppc64/kernel/ioctl32.c4
-rw-r--r--arch/ppc64/kernel/kprobes.c1
-rw-r--r--arch/ppc64/kernel/misc.S662
-rw-r--r--arch/ppc64/kernel/mpic.h273
-rw-r--r--arch/ppc64/kernel/pci.c46
-rw-r--r--arch/ppc64/kernel/pci.h54
-rw-r--r--arch/ppc64/kernel/pci_direct_iommu.c3
-rw-r--r--arch/ppc64/kernel/pci_dn.c3
-rw-r--r--arch/ppc64/kernel/pci_iommu.c21
-rw-r--r--arch/ppc64/kernel/pmac.h31
-rw-r--r--arch/ppc64/kernel/pmac_feature.c767
-rw-r--r--arch/ppc64/kernel/pmac_pci.c793
-rw-r--r--arch/ppc64/kernel/pmac_setup.c525
-rw-r--r--arch/ppc64/kernel/pmac_smp.c330
-rw-r--r--arch/ppc64/kernel/pmac_time.c195
-rw-r--r--arch/ppc64/kernel/ppc_ksyms.c20
-rw-r--r--arch/ppc64/kernel/prom.c7
-rw-r--r--arch/ppc64/kernel/prom_init.c1
-rw-r--r--arch/ppc64/kernel/ptrace.c363
-rw-r--r--arch/ppc64/kernel/rtas-proc.c1
-rw-r--r--arch/ppc64/kernel/rtas_pci.c9
-rw-r--r--arch/ppc64/kernel/rtc.c48
-rw-r--r--arch/ppc64/kernel/signal.c2
-rw-r--r--arch/ppc64/kernel/smp.c40
-rw-r--r--arch/ppc64/kernel/traps.c568
-rw-r--r--arch/ppc64/kernel/vdso.c12
-rw-r--r--arch/ppc64/kernel/vdso64/sigtramp.S1
-rw-r--r--arch/ppc64/kernel/vecemu.c346
-rw-r--r--arch/ppc64/kernel/vmlinux.lds.S17
-rw-r--r--arch/ppc64/lib/Makefile15
-rw-r--r--arch/ppc64/lib/string.S106
-rw-r--r--arch/ppc64/mm/Makefile11
-rw-r--r--arch/ppc64/mm/init.c869
-rw-r--r--arch/ppc64/oprofile/Kconfig23
-rw-r--r--arch/ppc64/oprofile/Makefile9
-rw-r--r--arch/ppc64/xmon/Makefile5
-rw-r--r--arch/ppc64/xmon/setjmp.S73
-rw-r--r--arch/s390/kernel/compat_ioctl.c9
-rw-r--r--arch/s390/kernel/head.S72
-rw-r--r--arch/s390/kernel/head64.S66
-rw-r--r--arch/s390/kernel/setup.c186
-rw-r--r--arch/s390/kernel/time.c4
-rw-r--r--arch/s390/kernel/vtime.c18
-rw-r--r--arch/s390/mm/ioremap.c4
-rw-r--r--arch/sh/drivers/dma/dma-sysfs.c1
-rw-r--r--arch/sh/kernel/cpufreq.c1
-rw-r--r--arch/sh/kernel/ptrace.c2
-rw-r--r--arch/sh/kernel/time.c4
-rw-r--r--arch/sh/mm/fault.c40
-rw-r--r--arch/sh/mm/hugetlbpage.c2
-rw-r--r--arch/sh/mm/ioremap.c4
-rw-r--r--arch/sh64/kernel/ptrace.c2
-rw-r--r--arch/sh64/kernel/time.c3
-rw-r--r--arch/sh64/mm/cache.c68
-rw-r--r--arch/sh64/mm/hugetlbpage.c188
-rw-r--r--arch/sh64/mm/ioremap.c4
-rw-r--r--arch/sparc/kernel/pcic.c4
-rw-r--r--arch/sparc/kernel/time.c4
-rw-r--r--arch/sparc/mm/generic.c7
-rw-r--r--arch/sparc64/kernel/binfmt_aout32.c1
-rw-r--r--arch/sparc64/kernel/ioctl32.c3
-rw-r--r--arch/sparc64/kernel/time.c4
-rw-r--r--arch/sparc64/mm/generic.c9
-rw-r--r--arch/sparc64/mm/tlb.c7
-rw-r--r--arch/um/Kconfig10
-rw-r--r--arch/um/Kconfig.x86_645
-rw-r--r--arch/um/Makefile-i38612
-rw-r--r--arch/um/include/sysdep-i386/syscalls.h1
-rw-r--r--arch/um/include/tlb.h1
-rw-r--r--arch/um/kernel/process_kern.c8
-rw-r--r--arch/um/kernel/skas/mmu.c4
-rw-r--r--arch/um/kernel/time_kern.c4
-rw-r--r--arch/um/kernel/tt/tlb.c36
-rw-r--r--arch/v850/kernel/ptrace.c2
-rw-r--r--arch/v850/kernel/time.c4
-rw-r--r--arch/x86_64/ia32/ia32_aout.c1
-rw-r--r--arch/x86_64/ia32/ia32_ioctl.c125
-rw-r--r--arch/x86_64/kernel/i8259.c8
-rw-r--r--arch/x86_64/kernel/setup.c2
-rw-r--r--arch/x86_64/kernel/suspend.c95
-rw-r--r--arch/x86_64/kernel/time.c32
-rw-r--r--arch/x86_64/mm/ioremap.c4
-rw-r--r--arch/xtensa/kernel/platform.c1
-rw-r--r--arch/xtensa/kernel/ptrace.c2
-rw-r--r--arch/xtensa/kernel/time.c3
920 files changed, 82766 insertions, 30703 deletions
diff --git a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c
index 67be50b7d80a..6b2921be1909 100644
--- a/arch/alpha/kernel/time.c
+++ b/arch/alpha/kernel/time.c
@@ -55,10 +55,6 @@
55#include "proto.h" 55#include "proto.h"
56#include "irq_impl.h" 56#include "irq_impl.h"
57 57
58u64 jiffies_64 = INITIAL_JIFFIES;
59
60EXPORT_SYMBOL(jiffies_64);
61
62extern unsigned long wall_jiffies; /* kernel/timer.c */ 58extern unsigned long wall_jiffies; /* kernel/timer.c */
63 59
64static int set_rtc_mmss(unsigned long); 60static int set_rtc_mmss(unsigned long);
diff --git a/arch/alpha/mm/numa.c b/arch/alpha/mm/numa.c
index c7481d59b6df..6d5251254f68 100644
--- a/arch/alpha/mm/numa.c
+++ b/arch/alpha/mm/numa.c
@@ -371,6 +371,8 @@ show_mem(void)
371 show_free_areas(); 371 show_free_areas();
372 printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); 372 printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
373 for_each_online_node(nid) { 373 for_each_online_node(nid) {
374 unsigned long flags;
375 pgdat_resize_lock(NODE_DATA(nid), &flags);
374 i = node_spanned_pages(nid); 376 i = node_spanned_pages(nid);
375 while (i-- > 0) { 377 while (i-- > 0) {
376 struct page *page = nid_page_nr(nid, i); 378 struct page *page = nid_page_nr(nid, i);
@@ -384,6 +386,7 @@ show_mem(void)
384 else 386 else
385 shared += page_count(page) - 1; 387 shared += page_count(page) - 1;
386 } 388 }
389 pgdat_resize_unlock(NODE_DATA(nid), &flags);
387 } 390 }
388 printk("%ld pages of RAM\n",total); 391 printk("%ld pages of RAM\n",total);
389 printk("%ld free pages\n",free); 392 printk("%ld free pages\n",free);
diff --git a/arch/alpha/mm/remap.c b/arch/alpha/mm/remap.c
index 19817ad3d89b..a78356c3ead5 100644
--- a/arch/alpha/mm/remap.c
+++ b/arch/alpha/mm/remap.c
@@ -2,7 +2,6 @@
2#include <asm/pgalloc.h> 2#include <asm/pgalloc.h>
3#include <asm/cacheflush.h> 3#include <asm/cacheflush.h>
4 4
5/* called with the page_table_lock held */
6static inline void 5static inline void
7remap_area_pte(pte_t * pte, unsigned long address, unsigned long size, 6remap_area_pte(pte_t * pte, unsigned long address, unsigned long size,
8 unsigned long phys_addr, unsigned long flags) 7 unsigned long phys_addr, unsigned long flags)
@@ -31,7 +30,6 @@ remap_area_pte(pte_t * pte, unsigned long address, unsigned long size,
31 } while (address && (address < end)); 30 } while (address && (address < end));
32} 31}
33 32
34/* called with the page_table_lock held */
35static inline int 33static inline int
36remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned long size, 34remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned long size,
37 unsigned long phys_addr, unsigned long flags) 35 unsigned long phys_addr, unsigned long flags)
@@ -46,7 +44,7 @@ remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned long size,
46 if (address >= end) 44 if (address >= end)
47 BUG(); 45 BUG();
48 do { 46 do {
49 pte_t * pte = pte_alloc_kernel(&init_mm, pmd, address); 47 pte_t * pte = pte_alloc_kernel(pmd, address);
50 if (!pte) 48 if (!pte)
51 return -ENOMEM; 49 return -ENOMEM;
52 remap_area_pte(pte, address, end - address, 50 remap_area_pte(pte, address, end - address,
@@ -70,7 +68,6 @@ __alpha_remap_area_pages(unsigned long address, unsigned long phys_addr,
70 flush_cache_all(); 68 flush_cache_all();
71 if (address >= end) 69 if (address >= end)
72 BUG(); 70 BUG();
73 spin_lock(&init_mm.page_table_lock);
74 do { 71 do {
75 pmd_t *pmd; 72 pmd_t *pmd;
76 pmd = pmd_alloc(&init_mm, dir, address); 73 pmd = pmd_alloc(&init_mm, dir, address);
@@ -84,7 +81,6 @@ __alpha_remap_area_pages(unsigned long address, unsigned long phys_addr,
84 address = (address + PGDIR_SIZE) & PGDIR_MASK; 81 address = (address + PGDIR_SIZE) & PGDIR_MASK;
85 dir++; 82 dir++;
86 } while (address && (address < end)); 83 } while (address && (address < end));
87 spin_unlock(&init_mm.page_table_lock);
88 return error; 84 return error;
89} 85}
90 86
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 299bc0468702..64cf480b0b02 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -8,7 +8,7 @@
8# Copyright (C) 1995-2001 by Russell King 8# Copyright (C) 1995-2001 by Russell King
9 9
10LDFLAGS_vmlinux :=-p --no-undefined -X 10LDFLAGS_vmlinux :=-p --no-undefined -X
11CPPFLAGS_vmlinux.lds = -DTEXTADDR=$(TEXTADDR) -DDATAADDR=$(DATAADDR) 11CPPFLAGS_vmlinux.lds = -DKERNEL_RAM_ADDR=$(TEXTADDR)
12OBJCOPYFLAGS :=-O binary -R .note -R .comment -S 12OBJCOPYFLAGS :=-O binary -R .note -R .comment -S
13GZFLAGS :=-9 13GZFLAGS :=-9
14#CFLAGS +=-pipe 14#CFLAGS +=-pipe
@@ -108,27 +108,19 @@ export CFLAGS_3c589_cs.o
108endif 108endif
109 109
110TEXTADDR := $(textaddr-y) 110TEXTADDR := $(textaddr-y)
111ifeq ($(CONFIG_XIP_KERNEL),y)
112 DATAADDR := $(TEXTADDR)
113 xipaddr-$(CONFIG_ARCH_CO285) := 0x5f000000
114 xipaddr-y ?= 0xbf000000
115 # Replace phys addr with virt addr while keeping offset from base.
116 TEXTADDR := $(shell echo $(CONFIG_XIP_PHYS_ADDR) $(xipaddr-y) | \
117 awk --non-decimal-data '/[:xdigit:]/ \
118 { printf("0x%x\n", and($$1, 0x000fffff) + $$2) }' )
119endif
120 111
121ifeq ($(incdir-y),) 112ifeq ($(incdir-y),)
122incdir-y := $(machine-y) 113incdir-y := $(machine-y)
123endif 114endif
124INCDIR := arch-$(incdir-y) 115INCDIR := arch-$(incdir-y)
116
125ifneq ($(machine-y),) 117ifneq ($(machine-y),)
126MACHINE := arch/arm/mach-$(machine-y)/ 118MACHINE := arch/arm/mach-$(machine-y)/
127else 119else
128MACHINE := 120MACHINE :=
129endif 121endif
130 122
131export TEXTADDR DATAADDR GZFLAGS 123export TEXTADDR GZFLAGS
132 124
133# Do we have FASTFPE? 125# Do we have FASTFPE?
134FASTFPE :=arch/arm/fastfpe 126FASTFPE :=arch/arm/fastfpe
diff --git a/arch/arm/boot/compressed/misc.c b/arch/arm/boot/compressed/misc.c
index 23434b56786a..50f13eec6cd7 100644
--- a/arch/arm/boot/compressed/misc.c
+++ b/arch/arm/boot/compressed/misc.c
@@ -30,7 +30,7 @@ unsigned int __machine_arch_type;
30#define putstr icedcc_putstr 30#define putstr icedcc_putstr
31#define putc icedcc_putc 31#define putc icedcc_putc
32 32
33extern void idedcc_putc(int ch); 33extern void icedcc_putc(int ch);
34 34
35static void 35static void
36icedcc_putstr(const char *ptr) 36icedcc_putstr(const char *ptr)
diff --git a/arch/arm/common/amba.c b/arch/arm/common/amba.c
index c6beb751f2a9..e1013112c354 100644
--- a/arch/arm/common/amba.c
+++ b/arch/arm/common/amba.c
@@ -10,6 +10,8 @@
10#include <linux/module.h> 10#include <linux/module.h>
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/device.h> 12#include <linux/device.h>
13#include <linux/string.h>
14#include <linux/slab.h>
13 15
14#include <asm/io.h> 16#include <asm/io.h>
15#include <asm/irq.h> 17#include <asm/irq.h>
diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c
index cbf2165476b0..ad6c89a555bb 100644
--- a/arch/arm/common/dmabounce.c
+++ b/arch/arm/common/dmabounce.c
@@ -33,8 +33,8 @@
33#include <asm/cacheflush.h> 33#include <asm/cacheflush.h>
34 34
35#undef DEBUG 35#undef DEBUG
36
37#undef STATS 36#undef STATS
37
38#ifdef STATS 38#ifdef STATS
39#define DO_STATS(X) do { X ; } while (0) 39#define DO_STATS(X) do { X ; } while (0)
40#else 40#else
@@ -52,26 +52,31 @@ struct safe_buffer {
52 int direction; 52 int direction;
53 53
54 /* safe buffer info */ 54 /* safe buffer info */
55 struct dma_pool *pool; 55 struct dmabounce_pool *pool;
56 void *safe; 56 void *safe;
57 dma_addr_t safe_dma_addr; 57 dma_addr_t safe_dma_addr;
58}; 58};
59 59
60struct dmabounce_pool {
61 unsigned long size;
62 struct dma_pool *pool;
63#ifdef STATS
64 unsigned long allocs;
65#endif
66};
67
60struct dmabounce_device_info { 68struct dmabounce_device_info {
61 struct list_head node; 69 struct list_head node;
62 70
63 struct device *dev; 71 struct device *dev;
64 struct dma_pool *small_buffer_pool;
65 struct dma_pool *large_buffer_pool;
66 struct list_head safe_buffers; 72 struct list_head safe_buffers;
67 unsigned long small_buffer_size, large_buffer_size;
68#ifdef STATS 73#ifdef STATS
69 unsigned long sbp_allocs;
70 unsigned long lbp_allocs;
71 unsigned long total_allocs; 74 unsigned long total_allocs;
72 unsigned long map_op_count; 75 unsigned long map_op_count;
73 unsigned long bounce_count; 76 unsigned long bounce_count;
74#endif 77#endif
78 struct dmabounce_pool small;
79 struct dmabounce_pool large;
75}; 80};
76 81
77static LIST_HEAD(dmabounce_devs); 82static LIST_HEAD(dmabounce_devs);
@@ -82,9 +87,9 @@ static void print_alloc_stats(struct dmabounce_device_info *device_info)
82 printk(KERN_INFO 87 printk(KERN_INFO
83 "%s: dmabounce: sbp: %lu, lbp: %lu, other: %lu, total: %lu\n", 88 "%s: dmabounce: sbp: %lu, lbp: %lu, other: %lu, total: %lu\n",
84 device_info->dev->bus_id, 89 device_info->dev->bus_id,
85 device_info->sbp_allocs, device_info->lbp_allocs, 90 device_info->small.allocs, device_info->large.allocs,
86 device_info->total_allocs - device_info->sbp_allocs - 91 device_info->total_allocs - device_info->small.allocs -
87 device_info->lbp_allocs, 92 device_info->large.allocs,
88 device_info->total_allocs); 93 device_info->total_allocs);
89} 94}
90#endif 95#endif
@@ -106,18 +111,22 @@ find_dmabounce_dev(struct device *dev)
106/* allocate a 'safe' buffer and keep track of it */ 111/* allocate a 'safe' buffer and keep track of it */
107static inline struct safe_buffer * 112static inline struct safe_buffer *
108alloc_safe_buffer(struct dmabounce_device_info *device_info, void *ptr, 113alloc_safe_buffer(struct dmabounce_device_info *device_info, void *ptr,
109 size_t size, enum dma_data_direction dir) 114 size_t size, enum dma_data_direction dir)
110{ 115{
111 struct safe_buffer *buf; 116 struct safe_buffer *buf;
112 struct dma_pool *pool; 117 struct dmabounce_pool *pool;
113 struct device *dev = device_info->dev; 118 struct device *dev = device_info->dev;
114 void *safe;
115 dma_addr_t safe_dma_addr;
116 119
117 dev_dbg(dev, "%s(ptr=%p, size=%d, dir=%d)\n", 120 dev_dbg(dev, "%s(ptr=%p, size=%d, dir=%d)\n",
118 __func__, ptr, size, dir); 121 __func__, ptr, size, dir);
119 122
120 DO_STATS ( device_info->total_allocs++ ); 123 if (size <= device_info->small.size) {
124 pool = &device_info->small;
125 } else if (size <= device_info->large.size) {
126 pool = &device_info->large;
127 } else {
128 pool = NULL;
129 }
121 130
122 buf = kmalloc(sizeof(struct safe_buffer), GFP_ATOMIC); 131 buf = kmalloc(sizeof(struct safe_buffer), GFP_ATOMIC);
123 if (buf == NULL) { 132 if (buf == NULL) {
@@ -125,41 +134,35 @@ alloc_safe_buffer(struct dmabounce_device_info *device_info, void *ptr,
125 return NULL; 134 return NULL;
126 } 135 }
127 136
128 if (size <= device_info->small_buffer_size) { 137 buf->ptr = ptr;
129 pool = device_info->small_buffer_pool; 138 buf->size = size;
130 safe = dma_pool_alloc(pool, GFP_ATOMIC, &safe_dma_addr); 139 buf->direction = dir;
131 140 buf->pool = pool;
132 DO_STATS ( device_info->sbp_allocs++ );
133 } else if (size <= device_info->large_buffer_size) {
134 pool = device_info->large_buffer_pool;
135 safe = dma_pool_alloc(pool, GFP_ATOMIC, &safe_dma_addr);
136 141
137 DO_STATS ( device_info->lbp_allocs++ ); 142 if (pool) {
143 buf->safe = dma_pool_alloc(pool->pool, GFP_ATOMIC,
144 &buf->safe_dma_addr);
138 } else { 145 } else {
139 pool = NULL; 146 buf->safe = dma_alloc_coherent(dev, size, &buf->safe_dma_addr,
140 safe = dma_alloc_coherent(dev, size, &safe_dma_addr, GFP_ATOMIC); 147 GFP_ATOMIC);
141 } 148 }
142 149
143 if (safe == NULL) { 150 if (buf->safe == NULL) {
144 dev_warn(device_info->dev, 151 dev_warn(dev,
145 "%s: could not alloc dma memory (size=%d)\n", 152 "%s: could not alloc dma memory (size=%d)\n",
146 __func__, size); 153 __func__, size);
147 kfree(buf); 154 kfree(buf);
148 return NULL; 155 return NULL;
149 } 156 }
150 157
151#ifdef STATS 158#ifdef STATS
159 if (pool)
160 pool->allocs++;
161 device_info->total_allocs++;
152 if (device_info->total_allocs % 1000 == 0) 162 if (device_info->total_allocs % 1000 == 0)
153 print_alloc_stats(device_info); 163 print_alloc_stats(device_info);
154#endif 164#endif
155 165
156 buf->ptr = ptr;
157 buf->size = size;
158 buf->direction = dir;
159 buf->pool = pool;
160 buf->safe = safe;
161 buf->safe_dma_addr = safe_dma_addr;
162
163 list_add(&buf->node, &device_info->safe_buffers); 166 list_add(&buf->node, &device_info->safe_buffers);
164 167
165 return buf; 168 return buf;
@@ -186,7 +189,7 @@ free_safe_buffer(struct dmabounce_device_info *device_info, struct safe_buffer *
186 list_del(&buf->node); 189 list_del(&buf->node);
187 190
188 if (buf->pool) 191 if (buf->pool)
189 dma_pool_free(buf->pool, buf->safe, buf->safe_dma_addr); 192 dma_pool_free(buf->pool->pool, buf->safe, buf->safe_dma_addr);
190 else 193 else
191 dma_free_coherent(device_info->dev, buf->size, buf->safe, 194 dma_free_coherent(device_info->dev, buf->size, buf->safe,
192 buf->safe_dma_addr); 195 buf->safe_dma_addr);
@@ -197,12 +200,10 @@ free_safe_buffer(struct dmabounce_device_info *device_info, struct safe_buffer *
197/* ************************************************** */ 200/* ************************************************** */
198 201
199#ifdef STATS 202#ifdef STATS
200
201static void print_map_stats(struct dmabounce_device_info *device_info) 203static void print_map_stats(struct dmabounce_device_info *device_info)
202{ 204{
203 printk(KERN_INFO 205 dev_info(device_info->dev,
204 "%s: dmabounce: map_op_count=%lu, bounce_count=%lu\n", 206 "dmabounce: map_op_count=%lu, bounce_count=%lu\n",
205 device_info->dev->bus_id,
206 device_info->map_op_count, device_info->bounce_count); 207 device_info->map_op_count, device_info->bounce_count);
207} 208}
208#endif 209#endif
@@ -258,13 +259,13 @@ map_single(struct device *dev, void *ptr, size_t size,
258 __func__, ptr, buf->safe, size); 259 __func__, ptr, buf->safe, size);
259 memcpy(buf->safe, ptr, size); 260 memcpy(buf->safe, ptr, size);
260 } 261 }
261 consistent_sync(buf->safe, size, dir); 262 ptr = buf->safe;
262 263
263 dma_addr = buf->safe_dma_addr; 264 dma_addr = buf->safe_dma_addr;
264 } else {
265 consistent_sync(ptr, size, dir);
266 } 265 }
267 266
267 consistent_sync(ptr, size, dir);
268
268 return dma_addr; 269 return dma_addr;
269} 270}
270 271
@@ -278,7 +279,7 @@ unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
278 /* 279 /*
279 * Trying to unmap an invalid mapping 280 * Trying to unmap an invalid mapping
280 */ 281 */
281 if (dma_addr == ~0) { 282 if (dma_mapping_error(dma_addr)) {
282 dev_err(dev, "Trying to unmap invalid mapping\n"); 283 dev_err(dev, "Trying to unmap invalid mapping\n");
283 return; 284 return;
284 } 285 }
@@ -570,11 +571,25 @@ dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nents,
570 local_irq_restore(flags); 571 local_irq_restore(flags);
571} 572}
572 573
574static int
575dmabounce_init_pool(struct dmabounce_pool *pool, struct device *dev, const char *name,
576 unsigned long size)
577{
578 pool->size = size;
579 DO_STATS(pool->allocs = 0);
580 pool->pool = dma_pool_create(name, dev, size,
581 0 /* byte alignment */,
582 0 /* no page-crossing issues */);
583
584 return pool->pool ? 0 : -ENOMEM;
585}
586
573int 587int
574dmabounce_register_dev(struct device *dev, unsigned long small_buffer_size, 588dmabounce_register_dev(struct device *dev, unsigned long small_buffer_size,
575 unsigned long large_buffer_size) 589 unsigned long large_buffer_size)
576{ 590{
577 struct dmabounce_device_info *device_info; 591 struct dmabounce_device_info *device_info;
592 int ret;
578 593
579 device_info = kmalloc(sizeof(struct dmabounce_device_info), GFP_ATOMIC); 594 device_info = kmalloc(sizeof(struct dmabounce_device_info), GFP_ATOMIC);
580 if (!device_info) { 595 if (!device_info) {
@@ -584,45 +599,31 @@ dmabounce_register_dev(struct device *dev, unsigned long small_buffer_size,
584 return -ENOMEM; 599 return -ENOMEM;
585 } 600 }
586 601
587 device_info->small_buffer_pool = 602 ret = dmabounce_init_pool(&device_info->small, dev,
588 dma_pool_create("small_dmabounce_pool", 603 "small_dmabounce_pool", small_buffer_size);
589 dev, 604 if (ret) {
590 small_buffer_size, 605 dev_err(dev,
591 0 /* byte alignment */, 606 "dmabounce: could not allocate DMA pool for %ld byte objects\n",
592 0 /* no page-crossing issues */); 607 small_buffer_size);
593 if (!device_info->small_buffer_pool) { 608 goto err_free;
594 printk(KERN_ERR
595 "dmabounce: could not allocate small DMA pool for %s\n",
596 dev->bus_id);
597 kfree(device_info);
598 return -ENOMEM;
599 } 609 }
600 610
601 if (large_buffer_size) { 611 if (large_buffer_size) {
602 device_info->large_buffer_pool = 612 ret = dmabounce_init_pool(&device_info->large, dev,
603 dma_pool_create("large_dmabounce_pool", 613 "large_dmabounce_pool",
604 dev, 614 large_buffer_size);
605 large_buffer_size, 615 if (ret) {
606 0 /* byte alignment */, 616 dev_err(dev,
607 0 /* no page-crossing issues */); 617 "dmabounce: could not allocate DMA pool for %ld byte objects\n",
608 if (!device_info->large_buffer_pool) { 618 large_buffer_size);
609 printk(KERN_ERR 619 goto err_destroy;
610 "dmabounce: could not allocate large DMA pool for %s\n",
611 dev->bus_id);
612 dma_pool_destroy(device_info->small_buffer_pool);
613
614 return -ENOMEM;
615 } 620 }
616 } 621 }
617 622
618 device_info->dev = dev; 623 device_info->dev = dev;
619 device_info->small_buffer_size = small_buffer_size;
620 device_info->large_buffer_size = large_buffer_size;
621 INIT_LIST_HEAD(&device_info->safe_buffers); 624 INIT_LIST_HEAD(&device_info->safe_buffers);
622 625
623#ifdef STATS 626#ifdef STATS
624 device_info->sbp_allocs = 0;
625 device_info->lbp_allocs = 0;
626 device_info->total_allocs = 0; 627 device_info->total_allocs = 0;
627 device_info->map_op_count = 0; 628 device_info->map_op_count = 0;
628 device_info->bounce_count = 0; 629 device_info->bounce_count = 0;
@@ -634,6 +635,12 @@ dmabounce_register_dev(struct device *dev, unsigned long small_buffer_size,
634 dev->bus_id, dev->bus->name); 635 dev->bus_id, dev->bus->name);
635 636
636 return 0; 637 return 0;
638
639 err_destroy:
640 dma_pool_destroy(device_info->small.pool);
641 err_free:
642 kfree(device_info);
643 return ret;
637} 644}
638 645
639void 646void
@@ -655,10 +662,10 @@ dmabounce_unregister_dev(struct device *dev)
655 BUG(); 662 BUG();
656 } 663 }
657 664
658 if (device_info->small_buffer_pool) 665 if (device_info->small.pool)
659 dma_pool_destroy(device_info->small_buffer_pool); 666 dma_pool_destroy(device_info->small.pool);
660 if (device_info->large_buffer_pool) 667 if (device_info->large.pool)
661 dma_pool_destroy(device_info->large_buffer_pool); 668 dma_pool_destroy(device_info->large.pool);
662 669
663#ifdef STATS 670#ifdef STATS
664 print_alloc_stats(device_info); 671 print_alloc_stats(device_info);
diff --git a/arch/arm/common/scoop.c b/arch/arm/common/scoop.c
index 68b06d16f253..bb4eff614413 100644
--- a/arch/arm/common/scoop.c
+++ b/arch/arm/common/scoop.c
@@ -11,6 +11,8 @@
11 * 11 *
12 */ 12 */
13 13
14#include <linux/device.h>
15#include <linux/string.h>
14#include <linux/platform_device.h> 16#include <linux/platform_device.h>
15#include <asm/io.h> 17#include <asm/io.h>
16#include <asm/hardware/scoop.h> 18#include <asm/hardware/scoop.h>
diff --git a/arch/arm/configs/ixdp2400_defconfig b/arch/arm/configs/ixdp2400_defconfig
index 678720fa2e2e..ddeb9f99d662 100644
--- a/arch/arm/configs/ixdp2400_defconfig
+++ b/arch/arm/configs/ixdp2400_defconfig
@@ -559,7 +559,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
559# 559#
560CONFIG_SERIAL_8250=y 560CONFIG_SERIAL_8250=y
561CONFIG_SERIAL_8250_CONSOLE=y 561CONFIG_SERIAL_8250_CONSOLE=y
562CONFIG_SERIAL_8250_NR_UARTS=2 562CONFIG_SERIAL_8250_NR_UARTS=1
563# CONFIG_SERIAL_8250_EXTENDED is not set 563# CONFIG_SERIAL_8250_EXTENDED is not set
564 564
565# 565#
diff --git a/arch/arm/configs/ixdp2800_defconfig b/arch/arm/configs/ixdp2800_defconfig
index 261e2343903b..81d3a0606f95 100644
--- a/arch/arm/configs/ixdp2800_defconfig
+++ b/arch/arm/configs/ixdp2800_defconfig
@@ -559,7 +559,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
559# 559#
560CONFIG_SERIAL_8250=y 560CONFIG_SERIAL_8250=y
561CONFIG_SERIAL_8250_CONSOLE=y 561CONFIG_SERIAL_8250_CONSOLE=y
562CONFIG_SERIAL_8250_NR_UARTS=2 562CONFIG_SERIAL_8250_NR_UARTS=1
563# CONFIG_SERIAL_8250_EXTENDED is not set 563# CONFIG_SERIAL_8250_EXTENDED is not set
564 564
565# 565#
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 3e1b0327e4d7..c11169b5ed9a 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -2,7 +2,7 @@
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4 4
5AFLAGS_head.o := -DTEXTADDR=$(TEXTADDR) -DDATAADDR=$(DATAADDR) 5AFLAGS_head.o := -DKERNEL_RAM_ADDR=$(TEXTADDR)
6 6
7# Object file lists. 7# Object file lists.
8 8
diff --git a/arch/arm/kernel/arthur.c b/arch/arm/kernel/arthur.c
index a418dad6692c..0ee2e9819631 100644
--- a/arch/arm/kernel/arthur.c
+++ b/arch/arm/kernel/arthur.c
@@ -18,6 +18,7 @@
18#include <linux/stddef.h> 18#include <linux/stddef.h>
19#include <linux/signal.h> 19#include <linux/signal.h>
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/sched.h>
21 22
22#include <asm/ptrace.h> 23#include <asm/ptrace.h>
23 24
diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c
index c1ff4d1f1bfd..04d3082a7b94 100644
--- a/arch/arm/kernel/asm-offsets.c
+++ b/arch/arm/kernel/asm-offsets.c
@@ -94,7 +94,6 @@ int main(void)
94 DEFINE(VM_EXEC, VM_EXEC); 94 DEFINE(VM_EXEC, VM_EXEC);
95 BLANK(); 95 BLANK();
96 DEFINE(PAGE_SZ, PAGE_SIZE); 96 DEFINE(PAGE_SZ, PAGE_SIZE);
97 DEFINE(VIRT_OFFSET, PAGE_OFFSET);
98 BLANK(); 97 BLANK();
99 DEFINE(SYS_ERROR0, 0x9f0000); 98 DEFINE(SYS_ERROR0, 0x9f0000);
100 BLANK(); 99 BLANK();
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 93b5e8e5292e..be439cab92c6 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -15,6 +15,7 @@
15 */ 15 */
16#include <linux/config.h> 16#include <linux/config.h>
17 17
18#include <asm/memory.h>
18#include <asm/glue.h> 19#include <asm/glue.h>
19#include <asm/vfpmacros.h> 20#include <asm/vfpmacros.h>
20#include <asm/hardware.h> /* should be moved into entry-macro.S */ 21#include <asm/hardware.h> /* should be moved into entry-macro.S */
@@ -310,7 +311,7 @@ __pabt_svc:
310 311
311#if __LINUX_ARM_ARCH__ < 6 && !defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG) 312#if __LINUX_ARM_ARCH__ < 6 && !defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG)
312 @ make sure our user space atomic helper is aborted 313 @ make sure our user space atomic helper is aborted
313 cmp r2, #VIRT_OFFSET 314 cmp r2, #TASK_SIZE
314 bichs r3, r3, #PSR_Z_BIT 315 bichs r3, r3, #PSR_Z_BIT
315#endif 316#endif
316 317
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 539626351348..8d8748407cbe 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -21,6 +21,7 @@
21#include <asm/procinfo.h> 21#include <asm/procinfo.h>
22#include <asm/ptrace.h> 22#include <asm/ptrace.h>
23#include <asm/asm-offsets.h> 23#include <asm/asm-offsets.h>
24#include <asm/memory.h>
24#include <asm/thread_info.h> 25#include <asm/thread_info.h>
25#include <asm/system.h> 26#include <asm/system.h>
26 27
@@ -33,52 +34,28 @@
33#define MACHINFO_PGOFFIO 12 34#define MACHINFO_PGOFFIO 12
34#define MACHINFO_NAME 16 35#define MACHINFO_NAME 16
35 36
36#ifndef CONFIG_XIP_KERNEL
37/* 37/*
38 * We place the page tables 16K below TEXTADDR. Therefore, we must make sure 38 * swapper_pg_dir is the virtual address of the initial page table.
39 * that TEXTADDR is correctly set. Currently, we expect the least significant 39 * We place the page tables 16K below KERNEL_RAM_ADDR. Therefore, we must
40 * 16 bits to be 0x8000, but we could probably relax this restriction to 40 * make sure that KERNEL_RAM_ADDR is correctly set. Currently, we expect
41 * TEXTADDR >= PAGE_OFFSET + 0x4000 41 * the least significant 16 bits to be 0x8000, but we could probably
42 * 42 * relax this restriction to KERNEL_RAM_ADDR >= PAGE_OFFSET + 0x4000.
43 * Note that swapper_pg_dir is the virtual address of the page tables, and
44 * pgtbl gives us a position-independent reference to these tables. We can
45 * do this because stext == TEXTADDR
46 */ 43 */
47#if (TEXTADDR & 0xffff) != 0x8000 44#if (KERNEL_RAM_ADDR & 0xffff) != 0x8000
48#error TEXTADDR must start at 0xXXXX8000 45#error KERNEL_RAM_ADDR must start at 0xXXXX8000
49#endif 46#endif
50 47
51 .globl swapper_pg_dir 48 .globl swapper_pg_dir
52 .equ swapper_pg_dir, TEXTADDR - 0x4000 49 .equ swapper_pg_dir, KERNEL_RAM_ADDR - 0x4000
53 50
54 .macro pgtbl, rd, phys 51 .macro pgtbl, rd
55 adr \rd, stext 52 ldr \rd, =(__virt_to_phys(KERNEL_RAM_ADDR - 0x4000))
56 sub \rd, \rd, #0x4000
57 .endm 53 .endm
58#else
59/*
60 * XIP Kernel:
61 *
62 * We place the page tables 16K below DATAADDR. Therefore, we must make sure
63 * that DATAADDR is correctly set. Currently, we expect the least significant
64 * 16 bits to be 0x8000, but we could probably relax this restriction to
65 * DATAADDR >= PAGE_OFFSET + 0x4000
66 *
67 * Note that pgtbl is meant to return the physical address of swapper_pg_dir.
68 * We can't make it relative to the kernel position in this case since
69 * the kernel can physically be anywhere.
70 */
71#if (DATAADDR & 0xffff) != 0x8000
72#error DATAADDR must start at 0xXXXX8000
73#endif
74
75 .globl swapper_pg_dir
76 .equ swapper_pg_dir, DATAADDR - 0x4000
77 54
78 .macro pgtbl, rd, phys 55#ifdef CONFIG_XIP_KERNEL
79 ldr \rd, =((DATAADDR - 0x4000) - VIRT_OFFSET) 56#define TEXTADDR XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR)
80 add \rd, \rd, \phys 57#else
81 .endm 58#define TEXTADDR KERNEL_RAM_ADDR
82#endif 59#endif
83 60
84/* 61/*
@@ -279,7 +256,7 @@ __turn_mmu_on:
279 .type __create_page_tables, %function 256 .type __create_page_tables, %function
280__create_page_tables: 257__create_page_tables:
281 ldr r5, [r8, #MACHINFO_PHYSRAM] @ physram 258 ldr r5, [r8, #MACHINFO_PHYSRAM] @ physram
282 pgtbl r4, r5 @ page table address 259 pgtbl r4 @ page table address
283 260
284 /* 261 /*
285 * Clear the 16K level 1 swapper page table 262 * Clear the 16K level 1 swapper page table
@@ -324,7 +301,7 @@ __create_page_tables:
324 /* 301 /*
325 * Then map first 1MB of ram in case it contains our boot params. 302 * Then map first 1MB of ram in case it contains our boot params.
326 */ 303 */
327 add r0, r4, #VIRT_OFFSET >> 18 304 add r0, r4, #PAGE_OFFSET >> 18
328 orr r6, r5, r7 305 orr r6, r5, r7
329 str r6, [r0] 306 str r6, [r0]
330 307
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
index cd99b83f14c2..9bd8609a2926 100644
--- a/arch/arm/kernel/ptrace.c
+++ b/arch/arm/kernel/ptrace.c
@@ -782,7 +782,7 @@ static int do_ptrace(int request, struct task_struct *child, long addr, long dat
782 return ret; 782 return ret;
783} 783}
784 784
785asmlinkage int sys_ptrace(long request, long pid, long addr, long data) 785asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
786{ 786{
787 struct task_struct *child; 787 struct task_struct *child;
788 int ret; 788 int ret;
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index a94d75fef598..a917e3dd3666 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -139,93 +139,33 @@ struct iwmmxt_sigframe {
139 unsigned long storage[0x98/4]; 139 unsigned long storage[0x98/4];
140}; 140};
141 141
142static int page_present(struct mm_struct *mm, void __user *uptr, int wr)
143{
144 unsigned long addr = (unsigned long)uptr;
145 pgd_t *pgd = pgd_offset(mm, addr);
146 if (pgd_present(*pgd)) {
147 pmd_t *pmd = pmd_offset(pgd, addr);
148 if (pmd_present(*pmd)) {
149 pte_t *pte = pte_offset_map(pmd, addr);
150 return (pte_present(*pte) && (!wr || pte_write(*pte)));
151 }
152 }
153 return 0;
154}
155
156static int copy_locked(void __user *uptr, void *kptr, size_t size, int write,
157 void (*copyfn)(void *, void __user *))
158{
159 unsigned char v, __user *userptr = uptr;
160 int err = 0;
161
162 do {
163 struct mm_struct *mm;
164
165 if (write) {
166 __put_user_error(0, userptr, err);
167 __put_user_error(0, userptr + size - 1, err);
168 } else {
169 __get_user_error(v, userptr, err);
170 __get_user_error(v, userptr + size - 1, err);
171 }
172
173 if (err)
174 break;
175
176 mm = current->mm;
177 spin_lock(&mm->page_table_lock);
178 if (page_present(mm, userptr, write) &&
179 page_present(mm, userptr + size - 1, write)) {
180 copyfn(kptr, uptr);
181 } else
182 err = 1;
183 spin_unlock(&mm->page_table_lock);
184 } while (err);
185
186 return err;
187}
188
189static int preserve_iwmmxt_context(struct iwmmxt_sigframe *frame) 142static int preserve_iwmmxt_context(struct iwmmxt_sigframe *frame)
190{ 143{
191 int err = 0; 144 char kbuf[sizeof(*frame) + 8];
145 struct iwmmxt_sigframe *kframe;
192 146
193 /* the iWMMXt context must be 64 bit aligned */ 147 /* the iWMMXt context must be 64 bit aligned */
194 WARN_ON((unsigned long)frame & 7); 148 kframe = (struct iwmmxt_sigframe *)((unsigned long)(kbuf + 8) & ~7);
195 149 kframe->magic0 = IWMMXT_MAGIC0;
196 __put_user_error(IWMMXT_MAGIC0, &frame->magic0, err); 150 kframe->magic1 = IWMMXT_MAGIC1;
197 __put_user_error(IWMMXT_MAGIC1, &frame->magic1, err); 151 iwmmxt_task_copy(current_thread_info(), &kframe->storage);
198 152 return __copy_to_user(frame, kframe, sizeof(*frame));
199 /*
200 * iwmmxt_task_copy() doesn't check user permissions.
201 * Let's do a dummy write on the upper boundary to ensure
202 * access to user mem is OK all way up.
203 */
204 err |= copy_locked(&frame->storage, current_thread_info(),
205 sizeof(frame->storage), 1, iwmmxt_task_copy);
206 return err;
207} 153}
208 154
209static int restore_iwmmxt_context(struct iwmmxt_sigframe *frame) 155static int restore_iwmmxt_context(struct iwmmxt_sigframe *frame)
210{ 156{
211 unsigned long magic0, magic1; 157 char kbuf[sizeof(*frame) + 8];
212 int err = 0; 158 struct iwmmxt_sigframe *kframe;
213 159
214 /* the iWMMXt context is 64 bit aligned */ 160 /* the iWMMXt context must be 64 bit aligned */
215 WARN_ON((unsigned long)frame & 7); 161 kframe = (struct iwmmxt_sigframe *)((unsigned long)(kbuf + 8) & ~7);
216 162 if (__copy_from_user(kframe, frame, sizeof(*frame)))
217 /* 163 return -1;
218 * Validate iWMMXt context signature. 164 if (kframe->magic0 != IWMMXT_MAGIC0 ||
219 * Also, iwmmxt_task_restore() doesn't check user permissions. 165 kframe->magic1 != IWMMXT_MAGIC1)
220 * Let's do a dummy write on the upper boundary to ensure 166 return -1;
221 * access to user mem is OK all way up. 167 iwmmxt_task_restore(current_thread_info(), &kframe->storage);
222 */ 168 return 0;
223 __get_user_error(magic0, &frame->magic0, err);
224 __get_user_error(magic1, &frame->magic1, err);
225 if (!err && magic0 == IWMMXT_MAGIC0 && magic1 == IWMMXT_MAGIC1)
226 err = copy_locked(&frame->storage, current_thread_info(),
227 sizeof(frame->storage), 0, iwmmxt_task_restore);
228 return err;
229} 169}
230 170
231#endif 171#endif
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
index 69449a818dcc..fc4729106a32 100644
--- a/arch/arm/kernel/time.c
+++ b/arch/arm/kernel/time.c
@@ -36,10 +36,6 @@
36#include <asm/thread_info.h> 36#include <asm/thread_info.h>
37#include <asm/mach/time.h> 37#include <asm/mach/time.h>
38 38
39u64 jiffies_64 = INITIAL_JIFFIES;
40
41EXPORT_SYMBOL(jiffies_64);
42
43/* 39/*
44 * Our system timer. 40 * Our system timer.
45 */ 41 */
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index baa09601a64e..45e9ea6cd2a5 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -198,25 +198,16 @@ void show_stack(struct task_struct *tsk, unsigned long *sp)
198 barrier(); 198 barrier();
199} 199}
200 200
201DEFINE_SPINLOCK(die_lock); 201static void __die(const char *str, int err, struct thread_info *thread, struct pt_regs *regs)
202
203/*
204 * This function is protected against re-entrancy.
205 */
206NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
207{ 202{
208 struct task_struct *tsk = current; 203 struct task_struct *tsk = thread->task;
209 static int die_counter; 204 static int die_counter;
210 205
211 console_verbose();
212 spin_lock_irq(&die_lock);
213 bust_spinlocks(1);
214
215 printk("Internal error: %s: %x [#%d]\n", str, err, ++die_counter); 206 printk("Internal error: %s: %x [#%d]\n", str, err, ++die_counter);
216 print_modules(); 207 print_modules();
217 __show_regs(regs); 208 __show_regs(regs);
218 printk("Process %s (pid: %d, stack limit = 0x%p)\n", 209 printk("Process %s (pid: %d, stack limit = 0x%p)\n",
219 tsk->comm, tsk->pid, tsk->thread_info + 1); 210 tsk->comm, tsk->pid, thread + 1);
220 211
221 if (!user_mode(regs) || in_interrupt()) { 212 if (!user_mode(regs) || in_interrupt()) {
222 dump_mem("Stack: ", regs->ARM_sp, 213 dump_mem("Stack: ", regs->ARM_sp,
@@ -224,7 +215,21 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
224 dump_backtrace(regs, tsk); 215 dump_backtrace(regs, tsk);
225 dump_instr(regs); 216 dump_instr(regs);
226 } 217 }
218}
219
220DEFINE_SPINLOCK(die_lock);
221
222/*
223 * This function is protected against re-entrancy.
224 */
225NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
226{
227 struct thread_info *thread = current_thread_info();
227 228
229 console_verbose();
230 spin_lock_irq(&die_lock);
231 bust_spinlocks(1);
232 __die(str, err, thread, regs);
228 bust_spinlocks(0); 233 bust_spinlocks(0);
229 spin_unlock_irq(&die_lock); 234 spin_unlock_irq(&die_lock);
230 do_exit(SIGSEGV); 235 do_exit(SIGSEGV);
@@ -483,29 +488,33 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
483 unsigned long addr = regs->ARM_r2; 488 unsigned long addr = regs->ARM_r2;
484 struct mm_struct *mm = current->mm; 489 struct mm_struct *mm = current->mm;
485 pgd_t *pgd; pmd_t *pmd; pte_t *pte; 490 pgd_t *pgd; pmd_t *pmd; pte_t *pte;
491 spinlock_t *ptl;
486 492
487 regs->ARM_cpsr &= ~PSR_C_BIT; 493 regs->ARM_cpsr &= ~PSR_C_BIT;
488 spin_lock(&mm->page_table_lock); 494 down_read(&mm->mmap_sem);
489 pgd = pgd_offset(mm, addr); 495 pgd = pgd_offset(mm, addr);
490 if (!pgd_present(*pgd)) 496 if (!pgd_present(*pgd))
491 goto bad_access; 497 goto bad_access;
492 pmd = pmd_offset(pgd, addr); 498 pmd = pmd_offset(pgd, addr);
493 if (!pmd_present(*pmd)) 499 if (!pmd_present(*pmd))
494 goto bad_access; 500 goto bad_access;
495 pte = pte_offset_map(pmd, addr); 501 pte = pte_offset_map_lock(mm, pmd, addr, &ptl);
496 if (!pte_present(*pte) || !pte_write(*pte)) 502 if (!pte_present(*pte) || !pte_write(*pte)) {
503 pte_unmap_unlock(pte, ptl);
497 goto bad_access; 504 goto bad_access;
505 }
498 val = *(unsigned long *)addr; 506 val = *(unsigned long *)addr;
499 val -= regs->ARM_r0; 507 val -= regs->ARM_r0;
500 if (val == 0) { 508 if (val == 0) {
501 *(unsigned long *)addr = regs->ARM_r1; 509 *(unsigned long *)addr = regs->ARM_r1;
502 regs->ARM_cpsr |= PSR_C_BIT; 510 regs->ARM_cpsr |= PSR_C_BIT;
503 } 511 }
504 spin_unlock(&mm->page_table_lock); 512 pte_unmap_unlock(pte, ptl);
513 up_read(&mm->mmap_sem);
505 return val; 514 return val;
506 515
507 bad_access: 516 bad_access:
508 spin_unlock(&mm->page_table_lock); 517 up_read(&mm->mmap_sem);
509 /* simulate a write access fault */ 518 /* simulate a write access fault */
510 do_DataAbort(addr, 15 + (1 << 11), regs); 519 do_DataAbort(addr, 15 + (1 << 11), regs);
511 return -1; 520 return -1;
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index 0d5db5279c5c..80c8e4c8cefa 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -6,14 +6,23 @@
6#include <asm-generic/vmlinux.lds.h> 6#include <asm-generic/vmlinux.lds.h>
7#include <linux/config.h> 7#include <linux/config.h>
8#include <asm/thread_info.h> 8#include <asm/thread_info.h>
9#include <asm/memory.h>
9 10
10OUTPUT_ARCH(arm) 11OUTPUT_ARCH(arm)
11ENTRY(stext) 12ENTRY(stext)
13
12#ifndef __ARMEB__ 14#ifndef __ARMEB__
13jiffies = jiffies_64; 15jiffies = jiffies_64;
14#else 16#else
15jiffies = jiffies_64 + 4; 17jiffies = jiffies_64 + 4;
16#endif 18#endif
19
20#ifdef CONFIG_XIP_KERNEL
21#define TEXTADDR XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR)
22#else
23#define TEXTADDR KERNEL_RAM_ADDR
24#endif
25
17SECTIONS 26SECTIONS
18{ 27{
19 . = TEXTADDR; 28 . = TEXTADDR;
@@ -95,7 +104,7 @@ SECTIONS
95 104
96#ifdef CONFIG_XIP_KERNEL 105#ifdef CONFIG_XIP_KERNEL
97 __data_loc = ALIGN(4); /* location in binary */ 106 __data_loc = ALIGN(4); /* location in binary */
98 . = DATAADDR; 107 . = KERNEL_RAM_ADDR;
99#else 108#else
100 . = ALIGN(THREAD_SIZE); 109 . = ALIGN(THREAD_SIZE);
101 __data_loc = .; 110 __data_loc = .;
diff --git a/arch/arm/lib/ashldi3.S b/arch/arm/lib/ashldi3.S
new file mode 100644
index 000000000000..561e20717b30
--- /dev/null
+++ b/arch/arm/lib/ashldi3.S
@@ -0,0 +1,48 @@
1/* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004, 2005
2 Free Software Foundation, Inc.
3
4This file is free software; you can redistribute it and/or modify it
5under the terms of the GNU General Public License as published by the
6Free Software Foundation; either version 2, or (at your option) any
7later version.
8
9In addition to the permissions in the GNU General Public License, the
10Free Software Foundation gives you unlimited permission to link the
11compiled version of this file into combinations with other programs,
12and to distribute those combinations without any restriction coming
13from the use of this file. (The General Public License restrictions
14do apply in other respects; for example, they cover modification of
15the file, and distribution when not linked into a combine
16executable.)
17
18This file is distributed in the hope that it will be useful, but
19WITHOUT ANY WARRANTY; without even the implied warranty of
20MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21General Public License for more details.
22
23You should have received a copy of the GNU General Public License
24along with this program; see the file COPYING. If not, write to
25the Free Software Foundation, 51 Franklin Street, Fifth Floor,
26Boston, MA 02110-1301, USA. */
27
28
29#include <linux/linkage.h>
30
31#ifdef __ARMEB__
32#define al r1
33#define ah r0
34#else
35#define al r0
36#define ah r1
37#endif
38
39ENTRY(__ashldi3)
40
41 subs r3, r2, #32
42 rsb ip, r2, #32
43 movmi ah, ah, lsl r2
44 movpl ah, al, lsl r3
45 orrmi ah, ah, al, lsr ip
46 mov al, al, lsl r2
47 mov pc, lr
48
diff --git a/arch/arm/lib/ashldi3.c b/arch/arm/lib/ashldi3.c
deleted file mode 100644
index b62875cfd8f8..000000000000
--- a/arch/arm/lib/ashldi3.c
+++ /dev/null
@@ -1,56 +0,0 @@
1/* More subroutines needed by GCC output code on some machines. */
2/* Compile this one with gcc. */
3/* Copyright (C) 1989, 92-98, 1999 Free Software Foundation, Inc.
4
5This file is part of GNU CC.
6
7GNU CC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12GNU CC is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU CC; see the file COPYING. If not, write to
19the Free Software Foundation, 59 Temple Place - Suite 330,
20Boston, MA 02111-1307, USA. */
21
22/* As a special exception, if you link this library with other files,
23 some of which are compiled with GCC, to produce an executable,
24 this library does not by itself cause the resulting executable
25 to be covered by the GNU General Public License.
26 This exception does not however invalidate any other reasons why
27 the executable file might be covered by the GNU General Public License.
28 */
29/* support functions required by the kernel. based on code from gcc-2.95.3 */
30/* I Molton 29/07/01 */
31
32#include "gcclib.h"
33
34s64 __ashldi3(s64 u, int b)
35{
36 DIunion w;
37 int bm;
38 DIunion uu;
39
40 if (b == 0)
41 return u;
42
43 uu.ll = u;
44
45 bm = (sizeof(s32) * BITS_PER_UNIT) - b;
46 if (bm <= 0) {
47 w.s.low = 0;
48 w.s.high = (u32) uu.s.low << -bm;
49 } else {
50 u32 carries = (u32) uu.s.low >> bm;
51 w.s.low = (u32) uu.s.low << b;
52 w.s.high = ((u32) uu.s.high << b) | carries;
53 }
54
55 return w.ll;
56}
diff --git a/arch/arm/lib/ashrdi3.S b/arch/arm/lib/ashrdi3.S
new file mode 100644
index 000000000000..86fb2a90c301
--- /dev/null
+++ b/arch/arm/lib/ashrdi3.S
@@ -0,0 +1,48 @@
1/* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004, 2005
2 Free Software Foundation, Inc.
3
4This file is free software; you can redistribute it and/or modify it
5under the terms of the GNU General Public License as published by the
6Free Software Foundation; either version 2, or (at your option) any
7later version.
8
9In addition to the permissions in the GNU General Public License, the
10Free Software Foundation gives you unlimited permission to link the
11compiled version of this file into combinations with other programs,
12and to distribute those combinations without any restriction coming
13from the use of this file. (The General Public License restrictions
14do apply in other respects; for example, they cover modification of
15the file, and distribution when not linked into a combine
16executable.)
17
18This file is distributed in the hope that it will be useful, but
19WITHOUT ANY WARRANTY; without even the implied warranty of
20MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21General Public License for more details.
22
23You should have received a copy of the GNU General Public License
24along with this program; see the file COPYING. If not, write to
25the Free Software Foundation, 51 Franklin Street, Fifth Floor,
26Boston, MA 02110-1301, USA. */
27
28
29#include <linux/linkage.h>
30
31#ifdef __ARMEB__
32#define al r1
33#define ah r0
34#else
35#define al r0
36#define ah r1
37#endif
38
39ENTRY(__ashrdi3)
40
41 subs r3, r2, #32
42 rsb ip, r2, #32
43 movmi al, al, lsr r2
44 movpl al, ah, asr r3
45 orrmi al, al, ah, lsl ip
46 mov ah, ah, asr r2
47 mov pc, lr
48
diff --git a/arch/arm/lib/ashrdi3.c b/arch/arm/lib/ashrdi3.c
deleted file mode 100644
index 9a8600a7543f..000000000000
--- a/arch/arm/lib/ashrdi3.c
+++ /dev/null
@@ -1,57 +0,0 @@
1/* More subroutines needed by GCC output code on some machines. */
2/* Compile this one with gcc. */
3/* Copyright (C) 1989, 92-98, 1999 Free Software Foundation, Inc.
4
5This file is part of GNU CC.
6
7GNU CC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12GNU CC is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU CC; see the file COPYING. If not, write to
19the Free Software Foundation, 59 Temple Place - Suite 330,
20Boston, MA 02111-1307, USA. */
21
22/* As a special exception, if you link this library with other files,
23 some of which are compiled with GCC, to produce an executable,
24 this library does not by itself cause the resulting executable
25 to be covered by the GNU General Public License.
26 This exception does not however invalidate any other reasons why
27 the executable file might be covered by the GNU General Public License.
28 */
29/* support functions required by the kernel. based on code from gcc-2.95.3 */
30/* I Molton 29/07/01 */
31
32#include "gcclib.h"
33
34s64 __ashrdi3(s64 u, int b)
35{
36 DIunion w;
37 int bm;
38 DIunion uu;
39
40 if (b == 0)
41 return u;
42
43 uu.ll = u;
44
45 bm = (sizeof(s32) * BITS_PER_UNIT) - b;
46 if (bm <= 0) {
47 /* w.s.high = 1..1 or 0..0 */
48 w.s.high = uu.s.high >> (sizeof(s32) * BITS_PER_UNIT - 1);
49 w.s.low = uu.s.high >> -bm;
50 } else {
51 u32 carries = (u32) uu.s.high << bm;
52 w.s.high = uu.s.high >> b;
53 w.s.low = ((u32) uu.s.low >> b) | carries;
54 }
55
56 return w.ll;
57}
diff --git a/arch/arm/lib/gcclib.h b/arch/arm/lib/gcclib.h
deleted file mode 100644
index 8b6dcc656de7..000000000000
--- a/arch/arm/lib/gcclib.h
+++ /dev/null
@@ -1,22 +0,0 @@
1/* gcclib.h -- definitions for various functions 'borrowed' from gcc-2.95.3 */
2/* I Molton 29/07/01 */
3
4#include <linux/types.h>
5
6#define BITS_PER_UNIT 8
7#define SI_TYPE_SIZE (sizeof(s32) * BITS_PER_UNIT)
8
9#ifdef __ARMEB__
10struct DIstruct {
11 s32 high, low;
12};
13#else
14struct DIstruct {
15 s32 low, high;
16};
17#endif
18
19typedef union {
20 struct DIstruct s;
21 s64 ll;
22} DIunion;
diff --git a/arch/arm/lib/lshrdi3.S b/arch/arm/lib/lshrdi3.S
new file mode 100644
index 000000000000..46c2ed19ec95
--- /dev/null
+++ b/arch/arm/lib/lshrdi3.S
@@ -0,0 +1,48 @@
1/* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004, 2005
2 Free Software Foundation, Inc.
3
4This file is free software; you can redistribute it and/or modify it
5under the terms of the GNU General Public License as published by the
6Free Software Foundation; either version 2, or (at your option) any
7later version.
8
9In addition to the permissions in the GNU General Public License, the
10Free Software Foundation gives you unlimited permission to link the
11compiled version of this file into combinations with other programs,
12and to distribute those combinations without any restriction coming
13from the use of this file. (The General Public License restrictions
14do apply in other respects; for example, they cover modification of
15the file, and distribution when not linked into a combine
16executable.)
17
18This file is distributed in the hope that it will be useful, but
19WITHOUT ANY WARRANTY; without even the implied warranty of
20MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21General Public License for more details.
22
23You should have received a copy of the GNU General Public License
24along with this program; see the file COPYING. If not, write to
25the Free Software Foundation, 51 Franklin Street, Fifth Floor,
26Boston, MA 02110-1301, USA. */
27
28
29#include <linux/linkage.h>
30
31#ifdef __ARMEB__
32#define al r1
33#define ah r0
34#else
35#define al r0
36#define ah r1
37#endif
38
39ENTRY(__lshrdi3)
40
41 subs r3, r2, #32
42 rsb ip, r2, #32
43 movmi al, al, lsr r2
44 movpl al, ah, lsr r3
45 orrmi al, al, ah, lsl ip
46 mov ah, ah, lsr r2
47 mov pc, lr
48
diff --git a/arch/arm/lib/lshrdi3.c b/arch/arm/lib/lshrdi3.c
deleted file mode 100644
index 3681f49d2b6e..000000000000
--- a/arch/arm/lib/lshrdi3.c
+++ /dev/null
@@ -1,56 +0,0 @@
1/* More subroutines needed by GCC output code on some machines. */
2/* Compile this one with gcc. */
3/* Copyright (C) 1989, 92-98, 1999 Free Software Foundation, Inc.
4
5This file is part of GNU CC.
6
7GNU CC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12GNU CC is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU CC; see the file COPYING. If not, write to
19the Free Software Foundation, 59 Temple Place - Suite 330,
20Boston, MA 02111-1307, USA. */
21
22/* As a special exception, if you link this library with other files,
23 some of which are compiled with GCC, to produce an executable,
24 this library does not by itself cause the resulting executable
25 to be covered by the GNU General Public License.
26 This exception does not however invalidate any other reasons why
27 the executable file might be covered by the GNU General Public License.
28 */
29/* support functions required by the kernel. based on code from gcc-2.95.3 */
30/* I Molton 29/07/01 */
31
32#include "gcclib.h"
33
34s64 __lshrdi3(s64 u, int b)
35{
36 DIunion w;
37 int bm;
38 DIunion uu;
39
40 if (b == 0)
41 return u;
42
43 uu.ll = u;
44
45 bm = (sizeof(s32) * BITS_PER_UNIT) - b;
46 if (bm <= 0) {
47 w.s.high = 0;
48 w.s.low = (u32) uu.s.high >> -bm;
49 } else {
50 u32 carries = (u32) uu.s.high << bm;
51 w.s.high = (u32) uu.s.high >> b;
52 w.s.low = ((u32) uu.s.low >> b) | carries;
53 }
54
55 return w.ll;
56}
diff --git a/arch/arm/lib/muldi3.S b/arch/arm/lib/muldi3.S
new file mode 100644
index 000000000000..c7fbdf005319
--- /dev/null
+++ b/arch/arm/lib/muldi3.S
@@ -0,0 +1,44 @@
1/*
2 * linux/arch/arm/lib/muldi3.S
3 *
4 * Author: Nicolas Pitre
5 * Created: Oct 19, 2005
6 * Copyright: Monta Vista Software, Inc.
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 version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/linkage.h>
14
15#ifdef __ARMEB__
16#define xh r0
17#define xl r1
18#define yh r2
19#define yl r3
20#else
21#define xl r0
22#define xh r1
23#define yl r2
24#define yh r3
25#endif
26
27ENTRY(__muldi3)
28
29 mul xh, yl, xh
30 mla xh, xl, yh, xh
31 mov ip, xl, asr #16
32 mov yh, yl, asr #16
33 bic xl, xl, ip, lsl #16
34 bic yl, yl, yh, lsl #16
35 mla xh, yh, ip, xh
36 mul yh, xl, yh
37 mul xl, yl, xl
38 mul ip, yl, ip
39 adds xl, xl, yh, lsl #16
40 adc xh, xh, yh, lsr #16
41 adds xl, xl, ip, lsl #16
42 adc xh, xh, ip, lsr #16
43 mov pc, lr
44
diff --git a/arch/arm/lib/muldi3.c b/arch/arm/lib/muldi3.c
deleted file mode 100644
index 0a3b93313f18..000000000000
--- a/arch/arm/lib/muldi3.c
+++ /dev/null
@@ -1,72 +0,0 @@
1/* More subroutines needed by GCC output code on some machines. */
2/* Compile this one with gcc. */
3/* Copyright (C) 1989, 92-98, 1999 Free Software Foundation, Inc.
4
5This file is part of GNU CC.
6
7GNU CC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12GNU CC is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU CC; see the file COPYING. If not, write to
19the Free Software Foundation, 59 Temple Place - Suite 330,
20Boston, MA 02111-1307, USA. */
21
22/* As a special exception, if you link this library with other files,
23 some of which are compiled with GCC, to produce an executable,
24 this library does not by itself cause the resulting executable
25 to be covered by the GNU General Public License.
26 This exception does not however invalidate any other reasons why
27 the executable file might be covered by the GNU General Public License.
28 */
29/* support functions required by the kernel. based on code from gcc-2.95.3 */
30/* I Molton 29/07/01 */
31
32#include "gcclib.h"
33
34#define umul_ppmm(xh, xl, a, b) \
35{register u32 __t0, __t1, __t2; \
36 __asm__ ("%@ Inlined umul_ppmm \n\
37 mov %2, %5, lsr #16 \n\
38 mov %0, %6, lsr #16 \n\
39 bic %3, %5, %2, lsl #16 \n\
40 bic %4, %6, %0, lsl #16 \n\
41 mul %1, %3, %4 \n\
42 mul %4, %2, %4 \n\
43 mul %3, %0, %3 \n\
44 mul %0, %2, %0 \n\
45 adds %3, %4, %3 \n\
46 addcs %0, %0, #65536 \n\
47 adds %1, %1, %3, lsl #16 \n\
48 adc %0, %0, %3, lsr #16" \
49 : "=&r" ((u32) (xh)), \
50 "=r" ((u32) (xl)), \
51 "=&r" (__t0), "=&r" (__t1), "=r" (__t2) \
52 : "r" ((u32) (a)), \
53 "r" ((u32) (b)));}
54
55#define __umulsidi3(u, v) \
56 ({DIunion __w; \
57 umul_ppmm (__w.s.high, __w.s.low, u, v); \
58 __w.ll; })
59
60s64 __muldi3(s64 u, s64 v)
61{
62 DIunion w;
63 DIunion uu, vv;
64
65 uu.ll = u, vv.ll = v;
66
67 w.ll = __umulsidi3(uu.s.low, vv.s.low);
68 w.s.high += ((u32) uu.s.low * (u32) vv.s.high
69 + (u32) uu.s.high * (u32) vv.s.low);
70
71 return w.ll;
72}
diff --git a/arch/arm/lib/ucmpdi2.S b/arch/arm/lib/ucmpdi2.S
new file mode 100644
index 000000000000..112630f93e5d
--- /dev/null
+++ b/arch/arm/lib/ucmpdi2.S
@@ -0,0 +1,35 @@
1/*
2 * linux/arch/arm/lib/ucmpdi2.S
3 *
4 * Author: Nicolas Pitre
5 * Created: Oct 19, 2005
6 * Copyright: Monta Vista Software, Inc.
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 version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/linkage.h>
14
15#ifdef __ARMEB__
16#define xh r0
17#define xl r1
18#define yh r2
19#define yl r3
20#else
21#define xl r0
22#define xh r1
23#define yl r2
24#define yh r3
25#endif
26
27ENTRY(__ucmpdi2)
28
29 cmp xh, yh
30 cmpeq xl, yl
31 movlo r0, #0
32 moveq r0, #1
33 movhi r0, #2
34 mov pc, lr
35
diff --git a/arch/arm/lib/ucmpdi2.c b/arch/arm/lib/ucmpdi2.c
deleted file mode 100644
index 57f3f2df3850..000000000000
--- a/arch/arm/lib/ucmpdi2.c
+++ /dev/null
@@ -1,49 +0,0 @@
1/* More subroutines needed by GCC output code on some machines. */
2/* Compile this one with gcc. */
3/* Copyright (C) 1989, 92-98, 1999 Free Software Foundation, Inc.
4
5This file is part of GNU CC.
6
7GNU CC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12GNU CC is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU CC; see the file COPYING. If not, write to
19the Free Software Foundation, 59 Temple Place - Suite 330,
20Boston, MA 02111-1307, USA. */
21
22/* As a special exception, if you link this library with other files,
23 some of which are compiled with GCC, to produce an executable,
24 this library does not by itself cause the resulting executable
25 to be covered by the GNU General Public License.
26 This exception does not however invalidate any other reasons why
27 the executable file might be covered by the GNU General Public License.
28 */
29/* support functions required by the kernel. based on code from gcc-2.95.3 */
30/* I Molton 29/07/01 */
31
32#include "gcclib.h"
33
34int __ucmpdi2(s64 a, s64 b)
35{
36 DIunion au, bu;
37
38 au.ll = a, bu.ll = b;
39
40 if ((u32) au.s.high < (u32) bu.s.high)
41 return 0;
42 else if ((u32) au.s.high > (u32) bu.s.high)
43 return 2;
44 if ((u32) au.s.low < (u32) bu.s.low)
45 return 0;
46 else if ((u32) au.s.low > (u32) bu.s.low)
47 return 2;
48 return 1;
49}
diff --git a/arch/arm/mach-imx/generic.c b/arch/arm/mach-imx/generic.c
index 60e2361e98e8..37613ad68366 100644
--- a/arch/arm/mach-imx/generic.c
+++ b/arch/arm/mach-imx/generic.c
@@ -26,6 +26,8 @@
26#include <linux/init.h> 26#include <linux/init.h>
27#include <linux/kernel.h> 27#include <linux/kernel.h>
28#include <linux/module.h> 28#include <linux/module.h>
29#include <linux/string.h>
30
29#include <asm/arch/imxfb.h> 31#include <asm/arch/imxfb.h>
30#include <asm/hardware.h> 32#include <asm/hardware.h>
31#include <asm/arch/imx-regs.h> 33#include <asm/arch/imx-regs.h>
diff --git a/arch/arm/mach-integrator/clock.c b/arch/arm/mach-integrator/clock.c
index 56200594db3c..73c360685cad 100644
--- a/arch/arm/mach-integrator/clock.c
+++ b/arch/arm/mach-integrator/clock.c
@@ -13,6 +13,7 @@
13#include <linux/list.h> 13#include <linux/list.h>
14#include <linux/errno.h> 14#include <linux/errno.h>
15#include <linux/err.h> 15#include <linux/err.h>
16#include <linux/string.h>
16 17
17#include <asm/semaphore.h> 18#include <asm/semaphore.h>
18#include <asm/hardware/clock.h> 19#include <asm/hardware/clock.h>
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c
index 1f9061ca7ef4..4c0f7c65facf 100644
--- a/arch/arm/mach-integrator/integrator_ap.c
+++ b/arch/arm/mach-integrator/integrator_ap.c
@@ -30,6 +30,7 @@
30#include <asm/io.h> 30#include <asm/io.h>
31#include <asm/irq.h> 31#include <asm/irq.h>
32#include <asm/setup.h> 32#include <asm/setup.h>
33#include <asm/param.h> /* HZ */
33#include <asm/mach-types.h> 34#include <asm/mach-types.h>
34#include <asm/hardware/amba.h> 35#include <asm/hardware/amba.h>
35#include <asm/hardware/amba_kmi.h> 36#include <asm/hardware/amba_kmi.h>
diff --git a/arch/arm/mach-integrator/lm.c b/arch/arm/mach-integrator/lm.c
index c5f19d160598..5b41e3a724e1 100644
--- a/arch/arm/mach-integrator/lm.c
+++ b/arch/arm/mach-integrator/lm.c
@@ -10,6 +10,7 @@
10#include <linux/module.h> 10#include <linux/module.h>
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/device.h> 12#include <linux/device.h>
13#include <linux/slab.h>
13 14
14#include <asm/arch/lm.h> 15#include <asm/arch/lm.h>
15 16
diff --git a/arch/arm/mach-iop3xx/iq31244-pci.c b/arch/arm/mach-iop3xx/iq31244-pci.c
index f997daa800bf..c6a973ba8fc6 100644
--- a/arch/arm/mach-iop3xx/iq31244-pci.c
+++ b/arch/arm/mach-iop3xx/iq31244-pci.c
@@ -14,6 +14,8 @@
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/pci.h> 15#include <linux/pci.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/string.h>
18#include <linux/slab.h>
17 19
18#include <asm/hardware.h> 20#include <asm/hardware.h>
19#include <asm/irq.h> 21#include <asm/irq.h>
diff --git a/arch/arm/mach-iop3xx/iq80321-pci.c b/arch/arm/mach-iop3xx/iq80321-pci.c
index 79fea3d20b66..802f6d091b75 100644
--- a/arch/arm/mach-iop3xx/iq80321-pci.c
+++ b/arch/arm/mach-iop3xx/iq80321-pci.c
@@ -14,6 +14,8 @@
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/pci.h> 15#include <linux/pci.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/string.h>
18#include <linux/slab.h>
17 19
18#include <asm/hardware.h> 20#include <asm/hardware.h>
19#include <asm/irq.h> 21#include <asm/irq.h>
diff --git a/arch/arm/mach-iop3xx/iq80331-pci.c b/arch/arm/mach-iop3xx/iq80331-pci.c
index f37a0e26b466..654e450a1311 100644
--- a/arch/arm/mach-iop3xx/iq80331-pci.c
+++ b/arch/arm/mach-iop3xx/iq80331-pci.c
@@ -13,6 +13,8 @@
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/pci.h> 14#include <linux/pci.h>
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/string.h>
17#include <linux/slab.h>
16 18
17#include <asm/hardware.h> 19#include <asm/hardware.h>
18#include <asm/irq.h> 20#include <asm/irq.h>
diff --git a/arch/arm/mach-iop3xx/iq80332-pci.c b/arch/arm/mach-iop3xx/iq80332-pci.c
index b9807aa2aade..65951ffe4631 100644
--- a/arch/arm/mach-iop3xx/iq80332-pci.c
+++ b/arch/arm/mach-iop3xx/iq80332-pci.c
@@ -13,6 +13,8 @@
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/pci.h> 14#include <linux/pci.h>
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/string.h>
17#include <linux/slab.h>
16 18
17#include <asm/hardware.h> 19#include <asm/hardware.h>
18#include <asm/irq.h> 20#include <asm/irq.h>
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index 247147f29b93..eb5f6d744a4a 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -33,6 +33,7 @@
33 33
34#include <asm/arch/pxa-regs.h> 34#include <asm/arch/pxa-regs.h>
35#include <asm/arch/irq.h> 35#include <asm/arch/irq.h>
36#include <asm/arch/irda.h>
36#include <asm/arch/mmc.h> 37#include <asm/arch/mmc.h>
37#include <asm/arch/udc.h> 38#include <asm/arch/udc.h>
38#include <asm/arch/corgi.h> 39#include <asm/arch/corgi.h>
@@ -224,6 +225,22 @@ static struct pxamci_platform_data corgi_mci_platform_data = {
224}; 225};
225 226
226 227
228/*
229 * Irda
230 */
231static void corgi_irda_transceiver_mode(struct device *dev, int mode)
232{
233 if (mode & IR_OFF)
234 GPSR(CORGI_GPIO_IR_ON) = GPIO_bit(CORGI_GPIO_IR_ON);
235 else
236 GPCR(CORGI_GPIO_IR_ON) = GPIO_bit(CORGI_GPIO_IR_ON);
237}
238
239static struct pxaficp_platform_data corgi_ficp_platform_data = {
240 .transceiver_cap = IR_SIRMODE | IR_OFF,
241 .transceiver_mode = corgi_irda_transceiver_mode,
242};
243
227 244
228/* 245/*
229 * USB Device Controller 246 * USB Device Controller
@@ -269,10 +286,13 @@ static void __init corgi_init(void)
269 286
270 corgi_ssp_set_machinfo(&corgi_ssp_machinfo); 287 corgi_ssp_set_machinfo(&corgi_ssp_machinfo);
271 288
289 pxa_gpio_mode(CORGI_GPIO_IR_ON | GPIO_OUT);
272 pxa_gpio_mode(CORGI_GPIO_USB_PULLUP | GPIO_OUT); 290 pxa_gpio_mode(CORGI_GPIO_USB_PULLUP | GPIO_OUT);
273 pxa_gpio_mode(CORGI_GPIO_HSYNC | GPIO_IN); 291 pxa_gpio_mode(CORGI_GPIO_HSYNC | GPIO_IN);
292
274 pxa_set_udc_info(&udc_info); 293 pxa_set_udc_info(&udc_info);
275 pxa_set_mci_info(&corgi_mci_platform_data); 294 pxa_set_mci_info(&corgi_mci_platform_data);
295 pxa_set_ficp_info(&corgi_ficp_platform_data);
276 296
277 scoop_num = 1; 297 scoop_num = 1;
278 scoop_devs = &corgi_pcmcia_scoop[0]; 298 scoop_devs = &corgi_pcmcia_scoop[0];
diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c
index afd5063b0ebe..9b48a90aefce 100644
--- a/arch/arm/mach-pxa/generic.c
+++ b/arch/arm/mach-pxa/generic.c
@@ -23,6 +23,7 @@
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/ioport.h> 24#include <linux/ioport.h>
25#include <linux/pm.h> 25#include <linux/pm.h>
26#include <linux/string.h>
26 27
27#include <asm/hardware.h> 28#include <asm/hardware.h>
28#include <asm/irq.h> 29#include <asm/irq.h>
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index 86326307ab9f..ad6a13f95a62 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -32,6 +32,7 @@
32#include <asm/arch/irq.h> 32#include <asm/arch/irq.h>
33#include <asm/arch/mmc.h> 33#include <asm/arch/mmc.h>
34#include <asm/arch/udc.h> 34#include <asm/arch/udc.h>
35#include <asm/arch/irda.h>
35#include <asm/arch/poodle.h> 36#include <asm/arch/poodle.h>
36#include <asm/arch/pxafb.h> 37#include <asm/arch/pxafb.h>
37 38
@@ -152,6 +153,24 @@ static struct pxamci_platform_data poodle_mci_platform_data = {
152 153
153 154
154/* 155/*
156 * Irda
157 */
158static void poodle_irda_transceiver_mode(struct device *dev, int mode)
159{
160 if (mode & IR_OFF) {
161 GPSR(POODLE_GPIO_IR_ON) = GPIO_bit(POODLE_GPIO_IR_ON);
162 } else {
163 GPCR(POODLE_GPIO_IR_ON) = GPIO_bit(POODLE_GPIO_IR_ON);
164 }
165}
166
167static struct pxaficp_platform_data poodle_ficp_platform_data = {
168 .transceiver_cap = IR_SIRMODE | IR_OFF,
169 .transceiver_mode = poodle_irda_transceiver_mode,
170};
171
172
173/*
155 * USB Device Controller 174 * USB Device Controller
156 */ 175 */
157static void poodle_udc_command(int cmd) 176static void poodle_udc_command(int cmd)
@@ -244,8 +263,10 @@ static void __init poodle_init(void)
244 263
245 set_pxa_fb_info(&poodle_fb_info); 264 set_pxa_fb_info(&poodle_fb_info);
246 pxa_gpio_mode(POODLE_GPIO_USB_PULLUP | GPIO_OUT); 265 pxa_gpio_mode(POODLE_GPIO_USB_PULLUP | GPIO_OUT);
266 pxa_gpio_mode(POODLE_GPIO_IR_ON | GPIO_OUT);
247 pxa_set_udc_info(&udc_info); 267 pxa_set_udc_info(&udc_info);
248 pxa_set_mci_info(&poodle_mci_platform_data); 268 pxa_set_mci_info(&poodle_mci_platform_data);
269 pxa_set_ficp_info(&poodle_ficp_platform_data);
249 270
250 scoop_num = 1; 271 scoop_num = 1;
251 scoop_devs = &poodle_pcmcia_scoop[0]; 272 scoop_devs = &poodle_pcmcia_scoop[0];
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index 4182ddf330da..6c6878cd2207 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -34,6 +34,7 @@
34 34
35#include <asm/arch/pxa-regs.h> 35#include <asm/arch/pxa-regs.h>
36#include <asm/arch/irq.h> 36#include <asm/arch/irq.h>
37#include <asm/arch/irda.h>
37#include <asm/arch/mmc.h> 38#include <asm/arch/mmc.h>
38#include <asm/arch/udc.h> 39#include <asm/arch/udc.h>
39#include <asm/arch/pxafb.h> 40#include <asm/arch/pxafb.h>
@@ -277,6 +278,23 @@ static struct pxamci_platform_data spitz_mci_platform_data = {
277 278
278 279
279/* 280/*
281 * Irda
282 */
283static void spitz_irda_transceiver_mode(struct device *dev, int mode)
284{
285 if (mode & IR_OFF)
286 set_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_IR_ON);
287 else
288 reset_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_IR_ON);
289}
290
291static struct pxaficp_platform_data spitz_ficp_platform_data = {
292 .transceiver_cap = IR_SIRMODE | IR_OFF,
293 .transceiver_mode = spitz_irda_transceiver_mode,
294};
295
296
297/*
280 * Spitz PXA Framebuffer 298 * Spitz PXA Framebuffer
281 */ 299 */
282static struct pxafb_mach_info spitz_pxafb_info __initdata = { 300static struct pxafb_mach_info spitz_pxafb_info __initdata = {
@@ -326,6 +344,7 @@ static void __init common_init(void)
326 344
327 platform_add_devices(devices, ARRAY_SIZE(devices)); 345 platform_add_devices(devices, ARRAY_SIZE(devices));
328 pxa_set_mci_info(&spitz_mci_platform_data); 346 pxa_set_mci_info(&spitz_mci_platform_data);
347 pxa_set_ficp_info(&spitz_ficp_platform_data);
329 set_pxa_fb_parent(&spitzssp_device.dev); 348 set_pxa_fb_parent(&spitzssp_device.dev);
330 set_pxa_fb_info(&spitz_pxafb_info); 349 set_pxa_fb_info(&spitz_pxafb_info);
331} 350}
diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c
index 976380bde417..2abdc419e984 100644
--- a/arch/arm/mach-sa1100/generic.c
+++ b/arch/arm/mach-sa1100/generic.c
@@ -17,6 +17,7 @@
17#include <linux/pm.h> 17#include <linux/pm.h>
18#include <linux/cpufreq.h> 18#include <linux/cpufreq.h>
19#include <linux/ioport.h> 19#include <linux/ioport.h>
20#include <linux/sched.h> /* just for sched_clock() - funny that */
20#include <linux/platform_device.h> 21#include <linux/platform_device.h>
21 22
22#include <asm/div64.h> 23#include <asm/div64.h>
@@ -24,6 +25,7 @@
24#include <asm/system.h> 25#include <asm/system.h>
25#include <asm/pgtable.h> 26#include <asm/pgtable.h>
26#include <asm/mach/map.h> 27#include <asm/mach/map.h>
28#include <asm/mach/flash.h>
27#include <asm/irq.h> 29#include <asm/irq.h>
28 30
29#include "generic.h" 31#include "generic.h"
@@ -284,6 +286,7 @@ static struct platform_device sa11x0mtd_device = {
284void sa11x0_set_flash_data(struct flash_platform_data *flash, 286void sa11x0_set_flash_data(struct flash_platform_data *flash,
285 struct resource *res, int nr) 287 struct resource *res, int nr)
286{ 288{
289 flash->name = "sa1100";
287 sa11x0mtd_device.dev.platform_data = flash; 290 sa11x0mtd_device.dev.platform_data = flash;
288 sa11x0mtd_device.resource = res; 291 sa11x0mtd_device.resource = res;
289 sa11x0mtd_device.num_resources = nr; 292 sa11x0mtd_device.num_resources = nr;
diff --git a/arch/arm/mach-sa1100/jornada720.c b/arch/arm/mach-sa1100/jornada720.c
index 9fb65cffa578..2f671cc3cb99 100644
--- a/arch/arm/mach-sa1100/jornada720.c
+++ b/arch/arm/mach-sa1100/jornada720.c
@@ -8,6 +8,8 @@
8#include <linux/delay.h> 8#include <linux/delay.h>
9#include <linux/platform_device.h> 9#include <linux/platform_device.h>
10#include <linux/ioport.h> 10#include <linux/ioport.h>
11#include <linux/mtd/mtd.h>
12#include <linux/mtd/partitions.h>
11 13
12#include <asm/hardware.h> 14#include <asm/hardware.h>
13#include <asm/hardware/sa1111.h> 15#include <asm/hardware/sa1111.h>
@@ -16,6 +18,7 @@
16#include <asm/setup.h> 18#include <asm/setup.h>
17 19
18#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
21#include <asm/mach/flash.h>
19#include <asm/mach/map.h> 22#include <asm/mach/map.h>
20#include <asm/mach/serial_sa1100.h> 23#include <asm/mach/serial_sa1100.h>
21 24
@@ -108,6 +111,66 @@ static void __init jornada720_map_io(void)
108 sa1100_register_uart(1, 1); 111 sa1100_register_uart(1, 1);
109} 112}
110 113
114static struct mtd_partition jornada720_partitions[] = {
115 {
116 .name = "JORNADA720 boot firmware",
117 .size = 0x00040000,
118 .offset = 0,
119 .mask_flags = MTD_WRITEABLE, /* force read-only */
120 }, {
121 .name = "JORNADA720 kernel",
122 .size = 0x000c0000,
123 .offset = 0x00040000,
124 }, {
125 .name = "JORNADA720 params",
126 .size = 0x00040000,
127 .offset = 0x00100000,
128 }, {
129 .name = "JORNADA720 initrd",
130 .size = 0x00100000,
131 .offset = 0x00140000,
132 }, {
133 .name = "JORNADA720 root cramfs",
134 .size = 0x00300000,
135 .offset = 0x00240000,
136 }, {
137 .name = "JORNADA720 usr cramfs",
138 .size = 0x00800000,
139 .offset = 0x00540000,
140 }, {
141 .name = "JORNADA720 usr local",
142 .size = 0, /* will expand to the end of the flash */
143 .offset = 0x00d00000,
144 }
145};
146
147static void jornada720_set_vpp(int vpp)
148{
149 if (vpp)
150 PPSR |= 0x80;
151 else
152 PPSR &= ~0x80;
153 PPDR |= 0x80;
154}
155
156static struct flash_platform_data jornada720_flash_data = {
157 .map_name = "cfi_probe",
158 .set_vpp = jornada720_set_vpp,
159 .parts = jornada720_partitions,
160 .nr_parts = ARRAY_SIZE(jornada720_partitions),
161};
162
163static struct resource jornada720_flash_resource = {
164 .start = SA1100_CS0_PHYS,
165 .end = SA1100_CS0_PHYS + SZ_32M - 1,
166 .flags = IORESOURCE_MEM,
167};
168
169static void __init jornada720_mach_init(void)
170{
171 sa11x0_set_flash_data(&jornada720_flash_data, &jornada720_flash_resource, 1);
172}
173
111MACHINE_START(JORNADA720, "HP Jornada 720") 174MACHINE_START(JORNADA720, "HP Jornada 720")
112 /* Maintainer: Michael Gernoth <michael@gernoth.net> */ 175 /* Maintainer: Michael Gernoth <michael@gernoth.net> */
113 .phys_ram = 0xc0000000, 176 .phys_ram = 0xc0000000,
@@ -117,4 +180,5 @@ MACHINE_START(JORNADA720, "HP Jornada 720")
117 .map_io = jornada720_map_io, 180 .map_io = jornada720_map_io,
118 .init_irq = sa1100_init_irq, 181 .init_irq = sa1100_init_irq,
119 .timer = &sa1100_timer, 182 .timer = &sa1100_timer,
183 .init_machine = jornada720_mach_init,
120MACHINE_END 184MACHINE_END
diff --git a/arch/arm/mach-versatile/clock.c b/arch/arm/mach-versatile/clock.c
index 48025c2b9987..b96a2ea15d41 100644
--- a/arch/arm/mach-versatile/clock.c
+++ b/arch/arm/mach-versatile/clock.c
@@ -13,6 +13,7 @@
13#include <linux/list.h> 13#include <linux/list.h>
14#include <linux/errno.h> 14#include <linux/errno.h>
15#include <linux/err.h> 15#include <linux/err.h>
16#include <linux/string.h>
16 17
17#include <asm/semaphore.h> 18#include <asm/semaphore.h>
18#include <asm/hardware/clock.h> 19#include <asm/hardware/clock.h>
diff --git a/arch/arm/mm/consistent.c b/arch/arm/mm/consistent.c
index 82f4d5e27c54..47b0b767f080 100644
--- a/arch/arm/mm/consistent.c
+++ b/arch/arm/mm/consistent.c
@@ -397,8 +397,6 @@ static int __init consistent_init(void)
397 pte_t *pte; 397 pte_t *pte;
398 int ret = 0; 398 int ret = 0;
399 399
400 spin_lock(&init_mm.page_table_lock);
401
402 do { 400 do {
403 pgd = pgd_offset(&init_mm, CONSISTENT_BASE); 401 pgd = pgd_offset(&init_mm, CONSISTENT_BASE);
404 pmd = pmd_alloc(&init_mm, pgd, CONSISTENT_BASE); 402 pmd = pmd_alloc(&init_mm, pgd, CONSISTENT_BASE);
@@ -409,7 +407,7 @@ static int __init consistent_init(void)
409 } 407 }
410 WARN_ON(!pmd_none(*pmd)); 408 WARN_ON(!pmd_none(*pmd));
411 409
412 pte = pte_alloc_kernel(&init_mm, pmd, CONSISTENT_BASE); 410 pte = pte_alloc_kernel(pmd, CONSISTENT_BASE);
413 if (!pte) { 411 if (!pte) {
414 printk(KERN_ERR "%s: no pte tables\n", __func__); 412 printk(KERN_ERR "%s: no pte tables\n", __func__);
415 ret = -ENOMEM; 413 ret = -ENOMEM;
@@ -419,8 +417,6 @@ static int __init consistent_init(void)
419 consistent_pte = pte; 417 consistent_pte = pte;
420 } while (0); 418 } while (0);
421 419
422 spin_unlock(&init_mm.page_table_lock);
423
424 return ret; 420 return ret;
425} 421}
426 422
diff --git a/arch/arm/mm/copypage-v6.c b/arch/arm/mm/copypage-v6.c
index 27d041574ea7..269ce6913ee9 100644
--- a/arch/arm/mm/copypage-v6.c
+++ b/arch/arm/mm/copypage-v6.c
@@ -22,9 +22,7 @@
22#endif 22#endif
23 23
24#define from_address (0xffff8000) 24#define from_address (0xffff8000)
25#define from_pgprot PAGE_KERNEL
26#define to_address (0xffffc000) 25#define to_address (0xffffc000)
27#define to_pgprot PAGE_KERNEL
28 26
29#define TOP_PTE(x) pte_offset_kernel(top_pmd, x) 27#define TOP_PTE(x) pte_offset_kernel(top_pmd, x)
30 28
@@ -34,7 +32,7 @@ static DEFINE_SPINLOCK(v6_lock);
34 * Copy the user page. No aliasing to deal with so we can just 32 * Copy the user page. No aliasing to deal with so we can just
35 * attack the kernel's existing mapping of these pages. 33 * attack the kernel's existing mapping of these pages.
36 */ 34 */
37void v6_copy_user_page_nonaliasing(void *kto, const void *kfrom, unsigned long vaddr) 35static void v6_copy_user_page_nonaliasing(void *kto, const void *kfrom, unsigned long vaddr)
38{ 36{
39 copy_page(kto, kfrom); 37 copy_page(kto, kfrom);
40} 38}
@@ -43,7 +41,7 @@ void v6_copy_user_page_nonaliasing(void *kto, const void *kfrom, unsigned long v
43 * Clear the user page. No aliasing to deal with so we can just 41 * Clear the user page. No aliasing to deal with so we can just
44 * attack the kernel's existing mapping of this page. 42 * attack the kernel's existing mapping of this page.
45 */ 43 */
46void v6_clear_user_page_nonaliasing(void *kaddr, unsigned long vaddr) 44static void v6_clear_user_page_nonaliasing(void *kaddr, unsigned long vaddr)
47{ 45{
48 clear_page(kaddr); 46 clear_page(kaddr);
49} 47}
@@ -51,7 +49,7 @@ void v6_clear_user_page_nonaliasing(void *kaddr, unsigned long vaddr)
51/* 49/*
52 * Copy the page, taking account of the cache colour. 50 * Copy the page, taking account of the cache colour.
53 */ 51 */
54void v6_copy_user_page_aliasing(void *kto, const void *kfrom, unsigned long vaddr) 52static void v6_copy_user_page_aliasing(void *kto, const void *kfrom, unsigned long vaddr)
55{ 53{
56 unsigned int offset = CACHE_COLOUR(vaddr); 54 unsigned int offset = CACHE_COLOUR(vaddr);
57 unsigned long from, to; 55 unsigned long from, to;
@@ -72,8 +70,8 @@ void v6_copy_user_page_aliasing(void *kto, const void *kfrom, unsigned long vadd
72 */ 70 */
73 spin_lock(&v6_lock); 71 spin_lock(&v6_lock);
74 72
75 set_pte(TOP_PTE(from_address) + offset, pfn_pte(__pa(kfrom) >> PAGE_SHIFT, from_pgprot)); 73 set_pte(TOP_PTE(from_address) + offset, pfn_pte(__pa(kfrom) >> PAGE_SHIFT, PAGE_KERNEL));
76 set_pte(TOP_PTE(to_address) + offset, pfn_pte(__pa(kto) >> PAGE_SHIFT, to_pgprot)); 74 set_pte(TOP_PTE(to_address) + offset, pfn_pte(__pa(kto) >> PAGE_SHIFT, PAGE_KERNEL));
77 75
78 from = from_address + (offset << PAGE_SHIFT); 76 from = from_address + (offset << PAGE_SHIFT);
79 to = to_address + (offset << PAGE_SHIFT); 77 to = to_address + (offset << PAGE_SHIFT);
@@ -91,7 +89,7 @@ void v6_copy_user_page_aliasing(void *kto, const void *kfrom, unsigned long vadd
91 * so remap the kernel page into the same cache colour as the user 89 * so remap the kernel page into the same cache colour as the user
92 * page. 90 * page.
93 */ 91 */
94void v6_clear_user_page_aliasing(void *kaddr, unsigned long vaddr) 92static void v6_clear_user_page_aliasing(void *kaddr, unsigned long vaddr)
95{ 93{
96 unsigned int offset = CACHE_COLOUR(vaddr); 94 unsigned int offset = CACHE_COLOUR(vaddr);
97 unsigned long to = to_address + (offset << PAGE_SHIFT); 95 unsigned long to = to_address + (offset << PAGE_SHIFT);
@@ -112,7 +110,7 @@ void v6_clear_user_page_aliasing(void *kaddr, unsigned long vaddr)
112 */ 110 */
113 spin_lock(&v6_lock); 111 spin_lock(&v6_lock);
114 112
115 set_pte(TOP_PTE(to_address) + offset, pfn_pte(__pa(kaddr) >> PAGE_SHIFT, to_pgprot)); 113 set_pte(TOP_PTE(to_address) + offset, pfn_pte(__pa(kaddr) >> PAGE_SHIFT, PAGE_KERNEL));
116 flush_tlb_kernel_page(to); 114 flush_tlb_kernel_page(to);
117 clear_page((void *)to); 115 clear_page((void *)to);
118 116
diff --git a/arch/arm/mm/fault-armv.c b/arch/arm/mm/fault-armv.c
index be4ab3d73c91..7fc1b35a6746 100644
--- a/arch/arm/mm/fault-armv.c
+++ b/arch/arm/mm/fault-armv.c
@@ -26,6 +26,11 @@ static unsigned long shared_pte_mask = L_PTE_CACHEABLE;
26/* 26/*
27 * We take the easy way out of this problem - we make the 27 * We take the easy way out of this problem - we make the
28 * PTE uncacheable. However, we leave the write buffer on. 28 * PTE uncacheable. However, we leave the write buffer on.
29 *
30 * Note that the pte lock held when calling update_mmu_cache must also
31 * guard the pte (somewhere else in the same mm) that we modify here.
32 * Therefore those configurations which might call adjust_pte (those
33 * without CONFIG_CPU_CACHE_VIPT) cannot support split page_table_lock.
29 */ 34 */
30static int adjust_pte(struct vm_area_struct *vma, unsigned long address) 35static int adjust_pte(struct vm_area_struct *vma, unsigned long address)
31{ 36{
@@ -127,7 +132,7 @@ void __flush_dcache_page(struct address_space *mapping, struct page *page);
127 * 2. If we have multiple shared mappings of the same space in 132 * 2. If we have multiple shared mappings of the same space in
128 * an object, we need to deal with the cache aliasing issues. 133 * an object, we need to deal with the cache aliasing issues.
129 * 134 *
130 * Note that the page_table_lock will be held. 135 * Note that the pte lock will be held.
131 */ 136 */
132void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t pte) 137void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t pte)
133{ 138{
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index f4496813615a..fd079ff1fc53 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -363,20 +363,16 @@ static void __init bootmem_init(struct meminfo *mi)
363 363
364 memcpy(&meminfo, mi, sizeof(meminfo)); 364 memcpy(&meminfo, mi, sizeof(meminfo));
365 365
366#ifdef CONFIG_XIP_KERNEL
367#error needs fixing
368 p->pfn = __phys_to_pfn(CONFIG_XIP_PHYS_ADDR & PMD_MASK);
369 p->virtual = (unsigned long)&_stext & PMD_MASK;
370 p->length = ((unsigned long)&_etext - p->virtual + ~PMD_MASK) & PMD_MASK;
371 p->type = MT_ROM;
372 p ++;
373#endif
374
375 /* 366 /*
376 * Clear out all the mappings below the kernel image. 367 * Clear out all the mappings below the kernel image.
377 * FIXME: what about XIP?
378 */ 368 */
379 for (addr = 0; addr < PAGE_OFFSET; addr += PGDIR_SIZE) 369 for (addr = 0; addr < MODULE_START; addr += PGDIR_SIZE)
370 pmd_clear(pmd_off_k(addr));
371#ifdef CONFIG_XIP_KERNEL
372 /* The XIP kernel is mapped in the module area -- skip over it */
373 addr = ((unsigned long)&_etext + PGDIR_SIZE - 1) & PGDIR_MASK;
374#endif
375 for ( ; addr < PAGE_OFFSET; addr += PGDIR_SIZE)
380 pmd_clear(pmd_off_k(addr)); 376 pmd_clear(pmd_off_k(addr));
381 377
382 /* 378 /*
@@ -436,6 +432,18 @@ static void __init devicemaps_init(struct machine_desc *mdesc)
436 pmd_clear(pmd_off_k(addr)); 432 pmd_clear(pmd_off_k(addr));
437 433
438 /* 434 /*
435 * Map the kernel if it is XIP.
436 * It is always first in the modulearea.
437 */
438#ifdef CONFIG_XIP_KERNEL
439 map.pfn = __phys_to_pfn(CONFIG_XIP_PHYS_ADDR & PGDIR_MASK);
440 map.virtual = MODULE_START;
441 map.length = ((unsigned long)&_etext - map.virtual + ~PGDIR_MASK) & PGDIR_MASK;
442 map.type = MT_ROM;
443 create_mapping(&map);
444#endif
445
446 /*
439 * Map the cache flushing regions. 447 * Map the cache flushing regions.
440 */ 448 */
441#ifdef FLUSH_BASE 449#ifdef FLUSH_BASE
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index 6fb1258df1b5..0f128c28fee4 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -75,7 +75,7 @@ remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned long size,
75 75
76 pgprot = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | L_PTE_WRITE | flags); 76 pgprot = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | L_PTE_WRITE | flags);
77 do { 77 do {
78 pte_t * pte = pte_alloc_kernel(&init_mm, pmd, address); 78 pte_t * pte = pte_alloc_kernel(pmd, address);
79 if (!pte) 79 if (!pte)
80 return -ENOMEM; 80 return -ENOMEM;
81 remap_area_pte(pte, address, end - address, address + phys_addr, pgprot); 81 remap_area_pte(pte, address, end - address, address + phys_addr, pgprot);
@@ -97,7 +97,6 @@ remap_area_pages(unsigned long start, unsigned long phys_addr,
97 phys_addr -= address; 97 phys_addr -= address;
98 dir = pgd_offset(&init_mm, address); 98 dir = pgd_offset(&init_mm, address);
99 BUG_ON(address >= end); 99 BUG_ON(address >= end);
100 spin_lock(&init_mm.page_table_lock);
101 do { 100 do {
102 pmd_t *pmd = pmd_alloc(&init_mm, dir, address); 101 pmd_t *pmd = pmd_alloc(&init_mm, dir, address);
103 if (!pmd) { 102 if (!pmd) {
@@ -114,7 +113,6 @@ remap_area_pages(unsigned long start, unsigned long phys_addr,
114 dir++; 113 dir++;
115 } while (address && (address < end)); 114 } while (address && (address < end));
116 115
117 spin_unlock(&init_mm.page_table_lock);
118 flush_cache_vmap(start, end); 116 flush_cache_vmap(start, end);
119 return err; 117 return err;
120} 118}
diff --git a/arch/arm/mm/mm-armv.c b/arch/arm/mm/mm-armv.c
index 61bc2fa0511e..1221fdde1769 100644
--- a/arch/arm/mm/mm-armv.c
+++ b/arch/arm/mm/mm-armv.c
@@ -180,11 +180,6 @@ pgd_t *get_pgd_slow(struct mm_struct *mm)
180 180
181 if (!vectors_high()) { 181 if (!vectors_high()) {
182 /* 182 /*
183 * This lock is here just to satisfy pmd_alloc and pte_lock
184 */
185 spin_lock(&mm->page_table_lock);
186
187 /*
188 * On ARM, first page must always be allocated since it 183 * On ARM, first page must always be allocated since it
189 * contains the machine vectors. 184 * contains the machine vectors.
190 */ 185 */
@@ -201,23 +196,14 @@ pgd_t *get_pgd_slow(struct mm_struct *mm)
201 set_pte(new_pte, *init_pte); 196 set_pte(new_pte, *init_pte);
202 pte_unmap_nested(init_pte); 197 pte_unmap_nested(init_pte);
203 pte_unmap(new_pte); 198 pte_unmap(new_pte);
204
205 spin_unlock(&mm->page_table_lock);
206 } 199 }
207 200
208 return new_pgd; 201 return new_pgd;
209 202
210no_pte: 203no_pte:
211 spin_unlock(&mm->page_table_lock);
212 pmd_free(new_pmd); 204 pmd_free(new_pmd);
213 free_pages((unsigned long)new_pgd, 2);
214 return NULL;
215
216no_pmd: 205no_pmd:
217 spin_unlock(&mm->page_table_lock);
218 free_pages((unsigned long)new_pgd, 2); 206 free_pages((unsigned long)new_pgd, 2);
219 return NULL;
220
221no_pgd: 207no_pgd:
222 return NULL; 208 return NULL;
223} 209}
@@ -243,6 +229,7 @@ void free_pgd_slow(pgd_t *pgd)
243 pte = pmd_page(*pmd); 229 pte = pmd_page(*pmd);
244 pmd_clear(pmd); 230 pmd_clear(pmd);
245 dec_page_state(nr_page_table_pages); 231 dec_page_state(nr_page_table_pages);
232 pte_lock_deinit(pte);
246 pte_free(pte); 233 pte_free(pte);
247 pmd_free(pmd); 234 pmd_free(pmd);
248free: 235free:
diff --git a/arch/arm/oprofile/backtrace.c b/arch/arm/oprofile/backtrace.c
index df35c452a8bf..7c22c12618cc 100644
--- a/arch/arm/oprofile/backtrace.c
+++ b/arch/arm/oprofile/backtrace.c
@@ -49,42 +49,22 @@ static struct frame_tail* kernel_backtrace(struct frame_tail *tail)
49 49
50static struct frame_tail* user_backtrace(struct frame_tail *tail) 50static struct frame_tail* user_backtrace(struct frame_tail *tail)
51{ 51{
52 struct frame_tail buftail; 52 struct frame_tail buftail[2];
53 53
54 /* hardware pte might not be valid due to dirty/accessed bit emulation 54 /* Also check accessibility of one struct frame_tail beyond */
55 * so we use copy_from_user and benefit from exception fixups */ 55 if (!access_ok(VERIFY_READ, tail, sizeof(buftail)))
56 if (copy_from_user(&buftail, tail, sizeof(struct frame_tail))) 56 return NULL;
57 if (__copy_from_user_inatomic(buftail, tail, sizeof(buftail)))
57 return NULL; 58 return NULL;
58 59
59 oprofile_add_trace(buftail.lr); 60 oprofile_add_trace(buftail[0].lr);
60 61
61 /* frame pointers should strictly progress back up the stack 62 /* frame pointers should strictly progress back up the stack
62 * (towards higher addresses) */ 63 * (towards higher addresses) */
63 if (tail >= buftail.fp) 64 if (tail >= buftail[0].fp)
64 return NULL; 65 return NULL;
65 66
66 return buftail.fp-1; 67 return buftail[0].fp-1;
67}
68
69/* Compare two addresses and see if they're on the same page */
70#define CMP_ADDR_EQUAL(x,y,offset) ((((unsigned long) x) >> PAGE_SHIFT) \
71 == ((((unsigned long) y) + offset) >> PAGE_SHIFT))
72
73/* check that the page(s) containing the frame tail are present */
74static int pages_present(struct frame_tail *tail)
75{
76 struct mm_struct * mm = current->mm;
77
78 if (!check_user_page_readable(mm, (unsigned long)tail))
79 return 0;
80
81 if (CMP_ADDR_EQUAL(tail, tail, 8))
82 return 1;
83
84 if (!check_user_page_readable(mm, ((unsigned long)tail) + 8))
85 return 0;
86
87 return 1;
88} 68}
89 69
90/* 70/*
@@ -118,7 +98,6 @@ static int valid_kernel_stack(struct frame_tail *tail, struct pt_regs *regs)
118void arm_backtrace(struct pt_regs * const regs, unsigned int depth) 98void arm_backtrace(struct pt_regs * const regs, unsigned int depth)
119{ 99{
120 struct frame_tail *tail; 100 struct frame_tail *tail;
121 unsigned long last_address = 0;
122 101
123 tail = ((struct frame_tail *) regs->ARM_fp) - 1; 102 tail = ((struct frame_tail *) regs->ARM_fp) - 1;
124 103
@@ -132,13 +111,6 @@ void arm_backtrace(struct pt_regs * const regs, unsigned int depth)
132 return; 111 return;
133 } 112 }
134 113
135 while (depth-- && tail && !((unsigned long) tail & 3)) { 114 while (depth-- && tail && !((unsigned long) tail & 3))
136 if ((!CMP_ADDR_EQUAL(last_address, tail, 0)
137 || !CMP_ADDR_EQUAL(last_address, tail, 8))
138 && !pages_present(tail))
139 return;
140 last_address = (unsigned long) tail;
141 tail = user_backtrace(tail); 115 tail = user_backtrace(tail);
142 }
143} 116}
144
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c
index 52a58b2da288..a020fe16428f 100644
--- a/arch/arm/plat-omap/clock.c
+++ b/arch/arm/plat-omap/clock.c
@@ -13,6 +13,7 @@
13#include <linux/list.h> 13#include <linux/list.h>
14#include <linux/errno.h> 14#include <linux/errno.h>
15#include <linux/err.h> 15#include <linux/err.h>
16#include <linux/string.h>
16 17
17#include <asm/io.h> 18#include <asm/io.h>
18#include <asm/semaphore.h> 19#include <asm/semaphore.h>
diff --git a/arch/arm26/kernel/ptrace.c b/arch/arm26/kernel/ptrace.c
index 8a52124de0e1..cf7e977d18c8 100644
--- a/arch/arm26/kernel/ptrace.c
+++ b/arch/arm26/kernel/ptrace.c
@@ -665,7 +665,7 @@ static int do_ptrace(int request, struct task_struct *child, long addr, long dat
665 return ret; 665 return ret;
666} 666}
667 667
668asmlinkage int sys_ptrace(long request, long pid, long addr, long data) 668asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
669{ 669{
670 struct task_struct *child; 670 struct task_struct *child;
671 int ret; 671 int ret;
diff --git a/arch/arm26/kernel/time.c b/arch/arm26/kernel/time.c
index e66aedd02fad..335525339ad6 100644
--- a/arch/arm26/kernel/time.c
+++ b/arch/arm26/kernel/time.c
@@ -34,10 +34,6 @@
34#include <asm/irq.h> 34#include <asm/irq.h>
35#include <asm/ioc.h> 35#include <asm/ioc.h>
36 36
37u64 jiffies_64 = INITIAL_JIFFIES;
38
39EXPORT_SYMBOL(jiffies_64);
40
41extern unsigned long wall_jiffies; 37extern unsigned long wall_jiffies;
42 38
43/* this needs a better home */ 39/* this needs a better home */
diff --git a/arch/arm26/mm/memc.c b/arch/arm26/mm/memc.c
index 8e8a2bb2487d..34def6397c3c 100644
--- a/arch/arm26/mm/memc.c
+++ b/arch/arm26/mm/memc.c
@@ -79,12 +79,6 @@ pgd_t *get_pgd_slow(struct mm_struct *mm)
79 goto no_pgd; 79 goto no_pgd;
80 80
81 /* 81 /*
82 * This lock is here just to satisfy pmd_alloc and pte_lock
83 * FIXME: I bet we could avoid taking it pretty much altogether
84 */
85 spin_lock(&mm->page_table_lock);
86
87 /*
88 * On ARM, first page must always be allocated since it contains 82 * On ARM, first page must always be allocated since it contains
89 * the machine vectors. 83 * the machine vectors.
90 */ 84 */
@@ -92,7 +86,7 @@ pgd_t *get_pgd_slow(struct mm_struct *mm)
92 if (!new_pmd) 86 if (!new_pmd)
93 goto no_pmd; 87 goto no_pmd;
94 88
95 new_pte = pte_alloc_kernel(mm, new_pmd, 0); 89 new_pte = pte_alloc_map(mm, new_pmd, 0);
96 if (!new_pte) 90 if (!new_pte)
97 goto no_pte; 91 goto no_pte;
98 92
@@ -101,6 +95,7 @@ pgd_t *get_pgd_slow(struct mm_struct *mm)
101 init_pte = pte_offset(init_pmd, 0); 95 init_pte = pte_offset(init_pmd, 0);
102 96
103 set_pte(new_pte, *init_pte); 97 set_pte(new_pte, *init_pte);
98 pte_unmap(new_pte);
104 99
105 /* 100 /*
106 * the page table entries are zeroed 101 * the page table entries are zeroed
@@ -112,23 +107,14 @@ pgd_t *get_pgd_slow(struct mm_struct *mm)
112 memcpy(new_pgd + FIRST_KERNEL_PGD_NR, init_pgd + FIRST_KERNEL_PGD_NR, 107 memcpy(new_pgd + FIRST_KERNEL_PGD_NR, init_pgd + FIRST_KERNEL_PGD_NR,
113 (PTRS_PER_PGD - FIRST_KERNEL_PGD_NR) * sizeof(pgd_t)); 108 (PTRS_PER_PGD - FIRST_KERNEL_PGD_NR) * sizeof(pgd_t));
114 109
115 spin_unlock(&mm->page_table_lock);
116
117 /* update MEMC tables */ 110 /* update MEMC tables */
118 cpu_memc_update_all(new_pgd); 111 cpu_memc_update_all(new_pgd);
119 return new_pgd; 112 return new_pgd;
120 113
121no_pte: 114no_pte:
122 spin_unlock(&mm->page_table_lock);
123 pmd_free(new_pmd); 115 pmd_free(new_pmd);
124 free_pgd_slow(new_pgd);
125 return NULL;
126
127no_pmd: 116no_pmd:
128 spin_unlock(&mm->page_table_lock);
129 free_pgd_slow(new_pgd); 117 free_pgd_slow(new_pgd);
130 return NULL;
131
132no_pgd: 118no_pgd:
133 return NULL; 119 return NULL;
134} 120}
diff --git a/arch/cris/arch-v10/drivers/axisflashmap.c b/arch/cris/arch-v10/drivers/axisflashmap.c
index 11ab3836aac6..56b038c8d482 100644
--- a/arch/cris/arch-v10/drivers/axisflashmap.c
+++ b/arch/cris/arch-v10/drivers/axisflashmap.c
@@ -140,6 +140,7 @@
140#include <linux/kernel.h> 140#include <linux/kernel.h>
141#include <linux/config.h> 141#include <linux/config.h>
142#include <linux/init.h> 142#include <linux/init.h>
143#include <linux/slab.h>
143 144
144#include <linux/mtd/concat.h> 145#include <linux/mtd/concat.h>
145#include <linux/mtd/map.h> 146#include <linux/mtd/map.h>
diff --git a/arch/cris/arch-v32/drivers/axisflashmap.c b/arch/cris/arch-v32/drivers/axisflashmap.c
index 78ed52b1cdac..b679f983b90a 100644
--- a/arch/cris/arch-v32/drivers/axisflashmap.c
+++ b/arch/cris/arch-v32/drivers/axisflashmap.c
@@ -20,6 +20,7 @@
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/config.h> 21#include <linux/config.h>
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/slab.h>
23 24
24#include <linux/mtd/concat.h> 25#include <linux/mtd/concat.h>
25#include <linux/mtd/map.h> 26#include <linux/mtd/map.h>
diff --git a/arch/cris/arch-v32/mm/tlb.c b/arch/cris/arch-v32/mm/tlb.c
index 8233406798d3..b08a28bb58ab 100644
--- a/arch/cris/arch-v32/mm/tlb.c
+++ b/arch/cris/arch-v32/mm/tlb.c
@@ -175,6 +175,8 @@ init_new_context(struct task_struct *tsk, struct mm_struct *mm)
175 return 0; 175 return 0;
176} 176}
177 177
178static DEFINE_SPINLOCK(mmu_context_lock);
179
178/* Called in schedule() just before actually doing the switch_to. */ 180/* Called in schedule() just before actually doing the switch_to. */
179void 181void
180switch_mm(struct mm_struct *prev, struct mm_struct *next, 182switch_mm(struct mm_struct *prev, struct mm_struct *next,
@@ -183,10 +185,10 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next,
183 int cpu = smp_processor_id(); 185 int cpu = smp_processor_id();
184 186
185 /* Make sure there is a MMU context. */ 187 /* Make sure there is a MMU context. */
186 spin_lock(&next->page_table_lock); 188 spin_lock(&mmu_context_lock);
187 get_mmu_context(next); 189 get_mmu_context(next);
188 cpu_set(cpu, next->cpu_vm_mask); 190 cpu_set(cpu, next->cpu_vm_mask);
189 spin_unlock(&next->page_table_lock); 191 spin_unlock(&mmu_context_lock);
190 192
191 /* 193 /*
192 * Remember the pgd for the fault handlers. Keep a seperate copy of it 194 * Remember the pgd for the fault handlers. Keep a seperate copy of it
diff --git a/arch/cris/kernel/time.c b/arch/cris/kernel/time.c
index a2d99b4aedcd..66ba8898db07 100644
--- a/arch/cris/kernel/time.c
+++ b/arch/cris/kernel/time.c
@@ -31,10 +31,7 @@
31#include <linux/timex.h> 31#include <linux/timex.h>
32#include <linux/init.h> 32#include <linux/init.h>
33#include <linux/profile.h> 33#include <linux/profile.h>
34 34#include <linux/sched.h> /* just for sched_clock() - funny that */
35u64 jiffies_64 = INITIAL_JIFFIES;
36
37EXPORT_SYMBOL(jiffies_64);
38 35
39int have_rtc; /* used to remember if we have an RTC or not */; 36int have_rtc; /* used to remember if we have an RTC or not */;
40 37
diff --git a/arch/cris/mm/ioremap.c b/arch/cris/mm/ioremap.c
index ebba11e270fa..a92ac9877582 100644
--- a/arch/cris/mm/ioremap.c
+++ b/arch/cris/mm/ioremap.c
@@ -52,7 +52,7 @@ static inline int remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned lo
52 if (address >= end) 52 if (address >= end)
53 BUG(); 53 BUG();
54 do { 54 do {
55 pte_t * pte = pte_alloc_kernel(&init_mm, pmd, address); 55 pte_t * pte = pte_alloc_kernel(pmd, address);
56 if (!pte) 56 if (!pte)
57 return -ENOMEM; 57 return -ENOMEM;
58 remap_area_pte(pte, address, end - address, address + phys_addr, prot); 58 remap_area_pte(pte, address, end - address, address + phys_addr, prot);
@@ -74,7 +74,6 @@ static int remap_area_pages(unsigned long address, unsigned long phys_addr,
74 flush_cache_all(); 74 flush_cache_all();
75 if (address >= end) 75 if (address >= end)
76 BUG(); 76 BUG();
77 spin_lock(&init_mm.page_table_lock);
78 do { 77 do {
79 pud_t *pud; 78 pud_t *pud;
80 pmd_t *pmd; 79 pmd_t *pmd;
@@ -94,7 +93,6 @@ static int remap_area_pages(unsigned long address, unsigned long phys_addr,
94 address = (address + PGDIR_SIZE) & PGDIR_MASK; 93 address = (address + PGDIR_SIZE) & PGDIR_MASK;
95 dir++; 94 dir++;
96 } while (address && (address < end)); 95 } while (address && (address < end));
97 spin_unlock(&init_mm.page_table_lock);
98 flush_tlb_all(); 96 flush_tlb_all();
99 return error; 97 return error;
100} 98}
diff --git a/arch/frv/kernel/ptrace.c b/arch/frv/kernel/ptrace.c
index cbe03cba9f02..cb335a14a315 100644
--- a/arch/frv/kernel/ptrace.c
+++ b/arch/frv/kernel/ptrace.c
@@ -106,7 +106,7 @@ void ptrace_enable(struct task_struct *child)
106 child->thread.frame0->__status |= REG__STATUS_STEP; 106 child->thread.frame0->__status |= REG__STATUS_STEP;
107} 107}
108 108
109asmlinkage int sys_ptrace(long request, long pid, long addr, long data) 109asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
110{ 110{
111 struct task_struct *child; 111 struct task_struct *child;
112 unsigned long tmp; 112 unsigned long tmp;
diff --git a/arch/frv/kernel/time.c b/arch/frv/kernel/time.c
index 8d6558b00e44..2e9741227b73 100644
--- a/arch/frv/kernel/time.c
+++ b/arch/frv/kernel/time.c
@@ -34,9 +34,6 @@
34 34
35extern unsigned long wall_jiffies; 35extern unsigned long wall_jiffies;
36 36
37u64 jiffies_64 = INITIAL_JIFFIES;
38EXPORT_SYMBOL(jiffies_64);
39
40unsigned long __nongprelbss __clkin_clock_speed_HZ; 37unsigned long __nongprelbss __clkin_clock_speed_HZ;
41unsigned long __nongprelbss __ext_bus_clock_speed_HZ; 38unsigned long __nongprelbss __ext_bus_clock_speed_HZ;
42unsigned long __nongprelbss __res_bus_clock_speed_HZ; 39unsigned long __nongprelbss __res_bus_clock_speed_HZ;
@@ -221,6 +218,7 @@ int do_settimeofday(struct timespec *tv)
221 clock_was_set(); 218 clock_was_set();
222 return 0; 219 return 0;
223} 220}
221EXPORT_SYMBOL(do_settimeofday);
224 222
225/* 223/*
226 * Scheduler clock - returns current time in nanosec units. 224 * Scheduler clock - returns current time in nanosec units.
diff --git a/arch/frv/mm/dma-alloc.c b/arch/frv/mm/dma-alloc.c
index cfc4f97490c6..342823aad758 100644
--- a/arch/frv/mm/dma-alloc.c
+++ b/arch/frv/mm/dma-alloc.c
@@ -55,21 +55,18 @@ static int map_page(unsigned long va, unsigned long pa, pgprot_t prot)
55 pte_t *pte; 55 pte_t *pte;
56 int err = -ENOMEM; 56 int err = -ENOMEM;
57 57
58 spin_lock(&init_mm.page_table_lock);
59
60 /* Use upper 10 bits of VA to index the first level map */ 58 /* Use upper 10 bits of VA to index the first level map */
61 pge = pgd_offset_k(va); 59 pge = pgd_offset_k(va);
62 pue = pud_offset(pge, va); 60 pue = pud_offset(pge, va);
63 pme = pmd_offset(pue, va); 61 pme = pmd_offset(pue, va);
64 62
65 /* Use middle 10 bits of VA to index the second-level map */ 63 /* Use middle 10 bits of VA to index the second-level map */
66 pte = pte_alloc_kernel(&init_mm, pme, va); 64 pte = pte_alloc_kernel(pme, va);
67 if (pte != 0) { 65 if (pte != 0) {
68 err = 0; 66 err = 0;
69 set_pte(pte, mk_pte_phys(pa & PAGE_MASK, prot)); 67 set_pte(pte, mk_pte_phys(pa & PAGE_MASK, prot));
70 } 68 }
71 69
72 spin_unlock(&init_mm.page_table_lock);
73 return err; 70 return err;
74} 71}
75 72
diff --git a/arch/frv/mm/pgalloc.c b/arch/frv/mm/pgalloc.c
index 4eaec0f3525b..2c67dfe5a6b3 100644
--- a/arch/frv/mm/pgalloc.c
+++ b/arch/frv/mm/pgalloc.c
@@ -87,14 +87,14 @@ static inline void pgd_list_add(pgd_t *pgd)
87 if (pgd_list) 87 if (pgd_list)
88 pgd_list->private = (unsigned long) &page->index; 88 pgd_list->private = (unsigned long) &page->index;
89 pgd_list = page; 89 pgd_list = page;
90 page->private = (unsigned long) &pgd_list; 90 set_page_private(page, (unsigned long)&pgd_list);
91} 91}
92 92
93static inline void pgd_list_del(pgd_t *pgd) 93static inline void pgd_list_del(pgd_t *pgd)
94{ 94{
95 struct page *next, **pprev, *page = virt_to_page(pgd); 95 struct page *next, **pprev, *page = virt_to_page(pgd);
96 next = (struct page *) page->index; 96 next = (struct page *) page->index;
97 pprev = (struct page **) page->private; 97 pprev = (struct page **)page_private(page);
98 *pprev = next; 98 *pprev = next;
99 if (next) 99 if (next)
100 next->private = (unsigned long) pprev; 100 next->private = (unsigned long) pprev;
diff --git a/arch/h8300/kernel/ptrace.c b/arch/h8300/kernel/ptrace.c
index 05c15e869777..a569fe4aa284 100644
--- a/arch/h8300/kernel/ptrace.c
+++ b/arch/h8300/kernel/ptrace.c
@@ -57,7 +57,7 @@ void ptrace_disable(struct task_struct *child)
57 h8300_disable_trace(child); 57 h8300_disable_trace(child);
58} 58}
59 59
60asmlinkage int sys_ptrace(long request, long pid, long addr, long data) 60asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
61{ 61{
62 struct task_struct *child; 62 struct task_struct *child;
63 int ret; 63 int ret;
diff --git a/arch/h8300/kernel/time.c b/arch/h8300/kernel/time.c
index af8c5d2057dd..688a5100604c 100644
--- a/arch/h8300/kernel/time.c
+++ b/arch/h8300/kernel/time.c
@@ -32,10 +32,6 @@
32 32
33#define TICK_SIZE (tick_nsec / 1000) 33#define TICK_SIZE (tick_nsec / 1000)
34 34
35u64 jiffies_64;
36
37EXPORT_SYMBOL(jiffies_64);
38
39/* 35/*
40 * timer_interrupt() needs to keep up the real-time clock, 36 * timer_interrupt() needs to keep up the real-time clock,
41 * as well as call the "do_timer()" routine every clocktick 37 * as well as call the "do_timer()" routine every clocktick
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig
index d2703cda61ea..5383e5e2d9b7 100644
--- a/arch/i386/Kconfig
+++ b/arch/i386/Kconfig
@@ -5,7 +5,7 @@
5 5
6mainmenu "Linux Kernel Configuration" 6mainmenu "Linux Kernel Configuration"
7 7
8config X86 8config X86_32
9 bool 9 bool
10 default y 10 default y
11 help 11 help
@@ -18,6 +18,10 @@ config SEMAPHORE_SLEEPERS
18 bool 18 bool
19 default y 19 default y
20 20
21config X86
22 bool
23 default y
24
21config MMU 25config MMU
22 bool 26 bool
23 default y 27 default y
@@ -151,304 +155,7 @@ config ES7000_CLUSTERED_APIC
151 default y 155 default y
152 depends on SMP && X86_ES7000 && MPENTIUMIII 156 depends on SMP && X86_ES7000 && MPENTIUMIII
153 157
154if !X86_ELAN 158source "arch/i386/Kconfig.cpu"
155
156choice
157 prompt "Processor family"
158 default M686
159
160config M386
161 bool "386"
162 ---help---
163 This is the processor type of your CPU. This information is used for
164 optimizing purposes. In order to compile a kernel that can run on
165 all x86 CPU types (albeit not optimally fast), you can specify
166 "386" here.
167
168 The kernel will not necessarily run on earlier architectures than
169 the one you have chosen, e.g. a Pentium optimized kernel will run on
170 a PPro, but not necessarily on a i486.
171
172 Here are the settings recommended for greatest speed:
173 - "386" for the AMD/Cyrix/Intel 386DX/DXL/SL/SLC/SX, Cyrix/TI
174 486DLC/DLC2, UMC 486SX-S and NexGen Nx586. Only "386" kernels
175 will run on a 386 class machine.
176 - "486" for the AMD/Cyrix/IBM/Intel 486DX/DX2/DX4 or
177 SL/SLC/SLC2/SLC3/SX/SX2 and UMC U5D or U5S.
178 - "586" for generic Pentium CPUs lacking the TSC
179 (time stamp counter) register.
180 - "Pentium-Classic" for the Intel Pentium.
181 - "Pentium-MMX" for the Intel Pentium MMX.
182 - "Pentium-Pro" for the Intel Pentium Pro.
183 - "Pentium-II" for the Intel Pentium II or pre-Coppermine Celeron.
184 - "Pentium-III" for the Intel Pentium III or Coppermine Celeron.
185 - "Pentium-4" for the Intel Pentium 4 or P4-based Celeron.
186 - "K6" for the AMD K6, K6-II and K6-III (aka K6-3D).
187 - "Athlon" for the AMD K7 family (Athlon/Duron/Thunderbird).
188 - "Crusoe" for the Transmeta Crusoe series.
189 - "Efficeon" for the Transmeta Efficeon series.
190 - "Winchip-C6" for original IDT Winchip.
191 - "Winchip-2" for IDT Winchip 2.
192 - "Winchip-2A" for IDT Winchips with 3dNow! capabilities.
193 - "GeodeGX1" for Geode GX1 (Cyrix MediaGX).
194 - "CyrixIII/VIA C3" for VIA Cyrix III or VIA C3.
195 - "VIA C3-2 for VIA C3-2 "Nehemiah" (model 9 and above).
196
197 If you don't know what to do, choose "386".
198
199config M486
200 bool "486"
201 help
202 Select this for a 486 series processor, either Intel or one of the
203 compatible processors from AMD, Cyrix, IBM, or Intel. Includes DX,
204 DX2, and DX4 variants; also SL/SLC/SLC2/SLC3/SX/SX2 and UMC U5D or
205 U5S.
206
207config M586
208 bool "586/K5/5x86/6x86/6x86MX"
209 help
210 Select this for an 586 or 686 series processor such as the AMD K5,
211 the Cyrix 5x86, 6x86 and 6x86MX. This choice does not
212 assume the RDTSC (Read Time Stamp Counter) instruction.
213
214config M586TSC
215 bool "Pentium-Classic"
216 help
217 Select this for a Pentium Classic processor with the RDTSC (Read
218 Time Stamp Counter) instruction for benchmarking.
219
220config M586MMX
221 bool "Pentium-MMX"
222 help
223 Select this for a Pentium with the MMX graphics/multimedia
224 extended instructions.
225
226config M686
227 bool "Pentium-Pro"
228 help
229 Select this for Intel Pentium Pro chips. This enables the use of
230 Pentium Pro extended instructions, and disables the init-time guard
231 against the f00f bug found in earlier Pentiums.
232
233config MPENTIUMII
234 bool "Pentium-II/Celeron(pre-Coppermine)"
235 help
236 Select this for Intel chips based on the Pentium-II and
237 pre-Coppermine Celeron core. This option enables an unaligned
238 copy optimization, compiles the kernel with optimization flags
239 tailored for the chip, and applies any applicable Pentium Pro
240 optimizations.
241
242config MPENTIUMIII
243 bool "Pentium-III/Celeron(Coppermine)/Pentium-III Xeon"
244 help
245 Select this for Intel chips based on the Pentium-III and
246 Celeron-Coppermine core. This option enables use of some
247 extended prefetch instructions in addition to the Pentium II
248 extensions.
249
250config MPENTIUMM
251 bool "Pentium M"
252 help
253 Select this for Intel Pentium M (not Pentium-4 M)
254 notebook chips.
255
256config MPENTIUM4
257 bool "Pentium-4/Celeron(P4-based)/Pentium-4 M/Xeon"
258 help
259 Select this for Intel Pentium 4 chips. This includes the
260 Pentium 4, P4-based Celeron and Xeon, and Pentium-4 M
261 (not Pentium M) chips. This option enables compile flags
262 optimized for the chip, uses the correct cache shift, and
263 applies any applicable Pentium III optimizations.
264
265config MK6
266 bool "K6/K6-II/K6-III"
267 help
268 Select this for an AMD K6-family processor. Enables use of
269 some extended instructions, and passes appropriate optimization
270 flags to GCC.
271
272config MK7
273 bool "Athlon/Duron/K7"
274 help
275 Select this for an AMD Athlon K7-family processor. Enables use of
276 some extended instructions, and passes appropriate optimization
277 flags to GCC.
278
279config MK8
280 bool "Opteron/Athlon64/Hammer/K8"
281 help
282 Select this for an AMD Opteron or Athlon64 Hammer-family processor. Enables
283 use of some extended instructions, and passes appropriate optimization
284 flags to GCC.
285
286config MCRUSOE
287 bool "Crusoe"
288 help
289 Select this for a Transmeta Crusoe processor. Treats the processor
290 like a 586 with TSC, and sets some GCC optimization flags (like a
291 Pentium Pro with no alignment requirements).
292
293config MEFFICEON
294 bool "Efficeon"
295 help
296 Select this for a Transmeta Efficeon processor.
297
298config MWINCHIPC6
299 bool "Winchip-C6"
300 help
301 Select this for an IDT Winchip C6 chip. Linux and GCC
302 treat this chip as a 586TSC with some extended instructions
303 and alignment requirements.
304
305config MWINCHIP2
306 bool "Winchip-2"
307 help
308 Select this for an IDT Winchip-2. Linux and GCC
309 treat this chip as a 586TSC with some extended instructions
310 and alignment requirements.
311
312config MWINCHIP3D
313 bool "Winchip-2A/Winchip-3"
314 help
315 Select this for an IDT Winchip-2A or 3. Linux and GCC
316 treat this chip as a 586TSC with some extended instructions
317 and alignment reqirements. Also enable out of order memory
318 stores for this CPU, which can increase performance of some
319 operations.
320
321config MGEODEGX1
322 bool "GeodeGX1"
323 help
324 Select this for a Geode GX1 (Cyrix MediaGX) chip.
325
326config MCYRIXIII
327 bool "CyrixIII/VIA-C3"
328 help
329 Select this for a Cyrix III or C3 chip. Presently Linux and GCC
330 treat this chip as a generic 586. Whilst the CPU is 686 class,
331 it lacks the cmov extension which gcc assumes is present when
332 generating 686 code.
333 Note that Nehemiah (Model 9) and above will not boot with this
334 kernel due to them lacking the 3DNow! instructions used in earlier
335 incarnations of the CPU.
336
337config MVIAC3_2
338 bool "VIA C3-2 (Nehemiah)"
339 help
340 Select this for a VIA C3 "Nehemiah". Selecting this enables usage
341 of SSE and tells gcc to treat the CPU as a 686.
342 Note, this kernel will not boot on older (pre model 9) C3s.
343
344endchoice
345
346config X86_GENERIC
347 bool "Generic x86 support"
348 help
349 Instead of just including optimizations for the selected
350 x86 variant (e.g. PII, Crusoe or Athlon), include some more
351 generic optimizations as well. This will make the kernel
352 perform better on x86 CPUs other than that selected.
353
354 This is really intended for distributors who need more
355 generic optimizations.
356
357endif
358
359#
360# Define implied options from the CPU selection here
361#
362config X86_CMPXCHG
363 bool
364 depends on !M386
365 default y
366
367config X86_XADD
368 bool
369 depends on !M386
370 default y
371
372config X86_L1_CACHE_SHIFT
373 int
374 default "7" if MPENTIUM4 || X86_GENERIC
375 default "4" if X86_ELAN || M486 || M386
376 default "5" if MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODEGX1
377 default "6" if MK7 || MK8 || MPENTIUMM
378
379config RWSEM_GENERIC_SPINLOCK
380 bool
381 depends on M386
382 default y
383
384config RWSEM_XCHGADD_ALGORITHM
385 bool
386 depends on !M386
387 default y
388
389config GENERIC_CALIBRATE_DELAY
390 bool
391 default y
392
393config X86_PPRO_FENCE
394 bool
395 depends on M686 || M586MMX || M586TSC || M586 || M486 || M386 || MGEODEGX1
396 default y
397
398config X86_F00F_BUG
399 bool
400 depends on M586MMX || M586TSC || M586 || M486 || M386
401 default y
402
403config X86_WP_WORKS_OK
404 bool
405 depends on !M386
406 default y
407
408config X86_INVLPG
409 bool
410 depends on !M386
411 default y
412
413config X86_BSWAP
414 bool
415 depends on !M386
416 default y
417
418config X86_POPAD_OK
419 bool
420 depends on !M386
421 default y
422
423config X86_ALIGNMENT_16
424 bool
425 depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || X86_ELAN || MK6 || M586MMX || M586TSC || M586 || M486 || MVIAC3_2 || MGEODEGX1
426 default y
427
428config X86_GOOD_APIC
429 bool
430 depends on MK7 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || MK8 || MEFFICEON
431 default y
432
433config X86_INTEL_USERCOPY
434 bool
435 depends on MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC || MK8 || MK7 || MEFFICEON
436 default y
437
438config X86_USE_PPRO_CHECKSUM
439 bool
440 depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MVIAC3_2 || MEFFICEON
441 default y
442
443config X86_USE_3DNOW
444 bool
445 depends on MCYRIXIII || MK7
446 default y
447
448config X86_OOSTORE
449 bool
450 depends on (MWINCHIP3D || MWINCHIP2 || MWINCHIPC6) && MTRR
451 default y
452 159
453config HPET_TIMER 160config HPET_TIMER
454 bool "HPET Timer Support" 161 bool "HPET Timer Support"
@@ -561,11 +268,6 @@ config X86_VISWS_APIC
561 depends on X86_VISWS 268 depends on X86_VISWS
562 default y 269 default y
563 270
564config X86_TSC
565 bool
566 depends on (MWINCHIP3D || MWINCHIP2 || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MGEODEGX1) && !X86_NUMAQ
567 default y
568
569config X86_MCE 271config X86_MCE
570 bool "Machine Check Exception" 272 bool "Machine Check Exception"
571 depends on !X86_VOYAGER 273 depends on !X86_VOYAGER
diff --git a/arch/i386/Kconfig.cpu b/arch/i386/Kconfig.cpu
new file mode 100644
index 000000000000..53bbb3c008ee
--- /dev/null
+++ b/arch/i386/Kconfig.cpu
@@ -0,0 +1,309 @@
1# Put here option for CPU selection and depending optimization
2if !X86_ELAN
3
4choice
5 prompt "Processor family"
6 default M686
7
8config M386
9 bool "386"
10 ---help---
11 This is the processor type of your CPU. This information is used for
12 optimizing purposes. In order to compile a kernel that can run on
13 all x86 CPU types (albeit not optimally fast), you can specify
14 "386" here.
15
16 The kernel will not necessarily run on earlier architectures than
17 the one you have chosen, e.g. a Pentium optimized kernel will run on
18 a PPro, but not necessarily on a i486.
19
20 Here are the settings recommended for greatest speed:
21 - "386" for the AMD/Cyrix/Intel 386DX/DXL/SL/SLC/SX, Cyrix/TI
22 486DLC/DLC2, UMC 486SX-S and NexGen Nx586. Only "386" kernels
23 will run on a 386 class machine.
24 - "486" for the AMD/Cyrix/IBM/Intel 486DX/DX2/DX4 or
25 SL/SLC/SLC2/SLC3/SX/SX2 and UMC U5D or U5S.
26 - "586" for generic Pentium CPUs lacking the TSC
27 (time stamp counter) register.
28 - "Pentium-Classic" for the Intel Pentium.
29 - "Pentium-MMX" for the Intel Pentium MMX.
30 - "Pentium-Pro" for the Intel Pentium Pro.
31 - "Pentium-II" for the Intel Pentium II or pre-Coppermine Celeron.
32 - "Pentium-III" for the Intel Pentium III or Coppermine Celeron.
33 - "Pentium-4" for the Intel Pentium 4 or P4-based Celeron.
34 - "K6" for the AMD K6, K6-II and K6-III (aka K6-3D).
35 - "Athlon" for the AMD K7 family (Athlon/Duron/Thunderbird).
36 - "Crusoe" for the Transmeta Crusoe series.
37 - "Efficeon" for the Transmeta Efficeon series.
38 - "Winchip-C6" for original IDT Winchip.
39 - "Winchip-2" for IDT Winchip 2.
40 - "Winchip-2A" for IDT Winchips with 3dNow! capabilities.
41 - "GeodeGX1" for Geode GX1 (Cyrix MediaGX).
42 - "CyrixIII/VIA C3" for VIA Cyrix III or VIA C3.
43 - "VIA C3-2 for VIA C3-2 "Nehemiah" (model 9 and above).
44
45 If you don't know what to do, choose "386".
46
47config M486
48 bool "486"
49 help
50 Select this for a 486 series processor, either Intel or one of the
51 compatible processors from AMD, Cyrix, IBM, or Intel. Includes DX,
52 DX2, and DX4 variants; also SL/SLC/SLC2/SLC3/SX/SX2 and UMC U5D or
53 U5S.
54
55config M586
56 bool "586/K5/5x86/6x86/6x86MX"
57 help
58 Select this for an 586 or 686 series processor such as the AMD K5,
59 the Cyrix 5x86, 6x86 and 6x86MX. This choice does not
60 assume the RDTSC (Read Time Stamp Counter) instruction.
61
62config M586TSC
63 bool "Pentium-Classic"
64 help
65 Select this for a Pentium Classic processor with the RDTSC (Read
66 Time Stamp Counter) instruction for benchmarking.
67
68config M586MMX
69 bool "Pentium-MMX"
70 help
71 Select this for a Pentium with the MMX graphics/multimedia
72 extended instructions.
73
74config M686
75 bool "Pentium-Pro"
76 help
77 Select this for Intel Pentium Pro chips. This enables the use of
78 Pentium Pro extended instructions, and disables the init-time guard
79 against the f00f bug found in earlier Pentiums.
80
81config MPENTIUMII
82 bool "Pentium-II/Celeron(pre-Coppermine)"
83 help
84 Select this for Intel chips based on the Pentium-II and
85 pre-Coppermine Celeron core. This option enables an unaligned
86 copy optimization, compiles the kernel with optimization flags
87 tailored for the chip, and applies any applicable Pentium Pro
88 optimizations.
89
90config MPENTIUMIII
91 bool "Pentium-III/Celeron(Coppermine)/Pentium-III Xeon"
92 help
93 Select this for Intel chips based on the Pentium-III and
94 Celeron-Coppermine core. This option enables use of some
95 extended prefetch instructions in addition to the Pentium II
96 extensions.
97
98config MPENTIUMM
99 bool "Pentium M"
100 help
101 Select this for Intel Pentium M (not Pentium-4 M)
102 notebook chips.
103
104config MPENTIUM4
105 bool "Pentium-4/Celeron(P4-based)/Pentium-4 M/Xeon"
106 help
107 Select this for Intel Pentium 4 chips. This includes the
108 Pentium 4, P4-based Celeron and Xeon, and Pentium-4 M
109 (not Pentium M) chips. This option enables compile flags
110 optimized for the chip, uses the correct cache shift, and
111 applies any applicable Pentium III optimizations.
112
113config MK6
114 bool "K6/K6-II/K6-III"
115 help
116 Select this for an AMD K6-family processor. Enables use of
117 some extended instructions, and passes appropriate optimization
118 flags to GCC.
119
120config MK7
121 bool "Athlon/Duron/K7"
122 help
123 Select this for an AMD Athlon K7-family processor. Enables use of
124 some extended instructions, and passes appropriate optimization
125 flags to GCC.
126
127config MK8
128 bool "Opteron/Athlon64/Hammer/K8"
129 help
130 Select this for an AMD Opteron or Athlon64 Hammer-family processor. Enables
131 use of some extended instructions, and passes appropriate optimization
132 flags to GCC.
133
134config MCRUSOE
135 bool "Crusoe"
136 help
137 Select this for a Transmeta Crusoe processor. Treats the processor
138 like a 586 with TSC, and sets some GCC optimization flags (like a
139 Pentium Pro with no alignment requirements).
140
141config MEFFICEON
142 bool "Efficeon"
143 help
144 Select this for a Transmeta Efficeon processor.
145
146config MWINCHIPC6
147 bool "Winchip-C6"
148 help
149 Select this for an IDT Winchip C6 chip. Linux and GCC
150 treat this chip as a 586TSC with some extended instructions
151 and alignment requirements.
152
153config MWINCHIP2
154 bool "Winchip-2"
155 help
156 Select this for an IDT Winchip-2. Linux and GCC
157 treat this chip as a 586TSC with some extended instructions
158 and alignment requirements.
159
160config MWINCHIP3D
161 bool "Winchip-2A/Winchip-3"
162 help
163 Select this for an IDT Winchip-2A or 3. Linux and GCC
164 treat this chip as a 586TSC with some extended instructions
165 and alignment reqirements. Also enable out of order memory
166 stores for this CPU, which can increase performance of some
167 operations.
168
169config MGEODEGX1
170 bool "GeodeGX1"
171 help
172 Select this for a Geode GX1 (Cyrix MediaGX) chip.
173
174config MCYRIXIII
175 bool "CyrixIII/VIA-C3"
176 help
177 Select this for a Cyrix III or C3 chip. Presently Linux and GCC
178 treat this chip as a generic 586. Whilst the CPU is 686 class,
179 it lacks the cmov extension which gcc assumes is present when
180 generating 686 code.
181 Note that Nehemiah (Model 9) and above will not boot with this
182 kernel due to them lacking the 3DNow! instructions used in earlier
183 incarnations of the CPU.
184
185config MVIAC3_2
186 bool "VIA C3-2 (Nehemiah)"
187 help
188 Select this for a VIA C3 "Nehemiah". Selecting this enables usage
189 of SSE and tells gcc to treat the CPU as a 686.
190 Note, this kernel will not boot on older (pre model 9) C3s.
191
192endchoice
193
194config X86_GENERIC
195 bool "Generic x86 support"
196 help
197 Instead of just including optimizations for the selected
198 x86 variant (e.g. PII, Crusoe or Athlon), include some more
199 generic optimizations as well. This will make the kernel
200 perform better on x86 CPUs other than that selected.
201
202 This is really intended for distributors who need more
203 generic optimizations.
204
205endif
206
207#
208# Define implied options from the CPU selection here
209#
210config X86_CMPXCHG
211 bool
212 depends on !M386
213 default y
214
215config X86_XADD
216 bool
217 depends on !M386
218 default y
219
220config X86_L1_CACHE_SHIFT
221 int
222 default "7" if MPENTIUM4 || X86_GENERIC
223 default "4" if X86_ELAN || M486 || M386
224 default "5" if MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODEGX1
225 default "6" if MK7 || MK8 || MPENTIUMM
226
227config RWSEM_GENERIC_SPINLOCK
228 bool
229 depends on M386
230 default y
231
232config RWSEM_XCHGADD_ALGORITHM
233 bool
234 depends on !M386
235 default y
236
237config GENERIC_CALIBRATE_DELAY
238 bool
239 default y
240
241config X86_PPRO_FENCE
242 bool
243 depends on M686 || M586MMX || M586TSC || M586 || M486 || M386 || MGEODEGX1
244 default y
245
246config X86_F00F_BUG
247 bool
248 depends on M586MMX || M586TSC || M586 || M486 || M386
249 default y
250
251config X86_WP_WORKS_OK
252 bool
253 depends on !M386
254 default y
255
256config X86_INVLPG
257 bool
258 depends on !M386
259 default y
260
261config X86_BSWAP
262 bool
263 depends on !M386
264 default y
265
266config X86_POPAD_OK
267 bool
268 depends on !M386
269 default y
270
271config X86_CMPXCHG64
272 bool
273 depends on !M386 && !M486
274 default y
275
276config X86_ALIGNMENT_16
277 bool
278 depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || X86_ELAN || MK6 || M586MMX || M586TSC || M586 || M486 || MVIAC3_2 || MGEODEGX1
279 default y
280
281config X86_GOOD_APIC
282 bool
283 depends on MK7 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || MK8 || MEFFICEON
284 default y
285
286config X86_INTEL_USERCOPY
287 bool
288 depends on MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC || MK8 || MK7 || MEFFICEON
289 default y
290
291config X86_USE_PPRO_CHECKSUM
292 bool
293 depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MVIAC3_2 || MEFFICEON
294 default y
295
296config X86_USE_3DNOW
297 bool
298 depends on MCYRIXIII || MK7
299 default y
300
301config X86_OOSTORE
302 bool
303 depends on (MWINCHIP3D || MWINCHIP2 || MWINCHIPC6) && MTRR
304 default y
305
306config X86_TSC
307 bool
308 depends on (MWINCHIP3D || MWINCHIP2 || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MGEODEGX1) && !X86_NUMAQ
309 default y
diff --git a/arch/i386/Makefile b/arch/i386/Makefile
index 09951990a622..d121ea18460f 100644
--- a/arch/i386/Makefile
+++ b/arch/i386/Makefile
@@ -34,35 +34,8 @@ CFLAGS += -pipe -msoft-float
34# prevent gcc from keeping the stack 16 byte aligned 34# prevent gcc from keeping the stack 16 byte aligned
35CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2) 35CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2)
36 36
37align := $(cc-option-align) 37# CPU-specific tuning. Anything which can be shared with UML should go here.
38cflags-$(CONFIG_M386) += -march=i386 38include $(srctree)/arch/i386/Makefile.cpu
39cflags-$(CONFIG_M486) += -march=i486
40cflags-$(CONFIG_M586) += -march=i586
41cflags-$(CONFIG_M586TSC) += -march=i586
42cflags-$(CONFIG_M586MMX) += $(call cc-option,-march=pentium-mmx,-march=i586)
43cflags-$(CONFIG_M686) += -march=i686
44cflags-$(CONFIG_MPENTIUMII) += -march=i686 $(call cc-option,-mtune=pentium2)
45cflags-$(CONFIG_MPENTIUMIII) += -march=i686 $(call cc-option,-mtune=pentium3)
46cflags-$(CONFIG_MPENTIUMM) += -march=i686 $(call cc-option,-mtune=pentium3)
47cflags-$(CONFIG_MPENTIUM4) += -march=i686 $(call cc-option,-mtune=pentium4)
48cflags-$(CONFIG_MK6) += -march=k6
49# Please note, that patches that add -march=athlon-xp and friends are pointless.
50# They make zero difference whatsosever to performance at this time.
51cflags-$(CONFIG_MK7) += $(call cc-option,-march=athlon,-march=i686 $(align)-functions=4)
52cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8,$(call cc-option,-march=athlon,-march=i686 $(align)-functions=4))
53cflags-$(CONFIG_MCRUSOE) += -march=i686 $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0
54cflags-$(CONFIG_MEFFICEON) += -march=i686 $(call cc-option,-mtune=pentium3) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0
55cflags-$(CONFIG_MWINCHIPC6) += $(call cc-option,-march=winchip-c6,-march=i586)
56cflags-$(CONFIG_MWINCHIP2) += $(call cc-option,-march=winchip2,-march=i586)
57cflags-$(CONFIG_MWINCHIP3D) += $(call cc-option,-march=winchip2,-march=i586)
58cflags-$(CONFIG_MCYRIXIII) += $(call cc-option,-march=c3,-march=i486) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0
59cflags-$(CONFIG_MVIAC3_2) += $(call cc-option,-march=c3-2,-march=i686)
60
61# AMD Elan support
62cflags-$(CONFIG_X86_ELAN) += -march=i486
63
64# Geode GX1 support
65cflags-$(CONFIG_MGEODEGX1) += $(call cc-option,-march=pentium-mmx,-march=i486)
66 39
67# -mregparm=3 works ok on gcc-3.0 and later 40# -mregparm=3 works ok on gcc-3.0 and later
68# 41#
diff --git a/arch/i386/Makefile.cpu b/arch/i386/Makefile.cpu
new file mode 100644
index 000000000000..8e51456df23d
--- /dev/null
+++ b/arch/i386/Makefile.cpu
@@ -0,0 +1,41 @@
1# CPU tuning section - shared with UML.
2# Must change only cflags-y (or [yn]), not CFLAGS! That makes a difference for UML.
3
4#-mtune exists since gcc 3.4, and some -mcpu flavors didn't exist in gcc 2.95.
5HAS_MTUNE := $(call cc-option-yn, -mtune=i386)
6ifeq ($(HAS_MTUNE),y)
7tune = $(call cc-option,-mtune=$(1),)
8else
9tune = $(call cc-option,-mcpu=$(1),)
10endif
11
12align := $(cc-option-align)
13cflags-$(CONFIG_M386) += -march=i386
14cflags-$(CONFIG_M486) += -march=i486
15cflags-$(CONFIG_M586) += -march=i586
16cflags-$(CONFIG_M586TSC) += -march=i586
17cflags-$(CONFIG_M586MMX) += $(call cc-option,-march=pentium-mmx,-march=i586)
18cflags-$(CONFIG_M686) += -march=i686
19cflags-$(CONFIG_MPENTIUMII) += -march=i686 $(call tune,pentium2)
20cflags-$(CONFIG_MPENTIUMIII) += -march=i686 $(call tune,pentium3)
21cflags-$(CONFIG_MPENTIUMM) += -march=i686 $(call tune,pentium3)
22cflags-$(CONFIG_MPENTIUM4) += -march=i686 $(call tune,pentium4)
23cflags-$(CONFIG_MK6) += -march=k6
24# Please note, that patches that add -march=athlon-xp and friends are pointless.
25# They make zero difference whatsosever to performance at this time.
26cflags-$(CONFIG_MK7) += $(call cc-option,-march=athlon,-march=i686 $(align)-functions=4)
27cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8,$(call cc-option,-march=athlon,-march=i686 $(align)-functions=4))
28cflags-$(CONFIG_MCRUSOE) += -march=i686 $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0
29cflags-$(CONFIG_MEFFICEON) += -march=i686 $(call tune,pentium3) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0
30cflags-$(CONFIG_MWINCHIPC6) += $(call cc-option,-march=winchip-c6,-march=i586)
31cflags-$(CONFIG_MWINCHIP2) += $(call cc-option,-march=winchip2,-march=i586)
32cflags-$(CONFIG_MWINCHIP3D) += $(call cc-option,-march=winchip2,-march=i586)
33cflags-$(CONFIG_MCYRIXIII) += $(call cc-option,-march=c3,-march=i486) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0
34cflags-$(CONFIG_MVIAC3_2) += $(call cc-option,-march=c3-2,-march=i686)
35
36# AMD Elan support
37cflags-$(CONFIG_X86_ELAN) += -march=i486
38
39# Geode GX1 support
40cflags-$(CONFIG_MGEODEGX1) += $(call cc-option,-march=pentium-mmx,-march=i486)
41
diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c
index 5546ddebec33..9204be6eedb3 100644
--- a/arch/i386/kernel/apic.c
+++ b/arch/i386/kernel/apic.c
@@ -803,6 +803,7 @@ no_apic:
803 803
804void __init init_apic_mappings(void) 804void __init init_apic_mappings(void)
805{ 805{
806 unsigned int orig_apicid;
806 unsigned long apic_phys; 807 unsigned long apic_phys;
807 808
808 /* 809 /*
@@ -824,8 +825,11 @@ void __init init_apic_mappings(void)
824 * Fetch the APIC ID of the BSP in case we have a 825 * Fetch the APIC ID of the BSP in case we have a
825 * default configuration (or the MP table is broken). 826 * default configuration (or the MP table is broken).
826 */ 827 */
827 if (boot_cpu_physical_apicid == -1U) 828 orig_apicid = boot_cpu_physical_apicid;
828 boot_cpu_physical_apicid = GET_APIC_ID(apic_read(APIC_ID)); 829 boot_cpu_physical_apicid = GET_APIC_ID(apic_read(APIC_ID));
830 if ((orig_apicid != -1U) && (orig_apicid != boot_cpu_physical_apicid))
831 printk(KERN_WARNING "Boot APIC ID in local APIC unexpected (%d vs %d)",
832 orig_apicid, boot_cpu_physical_apicid);
829 833
830#ifdef CONFIG_X86_IO_APIC 834#ifdef CONFIG_X86_IO_APIC
831 { 835 {
@@ -1046,10 +1050,11 @@ static unsigned int calibration_result;
1046 1050
1047void __init setup_boot_APIC_clock(void) 1051void __init setup_boot_APIC_clock(void)
1048{ 1052{
1053 unsigned long flags;
1049 apic_printk(APIC_VERBOSE, "Using local APIC timer interrupts.\n"); 1054 apic_printk(APIC_VERBOSE, "Using local APIC timer interrupts.\n");
1050 using_apic_timer = 1; 1055 using_apic_timer = 1;
1051 1056
1052 local_irq_disable(); 1057 local_irq_save(flags);
1053 1058
1054 calibration_result = calibrate_APIC_clock(); 1059 calibration_result = calibrate_APIC_clock();
1055 /* 1060 /*
@@ -1057,7 +1062,7 @@ void __init setup_boot_APIC_clock(void)
1057 */ 1062 */
1058 setup_APIC_timer(calibration_result); 1063 setup_APIC_timer(calibration_result);
1059 1064
1060 local_irq_enable(); 1065 local_irq_restore(flags);
1061} 1066}
1062 1067
1063void __devinit setup_secondary_APIC_clock(void) 1068void __devinit setup_secondary_APIC_clock(void)
@@ -1254,40 +1259,81 @@ fastcall void smp_error_interrupt(struct pt_regs *regs)
1254} 1259}
1255 1260
1256/* 1261/*
1257 * This initializes the IO-APIC and APIC hardware if this is 1262 * This initializes the IO-APIC and APIC hardware.
1258 * a UP kernel.
1259 */ 1263 */
1260int __init APIC_init_uniprocessor (void) 1264int __init APIC_init(void)
1261{ 1265{
1262 if (enable_local_apic < 0) 1266 if (enable_local_apic < 0) {
1263 clear_bit(X86_FEATURE_APIC, boot_cpu_data.x86_capability); 1267 printk(KERN_INFO "APIC disabled\n");
1268 return -1;
1269 }
1264 1270
1265 if (!smp_found_config && !cpu_has_apic) 1271 /* See if we have a SMP configuration or have forced enabled
1272 * the local apic.
1273 */
1274 if (!smp_found_config && !acpi_lapic && !cpu_has_apic) {
1275 enable_local_apic = -1;
1266 return -1; 1276 return -1;
1277 }
1267 1278
1268 /* 1279 /*
1269 * Complain if the BIOS pretends there is one. 1280 * Complain if the BIOS pretends there is an apic.
1281 * Then get out because we don't have an a local apic.
1270 */ 1282 */
1271 if (!cpu_has_apic && APIC_INTEGRATED(apic_version[boot_cpu_physical_apicid])) { 1283 if (!cpu_has_apic && APIC_INTEGRATED(apic_version[boot_cpu_physical_apicid])) {
1272 printk(KERN_ERR "BIOS bug, local APIC #%d not detected!...\n", 1284 printk(KERN_ERR "BIOS bug, local APIC #%d not detected!...\n",
1273 boot_cpu_physical_apicid); 1285 boot_cpu_physical_apicid);
1286 printk(KERN_ERR "... forcing use of dummy APIC emulation. (tell your hw vendor)\n");
1287 enable_local_apic = -1;
1274 return -1; 1288 return -1;
1275 } 1289 }
1276 1290
1277 verify_local_APIC(); 1291 verify_local_APIC();
1278 1292
1293 /*
1294 * Should not be necessary because the MP table should list the boot
1295 * CPU too, but we do it for the sake of robustness anyway.
1296 * Makes no sense to do this check in clustered apic mode, so skip it
1297 */
1298 if (!check_phys_apicid_present(boot_cpu_physical_apicid)) {
1299 printk("weird, boot CPU (#%d) not listed by the BIOS.\n",
1300 boot_cpu_physical_apicid);
1301 physid_set(boot_cpu_physical_apicid, phys_cpu_present_map);
1302 }
1303
1304 /*
1305 * Switch from PIC to APIC mode.
1306 */
1279 connect_bsp_APIC(); 1307 connect_bsp_APIC();
1308 setup_local_APIC();
1280 1309
1281 phys_cpu_present_map = physid_mask_of_physid(boot_cpu_physical_apicid); 1310#ifdef CONFIG_X86_IO_APIC
1311 /*
1312 * Now start the IO-APICs
1313 */
1314 if (smp_found_config && !skip_ioapic_setup && nr_ioapics)
1315 setup_IO_APIC();
1316#endif
1317 return 0;
1318}
1282 1319
1283 setup_local_APIC(); 1320void __init APIC_late_time_init(void)
1321{
1322 /* Improve our loops per jiffy estimate */
1323 loops_per_jiffy = ((1000 + HZ - 1)/HZ)*cpu_khz;
1324 boot_cpu_data.loops_per_jiffy = loops_per_jiffy;
1325 cpu_data[0].loops_per_jiffy = loops_per_jiffy;
1326
1327 /* setup_apic_nmi_watchdog doesn't work properly before cpu_khz is
1328 * initialized. So redo it here to ensure the boot cpu is setup
1329 * properly.
1330 */
1331 if (nmi_watchdog == NMI_LOCAL_APIC)
1332 setup_apic_nmi_watchdog();
1284 1333
1285#ifdef CONFIG_X86_IO_APIC 1334#ifdef CONFIG_X86_IO_APIC
1286 if (smp_found_config) 1335 if (smp_found_config && !skip_ioapic_setup && nr_ioapics)
1287 if (!skip_ioapic_setup && nr_ioapics) 1336 IO_APIC_late_time_init();
1288 setup_IO_APIC();
1289#endif 1337#endif
1290 setup_boot_APIC_clock(); 1338 setup_boot_APIC_clock();
1291
1292 return 0;
1293} 1339}
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c
index d7811c4e8b50..d2ef0c2aa93e 100644
--- a/arch/i386/kernel/apm.c
+++ b/arch/i386/kernel/apm.c
@@ -597,12 +597,14 @@ static u8 apm_bios_call(u32 func, u32 ebx_in, u32 ecx_in,
597 cpumask_t cpus; 597 cpumask_t cpus;
598 int cpu; 598 int cpu;
599 struct desc_struct save_desc_40; 599 struct desc_struct save_desc_40;
600 struct desc_struct *gdt;
600 601
601 cpus = apm_save_cpus(); 602 cpus = apm_save_cpus();
602 603
603 cpu = get_cpu(); 604 cpu = get_cpu();
604 save_desc_40 = per_cpu(cpu_gdt_table, cpu)[0x40 / 8]; 605 gdt = get_cpu_gdt_table(cpu);
605 per_cpu(cpu_gdt_table, cpu)[0x40 / 8] = bad_bios_desc; 606 save_desc_40 = gdt[0x40 / 8];
607 gdt[0x40 / 8] = bad_bios_desc;
606 608
607 local_save_flags(flags); 609 local_save_flags(flags);
608 APM_DO_CLI; 610 APM_DO_CLI;
@@ -610,7 +612,7 @@ static u8 apm_bios_call(u32 func, u32 ebx_in, u32 ecx_in,
610 apm_bios_call_asm(func, ebx_in, ecx_in, eax, ebx, ecx, edx, esi); 612 apm_bios_call_asm(func, ebx_in, ecx_in, eax, ebx, ecx, edx, esi);
611 APM_DO_RESTORE_SEGS; 613 APM_DO_RESTORE_SEGS;
612 local_irq_restore(flags); 614 local_irq_restore(flags);
613 per_cpu(cpu_gdt_table, cpu)[0x40 / 8] = save_desc_40; 615 gdt[0x40 / 8] = save_desc_40;
614 put_cpu(); 616 put_cpu();
615 apm_restore_cpus(cpus); 617 apm_restore_cpus(cpus);
616 618
@@ -639,13 +641,14 @@ static u8 apm_bios_call_simple(u32 func, u32 ebx_in, u32 ecx_in, u32 *eax)
639 cpumask_t cpus; 641 cpumask_t cpus;
640 int cpu; 642 int cpu;
641 struct desc_struct save_desc_40; 643 struct desc_struct save_desc_40;
642 644 struct desc_struct *gdt;
643 645
644 cpus = apm_save_cpus(); 646 cpus = apm_save_cpus();
645 647
646 cpu = get_cpu(); 648 cpu = get_cpu();
647 save_desc_40 = per_cpu(cpu_gdt_table, cpu)[0x40 / 8]; 649 gdt = get_cpu_gdt_table(cpu);
648 per_cpu(cpu_gdt_table, cpu)[0x40 / 8] = bad_bios_desc; 650 save_desc_40 = gdt[0x40 / 8];
651 gdt[0x40 / 8] = bad_bios_desc;
649 652
650 local_save_flags(flags); 653 local_save_flags(flags);
651 APM_DO_CLI; 654 APM_DO_CLI;
@@ -653,7 +656,7 @@ static u8 apm_bios_call_simple(u32 func, u32 ebx_in, u32 ecx_in, u32 *eax)
653 error = apm_bios_call_simple_asm(func, ebx_in, ecx_in, eax); 656 error = apm_bios_call_simple_asm(func, ebx_in, ecx_in, eax);
654 APM_DO_RESTORE_SEGS; 657 APM_DO_RESTORE_SEGS;
655 local_irq_restore(flags); 658 local_irq_restore(flags);
656 __get_cpu_var(cpu_gdt_table)[0x40 / 8] = save_desc_40; 659 gdt[0x40 / 8] = save_desc_40;
657 put_cpu(); 660 put_cpu();
658 apm_restore_cpus(cpus); 661 apm_restore_cpus(cpus);
659 return error; 662 return error;
@@ -2295,35 +2298,36 @@ static int __init apm_init(void)
2295 apm_bios_entry.segment = APM_CS; 2298 apm_bios_entry.segment = APM_CS;
2296 2299
2297 for (i = 0; i < NR_CPUS; i++) { 2300 for (i = 0; i < NR_CPUS; i++) {
2298 set_base(per_cpu(cpu_gdt_table, i)[APM_CS >> 3], 2301 struct desc_struct *gdt = get_cpu_gdt_table(i);
2302 set_base(gdt[APM_CS >> 3],
2299 __va((unsigned long)apm_info.bios.cseg << 4)); 2303 __va((unsigned long)apm_info.bios.cseg << 4));
2300 set_base(per_cpu(cpu_gdt_table, i)[APM_CS_16 >> 3], 2304 set_base(gdt[APM_CS_16 >> 3],
2301 __va((unsigned long)apm_info.bios.cseg_16 << 4)); 2305 __va((unsigned long)apm_info.bios.cseg_16 << 4));
2302 set_base(per_cpu(cpu_gdt_table, i)[APM_DS >> 3], 2306 set_base(gdt[APM_DS >> 3],
2303 __va((unsigned long)apm_info.bios.dseg << 4)); 2307 __va((unsigned long)apm_info.bios.dseg << 4));
2304#ifndef APM_RELAX_SEGMENTS 2308#ifndef APM_RELAX_SEGMENTS
2305 if (apm_info.bios.version == 0x100) { 2309 if (apm_info.bios.version == 0x100) {
2306#endif 2310#endif
2307 /* For ASUS motherboard, Award BIOS rev 110 (and others?) */ 2311 /* For ASUS motherboard, Award BIOS rev 110 (and others?) */
2308 _set_limit((char *)&per_cpu(cpu_gdt_table, i)[APM_CS >> 3], 64 * 1024 - 1); 2312 _set_limit((char *)&gdt[APM_CS >> 3], 64 * 1024 - 1);
2309 /* For some unknown machine. */ 2313 /* For some unknown machine. */
2310 _set_limit((char *)&per_cpu(cpu_gdt_table, i)[APM_CS_16 >> 3], 64 * 1024 - 1); 2314 _set_limit((char *)&gdt[APM_CS_16 >> 3], 64 * 1024 - 1);
2311 /* For the DEC Hinote Ultra CT475 (and others?) */ 2315 /* For the DEC Hinote Ultra CT475 (and others?) */
2312 _set_limit((char *)&per_cpu(cpu_gdt_table, i)[APM_DS >> 3], 64 * 1024 - 1); 2316 _set_limit((char *)&gdt[APM_DS >> 3], 64 * 1024 - 1);
2313#ifndef APM_RELAX_SEGMENTS 2317#ifndef APM_RELAX_SEGMENTS
2314 } else { 2318 } else {
2315 _set_limit((char *)&per_cpu(cpu_gdt_table, i)[APM_CS >> 3], 2319 _set_limit((char *)&gdt[APM_CS >> 3],
2316 (apm_info.bios.cseg_len - 1) & 0xffff); 2320 (apm_info.bios.cseg_len - 1) & 0xffff);
2317 _set_limit((char *)&per_cpu(cpu_gdt_table, i)[APM_CS_16 >> 3], 2321 _set_limit((char *)&gdt[APM_CS_16 >> 3],
2318 (apm_info.bios.cseg_16_len - 1) & 0xffff); 2322 (apm_info.bios.cseg_16_len - 1) & 0xffff);
2319 _set_limit((char *)&per_cpu(cpu_gdt_table, i)[APM_DS >> 3], 2323 _set_limit((char *)&gdt[APM_DS >> 3],
2320 (apm_info.bios.dseg_len - 1) & 0xffff); 2324 (apm_info.bios.dseg_len - 1) & 0xffff);
2321 /* workaround for broken BIOSes */ 2325 /* workaround for broken BIOSes */
2322 if (apm_info.bios.cseg_len <= apm_info.bios.offset) 2326 if (apm_info.bios.cseg_len <= apm_info.bios.offset)
2323 _set_limit((char *)&per_cpu(cpu_gdt_table, i)[APM_CS >> 3], 64 * 1024 -1); 2327 _set_limit((char *)&gdt[APM_CS >> 3], 64 * 1024 -1);
2324 if (apm_info.bios.dseg_len <= 0x40) { /* 0x40 * 4kB == 64kB */ 2328 if (apm_info.bios.dseg_len <= 0x40) { /* 0x40 * 4kB == 64kB */
2325 /* for the BIOS that assumes granularity = 1 */ 2329 /* for the BIOS that assumes granularity = 1 */
2326 per_cpu(cpu_gdt_table, i)[APM_DS >> 3].b |= 0x800000; 2330 gdt[APM_DS >> 3].b |= 0x800000;
2327 printk(KERN_NOTICE "apm: we set the granularity of dseg.\n"); 2331 printk(KERN_NOTICE "apm: we set the granularity of dseg.\n");
2328 } 2332 }
2329 } 2333 }
diff --git a/arch/i386/kernel/cpu/common.c b/arch/i386/kernel/cpu/common.c
index 9ad43be9a01f..74145a33cb0f 100644
--- a/arch/i386/kernel/cpu/common.c
+++ b/arch/i386/kernel/cpu/common.c
@@ -573,6 +573,7 @@ void __devinit cpu_init(void)
573 int cpu = smp_processor_id(); 573 int cpu = smp_processor_id();
574 struct tss_struct * t = &per_cpu(init_tss, cpu); 574 struct tss_struct * t = &per_cpu(init_tss, cpu);
575 struct thread_struct *thread = &current->thread; 575 struct thread_struct *thread = &current->thread;
576 struct desc_struct *gdt = get_cpu_gdt_table(cpu);
576 __u32 stk16_off = (__u32)&per_cpu(cpu_16bit_stack, cpu); 577 __u32 stk16_off = (__u32)&per_cpu(cpu_16bit_stack, cpu);
577 578
578 if (cpu_test_and_set(cpu, cpu_initialized)) { 579 if (cpu_test_and_set(cpu, cpu_initialized)) {
@@ -594,24 +595,16 @@ void __devinit cpu_init(void)
594 * Initialize the per-CPU GDT with the boot GDT, 595 * Initialize the per-CPU GDT with the boot GDT,
595 * and set up the GDT descriptor: 596 * and set up the GDT descriptor:
596 */ 597 */
597 memcpy(&per_cpu(cpu_gdt_table, cpu), cpu_gdt_table, 598 memcpy(gdt, cpu_gdt_table, GDT_SIZE);
598 GDT_SIZE);
599 599
600 /* Set up GDT entry for 16bit stack */ 600 /* Set up GDT entry for 16bit stack */
601 *(__u64 *)&(per_cpu(cpu_gdt_table, cpu)[GDT_ENTRY_ESPFIX_SS]) |= 601 *(__u64 *)(&gdt[GDT_ENTRY_ESPFIX_SS]) |=
602 ((((__u64)stk16_off) << 16) & 0x000000ffffff0000ULL) | 602 ((((__u64)stk16_off) << 16) & 0x000000ffffff0000ULL) |
603 ((((__u64)stk16_off) << 32) & 0xff00000000000000ULL) | 603 ((((__u64)stk16_off) << 32) & 0xff00000000000000ULL) |
604 (CPU_16BIT_STACK_SIZE - 1); 604 (CPU_16BIT_STACK_SIZE - 1);
605 605
606 cpu_gdt_descr[cpu].size = GDT_SIZE - 1; 606 cpu_gdt_descr[cpu].size = GDT_SIZE - 1;
607 cpu_gdt_descr[cpu].address = 607 cpu_gdt_descr[cpu].address = (unsigned long)gdt;
608 (unsigned long)&per_cpu(cpu_gdt_table, cpu);
609
610 /*
611 * Set up the per-thread TLS descriptor cache:
612 */
613 memcpy(thread->tls_array, &per_cpu(cpu_gdt_table, cpu),
614 GDT_ENTRY_TLS_ENTRIES * 8);
615 608
616 load_gdt(&cpu_gdt_descr[cpu]); 609 load_gdt(&cpu_gdt_descr[cpu]);
617 load_idt(&idt_descr); 610 load_idt(&idt_descr);
diff --git a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
index 822c8ce9d1f1..caa9f7711343 100644
--- a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
+++ b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
@@ -32,6 +32,7 @@
32#include <linux/proc_fs.h> 32#include <linux/proc_fs.h>
33#include <linux/seq_file.h> 33#include <linux/seq_file.h>
34#include <linux/compiler.h> 34#include <linux/compiler.h>
35#include <linux/sched.h> /* current */
35#include <asm/io.h> 36#include <asm/io.h>
36#include <asm/delay.h> 37#include <asm/delay.h>
37#include <asm/uaccess.h> 38#include <asm/uaccess.h>
diff --git a/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c b/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c
index aa622d52c6e5..270f2188d68b 100644
--- a/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c
+++ b/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c
@@ -28,6 +28,7 @@
28#include <linux/cpufreq.h> 28#include <linux/cpufreq.h>
29#include <linux/slab.h> 29#include <linux/slab.h>
30#include <linux/cpumask.h> 30#include <linux/cpumask.h>
31#include <linux/sched.h> /* current / set_cpus_allowed() */
31 32
32#include <asm/processor.h> 33#include <asm/processor.h>
33#include <asm/msr.h> 34#include <asm/msr.h>
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
index 58ca98fdc2ca..2d5c9adba0cd 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
@@ -32,6 +32,7 @@
32#include <linux/slab.h> 32#include <linux/slab.h>
33#include <linux/string.h> 33#include <linux/string.h>
34#include <linux/cpumask.h> 34#include <linux/cpumask.h>
35#include <linux/sched.h> /* for current / set_cpus_allowed() */
35 36
36#include <asm/msr.h> 37#include <asm/msr.h>
37#include <asm/io.h> 38#include <asm/io.h>
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
index c397b6220430..1465974256c9 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
+++ b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
@@ -22,6 +22,7 @@
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/cpufreq.h> 23#include <linux/cpufreq.h>
24#include <linux/config.h> 24#include <linux/config.h>
25#include <linux/sched.h> /* current */
25#include <linux/delay.h> 26#include <linux/delay.h>
26#include <linux/compiler.h> 27#include <linux/compiler.h>
27 28
diff --git a/arch/i386/kernel/cpu/intel_cacheinfo.c b/arch/i386/kernel/cpu/intel_cacheinfo.c
index 9e0d5f83cb9f..4dc42a189ae5 100644
--- a/arch/i386/kernel/cpu/intel_cacheinfo.c
+++ b/arch/i386/kernel/cpu/intel_cacheinfo.c
@@ -3,6 +3,7 @@
3 * 3 *
4 * Changes: 4 * Changes:
5 * Venkatesh Pallipadi : Adding cache identification through cpuid(4) 5 * Venkatesh Pallipadi : Adding cache identification through cpuid(4)
6 * Ashok Raj <ashok.raj@intel.com>: Work with CPU hotplug infrastructure.
6 */ 7 */
7 8
8#include <linux/init.h> 9#include <linux/init.h>
@@ -10,6 +11,7 @@
10#include <linux/device.h> 11#include <linux/device.h>
11#include <linux/compiler.h> 12#include <linux/compiler.h>
12#include <linux/cpu.h> 13#include <linux/cpu.h>
14#include <linux/sched.h>
13 15
14#include <asm/processor.h> 16#include <asm/processor.h>
15#include <asm/smp.h> 17#include <asm/smp.h>
@@ -28,7 +30,7 @@ struct _cache_table
28}; 30};
29 31
30/* all the cache descriptor types we care about (no TLB or trace cache entries) */ 32/* all the cache descriptor types we care about (no TLB or trace cache entries) */
31static struct _cache_table cache_table[] __devinitdata = 33static struct _cache_table cache_table[] __cpuinitdata =
32{ 34{
33 { 0x06, LVL_1_INST, 8 }, /* 4-way set assoc, 32 byte line size */ 35 { 0x06, LVL_1_INST, 8 }, /* 4-way set assoc, 32 byte line size */
34 { 0x08, LVL_1_INST, 16 }, /* 4-way set assoc, 32 byte line size */ 36 { 0x08, LVL_1_INST, 16 }, /* 4-way set assoc, 32 byte line size */
@@ -117,10 +119,9 @@ struct _cpuid4_info {
117 cpumask_t shared_cpu_map; 119 cpumask_t shared_cpu_map;
118}; 120};
119 121
120#define MAX_CACHE_LEAVES 4
121static unsigned short num_cache_leaves; 122static unsigned short num_cache_leaves;
122 123
123static int __devinit cpuid4_cache_lookup(int index, struct _cpuid4_info *this_leaf) 124static int __cpuinit cpuid4_cache_lookup(int index, struct _cpuid4_info *this_leaf)
124{ 125{
125 unsigned int eax, ebx, ecx, edx; 126 unsigned int eax, ebx, ecx, edx;
126 union _cpuid4_leaf_eax cache_eax; 127 union _cpuid4_leaf_eax cache_eax;
@@ -144,23 +145,18 @@ static int __init find_num_cache_leaves(void)
144{ 145{
145 unsigned int eax, ebx, ecx, edx; 146 unsigned int eax, ebx, ecx, edx;
146 union _cpuid4_leaf_eax cache_eax; 147 union _cpuid4_leaf_eax cache_eax;
147 int i; 148 int i = -1;
148 int retval;
149 149
150 retval = MAX_CACHE_LEAVES; 150 do {
151 /* Do cpuid(4) loop to find out num_cache_leaves */ 151 ++i;
152 for (i = 0; i < MAX_CACHE_LEAVES; i++) { 152 /* Do cpuid(4) loop to find out num_cache_leaves */
153 cpuid_count(4, i, &eax, &ebx, &ecx, &edx); 153 cpuid_count(4, i, &eax, &ebx, &ecx, &edx);
154 cache_eax.full = eax; 154 cache_eax.full = eax;
155 if (cache_eax.split.type == CACHE_TYPE_NULL) { 155 } while (cache_eax.split.type != CACHE_TYPE_NULL);
156 retval = i; 156 return i;
157 break;
158 }
159 }
160 return retval;
161} 157}
162 158
163unsigned int __devinit init_intel_cacheinfo(struct cpuinfo_x86 *c) 159unsigned int __cpuinit init_intel_cacheinfo(struct cpuinfo_x86 *c)
164{ 160{
165 unsigned int trace = 0, l1i = 0, l1d = 0, l2 = 0, l3 = 0; /* Cache sizes */ 161 unsigned int trace = 0, l1i = 0, l1d = 0, l2 = 0, l3 = 0; /* Cache sizes */
166 unsigned int new_l1d = 0, new_l1i = 0; /* Cache sizes from cpuid(4) */ 162 unsigned int new_l1d = 0, new_l1i = 0; /* Cache sizes from cpuid(4) */
@@ -284,13 +280,7 @@ unsigned int __devinit init_intel_cacheinfo(struct cpuinfo_x86 *c)
284 if ( l3 ) 280 if ( l3 )
285 printk(KERN_INFO "CPU: L3 cache: %dK\n", l3); 281 printk(KERN_INFO "CPU: L3 cache: %dK\n", l3);
286 282
287 /* 283 c->x86_cache_size = l3 ? l3 : (l2 ? l2 : (l1i+l1d));
288 * This assumes the L3 cache is shared; it typically lives in
289 * the northbridge. The L1 caches are included by the L2
290 * cache, and so should not be included for the purpose of
291 * SMP switching weights.
292 */
293 c->x86_cache_size = l2 ? l2 : (l1i+l1d);
294 } 284 }
295 285
296 return l2; 286 return l2;
@@ -301,7 +291,7 @@ static struct _cpuid4_info *cpuid4_info[NR_CPUS];
301#define CPUID4_INFO_IDX(x,y) (&((cpuid4_info[x])[y])) 291#define CPUID4_INFO_IDX(x,y) (&((cpuid4_info[x])[y]))
302 292
303#ifdef CONFIG_SMP 293#ifdef CONFIG_SMP
304static void __devinit cache_shared_cpu_map_setup(unsigned int cpu, int index) 294static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index)
305{ 295{
306 struct _cpuid4_info *this_leaf; 296 struct _cpuid4_info *this_leaf;
307 unsigned long num_threads_sharing; 297 unsigned long num_threads_sharing;
@@ -334,7 +324,7 @@ static void free_cache_attributes(unsigned int cpu)
334 cpuid4_info[cpu] = NULL; 324 cpuid4_info[cpu] = NULL;
335} 325}
336 326
337static int __devinit detect_cache_attributes(unsigned int cpu) 327static int __cpuinit detect_cache_attributes(unsigned int cpu)
338{ 328{
339 struct _cpuid4_info *this_leaf; 329 struct _cpuid4_info *this_leaf;
340 unsigned long j; 330 unsigned long j;
@@ -511,7 +501,7 @@ static void cpuid4_cache_sysfs_exit(unsigned int cpu)
511 free_cache_attributes(cpu); 501 free_cache_attributes(cpu);
512} 502}
513 503
514static int __devinit cpuid4_cache_sysfs_init(unsigned int cpu) 504static int __cpuinit cpuid4_cache_sysfs_init(unsigned int cpu)
515{ 505{
516 506
517 if (num_cache_leaves == 0) 507 if (num_cache_leaves == 0)
@@ -542,7 +532,7 @@ err_out:
542} 532}
543 533
544/* Add/Remove cache interface for CPU device */ 534/* Add/Remove cache interface for CPU device */
545static int __devinit cache_add_dev(struct sys_device * sys_dev) 535static int __cpuinit cache_add_dev(struct sys_device * sys_dev)
546{ 536{
547 unsigned int cpu = sys_dev->id; 537 unsigned int cpu = sys_dev->id;
548 unsigned long i, j; 538 unsigned long i, j;
@@ -579,7 +569,7 @@ static int __devinit cache_add_dev(struct sys_device * sys_dev)
579 return retval; 569 return retval;
580} 570}
581 571
582static int __devexit cache_remove_dev(struct sys_device * sys_dev) 572static void __cpuexit cache_remove_dev(struct sys_device * sys_dev)
583{ 573{
584 unsigned int cpu = sys_dev->id; 574 unsigned int cpu = sys_dev->id;
585 unsigned long i; 575 unsigned long i;
@@ -588,24 +578,49 @@ static int __devexit cache_remove_dev(struct sys_device * sys_dev)
588 kobject_unregister(&(INDEX_KOBJECT_PTR(cpu,i)->kobj)); 578 kobject_unregister(&(INDEX_KOBJECT_PTR(cpu,i)->kobj));
589 kobject_unregister(cache_kobject[cpu]); 579 kobject_unregister(cache_kobject[cpu]);
590 cpuid4_cache_sysfs_exit(cpu); 580 cpuid4_cache_sysfs_exit(cpu);
591 return 0; 581 return;
582}
583
584static int __cpuinit cacheinfo_cpu_callback(struct notifier_block *nfb,
585 unsigned long action, void *hcpu)
586{
587 unsigned int cpu = (unsigned long)hcpu;
588 struct sys_device *sys_dev;
589
590 sys_dev = get_cpu_sysdev(cpu);
591 switch (action) {
592 case CPU_ONLINE:
593 cache_add_dev(sys_dev);
594 break;
595 case CPU_DEAD:
596 cache_remove_dev(sys_dev);
597 break;
598 }
599 return NOTIFY_OK;
592} 600}
593 601
594static struct sysdev_driver cache_sysdev_driver = { 602static struct notifier_block cacheinfo_cpu_notifier =
595 .add = cache_add_dev, 603{
596 .remove = __devexit_p(cache_remove_dev), 604 .notifier_call = cacheinfo_cpu_callback,
597}; 605};
598 606
599/* Register/Unregister the cpu_cache driver */ 607static int __cpuinit cache_sysfs_init(void)
600static int __devinit cache_register_driver(void)
601{ 608{
609 int i;
610
602 if (num_cache_leaves == 0) 611 if (num_cache_leaves == 0)
603 return 0; 612 return 0;
604 613
605 return sysdev_driver_register(&cpu_sysdev_class,&cache_sysdev_driver); 614 register_cpu_notifier(&cacheinfo_cpu_notifier);
615
616 for_each_online_cpu(i) {
617 cacheinfo_cpu_callback(&cacheinfo_cpu_notifier, CPU_ONLINE,
618 (void *)(long)i);
619 }
620
621 return 0;
606} 622}
607 623
608device_initcall(cache_register_driver); 624device_initcall(cache_sysfs_init);
609 625
610#endif 626#endif
611
diff --git a/arch/i386/kernel/cpu/mcheck/p6.c b/arch/i386/kernel/cpu/mcheck/p6.c
index 3c035b8fa3d9..979b18bc95c1 100644
--- a/arch/i386/kernel/cpu/mcheck/p6.c
+++ b/arch/i386/kernel/cpu/mcheck/p6.c
@@ -102,11 +102,16 @@ void __devinit intel_p6_mcheck_init(struct cpuinfo_x86 *c)
102 wrmsr(MSR_IA32_MCG_CTL, 0xffffffff, 0xffffffff); 102 wrmsr(MSR_IA32_MCG_CTL, 0xffffffff, 0xffffffff);
103 nr_mce_banks = l & 0xff; 103 nr_mce_banks = l & 0xff;
104 104
105 /* Don't enable bank 0 on intel P6 cores, it goes bang quickly. */ 105 /*
106 for (i=1; i<nr_mce_banks; i++) { 106 * Following the example in IA-32 SDM Vol 3:
107 * - MC0_CTL should not be written
108 * - Status registers on all banks should be cleared on reset
109 */
110 for (i=1; i<nr_mce_banks; i++)
107 wrmsr (MSR_IA32_MC0_CTL+4*i, 0xffffffff, 0xffffffff); 111 wrmsr (MSR_IA32_MC0_CTL+4*i, 0xffffffff, 0xffffffff);
112
113 for (i=0; i<nr_mce_banks; i++)
108 wrmsr (MSR_IA32_MC0_STATUS+4*i, 0x0, 0x0); 114 wrmsr (MSR_IA32_MC0_STATUS+4*i, 0x0, 0x0);
109 }
110 115
111 set_in_cr4 (X86_CR4_MCE); 116 set_in_cr4 (X86_CR4_MCE);
112 printk (KERN_INFO "Intel machine check reporting enabled on CPU#%d.\n", 117 printk (KERN_INFO "Intel machine check reporting enabled on CPU#%d.\n",
diff --git a/arch/i386/kernel/cpu/mtrr/if.c b/arch/i386/kernel/cpu/mtrr/if.c
index 1923e0aed26a..cf39e205d33c 100644
--- a/arch/i386/kernel/cpu/mtrr/if.c
+++ b/arch/i386/kernel/cpu/mtrr/if.c
@@ -149,60 +149,89 @@ mtrr_write(struct file *file, const char __user *buf, size_t len, loff_t * ppos)
149 return -EINVAL; 149 return -EINVAL;
150} 150}
151 151
152static int 152static long
153mtrr_ioctl(struct inode *inode, struct file *file, 153mtrr_ioctl(struct file *file, unsigned int cmd, unsigned long __arg)
154 unsigned int cmd, unsigned long __arg)
155{ 154{
156 int err; 155 int err = 0;
157 mtrr_type type; 156 mtrr_type type;
158 struct mtrr_sentry sentry; 157 struct mtrr_sentry sentry;
159 struct mtrr_gentry gentry; 158 struct mtrr_gentry gentry;
160 void __user *arg = (void __user *) __arg; 159 void __user *arg = (void __user *) __arg;
161 160
162 switch (cmd) { 161 switch (cmd) {
162 case MTRRIOC_ADD_ENTRY:
163 case MTRRIOC_SET_ENTRY:
164 case MTRRIOC_DEL_ENTRY:
165 case MTRRIOC_KILL_ENTRY:
166 case MTRRIOC_ADD_PAGE_ENTRY:
167 case MTRRIOC_SET_PAGE_ENTRY:
168 case MTRRIOC_DEL_PAGE_ENTRY:
169 case MTRRIOC_KILL_PAGE_ENTRY:
170 if (copy_from_user(&sentry, arg, sizeof sentry))
171 return -EFAULT;
172 break;
173 case MTRRIOC_GET_ENTRY:
174 case MTRRIOC_GET_PAGE_ENTRY:
175 if (copy_from_user(&gentry, arg, sizeof gentry))
176 return -EFAULT;
177 break;
178#ifdef CONFIG_COMPAT
179 case MTRRIOC32_ADD_ENTRY:
180 case MTRRIOC32_SET_ENTRY:
181 case MTRRIOC32_DEL_ENTRY:
182 case MTRRIOC32_KILL_ENTRY:
183 case MTRRIOC32_ADD_PAGE_ENTRY:
184 case MTRRIOC32_SET_PAGE_ENTRY:
185 case MTRRIOC32_DEL_PAGE_ENTRY:
186 case MTRRIOC32_KILL_PAGE_ENTRY: {
187 struct mtrr_sentry32 __user *s32 = (struct mtrr_sentry32 __user *)__arg;
188 err = get_user(sentry.base, &s32->base);
189 err |= get_user(sentry.size, &s32->size);
190 err |= get_user(sentry.type, &s32->type);
191 if (err)
192 return err;
193 break;
194 }
195 case MTRRIOC32_GET_ENTRY:
196 case MTRRIOC32_GET_PAGE_ENTRY: {
197 struct mtrr_gentry32 __user *g32 = (struct mtrr_gentry32 __user *)__arg;
198 err = get_user(gentry.regnum, &g32->regnum);
199 err |= get_user(gentry.base, &g32->base);
200 err |= get_user(gentry.size, &g32->size);
201 err |= get_user(gentry.type, &g32->type);
202 if (err)
203 return err;
204 break;
205 }
206#endif
207 }
208
209 switch (cmd) {
163 default: 210 default:
164 return -ENOTTY; 211 return -ENOTTY;
165 case MTRRIOC_ADD_ENTRY: 212 case MTRRIOC_ADD_ENTRY:
166 if (!capable(CAP_SYS_ADMIN)) 213 if (!capable(CAP_SYS_ADMIN))
167 return -EPERM; 214 return -EPERM;
168 if (copy_from_user(&sentry, arg, sizeof sentry))
169 return -EFAULT;
170 err = 215 err =
171 mtrr_file_add(sentry.base, sentry.size, sentry.type, 1, 216 mtrr_file_add(sentry.base, sentry.size, sentry.type, 1,
172 file, 0); 217 file, 0);
173 if (err < 0)
174 return err;
175 break; 218 break;
176 case MTRRIOC_SET_ENTRY: 219 case MTRRIOC_SET_ENTRY:
177 if (!capable(CAP_SYS_ADMIN)) 220 if (!capable(CAP_SYS_ADMIN))
178 return -EPERM; 221 return -EPERM;
179 if (copy_from_user(&sentry, arg, sizeof sentry))
180 return -EFAULT;
181 err = mtrr_add(sentry.base, sentry.size, sentry.type, 0); 222 err = mtrr_add(sentry.base, sentry.size, sentry.type, 0);
182 if (err < 0)
183 return err;
184 break; 223 break;
185 case MTRRIOC_DEL_ENTRY: 224 case MTRRIOC_DEL_ENTRY:
186 if (!capable(CAP_SYS_ADMIN)) 225 if (!capable(CAP_SYS_ADMIN))
187 return -EPERM; 226 return -EPERM;
188 if (copy_from_user(&sentry, arg, sizeof sentry))
189 return -EFAULT;
190 err = mtrr_file_del(sentry.base, sentry.size, file, 0); 227 err = mtrr_file_del(sentry.base, sentry.size, file, 0);
191 if (err < 0)
192 return err;
193 break; 228 break;
194 case MTRRIOC_KILL_ENTRY: 229 case MTRRIOC_KILL_ENTRY:
195 if (!capable(CAP_SYS_ADMIN)) 230 if (!capable(CAP_SYS_ADMIN))
196 return -EPERM; 231 return -EPERM;
197 if (copy_from_user(&sentry, arg, sizeof sentry))
198 return -EFAULT;
199 err = mtrr_del(-1, sentry.base, sentry.size); 232 err = mtrr_del(-1, sentry.base, sentry.size);
200 if (err < 0)
201 return err;
202 break; 233 break;
203 case MTRRIOC_GET_ENTRY: 234 case MTRRIOC_GET_ENTRY:
204 if (copy_from_user(&gentry, arg, sizeof gentry))
205 return -EFAULT;
206 if (gentry.regnum >= num_var_ranges) 235 if (gentry.regnum >= num_var_ranges)
207 return -EINVAL; 236 return -EINVAL;
208 mtrr_if->get(gentry.regnum, &gentry.base, &gentry.size, &type); 237 mtrr_if->get(gentry.regnum, &gentry.base, &gentry.size, &type);
@@ -217,60 +246,59 @@ mtrr_ioctl(struct inode *inode, struct file *file,
217 gentry.type = type; 246 gentry.type = type;
218 } 247 }
219 248
220 if (copy_to_user(arg, &gentry, sizeof gentry))
221 return -EFAULT;
222 break; 249 break;
223 case MTRRIOC_ADD_PAGE_ENTRY: 250 case MTRRIOC_ADD_PAGE_ENTRY:
224 if (!capable(CAP_SYS_ADMIN)) 251 if (!capable(CAP_SYS_ADMIN))
225 return -EPERM; 252 return -EPERM;
226 if (copy_from_user(&sentry, arg, sizeof sentry))
227 return -EFAULT;
228 err = 253 err =
229 mtrr_file_add(sentry.base, sentry.size, sentry.type, 1, 254 mtrr_file_add(sentry.base, sentry.size, sentry.type, 1,
230 file, 1); 255 file, 1);
231 if (err < 0)
232 return err;
233 break; 256 break;
234 case MTRRIOC_SET_PAGE_ENTRY: 257 case MTRRIOC_SET_PAGE_ENTRY:
235 if (!capable(CAP_SYS_ADMIN)) 258 if (!capable(CAP_SYS_ADMIN))
236 return -EPERM; 259 return -EPERM;
237 if (copy_from_user(&sentry, arg, sizeof sentry))
238 return -EFAULT;
239 err = mtrr_add_page(sentry.base, sentry.size, sentry.type, 0); 260 err = mtrr_add_page(sentry.base, sentry.size, sentry.type, 0);
240 if (err < 0)
241 return err;
242 break; 261 break;
243 case MTRRIOC_DEL_PAGE_ENTRY: 262 case MTRRIOC_DEL_PAGE_ENTRY:
244 if (!capable(CAP_SYS_ADMIN)) 263 if (!capable(CAP_SYS_ADMIN))
245 return -EPERM; 264 return -EPERM;
246 if (copy_from_user(&sentry, arg, sizeof sentry))
247 return -EFAULT;
248 err = mtrr_file_del(sentry.base, sentry.size, file, 1); 265 err = mtrr_file_del(sentry.base, sentry.size, file, 1);
249 if (err < 0)
250 return err;
251 break; 266 break;
252 case MTRRIOC_KILL_PAGE_ENTRY: 267 case MTRRIOC_KILL_PAGE_ENTRY:
253 if (!capable(CAP_SYS_ADMIN)) 268 if (!capable(CAP_SYS_ADMIN))
254 return -EPERM; 269 return -EPERM;
255 if (copy_from_user(&sentry, arg, sizeof sentry))
256 return -EFAULT;
257 err = mtrr_del_page(-1, sentry.base, sentry.size); 270 err = mtrr_del_page(-1, sentry.base, sentry.size);
258 if (err < 0)
259 return err;
260 break; 271 break;
261 case MTRRIOC_GET_PAGE_ENTRY: 272 case MTRRIOC_GET_PAGE_ENTRY:
262 if (copy_from_user(&gentry, arg, sizeof gentry))
263 return -EFAULT;
264 if (gentry.regnum >= num_var_ranges) 273 if (gentry.regnum >= num_var_ranges)
265 return -EINVAL; 274 return -EINVAL;
266 mtrr_if->get(gentry.regnum, &gentry.base, &gentry.size, &type); 275 mtrr_if->get(gentry.regnum, &gentry.base, &gentry.size, &type);
267 gentry.type = type; 276 gentry.type = type;
277 break;
278 }
279
280 if (err)
281 return err;
268 282
283 switch(cmd) {
284 case MTRRIOC_GET_ENTRY:
285 case MTRRIOC_GET_PAGE_ENTRY:
269 if (copy_to_user(arg, &gentry, sizeof gentry)) 286 if (copy_to_user(arg, &gentry, sizeof gentry))
270 return -EFAULT; 287 err = -EFAULT;
288 break;
289#ifdef CONFIG_COMPAT
290 case MTRRIOC32_GET_ENTRY:
291 case MTRRIOC32_GET_PAGE_ENTRY: {
292 struct mtrr_gentry32 __user *g32 = (struct mtrr_gentry32 __user *)__arg;
293 err = put_user(gentry.base, &g32->base);
294 err |= put_user(gentry.size, &g32->size);
295 err |= put_user(gentry.regnum, &g32->regnum);
296 err |= put_user(gentry.type, &g32->type);
271 break; 297 break;
272 } 298 }
273 return 0; 299#endif
300 }
301 return err;
274} 302}
275 303
276static int 304static int
@@ -310,7 +338,8 @@ static struct file_operations mtrr_fops = {
310 .read = seq_read, 338 .read = seq_read,
311 .llseek = seq_lseek, 339 .llseek = seq_lseek,
312 .write = mtrr_write, 340 .write = mtrr_write,
313 .ioctl = mtrr_ioctl, 341 .unlocked_ioctl = mtrr_ioctl,
342 .compat_ioctl = mtrr_ioctl,
314 .release = mtrr_close, 343 .release = mtrr_close,
315}; 344};
316 345
diff --git a/arch/i386/kernel/cpu/proc.c b/arch/i386/kernel/cpu/proc.c
index 8bd77d948a84..41b871ecf4b3 100644
--- a/arch/i386/kernel/cpu/proc.c
+++ b/arch/i386/kernel/cpu/proc.c
@@ -44,7 +44,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
44 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 44 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
45 45
46 /* Intel-defined (#2) */ 46 /* Intel-defined (#2) */
47 "pni", NULL, NULL, "monitor", "ds_cpl", NULL, NULL, "est", 47 "pni", NULL, NULL, "monitor", "ds_cpl", "vmx", NULL, "est",
48 "tm2", NULL, "cid", NULL, NULL, "cx16", "xtpr", NULL, 48 "tm2", NULL, "cid", NULL, NULL, "cx16", "xtpr", NULL,
49 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 49 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
50 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 50 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
diff --git a/arch/i386/kernel/crash.c b/arch/i386/kernel/crash.c
index 0248e084017c..af809ccf5fbe 100644
--- a/arch/i386/kernel/crash.c
+++ b/arch/i386/kernel/crash.c
@@ -21,7 +21,6 @@
21#include <asm/hardirq.h> 21#include <asm/hardirq.h>
22#include <asm/nmi.h> 22#include <asm/nmi.h>
23#include <asm/hw_irq.h> 23#include <asm/hw_irq.h>
24#include <asm/apic.h>
25#include <mach_ipi.h> 24#include <mach_ipi.h>
26 25
27 26
@@ -148,7 +147,6 @@ static int crash_nmi_callback(struct pt_regs *regs, int cpu)
148 regs = &fixed_regs; 147 regs = &fixed_regs;
149 } 148 }
150 crash_save_this_cpu(regs, cpu); 149 crash_save_this_cpu(regs, cpu);
151 disable_local_APIC();
152 atomic_dec(&waiting_for_crash_ipi); 150 atomic_dec(&waiting_for_crash_ipi);
153 /* Assume hlt works */ 151 /* Assume hlt works */
154 halt(); 152 halt();
@@ -188,7 +186,6 @@ static void nmi_shootdown_cpus(void)
188 } 186 }
189 187
190 /* Leave the nmi callback set */ 188 /* Leave the nmi callback set */
191 disable_local_APIC();
192} 189}
193#else 190#else
194static void nmi_shootdown_cpus(void) 191static void nmi_shootdown_cpus(void)
@@ -213,9 +210,5 @@ void machine_crash_shutdown(struct pt_regs *regs)
213 /* Make a note of crashing cpu. Will be used in NMI callback.*/ 210 /* Make a note of crashing cpu. Will be used in NMI callback.*/
214 crashing_cpu = smp_processor_id(); 211 crashing_cpu = smp_processor_id();
215 nmi_shootdown_cpus(); 212 nmi_shootdown_cpus();
216 lapic_shutdown();
217#if defined(CONFIG_X86_IO_APIC)
218 disable_IO_APIC();
219#endif
220 crash_save_self(regs); 213 crash_save_self(regs);
221} 214}
diff --git a/arch/i386/kernel/i8259.c b/arch/i386/kernel/i8259.c
index 323ef8ab3244..d86f24909284 100644
--- a/arch/i386/kernel/i8259.c
+++ b/arch/i386/kernel/i8259.c
@@ -435,4 +435,8 @@ void __init init_IRQ(void)
435 setup_irq(FPU_IRQ, &fpu_irq); 435 setup_irq(FPU_IRQ, &fpu_irq);
436 436
437 irq_ctx_init(smp_processor_id()); 437 irq_ctx_init(smp_processor_id());
438
439#ifdef CONFIG_X86_LOCAL_APIC
440 APIC_init();
441#endif
438} 442}
diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c
index fb3991e8229e..5a77c52b20a9 100644
--- a/arch/i386/kernel/io_apic.c
+++ b/arch/i386/kernel/io_apic.c
@@ -46,6 +46,9 @@
46int (*ioapic_renumber_irq)(int ioapic, int irq); 46int (*ioapic_renumber_irq)(int ioapic, int irq);
47atomic_t irq_mis_count; 47atomic_t irq_mis_count;
48 48
49/* Where if anywhere is the i8259 connect in external int mode */
50static struct { int pin, apic; } ioapic_i8259 = { -1, -1 };
51
49static DEFINE_SPINLOCK(ioapic_lock); 52static DEFINE_SPINLOCK(ioapic_lock);
50 53
51/* 54/*
@@ -738,7 +741,7 @@ static int find_irq_entry(int apic, int pin, int type)
738/* 741/*
739 * Find the pin to which IRQ[irq] (ISA) is connected 742 * Find the pin to which IRQ[irq] (ISA) is connected
740 */ 743 */
741static int find_isa_irq_pin(int irq, int type) 744static int __init find_isa_irq_pin(int irq, int type)
742{ 745{
743 int i; 746 int i;
744 747
@@ -758,6 +761,33 @@ static int find_isa_irq_pin(int irq, int type)
758 return -1; 761 return -1;
759} 762}
760 763
764static int __init find_isa_irq_apic(int irq, int type)
765{
766 int i;
767
768 for (i = 0; i < mp_irq_entries; i++) {
769 int lbus = mp_irqs[i].mpc_srcbus;
770
771 if ((mp_bus_id_to_type[lbus] == MP_BUS_ISA ||
772 mp_bus_id_to_type[lbus] == MP_BUS_EISA ||
773 mp_bus_id_to_type[lbus] == MP_BUS_MCA ||
774 mp_bus_id_to_type[lbus] == MP_BUS_NEC98
775 ) &&
776 (mp_irqs[i].mpc_irqtype == type) &&
777 (mp_irqs[i].mpc_srcbusirq == irq))
778 break;
779 }
780 if (i < mp_irq_entries) {
781 int apic;
782 for(apic = 0; apic < nr_ioapics; apic++) {
783 if (mp_ioapics[apic].mpc_apicid == mp_irqs[i].mpc_dstapic)
784 return apic;
785 }
786 }
787
788 return -1;
789}
790
761/* 791/*
762 * Find a specific PCI IRQ entry. 792 * Find a specific PCI IRQ entry.
763 * Not an __init, possibly needed by modules 793 * Not an __init, possibly needed by modules
@@ -1253,7 +1283,7 @@ static void __init setup_IO_APIC_irqs(void)
1253/* 1283/*
1254 * Set up the 8259A-master output pin: 1284 * Set up the 8259A-master output pin:
1255 */ 1285 */
1256static void __init setup_ExtINT_IRQ0_pin(unsigned int pin, int vector) 1286static void __init setup_ExtINT_IRQ0_pin(unsigned int apic, unsigned int pin, int vector)
1257{ 1287{
1258 struct IO_APIC_route_entry entry; 1288 struct IO_APIC_route_entry entry;
1259 unsigned long flags; 1289 unsigned long flags;
@@ -1287,8 +1317,8 @@ static void __init setup_ExtINT_IRQ0_pin(unsigned int pin, int vector)
1287 * Add it to the IO-APIC irq-routing table: 1317 * Add it to the IO-APIC irq-routing table:
1288 */ 1318 */
1289 spin_lock_irqsave(&ioapic_lock, flags); 1319 spin_lock_irqsave(&ioapic_lock, flags);
1290 io_apic_write(0, 0x11+2*pin, *(((int *)&entry)+1)); 1320 io_apic_write(apic, 0x11+2*pin, *(((int *)&entry)+1));
1291 io_apic_write(0, 0x10+2*pin, *(((int *)&entry)+0)); 1321 io_apic_write(apic, 0x10+2*pin, *(((int *)&entry)+0));
1292 spin_unlock_irqrestore(&ioapic_lock, flags); 1322 spin_unlock_irqrestore(&ioapic_lock, flags);
1293 1323
1294 enable_8259A_irq(0); 1324 enable_8259A_irq(0);
@@ -1595,7 +1625,8 @@ void /*__init*/ print_PIC(void)
1595static void __init enable_IO_APIC(void) 1625static void __init enable_IO_APIC(void)
1596{ 1626{
1597 union IO_APIC_reg_01 reg_01; 1627 union IO_APIC_reg_01 reg_01;
1598 int i; 1628 int i8259_apic, i8259_pin;
1629 int i, apic;
1599 unsigned long flags; 1630 unsigned long flags;
1600 1631
1601 for (i = 0; i < PIN_MAP_SIZE; i++) { 1632 for (i = 0; i < PIN_MAP_SIZE; i++) {
@@ -1609,11 +1640,52 @@ static void __init enable_IO_APIC(void)
1609 /* 1640 /*
1610 * The number of IO-APIC IRQ registers (== #pins): 1641 * The number of IO-APIC IRQ registers (== #pins):
1611 */ 1642 */
1612 for (i = 0; i < nr_ioapics; i++) { 1643 for (apic = 0; apic < nr_ioapics; apic++) {
1613 spin_lock_irqsave(&ioapic_lock, flags); 1644 spin_lock_irqsave(&ioapic_lock, flags);
1614 reg_01.raw = io_apic_read(i, 1); 1645 reg_01.raw = io_apic_read(apic, 1);
1615 spin_unlock_irqrestore(&ioapic_lock, flags); 1646 spin_unlock_irqrestore(&ioapic_lock, flags);
1616 nr_ioapic_registers[i] = reg_01.bits.entries+1; 1647 nr_ioapic_registers[apic] = reg_01.bits.entries+1;
1648 }
1649 for(apic = 0; apic < nr_ioapics; apic++) {
1650 int pin;
1651 /* See if any of the pins is in ExtINT mode */
1652 for(pin = 0; pin < nr_ioapic_registers[i]; pin++) {
1653 struct IO_APIC_route_entry entry;
1654 spin_lock_irqsave(&ioapic_lock, flags);
1655 *(((int *)&entry) + 0) = io_apic_read(apic, 0x10 + 2 * pin);
1656 *(((int *)&entry) + 1) = io_apic_read(apic, 0x11 + 2 * pin);
1657 spin_unlock_irqrestore(&ioapic_lock, flags);
1658
1659
1660 /* If the interrupt line is enabled and in ExtInt mode
1661 * I have found the pin where the i8259 is connected.
1662 */
1663 if ((entry.mask == 0) && (entry.delivery_mode == dest_ExtINT)) {
1664 ioapic_i8259.apic = apic;
1665 ioapic_i8259.pin = pin;
1666 goto found_i8259;
1667 }
1668 }
1669 }
1670 found_i8259:
1671 /* Look to see what if the MP table has reported the ExtINT */
1672 /* If we could not find the appropriate pin by looking at the ioapic
1673 * the i8259 probably is not connected the ioapic but give the
1674 * mptable a chance anyway.
1675 */
1676 i8259_pin = find_isa_irq_pin(0, mp_ExtINT);
1677 i8259_apic = find_isa_irq_apic(0, mp_ExtINT);
1678 /* Trust the MP table if nothing is setup in the hardware */
1679 if ((ioapic_i8259.pin == -1) && (i8259_pin >= 0)) {
1680 printk(KERN_WARNING "ExtINT not setup in hardware but reported by MP table\n");
1681 ioapic_i8259.pin = i8259_pin;
1682 ioapic_i8259.apic = i8259_apic;
1683 }
1684 /* Complain if the MP table and the hardware disagree */
1685 if (((ioapic_i8259.apic != i8259_apic) || (ioapic_i8259.pin != i8259_pin)) &&
1686 (i8259_pin >= 0) && (ioapic_i8259.pin >= 0))
1687 {
1688 printk(KERN_WARNING "ExtINT in hardware and MP table differ\n");
1617 } 1689 }
1618 1690
1619 /* 1691 /*
@@ -1627,7 +1699,6 @@ static void __init enable_IO_APIC(void)
1627 */ 1699 */
1628void disable_IO_APIC(void) 1700void disable_IO_APIC(void)
1629{ 1701{
1630 int pin;
1631 /* 1702 /*
1632 * Clear the IO-APIC before rebooting: 1703 * Clear the IO-APIC before rebooting:
1633 */ 1704 */
@@ -1638,8 +1709,7 @@ void disable_IO_APIC(void)
1638 * Put that IOAPIC in virtual wire mode 1709 * Put that IOAPIC in virtual wire mode
1639 * so legacy interrupts can be delivered. 1710 * so legacy interrupts can be delivered.
1640 */ 1711 */
1641 pin = find_isa_irq_pin(0, mp_ExtINT); 1712 if (ioapic_i8259.pin != -1) {
1642 if (pin != -1) {
1643 struct IO_APIC_route_entry entry; 1713 struct IO_APIC_route_entry entry;
1644 unsigned long flags; 1714 unsigned long flags;
1645 1715
@@ -1650,7 +1720,7 @@ void disable_IO_APIC(void)
1650 entry.polarity = 0; /* High */ 1720 entry.polarity = 0; /* High */
1651 entry.delivery_status = 0; 1721 entry.delivery_status = 0;
1652 entry.dest_mode = 0; /* Physical */ 1722 entry.dest_mode = 0; /* Physical */
1653 entry.delivery_mode = 7; /* ExtInt */ 1723 entry.delivery_mode = dest_ExtINT; /* ExtInt */
1654 entry.vector = 0; 1724 entry.vector = 0;
1655 entry.dest.physical.physical_dest = 0; 1725 entry.dest.physical.physical_dest = 0;
1656 1726
@@ -1659,11 +1729,13 @@ void disable_IO_APIC(void)
1659 * Add it to the IO-APIC irq-routing table: 1729 * Add it to the IO-APIC irq-routing table:
1660 */ 1730 */
1661 spin_lock_irqsave(&ioapic_lock, flags); 1731 spin_lock_irqsave(&ioapic_lock, flags);
1662 io_apic_write(0, 0x11+2*pin, *(((int *)&entry)+1)); 1732 io_apic_write(ioapic_i8259.apic, 0x11+2*ioapic_i8259.pin,
1663 io_apic_write(0, 0x10+2*pin, *(((int *)&entry)+0)); 1733 *(((int *)&entry)+1));
1734 io_apic_write(ioapic_i8259.apic, 0x10+2*ioapic_i8259.pin,
1735 *(((int *)&entry)+0));
1664 spin_unlock_irqrestore(&ioapic_lock, flags); 1736 spin_unlock_irqrestore(&ioapic_lock, flags);
1665 } 1737 }
1666 disconnect_bsp_APIC(pin != -1); 1738 disconnect_bsp_APIC(ioapic_i8259.pin != -1);
1667} 1739}
1668 1740
1669/* 1741/*
@@ -2113,20 +2185,21 @@ static void setup_nmi (void)
2113 */ 2185 */
2114static inline void unlock_ExtINT_logic(void) 2186static inline void unlock_ExtINT_logic(void)
2115{ 2187{
2116 int pin, i; 2188 int apic, pin, i;
2117 struct IO_APIC_route_entry entry0, entry1; 2189 struct IO_APIC_route_entry entry0, entry1;
2118 unsigned char save_control, save_freq_select; 2190 unsigned char save_control, save_freq_select;
2119 unsigned long flags; 2191 unsigned long flags;
2120 2192
2121 pin = find_isa_irq_pin(8, mp_INT); 2193 pin = find_isa_irq_pin(8, mp_INT);
2194 apic = find_isa_irq_apic(8, mp_INT);
2122 if (pin == -1) 2195 if (pin == -1)
2123 return; 2196 return;
2124 2197
2125 spin_lock_irqsave(&ioapic_lock, flags); 2198 spin_lock_irqsave(&ioapic_lock, flags);
2126 *(((int *)&entry0) + 1) = io_apic_read(0, 0x11 + 2 * pin); 2199 *(((int *)&entry0) + 1) = io_apic_read(apic, 0x11 + 2 * pin);
2127 *(((int *)&entry0) + 0) = io_apic_read(0, 0x10 + 2 * pin); 2200 *(((int *)&entry0) + 0) = io_apic_read(apic, 0x10 + 2 * pin);
2128 spin_unlock_irqrestore(&ioapic_lock, flags); 2201 spin_unlock_irqrestore(&ioapic_lock, flags);
2129 clear_IO_APIC_pin(0, pin); 2202 clear_IO_APIC_pin(apic, pin);
2130 2203
2131 memset(&entry1, 0, sizeof(entry1)); 2204 memset(&entry1, 0, sizeof(entry1));
2132 2205
@@ -2139,8 +2212,8 @@ static inline void unlock_ExtINT_logic(void)
2139 entry1.vector = 0; 2212 entry1.vector = 0;
2140 2213
2141 spin_lock_irqsave(&ioapic_lock, flags); 2214 spin_lock_irqsave(&ioapic_lock, flags);
2142 io_apic_write(0, 0x11 + 2 * pin, *(((int *)&entry1) + 1)); 2215 io_apic_write(apic, 0x11 + 2 * pin, *(((int *)&entry1) + 1));
2143 io_apic_write(0, 0x10 + 2 * pin, *(((int *)&entry1) + 0)); 2216 io_apic_write(apic, 0x10 + 2 * pin, *(((int *)&entry1) + 0));
2144 spin_unlock_irqrestore(&ioapic_lock, flags); 2217 spin_unlock_irqrestore(&ioapic_lock, flags);
2145 2218
2146 save_control = CMOS_READ(RTC_CONTROL); 2219 save_control = CMOS_READ(RTC_CONTROL);
@@ -2158,11 +2231,11 @@ static inline void unlock_ExtINT_logic(void)
2158 2231
2159 CMOS_WRITE(save_control, RTC_CONTROL); 2232 CMOS_WRITE(save_control, RTC_CONTROL);
2160 CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT); 2233 CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT);
2161 clear_IO_APIC_pin(0, pin); 2234 clear_IO_APIC_pin(apic, pin);
2162 2235
2163 spin_lock_irqsave(&ioapic_lock, flags); 2236 spin_lock_irqsave(&ioapic_lock, flags);
2164 io_apic_write(0, 0x11 + 2 * pin, *(((int *)&entry0) + 1)); 2237 io_apic_write(apic, 0x11 + 2 * pin, *(((int *)&entry0) + 1));
2165 io_apic_write(0, 0x10 + 2 * pin, *(((int *)&entry0) + 0)); 2238 io_apic_write(apic, 0x10 + 2 * pin, *(((int *)&entry0) + 0));
2166 spin_unlock_irqrestore(&ioapic_lock, flags); 2239 spin_unlock_irqrestore(&ioapic_lock, flags);
2167} 2240}
2168 2241
@@ -2174,7 +2247,7 @@ static inline void unlock_ExtINT_logic(void)
2174 */ 2247 */
2175static inline void check_timer(void) 2248static inline void check_timer(void)
2176{ 2249{
2177 int pin1, pin2; 2250 int apic1, pin1, apic2, pin2;
2178 int vector; 2251 int vector;
2179 2252
2180 /* 2253 /*
@@ -2196,10 +2269,13 @@ static inline void check_timer(void)
2196 timer_ack = 1; 2269 timer_ack = 1;
2197 enable_8259A_irq(0); 2270 enable_8259A_irq(0);
2198 2271
2199 pin1 = find_isa_irq_pin(0, mp_INT); 2272 pin1 = find_isa_irq_pin(0, mp_INT);
2200 pin2 = find_isa_irq_pin(0, mp_ExtINT); 2273 apic1 = find_isa_irq_apic(0, mp_INT);
2274 pin2 = ioapic_i8259.pin;
2275 apic2 = ioapic_i8259.apic;
2201 2276
2202 printk(KERN_INFO "..TIMER: vector=0x%02X pin1=%d pin2=%d\n", vector, pin1, pin2); 2277 printk(KERN_INFO "..TIMER: vector=0x%02X apic1=%d pin1=%d apic2=%d pin2=%d\n",
2278 vector, apic1, pin1, apic2, pin2);
2203 2279
2204 if (pin1 != -1) { 2280 if (pin1 != -1) {
2205 /* 2281 /*
@@ -2216,8 +2292,9 @@ static inline void check_timer(void)
2216 clear_IO_APIC_pin(0, pin1); 2292 clear_IO_APIC_pin(0, pin1);
2217 return; 2293 return;
2218 } 2294 }
2219 clear_IO_APIC_pin(0, pin1); 2295 clear_IO_APIC_pin(apic1, pin1);
2220 printk(KERN_ERR "..MP-BIOS bug: 8254 timer not connected to IO-APIC\n"); 2296 printk(KERN_ERR "..MP-BIOS bug: 8254 timer not connected to "
2297 "IO-APIC\n");
2221 } 2298 }
2222 2299
2223 printk(KERN_INFO "...trying to set up timer (IRQ0) through the 8259A ... "); 2300 printk(KERN_INFO "...trying to set up timer (IRQ0) through the 8259A ... ");
@@ -2226,13 +2303,13 @@ static inline void check_timer(void)
2226 /* 2303 /*
2227 * legacy devices should be connected to IO APIC #0 2304 * legacy devices should be connected to IO APIC #0
2228 */ 2305 */
2229 setup_ExtINT_IRQ0_pin(pin2, vector); 2306 setup_ExtINT_IRQ0_pin(apic2, pin2, vector);
2230 if (timer_irq_works()) { 2307 if (timer_irq_works()) {
2231 printk("works.\n"); 2308 printk("works.\n");
2232 if (pin1 != -1) 2309 if (pin1 != -1)
2233 replace_pin_at_irq(0, 0, pin1, 0, pin2); 2310 replace_pin_at_irq(0, apic1, pin1, apic2, pin2);
2234 else 2311 else
2235 add_pin_to_irq(0, 0, pin2); 2312 add_pin_to_irq(0, apic2, pin2);
2236 if (nmi_watchdog == NMI_IO_APIC) { 2313 if (nmi_watchdog == NMI_IO_APIC) {
2237 setup_nmi(); 2314 setup_nmi();
2238 } 2315 }
@@ -2241,7 +2318,7 @@ static inline void check_timer(void)
2241 /* 2318 /*
2242 * Cleanup, just in case ... 2319 * Cleanup, just in case ...
2243 */ 2320 */
2244 clear_IO_APIC_pin(0, pin2); 2321 clear_IO_APIC_pin(apic2, pin2);
2245 } 2322 }
2246 printk(" failed.\n"); 2323 printk(" failed.\n");
2247 2324
@@ -2310,11 +2387,15 @@ void __init setup_IO_APIC(void)
2310 sync_Arb_IDs(); 2387 sync_Arb_IDs();
2311 setup_IO_APIC_irqs(); 2388 setup_IO_APIC_irqs();
2312 init_IO_APIC_traps(); 2389 init_IO_APIC_traps();
2313 check_timer();
2314 if (!acpi_ioapic) 2390 if (!acpi_ioapic)
2315 print_IO_APIC(); 2391 print_IO_APIC();
2316} 2392}
2317 2393
2394void __init IO_APIC_late_time_init(void)
2395{
2396 check_timer();
2397}
2398
2318/* 2399/*
2319 * Called after all the initialization is done. If we didnt find any 2400 * Called after all the initialization is done. If we didnt find any
2320 * APIC bugs then we can allow the modify fast path 2401 * APIC bugs then we can allow the modify fast path
diff --git a/arch/i386/kernel/irq.c b/arch/i386/kernel/irq.c
index ce66dcc26d90..1a201a932865 100644
--- a/arch/i386/kernel/irq.c
+++ b/arch/i386/kernel/irq.c
@@ -218,7 +218,7 @@ int show_interrupts(struct seq_file *p, void *v)
218 218
219 if (i == 0) { 219 if (i == 0) {
220 seq_printf(p, " "); 220 seq_printf(p, " ");
221 for_each_cpu(j) 221 for_each_online_cpu(j)
222 seq_printf(p, "CPU%d ",j); 222 seq_printf(p, "CPU%d ",j);
223 seq_putc(p, '\n'); 223 seq_putc(p, '\n');
224 } 224 }
@@ -232,7 +232,7 @@ int show_interrupts(struct seq_file *p, void *v)
232#ifndef CONFIG_SMP 232#ifndef CONFIG_SMP
233 seq_printf(p, "%10u ", kstat_irqs(i)); 233 seq_printf(p, "%10u ", kstat_irqs(i));
234#else 234#else
235 for_each_cpu(j) 235 for_each_online_cpu(j)
236 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); 236 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
237#endif 237#endif
238 seq_printf(p, " %14s", irq_desc[i].handler->typename); 238 seq_printf(p, " %14s", irq_desc[i].handler->typename);
@@ -246,12 +246,12 @@ skip:
246 spin_unlock_irqrestore(&irq_desc[i].lock, flags); 246 spin_unlock_irqrestore(&irq_desc[i].lock, flags);
247 } else if (i == NR_IRQS) { 247 } else if (i == NR_IRQS) {
248 seq_printf(p, "NMI: "); 248 seq_printf(p, "NMI: ");
249 for_each_cpu(j) 249 for_each_online_cpu(j)
250 seq_printf(p, "%10u ", nmi_count(j)); 250 seq_printf(p, "%10u ", nmi_count(j));
251 seq_putc(p, '\n'); 251 seq_putc(p, '\n');
252#ifdef CONFIG_X86_LOCAL_APIC 252#ifdef CONFIG_X86_LOCAL_APIC
253 seq_printf(p, "LOC: "); 253 seq_printf(p, "LOC: ");
254 for_each_cpu(j) 254 for_each_online_cpu(j)
255 seq_printf(p, "%10u ", 255 seq_printf(p, "%10u ",
256 per_cpu(irq_stat,j).apic_timer_irqs); 256 per_cpu(irq_stat,j).apic_timer_irqs);
257 seq_putc(p, '\n'); 257 seq_putc(p, '\n');
diff --git a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c
index 27aabfceb67e..8f767d9aa45d 100644
--- a/arch/i386/kernel/mpparse.c
+++ b/arch/i386/kernel/mpparse.c
@@ -69,7 +69,7 @@ unsigned int def_to_bigsmp = 0;
69/* Processor that is doing the boot up */ 69/* Processor that is doing the boot up */
70unsigned int boot_cpu_physical_apicid = -1U; 70unsigned int boot_cpu_physical_apicid = -1U;
71/* Internal processor count */ 71/* Internal processor count */
72static unsigned int __initdata num_processors; 72static unsigned int __devinitdata num_processors;
73 73
74/* Bitmask of physically existing CPUs */ 74/* Bitmask of physically existing CPUs */
75physid_mask_t phys_cpu_present_map; 75physid_mask_t phys_cpu_present_map;
@@ -119,7 +119,7 @@ static int MP_valid_apicid(int apicid, int version)
119} 119}
120#endif 120#endif
121 121
122static void __init MP_processor_info (struct mpc_config_processor *m) 122static void __devinit MP_processor_info (struct mpc_config_processor *m)
123{ 123{
124 int ver, apicid; 124 int ver, apicid;
125 physid_mask_t phys_cpu; 125 physid_mask_t phys_cpu;
@@ -182,17 +182,6 @@ static void __init MP_processor_info (struct mpc_config_processor *m)
182 boot_cpu_physical_apicid = m->mpc_apicid; 182 boot_cpu_physical_apicid = m->mpc_apicid;
183 } 183 }
184 184
185 if (num_processors >= NR_CPUS) {
186 printk(KERN_WARNING "WARNING: NR_CPUS limit of %i reached."
187 " Processor ignored.\n", NR_CPUS);
188 return;
189 }
190
191 if (num_processors >= maxcpus) {
192 printk(KERN_WARNING "WARNING: maxcpus limit of %i reached."
193 " Processor ignored.\n", maxcpus);
194 return;
195 }
196 ver = m->mpc_apicver; 185 ver = m->mpc_apicver;
197 186
198 if (!MP_valid_apicid(apicid, ver)) { 187 if (!MP_valid_apicid(apicid, ver)) {
@@ -201,11 +190,6 @@ static void __init MP_processor_info (struct mpc_config_processor *m)
201 return; 190 return;
202 } 191 }
203 192
204 cpu_set(num_processors, cpu_possible_map);
205 num_processors++;
206 phys_cpu = apicid_to_cpu_present(apicid);
207 physids_or(phys_cpu_present_map, phys_cpu_present_map, phys_cpu);
208
209 /* 193 /*
210 * Validate version 194 * Validate version
211 */ 195 */
@@ -216,6 +200,25 @@ static void __init MP_processor_info (struct mpc_config_processor *m)
216 ver = 0x10; 200 ver = 0x10;
217 } 201 }
218 apic_version[m->mpc_apicid] = ver; 202 apic_version[m->mpc_apicid] = ver;
203
204 phys_cpu = apicid_to_cpu_present(apicid);
205 physids_or(phys_cpu_present_map, phys_cpu_present_map, phys_cpu);
206
207 if (num_processors >= NR_CPUS) {
208 printk(KERN_WARNING "WARNING: NR_CPUS limit of %i reached."
209 " Processor ignored.\n", NR_CPUS);
210 return;
211 }
212
213 if (num_processors >= maxcpus) {
214 printk(KERN_WARNING "WARNING: maxcpus limit of %i reached."
215 " Processor ignored.\n", maxcpus);
216 return;
217 }
218
219 cpu_set(num_processors, cpu_possible_map);
220 num_processors++;
221
219 if ((num_processors > 8) && 222 if ((num_processors > 8) &&
220 APIC_XAPIC(ver) && 223 APIC_XAPIC(ver) &&
221 (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL)) 224 (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL))
@@ -834,7 +837,7 @@ void __init mp_register_lapic_address (
834} 837}
835 838
836 839
837void __init mp_register_lapic ( 840void __devinit mp_register_lapic (
838 u8 id, 841 u8 id,
839 u8 enabled) 842 u8 enabled)
840{ 843{
diff --git a/arch/i386/kernel/nmi.c b/arch/i386/kernel/nmi.c
index 72515b8a1b12..d661703ac1cb 100644
--- a/arch/i386/kernel/nmi.c
+++ b/arch/i386/kernel/nmi.c
@@ -100,16 +100,44 @@ int nmi_active;
100 (P4_CCCR_OVF_PMI0|P4_CCCR_THRESHOLD(15)|P4_CCCR_COMPLEMENT| \ 100 (P4_CCCR_OVF_PMI0|P4_CCCR_THRESHOLD(15)|P4_CCCR_COMPLEMENT| \
101 P4_CCCR_COMPARE|P4_CCCR_REQUIRED|P4_CCCR_ESCR_SELECT(4)|P4_CCCR_ENABLE) 101 P4_CCCR_COMPARE|P4_CCCR_REQUIRED|P4_CCCR_ESCR_SELECT(4)|P4_CCCR_ENABLE)
102 102
103#ifdef CONFIG_SMP
104/* The performance counters used by NMI_LOCAL_APIC don't trigger when
105 * the CPU is idle. To make sure the NMI watchdog really ticks on all
106 * CPUs during the test make them busy.
107 */
108static __init void nmi_cpu_busy(void *data)
109{
110 volatile int *endflag = data;
111 local_irq_enable();
112 /* Intentionally don't use cpu_relax here. This is
113 to make sure that the performance counter really ticks,
114 even if there is a simulator or similar that catches the
115 pause instruction. On a real HT machine this is fine because
116 all other CPUs are busy with "useless" delay loops and don't
117 care if they get somewhat less cycles. */
118 while (*endflag == 0)
119 barrier();
120}
121#endif
122
103static int __init check_nmi_watchdog(void) 123static int __init check_nmi_watchdog(void)
104{ 124{
105 unsigned int prev_nmi_count[NR_CPUS]; 125 volatile int endflag = 0;
126 unsigned int *prev_nmi_count;
106 int cpu; 127 int cpu;
107 128
108 if (nmi_watchdog == NMI_NONE) 129 if (nmi_watchdog == NMI_NONE)
109 return 0; 130 return 0;
110 131
132 prev_nmi_count = kmalloc(NR_CPUS * sizeof(int), GFP_KERNEL);
133 if (!prev_nmi_count)
134 return -1;
135
111 printk(KERN_INFO "Testing NMI watchdog ... "); 136 printk(KERN_INFO "Testing NMI watchdog ... ");
112 137
138 if (nmi_watchdog == NMI_LOCAL_APIC)
139 smp_call_function(nmi_cpu_busy, (void *)&endflag, 0, 0);
140
113 for (cpu = 0; cpu < NR_CPUS; cpu++) 141 for (cpu = 0; cpu < NR_CPUS; cpu++)
114 prev_nmi_count[cpu] = per_cpu(irq_stat, cpu).__nmi_count; 142 prev_nmi_count[cpu] = per_cpu(irq_stat, cpu).__nmi_count;
115 local_irq_enable(); 143 local_irq_enable();
@@ -123,12 +151,18 @@ static int __init check_nmi_watchdog(void)
123 continue; 151 continue;
124#endif 152#endif
125 if (nmi_count(cpu) - prev_nmi_count[cpu] <= 5) { 153 if (nmi_count(cpu) - prev_nmi_count[cpu] <= 5) {
126 printk("CPU#%d: NMI appears to be stuck!\n", cpu); 154 endflag = 1;
155 printk("CPU#%d: NMI appears to be stuck (%d->%d)!\n",
156 cpu,
157 prev_nmi_count[cpu],
158 nmi_count(cpu));
127 nmi_active = 0; 159 nmi_active = 0;
128 lapic_nmi_owner &= ~LAPIC_NMI_WATCHDOG; 160 lapic_nmi_owner &= ~LAPIC_NMI_WATCHDOG;
161 kfree(prev_nmi_count);
129 return -1; 162 return -1;
130 } 163 }
131 } 164 }
165 endflag = 1;
132 printk("OK.\n"); 166 printk("OK.\n");
133 167
134 /* now that we know it works we can reduce NMI frequency to 168 /* now that we know it works we can reduce NMI frequency to
@@ -136,6 +170,7 @@ static int __init check_nmi_watchdog(void)
136 if (nmi_watchdog == NMI_LOCAL_APIC) 170 if (nmi_watchdog == NMI_LOCAL_APIC)
137 nmi_hz = 1; 171 nmi_hz = 1;
138 172
173 kfree(prev_nmi_count);
139 return 0; 174 return 0;
140} 175}
141/* This needs to happen later in boot so counters are working */ 176/* This needs to happen later in boot so counters are working */
diff --git a/arch/i386/kernel/ptrace.c b/arch/i386/kernel/ptrace.c
index 7b6368bf8974..efd11f09c996 100644
--- a/arch/i386/kernel/ptrace.c
+++ b/arch/i386/kernel/ptrace.c
@@ -354,7 +354,7 @@ ptrace_set_thread_area(struct task_struct *child,
354 return 0; 354 return 0;
355} 355}
356 356
357asmlinkage int sys_ptrace(long request, long pid, long addr, long data) 357asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
358{ 358{
359 struct task_struct *child; 359 struct task_struct *child;
360 struct user * dummy = NULL; 360 struct user * dummy = NULL;
diff --git a/arch/i386/kernel/reboot_fixups.c b/arch/i386/kernel/reboot_fixups.c
index 1b183b378c2c..c9b87330aeea 100644
--- a/arch/i386/kernel/reboot_fixups.c
+++ b/arch/i386/kernel/reboot_fixups.c
@@ -44,7 +44,7 @@ void mach_reboot_fixups(void)
44 44
45 for (i=0; i < (sizeof(fixups_table)/sizeof(fixups_table[0])); i++) { 45 for (i=0; i < (sizeof(fixups_table)/sizeof(fixups_table[0])); i++) {
46 cur = &(fixups_table[i]); 46 cur = &(fixups_table[i]);
47 dev = pci_get_device(cur->vendor, cur->device, 0); 47 dev = pci_get_device(cur->vendor, cur->device, NULL);
48 if (!dev) 48 if (!dev)
49 continue; 49 continue;
50 50
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index 9b8c8a19824d..b48ac635f3c1 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -389,14 +389,24 @@ static void __init limit_regions(unsigned long long size)
389 } 389 }
390 } 390 }
391 for (i = 0; i < e820.nr_map; i++) { 391 for (i = 0; i < e820.nr_map; i++) {
392 if (e820.map[i].type == E820_RAM) { 392 current_addr = e820.map[i].addr + e820.map[i].size;
393 current_addr = e820.map[i].addr + e820.map[i].size; 393 if (current_addr < size)
394 if (current_addr >= size) { 394 continue;
395 e820.map[i].size -= current_addr-size; 395
396 e820.nr_map = i + 1; 396 if (e820.map[i].type != E820_RAM)
397 return; 397 continue;
398 } 398
399 if (e820.map[i].addr >= size) {
400 /*
401 * This region starts past the end of the
402 * requested size, skip it completely.
403 */
404 e820.nr_map = i;
405 } else {
406 e820.nr_map = i + 1;
407 e820.map[i].size -= current_addr - size;
399 } 408 }
409 return;
400 } 410 }
401} 411}
402 412
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c
index 1fb26d0e30b6..5a2bbe0c4fff 100644
--- a/arch/i386/kernel/smpboot.c
+++ b/arch/i386/kernel/smpboot.c
@@ -87,7 +87,11 @@ EXPORT_SYMBOL(cpu_online_map);
87cpumask_t cpu_callin_map; 87cpumask_t cpu_callin_map;
88cpumask_t cpu_callout_map; 88cpumask_t cpu_callout_map;
89EXPORT_SYMBOL(cpu_callout_map); 89EXPORT_SYMBOL(cpu_callout_map);
90#ifdef CONFIG_HOTPLUG_CPU
91cpumask_t cpu_possible_map = CPU_MASK_ALL;
92#else
90cpumask_t cpu_possible_map; 93cpumask_t cpu_possible_map;
94#endif
91EXPORT_SYMBOL(cpu_possible_map); 95EXPORT_SYMBOL(cpu_possible_map);
92static cpumask_t smp_commenced_mask; 96static cpumask_t smp_commenced_mask;
93 97
@@ -1074,6 +1078,16 @@ void *xquad_portio;
1074EXPORT_SYMBOL(xquad_portio); 1078EXPORT_SYMBOL(xquad_portio);
1075#endif 1079#endif
1076 1080
1081/*
1082 * Fall back to non SMP mode after errors.
1083 *
1084 */
1085static __init void disable_smp(void)
1086{
1087 cpu_set(0, cpu_sibling_map[0]);
1088 cpu_set(0, cpu_core_map[0]);
1089}
1090
1077static void __init smp_boot_cpus(unsigned int max_cpus) 1091static void __init smp_boot_cpus(unsigned int max_cpus)
1078{ 1092{
1079 int apicid, cpu, bit, kicked; 1093 int apicid, cpu, bit, kicked;
@@ -1086,7 +1100,6 @@ static void __init smp_boot_cpus(unsigned int max_cpus)
1086 printk("CPU%d: ", 0); 1100 printk("CPU%d: ", 0);
1087 print_cpu_info(&cpu_data[0]); 1101 print_cpu_info(&cpu_data[0]);
1088 1102
1089 boot_cpu_physical_apicid = GET_APIC_ID(apic_read(APIC_ID));
1090 boot_cpu_logical_apicid = logical_smp_processor_id(); 1103 boot_cpu_logical_apicid = logical_smp_processor_id();
1091 x86_cpu_to_apicid[0] = boot_cpu_physical_apicid; 1104 x86_cpu_to_apicid[0] = boot_cpu_physical_apicid;
1092 1105
@@ -1098,68 +1111,27 @@ static void __init smp_boot_cpus(unsigned int max_cpus)
1098 cpus_clear(cpu_core_map[0]); 1111 cpus_clear(cpu_core_map[0]);
1099 cpu_set(0, cpu_core_map[0]); 1112 cpu_set(0, cpu_core_map[0]);
1100 1113
1114 map_cpu_to_logical_apicid();
1115
1101 /* 1116 /*
1102 * If we couldn't find an SMP configuration at boot time, 1117 * If we couldn't find an SMP configuration at boot time,
1103 * get out of here now! 1118 * get out of here now!
1104 */ 1119 */
1105 if (!smp_found_config && !acpi_lapic) { 1120 if (!smp_found_config && !acpi_lapic) {
1106 printk(KERN_NOTICE "SMP motherboard not detected.\n"); 1121 printk(KERN_NOTICE "SMP motherboard not detected.\n");
1107 smpboot_clear_io_apic_irqs(); 1122 disable_smp();
1108 phys_cpu_present_map = physid_mask_of_physid(0);
1109 if (APIC_init_uniprocessor())
1110 printk(KERN_NOTICE "Local APIC not detected."
1111 " Using dummy APIC emulation.\n");
1112 map_cpu_to_logical_apicid();
1113 cpu_set(0, cpu_sibling_map[0]);
1114 cpu_set(0, cpu_core_map[0]);
1115 return; 1123 return;
1116 } 1124 }
1117 1125
1118 /* 1126 /*
1119 * Should not be necessary because the MP table should list the boot
1120 * CPU too, but we do it for the sake of robustness anyway.
1121 * Makes no sense to do this check in clustered apic mode, so skip it
1122 */
1123 if (!check_phys_apicid_present(boot_cpu_physical_apicid)) {
1124 printk("weird, boot CPU (#%d) not listed by the BIOS.\n",
1125 boot_cpu_physical_apicid);
1126 physid_set(hard_smp_processor_id(), phys_cpu_present_map);
1127 }
1128
1129 /*
1130 * If we couldn't find a local APIC, then get out of here now!
1131 */
1132 if (APIC_INTEGRATED(apic_version[boot_cpu_physical_apicid]) && !cpu_has_apic) {
1133 printk(KERN_ERR "BIOS bug, local APIC #%d not detected!...\n",
1134 boot_cpu_physical_apicid);
1135 printk(KERN_ERR "... forcing use of dummy APIC emulation. (tell your hw vendor)\n");
1136 smpboot_clear_io_apic_irqs();
1137 phys_cpu_present_map = physid_mask_of_physid(0);
1138 cpu_set(0, cpu_sibling_map[0]);
1139 cpu_set(0, cpu_core_map[0]);
1140 return;
1141 }
1142
1143 verify_local_APIC();
1144
1145 /*
1146 * If SMP should be disabled, then really disable it! 1127 * If SMP should be disabled, then really disable it!
1147 */ 1128 */
1148 if (!max_cpus) { 1129 if (!max_cpus || (enable_local_apic < 0)) {
1149 smp_found_config = 0; 1130 printk(KERN_INFO "SMP mode deactivated.\n");
1150 printk(KERN_INFO "SMP mode deactivated, forcing use of dummy APIC emulation.\n"); 1131 disable_smp();
1151 smpboot_clear_io_apic_irqs();
1152 phys_cpu_present_map = physid_mask_of_physid(0);
1153 cpu_set(0, cpu_sibling_map[0]);
1154 cpu_set(0, cpu_core_map[0]);
1155 return; 1132 return;
1156 } 1133 }
1157 1134
1158 connect_bsp_APIC();
1159 setup_local_APIC();
1160 map_cpu_to_logical_apicid();
1161
1162
1163 setup_portio_remap(); 1135 setup_portio_remap();
1164 1136
1165 /* 1137 /*
@@ -1240,10 +1212,6 @@ static void __init smp_boot_cpus(unsigned int max_cpus)
1240 cpu_set(0, cpu_sibling_map[0]); 1212 cpu_set(0, cpu_sibling_map[0]);
1241 cpu_set(0, cpu_core_map[0]); 1213 cpu_set(0, cpu_core_map[0]);
1242 1214
1243 smpboot_setup_io_apic();
1244
1245 setup_boot_APIC_clock();
1246
1247 /* 1215 /*
1248 * Synchronize the TSC with the AP 1216 * Synchronize the TSC with the AP
1249 */ 1217 */
diff --git a/arch/i386/kernel/srat.c b/arch/i386/kernel/srat.c
index 516bf5653b02..8de658db8146 100644
--- a/arch/i386/kernel/srat.c
+++ b/arch/i386/kernel/srat.c
@@ -327,7 +327,12 @@ int __init get_memcfg_from_srat(void)
327 int tables = 0; 327 int tables = 0;
328 int i = 0; 328 int i = 0;
329 329
330 acpi_find_root_pointer(ACPI_PHYSICAL_ADDRESSING, rsdp_address); 330 if (ACPI_FAILURE(acpi_find_root_pointer(ACPI_PHYSICAL_ADDRESSING,
331 rsdp_address))) {
332 printk("%s: System description tables not found\n",
333 __FUNCTION__);
334 goto out_err;
335 }
331 336
332 if (rsdp_address->pointer_type == ACPI_PHYSICAL_POINTER) { 337 if (rsdp_address->pointer_type == ACPI_PHYSICAL_POINTER) {
333 printk("%s: assigning address to rsdp\n", __FUNCTION__); 338 printk("%s: assigning address to rsdp\n", __FUNCTION__);
diff --git a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c
index 2883a4d4f01f..07471bba2dc6 100644
--- a/arch/i386/kernel/time.c
+++ b/arch/i386/kernel/time.c
@@ -74,10 +74,6 @@ int pit_latch_buggy; /* extern */
74 74
75#include "do_timer.h" 75#include "do_timer.h"
76 76
77u64 jiffies_64 = INITIAL_JIFFIES;
78
79EXPORT_SYMBOL(jiffies_64);
80
81unsigned int cpu_khz; /* Detected as we calibrate the TSC */ 77unsigned int cpu_khz; /* Detected as we calibrate the TSC */
82EXPORT_SYMBOL(cpu_khz); 78EXPORT_SYMBOL(cpu_khz);
83 79
@@ -444,8 +440,8 @@ static int time_init_device(void)
444 440
445device_initcall(time_init_device); 441device_initcall(time_init_device);
446 442
447#ifdef CONFIG_HPET_TIMER
448extern void (*late_time_init)(void); 443extern void (*late_time_init)(void);
444#ifdef CONFIG_HPET_TIMER
449/* Duplicate of time_init() below, with hpet_enable part added */ 445/* Duplicate of time_init() below, with hpet_enable part added */
450static void __init hpet_time_init(void) 446static void __init hpet_time_init(void)
451{ 447{
@@ -462,6 +458,11 @@ static void __init hpet_time_init(void)
462 printk(KERN_INFO "Using %s for high-res timesource\n",cur_timer->name); 458 printk(KERN_INFO "Using %s for high-res timesource\n",cur_timer->name);
463 459
464 time_init_hook(); 460 time_init_hook();
461
462#ifdef CONFIG_X86_LOCAL_APIC
463 if (enable_local_apic >= 0)
464 APIC_late_time_init();
465#endif
465} 466}
466#endif 467#endif
467 468
@@ -486,4 +487,9 @@ void __init time_init(void)
486 printk(KERN_INFO "Using %s for high-res timesource\n",cur_timer->name); 487 printk(KERN_INFO "Using %s for high-res timesource\n",cur_timer->name);
487 488
488 time_init_hook(); 489 time_init_hook();
490
491#ifdef CONFIG_X86_LOCAL_APIC
492 if (enable_local_apic >= 0)
493 late_time_init = APIC_late_time_init;
494#endif
489} 495}
diff --git a/arch/i386/kernel/time_hpet.c b/arch/i386/kernel/time_hpet.c
index 658c0629ba6a..9caeaa315cd7 100644
--- a/arch/i386/kernel/time_hpet.c
+++ b/arch/i386/kernel/time_hpet.c
@@ -275,6 +275,7 @@ static unsigned long PIE_freq = DEFAULT_RTC_INT_FREQ;
275static unsigned long PIE_count; 275static unsigned long PIE_count;
276 276
277static unsigned long hpet_rtc_int_freq; /* RTC interrupt frequency */ 277static unsigned long hpet_rtc_int_freq; /* RTC interrupt frequency */
278static unsigned int hpet_t1_cmp; /* cached comparator register */
278 279
279/* 280/*
280 * Timer 1 for RTC, we do not use periodic interrupt feature, 281 * Timer 1 for RTC, we do not use periodic interrupt feature,
@@ -306,10 +307,12 @@ int hpet_rtc_timer_init(void)
306 cnt = hpet_readl(HPET_COUNTER); 307 cnt = hpet_readl(HPET_COUNTER);
307 cnt += ((hpet_tick*HZ)/hpet_rtc_int_freq); 308 cnt += ((hpet_tick*HZ)/hpet_rtc_int_freq);
308 hpet_writel(cnt, HPET_T1_CMP); 309 hpet_writel(cnt, HPET_T1_CMP);
310 hpet_t1_cmp = cnt;
309 local_irq_restore(flags); 311 local_irq_restore(flags);
310 312
311 cfg = hpet_readl(HPET_T1_CFG); 313 cfg = hpet_readl(HPET_T1_CFG);
312 cfg |= HPET_TN_ENABLE | HPET_TN_SETVAL | HPET_TN_32BIT; 314 cfg &= ~HPET_TN_PERIODIC;
315 cfg |= HPET_TN_ENABLE | HPET_TN_32BIT;
313 hpet_writel(cfg, HPET_T1_CFG); 316 hpet_writel(cfg, HPET_T1_CFG);
314 317
315 return 1; 318 return 1;
@@ -319,8 +322,12 @@ static void hpet_rtc_timer_reinit(void)
319{ 322{
320 unsigned int cfg, cnt; 323 unsigned int cfg, cnt;
321 324
322 if (!(PIE_on | AIE_on | UIE_on)) 325 if (unlikely(!(PIE_on | AIE_on | UIE_on))) {
326 cfg = hpet_readl(HPET_T1_CFG);
327 cfg &= ~HPET_TN_ENABLE;
328 hpet_writel(cfg, HPET_T1_CFG);
323 return; 329 return;
330 }
324 331
325 if (PIE_on && (PIE_freq > DEFAULT_RTC_INT_FREQ)) 332 if (PIE_on && (PIE_freq > DEFAULT_RTC_INT_FREQ))
326 hpet_rtc_int_freq = PIE_freq; 333 hpet_rtc_int_freq = PIE_freq;
@@ -328,15 +335,10 @@ static void hpet_rtc_timer_reinit(void)
328 hpet_rtc_int_freq = DEFAULT_RTC_INT_FREQ; 335 hpet_rtc_int_freq = DEFAULT_RTC_INT_FREQ;
329 336
330 /* It is more accurate to use the comparator value than current count.*/ 337 /* It is more accurate to use the comparator value than current count.*/
331 cnt = hpet_readl(HPET_T1_CMP); 338 cnt = hpet_t1_cmp;
332 cnt += hpet_tick*HZ/hpet_rtc_int_freq; 339 cnt += hpet_tick*HZ/hpet_rtc_int_freq;
333 hpet_writel(cnt, HPET_T1_CMP); 340 hpet_writel(cnt, HPET_T1_CMP);
334 341 hpet_t1_cmp = cnt;
335 cfg = hpet_readl(HPET_T1_CFG);
336 cfg |= HPET_TN_ENABLE | HPET_TN_SETVAL | HPET_TN_32BIT;
337 hpet_writel(cfg, HPET_T1_CFG);
338
339 return;
340} 342}
341 343
342/* 344/*
diff --git a/arch/i386/kernel/timers/timer_hpet.c b/arch/i386/kernel/timers/timer_hpet.c
index d973a8b681fd..be242723c339 100644
--- a/arch/i386/kernel/timers/timer_hpet.c
+++ b/arch/i386/kernel/timers/timer_hpet.c
@@ -30,23 +30,28 @@ static seqlock_t monotonic_lock = SEQLOCK_UNLOCKED;
30 * basic equation: 30 * basic equation:
31 * ns = cycles / (freq / ns_per_sec) 31 * ns = cycles / (freq / ns_per_sec)
32 * ns = cycles * (ns_per_sec / freq) 32 * ns = cycles * (ns_per_sec / freq)
33 * ns = cycles * (10^9 / (cpu_mhz * 10^6)) 33 * ns = cycles * (10^9 / (cpu_khz * 10^3))
34 * ns = cycles * (10^3 / cpu_mhz) 34 * ns = cycles * (10^6 / cpu_khz)
35 * 35 *
36 * Then we use scaling math (suggested by george@mvista.com) to get: 36 * Then we use scaling math (suggested by george@mvista.com) to get:
37 * ns = cycles * (10^3 * SC / cpu_mhz) / SC 37 * ns = cycles * (10^6 * SC / cpu_khz) / SC
38 * ns = cycles * cyc2ns_scale / SC 38 * ns = cycles * cyc2ns_scale / SC
39 * 39 *
40 * And since SC is a constant power of two, we can convert the div 40 * And since SC is a constant power of two, we can convert the div
41 * into a shift. 41 * into a shift.
42 *
43 * We can use khz divisor instead of mhz to keep a better percision, since
44 * cyc2ns_scale is limited to 10^6 * 2^10, which fits in 32 bits.
45 * (mathieu.desnoyers@polymtl.ca)
46 *
42 * -johnstul@us.ibm.com "math is hard, lets go shopping!" 47 * -johnstul@us.ibm.com "math is hard, lets go shopping!"
43 */ 48 */
44static unsigned long cyc2ns_scale; 49static unsigned long cyc2ns_scale;
45#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */ 50#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */
46 51
47static inline void set_cyc2ns_scale(unsigned long cpu_mhz) 52static inline void set_cyc2ns_scale(unsigned long cpu_khz)
48{ 53{
49 cyc2ns_scale = (1000 << CYC2NS_SCALE_FACTOR)/cpu_mhz; 54 cyc2ns_scale = (1000000 << CYC2NS_SCALE_FACTOR)/cpu_khz;
50} 55}
51 56
52static inline unsigned long long cycles_2_ns(unsigned long long cyc) 57static inline unsigned long long cycles_2_ns(unsigned long long cyc)
@@ -163,7 +168,7 @@ static int __init init_hpet(char* override)
163 printk("Detected %u.%03u MHz processor.\n", 168 printk("Detected %u.%03u MHz processor.\n",
164 cpu_khz / 1000, cpu_khz % 1000); 169 cpu_khz / 1000, cpu_khz % 1000);
165 } 170 }
166 set_cyc2ns_scale(cpu_khz/1000); 171 set_cyc2ns_scale(cpu_khz);
167 } 172 }
168 /* set this only when cpu_has_tsc */ 173 /* set this only when cpu_has_tsc */
169 timer_hpet.read_timer = read_timer_tsc; 174 timer_hpet.read_timer = read_timer_tsc;
diff --git a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c
index 6dd470cc9f72..d395e3b42485 100644
--- a/arch/i386/kernel/timers/timer_tsc.c
+++ b/arch/i386/kernel/timers/timer_tsc.c
@@ -49,23 +49,28 @@ static seqlock_t monotonic_lock = SEQLOCK_UNLOCKED;
49 * basic equation: 49 * basic equation:
50 * ns = cycles / (freq / ns_per_sec) 50 * ns = cycles / (freq / ns_per_sec)
51 * ns = cycles * (ns_per_sec / freq) 51 * ns = cycles * (ns_per_sec / freq)
52 * ns = cycles * (10^9 / (cpu_mhz * 10^6)) 52 * ns = cycles * (10^9 / (cpu_khz * 10^3))
53 * ns = cycles * (10^3 / cpu_mhz) 53 * ns = cycles * (10^6 / cpu_khz)
54 * 54 *
55 * Then we use scaling math (suggested by george@mvista.com) to get: 55 * Then we use scaling math (suggested by george@mvista.com) to get:
56 * ns = cycles * (10^3 * SC / cpu_mhz) / SC 56 * ns = cycles * (10^6 * SC / cpu_khz) / SC
57 * ns = cycles * cyc2ns_scale / SC 57 * ns = cycles * cyc2ns_scale / SC
58 * 58 *
59 * And since SC is a constant power of two, we can convert the div 59 * And since SC is a constant power of two, we can convert the div
60 * into a shift. 60 * into a shift.
61 *
62 * We can use khz divisor instead of mhz to keep a better percision, since
63 * cyc2ns_scale is limited to 10^6 * 2^10, which fits in 32 bits.
64 * (mathieu.desnoyers@polymtl.ca)
65 *
61 * -johnstul@us.ibm.com "math is hard, lets go shopping!" 66 * -johnstul@us.ibm.com "math is hard, lets go shopping!"
62 */ 67 */
63static unsigned long cyc2ns_scale; 68static unsigned long cyc2ns_scale;
64#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */ 69#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */
65 70
66static inline void set_cyc2ns_scale(unsigned long cpu_mhz) 71static inline void set_cyc2ns_scale(unsigned long cpu_khz)
67{ 72{
68 cyc2ns_scale = (1000 << CYC2NS_SCALE_FACTOR)/cpu_mhz; 73 cyc2ns_scale = (1000000 << CYC2NS_SCALE_FACTOR)/cpu_khz;
69} 74}
70 75
71static inline unsigned long long cycles_2_ns(unsigned long long cyc) 76static inline unsigned long long cycles_2_ns(unsigned long long cyc)
@@ -286,7 +291,7 @@ time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
286 if (use_tsc) { 291 if (use_tsc) {
287 if (!(freq->flags & CPUFREQ_CONST_LOOPS)) { 292 if (!(freq->flags & CPUFREQ_CONST_LOOPS)) {
288 fast_gettimeoffset_quotient = cpufreq_scale(fast_gettimeoffset_ref, freq->new, ref_freq); 293 fast_gettimeoffset_quotient = cpufreq_scale(fast_gettimeoffset_ref, freq->new, ref_freq);
289 set_cyc2ns_scale(cpu_khz/1000); 294 set_cyc2ns_scale(cpu_khz);
290 } 295 }
291 } 296 }
292#endif 297#endif
@@ -536,7 +541,7 @@ static int __init init_tsc(char* override)
536 printk("Detected %u.%03u MHz processor.\n", 541 printk("Detected %u.%03u MHz processor.\n",
537 cpu_khz / 1000, cpu_khz % 1000); 542 cpu_khz / 1000, cpu_khz % 1000);
538 } 543 }
539 set_cyc2ns_scale(cpu_khz/1000); 544 set_cyc2ns_scale(cpu_khz);
540 return 0; 545 return 0;
541 } 546 }
542 } 547 }
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index 19e90bdd84ea..c34d1bfc5161 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -488,6 +488,7 @@ fastcall void __kprobes do_general_protection(struct pt_regs * regs,
488 tss->io_bitmap_max - thread->io_bitmap_max); 488 tss->io_bitmap_max - thread->io_bitmap_max);
489 tss->io_bitmap_max = thread->io_bitmap_max; 489 tss->io_bitmap_max = thread->io_bitmap_max;
490 tss->io_bitmap_base = IO_BITMAP_OFFSET; 490 tss->io_bitmap_base = IO_BITMAP_OFFSET;
491 tss->io_bitmap_owner = thread;
491 put_cpu(); 492 put_cpu();
492 return; 493 return;
493 } 494 }
diff --git a/arch/i386/kernel/vm86.c b/arch/i386/kernel/vm86.c
index 16b485009622..fc1993564f98 100644
--- a/arch/i386/kernel/vm86.c
+++ b/arch/i386/kernel/vm86.c
@@ -134,17 +134,16 @@ struct pt_regs * fastcall save_v86_state(struct kernel_vm86_regs * regs)
134 return ret; 134 return ret;
135} 135}
136 136
137static void mark_screen_rdonly(struct task_struct * tsk) 137static void mark_screen_rdonly(struct mm_struct *mm)
138{ 138{
139 pgd_t *pgd; 139 pgd_t *pgd;
140 pud_t *pud; 140 pud_t *pud;
141 pmd_t *pmd; 141 pmd_t *pmd;
142 pte_t *pte, *mapped; 142 pte_t *pte;
143 spinlock_t *ptl;
143 int i; 144 int i;
144 145
145 preempt_disable(); 146 pgd = pgd_offset(mm, 0xA0000);
146 spin_lock(&tsk->mm->page_table_lock);
147 pgd = pgd_offset(tsk->mm, 0xA0000);
148 if (pgd_none_or_clear_bad(pgd)) 147 if (pgd_none_or_clear_bad(pgd))
149 goto out; 148 goto out;
150 pud = pud_offset(pgd, 0xA0000); 149 pud = pud_offset(pgd, 0xA0000);
@@ -153,16 +152,14 @@ static void mark_screen_rdonly(struct task_struct * tsk)
153 pmd = pmd_offset(pud, 0xA0000); 152 pmd = pmd_offset(pud, 0xA0000);
154 if (pmd_none_or_clear_bad(pmd)) 153 if (pmd_none_or_clear_bad(pmd))
155 goto out; 154 goto out;
156 pte = mapped = pte_offset_map(pmd, 0xA0000); 155 pte = pte_offset_map_lock(mm, pmd, 0xA0000, &ptl);
157 for (i = 0; i < 32; i++) { 156 for (i = 0; i < 32; i++) {
158 if (pte_present(*pte)) 157 if (pte_present(*pte))
159 set_pte(pte, pte_wrprotect(*pte)); 158 set_pte(pte, pte_wrprotect(*pte));
160 pte++; 159 pte++;
161 } 160 }
162 pte_unmap(mapped); 161 pte_unmap_unlock(pte, ptl);
163out: 162out:
164 spin_unlock(&tsk->mm->page_table_lock);
165 preempt_enable();
166 flush_tlb(); 163 flush_tlb();
167} 164}
168 165
@@ -306,7 +303,7 @@ static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk
306 303
307 tsk->thread.screen_bitmap = info->screen_bitmap; 304 tsk->thread.screen_bitmap = info->screen_bitmap;
308 if (info->flags & VM86_SCREEN_BITMAP) 305 if (info->flags & VM86_SCREEN_BITMAP)
309 mark_screen_rdonly(tsk); 306 mark_screen_rdonly(tsk->mm);
310 __asm__ __volatile__( 307 __asm__ __volatile__(
311 "xorl %%eax,%%eax; movl %%eax,%%fs; movl %%eax,%%gs\n\t" 308 "xorl %%eax,%%eax; movl %%eax,%%fs; movl %%eax,%%gs\n\t"
312 "movl %0,%%esp\n\t" 309 "movl %0,%%esp\n\t"
diff --git a/arch/i386/mach-es7000/es7000.h b/arch/i386/mach-es7000/es7000.h
index 898ed905e119..f1e3204f5dec 100644
--- a/arch/i386/mach-es7000/es7000.h
+++ b/arch/i386/mach-es7000/es7000.h
@@ -24,6 +24,15 @@
24 * http://www.unisys.com 24 * http://www.unisys.com
25 */ 25 */
26 26
27/*
28 * ES7000 chipsets
29 */
30
31#define NON_UNISYS 0
32#define ES7000_CLASSIC 1
33#define ES7000_ZORRO 2
34
35
27#define MIP_REG 1 36#define MIP_REG 1
28#define MIP_PSAI_REG 4 37#define MIP_PSAI_REG 4
29 38
@@ -106,6 +115,6 @@ struct mip_reg {
106 115
107extern int parse_unisys_oem (char *oemptr); 116extern int parse_unisys_oem (char *oemptr);
108extern int find_unisys_acpi_oem_table(unsigned long *oem_addr); 117extern int find_unisys_acpi_oem_table(unsigned long *oem_addr);
109extern void setup_unisys (); 118extern void setup_unisys(void);
110extern int es7000_start_cpu(int cpu, unsigned long eip); 119extern int es7000_start_cpu(int cpu, unsigned long eip);
111extern void es7000_sw_apic(void); 120extern void es7000_sw_apic(void);
diff --git a/arch/i386/mach-es7000/es7000plat.c b/arch/i386/mach-es7000/es7000plat.c
index dc6660511b07..a9ab0644f403 100644
--- a/arch/i386/mach-es7000/es7000plat.c
+++ b/arch/i386/mach-es7000/es7000plat.c
@@ -62,6 +62,9 @@ static unsigned int base;
62static int 62static int
63es7000_rename_gsi(int ioapic, int gsi) 63es7000_rename_gsi(int ioapic, int gsi)
64{ 64{
65 if (es7000_plat == ES7000_ZORRO)
66 return gsi;
67
65 if (!base) { 68 if (!base) {
66 int i; 69 int i;
67 for (i = 0; i < nr_ioapics; i++) 70 for (i = 0; i < nr_ioapics; i++)
@@ -76,7 +79,7 @@ es7000_rename_gsi(int ioapic, int gsi)
76#endif /* (CONFIG_X86_IO_APIC) && (CONFIG_ACPI) */ 79#endif /* (CONFIG_X86_IO_APIC) && (CONFIG_ACPI) */
77 80
78void __init 81void __init
79setup_unisys () 82setup_unisys(void)
80{ 83{
81 /* 84 /*
82 * Determine the generation of the ES7000 currently running. 85 * Determine the generation of the ES7000 currently running.
@@ -86,9 +89,9 @@ setup_unisys ()
86 * 89 *
87 */ 90 */
88 if (!(boot_cpu_data.x86 <= 15 && boot_cpu_data.x86_model <= 2)) 91 if (!(boot_cpu_data.x86 <= 15 && boot_cpu_data.x86_model <= 2))
89 es7000_plat = 2; 92 es7000_plat = ES7000_ZORRO;
90 else 93 else
91 es7000_plat = 1; 94 es7000_plat = ES7000_CLASSIC;
92 ioapic_renumber_irq = es7000_rename_gsi; 95 ioapic_renumber_irq = es7000_rename_gsi;
93} 96}
94 97
@@ -151,7 +154,7 @@ parse_unisys_oem (char *oemptr)
151 } 154 }
152 155
153 if (success < 2) { 156 if (success < 2) {
154 es7000_plat = 0; 157 es7000_plat = NON_UNISYS;
155 } else 158 } else
156 setup_unisys(); 159 setup_unisys();
157 return es7000_plat; 160 return es7000_plat;
diff --git a/arch/i386/mm/discontig.c b/arch/i386/mm/discontig.c
index 244d8ec66be2..c4af9638dbfa 100644
--- a/arch/i386/mm/discontig.c
+++ b/arch/i386/mm/discontig.c
@@ -98,7 +98,7 @@ unsigned long node_memmap_size_bytes(int nid, unsigned long start_pfn,
98 98
99extern unsigned long find_max_low_pfn(void); 99extern unsigned long find_max_low_pfn(void);
100extern void find_max_pfn(void); 100extern void find_max_pfn(void);
101extern void one_highpage_init(struct page *, int, int); 101extern void add_one_highpage_init(struct page *, int, int);
102 102
103extern struct e820map e820; 103extern struct e820map e820;
104extern unsigned long init_pg_tables_end; 104extern unsigned long init_pg_tables_end;
@@ -427,7 +427,7 @@ void __init set_highmem_pages_init(int bad_ppro)
427 if (!pfn_valid(node_pfn)) 427 if (!pfn_valid(node_pfn))
428 continue; 428 continue;
429 page = pfn_to_page(node_pfn); 429 page = pfn_to_page(node_pfn);
430 one_highpage_init(page, node_pfn, bad_ppro); 430 add_one_highpage_init(page, node_pfn, bad_ppro);
431 } 431 }
432 } 432 }
433 totalram_pages += totalhigh_pages; 433 totalram_pages += totalhigh_pages;
diff --git a/arch/i386/mm/fault.c b/arch/i386/mm/fault.c
index 9edd4485b91e..cf572d9a3b6e 100644
--- a/arch/i386/mm/fault.c
+++ b/arch/i386/mm/fault.c
@@ -108,7 +108,7 @@ static inline unsigned long get_segment_eip(struct pt_regs *regs,
108 desc = (void *)desc + (seg & ~7); 108 desc = (void *)desc + (seg & ~7);
109 } else { 109 } else {
110 /* Must disable preemption while reading the GDT. */ 110 /* Must disable preemption while reading the GDT. */
111 desc = (u32 *)&per_cpu(cpu_gdt_table, get_cpu()); 111 desc = (u32 *)get_cpu_gdt_table(get_cpu());
112 desc = (void *)desc + (seg & ~7); 112 desc = (void *)desc + (seg & ~7);
113 } 113 }
114 114
diff --git a/arch/i386/mm/init.c b/arch/i386/mm/init.c
index 2ebaf75f732e..542d9298da5e 100644
--- a/arch/i386/mm/init.c
+++ b/arch/i386/mm/init.c
@@ -27,6 +27,7 @@
27#include <linux/slab.h> 27#include <linux/slab.h>
28#include <linux/proc_fs.h> 28#include <linux/proc_fs.h>
29#include <linux/efi.h> 29#include <linux/efi.h>
30#include <linux/memory_hotplug.h>
30 31
31#include <asm/processor.h> 32#include <asm/processor.h>
32#include <asm/system.h> 33#include <asm/system.h>
@@ -266,17 +267,46 @@ static void __init permanent_kmaps_init(pgd_t *pgd_base)
266 pkmap_page_table = pte; 267 pkmap_page_table = pte;
267} 268}
268 269
269void __init one_highpage_init(struct page *page, int pfn, int bad_ppro) 270void __devinit free_new_highpage(struct page *page)
271{
272 set_page_count(page, 1);
273 __free_page(page);
274 totalhigh_pages++;
275}
276
277void __init add_one_highpage_init(struct page *page, int pfn, int bad_ppro)
270{ 278{
271 if (page_is_ram(pfn) && !(bad_ppro && page_kills_ppro(pfn))) { 279 if (page_is_ram(pfn) && !(bad_ppro && page_kills_ppro(pfn))) {
272 ClearPageReserved(page); 280 ClearPageReserved(page);
273 set_page_count(page, 1); 281 free_new_highpage(page);
274 __free_page(page);
275 totalhigh_pages++;
276 } else 282 } else
277 SetPageReserved(page); 283 SetPageReserved(page);
278} 284}
279 285
286static int add_one_highpage_hotplug(struct page *page, unsigned long pfn)
287{
288 free_new_highpage(page);
289 totalram_pages++;
290#ifdef CONFIG_FLATMEM
291 max_mapnr = max(pfn, max_mapnr);
292#endif
293 num_physpages++;
294 return 0;
295}
296
297/*
298 * Not currently handling the NUMA case.
299 * Assuming single node and all memory that
300 * has been added dynamically that would be
301 * onlined here is in HIGHMEM
302 */
303void online_page(struct page *page)
304{
305 ClearPageReserved(page);
306 add_one_highpage_hotplug(page, page_to_pfn(page));
307}
308
309
280#ifdef CONFIG_NUMA 310#ifdef CONFIG_NUMA
281extern void set_highmem_pages_init(int); 311extern void set_highmem_pages_init(int);
282#else 312#else
@@ -284,7 +314,7 @@ static void __init set_highmem_pages_init(int bad_ppro)
284{ 314{
285 int pfn; 315 int pfn;
286 for (pfn = highstart_pfn; pfn < highend_pfn; pfn++) 316 for (pfn = highstart_pfn; pfn < highend_pfn; pfn++)
287 one_highpage_init(pfn_to_page(pfn), pfn, bad_ppro); 317 add_one_highpage_init(pfn_to_page(pfn), pfn, bad_ppro);
288 totalram_pages += totalhigh_pages; 318 totalram_pages += totalhigh_pages;
289} 319}
290#endif /* CONFIG_FLATMEM */ 320#endif /* CONFIG_FLATMEM */
@@ -615,6 +645,28 @@ void __init mem_init(void)
615#endif 645#endif
616} 646}
617 647
648/*
649 * this is for the non-NUMA, single node SMP system case.
650 * Specifically, in the case of x86, we will always add
651 * memory to the highmem for now.
652 */
653#ifndef CONFIG_NEED_MULTIPLE_NODES
654int add_memory(u64 start, u64 size)
655{
656 struct pglist_data *pgdata = &contig_page_data;
657 struct zone *zone = pgdata->node_zones + MAX_NR_ZONES-1;
658 unsigned long start_pfn = start >> PAGE_SHIFT;
659 unsigned long nr_pages = size >> PAGE_SHIFT;
660
661 return __add_pages(zone, start_pfn, nr_pages);
662}
663
664int remove_memory(u64 start, u64 size)
665{
666 return -EINVAL;
667}
668#endif
669
618kmem_cache_t *pgd_cache; 670kmem_cache_t *pgd_cache;
619kmem_cache_t *pmd_cache; 671kmem_cache_t *pmd_cache;
620 672
diff --git a/arch/i386/mm/ioremap.c b/arch/i386/mm/ioremap.c
index f379b8d67558..5d09de8d1c6b 100644
--- a/arch/i386/mm/ioremap.c
+++ b/arch/i386/mm/ioremap.c
@@ -28,7 +28,7 @@ static int ioremap_pte_range(pmd_t *pmd, unsigned long addr,
28 unsigned long pfn; 28 unsigned long pfn;
29 29
30 pfn = phys_addr >> PAGE_SHIFT; 30 pfn = phys_addr >> PAGE_SHIFT;
31 pte = pte_alloc_kernel(&init_mm, pmd, addr); 31 pte = pte_alloc_kernel(pmd, addr);
32 if (!pte) 32 if (!pte)
33 return -ENOMEM; 33 return -ENOMEM;
34 do { 34 do {
@@ -87,14 +87,12 @@ static int ioremap_page_range(unsigned long addr,
87 flush_cache_all(); 87 flush_cache_all();
88 phys_addr -= addr; 88 phys_addr -= addr;
89 pgd = pgd_offset_k(addr); 89 pgd = pgd_offset_k(addr);
90 spin_lock(&init_mm.page_table_lock);
91 do { 90 do {
92 next = pgd_addr_end(addr, end); 91 next = pgd_addr_end(addr, end);
93 err = ioremap_pud_range(pgd, addr, next, phys_addr+addr, flags); 92 err = ioremap_pud_range(pgd, addr, next, phys_addr+addr, flags);
94 if (err) 93 if (err)
95 break; 94 break;
96 } while (pgd++, addr = next, addr != end); 95 } while (pgd++, addr = next, addr != end);
97 spin_unlock(&init_mm.page_table_lock);
98 flush_tlb_all(); 96 flush_tlb_all();
99 return err; 97 return err;
100} 98}
diff --git a/arch/i386/mm/pgtable.c b/arch/i386/mm/pgtable.c
index dcdce2c6c532..9db3242103be 100644
--- a/arch/i386/mm/pgtable.c
+++ b/arch/i386/mm/pgtable.c
@@ -31,11 +31,13 @@ void show_mem(void)
31 pg_data_t *pgdat; 31 pg_data_t *pgdat;
32 unsigned long i; 32 unsigned long i;
33 struct page_state ps; 33 struct page_state ps;
34 unsigned long flags;
34 35
35 printk(KERN_INFO "Mem-info:\n"); 36 printk(KERN_INFO "Mem-info:\n");
36 show_free_areas(); 37 show_free_areas();
37 printk(KERN_INFO "Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); 38 printk(KERN_INFO "Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
38 for_each_pgdat(pgdat) { 39 for_each_pgdat(pgdat) {
40 pgdat_resize_lock(pgdat, &flags);
39 for (i = 0; i < pgdat->node_spanned_pages; ++i) { 41 for (i = 0; i < pgdat->node_spanned_pages; ++i) {
40 page = pgdat_page_nr(pgdat, i); 42 page = pgdat_page_nr(pgdat, i);
41 total++; 43 total++;
@@ -48,6 +50,7 @@ void show_mem(void)
48 else if (page_count(page)) 50 else if (page_count(page))
49 shared += page_count(page) - 1; 51 shared += page_count(page) - 1;
50 } 52 }
53 pgdat_resize_unlock(pgdat, &flags);
51 } 54 }
52 printk(KERN_INFO "%d pages of RAM\n", total); 55 printk(KERN_INFO "%d pages of RAM\n", total);
53 printk(KERN_INFO "%d pages of HIGHMEM\n", highmem); 56 printk(KERN_INFO "%d pages of HIGHMEM\n", highmem);
@@ -188,19 +191,19 @@ static inline void pgd_list_add(pgd_t *pgd)
188 struct page *page = virt_to_page(pgd); 191 struct page *page = virt_to_page(pgd);
189 page->index = (unsigned long)pgd_list; 192 page->index = (unsigned long)pgd_list;
190 if (pgd_list) 193 if (pgd_list)
191 pgd_list->private = (unsigned long)&page->index; 194 set_page_private(pgd_list, (unsigned long)&page->index);
192 pgd_list = page; 195 pgd_list = page;
193 page->private = (unsigned long)&pgd_list; 196 set_page_private(page, (unsigned long)&pgd_list);
194} 197}
195 198
196static inline void pgd_list_del(pgd_t *pgd) 199static inline void pgd_list_del(pgd_t *pgd)
197{ 200{
198 struct page *next, **pprev, *page = virt_to_page(pgd); 201 struct page *next, **pprev, *page = virt_to_page(pgd);
199 next = (struct page *)page->index; 202 next = (struct page *)page->index;
200 pprev = (struct page **)page->private; 203 pprev = (struct page **)page_private(page);
201 *pprev = next; 204 *pprev = next;
202 if (next) 205 if (next)
203 next->private = (unsigned long)pprev; 206 set_page_private(next, (unsigned long)pprev);
204} 207}
205 208
206void pgd_ctor(void *pgd, kmem_cache_t *cache, unsigned long unused) 209void pgd_ctor(void *pgd, kmem_cache_t *cache, unsigned long unused)
diff --git a/arch/i386/oprofile/backtrace.c b/arch/i386/oprofile/backtrace.c
index 65dfd2edb671..21654be3f73f 100644
--- a/arch/i386/oprofile/backtrace.c
+++ b/arch/i386/oprofile/backtrace.c
@@ -12,6 +12,7 @@
12#include <linux/sched.h> 12#include <linux/sched.h>
13#include <linux/mm.h> 13#include <linux/mm.h>
14#include <asm/ptrace.h> 14#include <asm/ptrace.h>
15#include <asm/uaccess.h>
15 16
16struct frame_head { 17struct frame_head {
17 struct frame_head * ebp; 18 struct frame_head * ebp;
@@ -21,26 +22,22 @@ struct frame_head {
21static struct frame_head * 22static struct frame_head *
22dump_backtrace(struct frame_head * head) 23dump_backtrace(struct frame_head * head)
23{ 24{
24 oprofile_add_trace(head->ret); 25 struct frame_head bufhead[2];
25 26
26 /* frame pointers should strictly progress back up the stack 27 /* Also check accessibility of one struct frame_head beyond */
27 * (towards higher addresses) */ 28 if (!access_ok(VERIFY_READ, head, sizeof(bufhead)))
28 if (head >= head->ebp) 29 return NULL;
30 if (__copy_from_user_inatomic(bufhead, head, sizeof(bufhead)))
29 return NULL; 31 return NULL;
30 32
31 return head->ebp; 33 oprofile_add_trace(bufhead[0].ret);
32}
33
34/* check that the page(s) containing the frame head are present */
35static int pages_present(struct frame_head * head)
36{
37 struct mm_struct * mm = current->mm;
38 34
39 /* FIXME: only necessary once per page */ 35 /* frame pointers should strictly progress back up the stack
40 if (!check_user_page_readable(mm, (unsigned long)head)) 36 * (towards higher addresses) */
41 return 0; 37 if (head >= bufhead[0].ebp)
38 return NULL;
42 39
43 return check_user_page_readable(mm, (unsigned long)(head + 1)); 40 return bufhead[0].ebp;
44} 41}
45 42
46/* 43/*
@@ -97,15 +94,6 @@ x86_backtrace(struct pt_regs * const regs, unsigned int depth)
97 return; 94 return;
98 } 95 }
99 96
100#ifdef CONFIG_SMP 97 while (depth-- && head)
101 if (!spin_trylock(&current->mm->page_table_lock))
102 return;
103#endif
104
105 while (depth-- && head && pages_present(head))
106 head = dump_backtrace(head); 98 head = dump_backtrace(head);
107
108#ifdef CONFIG_SMP
109 spin_unlock(&current->mm->page_table_lock);
110#endif
111} 99}
diff --git a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c
index cddafe33ff7c..19e6f4871d1e 100644
--- a/arch/i386/pci/irq.c
+++ b/arch/i386/pci/irq.c
@@ -547,31 +547,48 @@ static __init int intel_router_probe(struct irq_router *r, struct pci_dev *route
547 return 0; 547 return 0;
548} 548}
549 549
550static __init int via_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) 550static __init int via_router_probe(struct irq_router *r,
551 struct pci_dev *router, u16 device)
551{ 552{
552 /* FIXME: We should move some of the quirk fixup stuff here */ 553 /* FIXME: We should move some of the quirk fixup stuff here */
553 554
554 if (router->device == PCI_DEVICE_ID_VIA_82C686 && 555 /*
555 device == PCI_DEVICE_ID_VIA_82C586_0) { 556 * work arounds for some buggy BIOSes
556 /* Asus k7m bios wrongly reports 82C686A as 586-compatible */ 557 */
557 device = PCI_DEVICE_ID_VIA_82C686; 558 if (device == PCI_DEVICE_ID_VIA_82C586_0) {
559 switch(router->device) {
560 case PCI_DEVICE_ID_VIA_82C686:
561 /*
562 * Asus k7m bios wrongly reports 82C686A
563 * as 586-compatible
564 */
565 device = PCI_DEVICE_ID_VIA_82C686;
566 break;
567 case PCI_DEVICE_ID_VIA_8235:
568 /**
569 * Asus a7v-x bios wrongly reports 8235
570 * as 586-compatible
571 */
572 device = PCI_DEVICE_ID_VIA_8235;
573 break;
574 }
558 } 575 }
559 576
560 switch(device) 577 switch(device) {
561 { 578 case PCI_DEVICE_ID_VIA_82C586_0:
562 case PCI_DEVICE_ID_VIA_82C586_0: 579 r->name = "VIA";
563 r->name = "VIA"; 580 r->get = pirq_via586_get;
564 r->get = pirq_via586_get; 581 r->set = pirq_via586_set;
565 r->set = pirq_via586_set; 582 return 1;
566 return 1; 583 case PCI_DEVICE_ID_VIA_82C596:
567 case PCI_DEVICE_ID_VIA_82C596: 584 case PCI_DEVICE_ID_VIA_82C686:
568 case PCI_DEVICE_ID_VIA_82C686: 585 case PCI_DEVICE_ID_VIA_8231:
569 case PCI_DEVICE_ID_VIA_8231: 586 case PCI_DEVICE_ID_VIA_8235:
570 /* FIXME: add new ones for 8233/5 */ 587 /* FIXME: add new ones for 8233/5 */
571 r->name = "VIA"; 588 r->name = "VIA";
572 r->get = pirq_via_get; 589 r->get = pirq_via_get;
573 r->set = pirq_via_set; 590 r->set = pirq_via_set;
574 return 1; 591 return 1;
575 } 592 }
576 return 0; 593 return 0;
577} 594}
diff --git a/arch/i386/power/cpu.c b/arch/i386/power/cpu.c
index b27c5acc79d0..1f1572692e0b 100644
--- a/arch/i386/power/cpu.c
+++ b/arch/i386/power/cpu.c
@@ -51,16 +51,14 @@ void save_processor_state(void)
51 __save_processor_state(&saved_context); 51 __save_processor_state(&saved_context);
52} 52}
53 53
54static void 54static void do_fpu_end(void)
55do_fpu_end(void)
56{ 55{
57 /* restore FPU regs if necessary */ 56 /*
58 /* Do it out of line so that gcc does not move cr0 load to some stupid place */ 57 * Restore FPU regs if necessary.
59 kernel_fpu_end(); 58 */
60 mxcsr_feature_mask_init(); 59 kernel_fpu_end();
61} 60}
62 61
63
64static void fix_processor_context(void) 62static void fix_processor_context(void)
65{ 63{
66 int cpu = smp_processor_id(); 64 int cpu = smp_processor_id();
diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c
index 3fa67ecebc83..dc282710421a 100644
--- a/arch/ia64/ia32/sys_ia32.c
+++ b/arch/ia64/ia32/sys_ia32.c
@@ -36,6 +36,7 @@
36#include <linux/uio.h> 36#include <linux/uio.h>
37#include <linux/nfs_fs.h> 37#include <linux/nfs_fs.h>
38#include <linux/quota.h> 38#include <linux/quota.h>
39#include <linux/syscalls.h>
39#include <linux/sunrpc/svc.h> 40#include <linux/sunrpc/svc.h>
40#include <linux/nfsd/nfsd.h> 41#include <linux/nfsd/nfsd.h>
41#include <linux/nfsd/cache.h> 42#include <linux/nfsd/cache.h>
diff --git a/arch/ia64/kernel/cyclone.c b/arch/ia64/kernel/cyclone.c
index 768c7e46957c..6ade3790ce07 100644
--- a/arch/ia64/kernel/cyclone.c
+++ b/arch/ia64/kernel/cyclone.c
@@ -2,6 +2,7 @@
2#include <linux/smp.h> 2#include <linux/smp.h>
3#include <linux/time.h> 3#include <linux/time.h>
4#include <linux/errno.h> 4#include <linux/errno.h>
5#include <linux/timex.h>
5#include <asm/io.h> 6#include <asm/io.h>
6 7
7/* IBM Summit (EXA) Cyclone counter code*/ 8/* IBM Summit (EXA) Cyclone counter code*/
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index d71731ee5b61..f7dfc107cb7b 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -2352,7 +2352,8 @@ pfm_smpl_buffer_alloc(struct task_struct *task, pfm_context_t *ctx, unsigned lon
2352 insert_vm_struct(mm, vma); 2352 insert_vm_struct(mm, vma);
2353 2353
2354 mm->total_vm += size >> PAGE_SHIFT; 2354 mm->total_vm += size >> PAGE_SHIFT;
2355 vm_stat_account(vma); 2355 vm_stat_account(vma->vm_mm, vma->vm_flags, vma->vm_file,
2356 vma_pages(vma));
2356 up_write(&task->mm->mmap_sem); 2357 up_write(&task->mm->mmap_sem);
2357 2358
2358 /* 2359 /*
diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
index 8b8a5a45b621..5b7e736f3b49 100644
--- a/arch/ia64/kernel/time.c
+++ b/arch/ia64/kernel/time.c
@@ -32,10 +32,6 @@
32 32
33extern unsigned long wall_jiffies; 33extern unsigned long wall_jiffies;
34 34
35u64 jiffies_64 __cacheline_aligned_in_smp = INITIAL_JIFFIES;
36
37EXPORT_SYMBOL(jiffies_64);
38
39#define TIME_KEEPER_ID 0 /* smp_processor_id() of time-keeper */ 35#define TIME_KEEPER_ID 0 /* smp_processor_id() of time-keeper */
40 36
41#ifdef CONFIG_IA64_DEBUG_IRQ 37#ifdef CONFIG_IA64_DEBUG_IRQ
diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c
index a3788fb84809..a88cdb7232f8 100644
--- a/arch/ia64/mm/discontig.c
+++ b/arch/ia64/mm/discontig.c
@@ -555,9 +555,13 @@ void show_mem(void)
555 show_free_areas(); 555 show_free_areas();
556 printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); 556 printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
557 for_each_pgdat(pgdat) { 557 for_each_pgdat(pgdat) {
558 unsigned long present = pgdat->node_present_pages; 558 unsigned long present;
559 unsigned long flags;
559 int shared = 0, cached = 0, reserved = 0; 560 int shared = 0, cached = 0, reserved = 0;
561
560 printk("Node ID: %d\n", pgdat->node_id); 562 printk("Node ID: %d\n", pgdat->node_id);
563 pgdat_resize_lock(pgdat, &flags);
564 present = pgdat->node_present_pages;
561 for(i = 0; i < pgdat->node_spanned_pages; i++) { 565 for(i = 0; i < pgdat->node_spanned_pages; i++) {
562 struct page *page; 566 struct page *page;
563 if (pfn_valid(pgdat->node_start_pfn + i)) 567 if (pfn_valid(pgdat->node_start_pfn + i))
@@ -571,6 +575,7 @@ void show_mem(void)
571 else if (page_count(page)) 575 else if (page_count(page))
572 shared += page_count(page)-1; 576 shared += page_count(page)-1;
573 } 577 }
578 pgdat_resize_unlock(pgdat, &flags);
574 total_present += present; 579 total_present += present;
575 total_reserved += reserved; 580 total_reserved += reserved;
576 total_cached += cached; 581 total_cached += cached;
diff --git a/arch/ia64/mm/fault.c b/arch/ia64/mm/fault.c
index 3c32af910d60..af7eb087dca7 100644
--- a/arch/ia64/mm/fault.c
+++ b/arch/ia64/mm/fault.c
@@ -20,32 +20,6 @@
20extern void die (char *, struct pt_regs *, long); 20extern void die (char *, struct pt_regs *, long);
21 21
22/* 22/*
23 * This routine is analogous to expand_stack() but instead grows the
24 * register backing store (which grows towards higher addresses).
25 * Since the register backing store is access sequentially, we
26 * disallow growing the RBS by more than a page at a time. Note that
27 * the VM_GROWSUP flag can be set on any VM area but that's fine
28 * because the total process size is still limited by RLIMIT_STACK and
29 * RLIMIT_AS.
30 */
31static inline long
32expand_backing_store (struct vm_area_struct *vma, unsigned long address)
33{
34 unsigned long grow;
35
36 grow = PAGE_SIZE >> PAGE_SHIFT;
37 if (address - vma->vm_start > current->signal->rlim[RLIMIT_STACK].rlim_cur
38 || (((vma->vm_mm->total_vm + grow) << PAGE_SHIFT) > current->signal->rlim[RLIMIT_AS].rlim_cur))
39 return -ENOMEM;
40 vma->vm_end += PAGE_SIZE;
41 vma->vm_mm->total_vm += grow;
42 if (vma->vm_flags & VM_LOCKED)
43 vma->vm_mm->locked_vm += grow;
44 __vm_stat_account(vma->vm_mm, vma->vm_flags, vma->vm_file, grow);
45 return 0;
46}
47
48/*
49 * Return TRUE if ADDRESS points at a page in the kernel's mapped segment 23 * Return TRUE if ADDRESS points at a page in the kernel's mapped segment
50 * (inside region 5, on ia64) and that page is present. 24 * (inside region 5, on ia64) and that page is present.
51 */ 25 */
@@ -185,7 +159,13 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re
185 if (REGION_NUMBER(address) != REGION_NUMBER(vma->vm_start) 159 if (REGION_NUMBER(address) != REGION_NUMBER(vma->vm_start)
186 || REGION_OFFSET(address) >= RGN_MAP_LIMIT) 160 || REGION_OFFSET(address) >= RGN_MAP_LIMIT)
187 goto bad_area; 161 goto bad_area;
188 if (expand_backing_store(vma, address)) 162 /*
163 * Since the register backing store is accessed sequentially,
164 * we disallow growing it by more than a page at a time.
165 */
166 if (address > vma->vm_end + PAGE_SIZE - sizeof(long))
167 goto bad_area;
168 if (expand_upwards(vma, address))
189 goto bad_area; 169 goto bad_area;
190 } 170 }
191 goto good_area; 171 goto good_area;
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index 98246acd4991..e3215ba64ffd 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -158,7 +158,7 @@ ia64_init_addr_space (void)
158 vma->vm_start = current->thread.rbs_bot & PAGE_MASK; 158 vma->vm_start = current->thread.rbs_bot & PAGE_MASK;
159 vma->vm_end = vma->vm_start + PAGE_SIZE; 159 vma->vm_end = vma->vm_start + PAGE_SIZE;
160 vma->vm_page_prot = protection_map[VM_DATA_DEFAULT_FLAGS & 0x7]; 160 vma->vm_page_prot = protection_map[VM_DATA_DEFAULT_FLAGS & 0x7];
161 vma->vm_flags = VM_DATA_DEFAULT_FLAGS | VM_GROWSUP; 161 vma->vm_flags = VM_DATA_DEFAULT_FLAGS|VM_GROWSUP|VM_ACCOUNT;
162 down_write(&current->mm->mmap_sem); 162 down_write(&current->mm->mmap_sem);
163 if (insert_vm_struct(current->mm, vma)) { 163 if (insert_vm_struct(current->mm, vma)) {
164 up_write(&current->mm->mmap_sem); 164 up_write(&current->mm->mmap_sem);
@@ -275,26 +275,21 @@ put_kernel_page (struct page *page, unsigned long address, pgprot_t pgprot)
275 275
276 pgd = pgd_offset_k(address); /* note: this is NOT pgd_offset()! */ 276 pgd = pgd_offset_k(address); /* note: this is NOT pgd_offset()! */
277 277
278 spin_lock(&init_mm.page_table_lock);
279 { 278 {
280 pud = pud_alloc(&init_mm, pgd, address); 279 pud = pud_alloc(&init_mm, pgd, address);
281 if (!pud) 280 if (!pud)
282 goto out; 281 goto out;
283
284 pmd = pmd_alloc(&init_mm, pud, address); 282 pmd = pmd_alloc(&init_mm, pud, address);
285 if (!pmd) 283 if (!pmd)
286 goto out; 284 goto out;
287 pte = pte_alloc_map(&init_mm, pmd, address); 285 pte = pte_alloc_kernel(pmd, address);
288 if (!pte) 286 if (!pte)
289 goto out; 287 goto out;
290 if (!pte_none(*pte)) { 288 if (!pte_none(*pte))
291 pte_unmap(pte);
292 goto out; 289 goto out;
293 }
294 set_pte(pte, mk_pte(page, pgprot)); 290 set_pte(pte, mk_pte(page, pgprot));
295 pte_unmap(pte);
296 } 291 }
297 out: spin_unlock(&init_mm.page_table_lock); 292 out:
298 /* no need for flush_tlb */ 293 /* no need for flush_tlb */
299 return page; 294 return page;
300} 295}
diff --git a/arch/ia64/mm/tlb.c b/arch/ia64/mm/tlb.c
index c93e0f2b5fea..c79a9b96d02b 100644
--- a/arch/ia64/mm/tlb.c
+++ b/arch/ia64/mm/tlb.c
@@ -158,10 +158,12 @@ flush_tlb_range (struct vm_area_struct *vma, unsigned long start, unsigned long
158# ifdef CONFIG_SMP 158# ifdef CONFIG_SMP
159 platform_global_tlb_purge(mm, start, end, nbits); 159 platform_global_tlb_purge(mm, start, end, nbits);
160# else 160# else
161 preempt_disable();
161 do { 162 do {
162 ia64_ptcl(start, (nbits<<2)); 163 ia64_ptcl(start, (nbits<<2));
163 start += (1UL << nbits); 164 start += (1UL << nbits);
164 } while (start < end); 165 } while (start < end);
166 preempt_enable();
165# endif 167# endif
166 168
167 ia64_srlz_i(); /* srlz.i implies srlz.d */ 169 ia64_srlz_i(); /* srlz.i implies srlz.d */
diff --git a/arch/m32r/kernel/entry.S b/arch/m32r/kernel/entry.S
index 85920fb8d08c..396c94218cc2 100644
--- a/arch/m32r/kernel/entry.S
+++ b/arch/m32r/kernel/entry.S
@@ -653,8 +653,6 @@ ENTRY(rie_handler)
653 SAVE_ALL 653 SAVE_ALL
654 mvfc r0, bpc 654 mvfc r0, bpc
655 ld r1, @r0 655 ld r1, @r0
656 seth r0, #0xa0f0
657 st r1, @r0
658 ldi r1, #0x20 ; error_code 656 ldi r1, #0x20 ; error_code
659 mv r0, sp ; pt_regs 657 mv r0, sp ; pt_regs
660 bl do_rie_handler 658 bl do_rie_handler
diff --git a/arch/m32r/kernel/io_m32700ut.c b/arch/m32r/kernel/io_m32700ut.c
index e545b065f7e9..eda9f963c1eb 100644
--- a/arch/m32r/kernel/io_m32700ut.c
+++ b/arch/m32r/kernel/io_m32700ut.c
@@ -64,11 +64,11 @@ static inline void *__port2addr_ata(unsigned long port)
64 * from 0x10000000 to 0x13ffffff on physical address. 64 * from 0x10000000 to 0x13ffffff on physical address.
65 * The base address of LAN controller(LAN91C111) is 0x300. 65 * The base address of LAN controller(LAN91C111) is 0x300.
66 */ 66 */
67#define LAN_IOSTART 0x300 67#define LAN_IOSTART 0xa0000300
68#define LAN_IOEND 0x320 68#define LAN_IOEND 0xa0000320
69static inline void *_port2addr_ne(unsigned long port) 69static inline void *_port2addr_ne(unsigned long port)
70{ 70{
71 return (void *)(port + NONCACHE_OFFSET + 0x10000000); 71 return (void *)(port + 0x10000000);
72} 72}
73static inline void *_port2addr_usb(unsigned long port) 73static inline void *_port2addr_usb(unsigned long port)
74{ 74{
diff --git a/arch/m32r/kernel/io_mappi.c b/arch/m32r/kernel/io_mappi.c
index 78033165fb5c..3c3da042fbd1 100644
--- a/arch/m32r/kernel/io_mappi.c
+++ b/arch/m32r/kernel/io_mappi.c
@@ -31,7 +31,7 @@ extern void pcc_iowrite(int, unsigned long, void *, size_t, size_t, int);
31 31
32static inline void *_port2addr(unsigned long port) 32static inline void *_port2addr(unsigned long port)
33{ 33{
34 return (void *)(port + NONCACHE_OFFSET); 34 return (void *)(port | (NONCACHE_OFFSET));
35} 35}
36 36
37static inline void *_port2addr_ne(unsigned long port) 37static inline void *_port2addr_ne(unsigned long port)
diff --git a/arch/m32r/kernel/io_mappi2.c b/arch/m32r/kernel/io_mappi2.c
index 5c03504bf653..df3c729cb3e0 100644
--- a/arch/m32r/kernel/io_mappi2.c
+++ b/arch/m32r/kernel/io_mappi2.c
@@ -33,12 +33,9 @@ extern void pcc_iowrite_word(int, unsigned long, void *, size_t, size_t, int);
33 33
34static inline void *_port2addr(unsigned long port) 34static inline void *_port2addr(unsigned long port)
35{ 35{
36 return (void *)(port + NONCACHE_OFFSET); 36 return (void *)(port | (NONCACHE_OFFSET));
37} 37}
38 38
39#define LAN_IOSTART 0x300
40#define LAN_IOEND 0x320
41
42#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) 39#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
43static inline void *__port2addr_ata(unsigned long port) 40static inline void *__port2addr_ata(unsigned long port)
44{ 41{
@@ -59,15 +56,17 @@ static inline void *__port2addr_ata(unsigned long port)
59} 56}
60#endif 57#endif
61 58
59#define LAN_IOSTART 0xa0000300
60#define LAN_IOEND 0xa0000320
62#ifdef CONFIG_CHIP_OPSP 61#ifdef CONFIG_CHIP_OPSP
63static inline void *_port2addr_ne(unsigned long port) 62static inline void *_port2addr_ne(unsigned long port)
64{ 63{
65 return (void *)(port + NONCACHE_OFFSET + 0x10000000); 64 return (void *)(port + 0x10000000);
66} 65}
67#else 66#else
68static inline void *_port2addr_ne(unsigned long port) 67static inline void *_port2addr_ne(unsigned long port)
69{ 68{
70 return (void *)(port + NONCACHE_OFFSET + 0x04000000); 69 return (void *)(port + 0x04000000);
71} 70}
72#endif 71#endif
73static inline void *_port2addr_usb(unsigned long port) 72static inline void *_port2addr_usb(unsigned long port)
diff --git a/arch/m32r/kernel/io_mappi3.c b/arch/m32r/kernel/io_mappi3.c
index c80bde657854..6716ffea769a 100644
--- a/arch/m32r/kernel/io_mappi3.c
+++ b/arch/m32r/kernel/io_mappi3.c
@@ -36,9 +36,6 @@ static inline void *_port2addr(unsigned long port)
36 return (void *)(port + NONCACHE_OFFSET); 36 return (void *)(port + NONCACHE_OFFSET);
37} 37}
38 38
39#define LAN_IOSTART 0x300
40#define LAN_IOEND 0x320
41
42#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) 39#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
43static inline void *__port2addr_ata(unsigned long port) 40static inline void *__port2addr_ata(unsigned long port)
44{ 41{
@@ -59,9 +56,11 @@ static inline void *__port2addr_ata(unsigned long port)
59} 56}
60#endif 57#endif
61 58
59#define LAN_IOSTART 0xa0000300
60#define LAN_IOEND 0xa0000320
62static inline void *_port2addr_ne(unsigned long port) 61static inline void *_port2addr_ne(unsigned long port)
63{ 62{
64 return (void *)(port + NONCACHE_OFFSET + 0x10000000); 63 return (void *)(port + 0x10000000);
65} 64}
66 65
67static inline void *_port2addr_usb(unsigned long port) 66static inline void *_port2addr_usb(unsigned long port)
diff --git a/arch/m32r/kernel/io_oaks32r.c b/arch/m32r/kernel/io_oaks32r.c
index 9997dddd24d7..8be323931e4a 100644
--- a/arch/m32r/kernel/io_oaks32r.c
+++ b/arch/m32r/kernel/io_oaks32r.c
@@ -16,7 +16,7 @@
16 16
17static inline void *_port2addr(unsigned long port) 17static inline void *_port2addr(unsigned long port)
18{ 18{
19 return (void *)(port + NONCACHE_OFFSET); 19 return (void *)(port | (NONCACHE_OFFSET));
20} 20}
21 21
22static inline void *_port2addr_ne(unsigned long port) 22static inline void *_port2addr_ne(unsigned long port)
diff --git a/arch/m32r/kernel/io_opsput.c b/arch/m32r/kernel/io_opsput.c
index e34951e8156f..4793bd18e115 100644
--- a/arch/m32r/kernel/io_opsput.c
+++ b/arch/m32r/kernel/io_opsput.c
@@ -36,7 +36,7 @@ extern void pcc_iowrite_word(int, unsigned long, void *, size_t, size_t, int);
36 36
37static inline void *_port2addr(unsigned long port) 37static inline void *_port2addr(unsigned long port)
38{ 38{
39 return (void *)(port + NONCACHE_OFFSET); 39 return (void *)(port | (NONCACHE_OFFSET));
40} 40}
41 41
42/* 42/*
@@ -44,11 +44,11 @@ static inline void *_port2addr(unsigned long port)
44 * from 0x10000000 to 0x13ffffff on physical address. 44 * from 0x10000000 to 0x13ffffff on physical address.
45 * The base address of LAN controller(LAN91C111) is 0x300. 45 * The base address of LAN controller(LAN91C111) is 0x300.
46 */ 46 */
47#define LAN_IOSTART 0x300 47#define LAN_IOSTART 0xa0000300
48#define LAN_IOEND 0x320 48#define LAN_IOEND 0xa0000320
49static inline void *_port2addr_ne(unsigned long port) 49static inline void *_port2addr_ne(unsigned long port)
50{ 50{
51 return (void *)(port + NONCACHE_OFFSET + 0x10000000); 51 return (void *)(port + 0x10000000);
52} 52}
53static inline void *_port2addr_usb(unsigned long port) 53static inline void *_port2addr_usb(unsigned long port)
54{ 54{
diff --git a/arch/m32r/kernel/io_usrv.c b/arch/m32r/kernel/io_usrv.c
index 9eb161dcc104..39a379af40bc 100644
--- a/arch/m32r/kernel/io_usrv.c
+++ b/arch/m32r/kernel/io_usrv.c
@@ -47,7 +47,7 @@ static inline void *_port2addr(unsigned long port)
47 else if (port >= UART1_IOSTART && port <= UART1_IOEND) 47 else if (port >= UART1_IOSTART && port <= UART1_IOEND)
48 port = ((port - UART1_IOSTART) << 1) + UART1_REGSTART; 48 port = ((port - UART1_IOSTART) << 1) + UART1_REGSTART;
49#endif /* CONFIG_SERIAL_8250 || CONFIG_SERIAL_8250_MODULE */ 49#endif /* CONFIG_SERIAL_8250 || CONFIG_SERIAL_8250_MODULE */
50 return (void *)(port + NONCACHE_OFFSET); 50 return (void *)(port | (NONCACHE_OFFSET));
51} 51}
52 52
53static inline void delay(void) 53static inline void delay(void)
diff --git a/arch/m32r/kernel/ptrace.c b/arch/m32r/kernel/ptrace.c
index 124f7c1b775e..078d2a0e71c2 100644
--- a/arch/m32r/kernel/ptrace.c
+++ b/arch/m32r/kernel/ptrace.c
@@ -756,7 +756,7 @@ do_ptrace(long request, struct task_struct *child, long addr, long data)
756 return ret; 756 return ret;
757} 757}
758 758
759asmlinkage int sys_ptrace(long request, long pid, long addr, long data) 759asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
760{ 760{
761 struct task_struct *child; 761 struct task_struct *child;
762 int ret; 762 int ret;
diff --git a/arch/m32r/kernel/setup.c b/arch/m32r/kernel/setup.c
index ec5674727e7f..f722ec8eb021 100644
--- a/arch/m32r/kernel/setup.c
+++ b/arch/m32r/kernel/setup.c
@@ -305,19 +305,19 @@ static int show_cpuinfo(struct seq_file *m, void *v)
305 305
306 seq_printf(m, "processor\t: %ld\n", cpu); 306 seq_printf(m, "processor\t: %ld\n", cpu);
307 307
308#ifdef CONFIG_CHIP_VDEC2 308#if defined(CONFIG_CHIP_VDEC2)
309 seq_printf(m, "cpu family\t: VDEC2\n" 309 seq_printf(m, "cpu family\t: VDEC2\n"
310 "cache size\t: Unknown\n"); 310 "cache size\t: Unknown\n");
311#elif CONFIG_CHIP_M32700 311#elif defined(CONFIG_CHIP_M32700)
312 seq_printf(m,"cpu family\t: M32700\n" 312 seq_printf(m,"cpu family\t: M32700\n"
313 "cache size\t: I-8KB/D-8KB\n"); 313 "cache size\t: I-8KB/D-8KB\n");
314#elif CONFIG_CHIP_M32102 314#elif defined(CONFIG_CHIP_M32102)
315 seq_printf(m,"cpu family\t: M32102\n" 315 seq_printf(m,"cpu family\t: M32102\n"
316 "cache size\t: I-8KB\n"); 316 "cache size\t: I-8KB\n");
317#elif CONFIG_CHIP_OPSP 317#elif defined(CONFIG_CHIP_OPSP)
318 seq_printf(m,"cpu family\t: OPSP\n" 318 seq_printf(m,"cpu family\t: OPSP\n"
319 "cache size\t: I-8KB/D-8KB\n"); 319 "cache size\t: I-8KB/D-8KB\n");
320#elif CONFIG_CHIP_MP 320#elif defined(CONFIG_CHIP_MP)
321 seq_printf(m, "cpu family\t: M32R-MP\n" 321 seq_printf(m, "cpu family\t: M32R-MP\n"
322 "cache size\t: I-xxKB/D-xxKB\n"); 322 "cache size\t: I-xxKB/D-xxKB\n");
323#else 323#else
@@ -326,19 +326,19 @@ static int show_cpuinfo(struct seq_file *m, void *v)
326 seq_printf(m, "bogomips\t: %lu.%02lu\n", 326 seq_printf(m, "bogomips\t: %lu.%02lu\n",
327 c->loops_per_jiffy/(500000/HZ), 327 c->loops_per_jiffy/(500000/HZ),
328 (c->loops_per_jiffy/(5000/HZ)) % 100); 328 (c->loops_per_jiffy/(5000/HZ)) % 100);
329#ifdef CONFIG_PLAT_MAPPI 329#if defined(CONFIG_PLAT_MAPPI)
330 seq_printf(m, "Machine\t\t: Mappi Evaluation board\n"); 330 seq_printf(m, "Machine\t\t: Mappi Evaluation board\n");
331#elif CONFIG_PLAT_MAPPI2 331#elif defined(CONFIG_PLAT_MAPPI2)
332 seq_printf(m, "Machine\t\t: Mappi-II Evaluation board\n"); 332 seq_printf(m, "Machine\t\t: Mappi-II Evaluation board\n");
333#elif CONFIG_PLAT_MAPPI3 333#elif defined(CONFIG_PLAT_MAPPI3)
334 seq_printf(m, "Machine\t\t: Mappi-III Evaluation board\n"); 334 seq_printf(m, "Machine\t\t: Mappi-III Evaluation board\n");
335#elif CONFIG_PLAT_M32700UT 335#elif defined(CONFIG_PLAT_M32700UT)
336 seq_printf(m, "Machine\t\t: M32700UT Evaluation board\n"); 336 seq_printf(m, "Machine\t\t: M32700UT Evaluation board\n");
337#elif CONFIG_PLAT_OPSPUT 337#elif defined(CONFIG_PLAT_OPSPUT)
338 seq_printf(m, "Machine\t\t: OPSPUT Evaluation board\n"); 338 seq_printf(m, "Machine\t\t: OPSPUT Evaluation board\n");
339#elif CONFIG_PLAT_USRV 339#elif defined(CONFIG_PLAT_USRV)
340 seq_printf(m, "Machine\t\t: uServer\n"); 340 seq_printf(m, "Machine\t\t: uServer\n");
341#elif CONFIG_PLAT_OAKS32R 341#elif defined(CONFIG_PLAT_OAKS32R)
342 seq_printf(m, "Machine\t\t: OAKS32R\n"); 342 seq_printf(m, "Machine\t\t: OAKS32R\n");
343#else 343#else
344 seq_printf(m, "Machine\t\t: Unknown\n"); 344 seq_printf(m, "Machine\t\t: Unknown\n");
diff --git a/arch/m32r/kernel/time.c b/arch/m32r/kernel/time.c
index 539c562cd54d..2ebce2063fea 100644
--- a/arch/m32r/kernel/time.c
+++ b/arch/m32r/kernel/time.c
@@ -39,10 +39,6 @@ extern void send_IPI_allbutself(int, int);
39extern void smp_local_timer_interrupt(struct pt_regs *); 39extern void smp_local_timer_interrupt(struct pt_regs *);
40#endif 40#endif
41 41
42u64 jiffies_64 = INITIAL_JIFFIES;
43
44EXPORT_SYMBOL(jiffies_64);
45
46extern unsigned long wall_jiffies; 42extern unsigned long wall_jiffies;
47#define TICK_SIZE (tick_nsec / 1000) 43#define TICK_SIZE (tick_nsec / 1000)
48 44
diff --git a/arch/m32r/lib/csum_partial_copy.c b/arch/m32r/lib/csum_partial_copy.c
index ddb16a83a8ce..3d5f06145854 100644
--- a/arch/m32r/lib/csum_partial_copy.c
+++ b/arch/m32r/lib/csum_partial_copy.c
@@ -18,10 +18,10 @@
18 18
19#include <linux/module.h> 19#include <linux/module.h>
20#include <linux/types.h> 20#include <linux/types.h>
21#include <linux/string.h>
21 22
22#include <net/checksum.h> 23#include <net/checksum.h>
23#include <asm/byteorder.h> 24#include <asm/byteorder.h>
24#include <asm/string.h>
25#include <asm/uaccess.h> 25#include <asm/uaccess.h>
26 26
27/* 27/*
diff --git a/arch/m32r/mm/init.c b/arch/m32r/mm/init.c
index d9a40b1fe8ba..6facf15b04f3 100644
--- a/arch/m32r/mm/init.c
+++ b/arch/m32r/mm/init.c
@@ -48,6 +48,8 @@ void show_mem(void)
48 show_free_areas(); 48 show_free_areas();
49 printk("Free swap: %6ldkB\n",nr_swap_pages<<(PAGE_SHIFT-10)); 49 printk("Free swap: %6ldkB\n",nr_swap_pages<<(PAGE_SHIFT-10));
50 for_each_pgdat(pgdat) { 50 for_each_pgdat(pgdat) {
51 unsigned long flags;
52 pgdat_resize_lock(pgdat, &flags);
51 for (i = 0; i < pgdat->node_spanned_pages; ++i) { 53 for (i = 0; i < pgdat->node_spanned_pages; ++i) {
52 page = pgdat_page_nr(pgdat, i); 54 page = pgdat_page_nr(pgdat, i);
53 total++; 55 total++;
@@ -60,6 +62,7 @@ void show_mem(void)
60 else if (page_count(page)) 62 else if (page_count(page))
61 shared += page_count(page) - 1; 63 shared += page_count(page) - 1;
62 } 64 }
65 pgdat_resize_unlock(pgdat, &flags);
63 } 66 }
64 printk("%d pages of RAM\n", total); 67 printk("%d pages of RAM\n", total);
65 printk("%d pages of HIGHMEM\n",highmem); 68 printk("%d pages of HIGHMEM\n",highmem);
@@ -150,10 +153,14 @@ int __init reservedpages_count(void)
150 int reservedpages, nid, i; 153 int reservedpages, nid, i;
151 154
152 reservedpages = 0; 155 reservedpages = 0;
153 for_each_online_node(nid) 156 for_each_online_node(nid) {
157 unsigned long flags;
158 pgdat_resize_lock(NODE_DATA(nid), &flags);
154 for (i = 0 ; i < MAX_LOW_PFN(nid) - START_PFN(nid) ; i++) 159 for (i = 0 ; i < MAX_LOW_PFN(nid) - START_PFN(nid) ; i++)
155 if (PageReserved(nid_page_nr(nid, i))) 160 if (PageReserved(nid_page_nr(nid, i)))
156 reservedpages++; 161 reservedpages++;
162 pgdat_resize_unlock(NODE_DATA(nid), &flags);
163 }
157 164
158 return reservedpages; 165 return reservedpages;
159} 166}
diff --git a/arch/m32r/mm/ioremap.c b/arch/m32r/mm/ioremap.c
index 70c59055c19c..a151849a605e 100644
--- a/arch/m32r/mm/ioremap.c
+++ b/arch/m32r/mm/ioremap.c
@@ -67,7 +67,7 @@ remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned long size,
67 if (address >= end) 67 if (address >= end)
68 BUG(); 68 BUG();
69 do { 69 do {
70 pte_t * pte = pte_alloc_kernel(&init_mm, pmd, address); 70 pte_t * pte = pte_alloc_kernel(pmd, address);
71 if (!pte) 71 if (!pte)
72 return -ENOMEM; 72 return -ENOMEM;
73 remap_area_pte(pte, address, end - address, address + phys_addr, flags); 73 remap_area_pte(pte, address, end - address, address + phys_addr, flags);
@@ -90,7 +90,6 @@ remap_area_pages(unsigned long address, unsigned long phys_addr,
90 flush_cache_all(); 90 flush_cache_all();
91 if (address >= end) 91 if (address >= end)
92 BUG(); 92 BUG();
93 spin_lock(&init_mm.page_table_lock);
94 do { 93 do {
95 pmd_t *pmd; 94 pmd_t *pmd;
96 pmd = pmd_alloc(&init_mm, dir, address); 95 pmd = pmd_alloc(&init_mm, dir, address);
@@ -104,7 +103,6 @@ remap_area_pages(unsigned long address, unsigned long phys_addr,
104 address = (address + PGDIR_SIZE) & PGDIR_MASK; 103 address = (address + PGDIR_SIZE) & PGDIR_MASK;
105 dir++; 104 dir++;
106 } while (address && (address < end)); 105 } while (address && (address < end));
107 spin_unlock(&init_mm.page_table_lock);
108 flush_tlb_all(); 106 flush_tlb_all();
109 return error; 107 return error;
110} 108}
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
index ba960bbc8e6d..1dd5d18b2201 100644
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -388,33 +388,11 @@ config AMIGA_PCMCIA
388 Include support in the kernel for pcmcia on Amiga 1200 and Amiga 388 Include support in the kernel for pcmcia on Amiga 1200 and Amiga
389 600. If you intend to use pcmcia cards say Y; otherwise say N. 389 600. If you intend to use pcmcia cards say Y; otherwise say N.
390 390
391config STRAM_SWAP
392 bool "Support for ST-RAM as swap space"
393 depends on ATARI && BROKEN
394 ---help---
395 Some Atari 68k machines (including the 520STF and 1020STE) divide
396 their addressable memory into ST and TT sections. The TT section
397 (up to 512MB) is the main memory; the ST section (up to 4MB) is
398 accessible to the built-in graphics board, runs slower, and is
399 present mainly for backward compatibility with older machines.
400
401 This enables support for using (parts of) ST-RAM as swap space,
402 instead of as normal system memory. This can first enhance system
403 performance if you have lots of alternate RAM (compared to the size
404 of ST-RAM), because executable code always will reside in faster
405 memory. ST-RAM will remain as ultra-fast swap space. On the other
406 hand, it allows much improved dynamic allocations of ST-RAM buffers
407 for device driver modules (e.g. floppy, ACSI, SLM printer, DMA
408 sound). The probability that such allocations at module load time
409 fail is drastically reduced.
410
411config STRAM_PROC 391config STRAM_PROC
412 bool "ST-RAM statistics in /proc" 392 bool "ST-RAM statistics in /proc"
413 depends on ATARI 393 depends on ATARI
414 help 394 help
415 Say Y here to report ST-RAM usage statistics in /proc/stram. See 395 Say Y here to report ST-RAM usage statistics in /proc/stram.
416 the help for CONFIG_STRAM_SWAP for discussion of ST-RAM and its
417 uses.
418 396
419config HEARTBEAT 397config HEARTBEAT
420 bool "Use power LED as a heartbeat" if AMIGA || APOLLO || ATARI || MAC ||Q40 398 bool "Use power LED as a heartbeat" if AMIGA || APOLLO || ATARI || MAC ||Q40
diff --git a/arch/m68k/atari/stram.c b/arch/m68k/atari/stram.c
index 5a3c106b40c8..22e0481a5f7b 100644
--- a/arch/m68k/atari/stram.c
+++ b/arch/m68k/atari/stram.c
@@ -15,11 +15,9 @@
15#include <linux/kdev_t.h> 15#include <linux/kdev_t.h>
16#include <linux/major.h> 16#include <linux/major.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/swap.h>
19#include <linux/slab.h> 18#include <linux/slab.h>
20#include <linux/vmalloc.h> 19#include <linux/vmalloc.h>
21#include <linux/pagemap.h> 20#include <linux/pagemap.h>
22#include <linux/shm.h>
23#include <linux/bootmem.h> 21#include <linux/bootmem.h>
24#include <linux/mount.h> 22#include <linux/mount.h>
25#include <linux/blkdev.h> 23#include <linux/blkdev.h>
@@ -33,8 +31,6 @@
33#include <asm/io.h> 31#include <asm/io.h>
34#include <asm/semaphore.h> 32#include <asm/semaphore.h>
35 33
36#include <linux/swapops.h>
37
38#undef DEBUG 34#undef DEBUG
39 35
40#ifdef DEBUG 36#ifdef DEBUG
@@ -49,8 +45,7 @@
49#include <linux/proc_fs.h> 45#include <linux/proc_fs.h>
50#endif 46#endif
51 47
52/* Pre-swapping comments: 48/*
53 *
54 * ++roman: 49 * ++roman:
55 * 50 *
56 * New version of ST-Ram buffer allocation. Instead of using the 51 * New version of ST-Ram buffer allocation. Instead of using the
@@ -75,76 +70,6 @@
75 * 70 *
76 */ 71 */
77 72
78/*
79 * New Nov 1997: Use ST-RAM as swap space!
80 *
81 * In the past, there were often problems with modules that require ST-RAM
82 * buffers. Such drivers have to use __get_dma_pages(), which unfortunately
83 * often isn't very successful in allocating more than 1 page :-( [1] The net
84 * result was that most of the time you couldn't insmod such modules (ataflop,
85 * ACSI, SCSI on Falcon, Atari internal framebuffer, not to speak of acsi_slm,
86 * which needs a 1 MB buffer... :-).
87 *
88 * To overcome this limitation, ST-RAM can now be turned into a very
89 * high-speed swap space. If a request for an ST-RAM buffer comes, the kernel
90 * now tries to unswap some pages on that swap device to make some free (and
91 * contiguous) space. This works much better in comparison to
92 * __get_dma_pages(), since used swap pages can be selectively freed by either
93 * moving them to somewhere else in swap space, or by reading them back into
94 * system memory. Ok, there operation of unswapping isn't really cheap (for
95 * each page, one has to go through the page tables of all processes), but it
96 * doesn't happen that often (only when allocation ST-RAM, i.e. when loading a
97 * module that needs ST-RAM). But it at least makes it possible to load such
98 * modules!
99 *
100 * It could also be that overall system performance increases a bit due to
101 * ST-RAM swapping, since slow ST-RAM isn't used anymore for holding data or
102 * executing code in. It's then just a (very fast, compared to disk) back
103 * storage for not-so-often needed data. (But this effect must be compared
104 * with the loss of total memory...) Don't know if the effect is already
105 * visible on a TT, where the speed difference between ST- and TT-RAM isn't
106 * that dramatic, but it should on machines where TT-RAM is really much faster
107 * (e.g. Afterburner).
108 *
109 * [1]: __get_free_pages() does a fine job if you only want one page, but if
110 * you want more (contiguous) pages, it can give you such a block only if
111 * there's already a free one. The algorithm can't try to free buffers or swap
112 * out something in order to make more free space, since all that page-freeing
113 * mechanisms work "target-less", i.e. they just free something, but not in a
114 * specific place. I.e., __get_free_pages() can't do anything to free
115 * *adjacent* pages :-( This situation becomes even worse for DMA memory,
116 * since the freeing algorithms are also blind to DMA capability of pages.
117 */
118
119/* 1998-10-20: ++andreas
120 unswap_by_move disabled because it does not handle swapped shm pages.
121*/
122
123/* 2000-05-01: ++andreas
124 Integrated with bootmem. Remove all traces of unswap_by_move.
125*/
126
127#ifdef CONFIG_STRAM_SWAP
128#define ALIGN_IF_SWAP(x) PAGE_ALIGN(x)
129#else
130#define ALIGN_IF_SWAP(x) (x)
131#endif
132
133/* get index of swap page at address 'addr' */
134#define SWAP_NR(addr) (((addr) - swap_start) >> PAGE_SHIFT)
135
136/* get address of swap page #'nr' */
137#define SWAP_ADDR(nr) (swap_start + ((nr) << PAGE_SHIFT))
138
139/* get number of pages for 'n' bytes (already page-aligned) */
140#define N_PAGES(n) ((n) >> PAGE_SHIFT)
141
142/* The following two numbers define the maximum fraction of ST-RAM in total
143 * memory, below that the kernel would automatically use ST-RAM as swap
144 * space. This decision can be overridden with stram_swap= */
145#define MAX_STRAM_FRACTION_NOM 1
146#define MAX_STRAM_FRACTION_DENOM 3
147
148/* Start and end (virtual) of ST-RAM */ 73/* Start and end (virtual) of ST-RAM */
149static void *stram_start, *stram_end; 74static void *stram_start, *stram_end;
150 75
@@ -164,10 +89,9 @@ typedef struct stram_block {
164} BLOCK; 89} BLOCK;
165 90
166/* values for flags field */ 91/* values for flags field */
167#define BLOCK_FREE 0x01 /* free structure in the BLOCKs pool */ 92#define BLOCK_FREE 0x01 /* free structure in the BLOCKs pool */
168#define BLOCK_KMALLOCED 0x02 /* structure allocated by kmalloc() */ 93#define BLOCK_KMALLOCED 0x02 /* structure allocated by kmalloc() */
169#define BLOCK_GFP 0x08 /* block allocated with __get_dma_pages() */ 94#define BLOCK_GFP 0x08 /* block allocated with __get_dma_pages() */
170#define BLOCK_INSWAP 0x10 /* block allocated in swap space */
171 95
172/* list of allocated blocks */ 96/* list of allocated blocks */
173static BLOCK *alloc_list; 97static BLOCK *alloc_list;
@@ -179,60 +103,8 @@ static BLOCK *alloc_list;
179#define N_STATIC_BLOCKS 20 103#define N_STATIC_BLOCKS 20
180static BLOCK static_blocks[N_STATIC_BLOCKS]; 104static BLOCK static_blocks[N_STATIC_BLOCKS];
181 105
182#ifdef CONFIG_STRAM_SWAP
183/* max. number of bytes to use for swapping
184 * 0 = no ST-RAM swapping
185 * -1 = do swapping (to whole ST-RAM) if it's less than MAX_STRAM_FRACTION of
186 * total memory
187 */
188static int max_swap_size = -1;
189
190/* start and end of swapping area */
191static void *swap_start, *swap_end;
192
193/* The ST-RAM's swap info structure */
194static struct swap_info_struct *stram_swap_info;
195
196/* The ST-RAM's swap type */
197static int stram_swap_type;
198
199/* Semaphore for get_stram_region. */
200static DECLARE_MUTEX(stram_swap_sem);
201
202/* major and minor device number of the ST-RAM device; for the major, we use
203 * the same as Amiga z2ram, which is really similar and impossible on Atari,
204 * and for the minor a relatively odd number to avoid the user creating and
205 * using that device. */
206#define STRAM_MAJOR Z2RAM_MAJOR
207#define STRAM_MINOR 13
208
209/* Some impossible pointer value */
210#define MAGIC_FILE_P (struct file *)0xffffdead
211
212#ifdef DO_PROC
213static unsigned stat_swap_read;
214static unsigned stat_swap_write;
215static unsigned stat_swap_force;
216#endif /* DO_PROC */
217
218#endif /* CONFIG_STRAM_SWAP */
219
220/***************************** Prototypes *****************************/ 106/***************************** Prototypes *****************************/
221 107
222#ifdef CONFIG_STRAM_SWAP
223static int swap_init(void *start_mem, void *swap_data);
224static void *get_stram_region( unsigned long n_pages );
225static void free_stram_region( unsigned long offset, unsigned long n_pages
226 );
227static int in_some_region(void *addr);
228static unsigned long find_free_region( unsigned long n_pages, unsigned long
229 *total_free, unsigned long
230 *region_free );
231static void do_stram_request(request_queue_t *);
232static int stram_open( struct inode *inode, struct file *filp );
233static int stram_release( struct inode *inode, struct file *filp );
234static void reserve_region(void *start, void *end);
235#endif
236static BLOCK *add_region( void *addr, unsigned long size ); 108static BLOCK *add_region( void *addr, unsigned long size );
237static BLOCK *find_region( void *addr ); 109static BLOCK *find_region( void *addr );
238static int remove_region( BLOCK *block ); 110static int remove_region( BLOCK *block );
@@ -279,84 +151,11 @@ void __init atari_stram_init(void)
279 */ 151 */
280void __init atari_stram_reserve_pages(void *start_mem) 152void __init atari_stram_reserve_pages(void *start_mem)
281{ 153{
282#ifdef CONFIG_STRAM_SWAP
283 /* if max_swap_size is negative (i.e. no stram_swap= option given),
284 * determine at run time whether to use ST-RAM swapping */
285 if (max_swap_size < 0)
286 /* Use swapping if ST-RAM doesn't make up more than MAX_STRAM_FRACTION
287 * of total memory. In that case, the max. size is set to 16 MB,
288 * because ST-RAM can never be bigger than that.
289 * Also, never use swapping on a Hades, there's no separate ST-RAM in
290 * that machine. */
291 max_swap_size =
292 (!MACH_IS_HADES &&
293 (N_PAGES(stram_end-stram_start)*MAX_STRAM_FRACTION_DENOM <=
294 ((unsigned long)high_memory>>PAGE_SHIFT)*MAX_STRAM_FRACTION_NOM)) ? 16*1024*1024 : 0;
295 DPRINTK( "atari_stram_reserve_pages: max_swap_size = %d\n", max_swap_size );
296#endif
297
298 /* always reserve first page of ST-RAM, the first 2 kB are 154 /* always reserve first page of ST-RAM, the first 2 kB are
299 * supervisor-only! */ 155 * supervisor-only! */
300 if (!kernel_in_stram) 156 if (!kernel_in_stram)
301 reserve_bootmem (0, PAGE_SIZE); 157 reserve_bootmem (0, PAGE_SIZE);
302 158
303#ifdef CONFIG_STRAM_SWAP
304 {
305 void *swap_data;
306
307 start_mem = (void *) PAGE_ALIGN ((unsigned long) start_mem);
308 /* determine first page to use as swap: if the kernel is
309 in TT-RAM, this is the first page of (usable) ST-RAM;
310 otherwise just use the end of kernel data (= start_mem) */
311 swap_start = !kernel_in_stram ? stram_start + PAGE_SIZE : start_mem;
312 /* decrement by one page, rest of kernel assumes that first swap page
313 * is always reserved and maybe doesn't handle swp_entry == 0
314 * correctly */
315 swap_start -= PAGE_SIZE;
316 swap_end = stram_end;
317 if (swap_end-swap_start > max_swap_size)
318 swap_end = swap_start + max_swap_size;
319 DPRINTK( "atari_stram_reserve_pages: swapping enabled; "
320 "swap=%p-%p\n", swap_start, swap_end);
321
322 /* reserve some amount of memory for maintainance of
323 * swapping itself: one page for each 2048 (PAGE_SIZE/2)
324 * swap pages. (2 bytes for each page) */
325 swap_data = start_mem;
326 start_mem += ((SWAP_NR(swap_end) + PAGE_SIZE/2 - 1)
327 >> (PAGE_SHIFT-1)) << PAGE_SHIFT;
328 /* correct swap_start if necessary */
329 if (swap_start + PAGE_SIZE == swap_data)
330 swap_start = start_mem - PAGE_SIZE;
331
332 if (!swap_init( start_mem, swap_data )) {
333 printk( KERN_ERR "ST-RAM swap space initialization failed\n" );
334 max_swap_size = 0;
335 return;
336 }
337 /* reserve region for swapping meta-data */
338 reserve_region(swap_data, start_mem);
339 /* reserve swapping area itself */
340 reserve_region(swap_start + PAGE_SIZE, swap_end);
341
342 /*
343 * If the whole ST-RAM is used for swapping, there are no allocatable
344 * dma pages left. But unfortunately, some shared parts of the kernel
345 * (particularly the SCSI mid-level) call __get_dma_pages()
346 * unconditionally :-( These calls then fail, and scsi.c even doesn't
347 * check for NULL return values and just crashes. The quick fix for
348 * this (instead of doing much clean up work in the SCSI code) is to
349 * pretend all pages are DMA-able by setting mach_max_dma_address to
350 * ULONG_MAX. This doesn't change any functionality so far, since
351 * get_dma_pages() shouldn't be used on Atari anyway anymore (better
352 * use atari_stram_alloc()), and the Atari SCSI drivers don't need DMA
353 * memory. But unfortunately there's now no kind of warning (even not
354 * a NULL return value) if you use get_dma_pages() nevertheless :-(
355 * You just will get non-DMA-able memory...
356 */
357 mach_max_dma_address = 0xffffffff;
358 }
359#endif
360} 159}
361 160
362void atari_stram_mem_init_hook (void) 161void atari_stram_mem_init_hook (void)
@@ -367,7 +166,6 @@ void atari_stram_mem_init_hook (void)
367 166
368/* 167/*
369 * This is main public interface: somehow allocate a ST-RAM block 168 * This is main public interface: somehow allocate a ST-RAM block
370 * There are three strategies:
371 * 169 *
372 * - If we're before mem_init(), we have to make a static allocation. The 170 * - If we're before mem_init(), we have to make a static allocation. The
373 * region is taken in the kernel data area (if the kernel is in ST-RAM) or 171 * region is taken in the kernel data area (if the kernel is in ST-RAM) or
@@ -375,14 +173,9 @@ void atari_stram_mem_init_hook (void)
375 * rsvd_stram_* region. The ST-RAM is somewhere in the middle of kernel 173 * rsvd_stram_* region. The ST-RAM is somewhere in the middle of kernel
376 * address space in the latter case. 174 * address space in the latter case.
377 * 175 *
378 * - If mem_init() already has been called and ST-RAM swapping is enabled, 176 * - If mem_init() already has been called, try with __get_dma_pages().
379 * try to get the memory from the (pseudo) swap-space, either free already 177 * This has the disadvantage that it's very hard to get more than 1 page,
380 * or by moving some other pages out of the swap. 178 * and it is likely to fail :-(
381 *
382 * - If mem_init() already has been called, and ST-RAM swapping is not
383 * enabled, the only possibility is to try with __get_dma_pages(). This has
384 * the disadvantage that it's very hard to get more than 1 page, and it is
385 * likely to fail :-(
386 * 179 *
387 */ 180 */
388void *atari_stram_alloc(long size, const char *owner) 181void *atari_stram_alloc(long size, const char *owner)
@@ -393,27 +186,13 @@ void *atari_stram_alloc(long size, const char *owner)
393 186
394 DPRINTK("atari_stram_alloc(size=%08lx,owner=%s)\n", size, owner); 187 DPRINTK("atari_stram_alloc(size=%08lx,owner=%s)\n", size, owner);
395 188
396 size = ALIGN_IF_SWAP(size);
397 DPRINTK( "atari_stram_alloc: rounded size = %08lx\n", size );
398#ifdef CONFIG_STRAM_SWAP
399 if (max_swap_size) {
400 /* If swapping is active: make some free space in the swap
401 "device". */
402 DPRINTK( "atari_stram_alloc: after mem_init, swapping ok, "
403 "calling get_region\n" );
404 addr = get_stram_region( N_PAGES(size) );
405 flags = BLOCK_INSWAP;
406 }
407 else
408#endif
409 if (!mem_init_done) 189 if (!mem_init_done)
410 return alloc_bootmem_low(size); 190 return alloc_bootmem_low(size);
411 else { 191 else {
412 /* After mem_init() and no swapping: can only resort to 192 /* After mem_init(): can only resort to __get_dma_pages() */
413 * __get_dma_pages() */
414 addr = (void *)__get_dma_pages(GFP_KERNEL, get_order(size)); 193 addr = (void *)__get_dma_pages(GFP_KERNEL, get_order(size));
415 flags = BLOCK_GFP; 194 flags = BLOCK_GFP;
416 DPRINTK( "atari_stram_alloc: after mem_init, swapping off, " 195 DPRINTK( "atari_stram_alloc: after mem_init, "
417 "get_pages=%p\n", addr ); 196 "get_pages=%p\n", addr );
418 } 197 }
419 198
@@ -422,12 +201,7 @@ void *atari_stram_alloc(long size, const char *owner)
422 /* out of memory for BLOCK structure :-( */ 201 /* out of memory for BLOCK structure :-( */
423 DPRINTK( "atari_stram_alloc: out of mem for BLOCK -- " 202 DPRINTK( "atari_stram_alloc: out of mem for BLOCK -- "
424 "freeing again\n" ); 203 "freeing again\n" );
425#ifdef CONFIG_STRAM_SWAP 204 free_pages((unsigned long)addr, get_order(size));
426 if (flags == BLOCK_INSWAP)
427 free_stram_region( SWAP_NR(addr), N_PAGES(size) );
428 else
429#endif
430 free_pages((unsigned long)addr, get_order(size));
431 return( NULL ); 205 return( NULL );
432 } 206 }
433 block->owner = owner; 207 block->owner = owner;
@@ -451,25 +225,12 @@ void atari_stram_free( void *addr )
451 DPRINTK( "atari_stram_free: found block (%p): size=%08lx, owner=%s, " 225 DPRINTK( "atari_stram_free: found block (%p): size=%08lx, owner=%s, "
452 "flags=%02x\n", block, block->size, block->owner, block->flags ); 226 "flags=%02x\n", block, block->size, block->owner, block->flags );
453 227
454#ifdef CONFIG_STRAM_SWAP 228 if (!(block->flags & BLOCK_GFP))
455 if (!max_swap_size) {
456#endif
457 if (block->flags & BLOCK_GFP) {
458 DPRINTK("atari_stram_free: is kmalloced, order_size=%d\n",
459 get_order(block->size));
460 free_pages((unsigned long)addr, get_order(block->size));
461 }
462 else
463 goto fail;
464#ifdef CONFIG_STRAM_SWAP
465 }
466 else if (block->flags & BLOCK_INSWAP) {
467 DPRINTK( "atari_stram_free: is swap-alloced\n" );
468 free_stram_region( SWAP_NR(block->start), N_PAGES(block->size) );
469 }
470 else
471 goto fail; 229 goto fail;
472#endif 230
231 DPRINTK("atari_stram_free: is kmalloced, order_size=%d\n",
232 get_order(block->size));
233 free_pages((unsigned long)addr, get_order(block->size));
473 remove_region( block ); 234 remove_region( block );
474 return; 235 return;
475 236
@@ -478,612 +239,6 @@ void atari_stram_free( void *addr )
478 "(called from %p)\n", addr, __builtin_return_address(0) ); 239 "(called from %p)\n", addr, __builtin_return_address(0) );
479} 240}
480 241
481
482#ifdef CONFIG_STRAM_SWAP
483
484
485/* ------------------------------------------------------------------------ */
486/* Main Swapping Functions */
487/* ------------------------------------------------------------------------ */
488
489
490/*
491 * Initialize ST-RAM swap device
492 * (lots copied and modified from sys_swapon() in mm/swapfile.c)
493 */
494static int __init swap_init(void *start_mem, void *swap_data)
495{
496 static struct dentry fake_dentry;
497 static struct vfsmount fake_vfsmnt;
498 struct swap_info_struct *p;
499 struct inode swap_inode;
500 unsigned int type;
501 void *addr;
502 int i, j, k, prev;
503
504 DPRINTK("swap_init(start_mem=%p, swap_data=%p)\n",
505 start_mem, swap_data);
506
507 /* need at least one page for swapping to (and this also isn't very
508 * much... :-) */
509 if (swap_end - swap_start < 2*PAGE_SIZE) {
510 printk( KERN_WARNING "stram_swap_init: swap space too small\n" );
511 return( 0 );
512 }
513
514 /* find free slot in swap_info */
515 for( p = swap_info, type = 0; type < nr_swapfiles; type++, p++ )
516 if (!(p->flags & SWP_USED))
517 break;
518 if (type >= MAX_SWAPFILES) {
519 printk( KERN_WARNING "stram_swap_init: max. number of "
520 "swap devices exhausted\n" );
521 return( 0 );
522 }
523 if (type >= nr_swapfiles)
524 nr_swapfiles = type+1;
525
526 stram_swap_info = p;
527 stram_swap_type = type;
528
529 /* fake some dir cache entries to give us some name in /dev/swaps */
530 fake_dentry.d_parent = &fake_dentry;
531 fake_dentry.d_name.name = "stram (internal)";
532 fake_dentry.d_name.len = 16;
533 fake_vfsmnt.mnt_parent = &fake_vfsmnt;
534
535 p->flags = SWP_USED;
536 p->swap_file = &fake_dentry;
537 p->swap_vfsmnt = &fake_vfsmnt;
538 p->swap_map = swap_data;
539 p->cluster_nr = 0;
540 p->next = -1;
541 p->prio = 0x7ff0; /* a rather high priority, but not the higest
542 * to give the user a chance to override */
543
544 /* call stram_open() directly, avoids at least the overhead in
545 * constructing a dummy file structure... */
546 swap_inode.i_rdev = MKDEV( STRAM_MAJOR, STRAM_MINOR );
547 stram_open( &swap_inode, MAGIC_FILE_P );
548 p->max = SWAP_NR(swap_end);
549
550 /* initialize swap_map: set regions that are already allocated or belong
551 * to kernel data space to SWAP_MAP_BAD, otherwise to free */
552 j = 0; /* # of free pages */
553 k = 0; /* # of already allocated pages (from pre-mem_init stram_alloc()) */
554 p->lowest_bit = 0;
555 p->highest_bit = 0;
556 for( i = 1, addr = SWAP_ADDR(1); i < p->max;
557 i++, addr += PAGE_SIZE ) {
558 if (in_some_region( addr )) {
559 p->swap_map[i] = SWAP_MAP_BAD;
560 ++k;
561 }
562 else if (kernel_in_stram && addr < start_mem ) {
563 p->swap_map[i] = SWAP_MAP_BAD;
564 }
565 else {
566 p->swap_map[i] = 0;
567 ++j;
568 if (!p->lowest_bit) p->lowest_bit = i;
569 p->highest_bit = i;
570 }
571 }
572 /* first page always reserved (and doesn't really belong to swap space) */
573 p->swap_map[0] = SWAP_MAP_BAD;
574
575 /* now swapping to this device ok */
576 p->pages = j + k;
577 swap_list_lock();
578 nr_swap_pages += j;
579 p->flags = SWP_WRITEOK;
580
581 /* insert swap space into swap_list */
582 prev = -1;
583 for (i = swap_list.head; i >= 0; i = swap_info[i].next) {
584 if (p->prio >= swap_info[i].prio) {
585 break;
586 }
587 prev = i;
588 }
589 p->next = i;
590 if (prev < 0) {
591 swap_list.head = swap_list.next = p - swap_info;
592 } else {
593 swap_info[prev].next = p - swap_info;
594 }
595 swap_list_unlock();
596
597 printk( KERN_INFO "Using %dk (%d pages) of ST-RAM as swap space.\n",
598 p->pages << 2, p->pages );
599 return( 1 );
600}
601
602
603/*
604 * The swap entry has been read in advance, and we return 1 to indicate
605 * that the page has been used or is no longer needed.
606 *
607 * Always set the resulting pte to be nowrite (the same as COW pages
608 * after one process has exited). We don't know just how many PTEs will
609 * share this swap entry, so be cautious and let do_wp_page work out
610 * what to do if a write is requested later.
611 */
612static inline void unswap_pte(struct vm_area_struct * vma, unsigned long
613 address, pte_t *dir, swp_entry_t entry,
614 struct page *page)
615{
616 pte_t pte = *dir;
617
618 if (pte_none(pte))
619 return;
620 if (pte_present(pte)) {
621 /* If this entry is swap-cached, then page must already
622 hold the right address for any copies in physical
623 memory */
624 if (pte_page(pte) != page)
625 return;
626 /* We will be removing the swap cache in a moment, so... */
627 set_pte(dir, pte_mkdirty(pte));
628 return;
629 }
630 if (pte_val(pte) != entry.val)
631 return;
632
633 DPRINTK("unswap_pte: replacing entry %08lx by new page %p",
634 entry.val, page);
635 set_pte(dir, pte_mkdirty(mk_pte(page, vma->vm_page_prot)));
636 swap_free(entry);
637 get_page(page);
638 inc_mm_counter(vma->vm_mm, rss);
639}
640
641static inline void unswap_pmd(struct vm_area_struct * vma, pmd_t *dir,
642 unsigned long address, unsigned long size,
643 unsigned long offset, swp_entry_t entry,
644 struct page *page)
645{
646 pte_t * pte;
647 unsigned long end;
648
649 if (pmd_none(*dir))
650 return;
651 if (pmd_bad(*dir)) {
652 pmd_ERROR(*dir);
653 pmd_clear(dir);
654 return;
655 }
656 pte = pte_offset_kernel(dir, address);
657 offset += address & PMD_MASK;
658 address &= ~PMD_MASK;
659 end = address + size;
660 if (end > PMD_SIZE)
661 end = PMD_SIZE;
662 do {
663 unswap_pte(vma, offset+address-vma->vm_start, pte, entry, page);
664 address += PAGE_SIZE;
665 pte++;
666 } while (address < end);
667}
668
669static inline void unswap_pgd(struct vm_area_struct * vma, pgd_t *dir,
670 unsigned long address, unsigned long size,
671 swp_entry_t entry, struct page *page)
672{
673 pmd_t * pmd;
674 unsigned long offset, end;
675
676 if (pgd_none(*dir))
677 return;
678 if (pgd_bad(*dir)) {
679 pgd_ERROR(*dir);
680 pgd_clear(dir);
681 return;
682 }
683 pmd = pmd_offset(dir, address);
684 offset = address & PGDIR_MASK;
685 address &= ~PGDIR_MASK;
686 end = address + size;
687 if (end > PGDIR_SIZE)
688 end = PGDIR_SIZE;
689 do {
690 unswap_pmd(vma, pmd, address, end - address, offset, entry,
691 page);
692 address = (address + PMD_SIZE) & PMD_MASK;
693 pmd++;
694 } while (address < end);
695}
696
697static void unswap_vma(struct vm_area_struct * vma, pgd_t *pgdir,
698 swp_entry_t entry, struct page *page)
699{
700 unsigned long start = vma->vm_start, end = vma->vm_end;
701
702 do {
703 unswap_pgd(vma, pgdir, start, end - start, entry, page);
704 start = (start + PGDIR_SIZE) & PGDIR_MASK;
705 pgdir++;
706 } while (start < end);
707}
708
709static void unswap_process(struct mm_struct * mm, swp_entry_t entry,
710 struct page *page)
711{
712 struct vm_area_struct* vma;
713
714 /*
715 * Go through process' page directory.
716 */
717 if (!mm)
718 return;
719 for (vma = mm->mmap; vma; vma = vma->vm_next) {
720 pgd_t * pgd = pgd_offset(mm, vma->vm_start);
721 unswap_vma(vma, pgd, entry, page);
722 }
723}
724
725
726static int unswap_by_read(unsigned short *map, unsigned long max,
727 unsigned long start, unsigned long n_pages)
728{
729 struct task_struct *p;
730 struct page *page;
731 swp_entry_t entry;
732 unsigned long i;
733
734 DPRINTK( "unswapping %lu..%lu by reading in\n",
735 start, start+n_pages-1 );
736
737 for( i = start; i < start+n_pages; ++i ) {
738 if (map[i] == SWAP_MAP_BAD) {
739 printk( KERN_ERR "get_stram_region: page %lu already "
740 "reserved??\n", i );
741 continue;
742 }
743
744 if (map[i]) {
745 entry = swp_entry(stram_swap_type, i);
746 DPRINTK("unswap: map[i=%lu]=%u nr_swap=%ld\n",
747 i, map[i], nr_swap_pages);
748
749 swap_device_lock(stram_swap_info);
750 map[i]++;
751 swap_device_unlock(stram_swap_info);
752 /* Get a page for the entry, using the existing
753 swap cache page if there is one. Otherwise,
754 get a clean page and read the swap into it. */
755 page = read_swap_cache_async(entry, NULL, 0);
756 if (!page) {
757 swap_free(entry);
758 return -ENOMEM;
759 }
760 read_lock(&tasklist_lock);
761 for_each_process(p)
762 unswap_process(p->mm, entry, page);
763 read_unlock(&tasklist_lock);
764 shmem_unuse(entry, page);
765 /* Now get rid of the extra reference to the
766 temporary page we've been using. */
767 if (PageSwapCache(page))
768 delete_from_swap_cache(page);
769 __free_page(page);
770 #ifdef DO_PROC
771 stat_swap_force++;
772 #endif
773 }
774
775 DPRINTK( "unswap: map[i=%lu]=%u nr_swap=%ld\n",
776 i, map[i], nr_swap_pages );
777 swap_list_lock();
778 swap_device_lock(stram_swap_info);
779 map[i] = SWAP_MAP_BAD;
780 if (stram_swap_info->lowest_bit == i)
781 stram_swap_info->lowest_bit++;
782 if (stram_swap_info->highest_bit == i)
783 stram_swap_info->highest_bit--;
784 --nr_swap_pages;
785 swap_device_unlock(stram_swap_info);
786 swap_list_unlock();
787 }
788
789 return 0;
790}
791
792/*
793 * reserve a region in ST-RAM swap space for an allocation
794 */
795static void *get_stram_region( unsigned long n_pages )
796{
797 unsigned short *map = stram_swap_info->swap_map;
798 unsigned long max = stram_swap_info->max;
799 unsigned long start, total_free, region_free;
800 int err;
801 void *ret = NULL;
802
803 DPRINTK( "get_stram_region(n_pages=%lu)\n", n_pages );
804
805 down(&stram_swap_sem);
806
807 /* disallow writing to the swap device now */
808 stram_swap_info->flags = SWP_USED;
809
810 /* find a region of n_pages pages in the swap space including as much free
811 * pages as possible (and excluding any already-reserved pages). */
812 if (!(start = find_free_region( n_pages, &total_free, &region_free )))
813 goto end;
814 DPRINTK( "get_stram_region: region starts at %lu, has %lu free pages\n",
815 start, region_free );
816
817 err = unswap_by_read(map, max, start, n_pages);
818 if (err)
819 goto end;
820
821 ret = SWAP_ADDR(start);
822 end:
823 /* allow using swap device again */
824 stram_swap_info->flags = SWP_WRITEOK;
825 up(&stram_swap_sem);
826 DPRINTK( "get_stram_region: returning %p\n", ret );
827 return( ret );
828}
829
830
831/*
832 * free a reserved region in ST-RAM swap space
833 */
834static void free_stram_region( unsigned long offset, unsigned long n_pages )
835{
836 unsigned short *map = stram_swap_info->swap_map;
837
838 DPRINTK( "free_stram_region(offset=%lu,n_pages=%lu)\n", offset, n_pages );
839
840 if (offset < 1 || offset + n_pages > stram_swap_info->max) {
841 printk( KERN_ERR "free_stram_region: Trying to free non-ST-RAM\n" );
842 return;
843 }
844
845 swap_list_lock();
846 swap_device_lock(stram_swap_info);
847 /* un-reserve the freed pages */
848 for( ; n_pages > 0; ++offset, --n_pages ) {
849 if (map[offset] != SWAP_MAP_BAD)
850 printk( KERN_ERR "free_stram_region: Swap page %lu was not "
851 "reserved\n", offset );
852 map[offset] = 0;
853 }
854
855 /* update swapping meta-data */
856 if (offset < stram_swap_info->lowest_bit)
857 stram_swap_info->lowest_bit = offset;
858 if (offset+n_pages-1 > stram_swap_info->highest_bit)
859 stram_swap_info->highest_bit = offset+n_pages-1;
860 if (stram_swap_info->prio > swap_info[swap_list.next].prio)
861 swap_list.next = swap_list.head;
862 nr_swap_pages += n_pages;
863 swap_device_unlock(stram_swap_info);
864 swap_list_unlock();
865}
866
867
868/* ------------------------------------------------------------------------ */
869/* Utility Functions for Swapping */
870/* ------------------------------------------------------------------------ */
871
872
873/* is addr in some of the allocated regions? */
874static int in_some_region(void *addr)
875{
876 BLOCK *p;
877
878 for( p = alloc_list; p; p = p->next ) {
879 if (p->start <= addr && addr < p->start + p->size)
880 return( 1 );
881 }
882 return( 0 );
883}
884
885
886static unsigned long find_free_region(unsigned long n_pages,
887 unsigned long *total_free,
888 unsigned long *region_free)
889{
890 unsigned short *map = stram_swap_info->swap_map;
891 unsigned long max = stram_swap_info->max;
892 unsigned long head, tail, max_start;
893 long nfree, max_free;
894
895 /* first scan the swap space for a suitable place for the allocation */
896 head = 1;
897 max_start = 0;
898 max_free = -1;
899 *total_free = 0;
900
901 start_over:
902 /* increment tail until final window size reached, and count free pages */
903 nfree = 0;
904 for( tail = head; tail-head < n_pages && tail < max; ++tail ) {
905 if (map[tail] == SWAP_MAP_BAD) {
906 head = tail+1;
907 goto start_over;
908 }
909 if (!map[tail]) {
910 ++nfree;
911 ++*total_free;
912 }
913 }
914 if (tail-head < n_pages)
915 goto out;
916 if (nfree > max_free) {
917 max_start = head;
918 max_free = nfree;
919 if (max_free >= n_pages)
920 /* don't need more free pages... :-) */
921 goto out;
922 }
923
924 /* now shift the window and look for the area where as much pages as
925 * possible are free */
926 while( tail < max ) {
927 nfree -= (map[head++] == 0);
928 if (map[tail] == SWAP_MAP_BAD) {
929 head = tail+1;
930 goto start_over;
931 }
932 if (!map[tail]) {
933 ++nfree;
934 ++*total_free;
935 }
936 ++tail;
937 if (nfree > max_free) {
938 max_start = head;
939 max_free = nfree;
940 if (max_free >= n_pages)
941 /* don't need more free pages... :-) */
942 goto out;
943 }
944 }
945
946 out:
947 if (max_free < 0) {
948 printk( KERN_NOTICE "get_stram_region: ST-RAM too full or fragmented "
949 "-- can't allocate %lu pages\n", n_pages );
950 return( 0 );
951 }
952
953 *region_free = max_free;
954 return( max_start );
955}
956
957
958/* setup parameters from command line */
959void __init stram_swap_setup(char *str, int *ints)
960{
961 if (ints[0] >= 1)
962 max_swap_size = ((ints[1] < 0 ? 0 : ints[1]) * 1024) & PAGE_MASK;
963}
964
965
966/* ------------------------------------------------------------------------ */
967/* ST-RAM device */
968/* ------------------------------------------------------------------------ */
969
970static int refcnt;
971
972static void do_stram_request(request_queue_t *q)
973{
974 struct request *req;
975
976 while ((req = elv_next_request(q)) != NULL) {
977 void *start = swap_start + (req->sector << 9);
978 unsigned long len = req->current_nr_sectors << 9;
979 if ((start + len) > swap_end) {
980 printk( KERN_ERR "stram: bad access beyond end of device: "
981 "block=%ld, count=%d\n",
982 req->sector,
983 req->current_nr_sectors );
984 end_request(req, 0);
985 continue;
986 }
987
988 if (req->cmd == READ) {
989 memcpy(req->buffer, start, len);
990#ifdef DO_PROC
991 stat_swap_read += N_PAGES(len);
992#endif
993 }
994 else {
995 memcpy(start, req->buffer, len);
996#ifdef DO_PROC
997 stat_swap_write += N_PAGES(len);
998#endif
999 }
1000 end_request(req, 1);
1001 }
1002}
1003
1004
1005static int stram_open( struct inode *inode, struct file *filp )
1006{
1007 if (filp != MAGIC_FILE_P) {
1008 printk( KERN_NOTICE "Only kernel can open ST-RAM device\n" );
1009 return( -EPERM );
1010 }
1011 if (refcnt)
1012 return( -EBUSY );
1013 ++refcnt;
1014 return( 0 );
1015}
1016
1017static int stram_release( struct inode *inode, struct file *filp )
1018{
1019 if (filp != MAGIC_FILE_P) {
1020 printk( KERN_NOTICE "Only kernel can close ST-RAM device\n" );
1021 return( -EPERM );
1022 }
1023 if (refcnt > 0)
1024 --refcnt;
1025 return( 0 );
1026}
1027
1028
1029static struct block_device_operations stram_fops = {
1030 .open = stram_open,
1031 .release = stram_release,
1032};
1033
1034static struct gendisk *stram_disk;
1035static struct request_queue *stram_queue;
1036static DEFINE_SPINLOCK(stram_lock);
1037
1038int __init stram_device_init(void)
1039{
1040 if (!MACH_IS_ATARI)
1041 /* no point in initializing this, I hope */
1042 return -ENXIO;
1043
1044 if (!max_swap_size)
1045 /* swapping not enabled */
1046 return -ENXIO;
1047 stram_disk = alloc_disk(1);
1048 if (!stram_disk)
1049 return -ENOMEM;
1050
1051 if (register_blkdev(STRAM_MAJOR, "stram")) {
1052 put_disk(stram_disk);
1053 return -ENXIO;
1054 }
1055
1056 stram_queue = blk_init_queue(do_stram_request, &stram_lock);
1057 if (!stram_queue) {
1058 unregister_blkdev(STRAM_MAJOR, "stram");
1059 put_disk(stram_disk);
1060 return -ENOMEM;
1061 }
1062
1063 stram_disk->major = STRAM_MAJOR;
1064 stram_disk->first_minor = STRAM_MINOR;
1065 stram_disk->fops = &stram_fops;
1066 stram_disk->queue = stram_queue;
1067 sprintf(stram_disk->disk_name, "stram");
1068 set_capacity(stram_disk, (swap_end - swap_start)/512);
1069 add_disk(stram_disk);
1070 return 0;
1071}
1072
1073
1074
1075/* ------------------------------------------------------------------------ */
1076/* Misc Utility Functions */
1077/* ------------------------------------------------------------------------ */
1078
1079/* reserve a range of pages */
1080static void reserve_region(void *start, void *end)
1081{
1082 reserve_bootmem (virt_to_phys(start), end - start);
1083}
1084
1085#endif /* CONFIG_STRAM_SWAP */
1086
1087 242
1088/* ------------------------------------------------------------------------ */ 243/* ------------------------------------------------------------------------ */
1089/* Region Management */ 244/* Region Management */
@@ -1173,50 +328,9 @@ int get_stram_list( char *buf )
1173{ 328{
1174 int len = 0; 329 int len = 0;
1175 BLOCK *p; 330 BLOCK *p;
1176#ifdef CONFIG_STRAM_SWAP
1177 int i;
1178 unsigned short *map = stram_swap_info->swap_map;
1179 unsigned long max = stram_swap_info->max;
1180 unsigned free = 0, used = 0, rsvd = 0;
1181#endif
1182 331
1183#ifdef CONFIG_STRAM_SWAP 332 PRINT_PROC("Total ST-RAM: %8u kB\n",
1184 if (max_swap_size) {
1185 for( i = 1; i < max; ++i ) {
1186 if (!map[i])
1187 ++free;
1188 else if (map[i] == SWAP_MAP_BAD)
1189 ++rsvd;
1190 else
1191 ++used;
1192 }
1193 PRINT_PROC(
1194 "Total ST-RAM: %8u kB\n"
1195 "Total ST-RAM swap: %8lu kB\n"
1196 "Free swap: %8u kB\n"
1197 "Used swap: %8u kB\n"
1198 "Allocated swap: %8u kB\n"
1199 "Swap Reads: %8u\n"
1200 "Swap Writes: %8u\n"
1201 "Swap Forced Reads: %8u\n",
1202 (stram_end - stram_start) >> 10,
1203 (max-1) << (PAGE_SHIFT-10),
1204 free << (PAGE_SHIFT-10),
1205 used << (PAGE_SHIFT-10),
1206 rsvd << (PAGE_SHIFT-10),
1207 stat_swap_read,
1208 stat_swap_write,
1209 stat_swap_force );
1210 }
1211 else {
1212#endif
1213 PRINT_PROC( "ST-RAM swapping disabled\n" );
1214 PRINT_PROC("Total ST-RAM: %8u kB\n",
1215 (stram_end - stram_start) >> 10); 333 (stram_end - stram_start) >> 10);
1216#ifdef CONFIG_STRAM_SWAP
1217 }
1218#endif
1219
1220 PRINT_PROC( "Allocated regions:\n" ); 334 PRINT_PROC( "Allocated regions:\n" );
1221 for( p = alloc_list; p; p = p->next ) { 335 for( p = alloc_list; p; p = p->next ) {
1222 if (len + 50 >= PAGE_SIZE) 336 if (len + 50 >= PAGE_SIZE)
@@ -1227,8 +341,6 @@ int get_stram_list( char *buf )
1227 p->owner); 341 p->owner);
1228 if (p->flags & BLOCK_GFP) 342 if (p->flags & BLOCK_GFP)
1229 PRINT_PROC( "page-alloced)\n" ); 343 PRINT_PROC( "page-alloced)\n" );
1230 else if (p->flags & BLOCK_INSWAP)
1231 PRINT_PROC( "in swap)\n" );
1232 else 344 else
1233 PRINT_PROC( "??)\n" ); 345 PRINT_PROC( "??)\n" );
1234 } 346 }
diff --git a/arch/m68k/kernel/ptrace.c b/arch/m68k/kernel/ptrace.c
index 8ed1b01a6a87..f7f1d2e5b90b 100644
--- a/arch/m68k/kernel/ptrace.c
+++ b/arch/m68k/kernel/ptrace.c
@@ -121,7 +121,7 @@ void ptrace_disable(struct task_struct *child)
121 child->thread.work.syscall_trace = 0; 121 child->thread.work.syscall_trace = 0;
122} 122}
123 123
124asmlinkage int sys_ptrace(long request, long pid, long addr, long data) 124asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
125{ 125{
126 struct task_struct *child; 126 struct task_struct *child;
127 unsigned long tmp; 127 unsigned long tmp;
diff --git a/arch/m68k/kernel/time.c b/arch/m68k/kernel/time.c
index 4ec95e3cb874..98e4b1adfa29 100644
--- a/arch/m68k/kernel/time.c
+++ b/arch/m68k/kernel/time.c
@@ -27,10 +27,6 @@
27#include <linux/timex.h> 27#include <linux/timex.h>
28#include <linux/profile.h> 28#include <linux/profile.h>
29 29
30u64 jiffies_64 = INITIAL_JIFFIES;
31
32EXPORT_SYMBOL(jiffies_64);
33
34static inline int set_rtc_mmss(unsigned long nowtime) 30static inline int set_rtc_mmss(unsigned long nowtime)
35{ 31{
36 if (mach_set_clock_mmss) 32 if (mach_set_clock_mmss)
diff --git a/arch/m68k/mm/kmap.c b/arch/m68k/mm/kmap.c
index 5dcb3fa35ea9..fe2383e36b06 100644
--- a/arch/m68k/mm/kmap.c
+++ b/arch/m68k/mm/kmap.c
@@ -201,7 +201,7 @@ void *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag)
201 virtaddr += PTRTREESIZE; 201 virtaddr += PTRTREESIZE;
202 size -= PTRTREESIZE; 202 size -= PTRTREESIZE;
203 } else { 203 } else {
204 pte_dir = pte_alloc_kernel(&init_mm, pmd_dir, virtaddr); 204 pte_dir = pte_alloc_kernel(pmd_dir, virtaddr);
205 if (!pte_dir) { 205 if (!pte_dir) {
206 printk("ioremap: no mem for pte_dir\n"); 206 printk("ioremap: no mem for pte_dir\n");
207 return NULL; 207 return NULL;
diff --git a/arch/m68k/sun3x/dvma.c b/arch/m68k/sun3x/dvma.c
index 32e55adfeb8e..117481e86305 100644
--- a/arch/m68k/sun3x/dvma.c
+++ b/arch/m68k/sun3x/dvma.c
@@ -116,7 +116,7 @@ inline int dvma_map_cpu(unsigned long kaddr,
116 pte_t *pte; 116 pte_t *pte;
117 unsigned long end3; 117 unsigned long end3;
118 118
119 if((pte = pte_alloc_kernel(&init_mm, pmd, vaddr)) == NULL) { 119 if((pte = pte_alloc_kernel(pmd, vaddr)) == NULL) {
120 ret = -ENOMEM; 120 ret = -ENOMEM;
121 goto out; 121 goto out;
122 } 122 }
diff --git a/arch/m68knommu/kernel/ptrace.c b/arch/m68knommu/kernel/ptrace.c
index 9724e1cd82e5..621d7b91ccfe 100644
--- a/arch/m68knommu/kernel/ptrace.c
+++ b/arch/m68knommu/kernel/ptrace.c
@@ -101,7 +101,7 @@ void ptrace_disable(struct task_struct *child)
101 put_reg(child, PT_SR, tmp); 101 put_reg(child, PT_SR, tmp);
102} 102}
103 103
104asmlinkage int sys_ptrace(long request, long pid, long addr, long data) 104asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
105{ 105{
106 struct task_struct *child; 106 struct task_struct *child;
107 int ret; 107 int ret;
diff --git a/arch/m68knommu/kernel/time.c b/arch/m68knommu/kernel/time.c
index b17c1ecba966..b9d8abb45430 100644
--- a/arch/m68knommu/kernel/time.c
+++ b/arch/m68knommu/kernel/time.c
@@ -27,10 +27,6 @@
27 27
28#define TICK_SIZE (tick_nsec / 1000) 28#define TICK_SIZE (tick_nsec / 1000)
29 29
30u64 jiffies_64 = INITIAL_JIFFIES;
31
32EXPORT_SYMBOL(jiffies_64);
33
34extern unsigned long wall_jiffies; 30extern unsigned long wall_jiffies;
35 31
36 32
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 4cd724c05700..0097a0d53b3b 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -4,216 +4,147 @@ config MIPS
4 # Horrible source of confusion. Die, die, die ... 4 # Horrible source of confusion. Die, die, die ...
5 select EMBEDDED 5 select EMBEDDED
6 6
7# shouldn't it be per-subarchitecture?
8config ARCH_MAY_HAVE_PC_FDC
9 bool
10 default y
11
12mainmenu "Linux/MIPS Kernel Configuration" 7mainmenu "Linux/MIPS Kernel Configuration"
13 8
14source "init/Kconfig" 9source "init/Kconfig"
15 10
16config SYS_SUPPORTS_32BIT_KERNEL
17 bool
18config SYS_SUPPORTS_64BIT_KERNEL
19 bool
20config CPU_SUPPORTS_32BIT_KERNEL
21 bool
22config CPU_SUPPORTS_64BIT_KERNEL
23 bool
24
25menu "Kernel type"
26
27choice
28
29 prompt "Kernel code model"
30 help
31 You should only select this option if you have a workload that
32 actually benefits from 64-bit processing or if your machine has
33 large memory. You will only be presented a single option in this
34 menu if your system does not support both 32-bit and 64-bit kernels.
35
36config 32BIT
37 bool "32-bit kernel"
38 depends on CPU_SUPPORTS_32BIT_KERNEL && SYS_SUPPORTS_32BIT_KERNEL
39 select TRAD_SIGNALS
40 help
41 Select this option if you want to build a 32-bit kernel.
42
43config 64BIT
44 bool "64-bit kernel"
45 depends on CPU_SUPPORTS_64BIT_KERNEL && SYS_SUPPORTS_64BIT_KERNEL
46 help
47 Select this option if you want to build a 64-bit kernel.
48
49endchoice
50
51endmenu
52
53menu "Machine selection" 11menu "Machine selection"
54 12
55config MACH_JAZZ 13choice
56 bool "Support for the Jazz family of machines" 14 prompt "System type"
57 select ARC 15 default SGI_IP22
58 select ARC32
59 select GENERIC_ISA_DMA
60 select I8259
61 select ISA
62 select SYS_SUPPORTS_32BIT_KERNEL
63 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
64 help
65 This a family of machines based on the MIPS R4030 chipset which was
66 used by several vendors to build RISC/os and Windows NT workstations.
67 Members include the Acer PICA, MIPS Magnum 4000, MIPS Millenium and
68 Olivetti M700-10 workstations.
69 16
70config ACER_PICA_61 17config MIPS_MTX1
71 bool "Support for Acer PICA 1 chipset (EXPERIMENTAL)" 18 bool "Support for 4G Systems MTX-1 board"
72 depends on MACH_JAZZ && EXPERIMENTAL
73 select DMA_NONCOHERENT 19 select DMA_NONCOHERENT
74 help 20 select HW_HAS_PCI
75 This is a machine with a R4400 133/150 MHz CPU. To compile a Linux 21 select SOC_AU1500
76 kernel that runs on these, say Y here. For details about Linux on 22 select SYS_HAS_CPU_MIPS32_R1
77 the MIPS architecture, check out the Linux/MIPS FAQ on the WWW at 23 select SYS_SUPPORTS_LITTLE_ENDIAN
78 <http://www.linux-mips.org/>.
79 24
80config MIPS_MAGNUM_4000 25config MIPS_BOSPORUS
81 bool "Support for MIPS Magnum 4000" 26 bool "AMD Alchemy Bosporus board"
82 depends on MACH_JAZZ 27 select SOC_AU1500
83 select DMA_NONCOHERENT 28 select DMA_NONCOHERENT
84 help 29 select SYS_HAS_CPU_MIPS32_R1
85 This is a machine with a R4000 100 MHz CPU. To compile a Linux 30 select SYS_SUPPORTS_LITTLE_ENDIAN
86 kernel that runs on these, say Y here. For details about Linux on
87 the MIPS architecture, check out the Linux/MIPS FAQ on the WWW at
88 <http://www.linux-mips.org/>.
89 31
90config OLIVETTI_M700 32config MIPS_PB1000
91 bool "Support for Olivetti M700-10" 33 bool "AMD Alchemy PB1000 board"
92 depends on MACH_JAZZ 34 select SOC_AU1000
93 select DMA_NONCOHERENT 35 select DMA_NONCOHERENT
94 help 36 select HW_HAS_PCI
95 This is a machine with a R4000 100 MHz CPU. To compile a Linux 37 select SWAP_IO_SPACE
96 kernel that runs on these, say Y here. For details about Linux on 38 select SYS_HAS_CPU_MIPS32_R1
97 the MIPS architecture, check out the Linux/MIPS FAQ on the WWW at 39 select SYS_SUPPORTS_LITTLE_ENDIAN
98 <http://www.linux-mips.org/>.
99
100config MACH_VR41XX
101 bool "Support for NEC VR4100 series based machines"
102 select SYS_SUPPORTS_32BIT_KERNEL
103 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
104 40
105config NEC_CMBVR4133 41config MIPS_PB1100
106 bool "Support for NEC CMB-VR4133" 42 bool "AMD Alchemy PB1100 board"
107 depends on MACH_VR41XX 43 select SOC_AU1100
108 select CPU_VR41XX
109 select DMA_NONCOHERENT 44 select DMA_NONCOHERENT
110 select IRQ_CPU
111 select HW_HAS_PCI 45 select HW_HAS_PCI
46 select SWAP_IO_SPACE
47 select SYS_HAS_CPU_MIPS32_R1
48 select SYS_SUPPORTS_LITTLE_ENDIAN
112 49
113config ROCKHOPPER 50config MIPS_PB1500
114 bool "Support for Rockhopper baseboard" 51 bool "AMD Alchemy PB1500 board"
115 depends on NEC_CMBVR4133 52 select SOC_AU1500
116 select I8259 53 select DMA_NONCOHERENT
117 select HAVE_STD_PC_SERIAL_PORT 54 select HW_HAS_PCI
55 select SYS_HAS_CPU_MIPS32_R1
56 select SYS_SUPPORTS_LITTLE_ENDIAN
118 57
119config CASIO_E55 58config MIPS_PB1550
120 bool "Support for CASIO CASSIOPEIA E-10/15/55/65" 59 bool "AMD Alchemy PB1550 board"
121 depends on MACH_VR41XX 60 select SOC_AU1550
122 select CPU_LITTLE_ENDIAN
123 select DMA_NONCOHERENT 61 select DMA_NONCOHERENT
124 select IRQ_CPU 62 select HW_HAS_PCI
125 select ISA 63 select MIPS_DISABLE_OBSOLETE_IDE
64 select SYS_HAS_CPU_MIPS32_R1
65 select SYS_SUPPORTS_LITTLE_ENDIAN
126 66
127config IBM_WORKPAD 67config MIPS_PB1200
128 bool "Support for IBM WorkPad z50" 68 bool "AMD Alchemy PB1200 board"
129 depends on MACH_VR41XX 69 select SOC_AU1200
130 select CPU_LITTLE_ENDIAN
131 select DMA_NONCOHERENT 70 select DMA_NONCOHERENT
132 select IRQ_CPU 71 select MIPS_DISABLE_OBSOLETE_IDE
133 select ISA 72 select SYS_HAS_CPU_MIPS32_R1
73 select SYS_SUPPORTS_LITTLE_ENDIAN
134 74
135config TANBAC_TB022X 75config MIPS_DB1000
136 bool "Support for TANBAC VR4131 multichip module and TANBAC VR4131DIMM" 76 bool "AMD Alchemy DB1000 board"
137 depends on MACH_VR41XX 77 select SOC_AU1000
138 select CPU_LITTLE_ENDIAN
139 select DMA_NONCOHERENT 78 select DMA_NONCOHERENT
140 select IRQ_CPU
141 select HW_HAS_PCI 79 select HW_HAS_PCI
142 help 80 select SYS_HAS_CPU_MIPS32_R1
143 The TANBAC VR4131 multichip module(TB0225) and 81 select SYS_SUPPORTS_LITTLE_ENDIAN
144 the TANBAC VR4131DIMM(TB0229) are MIPS-based platforms
145 manufactured by TANBAC.
146 Please refer to <http://www.tanbac.co.jp/>
147 about VR4131 multichip module and VR4131DIMM.
148 82
149config TANBAC_TB0226 83config MIPS_DB1100
150 bool "Support for TANBAC Mbase(TB0226)" 84 bool "AMD Alchemy DB1100 board"
151 depends on TANBAC_TB022X 85 select SOC_AU1100
152 select GPIO_VR41XX
153 help
154 The TANBAC Mbase(TB0226) is a MIPS-based platform manufactured by TANBAC.
155 Please refer to <http://www.tanbac.co.jp/> about Mbase.
156
157config TANBAC_TB0287
158 bool "Support for TANBAC Mini-ITX DIMM base(TB0287)"
159 depends on TANBAC_TB022X
160 help
161 The TANBAC Mini-ITX DIMM base(TB0287) is a MIPS-based platform manufactured by TANBAC.
162 Please refer to <http://www.tanbac.co.jp/> about Mini-ITX DIMM base.
163
164config VICTOR_MPC30X
165 bool "Support for Victor MP-C303/304"
166 depends on MACH_VR41XX
167 select CPU_LITTLE_ENDIAN
168 select DMA_NONCOHERENT 86 select DMA_NONCOHERENT
169 select IRQ_CPU 87 select SYS_HAS_CPU_MIPS32_R1
170 select HW_HAS_PCI 88 select SYS_SUPPORTS_LITTLE_ENDIAN
171 89
172config ZAO_CAPCELLA 90config MIPS_DB1500
173 bool "Support for ZAO Networks Capcella" 91 bool "AMD Alchemy DB1500 board"
174 depends on MACH_VR41XX 92 select SOC_AU1500
175 select CPU_LITTLE_ENDIAN
176 select DMA_NONCOHERENT 93 select DMA_NONCOHERENT
177 select IRQ_CPU
178 select HW_HAS_PCI 94 select HW_HAS_PCI
95 select MIPS_DISABLE_OBSOLETE_IDE
96 select SYS_HAS_CPU_MIPS32_R1
97 select SYS_SUPPORTS_BIG_ENDIAN
98 select SYS_SUPPORTS_LITTLE_ENDIAN
179 99
180config PCI_VR41XX 100config MIPS_DB1550
181 bool "Add PCI control unit support of NEC VR4100 series" 101 bool "AMD Alchemy DB1550 board"
182 depends on MACH_VR41XX && HW_HAS_PCI 102 select SOC_AU1550
183 default y 103 select HW_HAS_PCI
184 select PCI 104 select DMA_NONCOHERENT
105 select MIPS_DISABLE_OBSOLETE_IDE
106 select SYS_HAS_CPU_MIPS32_R1
107 select SYS_SUPPORTS_LITTLE_ENDIAN
185 108
186config VRC4173 109config MIPS_DB1200
187 tristate "Add NEC VRC4173 companion chip support" 110 bool "AMD Alchemy DB1200 board"
188 depends on MACH_VR41XX && PCI_VR41XX 111 select SOC_AU1200
189 ---help--- 112 select DMA_COHERENT
190 The NEC VRC4173 is a companion chip for NEC VR4122/VR4131. 113 select MIPS_DISABLE_OBSOLETE_IDE
114 select SYS_HAS_CPU_MIPS32_R1
115 select SYS_SUPPORTS_LITTLE_ENDIAN
191 116
192config TOSHIBA_JMR3927 117config MIPS_MIRAGE
193 bool "Support for Toshiba JMR-TX3927 board" 118 bool "AMD Alchemy Mirage board"
194 select DMA_NONCOHERENT 119 select DMA_NONCOHERENT
195 select HW_HAS_PCI 120 select SOC_AU1500
196 select SWAP_IO_SPACE 121 select SYS_HAS_CPU_MIPS32_R1
197 select SYS_SUPPORTS_32BIT_KERNEL 122 select SYS_SUPPORTS_LITTLE_ENDIAN
198 123
199config MIPS_COBALT 124config MIPS_COBALT
200 bool "Support for Cobalt Server" 125 bool "Support for Cobalt Server"
201 depends on EXPERIMENTAL
202 select DMA_NONCOHERENT 126 select DMA_NONCOHERENT
203 select HW_HAS_PCI 127 select HW_HAS_PCI
204 select I8259 128 select I8259
205 select IRQ_CPU 129 select IRQ_CPU
130 select MIPS_GT64111
131 select SYS_HAS_CPU_NEVADA
206 select SYS_SUPPORTS_32BIT_KERNEL 132 select SYS_SUPPORTS_32BIT_KERNEL
207 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL 133 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
134 select SYS_SUPPORTS_LITTLE_ENDIAN
208 135
209config MACH_DECSTATION 136config MACH_DECSTATION
210 bool "Support for DECstations" 137 bool "Support for DECstations"
211 select BOOT_ELF32 138 select BOOT_ELF32
212 select DMA_NONCOHERENT 139 select DMA_NONCOHERENT
140 select EARLY_PRINTK
213 select IRQ_CPU 141 select IRQ_CPU
142 select SYS_HAS_CPU_R3000
143 select SYS_HAS_CPU_R4X00
214 select SYS_SUPPORTS_32BIT_KERNEL 144 select SYS_SUPPORTS_32BIT_KERNEL
215 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL 145 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
216 ---help--- 146 select SYS_SUPPORTS_LITTLE_ENDIAN
147 help
217 This enables support for DEC's MIPS based workstations. For details 148 This enables support for DEC's MIPS based workstations. For details
218 see the Linux/MIPS FAQ on <http://www.linux-mips.org/> and the 149 see the Linux/MIPS FAQ on <http://www.linux-mips.org/> and the
219 DECstation porting pages on <http://decstation.unix-ag.org/>. 150 DECstation porting pages on <http://decstation.unix-ag.org/>.
@@ -234,8 +165,10 @@ config MIPS_EV64120
234 select DMA_NONCOHERENT 165 select DMA_NONCOHERENT
235 select HW_HAS_PCI 166 select HW_HAS_PCI
236 select MIPS_GT64120 167 select MIPS_GT64120
168 select SYS_HAS_CPU_R5000
237 select SYS_SUPPORTS_32BIT_KERNEL 169 select SYS_SUPPORTS_32BIT_KERNEL
238 select SYS_SUPPORTS_64BIT_KERNEL 170 select SYS_SUPPORTS_64BIT_KERNEL
171 select SYS_SUPPORTS_BIG_ENDIAN
239 help 172 help
240 This is an evaluation board based on the Galileo GT-64120 173 This is an evaluation board based on the Galileo GT-64120
241 single-chip system controller that contains a MIPS R5000 compatible 174 single-chip system controller that contains a MIPS R5000 compatible
@@ -243,10 +176,6 @@ config MIPS_EV64120
243 <http://www.marvell.com/>. Say Y here if you wish to build a 176 <http://www.marvell.com/>. Say Y here if you wish to build a
244 kernel for this platform. 177 kernel for this platform.
245 178
246config EVB_PCI1
247 bool "Enable Second PCI (PCI1)"
248 depends on MIPS_EV64120
249
250config MIPS_EV96100 179config MIPS_EV96100
251 bool "Support for Galileo EV96100 Evaluation board (EXPERIMENTAL)" 180 bool "Support for Galileo EV96100 Evaluation board (EXPERIMENTAL)"
252 depends on EXPERIMENTAL 181 depends on EXPERIMENTAL
@@ -256,8 +185,11 @@ config MIPS_EV96100
256 select MIPS_GT96100 185 select MIPS_GT96100
257 select RM7000_CPU_SCACHE 186 select RM7000_CPU_SCACHE
258 select SWAP_IO_SPACE 187 select SWAP_IO_SPACE
188 select SYS_HAS_CPU_R5000
189 select SYS_HAS_CPU_RM7000
259 select SYS_SUPPORTS_32BIT_KERNEL 190 select SYS_SUPPORTS_32BIT_KERNEL
260 select SYS_SUPPORTS_64BIT_KERNEL 191 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
192 select SYS_SUPPORTS_BIG_ENDIAN
261 help 193 help
262 This is an evaluation board based on the Galileo GT-96100 LAN/WAN 194 This is an evaluation board based on the Galileo GT-96100 LAN/WAN
263 communications controllers containing a MIPS R5000 compatible core 195 communications controllers containing a MIPS R5000 compatible core
@@ -268,8 +200,11 @@ config MIPS_IVR
268 bool "Support for Globespan IVR board" 200 bool "Support for Globespan IVR board"
269 select DMA_NONCOHERENT 201 select DMA_NONCOHERENT
270 select HW_HAS_PCI 202 select HW_HAS_PCI
203 select ITE_BOARD_GEN
204 select SYS_HAS_CPU_NEVADA
271 select SYS_SUPPORTS_32BIT_KERNEL 205 select SYS_SUPPORTS_32BIT_KERNEL
272 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL 206 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
207 select SYS_SUPPORTS_LITTLE_ENDIAN
273 help 208 help
274 This is an evaluation board built by Globespan to showcase thir 209 This is an evaluation board built by Globespan to showcase thir
275 iVR (Internet Video Recorder) design. It utilizes a QED RM5231 210 iVR (Internet Video Recorder) design. It utilizes a QED RM5231
@@ -277,37 +212,16 @@ config MIPS_IVR
277 located at <http://www.globespan.net/>. Say Y here if you wish to 212 located at <http://www.globespan.net/>. Say Y here if you wish to
278 build a kernel for this platform. 213 build a kernel for this platform.
279 214
280config LASAT
281 bool "Support for LASAT Networks platforms"
282 select DMA_NONCOHERENT
283 select HW_HAS_PCI
284 select MIPS_GT64120
285 select R5000_CPU_SCACHE
286 select SYS_SUPPORTS_32BIT_KERNEL
287 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
288
289config PICVUE
290 tristate "PICVUE LCD display driver"
291 depends on LASAT
292
293config PICVUE_PROC
294 tristate "PICVUE LCD display driver /proc interface"
295 depends on PICVUE
296
297config DS1603
298 bool "DS1603 RTC driver"
299 depends on LASAT
300
301config LASAT_SYSCTL
302 bool "LASAT sysctl interface"
303 depends on LASAT
304
305config MIPS_ITE8172 215config MIPS_ITE8172
306 bool "Support for ITE 8172G board" 216 bool "Support for ITE 8172G board"
307 select DMA_NONCOHERENT 217 select DMA_NONCOHERENT
308 select HW_HAS_PCI 218 select HW_HAS_PCI
219 select ITE_BOARD_GEN
220 select SYS_HAS_CPU_R5432
221 select SYS_HAS_CPU_NEVADA
309 select SYS_SUPPORTS_32BIT_KERNEL 222 select SYS_SUPPORTS_32BIT_KERNEL
310 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL 223 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
224 select SYS_SUPPORTS_LITTLE_ENDIAN
311 help 225 help
312 Ths is an evaluation board made by ITE <http://www.ite.com.tw/> 226 Ths is an evaluation board made by ITE <http://www.ite.com.tw/>
313 with ATX form factor that utilizes a MIPS R5000 to work with its 227 with ATX form factor that utilizes a MIPS R5000 to work with its
@@ -315,42 +229,86 @@ config MIPS_ITE8172
315 either a NEC Vr5432 or QED RM5231. Say Y here if you wish to build 229 either a NEC Vr5432 or QED RM5231. Say Y here if you wish to build
316 a kernel for this platform. 230 a kernel for this platform.
317 231
318config IT8172_REVC 232config MACH_JAZZ
319 bool "Support for older IT8172 (Rev C)" 233 bool "Support for the Jazz family of machines"
320 depends on MIPS_ITE8172 234 select ARC
235 select ARC32
236 select ARCH_MAY_HAVE_PC_FDC
237 select GENERIC_ISA_DMA
238 select I8259
239 select ISA
240 select SYS_HAS_CPU_R4X00
241 select SYS_SUPPORTS_32BIT_KERNEL
242 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
321 help 243 help
322 Say Y here to support the older, Revision C version of the Integrated 244 This a family of machines based on the MIPS R4030 chipset which was
323 Technology Express, Inc. ITE8172 SBC. Vendor page at 245 used by several vendors to build RISC/os and Windows NT workstations.
324 <http://www.ite.com.tw/ia/brief_it8172bsp.htm>; picture of the 246 Members include the Acer PICA, MIPS Magnum 4000, MIPS Millenium and
325 board at <http://www.mvista.com/partners/semiconductor/ite.html>. 247 Olivetti M700-10 workstations.
248
249config LASAT
250 bool "Support for LASAT Networks platforms"
251 select DMA_NONCOHERENT
252 select HW_HAS_PCI
253 select MIPS_GT64120
254 select MIPS_NILE4
255 select R5000_CPU_SCACHE
256 select SYS_HAS_CPU_R5000
257 select SYS_SUPPORTS_32BIT_KERNEL
258 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
259 select SYS_SUPPORTS_LITTLE_ENDIAN
326 260
327config MIPS_ATLAS 261config MIPS_ATLAS
328 bool "Support for MIPS Atlas board" 262 bool "Support for MIPS Atlas board"
329 select BOOT_ELF32 263 select BOOT_ELF32
330 select DMA_NONCOHERENT 264 select DMA_NONCOHERENT
265 select IRQ_CPU
331 select HW_HAS_PCI 266 select HW_HAS_PCI
267 select MIPS_BOARDS_GEN
268 select MIPS_BONITO64
332 select MIPS_GT64120 269 select MIPS_GT64120
270 select MIPS_MSC
271 select RM7000_CPU_SCACHE
333 select SWAP_IO_SPACE 272 select SWAP_IO_SPACE
273 select SYS_HAS_CPU_MIPS32_R1
274 select SYS_HAS_CPU_MIPS32_R2
275 select SYS_HAS_CPU_MIPS64_R1
276 select SYS_HAS_CPU_NEVADA
277 select SYS_HAS_CPU_RM7000
334 select SYS_SUPPORTS_32BIT_KERNEL 278 select SYS_SUPPORTS_32BIT_KERNEL
335 select SYS_SUPPORTS_64BIT_KERNEL 279 select SYS_SUPPORTS_64BIT_KERNEL
280 select SYS_SUPPORTS_BIG_ENDIAN
281 select SYS_SUPPORTS_LITTLE_ENDIAN
336 help 282 help
337 This enables support for the QED R5231-based MIPS Atlas evaluation 283 This enables support for the MIPS Technologies Atlas evaluation
338 board. 284 board.
339 285
340config MIPS_MALTA 286config MIPS_MALTA
341 bool "Support for MIPS Malta board" 287 bool "Support for MIPS Malta board"
288 select ARCH_MAY_HAVE_PC_FDC
342 select BOOT_ELF32 289 select BOOT_ELF32
343 select HAVE_STD_PC_SERIAL_PORT 290 select HAVE_STD_PC_SERIAL_PORT
344 select DMA_NONCOHERENT 291 select DMA_NONCOHERENT
292 select IRQ_CPU
345 select GENERIC_ISA_DMA 293 select GENERIC_ISA_DMA
346 select HW_HAS_PCI 294 select HW_HAS_PCI
347 select I8259 295 select I8259
296 select MIPS_BOARDS_GEN
297 select MIPS_BONITO64
348 select MIPS_GT64120 298 select MIPS_GT64120
299 select MIPS_MSC
349 select SWAP_IO_SPACE 300 select SWAP_IO_SPACE
301 select SYS_HAS_CPU_MIPS32_R1
302 select SYS_HAS_CPU_MIPS32_R2
303 select SYS_HAS_CPU_MIPS64_R1
304 select SYS_HAS_CPU_NEVADA
305 select SYS_HAS_CPU_RM7000
350 select SYS_SUPPORTS_32BIT_KERNEL 306 select SYS_SUPPORTS_32BIT_KERNEL
351 select SYS_SUPPORTS_64BIT_KERNEL 307 select SYS_SUPPORTS_64BIT_KERNEL
308 select SYS_SUPPORTS_BIG_ENDIAN
309 select SYS_SUPPORTS_LITTLE_ENDIAN
352 help 310 help
353 This enables support for the VR5000-based MIPS Malta evaluation 311 This enables support for the MIPS Technologies Malta evaluation
354 board. 312 board.
355 313
356config MIPS_SEAD 314config MIPS_SEAD
@@ -358,50 +316,64 @@ config MIPS_SEAD
358 depends on EXPERIMENTAL 316 depends on EXPERIMENTAL
359 select IRQ_CPU 317 select IRQ_CPU
360 select DMA_NONCOHERENT 318 select DMA_NONCOHERENT
319 select MIPS_BOARDS_GEN
320 select SYS_HAS_CPU_MIPS32_R1
321 select SYS_HAS_CPU_MIPS32_R2
322 select SYS_HAS_CPU_MIPS64_R1
361 select SYS_SUPPORTS_32BIT_KERNEL 323 select SYS_SUPPORTS_32BIT_KERNEL
362 select SYS_SUPPORTS_64BIT_KERNEL 324 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
325 select SYS_SUPPORTS_BIG_ENDIAN
326 select SYS_SUPPORTS_LITTLE_ENDIAN
327 help
328 This enables support for the MIPS Technologies SEAD evaluation
329 board.
363 330
364config MOMENCO_OCELOT 331config MIPS_SIM
365 bool "Support for Momentum Ocelot board" 332 bool 'Support for MIPS simulator (MIPSsim)'
366 select DMA_NONCOHERENT 333 select DMA_NONCOHERENT
367 select HW_HAS_PCI
368 select IRQ_CPU 334 select IRQ_CPU
369 select IRQ_CPU_RM7K 335 select SYS_HAS_CPU_MIPS32_R1
370 select MIPS_GT64120 336 select SYS_HAS_CPU_MIPS32_R2
371 select RM7000_CPU_SCACHE
372 select SWAP_IO_SPACE
373 select SYS_SUPPORTS_32BIT_KERNEL 337 select SYS_SUPPORTS_32BIT_KERNEL
374 select SYS_SUPPORTS_64BIT_KERNEL 338 select SYS_SUPPORTS_BIG_ENDIAN
339 select SYS_SUPPORTS_LITTLE_ENDIAN
375 help 340 help
376 The Ocelot is a MIPS-based Single Board Computer (SBC) made by 341 This option enables support for MIPS Technologies MIPSsim software
377 Momentum Computer <http://www.momenco.com/>. 342 emulator.
378 343
379config MOMENCO_OCELOT_G 344config MOMENCO_JAGUAR_ATX
380 bool "Support for Momentum Ocelot-G board" 345 bool "Support for Momentum Jaguar board"
346 select BOOT_ELF32
381 select DMA_NONCOHERENT 347 select DMA_NONCOHERENT
382 select HW_HAS_PCI 348 select HW_HAS_PCI
383 select IRQ_CPU 349 select IRQ_CPU
384 select IRQ_CPU_RM7K 350 select IRQ_CPU_RM7K
351 select IRQ_MV64340
352 select LIMITED_DMA
385 select PCI_MARVELL 353 select PCI_MARVELL
386 select RM7000_CPU_SCACHE 354 select RM7000_CPU_SCACHE
387 select SWAP_IO_SPACE 355 select SWAP_IO_SPACE
356 select SYS_HAS_CPU_RM9000
388 select SYS_SUPPORTS_32BIT_KERNEL 357 select SYS_SUPPORTS_32BIT_KERNEL
389 select SYS_SUPPORTS_64BIT_KERNEL 358 select SYS_SUPPORTS_64BIT_KERNEL
359 select SYS_SUPPORTS_BIG_ENDIAN
390 help 360 help
391 The Ocelot is a MIPS-based Single Board Computer (SBC) made by 361 The Jaguar ATX is a MIPS-based Single Board Computer (SBC) made by
392 Momentum Computer <http://www.momenco.com/>. 362 Momentum Computer <http://www.momenco.com/>.
393 363
394config MOMENCO_OCELOT_C 364config MOMENCO_OCELOT
395 bool "Support for Momentum Ocelot-C board" 365 bool "Support for Momentum Ocelot board"
396 select DMA_NONCOHERENT 366 select DMA_NONCOHERENT
397 select HW_HAS_PCI 367 select HW_HAS_PCI
398 select IRQ_CPU 368 select IRQ_CPU
399 select IRQ_MV64340 369 select IRQ_CPU_RM7K
400 select PCI_MARVELL 370 select MIPS_GT64120
401 select RM7000_CPU_SCACHE 371 select RM7000_CPU_SCACHE
402 select SWAP_IO_SPACE 372 select SWAP_IO_SPACE
373 select SYS_HAS_CPU_RM7000
403 select SYS_SUPPORTS_32BIT_KERNEL 374 select SYS_SUPPORTS_32BIT_KERNEL
404 select SYS_SUPPORTS_64BIT_KERNEL 375 select SYS_SUPPORTS_64BIT_KERNEL
376 select SYS_SUPPORTS_BIG_ENDIAN
405 help 377 help
406 The Ocelot is a MIPS-based Single Board Computer (SBC) made by 378 The Ocelot is a MIPS-based Single Board Computer (SBC) made by
407 Momentum Computer <http://www.momenco.com/>. 379 Momentum Computer <http://www.momenco.com/>.
@@ -417,80 +389,95 @@ config MOMENCO_OCELOT_3
417 select PCI_MARVELL 389 select PCI_MARVELL
418 select RM7000_CPU_SCACHE 390 select RM7000_CPU_SCACHE
419 select SWAP_IO_SPACE 391 select SWAP_IO_SPACE
392 select SYS_HAS_CPU_RM9000
420 select SYS_SUPPORTS_32BIT_KERNEL 393 select SYS_SUPPORTS_32BIT_KERNEL
421 select SYS_SUPPORTS_64BIT_KERNEL 394 select SYS_SUPPORTS_64BIT_KERNEL
395 select SYS_SUPPORTS_BIG_ENDIAN
422 help 396 help
423 The Ocelot-3 is based off Discovery III System Controller and 397 The Ocelot-3 is based off Discovery III System Controller and
424 PMC-Sierra Rm79000 core. 398 PMC-Sierra Rm79000 core.
425 399
426config MOMENCO_JAGUAR_ATX 400config MOMENCO_OCELOT_C
427 bool "Support for Momentum Jaguar board" 401 bool "Support for Momentum Ocelot-C board"
428 select BOOT_ELF32
429 select DMA_NONCOHERENT 402 select DMA_NONCOHERENT
430 select HW_HAS_PCI 403 select HW_HAS_PCI
431 select IRQ_CPU 404 select IRQ_CPU
432 select IRQ_CPU_RM7K
433 select IRQ_MV64340 405 select IRQ_MV64340
434 select LIMITED_DMA
435 select PCI_MARVELL 406 select PCI_MARVELL
436 select RM7000_CPU_SCACHE 407 select RM7000_CPU_SCACHE
437 select SWAP_IO_SPACE 408 select SWAP_IO_SPACE
409 select SYS_HAS_CPU_RM7000
438 select SYS_SUPPORTS_32BIT_KERNEL 410 select SYS_SUPPORTS_32BIT_KERNEL
439 select SYS_SUPPORTS_64BIT_KERNEL 411 select SYS_SUPPORTS_64BIT_KERNEL
412 select SYS_SUPPORTS_BIG_ENDIAN
440 help 413 help
441 The Jaguar ATX is a MIPS-based Single Board Computer (SBC) made by 414 The Ocelot is a MIPS-based Single Board Computer (SBC) made by
442 Momentum Computer <http://www.momenco.com/>. 415 Momentum Computer <http://www.momenco.com/>.
443 416
444config JAGUAR_DMALOW 417config MOMENCO_OCELOT_G
445 bool "Low DMA Mode" 418 bool "Support for Momentum Ocelot-G board"
446 depends on MOMENCO_JAGUAR_ATX 419 select DMA_NONCOHERENT
447 help
448 Select to Y if jump JP5 is set on your board, N otherwise. Normally
449 the jumper is set, so if you feel unsafe, just say Y.
450
451config PMC_YOSEMITE
452 bool "Support for PMC-Sierra Yosemite eval board"
453 select DMA_COHERENT
454 select HW_HAS_PCI 420 select HW_HAS_PCI
455 select IRQ_CPU 421 select IRQ_CPU
456 select IRQ_CPU_RM7K 422 select IRQ_CPU_RM7K
457 select IRQ_CPU_RM9K 423 select PCI_MARVELL
424 select RM7000_CPU_SCACHE
458 select SWAP_IO_SPACE 425 select SWAP_IO_SPACE
426 select SYS_HAS_CPU_RM7000
459 select SYS_SUPPORTS_32BIT_KERNEL 427 select SYS_SUPPORTS_32BIT_KERNEL
460 select SYS_SUPPORTS_64BIT_KERNEL 428 select SYS_SUPPORTS_64BIT_KERNEL
429 select SYS_SUPPORTS_BIG_ENDIAN
461 help 430 help
462 Yosemite is an evaluation board for the RM9000x2 processor 431 The Ocelot is a MIPS-based Single Board Computer (SBC) made by
463 manufactured by PMC-Sierra 432 Momentum Computer <http://www.momenco.com/>.
464 433
465config HYPERTRANSPORT 434config MIPS_XXS1500
466 bool "Hypertransport Support for PMC-Sierra Yosemite" 435 bool "Support for MyCable XXS1500 board"
467 depends on PMC_YOSEMITE 436 select DMA_NONCOHERENT
437 select SOC_AU1500
438 select SYS_SUPPORTS_LITTLE_ENDIAN
439
440config PNX8550_V2PCI
441 bool "Support for Philips PNX8550 based Viper2-PCI board"
442 select PNX8550
443 select SYS_SUPPORTS_LITTLE_ENDIAN
444
445config PNX8550_JBS
446 bool "Support for Philips PNX8550 based JBS board"
447 select PNX8550
448 select SYS_SUPPORTS_LITTLE_ENDIAN
468 449
469config DDB5074 450config DDB5074
470 bool "Support for NEC DDB Vrc-5074 (EXPERIMENTAL)" 451 bool "Support for NEC DDB Vrc-5074 (EXPERIMENTAL)"
471 depends on EXPERIMENTAL 452 depends on EXPERIMENTAL
453 select DDB5XXX_COMMON
472 select DMA_NONCOHERENT 454 select DMA_NONCOHERENT
473 select HAVE_STD_PC_SERIAL_PORT 455 select HAVE_STD_PC_SERIAL_PORT
474 select HW_HAS_PCI 456 select HW_HAS_PCI
475 select IRQ_CPU 457 select IRQ_CPU
476 select I8259 458 select I8259
477 select ISA 459 select ISA
460 select SYS_HAS_CPU_R5000
478 select SYS_SUPPORTS_32BIT_KERNEL 461 select SYS_SUPPORTS_32BIT_KERNEL
479 select SYS_SUPPORTS_64BIT_KERNEL 462 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
463 select SYS_SUPPORTS_LITTLE_ENDIAN
480 help 464 help
481 This enables support for the VR5000-based NEC DDB Vrc-5074 465 This enables support for the VR5000-based NEC DDB Vrc-5074
482 evaluation board. 466 evaluation board.
483 467
484config DDB5476 468config DDB5476
485 bool "Support for NEC DDB Vrc-5476" 469 bool "Support for NEC DDB Vrc-5476"
470 select DDB5XXX_COMMON
486 select DMA_NONCOHERENT 471 select DMA_NONCOHERENT
487 select HAVE_STD_PC_SERIAL_PORT 472 select HAVE_STD_PC_SERIAL_PORT
488 select HW_HAS_PCI 473 select HW_HAS_PCI
489 select IRQ_CPU 474 select IRQ_CPU
490 select I8259 475 select I8259
491 select ISA 476 select ISA
477 select SYS_HAS_CPU_R5432
492 select SYS_SUPPORTS_32BIT_KERNEL 478 select SYS_SUPPORTS_32BIT_KERNEL
493 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL 479 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
480 select SYS_SUPPORTS_LITTLE_ENDIAN
494 help 481 help
495 This enables support for the R5432-based NEC DDB Vrc-5476 482 This enables support for the R5432-based NEC DDB Vrc-5476
496 evaluation board. 483 evaluation board.
@@ -501,12 +488,15 @@ config DDB5476
501 488
502config DDB5477 489config DDB5477
503 bool "Support for NEC DDB Vrc-5477" 490 bool "Support for NEC DDB Vrc-5477"
491 select DDB5XXX_COMMON
504 select DMA_NONCOHERENT 492 select DMA_NONCOHERENT
505 select HW_HAS_PCI 493 select HW_HAS_PCI
506 select I8259 494 select I8259
507 select IRQ_CPU 495 select IRQ_CPU
496 select SYS_HAS_CPU_R5432
508 select SYS_SUPPORTS_32BIT_KERNEL 497 select SYS_SUPPORTS_32BIT_KERNEL
509 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL 498 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
499 select SYS_SUPPORTS_LITTLE_ENDIAN
510 help 500 help
511 This enables support for the R5432-based NEC DDB Vrc-5477, 501 This enables support for the R5432-based NEC DDB Vrc-5477,
512 or Rockhopper/SolutionGear boards with R5432/R5500 CPUs. 502 or Rockhopper/SolutionGear boards with R5432/R5500 CPUs.
@@ -514,10 +504,28 @@ config DDB5477
514 Features : kernel debugging, serial terminal, NFS root fs, on-board 504 Features : kernel debugging, serial terminal, NFS root fs, on-board
515 ether port USB, AC97, PCI, etc. 505 ether port USB, AC97, PCI, etc.
516 506
517config DDB5477_BUS_FREQUENCY 507config MACH_VR41XX
518 int "bus frequency (in kHZ, 0 for auto-detect)" 508 bool "Support for NEC VR4100 series based machines"
519 depends on DDB5477 509 select SYS_HAS_CPU_VR41XX
520 default 0 510 select SYS_SUPPORTS_32BIT_KERNEL
511 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
512
513config PMC_YOSEMITE
514 bool "Support for PMC-Sierra Yosemite eval board"
515 select DMA_COHERENT
516 select HW_HAS_PCI
517 select IRQ_CPU
518 select IRQ_CPU_RM7K
519 select IRQ_CPU_RM9K
520 select SWAP_IO_SPACE
521 select SYS_HAS_CPU_RM9000
522 select SYS_SUPPORTS_32BIT_KERNEL
523 select SYS_SUPPORTS_64BIT_KERNEL
524 select SYS_SUPPORTS_BIG_ENDIAN
525 select SYS_SUPPORTS_HIGHMEM
526 help
527 Yosemite is an evaluation board for the RM9000x2 processor
528 manufactured by PMC-Sierra.
521 529
522config QEMU 530config QEMU
523 bool "Support for Qemu" 531 bool "Support for Qemu"
@@ -527,15 +535,16 @@ config QEMU
527 select I8259 535 select I8259
528 select ISA 536 select ISA
529 select SWAP_IO_SPACE 537 select SWAP_IO_SPACE
538 select SYS_HAS_CPU_MIPS32_R1
530 select SYS_SUPPORTS_32BIT_KERNEL 539 select SYS_SUPPORTS_32BIT_KERNEL
531 select SYS_SUPPORTS_BIG_ENDIAN 540 select SYS_SUPPORTS_BIG_ENDIAN
532 help 541 help
533 Qemu is a software emulator which among other architectures also 542 Qemu is a software emulator which among other architectures also
534 can simulate a MIPS32 4Kc system. This patch adds support for the 543 can simulate a MIPS32 4Kc system. This patch adds support for the
535 system architecture that currently is being simulated by Qemu. It 544 system architecture that currently is being simulated by Qemu. It
536 will eventually be removed again when Qemu has the capability to 545 will eventually be removed again when Qemu has the capability to
537 simulate actual MIPS hardware platforms. More information on Qemu 546 simulate actual MIPS hardware platforms. More information on Qemu
538 can be found at http://www.linux-mips.org/wiki/Qemu. 547 can be found at http://www.linux-mips.org/wiki/Qemu.
539 548
540config SGI_IP22 549config SGI_IP22
541 bool "Support for SGI IP22 (Indy/Indigo2)" 550 bool "Support for SGI IP22 (Indy/Indigo2)"
@@ -543,11 +552,15 @@ config SGI_IP22
543 select ARC32 552 select ARC32
544 select BOOT_ELF32 553 select BOOT_ELF32
545 select DMA_NONCOHERENT 554 select DMA_NONCOHERENT
555 select HW_HAS_EISA
546 select IP22_CPU_SCACHE 556 select IP22_CPU_SCACHE
547 select IRQ_CPU 557 select IRQ_CPU
548 select SWAP_IO_SPACE 558 select SWAP_IO_SPACE
559 select SYS_HAS_CPU_R4X00
560 select SYS_HAS_CPU_R5000
549 select SYS_SUPPORTS_32BIT_KERNEL 561 select SYS_SUPPORTS_32BIT_KERNEL
550 select SYS_SUPPORTS_64BIT_KERNEL 562 select SYS_SUPPORTS_64BIT_KERNEL
563 select SYS_SUPPORTS_BIG_ENDIAN
551 help 564 help
552 This are the SGI Indy, Challenge S and Indigo2, as well as certain 565 This are the SGI Indy, Challenge S and Indigo2, as well as certain
553 OEM variants like the Tandem CMN B006S. To compile a Linux kernel 566 OEM variants like the Tandem CMN B006S. To compile a Linux kernel
@@ -557,70 +570,18 @@ config SGI_IP27
557 bool "Support for SGI IP27 (Origin200/2000)" 570 bool "Support for SGI IP27 (Origin200/2000)"
558 select ARC 571 select ARC
559 select ARC64 572 select ARC64
573 select BOOT_ELF64
560 select DMA_IP27 574 select DMA_IP27
561 select HW_HAS_PCI 575 select HW_HAS_PCI
562 select PCI_DOMAINS 576 select PCI_DOMAINS
577 select SYS_HAS_CPU_R10000
563 select SYS_SUPPORTS_64BIT_KERNEL 578 select SYS_SUPPORTS_64BIT_KERNEL
579 select SYS_SUPPORTS_BIG_ENDIAN
564 help 580 help
565 This are the SGI Origin 200, Origin 2000 and Onyx 2 Graphics 581 This are the SGI Origin 200, Origin 2000 and Onyx 2 Graphics
566 workstations. To compile a Linux kernel that runs on these, say Y 582 workstations. To compile a Linux kernel that runs on these, say Y
567 here. 583 here.
568 584
569#config SGI_SN0_XXL
570# bool "IP27 XXL"
571# depends on SGI_IP27
572# This options adds support for userspace processes upto 16TB size.
573# Normally the limit is just .5TB.
574
575config SGI_SN0_N_MODE
576 bool "IP27 N-Mode"
577 depends on SGI_IP27
578 help
579 The nodes of Origin 200, Origin 2000 and Onyx 2 systems can be
580 configured in either N-Modes which allows for more nodes or M-Mode
581 which allows for more memory. Your system is most probably
582 running in M-Mode, so you should say N here.
583
584config ARCH_DISCONTIGMEM_ENABLE
585 bool
586 default y if SGI_IP27
587 help
588 Say Y to upport efficient handling of discontiguous physical memory,
589 for architectures which are either NUMA (Non-Uniform Memory Access)
590 or have huge holes in the physical address space for other reasons.
591 See <file:Documentation/vm/numa> for more.
592
593config NUMA
594 bool "NUMA Support"
595 depends on SGI_IP27
596 help
597 Say Y to compile the kernel to support NUMA (Non-Uniform Memory
598 Access). This option is for configuring high-end multiprocessor
599 server machines. If in doubt, say N.
600
601config MAPPED_KERNEL
602 bool "Mapped kernel support"
603 depends on SGI_IP27
604 help
605 Change the way a Linux kernel is loaded into memory on a MIPS64
606 machine. This is required in order to support text replication and
607 NUMA. If you need to understand it, read the source code.
608
609config REPLICATE_KTEXT
610 bool "Kernel text replication support"
611 depends on SGI_IP27
612 help
613 Say Y here to enable replicating the kernel text across multiple
614 nodes in a NUMA cluster. This trades memory for speed.
615
616config REPLICATE_EXHANDLERS
617 bool "Exception handler replication support"
618 depends on SGI_IP27
619 help
620 Say Y here to enable replicating the kernel exception handlers
621 across multiple nodes in a NUMA cluster. This trades memory for
622 speed.
623
624config SGI_IP32 585config SGI_IP32
625 bool "Support for SGI IP32 (O2) (EXPERIMENTAL)" 586 bool "Support for SGI IP32 (O2) (EXPERIMENTAL)"
626 depends on EXPERIMENTAL 587 depends on EXPERIMENTAL
@@ -633,353 +594,152 @@ config SGI_IP32
633 select HW_HAS_PCI 594 select HW_HAS_PCI
634 select R5000_CPU_SCACHE 595 select R5000_CPU_SCACHE
635 select RM7000_CPU_SCACHE 596 select RM7000_CPU_SCACHE
597 select SYS_HAS_CPU_R5000
598 select SYS_HAS_CPU_R10000 if BROKEN
599 select SYS_HAS_CPU_RM7000
636 select SYS_SUPPORTS_64BIT_KERNEL 600 select SYS_SUPPORTS_64BIT_KERNEL
601 select SYS_SUPPORTS_BIG_ENDIAN
637 help 602 help
638 If you want this kernel to run on SGI O2 workstation, say Y here. 603 If you want this kernel to run on SGI O2 workstation, say Y here.
639 604
640config SOC_AU1X00 605config SIBYTE_BIGSUR
641 bool "Support for AMD/Alchemy Au1X00 SOCs" 606 bool "Support for Sibyte BigSur"
642 select SYS_SUPPORTS_32BIT_KERNEL
643
644choice
645 prompt "Au1X00 SOC Type"
646 depends on SOC_AU1X00
647 help
648 Say Y here to enable support for one of three AMD/Alchemy
649 SOCs. For additional documentation see www.amd.com.
650
651config SOC_AU1000
652 bool "SOC_AU1000"
653config SOC_AU1100
654 bool "SOC_AU1100"
655config SOC_AU1500
656 bool "SOC_AU1500"
657config SOC_AU1550
658 bool "SOC_AU1550"
659
660endchoice
661
662choice
663 prompt "AMD/Alchemy Au1x00 board support"
664 depends on SOC_AU1X00
665 help
666 These are evaluation boards built by AMD/Alchemy to
667 showcase their Au1X00 Internet Edge Processors. The SOC design
668 is based on the MIPS32 architecture running at 266/400/500MHz
669 with many integrated peripherals. Further information can be
670 found at their website, <http://www.amd.com/>. Say Y here if you
671 wish to build a kernel for this platform.
672
673config MIPS_PB1000
674 bool "PB1000 board"
675 depends on SOC_AU1000
676 select DMA_NONCOHERENT
677 select HW_HAS_PCI
678 select SWAP_IO_SPACE
679
680config MIPS_PB1100
681 bool "PB1100 board"
682 depends on SOC_AU1100
683 select DMA_NONCOHERENT
684 select HW_HAS_PCI
685 select SWAP_IO_SPACE
686
687config MIPS_PB1500
688 bool "PB1500 board"
689 depends on SOC_AU1500
690 select DMA_COHERENT
691 select HW_HAS_PCI
692
693config MIPS_PB1550
694 bool "PB1550 board"
695 depends on SOC_AU1550
696 select DMA_COHERENT
697 select HW_HAS_PCI
698 select MIPS_DISABLE_OBSOLETE_IDE
699
700config MIPS_DB1000
701 bool "DB1000 board"
702 depends on SOC_AU1000
703 select DMA_NONCOHERENT
704 select HW_HAS_PCI
705
706config MIPS_DB1100
707 bool "DB1100 board"
708 depends on SOC_AU1100
709 select DMA_NONCOHERENT
710
711config MIPS_DB1500
712 bool "DB1500 board"
713 depends on SOC_AU1500
714 select DMA_COHERENT
715 select HW_HAS_PCI
716 select MIPS_DISABLE_OBSOLETE_IDE
717
718config MIPS_DB1550
719 bool "DB1550 board"
720 depends on SOC_AU1550
721 select HW_HAS_PCI
722 select DMA_COHERENT
723 select MIPS_DISABLE_OBSOLETE_IDE
724
725config MIPS_BOSPORUS
726 bool "Bosporus board"
727 depends on SOC_AU1500
728 select DMA_NONCOHERENT
729
730config MIPS_MIRAGE
731 bool "Mirage board"
732 depends on SOC_AU1500
733 select DMA_NONCOHERENT
734
735config MIPS_XXS1500
736 bool "MyCable XXS1500 board"
737 depends on SOC_AU1500
738 select DMA_NONCOHERENT
739
740config MIPS_MTX1
741 bool "4G Systems MTX-1 board"
742 depends on SOC_AU1500
743 select HW_HAS_PCI
744 select DMA_NONCOHERENT
745
746endchoice
747
748config SIBYTE_SB1xxx_SOC
749 bool "Support for Broadcom BCM1xxx SOCs (EXPERIMENTAL)"
750 depends on EXPERIMENTAL
751 select BOOT_ELF32 607 select BOOT_ELF32
752 select DMA_COHERENT 608 select DMA_COHERENT
609 select PCI_DOMAINS
610 select SIBYTE_BCM1x80
753 select SWAP_IO_SPACE 611 select SWAP_IO_SPACE
754 select SYS_SUPPORTS_32BIT_KERNEL 612 select SYS_HAS_CPU_SB1
755 select SYS_SUPPORTS_64BIT_KERNEL 613 select SYS_SUPPORTS_BIG_ENDIAN
756 614 select SYS_SUPPORTS_LITTLE_ENDIAN
757choice
758 prompt "BCM1xxx SOC-based board"
759 depends on SIBYTE_SB1xxx_SOC
760 default SIBYTE_SWARM
761 help
762 Enable support for boards based on the SiByte line of SOCs
763 from Broadcom. There are configurations for the known
764 evaluation boards, or you can choose "Other" and add your
765 own board support code.
766 615
767config SIBYTE_SWARM 616config SIBYTE_SWARM
768 bool "BCM91250A-SWARM" 617 bool "Support for Sibyte BCM91250A-SWARM"
618 select BOOT_ELF32
619 select DMA_COHERENT
769 select SIBYTE_SB1250 620 select SIBYTE_SB1250
621 select SWAP_IO_SPACE
622 select SYS_HAS_CPU_SB1
623 select SYS_SUPPORTS_BIG_ENDIAN
624 select SYS_SUPPORTS_HIGHMEM
625 select SYS_SUPPORTS_LITTLE_ENDIAN
770 626
771config SIBYTE_SENTOSA 627config SIBYTE_SENTOSA
772 bool "BCM91250E-Sentosa" 628 bool "Support for Sibyte BCM91250E-Sentosa"
629 depends on EXPERIMENTAL
630 select BOOT_ELF32
631 select DMA_COHERENT
773 select SIBYTE_SB1250 632 select SIBYTE_SB1250
633 select SWAP_IO_SPACE
634 select SYS_HAS_CPU_SB1
635 select SYS_SUPPORTS_BIG_ENDIAN
636 select SYS_SUPPORTS_LITTLE_ENDIAN
774 637
775config SIBYTE_RHONE 638config SIBYTE_RHONE
776 bool "BCM91125E-Rhone" 639 bool "Support for Sibyte BCM91125E-Rhone"
640 depends on EXPERIMENTAL
641 select BOOT_ELF32
642 select DMA_COHERENT
777 select SIBYTE_BCM1125H 643 select SIBYTE_BCM1125H
644 select SWAP_IO_SPACE
645 select SYS_HAS_CPU_SB1
646 select SYS_SUPPORTS_BIG_ENDIAN
647 select SYS_SUPPORTS_LITTLE_ENDIAN
778 648
779config SIBYTE_CARMEL 649config SIBYTE_CARMEL
780 bool "BCM91120x-Carmel" 650 bool "Support for Sibyte BCM91120x-Carmel"
651 depends on EXPERIMENTAL
652 select BOOT_ELF32
653 select DMA_COHERENT
781 select SIBYTE_BCM1120 654 select SIBYTE_BCM1120
655 select SWAP_IO_SPACE
656 select SYS_HAS_CPU_SB1
657 select SYS_SUPPORTS_BIG_ENDIAN
658 select SYS_SUPPORTS_LITTLE_ENDIAN
782 659
783config SIBYTE_PTSWARM 660config SIBYTE_PTSWARM
784 bool "BCM91250PT-PTSWARM" 661 bool "Support for Sibyte BCM91250PT-PTSWARM"
662 depends on EXPERIMENTAL
663 select BOOT_ELF32
664 select DMA_COHERENT
785 select SIBYTE_SB1250 665 select SIBYTE_SB1250
666 select SWAP_IO_SPACE
667 select SYS_HAS_CPU_SB1
668 select SYS_SUPPORTS_BIG_ENDIAN
669 select SYS_SUPPORTS_HIGHMEM
670 select SYS_SUPPORTS_LITTLE_ENDIAN
786 671
787config SIBYTE_LITTLESUR 672config SIBYTE_LITTLESUR
788 bool "BCM91250C2-LittleSur" 673 bool "Support for Sibyte BCM91250C2-LittleSur"
674 depends on EXPERIMENTAL
675 select BOOT_ELF32
676 select DMA_COHERENT
789 select SIBYTE_SB1250 677 select SIBYTE_SB1250
678 select SWAP_IO_SPACE
679 select SYS_HAS_CPU_SB1
680 select SYS_SUPPORTS_BIG_ENDIAN
681 select SYS_SUPPORTS_HIGHMEM
682 select SYS_SUPPORTS_LITTLE_ENDIAN
790 683
791config SIBYTE_CRHINE 684config SIBYTE_CRHINE
792 bool "BCM91120C-CRhine" 685 bool "Support for Sibyte BCM91120C-CRhine"
686 depends on EXPERIMENTAL
687 select BOOT_ELF32
688 select DMA_COHERENT
793 select SIBYTE_BCM1120 689 select SIBYTE_BCM1120
690 select SWAP_IO_SPACE
691 select SYS_HAS_CPU_SB1
692 select SYS_SUPPORTS_BIG_ENDIAN
693 select SYS_SUPPORTS_LITTLE_ENDIAN
794 694
795config SIBYTE_CRHONE 695config SIBYTE_CRHONE
796 bool "BCM91125C-CRhone" 696 bool "Support for Sibyte BCM91125C-CRhone"
797 select SIBYTE_BCM1125 697 depends on EXPERIMENTAL
798 698 select BOOT_ELF32
799config SIBYTE_UNKNOWN 699 select DMA_COHERENT
800 bool "Other"
801
802endchoice
803
804config SIBYTE_BOARD
805 bool
806 depends on SIBYTE_SB1xxx_SOC && !SIBYTE_UNKNOWN
807 default y
808
809choice
810 prompt "BCM1xxx SOC Type"
811 depends on SIBYTE_UNKNOWN
812 default SIBYTE_UNK_BCM1250
813 help
814 Since you haven't chosen a known evaluation board from
815 Broadcom, you must explicitly pick the SOC this kernel is
816 targetted for.
817
818config SIBYTE_UNK_BCM1250
819 bool "BCM1250"
820 select SIBYTE_SB1250
821
822config SIBYTE_UNK_BCM1120
823 bool "BCM1120"
824 select SIBYTE_BCM1120
825
826config SIBYTE_UNK_BCM1125
827 bool "BCM1125"
828 select SIBYTE_BCM1125 700 select SIBYTE_BCM1125
829 701 select SWAP_IO_SPACE
830config SIBYTE_UNK_BCM1125H 702 select SYS_HAS_CPU_SB1
831 bool "BCM1125H" 703 select SYS_SUPPORTS_BIG_ENDIAN
832 select SIBYTE_BCM1125H 704 select SYS_SUPPORTS_HIGHMEM
833 705 select SYS_SUPPORTS_LITTLE_ENDIAN
834endchoice
835
836config SIBYTE_SB1250
837 bool
838 select HW_HAS_PCI
839
840config SIBYTE_BCM1120
841 bool
842 select SIBYTE_BCM112X
843
844config SIBYTE_BCM1125
845 bool
846 select HW_HAS_PCI
847 select SIBYTE_BCM112X
848
849config SIBYTE_BCM1125H
850 bool
851 select HW_HAS_PCI
852 select SIBYTE_BCM112X
853
854config SIBYTE_BCM112X
855 bool
856
857choice
858 prompt "SiByte SOC Stepping"
859 depends on SIBYTE_SB1xxx_SOC
860
861config CPU_SB1_PASS_1
862 bool "1250 Pass1"
863 depends on SIBYTE_SB1250
864 select CPU_HAS_PREFETCH
865
866config CPU_SB1_PASS_2_1250
867 bool "1250 An"
868 depends on SIBYTE_SB1250
869 select CPU_SB1_PASS_2
870 help
871 Also called BCM1250 Pass 2
872
873config CPU_SB1_PASS_2_2
874 bool "1250 Bn"
875 depends on SIBYTE_SB1250
876 select CPU_HAS_PREFETCH
877 help
878 Also called BCM1250 Pass 2.2
879
880config CPU_SB1_PASS_4
881 bool "1250 Cn"
882 depends on SIBYTE_SB1250
883 select CPU_HAS_PREFETCH
884 help
885 Also called BCM1250 Pass 3
886
887config CPU_SB1_PASS_2_112x
888 bool "112x Hybrid"
889 depends on SIBYTE_BCM112X
890 select CPU_SB1_PASS_2
891
892config CPU_SB1_PASS_3
893 bool "112x An"
894 depends on SIBYTE_BCM112X
895 select CPU_HAS_PREFETCH
896
897endchoice
898
899config CPU_SB1_PASS_2
900 bool
901
902config SIBYTE_HAS_LDT
903 bool
904 depends on PCI && (SIBYTE_SB1250 || SIBYTE_BCM1125H)
905 default y
906
907config SIMULATION
908 bool "Running under simulation"
909 depends on SIBYTE_SB1xxx_SOC
910 help
911 Build a kernel suitable for running under the GDB simulator.
912 Primarily adjusts the kernel's notion of time.
913
914config SIBYTE_CFE
915 bool "Booting from CFE"
916 depends on SIBYTE_SB1xxx_SOC
917 help
918 Make use of the CFE API for enumerating available memory,
919 controlling secondary CPUs, and possibly console output.
920
921config SIBYTE_CFE_CONSOLE
922 bool "Use firmware console"
923 depends on SIBYTE_CFE
924 help
925 Use the CFE API's console write routines during boot. Other console
926 options (VT console, sb1250 duart console, etc.) should not be
927 configured.
928
929config SIBYTE_STANDALONE
930 bool
931 depends on SIBYTE_SB1xxx_SOC && !SIBYTE_CFE
932 default y
933
934config SIBYTE_STANDALONE_RAM_SIZE
935 int "Memory size (in megabytes)"
936 depends on SIBYTE_STANDALONE
937 default "32"
938
939config SIBYTE_BUS_WATCHER
940 bool "Support for Bus Watcher statistics"
941 depends on SIBYTE_SB1xxx_SOC
942 help
943 Handle and keep statistics on the bus error interrupts (COR_ECC,
944 BAD_ECC, IO_BUS).
945
946config SIBYTE_BW_TRACE
947 bool "Capture bus trace before bus error"
948 depends on SIBYTE_BUS_WATCHER
949 help
950 Run a continuous bus trace, dumping the raw data as soon as
951 a ZBbus error is detected. Cannot work if ZBbus profiling
952 is turned on, and also will interfere with JTAG-based trace
953 buffer activity. Raw buffer data is dumped to console, and
954 must be processed off-line.
955
956config SIBYTE_SB1250_PROF
957 bool "Support for SB1/SOC profiling - SB1/SCD perf counters"
958 depends on SIBYTE_SB1xxx_SOC
959
960config SIBYTE_TBPROF
961 bool "Support for ZBbus profiling"
962 depends on SIBYTE_SB1xxx_SOC
963 706
964config SNI_RM200_PCI 707config SNI_RM200_PCI
965 bool "Support for SNI RM200 PCI" 708 bool "Support for SNI RM200 PCI"
966 select ARC 709 select ARC
967 select ARC32 710 select ARC32
711 select ARCH_MAY_HAVE_PC_FDC
968 select BOOT_ELF32 712 select BOOT_ELF32
969 select DMA_NONCOHERENT 713 select DMA_NONCOHERENT
970 select GENERIC_ISA_DMA 714 select GENERIC_ISA_DMA
971 select HAVE_STD_PC_SERIAL_PORT 715 select HAVE_STD_PC_SERIAL_PORT
716 select HW_HAS_EISA
972 select HW_HAS_PCI 717 select HW_HAS_PCI
973 select I8259 718 select I8259
974 select ISA 719 select ISA
720 select SYS_HAS_CPU_R4X00
975 select SYS_SUPPORTS_32BIT_KERNEL 721 select SYS_SUPPORTS_32BIT_KERNEL
976 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL 722 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
723 select SYS_SUPPORTS_BIG_ENDIAN if EXPERIMENTAL
724 select SYS_SUPPORTS_HIGHMEM
725 select SYS_SUPPORTS_LITTLE_ENDIAN
977 help 726 help
978 The SNI RM200 PCI was a MIPS-based platform manufactured by Siemens 727 The SNI RM200 PCI was a MIPS-based platform manufactured by Siemens
979 Nixdorf Informationssysteme (SNI), parent company of Pyramid 728 Nixdorf Informationssysteme (SNI), parent company of Pyramid
980 Technology and now in turn merged with Fujitsu. Say Y here to 729 Technology and now in turn merged with Fujitsu. Say Y here to
981 support this machine type. 730 support this machine type.
982 731
732config TOSHIBA_JMR3927
733 bool "Support for Toshiba JMR-TX3927 board"
734 select DMA_NONCOHERENT
735 select HW_HAS_PCI
736 select MIPS_TX3927
737 select SWAP_IO_SPACE
738 select SYS_HAS_CPU_TX39XX
739 select SYS_SUPPORTS_32BIT_KERNEL
740 select SYS_SUPPORTS_BIG_ENDIAN
741 select TOSHIBA_BOARDS
742
983config TOSHIBA_RBTX4927 743config TOSHIBA_RBTX4927
984 bool "Support for Toshiba TBTX49[23]7 board" 744 bool "Support for Toshiba TBTX49[23]7 board"
985 select DMA_NONCOHERENT 745 select DMA_NONCOHERENT
@@ -988,15 +748,51 @@ config TOSHIBA_RBTX4927
988 select I8259 748 select I8259
989 select ISA 749 select ISA
990 select SWAP_IO_SPACE 750 select SWAP_IO_SPACE
751 select SYS_HAS_CPU_TX49XX
991 select SYS_SUPPORTS_32BIT_KERNEL 752 select SYS_SUPPORTS_32BIT_KERNEL
992 select SYS_SUPPORTS_64BIT_KERNEL 753 select SYS_SUPPORTS_64BIT_KERNEL
754 select SYS_SUPPORTS_BIG_ENDIAN
755 select TOSHIBA_BOARDS
993 help 756 help
994 This Toshiba board is based on the TX4927 processor. Say Y here to 757 This Toshiba board is based on the TX4927 processor. Say Y here to
995 support this machine type 758 support this machine type
996 759
997config TOSHIBA_FPCIB0 760config TOSHIBA_RBTX4938
998 bool "FPCIB0 Backplane Support" 761 bool "Support for Toshiba RBTX4938 board"
999 depends on TOSHIBA_RBTX4927 762 select HAVE_STD_PC_SERIAL_PORT
763 select DMA_NONCOHERENT
764 select GENERIC_ISA_DMA
765 select HAS_TXX9_SERIAL
766 select HW_HAS_PCI
767 select I8259
768 select ISA
769 select SWAP_IO_SPACE
770 select SYS_HAS_CPU_TX49XX
771 select SYS_SUPPORTS_32BIT_KERNEL
772 select SYS_SUPPORTS_LITTLE_ENDIAN
773 select SYS_SUPPORTS_BIG_ENDIAN
774 select TOSHIBA_BOARDS
775 help
776 This Toshiba board is based on the TX4938 processor. Say Y here to
777 support this machine type
778
779endchoice
780
781source "arch/mips/ddb5xxx/Kconfig"
782source "arch/mips/gt64120/ev64120/Kconfig"
783source "arch/mips/jazz/Kconfig"
784source "arch/mips/ite-boards/Kconfig"
785source "arch/mips/lasat/Kconfig"
786source "arch/mips/momentum/Kconfig"
787source "arch/mips/pmc-sierra/Kconfig"
788source "arch/mips/sgi-ip27/Kconfig"
789source "arch/mips/sibyte/Kconfig"
790source "arch/mips/tx4927/Kconfig"
791source "arch/mips/tx4938/Kconfig"
792source "arch/mips/vr41xx/Kconfig"
793source "arch/mips/philips/pnx8550/common/Kconfig"
794
795endmenu
1000 796
1001config RWSEM_GENERIC_SPINLOCK 797config RWSEM_GENERIC_SPINLOCK
1002 bool 798 bool
@@ -1014,8 +810,9 @@ config GENERIC_CALIBRATE_DELAY
1014# 810#
1015config ARC 811config ARC
1016 bool 812 bool
1017 depends on SNI_RM200_PCI || SGI_IP32 || SGI_IP27 || SGI_IP22 || MIPS_MAGNUM_4000 || OLIVETTI_M700 || ACER_PICA_61 813
1018 default y 814config ARCH_MAY_HAVE_PC_FDC
815 bool
1019 816
1020config DMA_COHERENT 817config DMA_COHERENT
1021 bool 818 bool
@@ -1034,51 +831,65 @@ config DMA_NONCOHERENT
1034config DMA_NEED_PCI_MAP_STATE 831config DMA_NEED_PCI_MAP_STATE
1035 bool 832 bool
1036 833
834config OWN_DMA
835 bool
836
1037config EARLY_PRINTK 837config EARLY_PRINTK
1038 bool 838 bool
1039 depends on MACH_DECSTATION
1040 default y
1041 839
1042config GENERIC_ISA_DMA 840config GENERIC_ISA_DMA
1043 bool 841 bool
1044 depends on SNI_RM200_PCI || MIPS_MAGNUM_4000 || OLIVETTI_M700 || ACER_PICA_61 || MIPS_MALTA
1045 default y
1046 842
1047config I8259 843config I8259
1048 bool 844 bool
1049 depends on SNI_RM200_PCI || DDB5477 || DDB5476 || DDB5074 || MACH_JAZZ || MIPS_MALTA || MIPS_COBALT
1050 default y
1051 845
1052config LIMITED_DMA 846config LIMITED_DMA
1053 bool 847 bool
1054 select HIGHMEM 848 select HIGHMEM
849 select SYS_SUPPORTS_HIGHMEM
1055 850
1056config MIPS_BONITO64 851config MIPS_BONITO64
1057 bool 852 bool
1058 depends on MIPS_ATLAS || MIPS_MALTA
1059 default y
1060 853
1061config MIPS_MSC 854config MIPS_MSC
1062 bool 855 bool
1063 depends on MIPS_ATLAS || MIPS_MALTA
1064 default y
1065 856
1066config MIPS_NILE4 857config MIPS_NILE4
1067 bool 858 bool
1068 depends on LASAT
1069 default y
1070 859
1071config MIPS_DISABLE_OBSOLETE_IDE 860config MIPS_DISABLE_OBSOLETE_IDE
1072 bool 861 bool
1073 862
1074config CPU_LITTLE_ENDIAN 863#
1075 bool "Generate little endian code" 864# Endianess selection. Suffiently obscure so many users don't know what to
1076 default y if ACER_PICA_61 || CASIO_E55 || DDB5074 || DDB5476 || DDB5477 || MACH_DECSTATION || IBM_WORKPAD || LASAT || MIPS_COBALT || MIPS_ITE8172 || MIPS_IVR || SOC_AU1X00 || OLIVETTI_M700 || SNI_RM200_PCI || VICTOR_MPC30X || ZAO_CAPCELLA 865# answer,so we try hard to limit the available choices. Also the use of a
1077 default n if MIPS_EV64120 || MIPS_EV96100 || MOMENCO_OCELOT || MOMENCO_OCELOT_G || SGI_IP22 || SGI_IP27 || SGI_IP32 || TOSHIBA_JMR3927 866# choice statement should be more obvious to the user.
867#
868choice
869 prompt "Endianess selection"
1078 help 870 help
1079 Some MIPS machines can be configured for either little or big endian 871 Some MIPS machines can be configured for either little or big endian
1080 byte order. These modes require different kernels. Say Y if your 872 byte order. These modes require different kernels and a different
1081 machine is little endian, N if it's a big endian machine. 873 Linux distribution. In general there is one prefered byteorder for a
874 particular system but some systems are just as commonly used in the
875 one or the other endianess.
876
877config CPU_BIG_ENDIAN
878 bool "Big endian"
879 depends on SYS_SUPPORTS_BIG_ENDIAN
880
881config CPU_LITTLE_ENDIAN
882 bool "Little endian"
883 depends on SYS_SUPPORTS_LITTLE_ENDIAN
884 help
885
886endchoice
887
888config SYS_SUPPORTS_BIG_ENDIAN
889 bool
890
891config SYS_SUPPORTS_LITTLE_ENDIAN
892 bool
1082 893
1083config IRQ_CPU 894config IRQ_CPU
1084 bool 895 bool
@@ -1086,42 +897,69 @@ config IRQ_CPU
1086config IRQ_CPU_RM7K 897config IRQ_CPU_RM7K
1087 bool 898 bool
1088 899
900config IRQ_CPU_RM9K
901 bool
902
1089config IRQ_MV64340 903config IRQ_MV64340
1090 bool 904 bool
1091 905
1092config DDB5XXX_COMMON 906config DDB5XXX_COMMON
1093 bool 907 bool
1094 depends on DDB5074 || DDB5476 || DDB5477
1095 default y
1096 908
1097config MIPS_BOARDS_GEN 909config MIPS_BOARDS_GEN
1098 bool 910 bool
1099 depends on MIPS_ATLAS || MIPS_MALTA || MIPS_SEAD
1100 default y
1101 911
1102config MIPS_GT64111 912config MIPS_GT64111
1103 bool 913 bool
1104 depends on MIPS_COBALT
1105 default y
1106 914
1107config MIPS_GT64120 915config MIPS_GT64120
1108 bool 916 bool
1109 depends on MIPS_EV64120 || MIPS_EV96100 || LASAT || MIPS_ATLAS || MIPS_MALTA || MOMENCO_OCELOT
1110 default y
1111 917
1112config MIPS_TX3927 918config MIPS_TX3927
1113 bool 919 bool
1114 depends on TOSHIBA_JMR3927
1115 select HAS_TXX9_SERIAL 920 select HAS_TXX9_SERIAL
1116 default y
1117 921
1118config PCI_MARVELL 922config PCI_MARVELL
1119 bool 923 bool
1120 924
1121config ITE_BOARD_GEN 925config ITE_BOARD_GEN
1122 bool 926 bool
1123 depends on MIPS_IVR || MIPS_ITE8172 927
1124 default y 928config SOC_AU1000
929 bool
930 select SOC_AU1X00
931
932config SOC_AU1100
933 bool
934 select SOC_AU1X00
935
936config SOC_AU1500
937 bool
938 select SOC_AU1X00
939
940config SOC_AU1550
941 bool
942 select SOC_AU1X00
943
944config SOC_AU1200
945 bool
946 select SOC_AU1X00
947
948config SOC_AU1X00
949 bool
950 select SYS_HAS_CPU_MIPS32_R1
951 select SYS_SUPPORTS_32BIT_KERNEL
952
953config PNX8550
954 bool
955 select SOC_PNX8550
956
957config SOC_PNX8550
958 bool
959 select DMA_NONCOHERENT
960 select HW_HAS_PCI
961 select SYS_HAS_CPU_R4X00
962 select SYS_SUPPORTS_32BIT_KERNEL
1125 963
1126config SWAP_IO_SPACE 964config SWAP_IO_SPACE
1127 bool 965 bool
@@ -1148,6 +986,9 @@ config SYSCLK_100
1148 986
1149endchoice 987endchoice
1150 988
989config ARC32
990 bool
991
1151config AU1X00_USB_DEVICE 992config AU1X00_USB_DEVICE
1152 bool 993 bool
1153 depends on MIPS_PB1500 || MIPS_PB1100 || MIPS_PB1000 994 depends on MIPS_PB1500 || MIPS_PB1100 || MIPS_PB1000
@@ -1155,11 +996,7 @@ config AU1X00_USB_DEVICE
1155 996
1156config MIPS_GT96100 997config MIPS_GT96100
1157 bool 998 bool
1158 depends on MIPS_EV96100 999 select MIPS_GT64120
1159 default y
1160 help
1161 Say Y here to support the Galileo Technology GT96100 communications
1162 controller card. There is a web page at <http://www.galileot.com/>.
1163 1000
1164config IT8172_CIR 1001config IT8172_CIR
1165 bool 1002 bool
@@ -1173,8 +1010,6 @@ config IT8712
1173 1010
1174config BOOT_ELF32 1011config BOOT_ELF32
1175 bool 1012 bool
1176 depends on MACH_DECSTATION || MIPS_ATLAS || MIPS_MALTA || MOMENCO_JAGUAR_ATX || MOMENCO_OCELOT_3 || SIBYTE_SB1xxx_SOC || SGI_IP32 || SGI_IP22 || SNI_RM200_PCI
1177 default y
1178 1013
1179config MIPS_L1_CACHE_SHIFT 1014config MIPS_L1_CACHE_SHIFT
1180 int 1015 int
@@ -1182,11 +1017,6 @@ config MIPS_L1_CACHE_SHIFT
1182 default "7" if SGI_IP27 1017 default "7" if SGI_IP27
1183 default "5" 1018 default "5"
1184 1019
1185config ARC32
1186 bool
1187 depends on MACH_JAZZ || SNI_RM200_PCI || SGI_IP22 || SGI_IP32
1188 default y
1189
1190config HAVE_STD_PC_SERIAL_PORT 1020config HAVE_STD_PC_SERIAL_PORT
1191 bool 1021 bool
1192 1022
@@ -1206,30 +1036,12 @@ config ARC_PROMLIB
1206 1036
1207config ARC64 1037config ARC64
1208 bool 1038 bool
1209 depends on SGI_IP27
1210 default y
1211 1039
1212config BOOT_ELF64 1040config BOOT_ELF64
1213 bool 1041 bool
1214 depends on SGI_IP27
1215 default y
1216
1217#config MAPPED_PCI_IO y
1218# bool
1219# depends on SGI_IP27
1220# default y
1221
1222config QL_ISP_A64
1223 bool
1224 depends on SGI_IP27
1225 default y
1226 1042
1227config TOSHIBA_BOARDS 1043config TOSHIBA_BOARDS
1228 bool 1044 bool
1229 depends on TOSHIBA_JMR3927 || TOSHIBA_RBTX4927
1230 default y
1231
1232endmenu
1233 1045
1234menu "CPU selection" 1046menu "CPU selection"
1235 1047
@@ -1237,18 +1049,69 @@ choice
1237 prompt "CPU type" 1049 prompt "CPU type"
1238 default CPU_R4X00 1050 default CPU_R4X00
1239 1051
1240config CPU_MIPS32 1052config CPU_MIPS32_R1
1241 bool "MIPS32" 1053 bool "MIPS32 Release 1"
1054 depends on SYS_HAS_CPU_MIPS32_R1
1055 select CPU_HAS_PREFETCH
1242 select CPU_SUPPORTS_32BIT_KERNEL 1056 select CPU_SUPPORTS_32BIT_KERNEL
1057 help
1058 Choose this option to build a kernel for release 1 or later of the
1059 MIPS32 architecture. Most modern embedded systems with a 32-bit
1060 MIPS processor are based on a MIPS32 processor. If you know the
1061 specific type of processor in your system, choose those that one
1062 otherwise CPU_MIPS32_R1 is a safe bet for any MIPS32 system.
1063 Release 2 of the MIPS32 architecture is available since several
1064 years so chances are you even have a MIPS32 Release 2 processor
1065 in which case you should choose CPU_MIPS32_R2 instead for better
1066 performance.
1067
1068config CPU_MIPS32_R2
1069 bool "MIPS32 Release 2"
1070 depends on SYS_HAS_CPU_MIPS32_R2
1071 select CPU_HAS_PREFETCH
1072 select CPU_SUPPORTS_32BIT_KERNEL
1073 help
1074 Choose this option to build a kernel for release 2 or later of the
1075 MIPS32 architecture. Most modern embedded systems with a 32-bit
1076 MIPS processor are based on a MIPS32 processor. If you know the
1077 specific type of processor in your system, choose those that one
1078 otherwise CPU_MIPS32_R1 is a safe bet for any MIPS32 system.
1243 1079
1244config CPU_MIPS64 1080config CPU_MIPS64_R1
1245 bool "MIPS64" 1081 bool "MIPS64 Release 1"
1082 depends on SYS_HAS_CPU_MIPS64_R1
1083 select CPU_HAS_PREFETCH
1246 select CPU_SUPPORTS_32BIT_KERNEL 1084 select CPU_SUPPORTS_32BIT_KERNEL
1247 select CPU_SUPPORTS_64BIT_KERNEL 1085 select CPU_SUPPORTS_64BIT_KERNEL
1086 help
1087 Choose this option to build a kernel for release 1 or later of the
1088 MIPS64 architecture. Many modern embedded systems with a 64-bit
1089 MIPS processor are based on a MIPS64 processor. If you know the
1090 specific type of processor in your system, choose those that one
1091 otherwise CPU_MIPS64_R1 is a safe bet for any MIPS64 system.
1092 Release 2 of the MIPS64 architecture is available since several
1093 years so chances are you even have a MIPS64 Release 2 processor
1094 in which case you should choose CPU_MIPS64_R2 instead for better
1095 performance.
1096
1097config CPU_MIPS64_R2
1098 bool "MIPS64 Release 2"
1099 depends on SYS_HAS_CPU_MIPS64_R2
1100 select CPU_HAS_PREFETCH
1101 select CPU_SUPPORTS_32BIT_KERNEL
1102 select CPU_SUPPORTS_64BIT_KERNEL
1103 help
1104 Choose this option to build a kernel for release 2 or later of the
1105 MIPS64 architecture. Many modern embedded systems with a 64-bit
1106 MIPS processor are based on a MIPS64 processor. If you know the
1107 specific type of processor in your system, choose those that one
1108 otherwise CPU_MIPS64_R1 is a safe bet for any MIPS64 system.
1248 1109
1249config CPU_R3000 1110config CPU_R3000
1250 bool "R3000" 1111 bool "R3000"
1112 depends on SYS_HAS_CPU_R3000
1251 select CPU_SUPPORTS_32BIT_KERNEL 1113 select CPU_SUPPORTS_32BIT_KERNEL
1114 select CPU_SUPPORTS_HIGHMEM
1252 help 1115 help
1253 Please make sure to pick the right CPU type. Linux/MIPS is not 1116 Please make sure to pick the right CPU type. Linux/MIPS is not
1254 designed to be generic, i.e. Kernels compiled for R3000 CPUs will 1117 designed to be generic, i.e. Kernels compiled for R3000 CPUs will
@@ -1259,20 +1122,23 @@ config CPU_R3000
1259 1122
1260config CPU_TX39XX 1123config CPU_TX39XX
1261 bool "R39XX" 1124 bool "R39XX"
1125 depends on SYS_HAS_CPU_TX39XX
1262 select CPU_SUPPORTS_32BIT_KERNEL 1126 select CPU_SUPPORTS_32BIT_KERNEL
1263 1127
1264config CPU_VR41XX 1128config CPU_VR41XX
1265 bool "R41xx" 1129 bool "R41xx"
1130 depends on SYS_HAS_CPU_VR41XX
1266 select CPU_SUPPORTS_32BIT_KERNEL 1131 select CPU_SUPPORTS_32BIT_KERNEL
1267 select CPU_SUPPORTS_64BIT_KERNEL 1132 select CPU_SUPPORTS_64BIT_KERNEL
1268 help 1133 help
1269 The options selects support for the NEC VR41xx series of processors. 1134 The options selects support for the NEC VR4100 series of processors.
1270 Only choose this option if you have one of these processors as a 1135 Only choose this option if you have one of these processors as a
1271 kernel built with this option will not run on any other type of 1136 kernel built with this option will not run on any other type of
1272 processor or vice versa. 1137 processor or vice versa.
1273 1138
1274config CPU_R4300 1139config CPU_R4300
1275 bool "R4300" 1140 bool "R4300"
1141 depends on SYS_HAS_CPU_R4300
1276 select CPU_SUPPORTS_32BIT_KERNEL 1142 select CPU_SUPPORTS_32BIT_KERNEL
1277 select CPU_SUPPORTS_64BIT_KERNEL 1143 select CPU_SUPPORTS_64BIT_KERNEL
1278 help 1144 help
@@ -1280,6 +1146,7 @@ config CPU_R4300
1280 1146
1281config CPU_R4X00 1147config CPU_R4X00
1282 bool "R4x00" 1148 bool "R4x00"
1149 depends on SYS_HAS_CPU_R4X00
1283 select CPU_SUPPORTS_32BIT_KERNEL 1150 select CPU_SUPPORTS_32BIT_KERNEL
1284 select CPU_SUPPORTS_64BIT_KERNEL 1151 select CPU_SUPPORTS_64BIT_KERNEL
1285 help 1152 help
@@ -1288,11 +1155,13 @@ config CPU_R4X00
1288 1155
1289config CPU_TX49XX 1156config CPU_TX49XX
1290 bool "R49XX" 1157 bool "R49XX"
1158 depends on SYS_HAS_CPU_TX49XX
1291 select CPU_SUPPORTS_32BIT_KERNEL 1159 select CPU_SUPPORTS_32BIT_KERNEL
1292 select CPU_SUPPORTS_64BIT_KERNEL 1160 select CPU_SUPPORTS_64BIT_KERNEL
1293 1161
1294config CPU_R5000 1162config CPU_R5000
1295 bool "R5000" 1163 bool "R5000"
1164 depends on SYS_HAS_CPU_R5000
1296 select CPU_SUPPORTS_32BIT_KERNEL 1165 select CPU_SUPPORTS_32BIT_KERNEL
1297 select CPU_SUPPORTS_64BIT_KERNEL 1166 select CPU_SUPPORTS_64BIT_KERNEL
1298 help 1167 help
@@ -1300,10 +1169,14 @@ config CPU_R5000
1300 1169
1301config CPU_R5432 1170config CPU_R5432
1302 bool "R5432" 1171 bool "R5432"
1172 depends on SYS_HAS_CPU_R5432
1173 select CPU_SUPPORTS_32BIT_KERNEL
1174 select CPU_SUPPORTS_64BIT_KERNEL
1303 1175
1304config CPU_R6000 1176config CPU_R6000
1305 bool "R6000" 1177 bool "R6000"
1306 depends on EXPERIMENTAL 1178 depends on EXPERIMENTAL
1179 depends on SYS_HAS_CPU_R6000
1307 select CPU_SUPPORTS_32BIT_KERNEL 1180 select CPU_SUPPORTS_32BIT_KERNEL
1308 help 1181 help
1309 MIPS Technologies R6000 and R6000A series processors. Note these 1182 MIPS Technologies R6000 and R6000A series processors. Note these
@@ -1311,6 +1184,7 @@ config CPU_R6000
1311 1184
1312config CPU_NEVADA 1185config CPU_NEVADA
1313 bool "RM52xx" 1186 bool "RM52xx"
1187 depends on SYS_HAS_CPU_NEVADA
1314 select CPU_SUPPORTS_32BIT_KERNEL 1188 select CPU_SUPPORTS_32BIT_KERNEL
1315 select CPU_SUPPORTS_64BIT_KERNEL 1189 select CPU_SUPPORTS_64BIT_KERNEL
1316 help 1190 help
@@ -1319,6 +1193,8 @@ config CPU_NEVADA
1319config CPU_R8000 1193config CPU_R8000
1320 bool "R8000" 1194 bool "R8000"
1321 depends on EXPERIMENTAL 1195 depends on EXPERIMENTAL
1196 depends on SYS_HAS_CPU_R8000
1197 select CPU_HAS_PREFETCH
1322 select CPU_SUPPORTS_64BIT_KERNEL 1198 select CPU_SUPPORTS_64BIT_KERNEL
1323 help 1199 help
1324 MIPS Technologies R8000 processors. Note these processors are 1200 MIPS Technologies R8000 processors. Note these processors are
@@ -1326,25 +1202,151 @@ config CPU_R8000
1326 1202
1327config CPU_R10000 1203config CPU_R10000
1328 bool "R10000" 1204 bool "R10000"
1205 depends on SYS_HAS_CPU_R10000
1206 select CPU_HAS_PREFETCH
1329 select CPU_SUPPORTS_32BIT_KERNEL 1207 select CPU_SUPPORTS_32BIT_KERNEL
1330 select CPU_SUPPORTS_64BIT_KERNEL 1208 select CPU_SUPPORTS_64BIT_KERNEL
1209 select CPU_SUPPORTS_HIGHMEM
1331 help 1210 help
1332 MIPS Technologies R10000-series processors. 1211 MIPS Technologies R10000-series processors.
1333 1212
1334config CPU_RM7000 1213config CPU_RM7000
1335 bool "RM7000" 1214 bool "RM7000"
1215 depends on SYS_HAS_CPU_RM7000
1216 select CPU_HAS_PREFETCH
1336 select CPU_SUPPORTS_32BIT_KERNEL 1217 select CPU_SUPPORTS_32BIT_KERNEL
1337 select CPU_SUPPORTS_64BIT_KERNEL 1218 select CPU_SUPPORTS_64BIT_KERNEL
1219 select CPU_SUPPORTS_HIGHMEM
1338 1220
1339config CPU_RM9000 1221config CPU_RM9000
1340 bool "RM9000" 1222 bool "RM9000"
1223 depends on SYS_HAS_CPU_RM9000
1224 select CPU_HAS_PREFETCH
1341 select CPU_SUPPORTS_32BIT_KERNEL 1225 select CPU_SUPPORTS_32BIT_KERNEL
1342 select CPU_SUPPORTS_64BIT_KERNEL 1226 select CPU_SUPPORTS_64BIT_KERNEL
1227 select CPU_SUPPORTS_HIGHMEM
1343 1228
1344config CPU_SB1 1229config CPU_SB1
1345 bool "SB1" 1230 bool "SB1"
1231 depends on SYS_HAS_CPU_SB1
1346 select CPU_SUPPORTS_32BIT_KERNEL 1232 select CPU_SUPPORTS_32BIT_KERNEL
1347 select CPU_SUPPORTS_64BIT_KERNEL 1233 select CPU_SUPPORTS_64BIT_KERNEL
1234 select CPU_SUPPORTS_HIGHMEM
1235
1236endchoice
1237
1238config SYS_HAS_CPU_MIPS32_R1
1239 bool
1240
1241config SYS_HAS_CPU_MIPS32_R2
1242 bool
1243
1244config SYS_HAS_CPU_MIPS64_R1
1245 bool
1246
1247config SYS_HAS_CPU_MIPS64_R2
1248 bool
1249
1250config SYS_HAS_CPU_R3000
1251 bool
1252
1253config SYS_HAS_CPU_TX39XX
1254 bool
1255
1256config SYS_HAS_CPU_VR41XX
1257 bool
1258
1259config SYS_HAS_CPU_R4300
1260 bool
1261
1262config SYS_HAS_CPU_R4X00
1263 bool
1264
1265config SYS_HAS_CPU_TX49XX
1266 bool
1267
1268config SYS_HAS_CPU_R5000
1269 bool
1270
1271config SYS_HAS_CPU_R5432
1272 bool
1273
1274config SYS_HAS_CPU_R6000
1275 bool
1276
1277config SYS_HAS_CPU_NEVADA
1278 bool
1279
1280config SYS_HAS_CPU_R8000
1281 bool
1282
1283config SYS_HAS_CPU_R10000
1284 bool
1285
1286config SYS_HAS_CPU_RM7000
1287 bool
1288
1289config SYS_HAS_CPU_RM9000
1290 bool
1291
1292config SYS_HAS_CPU_SB1
1293 bool
1294
1295endmenu
1296
1297#
1298# These two indicate any levelof the MIPS32 and MIPS64 architecture
1299#
1300config CPU_MIPS32
1301 bool
1302 default y if CPU_MIPS32_R1 || CPU_MIPS32_R2
1303
1304config CPU_MIPS64
1305 bool
1306 default y if CPU_MIPS64_R1 || CPU_MIPS64_R2
1307
1308#
1309# These two indicate the revision of the architecture, either 32 bot 64 bit.
1310#
1311config CPU_MIPSR1
1312 bool
1313 default y if CPU_MIPS32_R1 || CPU_MIPS64_R1
1314
1315config CPU_MIPSR2
1316 bool
1317 default y if CPU_MIPS32_R2 || CPU_MIPS64_R2
1318
1319config SYS_SUPPORTS_32BIT_KERNEL
1320 bool
1321config SYS_SUPPORTS_64BIT_KERNEL
1322 bool
1323config CPU_SUPPORTS_32BIT_KERNEL
1324 bool
1325config CPU_SUPPORTS_64BIT_KERNEL
1326 bool
1327
1328menu "Kernel type"
1329
1330choice
1331
1332 prompt "Kernel code model"
1333 help
1334 You should only select this option if you have a workload that
1335 actually benefits from 64-bit processing or if your machine has
1336 large memory. You will only be presented a single option in this
1337 menu if your system does not support both 32-bit and 64-bit kernels.
1338
1339config 32BIT
1340 bool "32-bit kernel"
1341 depends on CPU_SUPPORTS_32BIT_KERNEL && SYS_SUPPORTS_32BIT_KERNEL
1342 select TRAD_SIGNALS
1343 help
1344 Select this option if you want to build a 32-bit kernel.
1345config 64BIT
1346 bool "64-bit kernel"
1347 depends on CPU_SUPPORTS_64BIT_KERNEL && SYS_SUPPORTS_64BIT_KERNEL
1348 help
1349 Select this option if you want to build a 64-bit kernel.
1348 1350
1349endchoice 1351endchoice
1350 1352
@@ -1416,12 +1418,43 @@ config SIBYTE_DMA_PAGEOPS
1416 SiByte Linux port. Seems to give a small performance benefit. 1418 SiByte Linux port. Seems to give a small performance benefit.
1417 1419
1418config CPU_HAS_PREFETCH 1420config CPU_HAS_PREFETCH
1419 bool "Enable prefetches" if CPU_SB1 && !CPU_SB1_PASS_2 1421 bool
1420 default y if CPU_MIPS32 || CPU_MIPS64 || CPU_RM7000 || CPU_RM9000 || CPU_R10000 1422
1423config MIPS_MT
1424 bool "Enable MIPS MT"
1425
1426choice
1427 prompt "MIPS MT options"
1428 depends on MIPS_MT
1421 1429
1422config VTAG_ICACHE 1430config MIPS_MT_SMP
1423 bool "Support for Virtual Tagged I-cache" if CPU_MIPS64 || CPU_MIPS32 1431 bool "Use 1 TC on each available VPE for SMP"
1424 default y if CPU_SB1 1432 select SMP
1433
1434config MIPS_VPE_LOADER
1435 bool "VPE loader support."
1436 depends on MIPS_MT
1437 help
1438 Includes a loader for loading an elf relocatable object
1439 onto another VPE and running it.
1440
1441endchoice
1442
1443config MIPS_VPE_LOADER_TOM
1444 bool "Load VPE program into memory hidden from linux"
1445 depends on MIPS_VPE_LOADER
1446 default y
1447 help
1448 The loader can use memory that is present but has been hidden from
1449 Linux using the kernel command line option "mem=xxMB". It's up to
1450 you to ensure the amount you put in the option and the space your
1451 program requires is less or equal to the amount physically present.
1452
1453# this should possibly be in drivers/char, but it is rather cpu related. Hmmm
1454config MIPS_VPE_APSP_API
1455 bool "Enable support for AP/SP API (RTLX)"
1456 depends on MIPS_VPE_LOADER
1457 help
1425 1458
1426config SB1_PASS_1_WORKAROUNDS 1459config SB1_PASS_1_WORKAROUNDS
1427 bool 1460 bool
@@ -1440,7 +1473,7 @@ config SB1_PASS_2_1_WORKAROUNDS
1440 1473
1441config 64BIT_PHYS_ADDR 1474config 64BIT_PHYS_ADDR
1442 bool "Support for 64-bit physical address space" 1475 bool "Support for 64-bit physical address space"
1443 depends on (CPU_R4X00 || CPU_R5000 || CPU_RM7000 || CPU_RM9000 || CPU_R10000 || CPU_SB1 || CPU_MIPS32 || CPU_MIPS64) && 32BIT 1476 depends on (CPU_R4X00 || CPU_R5000 || CPU_RM7000 || CPU_RM9000 || CPU_R10000 || CPU_SB1 || CPU_MIPS32_R1 || CPU_MIPS64_R1) && 32BIT
1444 1477
1445config CPU_ADVANCED 1478config CPU_ADVANCED
1446 bool "Override CPU Options" 1479 bool "Override CPU Options"
@@ -1463,7 +1496,7 @@ config CPU_HAS_LLSC
1463 1496
1464config CPU_HAS_LLDSCD 1497config CPU_HAS_LLDSCD
1465 bool "lld/scd Instructions available" if CPU_ADVANCED 1498 bool "lld/scd Instructions available" if CPU_ADVANCED
1466 default y if !CPU_ADVANCED && !CPU_R3000 && !CPU_VR41XX && !CPU_TX39XX && !CPU_MIPS32 1499 default y if !CPU_ADVANCED && !CPU_R3000 && !CPU_VR41XX && !CPU_TX39XX && !CPU_MIPS32_R1
1467 help 1500 help
1468 Say Y here if your CPU has the lld and scd instructions, the 64-bit 1501 Say Y here if your CPU has the lld and scd instructions, the 64-bit
1469 equivalents of ll and sc. Say Y here for better performance, N if 1502 equivalents of ll and sc. Say Y here for better performance, N if
@@ -1477,12 +1510,52 @@ config CPU_HAS_WB
1477 machines which require flushing of write buffers in software. Saying 1510 machines which require flushing of write buffers in software. Saying
1478 Y is the safe option; N may result in kernel malfunction and crashes. 1511 Y is the safe option; N may result in kernel malfunction and crashes.
1479 1512
1513menu "MIPSR2 Interrupt handling"
1514 depends on CPU_MIPSR2 && CPU_ADVANCED
1515
1516config CPU_MIPSR2_IRQ_VI
1517 bool "Vectored interrupt mode"
1518 help
1519 Vectored interrupt mode allowing faster dispatching of interrupts.
1520 The board support code needs to be written to take advantage of this
1521 mode. Compatibility code is included to allow the kernel to run on
1522 a CPU that does not support vectored interrupts. It's safe to
1523 say Y here.
1524
1525config CPU_MIPSR2_IRQ_EI
1526 bool "External interrupt controller mode"
1527 help
1528 Extended interrupt mode takes advantage of an external interrupt
1529 controller to allow fast dispatching from many possible interrupt
1530 sources. Say N unless you know that external interrupt support is
1531 required.
1532
1533config CPU_MIPSR2_SRS
1534 bool "Make shadow set registers available for interrupt handlers"
1535 depends on CPU_MIPSR2_IRQ_VI || CPU_MIPSR2_IRQ_EI
1536 help
1537 Allow the kernel to use shadow register sets for fast interrupts.
1538 Interrupt handlers must be specially written to use shadow sets.
1539 Say N unless you know that shadow register set upport is needed.
1540endmenu
1541
1480config CPU_HAS_SYNC 1542config CPU_HAS_SYNC
1481 bool 1543 bool
1482 depends on !CPU_R3000 1544 depends on !CPU_R3000
1483 default y 1545 default y
1484 1546
1485# 1547#
1548# Use the generic interrupt handling code in kernel/irq/:
1549#
1550config GENERIC_HARDIRQS
1551 bool
1552 default y
1553
1554config GENERIC_IRQ_PROBE
1555 bool
1556 default y
1557
1558#
1486# - Highmem only makes sense for the 32-bit kernel. 1559# - Highmem only makes sense for the 32-bit kernel.
1487# - The current highmem code will only work properly on physically indexed 1560# - The current highmem code will only work properly on physically indexed
1488# caches such as R3000, SB1, R7000 or those that look like they're virtually 1561# caches such as R3000, SB1, R7000 or those that look like they're virtually
@@ -1491,14 +1564,19 @@ config CPU_HAS_SYNC
1491# where it's known to be safe. This will not offer highmem on a few systems 1564# where it's known to be safe. This will not offer highmem on a few systems
1492# such as MIPS32 and MIPS64 CPUs which may have virtual and physically 1565# such as MIPS32 and MIPS64 CPUs which may have virtual and physically
1493# indexed CPUs but we're playing safe. 1566# indexed CPUs but we're playing safe.
1494# - We should not offer highmem for system of which we already know that they 1567# - We use SYS_SUPPORTS_HIGHMEM to offer highmem only for systems where we
1495# don't have memory configurations that could gain from highmem support in 1568# know they might have memory configurations that could make use of highmem
1496# the kernel because they don't support configurations with RAM at physical 1569# support.
1497# addresses > 0x20000000.
1498# 1570#
1499config HIGHMEM 1571config HIGHMEM
1500 bool "High Memory Support" 1572 bool "High Memory Support"
1501 depends on 32BIT && (CPU_R3000 || CPU_SB1 || CPU_R7000 || CPU_RM9000 || CPU_R10000) && !(MACH_DECSTATION || MOMENCO_JAGUAR_ATX) 1573 depends on 32BIT && CPU_SUPPORTS_HIGHMEM && SYS_SUPPORTS_HIGHMEM
1574
1575config CPU_SUPPORTS_HIGHMEM
1576 bool
1577
1578config SYS_SUPPORTS_HIGHMEM
1579 bool
1502 1580
1503config ARCH_FLATMEM_ENABLE 1581config ARCH_FLATMEM_ENABLE
1504 def_bool y 1582 def_bool y
@@ -1508,7 +1586,7 @@ source "mm/Kconfig"
1508 1586
1509config SMP 1587config SMP
1510 bool "Multi-Processing support" 1588 bool "Multi-Processing support"
1511 depends on CPU_RM9000 || (SIBYTE_SB1250 && !SIBYTE_STANDALONE) || SGI_IP27 1589 depends on CPU_RM9000 || ((SIBYTE_BCM1x80 || SIBYTE_BCM1x55 || SIBYTE_SB1250) && !SIBYTE_STANDALONE) || SGI_IP27 || MIPS_MT_SMP
1512 ---help--- 1590 ---help---
1513 This enables support for systems with more than one CPU. If you have 1591 This enables support for systems with more than one CPU. If you have
1514 a system with only one CPU, like most personal computers, say N. If 1592 a system with only one CPU, like most personal computers, say N. If
@@ -1543,14 +1621,7 @@ config NR_CPUS
1543 This is purely to save memory - each supported CPU adds 1621 This is purely to save memory - each supported CPU adds
1544 approximately eight kilobytes to the kernel image. 1622 approximately eight kilobytes to the kernel image.
1545 1623
1546config PREEMPT 1624source "kernel/Kconfig.preempt"
1547 bool "Preemptible Kernel"
1548 help
1549 This option reduces the latency of the kernel when reacting to
1550 real-time or interactive events by allowing a low priority process to
1551 be preempted even if it is in kernel mode executing a system call.
1552 This allows applications to run more reliably even when the system is
1553 under load.
1554 1625
1555config RTC_DS1742 1626config RTC_DS1742
1556 bool "DS1742 BRAM/RTC support" 1627 bool "DS1742 BRAM/RTC support"
@@ -1566,14 +1637,16 @@ config MIPS_INSANE_LARGE
1566 This will result in additional memory usage, so it is not 1637 This will result in additional memory usage, so it is not
1567 recommended for normal users. 1638 recommended for normal users.
1568 1639
1640endmenu
1641
1569config RWSEM_GENERIC_SPINLOCK 1642config RWSEM_GENERIC_SPINLOCK
1570 bool 1643 bool
1571 default y 1644 default y
1572 1645
1573endmenu
1574
1575menu "Bus options (PCI, PCMCIA, EISA, ISA, TC)" 1646menu "Bus options (PCI, PCMCIA, EISA, ISA, TC)"
1576 1647
1648config HW_HAS_EISA
1649 bool
1577config HW_HAS_PCI 1650config HW_HAS_PCI
1578 bool 1651 bool
1579 1652
@@ -1607,7 +1680,7 @@ config ISA
1607 1680
1608config EISA 1681config EISA
1609 bool "EISA support" 1682 bool "EISA support"
1610 depends on SGI_IP22 || SNI_RM200_PCI 1683 depends on HW_HAS_EISA
1611 select ISA 1684 select ISA
1612 ---help--- 1685 ---help---
1613 The Extended Industry Standard Architecture (EISA) bus was 1686 The Extended Industry Standard Architecture (EISA) bus was
@@ -1641,12 +1714,6 @@ config MMU
1641 bool 1714 bool
1642 default y 1715 default y
1643 1716
1644config MCA
1645 bool
1646
1647config SBUS
1648 bool
1649
1650source "drivers/pcmcia/Kconfig" 1717source "drivers/pcmcia/Kconfig"
1651 1718
1652source "drivers/pci/hotplug/Kconfig" 1719source "drivers/pci/hotplug/Kconfig"
@@ -1659,7 +1726,6 @@ source "fs/Kconfig.binfmt"
1659 1726
1660config TRAD_SIGNALS 1727config TRAD_SIGNALS
1661 bool 1728 bool
1662 default y if 32BIT
1663 1729
1664config BUILD_ELF64 1730config BUILD_ELF64
1665 bool "Use 64-bit ELF format for building" 1731 bool "Use 64-bit ELF format for building"
@@ -1678,7 +1744,7 @@ config BUILD_ELF64
1678 1744
1679config BINFMT_IRIX 1745config BINFMT_IRIX
1680 bool "Include IRIX binary compatibility" 1746 bool "Include IRIX binary compatibility"
1681 depends on !CPU_LITTLE_ENDIAN && 32BIT && BROKEN 1747 depends on CPU_BIG_ENDIAN && 32BIT && BROKEN
1682 1748
1683config MIPS32_COMPAT 1749config MIPS32_COMPAT
1684 bool "Kernel support for Linux/MIPS 32-bit binary compatibility" 1750 bool "Kernel support for Linux/MIPS 32-bit binary compatibility"
@@ -1718,9 +1784,26 @@ config BINFMT_ELF32
1718 bool 1784 bool
1719 default y if MIPS32_O32 || MIPS32_N32 1785 default y if MIPS32_O32 || MIPS32_N32
1720 1786
1787config SECCOMP
1788 bool "Enable seccomp to safely compute untrusted bytecode"
1789 depends on PROC_FS && BROKEN
1790 default y
1791 help
1792 This kernel feature is useful for number crunching applications
1793 that may need to compute untrusted bytecode during their
1794 execution. By using pipes or other transports made available to
1795 the process as file descriptors supporting the read/write
1796 syscalls, it's possible to isolate those applications in
1797 their own address space using seccomp. Once seccomp is
1798 enabled via /proc/<pid>/seccomp, it cannot be disabled
1799 and the task is only allowed to execute a few safe syscalls
1800 defined by each seccomp mode.
1801
1802 If unsure, say Y. Only embedded should say N here.
1803
1721config PM 1804config PM
1722 bool "Power Management support (EXPERIMENTAL)" 1805 bool "Power Management support (EXPERIMENTAL)"
1723 depends on EXPERIMENTAL && MACH_AU1X00 1806 depends on EXPERIMENTAL && SOC_AU1X00
1724 1807
1725endmenu 1808endmenu
1726 1809
@@ -1730,6 +1813,8 @@ source "drivers/Kconfig"
1730 1813
1731source "fs/Kconfig" 1814source "fs/Kconfig"
1732 1815
1816source "arch/mips/oprofile/Kconfig"
1817
1733source "arch/mips/Kconfig.debug" 1818source "arch/mips/Kconfig.debug"
1734 1819
1735source "security/Kconfig" 1820source "security/Kconfig"
@@ -1737,18 +1822,3 @@ source "security/Kconfig"
1737source "crypto/Kconfig" 1822source "crypto/Kconfig"
1738 1823
1739source "lib/Kconfig" 1824source "lib/Kconfig"
1740
1741#
1742# Use the generic interrupt handling code in kernel/irq/:
1743#
1744config GENERIC_HARDIRQS
1745 bool
1746 default y
1747
1748config GENERIC_IRQ_PROBE
1749 bool
1750 default y
1751
1752config ISA_DMA_API
1753 bool
1754 default y
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 346e803f153b..02692027730a 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -52,6 +52,21 @@ ifdef CONFIG_CROSSCOMPILE
52CROSS_COMPILE := $(tool-prefix) 52CROSS_COMPILE := $(tool-prefix)
53endif 53endif
54 54
55CHECKFLAGS-y += -D__linux__ -D__mips__ \
56 -D_ABIO32=1 \
57 -D_ABIN32=2 \
58 -D_ABI64=3
59CHECKFLAGS-$(CONFIG_32BIT) += -D_MIPS_SIM=_ABIO32 \
60 -D_MIPS_SZLONG=32 \
61 -D__PTRDIFF_TYPE__=int
62CHECKFLAGS-$(CONFIG_64BIT) += -m64 -D_MIPS_SIM=_ABI64 \
63 -D_MIPS_SZLONG=64 \
64 -D__PTRDIFF_TYPE__="long int"
65CHECKFLAGS-$(CONFIG_CPU_BIG_ENDIAN) += -D__MIPSEB__
66CHECKFLAGS-$(CONFIG_CPU_LITTLE_ENDIAN) += -D__MIPSEL__
67
68CHECKFLAGS = $(CHECKFLAGS-y)
69
55ifdef CONFIG_BUILD_ELF64 70ifdef CONFIG_BUILD_ELF64
56gas-abi = 64 71gas-abi = 64
57ld-emul = $(64bit-emul) 72ld-emul = $(64bit-emul)
@@ -79,9 +94,18 @@ endif
79cflags-y += -I $(TOPDIR)/include/asm/gcc 94cflags-y += -I $(TOPDIR)/include/asm/gcc
80cflags-y += -G 0 -mno-abicalls -fno-pic -pipe 95cflags-y += -G 0 -mno-abicalls -fno-pic -pipe
81cflags-y += $(call cc-option, -finline-limit=100000) 96cflags-y += $(call cc-option, -finline-limit=100000)
82LDFLAGS_vmlinux += -G 0 -static -n 97LDFLAGS_vmlinux += -G 0 -static -n -nostdlib
83MODFLAGS += -mlong-calls 98MODFLAGS += -mlong-calls
84 99
100#
101# We explicitly add the endianness specifier if needed, this allows
102# to compile kernels with a toolchain for the other endianness. We
103# carefully avoid to add it redundantly because gcc 3.3/3.4 complains
104# when fed the toolchain default!
105#
106cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' && echo -EB)
107cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL)
108
85cflags-$(CONFIG_SB1XXX_CORELIS) += -mno-sched-prolog -fno-omit-frame-pointer 109cflags-$(CONFIG_SB1XXX_CORELIS) += -mno-sched-prolog -fno-omit-frame-pointer
86 110
87# 111#
@@ -167,14 +191,22 @@ cflags-$(CONFIG_CPU_TX49XX) += \
167 $(call set_gccflags,r4600,mips3,r4600,mips3,mips2) \ 191 $(call set_gccflags,r4600,mips3,r4600,mips3,mips2) \
168 -Wa,--trap 192 -Wa,--trap
169 193
170cflags-$(CONFIG_CPU_MIPS32) += \ 194cflags-$(CONFIG_CPU_MIPS32_R1) += \
171 $(call set_gccflags,mips32,mips32,r4600,mips3,mips2) \ 195 $(call set_gccflags,mips32,mips32,r4600,mips3,mips2) \
172 -Wa,--trap 196 -Wa,--trap
173 197
174cflags-$(CONFIG_CPU_MIPS64) += \ 198cflags-$(CONFIG_CPU_MIPS32_R2) += \
199 $(call set_gccflags,mips32r2,mips32r2,r4600,mips3,mips2) \
200 -Wa,--trap
201
202cflags-$(CONFIG_CPU_MIPS64_R1) += \
175 $(call set_gccflags,mips64,mips64,r4600,mips3,mips2) \ 203 $(call set_gccflags,mips64,mips64,r4600,mips3,mips2) \
176 -Wa,--trap 204 -Wa,--trap
177 205
206cflags-$(CONFIG_CPU_MIPS64_R2) += \
207 $(call set_gccflags,mips64r2,mips64r2,r4600,mips3,mips2) \
208 -Wa,--trap
209
178cflags-$(CONFIG_CPU_R5000) += \ 210cflags-$(CONFIG_CPU_R5000) += \
179 $(call set_gccflags,r5000,mips4,r5000,mips4,mips2) \ 211 $(call set_gccflags,r5000,mips4,r5000,mips4,mips2) \
180 -Wa,--trap 212 -Wa,--trap
@@ -196,6 +228,7 @@ cflags-$(CONFIG_CPU_RM9000) += \
196 $(call set_gccflags,rm9000,mips4,r5000,mips4,mips2) \ 228 $(call set_gccflags,rm9000,mips4,r5000,mips4,mips2) \
197 -Wa,--trap 229 -Wa,--trap
198 230
231
199cflags-$(CONFIG_CPU_SB1) += \ 232cflags-$(CONFIG_CPU_SB1) += \
200 $(call set_gccflags,sb1,mips64,r5000,mips4,mips2) \ 233 $(call set_gccflags,sb1,mips64,r5000,mips4,mips2) \
201 -Wa,--trap 234 -Wa,--trap
@@ -266,6 +299,13 @@ cflags-$(CONFIG_MIPS_PB1550) += -Iinclude/asm-mips/mach-pb1x00
266load-$(CONFIG_MIPS_PB1550) += 0xffffffff80100000 299load-$(CONFIG_MIPS_PB1550) += 0xffffffff80100000
267 300
268# 301#
302# AMD Alchemy Pb1200 eval board
303#
304libs-$(CONFIG_MIPS_PB1200) += arch/mips/au1000/pb1200/
305cflags-$(CONFIG_MIPS_PB1200) += -Iinclude/asm-mips/mach-pb1x00
306load-$(CONFIG_MIPS_PB1200) += 0xffffffff80100000
307
308#
269# AMD Alchemy Db1000 eval board 309# AMD Alchemy Db1000 eval board
270# 310#
271libs-$(CONFIG_MIPS_DB1000) += arch/mips/au1000/db1x00/ 311libs-$(CONFIG_MIPS_DB1000) += arch/mips/au1000/db1x00/
@@ -294,6 +334,13 @@ cflags-$(CONFIG_MIPS_DB1550) += -Iinclude/asm-mips/mach-db1x00
294load-$(CONFIG_MIPS_DB1550) += 0xffffffff80100000 334load-$(CONFIG_MIPS_DB1550) += 0xffffffff80100000
295 335
296# 336#
337# AMD Alchemy Db1200 eval board
338#
339libs-$(CONFIG_MIPS_DB1200) += arch/mips/au1000/pb1200/
340cflags-$(CONFIG_MIPS_DB1200) += -Iinclude/asm-mips/mach-db1x00
341load-$(CONFIG_MIPS_DB1200) += 0xffffffff80100000
342
343#
297# AMD Alchemy Bosporus eval board 344# AMD Alchemy Bosporus eval board
298# 345#
299libs-$(CONFIG_MIPS_BOSPORUS) += arch/mips/au1000/db1x00/ 346libs-$(CONFIG_MIPS_BOSPORUS) += arch/mips/au1000/db1x00/
@@ -323,6 +370,7 @@ load-$(CONFIG_MIPS_XXS1500) += 0xffffffff80100000
323# Cobalt Server 370# Cobalt Server
324# 371#
325core-$(CONFIG_MIPS_COBALT) += arch/mips/cobalt/ 372core-$(CONFIG_MIPS_COBALT) += arch/mips/cobalt/
373cflags-$(CONFIG_MIPS_COBALT) += -Iinclude/asm-mips/cobalt
326load-$(CONFIG_MIPS_COBALT) += 0xffffffff80080000 374load-$(CONFIG_MIPS_COBALT) += 0xffffffff80080000
327 375
328# 376#
@@ -389,6 +437,13 @@ core-$(CONFIG_MIPS_SEAD) += arch/mips/mips-boards/sead/
389load-$(CONFIG_MIPS_SEAD) += 0xffffffff80100000 437load-$(CONFIG_MIPS_SEAD) += 0xffffffff80100000
390 438
391# 439#
440# MIPS SIM
441#
442core-$(CONFIG_MIPS_SIM) += arch/mips/mips-boards/sim/
443cflags-$(CONFIG_MIPS_SIM) += -Iinclude/asm-mips/mach-sim
444load-$(CONFIG_MIPS_SIM) += 0x80100000
445
446#
392# Momentum Ocelot board 447# Momentum Ocelot board
393# 448#
394# The Ocelot setup.o must be linked early - it does the ioremap() for the 449# The Ocelot setup.o must be linked early - it does the ioremap() for the
@@ -514,6 +569,19 @@ load-$(CONFIG_CASIO_E55) += 0xffffffff80004000
514load-$(CONFIG_TANBAC_TB022X) += 0xffffffff80000000 569load-$(CONFIG_TANBAC_TB022X) += 0xffffffff80000000
515 570
516# 571#
572# Common Philips PNX8550
573#
574core-$(CONFIG_SOC_PNX8550) += arch/mips/philips/pnx8550/common/
575cflags-$(CONFIG_SOC_PNX8550) += -Iinclude/asm-mips/mach-pnx8550
576
577#
578# Philips PNX8550 JBS board
579#
580libs-$(CONFIG_PNX8550_JBS) += arch/mips/philips/pnx8550/jbs/
581#cflags-$(CONFIG_PNX8550_JBS) += -Iinclude/asm-mips/mach-pnx8550
582load-$(CONFIG_PNX8550_JBS) += 0xffffffff80060000
583
584#
517# SGI IP22 (Indy/Indigo2) 585# SGI IP22 (Indy/Indigo2)
518# 586#
519# Set the load address to >= 0xffffffff88069000 if you want to leave space for 587# Set the load address to >= 0xffffffff88069000 if you want to leave space for
@@ -582,10 +650,20 @@ load-$(CONFIG_SGI_IP32) += 0xffffffff80004000
582# removed (as happens, even if they have __initcall/module_init) 650# removed (as happens, even if they have __initcall/module_init)
583# 651#
584core-$(CONFIG_SIBYTE_BCM112X) += arch/mips/sibyte/sb1250/ 652core-$(CONFIG_SIBYTE_BCM112X) += arch/mips/sibyte/sb1250/
585cflags-$(CONFIG_SIBYTE_BCM112X) += -Iinclude/asm-mips/mach-sibyte 653cflags-$(CONFIG_SIBYTE_BCM112X) += -Iinclude/asm-mips/mach-sibyte \
654 -DSIBYTE_HDR_FEATURES=SIBYTE_HDR_FMASK_1250_112x_ALL
586 655
587core-$(CONFIG_SIBYTE_SB1250) += arch/mips/sibyte/sb1250/ 656core-$(CONFIG_SIBYTE_SB1250) += arch/mips/sibyte/sb1250/
588cflags-$(CONFIG_SIBYTE_SB1250) += -Iinclude/asm-mips/mach-sibyte 657cflags-$(CONFIG_SIBYTE_SB1250) += -Iinclude/asm-mips/mach-sibyte \
658 -DSIBYTE_HDR_FEATURES=SIBYTE_HDR_FMASK_1250_112x_ALL
659
660core-$(CONFIG_SIBYTE_BCM1x55) += arch/mips/sibyte/bcm1480/
661cflags-$(CONFIG_SIBYTE_BCM1x55) += -Iinclude/asm-mips/mach-sibyte \
662 -DSIBYTE_HDR_FEATURES=SIBYTE_HDR_FMASK_1480_ALL
663
664core-$(CONFIG_SIBYTE_BCM1x80) += arch/mips/sibyte/bcm1480/
665cflags-$(CONFIG_SIBYTE_BCM1x80) += -Iinclude/asm-mips/mach-sibyte \
666 -DSIBYTE_HDR_FEATURES=SIBYTE_HDR_FMASK_1480_ALL
589 667
590# 668#
591# Sibyte BCM91120x (Carmel) board 669# Sibyte BCM91120x (Carmel) board
@@ -593,6 +671,7 @@ cflags-$(CONFIG_SIBYTE_SB1250) += -Iinclude/asm-mips/mach-sibyte
593# Sibyte BCM91125C (CRhone) board 671# Sibyte BCM91125C (CRhone) board
594# Sibyte BCM91125E (Rhone) board 672# Sibyte BCM91125E (Rhone) board
595# Sibyte SWARM board 673# Sibyte SWARM board
674# Sibyte BCM91x80 (BigSur) board
596# 675#
597libs-$(CONFIG_SIBYTE_CARMEL) += arch/mips/sibyte/swarm/ 676libs-$(CONFIG_SIBYTE_CARMEL) += arch/mips/sibyte/swarm/
598load-$(CONFIG_SIBYTE_CARMEL) := 0xffffffff80100000 677load-$(CONFIG_SIBYTE_CARMEL) := 0xffffffff80100000
@@ -606,6 +685,8 @@ libs-$(CONFIG_SIBYTE_SENTOSA) += arch/mips/sibyte/swarm/
606load-$(CONFIG_SIBYTE_SENTOSA) := 0xffffffff80100000 685load-$(CONFIG_SIBYTE_SENTOSA) := 0xffffffff80100000
607libs-$(CONFIG_SIBYTE_SWARM) += arch/mips/sibyte/swarm/ 686libs-$(CONFIG_SIBYTE_SWARM) += arch/mips/sibyte/swarm/
608load-$(CONFIG_SIBYTE_SWARM) := 0xffffffff80100000 687load-$(CONFIG_SIBYTE_SWARM) := 0xffffffff80100000
688libs-$(CONFIG_SIBYTE_BIGSUR) += arch/mips/sibyte/swarm/
689load-$(CONFIG_SIBYTE_BIGSUR) := 0xffffffff80100000
609 690
610# 691#
611# SNI RM200 PCI 692# SNI RM200 PCI
@@ -629,6 +710,13 @@ core-$(CONFIG_TOSHIBA_RBTX4927) += arch/mips/tx4927/toshiba_rbtx4927/
629core-$(CONFIG_TOSHIBA_RBTX4927) += arch/mips/tx4927/common/ 710core-$(CONFIG_TOSHIBA_RBTX4927) += arch/mips/tx4927/common/
630load-$(CONFIG_TOSHIBA_RBTX4927) += 0xffffffff80020000 711load-$(CONFIG_TOSHIBA_RBTX4927) += 0xffffffff80020000
631 712
713#
714# Toshiba RBTX4938 board
715#
716core-$(CONFIG_TOSHIBA_RBTX4938) += arch/mips/tx4938/toshiba_rbtx4938/
717core-$(CONFIG_TOSHIBA_RBTX4938) += arch/mips/tx4938/common/
718load-$(CONFIG_TOSHIBA_RBTX4938) += 0xffffffff80100000
719
632cflags-y += -Iinclude/asm-mips/mach-generic 720cflags-y += -Iinclude/asm-mips/mach-generic
633drivers-$(CONFIG_PCI) += arch/mips/pci/ 721drivers-$(CONFIG_PCI) += arch/mips/pci/
634 722
@@ -701,10 +789,29 @@ ifdef CONFIG_BOOT_ELF64
701all: $(vmlinux-64) 789all: $(vmlinux-64)
702endif 790endif
703 791
792ifdef CONFIG_MIPS_ATLAS
793all: vmlinux.srec
794endif
795
796ifdef CONFIG_MIPS_MALTA
797all: vmlinux.srec
798endif
799
800ifdef CONFIG_MIPS_SEAD
801all: vmlinux.srec
802endif
803
804ifdef CONFIG_QEMU
805all: vmlinux.bin
806endif
807
704ifdef CONFIG_SNI_RM200_PCI 808ifdef CONFIG_SNI_RM200_PCI
705all: vmlinux.ecoff 809all: vmlinux.ecoff
706endif 810endif
707 811
812vmlinux.bin: $(vmlinux-32)
813 +@$(call makeboot,$@)
814
708vmlinux.ecoff vmlinux.rm200: $(vmlinux-32) 815vmlinux.ecoff vmlinux.rm200: $(vmlinux-32)
709 +@$(call makeboot,$@) 816 +@$(call makeboot,$@)
710 817
@@ -720,7 +827,6 @@ archclean:
720 @$(MAKE) $(clean)=arch/mips/boot 827 @$(MAKE) $(clean)=arch/mips/boot
721 @$(MAKE) $(clean)=arch/mips/lasat 828 @$(MAKE) $(clean)=arch/mips/lasat
722 829
723
724CLEAN_FILES += vmlinux.32 \ 830CLEAN_FILES += vmlinux.32 \
725 vmlinux.64 \ 831 vmlinux.64 \
726 vmlinux.ecoff 832 vmlinux.ecoff
diff --git a/arch/mips/arc/Makefile b/arch/mips/arc/Makefile
index e8424932e1a3..4f349ec1ea2d 100644
--- a/arch/mips/arc/Makefile
+++ b/arch/mips/arc/Makefile
@@ -3,7 +3,7 @@
3# 3#
4 4
5lib-y += cmdline.o env.o file.o identify.o init.o \ 5lib-y += cmdline.o env.o file.o identify.o init.o \
6 misc.o time.o tree.o 6 misc.o salone.o time.o tree.o
7 7
8lib-$(CONFIG_ARC_MEMORY) += memory.o 8lib-$(CONFIG_ARC_MEMORY) += memory.o
9lib-$(CONFIG_ARC_CONSOLE) += arc_con.o 9lib-$(CONFIG_ARC_CONSOLE) += arc_con.o
diff --git a/arch/mips/arc/identify.c b/arch/mips/arc/identify.c
index 0dd7a345eb79..1bd6199e174a 100644
--- a/arch/mips/arc/identify.c
+++ b/arch/mips/arc/identify.c
@@ -44,6 +44,11 @@ static struct smatch mach_table[] = {
44 MACH_GROUP_SGI, 44 MACH_GROUP_SGI,
45 MACH_SGI_IP28, 45 MACH_SGI_IP28,
46 PROM_FLAG_ARCS 46 PROM_FLAG_ARCS
47 }, { "SGI-IP30",
48 "SGI Octane",
49 MACH_GROUP_SGI,
50 MACH_SGI_IP30,
51 PROM_FLAG_ARCS
47 }, { "SGI-IP32", 52 }, { "SGI-IP32",
48 "SGI O2", 53 "SGI O2",
49 MACH_GROUP_SGI, 54 MACH_GROUP_SGI,
diff --git a/arch/mips/au1000/common/Makefile b/arch/mips/au1000/common/Makefile
index 594b75e5e080..a1edfd1f643c 100644
--- a/arch/mips/au1000/common/Makefile
+++ b/arch/mips/au1000/common/Makefile
@@ -8,7 +8,7 @@
8 8
9obj-y += prom.o int-handler.o irq.o puts.o time.o reset.o \ 9obj-y += prom.o int-handler.o irq.o puts.o time.o reset.o \
10 au1xxx_irqmap.o clocks.o platform.o power.o setup.o \ 10 au1xxx_irqmap.o clocks.o platform.o power.o setup.o \
11 sleeper.o cputable.o dma.o dbdma.o 11 sleeper.o cputable.o dma.o dbdma.o gpio.o
12 12
13obj-$(CONFIG_AU1X00_USB_DEVICE) += usbdev.o 13obj-$(CONFIG_AU1X00_USB_DEVICE) += usbdev.o
14obj-$(CONFIG_KGDB) += dbg_io.o 14obj-$(CONFIG_KGDB) += dbg_io.o
diff --git a/arch/mips/au1000/common/au1xxx_irqmap.c b/arch/mips/au1000/common/au1xxx_irqmap.c
index 8a0f39f67c59..0b2c03c52319 100644
--- a/arch/mips/au1000/common/au1xxx_irqmap.c
+++ b/arch/mips/au1000/common/au1xxx_irqmap.c
@@ -173,14 +173,14 @@ au1xxx_irq_map_t au1xxx_ic0_map[] = {
173 { AU1550_PSC1_INT, INTC_INT_HIGH_LEVEL, 0}, 173 { AU1550_PSC1_INT, INTC_INT_HIGH_LEVEL, 0},
174 { AU1550_PSC2_INT, INTC_INT_HIGH_LEVEL, 0}, 174 { AU1550_PSC2_INT, INTC_INT_HIGH_LEVEL, 0},
175 { AU1550_PSC3_INT, INTC_INT_HIGH_LEVEL, 0}, 175 { AU1550_PSC3_INT, INTC_INT_HIGH_LEVEL, 0},
176 { AU1550_TOY_INT, INTC_INT_RISE_EDGE, 0 }, 176 { AU1000_TOY_INT, INTC_INT_RISE_EDGE, 0 },
177 { AU1550_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 }, 177 { AU1000_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
178 { AU1550_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 }, 178 { AU1000_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
179 { AU1550_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 }, 179 { AU1000_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 },
180 { AU1550_RTC_INT, INTC_INT_RISE_EDGE, 0 }, 180 { AU1000_RTC_INT, INTC_INT_RISE_EDGE, 0 },
181 { AU1550_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 }, 181 { AU1000_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
182 { AU1550_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 }, 182 { AU1000_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
183 { AU1550_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 }, 183 { AU1000_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 },
184 { AU1550_NAND_INT, INTC_INT_RISE_EDGE, 0}, 184 { AU1550_NAND_INT, INTC_INT_RISE_EDGE, 0},
185 { AU1550_USB_DEV_REQ_INT, INTC_INT_HIGH_LEVEL, 0 }, 185 { AU1550_USB_DEV_REQ_INT, INTC_INT_HIGH_LEVEL, 0 },
186 { AU1550_USB_DEV_SUS_INT, INTC_INT_RISE_EDGE, 0 }, 186 { AU1550_USB_DEV_SUS_INT, INTC_INT_RISE_EDGE, 0 },
@@ -201,14 +201,14 @@ au1xxx_irq_map_t au1xxx_ic0_map[] = {
201 { AU1200_PSC1_INT, INTC_INT_HIGH_LEVEL, 0}, 201 { AU1200_PSC1_INT, INTC_INT_HIGH_LEVEL, 0},
202 { AU1200_AES_INT, INTC_INT_HIGH_LEVEL, 0}, 202 { AU1200_AES_INT, INTC_INT_HIGH_LEVEL, 0},
203 { AU1200_CAMERA_INT, INTC_INT_HIGH_LEVEL, 0}, 203 { AU1200_CAMERA_INT, INTC_INT_HIGH_LEVEL, 0},
204 { AU1200_TOY_INT, INTC_INT_RISE_EDGE, 0 }, 204 { AU1000_TOY_INT, INTC_INT_RISE_EDGE, 0 },
205 { AU1200_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 }, 205 { AU1000_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
206 { AU1200_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 }, 206 { AU1000_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
207 { AU1200_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 }, 207 { AU1000_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 },
208 { AU1200_RTC_INT, INTC_INT_RISE_EDGE, 0 }, 208 { AU1000_RTC_INT, INTC_INT_RISE_EDGE, 0 },
209 { AU1200_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 }, 209 { AU1000_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
210 { AU1200_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 }, 210 { AU1000_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
211 { AU1200_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 }, 211 { AU1000_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 },
212 { AU1200_NAND_INT, INTC_INT_RISE_EDGE, 0}, 212 { AU1200_NAND_INT, INTC_INT_RISE_EDGE, 0},
213 { AU1200_USB_INT, INTC_INT_HIGH_LEVEL, 0 }, 213 { AU1200_USB_INT, INTC_INT_HIGH_LEVEL, 0 },
214 { AU1200_LCD_INT, INTC_INT_HIGH_LEVEL, 0}, 214 { AU1200_LCD_INT, INTC_INT_HIGH_LEVEL, 0},
diff --git a/arch/mips/au1000/common/cputable.c b/arch/mips/au1000/common/cputable.c
index f5521dfccfd6..4dbde82c8215 100644
--- a/arch/mips/au1000/common/cputable.c
+++ b/arch/mips/au1000/common/cputable.c
@@ -37,7 +37,8 @@ struct cpu_spec cpu_specs[] = {
37 { 0xffffffff, 0x02030203, "Au1100 BD", 0, 1 }, 37 { 0xffffffff, 0x02030203, "Au1100 BD", 0, 1 },
38 { 0xffffffff, 0x02030204, "Au1100 BE", 0, 1 }, 38 { 0xffffffff, 0x02030204, "Au1100 BE", 0, 1 },
39 { 0xffffffff, 0x03030200, "Au1550 AA", 0, 1 }, 39 { 0xffffffff, 0x03030200, "Au1550 AA", 0, 1 },
40 { 0xffffffff, 0x04030200, "Au1200 AA", 0, 1 }, 40 { 0xffffffff, 0x04030200, "Au1200 AB", 0, 0 },
41 { 0xffffffff, 0x04030201, "Au1200 AC", 0, 1 },
41 { 0x00000000, 0x00000000, "Unknown Au1xxx", 1, 0 }, 42 { 0x00000000, 0x00000000, "Unknown Au1xxx", 1, 0 },
42}; 43};
43 44
diff --git a/arch/mips/au1000/common/dbdma.c b/arch/mips/au1000/common/dbdma.c
index adfc3172aace..d00e8247d6c2 100644
--- a/arch/mips/au1000/common/dbdma.c
+++ b/arch/mips/au1000/common/dbdma.c
@@ -29,6 +29,7 @@
29 * 675 Mass Ave, Cambridge, MA 02139, USA. 29 * 675 Mass Ave, Cambridge, MA 02139, USA.
30 * 30 *
31 */ 31 */
32
32#include <linux/config.h> 33#include <linux/config.h>
33#include <linux/kernel.h> 34#include <linux/kernel.h>
34#include <linux/errno.h> 35#include <linux/errno.h>
@@ -38,10 +39,12 @@
38#include <linux/string.h> 39#include <linux/string.h>
39#include <linux/delay.h> 40#include <linux/delay.h>
40#include <linux/interrupt.h> 41#include <linux/interrupt.h>
42#include <linux/module.h>
41#include <asm/mach-au1x00/au1000.h> 43#include <asm/mach-au1x00/au1000.h>
42#include <asm/mach-au1x00/au1xxx_dbdma.h> 44#include <asm/mach-au1x00/au1xxx_dbdma.h>
43#include <asm/system.h> 45#include <asm/system.h>
44 46
47
45#if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200) 48#if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200)
46 49
47/* 50/*
@@ -61,37 +64,10 @@ static DEFINE_SPINLOCK(au1xxx_dbdma_spin_lock);
61*/ 64*/
62#define ALIGN_ADDR(x, a) ((((u32)(x)) + (a-1)) & ~(a-1)) 65#define ALIGN_ADDR(x, a) ((((u32)(x)) + (a-1)) & ~(a-1))
63 66
64static volatile dbdma_global_t *dbdma_gptr = (dbdma_global_t *)DDMA_GLOBAL_BASE; 67static dbdma_global_t *dbdma_gptr = (dbdma_global_t *)DDMA_GLOBAL_BASE;
65static int dbdma_initialized; 68static int dbdma_initialized=0;
66static void au1xxx_dbdma_init(void); 69static void au1xxx_dbdma_init(void);
67 70
68typedef struct dbdma_device_table {
69 u32 dev_id;
70 u32 dev_flags;
71 u32 dev_tsize;
72 u32 dev_devwidth;
73 u32 dev_physaddr; /* If FIFO */
74 u32 dev_intlevel;
75 u32 dev_intpolarity;
76} dbdev_tab_t;
77
78typedef struct dbdma_chan_config {
79 u32 chan_flags;
80 u32 chan_index;
81 dbdev_tab_t *chan_src;
82 dbdev_tab_t *chan_dest;
83 au1x_dma_chan_t *chan_ptr;
84 au1x_ddma_desc_t *chan_desc_base;
85 au1x_ddma_desc_t *get_ptr, *put_ptr, *cur_ptr;
86 void *chan_callparam;
87 void (*chan_callback)(int, void *, struct pt_regs *);
88} chan_tab_t;
89
90#define DEV_FLAGS_INUSE (1 << 0)
91#define DEV_FLAGS_ANYUSE (1 << 1)
92#define DEV_FLAGS_OUT (1 << 2)
93#define DEV_FLAGS_IN (1 << 3)
94
95static dbdev_tab_t dbdev_tab[] = { 71static dbdev_tab_t dbdev_tab[] = {
96#ifdef CONFIG_SOC_AU1550 72#ifdef CONFIG_SOC_AU1550
97 /* UARTS */ 73 /* UARTS */
@@ -157,25 +133,25 @@ static dbdev_tab_t dbdev_tab[] = {
157 { DSCR_CMD0_MAE_BOTH, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, 133 { DSCR_CMD0_MAE_BOTH, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
158 { DSCR_CMD0_LCD, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, 134 { DSCR_CMD0_LCD, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
159 135
160 { DSCR_CMD0_SDMS_TX0, DEV_FLAGS_OUT, 0, 0, 0x00000000, 0, 0 }, 136 { DSCR_CMD0_SDMS_TX0, DEV_FLAGS_OUT, 4, 8, 0x10600000, 0, 0 },
161 { DSCR_CMD0_SDMS_RX0, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, 137 { DSCR_CMD0_SDMS_RX0, DEV_FLAGS_IN, 4, 8, 0x10600004, 0, 0 },
162 { DSCR_CMD0_SDMS_TX1, DEV_FLAGS_OUT, 0, 0, 0x00000000, 0, 0 }, 138 { DSCR_CMD0_SDMS_TX1, DEV_FLAGS_OUT, 4, 8, 0x10680000, 0, 0 },
163 { DSCR_CMD0_SDMS_RX1, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, 139 { DSCR_CMD0_SDMS_RX1, DEV_FLAGS_IN, 4, 8, 0x10680004, 0, 0 },
164 140
165 { DSCR_CMD0_AES_TX, DEV_FLAGS_OUT, 0, 0, 0x00000000, 0, 0 }, 141 { DSCR_CMD0_AES_RX, DEV_FLAGS_IN , 4, 32, 0x10300008, 0, 0 },
166 { DSCR_CMD0_AES_RX, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, 142 { DSCR_CMD0_AES_TX, DEV_FLAGS_OUT, 4, 32, 0x10300004, 0, 0 },
167 143
168 { DSCR_CMD0_PSC0_TX, DEV_FLAGS_OUT, 0, 0, 0x11a0001c, 0, 0 }, 144 { DSCR_CMD0_PSC0_TX, DEV_FLAGS_OUT, 0, 16, 0x11a0001c, 0, 0 },
169 { DSCR_CMD0_PSC0_RX, DEV_FLAGS_IN, 0, 0, 0x11a0001c, 0, 0 }, 145 { DSCR_CMD0_PSC0_RX, DEV_FLAGS_IN, 0, 16, 0x11a0001c, 0, 0 },
170 { DSCR_CMD0_PSC0_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, 146 { DSCR_CMD0_PSC0_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
171 147
172 { DSCR_CMD0_PSC1_TX, DEV_FLAGS_OUT, 0, 0, 0x11b0001c, 0, 0 }, 148 { DSCR_CMD0_PSC1_TX, DEV_FLAGS_OUT, 0, 16, 0x11b0001c, 0, 0 },
173 { DSCR_CMD0_PSC1_RX, DEV_FLAGS_IN, 0, 0, 0x11b0001c, 0, 0 }, 149 { DSCR_CMD0_PSC1_RX, DEV_FLAGS_IN, 0, 16, 0x11b0001c, 0, 0 },
174 { DSCR_CMD0_PSC1_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, 150 { DSCR_CMD0_PSC1_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
175 151
176 { DSCR_CMD0_CIM_RXA, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, 152 { DSCR_CMD0_CIM_RXA, DEV_FLAGS_IN, 0, 32, 0x14004020, 0, 0 },
177 { DSCR_CMD0_CIM_RXB, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, 153 { DSCR_CMD0_CIM_RXB, DEV_FLAGS_IN, 0, 32, 0x14004040, 0, 0 },
178 { DSCR_CMD0_CIM_RXC, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, 154 { DSCR_CMD0_CIM_RXC, DEV_FLAGS_IN, 0, 32, 0x14004060, 0, 0 },
179 { DSCR_CMD0_CIM_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, 155 { DSCR_CMD0_CIM_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
180 156
181 { DSCR_CMD0_NAND_FLASH, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, 157 { DSCR_CMD0_NAND_FLASH, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 },
@@ -184,6 +160,24 @@ static dbdev_tab_t dbdev_tab[] = {
184 160
185 { DSCR_CMD0_THROTTLE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, 161 { DSCR_CMD0_THROTTLE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
186 { DSCR_CMD0_ALWAYS, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, 162 { DSCR_CMD0_ALWAYS, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
163
164 /* Provide 16 user definable device types */
165 { 0, 0, 0, 0, 0, 0, 0 },
166 { 0, 0, 0, 0, 0, 0, 0 },
167 { 0, 0, 0, 0, 0, 0, 0 },
168 { 0, 0, 0, 0, 0, 0, 0 },
169 { 0, 0, 0, 0, 0, 0, 0 },
170 { 0, 0, 0, 0, 0, 0, 0 },
171 { 0, 0, 0, 0, 0, 0, 0 },
172 { 0, 0, 0, 0, 0, 0, 0 },
173 { 0, 0, 0, 0, 0, 0, 0 },
174 { 0, 0, 0, 0, 0, 0, 0 },
175 { 0, 0, 0, 0, 0, 0, 0 },
176 { 0, 0, 0, 0, 0, 0, 0 },
177 { 0, 0, 0, 0, 0, 0, 0 },
178 { 0, 0, 0, 0, 0, 0, 0 },
179 { 0, 0, 0, 0, 0, 0, 0 },
180 { 0, 0, 0, 0, 0, 0, 0 },
187}; 181};
188 182
189#define DBDEV_TAB_SIZE (sizeof(dbdev_tab) / sizeof(dbdev_tab_t)) 183#define DBDEV_TAB_SIZE (sizeof(dbdev_tab) / sizeof(dbdev_tab_t))
@@ -203,6 +197,36 @@ find_dbdev_id (u32 id)
203 return NULL; 197 return NULL;
204} 198}
205 199
200void * au1xxx_ddma_get_nextptr_virt(au1x_ddma_desc_t *dp)
201{
202 return phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr));
203}
204EXPORT_SYMBOL(au1xxx_ddma_get_nextptr_virt);
205
206u32
207au1xxx_ddma_add_device(dbdev_tab_t *dev)
208{
209 u32 ret = 0;
210 dbdev_tab_t *p=NULL;
211 static u16 new_id=0x1000;
212
213 p = find_dbdev_id(0);
214 if ( NULL != p )
215 {
216 memcpy(p, dev, sizeof(dbdev_tab_t));
217 p->dev_id = DSCR_DEV2CUSTOM_ID(new_id,dev->dev_id);
218 ret = p->dev_id;
219 new_id++;
220#if 0
221 printk("add_device: id:%x flags:%x padd:%x\n",
222 p->dev_id, p->dev_flags, p->dev_physaddr );
223#endif
224 }
225
226 return ret;
227}
228EXPORT_SYMBOL(au1xxx_ddma_add_device);
229
206/* Allocate a channel and return a non-zero descriptor if successful. 230/* Allocate a channel and return a non-zero descriptor if successful.
207*/ 231*/
208u32 232u32
@@ -215,7 +239,7 @@ au1xxx_dbdma_chan_alloc(u32 srcid, u32 destid,
215 int i; 239 int i;
216 dbdev_tab_t *stp, *dtp; 240 dbdev_tab_t *stp, *dtp;
217 chan_tab_t *ctp; 241 chan_tab_t *ctp;
218 volatile au1x_dma_chan_t *cp; 242 au1x_dma_chan_t *cp;
219 243
220 /* We do the intialization on the first channel allocation. 244 /* We do the intialization on the first channel allocation.
221 * We have to wait because of the interrupt handler initialization 245 * We have to wait because of the interrupt handler initialization
@@ -225,9 +249,6 @@ au1xxx_dbdma_chan_alloc(u32 srcid, u32 destid,
225 au1xxx_dbdma_init(); 249 au1xxx_dbdma_init();
226 dbdma_initialized = 1; 250 dbdma_initialized = 1;
227 251
228 if ((srcid > DSCR_NDEV_IDS) || (destid > DSCR_NDEV_IDS))
229 return 0;
230
231 if ((stp = find_dbdev_id(srcid)) == NULL) return 0; 252 if ((stp = find_dbdev_id(srcid)) == NULL) return 0;
232 if ((dtp = find_dbdev_id(destid)) == NULL) return 0; 253 if ((dtp = find_dbdev_id(destid)) == NULL) return 0;
233 254
@@ -271,7 +292,6 @@ au1xxx_dbdma_chan_alloc(u32 srcid, u32 destid,
271 */ 292 */
272 ctp = kmalloc(sizeof(chan_tab_t), GFP_KERNEL); 293 ctp = kmalloc(sizeof(chan_tab_t), GFP_KERNEL);
273 chan_tab_ptr[i] = ctp; 294 chan_tab_ptr[i] = ctp;
274 ctp->chan_index = chan = i;
275 break; 295 break;
276 } 296 }
277 } 297 }
@@ -279,10 +299,11 @@ au1xxx_dbdma_chan_alloc(u32 srcid, u32 destid,
279 299
280 if (ctp != NULL) { 300 if (ctp != NULL) {
281 memset(ctp, 0, sizeof(chan_tab_t)); 301 memset(ctp, 0, sizeof(chan_tab_t));
302 ctp->chan_index = chan = i;
282 dcp = DDMA_CHANNEL_BASE; 303 dcp = DDMA_CHANNEL_BASE;
283 dcp += (0x0100 * chan); 304 dcp += (0x0100 * chan);
284 ctp->chan_ptr = (au1x_dma_chan_t *)dcp; 305 ctp->chan_ptr = (au1x_dma_chan_t *)dcp;
285 cp = (volatile au1x_dma_chan_t *)dcp; 306 cp = (au1x_dma_chan_t *)dcp;
286 ctp->chan_src = stp; 307 ctp->chan_src = stp;
287 ctp->chan_dest = dtp; 308 ctp->chan_dest = dtp;
288 ctp->chan_callback = callback; 309 ctp->chan_callback = callback;
@@ -299,6 +320,9 @@ au1xxx_dbdma_chan_alloc(u32 srcid, u32 destid,
299 i |= DDMA_CFG_DED; 320 i |= DDMA_CFG_DED;
300 if (dtp->dev_intpolarity) 321 if (dtp->dev_intpolarity)
301 i |= DDMA_CFG_DP; 322 i |= DDMA_CFG_DP;
323 if ((stp->dev_flags & DEV_FLAGS_SYNC) ||
324 (dtp->dev_flags & DEV_FLAGS_SYNC))
325 i |= DDMA_CFG_SYNC;
302 cp->ddma_cfg = i; 326 cp->ddma_cfg = i;
303 au_sync(); 327 au_sync();
304 328
@@ -309,14 +333,14 @@ au1xxx_dbdma_chan_alloc(u32 srcid, u32 destid,
309 rv = (u32)(&chan_tab_ptr[chan]); 333 rv = (u32)(&chan_tab_ptr[chan]);
310 } 334 }
311 else { 335 else {
312 /* Release devices. 336 /* Release devices */
313 */
314 stp->dev_flags &= ~DEV_FLAGS_INUSE; 337 stp->dev_flags &= ~DEV_FLAGS_INUSE;
315 dtp->dev_flags &= ~DEV_FLAGS_INUSE; 338 dtp->dev_flags &= ~DEV_FLAGS_INUSE;
316 } 339 }
317 } 340 }
318 return rv; 341 return rv;
319} 342}
343EXPORT_SYMBOL(au1xxx_dbdma_chan_alloc);
320 344
321/* Set the device width if source or destination is a FIFO. 345/* Set the device width if source or destination is a FIFO.
322 * Should be 8, 16, or 32 bits. 346 * Should be 8, 16, or 32 bits.
@@ -344,6 +368,7 @@ au1xxx_dbdma_set_devwidth(u32 chanid, int bits)
344 368
345 return rv; 369 return rv;
346} 370}
371EXPORT_SYMBOL(au1xxx_dbdma_set_devwidth);
347 372
348/* Allocate a descriptor ring, initializing as much as possible. 373/* Allocate a descriptor ring, initializing as much as possible.
349*/ 374*/
@@ -370,7 +395,8 @@ au1xxx_dbdma_ring_alloc(u32 chanid, int entries)
370 * and if we try that first we are likely to not waste larger 395 * and if we try that first we are likely to not waste larger
371 * slabs of memory. 396 * slabs of memory.
372 */ 397 */
373 desc_base = (u32)kmalloc(entries * sizeof(au1x_ddma_desc_t), GFP_KERNEL); 398 desc_base = (u32)kmalloc(entries * sizeof(au1x_ddma_desc_t),
399 GFP_KERNEL|GFP_DMA);
374 if (desc_base == 0) 400 if (desc_base == 0)
375 return 0; 401 return 0;
376 402
@@ -381,7 +407,7 @@ au1xxx_dbdma_ring_alloc(u32 chanid, int entries)
381 kfree((const void *)desc_base); 407 kfree((const void *)desc_base);
382 i = entries * sizeof(au1x_ddma_desc_t); 408 i = entries * sizeof(au1x_ddma_desc_t);
383 i += (sizeof(au1x_ddma_desc_t) - 1); 409 i += (sizeof(au1x_ddma_desc_t) - 1);
384 if ((desc_base = (u32)kmalloc(i, GFP_KERNEL)) == 0) 410 if ((desc_base = (u32)kmalloc(i, GFP_KERNEL|GFP_DMA)) == 0)
385 return 0; 411 return 0;
386 412
387 desc_base = ALIGN_ADDR(desc_base, sizeof(au1x_ddma_desc_t)); 413 desc_base = ALIGN_ADDR(desc_base, sizeof(au1x_ddma_desc_t));
@@ -403,7 +429,13 @@ au1xxx_dbdma_ring_alloc(u32 chanid, int entries)
403 cmd0 |= DSCR_CMD0_SID(srcid); 429 cmd0 |= DSCR_CMD0_SID(srcid);
404 cmd0 |= DSCR_CMD0_DID(destid); 430 cmd0 |= DSCR_CMD0_DID(destid);
405 cmd0 |= DSCR_CMD0_IE | DSCR_CMD0_CV; 431 cmd0 |= DSCR_CMD0_IE | DSCR_CMD0_CV;
406 cmd0 |= DSCR_CMD0_ST(DSCR_CMD0_ST_CURRENT); 432 cmd0 |= DSCR_CMD0_ST(DSCR_CMD0_ST_NOCHANGE);
433
434 /* is it mem to mem transfer? */
435 if(((DSCR_CUSTOM2DEV_ID(srcid) == DSCR_CMD0_THROTTLE) || (DSCR_CUSTOM2DEV_ID(srcid) == DSCR_CMD0_ALWAYS)) &&
436 ((DSCR_CUSTOM2DEV_ID(destid) == DSCR_CMD0_THROTTLE) || (DSCR_CUSTOM2DEV_ID(destid) == DSCR_CMD0_ALWAYS))) {
437 cmd0 |= DSCR_CMD0_MEM;
438 }
407 439
408 switch (stp->dev_devwidth) { 440 switch (stp->dev_devwidth) {
409 case 8: 441 case 8:
@@ -461,9 +493,14 @@ au1xxx_dbdma_ring_alloc(u32 chanid, int entries)
461 /* If source input is fifo, set static address. 493 /* If source input is fifo, set static address.
462 */ 494 */
463 if (stp->dev_flags & DEV_FLAGS_IN) { 495 if (stp->dev_flags & DEV_FLAGS_IN) {
464 src0 = stp->dev_physaddr; 496 if ( stp->dev_flags & DEV_FLAGS_BURSTABLE )
497 src1 |= DSCR_SRC1_SAM(DSCR_xAM_BURST);
498 else
465 src1 |= DSCR_SRC1_SAM(DSCR_xAM_STATIC); 499 src1 |= DSCR_SRC1_SAM(DSCR_xAM_STATIC);
500
466 } 501 }
502 if (stp->dev_physaddr)
503 src0 = stp->dev_physaddr;
467 504
468 /* Set up dest1. For now, assume no stride and increment. 505 /* Set up dest1. For now, assume no stride and increment.
469 * A channel attribute update can change this later. 506 * A channel attribute update can change this later.
@@ -487,10 +524,18 @@ au1xxx_dbdma_ring_alloc(u32 chanid, int entries)
487 /* If destination output is fifo, set static address. 524 /* If destination output is fifo, set static address.
488 */ 525 */
489 if (dtp->dev_flags & DEV_FLAGS_OUT) { 526 if (dtp->dev_flags & DEV_FLAGS_OUT) {
490 dest0 = dtp->dev_physaddr; 527 if ( dtp->dev_flags & DEV_FLAGS_BURSTABLE )
528 dest1 |= DSCR_DEST1_DAM(DSCR_xAM_BURST);
529 else
491 dest1 |= DSCR_DEST1_DAM(DSCR_xAM_STATIC); 530 dest1 |= DSCR_DEST1_DAM(DSCR_xAM_STATIC);
492 } 531 }
532 if (dtp->dev_physaddr)
533 dest0 = dtp->dev_physaddr;
493 534
535#if 0
536 printk("did:%x sid:%x cmd0:%x cmd1:%x source0:%x source1:%x dest0:%x dest1:%x\n",
537 dtp->dev_id, stp->dev_id, cmd0, cmd1, src0, src1, dest0, dest1 );
538#endif
494 for (i=0; i<entries; i++) { 539 for (i=0; i<entries; i++) {
495 dp->dscr_cmd0 = cmd0; 540 dp->dscr_cmd0 = cmd0;
496 dp->dscr_cmd1 = cmd1; 541 dp->dscr_cmd1 = cmd1;
@@ -499,6 +544,8 @@ au1xxx_dbdma_ring_alloc(u32 chanid, int entries)
499 dp->dscr_dest0 = dest0; 544 dp->dscr_dest0 = dest0;
500 dp->dscr_dest1 = dest1; 545 dp->dscr_dest1 = dest1;
501 dp->dscr_stat = 0; 546 dp->dscr_stat = 0;
547 dp->sw_context = 0;
548 dp->sw_status = 0;
502 dp->dscr_nxtptr = DSCR_NXTPTR(virt_to_phys(dp + 1)); 549 dp->dscr_nxtptr = DSCR_NXTPTR(virt_to_phys(dp + 1));
503 dp++; 550 dp++;
504 } 551 }
@@ -511,13 +558,14 @@ au1xxx_dbdma_ring_alloc(u32 chanid, int entries)
511 558
512 return (u32)(ctp->chan_desc_base); 559 return (u32)(ctp->chan_desc_base);
513} 560}
561EXPORT_SYMBOL(au1xxx_dbdma_ring_alloc);
514 562
515/* Put a source buffer into the DMA ring. 563/* Put a source buffer into the DMA ring.
516 * This updates the source pointer and byte count. Normally used 564 * This updates the source pointer and byte count. Normally used
517 * for memory to fifo transfers. 565 * for memory to fifo transfers.
518 */ 566 */
519u32 567u32
520au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes) 568_au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes, u32 flags)
521{ 569{
522 chan_tab_t *ctp; 570 chan_tab_t *ctp;
523 au1x_ddma_desc_t *dp; 571 au1x_ddma_desc_t *dp;
@@ -544,8 +592,24 @@ au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes)
544 */ 592 */
545 dp->dscr_source0 = virt_to_phys(buf); 593 dp->dscr_source0 = virt_to_phys(buf);
546 dp->dscr_cmd1 = nbytes; 594 dp->dscr_cmd1 = nbytes;
547 dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */ 595 /* Check flags */
548 ctp->chan_ptr->ddma_dbell = 0xffffffff; /* Make it go */ 596 if (flags & DDMA_FLAGS_IE)
597 dp->dscr_cmd0 |= DSCR_CMD0_IE;
598 if (flags & DDMA_FLAGS_NOIE)
599 dp->dscr_cmd0 &= ~DSCR_CMD0_IE;
600
601 /*
602 * There is an errata on the Au1200/Au1550 parts that could result
603 * in "stale" data being DMA'd. It has to do with the snoop logic on
604 * the dache eviction buffer. NONCOHERENT_IO is on by default for
605 * these parts. If it is fixedin the future, these dma_cache_inv will
606 * just be nothing more than empty macros. See io.h.
607 * */
608 dma_cache_wback_inv((unsigned long)buf, nbytes);
609 dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */
610 au_sync();
611 dma_cache_wback_inv((unsigned long)dp, sizeof(dp));
612 ctp->chan_ptr->ddma_dbell = 0;
549 613
550 /* Get next descriptor pointer. 614 /* Get next descriptor pointer.
551 */ 615 */
@@ -555,13 +619,14 @@ au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes)
555 */ 619 */
556 return nbytes; 620 return nbytes;
557} 621}
622EXPORT_SYMBOL(_au1xxx_dbdma_put_source);
558 623
559/* Put a destination buffer into the DMA ring. 624/* Put a destination buffer into the DMA ring.
560 * This updates the destination pointer and byte count. Normally used 625 * This updates the destination pointer and byte count. Normally used
561 * to place an empty buffer into the ring for fifo to memory transfers. 626 * to place an empty buffer into the ring for fifo to memory transfers.
562 */ 627 */
563u32 628u32
564au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes) 629_au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes, u32 flags)
565{ 630{
566 chan_tab_t *ctp; 631 chan_tab_t *ctp;
567 au1x_ddma_desc_t *dp; 632 au1x_ddma_desc_t *dp;
@@ -583,11 +648,33 @@ au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes)
583 if (dp->dscr_cmd0 & DSCR_CMD0_V) 648 if (dp->dscr_cmd0 & DSCR_CMD0_V)
584 return 0; 649 return 0;
585 650
586 /* Load up buffer address and byte count. 651 /* Load up buffer address and byte count */
587 */ 652
653 /* Check flags */
654 if (flags & DDMA_FLAGS_IE)
655 dp->dscr_cmd0 |= DSCR_CMD0_IE;
656 if (flags & DDMA_FLAGS_NOIE)
657 dp->dscr_cmd0 &= ~DSCR_CMD0_IE;
658
588 dp->dscr_dest0 = virt_to_phys(buf); 659 dp->dscr_dest0 = virt_to_phys(buf);
589 dp->dscr_cmd1 = nbytes; 660 dp->dscr_cmd1 = nbytes;
661#if 0
662 printk("cmd0:%x cmd1:%x source0:%x source1:%x dest0:%x dest1:%x\n",
663 dp->dscr_cmd0, dp->dscr_cmd1, dp->dscr_source0,
664 dp->dscr_source1, dp->dscr_dest0, dp->dscr_dest1 );
665#endif
666 /*
667 * There is an errata on the Au1200/Au1550 parts that could result in
668 * "stale" data being DMA'd. It has to do with the snoop logic on the
669 * dache eviction buffer. NONCOHERENT_IO is on by default for these
670 * parts. If it is fixedin the future, these dma_cache_inv will just
671 * be nothing more than empty macros. See io.h.
672 * */
673 dma_cache_inv((unsigned long)buf,nbytes);
590 dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */ 674 dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */
675 au_sync();
676 dma_cache_wback_inv((unsigned long)dp, sizeof(dp));
677 ctp->chan_ptr->ddma_dbell = 0;
591 678
592 /* Get next descriptor pointer. 679 /* Get next descriptor pointer.
593 */ 680 */
@@ -597,6 +684,7 @@ au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes)
597 */ 684 */
598 return nbytes; 685 return nbytes;
599} 686}
687EXPORT_SYMBOL(_au1xxx_dbdma_put_dest);
600 688
601/* Get a destination buffer into the DMA ring. 689/* Get a destination buffer into the DMA ring.
602 * Normally used to get a full buffer from the ring during fifo 690 * Normally used to get a full buffer from the ring during fifo
@@ -646,7 +734,7 @@ void
646au1xxx_dbdma_stop(u32 chanid) 734au1xxx_dbdma_stop(u32 chanid)
647{ 735{
648 chan_tab_t *ctp; 736 chan_tab_t *ctp;
649 volatile au1x_dma_chan_t *cp; 737 au1x_dma_chan_t *cp;
650 int halt_timeout = 0; 738 int halt_timeout = 0;
651 739
652 ctp = *((chan_tab_t **)chanid); 740 ctp = *((chan_tab_t **)chanid);
@@ -666,6 +754,7 @@ au1xxx_dbdma_stop(u32 chanid)
666 cp->ddma_stat |= (DDMA_STAT_DB | DDMA_STAT_V); 754 cp->ddma_stat |= (DDMA_STAT_DB | DDMA_STAT_V);
667 au_sync(); 755 au_sync();
668} 756}
757EXPORT_SYMBOL(au1xxx_dbdma_stop);
669 758
670/* Start using the current descriptor pointer. If the dbdma encounters 759/* Start using the current descriptor pointer. If the dbdma encounters
671 * a not valid descriptor, it will stop. In this case, we can just 760 * a not valid descriptor, it will stop. In this case, we can just
@@ -675,17 +764,17 @@ void
675au1xxx_dbdma_start(u32 chanid) 764au1xxx_dbdma_start(u32 chanid)
676{ 765{
677 chan_tab_t *ctp; 766 chan_tab_t *ctp;
678 volatile au1x_dma_chan_t *cp; 767 au1x_dma_chan_t *cp;
679 768
680 ctp = *((chan_tab_t **)chanid); 769 ctp = *((chan_tab_t **)chanid);
681
682 cp = ctp->chan_ptr; 770 cp = ctp->chan_ptr;
683 cp->ddma_desptr = virt_to_phys(ctp->cur_ptr); 771 cp->ddma_desptr = virt_to_phys(ctp->cur_ptr);
684 cp->ddma_cfg |= DDMA_CFG_EN; /* Enable channel */ 772 cp->ddma_cfg |= DDMA_CFG_EN; /* Enable channel */
685 au_sync(); 773 au_sync();
686 cp->ddma_dbell = 0xffffffff; /* Make it go */ 774 cp->ddma_dbell = 0;
687 au_sync(); 775 au_sync();
688} 776}
777EXPORT_SYMBOL(au1xxx_dbdma_start);
689 778
690void 779void
691au1xxx_dbdma_reset(u32 chanid) 780au1xxx_dbdma_reset(u32 chanid)
@@ -704,15 +793,21 @@ au1xxx_dbdma_reset(u32 chanid)
704 793
705 do { 794 do {
706 dp->dscr_cmd0 &= ~DSCR_CMD0_V; 795 dp->dscr_cmd0 &= ~DSCR_CMD0_V;
796 /* reset our SW status -- this is used to determine
797 * if a descriptor is in use by upper level SW. Since
798 * posting can reset 'V' bit.
799 */
800 dp->sw_status = 0;
707 dp = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr)); 801 dp = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr));
708 } while (dp != ctp->chan_desc_base); 802 } while (dp != ctp->chan_desc_base);
709} 803}
804EXPORT_SYMBOL(au1xxx_dbdma_reset);
710 805
711u32 806u32
712au1xxx_get_dma_residue(u32 chanid) 807au1xxx_get_dma_residue(u32 chanid)
713{ 808{
714 chan_tab_t *ctp; 809 chan_tab_t *ctp;
715 volatile au1x_dma_chan_t *cp; 810 au1x_dma_chan_t *cp;
716 u32 rv; 811 u32 rv;
717 812
718 ctp = *((chan_tab_t **)chanid); 813 ctp = *((chan_tab_t **)chanid);
@@ -738,8 +833,7 @@ au1xxx_dbdma_chan_free(u32 chanid)
738 833
739 au1xxx_dbdma_stop(chanid); 834 au1xxx_dbdma_stop(chanid);
740 835
741 if (ctp->chan_desc_base != NULL) 836 kfree((void *)ctp->chan_desc_base);
742 kfree(ctp->chan_desc_base);
743 837
744 stp->dev_flags &= ~DEV_FLAGS_INUSE; 838 stp->dev_flags &= ~DEV_FLAGS_INUSE;
745 dtp->dev_flags &= ~DEV_FLAGS_INUSE; 839 dtp->dev_flags &= ~DEV_FLAGS_INUSE;
@@ -747,15 +841,16 @@ au1xxx_dbdma_chan_free(u32 chanid)
747 841
748 kfree(ctp); 842 kfree(ctp);
749} 843}
844EXPORT_SYMBOL(au1xxx_dbdma_chan_free);
750 845
751static irqreturn_t 846static irqreturn_t
752dbdma_interrupt(int irq, void *dev_id, struct pt_regs *regs) 847dbdma_interrupt(int irq, void *dev_id, struct pt_regs *regs)
753{ 848{
754 u32 intstat; 849 u32 intstat;
755 u32 chan_index; 850 u32 chan_index;
756 chan_tab_t *ctp; 851 chan_tab_t *ctp;
757 au1x_ddma_desc_t *dp; 852 au1x_ddma_desc_t *dp;
758 volatile au1x_dma_chan_t *cp; 853 au1x_dma_chan_t *cp;
759 854
760 intstat = dbdma_gptr->ddma_intstat; 855 intstat = dbdma_gptr->ddma_intstat;
761 au_sync(); 856 au_sync();
@@ -774,19 +869,27 @@ dbdma_interrupt(int irq, void *dev_id, struct pt_regs *regs)
774 (ctp->chan_callback)(irq, ctp->chan_callparam, regs); 869 (ctp->chan_callback)(irq, ctp->chan_callparam, regs);
775 870
776 ctp->cur_ptr = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr)); 871 ctp->cur_ptr = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr));
777 872 return IRQ_RETVAL(1);
778 return IRQ_HANDLED;
779} 873}
780 874
781static void 875static void au1xxx_dbdma_init(void)
782au1xxx_dbdma_init(void)
783{ 876{
877 int irq_nr;
878
784 dbdma_gptr->ddma_config = 0; 879 dbdma_gptr->ddma_config = 0;
785 dbdma_gptr->ddma_throttle = 0; 880 dbdma_gptr->ddma_throttle = 0;
786 dbdma_gptr->ddma_inten = 0xffff; 881 dbdma_gptr->ddma_inten = 0xffff;
787 au_sync(); 882 au_sync();
788 883
789 if (request_irq(AU1550_DDMA_INT, dbdma_interrupt, SA_INTERRUPT, 884#if defined(CONFIG_SOC_AU1550)
885 irq_nr = AU1550_DDMA_INT;
886#elif defined(CONFIG_SOC_AU1200)
887 irq_nr = AU1200_DDMA_INT;
888#else
889 #error Unknown Au1x00 SOC
890#endif
891
892 if (request_irq(irq_nr, dbdma_interrupt, SA_INTERRUPT,
790 "Au1xxx dbdma", (void *)dbdma_gptr)) 893 "Au1xxx dbdma", (void *)dbdma_gptr))
791 printk("Can't get 1550 dbdma irq"); 894 printk("Can't get 1550 dbdma irq");
792} 895}
@@ -797,7 +900,8 @@ au1xxx_dbdma_dump(u32 chanid)
797 chan_tab_t *ctp; 900 chan_tab_t *ctp;
798 au1x_ddma_desc_t *dp; 901 au1x_ddma_desc_t *dp;
799 dbdev_tab_t *stp, *dtp; 902 dbdev_tab_t *stp, *dtp;
800 volatile au1x_dma_chan_t *cp; 903 au1x_dma_chan_t *cp;
904 u32 i = 0;
801 905
802 ctp = *((chan_tab_t **)chanid); 906 ctp = *((chan_tab_t **)chanid);
803 stp = ctp->chan_src; 907 stp = ctp->chan_src;
@@ -822,15 +926,64 @@ au1xxx_dbdma_dump(u32 chanid)
822 dp = ctp->chan_desc_base; 926 dp = ctp->chan_desc_base;
823 927
824 do { 928 do {
825 printk("dp %08x, cmd0 %08x, cmd1 %08x\n", 929 printk("Dp[%d]= %08x, cmd0 %08x, cmd1 %08x\n",
826 (u32)dp, dp->dscr_cmd0, dp->dscr_cmd1); 930 i++, (u32)dp, dp->dscr_cmd0, dp->dscr_cmd1);
827 printk("src0 %08x, src1 %08x, dest0 %08x\n", 931 printk("src0 %08x, src1 %08x, dest0 %08x, dest1 %08x\n",
828 dp->dscr_source0, dp->dscr_source1, dp->dscr_dest0); 932 dp->dscr_source0, dp->dscr_source1, dp->dscr_dest0, dp->dscr_dest1);
829 printk("dest1 %08x, stat %08x, nxtptr %08x\n", 933 printk("stat %08x, nxtptr %08x\n",
830 dp->dscr_dest1, dp->dscr_stat, dp->dscr_nxtptr); 934 dp->dscr_stat, dp->dscr_nxtptr);
831 dp = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr)); 935 dp = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr));
832 } while (dp != ctp->chan_desc_base); 936 } while (dp != ctp->chan_desc_base);
833} 937}
834 938
939/* Put a descriptor into the DMA ring.
940 * This updates the source/destination pointers and byte count.
941 */
942u32
943au1xxx_dbdma_put_dscr(u32 chanid, au1x_ddma_desc_t *dscr )
944{
945 chan_tab_t *ctp;
946 au1x_ddma_desc_t *dp;
947 u32 nbytes=0;
948
949 /* I guess we could check this to be within the
950 * range of the table......
951 */
952 ctp = *((chan_tab_t **)chanid);
953
954 /* We should have multiple callers for a particular channel,
955 * an interrupt doesn't affect this pointer nor the descriptor,
956 * so no locking should be needed.
957 */
958 dp = ctp->put_ptr;
959
960 /* If the descriptor is valid, we are way ahead of the DMA
961 * engine, so just return an error condition.
962 */
963 if (dp->dscr_cmd0 & DSCR_CMD0_V)
964 return 0;
965
966 /* Load up buffer addresses and byte count.
967 */
968 dp->dscr_dest0 = dscr->dscr_dest0;
969 dp->dscr_source0 = dscr->dscr_source0;
970 dp->dscr_dest1 = dscr->dscr_dest1;
971 dp->dscr_source1 = dscr->dscr_source1;
972 dp->dscr_cmd1 = dscr->dscr_cmd1;
973 nbytes = dscr->dscr_cmd1;
974 /* Allow the caller to specifiy if an interrupt is generated */
975 dp->dscr_cmd0 &= ~DSCR_CMD0_IE;
976 dp->dscr_cmd0 |= dscr->dscr_cmd0 | DSCR_CMD0_V;
977 ctp->chan_ptr->ddma_dbell = 0;
978
979 /* Get next descriptor pointer.
980 */
981 ctp->put_ptr = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr));
982
983 /* return something not zero.
984 */
985 return nbytes;
986}
987
835#endif /* defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200) */ 988#endif /* defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200) */
836 989
diff --git a/arch/mips/au1000/common/dma.c b/arch/mips/au1000/common/dma.c
index 372c33f1353d..1905c6b104f2 100644
--- a/arch/mips/au1000/common/dma.c
+++ b/arch/mips/au1000/common/dma.c
@@ -39,7 +39,6 @@
39#include <linux/string.h> 39#include <linux/string.h>
40#include <linux/delay.h> 40#include <linux/delay.h>
41#include <linux/interrupt.h> 41#include <linux/interrupt.h>
42#include <linux/module.h>
43#include <asm/system.h> 42#include <asm/system.h>
44#include <asm/mach-au1x00/au1000.h> 43#include <asm/mach-au1x00/au1000.h>
45#include <asm/mach-au1x00/au1000_dma.h> 44#include <asm/mach-au1x00/au1000_dma.h>
diff --git a/arch/mips/au1000/common/gpio.c b/arch/mips/au1000/common/gpio.c
new file mode 100644
index 000000000000..5f5915b83142
--- /dev/null
+++ b/arch/mips/au1000/common/gpio.c
@@ -0,0 +1,119 @@
1/*
2 * This program is free software; you can redistribute it and/or modify it
3 * under the terms of the GNU General Public License as published by the
4 * Free Software Foundation; either version 2 of the License, or (at your
5 * option) any later version.
6 *
7 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
9 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
10 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
11 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
12 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
13 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
14 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
15 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
16 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
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 * 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22#include <linux/config.h>
23#include <linux/module.h>
24#include <au1000.h>
25#include <au1xxx_gpio.h>
26
27#define gpio1 sys
28#if !defined(CONFIG_SOC_AU1000)
29static AU1X00_GPIO2 * const gpio2 = (AU1X00_GPIO2 *)GPIO2_BASE;
30
31#define GPIO2_OUTPUT_ENABLE_MASK 0x00010000
32
33int au1xxx_gpio2_read(int signal)
34{
35 signal -= 200;
36/* gpio2->dir &= ~(0x01 << signal); //Set GPIO to input */
37 return ((gpio2->pinstate >> signal) & 0x01);
38}
39
40void au1xxx_gpio2_write(int signal, int value)
41{
42 signal -= 200;
43
44 gpio2->output = (GPIO2_OUTPUT_ENABLE_MASK << signal) |
45 (value << signal);
46}
47
48void au1xxx_gpio2_tristate(int signal)
49{
50 signal -= 200;
51 gpio2->dir &= ~(0x01 << signal); /* Set GPIO to input */
52}
53#endif
54
55int au1xxx_gpio1_read(int signal)
56{
57/* gpio1->trioutclr |= (0x01 << signal); */
58 return ((gpio1->pinstaterd >> signal) & 0x01);
59}
60
61void au1xxx_gpio1_write(int signal, int value)
62{
63 if(value)
64 gpio1->outputset = (0x01 << signal);
65 else
66 gpio1->outputclr = (0x01 << signal); /* Output a Zero */
67}
68
69void au1xxx_gpio1_tristate(int signal)
70{
71 gpio1->trioutclr = (0x01 << signal); /* Tristate signal */
72}
73
74
75int au1xxx_gpio_read(int signal)
76{
77 if(signal >= 200)
78#if defined(CONFIG_SOC_AU1000)
79 return 0;
80#else
81 return au1xxx_gpio2_read(signal);
82#endif
83 else
84 return au1xxx_gpio1_read(signal);
85}
86
87void au1xxx_gpio_write(int signal, int value)
88{
89 if(signal >= 200)
90#if defined(CONFIG_SOC_AU1000)
91 ;
92#else
93 au1xxx_gpio2_write(signal, value);
94#endif
95 else
96 au1xxx_gpio1_write(signal, value);
97}
98
99void au1xxx_gpio_tristate(int signal)
100{
101 if(signal >= 200)
102#if defined(CONFIG_SOC_AU1000)
103 ;
104#else
105 au1xxx_gpio2_tristate(signal);
106#endif
107 else
108 au1xxx_gpio1_tristate(signal);
109}
110
111void au1xxx_gpio1_set_inputs(void)
112{
113 gpio1->pininputen = 0;
114}
115
116EXPORT_SYMBOL(au1xxx_gpio1_set_inputs);
117EXPORT_SYMBOL(au1xxx_gpio_tristate);
118EXPORT_SYMBOL(au1xxx_gpio_write);
119EXPORT_SYMBOL(au1xxx_gpio_read);
diff --git a/arch/mips/au1000/common/irq.c b/arch/mips/au1000/common/irq.c
index d1eb5a4a9a19..1339a0979f66 100644
--- a/arch/mips/au1000/common/irq.c
+++ b/arch/mips/au1000/common/irq.c
@@ -83,7 +83,7 @@ inline void local_disable_irq(unsigned int irq_nr);
83void (*board_init_irq)(void); 83void (*board_init_irq)(void);
84 84
85#ifdef CONFIG_PM 85#ifdef CONFIG_PM
86extern void counter0_irq(int irq, void *dev_id, struct pt_regs *regs); 86extern irqreturn_t counter0_irq(int irq, void *dev_id, struct pt_regs *regs);
87#endif 87#endif
88 88
89static DEFINE_SPINLOCK(irq_lock); 89static DEFINE_SPINLOCK(irq_lock);
@@ -253,52 +253,72 @@ void restore_local_and_enable(int controller, unsigned long mask)
253 253
254 254
255static struct hw_interrupt_type rise_edge_irq_type = { 255static struct hw_interrupt_type rise_edge_irq_type = {
256 "Au1000 Rise Edge", 256 .typename = "Au1000 Rise Edge",
257 startup_irq, 257 .startup = startup_irq,
258 shutdown_irq, 258 .shutdown = shutdown_irq,
259 local_enable_irq, 259 .enable = local_enable_irq,
260 local_disable_irq, 260 .disable = local_disable_irq,
261 mask_and_ack_rise_edge_irq, 261 .ack = mask_and_ack_rise_edge_irq,
262 end_irq, 262 .end = end_irq,
263 NULL
264}; 263};
265 264
266static struct hw_interrupt_type fall_edge_irq_type = { 265static struct hw_interrupt_type fall_edge_irq_type = {
267 "Au1000 Fall Edge", 266 .typename = "Au1000 Fall Edge",
268 startup_irq, 267 .startup = startup_irq,
269 shutdown_irq, 268 .shutdown = shutdown_irq,
270 local_enable_irq, 269 .enable = local_enable_irq,
271 local_disable_irq, 270 .disable = local_disable_irq,
272 mask_and_ack_fall_edge_irq, 271 .ack = mask_and_ack_fall_edge_irq,
273 end_irq, 272 .end = end_irq,
274 NULL
275}; 273};
276 274
277static struct hw_interrupt_type either_edge_irq_type = { 275static struct hw_interrupt_type either_edge_irq_type = {
278 "Au1000 Rise or Fall Edge", 276 .typename = "Au1000 Rise or Fall Edge",
279 startup_irq, 277 .startup = startup_irq,
280 shutdown_irq, 278 .shutdown = shutdown_irq,
281 local_enable_irq, 279 .enable = local_enable_irq,
282 local_disable_irq, 280 .disable = local_disable_irq,
283 mask_and_ack_either_edge_irq, 281 .ack = mask_and_ack_either_edge_irq,
284 end_irq, 282 .end = end_irq,
285 NULL
286}; 283};
287 284
288static struct hw_interrupt_type level_irq_type = { 285static struct hw_interrupt_type level_irq_type = {
289 "Au1000 Level", 286 .typename = "Au1000 Level",
290 startup_irq, 287 .startup = startup_irq,
291 shutdown_irq, 288 .shutdown = shutdown_irq,
292 local_enable_irq, 289 .enable = local_enable_irq,
293 local_disable_irq, 290 .disable = local_disable_irq,
294 mask_and_ack_level_irq, 291 .ack = mask_and_ack_level_irq,
295 end_irq, 292 .end = end_irq,
296 NULL
297}; 293};
298 294
299#ifdef CONFIG_PM 295#ifdef CONFIG_PM
300void startup_match20_interrupt(void) 296void startup_match20_interrupt(irqreturn_t (*handler)(int, void *, struct pt_regs *))
301{ 297{
298 struct irq_desc *desc = &irq_desc[AU1000_TOY_MATCH2_INT];
299
300 static struct irqaction action;
301 memset(&action, 0, sizeof(struct irqaction));
302
303 /* This is a big problem.... since we didn't use request_irq
304 * when kernel/irq.c calls probe_irq_xxx this interrupt will
305 * be probed for usage. This will end up disabling the device :(
306 * Give it a bogus "action" pointer -- this will keep it from
307 * getting auto-probed!
308 *
309 * By setting the status to match that of request_irq() we
310 * can avoid it. --cgray
311 */
312 action.dev_id = handler;
313 action.flags = SA_INTERRUPT;
314 cpus_clear(action.mask);
315 action.name = "Au1xxx TOY";
316 action.handler = handler;
317 action.next = NULL;
318
319 desc->action = &action;
320 desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING | IRQ_INPROGRESS);
321
302 local_enable_irq(AU1000_TOY_MATCH2_INT); 322 local_enable_irq(AU1000_TOY_MATCH2_INT);
303} 323}
304#endif 324#endif
@@ -426,7 +446,6 @@ void __init arch_init_irq(void)
426 extern int au1xxx_ic0_nr_irqs; 446 extern int au1xxx_ic0_nr_irqs;
427 447
428 cp0_status = read_c0_status(); 448 cp0_status = read_c0_status();
429 memset(irq_desc, 0, sizeof(irq_desc));
430 set_except_vector(0, au1000_IRQ); 449 set_except_vector(0, au1000_IRQ);
431 450
432 /* Initialize interrupt controllers to a safe state. 451 /* Initialize interrupt controllers to a safe state.
@@ -492,7 +511,7 @@ void intc0_req0_irqdispatch(struct pt_regs *regs)
492 intc0_req0 |= au_readl(IC0_REQ0INT); 511 intc0_req0 |= au_readl(IC0_REQ0INT);
493 512
494 if (!intc0_req0) return; 513 if (!intc0_req0) return;
495 514#ifdef AU1000_USB_DEV_REQ_INT
496 /* 515 /*
497 * Because of the tight timing of SETUP token to reply 516 * Because of the tight timing of SETUP token to reply
498 * transactions, the USB devices-side packet complete 517 * transactions, the USB devices-side packet complete
@@ -503,7 +522,7 @@ void intc0_req0_irqdispatch(struct pt_regs *regs)
503 do_IRQ(AU1000_USB_DEV_REQ_INT, regs); 522 do_IRQ(AU1000_USB_DEV_REQ_INT, regs);
504 return; 523 return;
505 } 524 }
506 525#endif
507 irq = au_ffs(intc0_req0) - 1; 526 irq = au_ffs(intc0_req0) - 1;
508 intc0_req0 &= ~(1<<irq); 527 intc0_req0 &= ~(1<<irq);
509 do_IRQ(irq, regs); 528 do_IRQ(irq, regs);
@@ -521,17 +540,7 @@ void intc0_req1_irqdispatch(struct pt_regs *regs)
521 540
522 irq = au_ffs(intc0_req1) - 1; 541 irq = au_ffs(intc0_req1) - 1;
523 intc0_req1 &= ~(1<<irq); 542 intc0_req1 &= ~(1<<irq);
524#ifdef CONFIG_PM 543 do_IRQ(irq, regs);
525 if (irq == AU1000_TOY_MATCH2_INT) {
526 mask_and_ack_rise_edge_irq(irq);
527 counter0_irq(irq, NULL, regs);
528 local_enable_irq(irq);
529 }
530 else
531#endif
532 {
533 do_IRQ(irq, regs);
534 }
535} 544}
536 545
537 546
diff --git a/arch/mips/au1000/common/platform.c b/arch/mips/au1000/common/platform.c
index 3c778d0f58a6..48d3f54f88f8 100644
--- a/arch/mips/au1000/common/platform.c
+++ b/arch/mips/au1000/common/platform.c
@@ -7,13 +7,16 @@
7 * License version 2. This program is licensed "as is" without any 7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied. 8 * warranty of any kind, whether express or implied.
9 */ 9 */
10#include <linux/config.h>
11#include <linux/device.h>
10#include <linux/platform_device.h> 12#include <linux/platform_device.h>
11#include <linux/kernel.h> 13#include <linux/kernel.h>
12#include <linux/init.h> 14#include <linux/init.h>
13#include <linux/resource.h> 15#include <linux/resource.h>
14 16
15#include <asm/mach-au1x00/au1000.h> 17#include <asm/mach-au1x00/au1xxx.h>
16 18
19/* OHCI (USB full speed host controller) */
17static struct resource au1xxx_usb_ohci_resources[] = { 20static struct resource au1xxx_usb_ohci_resources[] = {
18 [0] = { 21 [0] = {
19 .start = USB_OHCI_BASE, 22 .start = USB_OHCI_BASE,
@@ -41,8 +44,252 @@ static struct platform_device au1xxx_usb_ohci_device = {
41 .resource = au1xxx_usb_ohci_resources, 44 .resource = au1xxx_usb_ohci_resources,
42}; 45};
43 46
47/*** AU1100 LCD controller ***/
48
49#ifdef CONFIG_FB_AU1100
50static struct resource au1100_lcd_resources[] = {
51 [0] = {
52 .start = LCD_PHYS_ADDR,
53 .end = LCD_PHYS_ADDR + 0x800 - 1,
54 .flags = IORESOURCE_MEM,
55 },
56 [1] = {
57 .start = AU1100_LCD_INT,
58 .end = AU1100_LCD_INT,
59 .flags = IORESOURCE_IRQ,
60 }
61};
62
63static u64 au1100_lcd_dmamask = ~(u32)0;
64
65static struct platform_device au1100_lcd_device = {
66 .name = "au1100-lcd",
67 .id = 0,
68 .dev = {
69 .dma_mask = &au1100_lcd_dmamask,
70 .coherent_dma_mask = 0xffffffff,
71 },
72 .num_resources = ARRAY_SIZE(au1100_lcd_resources),
73 .resource = au1100_lcd_resources,
74};
75#endif
76
77#ifdef CONFIG_SOC_AU1200
78/* EHCI (USB high speed host controller) */
79static struct resource au1xxx_usb_ehci_resources[] = {
80 [0] = {
81 .start = USB_EHCI_BASE,
82 .end = USB_EHCI_BASE + USB_EHCI_LEN - 1,
83 .flags = IORESOURCE_MEM,
84 },
85 [1] = {
86 .start = AU1000_USB_HOST_INT,
87 .end = AU1000_USB_HOST_INT,
88 .flags = IORESOURCE_IRQ,
89 },
90};
91
92static u64 ehci_dmamask = ~(u32)0;
93
94static struct platform_device au1xxx_usb_ehci_device = {
95 .name = "au1xxx-ehci",
96 .id = 0,
97 .dev = {
98 .dma_mask = &ehci_dmamask,
99 .coherent_dma_mask = 0xffffffff,
100 },
101 .num_resources = ARRAY_SIZE(au1xxx_usb_ehci_resources),
102 .resource = au1xxx_usb_ehci_resources,
103};
104
105/* Au1200 UDC (USB gadget controller) */
106static struct resource au1xxx_usb_gdt_resources[] = {
107 [0] = {
108 .start = USB_UDC_BASE,
109 .end = USB_UDC_BASE + USB_UDC_LEN - 1,
110 .flags = IORESOURCE_MEM,
111 },
112 [1] = {
113 .start = AU1200_USB_INT,
114 .end = AU1200_USB_INT,
115 .flags = IORESOURCE_IRQ,
116 },
117};
118
119static struct resource au1xxx_mmc_resources[] = {
120 [0] = {
121 .start = SD0_PHYS_ADDR,
122 .end = SD0_PHYS_ADDR + 0x40,
123 .flags = IORESOURCE_MEM,
124 },
125 [1] = {
126 .start = SD1_PHYS_ADDR,
127 .end = SD1_PHYS_ADDR + 0x40,
128 .flags = IORESOURCE_MEM,
129 },
130 [2] = {
131 .start = AU1200_SD_INT,
132 .end = AU1200_SD_INT,
133 .flags = IORESOURCE_IRQ,
134 }
135};
136
137static u64 udc_dmamask = ~(u32)0;
138
139static struct platform_device au1xxx_usb_gdt_device = {
140 .name = "au1xxx-udc",
141 .id = 0,
142 .dev = {
143 .dma_mask = &udc_dmamask,
144 .coherent_dma_mask = 0xffffffff,
145 },
146 .num_resources = ARRAY_SIZE(au1xxx_usb_gdt_resources),
147 .resource = au1xxx_usb_gdt_resources,
148};
149
150/* Au1200 UOC (USB OTG controller) */
151static struct resource au1xxx_usb_otg_resources[] = {
152 [0] = {
153 .start = USB_UOC_BASE,
154 .end = USB_UOC_BASE + USB_UOC_LEN - 1,
155 .flags = IORESOURCE_MEM,
156 },
157 [1] = {
158 .start = AU1200_USB_INT,
159 .end = AU1200_USB_INT,
160 .flags = IORESOURCE_IRQ,
161 },
162};
163
164static u64 uoc_dmamask = ~(u32)0;
165
166static struct platform_device au1xxx_usb_otg_device = {
167 .name = "au1xxx-uoc",
168 .id = 0,
169 .dev = {
170 .dma_mask = &uoc_dmamask,
171 .coherent_dma_mask = 0xffffffff,
172 },
173 .num_resources = ARRAY_SIZE(au1xxx_usb_otg_resources),
174 .resource = au1xxx_usb_otg_resources,
175};
176
177static struct resource au1200_lcd_resources[] = {
178 [0] = {
179 .start = LCD_PHYS_ADDR,
180 .end = LCD_PHYS_ADDR + 0x800 - 1,
181 .flags = IORESOURCE_MEM,
182 },
183 [1] = {
184 .start = AU1200_LCD_INT,
185 .end = AU1200_LCD_INT,
186 .flags = IORESOURCE_IRQ,
187 }
188};
189
190static struct resource au1200_ide0_resources[] = {
191 [0] = {
192 .start = AU1XXX_ATA_PHYS_ADDR,
193 .end = AU1XXX_ATA_PHYS_ADDR + AU1XXX_ATA_PHYS_LEN,
194 .flags = IORESOURCE_MEM,
195 },
196 [1] = {
197 .start = AU1XXX_ATA_INT,
198 .end = AU1XXX_ATA_INT,
199 .flags = IORESOURCE_IRQ,
200 }
201};
202
203static u64 au1200_lcd_dmamask = ~(u32)0;
204
205static struct platform_device au1200_lcd_device = {
206 .name = "au1200-lcd",
207 .id = 0,
208 .dev = {
209 .dma_mask = &au1200_lcd_dmamask,
210 .coherent_dma_mask = 0xffffffff,
211 },
212 .num_resources = ARRAY_SIZE(au1200_lcd_resources),
213 .resource = au1200_lcd_resources,
214};
215
216
217static u64 ide0_dmamask = ~(u32)0;
218
219static struct platform_device au1200_ide0_device = {
220 .name = "au1200-ide",
221 .id = 0,
222 .dev = {
223 .dma_mask = &ide0_dmamask,
224 .coherent_dma_mask = 0xffffffff,
225 },
226 .num_resources = ARRAY_SIZE(au1200_ide0_resources),
227 .resource = au1200_ide0_resources,
228};
229
230static u64 au1xxx_mmc_dmamask = ~(u32)0;
231
232static struct platform_device au1xxx_mmc_device = {
233 .name = "au1xxx-mmc",
234 .id = 0,
235 .dev = {
236 .dma_mask = &au1xxx_mmc_dmamask,
237 .coherent_dma_mask = 0xffffffff,
238 },
239 .num_resources = ARRAY_SIZE(au1xxx_mmc_resources),
240 .resource = au1xxx_mmc_resources,
241};
242#endif /* #ifdef CONFIG_SOC_AU1200 */
243
244static struct platform_device au1x00_pcmcia_device = {
245 .name = "au1x00-pcmcia",
246 .id = 0,
247};
248
249#ifdef CONFIG_MIPS_DB1200
250
251static struct resource smc91x_resources[] = {
252 [0] = {
253 .name = "smc91x-regs",
254 .start = AU1XXX_SMC91111_PHYS_ADDR,
255 .end = AU1XXX_SMC91111_PHYS_ADDR + 0xfffff,
256 .flags = IORESOURCE_MEM,
257 },
258 [1] = {
259 .start = AU1XXX_SMC91111_IRQ,
260 .end = AU1XXX_SMC91111_IRQ,
261 .flags = IORESOURCE_IRQ,
262 },
263};
264
265static struct platform_device smc91x_device = {
266 .name = "smc91x",
267 .id = -1,
268 .num_resources = ARRAY_SIZE(smc91x_resources),
269 .resource = smc91x_resources,
270};
271
272#endif
273
44static struct platform_device *au1xxx_platform_devices[] __initdata = { 274static struct platform_device *au1xxx_platform_devices[] __initdata = {
45 &au1xxx_usb_ohci_device, 275 &au1xxx_usb_ohci_device,
276 &au1x00_pcmcia_device,
277#ifdef CONFIG_FB_AU1100
278 &au1100_lcd_device,
279#endif
280#ifdef CONFIG_SOC_AU1200
281#if 0 /* fixme */
282 &au1xxx_usb_ehci_device,
283#endif
284 &au1xxx_usb_gdt_device,
285 &au1xxx_usb_otg_device,
286 &au1200_lcd_device,
287 &au1200_ide0_device,
288 &au1xxx_mmc_device,
289#endif
290#ifdef CONFIG_MIPS_DB1200
291 &smc91x_device,
292#endif
46}; 293};
47 294
48int au1xxx_platform_init(void) 295int au1xxx_platform_init(void)
diff --git a/arch/mips/au1000/common/power.c b/arch/mips/au1000/common/power.c
index c40daccbb5b1..f85093b8d54d 100644
--- a/arch/mips/au1000/common/power.c
+++ b/arch/mips/au1000/common/power.c
@@ -34,11 +34,13 @@
34#include <linux/pm.h> 34#include <linux/pm.h>
35#include <linux/slab.h> 35#include <linux/slab.h>
36#include <linux/sysctl.h> 36#include <linux/sysctl.h>
37#include <linux/jiffies.h>
37 38
38#include <asm/string.h> 39#include <asm/string.h>
39#include <asm/uaccess.h> 40#include <asm/uaccess.h>
40#include <asm/io.h> 41#include <asm/io.h>
41#include <asm/system.h> 42#include <asm/system.h>
43#include <asm/cacheflush.h>
42#include <asm/mach-au1x00/au1000.h> 44#include <asm/mach-au1x00/au1000.h>
43 45
44#ifdef CONFIG_PM 46#ifdef CONFIG_PM
@@ -50,7 +52,7 @@
50# define DPRINTK(fmt, args...) 52# define DPRINTK(fmt, args...)
51#endif 53#endif
52 54
53static void calibrate_delay(void); 55static void au1000_calibrate_delay(void);
54 56
55extern void set_au1x00_speed(unsigned int new_freq); 57extern void set_au1x00_speed(unsigned int new_freq);
56extern unsigned int get_au1x00_speed(void); 58extern unsigned int get_au1x00_speed(void);
@@ -260,7 +262,7 @@ int au_sleep(void)
260} 262}
261 263
262static int pm_do_sleep(ctl_table * ctl, int write, struct file *file, 264static int pm_do_sleep(ctl_table * ctl, int write, struct file *file,
263 void *buffer, size_t * len) 265 void __user *buffer, size_t * len, loff_t *ppos)
264{ 266{
265 int retval = 0; 267 int retval = 0;
266#ifdef SLEEP_TEST_TIMEOUT 268#ifdef SLEEP_TEST_TIMEOUT
@@ -294,10 +296,9 @@ static int pm_do_sleep(ctl_table * ctl, int write, struct file *file,
294} 296}
295 297
296static int pm_do_suspend(ctl_table * ctl, int write, struct file *file, 298static int pm_do_suspend(ctl_table * ctl, int write, struct file *file,
297 void *buffer, size_t * len) 299 void __user *buffer, size_t * len, loff_t *ppos)
298{ 300{
299 int retval = 0; 301 int retval = 0;
300 void au1k_wait(void);
301 302
302 if (!write) { 303 if (!write) {
303 *len = 0; 304 *len = 0;
@@ -306,7 +307,7 @@ static int pm_do_suspend(ctl_table * ctl, int write, struct file *file,
306 if (retval) 307 if (retval)
307 return retval; 308 return retval;
308 suspend_mode = 1; 309 suspend_mode = 1;
309 au1k_wait(); 310
310 retval = pm_send_all(PM_RESUME, (void *) 0); 311 retval = pm_send_all(PM_RESUME, (void *) 0);
311 } 312 }
312 return retval; 313 return retval;
@@ -314,7 +315,7 @@ static int pm_do_suspend(ctl_table * ctl, int write, struct file *file,
314 315
315 316
316static int pm_do_freq(ctl_table * ctl, int write, struct file *file, 317static int pm_do_freq(ctl_table * ctl, int write, struct file *file,
317 void *buffer, size_t * len) 318 void __user *buffer, size_t * len, loff_t *ppos)
318{ 319{
319 int retval = 0, i; 320 int retval = 0, i;
320 unsigned long val, pll; 321 unsigned long val, pll;
@@ -409,14 +410,14 @@ static int pm_do_freq(ctl_table * ctl, int write, struct file *file,
409 410
410 411
411 /* We don't want _any_ interrupts other than 412 /* We don't want _any_ interrupts other than
412 * match20. Otherwise our calibrate_delay() 413 * match20. Otherwise our au1000_calibrate_delay()
413 * calculation will be off, potentially a lot. 414 * calculation will be off, potentially a lot.
414 */ 415 */
415 intc0_mask = save_local_and_disable(0); 416 intc0_mask = save_local_and_disable(0);
416 intc1_mask = save_local_and_disable(1); 417 intc1_mask = save_local_and_disable(1);
417 local_enable_irq(AU1000_TOY_MATCH2_INT); 418 local_enable_irq(AU1000_TOY_MATCH2_INT);
418 spin_unlock_irqrestore(&pm_lock, flags); 419 spin_unlock_irqrestore(&pm_lock, flags);
419 calibrate_delay(); 420 au1000_calibrate_delay();
420 restore_local_and_enable(0, intc0_mask); 421 restore_local_and_enable(0, intc0_mask);
421 restore_local_and_enable(1, intc1_mask); 422 restore_local_and_enable(1, intc1_mask);
422 return retval; 423 return retval;
@@ -456,7 +457,7 @@ __initcall(pm_init);
456 better than 1% */ 457 better than 1% */
457#define LPS_PREC 8 458#define LPS_PREC 8
458 459
459static void calibrate_delay(void) 460static void au1000_calibrate_delay(void)
460{ 461{
461 unsigned long ticks, loopbit; 462 unsigned long ticks, loopbit;
462 int lps_precision = LPS_PREC; 463 int lps_precision = LPS_PREC;
diff --git a/arch/mips/au1000/common/prom.c b/arch/mips/au1000/common/prom.c
index 22e5a85af4d5..9c171afd9a53 100644
--- a/arch/mips/au1000/common/prom.c
+++ b/arch/mips/au1000/common/prom.c
@@ -75,7 +75,8 @@ void prom_init_cmdline(void)
75 } 75 }
76 if (cp != &(arcs_cmdline[0])) /* get rid of trailing space */ 76 if (cp != &(arcs_cmdline[0])) /* get rid of trailing space */
77 --cp; 77 --cp;
78 *cp = '\0'; 78 if (prom_argc > 1)
79 *cp = '\0';
79 80
80} 81}
81 82
diff --git a/arch/mips/au1000/common/puts.c b/arch/mips/au1000/common/puts.c
index c2ae4624b77b..2705829cd466 100644
--- a/arch/mips/au1000/common/puts.c
+++ b/arch/mips/au1000/common/puts.c
@@ -39,7 +39,6 @@
39#define TIMEOUT 0xffffff 39#define TIMEOUT 0xffffff
40#define SLOW_DOWN 40#define SLOW_DOWN
41 41
42static const char digits[16] = "0123456789abcdef";
43static volatile unsigned long * const com1 = (unsigned long *)SERIAL_BASE; 42static volatile unsigned long * const com1 = (unsigned long *)SERIAL_BASE;
44 43
45 44
@@ -54,7 +53,7 @@ static inline void slow_down(void)
54#endif 53#endif
55 54
56void 55void
57putch(const unsigned char c) 56prom_putchar(const unsigned char c)
58{ 57{
59 unsigned char ch; 58 unsigned char ch;
60 int i = 0; 59 int i = 0;
@@ -69,77 +68,3 @@ putch(const unsigned char c)
69 } while (0 == (ch & TX_BUSY)); 68 } while (0 == (ch & TX_BUSY));
70 com1[SER_DATA] = c; 69 com1[SER_DATA] = c;
71} 70}
72
73void
74puts(unsigned char *cp)
75{
76 unsigned char ch;
77 int i = 0;
78
79 while (*cp) {
80 do {
81 ch = com1[SER_CMD];
82 slow_down();
83 i++;
84 if (i>TIMEOUT) {
85 break;
86 }
87 } while (0 == (ch & TX_BUSY));
88 com1[SER_DATA] = *cp++;
89 }
90 putch('\r');
91 putch('\n');
92}
93
94void
95fputs(const char *cp)
96{
97 unsigned char ch;
98 int i = 0;
99
100 while (*cp) {
101
102 do {
103 ch = com1[SER_CMD];
104 slow_down();
105 i++;
106 if (i>TIMEOUT) {
107 break;
108 }
109 } while (0 == (ch & TX_BUSY));
110 com1[SER_DATA] = *cp++;
111 }
112}
113
114
115void
116put64(uint64_t ul)
117{
118 int cnt;
119 unsigned ch;
120
121 cnt = 16; /* 16 nibbles in a 64 bit long */
122 putch('0');
123 putch('x');
124 do {
125 cnt--;
126 ch = (unsigned char)(ul >> cnt * 4) & 0x0F;
127 putch(digits[ch]);
128 } while (cnt > 0);
129}
130
131void
132put32(unsigned u)
133{
134 int cnt;
135 unsigned ch;
136
137 cnt = 8; /* 8 nibbles in a 32 bit long */
138 putch('0');
139 putch('x');
140 do {
141 cnt--;
142 ch = (unsigned char)(u >> cnt * 4) & 0x0F;
143 putch(digits[ch]);
144 } while (cnt > 0);
145}
diff --git a/arch/mips/au1000/common/setup.c b/arch/mips/au1000/common/setup.c
index eff89e109ce6..1ef15d5ef943 100644
--- a/arch/mips/au1000/common/setup.c
+++ b/arch/mips/au1000/common/setup.c
@@ -32,6 +32,7 @@
32#include <linux/mm.h> 32#include <linux/mm.h>
33#include <linux/delay.h> 33#include <linux/delay.h>
34#include <linux/interrupt.h> 34#include <linux/interrupt.h>
35#include <linux/module.h>
35 36
36#include <asm/cpu.h> 37#include <asm/cpu.h>
37#include <asm/bootinfo.h> 38#include <asm/bootinfo.h>
@@ -57,7 +58,7 @@ extern void au1xxx_time_init(void);
57extern void au1xxx_timer_setup(struct irqaction *irq); 58extern void au1xxx_timer_setup(struct irqaction *irq);
58extern void set_cpuspec(void); 59extern void set_cpuspec(void);
59 60
60static int __init au1x00_setup(void) 61void __init plat_setup(void)
61{ 62{
62 struct cpu_spec *sp; 63 struct cpu_spec *sp;
63 char *argptr; 64 char *argptr;
@@ -106,8 +107,6 @@ static int __init au1x00_setup(void)
106 /*strcat(argptr, " video=au1100fb:panel:Sharp_320x240_16");*/ 107 /*strcat(argptr, " video=au1100fb:panel:Sharp_320x240_16");*/
107#ifdef CONFIG_MIPS_HYDROGEN3 108#ifdef CONFIG_MIPS_HYDROGEN3
108 strcat(argptr, " video=au1100fb:panel:Hydrogen_3_NEC_panel_320x240,nohwcursor"); 109 strcat(argptr, " video=au1100fb:panel:Hydrogen_3_NEC_panel_320x240,nohwcursor");
109#else
110 strcat(argptr, " video=au1100fb:panel:s10,nohwcursor");
111#endif 110#endif
112 } 111 }
113#endif 112#endif
@@ -153,15 +152,11 @@ static int __init au1x00_setup(void)
153 au_sync(); 152 au_sync();
154 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T0S); 153 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T0S);
155 au_writel(0, SYS_TOYTRIM); 154 au_writel(0, SYS_TOYTRIM);
156
157 return 0;
158} 155}
159 156
160early_initcall(au1x00_setup);
161
162#if defined(CONFIG_64BIT_PHYS_ADDR) 157#if defined(CONFIG_64BIT_PHYS_ADDR)
163/* This routine should be valid for all Au1x based boards */ 158/* This routine should be valid for all Au1x based boards */
164phys_t fixup_bigphys_addr(phys_t phys_addr, phys_t size) 159phys_t __fixup_bigphys_addr(phys_t phys_addr, phys_t size)
165{ 160{
166 u32 start, end; 161 u32 start, end;
167 162
@@ -192,4 +187,5 @@ phys_t fixup_bigphys_addr(phys_t phys_addr, phys_t size)
192 /* default nop */ 187 /* default nop */
193 return phys_addr; 188 return phys_addr;
194} 189}
190EXPORT_SYMBOL(__fixup_bigphys_addr);
195#endif 191#endif
diff --git a/arch/mips/au1000/common/time.c b/arch/mips/au1000/common/time.c
index 57675b41480e..883d3f3d8c53 100644
--- a/arch/mips/au1000/common/time.c
+++ b/arch/mips/au1000/common/time.c
@@ -50,7 +50,6 @@
50#include <linux/mc146818rtc.h> 50#include <linux/mc146818rtc.h>
51#include <linux/timex.h> 51#include <linux/timex.h>
52 52
53extern void startup_match20_interrupt(void);
54extern void do_softirq(void); 53extern void do_softirq(void);
55extern volatile unsigned long wall_jiffies; 54extern volatile unsigned long wall_jiffies;
56unsigned long missed_heart_beats = 0; 55unsigned long missed_heart_beats = 0;
@@ -58,14 +57,17 @@ unsigned long missed_heart_beats = 0;
58static unsigned long r4k_offset; /* Amount to increment compare reg each time */ 57static unsigned long r4k_offset; /* Amount to increment compare reg each time */
59static unsigned long r4k_cur; /* What counter should be at next timer irq */ 58static unsigned long r4k_cur; /* What counter should be at next timer irq */
60int no_au1xxx_32khz; 59int no_au1xxx_32khz;
61void (*au1k_wait_ptr)(void); 60extern int allow_au1k_wait; /* default off for CP0 Counter */
62 61
63/* Cycle counter value at the previous timer interrupt.. */ 62/* Cycle counter value at the previous timer interrupt.. */
64static unsigned int timerhi = 0, timerlo = 0; 63static unsigned int timerhi = 0, timerlo = 0;
65 64
66#ifdef CONFIG_PM 65#ifdef CONFIG_PM
67#define MATCH20_INC 328 66#if HZ < 100 || HZ > 1000
68extern void startup_match20_interrupt(void); 67#error "unsupported HZ value! Must be in [100,1000]"
68#endif
69#define MATCH20_INC (328*100/HZ) /* magic number 328 is for HZ=100... */
70extern void startup_match20_interrupt(irqreturn_t (*handler)(int, void *, struct pt_regs *));
69static unsigned long last_pc0, last_match20; 71static unsigned long last_pc0, last_match20;
70#endif 72#endif
71 73
@@ -117,17 +119,16 @@ null:
117} 119}
118 120
119#ifdef CONFIG_PM 121#ifdef CONFIG_PM
120void counter0_irq(int irq, void *dev_id, struct pt_regs *regs) 122irqreturn_t counter0_irq(int irq, void *dev_id, struct pt_regs *regs)
121{ 123{
122 unsigned long pc0; 124 unsigned long pc0;
123 int time_elapsed; 125 int time_elapsed;
124 static int jiffie_drift = 0; 126 static int jiffie_drift = 0;
125 127
126 kstat.irqs[0][irq]++;
127 if (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20) { 128 if (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20) {
128 /* should never happen! */ 129 /* should never happen! */
129 printk(KERN_WARNING "counter 0 w status eror\n"); 130 printk(KERN_WARNING "counter 0 w status error\n");
130 return; 131 return IRQ_NONE;
131 } 132 }
132 133
133 pc0 = au_readl(SYS_TOYREAD); 134 pc0 = au_readl(SYS_TOYREAD);
@@ -164,6 +165,8 @@ void counter0_irq(int irq, void *dev_id, struct pt_regs *regs)
164 update_process_times(user_mode(regs)); 165 update_process_times(user_mode(regs));
165#endif 166#endif
166 } 167 }
168
169 return IRQ_HANDLED;
167} 170}
168 171
169/* When we wakeup from sleep, we have to "catch up" on all of the 172/* When we wakeup from sleep, we have to "catch up" on all of the
@@ -388,7 +391,6 @@ void au1xxx_timer_setup(struct irqaction *irq)
388{ 391{
389 unsigned int est_freq; 392 unsigned int est_freq;
390 extern unsigned long (*do_gettimeoffset)(void); 393 extern unsigned long (*do_gettimeoffset)(void);
391 extern void au1k_wait(void);
392 394
393 printk("calculating r4koff... "); 395 printk("calculating r4koff... ");
394 r4k_offset = cal_r4koff(); 396 r4k_offset = cal_r4koff();
@@ -441,18 +443,18 @@ void au1xxx_timer_setup(struct irqaction *irq)
441 au_sync(); 443 au_sync();
442 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20); 444 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20);
443 445
444 /* setup match20 to interrupt once every 10ms */ 446 /* setup match20 to interrupt once every HZ */
445 last_pc0 = last_match20 = au_readl(SYS_TOYREAD); 447 last_pc0 = last_match20 = au_readl(SYS_TOYREAD);
446 au_writel(last_match20 + MATCH20_INC, SYS_TOYMATCH2); 448 au_writel(last_match20 + MATCH20_INC, SYS_TOYMATCH2);
447 au_sync(); 449 au_sync();
448 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20); 450 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20);
449 startup_match20_interrupt(); 451 startup_match20_interrupt(counter0_irq);
450 452
451 do_gettimeoffset = do_fast_pm_gettimeoffset; 453 do_gettimeoffset = do_fast_pm_gettimeoffset;
452 454
453 /* We can use the real 'wait' instruction. 455 /* We can use the real 'wait' instruction.
454 */ 456 */
455 au1k_wait_ptr = au1k_wait; 457 allow_au1k_wait = 1;
456 } 458 }
457 459
458#else 460#else
diff --git a/arch/mips/au1000/common/usbdev.c b/arch/mips/au1000/common/usbdev.c
index 447a9a4612a8..0b21bed7ee55 100644
--- a/arch/mips/au1000/common/usbdev.c
+++ b/arch/mips/au1000/common/usbdev.c
@@ -1005,11 +1005,11 @@ process_ep0_receive (struct usb_dev* dev)
1005#endif 1005#endif
1006 dev->ep0_stage = SETUP_STAGE; 1006 dev->ep0_stage = SETUP_STAGE;
1007 break; 1007 break;
1008 } 1008 }
1009 1009
1010 spin_unlock(&ep0->lock); 1010 spin_unlock(&ep0->lock);
1011 // we're done processing the packet, free it 1011 // we're done processing the packet, free it
1012 kfree(pkt); 1012 kfree(pkt);
1013} 1013}
1014 1014
1015 1015
@@ -1072,8 +1072,7 @@ dma_done_ep0_intr(int irq, void *dev_id, struct pt_regs *regs)
1072 clear_dma_done1(ep0->indma); 1072 clear_dma_done1(ep0->indma);
1073 1073
1074 pkt = send_packet_complete(ep0); 1074 pkt = send_packet_complete(ep0);
1075 if (pkt) 1075 kfree(pkt);
1076 kfree(pkt);
1077 } 1076 }
1078 1077
1079 /* 1078 /*
@@ -1302,8 +1301,7 @@ usbdev_exit(void)
1302 endpoint_flush(ep); 1301 endpoint_flush(ep);
1303 } 1302 }
1304 1303
1305 if (usbdev.full_conf_desc) 1304 kfree(usbdev.full_conf_desc);
1306 kfree(usbdev.full_conf_desc);
1307} 1305}
1308 1306
1309int 1307int
diff --git a/arch/mips/au1000/csb250/init.c b/arch/mips/au1000/csb250/init.c
index bd99733abc0b..a4898b1bc66a 100644
--- a/arch/mips/au1000/csb250/init.c
+++ b/arch/mips/au1000/csb250/init.c
@@ -35,7 +35,6 @@
35#include <asm/bootinfo.h> 35#include <asm/bootinfo.h>
36#include <linux/string.h> 36#include <linux/string.h>
37#include <linux/kernel.h> 37#include <linux/kernel.h>
38#include <linux/sched.h>
39 38
40int prom_argc; 39int prom_argc;
41char **prom_argv, **prom_envp; 40char **prom_argv, **prom_envp;
diff --git a/arch/mips/au1000/db1x00/irqmap.c b/arch/mips/au1000/db1x00/irqmap.c
index 8f6ef0dbe1f8..f63024a9893a 100644
--- a/arch/mips/au1000/db1x00/irqmap.c
+++ b/arch/mips/au1000/db1x00/irqmap.c
@@ -48,6 +48,38 @@
48#include <asm/system.h> 48#include <asm/system.h>
49#include <asm/mach-au1x00/au1000.h> 49#include <asm/mach-au1x00/au1000.h>
50 50
51#ifdef CONFIG_MIPS_DB1500
52char irq_tab_alchemy[][5] __initdata = {
53 [12] = { -1, INTA, INTX, INTX, INTX}, /* IDSEL 12 - HPT371 */
54 [13] = { -1, INTA, INTB, INTC, INTD}, /* IDSEL 13 - PCI slot */
55};
56#endif
57
58#ifdef CONFIG_MIPS_BOSPORUS
59char irq_tab_alchemy[][5] __initdata = {
60 [11] = { -1, INTA, INTB, INTX, INTX}, /* IDSEL 11 - miniPCI */
61 [12] = { -1, INTA, INTX, INTX, INTX}, /* IDSEL 12 - SN1741 */
62 [13] = { -1, INTA, INTB, INTC, INTD}, /* IDSEL 13 - PCI slot */
63};
64#endif
65
66#ifdef CONFIG_MIPS_MIRAGE
67char irq_tab_alchemy[][5] __initdata = {
68 [11] = { -1, INTD, INTX, INTX, INTX}, /* IDSEL 11 - SMI VGX */
69 [12] = { -1, INTX, INTX, INTC, INTX}, /* IDSEL 12 - PNX1300 */
70 [13] = { -1, INTA, INTB, INTX, INTX}, /* IDSEL 13 - miniPCI */
71};
72#endif
73
74#ifdef CONFIG_MIPS_DB1550
75char irq_tab_alchemy[][5] __initdata = {
76 [11] = { -1, INTC, INTX, INTX, INTX}, /* IDSEL 11 - on-board HPT371 */
77 [12] = { -1, INTB, INTC, INTD, INTA}, /* IDSEL 12 - PCI slot 2 (left) */
78 [13] = { -1, INTA, INTB, INTC, INTD}, /* IDSEL 13 - PCI slot 1 (right) */
79};
80#endif
81
82
51au1xxx_irq_map_t au1xxx_irq_map[] = { 83au1xxx_irq_map_t au1xxx_irq_map[] = {
52 84
53#ifndef CONFIG_MIPS_MIRAGE 85#ifndef CONFIG_MIPS_MIRAGE
diff --git a/arch/mips/au1000/db1x00/mirage_ts.c b/arch/mips/au1000/db1x00/mirage_ts.c
index ade35e432004..c29852c24b4f 100644
--- a/arch/mips/au1000/db1x00/mirage_ts.c
+++ b/arch/mips/au1000/db1x00/mirage_ts.c
@@ -102,15 +102,15 @@ static struct {
102} mirage_ts_cal = 102} mirage_ts_cal =
103{ 103{
104#if 0 104#if 0
105 xscale: 84, 105 .xscale = 84,
106 xtrans: -157, 106 .xtrans = -157,
107 yscale: 66, 107 .yscale = 66,
108 ytrans: -150, 108 .ytrans = -150,
109#else 109#else
110 xscale: 84, 110 .xscale = 84,
111 xtrans: -150, 111 .xtrans = -150,
112 yscale: 66, 112 .yscale = 66,
113 ytrans: -146, 113 .ytrans = -146,
114#endif 114#endif
115}; 115};
116 116
diff --git a/arch/mips/au1000/hydrogen3/init.c b/arch/mips/au1000/hydrogen3/init.c
index 8cc9879dd582..01ab28483959 100644
--- a/arch/mips/au1000/hydrogen3/init.c
+++ b/arch/mips/au1000/hydrogen3/init.c
@@ -37,7 +37,6 @@
37#include <linux/config.h> 37#include <linux/config.h>
38#include <linux/string.h> 38#include <linux/string.h>
39#include <linux/kernel.h> 39#include <linux/kernel.h>
40#include <linux/sched.h>
41 40
42int prom_argc; 41int prom_argc;
43char **prom_argv, **prom_envp; 42char **prom_argv, **prom_envp;
diff --git a/arch/mips/au1000/mtx-1/init.c b/arch/mips/au1000/mtx-1/init.c
index 02e7dbcff727..88f2b6d97281 100644
--- a/arch/mips/au1000/mtx-1/init.c
+++ b/arch/mips/au1000/mtx-1/init.c
@@ -33,7 +33,6 @@
33#include <linux/sched.h> 33#include <linux/sched.h>
34#include <linux/init.h> 34#include <linux/init.h>
35#include <linux/mm.h> 35#include <linux/mm.h>
36#include <linux/sched.h>
37#include <linux/bootmem.h> 36#include <linux/bootmem.h>
38#include <asm/addrspace.h> 37#include <asm/addrspace.h>
39#include <asm/bootinfo.h> 38#include <asm/bootinfo.h>
diff --git a/arch/mips/au1000/mtx-1/irqmap.c b/arch/mips/au1000/mtx-1/irqmap.c
index ddcb9d089dc1..f9a0a8b9def2 100644
--- a/arch/mips/au1000/mtx-1/irqmap.c
+++ b/arch/mips/au1000/mtx-1/irqmap.c
@@ -47,6 +47,17 @@
47#include <asm/system.h> 47#include <asm/system.h>
48#include <asm/mach-au1x00/au1000.h> 48#include <asm/mach-au1x00/au1000.h>
49 49
50char irq_tab_alchemy[][5] __initdata = {
51 [0] = { -1, INTA, INTB, INTX, INTX}, /* IDSEL 00 - AdapterA-Slot0 (top) */
52 [1] = { -1, INTB, INTA, INTX, INTX}, /* IDSEL 01 - AdapterA-Slot1 (bottom) */
53 [2] = { -1, INTC, INTD, INTX, INTX}, /* IDSEL 02 - AdapterB-Slot0 (top) */
54 [3] = { -1, INTD, INTC, INTX, INTX}, /* IDSEL 03 - AdapterB-Slot1 (bottom) */
55 [4] = { -1, INTA, INTB, INTX, INTX}, /* IDSEL 04 - AdapterC-Slot0 (top) */
56 [5] = { -1, INTB, INTA, INTX, INTX}, /* IDSEL 05 - AdapterC-Slot1 (bottom) */
57 [6] = { -1, INTC, INTD, INTX, INTX}, /* IDSEL 06 - AdapterD-Slot0 (top) */
58 [7] = { -1, INTD, INTC, INTX, INTX}, /* IDSEL 07 - AdapterD-Slot1 (bottom) */
59};
60
50au1xxx_irq_map_t au1xxx_irq_map[] = { 61au1xxx_irq_map_t au1xxx_irq_map[] = {
51 { AU1500_GPIO_204, INTC_INT_HIGH_LEVEL, 0}, 62 { AU1500_GPIO_204, INTC_INT_HIGH_LEVEL, 0},
52 { AU1500_GPIO_201, INTC_INT_LOW_LEVEL, 0 }, 63 { AU1500_GPIO_201, INTC_INT_LOW_LEVEL, 0 },
diff --git a/arch/mips/au1000/pb1000/init.c b/arch/mips/au1000/pb1000/init.c
index 34713c5df0d7..e9fa1bab81f3 100644
--- a/arch/mips/au1000/pb1000/init.c
+++ b/arch/mips/au1000/pb1000/init.c
@@ -65,5 +65,4 @@ void __init prom_init(void)
65 memsize = simple_strtol(memsize_str, NULL, 0); 65 memsize = simple_strtol(memsize_str, NULL, 0);
66 } 66 }
67 add_memory_region(0, memsize, BOOT_MEM_RAM); 67 add_memory_region(0, memsize, BOOT_MEM_RAM);
68 return 0;
69} 68}
diff --git a/arch/mips/au1000/pb1200/Makefile b/arch/mips/au1000/pb1200/Makefile
new file mode 100644
index 000000000000..22b673cf55af
--- /dev/null
+++ b/arch/mips/au1000/pb1200/Makefile
@@ -0,0 +1,5 @@
1#
2# Makefile for the Alchemy Semiconductor PB1200 board.
3#
4
5lib-y := init.o board_setup.o irqmap.o
diff --git a/arch/mips/au1000/pb1200/board_setup.c b/arch/mips/au1000/pb1200/board_setup.c
new file mode 100644
index 000000000000..a45b17538ac9
--- /dev/null
+++ b/arch/mips/au1000/pb1200/board_setup.c
@@ -0,0 +1,193 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 * Alchemy Pb1200/Db1200 board setup.
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 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
12 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
14 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
15 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
16 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
17 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
18 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
19 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
20 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21 *
22 * You should have received a copy of the GNU General Public License along
23 * with this program; if not, write to the Free Software Foundation, Inc.,
24 * 675 Mass Ave, Cambridge, MA 02139, USA.
25 */
26#include <linux/config.h>
27#include <linux/init.h>
28#include <linux/sched.h>
29#include <linux/ioport.h>
30#include <linux/mm.h>
31#include <linux/console.h>
32#include <linux/mc146818rtc.h>
33#include <linux/delay.h>
34
35#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
36#include <linux/ide.h>
37#endif
38
39#include <asm/cpu.h>
40#include <asm/bootinfo.h>
41#include <asm/irq.h>
42#include <asm/mipsregs.h>
43#include <asm/reboot.h>
44#include <asm/pgtable.h>
45#include <asm/mach-au1x00/au1000.h>
46#include <asm/mach-au1x00/au1xxx_dbdma.h>
47
48#ifdef CONFIG_MIPS_PB1200
49#include <asm/mach-pb1x00/pb1200.h>
50#endif
51
52#ifdef CONFIG_MIPS_DB1200
53#include <asm/mach-db1x00/db1200.h>
54#define PB1200_ETH_INT DB1200_ETH_INT
55#define PB1200_IDE_INT DB1200_IDE_INT
56#endif
57
58extern void _board_init_irq(void);
59extern void (*board_init_irq)(void);
60
61void board_reset (void)
62{
63 bcsr->resets = 0;
64 bcsr->system = 0;
65}
66
67void __init board_setup(void)
68{
69 char *argptr = NULL;
70 u32 pin_func;
71
72#if 0
73 /* Enable PSC1 SYNC for AC97. Normaly done in audio driver,
74 * but it is board specific code, so put it here.
75 */
76 pin_func = au_readl(SYS_PINFUNC);
77 au_sync();
78 pin_func |= SYS_PF_MUST_BE_SET | SYS_PF_PSC1_S1;
79 au_writel(pin_func, SYS_PINFUNC);
80
81 au_writel(0, (u32)bcsr|0x10); /* turn off pcmcia power */
82 au_sync();
83#endif
84
85#if defined(CONFIG_I2C_AU1550)
86 {
87 u32 freq0, clksrc;
88
89 /* Select SMBUS in CPLD */
90 bcsr->resets &= ~(BCSR_RESETS_PCS0MUX);
91
92 pin_func = au_readl(SYS_PINFUNC);
93 au_sync();
94 pin_func &= ~(3<<17 | 1<<4);
95 /* Set GPIOs correctly */
96 pin_func |= 2<<17;
97 au_writel(pin_func, SYS_PINFUNC);
98 au_sync();
99
100 /* The i2c driver depends on 50Mhz clock */
101 freq0 = au_readl(SYS_FREQCTRL0);
102 au_sync();
103 freq0 &= ~(SYS_FC_FRDIV1_MASK | SYS_FC_FS1 | SYS_FC_FE1);
104 freq0 |= (3<<SYS_FC_FRDIV1_BIT);
105 /* 396Mhz / (3+1)*2 == 49.5Mhz */
106 au_writel(freq0, SYS_FREQCTRL0);
107 au_sync();
108 freq0 |= SYS_FC_FE1;
109 au_writel(freq0, SYS_FREQCTRL0);
110 au_sync();
111
112 clksrc = au_readl(SYS_CLKSRC);
113 au_sync();
114 clksrc &= ~0x01f00000;
115 /* bit 22 is EXTCLK0 for PSC0 */
116 clksrc |= (0x3 << 22);
117 au_writel(clksrc, SYS_CLKSRC);
118 au_sync();
119 }
120#endif
121
122#ifdef CONFIG_FB_AU1200
123 argptr = prom_getcmdline();
124#ifdef CONFIG_MIPS_PB1200
125 strcat(argptr, " video=au1200fb:panel:bs");
126#endif
127#ifdef CONFIG_MIPS_DB1200
128 strcat(argptr, " video=au1200fb:panel:bs");
129#endif
130#endif
131
132 /* The Pb1200 development board uses external MUX for PSC0 to
133 support SMB/SPI. bcsr->resets bit 12: 0=SMB 1=SPI
134 */
135#if defined(CONFIG_AU1XXX_PSC_SPI) && defined(CONFIG_I2C_AU1550)
136 #error I2C and SPI are mutually exclusive. Both are physically connected to PSC0.\
137 Refer to Pb1200/Db1200 documentation.
138#elif defined( CONFIG_AU1XXX_PSC_SPI )
139 bcsr->resets |= BCSR_RESETS_PCS0MUX;
140 /*Hard Coding Value to enable Temp Sensors [bit 14] Value for SOC Au1200. Pls refer documentation*/
141 bcsr->resets =0x900f;
142#elif defined( CONFIG_I2C_AU1550 )
143 bcsr->resets &= (~BCSR_RESETS_PCS0MUX);
144#endif
145 au_sync();
146
147#ifdef CONFIG_MIPS_PB1200
148 printk("AMD Alchemy Pb1200 Board\n");
149#endif
150#ifdef CONFIG_MIPS_DB1200
151 printk("AMD Alchemy Db1200 Board\n");
152#endif
153
154 /* Setup Pb1200 External Interrupt Controller */
155 {
156 extern void (*board_init_irq)(void);
157 extern void _board_init_irq(void);
158 board_init_irq = _board_init_irq;
159 }
160}
161
162int
163board_au1200fb_panel (void)
164{
165 BCSR *bcsr = (BCSR *)BCSR_KSEG1_ADDR;
166 int p;
167
168 p = bcsr->switches;
169 p >>= 8;
170 p &= 0x0F;
171 return p;
172}
173
174int
175board_au1200fb_panel_init (void)
176{
177 /* Apply power */
178 BCSR *bcsr = (BCSR *)BCSR_KSEG1_ADDR;
179 bcsr->board |= (BCSR_BOARD_LCDVEE | BCSR_BOARD_LCDVDD | BCSR_BOARD_LCDBL);
180 /*printk("board_au1200fb_panel_init()\n"); */
181 return 0;
182}
183
184int
185board_au1200fb_panel_shutdown (void)
186{
187 /* Remove power */
188 BCSR *bcsr = (BCSR *)BCSR_KSEG1_ADDR;
189 bcsr->board &= ~(BCSR_BOARD_LCDVEE | BCSR_BOARD_LCDVDD | BCSR_BOARD_LCDBL);
190 /*printk("board_au1200fb_panel_shutdown()\n"); */
191 return 0;
192}
193
diff --git a/arch/mips/au1000/pb1200/init.c b/arch/mips/au1000/pb1200/init.c
new file mode 100644
index 000000000000..27f09e374e15
--- /dev/null
+++ b/arch/mips/au1000/pb1200/init.c
@@ -0,0 +1,69 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 * PB1200 board setup
5 *
6 * Copyright 2001 MontaVista Software Inc.
7 * Author: MontaVista Software, Inc.
8 * ppopov@mvista.com or source@mvista.com
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 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
16 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
17 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
18 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
21 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
22 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * You should have received a copy of the GNU General Public License along
27 * with this program; if not, write to the Free Software Foundation, Inc.,
28 * 675 Mass Ave, Cambridge, MA 02139, USA.
29 */
30#include <linux/init.h>
31#include <linux/mm.h>
32#include <linux/sched.h>
33#include <linux/bootmem.h>
34#include <asm/addrspace.h>
35#include <asm/bootinfo.h>
36#include <linux/string.h>
37#include <linux/kernel.h>
38
39int prom_argc;
40char **prom_argv, **prom_envp;
41extern void __init prom_init_cmdline(void);
42extern char *prom_getenv(char *envname);
43
44const char *get_system_type(void)
45{
46 return "Alchemy Pb1200";
47}
48
49void __init prom_init(void)
50{
51 unsigned char *memsize_str;
52 unsigned long memsize;
53
54 prom_argc = (int) fw_arg0;
55 prom_argv = (char **) fw_arg1;
56 prom_envp = (char **) fw_arg2;
57
58 mips_machgroup = MACH_GROUP_ALCHEMY;
59 mips_machtype = MACH_PB1200;
60
61 prom_init_cmdline();
62 memsize_str = prom_getenv("memsize");
63 if (!memsize_str) {
64 memsize = 0x08000000;
65 } else {
66 memsize = simple_strtol(memsize_str, NULL, 0);
67 }
68 add_memory_region(0, memsize, BOOT_MEM_RAM);
69}
diff --git a/arch/mips/au1000/pb1200/irqmap.c b/arch/mips/au1000/pb1200/irqmap.c
new file mode 100644
index 000000000000..59e70e5cf325
--- /dev/null
+++ b/arch/mips/au1000/pb1200/irqmap.c
@@ -0,0 +1,182 @@
1/*
2 * BRIEF MODULE DESCRIPTION
3 * Au1xxx irq map table
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#include <linux/config.h>
26#include <linux/errno.h>
27#include <linux/init.h>
28#include <linux/irq.h>
29#include <linux/kernel_stat.h>
30#include <linux/module.h>
31#include <linux/signal.h>
32#include <linux/sched.h>
33#include <linux/types.h>
34#include <linux/interrupt.h>
35#include <linux/ioport.h>
36#include <linux/timex.h>
37#include <linux/slab.h>
38#include <linux/random.h>
39#include <linux/delay.h>
40
41#include <asm/bitops.h>
42#include <asm/bootinfo.h>
43#include <asm/io.h>
44#include <asm/mipsregs.h>
45#include <asm/system.h>
46#include <asm/mach-au1x00/au1000.h>
47
48#ifdef CONFIG_MIPS_PB1200
49#include <asm/mach-pb1x00/pb1200.h>
50#endif
51
52#ifdef CONFIG_MIPS_DB1200
53#include <asm/mach-db1x00/db1200.h>
54#define PB1200_INT_BEGIN DB1200_INT_BEGIN
55#define PB1200_INT_END DB1200_INT_END
56#endif
57
58au1xxx_irq_map_t au1xxx_irq_map[] = {
59 { AU1000_GPIO_7, INTC_INT_LOW_LEVEL, 0 }, // This is exteranl interrupt cascade
60};
61
62int au1xxx_nr_irqs = sizeof(au1xxx_irq_map)/sizeof(au1xxx_irq_map_t);
63
64/*
65 * Support for External interrupts on the PbAu1200 Development platform.
66 */
67static volatile int pb1200_cascade_en=0;
68
69irqreturn_t pb1200_cascade_handler( int irq, void *dev_id, struct pt_regs *regs)
70{
71 unsigned short bisr = bcsr->int_status;
72 int extirq_nr = 0;
73
74 /* Clear all the edge interrupts. This has no effect on level */
75 bcsr->int_status = bisr;
76 for( ; bisr; bisr &= (bisr-1) )
77 {
78 extirq_nr = (PB1200_INT_BEGIN-1) + au_ffs(bisr);
79 /* Ack and dispatch IRQ */
80 do_IRQ(extirq_nr,regs);
81 }
82 return IRQ_RETVAL(1);
83}
84
85inline void pb1200_enable_irq(unsigned int irq_nr)
86{
87 bcsr->intset_mask = 1<<(irq_nr - PB1200_INT_BEGIN);
88 bcsr->intset = 1<<(irq_nr - PB1200_INT_BEGIN);
89}
90
91inline void pb1200_disable_irq(unsigned int irq_nr)
92{
93 bcsr->intclr_mask = 1<<(irq_nr - PB1200_INT_BEGIN);
94 bcsr->intclr = 1<<(irq_nr - PB1200_INT_BEGIN);
95}
96
97static unsigned int pb1200_startup_irq( unsigned int irq_nr )
98{
99 if (++pb1200_cascade_en == 1)
100 {
101 request_irq(AU1000_GPIO_7, &pb1200_cascade_handler,
102 0, "Pb1200 Cascade", (void *)&pb1200_cascade_handler );
103#ifdef CONFIG_MIPS_PB1200
104 /* We have a problem with CPLD rev3. Enable a workaround */
105 if( ((bcsr->whoami & BCSR_WHOAMI_CPLD)>>4) <= 3)
106 {
107 printk("\nWARNING!!!\n");
108 printk("\nWARNING!!!\n");
109 printk("\nWARNING!!!\n");
110 printk("\nWARNING!!!\n");
111 printk("\nWARNING!!!\n");
112 printk("\nWARNING!!!\n");
113 printk("Pb1200 must be at CPLD rev4. Please have Pb1200\n");
114 printk("updated to latest revision. This software will not\n");
115 printk("work on anything less than CPLD rev4\n");
116 printk("\nWARNING!!!\n");
117 printk("\nWARNING!!!\n");
118 printk("\nWARNING!!!\n");
119 printk("\nWARNING!!!\n");
120 printk("\nWARNING!!!\n");
121 printk("\nWARNING!!!\n");
122 while(1);
123 }
124#endif
125 }
126 pb1200_enable_irq(irq_nr);
127 return 0;
128}
129
130static void pb1200_shutdown_irq( unsigned int irq_nr )
131{
132 pb1200_disable_irq(irq_nr);
133 if (--pb1200_cascade_en == 0)
134 {
135 free_irq(AU1000_GPIO_7,&pb1200_cascade_handler );
136 }
137 return;
138}
139
140static inline void pb1200_mask_and_ack_irq(unsigned int irq_nr)
141{
142 pb1200_disable_irq( irq_nr );
143}
144
145static void pb1200_end_irq(unsigned int irq_nr)
146{
147 if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS))) {
148 pb1200_enable_irq(irq_nr);
149 }
150}
151
152static struct hw_interrupt_type external_irq_type =
153{
154#ifdef CONFIG_MIPS_PB1200
155 "Pb1200 Ext",
156#endif
157#ifdef CONFIG_MIPS_DB1200
158 "Db1200 Ext",
159#endif
160 pb1200_startup_irq,
161 pb1200_shutdown_irq,
162 pb1200_enable_irq,
163 pb1200_disable_irq,
164 pb1200_mask_and_ack_irq,
165 pb1200_end_irq,
166 NULL
167};
168
169void _board_init_irq(void)
170{
171 int irq_nr;
172
173 for (irq_nr = PB1200_INT_BEGIN; irq_nr <= PB1200_INT_END; irq_nr++)
174 {
175 irq_desc[irq_nr].handler = &external_irq_type;
176 pb1200_disable_irq(irq_nr);
177 }
178
179 /* GPIO_7 can not be hooked here, so it is hooked upon first
180 request of any source attached to the cascade */
181}
182
diff --git a/arch/mips/au1000/pb1500/irqmap.c b/arch/mips/au1000/pb1500/irqmap.c
index 476e25001681..8cb76c2edb5e 100644
--- a/arch/mips/au1000/pb1500/irqmap.c
+++ b/arch/mips/au1000/pb1500/irqmap.c
@@ -47,6 +47,11 @@
47#include <asm/system.h> 47#include <asm/system.h>
48#include <asm/mach-au1x00/au1000.h> 48#include <asm/mach-au1x00/au1000.h>
49 49
50char irq_tab_alchemy[][5] __initdata = {
51 [12] = { -1, INTA, INTX, INTX, INTX}, /* IDSEL 12 - HPT370 */
52 [13] = { -1, INTA, INTB, INTC, INTD}, /* IDSEL 13 - PCI slot */
53};
54
50au1xxx_irq_map_t au1xxx_irq_map[] = { 55au1xxx_irq_map_t au1xxx_irq_map[] = {
51 { AU1500_GPIO_204, INTC_INT_HIGH_LEVEL, 0}, 56 { AU1500_GPIO_204, INTC_INT_HIGH_LEVEL, 0},
52 { AU1500_GPIO_201, INTC_INT_LOW_LEVEL, 0 }, 57 { AU1500_GPIO_201, INTC_INT_LOW_LEVEL, 0 },
diff --git a/arch/mips/au1000/pb1550/irqmap.c b/arch/mips/au1000/pb1550/irqmap.c
index 889d4949ee76..47c7a1c19f4b 100644
--- a/arch/mips/au1000/pb1550/irqmap.c
+++ b/arch/mips/au1000/pb1550/irqmap.c
@@ -47,6 +47,11 @@
47#include <asm/system.h> 47#include <asm/system.h>
48#include <asm/mach-au1x00/au1000.h> 48#include <asm/mach-au1x00/au1000.h>
49 49
50char irq_tab_alchemy[][5] __initdata = {
51 [12] = { -1, INTB, INTC, INTD, INTA}, /* IDSEL 12 - PCI slot 2 (left) */
52 [13] = { -1, INTA, INTB, INTC, INTD}, /* IDSEL 13 - PCI slot 1 (right) */
53};
54
50au1xxx_irq_map_t au1xxx_irq_map[] = { 55au1xxx_irq_map_t au1xxx_irq_map[] = {
51 { AU1000_GPIO_0, INTC_INT_LOW_LEVEL, 0 }, 56 { AU1000_GPIO_0, INTC_INT_LOW_LEVEL, 0 },
52 { AU1000_GPIO_1, INTC_INT_LOW_LEVEL, 0 }, 57 { AU1000_GPIO_1, INTC_INT_LOW_LEVEL, 0 },
diff --git a/arch/mips/boot/Makefile b/arch/mips/boot/Makefile
index efbeac326815..0dc84417bf49 100644
--- a/arch/mips/boot/Makefile
+++ b/arch/mips/boot/Makefile
@@ -33,6 +33,9 @@ vmlinux.ecoff: $(obj)/elf2ecoff $(VMLINUX)
33$(obj)/elf2ecoff: $(obj)/elf2ecoff.c 33$(obj)/elf2ecoff: $(obj)/elf2ecoff.c
34 $(HOSTCC) -o $@ $^ 34 $(HOSTCC) -o $@ $^
35 35
36vmlinux.bin: $(VMLINUX)
37 $(OBJCOPY) -O binary $(strip-flags) $(VMLINUX) $(obj)/vmlinux.bin
38
36vmlinux.srec: $(VMLINUX) 39vmlinux.srec: $(VMLINUX)
37 $(OBJCOPY) -S -O srec $(strip-flags) $(VMLINUX) $(obj)/vmlinux.srec 40 $(OBJCOPY) -S -O srec $(strip-flags) $(VMLINUX) $(obj)/vmlinux.srec
38 41
@@ -45,5 +48,6 @@ archhelp:
45 48
46clean-files += addinitrd \ 49clean-files += addinitrd \
47 elf2ecoff \ 50 elf2ecoff \
51 vmlinux.bin \
48 vmlinux.ecoff \ 52 vmlinux.ecoff \
49 vmlinux.srec 53 vmlinux.srec
diff --git a/arch/mips/cobalt/Makefile b/arch/mips/cobalt/Makefile
index a5e6554b2326..3b6b7579d1de 100644
--- a/arch/mips/cobalt/Makefile
+++ b/arch/mips/cobalt/Makefile
@@ -2,6 +2,6 @@
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 := irq.o int-handler.o reset.o setup.o promcon.o 5obj-y := irq.o int-handler.o reset.o setup.o
6 6
7EXTRA_AFLAGS := $(CFLAGS) 7EXTRA_AFLAGS := $(CFLAGS)
diff --git a/arch/mips/cobalt/int-handler.S b/arch/mips/cobalt/int-handler.S
index 1a21dec1b3ca..f92608e8d84f 100644
--- a/arch/mips/cobalt/int-handler.S
+++ b/arch/mips/cobalt/int-handler.S
@@ -18,8 +18,8 @@
18 SAVE_ALL 18 SAVE_ALL
19 CLI 19 CLI
20 20
21 la ra, ret_from_irq 21 PTR_LA ra, ret_from_irq
22 move a1, sp 22 move a0, sp
23 j cobalt_irq 23 j cobalt_irq
24 24
25 END(cobalt_handle_int) 25 END(cobalt_handle_int)
diff --git a/arch/mips/cobalt/irq.c b/arch/mips/cobalt/irq.c
index 6d2a81581397..0d90851f925e 100644
--- a/arch/mips/cobalt/irq.c
+++ b/arch/mips/cobalt/irq.c
@@ -10,6 +10,8 @@
10#include <linux/kernel.h> 10#include <linux/kernel.h>
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/irq.h> 12#include <linux/irq.h>
13#include <linux/interrupt.h>
14#include <linux/pci.h>
13 15
14#include <asm/i8259.h> 16#include <asm/i8259.h>
15#include <asm/irq_cpu.h> 17#include <asm/irq_cpu.h>
@@ -25,8 +27,8 @@ extern void cobalt_handle_int(void);
25 * the CPU interrupt lines, and ones that come in on the via chip. The CPU 27 * the CPU interrupt lines, and ones that come in on the via chip. The CPU
26 * mappings are: 28 * mappings are:
27 * 29 *
28 * 16, - Software interrupt 0 (unused) IE_SW0 30 * 16 - Software interrupt 0 (unused) IE_SW0
29 * 17 - Software interrupt 1 (unused) IE_SW0 31 * 17 - Software interrupt 1 (unused) IE_SW1
30 * 18 - Galileo chip (timer) IE_IRQ0 32 * 18 - Galileo chip (timer) IE_IRQ0
31 * 19 - Tulip 0 + NCR SCSI IE_IRQ1 33 * 19 - Tulip 0 + NCR SCSI IE_IRQ1
32 * 20 - Tulip 1 IE_IRQ2 34 * 20 - Tulip 1 IE_IRQ2
@@ -42,61 +44,94 @@ extern void cobalt_handle_int(void);
42 * 15 - IDE1 44 * 15 - IDE1
43 */ 45 */
44 46
45asmlinkage void cobalt_irq(struct pt_regs *regs) 47static inline void galileo_irq(struct pt_regs *regs)
46{ 48{
47 unsigned int pending = read_c0_status() & read_c0_cause(); 49 unsigned int mask, pending, devfn;
48
49 if (pending & CAUSEF_IP2) { /* int 18 */
50 unsigned long irq_src = GALILEO_INL(GT_INTRCAUSE_OFS);
51
52 /* Check for timer irq ... */
53 if (irq_src & GALILEO_T0EXP) {
54 /* Clear the int line */
55 GALILEO_OUTL(0, GT_INTRCAUSE_OFS);
56 do_IRQ(COBALT_TIMER_IRQ, regs);
57 }
58 return;
59 }
60 50
61 if (pending & CAUSEF_IP6) { /* int 22 */ 51 mask = GALILEO_INL(GT_INTRMASK_OFS);
62 int irq = i8259_irq(); 52 pending = GALILEO_INL(GT_INTRCAUSE_OFS) & mask;
63 53
64 if (irq >= 0) 54 if (pending & GALILEO_INTR_T0EXP) {
65 do_IRQ(irq, regs);
66 return;
67 }
68 55
69 if (pending & CAUSEF_IP3) { /* int 19 */ 56 GALILEO_OUTL(~GALILEO_INTR_T0EXP, GT_INTRCAUSE_OFS);
70 do_IRQ(COBALT_ETH0_IRQ, regs); 57 do_IRQ(COBALT_GALILEO_IRQ, regs);
71 return;
72 }
73 58
74 if (pending & CAUSEF_IP4) { /* int 20 */ 59 } else if (pending & GALILEO_INTR_RETRY_CTR) {
75 do_IRQ(COBALT_ETH1_IRQ, regs);
76 return;
77 }
78 60
79 if (pending & CAUSEF_IP5) { /* int 21 */ 61 devfn = GALILEO_INL(GT_PCI0_CFGADDR_OFS) >> 8;
80 do_IRQ(COBALT_SERIAL_IRQ, regs); 62 GALILEO_OUTL(~GALILEO_INTR_RETRY_CTR, GT_INTRCAUSE_OFS);
81 return; 63 printk(KERN_WARNING "Galileo: PCI retry count exceeded (%02x.%u)\n",
82 } 64 PCI_SLOT(devfn), PCI_FUNC(devfn));
65
66 } else {
83 67
84 if (pending & CAUSEF_IP7) { /* int 23 */ 68 GALILEO_OUTL(mask & ~pending, GT_INTRMASK_OFS);
85 do_IRQ(COBALT_QUBE_SLOT_IRQ, regs); 69 printk(KERN_WARNING "Galileo: masking unexpected interrupt %08x\n", pending);
86 return;
87 } 70 }
88} 71}
89 72
73static inline void via_pic_irq(struct pt_regs *regs)
74{
75 int irq;
76
77 irq = i8259_irq();
78 if (irq >= 0)
79 do_IRQ(irq, regs);
80}
81
82asmlinkage void cobalt_irq(struct pt_regs *regs)
83{
84 unsigned pending;
85
86 pending = read_c0_status() & read_c0_cause();
87
88 if (pending & CAUSEF_IP2) /* COBALT_GALILEO_IRQ (18) */
89
90 galileo_irq(regs);
91
92 else if (pending & CAUSEF_IP6) /* COBALT_VIA_IRQ (22) */
93
94 via_pic_irq(regs);
95
96 else if (pending & CAUSEF_IP3) /* COBALT_ETH0_IRQ (19) */
97
98 do_IRQ(COBALT_CPU_IRQ + 3, regs);
99
100 else if (pending & CAUSEF_IP4) /* COBALT_ETH1_IRQ (20) */
101
102 do_IRQ(COBALT_CPU_IRQ + 4, regs);
103
104 else if (pending & CAUSEF_IP5) /* COBALT_SERIAL_IRQ (21) */
105
106 do_IRQ(COBALT_CPU_IRQ + 5, regs);
107
108 else if (pending & CAUSEF_IP7) /* IRQ 23 */
109
110 do_IRQ(COBALT_CPU_IRQ + 7, regs);
111}
112
113static struct irqaction irq_via = {
114 no_action, 0, { { 0, } }, "cascade", NULL, NULL
115};
116
90void __init arch_init_irq(void) 117void __init arch_init_irq(void)
91{ 118{
119 /*
120 * Mask all Galileo interrupts. The Galileo
121 * handler is set in cobalt_timer_setup()
122 */
123 GALILEO_OUTL(0, GT_INTRMASK_OFS);
124
92 set_except_vector(0, cobalt_handle_int); 125 set_except_vector(0, cobalt_handle_int);
93 126
94 init_i8259_irqs(); /* 0 ... 15 */ 127 init_i8259_irqs(); /* 0 ... 15 */
95 mips_cpu_irq_init(16); /* 16 ... 23 */ 128 mips_cpu_irq_init(COBALT_CPU_IRQ); /* 16 ... 23 */
96 129
97 /* 130 /*
98 * Mask all cpu interrupts 131 * Mask all cpu interrupts
99 * (except IE4, we already masked those at VIA level) 132 * (except IE4, we already masked those at VIA level)
100 */ 133 */
101 change_c0_status(ST0_IM, IE_IRQ4); 134 change_c0_status(ST0_IM, IE_IRQ4);
135
136 setup_irq(COBALT_VIA_IRQ, &irq_via);
102} 137}
diff --git a/arch/mips/cobalt/promcon.c b/arch/mips/cobalt/promcon.c
deleted file mode 100644
index f03df761e9f1..000000000000
--- a/arch/mips/cobalt/promcon.c
+++ /dev/null
@@ -1,87 +0,0 @@
1/*
2 * PROM console for Cobalt Raq2
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 1995, 1996, 1997 by Ralf Baechle
9 * Copyright (C) 2001 by Liam Davies (ldavies@agile.tv)
10 *
11 */
12
13#include <linux/init.h>
14#include <linux/console.h>
15#include <linux/kdev_t.h>
16#include <linux/serial_reg.h>
17
18#include <asm/delay.h>
19#include <asm/serial.h>
20#include <asm/io.h>
21
22static unsigned long port = 0xc800000;
23
24static __inline__ void ns16550_cons_put_char(char ch, unsigned long ioaddr)
25{
26 char lsr;
27
28 do {
29 lsr = inb(ioaddr + UART_LSR);
30 } while ((lsr & (UART_LSR_TEMT | UART_LSR_THRE)) != (UART_LSR_TEMT | UART_LSR_THRE));
31 outb(ch, ioaddr + UART_TX);
32}
33
34static __inline__ char ns16550_cons_get_char(unsigned long ioaddr)
35{
36 while ((inb(ioaddr + UART_LSR) & UART_LSR_DR) == 0)
37 udelay(1);
38 return inb(ioaddr + UART_RX);
39}
40
41void ns16550_console_write(struct console *co, const char *s, unsigned count)
42{
43 char lsr, ier;
44 unsigned i;
45
46 ier = inb(port + UART_IER);
47 outb(0x00, port + UART_IER);
48 for (i=0; i < count; i++, s++) {
49
50 if(*s == '\n')
51 ns16550_cons_put_char('\r', port);
52 ns16550_cons_put_char(*s, port);
53 }
54
55 do {
56 lsr = inb(port + UART_LSR);
57 } while ((lsr & (UART_LSR_TEMT | UART_LSR_THRE)) != (UART_LSR_TEMT | UART_LSR_THRE));
58
59 outb(ier, port + UART_IER);
60}
61
62char getDebugChar(void)
63{
64 return ns16550_cons_get_char(port);
65}
66
67void putDebugChar(char kgdb_char)
68{
69 ns16550_cons_put_char(kgdb_char, port);
70}
71
72static struct console ns16550_console = {
73 .name = "prom",
74 .setup = NULL,
75 .write = ns16550_console_write,
76 .flags = CON_PRINTBUFFER,
77 .index = -1,
78};
79
80static int __init ns16550_setup_console(void)
81{
82 register_console(&ns16550_console);
83
84 return 0;
85}
86
87console_initcall(ns16550_setup_console);
diff --git a/arch/mips/cobalt/reset.c b/arch/mips/cobalt/reset.c
index 084c8e59f42c..805a0e88507b 100644
--- a/arch/mips/cobalt/reset.c
+++ b/arch/mips/cobalt/reset.c
@@ -16,48 +16,45 @@
16#include <asm/reboot.h> 16#include <asm/reboot.h>
17#include <asm/system.h> 17#include <asm/system.h>
18#include <asm/mipsregs.h> 18#include <asm/mipsregs.h>
19#include <asm/cobalt/cobalt.h>
19 20
20void cobalt_machine_restart(char *command) 21void cobalt_machine_halt(void)
21{ 22{
22 *(volatile char *)0xbc000000 = 0x0f; 23 int state, last, diff;
24 unsigned long mark;
23 25
24 /* 26 /*
25 * Ouch, we're still alive ... This time we take the silver bullet ... 27 * turn off bar on Qube, flash power off LED on RaQ (0.5Hz)
26 * ... and find that we leave the hardware in a state in which the 28 *
27 * kernel in the flush locks up somewhen during of after the PCI 29 * restart if ENTER and SELECT are pressed
28 * detection stuff.
29 */ 30 */
30 set_c0_status(ST0_BEV | ST0_ERL);
31 change_c0_config(CONF_CM_CMASK, CONF_CM_UNCACHED);
32 flush_cache_all();
33 write_c0_wired(0);
34 __asm__ __volatile__(
35 "jr\t%0"
36 :
37 : "r" (0xbfc00000));
38}
39 31
40extern int led_state; 32 last = COBALT_KEY_PORT;
41#define kLED 0xBC000000
42#define LEDSet(x) (*(volatile unsigned char *) kLED) = (( unsigned char)x)
43 33
44void cobalt_machine_halt(void) 34 for (state = 0;;) {
45{ 35
46 int mark; 36 state ^= COBALT_LED_POWER_OFF;
37 COBALT_LED_PORT = state;
38
39 diff = COBALT_KEY_PORT ^ last;
40 last ^= diff;
47 41
48 /* Blink our cute? little LED (number 3)... */ 42 if((diff & (COBALT_KEY_ENTER | COBALT_KEY_SELECT)) && !(~last & (COBALT_KEY_ENTER | COBALT_KEY_SELECT)))
49 while (1) { 43 COBALT_LED_PORT = COBALT_LED_RESET;
50 led_state = led_state | ( 1 << 3 ); 44
51 LEDSet(led_state); 45 for (mark = jiffies; jiffies - mark < HZ;)
52 mark = jiffies; 46 ;
53 while (jiffies<(mark+HZ));
54 led_state = led_state & ~( 1 << 3 );
55 LEDSet(led_state);
56 mark = jiffies;
57 while (jiffies<(mark+HZ));
58 } 47 }
59} 48}
60 49
50void cobalt_machine_restart(char *command)
51{
52 COBALT_LED_PORT = COBALT_LED_RESET;
53
54 /* we should never get here */
55 cobalt_machine_halt();
56}
57
61/* 58/*
62 * This triggers the luser mode device driver for the power switch ;-) 59 * This triggers the luser mode device driver for the power switch ;-)
63 */ 60 */
diff --git a/arch/mips/cobalt/setup.c b/arch/mips/cobalt/setup.c
index 6b4737e425ed..d358a118fa31 100644
--- a/arch/mips/cobalt/setup.c
+++ b/arch/mips/cobalt/setup.c
@@ -13,6 +13,8 @@
13#include <linux/interrupt.h> 13#include <linux/interrupt.h>
14#include <linux/pci.h> 14#include <linux/pci.h>
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/serial.h>
17#include <linux/serial_core.h>
16 18
17#include <asm/bootinfo.h> 19#include <asm/bootinfo.h>
18#include <asm/time.h> 20#include <asm/time.h>
@@ -21,6 +23,7 @@
21#include <asm/processor.h> 23#include <asm/processor.h>
22#include <asm/reboot.h> 24#include <asm/reboot.h>
23#include <asm/gt64120.h> 25#include <asm/gt64120.h>
26#include <asm/serial.h>
24 27
25#include <asm/cobalt/cobalt.h> 28#include <asm/cobalt/cobalt.h>
26 29
@@ -30,45 +33,44 @@ extern void cobalt_machine_power_off(void);
30 33
31int cobalt_board_id; 34int cobalt_board_id;
32 35
33static char my_cmdline[CL_SIZE] = {
34 "console=ttyS0,115200 "
35#ifdef CONFIG_IP_PNP
36 "ip=on "
37#endif
38#ifdef CONFIG_ROOT_NFS
39 "root=/dev/nfs "
40#else
41 "root=/dev/hda1 "
42#endif
43 };
44
45const char *get_system_type(void) 36const char *get_system_type(void)
46{ 37{
38 switch (cobalt_board_id) {
39 case COBALT_BRD_ID_QUBE1:
40 return "Cobalt Qube";
41 case COBALT_BRD_ID_RAQ1:
42 return "Cobalt RaQ";
43 case COBALT_BRD_ID_QUBE2:
44 return "Cobalt Qube2";
45 case COBALT_BRD_ID_RAQ2:
46 return "Cobalt RaQ2";
47 }
47 return "MIPS Cobalt"; 48 return "MIPS Cobalt";
48} 49}
49 50
50static void __init cobalt_timer_setup(struct irqaction *irq) 51static void __init cobalt_timer_setup(struct irqaction *irq)
51{ 52{
52 /* Load timer value for 150 Hz */ 53 /* Load timer value for 1KHz (TCLK is 50MHz) */
53 GALILEO_OUTL(500000, GT_TC0_OFS); 54 GALILEO_OUTL(50*1000*1000 / 1000, GT_TC0_OFS);
54 55
55 /* Register our timer interrupt */ 56 /* Enable timer */
56 setup_irq(COBALT_TIMER_IRQ, irq); 57 GALILEO_OUTL(GALILEO_ENTC0 | GALILEO_SELTC0, GT_TC_CONTROL_OFS);
57 58
58 /* Enable timer ints */ 59 /* Register interrupt */
59 GALILEO_OUTL((GALILEO_ENTC0 | GALILEO_SELTC0), GT_TC_CONTROL_OFS); 60 setup_irq(COBALT_GALILEO_IRQ, irq);
60 /* Unmask timer int */ 61
61 GALILEO_OUTL(0x100, GT_INTRMASK_OFS); 62 /* Enable interrupt */
63 GALILEO_OUTL(GALILEO_INTR_T0EXP | GALILEO_INL(GT_INTRMASK_OFS), GT_INTRMASK_OFS);
62} 64}
63 65
64extern struct pci_ops gt64111_pci_ops; 66extern struct pci_ops gt64111_pci_ops;
65 67
66static struct resource cobalt_mem_resource = { 68static struct resource cobalt_mem_resource = {
67 "GT64111 PCI MEM", GT64111_IO_BASE, 0xffffffffUL, IORESOURCE_MEM 69 "PCI memory", GT64111_MEM_BASE, GT64111_MEM_END, IORESOURCE_MEM
68}; 70};
69 71
70static struct resource cobalt_io_resource = { 72static struct resource cobalt_io_resource = {
71 "GT64111 IO MEM", 0x00001000UL, 0x0fffffffUL, IORESOURCE_IO 73 "PCI I/O", 0x1000, 0xffff, IORESOURCE_IO
72}; 74};
73 75
74static struct resource cobalt_io_resources[] = { 76static struct resource cobalt_io_resources[] = {
@@ -86,11 +88,12 @@ static struct pci_controller cobalt_pci_controller = {
86 .mem_resource = &cobalt_mem_resource, 88 .mem_resource = &cobalt_mem_resource,
87 .mem_offset = 0, 89 .mem_offset = 0,
88 .io_resource = &cobalt_io_resource, 90 .io_resource = &cobalt_io_resource,
89 .io_offset = 0x00001000UL - GT64111_IO_BASE 91 .io_offset = 0 - GT64111_IO_BASE
90}; 92};
91 93
92static void __init cobalt_setup(void) 94void __init plat_setup(void)
93{ 95{
96 static struct uart_port uart;
94 unsigned int devfn = PCI_DEVFN(COBALT_PCICONF_VIA, 0); 97 unsigned int devfn = PCI_DEVFN(COBALT_PCICONF_VIA, 0);
95 int i; 98 int i;
96 99
@@ -100,7 +103,10 @@ static void __init cobalt_setup(void)
100 103
101 board_timer_setup = cobalt_timer_setup; 104 board_timer_setup = cobalt_timer_setup;
102 105
103 set_io_port_base(KSEG1ADDR(GT64111_IO_BASE)); 106 set_io_port_base(CKSEG1ADDR(GT64111_IO_BASE));
107
108 /* I/O port resource must include UART and LCD/buttons */
109 ioport_resource.end = 0x0fffffff;
104 110
105 /* 111 /*
106 * This is a prom style console. We just poke at the 112 * This is a prom style console. We just poke at the
@@ -120,27 +126,61 @@ static void __init cobalt_setup(void)
120 cobalt_board_id >>= ((VIA_COBALT_BRD_ID_REG & 3) * 8); 126 cobalt_board_id >>= ((VIA_COBALT_BRD_ID_REG & 3) * 8);
121 cobalt_board_id = VIA_COBALT_BRD_REG_to_ID(cobalt_board_id); 127 cobalt_board_id = VIA_COBALT_BRD_REG_to_ID(cobalt_board_id);
122 128
129 printk("Cobalt board ID: %d\n", cobalt_board_id);
130
123#ifdef CONFIG_PCI 131#ifdef CONFIG_PCI
124 register_pci_controller(&cobalt_pci_controller); 132 register_pci_controller(&cobalt_pci_controller);
125#endif 133#endif
126}
127 134
128early_initcall(cobalt_setup); 135#ifdef CONFIG_SERIAL_8250
136 if (cobalt_board_id > COBALT_BRD_ID_RAQ1) {
137
138 uart.line = 0;
139 uart.type = PORT_UNKNOWN;
140 uart.uartclk = 18432000;
141 uart.irq = COBALT_SERIAL_IRQ;
142 uart.flags = STD_COM_FLAGS;
143 uart.iobase = 0xc800000;
144 uart.iotype = UPIO_PORT;
145
146 early_serial_setup(&uart);
147 }
148#endif
149}
129 150
130/* 151/*
131 * Prom init. We read our one and only communication with the firmware. 152 * Prom init. We read our one and only communication with the firmware.
132 * Grab the amount of installed memory 153 * Grab the amount of installed memory.
154 * Better boot loaders (CoLo) pass a command line too :-)
133 */ 155 */
134 156
135void __init prom_init(void) 157void __init prom_init(void)
136{ 158{
137 int argc = fw_arg0; 159 int narg, indx, posn, nchr;
138 160 unsigned long memsz;
139 strcpy(arcs_cmdline, my_cmdline); 161 char **argv;
140 162
141 mips_machgroup = MACH_GROUP_COBALT; 163 mips_machgroup = MACH_GROUP_COBALT;
142 164
143 add_memory_region(0x0, argc & 0x7fffffff, BOOT_MEM_RAM); 165 memsz = fw_arg0 & 0x7fff0000;
166 narg = fw_arg0 & 0x0000ffff;
167
168 if (narg) {
169 arcs_cmdline[0] = '\0';
170 argv = (char **) fw_arg1;
171 posn = 0;
172 for (indx = 1; indx < narg; ++indx) {
173 nchr = strlen(argv[indx]);
174 if (posn + 1 + nchr + 1 > sizeof(arcs_cmdline))
175 break;
176 if (posn)
177 arcs_cmdline[posn++] = ' ';
178 strcpy(arcs_cmdline + posn, argv[indx]);
179 posn += nchr;
180 }
181 }
182
183 add_memory_region(0x0, memsz, BOOT_MEM_RAM);
144} 184}
145 185
146unsigned long __init prom_free_prom_memory(void) 186unsigned long __init prom_free_prom_memory(void)
diff --git a/arch/mips/configs/atlas_defconfig b/arch/mips/configs/atlas_defconfig
index 3120a02b8670..132ec3dac63f 100644
--- a/arch/mips/configs/atlas_defconfig
+++ b/arch/mips/configs/atlas_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:00 2005 4# Thu Oct 20 22:25:13 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,24 +11,29 @@ CONFIG_32BIT=y
14CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
25# CONFIG_BSD_PROCESS_ACCT is not set 24# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y 25CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set 26# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14
29CONFIG_HOTPLUG=y 27CONFIG_HOTPLUG=y
30CONFIG_KOBJECT_UEVENT=y 28CONFIG_KOBJECT_UEVENT=y
31# CONFIG_IKCONFIG is not set 29# CONFIG_IKCONFIG is not set
30CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y 31CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y 32CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_EXTRA_PASS is not set 33# CONFIG_KALLSYMS_EXTRA_PASS is not set
34CONFIG_PRINTK=y
35CONFIG_BUG=y
36CONFIG_BASE_FULL=y
35CONFIG_FUTEX=y 37CONFIG_FUTEX=y
36CONFIG_EPOLL=y 38CONFIG_EPOLL=y
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -41,6 +43,7 @@ CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0 43CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0 44CONFIG_CC_ALIGN_JUMPS=0
43# CONFIG_TINY_SHMEM is not set 45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
44 47
45# 48#
46# Loadable module support 49# Loadable module support
@@ -56,42 +59,72 @@ CONFIG_KMOD=y
56# 59#
57# Machine selection 60# Machine selection
58# 61#
59# CONFIG_MACH_JAZZ is not set 62# CONFIG_MIPS_MTX1 is not set
60# CONFIG_MACH_VR41XX is not set 63# CONFIG_MIPS_BOSPORUS is not set
61# CONFIG_TOSHIBA_JMR3927 is not set 64# CONFIG_MIPS_PB1000 is not set
65# CONFIG_MIPS_PB1100 is not set
66# CONFIG_MIPS_PB1500 is not set
67# CONFIG_MIPS_PB1550 is not set
68# CONFIG_MIPS_PB1200 is not set
69# CONFIG_MIPS_DB1000 is not set
70# CONFIG_MIPS_DB1100 is not set
71# CONFIG_MIPS_DB1500 is not set
72# CONFIG_MIPS_DB1550 is not set
73# CONFIG_MIPS_DB1200 is not set
74# CONFIG_MIPS_MIRAGE is not set
62# CONFIG_MIPS_COBALT is not set 75# CONFIG_MIPS_COBALT is not set
63# CONFIG_MACH_DECSTATION is not set 76# CONFIG_MACH_DECSTATION is not set
64# CONFIG_MIPS_EV64120 is not set 77# CONFIG_MIPS_EV64120 is not set
65# CONFIG_MIPS_EV96100 is not set 78# CONFIG_MIPS_EV96100 is not set
66# CONFIG_MIPS_IVR is not set 79# CONFIG_MIPS_IVR is not set
67# CONFIG_LASAT is not set
68# CONFIG_MIPS_ITE8172 is not set 80# CONFIG_MIPS_ITE8172 is not set
81# CONFIG_MACH_JAZZ is not set
82# CONFIG_LASAT is not set
69CONFIG_MIPS_ATLAS=y 83CONFIG_MIPS_ATLAS=y
70# CONFIG_MIPS_MALTA is not set 84# CONFIG_MIPS_MALTA is not set
71# CONFIG_MIPS_SEAD is not set 85# CONFIG_MIPS_SEAD is not set
86# CONFIG_MIPS_SIM is not set
87# CONFIG_MOMENCO_JAGUAR_ATX is not set
72# CONFIG_MOMENCO_OCELOT is not set 88# CONFIG_MOMENCO_OCELOT is not set
73# CONFIG_MOMENCO_OCELOT_G is not set
74# CONFIG_MOMENCO_OCELOT_C is not set
75# CONFIG_MOMENCO_OCELOT_3 is not set 89# CONFIG_MOMENCO_OCELOT_3 is not set
76# CONFIG_MOMENCO_JAGUAR_ATX is not set 90# CONFIG_MOMENCO_OCELOT_C is not set
77# CONFIG_PMC_YOSEMITE is not set 91# CONFIG_MOMENCO_OCELOT_G is not set
92# CONFIG_MIPS_XXS1500 is not set
93# CONFIG_PNX8550_V2PCI is not set
94# CONFIG_PNX8550_JBS is not set
78# CONFIG_DDB5074 is not set 95# CONFIG_DDB5074 is not set
79# CONFIG_DDB5476 is not set 96# CONFIG_DDB5476 is not set
80# CONFIG_DDB5477 is not set 97# CONFIG_DDB5477 is not set
81# CONFIG_NEC_OSPREY is not set 98# CONFIG_MACH_VR41XX is not set
99# CONFIG_PMC_YOSEMITE is not set
100# CONFIG_QEMU is not set
82# CONFIG_SGI_IP22 is not set 101# CONFIG_SGI_IP22 is not set
83# CONFIG_SOC_AU1X00 is not set 102# CONFIG_SGI_IP27 is not set
84# CONFIG_SIBYTE_SB1xxx_SOC is not set 103# CONFIG_SGI_IP32 is not set
104# CONFIG_SIBYTE_BIGSUR is not set
105# CONFIG_SIBYTE_SWARM is not set
106# CONFIG_SIBYTE_SENTOSA is not set
107# CONFIG_SIBYTE_RHONE is not set
108# CONFIG_SIBYTE_CARMEL is not set
109# CONFIG_SIBYTE_PTSWARM is not set
110# CONFIG_SIBYTE_LITTLESUR is not set
111# CONFIG_SIBYTE_CRHINE is not set
112# CONFIG_SIBYTE_CRHONE is not set
85# CONFIG_SNI_RM200_PCI is not set 113# CONFIG_SNI_RM200_PCI is not set
114# CONFIG_TOSHIBA_JMR3927 is not set
86# CONFIG_TOSHIBA_RBTX4927 is not set 115# CONFIG_TOSHIBA_RBTX4927 is not set
116# CONFIG_TOSHIBA_RBTX4938 is not set
87CONFIG_RWSEM_GENERIC_SPINLOCK=y 117CONFIG_RWSEM_GENERIC_SPINLOCK=y
88CONFIG_GENERIC_CALIBRATE_DELAY=y 118CONFIG_GENERIC_CALIBRATE_DELAY=y
89CONFIG_HAVE_DEC_LOCK=y
90CONFIG_DMA_NONCOHERENT=y 119CONFIG_DMA_NONCOHERENT=y
91CONFIG_DMA_NEED_PCI_MAP_STATE=y 120CONFIG_DMA_NEED_PCI_MAP_STATE=y
92CONFIG_MIPS_BONITO64=y 121CONFIG_MIPS_BONITO64=y
93CONFIG_MIPS_MSC=y 122CONFIG_MIPS_MSC=y
94# CONFIG_CPU_LITTLE_ENDIAN is not set 123# CONFIG_CPU_BIG_ENDIAN is not set
124CONFIG_CPU_LITTLE_ENDIAN=y
125CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
126CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
127CONFIG_IRQ_CPU=y
95CONFIG_MIPS_BOARDS_GEN=y 128CONFIG_MIPS_BOARDS_GEN=y
96CONFIG_MIPS_GT64120=y 129CONFIG_MIPS_GT64120=y
97CONFIG_SWAP_IO_SPACE=y 130CONFIG_SWAP_IO_SPACE=y
@@ -101,8 +134,10 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
101# 134#
102# CPU selection 135# CPU selection
103# 136#
104CONFIG_CPU_MIPS32=y 137CONFIG_CPU_MIPS32_R1=y
105# CONFIG_CPU_MIPS64 is not set 138# CONFIG_CPU_MIPS32_R2 is not set
139# CONFIG_CPU_MIPS64_R1 is not set
140# CONFIG_CPU_MIPS64_R2 is not set
106# CONFIG_CPU_R3000 is not set 141# CONFIG_CPU_R3000 is not set
107# CONFIG_CPU_TX39XX is not set 142# CONFIG_CPU_TX39XX is not set
108# CONFIG_CPU_VR41XX is not set 143# CONFIG_CPU_VR41XX is not set
@@ -118,15 +153,46 @@ CONFIG_CPU_MIPS32=y
118# CONFIG_CPU_RM7000 is not set 153# CONFIG_CPU_RM7000 is not set
119# CONFIG_CPU_RM9000 is not set 154# CONFIG_CPU_RM9000 is not set
120# CONFIG_CPU_SB1 is not set 155# CONFIG_CPU_SB1 is not set
156CONFIG_SYS_HAS_CPU_MIPS32_R1=y
157CONFIG_SYS_HAS_CPU_MIPS32_R2=y
158CONFIG_SYS_HAS_CPU_MIPS64_R1=y
159CONFIG_SYS_HAS_CPU_NEVADA=y
160CONFIG_SYS_HAS_CPU_RM7000=y
161CONFIG_CPU_MIPS32=y
162CONFIG_CPU_MIPSR1=y
163CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
164CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
165CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
166
167#
168# Kernel type
169#
170CONFIG_32BIT=y
171# CONFIG_64BIT is not set
121CONFIG_PAGE_SIZE_4KB=y 172CONFIG_PAGE_SIZE_4KB=y
122# CONFIG_PAGE_SIZE_8KB is not set 173# CONFIG_PAGE_SIZE_8KB is not set
123# CONFIG_PAGE_SIZE_16KB is not set 174# CONFIG_PAGE_SIZE_16KB is not set
124# CONFIG_PAGE_SIZE_64KB is not set 175# CONFIG_PAGE_SIZE_64KB is not set
176CONFIG_BOARD_SCACHE=y
177CONFIG_RM7000_CPU_SCACHE=y
125CONFIG_CPU_HAS_PREFETCH=y 178CONFIG_CPU_HAS_PREFETCH=y
179# CONFIG_MIPS_MT is not set
126# CONFIG_64BIT_PHYS_ADDR is not set 180# CONFIG_64BIT_PHYS_ADDR is not set
127# CONFIG_CPU_ADVANCED is not set 181# CONFIG_CPU_ADVANCED is not set
128CONFIG_CPU_HAS_LLSC=y 182CONFIG_CPU_HAS_LLSC=y
129CONFIG_CPU_HAS_SYNC=y 183CONFIG_CPU_HAS_SYNC=y
184CONFIG_GENERIC_HARDIRQS=y
185CONFIG_GENERIC_IRQ_PROBE=y
186CONFIG_ARCH_FLATMEM_ENABLE=y
187CONFIG_SELECT_MEMORY_MODEL=y
188CONFIG_FLATMEM_MANUAL=y
189# CONFIG_DISCONTIGMEM_MANUAL is not set
190# CONFIG_SPARSEMEM_MANUAL is not set
191CONFIG_FLATMEM=y
192CONFIG_FLAT_NODE_MEM_MAP=y
193# CONFIG_SPARSEMEM_STATIC is not set
194CONFIG_PREEMPT_NONE=y
195# CONFIG_PREEMPT_VOLUNTARY is not set
130# CONFIG_PREEMPT is not set 196# CONFIG_PREEMPT is not set
131 197
132# 198#
@@ -135,7 +201,6 @@ CONFIG_CPU_HAS_SYNC=y
135CONFIG_HW_HAS_PCI=y 201CONFIG_HW_HAS_PCI=y
136CONFIG_PCI=y 202CONFIG_PCI=y
137CONFIG_PCI_LEGACY_PROC=y 203CONFIG_PCI_LEGACY_PROC=y
138CONFIG_PCI_NAMES=y
139CONFIG_MMU=y 204CONFIG_MMU=y
140 205
141# 206#
@@ -144,10 +209,6 @@ CONFIG_MMU=y
144# CONFIG_PCCARD is not set 209# CONFIG_PCCARD is not set
145 210
146# 211#
147# PC-card bridges
148#
149
150#
151# PCI Hotplug Support 212# PCI Hotplug Support
152# 213#
153# CONFIG_HOTPLUG_PCI is not set 214# CONFIG_HOTPLUG_PCI is not set
@@ -160,199 +221,7 @@ CONFIG_BINFMT_ELF=y
160CONFIG_TRAD_SIGNALS=y 221CONFIG_TRAD_SIGNALS=y
161 222
162# 223#
163# Device Drivers 224# Networking
164#
165
166#
167# Generic Driver Options
168#
169CONFIG_STANDALONE=y
170CONFIG_PREVENT_FIRMWARE_BUILD=y
171CONFIG_FW_LOADER=y
172
173#
174# Memory Technology Devices (MTD)
175#
176# CONFIG_MTD is not set
177
178#
179# Parallel port support
180#
181# CONFIG_PARPORT is not set
182
183#
184# Plug and Play support
185#
186
187#
188# Block devices
189#
190# CONFIG_BLK_DEV_FD is not set
191# CONFIG_BLK_CPQ_DA is not set
192# CONFIG_BLK_CPQ_CISS_DA is not set
193# CONFIG_BLK_DEV_DAC960 is not set
194CONFIG_BLK_DEV_UMEM=m
195# CONFIG_BLK_DEV_COW_COMMON is not set
196CONFIG_BLK_DEV_LOOP=m
197CONFIG_BLK_DEV_CRYPTOLOOP=m
198CONFIG_BLK_DEV_NBD=m
199# CONFIG_BLK_DEV_SX8 is not set
200CONFIG_BLK_DEV_RAM=y
201CONFIG_BLK_DEV_RAM_COUNT=16
202CONFIG_BLK_DEV_RAM_SIZE=4096
203# CONFIG_BLK_DEV_INITRD is not set
204CONFIG_INITRAMFS_SOURCE=""
205# CONFIG_LBD is not set
206CONFIG_CDROM_PKTCDVD=m
207CONFIG_CDROM_PKTCDVD_BUFFERS=8
208# CONFIG_CDROM_PKTCDVD_WCACHE is not set
209
210#
211# IO Schedulers
212#
213CONFIG_IOSCHED_NOOP=y
214CONFIG_IOSCHED_AS=y
215CONFIG_IOSCHED_DEADLINE=y
216CONFIG_IOSCHED_CFQ=y
217CONFIG_ATA_OVER_ETH=m
218
219#
220# ATA/ATAPI/MFM/RLL support
221#
222CONFIG_IDE=y
223CONFIG_BLK_DEV_IDE=y
224
225#
226# Please see Documentation/ide.txt for help/info on IDE drives
227#
228# CONFIG_BLK_DEV_IDE_SATA is not set
229CONFIG_BLK_DEV_IDEDISK=y
230# CONFIG_IDEDISK_MULTI_MODE is not set
231CONFIG_BLK_DEV_IDECD=y
232# CONFIG_BLK_DEV_IDETAPE is not set
233# CONFIG_BLK_DEV_IDEFLOPPY is not set
234# CONFIG_BLK_DEV_IDESCSI is not set
235# CONFIG_IDE_TASK_IOCTL is not set
236
237#
238# IDE chipset support/bugfixes
239#
240CONFIG_IDE_GENERIC=y
241# CONFIG_BLK_DEV_IDEPCI is not set
242# CONFIG_IDE_ARM is not set
243# CONFIG_BLK_DEV_IDEDMA is not set
244# CONFIG_IDEDMA_AUTO is not set
245# CONFIG_BLK_DEV_HD is not set
246
247#
248# SCSI device support
249#
250CONFIG_SCSI=y
251CONFIG_SCSI_PROC_FS=y
252
253#
254# SCSI support type (disk, tape, CD-ROM)
255#
256CONFIG_BLK_DEV_SD=y
257CONFIG_CHR_DEV_ST=m
258CONFIG_CHR_DEV_OSST=m
259CONFIG_BLK_DEV_SR=m
260CONFIG_BLK_DEV_SR_VENDOR=y
261CONFIG_CHR_DEV_SG=m
262
263#
264# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
265#
266CONFIG_SCSI_MULTI_LUN=y
267CONFIG_SCSI_CONSTANTS=y
268CONFIG_SCSI_LOGGING=y
269
270#
271# SCSI Transport Attributes
272#
273CONFIG_SCSI_SPI_ATTRS=y
274CONFIG_SCSI_FC_ATTRS=m
275CONFIG_SCSI_ISCSI_ATTRS=m
276
277#
278# SCSI low-level drivers
279#
280# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
281# CONFIG_SCSI_3W_9XXX is not set
282# CONFIG_SCSI_ACARD is not set
283# CONFIG_SCSI_AACRAID is not set
284# CONFIG_SCSI_AIC7XXX is not set
285# CONFIG_SCSI_AIC7XXX_OLD is not set
286# CONFIG_SCSI_AIC79XX is not set
287# CONFIG_SCSI_DPT_I2O is not set
288# CONFIG_MEGARAID_NEWGEN is not set
289# CONFIG_MEGARAID_LEGACY is not set
290# CONFIG_SCSI_SATA is not set
291# CONFIG_SCSI_BUSLOGIC is not set
292# CONFIG_SCSI_DMX3191D is not set
293# CONFIG_SCSI_EATA is not set
294# CONFIG_SCSI_EATA_PIO is not set
295# CONFIG_SCSI_FUTURE_DOMAIN is not set
296# CONFIG_SCSI_GDTH is not set
297# CONFIG_SCSI_IPS is not set
298# CONFIG_SCSI_INITIO is not set
299# CONFIG_SCSI_INIA100 is not set
300CONFIG_SCSI_SYM53C8XX_2=y
301CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
302CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
303CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
304# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
305# CONFIG_SCSI_IPR is not set
306# CONFIG_SCSI_QLOGIC_ISP is not set
307# CONFIG_SCSI_QLOGIC_FC is not set
308# CONFIG_SCSI_QLOGIC_1280 is not set
309CONFIG_SCSI_QLA2XXX=y
310# CONFIG_SCSI_QLA21XX is not set
311# CONFIG_SCSI_QLA22XX is not set
312# CONFIG_SCSI_QLA2300 is not set
313# CONFIG_SCSI_QLA2322 is not set
314# CONFIG_SCSI_QLA6312 is not set
315# CONFIG_SCSI_DC395x is not set
316# CONFIG_SCSI_DC390T is not set
317# CONFIG_SCSI_NSP32 is not set
318# CONFIG_SCSI_DEBUG is not set
319
320#
321# Multi-device support (RAID and LVM)
322#
323CONFIG_MD=y
324CONFIG_BLK_DEV_MD=m
325CONFIG_MD_LINEAR=m
326CONFIG_MD_RAID0=m
327CONFIG_MD_RAID1=m
328CONFIG_MD_RAID10=m
329CONFIG_MD_RAID5=m
330CONFIG_MD_RAID6=m
331CONFIG_MD_MULTIPATH=m
332CONFIG_MD_FAULTY=m
333CONFIG_BLK_DEV_DM=m
334CONFIG_DM_CRYPT=m
335CONFIG_DM_SNAPSHOT=m
336CONFIG_DM_MIRROR=m
337CONFIG_DM_ZERO=m
338
339#
340# Fusion MPT device support
341#
342# CONFIG_FUSION is not set
343
344#
345# IEEE 1394 (FireWire) support
346#
347# CONFIG_IEEE1394 is not set
348
349#
350# I2O device support
351#
352# CONFIG_I2O is not set
353
354#
355# Networking support
356# 225#
357CONFIG_NET=y 226CONFIG_NET=y
358 227
@@ -361,15 +230,20 @@ CONFIG_NET=y
361# 230#
362CONFIG_PACKET=y 231CONFIG_PACKET=y
363CONFIG_PACKET_MMAP=y 232CONFIG_PACKET_MMAP=y
364CONFIG_NETLINK_DEV=y
365CONFIG_UNIX=y 233CONFIG_UNIX=y
234CONFIG_XFRM=y
235CONFIG_XFRM_USER=m
366CONFIG_NET_KEY=y 236CONFIG_NET_KEY=y
367CONFIG_INET=y 237CONFIG_INET=y
368CONFIG_IP_MULTICAST=y 238CONFIG_IP_MULTICAST=y
369CONFIG_IP_ADVANCED_ROUTER=y 239CONFIG_IP_ADVANCED_ROUTER=y
240CONFIG_ASK_IP_FIB_HASH=y
241# CONFIG_IP_FIB_TRIE is not set
242CONFIG_IP_FIB_HASH=y
370CONFIG_IP_MULTIPLE_TABLES=y 243CONFIG_IP_MULTIPLE_TABLES=y
371CONFIG_IP_ROUTE_FWMARK=y 244CONFIG_IP_ROUTE_FWMARK=y
372CONFIG_IP_ROUTE_MULTIPATH=y 245CONFIG_IP_ROUTE_MULTIPATH=y
246# CONFIG_IP_ROUTE_MULTIPATH_CACHED is not set
373CONFIG_IP_ROUTE_VERBOSE=y 247CONFIG_IP_ROUTE_VERBOSE=y
374CONFIG_IP_PNP=y 248CONFIG_IP_PNP=y
375CONFIG_IP_PNP_DHCP=y 249CONFIG_IP_PNP_DHCP=y
@@ -387,8 +261,10 @@ CONFIG_INET_AH=m
387CONFIG_INET_ESP=m 261CONFIG_INET_ESP=m
388CONFIG_INET_IPCOMP=m 262CONFIG_INET_IPCOMP=m
389CONFIG_INET_TUNNEL=m 263CONFIG_INET_TUNNEL=m
390CONFIG_IP_TCPDIAG=m 264CONFIG_INET_DIAG=y
391CONFIG_IP_TCPDIAG_IPV6=y 265CONFIG_INET_TCP_DIAG=y
266# CONFIG_TCP_CONG_ADVANCED is not set
267CONFIG_TCP_CONG_BIC=y
392 268
393# 269#
394# IP: Virtual Server Configuration 270# IP: Virtual Server Configuration
@@ -433,6 +309,9 @@ CONFIG_IPV6_TUNNEL=m
433CONFIG_NETFILTER=y 309CONFIG_NETFILTER=y
434# CONFIG_NETFILTER_DEBUG is not set 310# CONFIG_NETFILTER_DEBUG is not set
435CONFIG_BRIDGE_NETFILTER=y 311CONFIG_BRIDGE_NETFILTER=y
312CONFIG_NETFILTER_NETLINK=m
313CONFIG_NETFILTER_NETLINK_QUEUE=m
314CONFIG_NETFILTER_NETLINK_LOG=m
436 315
437# 316#
438# IP: Netfilter Configuration 317# IP: Netfilter Configuration
@@ -440,11 +319,15 @@ CONFIG_BRIDGE_NETFILTER=y
440CONFIG_IP_NF_CONNTRACK=m 319CONFIG_IP_NF_CONNTRACK=m
441CONFIG_IP_NF_CT_ACCT=y 320CONFIG_IP_NF_CT_ACCT=y
442CONFIG_IP_NF_CONNTRACK_MARK=y 321CONFIG_IP_NF_CONNTRACK_MARK=y
322CONFIG_IP_NF_CONNTRACK_EVENTS=y
323CONFIG_IP_NF_CONNTRACK_NETLINK=m
443CONFIG_IP_NF_CT_PROTO_SCTP=m 324CONFIG_IP_NF_CT_PROTO_SCTP=m
444CONFIG_IP_NF_FTP=m 325CONFIG_IP_NF_FTP=m
445CONFIG_IP_NF_IRC=m 326CONFIG_IP_NF_IRC=m
327# CONFIG_IP_NF_NETBIOS_NS is not set
446CONFIG_IP_NF_TFTP=m 328CONFIG_IP_NF_TFTP=m
447CONFIG_IP_NF_AMANDA=m 329CONFIG_IP_NF_AMANDA=m
330CONFIG_IP_NF_PPTP=m
448CONFIG_IP_NF_QUEUE=m 331CONFIG_IP_NF_QUEUE=m
449CONFIG_IP_NF_IPTABLES=m 332CONFIG_IP_NF_IPTABLES=m
450CONFIG_IP_NF_MATCH_LIMIT=m 333CONFIG_IP_NF_MATCH_LIMIT=m
@@ -469,9 +352,12 @@ CONFIG_IP_NF_MATCH_PHYSDEV=m
469CONFIG_IP_NF_MATCH_ADDRTYPE=m 352CONFIG_IP_NF_MATCH_ADDRTYPE=m
470CONFIG_IP_NF_MATCH_REALM=m 353CONFIG_IP_NF_MATCH_REALM=m
471CONFIG_IP_NF_MATCH_SCTP=m 354CONFIG_IP_NF_MATCH_SCTP=m
355CONFIG_IP_NF_MATCH_DCCP=m
472CONFIG_IP_NF_MATCH_COMMENT=m 356CONFIG_IP_NF_MATCH_COMMENT=m
473CONFIG_IP_NF_MATCH_CONNMARK=m 357CONFIG_IP_NF_MATCH_CONNMARK=m
358CONFIG_IP_NF_MATCH_CONNBYTES=m
474CONFIG_IP_NF_MATCH_HASHLIMIT=m 359CONFIG_IP_NF_MATCH_HASHLIMIT=m
360CONFIG_IP_NF_MATCH_STRING=m
475CONFIG_IP_NF_FILTER=m 361CONFIG_IP_NF_FILTER=m
476CONFIG_IP_NF_TARGET_REJECT=m 362CONFIG_IP_NF_TARGET_REJECT=m
477CONFIG_IP_NF_TARGET_LOG=m 363CONFIG_IP_NF_TARGET_LOG=m
@@ -488,12 +374,14 @@ CONFIG_IP_NF_NAT_IRC=m
488CONFIG_IP_NF_NAT_FTP=m 374CONFIG_IP_NF_NAT_FTP=m
489CONFIG_IP_NF_NAT_TFTP=m 375CONFIG_IP_NF_NAT_TFTP=m
490CONFIG_IP_NF_NAT_AMANDA=m 376CONFIG_IP_NF_NAT_AMANDA=m
377CONFIG_IP_NF_NAT_PPTP=m
491CONFIG_IP_NF_MANGLE=m 378CONFIG_IP_NF_MANGLE=m
492CONFIG_IP_NF_TARGET_TOS=m 379CONFIG_IP_NF_TARGET_TOS=m
493CONFIG_IP_NF_TARGET_ECN=m 380CONFIG_IP_NF_TARGET_ECN=m
494CONFIG_IP_NF_TARGET_DSCP=m 381CONFIG_IP_NF_TARGET_DSCP=m
495CONFIG_IP_NF_TARGET_MARK=m 382CONFIG_IP_NF_TARGET_MARK=m
496CONFIG_IP_NF_TARGET_CLASSIFY=m 383CONFIG_IP_NF_TARGET_CLASSIFY=m
384CONFIG_IP_NF_TARGET_TTL=m
497CONFIG_IP_NF_TARGET_CONNMARK=m 385CONFIG_IP_NF_TARGET_CONNMARK=m
498CONFIG_IP_NF_TARGET_CLUSTERIP=m 386CONFIG_IP_NF_TARGET_CLUSTERIP=m
499CONFIG_IP_NF_RAW=m 387CONFIG_IP_NF_RAW=m
@@ -503,7 +391,7 @@ CONFIG_IP_NF_ARPFILTER=m
503CONFIG_IP_NF_ARP_MANGLE=m 391CONFIG_IP_NF_ARP_MANGLE=m
504 392
505# 393#
506# IPv6: Netfilter Configuration 394# IPv6: Netfilter Configuration (EXPERIMENTAL)
507# 395#
508CONFIG_IP6_NF_QUEUE=m 396CONFIG_IP6_NF_QUEUE=m
509CONFIG_IP6_NF_IPTABLES=m 397CONFIG_IP6_NF_IPTABLES=m
@@ -523,8 +411,10 @@ CONFIG_IP6_NF_MATCH_EUI64=m
523CONFIG_IP6_NF_MATCH_PHYSDEV=m 411CONFIG_IP6_NF_MATCH_PHYSDEV=m
524CONFIG_IP6_NF_FILTER=m 412CONFIG_IP6_NF_FILTER=m
525CONFIG_IP6_NF_TARGET_LOG=m 413CONFIG_IP6_NF_TARGET_LOG=m
414CONFIG_IP6_NF_TARGET_REJECT=m
526CONFIG_IP6_NF_MANGLE=m 415CONFIG_IP6_NF_MANGLE=m
527CONFIG_IP6_NF_TARGET_MARK=m 416CONFIG_IP6_NF_TARGET_MARK=m
417CONFIG_IP6_NF_TARGET_HL=m
528CONFIG_IP6_NF_RAW=m 418CONFIG_IP6_NF_RAW=m
529 419
530# 420#
@@ -550,8 +440,11 @@ CONFIG_BRIDGE_EBT_REDIRECT=m
550CONFIG_BRIDGE_EBT_SNAT=m 440CONFIG_BRIDGE_EBT_SNAT=m
551CONFIG_BRIDGE_EBT_LOG=m 441CONFIG_BRIDGE_EBT_LOG=m
552CONFIG_BRIDGE_EBT_ULOG=m 442CONFIG_BRIDGE_EBT_ULOG=m
553CONFIG_XFRM=y 443
554CONFIG_XFRM_USER=m 444#
445# DCCP Configuration (EXPERIMENTAL)
446#
447# CONFIG_IP_DCCP is not set
555 448
556# 449#
557# SCTP Configuration (EXPERIMENTAL) 450# SCTP Configuration (EXPERIMENTAL)
@@ -579,10 +472,6 @@ CONFIG_IPDDP_DECAP=y
579CONFIG_NET_DIVERT=y 472CONFIG_NET_DIVERT=y
580# CONFIG_ECONET is not set 473# CONFIG_ECONET is not set
581# CONFIG_WAN_ROUTER is not set 474# CONFIG_WAN_ROUTER is not set
582
583#
584# QoS and/or fair queueing
585#
586CONFIG_NET_SCHED=y 475CONFIG_NET_SCHED=y
587CONFIG_NET_SCH_CLK_JIFFIES=y 476CONFIG_NET_SCH_CLK_JIFFIES=y
588# CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set 477# CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set
@@ -602,6 +491,7 @@ CONFIG_NET_SCH_INGRESS=m
602CONFIG_NET_QOS=y 491CONFIG_NET_QOS=y
603CONFIG_NET_ESTIMATOR=y 492CONFIG_NET_ESTIMATOR=y
604CONFIG_NET_CLS=y 493CONFIG_NET_CLS=y
494CONFIG_NET_CLS_BASIC=m
605CONFIG_NET_CLS_TCINDEX=m 495CONFIG_NET_CLS_TCINDEX=m
606CONFIG_NET_CLS_ROUTE4=m 496CONFIG_NET_CLS_ROUTE4=m
607CONFIG_NET_CLS_ROUTE=y 497CONFIG_NET_CLS_ROUTE=y
@@ -612,6 +502,7 @@ CONFIG_NET_CLS_IND=y
612# CONFIG_CLS_U32_MARK is not set 502# CONFIG_CLS_U32_MARK is not set
613CONFIG_NET_CLS_RSVP=m 503CONFIG_NET_CLS_RSVP=m
614CONFIG_NET_CLS_RSVP6=m 504CONFIG_NET_CLS_RSVP6=m
505# CONFIG_NET_EMATCH is not set
615# CONFIG_NET_CLS_ACT is not set 506# CONFIG_NET_CLS_ACT is not set
616CONFIG_NET_CLS_POLICE=y 507CONFIG_NET_CLS_POLICE=y
617 508
@@ -619,17 +510,222 @@ CONFIG_NET_CLS_POLICE=y
619# Network testing 510# Network testing
620# 511#
621# CONFIG_NET_PKTGEN is not set 512# CONFIG_NET_PKTGEN is not set
622# CONFIG_NETPOLL is not set
623# CONFIG_NET_POLL_CONTROLLER is not set
624# CONFIG_HAMRADIO is not set 513# CONFIG_HAMRADIO is not set
625# CONFIG_IRDA is not set 514# CONFIG_IRDA is not set
626# CONFIG_BT is not set 515# CONFIG_BT is not set
516CONFIG_IEEE80211=m
517# CONFIG_IEEE80211_DEBUG is not set
518CONFIG_IEEE80211_CRYPT_WEP=m
519CONFIG_IEEE80211_CRYPT_CCMP=m
520CONFIG_IEEE80211_CRYPT_TKIP=m
521
522#
523# Device Drivers
524#
525
526#
527# Generic Driver Options
528#
529CONFIG_STANDALONE=y
530CONFIG_PREVENT_FIRMWARE_BUILD=y
531CONFIG_FW_LOADER=y
532
533#
534# Connector - unified userspace <-> kernelspace linker
535#
536CONFIG_CONNECTOR=m
537
538#
539# Memory Technology Devices (MTD)
540#
541# CONFIG_MTD is not set
542
543#
544# Parallel port support
545#
546# CONFIG_PARPORT is not set
547
548#
549# Plug and Play support
550#
551
552#
553# Block devices
554#
555# CONFIG_BLK_CPQ_DA is not set
556# CONFIG_BLK_CPQ_CISS_DA is not set
557# CONFIG_BLK_DEV_DAC960 is not set
558CONFIG_BLK_DEV_UMEM=m
559# CONFIG_BLK_DEV_COW_COMMON is not set
560CONFIG_BLK_DEV_LOOP=m
561CONFIG_BLK_DEV_CRYPTOLOOP=m
562CONFIG_BLK_DEV_NBD=m
563# CONFIG_BLK_DEV_SX8 is not set
564CONFIG_BLK_DEV_RAM=y
565CONFIG_BLK_DEV_RAM_COUNT=16
566CONFIG_BLK_DEV_RAM_SIZE=4096
567# CONFIG_BLK_DEV_INITRD is not set
568# CONFIG_LBD is not set
569CONFIG_CDROM_PKTCDVD=m
570CONFIG_CDROM_PKTCDVD_BUFFERS=8
571# CONFIG_CDROM_PKTCDVD_WCACHE is not set
572
573#
574# IO Schedulers
575#
576CONFIG_IOSCHED_NOOP=y
577CONFIG_IOSCHED_AS=y
578CONFIG_IOSCHED_DEADLINE=y
579CONFIG_IOSCHED_CFQ=y
580CONFIG_ATA_OVER_ETH=m
581
582#
583# ATA/ATAPI/MFM/RLL support
584#
585CONFIG_IDE=y
586CONFIG_BLK_DEV_IDE=y
587
588#
589# Please see Documentation/ide.txt for help/info on IDE drives
590#
591# CONFIG_BLK_DEV_IDE_SATA is not set
592CONFIG_BLK_DEV_IDEDISK=y
593# CONFIG_IDEDISK_MULTI_MODE is not set
594CONFIG_BLK_DEV_IDECD=y
595# CONFIG_BLK_DEV_IDETAPE is not set
596# CONFIG_BLK_DEV_IDEFLOPPY is not set
597# CONFIG_BLK_DEV_IDESCSI is not set
598# CONFIG_IDE_TASK_IOCTL is not set
599
600#
601# IDE chipset support/bugfixes
602#
603CONFIG_IDE_GENERIC=y
604# CONFIG_BLK_DEV_IDEPCI is not set
605# CONFIG_IDE_ARM is not set
606# CONFIG_BLK_DEV_IDEDMA is not set
607# CONFIG_IDEDMA_AUTO is not set
608# CONFIG_BLK_DEV_HD is not set
609
610#
611# SCSI device support
612#
613CONFIG_RAID_ATTRS=m
614CONFIG_SCSI=y
615CONFIG_SCSI_PROC_FS=y
616
617#
618# SCSI support type (disk, tape, CD-ROM)
619#
620CONFIG_BLK_DEV_SD=y
621CONFIG_CHR_DEV_ST=m
622CONFIG_CHR_DEV_OSST=m
623CONFIG_BLK_DEV_SR=m
624CONFIG_BLK_DEV_SR_VENDOR=y
625CONFIG_CHR_DEV_SG=m
626CONFIG_CHR_DEV_SCH=m
627
628#
629# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
630#
631CONFIG_SCSI_MULTI_LUN=y
632CONFIG_SCSI_CONSTANTS=y
633CONFIG_SCSI_LOGGING=y
634
635#
636# SCSI Transport Attributes
637#
638CONFIG_SCSI_SPI_ATTRS=y
639CONFIG_SCSI_FC_ATTRS=m
640CONFIG_SCSI_ISCSI_ATTRS=m
641CONFIG_SCSI_SAS_ATTRS=m
642
643#
644# SCSI low-level drivers
645#
646# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
647# CONFIG_SCSI_3W_9XXX is not set
648# CONFIG_SCSI_ACARD is not set
649# CONFIG_SCSI_AACRAID is not set
650# CONFIG_SCSI_AIC7XXX is not set
651# CONFIG_SCSI_AIC7XXX_OLD is not set
652# CONFIG_SCSI_AIC79XX is not set
653# CONFIG_SCSI_DPT_I2O is not set
654# CONFIG_MEGARAID_NEWGEN is not set
655# CONFIG_MEGARAID_LEGACY is not set
656# CONFIG_SCSI_SATA is not set
657# CONFIG_SCSI_DMX3191D is not set
658# CONFIG_SCSI_FUTURE_DOMAIN is not set
659# CONFIG_SCSI_IPS is not set
660# CONFIG_SCSI_INITIO is not set
661# CONFIG_SCSI_INIA100 is not set
662CONFIG_SCSI_SYM53C8XX_2=y
663CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
664CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
665CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
666# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
667# CONFIG_SCSI_IPR is not set
668# CONFIG_SCSI_QLOGIC_FC is not set
669# CONFIG_SCSI_QLOGIC_1280 is not set
670CONFIG_SCSI_QLA2XXX=y
671# CONFIG_SCSI_QLA21XX is not set
672# CONFIG_SCSI_QLA22XX is not set
673# CONFIG_SCSI_QLA2300 is not set
674# CONFIG_SCSI_QLA2322 is not set
675# CONFIG_SCSI_QLA6312 is not set
676# CONFIG_SCSI_QLA24XX is not set
677# CONFIG_SCSI_LPFC is not set
678# CONFIG_SCSI_DC395x is not set
679# CONFIG_SCSI_DC390T is not set
680# CONFIG_SCSI_NSP32 is not set
681# CONFIG_SCSI_DEBUG is not set
682
683#
684# Multi-device support (RAID and LVM)
685#
686CONFIG_MD=y
687CONFIG_BLK_DEV_MD=m
688CONFIG_MD_LINEAR=m
689CONFIG_MD_RAID0=m
690CONFIG_MD_RAID1=m
691CONFIG_MD_RAID10=m
692CONFIG_MD_RAID5=m
693CONFIG_MD_RAID6=m
694CONFIG_MD_MULTIPATH=m
695CONFIG_MD_FAULTY=m
696CONFIG_BLK_DEV_DM=m
697CONFIG_DM_CRYPT=m
698CONFIG_DM_SNAPSHOT=m
699CONFIG_DM_MIRROR=m
700CONFIG_DM_ZERO=m
701CONFIG_DM_MULTIPATH=m
702CONFIG_DM_MULTIPATH_EMC=m
703
704#
705# Fusion MPT device support
706#
707# CONFIG_FUSION is not set
708# CONFIG_FUSION_SPI is not set
709# CONFIG_FUSION_FC is not set
710
711#
712# IEEE 1394 (FireWire) support
713#
714# CONFIG_IEEE1394 is not set
715
716#
717# I2O device support
718#
719# CONFIG_I2O is not set
720
721#
722# Network device support
723#
627CONFIG_NETDEVICES=y 724CONFIG_NETDEVICES=y
628CONFIG_DUMMY=m 725CONFIG_DUMMY=m
629CONFIG_BONDING=m 726CONFIG_BONDING=m
630CONFIG_EQUALIZER=m 727CONFIG_EQUALIZER=m
631CONFIG_TUN=m 728CONFIG_TUN=m
632# CONFIG_ETHERTAP is not set
633 729
634# 730#
635# ARCnet devices 731# ARCnet devices
@@ -637,6 +733,21 @@ CONFIG_TUN=m
637# CONFIG_ARCNET is not set 733# CONFIG_ARCNET is not set
638 734
639# 735#
736# PHY device support
737#
738CONFIG_PHYLIB=m
739CONFIG_PHYCONTROL=y
740
741#
742# MII PHY device drivers
743#
744CONFIG_MARVELL_PHY=m
745CONFIG_DAVICOM_PHY=m
746CONFIG_QSEMI_PHY=m
747CONFIG_LXT_PHY=m
748CONFIG_CICADA_PHY=m
749
750#
640# Ethernet (10 or 100Mbit) 751# Ethernet (10 or 100Mbit)
641# 752#
642CONFIG_NET_ETHERNET=y 753CONFIG_NET_ETHERNET=y
@@ -681,13 +792,17 @@ CONFIG_LAN_SAA9730=y
681# CONFIG_HAMACHI is not set 792# CONFIG_HAMACHI is not set
682# CONFIG_YELLOWFIN is not set 793# CONFIG_YELLOWFIN is not set
683# CONFIG_R8169 is not set 794# CONFIG_R8169 is not set
795# CONFIG_SIS190 is not set
796# CONFIG_SKGE is not set
684# CONFIG_SK98LIN is not set 797# CONFIG_SK98LIN is not set
685# CONFIG_VIA_VELOCITY is not set 798# CONFIG_VIA_VELOCITY is not set
686# CONFIG_TIGON3 is not set 799# CONFIG_TIGON3 is not set
800# CONFIG_BNX2 is not set
687 801
688# 802#
689# Ethernet (10000 Mbit) 803# Ethernet (10000 Mbit)
690# 804#
805# CONFIG_CHELSIO_T1 is not set
691# CONFIG_IXGB is not set 806# CONFIG_IXGB is not set
692# CONFIG_S2IO is not set 807# CONFIG_S2IO is not set
693 808
@@ -700,6 +815,8 @@ CONFIG_LAN_SAA9730=y
700# Wireless LAN (non-hamradio) 815# Wireless LAN (non-hamradio)
701# 816#
702# CONFIG_NET_RADIO is not set 817# CONFIG_NET_RADIO is not set
818# CONFIG_IPW_DEBUG is not set
819CONFIG_IPW2200=m
703 820
704# 821#
705# Wan interfaces 822# Wan interfaces
@@ -712,6 +829,8 @@ CONFIG_LAN_SAA9730=y
712# CONFIG_NET_FC is not set 829# CONFIG_NET_FC is not set
713# CONFIG_SHAPER is not set 830# CONFIG_SHAPER is not set
714# CONFIG_NETCONSOLE is not set 831# CONFIG_NETCONSOLE is not set
832# CONFIG_NETPOLL is not set
833# CONFIG_NET_POLL_CONTROLLER is not set
715 834
716# 835#
717# ISDN subsystem 836# ISDN subsystem
@@ -741,19 +860,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
741# CONFIG_INPUT_EVBUG is not set 860# CONFIG_INPUT_EVBUG is not set
742 861
743# 862#
744# Input I/O drivers
745#
746# CONFIG_GAMEPORT is not set
747CONFIG_SOUND_GAMEPORT=y
748CONFIG_SERIO=y
749# CONFIG_SERIO_I8042 is not set
750CONFIG_SERIO_SERPORT=y
751# CONFIG_SERIO_CT82C710 is not set
752# CONFIG_SERIO_PCIPS2 is not set
753CONFIG_SERIO_LIBPS2=y
754CONFIG_SERIO_RAW=y
755
756#
757# Input Device Drivers 863# Input Device Drivers
758# 864#
759# CONFIG_INPUT_KEYBOARD is not set 865# CONFIG_INPUT_KEYBOARD is not set
@@ -766,6 +872,17 @@ CONFIG_MOUSE_SERIAL=m
766# CONFIG_INPUT_MISC is not set 872# CONFIG_INPUT_MISC is not set
767 873
768# 874#
875# Hardware I/O ports
876#
877CONFIG_SERIO=y
878# CONFIG_SERIO_I8042 is not set
879CONFIG_SERIO_SERPORT=y
880# CONFIG_SERIO_PCIPS2 is not set
881CONFIG_SERIO_LIBPS2=y
882CONFIG_SERIO_RAW=y
883# CONFIG_GAMEPORT is not set
884
885#
769# Character devices 886# Character devices
770# 887#
771CONFIG_VT=y 888CONFIG_VT=y
@@ -786,6 +903,7 @@ CONFIG_SERIAL_8250_NR_UARTS=4
786# 903#
787CONFIG_SERIAL_CORE=y 904CONFIG_SERIAL_CORE=y
788CONFIG_SERIAL_CORE_CONSOLE=y 905CONFIG_SERIAL_CORE_CONSOLE=y
906# CONFIG_SERIAL_JSM is not set
789CONFIG_UNIX98_PTYS=y 907CONFIG_UNIX98_PTYS=y
790CONFIG_LEGACY_PTYS=y 908CONFIG_LEGACY_PTYS=y
791CONFIG_LEGACY_PTY_COUNT=256 909CONFIG_LEGACY_PTY_COUNT=256
@@ -812,6 +930,11 @@ CONFIG_LEGACY_PTY_COUNT=256
812# CONFIG_RAW_DRIVER is not set 930# CONFIG_RAW_DRIVER is not set
813 931
814# 932#
933# TPM devices
934#
935# CONFIG_TCG_TPM is not set
936
937#
815# I2C support 938# I2C support
816# 939#
817# CONFIG_I2C is not set 940# CONFIG_I2C is not set
@@ -822,10 +945,20 @@ CONFIG_LEGACY_PTY_COUNT=256
822# CONFIG_W1 is not set 945# CONFIG_W1 is not set
823 946
824# 947#
948# Hardware Monitoring support
949#
950# CONFIG_HWMON is not set
951# CONFIG_HWMON_VID is not set
952
953#
825# Misc devices 954# Misc devices
826# 955#
827 956
828# 957#
958# Multimedia Capabilities Port drivers
959#
960
961#
829# Multimedia devices 962# Multimedia devices
830# 963#
831# CONFIG_VIDEO_DEV is not set 964# CONFIG_VIDEO_DEV is not set
@@ -845,7 +978,6 @@ CONFIG_LEGACY_PTY_COUNT=256
845# 978#
846# CONFIG_VGA_CONSOLE is not set 979# CONFIG_VGA_CONSOLE is not set
847CONFIG_DUMMY_CONSOLE=y 980CONFIG_DUMMY_CONSOLE=y
848# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
849 981
850# 982#
851# Sound 983# Sound
@@ -855,13 +987,9 @@ CONFIG_DUMMY_CONSOLE=y
855# 987#
856# USB support 988# USB support
857# 989#
858# CONFIG_USB is not set
859CONFIG_USB_ARCH_HAS_HCD=y 990CONFIG_USB_ARCH_HAS_HCD=y
860CONFIG_USB_ARCH_HAS_OHCI=y 991CONFIG_USB_ARCH_HAS_OHCI=y
861 992# CONFIG_USB is not set
862#
863# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
864#
865 993
866# 994#
867# USB Gadget Support 995# USB Gadget Support
@@ -879,10 +1007,15 @@ CONFIG_USB_ARCH_HAS_OHCI=y
879# CONFIG_INFINIBAND is not set 1007# CONFIG_INFINIBAND is not set
880 1008
881# 1009#
1010# SN Devices
1011#
1012
1013#
882# File systems 1014# File systems
883# 1015#
884CONFIG_EXT2_FS=y 1016CONFIG_EXT2_FS=y
885# CONFIG_EXT2_FS_XATTR is not set 1017# CONFIG_EXT2_FS_XATTR is not set
1018# CONFIG_EXT2_FS_XIP is not set
886CONFIG_EXT3_FS=y 1019CONFIG_EXT3_FS=y
887CONFIG_EXT3_FS_XATTR=y 1020CONFIG_EXT3_FS_XATTR=y
888# CONFIG_EXT3_FS_POSIX_ACL is not set 1021# CONFIG_EXT3_FS_POSIX_ACL is not set
@@ -903,12 +1036,14 @@ CONFIG_JFS_SECURITY=y
903# CONFIG_JFS_STATISTICS is not set 1036# CONFIG_JFS_STATISTICS is not set
904CONFIG_FS_POSIX_ACL=y 1037CONFIG_FS_POSIX_ACL=y
905CONFIG_XFS_FS=m 1038CONFIG_XFS_FS=m
906# CONFIG_XFS_RT is not set 1039CONFIG_XFS_EXPORT=y
907CONFIG_XFS_QUOTA=y 1040CONFIG_XFS_QUOTA=m
908CONFIG_XFS_SECURITY=y 1041CONFIG_XFS_SECURITY=y
909CONFIG_XFS_POSIX_ACL=y 1042CONFIG_XFS_POSIX_ACL=y
1043# CONFIG_XFS_RT is not set
910CONFIG_MINIX_FS=m 1044CONFIG_MINIX_FS=m
911CONFIG_ROMFS_FS=m 1045CONFIG_ROMFS_FS=m
1046CONFIG_INOTIFY=y
912CONFIG_QUOTA=y 1047CONFIG_QUOTA=y
913# CONFIG_QFMT_V1 is not set 1048# CONFIG_QFMT_V1 is not set
914CONFIG_QFMT_V2=y 1049CONFIG_QFMT_V2=y
@@ -916,6 +1051,7 @@ CONFIG_QUOTACTL=y
916CONFIG_DNOTIFY=y 1051CONFIG_DNOTIFY=y
917CONFIG_AUTOFS_FS=y 1052CONFIG_AUTOFS_FS=y
918# CONFIG_AUTOFS4_FS is not set 1053# CONFIG_AUTOFS4_FS is not set
1054CONFIG_FUSE_FS=m
919 1055
920# 1056#
921# CD-ROM/DVD Filesystems 1057# CD-ROM/DVD Filesystems
@@ -943,12 +1079,10 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
943CONFIG_PROC_FS=y 1079CONFIG_PROC_FS=y
944CONFIG_PROC_KCORE=y 1080CONFIG_PROC_KCORE=y
945CONFIG_SYSFS=y 1081CONFIG_SYSFS=y
946# CONFIG_DEVFS_FS is not set
947CONFIG_DEVPTS_FS_XATTR=y
948CONFIG_DEVPTS_FS_SECURITY=y
949# CONFIG_TMPFS is not set 1082# CONFIG_TMPFS is not set
950# CONFIG_HUGETLB_PAGE is not set 1083# CONFIG_HUGETLB_PAGE is not set
951CONFIG_RAMFS=y 1084CONFIG_RAMFS=y
1085CONFIG_RELAYFS_FS=m
952 1086
953# 1087#
954# Miscellaneous filesystems 1088# Miscellaneous filesystems
@@ -974,16 +1108,19 @@ CONFIG_UFS_FS=m
974# 1108#
975CONFIG_NFS_FS=y 1109CONFIG_NFS_FS=y
976CONFIG_NFS_V3=y 1110CONFIG_NFS_V3=y
1111# CONFIG_NFS_V3_ACL is not set
977# CONFIG_NFS_V4 is not set 1112# CONFIG_NFS_V4 is not set
978# CONFIG_NFS_DIRECTIO is not set 1113# CONFIG_NFS_DIRECTIO is not set
979CONFIG_NFSD=y 1114CONFIG_NFSD=y
980CONFIG_NFSD_V3=y 1115CONFIG_NFSD_V3=y
1116# CONFIG_NFSD_V3_ACL is not set
981# CONFIG_NFSD_V4 is not set 1117# CONFIG_NFSD_V4 is not set
982# CONFIG_NFSD_TCP is not set 1118# CONFIG_NFSD_TCP is not set
983CONFIG_ROOT_NFS=y 1119CONFIG_ROOT_NFS=y
984CONFIG_LOCKD=y 1120CONFIG_LOCKD=y
985CONFIG_LOCKD_V4=y 1121CONFIG_LOCKD_V4=y
986CONFIG_EXPORTFS=y 1122CONFIG_EXPORTFS=y
1123CONFIG_NFS_COMMON=y
987CONFIG_SUNRPC=y 1124CONFIG_SUNRPC=y
988# CONFIG_RPCSEC_GSS_KRB5 is not set 1125# CONFIG_RPCSEC_GSS_KRB5 is not set
989# CONFIG_RPCSEC_GSS_SPKM3 is not set 1126# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -992,6 +1129,7 @@ CONFIG_SUNRPC=y
992# CONFIG_NCP_FS is not set 1129# CONFIG_NCP_FS is not set
993# CONFIG_CODA_FS is not set 1130# CONFIG_CODA_FS is not set
994# CONFIG_AFS_FS is not set 1131# CONFIG_AFS_FS is not set
1132# CONFIG_9P_FS is not set
995 1133
996# 1134#
997# Partition Types 1135# Partition Types
@@ -1051,7 +1189,9 @@ CONFIG_NLS_UTF8=m
1051# 1189#
1052# Kernel hacking 1190# Kernel hacking
1053# 1191#
1192# CONFIG_PRINTK_TIME is not set
1054# CONFIG_DEBUG_KERNEL is not set 1193# CONFIG_DEBUG_KERNEL is not set
1194CONFIG_LOG_BUF_SHIFT=14
1055CONFIG_CROSSCOMPILE=y 1195CONFIG_CROSSCOMPILE=y
1056CONFIG_CMDLINE="" 1196CONFIG_CMDLINE=""
1057 1197
@@ -1073,6 +1213,7 @@ CONFIG_CRYPTO_SHA1=m
1073CONFIG_CRYPTO_SHA256=m 1213CONFIG_CRYPTO_SHA256=m
1074CONFIG_CRYPTO_SHA512=m 1214CONFIG_CRYPTO_SHA512=m
1075CONFIG_CRYPTO_WP512=m 1215CONFIG_CRYPTO_WP512=m
1216CONFIG_CRYPTO_TGR192=m
1076CONFIG_CRYPTO_DES=m 1217CONFIG_CRYPTO_DES=m
1077CONFIG_CRYPTO_BLOWFISH=m 1218CONFIG_CRYPTO_BLOWFISH=m
1078CONFIG_CRYPTO_TWOFISH=m 1219CONFIG_CRYPTO_TWOFISH=m
@@ -1097,9 +1238,12 @@ CONFIG_CRYPTO_CRC32C=m
1097# Library routines 1238# Library routines
1098# 1239#
1099# CONFIG_CRC_CCITT is not set 1240# CONFIG_CRC_CCITT is not set
1241CONFIG_CRC16=m
1100CONFIG_CRC32=y 1242CONFIG_CRC32=y
1101CONFIG_LIBCRC32C=m 1243CONFIG_LIBCRC32C=m
1102CONFIG_ZLIB_INFLATE=m 1244CONFIG_ZLIB_INFLATE=m
1103CONFIG_ZLIB_DEFLATE=m 1245CONFIG_ZLIB_DEFLATE=m
1104CONFIG_GENERIC_HARDIRQS=y 1246CONFIG_TEXTSEARCH=y
1105CONFIG_GENERIC_IRQ_PROBE=y 1247CONFIG_TEXTSEARCH_KMP=m
1248CONFIG_TEXTSEARCH_BM=m
1249CONFIG_TEXTSEARCH_FSM=m
diff --git a/arch/mips/configs/bigsur_defconfig b/arch/mips/configs/bigsur_defconfig
new file mode 100644
index 000000000000..25e8a08e68be
--- /dev/null
+++ b/arch/mips/configs/bigsur_defconfig
@@ -0,0 +1,881 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.14-rc2
4# Thu Oct 20 22:25:17 2005
5#
6CONFIG_MIPS=y
7
8#
9# Code maturity level options
10#
11CONFIG_EXPERIMENTAL=y
12CONFIG_CLEAN_COMPILE=y
13CONFIG_LOCK_KERNEL=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
15
16#
17# General setup
18#
19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
21CONFIG_SWAP=y
22CONFIG_SYSVIPC=y
23# CONFIG_POSIX_MQUEUE is not set
24# CONFIG_BSD_PROCESS_ACCT is not set
25CONFIG_SYSCTL=y
26# CONFIG_AUDIT is not set
27# CONFIG_HOTPLUG is not set
28CONFIG_KOBJECT_UEVENT=y
29CONFIG_IKCONFIG=y
30CONFIG_IKCONFIG_PROC=y
31# CONFIG_CPUSETS is not set
32CONFIG_INITRAMFS_SOURCE=""
33CONFIG_EMBEDDED=y
34CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_ALL is not set
36# CONFIG_KALLSYMS_EXTRA_PASS is not set
37CONFIG_PRINTK=y
38CONFIG_BUG=y
39CONFIG_BASE_FULL=y
40CONFIG_FUTEX=y
41CONFIG_EPOLL=y
42# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
43CONFIG_SHMEM=y
44CONFIG_CC_ALIGN_FUNCTIONS=0
45CONFIG_CC_ALIGN_LABELS=0
46CONFIG_CC_ALIGN_LOOPS=0
47CONFIG_CC_ALIGN_JUMPS=0
48# CONFIG_TINY_SHMEM is not set
49CONFIG_BASE_SMALL=0
50
51#
52# Loadable module support
53#
54CONFIG_MODULES=y
55CONFIG_MODULE_UNLOAD=y
56# CONFIG_MODULE_FORCE_UNLOAD is not set
57CONFIG_OBSOLETE_MODPARM=y
58CONFIG_MODVERSIONS=y
59CONFIG_MODULE_SRCVERSION_ALL=y
60CONFIG_KMOD=y
61CONFIG_STOP_MACHINE=y
62
63#
64# Machine selection
65#
66# CONFIG_MIPS_MTX1 is not set
67# CONFIG_MIPS_BOSPORUS is not set
68# CONFIG_MIPS_PB1000 is not set
69# CONFIG_MIPS_PB1100 is not set
70# CONFIG_MIPS_PB1500 is not set
71# CONFIG_MIPS_PB1550 is not set
72# CONFIG_MIPS_PB1200 is not set
73# CONFIG_MIPS_DB1000 is not set
74# CONFIG_MIPS_DB1100 is not set
75# CONFIG_MIPS_DB1500 is not set
76# CONFIG_MIPS_DB1550 is not set
77# CONFIG_MIPS_DB1200 is not set
78# CONFIG_MIPS_MIRAGE is not set
79# CONFIG_MIPS_COBALT is not set
80# CONFIG_MACH_DECSTATION is not set
81# CONFIG_MIPS_EV64120 is not set
82# CONFIG_MIPS_EV96100 is not set
83# CONFIG_MIPS_IVR is not set
84# CONFIG_MIPS_ITE8172 is not set
85# CONFIG_MACH_JAZZ is not set
86# CONFIG_LASAT is not set
87# CONFIG_MIPS_ATLAS is not set
88# CONFIG_MIPS_MALTA is not set
89# CONFIG_MIPS_SEAD is not set
90# CONFIG_MIPS_SIM is not set
91# CONFIG_MOMENCO_JAGUAR_ATX is not set
92# CONFIG_MOMENCO_OCELOT is not set
93# CONFIG_MOMENCO_OCELOT_3 is not set
94# CONFIG_MOMENCO_OCELOT_C is not set
95# CONFIG_MOMENCO_OCELOT_G is not set
96# CONFIG_MIPS_XXS1500 is not set
97# CONFIG_PNX8550_V2PCI is not set
98# CONFIG_PNX8550_JBS is not set
99# CONFIG_DDB5074 is not set
100# CONFIG_DDB5476 is not set
101# CONFIG_DDB5477 is not set
102# CONFIG_MACH_VR41XX is not set
103# CONFIG_PMC_YOSEMITE is not set
104# CONFIG_QEMU is not set
105# CONFIG_SGI_IP22 is not set
106# CONFIG_SGI_IP27 is not set
107# CONFIG_SGI_IP32 is not set
108CONFIG_SIBYTE_BIGSUR=y
109# CONFIG_SIBYTE_SWARM is not set
110# CONFIG_SIBYTE_SENTOSA is not set
111# CONFIG_SIBYTE_RHONE is not set
112# CONFIG_SIBYTE_CARMEL is not set
113# CONFIG_SIBYTE_PTSWARM is not set
114# CONFIG_SIBYTE_LITTLESUR is not set
115# CONFIG_SIBYTE_CRHINE is not set
116# CONFIG_SIBYTE_CRHONE is not set
117# CONFIG_SNI_RM200_PCI is not set
118# CONFIG_TOSHIBA_JMR3927 is not set
119# CONFIG_TOSHIBA_RBTX4927 is not set
120# CONFIG_TOSHIBA_RBTX4938 is not set
121CONFIG_SIBYTE_BCM1x80=y
122CONFIG_SIBYTE_SB1xxx_SOC=y
123# CONFIG_CPU_SB1_PASS_1 is not set
124# CONFIG_CPU_SB1_PASS_2_1250 is not set
125# CONFIG_CPU_SB1_PASS_2_2 is not set
126# CONFIG_CPU_SB1_PASS_4 is not set
127# CONFIG_CPU_SB1_PASS_2_112x is not set
128# CONFIG_CPU_SB1_PASS_3 is not set
129# CONFIG_SIMULATION is not set
130# CONFIG_CONFIG_SB1_CEX_ALWAYS_FATAL is not set
131# CONFIG_CONFIG_SB1_CERR_STALL is not set
132CONFIG_SIBYTE_CFE=y
133# CONFIG_SIBYTE_CFE_CONSOLE is not set
134# CONFIG_SIBYTE_BUS_WATCHER is not set
135# CONFIG_SIBYTE_SB1250_PROF is not set
136# CONFIG_SIBYTE_TBPROF is not set
137CONFIG_RWSEM_GENERIC_SPINLOCK=y
138CONFIG_GENERIC_CALIBRATE_DELAY=y
139CONFIG_DMA_COHERENT=y
140CONFIG_CPU_BIG_ENDIAN=y
141# CONFIG_CPU_LITTLE_ENDIAN is not set
142CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
143CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
144CONFIG_SWAP_IO_SPACE=y
145CONFIG_BOOT_ELF32=y
146CONFIG_MIPS_L1_CACHE_SHIFT=5
147
148#
149# CPU selection
150#
151# CONFIG_CPU_MIPS32_R1 is not set
152# CONFIG_CPU_MIPS32_R2 is not set
153# CONFIG_CPU_MIPS64_R1 is not set
154# CONFIG_CPU_MIPS64_R2 is not set
155# CONFIG_CPU_R3000 is not set
156# CONFIG_CPU_TX39XX is not set
157# CONFIG_CPU_VR41XX is not set
158# CONFIG_CPU_R4300 is not set
159# CONFIG_CPU_R4X00 is not set
160# CONFIG_CPU_TX49XX is not set
161# CONFIG_CPU_R5000 is not set
162# CONFIG_CPU_R5432 is not set
163# CONFIG_CPU_R6000 is not set
164# CONFIG_CPU_NEVADA is not set
165# CONFIG_CPU_R8000 is not set
166# CONFIG_CPU_R10000 is not set
167# CONFIG_CPU_RM7000 is not set
168# CONFIG_CPU_RM9000 is not set
169CONFIG_CPU_SB1=y
170CONFIG_SYS_HAS_CPU_SB1=y
171CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
172CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
173CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
174CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
175
176#
177# Kernel type
178#
179# CONFIG_32BIT is not set
180CONFIG_64BIT=y
181CONFIG_PAGE_SIZE_4KB=y
182# CONFIG_PAGE_SIZE_8KB is not set
183# CONFIG_PAGE_SIZE_16KB is not set
184# CONFIG_PAGE_SIZE_64KB is not set
185# CONFIG_SIBYTE_DMA_PAGEOPS is not set
186# CONFIG_MIPS_MT is not set
187CONFIG_CPU_HAS_LLSC=y
188CONFIG_CPU_HAS_LLDSCD=y
189CONFIG_CPU_HAS_SYNC=y
190CONFIG_GENERIC_HARDIRQS=y
191CONFIG_GENERIC_IRQ_PROBE=y
192CONFIG_CPU_SUPPORTS_HIGHMEM=y
193CONFIG_ARCH_FLATMEM_ENABLE=y
194CONFIG_SELECT_MEMORY_MODEL=y
195CONFIG_FLATMEM_MANUAL=y
196# CONFIG_DISCONTIGMEM_MANUAL is not set
197# CONFIG_SPARSEMEM_MANUAL is not set
198CONFIG_FLATMEM=y
199CONFIG_FLAT_NODE_MEM_MAP=y
200# CONFIG_SPARSEMEM_STATIC is not set
201CONFIG_SMP=y
202CONFIG_NR_CPUS=4
203CONFIG_PREEMPT_NONE=y
204# CONFIG_PREEMPT_VOLUNTARY is not set
205# CONFIG_PREEMPT is not set
206# CONFIG_PREEMPT_BKL is not set
207
208#
209# Bus options (PCI, PCMCIA, EISA, ISA, TC)
210#
211CONFIG_HW_HAS_PCI=y
212CONFIG_PCI=y
213CONFIG_PCI_DOMAINS=y
214CONFIG_PCI_LEGACY_PROC=y
215CONFIG_PCI_DEBUG=y
216CONFIG_MMU=y
217
218#
219# PCCARD (PCMCIA/CardBus) support
220#
221# CONFIG_PCCARD is not set
222
223#
224# PCI Hotplug Support
225#
226# CONFIG_HOTPLUG_PCI is not set
227
228#
229# Executable file formats
230#
231CONFIG_BINFMT_ELF=y
232# CONFIG_BINFMT_MISC is not set
233CONFIG_BUILD_ELF64=y
234CONFIG_MIPS32_COMPAT=y
235CONFIG_COMPAT=y
236CONFIG_MIPS32_O32=y
237# CONFIG_MIPS32_N32 is not set
238CONFIG_BINFMT_ELF32=y
239
240#
241# Networking
242#
243CONFIG_NET=y
244
245#
246# Networking options
247#
248CONFIG_PACKET=y
249CONFIG_PACKET_MMAP=y
250CONFIG_UNIX=y
251CONFIG_XFRM=y
252CONFIG_XFRM_USER=m
253CONFIG_NET_KEY=y
254CONFIG_INET=y
255# CONFIG_IP_MULTICAST is not set
256# CONFIG_IP_ADVANCED_ROUTER is not set
257CONFIG_IP_FIB_HASH=y
258CONFIG_IP_PNP=y
259CONFIG_IP_PNP_DHCP=y
260CONFIG_IP_PNP_BOOTP=y
261# CONFIG_IP_PNP_RARP is not set
262# CONFIG_NET_IPIP is not set
263# CONFIG_NET_IPGRE is not set
264# CONFIG_ARPD is not set
265# CONFIG_SYN_COOKIES is not set
266# CONFIG_INET_AH is not set
267# CONFIG_INET_ESP is not set
268# CONFIG_INET_IPCOMP is not set
269CONFIG_INET_TUNNEL=m
270CONFIG_INET_DIAG=y
271CONFIG_INET_TCP_DIAG=y
272# CONFIG_TCP_CONG_ADVANCED is not set
273CONFIG_TCP_CONG_BIC=y
274# CONFIG_IPV6 is not set
275# CONFIG_NETFILTER is not set
276
277#
278# DCCP Configuration (EXPERIMENTAL)
279#
280# CONFIG_IP_DCCP is not set
281
282#
283# SCTP Configuration (EXPERIMENTAL)
284#
285# CONFIG_IP_SCTP is not set
286# CONFIG_ATM is not set
287# CONFIG_BRIDGE is not set
288# CONFIG_VLAN_8021Q is not set
289# CONFIG_DECNET is not set
290# CONFIG_LLC2 is not set
291# CONFIG_IPX is not set
292# CONFIG_ATALK is not set
293# CONFIG_X25 is not set
294# CONFIG_LAPB is not set
295# CONFIG_NET_DIVERT is not set
296# CONFIG_ECONET is not set
297# CONFIG_WAN_ROUTER is not set
298# CONFIG_NET_SCHED is not set
299# CONFIG_NET_CLS_ROUTE is not set
300
301#
302# Network testing
303#
304# CONFIG_NET_PKTGEN is not set
305# CONFIG_HAMRADIO is not set
306# CONFIG_IRDA is not set
307# CONFIG_BT is not set
308# CONFIG_IEEE80211 is not set
309
310#
311# Device Drivers
312#
313
314#
315# Generic Driver Options
316#
317CONFIG_STANDALONE=y
318CONFIG_PREVENT_FIRMWARE_BUILD=y
319# CONFIG_FW_LOADER is not set
320# CONFIG_DEBUG_DRIVER is not set
321
322#
323# Connector - unified userspace <-> kernelspace linker
324#
325# CONFIG_CONNECTOR is not set
326
327#
328# Memory Technology Devices (MTD)
329#
330# CONFIG_MTD is not set
331
332#
333# Parallel port support
334#
335# CONFIG_PARPORT is not set
336
337#
338# Plug and Play support
339#
340
341#
342# Block devices
343#
344# CONFIG_BLK_CPQ_DA is not set
345# CONFIG_BLK_CPQ_CISS_DA is not set
346# CONFIG_BLK_DEV_DAC960 is not set
347# CONFIG_BLK_DEV_UMEM is not set
348# CONFIG_BLK_DEV_COW_COMMON is not set
349CONFIG_BLK_DEV_LOOP=m
350# CONFIG_BLK_DEV_CRYPTOLOOP is not set
351CONFIG_BLK_DEV_NBD=m
352# CONFIG_BLK_DEV_SX8 is not set
353# CONFIG_BLK_DEV_RAM is not set
354CONFIG_BLK_DEV_RAM_COUNT=16
355# CONFIG_CDROM_PKTCDVD is not set
356
357#
358# IO Schedulers
359#
360CONFIG_IOSCHED_NOOP=y
361CONFIG_IOSCHED_AS=y
362CONFIG_IOSCHED_DEADLINE=y
363CONFIG_IOSCHED_CFQ=y
364# CONFIG_ATA_OVER_ETH is not set
365
366#
367# ATA/ATAPI/MFM/RLL support
368#
369CONFIG_IDE=y
370CONFIG_BLK_DEV_IDE=y
371
372#
373# Please see Documentation/ide.txt for help/info on IDE drives
374#
375# CONFIG_BLK_DEV_IDE_SATA is not set
376CONFIG_BLK_DEV_IDEDISK=y
377# CONFIG_IDEDISK_MULTI_MODE is not set
378CONFIG_BLK_DEV_IDECD=y
379CONFIG_BLK_DEV_IDETAPE=y
380CONFIG_BLK_DEV_IDEFLOPPY=y
381# CONFIG_IDE_TASK_IOCTL is not set
382
383#
384# IDE chipset support/bugfixes
385#
386CONFIG_IDE_GENERIC=y
387# CONFIG_BLK_DEV_IDEPCI is not set
388# CONFIG_BLK_DEV_IDE_SWARM is not set
389# CONFIG_IDE_ARM is not set
390# CONFIG_BLK_DEV_IDEDMA is not set
391# CONFIG_IDEDMA_AUTO is not set
392# CONFIG_BLK_DEV_HD is not set
393
394#
395# SCSI device support
396#
397# CONFIG_RAID_ATTRS is not set
398# CONFIG_SCSI is not set
399
400#
401# Multi-device support (RAID and LVM)
402#
403# CONFIG_MD is not set
404
405#
406# Fusion MPT device support
407#
408# CONFIG_FUSION is not set
409
410#
411# IEEE 1394 (FireWire) support
412#
413# CONFIG_IEEE1394 is not set
414
415#
416# I2O device support
417#
418# CONFIG_I2O is not set
419
420#
421# Network device support
422#
423CONFIG_NETDEVICES=y
424# CONFIG_DUMMY is not set
425# CONFIG_BONDING is not set
426# CONFIG_EQUALIZER is not set
427# CONFIG_TUN is not set
428
429#
430# ARCnet devices
431#
432# CONFIG_ARCNET is not set
433
434#
435# PHY device support
436#
437# CONFIG_PHYLIB is not set
438
439#
440# Ethernet (10 or 100Mbit)
441#
442CONFIG_NET_ETHERNET=y
443CONFIG_MII=y
444# CONFIG_HAPPYMEAL is not set
445# CONFIG_SUNGEM is not set
446# CONFIG_NET_VENDOR_3COM is not set
447
448#
449# Tulip family network device support
450#
451# CONFIG_NET_TULIP is not set
452# CONFIG_HP100 is not set
453# CONFIG_NET_PCI is not set
454
455#
456# Ethernet (1000 Mbit)
457#
458# CONFIG_ACENIC is not set
459# CONFIG_DL2K is not set
460# CONFIG_E1000 is not set
461# CONFIG_NS83820 is not set
462# CONFIG_HAMACHI is not set
463# CONFIG_YELLOWFIN is not set
464# CONFIG_R8169 is not set
465CONFIG_NET_SB1250_MAC=y
466# CONFIG_SIS190 is not set
467# CONFIG_SKGE is not set
468# CONFIG_SK98LIN is not set
469# CONFIG_TIGON3 is not set
470# CONFIG_BNX2 is not set
471
472#
473# Ethernet (10000 Mbit)
474#
475# CONFIG_CHELSIO_T1 is not set
476# CONFIG_IXGB is not set
477# CONFIG_S2IO is not set
478
479#
480# Token Ring devices
481#
482# CONFIG_TR is not set
483
484#
485# Wireless LAN (non-hamradio)
486#
487# CONFIG_NET_RADIO is not set
488
489#
490# Wan interfaces
491#
492# CONFIG_WAN is not set
493# CONFIG_FDDI is not set
494# CONFIG_HIPPI is not set
495# CONFIG_PPP is not set
496# CONFIG_SLIP is not set
497# CONFIG_SHAPER is not set
498# CONFIG_NETCONSOLE is not set
499# CONFIG_NETPOLL is not set
500# CONFIG_NET_POLL_CONTROLLER is not set
501
502#
503# ISDN subsystem
504#
505# CONFIG_ISDN is not set
506
507#
508# Telephony Support
509#
510# CONFIG_PHONE is not set
511
512#
513# Input device support
514#
515# CONFIG_INPUT is not set
516
517#
518# Hardware I/O ports
519#
520CONFIG_SERIO=y
521# CONFIG_SERIO_I8042 is not set
522CONFIG_SERIO_SERPORT=y
523# CONFIG_SERIO_PCIPS2 is not set
524# CONFIG_SERIO_LIBPS2 is not set
525CONFIG_SERIO_RAW=m
526# CONFIG_GAMEPORT is not set
527
528#
529# Character devices
530#
531# CONFIG_VT is not set
532CONFIG_SERIAL_NONSTANDARD=y
533# CONFIG_ROCKETPORT is not set
534# CONFIG_CYCLADES is not set
535# CONFIG_DIGIEPCA is not set
536# CONFIG_MOXA_SMARTIO is not set
537# CONFIG_ISI is not set
538# CONFIG_SYNCLINKMP is not set
539# CONFIG_N_HDLC is not set
540# CONFIG_SPECIALIX is not set
541# CONFIG_SX is not set
542# CONFIG_STALDRV is not set
543CONFIG_SIBYTE_SB1250_DUART=y
544CONFIG_SIBYTE_SB1250_DUART_CONSOLE=y
545
546#
547# Serial drivers
548#
549# CONFIG_SERIAL_8250 is not set
550
551#
552# Non-8250 serial port support
553#
554# CONFIG_SERIAL_JSM is not set
555CONFIG_UNIX98_PTYS=y
556CONFIG_LEGACY_PTYS=y
557CONFIG_LEGACY_PTY_COUNT=256
558
559#
560# IPMI
561#
562# CONFIG_IPMI_HANDLER is not set
563
564#
565# Watchdog Cards
566#
567# CONFIG_WATCHDOG is not set
568# CONFIG_RTC is not set
569CONFIG_GEN_RTC=y
570# CONFIG_GEN_RTC_X is not set
571# CONFIG_DTLK is not set
572# CONFIG_R3964 is not set
573# CONFIG_APPLICOM is not set
574
575#
576# Ftape, the floppy tape device driver
577#
578# CONFIG_DRM is not set
579# CONFIG_RAW_DRIVER is not set
580
581#
582# TPM devices
583#
584# CONFIG_TCG_TPM is not set
585
586#
587# I2C support
588#
589CONFIG_I2C=y
590CONFIG_I2C_CHARDEV=y
591
592#
593# I2C Algorithms
594#
595# CONFIG_I2C_ALGOBIT is not set
596# CONFIG_I2C_ALGOPCF is not set
597# CONFIG_I2C_ALGOPCA is not set
598CONFIG_I2C_ALGO_SIBYTE=y
599
600#
601# I2C Hardware Bus support
602#
603# CONFIG_I2C_ALI1535 is not set
604# CONFIG_I2C_ALI1563 is not set
605# CONFIG_I2C_ALI15X3 is not set
606# CONFIG_I2C_AMD756 is not set
607# CONFIG_I2C_AMD8111 is not set
608# CONFIG_I2C_I801 is not set
609# CONFIG_I2C_I810 is not set
610# CONFIG_I2C_PIIX4 is not set
611# CONFIG_I2C_NFORCE2 is not set
612# CONFIG_I2C_PARPORT_LIGHT is not set
613# CONFIG_I2C_PROSAVAGE is not set
614# CONFIG_I2C_SAVAGE4 is not set
615CONFIG_I2C_SIBYTE=y
616# CONFIG_SCx200_ACB is not set
617# CONFIG_I2C_SIS5595 is not set
618# CONFIG_I2C_SIS630 is not set
619# CONFIG_I2C_SIS96X is not set
620# CONFIG_I2C_STUB is not set
621# CONFIG_I2C_VIA is not set
622# CONFIG_I2C_VIAPRO is not set
623# CONFIG_I2C_VOODOO3 is not set
624# CONFIG_I2C_PCA_ISA is not set
625
626#
627# Miscellaneous I2C Chip support
628#
629CONFIG_SENSORS_DS1337=y
630CONFIG_SENSORS_DS1374=y
631CONFIG_SENSORS_EEPROM=y
632CONFIG_SENSORS_PCF8574=y
633CONFIG_SENSORS_PCA9539=y
634CONFIG_SENSORS_PCF8591=y
635CONFIG_SENSORS_RTC8564=y
636CONFIG_SENSORS_MAX6875=y
637CONFIG_I2C_DEBUG_CORE=y
638CONFIG_I2C_DEBUG_ALGO=y
639CONFIG_I2C_DEBUG_BUS=y
640CONFIG_I2C_DEBUG_CHIP=y
641
642#
643# Dallas's 1-wire bus
644#
645# CONFIG_W1 is not set
646
647#
648# Hardware Monitoring support
649#
650# CONFIG_HWMON is not set
651# CONFIG_HWMON_VID is not set
652
653#
654# Misc devices
655#
656
657#
658# Multimedia Capabilities Port drivers
659#
660
661#
662# Multimedia devices
663#
664# CONFIG_VIDEO_DEV is not set
665
666#
667# Digital Video Broadcasting Devices
668#
669# CONFIG_DVB is not set
670
671#
672# Graphics support
673#
674# CONFIG_FB is not set
675
676#
677# Sound
678#
679# CONFIG_SOUND is not set
680
681#
682# USB support
683#
684CONFIG_USB_ARCH_HAS_HCD=y
685CONFIG_USB_ARCH_HAS_OHCI=y
686# CONFIG_USB is not set
687
688#
689# USB Gadget Support
690#
691# CONFIG_USB_GADGET is not set
692
693#
694# MMC/SD Card support
695#
696# CONFIG_MMC is not set
697
698#
699# InfiniBand support
700#
701# CONFIG_INFINIBAND is not set
702
703#
704# SN Devices
705#
706
707#
708# File systems
709#
710CONFIG_EXT2_FS=y
711CONFIG_EXT2_FS_XATTR=y
712CONFIG_EXT2_FS_POSIX_ACL=y
713CONFIG_EXT2_FS_SECURITY=y
714# CONFIG_EXT2_FS_XIP is not set
715# CONFIG_EXT3_FS is not set
716# CONFIG_JBD is not set
717CONFIG_FS_MBCACHE=y
718# CONFIG_REISERFS_FS is not set
719# CONFIG_JFS_FS is not set
720CONFIG_FS_POSIX_ACL=y
721# CONFIG_XFS_FS is not set
722# CONFIG_MINIX_FS is not set
723# CONFIG_ROMFS_FS is not set
724CONFIG_INOTIFY=y
725# CONFIG_QUOTA is not set
726CONFIG_DNOTIFY=y
727# CONFIG_AUTOFS_FS is not set
728# CONFIG_AUTOFS4_FS is not set
729# CONFIG_FUSE_FS is not set
730
731#
732# CD-ROM/DVD Filesystems
733#
734# CONFIG_ISO9660_FS is not set
735# CONFIG_UDF_FS is not set
736
737#
738# DOS/FAT/NT Filesystems
739#
740# CONFIG_MSDOS_FS is not set
741# CONFIG_VFAT_FS is not set
742# CONFIG_NTFS_FS is not set
743
744#
745# Pseudo filesystems
746#
747CONFIG_PROC_FS=y
748CONFIG_PROC_KCORE=y
749CONFIG_SYSFS=y
750# CONFIG_TMPFS is not set
751# CONFIG_HUGETLB_PAGE is not set
752CONFIG_RAMFS=y
753# CONFIG_RELAYFS_FS is not set
754
755#
756# Miscellaneous filesystems
757#
758# CONFIG_ADFS_FS is not set
759# CONFIG_AFFS_FS is not set
760# CONFIG_HFS_FS is not set
761# CONFIG_HFSPLUS_FS is not set
762# CONFIG_BEFS_FS is not set
763# CONFIG_BFS_FS is not set
764# CONFIG_EFS_FS is not set
765# CONFIG_CRAMFS is not set
766# CONFIG_VXFS_FS is not set
767# CONFIG_HPFS_FS is not set
768# CONFIG_QNX4FS_FS is not set
769# CONFIG_SYSV_FS is not set
770# CONFIG_UFS_FS is not set
771
772#
773# Network File Systems
774#
775CONFIG_NFS_FS=y
776CONFIG_NFS_V3=y
777# CONFIG_NFS_V3_ACL is not set
778# CONFIG_NFS_V4 is not set
779# CONFIG_NFS_DIRECTIO is not set
780# CONFIG_NFSD is not set
781CONFIG_ROOT_NFS=y
782CONFIG_LOCKD=y
783CONFIG_LOCKD_V4=y
784CONFIG_NFS_COMMON=y
785CONFIG_SUNRPC=y
786# CONFIG_RPCSEC_GSS_KRB5 is not set
787# CONFIG_RPCSEC_GSS_SPKM3 is not set
788# CONFIG_SMB_FS is not set
789# CONFIG_CIFS is not set
790# CONFIG_NCP_FS is not set
791# CONFIG_CODA_FS is not set
792# CONFIG_AFS_FS is not set
793# CONFIG_9P_FS is not set
794
795#
796# Partition Types
797#
798# CONFIG_PARTITION_ADVANCED is not set
799CONFIG_MSDOS_PARTITION=y
800
801#
802# Native Language Support
803#
804# CONFIG_NLS is not set
805
806#
807# Profiling support
808#
809# CONFIG_PROFILING is not set
810
811#
812# Kernel hacking
813#
814CONFIG_PRINTK_TIME=y
815CONFIG_DEBUG_KERNEL=y
816CONFIG_MAGIC_SYSRQ=y
817CONFIG_LOG_BUF_SHIFT=16
818CONFIG_DETECT_SOFTLOCKUP=y
819# CONFIG_SCHEDSTATS is not set
820# CONFIG_DEBUG_SLAB is not set
821# CONFIG_DEBUG_SPINLOCK is not set
822# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
823# CONFIG_DEBUG_KOBJECT is not set
824# CONFIG_DEBUG_INFO is not set
825# CONFIG_DEBUG_FS is not set
826CONFIG_CROSSCOMPILE=y
827CONFIG_CMDLINE=""
828# CONFIG_DEBUG_STACK_USAGE is not set
829# CONFIG_KGDB is not set
830# CONFIG_SB1XXX_CORELIS is not set
831# CONFIG_RUNTIME_DEBUG is not set
832
833#
834# Security options
835#
836CONFIG_KEYS=y
837CONFIG_KEYS_DEBUG_PROC_KEYS=y
838# CONFIG_SECURITY is not set
839
840#
841# Cryptographic options
842#
843CONFIG_CRYPTO=y
844CONFIG_CRYPTO_HMAC=y
845CONFIG_CRYPTO_NULL=y
846CONFIG_CRYPTO_MD4=y
847CONFIG_CRYPTO_MD5=y
848CONFIG_CRYPTO_SHA1=y
849CONFIG_CRYPTO_SHA256=y
850CONFIG_CRYPTO_SHA512=y
851CONFIG_CRYPTO_WP512=m
852CONFIG_CRYPTO_TGR192=m
853CONFIG_CRYPTO_DES=y
854CONFIG_CRYPTO_BLOWFISH=y
855CONFIG_CRYPTO_TWOFISH=y
856CONFIG_CRYPTO_SERPENT=y
857CONFIG_CRYPTO_AES=m
858# CONFIG_CRYPTO_CAST5 is not set
859# CONFIG_CRYPTO_CAST6 is not set
860CONFIG_CRYPTO_TEA=m
861# CONFIG_CRYPTO_ARC4 is not set
862CONFIG_CRYPTO_KHAZAD=m
863CONFIG_CRYPTO_ANUBIS=m
864CONFIG_CRYPTO_DEFLATE=y
865CONFIG_CRYPTO_MICHAEL_MIC=y
866# CONFIG_CRYPTO_CRC32C is not set
867# CONFIG_CRYPTO_TEST is not set
868
869#
870# Hardware crypto devices
871#
872
873#
874# Library routines
875#
876# CONFIG_CRC_CCITT is not set
877# CONFIG_CRC16 is not set
878CONFIG_CRC32=y
879# CONFIG_LIBCRC32C is not set
880CONFIG_ZLIB_INFLATE=y
881CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/mips/configs/capcella_defconfig b/arch/mips/configs/capcella_defconfig
index 158e7165f4e3..bfbaa08c47cb 100644
--- a/arch/mips/configs/capcella_defconfig
+++ b/arch/mips/configs/capcella_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:00 2005 4# Thu Oct 20 22:25:20 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,24 +11,29 @@ CONFIG_32BIT=y
14CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
25# CONFIG_BSD_PROCESS_ACCT is not set 24# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y 25CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set 26# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14 27CONFIG_HOTPLUG=y
29# CONFIG_HOTPLUG is not set
30CONFIG_KOBJECT_UEVENT=y 28CONFIG_KOBJECT_UEVENT=y
31# CONFIG_IKCONFIG is not set 29# CONFIG_IKCONFIG is not set
30CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y 31CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y 32CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_EXTRA_PASS is not set 33# CONFIG_KALLSYMS_EXTRA_PASS is not set
34CONFIG_PRINTK=y
35CONFIG_BUG=y
36CONFIG_BASE_FULL=y
35CONFIG_FUTEX=y 37CONFIG_FUTEX=y
36CONFIG_EPOLL=y 38CONFIG_EPOLL=y
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -41,6 +43,7 @@ CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0 43CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0 44CONFIG_CC_ALIGN_JUMPS=0
43# CONFIG_TINY_SHMEM is not set 45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
44 47
45# 48#
46# Loadable module support 49# Loadable module support
@@ -56,57 +59,86 @@ CONFIG_KMOD=y
56# 59#
57# Machine selection 60# Machine selection
58# 61#
59# CONFIG_MACH_JAZZ is not set 62# CONFIG_MIPS_MTX1 is not set
60CONFIG_MACH_VR41XX=y 63# CONFIG_MIPS_BOSPORUS is not set
61# CONFIG_NEC_CMBVR4133 is not set 64# CONFIG_MIPS_PB1000 is not set
62# CONFIG_CASIO_E55 is not set 65# CONFIG_MIPS_PB1100 is not set
63# CONFIG_IBM_WORKPAD is not set 66# CONFIG_MIPS_PB1500 is not set
64# CONFIG_TANBAC_TB0226 is not set 67# CONFIG_MIPS_PB1550 is not set
65# CONFIG_TANBAC_TB0229 is not set 68# CONFIG_MIPS_PB1200 is not set
66# CONFIG_VICTOR_MPC30X is not set 69# CONFIG_MIPS_DB1000 is not set
67CONFIG_ZAO_CAPCELLA=y 70# CONFIG_MIPS_DB1100 is not set
68CONFIG_PCI_VR41XX=y 71# CONFIG_MIPS_DB1500 is not set
69CONFIG_VRC4173=y 72# CONFIG_MIPS_DB1550 is not set
70# CONFIG_TOSHIBA_JMR3927 is not set 73# CONFIG_MIPS_DB1200 is not set
74# CONFIG_MIPS_MIRAGE is not set
71# CONFIG_MIPS_COBALT is not set 75# CONFIG_MIPS_COBALT is not set
72# CONFIG_MACH_DECSTATION is not set 76# CONFIG_MACH_DECSTATION is not set
73# CONFIG_MIPS_EV64120 is not set 77# CONFIG_MIPS_EV64120 is not set
74# CONFIG_MIPS_EV96100 is not set 78# CONFIG_MIPS_EV96100 is not set
75# CONFIG_MIPS_IVR is not set 79# CONFIG_MIPS_IVR is not set
76# CONFIG_LASAT is not set
77# CONFIG_MIPS_ITE8172 is not set 80# CONFIG_MIPS_ITE8172 is not set
81# CONFIG_MACH_JAZZ is not set
82# CONFIG_LASAT is not set
78# CONFIG_MIPS_ATLAS is not set 83# CONFIG_MIPS_ATLAS is not set
79# CONFIG_MIPS_MALTA is not set 84# CONFIG_MIPS_MALTA is not set
80# CONFIG_MIPS_SEAD is not set 85# CONFIG_MIPS_SEAD is not set
86# CONFIG_MIPS_SIM is not set
87# CONFIG_MOMENCO_JAGUAR_ATX is not set
81# CONFIG_MOMENCO_OCELOT is not set 88# CONFIG_MOMENCO_OCELOT is not set
82# CONFIG_MOMENCO_OCELOT_G is not set
83# CONFIG_MOMENCO_OCELOT_C is not set
84# CONFIG_MOMENCO_OCELOT_3 is not set 89# CONFIG_MOMENCO_OCELOT_3 is not set
85# CONFIG_MOMENCO_JAGUAR_ATX is not set 90# CONFIG_MOMENCO_OCELOT_C is not set
86# CONFIG_PMC_YOSEMITE is not set 91# CONFIG_MOMENCO_OCELOT_G is not set
92# CONFIG_MIPS_XXS1500 is not set
93# CONFIG_PNX8550_V2PCI is not set
94# CONFIG_PNX8550_JBS is not set
87# CONFIG_DDB5074 is not set 95# CONFIG_DDB5074 is not set
88# CONFIG_DDB5476 is not set 96# CONFIG_DDB5476 is not set
89# CONFIG_DDB5477 is not set 97# CONFIG_DDB5477 is not set
90# CONFIG_NEC_OSPREY is not set 98CONFIG_MACH_VR41XX=y
99# CONFIG_PMC_YOSEMITE is not set
100# CONFIG_QEMU is not set
91# CONFIG_SGI_IP22 is not set 101# CONFIG_SGI_IP22 is not set
92# CONFIG_SOC_AU1X00 is not set 102# CONFIG_SGI_IP27 is not set
93# CONFIG_SIBYTE_SB1xxx_SOC is not set 103# CONFIG_SGI_IP32 is not set
104# CONFIG_SIBYTE_BIGSUR is not set
105# CONFIG_SIBYTE_SWARM is not set
106# CONFIG_SIBYTE_SENTOSA is not set
107# CONFIG_SIBYTE_RHONE is not set
108# CONFIG_SIBYTE_CARMEL is not set
109# CONFIG_SIBYTE_PTSWARM is not set
110# CONFIG_SIBYTE_LITTLESUR is not set
111# CONFIG_SIBYTE_CRHINE is not set
112# CONFIG_SIBYTE_CRHONE is not set
94# CONFIG_SNI_RM200_PCI is not set 113# CONFIG_SNI_RM200_PCI is not set
114# CONFIG_TOSHIBA_JMR3927 is not set
95# CONFIG_TOSHIBA_RBTX4927 is not set 115# CONFIG_TOSHIBA_RBTX4927 is not set
116# CONFIG_TOSHIBA_RBTX4938 is not set
117# CONFIG_NEC_CMBVR4133 is not set
118# CONFIG_CASIO_E55 is not set
119# CONFIG_IBM_WORKPAD is not set
120# CONFIG_TANBAC_TB022X is not set
121# CONFIG_VICTOR_MPC30X is not set
122CONFIG_ZAO_CAPCELLA=y
123CONFIG_PCI_VR41XX=y
124# CONFIG_VRC4173 is not set
96CONFIG_RWSEM_GENERIC_SPINLOCK=y 125CONFIG_RWSEM_GENERIC_SPINLOCK=y
97CONFIG_GENERIC_CALIBRATE_DELAY=y 126CONFIG_GENERIC_CALIBRATE_DELAY=y
98CONFIG_HAVE_DEC_LOCK=y
99CONFIG_DMA_NONCOHERENT=y 127CONFIG_DMA_NONCOHERENT=y
100CONFIG_DMA_NEED_PCI_MAP_STATE=y 128CONFIG_DMA_NEED_PCI_MAP_STATE=y
129# CONFIG_CPU_BIG_ENDIAN is not set
101CONFIG_CPU_LITTLE_ENDIAN=y 130CONFIG_CPU_LITTLE_ENDIAN=y
131CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
102CONFIG_IRQ_CPU=y 132CONFIG_IRQ_CPU=y
103CONFIG_MIPS_L1_CACHE_SHIFT=5 133CONFIG_MIPS_L1_CACHE_SHIFT=5
104 134
105# 135#
106# CPU selection 136# CPU selection
107# 137#
108# CONFIG_CPU_MIPS32 is not set 138# CONFIG_CPU_MIPS32_R1 is not set
109# CONFIG_CPU_MIPS64 is not set 139# CONFIG_CPU_MIPS32_R2 is not set
140# CONFIG_CPU_MIPS64_R1 is not set
141# CONFIG_CPU_MIPS64_R2 is not set
110# CONFIG_CPU_R3000 is not set 142# CONFIG_CPU_R3000 is not set
111# CONFIG_CPU_TX39XX is not set 143# CONFIG_CPU_TX39XX is not set
112CONFIG_CPU_VR41XX=y 144CONFIG_CPU_VR41XX=y
@@ -122,12 +154,36 @@ CONFIG_CPU_VR41XX=y
122# CONFIG_CPU_RM7000 is not set 154# CONFIG_CPU_RM7000 is not set
123# CONFIG_CPU_RM9000 is not set 155# CONFIG_CPU_RM9000 is not set
124# CONFIG_CPU_SB1 is not set 156# CONFIG_CPU_SB1 is not set
157CONFIG_SYS_HAS_CPU_VR41XX=y
158CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
159CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
160CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
161CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
162
163#
164# Kernel type
165#
166CONFIG_32BIT=y
167# CONFIG_64BIT is not set
125CONFIG_PAGE_SIZE_4KB=y 168CONFIG_PAGE_SIZE_4KB=y
126# CONFIG_PAGE_SIZE_8KB is not set 169# CONFIG_PAGE_SIZE_8KB is not set
127# CONFIG_PAGE_SIZE_16KB is not set 170# CONFIG_PAGE_SIZE_16KB is not set
128# CONFIG_PAGE_SIZE_64KB is not set 171# CONFIG_PAGE_SIZE_64KB is not set
172# CONFIG_MIPS_MT is not set
129# CONFIG_CPU_ADVANCED is not set 173# CONFIG_CPU_ADVANCED is not set
130CONFIG_CPU_HAS_SYNC=y 174CONFIG_CPU_HAS_SYNC=y
175CONFIG_GENERIC_HARDIRQS=y
176CONFIG_GENERIC_IRQ_PROBE=y
177CONFIG_ARCH_FLATMEM_ENABLE=y
178CONFIG_SELECT_MEMORY_MODEL=y
179CONFIG_FLATMEM_MANUAL=y
180# CONFIG_DISCONTIGMEM_MANUAL is not set
181# CONFIG_SPARSEMEM_MANUAL is not set
182CONFIG_FLATMEM=y
183CONFIG_FLAT_NODE_MEM_MAP=y
184# CONFIG_SPARSEMEM_STATIC is not set
185CONFIG_PREEMPT_NONE=y
186# CONFIG_PREEMPT_VOLUNTARY is not set
131# CONFIG_PREEMPT is not set 187# CONFIG_PREEMPT is not set
132 188
133# 189#
@@ -136,7 +192,6 @@ CONFIG_CPU_HAS_SYNC=y
136CONFIG_HW_HAS_PCI=y 192CONFIG_HW_HAS_PCI=y
137CONFIG_PCI=y 193CONFIG_PCI=y
138CONFIG_PCI_LEGACY_PROC=y 194CONFIG_PCI_LEGACY_PROC=y
139CONFIG_PCI_NAMES=y
140CONFIG_MMU=y 195CONFIG_MMU=y
141 196
142# 197#
@@ -145,10 +200,6 @@ CONFIG_MMU=y
145# CONFIG_PCCARD is not set 200# CONFIG_PCCARD is not set
146 201
147# 202#
148# PC-card bridges
149#
150
151#
152# PCI Hotplug Support 203# PCI Hotplug Support
153# 204#
154# CONFIG_HOTPLUG_PCI is not set 205# CONFIG_HOTPLUG_PCI is not set
@@ -161,6 +212,81 @@ CONFIG_BINFMT_ELF=y
161CONFIG_TRAD_SIGNALS=y 212CONFIG_TRAD_SIGNALS=y
162 213
163# 214#
215# Networking
216#
217CONFIG_NET=y
218
219#
220# Networking options
221#
222CONFIG_PACKET=y
223CONFIG_PACKET_MMAP=y
224CONFIG_UNIX=y
225CONFIG_XFRM=y
226CONFIG_XFRM_USER=m
227CONFIG_NET_KEY=y
228CONFIG_INET=y
229CONFIG_IP_MULTICAST=y
230# CONFIG_IP_ADVANCED_ROUTER is not set
231CONFIG_IP_FIB_HASH=y
232CONFIG_IP_PNP=y
233# CONFIG_IP_PNP_DHCP is not set
234CONFIG_IP_PNP_BOOTP=y
235# CONFIG_IP_PNP_RARP is not set
236# CONFIG_NET_IPIP is not set
237# CONFIG_NET_IPGRE is not set
238# CONFIG_IP_MROUTE is not set
239# CONFIG_ARPD is not set
240# CONFIG_SYN_COOKIES is not set
241# CONFIG_INET_AH is not set
242# CONFIG_INET_ESP is not set
243# CONFIG_INET_IPCOMP is not set
244CONFIG_INET_TUNNEL=m
245CONFIG_INET_DIAG=y
246CONFIG_INET_TCP_DIAG=y
247# CONFIG_TCP_CONG_ADVANCED is not set
248CONFIG_TCP_CONG_BIC=y
249# CONFIG_IPV6 is not set
250# CONFIG_NETFILTER is not set
251
252#
253# DCCP Configuration (EXPERIMENTAL)
254#
255# CONFIG_IP_DCCP is not set
256
257#
258# SCTP Configuration (EXPERIMENTAL)
259#
260# CONFIG_IP_SCTP is not set
261# CONFIG_ATM is not set
262# CONFIG_BRIDGE is not set
263# CONFIG_VLAN_8021Q is not set
264# CONFIG_DECNET is not set
265# CONFIG_LLC2 is not set
266# CONFIG_IPX is not set
267# CONFIG_ATALK is not set
268# CONFIG_X25 is not set
269# CONFIG_LAPB is not set
270# CONFIG_NET_DIVERT is not set
271# CONFIG_ECONET is not set
272# CONFIG_WAN_ROUTER is not set
273# CONFIG_NET_SCHED is not set
274# CONFIG_NET_CLS_ROUTE is not set
275
276#
277# Network testing
278#
279# CONFIG_NET_PKTGEN is not set
280# CONFIG_HAMRADIO is not set
281# CONFIG_IRDA is not set
282# CONFIG_BT is not set
283CONFIG_IEEE80211=m
284# CONFIG_IEEE80211_DEBUG is not set
285CONFIG_IEEE80211_CRYPT_WEP=m
286CONFIG_IEEE80211_CRYPT_CCMP=m
287CONFIG_IEEE80211_CRYPT_TKIP=m
288
289#
164# Device Drivers 290# Device Drivers
165# 291#
166 292
@@ -169,7 +295,12 @@ CONFIG_TRAD_SIGNALS=y
169# 295#
170CONFIG_STANDALONE=y 296CONFIG_STANDALONE=y
171CONFIG_PREVENT_FIRMWARE_BUILD=y 297CONFIG_PREVENT_FIRMWARE_BUILD=y
172# CONFIG_FW_LOADER is not set 298CONFIG_FW_LOADER=m
299
300#
301# Connector - unified userspace <-> kernelspace linker
302#
303CONFIG_CONNECTOR=m
173 304
174# 305#
175# Memory Technology Devices (MTD) 306# Memory Technology Devices (MTD)
@@ -188,7 +319,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
188# 319#
189# Block devices 320# Block devices
190# 321#
191# CONFIG_BLK_DEV_FD is not set
192# CONFIG_BLK_CPQ_DA is not set 322# CONFIG_BLK_CPQ_DA is not set
193# CONFIG_BLK_CPQ_CISS_DA is not set 323# CONFIG_BLK_CPQ_CISS_DA is not set
194# CONFIG_BLK_DEV_DAC960 is not set 324# CONFIG_BLK_DEV_DAC960 is not set
@@ -199,11 +329,8 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
199# CONFIG_BLK_DEV_SX8 is not set 329# CONFIG_BLK_DEV_SX8 is not set
200# CONFIG_BLK_DEV_RAM is not set 330# CONFIG_BLK_DEV_RAM is not set
201CONFIG_BLK_DEV_RAM_COUNT=16 331CONFIG_BLK_DEV_RAM_COUNT=16
202CONFIG_INITRAMFS_SOURCE=""
203# CONFIG_LBD is not set 332# CONFIG_LBD is not set
204CONFIG_CDROM_PKTCDVD=m 333# CONFIG_CDROM_PKTCDVD is not set
205CONFIG_CDROM_PKTCDVD_BUFFERS=8
206# CONFIG_CDROM_PKTCDVD_WCACHE is not set
207 334
208# 335#
209# IO Schedulers 336# IO Schedulers
@@ -244,6 +371,7 @@ CONFIG_IDE_GENERIC=y
244# 371#
245# SCSI device support 372# SCSI device support
246# 373#
374# CONFIG_RAID_ATTRS is not set
247# CONFIG_SCSI is not set 375# CONFIG_SCSI is not set
248 376
249# 377#
@@ -254,6 +382,7 @@ CONFIG_IDE_GENERIC=y
254# 382#
255# Fusion MPT device support 383# Fusion MPT device support
256# 384#
385# CONFIG_FUSION is not set
257 386
258# 387#
259# IEEE 1394 (FireWire) support 388# IEEE 1394 (FireWire) support
@@ -266,79 +395,13 @@ CONFIG_IDE_GENERIC=y
266# CONFIG_I2O is not set 395# CONFIG_I2O is not set
267 396
268# 397#
269# Networking support 398# Network device support
270#
271CONFIG_NET=y
272
273#
274# Networking options
275#
276CONFIG_PACKET=y
277CONFIG_PACKET_MMAP=y
278CONFIG_NETLINK_DEV=y
279CONFIG_UNIX=y
280CONFIG_NET_KEY=y
281CONFIG_INET=y
282CONFIG_IP_MULTICAST=y
283# CONFIG_IP_ADVANCED_ROUTER is not set
284CONFIG_IP_PNP=y
285# CONFIG_IP_PNP_DHCP is not set
286CONFIG_IP_PNP_BOOTP=y
287# CONFIG_IP_PNP_RARP is not set
288# CONFIG_NET_IPIP is not set
289# CONFIG_NET_IPGRE is not set
290# CONFIG_IP_MROUTE is not set
291# CONFIG_ARPD is not set
292# CONFIG_SYN_COOKIES is not set
293# CONFIG_INET_AH is not set
294# CONFIG_INET_ESP is not set
295# CONFIG_INET_IPCOMP is not set
296CONFIG_INET_TUNNEL=m
297CONFIG_IP_TCPDIAG=m
298# CONFIG_IP_TCPDIAG_IPV6 is not set
299# CONFIG_IPV6 is not set
300# CONFIG_NETFILTER is not set
301CONFIG_XFRM=y
302CONFIG_XFRM_USER=m
303
304#
305# SCTP Configuration (EXPERIMENTAL)
306#
307# CONFIG_IP_SCTP is not set
308# CONFIG_ATM is not set
309# CONFIG_BRIDGE is not set
310# CONFIG_VLAN_8021Q is not set
311# CONFIG_DECNET is not set
312# CONFIG_LLC2 is not set
313# CONFIG_IPX is not set
314# CONFIG_ATALK is not set
315# CONFIG_X25 is not set
316# CONFIG_LAPB is not set
317# CONFIG_NET_DIVERT is not set
318# CONFIG_ECONET is not set
319# CONFIG_WAN_ROUTER is not set
320
321#
322# QoS and/or fair queueing
323#
324# CONFIG_NET_SCHED is not set
325# CONFIG_NET_CLS_ROUTE is not set
326
327#
328# Network testing
329# 399#
330# CONFIG_NET_PKTGEN is not set
331# CONFIG_NETPOLL is not set
332# CONFIG_NET_POLL_CONTROLLER is not set
333# CONFIG_HAMRADIO is not set
334# CONFIG_IRDA is not set
335# CONFIG_BT is not set
336CONFIG_NETDEVICES=y 400CONFIG_NETDEVICES=y
337# CONFIG_DUMMY is not set 401# CONFIG_DUMMY is not set
338# CONFIG_BONDING is not set 402# CONFIG_BONDING is not set
339# CONFIG_EQUALIZER is not set 403# CONFIG_EQUALIZER is not set
340# CONFIG_TUN is not set 404# CONFIG_TUN is not set
341# CONFIG_ETHERTAP is not set
342 405
343# 406#
344# ARCnet devices 407# ARCnet devices
@@ -346,10 +409,25 @@ CONFIG_NETDEVICES=y
346# CONFIG_ARCNET is not set 409# CONFIG_ARCNET is not set
347 410
348# 411#
412# PHY device support
413#
414CONFIG_PHYLIB=m
415CONFIG_PHYCONTROL=y
416
417#
418# MII PHY device drivers
419#
420CONFIG_MARVELL_PHY=m
421CONFIG_DAVICOM_PHY=m
422CONFIG_QSEMI_PHY=m
423CONFIG_LXT_PHY=m
424CONFIG_CICADA_PHY=m
425
426#
349# Ethernet (10 or 100Mbit) 427# Ethernet (10 or 100Mbit)
350# 428#
351CONFIG_NET_ETHERNET=y 429CONFIG_NET_ETHERNET=y
352# CONFIG_MII is not set 430CONFIG_MII=y
353# CONFIG_HAPPYMEAL is not set 431# CONFIG_HAPPYMEAL is not set
354# CONFIG_SUNGEM is not set 432# CONFIG_SUNGEM is not set
355# CONFIG_NET_VENDOR_3COM is not set 433# CONFIG_NET_VENDOR_3COM is not set
@@ -359,7 +437,30 @@ CONFIG_NET_ETHERNET=y
359# 437#
360# CONFIG_NET_TULIP is not set 438# CONFIG_NET_TULIP is not set
361# CONFIG_HP100 is not set 439# CONFIG_HP100 is not set
362# CONFIG_NET_PCI is not set 440CONFIG_NET_PCI=y
441# CONFIG_PCNET32 is not set
442# CONFIG_AMD8111_ETH is not set
443# CONFIG_ADAPTEC_STARFIRE is not set
444# CONFIG_B44 is not set
445# CONFIG_FORCEDETH is not set
446# CONFIG_DGRS is not set
447# CONFIG_EEPRO100 is not set
448# CONFIG_E100 is not set
449# CONFIG_FEALNX is not set
450# CONFIG_NATSEMI is not set
451# CONFIG_NE2K_PCI is not set
452# CONFIG_8139CP is not set
453CONFIG_8139TOO=y
454CONFIG_8139TOO_PIO=y
455# CONFIG_8139TOO_TUNE_TWISTER is not set
456# CONFIG_8139TOO_8129 is not set
457# CONFIG_8139_OLD_RX_RESET is not set
458# CONFIG_SIS900 is not set
459# CONFIG_EPIC100 is not set
460# CONFIG_SUNDANCE is not set
461# CONFIG_TLAN is not set
462# CONFIG_VIA_RHINE is not set
463# CONFIG_LAN_SAA9730 is not set
363 464
364# 465#
365# Ethernet (1000 Mbit) 466# Ethernet (1000 Mbit)
@@ -371,12 +472,17 @@ CONFIG_NET_ETHERNET=y
371# CONFIG_HAMACHI is not set 472# CONFIG_HAMACHI is not set
372# CONFIG_YELLOWFIN is not set 473# CONFIG_YELLOWFIN is not set
373# CONFIG_R8169 is not set 474# CONFIG_R8169 is not set
475# CONFIG_SIS190 is not set
476# CONFIG_SKGE is not set
374# CONFIG_SK98LIN is not set 477# CONFIG_SK98LIN is not set
478# CONFIG_VIA_VELOCITY is not set
375# CONFIG_TIGON3 is not set 479# CONFIG_TIGON3 is not set
480# CONFIG_BNX2 is not set
376 481
377# 482#
378# Ethernet (10000 Mbit) 483# Ethernet (10000 Mbit)
379# 484#
485# CONFIG_CHELSIO_T1 is not set
380# CONFIG_IXGB is not set 486# CONFIG_IXGB is not set
381# CONFIG_S2IO is not set 487# CONFIG_S2IO is not set
382 488
@@ -389,6 +495,8 @@ CONFIG_NET_ETHERNET=y
389# Wireless LAN (non-hamradio) 495# Wireless LAN (non-hamradio)
390# 496#
391# CONFIG_NET_RADIO is not set 497# CONFIG_NET_RADIO is not set
498# CONFIG_IPW_DEBUG is not set
499CONFIG_IPW2200=m
392 500
393# 501#
394# Wan interfaces 502# Wan interfaces
@@ -400,6 +508,8 @@ CONFIG_NET_ETHERNET=y
400# CONFIG_SLIP is not set 508# CONFIG_SLIP is not set
401# CONFIG_SHAPER is not set 509# CONFIG_SHAPER is not set
402# CONFIG_NETCONSOLE is not set 510# CONFIG_NETCONSOLE is not set
511# CONFIG_NETPOLL is not set
512# CONFIG_NET_POLL_CONTROLLER is not set
403 513
404# 514#
405# ISDN subsystem 515# ISDN subsystem
@@ -419,29 +529,13 @@ CONFIG_INPUT=y
419# 529#
420# Userland interfaces 530# Userland interfaces
421# 531#
422CONFIG_INPUT_MOUSEDEV=y 532# CONFIG_INPUT_MOUSEDEV is not set
423CONFIG_INPUT_MOUSEDEV_PSAUX=y
424CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
425CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
426# CONFIG_INPUT_JOYDEV is not set 533# CONFIG_INPUT_JOYDEV is not set
427# CONFIG_INPUT_TSDEV is not set 534# CONFIG_INPUT_TSDEV is not set
428# CONFIG_INPUT_EVDEV is not set 535# CONFIG_INPUT_EVDEV is not set
429# CONFIG_INPUT_EVBUG is not set 536# CONFIG_INPUT_EVBUG is not set
430 537
431# 538#
432# Input I/O drivers
433#
434# CONFIG_GAMEPORT is not set
435CONFIG_SOUND_GAMEPORT=y
436CONFIG_SERIO=y
437CONFIG_SERIO_I8042=y
438CONFIG_SERIO_SERPORT=y
439# CONFIG_SERIO_CT82C710 is not set
440# CONFIG_SERIO_PCIPS2 is not set
441CONFIG_SERIO_LIBPS2=m
442CONFIG_SERIO_RAW=m
443
444#
445# Input Device Drivers 539# Input Device Drivers
446# 540#
447# CONFIG_INPUT_KEYBOARD is not set 541# CONFIG_INPUT_KEYBOARD is not set
@@ -451,6 +545,12 @@ CONFIG_SERIO_RAW=m
451# CONFIG_INPUT_MISC is not set 545# CONFIG_INPUT_MISC is not set
452 546
453# 547#
548# Hardware I/O ports
549#
550# CONFIG_SERIO is not set
551# CONFIG_GAMEPORT is not set
552
553#
454# Character devices 554# Character devices
455# 555#
456CONFIG_VT=y 556CONFIG_VT=y
@@ -461,16 +561,16 @@ CONFIG_HW_CONSOLE=y
461# 561#
462# Serial drivers 562# Serial drivers
463# 563#
464CONFIG_SERIAL_8250=y 564# CONFIG_SERIAL_8250 is not set
465CONFIG_SERIAL_8250_CONSOLE=y
466CONFIG_SERIAL_8250_NR_UARTS=4
467# CONFIG_SERIAL_8250_EXTENDED is not set
468 565
469# 566#
470# Non-8250 serial port support 567# Non-8250 serial port support
471# 568#
472CONFIG_SERIAL_CORE=y 569CONFIG_SERIAL_CORE=y
473CONFIG_SERIAL_CORE_CONSOLE=y 570CONFIG_SERIAL_CORE_CONSOLE=y
571CONFIG_SERIAL_VR41XX=y
572CONFIG_SERIAL_VR41XX_CONSOLE=y
573# CONFIG_SERIAL_JSM is not set
474CONFIG_UNIX98_PTYS=y 574CONFIG_UNIX98_PTYS=y
475CONFIG_LEGACY_PTYS=y 575CONFIG_LEGACY_PTYS=y
476CONFIG_LEGACY_PTY_COUNT=256 576CONFIG_LEGACY_PTY_COUNT=256
@@ -483,19 +583,7 @@ CONFIG_LEGACY_PTY_COUNT=256
483# 583#
484# Watchdog Cards 584# Watchdog Cards
485# 585#
486CONFIG_WATCHDOG=y 586# CONFIG_WATCHDOG is not set
487# CONFIG_WATCHDOG_NOWAYOUT is not set
488
489#
490# Watchdog Device Drivers
491#
492# CONFIG_SOFT_WATCHDOG is not set
493
494#
495# PCI-based Watchdog Cards
496#
497# CONFIG_PCIPCWATCHDOG is not set
498# CONFIG_WDTPCI is not set
499# CONFIG_RTC is not set 587# CONFIG_RTC is not set
500# CONFIG_GEN_RTC is not set 588# CONFIG_GEN_RTC is not set
501# CONFIG_DTLK is not set 589# CONFIG_DTLK is not set
@@ -506,9 +594,15 @@ CONFIG_WATCHDOG=y
506# Ftape, the floppy tape device driver 594# Ftape, the floppy tape device driver
507# 595#
508# CONFIG_DRM is not set 596# CONFIG_DRM is not set
597CONFIG_GPIO_VR41XX=y
509# CONFIG_RAW_DRIVER is not set 598# CONFIG_RAW_DRIVER is not set
510 599
511# 600#
601# TPM devices
602#
603# CONFIG_TCG_TPM is not set
604
605#
512# I2C support 606# I2C support
513# 607#
514# CONFIG_I2C is not set 608# CONFIG_I2C is not set
@@ -519,10 +613,20 @@ CONFIG_WATCHDOG=y
519# CONFIG_W1 is not set 613# CONFIG_W1 is not set
520 614
521# 615#
616# Hardware Monitoring support
617#
618# CONFIG_HWMON is not set
619# CONFIG_HWMON_VID is not set
620
621#
522# Misc devices 622# Misc devices
523# 623#
524 624
525# 625#
626# Multimedia Capabilities Port drivers
627#
628
629#
526# Multimedia devices 630# Multimedia devices
527# 631#
528# CONFIG_VIDEO_DEV is not set 632# CONFIG_VIDEO_DEV is not set
@@ -542,7 +646,6 @@ CONFIG_WATCHDOG=y
542# 646#
543# CONFIG_VGA_CONSOLE is not set 647# CONFIG_VGA_CONSOLE is not set
544CONFIG_DUMMY_CONSOLE=y 648CONFIG_DUMMY_CONSOLE=y
545# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
546 649
547# 650#
548# Sound 651# Sound
@@ -552,13 +655,9 @@ CONFIG_DUMMY_CONSOLE=y
552# 655#
553# USB support 656# USB support
554# 657#
555# CONFIG_USB is not set
556CONFIG_USB_ARCH_HAS_HCD=y 658CONFIG_USB_ARCH_HAS_HCD=y
557CONFIG_USB_ARCH_HAS_OHCI=y 659CONFIG_USB_ARCH_HAS_OHCI=y
558 660# CONFIG_USB is not set
559#
560# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
561#
562 661
563# 662#
564# USB Gadget Support 663# USB Gadget Support
@@ -576,21 +675,29 @@ CONFIG_USB_ARCH_HAS_OHCI=y
576# CONFIG_INFINIBAND is not set 675# CONFIG_INFINIBAND is not set
577 676
578# 677#
678# SN Devices
679#
680
681#
579# File systems 682# File systems
580# 683#
581CONFIG_EXT2_FS=y 684CONFIG_EXT2_FS=y
582# CONFIG_EXT2_FS_XATTR is not set 685# CONFIG_EXT2_FS_XATTR is not set
686# CONFIG_EXT2_FS_XIP is not set
583# CONFIG_EXT3_FS is not set 687# CONFIG_EXT3_FS is not set
584# CONFIG_JBD is not set 688# CONFIG_JBD is not set
585# CONFIG_REISERFS_FS is not set 689# CONFIG_REISERFS_FS is not set
586# CONFIG_JFS_FS is not set 690# CONFIG_JFS_FS is not set
691# CONFIG_FS_POSIX_ACL is not set
587# CONFIG_XFS_FS is not set 692# CONFIG_XFS_FS is not set
588# CONFIG_MINIX_FS is not set 693# CONFIG_MINIX_FS is not set
589# CONFIG_ROMFS_FS is not set 694# CONFIG_ROMFS_FS is not set
695CONFIG_INOTIFY=y
590# CONFIG_QUOTA is not set 696# CONFIG_QUOTA is not set
591CONFIG_DNOTIFY=y 697CONFIG_DNOTIFY=y
592CONFIG_AUTOFS_FS=y 698CONFIG_AUTOFS_FS=y
593CONFIG_AUTOFS4_FS=y 699CONFIG_AUTOFS4_FS=y
700CONFIG_FUSE_FS=m
594 701
595# 702#
596# CD-ROM/DVD Filesystems 703# CD-ROM/DVD Filesystems
@@ -611,12 +718,10 @@ CONFIG_AUTOFS4_FS=y
611CONFIG_PROC_FS=y 718CONFIG_PROC_FS=y
612CONFIG_PROC_KCORE=y 719CONFIG_PROC_KCORE=y
613CONFIG_SYSFS=y 720CONFIG_SYSFS=y
614# CONFIG_DEVFS_FS is not set
615CONFIG_DEVPTS_FS_XATTR=y
616CONFIG_DEVPTS_FS_SECURITY=y
617# CONFIG_TMPFS is not set 721# CONFIG_TMPFS is not set
618# CONFIG_HUGETLB_PAGE is not set 722# CONFIG_HUGETLB_PAGE is not set
619CONFIG_RAMFS=y 723CONFIG_RAMFS=y
724CONFIG_RELAYFS_FS=m
620 725
621# 726#
622# Miscellaneous filesystems 727# Miscellaneous filesystems
@@ -648,6 +753,7 @@ CONFIG_NFSD=y
648CONFIG_ROOT_NFS=y 753CONFIG_ROOT_NFS=y
649CONFIG_LOCKD=y 754CONFIG_LOCKD=y
650CONFIG_EXPORTFS=y 755CONFIG_EXPORTFS=y
756CONFIG_NFS_COMMON=y
651CONFIG_SUNRPC=y 757CONFIG_SUNRPC=y
652# CONFIG_RPCSEC_GSS_KRB5 is not set 758# CONFIG_RPCSEC_GSS_KRB5 is not set
653# CONFIG_RPCSEC_GSS_SPKM3 is not set 759# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -656,6 +762,7 @@ CONFIG_SUNRPC=y
656# CONFIG_NCP_FS is not set 762# CONFIG_NCP_FS is not set
657# CONFIG_CODA_FS is not set 763# CONFIG_CODA_FS is not set
658# CONFIG_AFS_FS is not set 764# CONFIG_AFS_FS is not set
765# CONFIG_9P_FS is not set
659 766
660# 767#
661# Partition Types 768# Partition Types
@@ -676,9 +783,11 @@ CONFIG_MSDOS_PARTITION=y
676# 783#
677# Kernel hacking 784# Kernel hacking
678# 785#
786# CONFIG_PRINTK_TIME is not set
679# CONFIG_DEBUG_KERNEL is not set 787# CONFIG_DEBUG_KERNEL is not set
788CONFIG_LOG_BUF_SHIFT=14
680CONFIG_CROSSCOMPILE=y 789CONFIG_CROSSCOMPILE=y
681CONFIG_CMDLINE="" 790CONFIG_CMDLINE="mem=32M console=ttyVR0,38400"
682 791
683# 792#
684# Security options 793# Security options
@@ -690,7 +799,31 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
690# 799#
691# Cryptographic options 800# Cryptographic options
692# 801#
693# CONFIG_CRYPTO is not set 802CONFIG_CRYPTO=y
803CONFIG_CRYPTO_HMAC=y
804CONFIG_CRYPTO_NULL=m
805CONFIG_CRYPTO_MD4=m
806CONFIG_CRYPTO_MD5=m
807CONFIG_CRYPTO_SHA1=m
808CONFIG_CRYPTO_SHA256=m
809CONFIG_CRYPTO_SHA512=m
810CONFIG_CRYPTO_WP512=m
811CONFIG_CRYPTO_TGR192=m
812CONFIG_CRYPTO_DES=m
813CONFIG_CRYPTO_BLOWFISH=m
814CONFIG_CRYPTO_TWOFISH=m
815CONFIG_CRYPTO_SERPENT=m
816CONFIG_CRYPTO_AES=m
817CONFIG_CRYPTO_CAST5=m
818CONFIG_CRYPTO_CAST6=m
819CONFIG_CRYPTO_TEA=m
820CONFIG_CRYPTO_ARC4=m
821CONFIG_CRYPTO_KHAZAD=m
822CONFIG_CRYPTO_ANUBIS=m
823CONFIG_CRYPTO_DEFLATE=m
824CONFIG_CRYPTO_MICHAEL_MIC=m
825CONFIG_CRYPTO_CRC32C=m
826# CONFIG_CRYPTO_TEST is not set
694 827
695# 828#
696# Hardware crypto devices 829# Hardware crypto devices
@@ -700,7 +833,8 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
700# Library routines 833# Library routines
701# 834#
702# CONFIG_CRC_CCITT is not set 835# CONFIG_CRC_CCITT is not set
703# CONFIG_CRC32 is not set 836CONFIG_CRC16=m
837CONFIG_CRC32=y
704CONFIG_LIBCRC32C=m 838CONFIG_LIBCRC32C=m
705CONFIG_GENERIC_HARDIRQS=y 839CONFIG_ZLIB_INFLATE=m
706CONFIG_GENERIC_IRQ_PROBE=y 840CONFIG_ZLIB_DEFLATE=m
diff --git a/arch/mips/configs/cobalt_defconfig b/arch/mips/configs/cobalt_defconfig
index 4302c6f914f5..4b4d1ddb3d42 100644
--- a/arch/mips/configs/cobalt_defconfig
+++ b/arch/mips/configs/cobalt_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:00 2005 4# Thu Oct 20 22:25:23 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,24 +11,29 @@ CONFIG_32BIT=y
14CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
25# CONFIG_BSD_PROCESS_ACCT is not set 24# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y 25CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set 26# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14
29CONFIG_HOTPLUG=y 27CONFIG_HOTPLUG=y
30CONFIG_KOBJECT_UEVENT=y 28CONFIG_KOBJECT_UEVENT=y
31# CONFIG_IKCONFIG is not set 29# CONFIG_IKCONFIG is not set
30CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y 31CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y 32CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_EXTRA_PASS is not set 33# CONFIG_KALLSYMS_EXTRA_PASS is not set
34CONFIG_PRINTK=y
35CONFIG_BUG=y
36CONFIG_BASE_FULL=y
35CONFIG_FUTEX=y 37CONFIG_FUTEX=y
36CONFIG_EPOLL=y 38CONFIG_EPOLL=y
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -41,6 +43,7 @@ CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0 43CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0 44CONFIG_CC_ALIGN_JUMPS=0
43# CONFIG_TINY_SHMEM is not set 45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
44 47
45# 48#
46# Loadable module support 49# Loadable module support
@@ -50,41 +53,69 @@ CONFIG_CC_ALIGN_JUMPS=0
50# 53#
51# Machine selection 54# Machine selection
52# 55#
53# CONFIG_MACH_JAZZ is not set 56# CONFIG_MIPS_MTX1 is not set
54# CONFIG_MACH_VR41XX is not set 57# CONFIG_MIPS_BOSPORUS is not set
55# CONFIG_TOSHIBA_JMR3927 is not set 58# CONFIG_MIPS_PB1000 is not set
59# CONFIG_MIPS_PB1100 is not set
60# CONFIG_MIPS_PB1500 is not set
61# CONFIG_MIPS_PB1550 is not set
62# CONFIG_MIPS_PB1200 is not set
63# CONFIG_MIPS_DB1000 is not set
64# CONFIG_MIPS_DB1100 is not set
65# CONFIG_MIPS_DB1500 is not set
66# CONFIG_MIPS_DB1550 is not set
67# CONFIG_MIPS_DB1200 is not set
68# CONFIG_MIPS_MIRAGE is not set
56CONFIG_MIPS_COBALT=y 69CONFIG_MIPS_COBALT=y
57# CONFIG_MACH_DECSTATION is not set 70# CONFIG_MACH_DECSTATION is not set
58# CONFIG_MIPS_EV64120 is not set 71# CONFIG_MIPS_EV64120 is not set
59# CONFIG_MIPS_EV96100 is not set 72# CONFIG_MIPS_EV96100 is not set
60# CONFIG_MIPS_IVR is not set 73# CONFIG_MIPS_IVR is not set
61# CONFIG_LASAT is not set
62# CONFIG_MIPS_ITE8172 is not set 74# CONFIG_MIPS_ITE8172 is not set
75# CONFIG_MACH_JAZZ is not set
76# CONFIG_LASAT is not set
63# CONFIG_MIPS_ATLAS is not set 77# CONFIG_MIPS_ATLAS is not set
64# CONFIG_MIPS_MALTA is not set 78# CONFIG_MIPS_MALTA is not set
65# CONFIG_MIPS_SEAD is not set 79# CONFIG_MIPS_SEAD is not set
80# CONFIG_MIPS_SIM is not set
81# CONFIG_MOMENCO_JAGUAR_ATX is not set
66# CONFIG_MOMENCO_OCELOT is not set 82# CONFIG_MOMENCO_OCELOT is not set
67# CONFIG_MOMENCO_OCELOT_G is not set
68# CONFIG_MOMENCO_OCELOT_C is not set
69# CONFIG_MOMENCO_OCELOT_3 is not set 83# CONFIG_MOMENCO_OCELOT_3 is not set
70# CONFIG_MOMENCO_JAGUAR_ATX is not set 84# CONFIG_MOMENCO_OCELOT_C is not set
71# CONFIG_PMC_YOSEMITE is not set 85# CONFIG_MOMENCO_OCELOT_G is not set
86# CONFIG_MIPS_XXS1500 is not set
87# CONFIG_PNX8550_V2PCI is not set
88# CONFIG_PNX8550_JBS is not set
72# CONFIG_DDB5074 is not set 89# CONFIG_DDB5074 is not set
73# CONFIG_DDB5476 is not set 90# CONFIG_DDB5476 is not set
74# CONFIG_DDB5477 is not set 91# CONFIG_DDB5477 is not set
75# CONFIG_NEC_OSPREY is not set 92# CONFIG_MACH_VR41XX is not set
93# CONFIG_PMC_YOSEMITE is not set
94# CONFIG_QEMU is not set
76# CONFIG_SGI_IP22 is not set 95# CONFIG_SGI_IP22 is not set
77# CONFIG_SOC_AU1X00 is not set 96# CONFIG_SGI_IP27 is not set
78# CONFIG_SIBYTE_SB1xxx_SOC is not set 97# CONFIG_SGI_IP32 is not set
98# CONFIG_SIBYTE_BIGSUR is not set
99# CONFIG_SIBYTE_SWARM is not set
100# CONFIG_SIBYTE_SENTOSA is not set
101# CONFIG_SIBYTE_RHONE is not set
102# CONFIG_SIBYTE_CARMEL is not set
103# CONFIG_SIBYTE_PTSWARM is not set
104# CONFIG_SIBYTE_LITTLESUR is not set
105# CONFIG_SIBYTE_CRHINE is not set
106# CONFIG_SIBYTE_CRHONE is not set
79# CONFIG_SNI_RM200_PCI is not set 107# CONFIG_SNI_RM200_PCI is not set
108# CONFIG_TOSHIBA_JMR3927 is not set
80# CONFIG_TOSHIBA_RBTX4927 is not set 109# CONFIG_TOSHIBA_RBTX4927 is not set
110# CONFIG_TOSHIBA_RBTX4938 is not set
81CONFIG_RWSEM_GENERIC_SPINLOCK=y 111CONFIG_RWSEM_GENERIC_SPINLOCK=y
82CONFIG_GENERIC_CALIBRATE_DELAY=y 112CONFIG_GENERIC_CALIBRATE_DELAY=y
83CONFIG_HAVE_DEC_LOCK=y
84CONFIG_DMA_NONCOHERENT=y 113CONFIG_DMA_NONCOHERENT=y
85CONFIG_DMA_NEED_PCI_MAP_STATE=y 114CONFIG_DMA_NEED_PCI_MAP_STATE=y
86CONFIG_I8259=y 115CONFIG_I8259=y
116# CONFIG_CPU_BIG_ENDIAN is not set
87CONFIG_CPU_LITTLE_ENDIAN=y 117CONFIG_CPU_LITTLE_ENDIAN=y
118CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
88CONFIG_IRQ_CPU=y 119CONFIG_IRQ_CPU=y
89CONFIG_MIPS_GT64111=y 120CONFIG_MIPS_GT64111=y
90CONFIG_MIPS_L1_CACHE_SHIFT=5 121CONFIG_MIPS_L1_CACHE_SHIFT=5
@@ -92,8 +123,10 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
92# 123#
93# CPU selection 124# CPU selection
94# 125#
95# CONFIG_CPU_MIPS32 is not set 126# CONFIG_CPU_MIPS32_R1 is not set
96# CONFIG_CPU_MIPS64 is not set 127# CONFIG_CPU_MIPS32_R2 is not set
128# CONFIG_CPU_MIPS64_R1 is not set
129# CONFIG_CPU_MIPS64_R2 is not set
97# CONFIG_CPU_R3000 is not set 130# CONFIG_CPU_R3000 is not set
98# CONFIG_CPU_TX39XX is not set 131# CONFIG_CPU_TX39XX is not set
99# CONFIG_CPU_VR41XX is not set 132# CONFIG_CPU_VR41XX is not set
@@ -109,14 +142,38 @@ CONFIG_CPU_NEVADA=y
109# CONFIG_CPU_RM7000 is not set 142# CONFIG_CPU_RM7000 is not set
110# CONFIG_CPU_RM9000 is not set 143# CONFIG_CPU_RM9000 is not set
111# CONFIG_CPU_SB1 is not set 144# CONFIG_CPU_SB1 is not set
145CONFIG_SYS_HAS_CPU_NEVADA=y
146CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
147CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
148CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
149CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
150
151#
152# Kernel type
153#
154CONFIG_32BIT=y
155# CONFIG_64BIT is not set
112CONFIG_PAGE_SIZE_4KB=y 156CONFIG_PAGE_SIZE_4KB=y
113# CONFIG_PAGE_SIZE_8KB is not set 157# CONFIG_PAGE_SIZE_8KB is not set
114# CONFIG_PAGE_SIZE_16KB is not set 158# CONFIG_PAGE_SIZE_16KB is not set
115# CONFIG_PAGE_SIZE_64KB is not set 159# CONFIG_PAGE_SIZE_64KB is not set
160# CONFIG_MIPS_MT is not set
116# CONFIG_CPU_ADVANCED is not set 161# CONFIG_CPU_ADVANCED is not set
117CONFIG_CPU_HAS_LLSC=y 162CONFIG_CPU_HAS_LLSC=y
118CONFIG_CPU_HAS_LLDSCD=y 163CONFIG_CPU_HAS_LLDSCD=y
119CONFIG_CPU_HAS_SYNC=y 164CONFIG_CPU_HAS_SYNC=y
165CONFIG_GENERIC_HARDIRQS=y
166CONFIG_GENERIC_IRQ_PROBE=y
167CONFIG_ARCH_FLATMEM_ENABLE=y
168CONFIG_SELECT_MEMORY_MODEL=y
169CONFIG_FLATMEM_MANUAL=y
170# CONFIG_DISCONTIGMEM_MANUAL is not set
171# CONFIG_SPARSEMEM_MANUAL is not set
172CONFIG_FLATMEM=y
173CONFIG_FLAT_NODE_MEM_MAP=y
174# CONFIG_SPARSEMEM_STATIC is not set
175CONFIG_PREEMPT_NONE=y
176# CONFIG_PREEMPT_VOLUNTARY is not set
120# CONFIG_PREEMPT is not set 177# CONFIG_PREEMPT is not set
121 178
122# 179#
@@ -125,7 +182,6 @@ CONFIG_CPU_HAS_SYNC=y
125CONFIG_HW_HAS_PCI=y 182CONFIG_HW_HAS_PCI=y
126CONFIG_PCI=y 183CONFIG_PCI=y
127CONFIG_PCI_LEGACY_PROC=y 184CONFIG_PCI_LEGACY_PROC=y
128CONFIG_PCI_NAMES=y
129CONFIG_MMU=y 185CONFIG_MMU=y
130 186
131# 187#
@@ -134,10 +190,6 @@ CONFIG_MMU=y
134# CONFIG_PCCARD is not set 190# CONFIG_PCCARD is not set
135 191
136# 192#
137# PC-card bridges
138#
139
140#
141# PCI Hotplug Support 193# PCI Hotplug Support
142# 194#
143# CONFIG_HOTPLUG_PCI is not set 195# CONFIG_HOTPLUG_PCI is not set
@@ -150,6 +202,77 @@ CONFIG_BINFMT_ELF=y
150CONFIG_TRAD_SIGNALS=y 202CONFIG_TRAD_SIGNALS=y
151 203
152# 204#
205# Networking
206#
207CONFIG_NET=y
208
209#
210# Networking options
211#
212CONFIG_PACKET=y
213# CONFIG_PACKET_MMAP is not set
214CONFIG_UNIX=y
215CONFIG_XFRM=y
216CONFIG_XFRM_USER=y
217CONFIG_NET_KEY=y
218CONFIG_INET=y
219# CONFIG_IP_MULTICAST is not set
220# CONFIG_IP_ADVANCED_ROUTER is not set
221CONFIG_IP_FIB_HASH=y
222# CONFIG_IP_PNP is not set
223# CONFIG_NET_IPIP is not set
224# CONFIG_NET_IPGRE is not set
225# CONFIG_ARPD is not set
226# CONFIG_SYN_COOKIES is not set
227# CONFIG_INET_AH is not set
228# CONFIG_INET_ESP is not set
229# CONFIG_INET_IPCOMP is not set
230CONFIG_INET_TUNNEL=y
231CONFIG_INET_DIAG=y
232CONFIG_INET_TCP_DIAG=y
233# CONFIG_TCP_CONG_ADVANCED is not set
234CONFIG_TCP_CONG_BIC=y
235# CONFIG_IPV6 is not set
236# CONFIG_NETFILTER is not set
237
238#
239# DCCP Configuration (EXPERIMENTAL)
240#
241# CONFIG_IP_DCCP is not set
242
243#
244# SCTP Configuration (EXPERIMENTAL)
245#
246# CONFIG_IP_SCTP is not set
247# CONFIG_ATM is not set
248# CONFIG_BRIDGE is not set
249# CONFIG_VLAN_8021Q is not set
250# CONFIG_DECNET is not set
251# CONFIG_LLC2 is not set
252# CONFIG_IPX is not set
253# CONFIG_ATALK is not set
254# CONFIG_X25 is not set
255# CONFIG_LAPB is not set
256# CONFIG_NET_DIVERT is not set
257# CONFIG_ECONET is not set
258# CONFIG_WAN_ROUTER is not set
259# CONFIG_NET_SCHED is not set
260# CONFIG_NET_CLS_ROUTE is not set
261
262#
263# Network testing
264#
265# CONFIG_NET_PKTGEN is not set
266# CONFIG_HAMRADIO is not set
267# CONFIG_IRDA is not set
268# CONFIG_BT is not set
269CONFIG_IEEE80211=y
270# CONFIG_IEEE80211_DEBUG is not set
271CONFIG_IEEE80211_CRYPT_WEP=y
272CONFIG_IEEE80211_CRYPT_CCMP=y
273CONFIG_IEEE80211_CRYPT_TKIP=y
274
275#
153# Device Drivers 276# Device Drivers
154# 277#
155 278
@@ -161,6 +284,11 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
161CONFIG_FW_LOADER=y 284CONFIG_FW_LOADER=y
162 285
163# 286#
287# Connector - unified userspace <-> kernelspace linker
288#
289CONFIG_CONNECTOR=y
290
291#
164# Memory Technology Devices (MTD) 292# Memory Technology Devices (MTD)
165# 293#
166# CONFIG_MTD is not set 294# CONFIG_MTD is not set
@@ -177,7 +305,6 @@ CONFIG_FW_LOADER=y
177# 305#
178# Block devices 306# Block devices
179# 307#
180# CONFIG_BLK_DEV_FD is not set
181# CONFIG_BLK_CPQ_DA is not set 308# CONFIG_BLK_CPQ_DA is not set
182# CONFIG_BLK_CPQ_CISS_DA is not set 309# CONFIG_BLK_CPQ_CISS_DA is not set
183# CONFIG_BLK_DEV_DAC960 is not set 310# CONFIG_BLK_DEV_DAC960 is not set
@@ -189,7 +316,6 @@ CONFIG_BLK_DEV_LOOP=y
189# CONFIG_BLK_DEV_SX8 is not set 316# CONFIG_BLK_DEV_SX8 is not set
190# CONFIG_BLK_DEV_RAM is not set 317# CONFIG_BLK_DEV_RAM is not set
191CONFIG_BLK_DEV_RAM_COUNT=16 318CONFIG_BLK_DEV_RAM_COUNT=16
192CONFIG_INITRAMFS_SOURCE=""
193# CONFIG_LBD is not set 319# CONFIG_LBD is not set
194CONFIG_CDROM_PKTCDVD=y 320CONFIG_CDROM_PKTCDVD=y
195CONFIG_CDROM_PKTCDVD_BUFFERS=8 321CONFIG_CDROM_PKTCDVD_BUFFERS=8
@@ -234,6 +360,7 @@ CONFIG_IDE_GENERIC=y
234# 360#
235# SCSI device support 361# SCSI device support
236# 362#
363CONFIG_RAID_ATTRS=y
237# CONFIG_SCSI is not set 364# CONFIG_SCSI is not set
238 365
239# 366#
@@ -244,6 +371,7 @@ CONFIG_IDE_GENERIC=y
244# 371#
245# Fusion MPT device support 372# Fusion MPT device support
246# 373#
374# CONFIG_FUSION is not set
247 375
248# 376#
249# IEEE 1394 (FireWire) support 377# IEEE 1394 (FireWire) support
@@ -256,75 +384,13 @@ CONFIG_IDE_GENERIC=y
256# CONFIG_I2O is not set 384# CONFIG_I2O is not set
257 385
258# 386#
259# Networking support 387# Network device support
260#
261CONFIG_NET=y
262
263#
264# Networking options
265#
266CONFIG_PACKET=y
267# CONFIG_PACKET_MMAP is not set
268CONFIG_NETLINK_DEV=y
269CONFIG_UNIX=y
270CONFIG_NET_KEY=y
271CONFIG_INET=y
272# CONFIG_IP_MULTICAST is not set
273# CONFIG_IP_ADVANCED_ROUTER is not set
274# CONFIG_IP_PNP is not set
275# CONFIG_NET_IPIP is not set
276# CONFIG_NET_IPGRE is not set
277# CONFIG_ARPD is not set
278# CONFIG_SYN_COOKIES is not set
279# CONFIG_INET_AH is not set
280# CONFIG_INET_ESP is not set
281# CONFIG_INET_IPCOMP is not set
282CONFIG_INET_TUNNEL=y
283CONFIG_IP_TCPDIAG=y
284# CONFIG_IP_TCPDIAG_IPV6 is not set
285# CONFIG_IPV6 is not set
286# CONFIG_NETFILTER is not set
287CONFIG_XFRM=y
288CONFIG_XFRM_USER=y
289
290#
291# SCTP Configuration (EXPERIMENTAL)
292#
293# CONFIG_IP_SCTP is not set
294# CONFIG_ATM is not set
295# CONFIG_BRIDGE is not set
296# CONFIG_VLAN_8021Q is not set
297# CONFIG_DECNET is not set
298# CONFIG_LLC2 is not set
299# CONFIG_IPX is not set
300# CONFIG_ATALK is not set
301# CONFIG_X25 is not set
302# CONFIG_LAPB is not set
303# CONFIG_NET_DIVERT is not set
304# CONFIG_ECONET is not set
305# CONFIG_WAN_ROUTER is not set
306
307#
308# QoS and/or fair queueing
309#
310# CONFIG_NET_SCHED is not set
311# CONFIG_NET_CLS_ROUTE is not set
312
313#
314# Network testing
315# 388#
316# CONFIG_NET_PKTGEN is not set
317# CONFIG_NETPOLL is not set
318# CONFIG_NET_POLL_CONTROLLER is not set
319# CONFIG_HAMRADIO is not set
320# CONFIG_IRDA is not set
321# CONFIG_BT is not set
322CONFIG_NETDEVICES=y 389CONFIG_NETDEVICES=y
323# CONFIG_DUMMY is not set 390# CONFIG_DUMMY is not set
324# CONFIG_BONDING is not set 391# CONFIG_BONDING is not set
325# CONFIG_EQUALIZER is not set 392# CONFIG_EQUALIZER is not set
326# CONFIG_TUN is not set 393# CONFIG_TUN is not set
327# CONFIG_ETHERTAP is not set
328 394
329# 395#
330# ARCnet devices 396# ARCnet devices
@@ -332,6 +398,21 @@ CONFIG_NETDEVICES=y
332# CONFIG_ARCNET is not set 398# CONFIG_ARCNET is not set
333 399
334# 400#
401# PHY device support
402#
403CONFIG_PHYLIB=y
404CONFIG_PHYCONTROL=y
405
406#
407# MII PHY device drivers
408#
409CONFIG_MARVELL_PHY=y
410CONFIG_DAVICOM_PHY=y
411CONFIG_QSEMI_PHY=y
412CONFIG_LXT_PHY=y
413CONFIG_CICADA_PHY=y
414
415#
335# Ethernet (10 or 100Mbit) 416# Ethernet (10 or 100Mbit)
336# 417#
337CONFIG_NET_ETHERNET=y 418CONFIG_NET_ETHERNET=y
@@ -357,12 +438,16 @@ CONFIG_NET_ETHERNET=y
357# CONFIG_HAMACHI is not set 438# CONFIG_HAMACHI is not set
358# CONFIG_YELLOWFIN is not set 439# CONFIG_YELLOWFIN is not set
359# CONFIG_R8169 is not set 440# CONFIG_R8169 is not set
441# CONFIG_SIS190 is not set
442# CONFIG_SKGE is not set
360# CONFIG_SK98LIN is not set 443# CONFIG_SK98LIN is not set
361# CONFIG_TIGON3 is not set 444# CONFIG_TIGON3 is not set
445# CONFIG_BNX2 is not set
362 446
363# 447#
364# Ethernet (10000 Mbit) 448# Ethernet (10000 Mbit)
365# 449#
450# CONFIG_CHELSIO_T1 is not set
366# CONFIG_IXGB is not set 451# CONFIG_IXGB is not set
367# CONFIG_S2IO is not set 452# CONFIG_S2IO is not set
368 453
@@ -375,6 +460,8 @@ CONFIG_NET_ETHERNET=y
375# Wireless LAN (non-hamradio) 460# Wireless LAN (non-hamradio)
376# 461#
377# CONFIG_NET_RADIO is not set 462# CONFIG_NET_RADIO is not set
463# CONFIG_IPW_DEBUG is not set
464CONFIG_IPW2200=y
378 465
379# 466#
380# Wan interfaces 467# Wan interfaces
@@ -386,6 +473,8 @@ CONFIG_NET_ETHERNET=y
386# CONFIG_SLIP is not set 473# CONFIG_SLIP is not set
387# CONFIG_SHAPER is not set 474# CONFIG_SHAPER is not set
388# CONFIG_NETCONSOLE is not set 475# CONFIG_NETCONSOLE is not set
476# CONFIG_NETPOLL is not set
477# CONFIG_NET_POLL_CONTROLLER is not set
389 478
390# 479#
391# ISDN subsystem 480# ISDN subsystem
@@ -415,19 +504,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
415# CONFIG_INPUT_EVBUG is not set 504# CONFIG_INPUT_EVBUG is not set
416 505
417# 506#
418# Input I/O drivers
419#
420# CONFIG_GAMEPORT is not set
421CONFIG_SOUND_GAMEPORT=y
422CONFIG_SERIO=y
423# CONFIG_SERIO_I8042 is not set
424CONFIG_SERIO_SERPORT=y
425# CONFIG_SERIO_CT82C710 is not set
426# CONFIG_SERIO_PCIPS2 is not set
427# CONFIG_SERIO_LIBPS2 is not set
428CONFIG_SERIO_RAW=y
429
430#
431# Input Device Drivers 507# Input Device Drivers
432# 508#
433# CONFIG_INPUT_KEYBOARD is not set 509# CONFIG_INPUT_KEYBOARD is not set
@@ -437,6 +513,17 @@ CONFIG_SERIO_RAW=y
437# CONFIG_INPUT_MISC is not set 513# CONFIG_INPUT_MISC is not set
438 514
439# 515#
516# Hardware I/O ports
517#
518CONFIG_SERIO=y
519# CONFIG_SERIO_I8042 is not set
520CONFIG_SERIO_SERPORT=y
521# CONFIG_SERIO_PCIPS2 is not set
522# CONFIG_SERIO_LIBPS2 is not set
523CONFIG_SERIO_RAW=y
524# CONFIG_GAMEPORT is not set
525
526#
440# Character devices 527# Character devices
441# 528#
442CONFIG_VT=y 529CONFIG_VT=y
@@ -457,6 +544,7 @@ CONFIG_SERIAL_8250_NR_UARTS=4
457# 544#
458CONFIG_SERIAL_CORE=y 545CONFIG_SERIAL_CORE=y
459CONFIG_SERIAL_CORE_CONSOLE=y 546CONFIG_SERIAL_CORE_CONSOLE=y
547# CONFIG_SERIAL_JSM is not set
460CONFIG_UNIX98_PTYS=y 548CONFIG_UNIX98_PTYS=y
461CONFIG_LEGACY_PTYS=y 549CONFIG_LEGACY_PTYS=y
462CONFIG_LEGACY_PTY_COUNT=256 550CONFIG_LEGACY_PTY_COUNT=256
@@ -483,6 +571,11 @@ CONFIG_COBALT_LCD=y
483# CONFIG_RAW_DRIVER is not set 571# CONFIG_RAW_DRIVER is not set
484 572
485# 573#
574# TPM devices
575#
576# CONFIG_TCG_TPM is not set
577
578#
486# I2C support 579# I2C support
487# 580#
488# CONFIG_I2C is not set 581# CONFIG_I2C is not set
@@ -493,10 +586,20 @@ CONFIG_COBALT_LCD=y
493# CONFIG_W1 is not set 586# CONFIG_W1 is not set
494 587
495# 588#
589# Hardware Monitoring support
590#
591# CONFIG_HWMON is not set
592# CONFIG_HWMON_VID is not set
593
594#
496# Misc devices 595# Misc devices
497# 596#
498 597
499# 598#
599# Multimedia Capabilities Port drivers
600#
601
602#
500# Multimedia devices 603# Multimedia devices
501# 604#
502# CONFIG_VIDEO_DEV is not set 605# CONFIG_VIDEO_DEV is not set
@@ -516,7 +619,6 @@ CONFIG_COBALT_LCD=y
516# 619#
517# CONFIG_VGA_CONSOLE is not set 620# CONFIG_VGA_CONSOLE is not set
518CONFIG_DUMMY_CONSOLE=y 621CONFIG_DUMMY_CONSOLE=y
519# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
520 622
521# 623#
522# Sound 624# Sound
@@ -526,13 +628,9 @@ CONFIG_DUMMY_CONSOLE=y
526# 628#
527# USB support 629# USB support
528# 630#
529# CONFIG_USB is not set
530CONFIG_USB_ARCH_HAS_HCD=y 631CONFIG_USB_ARCH_HAS_HCD=y
531CONFIG_USB_ARCH_HAS_OHCI=y 632CONFIG_USB_ARCH_HAS_OHCI=y
532 633# CONFIG_USB is not set
533#
534# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
535#
536 634
537# 635#
538# USB Gadget Support 636# USB Gadget Support
@@ -550,12 +648,17 @@ CONFIG_USB_ARCH_HAS_OHCI=y
550# CONFIG_INFINIBAND is not set 648# CONFIG_INFINIBAND is not set
551 649
552# 650#
651# SN Devices
652#
653
654#
553# File systems 655# File systems
554# 656#
555CONFIG_EXT2_FS=y 657CONFIG_EXT2_FS=y
556CONFIG_EXT2_FS_XATTR=y 658CONFIG_EXT2_FS_XATTR=y
557CONFIG_EXT2_FS_POSIX_ACL=y 659CONFIG_EXT2_FS_POSIX_ACL=y
558CONFIG_EXT2_FS_SECURITY=y 660CONFIG_EXT2_FS_SECURITY=y
661# CONFIG_EXT2_FS_XIP is not set
559# CONFIG_EXT3_FS is not set 662# CONFIG_EXT3_FS is not set
560# CONFIG_JBD is not set 663# CONFIG_JBD is not set
561CONFIG_FS_MBCACHE=y 664CONFIG_FS_MBCACHE=y
@@ -565,10 +668,12 @@ CONFIG_FS_POSIX_ACL=y
565# CONFIG_XFS_FS is not set 668# CONFIG_XFS_FS is not set
566# CONFIG_MINIX_FS is not set 669# CONFIG_MINIX_FS is not set
567# CONFIG_ROMFS_FS is not set 670# CONFIG_ROMFS_FS is not set
671CONFIG_INOTIFY=y
568# CONFIG_QUOTA is not set 672# CONFIG_QUOTA is not set
569CONFIG_DNOTIFY=y 673CONFIG_DNOTIFY=y
570# CONFIG_AUTOFS_FS is not set 674# CONFIG_AUTOFS_FS is not set
571# CONFIG_AUTOFS4_FS is not set 675# CONFIG_AUTOFS4_FS is not set
676CONFIG_FUSE_FS=y
572 677
573# 678#
574# CD-ROM/DVD Filesystems 679# CD-ROM/DVD Filesystems
@@ -589,12 +694,10 @@ CONFIG_DNOTIFY=y
589CONFIG_PROC_FS=y 694CONFIG_PROC_FS=y
590CONFIG_PROC_KCORE=y 695CONFIG_PROC_KCORE=y
591CONFIG_SYSFS=y 696CONFIG_SYSFS=y
592# CONFIG_DEVFS_FS is not set
593CONFIG_DEVPTS_FS_XATTR=y
594CONFIG_DEVPTS_FS_SECURITY=y
595# CONFIG_TMPFS is not set 697# CONFIG_TMPFS is not set
596# CONFIG_HUGETLB_PAGE is not set 698# CONFIG_HUGETLB_PAGE is not set
597CONFIG_RAMFS=y 699CONFIG_RAMFS=y
700CONFIG_RELAYFS_FS=y
598 701
599# 702#
600# Miscellaneous filesystems 703# Miscellaneous filesystems
@@ -622,7 +725,7 @@ CONFIG_NFS_FS=y
622# CONFIG_NFS_DIRECTIO is not set 725# CONFIG_NFS_DIRECTIO is not set
623# CONFIG_NFSD is not set 726# CONFIG_NFSD is not set
624CONFIG_LOCKD=y 727CONFIG_LOCKD=y
625# CONFIG_EXPORTFS is not set 728CONFIG_NFS_COMMON=y
626CONFIG_SUNRPC=y 729CONFIG_SUNRPC=y
627# CONFIG_RPCSEC_GSS_KRB5 is not set 730# CONFIG_RPCSEC_GSS_KRB5 is not set
628# CONFIG_RPCSEC_GSS_SPKM3 is not set 731# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -631,6 +734,7 @@ CONFIG_SUNRPC=y
631# CONFIG_NCP_FS is not set 734# CONFIG_NCP_FS is not set
632# CONFIG_CODA_FS is not set 735# CONFIG_CODA_FS is not set
633# CONFIG_AFS_FS is not set 736# CONFIG_AFS_FS is not set
737# CONFIG_9P_FS is not set
634 738
635# 739#
636# Partition Types 740# Partition Types
@@ -651,7 +755,9 @@ CONFIG_MSDOS_PARTITION=y
651# 755#
652# Kernel hacking 756# Kernel hacking
653# 757#
758# CONFIG_PRINTK_TIME is not set
654# CONFIG_DEBUG_KERNEL is not set 759# CONFIG_DEBUG_KERNEL is not set
760CONFIG_LOG_BUF_SHIFT=14
655CONFIG_CROSSCOMPILE=y 761CONFIG_CROSSCOMPILE=y
656CONFIG_CMDLINE="" 762CONFIG_CMDLINE=""
657 763
@@ -665,7 +771,31 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
665# 771#
666# Cryptographic options 772# Cryptographic options
667# 773#
668# CONFIG_CRYPTO is not set 774CONFIG_CRYPTO=y
775CONFIG_CRYPTO_HMAC=y
776CONFIG_CRYPTO_NULL=y
777CONFIG_CRYPTO_MD4=y
778CONFIG_CRYPTO_MD5=y
779CONFIG_CRYPTO_SHA1=y
780CONFIG_CRYPTO_SHA256=y
781CONFIG_CRYPTO_SHA512=y
782CONFIG_CRYPTO_WP512=y
783CONFIG_CRYPTO_TGR192=y
784CONFIG_CRYPTO_DES=y
785CONFIG_CRYPTO_BLOWFISH=y
786CONFIG_CRYPTO_TWOFISH=y
787CONFIG_CRYPTO_SERPENT=y
788CONFIG_CRYPTO_AES=y
789CONFIG_CRYPTO_CAST5=y
790CONFIG_CRYPTO_CAST6=y
791CONFIG_CRYPTO_TEA=y
792CONFIG_CRYPTO_ARC4=y
793CONFIG_CRYPTO_KHAZAD=y
794CONFIG_CRYPTO_ANUBIS=y
795CONFIG_CRYPTO_DEFLATE=y
796CONFIG_CRYPTO_MICHAEL_MIC=y
797CONFIG_CRYPTO_CRC32C=y
798# CONFIG_CRYPTO_TEST is not set
669 799
670# 800#
671# Hardware crypto devices 801# Hardware crypto devices
@@ -675,7 +805,8 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
675# Library routines 805# Library routines
676# 806#
677# CONFIG_CRC_CCITT is not set 807# CONFIG_CRC_CCITT is not set
678# CONFIG_CRC32 is not set 808CONFIG_CRC16=y
679# CONFIG_LIBCRC32C is not set 809CONFIG_CRC32=y
680CONFIG_GENERIC_HARDIRQS=y 810CONFIG_LIBCRC32C=y
681CONFIG_GENERIC_IRQ_PROBE=y 811CONFIG_ZLIB_INFLATE=y
812CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/mips/configs/db1000_defconfig b/arch/mips/configs/db1000_defconfig
index 962fc14b58c2..6501144ec612 100644
--- a/arch/mips/configs/db1000_defconfig
+++ b/arch/mips/configs/db1000_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:01 2005 4# Thu Oct 20 22:25:26 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,24 +11,29 @@ CONFIG_32BIT=y
14CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
25# CONFIG_BSD_PROCESS_ACCT is not set 24# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y 25CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set 26# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14
29CONFIG_HOTPLUG=y 27CONFIG_HOTPLUG=y
30CONFIG_KOBJECT_UEVENT=y 28CONFIG_KOBJECT_UEVENT=y
31# CONFIG_IKCONFIG is not set 29# CONFIG_IKCONFIG is not set
30CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y 31CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y 32CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_EXTRA_PASS is not set 33# CONFIG_KALLSYMS_EXTRA_PASS is not set
34CONFIG_PRINTK=y
35CONFIG_BUG=y
36CONFIG_BASE_FULL=y
35CONFIG_FUTEX=y 37CONFIG_FUTEX=y
36CONFIG_EPOLL=y 38CONFIG_EPOLL=y
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -41,6 +43,7 @@ CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0 43CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0 44CONFIG_CC_ALIGN_JUMPS=0
43# CONFIG_TINY_SHMEM is not set 45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
44 47
45# 48#
46# Loadable module support 49# Loadable module support
@@ -56,63 +59,79 @@ CONFIG_KMOD=y
56# 59#
57# Machine selection 60# Machine selection
58# 61#
59# CONFIG_MACH_JAZZ is not set 62# CONFIG_MIPS_MTX1 is not set
60# CONFIG_MACH_VR41XX is not set 63# CONFIG_MIPS_BOSPORUS is not set
61# CONFIG_TOSHIBA_JMR3927 is not set 64# CONFIG_MIPS_PB1000 is not set
65# CONFIG_MIPS_PB1100 is not set
66# CONFIG_MIPS_PB1500 is not set
67# CONFIG_MIPS_PB1550 is not set
68# CONFIG_MIPS_PB1200 is not set
69CONFIG_MIPS_DB1000=y
70# CONFIG_MIPS_DB1100 is not set
71# CONFIG_MIPS_DB1500 is not set
72# CONFIG_MIPS_DB1550 is not set
73# CONFIG_MIPS_DB1200 is not set
74# CONFIG_MIPS_MIRAGE is not set
62# CONFIG_MIPS_COBALT is not set 75# CONFIG_MIPS_COBALT is not set
63# CONFIG_MACH_DECSTATION is not set 76# CONFIG_MACH_DECSTATION is not set
64# CONFIG_MIPS_EV64120 is not set 77# CONFIG_MIPS_EV64120 is not set
65# CONFIG_MIPS_EV96100 is not set 78# CONFIG_MIPS_EV96100 is not set
66# CONFIG_MIPS_IVR is not set 79# CONFIG_MIPS_IVR is not set
67# CONFIG_LASAT is not set
68# CONFIG_MIPS_ITE8172 is not set 80# CONFIG_MIPS_ITE8172 is not set
81# CONFIG_MACH_JAZZ is not set
82# CONFIG_LASAT is not set
69# CONFIG_MIPS_ATLAS is not set 83# CONFIG_MIPS_ATLAS is not set
70# CONFIG_MIPS_MALTA is not set 84# CONFIG_MIPS_MALTA is not set
71# CONFIG_MIPS_SEAD is not set 85# CONFIG_MIPS_SEAD is not set
86# CONFIG_MIPS_SIM is not set
87# CONFIG_MOMENCO_JAGUAR_ATX is not set
72# CONFIG_MOMENCO_OCELOT is not set 88# CONFIG_MOMENCO_OCELOT is not set
73# CONFIG_MOMENCO_OCELOT_G is not set
74# CONFIG_MOMENCO_OCELOT_C is not set
75# CONFIG_MOMENCO_OCELOT_3 is not set 89# CONFIG_MOMENCO_OCELOT_3 is not set
76# CONFIG_MOMENCO_JAGUAR_ATX is not set 90# CONFIG_MOMENCO_OCELOT_C is not set
77# CONFIG_PMC_YOSEMITE is not set 91# CONFIG_MOMENCO_OCELOT_G is not set
92# CONFIG_MIPS_XXS1500 is not set
93# CONFIG_PNX8550_V2PCI is not set
94# CONFIG_PNX8550_JBS is not set
78# CONFIG_DDB5074 is not set 95# CONFIG_DDB5074 is not set
79# CONFIG_DDB5476 is not set 96# CONFIG_DDB5476 is not set
80# CONFIG_DDB5477 is not set 97# CONFIG_DDB5477 is not set
81# CONFIG_NEC_OSPREY is not set 98# CONFIG_MACH_VR41XX is not set
99# CONFIG_PMC_YOSEMITE is not set
100# CONFIG_QEMU is not set
82# CONFIG_SGI_IP22 is not set 101# CONFIG_SGI_IP22 is not set
83CONFIG_SOC_AU1X00=y 102# CONFIG_SGI_IP27 is not set
84CONFIG_SOC_AU1000=y 103# CONFIG_SGI_IP32 is not set
85# CONFIG_SOC_AU1100 is not set 104# CONFIG_SIBYTE_BIGSUR is not set
86# CONFIG_SOC_AU1500 is not set 105# CONFIG_SIBYTE_SWARM is not set
87# CONFIG_SOC_AU1550 is not set 106# CONFIG_SIBYTE_SENTOSA is not set
88# CONFIG_MIPS_PB1000 is not set 107# CONFIG_SIBYTE_RHONE is not set
89# CONFIG_MIPS_PB1100 is not set 108# CONFIG_SIBYTE_CARMEL is not set
90# CONFIG_MIPS_PB1500 is not set 109# CONFIG_SIBYTE_PTSWARM is not set
91# CONFIG_MIPS_PB1550 is not set 110# CONFIG_SIBYTE_LITTLESUR is not set
92CONFIG_MIPS_DB1000=y 111# CONFIG_SIBYTE_CRHINE is not set
93# CONFIG_MIPS_DB1100 is not set 112# CONFIG_SIBYTE_CRHONE is not set
94# CONFIG_MIPS_DB1500 is not set
95# CONFIG_MIPS_DB1550 is not set
96# CONFIG_MIPS_BOSPORUS is not set
97# CONFIG_MIPS_MIRAGE is not set
98# CONFIG_MIPS_XXS1500 is not set
99# CONFIG_MIPS_MTX1 is not set
100# CONFIG_SIBYTE_SB1xxx_SOC is not set
101# CONFIG_SNI_RM200_PCI is not set 113# CONFIG_SNI_RM200_PCI is not set
114# CONFIG_TOSHIBA_JMR3927 is not set
102# CONFIG_TOSHIBA_RBTX4927 is not set 115# CONFIG_TOSHIBA_RBTX4927 is not set
116# CONFIG_TOSHIBA_RBTX4938 is not set
103CONFIG_RWSEM_GENERIC_SPINLOCK=y 117CONFIG_RWSEM_GENERIC_SPINLOCK=y
104CONFIG_GENERIC_CALIBRATE_DELAY=y 118CONFIG_GENERIC_CALIBRATE_DELAY=y
105CONFIG_HAVE_DEC_LOCK=y
106CONFIG_DMA_NONCOHERENT=y 119CONFIG_DMA_NONCOHERENT=y
107CONFIG_DMA_NEED_PCI_MAP_STATE=y 120CONFIG_DMA_NEED_PCI_MAP_STATE=y
121# CONFIG_CPU_BIG_ENDIAN is not set
108CONFIG_CPU_LITTLE_ENDIAN=y 122CONFIG_CPU_LITTLE_ENDIAN=y
123CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
124CONFIG_SOC_AU1000=y
125CONFIG_SOC_AU1X00=y
109CONFIG_MIPS_L1_CACHE_SHIFT=5 126CONFIG_MIPS_L1_CACHE_SHIFT=5
110 127
111# 128#
112# CPU selection 129# CPU selection
113# 130#
114CONFIG_CPU_MIPS32=y 131CONFIG_CPU_MIPS32_R1=y
115# CONFIG_CPU_MIPS64 is not set 132# CONFIG_CPU_MIPS32_R2 is not set
133# CONFIG_CPU_MIPS64_R1 is not set
134# CONFIG_CPU_MIPS64_R2 is not set
116# CONFIG_CPU_R3000 is not set 135# CONFIG_CPU_R3000 is not set
117# CONFIG_CPU_TX39XX is not set 136# CONFIG_CPU_TX39XX is not set
118# CONFIG_CPU_VR41XX is not set 137# CONFIG_CPU_VR41XX is not set
@@ -128,15 +147,39 @@ CONFIG_CPU_MIPS32=y
128# CONFIG_CPU_RM7000 is not set 147# CONFIG_CPU_RM7000 is not set
129# CONFIG_CPU_RM9000 is not set 148# CONFIG_CPU_RM9000 is not set
130# CONFIG_CPU_SB1 is not set 149# CONFIG_CPU_SB1 is not set
150CONFIG_SYS_HAS_CPU_MIPS32_R1=y
151CONFIG_CPU_MIPS32=y
152CONFIG_CPU_MIPSR1=y
153CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
154CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
155
156#
157# Kernel type
158#
159CONFIG_32BIT=y
160# CONFIG_64BIT is not set
131CONFIG_PAGE_SIZE_4KB=y 161CONFIG_PAGE_SIZE_4KB=y
132# CONFIG_PAGE_SIZE_8KB is not set 162# CONFIG_PAGE_SIZE_8KB is not set
133# CONFIG_PAGE_SIZE_16KB is not set 163# CONFIG_PAGE_SIZE_16KB is not set
134# CONFIG_PAGE_SIZE_64KB is not set 164# CONFIG_PAGE_SIZE_64KB is not set
135CONFIG_CPU_HAS_PREFETCH=y 165CONFIG_CPU_HAS_PREFETCH=y
166# CONFIG_MIPS_MT is not set
136CONFIG_64BIT_PHYS_ADDR=y 167CONFIG_64BIT_PHYS_ADDR=y
137# CONFIG_CPU_ADVANCED is not set 168# CONFIG_CPU_ADVANCED is not set
138CONFIG_CPU_HAS_LLSC=y 169CONFIG_CPU_HAS_LLSC=y
139CONFIG_CPU_HAS_SYNC=y 170CONFIG_CPU_HAS_SYNC=y
171CONFIG_GENERIC_HARDIRQS=y
172CONFIG_GENERIC_IRQ_PROBE=y
173CONFIG_ARCH_FLATMEM_ENABLE=y
174CONFIG_SELECT_MEMORY_MODEL=y
175CONFIG_FLATMEM_MANUAL=y
176# CONFIG_DISCONTIGMEM_MANUAL is not set
177# CONFIG_SPARSEMEM_MANUAL is not set
178CONFIG_FLATMEM=y
179CONFIG_FLAT_NODE_MEM_MAP=y
180# CONFIG_SPARSEMEM_STATIC is not set
181CONFIG_PREEMPT_NONE=y
182# CONFIG_PREEMPT_VOLUNTARY is not set
140# CONFIG_PREEMPT is not set 183# CONFIG_PREEMPT is not set
141 184
142# 185#
@@ -152,6 +195,8 @@ CONFIG_MMU=y
152CONFIG_PCCARD=m 195CONFIG_PCCARD=m
153# CONFIG_PCMCIA_DEBUG is not set 196# CONFIG_PCMCIA_DEBUG is not set
154CONFIG_PCMCIA=m 197CONFIG_PCMCIA=m
198CONFIG_PCMCIA_LOAD_CIS=y
199CONFIG_PCMCIA_IOCTL=y
155 200
156# 201#
157# PC-card bridges 202# PC-card bridges
@@ -169,6 +214,100 @@ CONFIG_PCMCIA=m
169CONFIG_BINFMT_ELF=y 214CONFIG_BINFMT_ELF=y
170# CONFIG_BINFMT_MISC is not set 215# CONFIG_BINFMT_MISC is not set
171CONFIG_TRAD_SIGNALS=y 216CONFIG_TRAD_SIGNALS=y
217# CONFIG_PM is not set
218
219#
220# Networking
221#
222CONFIG_NET=y
223
224#
225# Networking options
226#
227CONFIG_PACKET=y
228# CONFIG_PACKET_MMAP is not set
229CONFIG_UNIX=y
230CONFIG_XFRM=y
231CONFIG_XFRM_USER=m
232CONFIG_NET_KEY=y
233CONFIG_INET=y
234CONFIG_IP_MULTICAST=y
235# CONFIG_IP_ADVANCED_ROUTER is not set
236CONFIG_IP_FIB_HASH=y
237CONFIG_IP_PNP=y
238# CONFIG_IP_PNP_DHCP is not set
239CONFIG_IP_PNP_BOOTP=y
240# CONFIG_IP_PNP_RARP is not set
241# CONFIG_NET_IPIP is not set
242# CONFIG_NET_IPGRE is not set
243# CONFIG_IP_MROUTE 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
249CONFIG_INET_TUNNEL=m
250CONFIG_INET_DIAG=y
251CONFIG_INET_TCP_DIAG=y
252# CONFIG_TCP_CONG_ADVANCED is not set
253CONFIG_TCP_CONG_BIC=y
254
255#
256# IP: Virtual Server Configuration
257#
258# CONFIG_IP_VS is not set
259# CONFIG_IPV6 is not set
260CONFIG_NETFILTER=y
261# CONFIG_NETFILTER_DEBUG is not set
262CONFIG_NETFILTER_NETLINK=m
263CONFIG_NETFILTER_NETLINK_QUEUE=m
264CONFIG_NETFILTER_NETLINK_LOG=m
265
266#
267# IP: Netfilter Configuration
268#
269# CONFIG_IP_NF_CONNTRACK is not set
270CONFIG_IP_NF_PPTP=m
271# CONFIG_IP_NF_QUEUE is not set
272# CONFIG_IP_NF_IPTABLES is not set
273# CONFIG_IP_NF_ARPTABLES is not set
274
275#
276# DCCP Configuration (EXPERIMENTAL)
277#
278# CONFIG_IP_DCCP is not set
279
280#
281# SCTP Configuration (EXPERIMENTAL)
282#
283# CONFIG_IP_SCTP is not set
284# CONFIG_ATM is not set
285# CONFIG_BRIDGE is not set
286# CONFIG_VLAN_8021Q is not set
287# CONFIG_DECNET is not set
288# CONFIG_LLC2 is not set
289# CONFIG_IPX is not set
290# CONFIG_ATALK is not set
291# CONFIG_X25 is not set
292# CONFIG_LAPB is not set
293# CONFIG_NET_DIVERT is not set
294# CONFIG_ECONET is not set
295# CONFIG_WAN_ROUTER is not set
296# CONFIG_NET_SCHED is not set
297# CONFIG_NET_CLS_ROUTE is not set
298
299#
300# Network testing
301#
302# CONFIG_NET_PKTGEN is not set
303# CONFIG_HAMRADIO is not set
304# CONFIG_IRDA is not set
305# CONFIG_BT is not set
306CONFIG_IEEE80211=m
307# CONFIG_IEEE80211_DEBUG is not set
308CONFIG_IEEE80211_CRYPT_WEP=m
309CONFIG_IEEE80211_CRYPT_CCMP=m
310CONFIG_IEEE80211_CRYPT_TKIP=m
172 311
173# 312#
174# Device Drivers 313# Device Drivers
@@ -179,12 +318,86 @@ CONFIG_TRAD_SIGNALS=y
179# 318#
180CONFIG_STANDALONE=y 319CONFIG_STANDALONE=y
181CONFIG_PREVENT_FIRMWARE_BUILD=y 320CONFIG_PREVENT_FIRMWARE_BUILD=y
182# CONFIG_FW_LOADER is not set 321CONFIG_FW_LOADER=m
322
323#
324# Connector - unified userspace <-> kernelspace linker
325#
326CONFIG_CONNECTOR=m
183 327
184# 328#
185# Memory Technology Devices (MTD) 329# Memory Technology Devices (MTD)
186# 330#
187# CONFIG_MTD is not set 331CONFIG_MTD=y
332# CONFIG_MTD_DEBUG is not set
333# CONFIG_MTD_CONCAT is not set
334CONFIG_MTD_PARTITIONS=y
335# CONFIG_MTD_REDBOOT_PARTS is not set
336# CONFIG_MTD_CMDLINE_PARTS is not set
337
338#
339# User Modules And Translation Layers
340#
341CONFIG_MTD_CHAR=y
342CONFIG_MTD_BLOCK=y
343# CONFIG_FTL is not set
344# CONFIG_NFTL is not set
345# CONFIG_INFTL is not set
346
347#
348# RAM/ROM/Flash chip drivers
349#
350CONFIG_MTD_CFI=y
351# CONFIG_MTD_JEDECPROBE is not set
352CONFIG_MTD_GEN_PROBE=y
353# CONFIG_MTD_CFI_ADV_OPTIONS is not set
354CONFIG_MTD_MAP_BANK_WIDTH_1=y
355CONFIG_MTD_MAP_BANK_WIDTH_2=y
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
360CONFIG_MTD_CFI_I1=y
361CONFIG_MTD_CFI_I2=y
362# CONFIG_MTD_CFI_I4 is not set
363# CONFIG_MTD_CFI_I8 is not set
364# CONFIG_MTD_CFI_INTELEXT is not set
365CONFIG_MTD_CFI_AMDSTD=y
366CONFIG_MTD_CFI_AMDSTD_RETRY=0
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_ALCHEMY=y
379# CONFIG_MTD_PLATRAM is not set
380
381#
382# Self-contained MTD device drivers
383#
384# CONFIG_MTD_SLRAM is not set
385# CONFIG_MTD_PHRAM is not set
386# CONFIG_MTD_MTDRAM is not set
387# CONFIG_MTD_BLKMTD is not set
388# CONFIG_MTD_BLOCK2MTD is not set
389
390#
391# Disk-On-Chip Device Drivers
392#
393# CONFIG_MTD_DOC2000 is not set
394# CONFIG_MTD_DOC2001 is not set
395# CONFIG_MTD_DOC2001PLUS is not set
396
397#
398# NAND Flash Device Drivers
399#
400# CONFIG_MTD_NAND is not set
188 401
189# 402#
190# Parallel port support 403# Parallel port support
@@ -198,14 +411,12 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
198# 411#
199# Block devices 412# Block devices
200# 413#
201# CONFIG_BLK_DEV_FD is not set
202# CONFIG_BLK_DEV_COW_COMMON is not set 414# CONFIG_BLK_DEV_COW_COMMON is not set
203CONFIG_BLK_DEV_LOOP=y 415CONFIG_BLK_DEV_LOOP=y
204# CONFIG_BLK_DEV_CRYPTOLOOP is not set 416# CONFIG_BLK_DEV_CRYPTOLOOP is not set
205# CONFIG_BLK_DEV_NBD is not set 417# CONFIG_BLK_DEV_NBD is not set
206# CONFIG_BLK_DEV_RAM is not set 418# CONFIG_BLK_DEV_RAM is not set
207CONFIG_BLK_DEV_RAM_COUNT=16 419CONFIG_BLK_DEV_RAM_COUNT=16
208CONFIG_INITRAMFS_SOURCE=""
209# CONFIG_LBD is not set 420# CONFIG_LBD is not set
210CONFIG_CDROM_PKTCDVD=m 421CONFIG_CDROM_PKTCDVD=m
211CONFIG_CDROM_PKTCDVD_BUFFERS=8 422CONFIG_CDROM_PKTCDVD_BUFFERS=8
@@ -228,6 +439,7 @@ CONFIG_ATA_OVER_ETH=m
228# 439#
229# SCSI device support 440# SCSI device support
230# 441#
442CONFIG_RAID_ATTRS=m
231# CONFIG_SCSI is not set 443# CONFIG_SCSI is not set
232 444
233# 445#
@@ -238,6 +450,7 @@ CONFIG_ATA_OVER_ETH=m
238# 450#
239# Fusion MPT device support 451# Fusion MPT device support
240# 452#
453# CONFIG_FUSION is not set
241 454
242# 455#
243# IEEE 1394 (FireWire) support 456# IEEE 1394 (FireWire) support
@@ -248,94 +461,28 @@ CONFIG_ATA_OVER_ETH=m
248# 461#
249 462
250# 463#
251# Networking support 464# Network device support
252#
253CONFIG_NET=y
254
255#
256# Networking options
257#
258CONFIG_PACKET=y
259# CONFIG_PACKET_MMAP is not set
260CONFIG_NETLINK_DEV=y
261CONFIG_UNIX=y
262CONFIG_NET_KEY=y
263CONFIG_INET=y
264CONFIG_IP_MULTICAST=y
265# CONFIG_IP_ADVANCED_ROUTER is not set
266CONFIG_IP_PNP=y
267# CONFIG_IP_PNP_DHCP is not set
268CONFIG_IP_PNP_BOOTP=y
269# CONFIG_IP_PNP_RARP is not set
270# CONFIG_NET_IPIP is not set
271# CONFIG_NET_IPGRE is not set
272# CONFIG_IP_MROUTE is not set
273# CONFIG_ARPD is not set
274# CONFIG_SYN_COOKIES is not set
275# CONFIG_INET_AH is not set
276# CONFIG_INET_ESP is not set
277# CONFIG_INET_IPCOMP is not set
278CONFIG_INET_TUNNEL=m
279CONFIG_IP_TCPDIAG=m
280# CONFIG_IP_TCPDIAG_IPV6 is not set
281
282#
283# IP: Virtual Server Configuration
284#
285# CONFIG_IP_VS is not set
286# CONFIG_IPV6 is not set
287CONFIG_NETFILTER=y
288# CONFIG_NETFILTER_DEBUG is not set
289
290#
291# IP: Netfilter Configuration
292# 465#
293# CONFIG_IP_NF_CONNTRACK is not set 466CONFIG_NETDEVICES=y
294CONFIG_IP_NF_CONNTRACK_MARK=y 467# CONFIG_DUMMY is not set
295# CONFIG_IP_NF_QUEUE is not set 468# CONFIG_BONDING is not set
296# CONFIG_IP_NF_IPTABLES is not set 469# CONFIG_EQUALIZER is not set
297# CONFIG_IP_NF_ARPTABLES is not set 470# CONFIG_TUN is not set
298CONFIG_XFRM=y
299CONFIG_XFRM_USER=m
300
301#
302# SCTP Configuration (EXPERIMENTAL)
303#
304# CONFIG_IP_SCTP is not set
305# CONFIG_ATM is not set
306# CONFIG_BRIDGE is not set
307# CONFIG_VLAN_8021Q is not set
308# CONFIG_DECNET is not set
309# CONFIG_LLC2 is not set
310# CONFIG_IPX is not set
311# CONFIG_ATALK is not set
312# CONFIG_X25 is not set
313# CONFIG_LAPB is not set
314# CONFIG_NET_DIVERT is not set
315# CONFIG_ECONET is not set
316# CONFIG_WAN_ROUTER is not set
317 471
318# 472#
319# QoS and/or fair queueing 473# PHY device support
320# 474#
321# CONFIG_NET_SCHED is not set 475CONFIG_PHYLIB=m
322# CONFIG_NET_CLS_ROUTE is not set 476CONFIG_PHYCONTROL=y
323 477
324# 478#
325# Network testing 479# MII PHY device drivers
326# 480#
327# CONFIG_NET_PKTGEN is not set 481CONFIG_MARVELL_PHY=m
328# CONFIG_NETPOLL is not set 482CONFIG_DAVICOM_PHY=m
329# CONFIG_NET_POLL_CONTROLLER is not set 483CONFIG_QSEMI_PHY=m
330# CONFIG_HAMRADIO is not set 484CONFIG_LXT_PHY=m
331# CONFIG_IRDA is not set 485CONFIG_CICADA_PHY=m
332# CONFIG_BT is not set
333CONFIG_NETDEVICES=y
334# CONFIG_DUMMY is not set
335# CONFIG_BONDING is not set
336# CONFIG_EQUALIZER is not set
337# CONFIG_TUN is not set
338# CONFIG_ETHERTAP is not set
339 486
340# 487#
341# Ethernet (10 or 100Mbit) 488# Ethernet (10 or 100Mbit)
@@ -389,6 +536,8 @@ CONFIG_PPPOE=m
389# CONFIG_SLIP is not set 536# CONFIG_SLIP is not set
390# CONFIG_SHAPER is not set 537# CONFIG_SHAPER is not set
391# CONFIG_NETCONSOLE is not set 538# CONFIG_NETCONSOLE is not set
539# CONFIG_NETPOLL is not set
540# CONFIG_NET_POLL_CONTROLLER is not set
392 541
393# 542#
394# ISDN subsystem 543# ISDN subsystem
@@ -418,18 +567,6 @@ CONFIG_INPUT_EVDEV=y
418# CONFIG_INPUT_EVBUG is not set 567# CONFIG_INPUT_EVBUG is not set
419 568
420# 569#
421# Input I/O drivers
422#
423# CONFIG_GAMEPORT is not set
424CONFIG_SOUND_GAMEPORT=y
425CONFIG_SERIO=y
426# CONFIG_SERIO_I8042 is not set
427CONFIG_SERIO_SERPORT=y
428# CONFIG_SERIO_CT82C710 is not set
429# CONFIG_SERIO_LIBPS2 is not set
430CONFIG_SERIO_RAW=m
431
432#
433# Input Device Drivers 570# Input Device Drivers
434# 571#
435# CONFIG_INPUT_KEYBOARD is not set 572# CONFIG_INPUT_KEYBOARD is not set
@@ -439,6 +576,16 @@ CONFIG_SERIO_RAW=m
439# CONFIG_INPUT_MISC is not set 576# CONFIG_INPUT_MISC is not set
440 577
441# 578#
579# Hardware I/O ports
580#
581CONFIG_SERIO=y
582# CONFIG_SERIO_I8042 is not set
583CONFIG_SERIO_SERPORT=y
584# CONFIG_SERIO_LIBPS2 is not set
585CONFIG_SERIO_RAW=m
586# CONFIG_GAMEPORT is not set
587
588#
442# Character devices 589# Character devices
443# 590#
444CONFIG_VT=y 591CONFIG_VT=y
@@ -473,14 +620,14 @@ CONFIG_LEGACY_PTY_COUNT=256
473# Watchdog Cards 620# Watchdog Cards
474# 621#
475# CONFIG_WATCHDOG is not set 622# CONFIG_WATCHDOG is not set
476CONFIG_RTC=y 623# CONFIG_RTC is not set
624# CONFIG_GEN_RTC is not set
477# CONFIG_DTLK is not set 625# CONFIG_DTLK is not set
478# CONFIG_R3964 is not set 626# CONFIG_R3964 is not set
479 627
480# 628#
481# Ftape, the floppy tape device driver 629# Ftape, the floppy tape device driver
482# 630#
483# CONFIG_DRM is not set
484 631
485# 632#
486# PCMCIA character devices 633# PCMCIA character devices
@@ -489,6 +636,10 @@ CONFIG_SYNCLINK_CS=m
489# CONFIG_RAW_DRIVER is not set 636# CONFIG_RAW_DRIVER is not set
490 637
491# 638#
639# TPM devices
640#
641
642#
492# I2C support 643# I2C support
493# 644#
494# CONFIG_I2C is not set 645# CONFIG_I2C is not set
@@ -499,10 +650,20 @@ CONFIG_SYNCLINK_CS=m
499# CONFIG_W1 is not set 650# CONFIG_W1 is not set
500 651
501# 652#
653# Hardware Monitoring support
654#
655# CONFIG_HWMON is not set
656# CONFIG_HWMON_VID is not set
657
658#
502# Misc devices 659# Misc devices
503# 660#
504 661
505# 662#
663# Multimedia Capabilities Port drivers
664#
665
666#
506# Multimedia devices 667# Multimedia devices
507# 668#
508# CONFIG_VIDEO_DEV is not set 669# CONFIG_VIDEO_DEV is not set
@@ -522,7 +683,6 @@ CONFIG_SYNCLINK_CS=m
522# 683#
523# CONFIG_VGA_CONSOLE is not set 684# CONFIG_VGA_CONSOLE is not set
524CONFIG_DUMMY_CONSOLE=y 685CONFIG_DUMMY_CONSOLE=y
525# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
526 686
527# 687#
528# Sound 688# Sound
@@ -532,12 +692,9 @@ CONFIG_DUMMY_CONSOLE=y
532# 692#
533# USB support 693# USB support
534# 694#
535# CONFIG_USB_ARCH_HAS_HCD is not set 695CONFIG_USB_ARCH_HAS_HCD=y
536# CONFIG_USB_ARCH_HAS_OHCI is not set 696CONFIG_USB_ARCH_HAS_OHCI=y
537 697# CONFIG_USB is not set
538#
539# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
540#
541 698
542# 699#
543# USB Gadget Support 700# USB Gadget Support
@@ -552,7 +709,10 @@ CONFIG_DUMMY_CONSOLE=y
552# 709#
553# InfiniBand support 710# InfiniBand support
554# 711#
555# CONFIG_INFINIBAND is not set 712
713#
714# SN Devices
715#
556 716
557# 717#
558# File systems 718# File systems
@@ -561,6 +721,7 @@ CONFIG_EXT2_FS=y
561CONFIG_EXT2_FS_XATTR=y 721CONFIG_EXT2_FS_XATTR=y
562CONFIG_EXT2_FS_POSIX_ACL=y 722CONFIG_EXT2_FS_POSIX_ACL=y
563# CONFIG_EXT2_FS_SECURITY is not set 723# CONFIG_EXT2_FS_SECURITY is not set
724# CONFIG_EXT2_FS_XIP is not set
564CONFIG_EXT3_FS=y 725CONFIG_EXT3_FS=y
565CONFIG_EXT3_FS_XATTR=y 726CONFIG_EXT3_FS_XATTR=y
566CONFIG_EXT3_FS_POSIX_ACL=y 727CONFIG_EXT3_FS_POSIX_ACL=y
@@ -579,10 +740,12 @@ CONFIG_FS_POSIX_ACL=y
579# CONFIG_XFS_FS is not set 740# CONFIG_XFS_FS is not set
580# CONFIG_MINIX_FS is not set 741# CONFIG_MINIX_FS is not set
581# CONFIG_ROMFS_FS is not set 742# CONFIG_ROMFS_FS is not set
743CONFIG_INOTIFY=y
582# CONFIG_QUOTA is not set 744# CONFIG_QUOTA is not set
583CONFIG_DNOTIFY=y 745CONFIG_DNOTIFY=y
584CONFIG_AUTOFS_FS=m 746CONFIG_AUTOFS_FS=m
585CONFIG_AUTOFS4_FS=m 747CONFIG_AUTOFS4_FS=m
748CONFIG_FUSE_FS=m
586 749
587# 750#
588# CD-ROM/DVD Filesystems 751# CD-ROM/DVD Filesystems
@@ -603,13 +766,10 @@ CONFIG_AUTOFS4_FS=m
603CONFIG_PROC_FS=y 766CONFIG_PROC_FS=y
604CONFIG_PROC_KCORE=y 767CONFIG_PROC_KCORE=y
605CONFIG_SYSFS=y 768CONFIG_SYSFS=y
606# CONFIG_DEVFS_FS is not set
607CONFIG_DEVPTS_FS_XATTR=y
608CONFIG_DEVPTS_FS_SECURITY=y
609CONFIG_TMPFS=y 769CONFIG_TMPFS=y
610# CONFIG_TMPFS_XATTR is not set
611# CONFIG_HUGETLB_PAGE is not set 770# CONFIG_HUGETLB_PAGE is not set
612CONFIG_RAMFS=y 771CONFIG_RAMFS=y
772CONFIG_RELAYFS_FS=m
613 773
614# 774#
615# Miscellaneous filesystems 775# Miscellaneous filesystems
@@ -621,6 +781,8 @@ CONFIG_RAMFS=y
621# CONFIG_BEFS_FS is not set 781# CONFIG_BEFS_FS is not set
622# CONFIG_BFS_FS is not set 782# CONFIG_BFS_FS is not set
623# CONFIG_EFS_FS is not set 783# CONFIG_EFS_FS is not set
784# CONFIG_JFFS_FS is not set
785# CONFIG_JFFS2_FS is not set
624CONFIG_CRAMFS=m 786CONFIG_CRAMFS=m
625# CONFIG_VXFS_FS is not set 787# CONFIG_VXFS_FS is not set
626# CONFIG_HPFS_FS is not set 788# CONFIG_HPFS_FS is not set
@@ -641,6 +803,7 @@ CONFIG_NFSD=m
641CONFIG_ROOT_NFS=y 803CONFIG_ROOT_NFS=y
642CONFIG_LOCKD=y 804CONFIG_LOCKD=y
643CONFIG_EXPORTFS=m 805CONFIG_EXPORTFS=m
806CONFIG_NFS_COMMON=y
644CONFIG_SUNRPC=y 807CONFIG_SUNRPC=y
645# CONFIG_RPCSEC_GSS_KRB5 is not set 808# CONFIG_RPCSEC_GSS_KRB5 is not set
646# CONFIG_RPCSEC_GSS_SPKM3 is not set 809# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -650,6 +813,7 @@ CONFIG_SMB_FS=m
650# CONFIG_NCP_FS is not set 813# CONFIG_NCP_FS is not set
651# CONFIG_CODA_FS is not set 814# CONFIG_CODA_FS is not set
652# CONFIG_AFS_FS is not set 815# CONFIG_AFS_FS is not set
816# CONFIG_9P_FS is not set
653 817
654# 818#
655# Partition Types 819# Partition Types
@@ -709,7 +873,9 @@ CONFIG_NLS_DEFAULT="iso8859-1"
709# 873#
710# Kernel hacking 874# Kernel hacking
711# 875#
876# CONFIG_PRINTK_TIME is not set
712# CONFIG_DEBUG_KERNEL is not set 877# CONFIG_DEBUG_KERNEL is not set
878CONFIG_LOG_BUF_SHIFT=14
713CONFIG_CROSSCOMPILE=y 879CONFIG_CROSSCOMPILE=y
714CONFIG_CMDLINE="" 880CONFIG_CMDLINE=""
715 881
@@ -725,26 +891,27 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
725# 891#
726CONFIG_CRYPTO=y 892CONFIG_CRYPTO=y
727CONFIG_CRYPTO_HMAC=y 893CONFIG_CRYPTO_HMAC=y
728CONFIG_CRYPTO_NULL=y 894CONFIG_CRYPTO_NULL=m
729# CONFIG_CRYPTO_MD4 is not set 895CONFIG_CRYPTO_MD4=m
730# CONFIG_CRYPTO_MD5 is not set 896CONFIG_CRYPTO_MD5=m
731# CONFIG_CRYPTO_SHA1 is not set 897CONFIG_CRYPTO_SHA1=m
732# CONFIG_CRYPTO_SHA256 is not set 898CONFIG_CRYPTO_SHA256=m
733CONFIG_CRYPTO_SHA512=y 899CONFIG_CRYPTO_SHA512=m
734CONFIG_CRYPTO_WP512=m 900CONFIG_CRYPTO_WP512=m
735# CONFIG_CRYPTO_DES is not set 901CONFIG_CRYPTO_TGR192=m
736# CONFIG_CRYPTO_BLOWFISH is not set 902CONFIG_CRYPTO_DES=m
737CONFIG_CRYPTO_TWOFISH=y 903CONFIG_CRYPTO_BLOWFISH=m
738# CONFIG_CRYPTO_SERPENT is not set 904CONFIG_CRYPTO_TWOFISH=m
905CONFIG_CRYPTO_SERPENT=m
739CONFIG_CRYPTO_AES=m 906CONFIG_CRYPTO_AES=m
740# CONFIG_CRYPTO_CAST5 is not set 907CONFIG_CRYPTO_CAST5=m
741# CONFIG_CRYPTO_CAST6 is not set 908CONFIG_CRYPTO_CAST6=m
742CONFIG_CRYPTO_TEA=m 909CONFIG_CRYPTO_TEA=m
743# CONFIG_CRYPTO_ARC4 is not set 910CONFIG_CRYPTO_ARC4=m
744CONFIG_CRYPTO_KHAZAD=m 911CONFIG_CRYPTO_KHAZAD=m
745CONFIG_CRYPTO_ANUBIS=m 912CONFIG_CRYPTO_ANUBIS=m
746CONFIG_CRYPTO_DEFLATE=y 913CONFIG_CRYPTO_DEFLATE=m
747CONFIG_CRYPTO_MICHAEL_MIC=y 914CONFIG_CRYPTO_MICHAEL_MIC=m
748CONFIG_CRYPTO_CRC32C=m 915CONFIG_CRYPTO_CRC32C=m
749# CONFIG_CRYPTO_TEST is not set 916# CONFIG_CRYPTO_TEST is not set
750 917
@@ -756,9 +923,8 @@ CONFIG_CRYPTO_CRC32C=m
756# Library routines 923# Library routines
757# 924#
758CONFIG_CRC_CCITT=m 925CONFIG_CRC_CCITT=m
926CONFIG_CRC16=m
759CONFIG_CRC32=y 927CONFIG_CRC32=y
760CONFIG_LIBCRC32C=m 928CONFIG_LIBCRC32C=m
761CONFIG_ZLIB_INFLATE=y 929CONFIG_ZLIB_INFLATE=m
762CONFIG_ZLIB_DEFLATE=y 930CONFIG_ZLIB_DEFLATE=m
763CONFIG_GENERIC_HARDIRQS=y
764CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/db1100_defconfig b/arch/mips/configs/db1100_defconfig
index 6a528d479d70..b8cd2cd923dd 100644
--- a/arch/mips/configs/db1100_defconfig
+++ b/arch/mips/configs/db1100_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:01 2005 4# Thu Oct 20 22:25:29 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,24 +11,29 @@ CONFIG_32BIT=y
14CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
25# CONFIG_BSD_PROCESS_ACCT is not set 24# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y 25CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set 26# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14
29CONFIG_HOTPLUG=y 27CONFIG_HOTPLUG=y
30CONFIG_KOBJECT_UEVENT=y 28CONFIG_KOBJECT_UEVENT=y
31# CONFIG_IKCONFIG is not set 29# CONFIG_IKCONFIG is not set
30CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y 31CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y 32CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_EXTRA_PASS is not set 33# CONFIG_KALLSYMS_EXTRA_PASS is not set
34CONFIG_PRINTK=y
35CONFIG_BUG=y
36CONFIG_BASE_FULL=y
35CONFIG_FUTEX=y 37CONFIG_FUTEX=y
36CONFIG_EPOLL=y 38CONFIG_EPOLL=y
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -41,6 +43,7 @@ CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0 43CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0 44CONFIG_CC_ALIGN_JUMPS=0
43# CONFIG_TINY_SHMEM is not set 45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
44 47
45# 48#
46# Loadable module support 49# Loadable module support
@@ -56,63 +59,79 @@ CONFIG_KMOD=y
56# 59#
57# Machine selection 60# Machine selection
58# 61#
59# CONFIG_MACH_JAZZ is not set 62# CONFIG_MIPS_MTX1 is not set
60# CONFIG_MACH_VR41XX is not set 63# CONFIG_MIPS_BOSPORUS is not set
61# CONFIG_TOSHIBA_JMR3927 is not set 64# CONFIG_MIPS_PB1000 is not set
65# CONFIG_MIPS_PB1100 is not set
66# CONFIG_MIPS_PB1500 is not set
67# CONFIG_MIPS_PB1550 is not set
68# CONFIG_MIPS_PB1200 is not set
69# CONFIG_MIPS_DB1000 is not set
70CONFIG_MIPS_DB1100=y
71# CONFIG_MIPS_DB1500 is not set
72# CONFIG_MIPS_DB1550 is not set
73# CONFIG_MIPS_DB1200 is not set
74# CONFIG_MIPS_MIRAGE is not set
62# CONFIG_MIPS_COBALT is not set 75# CONFIG_MIPS_COBALT is not set
63# CONFIG_MACH_DECSTATION is not set 76# CONFIG_MACH_DECSTATION is not set
64# CONFIG_MIPS_EV64120 is not set 77# CONFIG_MIPS_EV64120 is not set
65# CONFIG_MIPS_EV96100 is not set 78# CONFIG_MIPS_EV96100 is not set
66# CONFIG_MIPS_IVR is not set 79# CONFIG_MIPS_IVR is not set
67# CONFIG_LASAT is not set
68# CONFIG_MIPS_ITE8172 is not set 80# CONFIG_MIPS_ITE8172 is not set
81# CONFIG_MACH_JAZZ is not set
82# CONFIG_LASAT is not set
69# CONFIG_MIPS_ATLAS is not set 83# CONFIG_MIPS_ATLAS is not set
70# CONFIG_MIPS_MALTA is not set 84# CONFIG_MIPS_MALTA is not set
71# CONFIG_MIPS_SEAD is not set 85# CONFIG_MIPS_SEAD is not set
86# CONFIG_MIPS_SIM is not set
87# CONFIG_MOMENCO_JAGUAR_ATX is not set
72# CONFIG_MOMENCO_OCELOT is not set 88# CONFIG_MOMENCO_OCELOT is not set
73# CONFIG_MOMENCO_OCELOT_G is not set
74# CONFIG_MOMENCO_OCELOT_C is not set
75# CONFIG_MOMENCO_OCELOT_3 is not set 89# CONFIG_MOMENCO_OCELOT_3 is not set
76# CONFIG_MOMENCO_JAGUAR_ATX is not set 90# CONFIG_MOMENCO_OCELOT_C is not set
77# CONFIG_PMC_YOSEMITE is not set 91# CONFIG_MOMENCO_OCELOT_G is not set
92# CONFIG_MIPS_XXS1500 is not set
93# CONFIG_PNX8550_V2PCI is not set
94# CONFIG_PNX8550_JBS is not set
78# CONFIG_DDB5074 is not set 95# CONFIG_DDB5074 is not set
79# CONFIG_DDB5476 is not set 96# CONFIG_DDB5476 is not set
80# CONFIG_DDB5477 is not set 97# CONFIG_DDB5477 is not set
81# CONFIG_NEC_OSPREY is not set 98# CONFIG_MACH_VR41XX is not set
99# CONFIG_PMC_YOSEMITE is not set
100# CONFIG_QEMU is not set
82# CONFIG_SGI_IP22 is not set 101# CONFIG_SGI_IP22 is not set
83CONFIG_SOC_AU1X00=y 102# CONFIG_SGI_IP27 is not set
84# CONFIG_SOC_AU1000 is not set 103# CONFIG_SGI_IP32 is not set
85CONFIG_SOC_AU1100=y 104# CONFIG_SIBYTE_BIGSUR is not set
86# CONFIG_SOC_AU1500 is not set 105# CONFIG_SIBYTE_SWARM is not set
87# CONFIG_SOC_AU1550 is not set 106# CONFIG_SIBYTE_SENTOSA is not set
88# CONFIG_MIPS_PB1000 is not set 107# CONFIG_SIBYTE_RHONE is not set
89# CONFIG_MIPS_PB1100 is not set 108# CONFIG_SIBYTE_CARMEL is not set
90# CONFIG_MIPS_PB1500 is not set 109# CONFIG_SIBYTE_PTSWARM is not set
91# CONFIG_MIPS_PB1550 is not set 110# CONFIG_SIBYTE_LITTLESUR is not set
92# CONFIG_MIPS_DB1000 is not set 111# CONFIG_SIBYTE_CRHINE is not set
93CONFIG_MIPS_DB1100=y 112# CONFIG_SIBYTE_CRHONE is not set
94# CONFIG_MIPS_DB1500 is not set
95# CONFIG_MIPS_DB1550 is not set
96# CONFIG_MIPS_BOSPORUS is not set
97# CONFIG_MIPS_MIRAGE is not set
98# CONFIG_MIPS_XXS1500 is not set
99# CONFIG_MIPS_MTX1 is not set
100# CONFIG_SIBYTE_SB1xxx_SOC is not set
101# CONFIG_SNI_RM200_PCI is not set 113# CONFIG_SNI_RM200_PCI is not set
114# CONFIG_TOSHIBA_JMR3927 is not set
102# CONFIG_TOSHIBA_RBTX4927 is not set 115# CONFIG_TOSHIBA_RBTX4927 is not set
116# CONFIG_TOSHIBA_RBTX4938 is not set
103CONFIG_RWSEM_GENERIC_SPINLOCK=y 117CONFIG_RWSEM_GENERIC_SPINLOCK=y
104CONFIG_GENERIC_CALIBRATE_DELAY=y 118CONFIG_GENERIC_CALIBRATE_DELAY=y
105CONFIG_HAVE_DEC_LOCK=y
106CONFIG_DMA_NONCOHERENT=y 119CONFIG_DMA_NONCOHERENT=y
107CONFIG_DMA_NEED_PCI_MAP_STATE=y 120CONFIG_DMA_NEED_PCI_MAP_STATE=y
121# CONFIG_CPU_BIG_ENDIAN is not set
108CONFIG_CPU_LITTLE_ENDIAN=y 122CONFIG_CPU_LITTLE_ENDIAN=y
123CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
124CONFIG_SOC_AU1100=y
125CONFIG_SOC_AU1X00=y
109CONFIG_MIPS_L1_CACHE_SHIFT=5 126CONFIG_MIPS_L1_CACHE_SHIFT=5
110 127
111# 128#
112# CPU selection 129# CPU selection
113# 130#
114CONFIG_CPU_MIPS32=y 131CONFIG_CPU_MIPS32_R1=y
115# CONFIG_CPU_MIPS64 is not set 132# CONFIG_CPU_MIPS32_R2 is not set
133# CONFIG_CPU_MIPS64_R1 is not set
134# CONFIG_CPU_MIPS64_R2 is not set
116# CONFIG_CPU_R3000 is not set 135# CONFIG_CPU_R3000 is not set
117# CONFIG_CPU_TX39XX is not set 136# CONFIG_CPU_TX39XX is not set
118# CONFIG_CPU_VR41XX is not set 137# CONFIG_CPU_VR41XX is not set
@@ -128,15 +147,39 @@ CONFIG_CPU_MIPS32=y
128# CONFIG_CPU_RM7000 is not set 147# CONFIG_CPU_RM7000 is not set
129# CONFIG_CPU_RM9000 is not set 148# CONFIG_CPU_RM9000 is not set
130# CONFIG_CPU_SB1 is not set 149# CONFIG_CPU_SB1 is not set
150CONFIG_SYS_HAS_CPU_MIPS32_R1=y
151CONFIG_CPU_MIPS32=y
152CONFIG_CPU_MIPSR1=y
153CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
154CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
155
156#
157# Kernel type
158#
159CONFIG_32BIT=y
160# CONFIG_64BIT is not set
131CONFIG_PAGE_SIZE_4KB=y 161CONFIG_PAGE_SIZE_4KB=y
132# CONFIG_PAGE_SIZE_8KB is not set 162# CONFIG_PAGE_SIZE_8KB is not set
133# CONFIG_PAGE_SIZE_16KB is not set 163# CONFIG_PAGE_SIZE_16KB is not set
134# CONFIG_PAGE_SIZE_64KB is not set 164# CONFIG_PAGE_SIZE_64KB is not set
135CONFIG_CPU_HAS_PREFETCH=y 165CONFIG_CPU_HAS_PREFETCH=y
136# CONFIG_64BIT_PHYS_ADDR is not set 166# CONFIG_MIPS_MT is not set
167CONFIG_64BIT_PHYS_ADDR=y
137# CONFIG_CPU_ADVANCED is not set 168# CONFIG_CPU_ADVANCED is not set
138CONFIG_CPU_HAS_LLSC=y 169CONFIG_CPU_HAS_LLSC=y
139CONFIG_CPU_HAS_SYNC=y 170CONFIG_CPU_HAS_SYNC=y
171CONFIG_GENERIC_HARDIRQS=y
172CONFIG_GENERIC_IRQ_PROBE=y
173CONFIG_ARCH_FLATMEM_ENABLE=y
174CONFIG_SELECT_MEMORY_MODEL=y
175CONFIG_FLATMEM_MANUAL=y
176# CONFIG_DISCONTIGMEM_MANUAL is not set
177# CONFIG_SPARSEMEM_MANUAL is not set
178CONFIG_FLATMEM=y
179CONFIG_FLAT_NODE_MEM_MAP=y
180# CONFIG_SPARSEMEM_STATIC is not set
181CONFIG_PREEMPT_NONE=y
182# CONFIG_PREEMPT_VOLUNTARY is not set
140# CONFIG_PREEMPT is not set 183# CONFIG_PREEMPT is not set
141 184
142# 185#
@@ -147,15 +190,7 @@ CONFIG_MMU=y
147# 190#
148# PCCARD (PCMCIA/CardBus) support 191# PCCARD (PCMCIA/CardBus) support
149# 192#
150CONFIG_PCCARD=m 193# CONFIG_PCCARD is not set
151# CONFIG_PCMCIA_DEBUG is not set
152CONFIG_PCMCIA=m
153
154#
155# PC-card bridges
156#
157# CONFIG_TCIC is not set
158# CONFIG_PCMCIA_AU1X00 is not set
159 194
160# 195#
161# PCI Hotplug Support 196# PCI Hotplug Support
@@ -167,6 +202,100 @@ CONFIG_PCMCIA=m
167CONFIG_BINFMT_ELF=y 202CONFIG_BINFMT_ELF=y
168# CONFIG_BINFMT_MISC is not set 203# CONFIG_BINFMT_MISC is not set
169CONFIG_TRAD_SIGNALS=y 204CONFIG_TRAD_SIGNALS=y
205# CONFIG_PM is not set
206
207#
208# Networking
209#
210CONFIG_NET=y
211
212#
213# Networking options
214#
215CONFIG_PACKET=y
216# CONFIG_PACKET_MMAP is not set
217CONFIG_UNIX=y
218CONFIG_XFRM=y
219CONFIG_XFRM_USER=m
220CONFIG_NET_KEY=y
221CONFIG_INET=y
222CONFIG_IP_MULTICAST=y
223# CONFIG_IP_ADVANCED_ROUTER is not set
224CONFIG_IP_FIB_HASH=y
225CONFIG_IP_PNP=y
226# CONFIG_IP_PNP_DHCP is not set
227CONFIG_IP_PNP_BOOTP=y
228# CONFIG_IP_PNP_RARP is not set
229# CONFIG_NET_IPIP is not set
230# CONFIG_NET_IPGRE is not set
231# CONFIG_IP_MROUTE is not set
232# CONFIG_ARPD is not set
233# CONFIG_SYN_COOKIES is not set
234# CONFIG_INET_AH is not set
235# CONFIG_INET_ESP is not set
236# CONFIG_INET_IPCOMP is not set
237CONFIG_INET_TUNNEL=m
238CONFIG_INET_DIAG=y
239CONFIG_INET_TCP_DIAG=y
240# CONFIG_TCP_CONG_ADVANCED is not set
241CONFIG_TCP_CONG_BIC=y
242
243#
244# IP: Virtual Server Configuration
245#
246# CONFIG_IP_VS is not set
247# CONFIG_IPV6 is not set
248CONFIG_NETFILTER=y
249# CONFIG_NETFILTER_DEBUG is not set
250CONFIG_NETFILTER_NETLINK=m
251CONFIG_NETFILTER_NETLINK_QUEUE=m
252CONFIG_NETFILTER_NETLINK_LOG=m
253
254#
255# IP: Netfilter Configuration
256#
257# CONFIG_IP_NF_CONNTRACK is not set
258CONFIG_IP_NF_PPTP=m
259# CONFIG_IP_NF_QUEUE is not set
260# CONFIG_IP_NF_IPTABLES is not set
261# CONFIG_IP_NF_ARPTABLES is not set
262
263#
264# DCCP Configuration (EXPERIMENTAL)
265#
266# CONFIG_IP_DCCP is not set
267
268#
269# SCTP Configuration (EXPERIMENTAL)
270#
271# CONFIG_IP_SCTP is not set
272# CONFIG_ATM is not set
273# CONFIG_BRIDGE is not set
274# CONFIG_VLAN_8021Q is not set
275# CONFIG_DECNET is not set
276# CONFIG_LLC2 is not set
277# CONFIG_IPX is not set
278# CONFIG_ATALK is not set
279# CONFIG_X25 is not set
280# CONFIG_LAPB is not set
281# CONFIG_NET_DIVERT is not set
282# CONFIG_ECONET is not set
283# CONFIG_WAN_ROUTER is not set
284# CONFIG_NET_SCHED is not set
285# CONFIG_NET_CLS_ROUTE 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
294CONFIG_IEEE80211=m
295# CONFIG_IEEE80211_DEBUG is not set
296CONFIG_IEEE80211_CRYPT_WEP=m
297CONFIG_IEEE80211_CRYPT_CCMP=m
298CONFIG_IEEE80211_CRYPT_TKIP=m
170 299
171# 300#
172# Device Drivers 301# Device Drivers
@@ -180,9 +309,83 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
180# CONFIG_FW_LOADER is not set 309# CONFIG_FW_LOADER is not set
181 310
182# 311#
312# Connector - unified userspace <-> kernelspace linker
313#
314CONFIG_CONNECTOR=m
315
316#
183# Memory Technology Devices (MTD) 317# Memory Technology Devices (MTD)
184# 318#
185# CONFIG_MTD is not set 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
324# CONFIG_MTD_CMDLINE_PARTS is not set
325
326#
327# User Modules And Translation Layers
328#
329CONFIG_MTD_CHAR=y
330CONFIG_MTD_BLOCK=y
331# CONFIG_FTL is not set
332# CONFIG_NFTL is not set
333# CONFIG_INFTL is not set
334
335#
336# RAM/ROM/Flash chip drivers
337#
338CONFIG_MTD_CFI=y
339# CONFIG_MTD_JEDECPROBE is not set
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
354CONFIG_MTD_CFI_AMDSTD_RETRY=0
355# CONFIG_MTD_CFI_STAA is not set
356CONFIG_MTD_CFI_UTIL=y
357# CONFIG_MTD_RAM is not set
358# CONFIG_MTD_ROM is not set
359# CONFIG_MTD_ABSENT is not set
360
361#
362# Mapping drivers for chip access
363#
364# CONFIG_MTD_COMPLEX_MAPPINGS is not set
365# CONFIG_MTD_PHYSMAP is not set
366CONFIG_MTD_ALCHEMY=y
367# CONFIG_MTD_PLATRAM is not set
368
369#
370# Self-contained MTD device drivers
371#
372# CONFIG_MTD_SLRAM is not set
373# CONFIG_MTD_PHRAM is not set
374# CONFIG_MTD_MTDRAM is not set
375# CONFIG_MTD_BLKMTD is not set
376# CONFIG_MTD_BLOCK2MTD is not set
377
378#
379# Disk-On-Chip Device Drivers
380#
381# CONFIG_MTD_DOC2000 is not set
382# CONFIG_MTD_DOC2001 is not set
383# CONFIG_MTD_DOC2001PLUS is not set
384
385#
386# NAND Flash Device Drivers
387#
388# CONFIG_MTD_NAND is not set
186 389
187# 390#
188# Parallel port support 391# Parallel port support
@@ -196,14 +399,12 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
196# 399#
197# Block devices 400# Block devices
198# 401#
199# CONFIG_BLK_DEV_FD is not set
200# CONFIG_BLK_DEV_COW_COMMON is not set 402# CONFIG_BLK_DEV_COW_COMMON is not set
201CONFIG_BLK_DEV_LOOP=y 403CONFIG_BLK_DEV_LOOP=y
202# CONFIG_BLK_DEV_CRYPTOLOOP is not set 404# CONFIG_BLK_DEV_CRYPTOLOOP is not set
203# CONFIG_BLK_DEV_NBD is not set 405# CONFIG_BLK_DEV_NBD is not set
204# CONFIG_BLK_DEV_RAM is not set 406# CONFIG_BLK_DEV_RAM is not set
205CONFIG_BLK_DEV_RAM_COUNT=16 407CONFIG_BLK_DEV_RAM_COUNT=16
206CONFIG_INITRAMFS_SOURCE=""
207# CONFIG_LBD is not set 408# CONFIG_LBD is not set
208CONFIG_CDROM_PKTCDVD=m 409CONFIG_CDROM_PKTCDVD=m
209CONFIG_CDROM_PKTCDVD_BUFFERS=8 410CONFIG_CDROM_PKTCDVD_BUFFERS=8
@@ -226,6 +427,7 @@ CONFIG_ATA_OVER_ETH=m
226# 427#
227# SCSI device support 428# SCSI device support
228# 429#
430CONFIG_RAID_ATTRS=m
229# CONFIG_SCSI is not set 431# CONFIG_SCSI is not set
230 432
231# 433#
@@ -236,6 +438,7 @@ CONFIG_ATA_OVER_ETH=m
236# 438#
237# Fusion MPT device support 439# Fusion MPT device support
238# 440#
441# CONFIG_FUSION is not set
239 442
240# 443#
241# IEEE 1394 (FireWire) support 444# IEEE 1394 (FireWire) support
@@ -246,101 +449,35 @@ CONFIG_ATA_OVER_ETH=m
246# 449#
247 450
248# 451#
249# Networking support 452# Network device support
250#
251CONFIG_NET=y
252
253#
254# Networking options
255#
256CONFIG_PACKET=y
257# CONFIG_PACKET_MMAP is not set
258CONFIG_NETLINK_DEV=y
259CONFIG_UNIX=y
260CONFIG_NET_KEY=y
261CONFIG_INET=y
262CONFIG_IP_MULTICAST=y
263# CONFIG_IP_ADVANCED_ROUTER is not set
264CONFIG_IP_PNP=y
265# CONFIG_IP_PNP_DHCP is not set
266CONFIG_IP_PNP_BOOTP=y
267# CONFIG_IP_PNP_RARP is not set
268# CONFIG_NET_IPIP is not set
269# CONFIG_NET_IPGRE is not set
270# CONFIG_IP_MROUTE is not set
271# CONFIG_ARPD is not set
272# CONFIG_SYN_COOKIES is not set
273# CONFIG_INET_AH is not set
274# CONFIG_INET_ESP is not set
275# CONFIG_INET_IPCOMP is not set
276CONFIG_INET_TUNNEL=m
277CONFIG_IP_TCPDIAG=m
278# CONFIG_IP_TCPDIAG_IPV6 is not set
279
280#
281# IP: Virtual Server Configuration
282#
283# CONFIG_IP_VS is not set
284# CONFIG_IPV6 is not set
285CONFIG_NETFILTER=y
286# CONFIG_NETFILTER_DEBUG is not set
287
288#
289# IP: Netfilter Configuration
290# 453#
291# CONFIG_IP_NF_CONNTRACK is not set 454CONFIG_NETDEVICES=y
292CONFIG_IP_NF_CONNTRACK_MARK=y 455# CONFIG_DUMMY is not set
293# CONFIG_IP_NF_QUEUE is not set 456# CONFIG_BONDING is not set
294# CONFIG_IP_NF_IPTABLES is not set 457# CONFIG_EQUALIZER is not set
295# CONFIG_IP_NF_ARPTABLES is not set 458# CONFIG_TUN is not set
296CONFIG_XFRM=y
297CONFIG_XFRM_USER=m
298
299#
300# SCTP Configuration (EXPERIMENTAL)
301#
302# CONFIG_IP_SCTP is not set
303# CONFIG_ATM is not set
304# CONFIG_BRIDGE is not set
305# CONFIG_VLAN_8021Q is not set
306# CONFIG_DECNET is not set
307# CONFIG_LLC2 is not set
308# CONFIG_IPX is not set
309# CONFIG_ATALK is not set
310# CONFIG_X25 is not set
311# CONFIG_LAPB is not set
312# CONFIG_NET_DIVERT is not set
313# CONFIG_ECONET is not set
314# CONFIG_WAN_ROUTER is not set
315 459
316# 460#
317# QoS and/or fair queueing 461# PHY device support
318# 462#
319# CONFIG_NET_SCHED is not set 463CONFIG_PHYLIB=m
320# CONFIG_NET_CLS_ROUTE is not set 464CONFIG_PHYCONTROL=y
321 465
322# 466#
323# Network testing 467# MII PHY device drivers
324# 468#
325# CONFIG_NET_PKTGEN is not set 469CONFIG_MARVELL_PHY=m
326# CONFIG_NETPOLL is not set 470CONFIG_DAVICOM_PHY=m
327# CONFIG_NET_POLL_CONTROLLER is not set 471CONFIG_QSEMI_PHY=m
328# CONFIG_HAMRADIO is not set 472CONFIG_LXT_PHY=m
329# CONFIG_IRDA is not set 473CONFIG_CICADA_PHY=m
330# CONFIG_BT is not set
331CONFIG_NETDEVICES=y
332# CONFIG_DUMMY is not set
333# CONFIG_BONDING is not set
334# CONFIG_EQUALIZER is not set
335# CONFIG_TUN is not set
336# CONFIG_ETHERTAP is not set
337 474
338# 475#
339# Ethernet (10 or 100Mbit) 476# Ethernet (10 or 100Mbit)
340# 477#
341CONFIG_NET_ETHERNET=y 478CONFIG_NET_ETHERNET=y
342CONFIG_MII=m 479CONFIG_MII=m
343# CONFIG_MIPS_AU1X00_ENET is not set 480CONFIG_MIPS_AU1X00_ENET=y
344 481
345# 482#
346# Ethernet (1000 Mbit) 483# Ethernet (1000 Mbit)
@@ -360,19 +497,6 @@ CONFIG_MII=m
360# CONFIG_NET_RADIO is not set 497# CONFIG_NET_RADIO is not set
361 498
362# 499#
363# PCMCIA network device support
364#
365CONFIG_NET_PCMCIA=y
366CONFIG_PCMCIA_3C589=m
367CONFIG_PCMCIA_3C574=m
368CONFIG_PCMCIA_FMVJ18X=m
369CONFIG_PCMCIA_PCNET=m
370CONFIG_PCMCIA_NMCLAN=m
371CONFIG_PCMCIA_SMC91C92=m
372CONFIG_PCMCIA_XIRC2PS=m
373CONFIG_PCMCIA_AXNET=m
374
375#
376# Wan interfaces 500# Wan interfaces
377# 501#
378# CONFIG_WAN is not set 502# CONFIG_WAN is not set
@@ -387,6 +511,8 @@ CONFIG_PPPOE=m
387# CONFIG_SLIP is not set 511# CONFIG_SLIP is not set
388# CONFIG_SHAPER is not set 512# CONFIG_SHAPER is not set
389# CONFIG_NETCONSOLE is not set 513# CONFIG_NETCONSOLE is not set
514# CONFIG_NETPOLL is not set
515# CONFIG_NET_POLL_CONTROLLER is not set
390 516
391# 517#
392# ISDN subsystem 518# ISDN subsystem
@@ -416,18 +542,6 @@ CONFIG_INPUT_EVDEV=y
416# CONFIG_INPUT_EVBUG is not set 542# CONFIG_INPUT_EVBUG is not set
417 543
418# 544#
419# Input I/O drivers
420#
421# CONFIG_GAMEPORT is not set
422CONFIG_SOUND_GAMEPORT=y
423CONFIG_SERIO=y
424# CONFIG_SERIO_I8042 is not set
425CONFIG_SERIO_SERPORT=y
426# CONFIG_SERIO_CT82C710 is not set
427CONFIG_SERIO_LIBPS2=m
428CONFIG_SERIO_RAW=m
429
430#
431# Input Device Drivers 545# Input Device Drivers
432# 546#
433# CONFIG_INPUT_KEYBOARD is not set 547# CONFIG_INPUT_KEYBOARD is not set
@@ -437,6 +551,16 @@ CONFIG_SERIO_RAW=m
437# CONFIG_INPUT_MISC is not set 551# CONFIG_INPUT_MISC is not set
438 552
439# 553#
554# Hardware I/O ports
555#
556CONFIG_SERIO=y
557# CONFIG_SERIO_I8042 is not set
558CONFIG_SERIO_SERPORT=y
559CONFIG_SERIO_LIBPS2=m
560CONFIG_SERIO_RAW=m
561# CONFIG_GAMEPORT is not set
562
563#
440# Character devices 564# Character devices
441# 565#
442CONFIG_VT=y 566CONFIG_VT=y
@@ -454,7 +578,10 @@ CONFIG_HW_CONSOLE=y
454# 578#
455# Non-8250 serial port support 579# Non-8250 serial port support
456# 580#
457# CONFIG_SERIAL_AU1X00 is not set 581CONFIG_SERIAL_AU1X00=y
582CONFIG_SERIAL_AU1X00_CONSOLE=y
583CONFIG_SERIAL_CORE=y
584CONFIG_SERIAL_CORE_CONSOLE=y
458CONFIG_UNIX98_PTYS=y 585CONFIG_UNIX98_PTYS=y
459CONFIG_LEGACY_PTYS=y 586CONFIG_LEGACY_PTYS=y
460CONFIG_LEGACY_PTY_COUNT=256 587CONFIG_LEGACY_PTY_COUNT=256
@@ -468,20 +595,19 @@ CONFIG_LEGACY_PTY_COUNT=256
468# Watchdog Cards 595# Watchdog Cards
469# 596#
470# CONFIG_WATCHDOG is not set 597# CONFIG_WATCHDOG is not set
471CONFIG_RTC=y 598# CONFIG_RTC is not set
599# CONFIG_GEN_RTC is not set
472# CONFIG_DTLK is not set 600# CONFIG_DTLK is not set
473# CONFIG_R3964 is not set 601# CONFIG_R3964 is not set
474 602
475# 603#
476# Ftape, the floppy tape device driver 604# Ftape, the floppy tape device driver
477# 605#
478# CONFIG_DRM is not set 606# CONFIG_RAW_DRIVER is not set
479 607
480# 608#
481# PCMCIA character devices 609# TPM devices
482# 610#
483CONFIG_SYNCLINK_CS=m
484# CONFIG_RAW_DRIVER is not set
485 611
486# 612#
487# I2C support 613# I2C support
@@ -494,10 +620,20 @@ CONFIG_SYNCLINK_CS=m
494# CONFIG_W1 is not set 620# CONFIG_W1 is not set
495 621
496# 622#
623# Hardware Monitoring support
624#
625# CONFIG_HWMON is not set
626# CONFIG_HWMON_VID is not set
627
628#
497# Misc devices 629# Misc devices
498# 630#
499 631
500# 632#
633# Multimedia Capabilities Port drivers
634#
635
636#
501# Multimedia devices 637# Multimedia devices
502# 638#
503# CONFIG_VIDEO_DEV is not set 639# CONFIG_VIDEO_DEV is not set
@@ -510,13 +646,43 @@ CONFIG_SYNCLINK_CS=m
510# 646#
511# Graphics support 647# Graphics support
512# 648#
513# CONFIG_FB is not set 649CONFIG_FB=y
650CONFIG_FB_CFB_FILLRECT=y
651CONFIG_FB_CFB_COPYAREA=y
652CONFIG_FB_CFB_IMAGEBLIT=y
653CONFIG_FB_SOFT_CURSOR=y
654# CONFIG_FB_MACMODES is not set
655# CONFIG_FB_MODE_HELPERS is not set
656# CONFIG_FB_TILEBLITTING is not set
657CONFIG_FB_AU1100=y
658# CONFIG_FB_S1D13XXX is not set
659# CONFIG_FB_VIRTUAL is not set
514 660
515# 661#
516# Console display driver support 662# Console display driver support
517# 663#
518# CONFIG_VGA_CONSOLE is not set 664# CONFIG_VGA_CONSOLE is not set
519CONFIG_DUMMY_CONSOLE=y 665CONFIG_DUMMY_CONSOLE=y
666CONFIG_FRAMEBUFFER_CONSOLE=y
667CONFIG_FONTS=y
668CONFIG_FONT_8x8=y
669CONFIG_FONT_8x16=y
670# CONFIG_FONT_6x11 is not set
671# CONFIG_FONT_7x14 is not set
672# CONFIG_FONT_PEARL_8x8 is not set
673# CONFIG_FONT_ACORN_8x8 is not set
674# CONFIG_FONT_MINI_4x6 is not set
675# CONFIG_FONT_SUN8x16 is not set
676# CONFIG_FONT_SUN12x22 is not set
677# CONFIG_FONT_10x18 is not set
678
679#
680# Logo configuration
681#
682CONFIG_LOGO=y
683CONFIG_LOGO_LINUX_MONO=y
684CONFIG_LOGO_LINUX_VGA16=y
685CONFIG_LOGO_LINUX_CLUT224=y
520# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 686# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
521 687
522# 688#
@@ -527,12 +693,9 @@ CONFIG_DUMMY_CONSOLE=y
527# 693#
528# USB support 694# USB support
529# 695#
530# CONFIG_USB_ARCH_HAS_HCD is not set 696CONFIG_USB_ARCH_HAS_HCD=y
531# CONFIG_USB_ARCH_HAS_OHCI is not set 697CONFIG_USB_ARCH_HAS_OHCI=y
532 698# CONFIG_USB is not set
533#
534# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
535#
536 699
537# 700#
538# USB Gadget Support 701# USB Gadget Support
@@ -547,7 +710,10 @@ CONFIG_DUMMY_CONSOLE=y
547# 710#
548# InfiniBand support 711# InfiniBand support
549# 712#
550# CONFIG_INFINIBAND is not set 713
714#
715# SN Devices
716#
551 717
552# 718#
553# File systems 719# File systems
@@ -556,6 +722,7 @@ CONFIG_EXT2_FS=y
556CONFIG_EXT2_FS_XATTR=y 722CONFIG_EXT2_FS_XATTR=y
557CONFIG_EXT2_FS_POSIX_ACL=y 723CONFIG_EXT2_FS_POSIX_ACL=y
558# CONFIG_EXT2_FS_SECURITY is not set 724# CONFIG_EXT2_FS_SECURITY is not set
725# CONFIG_EXT2_FS_XIP is not set
559CONFIG_EXT3_FS=y 726CONFIG_EXT3_FS=y
560CONFIG_EXT3_FS_XATTR=y 727CONFIG_EXT3_FS_XATTR=y
561CONFIG_EXT3_FS_POSIX_ACL=y 728CONFIG_EXT3_FS_POSIX_ACL=y
@@ -574,10 +741,12 @@ CONFIG_FS_POSIX_ACL=y
574# CONFIG_XFS_FS is not set 741# CONFIG_XFS_FS is not set
575# CONFIG_MINIX_FS is not set 742# CONFIG_MINIX_FS is not set
576# CONFIG_ROMFS_FS is not set 743# CONFIG_ROMFS_FS is not set
744CONFIG_INOTIFY=y
577# CONFIG_QUOTA is not set 745# CONFIG_QUOTA is not set
578CONFIG_DNOTIFY=y 746CONFIG_DNOTIFY=y
579CONFIG_AUTOFS_FS=m 747CONFIG_AUTOFS_FS=m
580CONFIG_AUTOFS4_FS=m 748CONFIG_AUTOFS4_FS=m
749CONFIG_FUSE_FS=m
581 750
582# 751#
583# CD-ROM/DVD Filesystems 752# CD-ROM/DVD Filesystems
@@ -598,13 +767,10 @@ CONFIG_AUTOFS4_FS=m
598CONFIG_PROC_FS=y 767CONFIG_PROC_FS=y
599CONFIG_PROC_KCORE=y 768CONFIG_PROC_KCORE=y
600CONFIG_SYSFS=y 769CONFIG_SYSFS=y
601# CONFIG_DEVFS_FS is not set
602CONFIG_DEVPTS_FS_XATTR=y
603CONFIG_DEVPTS_FS_SECURITY=y
604CONFIG_TMPFS=y 770CONFIG_TMPFS=y
605# CONFIG_TMPFS_XATTR is not set
606# CONFIG_HUGETLB_PAGE is not set 771# CONFIG_HUGETLB_PAGE is not set
607CONFIG_RAMFS=y 772CONFIG_RAMFS=y
773CONFIG_RELAYFS_FS=m
608 774
609# 775#
610# Miscellaneous filesystems 776# Miscellaneous filesystems
@@ -616,6 +782,8 @@ CONFIG_RAMFS=y
616# CONFIG_BEFS_FS is not set 782# CONFIG_BEFS_FS is not set
617# CONFIG_BFS_FS is not set 783# CONFIG_BFS_FS is not set
618# CONFIG_EFS_FS is not set 784# CONFIG_EFS_FS is not set
785# CONFIG_JFFS_FS is not set
786# CONFIG_JFFS2_FS is not set
619CONFIG_CRAMFS=m 787CONFIG_CRAMFS=m
620# CONFIG_VXFS_FS is not set 788# CONFIG_VXFS_FS is not set
621# CONFIG_HPFS_FS is not set 789# CONFIG_HPFS_FS is not set
@@ -636,6 +804,7 @@ CONFIG_NFSD=m
636CONFIG_ROOT_NFS=y 804CONFIG_ROOT_NFS=y
637CONFIG_LOCKD=y 805CONFIG_LOCKD=y
638CONFIG_EXPORTFS=m 806CONFIG_EXPORTFS=m
807CONFIG_NFS_COMMON=y
639CONFIG_SUNRPC=y 808CONFIG_SUNRPC=y
640# CONFIG_RPCSEC_GSS_KRB5 is not set 809# CONFIG_RPCSEC_GSS_KRB5 is not set
641# CONFIG_RPCSEC_GSS_SPKM3 is not set 810# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -645,6 +814,7 @@ CONFIG_SMB_FS=m
645# CONFIG_NCP_FS is not set 814# CONFIG_NCP_FS is not set
646# CONFIG_CODA_FS is not set 815# CONFIG_CODA_FS is not set
647# CONFIG_AFS_FS is not set 816# CONFIG_AFS_FS is not set
817# CONFIG_9P_FS is not set
648 818
649# 819#
650# Partition Types 820# Partition Types
@@ -704,7 +874,9 @@ CONFIG_NLS_DEFAULT="iso8859-1"
704# 874#
705# Kernel hacking 875# Kernel hacking
706# 876#
877# CONFIG_PRINTK_TIME is not set
707# CONFIG_DEBUG_KERNEL is not set 878# CONFIG_DEBUG_KERNEL is not set
879CONFIG_LOG_BUF_SHIFT=14
708CONFIG_CROSSCOMPILE=y 880CONFIG_CROSSCOMPILE=y
709CONFIG_CMDLINE="" 881CONFIG_CMDLINE=""
710 882
@@ -720,26 +892,27 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
720# 892#
721CONFIG_CRYPTO=y 893CONFIG_CRYPTO=y
722CONFIG_CRYPTO_HMAC=y 894CONFIG_CRYPTO_HMAC=y
723CONFIG_CRYPTO_NULL=y 895CONFIG_CRYPTO_NULL=m
724# CONFIG_CRYPTO_MD4 is not set 896CONFIG_CRYPTO_MD4=m
725# CONFIG_CRYPTO_MD5 is not set 897CONFIG_CRYPTO_MD5=m
726# CONFIG_CRYPTO_SHA1 is not set 898CONFIG_CRYPTO_SHA1=m
727# CONFIG_CRYPTO_SHA256 is not set 899CONFIG_CRYPTO_SHA256=m
728CONFIG_CRYPTO_SHA512=y 900CONFIG_CRYPTO_SHA512=m
729CONFIG_CRYPTO_WP512=m 901CONFIG_CRYPTO_WP512=m
730# CONFIG_CRYPTO_DES is not set 902CONFIG_CRYPTO_TGR192=m
731# CONFIG_CRYPTO_BLOWFISH is not set 903CONFIG_CRYPTO_DES=m
732CONFIG_CRYPTO_TWOFISH=y 904CONFIG_CRYPTO_BLOWFISH=m
733# CONFIG_CRYPTO_SERPENT is not set 905CONFIG_CRYPTO_TWOFISH=m
906CONFIG_CRYPTO_SERPENT=m
734CONFIG_CRYPTO_AES=m 907CONFIG_CRYPTO_AES=m
735# CONFIG_CRYPTO_CAST5 is not set 908CONFIG_CRYPTO_CAST5=m
736# CONFIG_CRYPTO_CAST6 is not set 909CONFIG_CRYPTO_CAST6=m
737CONFIG_CRYPTO_TEA=m 910CONFIG_CRYPTO_TEA=m
738# CONFIG_CRYPTO_ARC4 is not set 911CONFIG_CRYPTO_ARC4=m
739CONFIG_CRYPTO_KHAZAD=m 912CONFIG_CRYPTO_KHAZAD=m
740CONFIG_CRYPTO_ANUBIS=m 913CONFIG_CRYPTO_ANUBIS=m
741CONFIG_CRYPTO_DEFLATE=y 914CONFIG_CRYPTO_DEFLATE=m
742CONFIG_CRYPTO_MICHAEL_MIC=y 915CONFIG_CRYPTO_MICHAEL_MIC=m
743CONFIG_CRYPTO_CRC32C=m 916CONFIG_CRYPTO_CRC32C=m
744# CONFIG_CRYPTO_TEST is not set 917# CONFIG_CRYPTO_TEST is not set
745 918
@@ -751,9 +924,8 @@ CONFIG_CRYPTO_CRC32C=m
751# Library routines 924# Library routines
752# 925#
753CONFIG_CRC_CCITT=m 926CONFIG_CRC_CCITT=m
927CONFIG_CRC16=m
754CONFIG_CRC32=y 928CONFIG_CRC32=y
755CONFIG_LIBCRC32C=m 929CONFIG_LIBCRC32C=m
756CONFIG_ZLIB_INFLATE=y 930CONFIG_ZLIB_INFLATE=m
757CONFIG_ZLIB_DEFLATE=y 931CONFIG_ZLIB_DEFLATE=m
758CONFIG_GENERIC_HARDIRQS=y
759CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/db1200_defconfig b/arch/mips/configs/db1200_defconfig
new file mode 100644
index 000000000000..530b6c2d99f6
--- /dev/null
+++ b/arch/mips/configs/db1200_defconfig
@@ -0,0 +1,987 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.14-rc2
4# Thu Oct 20 22:25:32 2005
5#
6CONFIG_MIPS=y
7
8#
9# Code maturity level options
10#
11CONFIG_EXPERIMENTAL=y
12CONFIG_CLEAN_COMPILE=y
13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
15
16#
17# General setup
18#
19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
21CONFIG_SWAP=y
22CONFIG_SYSVIPC=y
23# CONFIG_POSIX_MQUEUE is not set
24# CONFIG_BSD_PROCESS_ACCT is not set
25CONFIG_SYSCTL=y
26# CONFIG_AUDIT is not set
27CONFIG_HOTPLUG=y
28CONFIG_KOBJECT_UEVENT=y
29CONFIG_IKCONFIG=y
30CONFIG_IKCONFIG_PROC=y
31CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_EXTRA_PASS is not set
35CONFIG_PRINTK=y
36CONFIG_BUG=y
37CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y
39CONFIG_EPOLL=y
40# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
41CONFIG_SHMEM=y
42CONFIG_CC_ALIGN_FUNCTIONS=0
43CONFIG_CC_ALIGN_LABELS=0
44CONFIG_CC_ALIGN_LOOPS=0
45CONFIG_CC_ALIGN_JUMPS=0
46# CONFIG_TINY_SHMEM is not set
47CONFIG_BASE_SMALL=0
48
49#
50# Loadable module support
51#
52CONFIG_MODULES=y
53CONFIG_MODULE_UNLOAD=y
54# CONFIG_MODULE_FORCE_UNLOAD is not set
55CONFIG_OBSOLETE_MODPARM=y
56CONFIG_MODVERSIONS=y
57CONFIG_MODULE_SRCVERSION_ALL=y
58CONFIG_KMOD=y
59
60#
61# Machine selection
62#
63# CONFIG_MIPS_MTX1 is not set
64# CONFIG_MIPS_BOSPORUS is not set
65# CONFIG_MIPS_PB1000 is not set
66# CONFIG_MIPS_PB1100 is not set
67# CONFIG_MIPS_PB1500 is not set
68# CONFIG_MIPS_PB1550 is not set
69# CONFIG_MIPS_PB1200 is not set
70# CONFIG_MIPS_DB1000 is not set
71# CONFIG_MIPS_DB1100 is not set
72# CONFIG_MIPS_DB1500 is not set
73# CONFIG_MIPS_DB1550 is not set
74CONFIG_MIPS_DB1200=y
75# CONFIG_MIPS_MIRAGE is not set
76# CONFIG_MIPS_COBALT is not set
77# CONFIG_MACH_DECSTATION is not set
78# CONFIG_MIPS_EV64120 is not set
79# CONFIG_MIPS_EV96100 is not set
80# CONFIG_MIPS_IVR is not set
81# CONFIG_MIPS_ITE8172 is not set
82# CONFIG_MACH_JAZZ is not set
83# CONFIG_LASAT is not set
84# CONFIG_MIPS_ATLAS is not set
85# CONFIG_MIPS_MALTA is not set
86# CONFIG_MIPS_SEAD is not set
87# CONFIG_MIPS_SIM is not set
88# CONFIG_MOMENCO_JAGUAR_ATX is not set
89# CONFIG_MOMENCO_OCELOT is not set
90# CONFIG_MOMENCO_OCELOT_3 is not set
91# CONFIG_MOMENCO_OCELOT_C is not set
92# CONFIG_MOMENCO_OCELOT_G is not set
93# CONFIG_MIPS_XXS1500 is not set
94# CONFIG_PNX8550_V2PCI is not set
95# CONFIG_PNX8550_JBS is not set
96# CONFIG_DDB5074 is not set
97# CONFIG_DDB5476 is not set
98# CONFIG_DDB5477 is not set
99# CONFIG_MACH_VR41XX is not set
100# CONFIG_PMC_YOSEMITE is not set
101# CONFIG_QEMU is not set
102# CONFIG_SGI_IP22 is not set
103# CONFIG_SGI_IP27 is not set
104# CONFIG_SGI_IP32 is not set
105# CONFIG_SIBYTE_BIGSUR is not set
106# CONFIG_SIBYTE_SWARM is not set
107# CONFIG_SIBYTE_SENTOSA is not set
108# CONFIG_SIBYTE_RHONE is not set
109# CONFIG_SIBYTE_CARMEL is not set
110# CONFIG_SIBYTE_PTSWARM is not set
111# CONFIG_SIBYTE_LITTLESUR is not set
112# CONFIG_SIBYTE_CRHINE is not set
113# CONFIG_SIBYTE_CRHONE is not set
114# CONFIG_SNI_RM200_PCI is not set
115# CONFIG_TOSHIBA_JMR3927 is not set
116# CONFIG_TOSHIBA_RBTX4927 is not set
117# CONFIG_TOSHIBA_RBTX4938 is not set
118CONFIG_RWSEM_GENERIC_SPINLOCK=y
119CONFIG_GENERIC_CALIBRATE_DELAY=y
120CONFIG_DMA_COHERENT=y
121CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y
122# CONFIG_CPU_BIG_ENDIAN is not set
123CONFIG_CPU_LITTLE_ENDIAN=y
124CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
125CONFIG_SOC_AU1200=y
126CONFIG_SOC_AU1X00=y
127CONFIG_MIPS_L1_CACHE_SHIFT=5
128
129#
130# CPU selection
131#
132CONFIG_CPU_MIPS32_R1=y
133# CONFIG_CPU_MIPS32_R2 is not set
134# CONFIG_CPU_MIPS64_R1 is not set
135# CONFIG_CPU_MIPS64_R2 is not set
136# CONFIG_CPU_R3000 is not set
137# CONFIG_CPU_TX39XX is not set
138# CONFIG_CPU_VR41XX is not set
139# CONFIG_CPU_R4300 is not set
140# CONFIG_CPU_R4X00 is not set
141# CONFIG_CPU_TX49XX is not set
142# CONFIG_CPU_R5000 is not set
143# CONFIG_CPU_R5432 is not set
144# CONFIG_CPU_R6000 is not set
145# CONFIG_CPU_NEVADA is not set
146# CONFIG_CPU_R8000 is not set
147# CONFIG_CPU_R10000 is not set
148# CONFIG_CPU_RM7000 is not set
149# CONFIG_CPU_RM9000 is not set
150# CONFIG_CPU_SB1 is not set
151CONFIG_SYS_HAS_CPU_MIPS32_R1=y
152CONFIG_CPU_MIPS32=y
153CONFIG_CPU_MIPSR1=y
154CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
155CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
156
157#
158# Kernel type
159#
160CONFIG_32BIT=y
161# CONFIG_64BIT is not set
162CONFIG_PAGE_SIZE_4KB=y
163# CONFIG_PAGE_SIZE_8KB is not set
164# CONFIG_PAGE_SIZE_16KB is not set
165# CONFIG_PAGE_SIZE_64KB is not set
166CONFIG_CPU_HAS_PREFETCH=y
167# CONFIG_MIPS_MT is not set
168CONFIG_64BIT_PHYS_ADDR=y
169# CONFIG_CPU_ADVANCED is not set
170CONFIG_CPU_HAS_LLSC=y
171CONFIG_CPU_HAS_SYNC=y
172CONFIG_GENERIC_HARDIRQS=y
173CONFIG_GENERIC_IRQ_PROBE=y
174CONFIG_ARCH_FLATMEM_ENABLE=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_PREEMPT_NONE=y
183# CONFIG_PREEMPT_VOLUNTARY is not set
184# CONFIG_PREEMPT is not set
185
186#
187# Bus options (PCI, PCMCIA, EISA, ISA, TC)
188#
189CONFIG_MMU=y
190
191#
192# PCCARD (PCMCIA/CardBus) support
193#
194CONFIG_PCCARD=m
195# CONFIG_PCMCIA_DEBUG is not set
196CONFIG_PCMCIA=m
197CONFIG_PCMCIA_LOAD_CIS=y
198CONFIG_PCMCIA_IOCTL=y
199
200#
201# PC-card bridges
202#
203# CONFIG_TCIC is not set
204CONFIG_PCMCIA_AU1X00=m
205
206#
207# PCI Hotplug Support
208#
209
210#
211# Executable file formats
212#
213CONFIG_BINFMT_ELF=y
214# CONFIG_BINFMT_MISC is not set
215CONFIG_TRAD_SIGNALS=y
216# CONFIG_PM is not set
217
218#
219# Networking
220#
221CONFIG_NET=y
222
223#
224# Networking options
225#
226CONFIG_PACKET=y
227# CONFIG_PACKET_MMAP is not set
228CONFIG_UNIX=y
229CONFIG_XFRM=y
230CONFIG_XFRM_USER=m
231CONFIG_NET_KEY=y
232CONFIG_INET=y
233CONFIG_IP_MULTICAST=y
234# CONFIG_IP_ADVANCED_ROUTER is not set
235CONFIG_IP_FIB_HASH=y
236# CONFIG_IP_PNP is not set
237# CONFIG_NET_IPIP is not set
238# CONFIG_NET_IPGRE is not set
239# CONFIG_IP_MROUTE is not set
240# CONFIG_ARPD is not set
241# CONFIG_SYN_COOKIES is not set
242# CONFIG_INET_AH is not set
243# CONFIG_INET_ESP is not set
244# CONFIG_INET_IPCOMP is not set
245CONFIG_INET_TUNNEL=m
246CONFIG_INET_DIAG=y
247CONFIG_INET_TCP_DIAG=y
248# CONFIG_TCP_CONG_ADVANCED is not set
249CONFIG_TCP_CONG_BIC=y
250
251#
252# IP: Virtual Server Configuration
253#
254# CONFIG_IP_VS is not set
255# CONFIG_IPV6 is not set
256CONFIG_NETFILTER=y
257# CONFIG_NETFILTER_DEBUG is not set
258# CONFIG_NETFILTER_NETLINK is not set
259
260#
261# IP: Netfilter Configuration
262#
263# CONFIG_IP_NF_CONNTRACK is not set
264CONFIG_IP_NF_PPTP=m
265# CONFIG_IP_NF_QUEUE is not set
266# CONFIG_IP_NF_IPTABLES is not set
267# CONFIG_IP_NF_ARPTABLES is not set
268
269#
270# DCCP Configuration (EXPERIMENTAL)
271#
272# CONFIG_IP_DCCP is not set
273
274#
275# SCTP Configuration (EXPERIMENTAL)
276#
277# CONFIG_IP_SCTP is not set
278# CONFIG_ATM is not set
279# CONFIG_BRIDGE is not set
280# CONFIG_VLAN_8021Q is not set
281# CONFIG_DECNET is not set
282# CONFIG_LLC2 is not set
283# CONFIG_IPX is not set
284# CONFIG_ATALK is not set
285# CONFIG_X25 is not set
286# CONFIG_LAPB is not set
287# CONFIG_NET_DIVERT is not set
288# CONFIG_ECONET is not set
289# CONFIG_WAN_ROUTER is not set
290# CONFIG_NET_SCHED is not set
291# CONFIG_NET_CLS_ROUTE 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_IEEE80211 is not set
301
302#
303# Device Drivers
304#
305
306#
307# Generic Driver Options
308#
309CONFIG_STANDALONE=y
310CONFIG_PREVENT_FIRMWARE_BUILD=y
311CONFIG_FW_LOADER=y
312
313#
314# Connector - unified userspace <-> kernelspace linker
315#
316# CONFIG_CONNECTOR is not set
317
318#
319# Memory Technology Devices (MTD)
320#
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
326# CONFIG_MTD_CMDLINE_PARTS is not set
327
328#
329# User Modules And Translation Layers
330#
331CONFIG_MTD_CHAR=y
332CONFIG_MTD_BLOCK=y
333# CONFIG_FTL is not set
334# CONFIG_NFTL is not set
335# CONFIG_INFTL is not set
336
337#
338# RAM/ROM/Flash chip drivers
339#
340CONFIG_MTD_CFI=y
341# CONFIG_MTD_JEDECPROBE is not set
342CONFIG_MTD_GEN_PROBE=y
343# CONFIG_MTD_CFI_ADV_OPTIONS is not set
344CONFIG_MTD_MAP_BANK_WIDTH_1=y
345CONFIG_MTD_MAP_BANK_WIDTH_2=y
346CONFIG_MTD_MAP_BANK_WIDTH_4=y
347# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
348# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
349# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
350CONFIG_MTD_CFI_I1=y
351CONFIG_MTD_CFI_I2=y
352# CONFIG_MTD_CFI_I4 is not set
353# CONFIG_MTD_CFI_I8 is not set
354# CONFIG_MTD_CFI_INTELEXT is not set
355CONFIG_MTD_CFI_AMDSTD=y
356CONFIG_MTD_CFI_AMDSTD_RETRY=0
357# CONFIG_MTD_CFI_STAA is not set
358CONFIG_MTD_CFI_UTIL=y
359# CONFIG_MTD_RAM is not set
360# CONFIG_MTD_ROM is not set
361# CONFIG_MTD_ABSENT is not set
362
363#
364# Mapping drivers for chip access
365#
366# CONFIG_MTD_COMPLEX_MAPPINGS is not set
367# CONFIG_MTD_PHYSMAP is not set
368CONFIG_MTD_ALCHEMY=y
369# CONFIG_MTD_PLATRAM is not set
370
371#
372# Self-contained MTD device drivers
373#
374# CONFIG_MTD_SLRAM is not set
375# CONFIG_MTD_PHRAM is not set
376# CONFIG_MTD_MTDRAM is not set
377# CONFIG_MTD_BLKMTD 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
387#
388# NAND Flash Device Drivers
389#
390CONFIG_MTD_NAND=y
391# CONFIG_MTD_NAND_VERIFY_WRITE is not set
392CONFIG_MTD_NAND_IDS=y
393# CONFIG_MTD_NAND_AU1550 is not set
394# CONFIG_MTD_NAND_DISKONCHIP is not set
395# CONFIG_MTD_NAND_NANDSIM is not set
396
397#
398# Parallel port support
399#
400# CONFIG_PARPORT is not set
401
402#
403# Plug and Play support
404#
405
406#
407# Block devices
408#
409# CONFIG_BLK_DEV_COW_COMMON is not set
410CONFIG_BLK_DEV_LOOP=y
411# CONFIG_BLK_DEV_CRYPTOLOOP is not set
412# CONFIG_BLK_DEV_NBD is not set
413CONFIG_BLK_DEV_RAM=y
414CONFIG_BLK_DEV_RAM_COUNT=16
415CONFIG_BLK_DEV_RAM_SIZE=4096
416# CONFIG_BLK_DEV_INITRD is not set
417# CONFIG_LBD is not set
418# CONFIG_CDROM_PKTCDVD is not set
419
420#
421# IO Schedulers
422#
423CONFIG_IOSCHED_NOOP=y
424CONFIG_IOSCHED_AS=y
425CONFIG_IOSCHED_DEADLINE=y
426CONFIG_IOSCHED_CFQ=y
427# CONFIG_ATA_OVER_ETH is not set
428
429#
430# ATA/ATAPI/MFM/RLL support
431#
432CONFIG_IDE=y
433CONFIG_BLK_DEV_IDE=y
434
435#
436# Please see Documentation/ide.txt for help/info on IDE drives
437#
438# CONFIG_BLK_DEV_IDE_SATA is not set
439CONFIG_BLK_DEV_IDEDISK=y
440CONFIG_IDEDISK_MULTI_MODE=y
441CONFIG_BLK_DEV_IDECS=m
442# CONFIG_BLK_DEV_IDECD is not set
443# CONFIG_BLK_DEV_IDETAPE is not set
444# CONFIG_BLK_DEV_IDEFLOPPY is not set
445# CONFIG_BLK_DEV_IDESCSI is not set
446# CONFIG_IDE_TASK_IOCTL is not set
447
448#
449# IDE chipset support/bugfixes
450#
451CONFIG_IDE_GENERIC=y
452CONFIG_BLK_DEV_IDE_AU1XXX=y
453CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA=y
454# CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA is not set
455# CONFIG_BLK_DEV_IDE_AU1XXX_BURSTABLE_ON is not set
456CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ=128
457# CONFIG_IDE_ARM is not set
458# CONFIG_BLK_DEV_IDEDMA is not set
459# CONFIG_IDEDMA_AUTO is not set
460# CONFIG_BLK_DEV_HD is not set
461
462#
463# SCSI device support
464#
465# CONFIG_RAID_ATTRS is not set
466CONFIG_SCSI=y
467CONFIG_SCSI_PROC_FS=y
468
469#
470# SCSI support type (disk, tape, CD-ROM)
471#
472CONFIG_BLK_DEV_SD=y
473# CONFIG_CHR_DEV_ST is not set
474# CONFIG_CHR_DEV_OSST is not set
475CONFIG_BLK_DEV_SR=y
476# CONFIG_BLK_DEV_SR_VENDOR is not set
477CONFIG_CHR_DEV_SG=y
478# CONFIG_CHR_DEV_SCH is not set
479
480#
481# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
482#
483CONFIG_SCSI_MULTI_LUN=y
484# CONFIG_SCSI_CONSTANTS is not set
485# CONFIG_SCSI_LOGGING is not set
486
487#
488# SCSI Transport Attributes
489#
490# CONFIG_SCSI_SPI_ATTRS is not set
491# CONFIG_SCSI_FC_ATTRS is not set
492# CONFIG_SCSI_ISCSI_ATTRS is not set
493# CONFIG_SCSI_SAS_ATTRS is not set
494
495#
496# SCSI low-level drivers
497#
498# CONFIG_SCSI_SATA is not set
499# CONFIG_SCSI_DEBUG is not set
500
501#
502# PCMCIA SCSI adapter support
503#
504# CONFIG_PCMCIA_AHA152X is not set
505# CONFIG_PCMCIA_FDOMAIN is not set
506# CONFIG_PCMCIA_NINJA_SCSI is not set
507# CONFIG_PCMCIA_QLOGIC is not set
508# CONFIG_PCMCIA_SYM53C500 is not set
509
510#
511# Multi-device support (RAID and LVM)
512#
513# CONFIG_MD is not set
514
515#
516# Fusion MPT device support
517#
518# CONFIG_FUSION is not set
519
520#
521# IEEE 1394 (FireWire) support
522#
523
524#
525# I2O device support
526#
527
528#
529# Network device support
530#
531CONFIG_NETDEVICES=y
532# CONFIG_DUMMY is not set
533# CONFIG_BONDING is not set
534# CONFIG_EQUALIZER is not set
535# CONFIG_TUN is not set
536
537#
538# PHY device support
539#
540# CONFIG_PHYLIB is not set
541
542#
543# Ethernet (10 or 100Mbit)
544#
545CONFIG_NET_ETHERNET=y
546CONFIG_MII=m
547# CONFIG_MIPS_AU1X00_ENET is not set
548
549#
550# Ethernet (1000 Mbit)
551#
552
553#
554# Ethernet (10000 Mbit)
555#
556
557#
558# Token Ring devices
559#
560
561#
562# Wireless LAN (non-hamradio)
563#
564# CONFIG_NET_RADIO is not set
565
566#
567# PCMCIA network device support
568#
569# CONFIG_NET_PCMCIA is not set
570
571#
572# Wan interfaces
573#
574# CONFIG_WAN is not set
575# CONFIG_PPP is not set
576# CONFIG_SLIP is not set
577# CONFIG_SHAPER is not set
578# CONFIG_NETCONSOLE is not set
579# CONFIG_NETPOLL is not set
580# CONFIG_NET_POLL_CONTROLLER is not set
581
582#
583# ISDN subsystem
584#
585# CONFIG_ISDN is not set
586
587#
588# Telephony Support
589#
590# CONFIG_PHONE is not set
591
592#
593# Input device support
594#
595CONFIG_INPUT=y
596
597#
598# Userland interfaces
599#
600CONFIG_INPUT_MOUSEDEV=y
601CONFIG_INPUT_MOUSEDEV_PSAUX=y
602CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
603CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
604# CONFIG_INPUT_JOYDEV is not set
605# CONFIG_INPUT_TSDEV is not set
606CONFIG_INPUT_EVDEV=y
607# CONFIG_INPUT_EVBUG is not set
608
609#
610# Input Device Drivers
611#
612# CONFIG_INPUT_KEYBOARD is not set
613# CONFIG_INPUT_MOUSE is not set
614# CONFIG_INPUT_JOYSTICK is not set
615# CONFIG_INPUT_TOUCHSCREEN is not set
616# CONFIG_INPUT_MISC is not set
617
618#
619# Hardware I/O ports
620#
621CONFIG_SERIO=y
622# CONFIG_SERIO_I8042 is not set
623CONFIG_SERIO_SERPORT=y
624# CONFIG_SERIO_LIBPS2 is not set
625CONFIG_SERIO_RAW=y
626# CONFIG_GAMEPORT is not set
627
628#
629# Character devices
630#
631CONFIG_VT=y
632CONFIG_VT_CONSOLE=y
633CONFIG_HW_CONSOLE=y
634# CONFIG_SERIAL_NONSTANDARD is not set
635# CONFIG_AU1X00_GPIO is not set
636# CONFIG_TS_AU1X00_ADS7846 is not set
637
638#
639# Serial drivers
640#
641# CONFIG_SERIAL_8250 is not set
642
643#
644# Non-8250 serial port support
645#
646CONFIG_SERIAL_AU1X00=y
647CONFIG_SERIAL_AU1X00_CONSOLE=y
648CONFIG_SERIAL_CORE=y
649CONFIG_SERIAL_CORE_CONSOLE=y
650CONFIG_UNIX98_PTYS=y
651CONFIG_LEGACY_PTYS=y
652CONFIG_LEGACY_PTY_COUNT=256
653
654#
655# IPMI
656#
657# CONFIG_IPMI_HANDLER is not set
658
659#
660# Watchdog Cards
661#
662# CONFIG_WATCHDOG is not set
663# CONFIG_RTC is not set
664# CONFIG_GEN_RTC is not set
665# CONFIG_DTLK is not set
666# CONFIG_R3964 is not set
667
668#
669# Ftape, the floppy tape device driver
670#
671
672#
673# PCMCIA character devices
674#
675# CONFIG_SYNCLINK_CS is not set
676# CONFIG_RAW_DRIVER is not set
677
678#
679# TPM devices
680#
681
682#
683# I2C support
684#
685# CONFIG_I2C is not set
686
687#
688# Dallas's 1-wire bus
689#
690# CONFIG_W1 is not set
691
692#
693# Hardware Monitoring support
694#
695# CONFIG_HWMON is not set
696# CONFIG_HWMON_VID is not set
697
698#
699# Misc devices
700#
701
702#
703# Multimedia Capabilities Port drivers
704#
705
706#
707# Multimedia devices
708#
709# CONFIG_VIDEO_DEV is not set
710
711#
712# Digital Video Broadcasting Devices
713#
714# CONFIG_DVB is not set
715
716#
717# Graphics support
718#
719CONFIG_FB=y
720CONFIG_FB_CFB_FILLRECT=y
721CONFIG_FB_CFB_COPYAREA=y
722CONFIG_FB_CFB_IMAGEBLIT=y
723CONFIG_FB_SOFT_CURSOR=y
724# CONFIG_FB_MACMODES is not set
725# CONFIG_FB_MODE_HELPERS is not set
726# CONFIG_FB_TILEBLITTING is not set
727CONFIG_FB_AU1200=y
728# CONFIG_FB_S1D13XXX is not set
729# CONFIG_FB_VIRTUAL is not set
730
731#
732# Console display driver support
733#
734CONFIG_VGA_CONSOLE=y
735CONFIG_DUMMY_CONSOLE=y
736# CONFIG_FRAMEBUFFER_CONSOLE is not set
737
738#
739# Logo configuration
740#
741CONFIG_LOGO=y
742CONFIG_LOGO_LINUX_MONO=y
743CONFIG_LOGO_LINUX_VGA16=y
744CONFIG_LOGO_LINUX_CLUT224=y
745# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
746
747#
748# Sound
749#
750# CONFIG_SOUND is not set
751
752#
753# USB support
754#
755CONFIG_USB_ARCH_HAS_HCD=y
756CONFIG_USB_ARCH_HAS_OHCI=y
757# CONFIG_USB is not set
758
759#
760# USB Gadget Support
761#
762CONFIG_USB_GADGET=m
763# CONFIG_USB_GADGET_DEBUG_FILES is not set
764# CONFIG_USB_GADGET_NET2280 is not set
765# CONFIG_USB_GADGET_PXA2XX is not set
766# CONFIG_USB_GADGET_GOKU is not set
767# CONFIG_USB_GADGET_LH7A40X is not set
768# CONFIG_USB_GADGET_OMAP is not set
769# CONFIG_USB_GADGET_DUMMY_HCD is not set
770# CONFIG_USB_GADGET_DUALSPEED is not set
771
772#
773# MMC/SD Card support
774#
775CONFIG_MMC=y
776# CONFIG_MMC_DEBUG is not set
777CONFIG_MMC_BLOCK=y
778CONFIG_MMC_AU1X=y
779
780#
781# InfiniBand support
782#
783
784#
785# SN Devices
786#
787
788#
789# File systems
790#
791CONFIG_EXT2_FS=y
792CONFIG_EXT2_FS_XATTR=y
793CONFIG_EXT2_FS_POSIX_ACL=y
794# CONFIG_EXT2_FS_SECURITY is not set
795# CONFIG_EXT2_FS_XIP is not set
796CONFIG_EXT3_FS=y
797CONFIG_EXT3_FS_XATTR=y
798CONFIG_EXT3_FS_POSIX_ACL=y
799CONFIG_EXT3_FS_SECURITY=y
800CONFIG_JBD=y
801# CONFIG_JBD_DEBUG is not set
802CONFIG_FS_MBCACHE=y
803# CONFIG_REISERFS_FS is not set
804CONFIG_JFS_FS=y
805# CONFIG_JFS_POSIX_ACL is not set
806# CONFIG_JFS_SECURITY is not set
807# CONFIG_JFS_DEBUG is not set
808# CONFIG_JFS_STATISTICS is not set
809CONFIG_FS_POSIX_ACL=y
810# CONFIG_XFS_FS is not set
811# CONFIG_MINIX_FS is not set
812# CONFIG_ROMFS_FS is not set
813CONFIG_INOTIFY=y
814# CONFIG_QUOTA is not set
815CONFIG_DNOTIFY=y
816# CONFIG_AUTOFS_FS is not set
817# CONFIG_AUTOFS4_FS is not set
818# CONFIG_FUSE_FS is not set
819
820#
821# CD-ROM/DVD Filesystems
822#
823CONFIG_ISO9660_FS=m
824CONFIG_JOLIET=y
825CONFIG_ZISOFS=y
826CONFIG_ZISOFS_FS=m
827CONFIG_UDF_FS=m
828CONFIG_UDF_NLS=y
829
830#
831# DOS/FAT/NT Filesystems
832#
833CONFIG_FAT_FS=m
834CONFIG_MSDOS_FS=m
835CONFIG_VFAT_FS=m
836CONFIG_FAT_DEFAULT_CODEPAGE=437
837CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
838# CONFIG_NTFS_FS is not set
839
840#
841# Pseudo filesystems
842#
843CONFIG_PROC_FS=y
844CONFIG_PROC_KCORE=y
845CONFIG_SYSFS=y
846CONFIG_TMPFS=y
847# CONFIG_HUGETLB_PAGE is not set
848CONFIG_RAMFS=y
849# CONFIG_RELAYFS_FS is not set
850
851#
852# Miscellaneous filesystems
853#
854# CONFIG_ADFS_FS is not set
855# CONFIG_AFFS_FS is not set
856# CONFIG_HFS_FS is not set
857# CONFIG_HFSPLUS_FS is not set
858# CONFIG_BEFS_FS is not set
859# CONFIG_BFS_FS is not set
860# CONFIG_EFS_FS is not set
861# CONFIG_JFFS_FS is not set
862CONFIG_JFFS2_FS=y
863CONFIG_JFFS2_FS_DEBUG=0
864CONFIG_JFFS2_FS_WRITEBUFFER=y
865# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
866CONFIG_JFFS2_ZLIB=y
867CONFIG_JFFS2_RTIME=y
868# CONFIG_JFFS2_RUBIN is not set
869CONFIG_CRAMFS=m
870# CONFIG_VXFS_FS is not set
871# CONFIG_HPFS_FS is not set
872# CONFIG_QNX4FS_FS is not set
873# CONFIG_SYSV_FS is not set
874# CONFIG_UFS_FS is not set
875
876#
877# Network File Systems
878#
879CONFIG_NFS_FS=y
880CONFIG_NFS_V3=y
881# CONFIG_NFS_V3_ACL is not set
882# CONFIG_NFS_V4 is not set
883# CONFIG_NFS_DIRECTIO is not set
884# CONFIG_NFSD is not set
885CONFIG_LOCKD=y
886CONFIG_LOCKD_V4=y
887CONFIG_NFS_COMMON=y
888CONFIG_SUNRPC=y
889# CONFIG_RPCSEC_GSS_KRB5 is not set
890# CONFIG_RPCSEC_GSS_SPKM3 is not set
891CONFIG_SMB_FS=y
892# CONFIG_SMB_NLS_DEFAULT is not set
893# CONFIG_CIFS is not set
894# CONFIG_NCP_FS is not set
895# CONFIG_CODA_FS is not set
896# CONFIG_AFS_FS is not set
897# CONFIG_9P_FS is not set
898
899#
900# Partition Types
901#
902# CONFIG_PARTITION_ADVANCED is not set
903CONFIG_MSDOS_PARTITION=y
904
905#
906# Native Language Support
907#
908CONFIG_NLS=y
909CONFIG_NLS_DEFAULT="iso8859-1"
910CONFIG_NLS_CODEPAGE_437=m
911CONFIG_NLS_CODEPAGE_737=m
912CONFIG_NLS_CODEPAGE_775=m
913CONFIG_NLS_CODEPAGE_850=m
914CONFIG_NLS_CODEPAGE_852=m
915CONFIG_NLS_CODEPAGE_855=m
916CONFIG_NLS_CODEPAGE_857=m
917CONFIG_NLS_CODEPAGE_860=m
918CONFIG_NLS_CODEPAGE_861=m
919CONFIG_NLS_CODEPAGE_862=m
920CONFIG_NLS_CODEPAGE_863=m
921CONFIG_NLS_CODEPAGE_864=m
922CONFIG_NLS_CODEPAGE_865=m
923CONFIG_NLS_CODEPAGE_866=m
924CONFIG_NLS_CODEPAGE_869=m
925CONFIG_NLS_CODEPAGE_936=m
926CONFIG_NLS_CODEPAGE_950=m
927CONFIG_NLS_CODEPAGE_932=m
928CONFIG_NLS_CODEPAGE_949=m
929CONFIG_NLS_CODEPAGE_874=m
930CONFIG_NLS_ISO8859_8=m
931CONFIG_NLS_CODEPAGE_1250=m
932CONFIG_NLS_CODEPAGE_1251=m
933CONFIG_NLS_ASCII=m
934CONFIG_NLS_ISO8859_1=m
935CONFIG_NLS_ISO8859_2=m
936CONFIG_NLS_ISO8859_3=m
937CONFIG_NLS_ISO8859_4=m
938CONFIG_NLS_ISO8859_5=m
939CONFIG_NLS_ISO8859_6=m
940CONFIG_NLS_ISO8859_7=m
941CONFIG_NLS_ISO8859_9=m
942CONFIG_NLS_ISO8859_13=m
943CONFIG_NLS_ISO8859_14=m
944CONFIG_NLS_ISO8859_15=m
945CONFIG_NLS_KOI8_R=m
946CONFIG_NLS_KOI8_U=m
947CONFIG_NLS_UTF8=m
948
949#
950# Profiling support
951#
952# CONFIG_PROFILING is not set
953
954#
955# Kernel hacking
956#
957# CONFIG_PRINTK_TIME is not set
958# CONFIG_DEBUG_KERNEL is not set
959CONFIG_LOG_BUF_SHIFT=14
960CONFIG_CROSSCOMPILE=y
961CONFIG_CMDLINE="mem=48M"
962
963#
964# Security options
965#
966CONFIG_KEYS=y
967CONFIG_KEYS_DEBUG_PROC_KEYS=y
968# CONFIG_SECURITY is not set
969
970#
971# Cryptographic options
972#
973# CONFIG_CRYPTO is not set
974
975#
976# Hardware crypto devices
977#
978
979#
980# Library routines
981#
982CONFIG_CRC_CCITT=y
983# CONFIG_CRC16 is not set
984CONFIG_CRC32=y
985CONFIG_LIBCRC32C=y
986CONFIG_ZLIB_INFLATE=y
987CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/mips/configs/db1500_defconfig b/arch/mips/configs/db1500_defconfig
index fed6f2fab48b..1c2784dee697 100644
--- a/arch/mips/configs/db1500_defconfig
+++ b/arch/mips/configs/db1500_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:01 2005 4# Thu Oct 20 22:25:36 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,24 +11,29 @@ CONFIG_32BIT=y
14CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
25# CONFIG_BSD_PROCESS_ACCT is not set 24# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y 25CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set 26# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14
29CONFIG_HOTPLUG=y 27CONFIG_HOTPLUG=y
30CONFIG_KOBJECT_UEVENT=y 28CONFIG_KOBJECT_UEVENT=y
31# CONFIG_IKCONFIG is not set 29# CONFIG_IKCONFIG is not set
30CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y 31CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y 32CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_EXTRA_PASS is not set 33# CONFIG_KALLSYMS_EXTRA_PASS is not set
34CONFIG_PRINTK=y
35CONFIG_BUG=y
36CONFIG_BASE_FULL=y
35CONFIG_FUTEX=y 37CONFIG_FUTEX=y
36CONFIG_EPOLL=y 38CONFIG_EPOLL=y
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -41,6 +43,7 @@ CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0 43CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0 44CONFIG_CC_ALIGN_JUMPS=0
43# CONFIG_TINY_SHMEM is not set 45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
44 47
45# 48#
46# Loadable module support 49# Loadable module support
@@ -56,63 +59,81 @@ CONFIG_KMOD=y
56# 59#
57# Machine selection 60# Machine selection
58# 61#
59# CONFIG_MACH_JAZZ is not set 62# CONFIG_MIPS_MTX1 is not set
60# CONFIG_MACH_VR41XX is not set 63# CONFIG_MIPS_BOSPORUS is not set
61# CONFIG_TOSHIBA_JMR3927 is not set 64# CONFIG_MIPS_PB1000 is not set
65# CONFIG_MIPS_PB1100 is not set
66# CONFIG_MIPS_PB1500 is not set
67# CONFIG_MIPS_PB1550 is not set
68# CONFIG_MIPS_PB1200 is not set
69# CONFIG_MIPS_DB1000 is not set
70# CONFIG_MIPS_DB1100 is not set
71CONFIG_MIPS_DB1500=y
72# CONFIG_MIPS_DB1550 is not set
73# CONFIG_MIPS_DB1200 is not set
74# CONFIG_MIPS_MIRAGE is not set
62# CONFIG_MIPS_COBALT is not set 75# CONFIG_MIPS_COBALT is not set
63# CONFIG_MACH_DECSTATION is not set 76# CONFIG_MACH_DECSTATION is not set
64# CONFIG_MIPS_EV64120 is not set 77# CONFIG_MIPS_EV64120 is not set
65# CONFIG_MIPS_EV96100 is not set 78# CONFIG_MIPS_EV96100 is not set
66# CONFIG_MIPS_IVR is not set 79# CONFIG_MIPS_IVR is not set
67# CONFIG_LASAT is not set
68# CONFIG_MIPS_ITE8172 is not set 80# CONFIG_MIPS_ITE8172 is not set
81# CONFIG_MACH_JAZZ is not set
82# CONFIG_LASAT is not set
69# CONFIG_MIPS_ATLAS is not set 83# CONFIG_MIPS_ATLAS is not set
70# CONFIG_MIPS_MALTA is not set 84# CONFIG_MIPS_MALTA is not set
71# CONFIG_MIPS_SEAD is not set 85# CONFIG_MIPS_SEAD is not set
86# CONFIG_MIPS_SIM is not set
87# CONFIG_MOMENCO_JAGUAR_ATX is not set
72# CONFIG_MOMENCO_OCELOT is not set 88# CONFIG_MOMENCO_OCELOT is not set
73# CONFIG_MOMENCO_OCELOT_G is not set
74# CONFIG_MOMENCO_OCELOT_C is not set
75# CONFIG_MOMENCO_OCELOT_3 is not set 89# CONFIG_MOMENCO_OCELOT_3 is not set
76# CONFIG_MOMENCO_JAGUAR_ATX is not set 90# CONFIG_MOMENCO_OCELOT_C is not set
77# CONFIG_PMC_YOSEMITE is not set 91# CONFIG_MOMENCO_OCELOT_G is not set
92# CONFIG_MIPS_XXS1500 is not set
93# CONFIG_PNX8550_V2PCI is not set
94# CONFIG_PNX8550_JBS is not set
78# CONFIG_DDB5074 is not set 95# CONFIG_DDB5074 is not set
79# CONFIG_DDB5476 is not set 96# CONFIG_DDB5476 is not set
80# CONFIG_DDB5477 is not set 97# CONFIG_DDB5477 is not set
81# CONFIG_NEC_OSPREY is not set 98# CONFIG_MACH_VR41XX is not set
99# CONFIG_PMC_YOSEMITE is not set
100# CONFIG_QEMU is not set
82# CONFIG_SGI_IP22 is not set 101# CONFIG_SGI_IP22 is not set
83CONFIG_SOC_AU1X00=y 102# CONFIG_SGI_IP27 is not set
84# CONFIG_SOC_AU1000 is not set 103# CONFIG_SGI_IP32 is not set
85# CONFIG_SOC_AU1100 is not set 104# CONFIG_SIBYTE_BIGSUR is not set
86CONFIG_SOC_AU1500=y 105# CONFIG_SIBYTE_SWARM is not set
87# CONFIG_SOC_AU1550 is not set 106# CONFIG_SIBYTE_SENTOSA is not set
88# CONFIG_MIPS_PB1000 is not set 107# CONFIG_SIBYTE_RHONE is not set
89# CONFIG_MIPS_PB1100 is not set 108# CONFIG_SIBYTE_CARMEL is not set
90# CONFIG_MIPS_PB1500 is not set 109# CONFIG_SIBYTE_PTSWARM is not set
91# CONFIG_MIPS_PB1550 is not set 110# CONFIG_SIBYTE_LITTLESUR is not set
92# CONFIG_MIPS_DB1000 is not set 111# CONFIG_SIBYTE_CRHINE is not set
93# CONFIG_MIPS_DB1100 is not set 112# CONFIG_SIBYTE_CRHONE is not set
94CONFIG_MIPS_DB1500=y
95# CONFIG_MIPS_DB1550 is not set
96# CONFIG_MIPS_BOSPORUS is not set
97# CONFIG_MIPS_MIRAGE is not set
98# CONFIG_MIPS_XXS1500 is not set
99# CONFIG_MIPS_MTX1 is not set
100# CONFIG_SIBYTE_SB1xxx_SOC is not set
101# CONFIG_SNI_RM200_PCI is not set 113# CONFIG_SNI_RM200_PCI is not set
114# CONFIG_TOSHIBA_JMR3927 is not set
102# CONFIG_TOSHIBA_RBTX4927 is not set 115# CONFIG_TOSHIBA_RBTX4927 is not set
116# CONFIG_TOSHIBA_RBTX4938 is not set
103CONFIG_RWSEM_GENERIC_SPINLOCK=y 117CONFIG_RWSEM_GENERIC_SPINLOCK=y
104CONFIG_GENERIC_CALIBRATE_DELAY=y 118CONFIG_GENERIC_CALIBRATE_DELAY=y
105CONFIG_HAVE_DEC_LOCK=y 119CONFIG_DMA_NONCOHERENT=y
106CONFIG_DMA_COHERENT=y 120CONFIG_DMA_NEED_PCI_MAP_STATE=y
107CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y 121CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y
122# CONFIG_CPU_BIG_ENDIAN is not set
108CONFIG_CPU_LITTLE_ENDIAN=y 123CONFIG_CPU_LITTLE_ENDIAN=y
124CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
125CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
126CONFIG_SOC_AU1500=y
127CONFIG_SOC_AU1X00=y
109CONFIG_MIPS_L1_CACHE_SHIFT=5 128CONFIG_MIPS_L1_CACHE_SHIFT=5
110 129
111# 130#
112# CPU selection 131# CPU selection
113# 132#
114CONFIG_CPU_MIPS32=y 133CONFIG_CPU_MIPS32_R1=y
115# CONFIG_CPU_MIPS64 is not set 134# CONFIG_CPU_MIPS32_R2 is not set
135# CONFIG_CPU_MIPS64_R1 is not set
136# CONFIG_CPU_MIPS64_R2 is not set
116# CONFIG_CPU_R3000 is not set 137# CONFIG_CPU_R3000 is not set
117# CONFIG_CPU_TX39XX is not set 138# CONFIG_CPU_TX39XX is not set
118# CONFIG_CPU_VR41XX is not set 139# CONFIG_CPU_VR41XX is not set
@@ -128,15 +149,39 @@ CONFIG_CPU_MIPS32=y
128# CONFIG_CPU_RM7000 is not set 149# CONFIG_CPU_RM7000 is not set
129# CONFIG_CPU_RM9000 is not set 150# CONFIG_CPU_RM9000 is not set
130# CONFIG_CPU_SB1 is not set 151# CONFIG_CPU_SB1 is not set
152CONFIG_SYS_HAS_CPU_MIPS32_R1=y
153CONFIG_CPU_MIPS32=y
154CONFIG_CPU_MIPSR1=y
155CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
156CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
157
158#
159# Kernel type
160#
161CONFIG_32BIT=y
162# CONFIG_64BIT is not set
131CONFIG_PAGE_SIZE_4KB=y 163CONFIG_PAGE_SIZE_4KB=y
132# CONFIG_PAGE_SIZE_8KB is not set 164# CONFIG_PAGE_SIZE_8KB is not set
133# CONFIG_PAGE_SIZE_16KB is not set 165# CONFIG_PAGE_SIZE_16KB is not set
134# CONFIG_PAGE_SIZE_64KB is not set 166# CONFIG_PAGE_SIZE_64KB is not set
135CONFIG_CPU_HAS_PREFETCH=y 167CONFIG_CPU_HAS_PREFETCH=y
168# CONFIG_MIPS_MT is not set
136CONFIG_64BIT_PHYS_ADDR=y 169CONFIG_64BIT_PHYS_ADDR=y
137# CONFIG_CPU_ADVANCED is not set 170# CONFIG_CPU_ADVANCED is not set
138CONFIG_CPU_HAS_LLSC=y 171CONFIG_CPU_HAS_LLSC=y
139CONFIG_CPU_HAS_SYNC=y 172CONFIG_CPU_HAS_SYNC=y
173CONFIG_GENERIC_HARDIRQS=y
174CONFIG_GENERIC_IRQ_PROBE=y
175CONFIG_ARCH_FLATMEM_ENABLE=y
176CONFIG_SELECT_MEMORY_MODEL=y
177CONFIG_FLATMEM_MANUAL=y
178# CONFIG_DISCONTIGMEM_MANUAL is not set
179# CONFIG_SPARSEMEM_MANUAL is not set
180CONFIG_FLATMEM=y
181CONFIG_FLAT_NODE_MEM_MAP=y
182# CONFIG_SPARSEMEM_STATIC is not set
183CONFIG_PREEMPT_NONE=y
184# CONFIG_PREEMPT_VOLUNTARY is not set
140# CONFIG_PREEMPT is not set 185# CONFIG_PREEMPT is not set
141 186
142# 187#
@@ -145,7 +190,6 @@ CONFIG_CPU_HAS_SYNC=y
145CONFIG_HW_HAS_PCI=y 190CONFIG_HW_HAS_PCI=y
146CONFIG_PCI=y 191CONFIG_PCI=y
147CONFIG_PCI_LEGACY_PROC=y 192CONFIG_PCI_LEGACY_PROC=y
148CONFIG_PCI_NAMES=y
149CONFIG_MMU=y 193CONFIG_MMU=y
150 194
151# 195#
@@ -154,6 +198,8 @@ CONFIG_MMU=y
154CONFIG_PCCARD=m 198CONFIG_PCCARD=m
155# CONFIG_PCMCIA_DEBUG is not set 199# CONFIG_PCMCIA_DEBUG is not set
156CONFIG_PCMCIA=m 200CONFIG_PCMCIA=m
201CONFIG_PCMCIA_LOAD_CIS=y
202CONFIG_PCMCIA_IOCTL=y
157CONFIG_CARDBUS=y 203CONFIG_CARDBUS=y
158 204
159# 205#
@@ -176,6 +222,100 @@ CONFIG_PCMCIA_AU1X00=m
176CONFIG_BINFMT_ELF=y 222CONFIG_BINFMT_ELF=y
177# CONFIG_BINFMT_MISC is not set 223# CONFIG_BINFMT_MISC is not set
178CONFIG_TRAD_SIGNALS=y 224CONFIG_TRAD_SIGNALS=y
225# CONFIG_PM is not set
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=m
240CONFIG_NET_KEY=y
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
247CONFIG_IP_PNP_BOOTP=y
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
253# CONFIG_SYN_COOKIES is not set
254# CONFIG_INET_AH is not set
255# CONFIG_INET_ESP is not set
256# CONFIG_INET_IPCOMP is not set
257CONFIG_INET_TUNNEL=m
258CONFIG_INET_DIAG=y
259CONFIG_INET_TCP_DIAG=y
260# CONFIG_TCP_CONG_ADVANCED is not set
261CONFIG_TCP_CONG_BIC=y
262
263#
264# IP: Virtual Server Configuration
265#
266# CONFIG_IP_VS is not set
267# CONFIG_IPV6 is not set
268CONFIG_NETFILTER=y
269# CONFIG_NETFILTER_DEBUG is not set
270CONFIG_NETFILTER_NETLINK=m
271CONFIG_NETFILTER_NETLINK_QUEUE=m
272CONFIG_NETFILTER_NETLINK_LOG=m
273
274#
275# IP: Netfilter Configuration
276#
277# CONFIG_IP_NF_CONNTRACK is not set
278CONFIG_IP_NF_PPTP=m
279# CONFIG_IP_NF_QUEUE is not set
280# CONFIG_IP_NF_IPTABLES is not set
281# CONFIG_IP_NF_ARPTABLES is not set
282
283#
284# DCCP Configuration (EXPERIMENTAL)
285#
286# CONFIG_IP_DCCP is not set
287
288#
289# SCTP Configuration (EXPERIMENTAL)
290#
291# CONFIG_IP_SCTP is not set
292# CONFIG_ATM is not set
293# CONFIG_BRIDGE is not set
294# CONFIG_VLAN_8021Q is not set
295# CONFIG_DECNET is not set
296# CONFIG_LLC2 is not set
297# CONFIG_IPX is not set
298# CONFIG_ATALK is not set
299# CONFIG_X25 is not set
300# CONFIG_LAPB is not set
301# CONFIG_NET_DIVERT is not set
302# CONFIG_ECONET is not set
303# CONFIG_WAN_ROUTER is not set
304# CONFIG_NET_SCHED is not set
305# CONFIG_NET_CLS_ROUTE is not set
306
307#
308# Network testing
309#
310# CONFIG_NET_PKTGEN is not set
311# CONFIG_HAMRADIO is not set
312# CONFIG_IRDA is not set
313# CONFIG_BT is not set
314CONFIG_IEEE80211=m
315# CONFIG_IEEE80211_DEBUG is not set
316CONFIG_IEEE80211_CRYPT_WEP=m
317CONFIG_IEEE80211_CRYPT_CCMP=m
318CONFIG_IEEE80211_CRYPT_TKIP=m
179 319
180# 320#
181# Device Drivers 321# Device Drivers
@@ -186,15 +326,20 @@ CONFIG_TRAD_SIGNALS=y
186# 326#
187CONFIG_STANDALONE=y 327CONFIG_STANDALONE=y
188CONFIG_PREVENT_FIRMWARE_BUILD=y 328CONFIG_PREVENT_FIRMWARE_BUILD=y
189# CONFIG_FW_LOADER is not set 329CONFIG_FW_LOADER=m
330
331#
332# Connector - unified userspace <-> kernelspace linker
333#
334CONFIG_CONNECTOR=m
190 335
191# 336#
192# Memory Technology Devices (MTD) 337# Memory Technology Devices (MTD)
193# 338#
194CONFIG_MTD=y 339CONFIG_MTD=y
195# CONFIG_MTD_DEBUG is not set 340# CONFIG_MTD_DEBUG is not set
196CONFIG_MTD_PARTITIONS=y
197# CONFIG_MTD_CONCAT is not set 341# CONFIG_MTD_CONCAT is not set
342CONFIG_MTD_PARTITIONS=y
198# CONFIG_MTD_REDBOOT_PARTS is not set 343# CONFIG_MTD_REDBOOT_PARTS is not set
199# CONFIG_MTD_CMDLINE_PARTS is not set 344# CONFIG_MTD_CMDLINE_PARTS is not set
200 345
@@ -232,16 +377,14 @@ CONFIG_MTD_CFI_UTIL=y
232# CONFIG_MTD_RAM is not set 377# CONFIG_MTD_RAM is not set
233# CONFIG_MTD_ROM is not set 378# CONFIG_MTD_ROM is not set
234# CONFIG_MTD_ABSENT is not set 379# CONFIG_MTD_ABSENT is not set
235# CONFIG_MTD_XIP is not set
236 380
237# 381#
238# Mapping drivers for chip access 382# Mapping drivers for chip access
239# 383#
240# CONFIG_MTD_COMPLEX_MAPPINGS is not set 384# CONFIG_MTD_COMPLEX_MAPPINGS is not set
241# CONFIG_MTD_PHYSMAP is not set 385# CONFIG_MTD_PHYSMAP is not set
242CONFIG_MTD_DB1X00=y 386CONFIG_MTD_ALCHEMY=y
243CONFIG_MTD_DB1X00_BOOT=y 387# CONFIG_MTD_PLATRAM is not set
244CONFIG_MTD_DB1X00_USER=y
245 388
246# 389#
247# Self-contained MTD device drivers 390# Self-contained MTD device drivers
@@ -277,7 +420,6 @@ CONFIG_MTD_DB1X00_USER=y
277# 420#
278# Block devices 421# Block devices
279# 422#
280# CONFIG_BLK_DEV_FD is not set
281# CONFIG_BLK_CPQ_DA is not set 423# CONFIG_BLK_CPQ_DA is not set
282# CONFIG_BLK_CPQ_CISS_DA is not set 424# CONFIG_BLK_CPQ_CISS_DA is not set
283# CONFIG_BLK_DEV_DAC960 is not set 425# CONFIG_BLK_DEV_DAC960 is not set
@@ -290,7 +432,6 @@ CONFIG_BLK_DEV_LOOP=y
290# CONFIG_BLK_DEV_UB is not set 432# CONFIG_BLK_DEV_UB is not set
291# CONFIG_BLK_DEV_RAM is not set 433# CONFIG_BLK_DEV_RAM is not set
292CONFIG_BLK_DEV_RAM_COUNT=16 434CONFIG_BLK_DEV_RAM_COUNT=16
293CONFIG_INITRAMFS_SOURCE=""
294# CONFIG_LBD is not set 435# CONFIG_LBD is not set
295CONFIG_CDROM_PKTCDVD=m 436CONFIG_CDROM_PKTCDVD=m
296CONFIG_CDROM_PKTCDVD_BUFFERS=8 437CONFIG_CDROM_PKTCDVD_BUFFERS=8
@@ -336,6 +477,7 @@ CONFIG_BLK_DEV_IDECS=m
336# 477#
337# SCSI device support 478# SCSI device support
338# 479#
480CONFIG_RAID_ATTRS=m
339# CONFIG_SCSI is not set 481# CONFIG_SCSI is not set
340 482
341# 483#
@@ -346,6 +488,7 @@ CONFIG_BLK_DEV_IDECS=m
346# 488#
347# Fusion MPT device support 489# Fusion MPT device support
348# 490#
491# CONFIG_FUSION is not set
349 492
350# 493#
351# IEEE 1394 (FireWire) support 494# IEEE 1394 (FireWire) support
@@ -358,94 +501,13 @@ CONFIG_BLK_DEV_IDECS=m
358# CONFIG_I2O is not set 501# CONFIG_I2O is not set
359 502
360# 503#
361# Networking support 504# Network device support
362#
363CONFIG_NET=y
364
365#
366# Networking options
367#
368CONFIG_PACKET=y
369# CONFIG_PACKET_MMAP is not set
370CONFIG_NETLINK_DEV=y
371CONFIG_UNIX=y
372CONFIG_NET_KEY=y
373CONFIG_INET=y
374CONFIG_IP_MULTICAST=y
375# CONFIG_IP_ADVANCED_ROUTER is not set
376CONFIG_IP_PNP=y
377# CONFIG_IP_PNP_DHCP is not set
378CONFIG_IP_PNP_BOOTP=y
379# CONFIG_IP_PNP_RARP is not set
380# CONFIG_NET_IPIP is not set
381# CONFIG_NET_IPGRE is not set
382# CONFIG_IP_MROUTE is not set
383# CONFIG_ARPD is not set
384# CONFIG_SYN_COOKIES is not set
385# CONFIG_INET_AH is not set
386# CONFIG_INET_ESP is not set
387# CONFIG_INET_IPCOMP is not set
388CONFIG_INET_TUNNEL=m
389CONFIG_IP_TCPDIAG=m
390# CONFIG_IP_TCPDIAG_IPV6 is not set
391
392#
393# IP: Virtual Server Configuration
394# 505#
395# CONFIG_IP_VS is not set
396# CONFIG_IPV6 is not set
397CONFIG_NETFILTER=y
398# CONFIG_NETFILTER_DEBUG is not set
399
400#
401# IP: Netfilter Configuration
402#
403# CONFIG_IP_NF_CONNTRACK is not set
404CONFIG_IP_NF_CONNTRACK_MARK=y
405# CONFIG_IP_NF_QUEUE is not set
406# CONFIG_IP_NF_IPTABLES is not set
407# CONFIG_IP_NF_ARPTABLES is not set
408CONFIG_XFRM=y
409CONFIG_XFRM_USER=m
410
411#
412# SCTP Configuration (EXPERIMENTAL)
413#
414# CONFIG_IP_SCTP is not set
415# CONFIG_ATM is not set
416# CONFIG_BRIDGE is not set
417# CONFIG_VLAN_8021Q is not set
418# CONFIG_DECNET is not set
419# CONFIG_LLC2 is not set
420# CONFIG_IPX is not set
421# CONFIG_ATALK is not set
422# CONFIG_X25 is not set
423# CONFIG_LAPB is not set
424# CONFIG_NET_DIVERT is not set
425# CONFIG_ECONET is not set
426# CONFIG_WAN_ROUTER is not set
427
428#
429# QoS and/or fair queueing
430#
431# CONFIG_NET_SCHED is not set
432# CONFIG_NET_CLS_ROUTE is not set
433
434#
435# Network testing
436#
437# CONFIG_NET_PKTGEN is not set
438# CONFIG_NETPOLL is not set
439# CONFIG_NET_POLL_CONTROLLER is not set
440# CONFIG_HAMRADIO is not set
441# CONFIG_IRDA is not set
442# CONFIG_BT is not set
443CONFIG_NETDEVICES=y 506CONFIG_NETDEVICES=y
444# CONFIG_DUMMY is not set 507# CONFIG_DUMMY is not set
445# CONFIG_BONDING is not set 508# CONFIG_BONDING is not set
446# CONFIG_EQUALIZER is not set 509# CONFIG_EQUALIZER is not set
447# CONFIG_TUN is not set 510# CONFIG_TUN is not set
448# CONFIG_ETHERTAP is not set
449 511
450# 512#
451# ARCnet devices 513# ARCnet devices
@@ -453,6 +515,21 @@ CONFIG_NETDEVICES=y
453# CONFIG_ARCNET is not set 515# CONFIG_ARCNET is not set
454 516
455# 517#
518# PHY device support
519#
520CONFIG_PHYLIB=m
521CONFIG_PHYCONTROL=y
522
523#
524# MII PHY device drivers
525#
526CONFIG_MARVELL_PHY=m
527CONFIG_DAVICOM_PHY=m
528CONFIG_QSEMI_PHY=m
529CONFIG_LXT_PHY=m
530CONFIG_CICADA_PHY=m
531
532#
456# Ethernet (10 or 100Mbit) 533# Ethernet (10 or 100Mbit)
457# 534#
458CONFIG_NET_ETHERNET=y 535CONFIG_NET_ETHERNET=y
@@ -479,12 +556,16 @@ CONFIG_MIPS_AU1X00_ENET=y
479# CONFIG_HAMACHI is not set 556# CONFIG_HAMACHI is not set
480# CONFIG_YELLOWFIN is not set 557# CONFIG_YELLOWFIN is not set
481# CONFIG_R8169 is not set 558# CONFIG_R8169 is not set
559# CONFIG_SIS190 is not set
560# CONFIG_SKGE is not set
482# CONFIG_SK98LIN is not set 561# CONFIG_SK98LIN is not set
483# CONFIG_TIGON3 is not set 562# CONFIG_TIGON3 is not set
563# CONFIG_BNX2 is not set
484 564
485# 565#
486# Ethernet (10000 Mbit) 566# Ethernet (10000 Mbit)
487# 567#
568# CONFIG_CHELSIO_T1 is not set
488# CONFIG_IXGB is not set 569# CONFIG_IXGB is not set
489# CONFIG_S2IO is not set 570# CONFIG_S2IO is not set
490 571
@@ -497,6 +578,8 @@ CONFIG_MIPS_AU1X00_ENET=y
497# Wireless LAN (non-hamradio) 578# Wireless LAN (non-hamradio)
498# 579#
499# CONFIG_NET_RADIO is not set 580# CONFIG_NET_RADIO is not set
581# CONFIG_IPW_DEBUG is not set
582CONFIG_IPW2200=m
500 583
501# 584#
502# PCMCIA network device support 585# PCMCIA network device support
@@ -520,6 +603,8 @@ CONFIG_PPPOE=m
520# CONFIG_SLIP is not set 603# CONFIG_SLIP is not set
521# CONFIG_SHAPER is not set 604# CONFIG_SHAPER is not set
522# CONFIG_NETCONSOLE is not set 605# CONFIG_NETCONSOLE is not set
606# CONFIG_NETPOLL is not set
607# CONFIG_NET_POLL_CONTROLLER is not set
523 608
524# 609#
525# ISDN subsystem 610# ISDN subsystem
@@ -549,19 +634,6 @@ CONFIG_INPUT_EVDEV=y
549# CONFIG_INPUT_EVBUG is not set 634# CONFIG_INPUT_EVBUG is not set
550 635
551# 636#
552# Input I/O drivers
553#
554# CONFIG_GAMEPORT is not set
555CONFIG_SOUND_GAMEPORT=y
556CONFIG_SERIO=y
557# CONFIG_SERIO_I8042 is not set
558CONFIG_SERIO_SERPORT=y
559# CONFIG_SERIO_CT82C710 is not set
560# CONFIG_SERIO_PCIPS2 is not set
561# CONFIG_SERIO_LIBPS2 is not set
562CONFIG_SERIO_RAW=m
563
564#
565# Input Device Drivers 637# Input Device Drivers
566# 638#
567# CONFIG_INPUT_KEYBOARD is not set 639# CONFIG_INPUT_KEYBOARD is not set
@@ -571,6 +643,17 @@ CONFIG_SERIO_RAW=m
571# CONFIG_INPUT_MISC is not set 643# CONFIG_INPUT_MISC is not set
572 644
573# 645#
646# Hardware I/O ports
647#
648CONFIG_SERIO=y
649# CONFIG_SERIO_I8042 is not set
650CONFIG_SERIO_SERPORT=y
651# CONFIG_SERIO_PCIPS2 is not set
652# CONFIG_SERIO_LIBPS2 is not set
653CONFIG_SERIO_RAW=m
654# CONFIG_GAMEPORT is not set
655
656#
574# Character devices 657# Character devices
575# 658#
576# CONFIG_VT is not set 659# CONFIG_VT is not set
@@ -590,6 +673,7 @@ CONFIG_SERIAL_AU1X00=y
590CONFIG_SERIAL_AU1X00_CONSOLE=y 673CONFIG_SERIAL_AU1X00_CONSOLE=y
591CONFIG_SERIAL_CORE=y 674CONFIG_SERIAL_CORE=y
592CONFIG_SERIAL_CORE_CONSOLE=y 675CONFIG_SERIAL_CORE_CONSOLE=y
676# CONFIG_SERIAL_JSM is not set
593CONFIG_UNIX98_PTYS=y 677CONFIG_UNIX98_PTYS=y
594CONFIG_LEGACY_PTYS=y 678CONFIG_LEGACY_PTYS=y
595CONFIG_LEGACY_PTY_COUNT=256 679CONFIG_LEGACY_PTY_COUNT=256
@@ -603,7 +687,8 @@ CONFIG_LEGACY_PTY_COUNT=256
603# Watchdog Cards 687# Watchdog Cards
604# 688#
605# CONFIG_WATCHDOG is not set 689# CONFIG_WATCHDOG is not set
606CONFIG_RTC=y 690# CONFIG_RTC is not set
691# CONFIG_GEN_RTC is not set
607# CONFIG_DTLK is not set 692# CONFIG_DTLK is not set
608# CONFIG_R3964 is not set 693# CONFIG_R3964 is not set
609# CONFIG_APPLICOM is not set 694# CONFIG_APPLICOM is not set
@@ -620,6 +705,11 @@ CONFIG_SYNCLINK_CS=m
620# CONFIG_RAW_DRIVER is not set 705# CONFIG_RAW_DRIVER is not set
621 706
622# 707#
708# TPM devices
709#
710# CONFIG_TCG_TPM is not set
711
712#
623# I2C support 713# I2C support
624# 714#
625# CONFIG_I2C is not set 715# CONFIG_I2C is not set
@@ -630,10 +720,20 @@ CONFIG_SYNCLINK_CS=m
630# CONFIG_W1 is not set 720# CONFIG_W1 is not set
631 721
632# 722#
723# Hardware Monitoring support
724#
725# CONFIG_HWMON is not set
726# CONFIG_HWMON_VID is not set
727
728#
633# Misc devices 729# Misc devices
634# 730#
635 731
636# 732#
733# Multimedia Capabilities Port drivers
734#
735
736#
637# Multimedia devices 737# Multimedia devices
638# 738#
639# CONFIG_VIDEO_DEV is not set 739# CONFIG_VIDEO_DEV is not set
@@ -647,7 +747,6 @@ CONFIG_SYNCLINK_CS=m
647# Graphics support 747# Graphics support
648# 748#
649# CONFIG_FB is not set 749# CONFIG_FB is not set
650# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
651 750
652# 751#
653# Sound 752# Sound
@@ -680,7 +779,6 @@ CONFIG_SOUND_AU1000=y
680# CONFIG_SOUND_MSNDCLAS is not set 779# CONFIG_SOUND_MSNDCLAS is not set
681# CONFIG_SOUND_MSNDPIN is not set 780# CONFIG_SOUND_MSNDPIN is not set
682# CONFIG_SOUND_VIA82CXXX is not set 781# CONFIG_SOUND_VIA82CXXX is not set
683# CONFIG_SOUND_OSS is not set
684# CONFIG_SOUND_ALI5455 is not set 782# CONFIG_SOUND_ALI5455 is not set
685# CONFIG_SOUND_FORTE is not set 783# CONFIG_SOUND_FORTE is not set
686# CONFIG_SOUND_RME96XX is not set 784# CONFIG_SOUND_RME96XX is not set
@@ -689,6 +787,8 @@ CONFIG_SOUND_AU1000=y
689# 787#
690# USB support 788# USB support
691# 789#
790CONFIG_USB_ARCH_HAS_HCD=y
791CONFIG_USB_ARCH_HAS_OHCI=y
692CONFIG_USB=y 792CONFIG_USB=y
693# CONFIG_USB_DEBUG is not set 793# CONFIG_USB_DEBUG is not set
694 794
@@ -699,23 +799,23 @@ CONFIG_USB=y
699# CONFIG_USB_BANDWIDTH is not set 799# CONFIG_USB_BANDWIDTH is not set
700# CONFIG_USB_DYNAMIC_MINORS is not set 800# CONFIG_USB_DYNAMIC_MINORS is not set
701# CONFIG_USB_OTG is not set 801# CONFIG_USB_OTG is not set
702CONFIG_USB_ARCH_HAS_HCD=y
703CONFIG_USB_ARCH_HAS_OHCI=y
704 802
705# 803#
706# USB Host Controller Drivers 804# USB Host Controller Drivers
707# 805#
708# CONFIG_USB_EHCI_HCD is not set 806# CONFIG_USB_EHCI_HCD is not set
807# CONFIG_USB_ISP116X_HCD is not set
709CONFIG_USB_OHCI_HCD=y 808CONFIG_USB_OHCI_HCD=y
809# CONFIG_USB_OHCI_BIG_ENDIAN is not set
810CONFIG_USB_OHCI_LITTLE_ENDIAN=y
710# CONFIG_USB_UHCI_HCD is not set 811# CONFIG_USB_UHCI_HCD is not set
711# CONFIG_USB_SL811_HCD is not set 812# CONFIG_USB_SL811_HCD is not set
712 813
713# 814#
714# USB Device Class drivers 815# USB Device Class drivers
715# 816#
716# CONFIG_USB_AUDIO is not set 817# CONFIG_OBSOLETE_OSS_USB_DRIVER is not set
717# CONFIG_USB_BLUETOOTH_TTY is not set 818# CONFIG_USB_BLUETOOTH_TTY is not set
718# CONFIG_USB_MIDI is not set
719# CONFIG_USB_ACM is not set 819# CONFIG_USB_ACM is not set
720# CONFIG_USB_PRINTER is not set 820# CONFIG_USB_PRINTER is not set
721 821
@@ -733,12 +833,17 @@ CONFIG_USB_HIDINPUT=y
733# CONFIG_USB_HIDDEV is not set 833# CONFIG_USB_HIDDEV is not set
734# CONFIG_USB_AIPTEK is not set 834# CONFIG_USB_AIPTEK is not set
735# CONFIG_USB_WACOM is not set 835# CONFIG_USB_WACOM is not set
836# CONFIG_USB_ACECAD is not set
736# CONFIG_USB_KBTAB is not set 837# CONFIG_USB_KBTAB is not set
737# CONFIG_USB_POWERMATE is not set 838# CONFIG_USB_POWERMATE is not set
738# CONFIG_USB_MTOUCH is not set 839# CONFIG_USB_MTOUCH is not set
840# CONFIG_USB_ITMTOUCH is not set
739# CONFIG_USB_EGALAX is not set 841# CONFIG_USB_EGALAX is not set
842CONFIG_USB_YEALINK=m
740# CONFIG_USB_XPAD is not set 843# CONFIG_USB_XPAD is not set
741# CONFIG_USB_ATI_REMOTE is not set 844# CONFIG_USB_ATI_REMOTE is not set
845# CONFIG_USB_KEYSPAN_REMOTE is not set
846# CONFIG_USB_APPLETOUCH is not set
742 847
743# 848#
744# USB Imaging devices 849# USB Imaging devices
@@ -762,6 +867,7 @@ CONFIG_USB_HIDINPUT=y
762# CONFIG_USB_PEGASUS is not set 867# CONFIG_USB_PEGASUS is not set
763# CONFIG_USB_RTL8150 is not set 868# CONFIG_USB_RTL8150 is not set
764# CONFIG_USB_USBNET is not set 869# CONFIG_USB_USBNET is not set
870CONFIG_USB_MON=y
765 871
766# 872#
767# USB port drivers 873# USB port drivers
@@ -786,9 +892,10 @@ CONFIG_USB_HIDINPUT=y
786# CONFIG_USB_PHIDGETKIT is not set 892# CONFIG_USB_PHIDGETKIT is not set
787# CONFIG_USB_PHIDGETSERVO is not set 893# CONFIG_USB_PHIDGETSERVO is not set
788# CONFIG_USB_IDMOUSE is not set 894# CONFIG_USB_IDMOUSE is not set
895CONFIG_USB_LD=m
789 896
790# 897#
791# USB ATM/DSL drivers 898# USB DSL modem support
792# 899#
793 900
794# 901#
@@ -807,12 +914,17 @@ CONFIG_USB_HIDINPUT=y
807# CONFIG_INFINIBAND is not set 914# CONFIG_INFINIBAND is not set
808 915
809# 916#
917# SN Devices
918#
919
920#
810# File systems 921# File systems
811# 922#
812CONFIG_EXT2_FS=y 923CONFIG_EXT2_FS=y
813CONFIG_EXT2_FS_XATTR=y 924CONFIG_EXT2_FS_XATTR=y
814CONFIG_EXT2_FS_POSIX_ACL=y 925CONFIG_EXT2_FS_POSIX_ACL=y
815# CONFIG_EXT2_FS_SECURITY is not set 926# CONFIG_EXT2_FS_SECURITY is not set
927# CONFIG_EXT2_FS_XIP is not set
816CONFIG_EXT3_FS=y 928CONFIG_EXT3_FS=y
817CONFIG_EXT3_FS_XATTR=y 929CONFIG_EXT3_FS_XATTR=y
818CONFIG_EXT3_FS_POSIX_ACL=y 930CONFIG_EXT3_FS_POSIX_ACL=y
@@ -831,10 +943,12 @@ CONFIG_FS_POSIX_ACL=y
831# CONFIG_XFS_FS is not set 943# CONFIG_XFS_FS is not set
832# CONFIG_MINIX_FS is not set 944# CONFIG_MINIX_FS is not set
833# CONFIG_ROMFS_FS is not set 945# CONFIG_ROMFS_FS is not set
946CONFIG_INOTIFY=y
834# CONFIG_QUOTA is not set 947# CONFIG_QUOTA is not set
835CONFIG_DNOTIFY=y 948CONFIG_DNOTIFY=y
836CONFIG_AUTOFS_FS=m 949CONFIG_AUTOFS_FS=m
837CONFIG_AUTOFS4_FS=m 950CONFIG_AUTOFS4_FS=m
951CONFIG_FUSE_FS=m
838 952
839# 953#
840# CD-ROM/DVD Filesystems 954# CD-ROM/DVD Filesystems
@@ -855,13 +969,10 @@ CONFIG_AUTOFS4_FS=m
855CONFIG_PROC_FS=y 969CONFIG_PROC_FS=y
856CONFIG_PROC_KCORE=y 970CONFIG_PROC_KCORE=y
857CONFIG_SYSFS=y 971CONFIG_SYSFS=y
858# CONFIG_DEVFS_FS is not set
859CONFIG_DEVPTS_FS_XATTR=y
860CONFIG_DEVPTS_FS_SECURITY=y
861CONFIG_TMPFS=y 972CONFIG_TMPFS=y
862# CONFIG_TMPFS_XATTR is not set
863# CONFIG_HUGETLB_PAGE is not set 973# CONFIG_HUGETLB_PAGE is not set
864CONFIG_RAMFS=y 974CONFIG_RAMFS=y
975CONFIG_RELAYFS_FS=m
865 976
866# 977#
867# Miscellaneous filesystems 978# Miscellaneous filesystems
@@ -895,6 +1006,7 @@ CONFIG_NFSD=m
895CONFIG_ROOT_NFS=y 1006CONFIG_ROOT_NFS=y
896CONFIG_LOCKD=y 1007CONFIG_LOCKD=y
897CONFIG_EXPORTFS=m 1008CONFIG_EXPORTFS=m
1009CONFIG_NFS_COMMON=y
898CONFIG_SUNRPC=y 1010CONFIG_SUNRPC=y
899# CONFIG_RPCSEC_GSS_KRB5 is not set 1011# CONFIG_RPCSEC_GSS_KRB5 is not set
900# CONFIG_RPCSEC_GSS_SPKM3 is not set 1012# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -904,6 +1016,7 @@ CONFIG_SMB_FS=m
904# CONFIG_NCP_FS is not set 1016# CONFIG_NCP_FS is not set
905# CONFIG_CODA_FS is not set 1017# CONFIG_CODA_FS is not set
906# CONFIG_AFS_FS is not set 1018# CONFIG_AFS_FS is not set
1019# CONFIG_9P_FS is not set
907 1020
908# 1021#
909# Partition Types 1022# Partition Types
@@ -963,7 +1076,9 @@ CONFIG_NLS_DEFAULT="iso8859-1"
963# 1076#
964# Kernel hacking 1077# Kernel hacking
965# 1078#
1079# CONFIG_PRINTK_TIME is not set
966# CONFIG_DEBUG_KERNEL is not set 1080# CONFIG_DEBUG_KERNEL is not set
1081CONFIG_LOG_BUF_SHIFT=14
967CONFIG_CROSSCOMPILE=y 1082CONFIG_CROSSCOMPILE=y
968CONFIG_CMDLINE="" 1083CONFIG_CMDLINE=""
969 1084
@@ -979,26 +1094,27 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
979# 1094#
980CONFIG_CRYPTO=y 1095CONFIG_CRYPTO=y
981CONFIG_CRYPTO_HMAC=y 1096CONFIG_CRYPTO_HMAC=y
982CONFIG_CRYPTO_NULL=y 1097CONFIG_CRYPTO_NULL=m
983# CONFIG_CRYPTO_MD4 is not set 1098CONFIG_CRYPTO_MD4=m
984# CONFIG_CRYPTO_MD5 is not set 1099CONFIG_CRYPTO_MD5=m
985# CONFIG_CRYPTO_SHA1 is not set 1100CONFIG_CRYPTO_SHA1=m
986# CONFIG_CRYPTO_SHA256 is not set 1101CONFIG_CRYPTO_SHA256=m
987CONFIG_CRYPTO_SHA512=y 1102CONFIG_CRYPTO_SHA512=m
988CONFIG_CRYPTO_WP512=m 1103CONFIG_CRYPTO_WP512=m
989# CONFIG_CRYPTO_DES is not set 1104CONFIG_CRYPTO_TGR192=m
990# CONFIG_CRYPTO_BLOWFISH is not set 1105CONFIG_CRYPTO_DES=m
991CONFIG_CRYPTO_TWOFISH=y 1106CONFIG_CRYPTO_BLOWFISH=m
992# CONFIG_CRYPTO_SERPENT is not set 1107CONFIG_CRYPTO_TWOFISH=m
1108CONFIG_CRYPTO_SERPENT=m
993CONFIG_CRYPTO_AES=m 1109CONFIG_CRYPTO_AES=m
994# CONFIG_CRYPTO_CAST5 is not set 1110CONFIG_CRYPTO_CAST5=m
995# CONFIG_CRYPTO_CAST6 is not set 1111CONFIG_CRYPTO_CAST6=m
996CONFIG_CRYPTO_TEA=m 1112CONFIG_CRYPTO_TEA=m
997# CONFIG_CRYPTO_ARC4 is not set 1113CONFIG_CRYPTO_ARC4=m
998CONFIG_CRYPTO_KHAZAD=m 1114CONFIG_CRYPTO_KHAZAD=m
999CONFIG_CRYPTO_ANUBIS=m 1115CONFIG_CRYPTO_ANUBIS=m
1000CONFIG_CRYPTO_DEFLATE=y 1116CONFIG_CRYPTO_DEFLATE=m
1001CONFIG_CRYPTO_MICHAEL_MIC=y 1117CONFIG_CRYPTO_MICHAEL_MIC=m
1002CONFIG_CRYPTO_CRC32C=m 1118CONFIG_CRYPTO_CRC32C=m
1003# CONFIG_CRYPTO_TEST is not set 1119# CONFIG_CRYPTO_TEST is not set
1004 1120
@@ -1010,9 +1126,8 @@ CONFIG_CRYPTO_CRC32C=m
1010# Library routines 1126# Library routines
1011# 1127#
1012CONFIG_CRC_CCITT=m 1128CONFIG_CRC_CCITT=m
1129CONFIG_CRC16=m
1013CONFIG_CRC32=y 1130CONFIG_CRC32=y
1014CONFIG_LIBCRC32C=m 1131CONFIG_LIBCRC32C=m
1015CONFIG_ZLIB_INFLATE=y 1132CONFIG_ZLIB_INFLATE=m
1016CONFIG_ZLIB_DEFLATE=y 1133CONFIG_ZLIB_DEFLATE=m
1017CONFIG_GENERIC_HARDIRQS=y
1018CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/db1550_defconfig b/arch/mips/configs/db1550_defconfig
index 178c0ad1af75..64248e2e924a 100644
--- a/arch/mips/configs/db1550_defconfig
+++ b/arch/mips/configs/db1550_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:02 2005 4# Thu Oct 20 22:25:39 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,24 +11,29 @@ CONFIG_32BIT=y
14CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
25# CONFIG_BSD_PROCESS_ACCT is not set 24# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y 25CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set 26# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14
29CONFIG_HOTPLUG=y 27CONFIG_HOTPLUG=y
30CONFIG_KOBJECT_UEVENT=y 28CONFIG_KOBJECT_UEVENT=y
31# CONFIG_IKCONFIG is not set 29# CONFIG_IKCONFIG is not set
30CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y 31CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y 32CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_EXTRA_PASS is not set 33# CONFIG_KALLSYMS_EXTRA_PASS is not set
34CONFIG_PRINTK=y
35CONFIG_BUG=y
36CONFIG_BASE_FULL=y
35CONFIG_FUTEX=y 37CONFIG_FUTEX=y
36CONFIG_EPOLL=y 38CONFIG_EPOLL=y
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -41,6 +43,7 @@ CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0 43CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0 44CONFIG_CC_ALIGN_JUMPS=0
43# CONFIG_TINY_SHMEM is not set 45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
44 47
45# 48#
46# Loadable module support 49# Loadable module support
@@ -56,63 +59,80 @@ CONFIG_KMOD=y
56# 59#
57# Machine selection 60# Machine selection
58# 61#
59# CONFIG_MACH_JAZZ is not set 62# CONFIG_MIPS_MTX1 is not set
60# CONFIG_MACH_VR41XX is not set 63# CONFIG_MIPS_BOSPORUS is not set
61# CONFIG_TOSHIBA_JMR3927 is not set 64# CONFIG_MIPS_PB1000 is not set
65# CONFIG_MIPS_PB1100 is not set
66# CONFIG_MIPS_PB1500 is not set
67# CONFIG_MIPS_PB1550 is not set
68# CONFIG_MIPS_PB1200 is not set
69# CONFIG_MIPS_DB1000 is not set
70# CONFIG_MIPS_DB1100 is not set
71# CONFIG_MIPS_DB1500 is not set
72CONFIG_MIPS_DB1550=y
73# CONFIG_MIPS_DB1200 is not set
74# CONFIG_MIPS_MIRAGE is not set
62# CONFIG_MIPS_COBALT is not set 75# CONFIG_MIPS_COBALT is not set
63# CONFIG_MACH_DECSTATION is not set 76# CONFIG_MACH_DECSTATION is not set
64# CONFIG_MIPS_EV64120 is not set 77# CONFIG_MIPS_EV64120 is not set
65# CONFIG_MIPS_EV96100 is not set 78# CONFIG_MIPS_EV96100 is not set
66# CONFIG_MIPS_IVR is not set 79# CONFIG_MIPS_IVR is not set
67# CONFIG_LASAT is not set
68# CONFIG_MIPS_ITE8172 is not set 80# CONFIG_MIPS_ITE8172 is not set
81# CONFIG_MACH_JAZZ is not set
82# CONFIG_LASAT is not set
69# CONFIG_MIPS_ATLAS is not set 83# CONFIG_MIPS_ATLAS is not set
70# CONFIG_MIPS_MALTA is not set 84# CONFIG_MIPS_MALTA is not set
71# CONFIG_MIPS_SEAD is not set 85# CONFIG_MIPS_SEAD is not set
86# CONFIG_MIPS_SIM is not set
87# CONFIG_MOMENCO_JAGUAR_ATX is not set
72# CONFIG_MOMENCO_OCELOT is not set 88# CONFIG_MOMENCO_OCELOT is not set
73# CONFIG_MOMENCO_OCELOT_G is not set
74# CONFIG_MOMENCO_OCELOT_C is not set
75# CONFIG_MOMENCO_OCELOT_3 is not set 89# CONFIG_MOMENCO_OCELOT_3 is not set
76# CONFIG_MOMENCO_JAGUAR_ATX is not set 90# CONFIG_MOMENCO_OCELOT_C is not set
77# CONFIG_PMC_YOSEMITE is not set 91# CONFIG_MOMENCO_OCELOT_G is not set
92# CONFIG_MIPS_XXS1500 is not set
93# CONFIG_PNX8550_V2PCI is not set
94# CONFIG_PNX8550_JBS is not set
78# CONFIG_DDB5074 is not set 95# CONFIG_DDB5074 is not set
79# CONFIG_DDB5476 is not set 96# CONFIG_DDB5476 is not set
80# CONFIG_DDB5477 is not set 97# CONFIG_DDB5477 is not set
81# CONFIG_NEC_OSPREY is not set 98# CONFIG_MACH_VR41XX is not set
99# CONFIG_PMC_YOSEMITE is not set
100# CONFIG_QEMU is not set
82# CONFIG_SGI_IP22 is not set 101# CONFIG_SGI_IP22 is not set
83CONFIG_SOC_AU1X00=y 102# CONFIG_SGI_IP27 is not set
84# CONFIG_SOC_AU1000 is not set 103# CONFIG_SGI_IP32 is not set
85# CONFIG_SOC_AU1100 is not set 104# CONFIG_SIBYTE_BIGSUR is not set
86# CONFIG_SOC_AU1500 is not set 105# CONFIG_SIBYTE_SWARM is not set
87CONFIG_SOC_AU1550=y 106# CONFIG_SIBYTE_SENTOSA is not set
88# CONFIG_MIPS_PB1000 is not set 107# CONFIG_SIBYTE_RHONE is not set
89# CONFIG_MIPS_PB1100 is not set 108# CONFIG_SIBYTE_CARMEL is not set
90# CONFIG_MIPS_PB1500 is not set 109# CONFIG_SIBYTE_PTSWARM is not set
91# CONFIG_MIPS_PB1550 is not set 110# CONFIG_SIBYTE_LITTLESUR is not set
92# CONFIG_MIPS_DB1000 is not set 111# CONFIG_SIBYTE_CRHINE is not set
93# CONFIG_MIPS_DB1100 is not set 112# CONFIG_SIBYTE_CRHONE is not set
94# CONFIG_MIPS_DB1500 is not set
95CONFIG_MIPS_DB1550=y
96# CONFIG_MIPS_BOSPORUS is not set
97# CONFIG_MIPS_MIRAGE is not set
98# CONFIG_MIPS_XXS1500 is not set
99# CONFIG_MIPS_MTX1 is not set
100# CONFIG_SIBYTE_SB1xxx_SOC is not set
101# CONFIG_SNI_RM200_PCI is not set 113# CONFIG_SNI_RM200_PCI is not set
114# CONFIG_TOSHIBA_JMR3927 is not set
102# CONFIG_TOSHIBA_RBTX4927 is not set 115# CONFIG_TOSHIBA_RBTX4927 is not set
116# CONFIG_TOSHIBA_RBTX4938 is not set
103CONFIG_RWSEM_GENERIC_SPINLOCK=y 117CONFIG_RWSEM_GENERIC_SPINLOCK=y
104CONFIG_GENERIC_CALIBRATE_DELAY=y 118CONFIG_GENERIC_CALIBRATE_DELAY=y
105CONFIG_HAVE_DEC_LOCK=y 119CONFIG_DMA_NONCOHERENT=y
106CONFIG_DMA_COHERENT=y 120CONFIG_DMA_NEED_PCI_MAP_STATE=y
107CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y 121CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y
122# CONFIG_CPU_BIG_ENDIAN is not set
108CONFIG_CPU_LITTLE_ENDIAN=y 123CONFIG_CPU_LITTLE_ENDIAN=y
124CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
125CONFIG_SOC_AU1550=y
126CONFIG_SOC_AU1X00=y
109CONFIG_MIPS_L1_CACHE_SHIFT=5 127CONFIG_MIPS_L1_CACHE_SHIFT=5
110 128
111# 129#
112# CPU selection 130# CPU selection
113# 131#
114CONFIG_CPU_MIPS32=y 132CONFIG_CPU_MIPS32_R1=y
115# CONFIG_CPU_MIPS64 is not set 133# CONFIG_CPU_MIPS32_R2 is not set
134# CONFIG_CPU_MIPS64_R1 is not set
135# CONFIG_CPU_MIPS64_R2 is not set
116# CONFIG_CPU_R3000 is not set 136# CONFIG_CPU_R3000 is not set
117# CONFIG_CPU_TX39XX is not set 137# CONFIG_CPU_TX39XX is not set
118# CONFIG_CPU_VR41XX is not set 138# CONFIG_CPU_VR41XX is not set
@@ -128,15 +148,39 @@ CONFIG_CPU_MIPS32=y
128# CONFIG_CPU_RM7000 is not set 148# CONFIG_CPU_RM7000 is not set
129# CONFIG_CPU_RM9000 is not set 149# CONFIG_CPU_RM9000 is not set
130# CONFIG_CPU_SB1 is not set 150# CONFIG_CPU_SB1 is not set
151CONFIG_SYS_HAS_CPU_MIPS32_R1=y
152CONFIG_CPU_MIPS32=y
153CONFIG_CPU_MIPSR1=y
154CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
155CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
156
157#
158# Kernel type
159#
160CONFIG_32BIT=y
161# CONFIG_64BIT is not set
131CONFIG_PAGE_SIZE_4KB=y 162CONFIG_PAGE_SIZE_4KB=y
132# CONFIG_PAGE_SIZE_8KB is not set 163# CONFIG_PAGE_SIZE_8KB is not set
133# CONFIG_PAGE_SIZE_16KB is not set 164# CONFIG_PAGE_SIZE_16KB is not set
134# CONFIG_PAGE_SIZE_64KB is not set 165# CONFIG_PAGE_SIZE_64KB is not set
135CONFIG_CPU_HAS_PREFETCH=y 166CONFIG_CPU_HAS_PREFETCH=y
167# CONFIG_MIPS_MT is not set
136CONFIG_64BIT_PHYS_ADDR=y 168CONFIG_64BIT_PHYS_ADDR=y
137# CONFIG_CPU_ADVANCED is not set 169# CONFIG_CPU_ADVANCED is not set
138CONFIG_CPU_HAS_LLSC=y 170CONFIG_CPU_HAS_LLSC=y
139CONFIG_CPU_HAS_SYNC=y 171CONFIG_CPU_HAS_SYNC=y
172CONFIG_GENERIC_HARDIRQS=y
173CONFIG_GENERIC_IRQ_PROBE=y
174CONFIG_ARCH_FLATMEM_ENABLE=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_PREEMPT_NONE=y
183# CONFIG_PREEMPT_VOLUNTARY is not set
140# CONFIG_PREEMPT is not set 184# CONFIG_PREEMPT is not set
141 185
142# 186#
@@ -145,7 +189,6 @@ CONFIG_CPU_HAS_SYNC=y
145CONFIG_HW_HAS_PCI=y 189CONFIG_HW_HAS_PCI=y
146CONFIG_PCI=y 190CONFIG_PCI=y
147CONFIG_PCI_LEGACY_PROC=y 191CONFIG_PCI_LEGACY_PROC=y
148CONFIG_PCI_NAMES=y
149CONFIG_MMU=y 192CONFIG_MMU=y
150 193
151# 194#
@@ -154,6 +197,8 @@ CONFIG_MMU=y
154CONFIG_PCCARD=m 197CONFIG_PCCARD=m
155# CONFIG_PCMCIA_DEBUG is not set 198# CONFIG_PCMCIA_DEBUG is not set
156CONFIG_PCMCIA=m 199CONFIG_PCMCIA=m
200CONFIG_PCMCIA_LOAD_CIS=y
201CONFIG_PCMCIA_IOCTL=y
157CONFIG_CARDBUS=y 202CONFIG_CARDBUS=y
158 203
159# 204#
@@ -176,6 +221,100 @@ CONFIG_PCMCIA_AU1X00=m
176CONFIG_BINFMT_ELF=y 221CONFIG_BINFMT_ELF=y
177# CONFIG_BINFMT_MISC is not set 222# CONFIG_BINFMT_MISC is not set
178CONFIG_TRAD_SIGNALS=y 223CONFIG_TRAD_SIGNALS=y
224# CONFIG_PM is not set
225
226#
227# Networking
228#
229CONFIG_NET=y
230
231#
232# Networking options
233#
234CONFIG_PACKET=y
235# CONFIG_PACKET_MMAP is not set
236CONFIG_UNIX=y
237CONFIG_XFRM=y
238CONFIG_XFRM_USER=m
239CONFIG_NET_KEY=y
240CONFIG_INET=y
241CONFIG_IP_MULTICAST=y
242# CONFIG_IP_ADVANCED_ROUTER is not set
243CONFIG_IP_FIB_HASH=y
244CONFIG_IP_PNP=y
245# CONFIG_IP_PNP_DHCP is not set
246CONFIG_IP_PNP_BOOTP=y
247# CONFIG_IP_PNP_RARP is not set
248# CONFIG_NET_IPIP is not set
249# CONFIG_NET_IPGRE is not set
250# CONFIG_IP_MROUTE is not set
251# CONFIG_ARPD is not set
252# CONFIG_SYN_COOKIES is not set
253# CONFIG_INET_AH is not set
254# CONFIG_INET_ESP is not set
255# CONFIG_INET_IPCOMP is not set
256CONFIG_INET_TUNNEL=m
257CONFIG_INET_DIAG=y
258CONFIG_INET_TCP_DIAG=y
259# CONFIG_TCP_CONG_ADVANCED is not set
260CONFIG_TCP_CONG_BIC=y
261
262#
263# IP: Virtual Server Configuration
264#
265# CONFIG_IP_VS is not set
266# CONFIG_IPV6 is not set
267CONFIG_NETFILTER=y
268# CONFIG_NETFILTER_DEBUG is not set
269CONFIG_NETFILTER_NETLINK=m
270CONFIG_NETFILTER_NETLINK_QUEUE=m
271CONFIG_NETFILTER_NETLINK_LOG=m
272
273#
274# IP: Netfilter Configuration
275#
276# CONFIG_IP_NF_CONNTRACK is not set
277CONFIG_IP_NF_PPTP=m
278# CONFIG_IP_NF_QUEUE is not set
279# CONFIG_IP_NF_IPTABLES is not set
280# CONFIG_IP_NF_ARPTABLES is not set
281
282#
283# DCCP Configuration (EXPERIMENTAL)
284#
285# CONFIG_IP_DCCP is not set
286
287#
288# SCTP Configuration (EXPERIMENTAL)
289#
290# CONFIG_IP_SCTP is not set
291# CONFIG_ATM is not set
292# CONFIG_BRIDGE is not set
293# CONFIG_VLAN_8021Q is not set
294# CONFIG_DECNET is not set
295# CONFIG_LLC2 is not set
296# CONFIG_IPX is not set
297# CONFIG_ATALK is not set
298# CONFIG_X25 is not set
299# CONFIG_LAPB is not set
300# CONFIG_NET_DIVERT is not set
301# CONFIG_ECONET is not set
302# CONFIG_WAN_ROUTER is not set
303# CONFIG_NET_SCHED is not set
304# CONFIG_NET_CLS_ROUTE is not set
305
306#
307# Network testing
308#
309# CONFIG_NET_PKTGEN is not set
310# CONFIG_HAMRADIO is not set
311# CONFIG_IRDA is not set
312# CONFIG_BT is not set
313CONFIG_IEEE80211=m
314# CONFIG_IEEE80211_DEBUG is not set
315CONFIG_IEEE80211_CRYPT_WEP=m
316CONFIG_IEEE80211_CRYPT_CCMP=m
317CONFIG_IEEE80211_CRYPT_TKIP=m
179 318
180# 319#
181# Device Drivers 320# Device Drivers
@@ -186,15 +325,20 @@ CONFIG_TRAD_SIGNALS=y
186# 325#
187CONFIG_STANDALONE=y 326CONFIG_STANDALONE=y
188CONFIG_PREVENT_FIRMWARE_BUILD=y 327CONFIG_PREVENT_FIRMWARE_BUILD=y
189# CONFIG_FW_LOADER is not set 328CONFIG_FW_LOADER=m
329
330#
331# Connector - unified userspace <-> kernelspace linker
332#
333CONFIG_CONNECTOR=m
190 334
191# 335#
192# Memory Technology Devices (MTD) 336# Memory Technology Devices (MTD)
193# 337#
194CONFIG_MTD=y 338CONFIG_MTD=y
195# CONFIG_MTD_DEBUG is not set 339# CONFIG_MTD_DEBUG is not set
196CONFIG_MTD_PARTITIONS=y
197# CONFIG_MTD_CONCAT is not set 340# CONFIG_MTD_CONCAT is not set
341CONFIG_MTD_PARTITIONS=y
198# CONFIG_MTD_REDBOOT_PARTS is not set 342# CONFIG_MTD_REDBOOT_PARTS is not set
199# CONFIG_MTD_CMDLINE_PARTS is not set 343# CONFIG_MTD_CMDLINE_PARTS is not set
200 344
@@ -238,9 +382,8 @@ CONFIG_MTD_CFI_UTIL=y
238# 382#
239# CONFIG_MTD_COMPLEX_MAPPINGS is not set 383# CONFIG_MTD_COMPLEX_MAPPINGS is not set
240# CONFIG_MTD_PHYSMAP is not set 384# CONFIG_MTD_PHYSMAP is not set
241CONFIG_MTD_DB1550=y 385CONFIG_MTD_ALCHEMY=y
242CONFIG_MTD_DB1550_BOOT=y 386# CONFIG_MTD_PLATRAM is not set
243CONFIG_MTD_DB1550_USER=y
244 387
245# 388#
246# Self-contained MTD device drivers 389# Self-contained MTD device drivers
@@ -281,7 +424,6 @@ CONFIG_MTD_NAND_AU1550=m
281# 424#
282# Block devices 425# Block devices
283# 426#
284# CONFIG_BLK_DEV_FD is not set
285# CONFIG_BLK_CPQ_DA is not set 427# CONFIG_BLK_CPQ_DA is not set
286# CONFIG_BLK_CPQ_CISS_DA is not set 428# CONFIG_BLK_CPQ_CISS_DA is not set
287# CONFIG_BLK_DEV_DAC960 is not set 429# CONFIG_BLK_DEV_DAC960 is not set
@@ -293,7 +435,6 @@ CONFIG_BLK_DEV_LOOP=y
293# CONFIG_BLK_DEV_SX8 is not set 435# CONFIG_BLK_DEV_SX8 is not set
294# CONFIG_BLK_DEV_RAM is not set 436# CONFIG_BLK_DEV_RAM is not set
295CONFIG_BLK_DEV_RAM_COUNT=16 437CONFIG_BLK_DEV_RAM_COUNT=16
296CONFIG_INITRAMFS_SOURCE=""
297# CONFIG_LBD is not set 438# CONFIG_LBD is not set
298CONFIG_CDROM_PKTCDVD=m 439CONFIG_CDROM_PKTCDVD=m
299CONFIG_CDROM_PKTCDVD_BUFFERS=8 440CONFIG_CDROM_PKTCDVD_BUFFERS=8
@@ -350,6 +491,7 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y
350# CONFIG_BLK_DEV_HPT366 is not set 491# CONFIG_BLK_DEV_HPT366 is not set
351# CONFIG_BLK_DEV_SC1200 is not set 492# CONFIG_BLK_DEV_SC1200 is not set
352# CONFIG_BLK_DEV_PIIX is not set 493# CONFIG_BLK_DEV_PIIX is not set
494# CONFIG_BLK_DEV_IT821X is not set
353# CONFIG_BLK_DEV_NS87415 is not set 495# CONFIG_BLK_DEV_NS87415 is not set
354# CONFIG_BLK_DEV_PDC202XX_OLD is not set 496# CONFIG_BLK_DEV_PDC202XX_OLD is not set
355# CONFIG_BLK_DEV_PDC202XX_NEW is not set 497# CONFIG_BLK_DEV_PDC202XX_NEW is not set
@@ -367,6 +509,7 @@ CONFIG_BLK_DEV_IDEDMA=y
367# 509#
368# SCSI device support 510# SCSI device support
369# 511#
512CONFIG_RAID_ATTRS=m
370# CONFIG_SCSI is not set 513# CONFIG_SCSI is not set
371 514
372# 515#
@@ -377,6 +520,7 @@ CONFIG_BLK_DEV_IDEDMA=y
377# 520#
378# Fusion MPT device support 521# Fusion MPT device support
379# 522#
523# CONFIG_FUSION is not set
380 524
381# 525#
382# IEEE 1394 (FireWire) support 526# IEEE 1394 (FireWire) support
@@ -389,94 +533,13 @@ CONFIG_BLK_DEV_IDEDMA=y
389# CONFIG_I2O is not set 533# CONFIG_I2O is not set
390 534
391# 535#
392# Networking support 536# Network device support
393#
394CONFIG_NET=y
395
396#
397# Networking options
398#
399CONFIG_PACKET=y
400# CONFIG_PACKET_MMAP is not set
401CONFIG_NETLINK_DEV=y
402CONFIG_UNIX=y
403CONFIG_NET_KEY=y
404CONFIG_INET=y
405CONFIG_IP_MULTICAST=y
406# CONFIG_IP_ADVANCED_ROUTER is not set
407CONFIG_IP_PNP=y
408# CONFIG_IP_PNP_DHCP is not set
409CONFIG_IP_PNP_BOOTP=y
410# CONFIG_IP_PNP_RARP is not set
411# CONFIG_NET_IPIP is not set
412# CONFIG_NET_IPGRE is not set
413# CONFIG_IP_MROUTE is not set
414# CONFIG_ARPD is not set
415# CONFIG_SYN_COOKIES is not set
416# CONFIG_INET_AH is not set
417# CONFIG_INET_ESP is not set
418# CONFIG_INET_IPCOMP is not set
419CONFIG_INET_TUNNEL=m
420CONFIG_IP_TCPDIAG=m
421# CONFIG_IP_TCPDIAG_IPV6 is not set
422
423#
424# IP: Virtual Server Configuration
425# 537#
426# CONFIG_IP_VS is not set
427# CONFIG_IPV6 is not set
428CONFIG_NETFILTER=y
429# CONFIG_NETFILTER_DEBUG is not set
430
431#
432# IP: Netfilter Configuration
433#
434# CONFIG_IP_NF_CONNTRACK is not set
435CONFIG_IP_NF_CONNTRACK_MARK=y
436# CONFIG_IP_NF_QUEUE is not set
437# CONFIG_IP_NF_IPTABLES is not set
438# CONFIG_IP_NF_ARPTABLES is not set
439CONFIG_XFRM=y
440CONFIG_XFRM_USER=m
441
442#
443# SCTP Configuration (EXPERIMENTAL)
444#
445# CONFIG_IP_SCTP is not set
446# CONFIG_ATM is not set
447# CONFIG_BRIDGE is not set
448# CONFIG_VLAN_8021Q is not set
449# CONFIG_DECNET is not set
450# CONFIG_LLC2 is not set
451# CONFIG_IPX is not set
452# CONFIG_ATALK is not set
453# CONFIG_X25 is not set
454# CONFIG_LAPB is not set
455# CONFIG_NET_DIVERT is not set
456# CONFIG_ECONET is not set
457# CONFIG_WAN_ROUTER is not set
458
459#
460# QoS and/or fair queueing
461#
462# CONFIG_NET_SCHED is not set
463# CONFIG_NET_CLS_ROUTE is not set
464
465#
466# Network testing
467#
468# CONFIG_NET_PKTGEN is not set
469# CONFIG_NETPOLL is not set
470# CONFIG_NET_POLL_CONTROLLER is not set
471# CONFIG_HAMRADIO is not set
472# CONFIG_IRDA is not set
473# CONFIG_BT is not set
474CONFIG_NETDEVICES=y 538CONFIG_NETDEVICES=y
475# CONFIG_DUMMY is not set 539# CONFIG_DUMMY is not set
476# CONFIG_BONDING is not set 540# CONFIG_BONDING is not set
477# CONFIG_EQUALIZER is not set 541# CONFIG_EQUALIZER is not set
478# CONFIG_TUN is not set 542# CONFIG_TUN is not set
479# CONFIG_ETHERTAP is not set
480 543
481# 544#
482# ARCnet devices 545# ARCnet devices
@@ -484,6 +547,21 @@ CONFIG_NETDEVICES=y
484# CONFIG_ARCNET is not set 547# CONFIG_ARCNET is not set
485 548
486# 549#
550# PHY device support
551#
552CONFIG_PHYLIB=m
553CONFIG_PHYCONTROL=y
554
555#
556# MII PHY device drivers
557#
558CONFIG_MARVELL_PHY=m
559CONFIG_DAVICOM_PHY=m
560CONFIG_QSEMI_PHY=m
561CONFIG_LXT_PHY=m
562CONFIG_CICADA_PHY=m
563
564#
487# Ethernet (10 or 100Mbit) 565# Ethernet (10 or 100Mbit)
488# 566#
489CONFIG_NET_ETHERNET=y 567CONFIG_NET_ETHERNET=y
@@ -510,12 +588,16 @@ CONFIG_MIPS_AU1X00_ENET=y
510# CONFIG_HAMACHI is not set 588# CONFIG_HAMACHI is not set
511# CONFIG_YELLOWFIN is not set 589# CONFIG_YELLOWFIN is not set
512# CONFIG_R8169 is not set 590# CONFIG_R8169 is not set
591# CONFIG_SIS190 is not set
592# CONFIG_SKGE is not set
513# CONFIG_SK98LIN is not set 593# CONFIG_SK98LIN is not set
514# CONFIG_TIGON3 is not set 594# CONFIG_TIGON3 is not set
595# CONFIG_BNX2 is not set
515 596
516# 597#
517# Ethernet (10000 Mbit) 598# Ethernet (10000 Mbit)
518# 599#
600# CONFIG_CHELSIO_T1 is not set
519# CONFIG_IXGB is not set 601# CONFIG_IXGB is not set
520# CONFIG_S2IO is not set 602# CONFIG_S2IO is not set
521 603
@@ -528,6 +610,8 @@ CONFIG_MIPS_AU1X00_ENET=y
528# Wireless LAN (non-hamradio) 610# Wireless LAN (non-hamradio)
529# 611#
530# CONFIG_NET_RADIO is not set 612# CONFIG_NET_RADIO is not set
613# CONFIG_IPW_DEBUG is not set
614CONFIG_IPW2200=m
531 615
532# 616#
533# PCMCIA network device support 617# PCMCIA network device support
@@ -559,6 +643,8 @@ CONFIG_PPPOE=m
559# CONFIG_SLIP is not set 643# CONFIG_SLIP is not set
560# CONFIG_SHAPER is not set 644# CONFIG_SHAPER is not set
561# CONFIG_NETCONSOLE is not set 645# CONFIG_NETCONSOLE is not set
646# CONFIG_NETPOLL is not set
647# CONFIG_NET_POLL_CONTROLLER is not set
562 648
563# 649#
564# ISDN subsystem 650# ISDN subsystem
@@ -588,19 +674,6 @@ CONFIG_INPUT_EVDEV=y
588# CONFIG_INPUT_EVBUG is not set 674# CONFIG_INPUT_EVBUG is not set
589 675
590# 676#
591# Input I/O drivers
592#
593# CONFIG_GAMEPORT is not set
594CONFIG_SOUND_GAMEPORT=y
595CONFIG_SERIO=y
596# CONFIG_SERIO_I8042 is not set
597CONFIG_SERIO_SERPORT=y
598# CONFIG_SERIO_CT82C710 is not set
599# CONFIG_SERIO_PCIPS2 is not set
600# CONFIG_SERIO_LIBPS2 is not set
601CONFIG_SERIO_RAW=m
602
603#
604# Input Device Drivers 677# Input Device Drivers
605# 678#
606# CONFIG_INPUT_KEYBOARD is not set 679# CONFIG_INPUT_KEYBOARD is not set
@@ -610,6 +683,17 @@ CONFIG_SERIO_RAW=m
610# CONFIG_INPUT_MISC is not set 683# CONFIG_INPUT_MISC is not set
611 684
612# 685#
686# Hardware I/O ports
687#
688CONFIG_SERIO=y
689# CONFIG_SERIO_I8042 is not set
690CONFIG_SERIO_SERPORT=y
691# CONFIG_SERIO_PCIPS2 is not set
692# CONFIG_SERIO_LIBPS2 is not set
693CONFIG_SERIO_RAW=m
694# CONFIG_GAMEPORT is not set
695
696#
613# Character devices 697# Character devices
614# 698#
615# CONFIG_VT is not set 699# CONFIG_VT is not set
@@ -629,6 +713,7 @@ CONFIG_SERIAL_AU1X00=y
629CONFIG_SERIAL_AU1X00_CONSOLE=y 713CONFIG_SERIAL_AU1X00_CONSOLE=y
630CONFIG_SERIAL_CORE=y 714CONFIG_SERIAL_CORE=y
631CONFIG_SERIAL_CORE_CONSOLE=y 715CONFIG_SERIAL_CORE_CONSOLE=y
716# CONFIG_SERIAL_JSM is not set
632CONFIG_UNIX98_PTYS=y 717CONFIG_UNIX98_PTYS=y
633CONFIG_LEGACY_PTYS=y 718CONFIG_LEGACY_PTYS=y
634CONFIG_LEGACY_PTY_COUNT=256 719CONFIG_LEGACY_PTY_COUNT=256
@@ -660,6 +745,11 @@ CONFIG_SYNCLINK_CS=m
660# CONFIG_RAW_DRIVER is not set 745# CONFIG_RAW_DRIVER is not set
661 746
662# 747#
748# TPM devices
749#
750# CONFIG_TCG_TPM is not set
751
752#
663# I2C support 753# I2C support
664# 754#
665# CONFIG_I2C is not set 755# CONFIG_I2C is not set
@@ -670,10 +760,20 @@ CONFIG_SYNCLINK_CS=m
670# CONFIG_W1 is not set 760# CONFIG_W1 is not set
671 761
672# 762#
763# Hardware Monitoring support
764#
765# CONFIG_HWMON is not set
766# CONFIG_HWMON_VID is not set
767
768#
673# Misc devices 769# Misc devices
674# 770#
675 771
676# 772#
773# Multimedia Capabilities Port drivers
774#
775
776#
677# Multimedia devices 777# Multimedia devices
678# 778#
679# CONFIG_VIDEO_DEV is not set 779# CONFIG_VIDEO_DEV is not set
@@ -687,7 +787,6 @@ CONFIG_SYNCLINK_CS=m
687# Graphics support 787# Graphics support
688# 788#
689# CONFIG_FB is not set 789# CONFIG_FB is not set
690# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
691 790
692# 791#
693# Sound 792# Sound
@@ -697,13 +796,9 @@ CONFIG_SYNCLINK_CS=m
697# 796#
698# USB support 797# USB support
699# 798#
700# CONFIG_USB is not set
701CONFIG_USB_ARCH_HAS_HCD=y 799CONFIG_USB_ARCH_HAS_HCD=y
702CONFIG_USB_ARCH_HAS_OHCI=y 800CONFIG_USB_ARCH_HAS_OHCI=y
703 801# CONFIG_USB is not set
704#
705# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
706#
707 802
708# 803#
709# USB Gadget Support 804# USB Gadget Support
@@ -721,12 +816,17 @@ CONFIG_USB_ARCH_HAS_OHCI=y
721# CONFIG_INFINIBAND is not set 816# CONFIG_INFINIBAND is not set
722 817
723# 818#
819# SN Devices
820#
821
822#
724# File systems 823# File systems
725# 824#
726CONFIG_EXT2_FS=y 825CONFIG_EXT2_FS=y
727CONFIG_EXT2_FS_XATTR=y 826CONFIG_EXT2_FS_XATTR=y
728CONFIG_EXT2_FS_POSIX_ACL=y 827CONFIG_EXT2_FS_POSIX_ACL=y
729# CONFIG_EXT2_FS_SECURITY is not set 828# CONFIG_EXT2_FS_SECURITY is not set
829# CONFIG_EXT2_FS_XIP is not set
730CONFIG_EXT3_FS=y 830CONFIG_EXT3_FS=y
731CONFIG_EXT3_FS_XATTR=y 831CONFIG_EXT3_FS_XATTR=y
732CONFIG_EXT3_FS_POSIX_ACL=y 832CONFIG_EXT3_FS_POSIX_ACL=y
@@ -745,10 +845,12 @@ CONFIG_FS_POSIX_ACL=y
745# CONFIG_XFS_FS is not set 845# CONFIG_XFS_FS is not set
746# CONFIG_MINIX_FS is not set 846# CONFIG_MINIX_FS is not set
747# CONFIG_ROMFS_FS is not set 847# CONFIG_ROMFS_FS is not set
848CONFIG_INOTIFY=y
748# CONFIG_QUOTA is not set 849# CONFIG_QUOTA is not set
749CONFIG_DNOTIFY=y 850CONFIG_DNOTIFY=y
750CONFIG_AUTOFS_FS=m 851CONFIG_AUTOFS_FS=m
751CONFIG_AUTOFS4_FS=m 852CONFIG_AUTOFS4_FS=m
853CONFIG_FUSE_FS=m
752 854
753# 855#
754# CD-ROM/DVD Filesystems 856# CD-ROM/DVD Filesystems
@@ -769,13 +871,10 @@ CONFIG_AUTOFS4_FS=m
769CONFIG_PROC_FS=y 871CONFIG_PROC_FS=y
770CONFIG_PROC_KCORE=y 872CONFIG_PROC_KCORE=y
771CONFIG_SYSFS=y 873CONFIG_SYSFS=y
772# CONFIG_DEVFS_FS is not set
773CONFIG_DEVPTS_FS_XATTR=y
774CONFIG_DEVPTS_FS_SECURITY=y
775CONFIG_TMPFS=y 874CONFIG_TMPFS=y
776# CONFIG_TMPFS_XATTR is not set
777# CONFIG_HUGETLB_PAGE is not set 875# CONFIG_HUGETLB_PAGE is not set
778CONFIG_RAMFS=y 876CONFIG_RAMFS=y
877CONFIG_RELAYFS_FS=m
779 878
780# 879#
781# Miscellaneous filesystems 880# Miscellaneous filesystems
@@ -809,6 +908,7 @@ CONFIG_NFSD=m
809CONFIG_ROOT_NFS=y 908CONFIG_ROOT_NFS=y
810CONFIG_LOCKD=y 909CONFIG_LOCKD=y
811CONFIG_EXPORTFS=m 910CONFIG_EXPORTFS=m
911CONFIG_NFS_COMMON=y
812CONFIG_SUNRPC=y 912CONFIG_SUNRPC=y
813# CONFIG_RPCSEC_GSS_KRB5 is not set 913# CONFIG_RPCSEC_GSS_KRB5 is not set
814# CONFIG_RPCSEC_GSS_SPKM3 is not set 914# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -818,6 +918,7 @@ CONFIG_SMB_FS=m
818# CONFIG_NCP_FS is not set 918# CONFIG_NCP_FS is not set
819# CONFIG_CODA_FS is not set 919# CONFIG_CODA_FS is not set
820# CONFIG_AFS_FS is not set 920# CONFIG_AFS_FS is not set
921# CONFIG_9P_FS is not set
821 922
822# 923#
823# Partition Types 924# Partition Types
@@ -877,7 +978,9 @@ CONFIG_NLS_DEFAULT="iso8859-1"
877# 978#
878# Kernel hacking 979# Kernel hacking
879# 980#
981# CONFIG_PRINTK_TIME is not set
880# CONFIG_DEBUG_KERNEL is not set 982# CONFIG_DEBUG_KERNEL is not set
983CONFIG_LOG_BUF_SHIFT=14
881CONFIG_CROSSCOMPILE=y 984CONFIG_CROSSCOMPILE=y
882CONFIG_CMDLINE="" 985CONFIG_CMDLINE=""
883 986
@@ -893,26 +996,27 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
893# 996#
894CONFIG_CRYPTO=y 997CONFIG_CRYPTO=y
895CONFIG_CRYPTO_HMAC=y 998CONFIG_CRYPTO_HMAC=y
896CONFIG_CRYPTO_NULL=y 999CONFIG_CRYPTO_NULL=m
897# CONFIG_CRYPTO_MD4 is not set 1000CONFIG_CRYPTO_MD4=m
898# CONFIG_CRYPTO_MD5 is not set 1001CONFIG_CRYPTO_MD5=m
899# CONFIG_CRYPTO_SHA1 is not set 1002CONFIG_CRYPTO_SHA1=m
900# CONFIG_CRYPTO_SHA256 is not set 1003CONFIG_CRYPTO_SHA256=m
901CONFIG_CRYPTO_SHA512=y 1004CONFIG_CRYPTO_SHA512=m
902CONFIG_CRYPTO_WP512=m 1005CONFIG_CRYPTO_WP512=m
903# CONFIG_CRYPTO_DES is not set 1006CONFIG_CRYPTO_TGR192=m
904# CONFIG_CRYPTO_BLOWFISH is not set 1007CONFIG_CRYPTO_DES=m
905CONFIG_CRYPTO_TWOFISH=y 1008CONFIG_CRYPTO_BLOWFISH=m
906# CONFIG_CRYPTO_SERPENT is not set 1009CONFIG_CRYPTO_TWOFISH=m
1010CONFIG_CRYPTO_SERPENT=m
907CONFIG_CRYPTO_AES=m 1011CONFIG_CRYPTO_AES=m
908# CONFIG_CRYPTO_CAST5 is not set 1012CONFIG_CRYPTO_CAST5=m
909# CONFIG_CRYPTO_CAST6 is not set 1013CONFIG_CRYPTO_CAST6=m
910CONFIG_CRYPTO_TEA=m 1014CONFIG_CRYPTO_TEA=m
911# CONFIG_CRYPTO_ARC4 is not set 1015CONFIG_CRYPTO_ARC4=m
912CONFIG_CRYPTO_KHAZAD=m 1016CONFIG_CRYPTO_KHAZAD=m
913CONFIG_CRYPTO_ANUBIS=m 1017CONFIG_CRYPTO_ANUBIS=m
914CONFIG_CRYPTO_DEFLATE=y 1018CONFIG_CRYPTO_DEFLATE=m
915CONFIG_CRYPTO_MICHAEL_MIC=y 1019CONFIG_CRYPTO_MICHAEL_MIC=m
916CONFIG_CRYPTO_CRC32C=m 1020CONFIG_CRYPTO_CRC32C=m
917# CONFIG_CRYPTO_TEST is not set 1021# CONFIG_CRYPTO_TEST is not set
918 1022
@@ -924,9 +1028,8 @@ CONFIG_CRYPTO_CRC32C=m
924# Library routines 1028# Library routines
925# 1029#
926CONFIG_CRC_CCITT=m 1030CONFIG_CRC_CCITT=m
1031CONFIG_CRC16=m
927CONFIG_CRC32=y 1032CONFIG_CRC32=y
928CONFIG_LIBCRC32C=m 1033CONFIG_LIBCRC32C=m
929CONFIG_ZLIB_INFLATE=y 1034CONFIG_ZLIB_INFLATE=m
930CONFIG_ZLIB_DEFLATE=y 1035CONFIG_ZLIB_DEFLATE=m
931CONFIG_GENERIC_HARDIRQS=y
932CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/ddb5476_defconfig b/arch/mips/configs/ddb5476_defconfig
index 70addc73f699..b260e51eb517 100644
--- a/arch/mips/configs/ddb5476_defconfig
+++ b/arch/mips/configs/ddb5476_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:02 2005 4# Thu Oct 20 22:25:42 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,24 +11,29 @@ CONFIG_32BIT=y
14CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
25# CONFIG_BSD_PROCESS_ACCT is not set 24# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y 25CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set 26# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14 27CONFIG_HOTPLUG=y
29# CONFIG_HOTPLUG is not set
30CONFIG_KOBJECT_UEVENT=y 28CONFIG_KOBJECT_UEVENT=y
31# CONFIG_IKCONFIG is not set 29# CONFIG_IKCONFIG is not set
30CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y 31CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y 32CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_EXTRA_PASS is not set 33# CONFIG_KALLSYMS_EXTRA_PASS is not set
34CONFIG_PRINTK=y
35CONFIG_BUG=y
36CONFIG_BASE_FULL=y
35CONFIG_FUTEX=y 37CONFIG_FUTEX=y
36CONFIG_EPOLL=y 38CONFIG_EPOLL=y
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -41,6 +43,7 @@ CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0 43CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0 44CONFIG_CC_ALIGN_JUMPS=0
43# CONFIG_TINY_SHMEM is not set 45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
44 47
45# 48#
46# Loadable module support 49# Loadable module support
@@ -50,41 +53,69 @@ CONFIG_CC_ALIGN_JUMPS=0
50# 53#
51# Machine selection 54# Machine selection
52# 55#
53# CONFIG_MACH_JAZZ is not set 56# CONFIG_MIPS_MTX1 is not set
54# CONFIG_MACH_VR41XX is not set 57# CONFIG_MIPS_BOSPORUS is not set
55# CONFIG_TOSHIBA_JMR3927 is not set 58# CONFIG_MIPS_PB1000 is not set
59# CONFIG_MIPS_PB1100 is not set
60# CONFIG_MIPS_PB1500 is not set
61# CONFIG_MIPS_PB1550 is not set
62# CONFIG_MIPS_PB1200 is not set
63# CONFIG_MIPS_DB1000 is not set
64# CONFIG_MIPS_DB1100 is not set
65# CONFIG_MIPS_DB1500 is not set
66# CONFIG_MIPS_DB1550 is not set
67# CONFIG_MIPS_DB1200 is not set
68# CONFIG_MIPS_MIRAGE is not set
56# CONFIG_MIPS_COBALT is not set 69# CONFIG_MIPS_COBALT is not set
57# CONFIG_MACH_DECSTATION is not set 70# CONFIG_MACH_DECSTATION is not set
58# CONFIG_MIPS_EV64120 is not set 71# CONFIG_MIPS_EV64120 is not set
59# CONFIG_MIPS_EV96100 is not set 72# CONFIG_MIPS_EV96100 is not set
60# CONFIG_MIPS_IVR is not set 73# CONFIG_MIPS_IVR is not set
61# CONFIG_LASAT is not set
62# CONFIG_MIPS_ITE8172 is not set 74# CONFIG_MIPS_ITE8172 is not set
75# CONFIG_MACH_JAZZ is not set
76# CONFIG_LASAT is not set
63# CONFIG_MIPS_ATLAS is not set 77# CONFIG_MIPS_ATLAS is not set
64# CONFIG_MIPS_MALTA is not set 78# CONFIG_MIPS_MALTA is not set
65# CONFIG_MIPS_SEAD is not set 79# CONFIG_MIPS_SEAD is not set
80# CONFIG_MIPS_SIM is not set
81# CONFIG_MOMENCO_JAGUAR_ATX is not set
66# CONFIG_MOMENCO_OCELOT is not set 82# CONFIG_MOMENCO_OCELOT is not set
67# CONFIG_MOMENCO_OCELOT_G is not set
68# CONFIG_MOMENCO_OCELOT_C is not set
69# CONFIG_MOMENCO_OCELOT_3 is not set 83# CONFIG_MOMENCO_OCELOT_3 is not set
70# CONFIG_MOMENCO_JAGUAR_ATX is not set 84# CONFIG_MOMENCO_OCELOT_C is not set
71# CONFIG_PMC_YOSEMITE is not set 85# CONFIG_MOMENCO_OCELOT_G is not set
86# CONFIG_MIPS_XXS1500 is not set
87# CONFIG_PNX8550_V2PCI is not set
88# CONFIG_PNX8550_JBS is not set
72# CONFIG_DDB5074 is not set 89# CONFIG_DDB5074 is not set
73CONFIG_DDB5476=y 90CONFIG_DDB5476=y
74# CONFIG_DDB5477 is not set 91# CONFIG_DDB5477 is not set
75# CONFIG_NEC_OSPREY is not set 92# CONFIG_MACH_VR41XX is not set
93# CONFIG_PMC_YOSEMITE is not set
94# CONFIG_QEMU is not set
76# CONFIG_SGI_IP22 is not set 95# CONFIG_SGI_IP22 is not set
77# CONFIG_SOC_AU1X00 is not set 96# CONFIG_SGI_IP27 is not set
78# CONFIG_SIBYTE_SB1xxx_SOC is not set 97# CONFIG_SGI_IP32 is not set
98# CONFIG_SIBYTE_BIGSUR is not set
99# CONFIG_SIBYTE_SWARM is not set
100# CONFIG_SIBYTE_SENTOSA is not set
101# CONFIG_SIBYTE_RHONE is not set
102# CONFIG_SIBYTE_CARMEL is not set
103# CONFIG_SIBYTE_PTSWARM is not set
104# CONFIG_SIBYTE_LITTLESUR is not set
105# CONFIG_SIBYTE_CRHINE is not set
106# CONFIG_SIBYTE_CRHONE is not set
79# CONFIG_SNI_RM200_PCI is not set 107# CONFIG_SNI_RM200_PCI is not set
108# CONFIG_TOSHIBA_JMR3927 is not set
80# CONFIG_TOSHIBA_RBTX4927 is not set 109# CONFIG_TOSHIBA_RBTX4927 is not set
110# CONFIG_TOSHIBA_RBTX4938 is not set
81CONFIG_RWSEM_GENERIC_SPINLOCK=y 111CONFIG_RWSEM_GENERIC_SPINLOCK=y
82CONFIG_GENERIC_CALIBRATE_DELAY=y 112CONFIG_GENERIC_CALIBRATE_DELAY=y
83CONFIG_HAVE_DEC_LOCK=y
84CONFIG_DMA_NONCOHERENT=y 113CONFIG_DMA_NONCOHERENT=y
85CONFIG_DMA_NEED_PCI_MAP_STATE=y 114CONFIG_DMA_NEED_PCI_MAP_STATE=y
86CONFIG_I8259=y 115CONFIG_I8259=y
116# CONFIG_CPU_BIG_ENDIAN is not set
87CONFIG_CPU_LITTLE_ENDIAN=y 117CONFIG_CPU_LITTLE_ENDIAN=y
118CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
88CONFIG_IRQ_CPU=y 119CONFIG_IRQ_CPU=y
89CONFIG_DDB5XXX_COMMON=y 120CONFIG_DDB5XXX_COMMON=y
90CONFIG_MIPS_L1_CACHE_SHIFT=5 121CONFIG_MIPS_L1_CACHE_SHIFT=5
@@ -93,8 +124,10 @@ CONFIG_HAVE_STD_PC_SERIAL_PORT=y
93# 124#
94# CPU selection 125# CPU selection
95# 126#
96# CONFIG_CPU_MIPS32 is not set 127# CONFIG_CPU_MIPS32_R1 is not set
97# CONFIG_CPU_MIPS64 is not set 128# CONFIG_CPU_MIPS32_R2 is not set
129# CONFIG_CPU_MIPS64_R1 is not set
130# CONFIG_CPU_MIPS64_R2 is not set
98# CONFIG_CPU_R3000 is not set 131# CONFIG_CPU_R3000 is not set
99# CONFIG_CPU_TX39XX is not set 132# CONFIG_CPU_TX39XX is not set
100# CONFIG_CPU_VR41XX is not set 133# CONFIG_CPU_VR41XX is not set
@@ -110,14 +143,38 @@ CONFIG_CPU_R5432=y
110# CONFIG_CPU_RM7000 is not set 143# CONFIG_CPU_RM7000 is not set
111# CONFIG_CPU_RM9000 is not set 144# CONFIG_CPU_RM9000 is not set
112# CONFIG_CPU_SB1 is not set 145# CONFIG_CPU_SB1 is not set
146CONFIG_SYS_HAS_CPU_R5432=y
147CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
148CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
149CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
150CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
151
152#
153# Kernel type
154#
155CONFIG_32BIT=y
156# CONFIG_64BIT is not set
113CONFIG_PAGE_SIZE_4KB=y 157CONFIG_PAGE_SIZE_4KB=y
114# CONFIG_PAGE_SIZE_8KB is not set 158# CONFIG_PAGE_SIZE_8KB is not set
115# CONFIG_PAGE_SIZE_16KB is not set 159# CONFIG_PAGE_SIZE_16KB is not set
116# CONFIG_PAGE_SIZE_64KB is not set 160# CONFIG_PAGE_SIZE_64KB is not set
161# CONFIG_MIPS_MT is not set
117# CONFIG_CPU_ADVANCED is not set 162# CONFIG_CPU_ADVANCED is not set
118CONFIG_CPU_HAS_LLSC=y 163CONFIG_CPU_HAS_LLSC=y
119CONFIG_CPU_HAS_LLDSCD=y 164CONFIG_CPU_HAS_LLDSCD=y
120CONFIG_CPU_HAS_SYNC=y 165CONFIG_CPU_HAS_SYNC=y
166CONFIG_GENERIC_HARDIRQS=y
167CONFIG_GENERIC_IRQ_PROBE=y
168CONFIG_ARCH_FLATMEM_ENABLE=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_PREEMPT_NONE=y
177# CONFIG_PREEMPT_VOLUNTARY is not set
121# CONFIG_PREEMPT is not set 178# CONFIG_PREEMPT is not set
122 179
123# 180#
@@ -126,7 +183,6 @@ CONFIG_CPU_HAS_SYNC=y
126CONFIG_HW_HAS_PCI=y 183CONFIG_HW_HAS_PCI=y
127CONFIG_PCI=y 184CONFIG_PCI=y
128CONFIG_PCI_LEGACY_PROC=y 185CONFIG_PCI_LEGACY_PROC=y
129CONFIG_PCI_NAMES=y
130CONFIG_ISA=y 186CONFIG_ISA=y
131CONFIG_MMU=y 187CONFIG_MMU=y
132 188
@@ -136,11 +192,6 @@ CONFIG_MMU=y
136# CONFIG_PCCARD is not set 192# CONFIG_PCCARD is not set
137 193
138# 194#
139# PC-card bridges
140#
141CONFIG_PCMCIA_PROBE=y
142
143#
144# PCI Hotplug Support 195# PCI Hotplug Support
145# 196#
146# CONFIG_HOTPLUG_PCI is not set 197# CONFIG_HOTPLUG_PCI is not set
@@ -153,6 +204,80 @@ CONFIG_BINFMT_ELF=y
153CONFIG_TRAD_SIGNALS=y 204CONFIG_TRAD_SIGNALS=y
154 205
155# 206#
207# Networking
208#
209CONFIG_NET=y
210
211#
212# Networking options
213#
214CONFIG_PACKET=y
215# CONFIG_PACKET_MMAP is not set
216CONFIG_UNIX=y
217CONFIG_XFRM=y
218CONFIG_XFRM_USER=y
219CONFIG_NET_KEY=y
220CONFIG_INET=y
221# CONFIG_IP_MULTICAST is not set
222# CONFIG_IP_ADVANCED_ROUTER is not set
223CONFIG_IP_FIB_HASH=y
224CONFIG_IP_PNP=y
225# CONFIG_IP_PNP_DHCP is not set
226CONFIG_IP_PNP_BOOTP=y
227# CONFIG_IP_PNP_RARP is not set
228# CONFIG_NET_IPIP is not set
229# CONFIG_NET_IPGRE is not set
230# CONFIG_ARPD is not set
231# CONFIG_SYN_COOKIES is not set
232# CONFIG_INET_AH is not set
233# CONFIG_INET_ESP is not set
234# CONFIG_INET_IPCOMP is not set
235CONFIG_INET_TUNNEL=y
236CONFIG_INET_DIAG=y
237CONFIG_INET_TCP_DIAG=y
238# CONFIG_TCP_CONG_ADVANCED is not set
239CONFIG_TCP_CONG_BIC=y
240# CONFIG_IPV6 is not set
241# CONFIG_NETFILTER is not set
242
243#
244# DCCP Configuration (EXPERIMENTAL)
245#
246# CONFIG_IP_DCCP is not set
247
248#
249# SCTP Configuration (EXPERIMENTAL)
250#
251# CONFIG_IP_SCTP is not set
252# CONFIG_ATM is not set
253# CONFIG_BRIDGE is not set
254# CONFIG_VLAN_8021Q is not set
255# CONFIG_DECNET is not set
256# CONFIG_LLC2 is not set
257# CONFIG_IPX is not set
258# CONFIG_ATALK is not set
259# CONFIG_X25 is not set
260# CONFIG_LAPB is not set
261# CONFIG_NET_DIVERT is not set
262# CONFIG_ECONET is not set
263# CONFIG_WAN_ROUTER is not set
264# CONFIG_NET_SCHED is not set
265# CONFIG_NET_CLS_ROUTE is not set
266
267#
268# Network testing
269#
270# CONFIG_NET_PKTGEN is not set
271# CONFIG_HAMRADIO is not set
272# CONFIG_IRDA is not set
273# CONFIG_BT is not set
274CONFIG_IEEE80211=y
275# CONFIG_IEEE80211_DEBUG is not set
276CONFIG_IEEE80211_CRYPT_WEP=y
277CONFIG_IEEE80211_CRYPT_CCMP=y
278CONFIG_IEEE80211_CRYPT_TKIP=y
279
280#
156# Device Drivers 281# Device Drivers
157# 282#
158 283
@@ -161,7 +286,12 @@ CONFIG_TRAD_SIGNALS=y
161# 286#
162CONFIG_STANDALONE=y 287CONFIG_STANDALONE=y
163CONFIG_PREVENT_FIRMWARE_BUILD=y 288CONFIG_PREVENT_FIRMWARE_BUILD=y
164# CONFIG_FW_LOADER is not set 289CONFIG_FW_LOADER=y
290
291#
292# Connector - unified userspace <-> kernelspace linker
293#
294CONFIG_CONNECTOR=y
165 295
166# 296#
167# Memory Technology Devices (MTD) 297# Memory Technology Devices (MTD)
@@ -181,8 +311,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
181# 311#
182# Block devices 312# Block devices
183# 313#
184# CONFIG_BLK_DEV_FD is not set
185# CONFIG_BLK_DEV_XD is not set
186# CONFIG_BLK_CPQ_DA is not set 314# CONFIG_BLK_CPQ_DA is not set
187# CONFIG_BLK_CPQ_CISS_DA is not set 315# CONFIG_BLK_CPQ_CISS_DA is not set
188# CONFIG_BLK_DEV_DAC960 is not set 316# CONFIG_BLK_DEV_DAC960 is not set
@@ -193,7 +321,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
193# CONFIG_BLK_DEV_SX8 is not set 321# CONFIG_BLK_DEV_SX8 is not set
194# CONFIG_BLK_DEV_RAM is not set 322# CONFIG_BLK_DEV_RAM is not set
195CONFIG_BLK_DEV_RAM_COUNT=16 323CONFIG_BLK_DEV_RAM_COUNT=16
196CONFIG_INITRAMFS_SOURCE=""
197# CONFIG_LBD is not set 324# CONFIG_LBD is not set
198CONFIG_CDROM_PKTCDVD=y 325CONFIG_CDROM_PKTCDVD=y
199CONFIG_CDROM_PKTCDVD_BUFFERS=8 326CONFIG_CDROM_PKTCDVD_BUFFERS=8
@@ -239,6 +366,7 @@ CONFIG_IDE_GENERIC=y
239# 366#
240# SCSI device support 367# SCSI device support
241# 368#
369CONFIG_RAID_ATTRS=y
242# CONFIG_SCSI is not set 370# CONFIG_SCSI is not set
243 371
244# 372#
@@ -254,6 +382,7 @@ CONFIG_IDE_GENERIC=y
254# 382#
255# Fusion MPT device support 383# Fusion MPT device support
256# 384#
385# CONFIG_FUSION is not set
257 386
258# 387#
259# IEEE 1394 (FireWire) support 388# IEEE 1394 (FireWire) support
@@ -266,78 +395,13 @@ CONFIG_IDE_GENERIC=y
266# CONFIG_I2O is not set 395# CONFIG_I2O is not set
267 396
268# 397#
269# Networking support 398# Network device support
270#
271CONFIG_NET=y
272
273#
274# Networking options
275#
276CONFIG_PACKET=y
277# CONFIG_PACKET_MMAP is not set
278CONFIG_NETLINK_DEV=y
279CONFIG_UNIX=y
280CONFIG_NET_KEY=y
281CONFIG_INET=y
282# CONFIG_IP_MULTICAST is not set
283# CONFIG_IP_ADVANCED_ROUTER is not set
284CONFIG_IP_PNP=y
285# CONFIG_IP_PNP_DHCP is not set
286CONFIG_IP_PNP_BOOTP=y
287# CONFIG_IP_PNP_RARP is not set
288# CONFIG_NET_IPIP is not set
289# CONFIG_NET_IPGRE is not set
290# CONFIG_ARPD is not set
291# CONFIG_SYN_COOKIES is not set
292# CONFIG_INET_AH is not set
293# CONFIG_INET_ESP is not set
294# CONFIG_INET_IPCOMP is not set
295CONFIG_INET_TUNNEL=y
296CONFIG_IP_TCPDIAG=y
297# CONFIG_IP_TCPDIAG_IPV6 is not set
298# CONFIG_IPV6 is not set
299# CONFIG_NETFILTER is not set
300CONFIG_XFRM=y
301CONFIG_XFRM_USER=y
302
303#
304# SCTP Configuration (EXPERIMENTAL)
305# 399#
306# CONFIG_IP_SCTP is not set
307# CONFIG_ATM is not set
308# CONFIG_BRIDGE is not set
309# CONFIG_VLAN_8021Q is not set
310# CONFIG_DECNET is not set
311# CONFIG_LLC2 is not set
312# CONFIG_IPX is not set
313# CONFIG_ATALK is not set
314# CONFIG_X25 is not set
315# CONFIG_LAPB is not set
316# CONFIG_NET_DIVERT is not set
317# CONFIG_ECONET is not set
318# CONFIG_WAN_ROUTER is not set
319
320#
321# QoS and/or fair queueing
322#
323# CONFIG_NET_SCHED is not set
324# CONFIG_NET_CLS_ROUTE is not set
325
326#
327# Network testing
328#
329# CONFIG_NET_PKTGEN is not set
330# CONFIG_NETPOLL is not set
331# CONFIG_NET_POLL_CONTROLLER is not set
332# CONFIG_HAMRADIO is not set
333# CONFIG_IRDA is not set
334# CONFIG_BT is not set
335CONFIG_NETDEVICES=y 400CONFIG_NETDEVICES=y
336# CONFIG_DUMMY is not set 401# CONFIG_DUMMY is not set
337# CONFIG_BONDING is not set 402# CONFIG_BONDING is not set
338# CONFIG_EQUALIZER is not set 403# CONFIG_EQUALIZER is not set
339# CONFIG_TUN is not set 404# CONFIG_TUN is not set
340# CONFIG_ETHERTAP is not set
341 405
342# 406#
343# ARCnet devices 407# ARCnet devices
@@ -345,6 +409,21 @@ CONFIG_NETDEVICES=y
345# CONFIG_ARCNET is not set 409# CONFIG_ARCNET is not set
346 410
347# 411#
412# PHY device support
413#
414CONFIG_PHYLIB=y
415CONFIG_PHYCONTROL=y
416
417#
418# MII PHY device drivers
419#
420CONFIG_MARVELL_PHY=y
421CONFIG_DAVICOM_PHY=y
422CONFIG_QSEMI_PHY=y
423CONFIG_LXT_PHY=y
424CONFIG_CICADA_PHY=y
425
426#
348# Ethernet (10 or 100Mbit) 427# Ethernet (10 or 100Mbit)
349# 428#
350CONFIG_NET_ETHERNET=y 429CONFIG_NET_ETHERNET=y
@@ -352,7 +431,6 @@ CONFIG_NET_ETHERNET=y
352# CONFIG_HAPPYMEAL is not set 431# CONFIG_HAPPYMEAL is not set
353# CONFIG_SUNGEM is not set 432# CONFIG_SUNGEM is not set
354# CONFIG_NET_VENDOR_3COM is not set 433# CONFIG_NET_VENDOR_3COM is not set
355# CONFIG_LANCE is not set
356# CONFIG_NET_VENDOR_SMC is not set 434# CONFIG_NET_VENDOR_SMC is not set
357# CONFIG_NET_VENDOR_RACAL is not set 435# CONFIG_NET_VENDOR_RACAL is not set
358 436
@@ -377,12 +455,16 @@ CONFIG_NET_ETHERNET=y
377# CONFIG_HAMACHI is not set 455# CONFIG_HAMACHI is not set
378# CONFIG_YELLOWFIN is not set 456# CONFIG_YELLOWFIN is not set
379# CONFIG_R8169 is not set 457# CONFIG_R8169 is not set
458# CONFIG_SIS190 is not set
459# CONFIG_SKGE is not set
380# CONFIG_SK98LIN is not set 460# CONFIG_SK98LIN is not set
381# CONFIG_TIGON3 is not set 461# CONFIG_TIGON3 is not set
462# CONFIG_BNX2 is not set
382 463
383# 464#
384# Ethernet (10000 Mbit) 465# Ethernet (10000 Mbit)
385# 466#
467# CONFIG_CHELSIO_T1 is not set
386# CONFIG_IXGB is not set 468# CONFIG_IXGB is not set
387# CONFIG_S2IO is not set 469# CONFIG_S2IO is not set
388 470
@@ -395,6 +477,8 @@ CONFIG_NET_ETHERNET=y
395# Wireless LAN (non-hamradio) 477# Wireless LAN (non-hamradio)
396# 478#
397# CONFIG_NET_RADIO is not set 479# CONFIG_NET_RADIO is not set
480# CONFIG_IPW_DEBUG is not set
481CONFIG_IPW2200=y
398 482
399# 483#
400# Wan interfaces 484# Wan interfaces
@@ -406,6 +490,8 @@ CONFIG_NET_ETHERNET=y
406# CONFIG_SLIP is not set 490# CONFIG_SLIP is not set
407# CONFIG_SHAPER is not set 491# CONFIG_SHAPER is not set
408# CONFIG_NETCONSOLE is not set 492# CONFIG_NETCONSOLE is not set
493# CONFIG_NETPOLL is not set
494# CONFIG_NET_POLL_CONTROLLER is not set
409 495
410# 496#
411# ISDN subsystem 497# ISDN subsystem
@@ -435,19 +521,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
435# CONFIG_INPUT_EVBUG is not set 521# CONFIG_INPUT_EVBUG is not set
436 522
437# 523#
438# Input I/O drivers
439#
440# CONFIG_GAMEPORT is not set
441CONFIG_SOUND_GAMEPORT=y
442CONFIG_SERIO=y
443# CONFIG_SERIO_I8042 is not set
444CONFIG_SERIO_SERPORT=y
445# CONFIG_SERIO_CT82C710 is not set
446# CONFIG_SERIO_PCIPS2 is not set
447# CONFIG_SERIO_LIBPS2 is not set
448CONFIG_SERIO_RAW=y
449
450#
451# Input Device Drivers 524# Input Device Drivers
452# 525#
453# CONFIG_INPUT_KEYBOARD is not set 526# CONFIG_INPUT_KEYBOARD is not set
@@ -457,6 +530,17 @@ CONFIG_SERIO_RAW=y
457# CONFIG_INPUT_MISC is not set 530# CONFIG_INPUT_MISC is not set
458 531
459# 532#
533# Hardware I/O ports
534#
535CONFIG_SERIO=y
536# CONFIG_SERIO_I8042 is not set
537CONFIG_SERIO_SERPORT=y
538# CONFIG_SERIO_PCIPS2 is not set
539# CONFIG_SERIO_LIBPS2 is not set
540CONFIG_SERIO_RAW=y
541# CONFIG_GAMEPORT is not set
542
543#
460# Character devices 544# Character devices
461# 545#
462CONFIG_VT=y 546CONFIG_VT=y
@@ -477,6 +561,7 @@ CONFIG_SERIAL_8250_NR_UARTS=4
477# 561#
478CONFIG_SERIAL_CORE=y 562CONFIG_SERIAL_CORE=y
479CONFIG_SERIAL_CORE_CONSOLE=y 563CONFIG_SERIAL_CORE_CONSOLE=y
564# CONFIG_SERIAL_JSM is not set
480CONFIG_UNIX98_PTYS=y 565CONFIG_UNIX98_PTYS=y
481CONFIG_LEGACY_PTYS=y 566CONFIG_LEGACY_PTYS=y
482CONFIG_LEGACY_PTY_COUNT=256 567CONFIG_LEGACY_PTY_COUNT=256
@@ -503,6 +588,11 @@ CONFIG_LEGACY_PTY_COUNT=256
503# CONFIG_RAW_DRIVER is not set 588# CONFIG_RAW_DRIVER is not set
504 589
505# 590#
591# TPM devices
592#
593# CONFIG_TCG_TPM is not set
594
595#
506# I2C support 596# I2C support
507# 597#
508# CONFIG_I2C is not set 598# CONFIG_I2C is not set
@@ -513,10 +603,20 @@ CONFIG_LEGACY_PTY_COUNT=256
513# CONFIG_W1 is not set 603# CONFIG_W1 is not set
514 604
515# 605#
606# Hardware Monitoring support
607#
608# CONFIG_HWMON is not set
609# CONFIG_HWMON_VID is not set
610
611#
516# Misc devices 612# Misc devices
517# 613#
518 614
519# 615#
616# Multimedia Capabilities Port drivers
617#
618
619#
520# Multimedia devices 620# Multimedia devices
521# 621#
522# CONFIG_VIDEO_DEV is not set 622# CONFIG_VIDEO_DEV is not set
@@ -530,6 +630,11 @@ CONFIG_LEGACY_PTY_COUNT=256
530# Graphics support 630# Graphics support
531# 631#
532CONFIG_FB=y 632CONFIG_FB=y
633# CONFIG_FB_CFB_FILLRECT is not set
634# CONFIG_FB_CFB_COPYAREA is not set
635# CONFIG_FB_CFB_IMAGEBLIT is not set
636# CONFIG_FB_SOFT_CURSOR is not set
637# CONFIG_FB_MACMODES is not set
533# CONFIG_FB_MODE_HELPERS is not set 638# CONFIG_FB_MODE_HELPERS is not set
534# CONFIG_FB_TILEBLITTING is not set 639# CONFIG_FB_TILEBLITTING is not set
535# CONFIG_FB_CIRRUS is not set 640# CONFIG_FB_CIRRUS is not set
@@ -537,6 +642,7 @@ CONFIG_FB=y
537# CONFIG_FB_CYBER2000 is not set 642# CONFIG_FB_CYBER2000 is not set
538# CONFIG_FB_ASILIANT is not set 643# CONFIG_FB_ASILIANT is not set
539# CONFIG_FB_IMSTT is not set 644# CONFIG_FB_IMSTT is not set
645# CONFIG_FB_NVIDIA is not set
540# CONFIG_FB_RIVA is not set 646# CONFIG_FB_RIVA is not set
541# CONFIG_FB_MATROX is not set 647# CONFIG_FB_MATROX is not set
542# CONFIG_FB_RADEON_OLD is not set 648# CONFIG_FB_RADEON_OLD is not set
@@ -549,8 +655,11 @@ CONFIG_FB=y
549# CONFIG_FB_KYRO is not set 655# CONFIG_FB_KYRO is not set
550# CONFIG_FB_3DFX is not set 656# CONFIG_FB_3DFX is not set
551# CONFIG_FB_VOODOO1 is not set 657# CONFIG_FB_VOODOO1 is not set
658# CONFIG_FB_SMIVGX is not set
659# CONFIG_FB_CYBLA is not set
552# CONFIG_FB_TRIDENT is not set 660# CONFIG_FB_TRIDENT is not set
553# CONFIG_FB_E1356 is not set 661# CONFIG_FB_E1356 is not set
662# CONFIG_FB_S1D13XXX is not set
554# CONFIG_FB_VIRTUAL is not set 663# CONFIG_FB_VIRTUAL is not set
555 664
556# 665#
@@ -575,13 +684,9 @@ CONFIG_DUMMY_CONSOLE=y
575# 684#
576# USB support 685# USB support
577# 686#
578# CONFIG_USB is not set
579CONFIG_USB_ARCH_HAS_HCD=y 687CONFIG_USB_ARCH_HAS_HCD=y
580CONFIG_USB_ARCH_HAS_OHCI=y 688CONFIG_USB_ARCH_HAS_OHCI=y
581 689# CONFIG_USB is not set
582#
583# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
584#
585 690
586# 691#
587# USB Gadget Support 692# USB Gadget Support
@@ -599,21 +704,29 @@ CONFIG_USB_ARCH_HAS_OHCI=y
599# CONFIG_INFINIBAND is not set 704# CONFIG_INFINIBAND is not set
600 705
601# 706#
707# SN Devices
708#
709
710#
602# File systems 711# File systems
603# 712#
604CONFIG_EXT2_FS=y 713CONFIG_EXT2_FS=y
605# CONFIG_EXT2_FS_XATTR is not set 714# CONFIG_EXT2_FS_XATTR is not set
715# CONFIG_EXT2_FS_XIP is not set
606# CONFIG_EXT3_FS is not set 716# CONFIG_EXT3_FS is not set
607# CONFIG_JBD is not set 717# CONFIG_JBD is not set
608# CONFIG_REISERFS_FS is not set 718# CONFIG_REISERFS_FS is not set
609# CONFIG_JFS_FS is not set 719# CONFIG_JFS_FS is not set
720# CONFIG_FS_POSIX_ACL is not set
610# CONFIG_XFS_FS is not set 721# CONFIG_XFS_FS is not set
611# CONFIG_MINIX_FS is not set 722# CONFIG_MINIX_FS is not set
612# CONFIG_ROMFS_FS is not set 723# CONFIG_ROMFS_FS is not set
724CONFIG_INOTIFY=y
613# CONFIG_QUOTA is not set 725# CONFIG_QUOTA is not set
614CONFIG_DNOTIFY=y 726CONFIG_DNOTIFY=y
615# CONFIG_AUTOFS_FS is not set 727# CONFIG_AUTOFS_FS is not set
616# CONFIG_AUTOFS4_FS is not set 728# CONFIG_AUTOFS4_FS is not set
729CONFIG_FUSE_FS=y
617 730
618# 731#
619# CD-ROM/DVD Filesystems 732# CD-ROM/DVD Filesystems
@@ -634,12 +747,10 @@ CONFIG_DNOTIFY=y
634CONFIG_PROC_FS=y 747CONFIG_PROC_FS=y
635CONFIG_PROC_KCORE=y 748CONFIG_PROC_KCORE=y
636CONFIG_SYSFS=y 749CONFIG_SYSFS=y
637# CONFIG_DEVFS_FS is not set
638CONFIG_DEVPTS_FS_XATTR=y
639CONFIG_DEVPTS_FS_SECURITY=y
640# CONFIG_TMPFS is not set 750# CONFIG_TMPFS is not set
641# CONFIG_HUGETLB_PAGE is not set 751# CONFIG_HUGETLB_PAGE is not set
642CONFIG_RAMFS=y 752CONFIG_RAMFS=y
753CONFIG_RELAYFS_FS=y
643 754
644# 755#
645# Miscellaneous filesystems 756# Miscellaneous filesystems
@@ -668,7 +779,7 @@ CONFIG_NFS_FS=y
668# CONFIG_NFSD is not set 779# CONFIG_NFSD is not set
669CONFIG_ROOT_NFS=y 780CONFIG_ROOT_NFS=y
670CONFIG_LOCKD=y 781CONFIG_LOCKD=y
671# CONFIG_EXPORTFS is not set 782CONFIG_NFS_COMMON=y
672CONFIG_SUNRPC=y 783CONFIG_SUNRPC=y
673# CONFIG_RPCSEC_GSS_KRB5 is not set 784# CONFIG_RPCSEC_GSS_KRB5 is not set
674# CONFIG_RPCSEC_GSS_SPKM3 is not set 785# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -677,6 +788,7 @@ CONFIG_SUNRPC=y
677# CONFIG_NCP_FS is not set 788# CONFIG_NCP_FS is not set
678# CONFIG_CODA_FS is not set 789# CONFIG_CODA_FS is not set
679# CONFIG_AFS_FS is not set 790# CONFIG_AFS_FS is not set
791# CONFIG_9P_FS is not set
680 792
681# 793#
682# Partition Types 794# Partition Types
@@ -697,7 +809,9 @@ CONFIG_MSDOS_PARTITION=y
697# 809#
698# Kernel hacking 810# Kernel hacking
699# 811#
812# CONFIG_PRINTK_TIME is not set
700# CONFIG_DEBUG_KERNEL is not set 813# CONFIG_DEBUG_KERNEL is not set
814CONFIG_LOG_BUF_SHIFT=14
701CONFIG_CROSSCOMPILE=y 815CONFIG_CROSSCOMPILE=y
702CONFIG_CMDLINE="ip=any" 816CONFIG_CMDLINE="ip=any"
703 817
@@ -711,7 +825,31 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
711# 825#
712# Cryptographic options 826# Cryptographic options
713# 827#
714# CONFIG_CRYPTO is not set 828CONFIG_CRYPTO=y
829CONFIG_CRYPTO_HMAC=y
830CONFIG_CRYPTO_NULL=y
831CONFIG_CRYPTO_MD4=y
832CONFIG_CRYPTO_MD5=y
833CONFIG_CRYPTO_SHA1=y
834CONFIG_CRYPTO_SHA256=y
835CONFIG_CRYPTO_SHA512=y
836CONFIG_CRYPTO_WP512=y
837CONFIG_CRYPTO_TGR192=y
838CONFIG_CRYPTO_DES=y
839CONFIG_CRYPTO_BLOWFISH=y
840CONFIG_CRYPTO_TWOFISH=y
841CONFIG_CRYPTO_SERPENT=y
842CONFIG_CRYPTO_AES=y
843CONFIG_CRYPTO_CAST5=y
844CONFIG_CRYPTO_CAST6=y
845CONFIG_CRYPTO_TEA=y
846CONFIG_CRYPTO_ARC4=y
847CONFIG_CRYPTO_KHAZAD=y
848CONFIG_CRYPTO_ANUBIS=y
849CONFIG_CRYPTO_DEFLATE=y
850CONFIG_CRYPTO_MICHAEL_MIC=y
851CONFIG_CRYPTO_CRC32C=y
852# CONFIG_CRYPTO_TEST is not set
715 853
716# 854#
717# Hardware crypto devices 855# Hardware crypto devices
@@ -721,7 +859,8 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
721# Library routines 859# Library routines
722# 860#
723# CONFIG_CRC_CCITT is not set 861# CONFIG_CRC_CCITT is not set
724# CONFIG_CRC32 is not set 862CONFIG_CRC16=y
725# CONFIG_LIBCRC32C is not set 863CONFIG_CRC32=y
726CONFIG_GENERIC_HARDIRQS=y 864CONFIG_LIBCRC32C=y
727CONFIG_GENERIC_IRQ_PROBE=y 865CONFIG_ZLIB_INFLATE=y
866CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/mips/configs/ddb5477_defconfig b/arch/mips/configs/ddb5477_defconfig
index 60292808b384..c2a01df3c8df 100644
--- a/arch/mips/configs/ddb5477_defconfig
+++ b/arch/mips/configs/ddb5477_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:02 2005 4# Thu Oct 20 22:25:45 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,24 +11,29 @@ CONFIG_32BIT=y
14CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
25# CONFIG_BSD_PROCESS_ACCT is not set 24# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y 25CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set 26# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14 27CONFIG_HOTPLUG=y
29# CONFIG_HOTPLUG is not set
30CONFIG_KOBJECT_UEVENT=y 28CONFIG_KOBJECT_UEVENT=y
31# CONFIG_IKCONFIG is not set 29# CONFIG_IKCONFIG is not set
30CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y 31CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y 32CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_EXTRA_PASS is not set 33# CONFIG_KALLSYMS_EXTRA_PASS is not set
34CONFIG_PRINTK=y
35CONFIG_BUG=y
36CONFIG_BASE_FULL=y
35CONFIG_FUTEX=y 37CONFIG_FUTEX=y
36CONFIG_EPOLL=y 38CONFIG_EPOLL=y
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -41,6 +43,7 @@ CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0 43CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0 44CONFIG_CC_ALIGN_JUMPS=0
43# CONFIG_TINY_SHMEM is not set 45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
44 47
45# 48#
46# Loadable module support 49# Loadable module support
@@ -50,42 +53,70 @@ CONFIG_CC_ALIGN_JUMPS=0
50# 53#
51# Machine selection 54# Machine selection
52# 55#
53# CONFIG_MACH_JAZZ is not set 56# CONFIG_MIPS_MTX1 is not set
54# CONFIG_MACH_VR41XX is not set 57# CONFIG_MIPS_BOSPORUS is not set
55# CONFIG_TOSHIBA_JMR3927 is not set 58# CONFIG_MIPS_PB1000 is not set
59# CONFIG_MIPS_PB1100 is not set
60# CONFIG_MIPS_PB1500 is not set
61# CONFIG_MIPS_PB1550 is not set
62# CONFIG_MIPS_PB1200 is not set
63# CONFIG_MIPS_DB1000 is not set
64# CONFIG_MIPS_DB1100 is not set
65# CONFIG_MIPS_DB1500 is not set
66# CONFIG_MIPS_DB1550 is not set
67# CONFIG_MIPS_DB1200 is not set
68# CONFIG_MIPS_MIRAGE is not set
56# CONFIG_MIPS_COBALT is not set 69# CONFIG_MIPS_COBALT is not set
57# CONFIG_MACH_DECSTATION is not set 70# CONFIG_MACH_DECSTATION is not set
58# CONFIG_MIPS_EV64120 is not set 71# CONFIG_MIPS_EV64120 is not set
59# CONFIG_MIPS_EV96100 is not set 72# CONFIG_MIPS_EV96100 is not set
60# CONFIG_MIPS_IVR is not set 73# CONFIG_MIPS_IVR is not set
61# CONFIG_LASAT is not set
62# CONFIG_MIPS_ITE8172 is not set 74# CONFIG_MIPS_ITE8172 is not set
75# CONFIG_MACH_JAZZ is not set
76# CONFIG_LASAT is not set
63# CONFIG_MIPS_ATLAS is not set 77# CONFIG_MIPS_ATLAS is not set
64# CONFIG_MIPS_MALTA is not set 78# CONFIG_MIPS_MALTA is not set
65# CONFIG_MIPS_SEAD is not set 79# CONFIG_MIPS_SEAD is not set
80# CONFIG_MIPS_SIM is not set
81# CONFIG_MOMENCO_JAGUAR_ATX is not set
66# CONFIG_MOMENCO_OCELOT is not set 82# CONFIG_MOMENCO_OCELOT is not set
67# CONFIG_MOMENCO_OCELOT_G is not set
68# CONFIG_MOMENCO_OCELOT_C is not set
69# CONFIG_MOMENCO_OCELOT_3 is not set 83# CONFIG_MOMENCO_OCELOT_3 is not set
70# CONFIG_MOMENCO_JAGUAR_ATX is not set 84# CONFIG_MOMENCO_OCELOT_C is not set
71# CONFIG_PMC_YOSEMITE is not set 85# CONFIG_MOMENCO_OCELOT_G is not set
86# CONFIG_MIPS_XXS1500 is not set
87# CONFIG_PNX8550_V2PCI is not set
88# CONFIG_PNX8550_JBS is not set
72# CONFIG_DDB5074 is not set 89# CONFIG_DDB5074 is not set
73# CONFIG_DDB5476 is not set 90# CONFIG_DDB5476 is not set
74CONFIG_DDB5477=y 91CONFIG_DDB5477=y
75CONFIG_DDB5477_BUS_FREQUENCY=0 92# CONFIG_MACH_VR41XX is not set
76# CONFIG_NEC_OSPREY is not set 93# CONFIG_PMC_YOSEMITE is not set
94# CONFIG_QEMU is not set
77# CONFIG_SGI_IP22 is not set 95# CONFIG_SGI_IP22 is not set
78# CONFIG_SOC_AU1X00 is not set 96# CONFIG_SGI_IP27 is not set
79# CONFIG_SIBYTE_SB1xxx_SOC is not set 97# CONFIG_SGI_IP32 is not set
98# CONFIG_SIBYTE_BIGSUR is not set
99# CONFIG_SIBYTE_SWARM is not set
100# CONFIG_SIBYTE_SENTOSA is not set
101# CONFIG_SIBYTE_RHONE is not set
102# CONFIG_SIBYTE_CARMEL is not set
103# CONFIG_SIBYTE_PTSWARM is not set
104# CONFIG_SIBYTE_LITTLESUR is not set
105# CONFIG_SIBYTE_CRHINE is not set
106# CONFIG_SIBYTE_CRHONE is not set
80# CONFIG_SNI_RM200_PCI is not set 107# CONFIG_SNI_RM200_PCI is not set
108# CONFIG_TOSHIBA_JMR3927 is not set
81# CONFIG_TOSHIBA_RBTX4927 is not set 109# CONFIG_TOSHIBA_RBTX4927 is not set
110# CONFIG_TOSHIBA_RBTX4938 is not set
111CONFIG_DDB5477_BUS_FREQUENCY=0
82CONFIG_RWSEM_GENERIC_SPINLOCK=y 112CONFIG_RWSEM_GENERIC_SPINLOCK=y
83CONFIG_GENERIC_CALIBRATE_DELAY=y 113CONFIG_GENERIC_CALIBRATE_DELAY=y
84CONFIG_HAVE_DEC_LOCK=y
85CONFIG_DMA_NONCOHERENT=y 114CONFIG_DMA_NONCOHERENT=y
86CONFIG_DMA_NEED_PCI_MAP_STATE=y 115CONFIG_DMA_NEED_PCI_MAP_STATE=y
87CONFIG_I8259=y 116CONFIG_I8259=y
117# CONFIG_CPU_BIG_ENDIAN is not set
88CONFIG_CPU_LITTLE_ENDIAN=y 118CONFIG_CPU_LITTLE_ENDIAN=y
119CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
89CONFIG_IRQ_CPU=y 120CONFIG_IRQ_CPU=y
90CONFIG_DDB5XXX_COMMON=y 121CONFIG_DDB5XXX_COMMON=y
91CONFIG_MIPS_L1_CACHE_SHIFT=5 122CONFIG_MIPS_L1_CACHE_SHIFT=5
@@ -93,8 +124,10 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
93# 124#
94# CPU selection 125# CPU selection
95# 126#
96# CONFIG_CPU_MIPS32 is not set 127# CONFIG_CPU_MIPS32_R1 is not set
97# CONFIG_CPU_MIPS64 is not set 128# CONFIG_CPU_MIPS32_R2 is not set
129# CONFIG_CPU_MIPS64_R1 is not set
130# CONFIG_CPU_MIPS64_R2 is not set
98# CONFIG_CPU_R3000 is not set 131# CONFIG_CPU_R3000 is not set
99# CONFIG_CPU_TX39XX is not set 132# CONFIG_CPU_TX39XX is not set
100# CONFIG_CPU_VR41XX is not set 133# CONFIG_CPU_VR41XX is not set
@@ -110,14 +143,38 @@ CONFIG_CPU_R5432=y
110# CONFIG_CPU_RM7000 is not set 143# CONFIG_CPU_RM7000 is not set
111# CONFIG_CPU_RM9000 is not set 144# CONFIG_CPU_RM9000 is not set
112# CONFIG_CPU_SB1 is not set 145# CONFIG_CPU_SB1 is not set
146CONFIG_SYS_HAS_CPU_R5432=y
147CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
148CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
149CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
150CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
151
152#
153# Kernel type
154#
155CONFIG_32BIT=y
156# CONFIG_64BIT is not set
113CONFIG_PAGE_SIZE_4KB=y 157CONFIG_PAGE_SIZE_4KB=y
114# CONFIG_PAGE_SIZE_8KB is not set 158# CONFIG_PAGE_SIZE_8KB is not set
115# CONFIG_PAGE_SIZE_16KB is not set 159# CONFIG_PAGE_SIZE_16KB is not set
116# CONFIG_PAGE_SIZE_64KB is not set 160# CONFIG_PAGE_SIZE_64KB is not set
161# CONFIG_MIPS_MT is not set
117# CONFIG_CPU_ADVANCED is not set 162# CONFIG_CPU_ADVANCED is not set
118CONFIG_CPU_HAS_LLSC=y 163CONFIG_CPU_HAS_LLSC=y
119CONFIG_CPU_HAS_LLDSCD=y 164CONFIG_CPU_HAS_LLDSCD=y
120CONFIG_CPU_HAS_SYNC=y 165CONFIG_CPU_HAS_SYNC=y
166CONFIG_GENERIC_HARDIRQS=y
167CONFIG_GENERIC_IRQ_PROBE=y
168CONFIG_ARCH_FLATMEM_ENABLE=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_PREEMPT_NONE=y
177# CONFIG_PREEMPT_VOLUNTARY is not set
121# CONFIG_PREEMPT is not set 178# CONFIG_PREEMPT is not set
122 179
123# 180#
@@ -126,7 +183,6 @@ CONFIG_CPU_HAS_SYNC=y
126CONFIG_HW_HAS_PCI=y 183CONFIG_HW_HAS_PCI=y
127CONFIG_PCI=y 184CONFIG_PCI=y
128CONFIG_PCI_LEGACY_PROC=y 185CONFIG_PCI_LEGACY_PROC=y
129CONFIG_PCI_NAMES=y
130CONFIG_MMU=y 186CONFIG_MMU=y
131 187
132# 188#
@@ -135,10 +191,6 @@ CONFIG_MMU=y
135# CONFIG_PCCARD is not set 191# CONFIG_PCCARD is not set
136 192
137# 193#
138# PC-card bridges
139#
140
141#
142# PCI Hotplug Support 194# PCI Hotplug Support
143# 195#
144# CONFIG_HOTPLUG_PCI is not set 196# CONFIG_HOTPLUG_PCI is not set
@@ -151,6 +203,80 @@ CONFIG_BINFMT_ELF=y
151CONFIG_TRAD_SIGNALS=y 203CONFIG_TRAD_SIGNALS=y
152 204
153# 205#
206# Networking
207#
208CONFIG_NET=y
209
210#
211# Networking options
212#
213CONFIG_PACKET=y
214# CONFIG_PACKET_MMAP is not set
215CONFIG_UNIX=y
216CONFIG_XFRM=y
217CONFIG_XFRM_USER=y
218CONFIG_NET_KEY=y
219CONFIG_INET=y
220# CONFIG_IP_MULTICAST is not set
221# CONFIG_IP_ADVANCED_ROUTER is not set
222CONFIG_IP_FIB_HASH=y
223CONFIG_IP_PNP=y
224# CONFIG_IP_PNP_DHCP is not set
225CONFIG_IP_PNP_BOOTP=y
226# CONFIG_IP_PNP_RARP is not set
227# CONFIG_NET_IPIP is not set
228# CONFIG_NET_IPGRE is not set
229# CONFIG_ARPD is not set
230# CONFIG_SYN_COOKIES is not set
231# CONFIG_INET_AH is not set
232# CONFIG_INET_ESP is not set
233# CONFIG_INET_IPCOMP is not set
234CONFIG_INET_TUNNEL=y
235CONFIG_INET_DIAG=y
236CONFIG_INET_TCP_DIAG=y
237# CONFIG_TCP_CONG_ADVANCED is not set
238CONFIG_TCP_CONG_BIC=y
239# CONFIG_IPV6 is not set
240# CONFIG_NETFILTER is not set
241
242#
243# DCCP Configuration (EXPERIMENTAL)
244#
245# CONFIG_IP_DCCP is not set
246
247#
248# SCTP Configuration (EXPERIMENTAL)
249#
250# CONFIG_IP_SCTP is not set
251# CONFIG_ATM is not set
252# CONFIG_BRIDGE is not set
253# CONFIG_VLAN_8021Q is not set
254# CONFIG_DECNET is not set
255# CONFIG_LLC2 is not set
256# CONFIG_IPX is not set
257# CONFIG_ATALK is not set
258# CONFIG_X25 is not set
259# CONFIG_LAPB is not set
260# CONFIG_NET_DIVERT is not set
261# CONFIG_ECONET is not set
262# CONFIG_WAN_ROUTER is not set
263# CONFIG_NET_SCHED is not set
264# CONFIG_NET_CLS_ROUTE is not set
265
266#
267# Network testing
268#
269# CONFIG_NET_PKTGEN is not set
270# CONFIG_HAMRADIO is not set
271# CONFIG_IRDA is not set
272# CONFIG_BT is not set
273CONFIG_IEEE80211=y
274# CONFIG_IEEE80211_DEBUG is not set
275CONFIG_IEEE80211_CRYPT_WEP=y
276CONFIG_IEEE80211_CRYPT_CCMP=y
277CONFIG_IEEE80211_CRYPT_TKIP=y
278
279#
154# Device Drivers 280# Device Drivers
155# 281#
156 282
@@ -159,7 +285,12 @@ CONFIG_TRAD_SIGNALS=y
159# 285#
160CONFIG_STANDALONE=y 286CONFIG_STANDALONE=y
161CONFIG_PREVENT_FIRMWARE_BUILD=y 287CONFIG_PREVENT_FIRMWARE_BUILD=y
162# CONFIG_FW_LOADER is not set 288CONFIG_FW_LOADER=y
289
290#
291# Connector - unified userspace <-> kernelspace linker
292#
293CONFIG_CONNECTOR=y
163 294
164# 295#
165# Memory Technology Devices (MTD) 296# Memory Technology Devices (MTD)
@@ -178,7 +309,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
178# 309#
179# Block devices 310# Block devices
180# 311#
181# CONFIG_BLK_DEV_FD is not set
182# CONFIG_BLK_CPQ_DA is not set 312# CONFIG_BLK_CPQ_DA is not set
183# CONFIG_BLK_CPQ_CISS_DA is not set 313# CONFIG_BLK_CPQ_CISS_DA is not set
184# CONFIG_BLK_DEV_DAC960 is not set 314# CONFIG_BLK_DEV_DAC960 is not set
@@ -189,7 +319,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
189# CONFIG_BLK_DEV_SX8 is not set 319# CONFIG_BLK_DEV_SX8 is not set
190# CONFIG_BLK_DEV_RAM is not set 320# CONFIG_BLK_DEV_RAM is not set
191CONFIG_BLK_DEV_RAM_COUNT=16 321CONFIG_BLK_DEV_RAM_COUNT=16
192CONFIG_INITRAMFS_SOURCE=""
193# CONFIG_LBD is not set 322# CONFIG_LBD is not set
194CONFIG_CDROM_PKTCDVD=y 323CONFIG_CDROM_PKTCDVD=y
195CONFIG_CDROM_PKTCDVD_BUFFERS=8 324CONFIG_CDROM_PKTCDVD_BUFFERS=8
@@ -212,6 +341,7 @@ CONFIG_ATA_OVER_ETH=y
212# 341#
213# SCSI device support 342# SCSI device support
214# 343#
344CONFIG_RAID_ATTRS=y
215# CONFIG_SCSI is not set 345# CONFIG_SCSI is not set
216 346
217# 347#
@@ -222,6 +352,7 @@ CONFIG_ATA_OVER_ETH=y
222# 352#
223# Fusion MPT device support 353# Fusion MPT device support
224# 354#
355# CONFIG_FUSION is not set
225 356
226# 357#
227# IEEE 1394 (FireWire) support 358# IEEE 1394 (FireWire) support
@@ -234,78 +365,13 @@ CONFIG_ATA_OVER_ETH=y
234# CONFIG_I2O is not set 365# CONFIG_I2O is not set
235 366
236# 367#
237# Networking support 368# Network device support
238#
239CONFIG_NET=y
240
241#
242# Networking options
243#
244CONFIG_PACKET=y
245# CONFIG_PACKET_MMAP is not set
246CONFIG_NETLINK_DEV=y
247CONFIG_UNIX=y
248CONFIG_NET_KEY=y
249CONFIG_INET=y
250# CONFIG_IP_MULTICAST is not set
251# CONFIG_IP_ADVANCED_ROUTER is not set
252CONFIG_IP_PNP=y
253# CONFIG_IP_PNP_DHCP is not set
254CONFIG_IP_PNP_BOOTP=y
255# CONFIG_IP_PNP_RARP is not set
256# CONFIG_NET_IPIP is not set
257# CONFIG_NET_IPGRE is not set
258# CONFIG_ARPD is not set
259# CONFIG_SYN_COOKIES is not set
260# CONFIG_INET_AH is not set
261# CONFIG_INET_ESP is not set
262# CONFIG_INET_IPCOMP is not set
263CONFIG_INET_TUNNEL=y
264CONFIG_IP_TCPDIAG=y
265# CONFIG_IP_TCPDIAG_IPV6 is not set
266# CONFIG_IPV6 is not set
267# CONFIG_NETFILTER is not set
268CONFIG_XFRM=y
269CONFIG_XFRM_USER=y
270
271#
272# SCTP Configuration (EXPERIMENTAL)
273#
274# CONFIG_IP_SCTP is not set
275# CONFIG_ATM is not set
276# CONFIG_BRIDGE is not set
277# CONFIG_VLAN_8021Q is not set
278# CONFIG_DECNET is not set
279# CONFIG_LLC2 is not set
280# CONFIG_IPX is not set
281# CONFIG_ATALK is not set
282# CONFIG_X25 is not set
283# CONFIG_LAPB is not set
284# CONFIG_NET_DIVERT 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# 369#
291# CONFIG_NET_SCHED is not set
292# CONFIG_NET_CLS_ROUTE is not set
293
294#
295# Network testing
296#
297# CONFIG_NET_PKTGEN is not set
298# CONFIG_NETPOLL is not set
299# CONFIG_NET_POLL_CONTROLLER is not set
300# CONFIG_HAMRADIO is not set
301# CONFIG_IRDA is not set
302# CONFIG_BT is not set
303CONFIG_NETDEVICES=y 370CONFIG_NETDEVICES=y
304# CONFIG_DUMMY is not set 371# CONFIG_DUMMY is not set
305# CONFIG_BONDING is not set 372# CONFIG_BONDING is not set
306# CONFIG_EQUALIZER is not set 373# CONFIG_EQUALIZER is not set
307# CONFIG_TUN is not set 374# CONFIG_TUN is not set
308# CONFIG_ETHERTAP is not set
309 375
310# 376#
311# ARCnet devices 377# ARCnet devices
@@ -313,6 +379,21 @@ CONFIG_NETDEVICES=y
313# CONFIG_ARCNET is not set 379# CONFIG_ARCNET is not set
314 380
315# 381#
382# PHY device support
383#
384CONFIG_PHYLIB=y
385CONFIG_PHYCONTROL=y
386
387#
388# MII PHY device drivers
389#
390CONFIG_MARVELL_PHY=y
391CONFIG_DAVICOM_PHY=y
392CONFIG_QSEMI_PHY=y
393CONFIG_LXT_PHY=y
394CONFIG_CICADA_PHY=y
395
396#
316# Ethernet (10 or 100Mbit) 397# Ethernet (10 or 100Mbit)
317# 398#
318CONFIG_NET_ETHERNET=y 399CONFIG_NET_ETHERNET=y
@@ -357,13 +438,17 @@ CONFIG_PCNET32=y
357# CONFIG_HAMACHI is not set 438# CONFIG_HAMACHI is not set
358# CONFIG_YELLOWFIN is not set 439# CONFIG_YELLOWFIN is not set
359# CONFIG_R8169 is not set 440# CONFIG_R8169 is not set
441# CONFIG_SIS190 is not set
442# CONFIG_SKGE is not set
360# CONFIG_SK98LIN is not set 443# CONFIG_SK98LIN is not set
361# CONFIG_VIA_VELOCITY is not set 444# CONFIG_VIA_VELOCITY is not set
362# CONFIG_TIGON3 is not set 445# CONFIG_TIGON3 is not set
446# CONFIG_BNX2 is not set
363 447
364# 448#
365# Ethernet (10000 Mbit) 449# Ethernet (10000 Mbit)
366# 450#
451# CONFIG_CHELSIO_T1 is not set
367# CONFIG_IXGB is not set 452# CONFIG_IXGB is not set
368# CONFIG_S2IO is not set 453# CONFIG_S2IO is not set
369 454
@@ -376,6 +461,8 @@ CONFIG_PCNET32=y
376# Wireless LAN (non-hamradio) 461# Wireless LAN (non-hamradio)
377# 462#
378# CONFIG_NET_RADIO is not set 463# CONFIG_NET_RADIO is not set
464# CONFIG_IPW_DEBUG is not set
465CONFIG_IPW2200=y
379 466
380# 467#
381# Wan interfaces 468# Wan interfaces
@@ -387,6 +474,8 @@ CONFIG_PCNET32=y
387# CONFIG_SLIP is not set 474# CONFIG_SLIP is not set
388# CONFIG_SHAPER is not set 475# CONFIG_SHAPER is not set
389# CONFIG_NETCONSOLE is not set 476# CONFIG_NETCONSOLE is not set
477# CONFIG_NETPOLL is not set
478# CONFIG_NET_POLL_CONTROLLER is not set
390 479
391# 480#
392# ISDN subsystem 481# ISDN subsystem
@@ -416,19 +505,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
416# CONFIG_INPUT_EVBUG is not set 505# CONFIG_INPUT_EVBUG is not set
417 506
418# 507#
419# Input I/O drivers
420#
421# CONFIG_GAMEPORT is not set
422CONFIG_SOUND_GAMEPORT=y
423CONFIG_SERIO=y
424# CONFIG_SERIO_I8042 is not set
425CONFIG_SERIO_SERPORT=y
426# CONFIG_SERIO_CT82C710 is not set
427# CONFIG_SERIO_PCIPS2 is not set
428# CONFIG_SERIO_LIBPS2 is not set
429CONFIG_SERIO_RAW=y
430
431#
432# Input Device Drivers 508# Input Device Drivers
433# 509#
434# CONFIG_INPUT_KEYBOARD is not set 510# CONFIG_INPUT_KEYBOARD is not set
@@ -438,6 +514,17 @@ CONFIG_SERIO_RAW=y
438# CONFIG_INPUT_MISC is not set 514# CONFIG_INPUT_MISC is not set
439 515
440# 516#
517# Hardware I/O ports
518#
519CONFIG_SERIO=y
520# CONFIG_SERIO_I8042 is not set
521CONFIG_SERIO_SERPORT=y
522# CONFIG_SERIO_PCIPS2 is not set
523# CONFIG_SERIO_LIBPS2 is not set
524CONFIG_SERIO_RAW=y
525# CONFIG_GAMEPORT is not set
526
527#
441# Character devices 528# Character devices
442# 529#
443CONFIG_VT=y 530CONFIG_VT=y
@@ -458,6 +545,7 @@ CONFIG_SERIAL_8250_NR_UARTS=4
458# 545#
459CONFIG_SERIAL_CORE=y 546CONFIG_SERIAL_CORE=y
460CONFIG_SERIAL_CORE_CONSOLE=y 547CONFIG_SERIAL_CORE_CONSOLE=y
548# CONFIG_SERIAL_JSM is not set
461CONFIG_UNIX98_PTYS=y 549CONFIG_UNIX98_PTYS=y
462CONFIG_LEGACY_PTYS=y 550CONFIG_LEGACY_PTYS=y
463CONFIG_LEGACY_PTY_COUNT=256 551CONFIG_LEGACY_PTY_COUNT=256
@@ -484,6 +572,11 @@ CONFIG_LEGACY_PTY_COUNT=256
484# CONFIG_RAW_DRIVER is not set 572# CONFIG_RAW_DRIVER is not set
485 573
486# 574#
575# TPM devices
576#
577# CONFIG_TCG_TPM is not set
578
579#
487# I2C support 580# I2C support
488# 581#
489# CONFIG_I2C is not set 582# CONFIG_I2C is not set
@@ -494,10 +587,20 @@ CONFIG_LEGACY_PTY_COUNT=256
494# CONFIG_W1 is not set 587# CONFIG_W1 is not set
495 588
496# 589#
590# Hardware Monitoring support
591#
592# CONFIG_HWMON is not set
593# CONFIG_HWMON_VID is not set
594
595#
497# Misc devices 596# Misc devices
498# 597#
499 598
500# 599#
600# Multimedia Capabilities Port drivers
601#
602
603#
501# Multimedia devices 604# Multimedia devices
502# 605#
503# CONFIG_VIDEO_DEV is not set 606# CONFIG_VIDEO_DEV is not set
@@ -517,7 +620,6 @@ CONFIG_LEGACY_PTY_COUNT=256
517# 620#
518# CONFIG_VGA_CONSOLE is not set 621# CONFIG_VGA_CONSOLE is not set
519CONFIG_DUMMY_CONSOLE=y 622CONFIG_DUMMY_CONSOLE=y
520# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
521 623
522# 624#
523# Sound 625# Sound
@@ -527,13 +629,9 @@ CONFIG_DUMMY_CONSOLE=y
527# 629#
528# USB support 630# USB support
529# 631#
530# CONFIG_USB is not set
531CONFIG_USB_ARCH_HAS_HCD=y 632CONFIG_USB_ARCH_HAS_HCD=y
532CONFIG_USB_ARCH_HAS_OHCI=y 633CONFIG_USB_ARCH_HAS_OHCI=y
533 634# CONFIG_USB is not set
534#
535# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
536#
537 635
538# 636#
539# USB Gadget Support 637# USB Gadget Support
@@ -551,21 +649,29 @@ CONFIG_USB_ARCH_HAS_OHCI=y
551# CONFIG_INFINIBAND is not set 649# CONFIG_INFINIBAND is not set
552 650
553# 651#
652# SN Devices
653#
654
655#
554# File systems 656# File systems
555# 657#
556CONFIG_EXT2_FS=y 658CONFIG_EXT2_FS=y
557# CONFIG_EXT2_FS_XATTR is not set 659# CONFIG_EXT2_FS_XATTR is not set
660# CONFIG_EXT2_FS_XIP is not set
558# CONFIG_EXT3_FS is not set 661# CONFIG_EXT3_FS is not set
559# CONFIG_JBD is not set 662# CONFIG_JBD is not set
560# CONFIG_REISERFS_FS is not set 663# CONFIG_REISERFS_FS is not set
561# CONFIG_JFS_FS is not set 664# CONFIG_JFS_FS is not set
665# CONFIG_FS_POSIX_ACL is not set
562# CONFIG_XFS_FS is not set 666# CONFIG_XFS_FS is not set
563# CONFIG_MINIX_FS is not set 667# CONFIG_MINIX_FS is not set
564# CONFIG_ROMFS_FS is not set 668# CONFIG_ROMFS_FS is not set
669CONFIG_INOTIFY=y
565# CONFIG_QUOTA is not set 670# CONFIG_QUOTA is not set
566CONFIG_DNOTIFY=y 671CONFIG_DNOTIFY=y
567CONFIG_AUTOFS_FS=y 672CONFIG_AUTOFS_FS=y
568CONFIG_AUTOFS4_FS=y 673CONFIG_AUTOFS4_FS=y
674CONFIG_FUSE_FS=y
569 675
570# 676#
571# CD-ROM/DVD Filesystems 677# CD-ROM/DVD Filesystems
@@ -586,12 +692,10 @@ CONFIG_AUTOFS4_FS=y
586CONFIG_PROC_FS=y 692CONFIG_PROC_FS=y
587CONFIG_PROC_KCORE=y 693CONFIG_PROC_KCORE=y
588CONFIG_SYSFS=y 694CONFIG_SYSFS=y
589# CONFIG_DEVFS_FS is not set
590CONFIG_DEVPTS_FS_XATTR=y
591CONFIG_DEVPTS_FS_SECURITY=y
592# CONFIG_TMPFS is not set 695# CONFIG_TMPFS is not set
593# CONFIG_HUGETLB_PAGE is not set 696# CONFIG_HUGETLB_PAGE is not set
594CONFIG_RAMFS=y 697CONFIG_RAMFS=y
698CONFIG_RELAYFS_FS=y
595 699
596# 700#
597# Miscellaneous filesystems 701# Miscellaneous filesystems
@@ -623,6 +727,7 @@ CONFIG_NFSD=y
623CONFIG_ROOT_NFS=y 727CONFIG_ROOT_NFS=y
624CONFIG_LOCKD=y 728CONFIG_LOCKD=y
625CONFIG_EXPORTFS=y 729CONFIG_EXPORTFS=y
730CONFIG_NFS_COMMON=y
626CONFIG_SUNRPC=y 731CONFIG_SUNRPC=y
627# CONFIG_RPCSEC_GSS_KRB5 is not set 732# CONFIG_RPCSEC_GSS_KRB5 is not set
628# CONFIG_RPCSEC_GSS_SPKM3 is not set 733# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -631,6 +736,7 @@ CONFIG_SUNRPC=y
631# CONFIG_NCP_FS is not set 736# CONFIG_NCP_FS is not set
632# CONFIG_CODA_FS is not set 737# CONFIG_CODA_FS is not set
633# CONFIG_AFS_FS is not set 738# CONFIG_AFS_FS is not set
739# CONFIG_9P_FS is not set
634 740
635# 741#
636# Partition Types 742# Partition Types
@@ -651,7 +757,9 @@ CONFIG_MSDOS_PARTITION=y
651# 757#
652# Kernel hacking 758# Kernel hacking
653# 759#
760# CONFIG_PRINTK_TIME is not set
654# CONFIG_DEBUG_KERNEL is not set 761# CONFIG_DEBUG_KERNEL is not set
762CONFIG_LOG_BUF_SHIFT=14
655CONFIG_CROSSCOMPILE=y 763CONFIG_CROSSCOMPILE=y
656CONFIG_CMDLINE="ip=any" 764CONFIG_CMDLINE="ip=any"
657 765
@@ -665,7 +773,31 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
665# 773#
666# Cryptographic options 774# Cryptographic options
667# 775#
668# CONFIG_CRYPTO is not set 776CONFIG_CRYPTO=y
777CONFIG_CRYPTO_HMAC=y
778CONFIG_CRYPTO_NULL=y
779CONFIG_CRYPTO_MD4=y
780CONFIG_CRYPTO_MD5=y
781CONFIG_CRYPTO_SHA1=y
782CONFIG_CRYPTO_SHA256=y
783CONFIG_CRYPTO_SHA512=y
784CONFIG_CRYPTO_WP512=y
785CONFIG_CRYPTO_TGR192=y
786CONFIG_CRYPTO_DES=y
787CONFIG_CRYPTO_BLOWFISH=y
788CONFIG_CRYPTO_TWOFISH=y
789CONFIG_CRYPTO_SERPENT=y
790CONFIG_CRYPTO_AES=y
791CONFIG_CRYPTO_CAST5=y
792CONFIG_CRYPTO_CAST6=y
793CONFIG_CRYPTO_TEA=y
794CONFIG_CRYPTO_ARC4=y
795CONFIG_CRYPTO_KHAZAD=y
796CONFIG_CRYPTO_ANUBIS=y
797CONFIG_CRYPTO_DEFLATE=y
798CONFIG_CRYPTO_MICHAEL_MIC=y
799CONFIG_CRYPTO_CRC32C=y
800# CONFIG_CRYPTO_TEST is not set
669 801
670# 802#
671# Hardware crypto devices 803# Hardware crypto devices
@@ -675,7 +807,8 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
675# Library routines 807# Library routines
676# 808#
677# CONFIG_CRC_CCITT is not set 809# CONFIG_CRC_CCITT is not set
810CONFIG_CRC16=y
678CONFIG_CRC32=y 811CONFIG_CRC32=y
679# CONFIG_LIBCRC32C is not set 812CONFIG_LIBCRC32C=y
680CONFIG_GENERIC_HARDIRQS=y 813CONFIG_ZLIB_INFLATE=y
681CONFIG_GENERIC_IRQ_PROBE=y 814CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/mips/configs/decstation_defconfig b/arch/mips/configs/decstation_defconfig
index 66ec1f41d122..5bc885b72d14 100644
--- a/arch/mips/configs/decstation_defconfig
+++ b/arch/mips/configs/decstation_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:03 2005 4# Thu Oct 20 22:25:48 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,24 +11,30 @@ CONFIG_32BIT=y
14CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
25# CONFIG_BSD_PROCESS_ACCT is not set 24# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y 25CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set 26# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14
29# CONFIG_HOTPLUG is not set 27# CONFIG_HOTPLUG is not set
30CONFIG_KOBJECT_UEVENT=y 28CONFIG_KOBJECT_UEVENT=y
31# CONFIG_IKCONFIG is not set 29# CONFIG_IKCONFIG is not set
30CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y 31CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y 32CONFIG_KALLSYMS=y
33# CONFIG_KALLSYMS_ALL is not set
34# CONFIG_KALLSYMS_EXTRA_PASS is not set 34# CONFIG_KALLSYMS_EXTRA_PASS is not set
35CONFIG_PRINTK=y
36CONFIG_BUG=y
37CONFIG_BASE_FULL=y
35CONFIG_FUTEX=y 38CONFIG_FUTEX=y
36CONFIG_EPOLL=y 39CONFIG_EPOLL=y
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 40# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -41,6 +44,7 @@ CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0 44CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0 45CONFIG_CC_ALIGN_JUMPS=0
43# CONFIG_TINY_SHMEM is not set 46# CONFIG_TINY_SHMEM is not set
47CONFIG_BASE_SMALL=0
44 48
45# 49#
46# Loadable module support 50# Loadable module support
@@ -49,48 +53,76 @@ CONFIG_MODULES=y
49CONFIG_MODULE_UNLOAD=y 53CONFIG_MODULE_UNLOAD=y
50# CONFIG_MODULE_FORCE_UNLOAD is not set 54# CONFIG_MODULE_FORCE_UNLOAD is not set
51CONFIG_OBSOLETE_MODPARM=y 55CONFIG_OBSOLETE_MODPARM=y
52CONFIG_MODVERSIONS=y 56# CONFIG_MODVERSIONS is not set
53CONFIG_MODULE_SRCVERSION_ALL=y 57CONFIG_MODULE_SRCVERSION_ALL=y
54CONFIG_KMOD=y 58CONFIG_KMOD=y
55 59
56# 60#
57# Machine selection 61# Machine selection
58# 62#
59# CONFIG_MACH_JAZZ is not set 63# CONFIG_MIPS_MTX1 is not set
60# CONFIG_MACH_VR41XX is not set 64# CONFIG_MIPS_BOSPORUS is not set
61# CONFIG_TOSHIBA_JMR3927 is not set 65# CONFIG_MIPS_PB1000 is not set
66# CONFIG_MIPS_PB1100 is not set
67# CONFIG_MIPS_PB1500 is not set
68# CONFIG_MIPS_PB1550 is not set
69# CONFIG_MIPS_PB1200 is not set
70# CONFIG_MIPS_DB1000 is not set
71# CONFIG_MIPS_DB1100 is not set
72# CONFIG_MIPS_DB1500 is not set
73# CONFIG_MIPS_DB1550 is not set
74# CONFIG_MIPS_DB1200 is not set
75# CONFIG_MIPS_MIRAGE is not set
62# CONFIG_MIPS_COBALT is not set 76# CONFIG_MIPS_COBALT is not set
63CONFIG_MACH_DECSTATION=y 77CONFIG_MACH_DECSTATION=y
64# CONFIG_MIPS_EV64120 is not set 78# CONFIG_MIPS_EV64120 is not set
65# CONFIG_MIPS_EV96100 is not set 79# CONFIG_MIPS_EV96100 is not set
66# CONFIG_MIPS_IVR is not set 80# CONFIG_MIPS_IVR is not set
67# CONFIG_LASAT is not set
68# CONFIG_MIPS_ITE8172 is not set 81# CONFIG_MIPS_ITE8172 is not set
82# CONFIG_MACH_JAZZ is not set
83# CONFIG_LASAT is not set
69# CONFIG_MIPS_ATLAS is not set 84# CONFIG_MIPS_ATLAS is not set
70# CONFIG_MIPS_MALTA is not set 85# CONFIG_MIPS_MALTA is not set
71# CONFIG_MIPS_SEAD is not set 86# CONFIG_MIPS_SEAD is not set
87# CONFIG_MIPS_SIM is not set
88# CONFIG_MOMENCO_JAGUAR_ATX is not set
72# CONFIG_MOMENCO_OCELOT is not set 89# CONFIG_MOMENCO_OCELOT is not set
73# CONFIG_MOMENCO_OCELOT_G is not set
74# CONFIG_MOMENCO_OCELOT_C is not set
75# CONFIG_MOMENCO_OCELOT_3 is not set 90# CONFIG_MOMENCO_OCELOT_3 is not set
76# CONFIG_MOMENCO_JAGUAR_ATX is not set 91# CONFIG_MOMENCO_OCELOT_C is not set
77# CONFIG_PMC_YOSEMITE is not set 92# CONFIG_MOMENCO_OCELOT_G is not set
93# CONFIG_MIPS_XXS1500 is not set
94# CONFIG_PNX8550_V2PCI is not set
95# CONFIG_PNX8550_JBS is not set
78# CONFIG_DDB5074 is not set 96# CONFIG_DDB5074 is not set
79# CONFIG_DDB5476 is not set 97# CONFIG_DDB5476 is not set
80# CONFIG_DDB5477 is not set 98# CONFIG_DDB5477 is not set
81# CONFIG_NEC_OSPREY is not set 99# CONFIG_MACH_VR41XX is not set
100# CONFIG_PMC_YOSEMITE is not set
101# CONFIG_QEMU is not set
82# CONFIG_SGI_IP22 is not set 102# CONFIG_SGI_IP22 is not set
83# CONFIG_SOC_AU1X00 is not set 103# CONFIG_SGI_IP27 is not set
84# CONFIG_SIBYTE_SB1xxx_SOC is not set 104# CONFIG_SGI_IP32 is not set
105# CONFIG_SIBYTE_BIGSUR is not set
106# CONFIG_SIBYTE_SWARM is not set
107# CONFIG_SIBYTE_SENTOSA is not set
108# CONFIG_SIBYTE_RHONE is not set
109# CONFIG_SIBYTE_CARMEL is not set
110# CONFIG_SIBYTE_PTSWARM is not set
111# CONFIG_SIBYTE_LITTLESUR is not set
112# CONFIG_SIBYTE_CRHINE is not set
113# CONFIG_SIBYTE_CRHONE is not set
85# CONFIG_SNI_RM200_PCI is not set 114# CONFIG_SNI_RM200_PCI is not set
115# CONFIG_TOSHIBA_JMR3927 is not set
86# CONFIG_TOSHIBA_RBTX4927 is not set 116# CONFIG_TOSHIBA_RBTX4927 is not set
117# CONFIG_TOSHIBA_RBTX4938 is not set
87CONFIG_RWSEM_GENERIC_SPINLOCK=y 118CONFIG_RWSEM_GENERIC_SPINLOCK=y
88CONFIG_GENERIC_CALIBRATE_DELAY=y 119CONFIG_GENERIC_CALIBRATE_DELAY=y
89CONFIG_HAVE_DEC_LOCK=y
90CONFIG_DMA_NONCOHERENT=y 120CONFIG_DMA_NONCOHERENT=y
91CONFIG_DMA_NEED_PCI_MAP_STATE=y 121CONFIG_DMA_NEED_PCI_MAP_STATE=y
92CONFIG_EARLY_PRINTK=y 122CONFIG_EARLY_PRINTK=y
123# CONFIG_CPU_BIG_ENDIAN is not set
93CONFIG_CPU_LITTLE_ENDIAN=y 124CONFIG_CPU_LITTLE_ENDIAN=y
125CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
94CONFIG_IRQ_CPU=y 126CONFIG_IRQ_CPU=y
95CONFIG_BOOT_ELF32=y 127CONFIG_BOOT_ELF32=y
96CONFIG_MIPS_L1_CACHE_SHIFT=4 128CONFIG_MIPS_L1_CACHE_SHIFT=4
@@ -98,8 +130,10 @@ CONFIG_MIPS_L1_CACHE_SHIFT=4
98# 130#
99# CPU selection 131# CPU selection
100# 132#
101# CONFIG_CPU_MIPS32 is not set 133# CONFIG_CPU_MIPS32_R1 is not set
102# CONFIG_CPU_MIPS64 is not set 134# CONFIG_CPU_MIPS32_R2 is not set
135# CONFIG_CPU_MIPS64_R1 is not set
136# CONFIG_CPU_MIPS64_R2 is not set
103CONFIG_CPU_R3000=y 137CONFIG_CPU_R3000=y
104# CONFIG_CPU_TX39XX is not set 138# CONFIG_CPU_TX39XX is not set
105# CONFIG_CPU_VR41XX is not set 139# CONFIG_CPU_VR41XX is not set
@@ -115,12 +149,37 @@ CONFIG_CPU_R3000=y
115# CONFIG_CPU_RM7000 is not set 149# CONFIG_CPU_RM7000 is not set
116# CONFIG_CPU_RM9000 is not set 150# CONFIG_CPU_RM9000 is not set
117# CONFIG_CPU_SB1 is not set 151# CONFIG_CPU_SB1 is not set
152CONFIG_SYS_HAS_CPU_R3000=y
153CONFIG_SYS_HAS_CPU_R4X00=y
154CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
155CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
156CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
157
158#
159# Kernel type
160#
161CONFIG_32BIT=y
162# CONFIG_64BIT is not set
118CONFIG_PAGE_SIZE_4KB=y 163CONFIG_PAGE_SIZE_4KB=y
119# CONFIG_PAGE_SIZE_8KB is not set 164# CONFIG_PAGE_SIZE_8KB is not set
120# CONFIG_PAGE_SIZE_16KB is not set 165# CONFIG_PAGE_SIZE_16KB is not set
121# CONFIG_PAGE_SIZE_64KB is not set 166# CONFIG_PAGE_SIZE_64KB is not set
167# CONFIG_MIPS_MT is not set
122# CONFIG_CPU_ADVANCED is not set 168# CONFIG_CPU_ADVANCED is not set
123CONFIG_CPU_HAS_WB=y 169CONFIG_CPU_HAS_WB=y
170CONFIG_GENERIC_HARDIRQS=y
171CONFIG_GENERIC_IRQ_PROBE=y
172CONFIG_CPU_SUPPORTS_HIGHMEM=y
173CONFIG_ARCH_FLATMEM_ENABLE=y
174CONFIG_SELECT_MEMORY_MODEL=y
175CONFIG_FLATMEM_MANUAL=y
176# CONFIG_DISCONTIGMEM_MANUAL is not set
177# CONFIG_SPARSEMEM_MANUAL is not set
178CONFIG_FLATMEM=y
179CONFIG_FLAT_NODE_MEM_MAP=y
180# CONFIG_SPARSEMEM_STATIC is not set
181CONFIG_PREEMPT_NONE=y
182# CONFIG_PREEMPT_VOLUNTARY is not set
124# CONFIG_PREEMPT is not set 183# CONFIG_PREEMPT is not set
125 184
126# 185#
@@ -135,10 +194,6 @@ CONFIG_MMU=y
135# CONFIG_PCCARD is not set 194# CONFIG_PCCARD is not set
136 195
137# 196#
138# PC-card bridges
139#
140
141#
142# PCI Hotplug Support 197# PCI Hotplug Support
143# 198#
144 199
@@ -150,6 +205,80 @@ CONFIG_BINFMT_ELF=y
150CONFIG_TRAD_SIGNALS=y 205CONFIG_TRAD_SIGNALS=y
151 206
152# 207#
208# Networking
209#
210CONFIG_NET=y
211
212#
213# Networking options
214#
215CONFIG_PACKET=y
216CONFIG_PACKET_MMAP=y
217CONFIG_UNIX=y
218CONFIG_XFRM=y
219CONFIG_XFRM_USER=m
220# CONFIG_NET_KEY is not set
221CONFIG_INET=y
222# CONFIG_IP_MULTICAST is not set
223# CONFIG_IP_ADVANCED_ROUTER is not set
224CONFIG_IP_FIB_HASH=y
225CONFIG_IP_PNP=y
226# CONFIG_IP_PNP_DHCP is not set
227CONFIG_IP_PNP_BOOTP=y
228# CONFIG_IP_PNP_RARP is not set
229# CONFIG_NET_IPIP is not set
230# CONFIG_NET_IPGRE is not set
231# CONFIG_ARPD is not set
232# CONFIG_SYN_COOKIES is not set
233# CONFIG_INET_AH is not set
234# CONFIG_INET_ESP is not set
235# CONFIG_INET_IPCOMP is not set
236CONFIG_INET_TUNNEL=m
237CONFIG_INET_DIAG=y
238CONFIG_INET_TCP_DIAG=y
239# CONFIG_TCP_CONG_ADVANCED is not set
240CONFIG_TCP_CONG_BIC=y
241# CONFIG_IPV6 is not set
242# CONFIG_NETFILTER is not set
243
244#
245# DCCP Configuration (EXPERIMENTAL)
246#
247# CONFIG_IP_DCCP is not set
248
249#
250# SCTP Configuration (EXPERIMENTAL)
251#
252# CONFIG_IP_SCTP is not set
253# CONFIG_ATM is not set
254# CONFIG_BRIDGE is not set
255# CONFIG_VLAN_8021Q is not set
256# CONFIG_DECNET is not set
257# CONFIG_LLC2 is not set
258# CONFIG_IPX is not set
259# CONFIG_ATALK is not set
260# CONFIG_X25 is not set
261# CONFIG_LAPB is not set
262# CONFIG_NET_DIVERT is not set
263# CONFIG_ECONET is not set
264# CONFIG_WAN_ROUTER is not set
265# CONFIG_NET_SCHED is not set
266# CONFIG_NET_CLS_ROUTE is not set
267
268#
269# Network testing
270#
271# CONFIG_NET_PKTGEN is not set
272# CONFIG_HAMRADIO is not set
273# CONFIG_IRDA is not set
274# CONFIG_BT is not set
275CONFIG_IEEE80211=m
276# CONFIG_IEEE80211_DEBUG is not set
277CONFIG_IEEE80211_CRYPT_WEP=m
278CONFIG_IEEE80211_CRYPT_CCMP=m
279CONFIG_IEEE80211_CRYPT_TKIP=m
280
281#
153# Device Drivers 282# Device Drivers
154# 283#
155 284
@@ -159,6 +288,12 @@ CONFIG_TRAD_SIGNALS=y
159CONFIG_STANDALONE=y 288CONFIG_STANDALONE=y
160CONFIG_PREVENT_FIRMWARE_BUILD=y 289CONFIG_PREVENT_FIRMWARE_BUILD=y
161# CONFIG_FW_LOADER is not set 290# CONFIG_FW_LOADER is not set
291# CONFIG_DEBUG_DRIVER is not set
292
293#
294# Connector - unified userspace <-> kernelspace linker
295#
296CONFIG_CONNECTOR=m
162 297
163# 298#
164# Memory Technology Devices (MTD) 299# Memory Technology Devices (MTD)
@@ -177,17 +312,14 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
177# 312#
178# Block devices 313# Block devices
179# 314#
180# CONFIG_BLK_DEV_FD is not set
181# CONFIG_BLK_DEV_COW_COMMON is not set 315# CONFIG_BLK_DEV_COW_COMMON is not set
182# CONFIG_BLK_DEV_LOOP is not set 316CONFIG_BLK_DEV_LOOP=m
317# CONFIG_BLK_DEV_CRYPTOLOOP is not set
183# CONFIG_BLK_DEV_NBD is not set 318# CONFIG_BLK_DEV_NBD is not set
184# CONFIG_BLK_DEV_RAM is not set 319# CONFIG_BLK_DEV_RAM is not set
185CONFIG_BLK_DEV_RAM_COUNT=16 320CONFIG_BLK_DEV_RAM_COUNT=16
186CONFIG_INITRAMFS_SOURCE=""
187# CONFIG_LBD is not set 321# CONFIG_LBD is not set
188CONFIG_CDROM_PKTCDVD=m 322# CONFIG_CDROM_PKTCDVD is not set
189CONFIG_CDROM_PKTCDVD_BUFFERS=8
190# CONFIG_CDROM_PKTCDVD_WCACHE is not set
191 323
192# 324#
193# IO Schedulers 325# IO Schedulers
@@ -196,7 +328,7 @@ CONFIG_IOSCHED_NOOP=y
196CONFIG_IOSCHED_AS=y 328CONFIG_IOSCHED_AS=y
197CONFIG_IOSCHED_DEADLINE=y 329CONFIG_IOSCHED_DEADLINE=y
198CONFIG_IOSCHED_CFQ=y 330CONFIG_IOSCHED_CFQ=y
199CONFIG_ATA_OVER_ETH=m 331# CONFIG_ATA_OVER_ETH is not set
200 332
201# 333#
202# ATA/ATAPI/MFM/RLL support 334# ATA/ATAPI/MFM/RLL support
@@ -206,6 +338,7 @@ CONFIG_ATA_OVER_ETH=m
206# 338#
207# SCSI device support 339# SCSI device support
208# 340#
341CONFIG_RAID_ATTRS=m
209CONFIG_SCSI=y 342CONFIG_SCSI=y
210CONFIG_SCSI_PROC_FS=y 343CONFIG_SCSI_PROC_FS=y
211 344
@@ -213,10 +346,12 @@ CONFIG_SCSI_PROC_FS=y
213# SCSI support type (disk, tape, CD-ROM) 346# SCSI support type (disk, tape, CD-ROM)
214# 347#
215CONFIG_BLK_DEV_SD=y 348CONFIG_BLK_DEV_SD=y
216# CONFIG_CHR_DEV_ST is not set 349CONFIG_CHR_DEV_ST=m
217# CONFIG_CHR_DEV_OSST is not set 350# CONFIG_CHR_DEV_OSST is not set
218# CONFIG_BLK_DEV_SR is not set 351CONFIG_BLK_DEV_SR=m
219# CONFIG_CHR_DEV_SG is not set 352# CONFIG_BLK_DEV_SR_VENDOR is not set
353CONFIG_CHR_DEV_SG=m
354# CONFIG_CHR_DEV_SCH is not set
220 355
221# 356#
222# Some SCSI devices (e.g. CD jukebox) support multiple LUNs 357# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
@@ -228,9 +363,10 @@ CONFIG_SCSI_CONSTANTS=y
228# 363#
229# SCSI Transport Attributes 364# SCSI Transport Attributes
230# 365#
231# CONFIG_SCSI_SPI_ATTRS is not set 366CONFIG_SCSI_SPI_ATTRS=m
232# CONFIG_SCSI_FC_ATTRS is not set 367# CONFIG_SCSI_FC_ATTRS is not set
233# CONFIG_SCSI_ISCSI_ATTRS is not set 368# CONFIG_SCSI_ISCSI_ATTRS is not set
369CONFIG_SCSI_SAS_ATTRS=m
234 370
235# 371#
236# SCSI low-level drivers 372# SCSI low-level drivers
@@ -248,6 +384,7 @@ CONFIG_SCSI_DECNCR=y
248# 384#
249# Fusion MPT device support 385# Fusion MPT device support
250# 386#
387# CONFIG_FUSION is not set
251 388
252# 389#
253# IEEE 1394 (FireWire) support 390# IEEE 1394 (FireWire) support
@@ -258,78 +395,28 @@ CONFIG_SCSI_DECNCR=y
258# 395#
259 396
260# 397#
261# Networking support 398# Network device support
262#
263CONFIG_NET=y
264
265#
266# Networking options
267#
268CONFIG_PACKET=y
269# CONFIG_PACKET_MMAP is not set
270CONFIG_NETLINK_DEV=y
271CONFIG_UNIX=y
272CONFIG_NET_KEY=y
273CONFIG_INET=y
274# CONFIG_IP_MULTICAST is not set
275# CONFIG_IP_ADVANCED_ROUTER is not set
276CONFIG_IP_PNP=y
277# CONFIG_IP_PNP_DHCP is not set
278CONFIG_IP_PNP_BOOTP=y
279# CONFIG_IP_PNP_RARP is not set
280# CONFIG_NET_IPIP is not set
281# CONFIG_NET_IPGRE is not set
282# CONFIG_ARPD is not set
283# CONFIG_SYN_COOKIES is not set
284# CONFIG_INET_AH is not set
285# CONFIG_INET_ESP is not set
286# CONFIG_INET_IPCOMP is not set
287CONFIG_INET_TUNNEL=m
288CONFIG_IP_TCPDIAG=m
289# CONFIG_IP_TCPDIAG_IPV6 is not set
290# CONFIG_IPV6 is not set
291# CONFIG_NETFILTER is not set
292CONFIG_XFRM=y
293CONFIG_XFRM_USER=m
294
295#
296# SCTP Configuration (EXPERIMENTAL)
297# 399#
298# CONFIG_IP_SCTP is not set 400CONFIG_NETDEVICES=y
299# CONFIG_ATM is not set 401# CONFIG_DUMMY is not set
300# CONFIG_BRIDGE is not set 402# CONFIG_BONDING is not set
301# CONFIG_VLAN_8021Q is not set 403# CONFIG_EQUALIZER is not set
302# CONFIG_DECNET is not set 404# CONFIG_TUN is not set
303# CONFIG_LLC2 is not set
304# CONFIG_IPX is not set
305# CONFIG_ATALK is not set
306# CONFIG_X25 is not set
307# CONFIG_LAPB is not set
308# CONFIG_NET_DIVERT is not set
309# CONFIG_ECONET is not set
310# CONFIG_WAN_ROUTER is not set
311 405
312# 406#
313# QoS and/or fair queueing 407# PHY device support
314# 408#
315# CONFIG_NET_SCHED is not set 409CONFIG_PHYLIB=m
316# CONFIG_NET_CLS_ROUTE is not set 410CONFIG_PHYCONTROL=y
317 411
318# 412#
319# Network testing 413# MII PHY device drivers
320# 414#
321# CONFIG_NET_PKTGEN is not set 415CONFIG_MARVELL_PHY=m
322# CONFIG_NETPOLL is not set 416CONFIG_DAVICOM_PHY=m
323# CONFIG_NET_POLL_CONTROLLER is not set 417CONFIG_QSEMI_PHY=m
324# CONFIG_HAMRADIO is not set 418CONFIG_LXT_PHY=m
325# CONFIG_IRDA is not set 419CONFIG_CICADA_PHY=m
326# CONFIG_BT is not set
327CONFIG_NETDEVICES=y
328# CONFIG_DUMMY is not set
329# CONFIG_BONDING is not set
330# CONFIG_EQUALIZER is not set
331# CONFIG_TUN is not set
332# CONFIG_ETHERTAP is not set
333 420
334# 421#
335# Ethernet (10 or 100Mbit) 422# Ethernet (10 or 100Mbit)
@@ -363,6 +450,8 @@ CONFIG_DECLANCE=y
363# CONFIG_SLIP is not set 450# CONFIG_SLIP is not set
364# CONFIG_SHAPER is not set 451# CONFIG_SHAPER is not set
365# CONFIG_NETCONSOLE is not set 452# CONFIG_NETCONSOLE is not set
453# CONFIG_NETPOLL is not set
454# CONFIG_NET_POLL_CONTROLLER is not set
366 455
367# 456#
368# ISDN subsystem 457# ISDN subsystem
@@ -377,48 +466,22 @@ CONFIG_DECLANCE=y
377# 466#
378# Input device support 467# Input device support
379# 468#
380CONFIG_INPUT=y 469# CONFIG_INPUT is not set
381 470
382# 471#
383# Userland interfaces 472# Hardware I/O ports
384#
385CONFIG_INPUT_MOUSEDEV=y
386CONFIG_INPUT_MOUSEDEV_PSAUX=y
387CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
388CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
389# CONFIG_INPUT_JOYDEV is not set
390# CONFIG_INPUT_TSDEV is not set
391# CONFIG_INPUT_EVDEV is not set
392# CONFIG_INPUT_EVBUG is not set
393
394#
395# Input I/O drivers
396# 473#
474# CONFIG_SERIO is not set
397# CONFIG_GAMEPORT is not set 475# CONFIG_GAMEPORT is not set
398CONFIG_SOUND_GAMEPORT=y
399CONFIG_SERIO=y
400# CONFIG_SERIO_I8042 is not set
401CONFIG_SERIO_SERPORT=y
402# CONFIG_SERIO_CT82C710 is not set
403# CONFIG_SERIO_LIBPS2 is not set
404CONFIG_SERIO_RAW=m
405
406#
407# Input Device Drivers
408#
409# CONFIG_INPUT_KEYBOARD is not set
410# CONFIG_INPUT_MOUSE is not set
411# CONFIG_INPUT_JOYSTICK is not set
412# CONFIG_INPUT_TOUCHSCREEN is not set
413# CONFIG_INPUT_MISC is not set
414 476
415# 477#
416# Character devices 478# Character devices
417# 479#
418CONFIG_VT=y 480# CONFIG_VT is not set
419CONFIG_VT_CONSOLE=y
420CONFIG_HW_CONSOLE=y
421# CONFIG_SERIAL_NONSTANDARD is not set 481# CONFIG_SERIAL_NONSTANDARD is not set
482CONFIG_SERIAL_DEC=y
483CONFIG_SERIAL_DEC_CONSOLE=y
484CONFIG_ZS=y
422 485
423# 486#
424# Serial drivers 487# Serial drivers
@@ -445,18 +508,20 @@ CONFIG_LEGACY_PTY_COUNT=256
445# Watchdog Cards 508# Watchdog Cards
446# 509#
447# CONFIG_WATCHDOG is not set 510# CONFIG_WATCHDOG is not set
448# CONFIG_RTC is not set 511CONFIG_RTC=y
449# CONFIG_GEN_RTC is not set
450# CONFIG_DTLK is not set 512# CONFIG_DTLK is not set
451# CONFIG_R3964 is not set 513# CONFIG_R3964 is not set
452 514
453# 515#
454# Ftape, the floppy tape device driver 516# Ftape, the floppy tape device driver
455# 517#
456# CONFIG_DRM is not set
457# CONFIG_RAW_DRIVER is not set 518# CONFIG_RAW_DRIVER is not set
458 519
459# 520#
521# TPM devices
522#
523
524#
460# I2C support 525# I2C support
461# 526#
462# CONFIG_I2C is not set 527# CONFIG_I2C is not set
@@ -467,10 +532,20 @@ CONFIG_LEGACY_PTY_COUNT=256
467# CONFIG_W1 is not set 532# CONFIG_W1 is not set
468 533
469# 534#
535# Hardware Monitoring support
536#
537# CONFIG_HWMON is not set
538# CONFIG_HWMON_VID is not set
539
540#
470# Misc devices 541# Misc devices
471# 542#
472 543
473# 544#
545# Multimedia Capabilities Port drivers
546#
547
548#
474# Multimedia devices 549# Multimedia devices
475# 550#
476# CONFIG_VIDEO_DEV is not set 551# CONFIG_VIDEO_DEV is not set
@@ -483,13 +558,29 @@ CONFIG_LEGACY_PTY_COUNT=256
483# 558#
484# Graphics support 559# Graphics support
485# 560#
486# CONFIG_FB is not set 561CONFIG_FB=y
487 562CONFIG_FB_CFB_FILLRECT=y
488# 563CONFIG_FB_CFB_COPYAREA=y
489# Console display driver support 564CONFIG_FB_CFB_IMAGEBLIT=y
490# 565CONFIG_FB_SOFT_CURSOR=y
491# CONFIG_VGA_CONSOLE is not set 566# CONFIG_FB_MACMODES is not set
492CONFIG_DUMMY_CONSOLE=y 567# CONFIG_FB_MODE_HELPERS is not set
568# CONFIG_FB_TILEBLITTING is not set
569# CONFIG_FB_PMAG_AA is not set
570CONFIG_FB_PMAG_BA=y
571CONFIG_FB_PMAGB_B=y
572# CONFIG_FB_MAXINE is not set
573# CONFIG_FB_S1D13XXX is not set
574# CONFIG_FB_VIRTUAL is not set
575
576#
577# Logo configuration
578#
579CONFIG_LOGO=y
580# CONFIG_LOGO_LINUX_MONO is not set
581# CONFIG_LOGO_LINUX_VGA16 is not set
582# CONFIG_LOGO_LINUX_CLUT224 is not set
583CONFIG_LOGO_DEC_CLUT224=y
493# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 584# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
494 585
495# 586#
@@ -504,10 +595,6 @@ CONFIG_DUMMY_CONSOLE=y
504# CONFIG_USB_ARCH_HAS_OHCI is not set 595# CONFIG_USB_ARCH_HAS_OHCI is not set
505 596
506# 597#
507# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
508#
509
510#
511# USB Gadget Support 598# USB Gadget Support
512# 599#
513# CONFIG_USB_GADGET is not set 600# CONFIG_USB_GADGET is not set
@@ -520,7 +607,10 @@ CONFIG_DUMMY_CONSOLE=y
520# 607#
521# InfiniBand support 608# InfiniBand support
522# 609#
523# CONFIG_INFINIBAND is not set 610
611#
612# SN Devices
613#
524 614
525# 615#
526# File systems 616# File systems
@@ -529,6 +619,7 @@ CONFIG_EXT2_FS=y
529CONFIG_EXT2_FS_XATTR=y 619CONFIG_EXT2_FS_XATTR=y
530CONFIG_EXT2_FS_POSIX_ACL=y 620CONFIG_EXT2_FS_POSIX_ACL=y
531CONFIG_EXT2_FS_SECURITY=y 621CONFIG_EXT2_FS_SECURITY=y
622# CONFIG_EXT2_FS_XIP is not set
532# CONFIG_EXT3_FS is not set 623# CONFIG_EXT3_FS is not set
533# CONFIG_JBD is not set 624# CONFIG_JBD is not set
534CONFIG_FS_MBCACHE=y 625CONFIG_FS_MBCACHE=y
@@ -538,10 +629,12 @@ CONFIG_FS_POSIX_ACL=y
538# CONFIG_XFS_FS is not set 629# CONFIG_XFS_FS is not set
539# CONFIG_MINIX_FS is not set 630# CONFIG_MINIX_FS is not set
540# CONFIG_ROMFS_FS is not set 631# CONFIG_ROMFS_FS is not set
632CONFIG_INOTIFY=y
541# CONFIG_QUOTA is not set 633# CONFIG_QUOTA is not set
542CONFIG_DNOTIFY=y 634CONFIG_DNOTIFY=y
543# CONFIG_AUTOFS_FS is not set 635# CONFIG_AUTOFS_FS is not set
544# CONFIG_AUTOFS4_FS is not set 636# CONFIG_AUTOFS4_FS is not set
637CONFIG_FUSE_FS=m
545 638
546# 639#
547# CD-ROM/DVD Filesystems 640# CD-ROM/DVD Filesystems
@@ -562,12 +655,10 @@ CONFIG_DNOTIFY=y
562CONFIG_PROC_FS=y 655CONFIG_PROC_FS=y
563CONFIG_PROC_KCORE=y 656CONFIG_PROC_KCORE=y
564CONFIG_SYSFS=y 657CONFIG_SYSFS=y
565# CONFIG_DEVFS_FS is not set 658CONFIG_TMPFS=y
566CONFIG_DEVPTS_FS_XATTR=y
567CONFIG_DEVPTS_FS_SECURITY=y
568# CONFIG_TMPFS is not set
569# CONFIG_HUGETLB_PAGE is not set 659# CONFIG_HUGETLB_PAGE is not set
570CONFIG_RAMFS=y 660CONFIG_RAMFS=y
661CONFIG_RELAYFS_FS=m
571 662
572# 663#
573# Miscellaneous filesystems 664# Miscellaneous filesystems
@@ -584,19 +675,31 @@ CONFIG_RAMFS=y
584# CONFIG_HPFS_FS is not set 675# CONFIG_HPFS_FS is not set
585# CONFIG_QNX4FS_FS is not set 676# CONFIG_QNX4FS_FS is not set
586# CONFIG_SYSV_FS is not set 677# CONFIG_SYSV_FS is not set
587# CONFIG_UFS_FS is not set 678CONFIG_UFS_FS=y
679CONFIG_UFS_FS_WRITE=y
588 680
589# 681#
590# Network File Systems 682# Network File Systems
591# 683#
592# CONFIG_NFS_FS is not set 684CONFIG_NFS_FS=y
685CONFIG_NFS_V3=y
686# CONFIG_NFS_V3_ACL is not set
687# CONFIG_NFS_V4 is not set
688# CONFIG_NFS_DIRECTIO is not set
593# CONFIG_NFSD is not set 689# CONFIG_NFSD is not set
594# CONFIG_EXPORTFS is not set 690CONFIG_ROOT_NFS=y
691CONFIG_LOCKD=y
692CONFIG_LOCKD_V4=y
693CONFIG_NFS_COMMON=y
694CONFIG_SUNRPC=y
695# CONFIG_RPCSEC_GSS_KRB5 is not set
696# CONFIG_RPCSEC_GSS_SPKM3 is not set
595# CONFIG_SMB_FS is not set 697# CONFIG_SMB_FS is not set
596# CONFIG_CIFS is not set 698# CONFIG_CIFS is not set
597# CONFIG_NCP_FS is not set 699# CONFIG_NCP_FS is not set
598# CONFIG_CODA_FS is not set 700# CONFIG_CODA_FS is not set
599# CONFIG_AFS_FS is not set 701# CONFIG_AFS_FS is not set
702# CONFIG_9P_FS is not set
600 703
601# 704#
602# Partition Types 705# Partition Types
@@ -631,9 +734,24 @@ CONFIG_ULTRIX_PARTITION=y
631# 734#
632# Kernel hacking 735# Kernel hacking
633# 736#
634# CONFIG_DEBUG_KERNEL is not set 737# CONFIG_PRINTK_TIME is not set
738CONFIG_DEBUG_KERNEL=y
739CONFIG_MAGIC_SYSRQ=y
740CONFIG_LOG_BUF_SHIFT=14
741CONFIG_DETECT_SOFTLOCKUP=y
742# CONFIG_SCHEDSTATS is not set
743# CONFIG_DEBUG_SLAB is not set
744# CONFIG_DEBUG_SPINLOCK is not set
745# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
746# CONFIG_DEBUG_KOBJECT is not set
747# CONFIG_DEBUG_INFO is not set
748# CONFIG_DEBUG_FS is not set
635CONFIG_CROSSCOMPILE=y 749CONFIG_CROSSCOMPILE=y
636CONFIG_CMDLINE="" 750CONFIG_CMDLINE=""
751# CONFIG_DEBUG_STACK_USAGE is not set
752# CONFIG_KGDB is not set
753# CONFIG_RUNTIME_DEBUG is not set
754# CONFIG_MIPS_UNCACHED is not set
637 755
638# 756#
639# Security options 757# Security options
@@ -645,7 +763,31 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
645# 763#
646# Cryptographic options 764# Cryptographic options
647# 765#
648# CONFIG_CRYPTO is not set 766CONFIG_CRYPTO=y
767CONFIG_CRYPTO_HMAC=y
768CONFIG_CRYPTO_NULL=m
769CONFIG_CRYPTO_MD4=m
770CONFIG_CRYPTO_MD5=m
771CONFIG_CRYPTO_SHA1=m
772CONFIG_CRYPTO_SHA256=m
773CONFIG_CRYPTO_SHA512=m
774CONFIG_CRYPTO_WP512=m
775CONFIG_CRYPTO_TGR192=m
776CONFIG_CRYPTO_DES=m
777CONFIG_CRYPTO_BLOWFISH=m
778CONFIG_CRYPTO_TWOFISH=m
779CONFIG_CRYPTO_SERPENT=m
780CONFIG_CRYPTO_AES=m
781CONFIG_CRYPTO_CAST5=m
782CONFIG_CRYPTO_CAST6=m
783CONFIG_CRYPTO_TEA=m
784CONFIG_CRYPTO_ARC4=m
785CONFIG_CRYPTO_KHAZAD=m
786CONFIG_CRYPTO_ANUBIS=m
787CONFIG_CRYPTO_DEFLATE=m
788CONFIG_CRYPTO_MICHAEL_MIC=m
789CONFIG_CRYPTO_CRC32C=m
790# CONFIG_CRYPTO_TEST is not set
649 791
650# 792#
651# Hardware crypto devices 793# Hardware crypto devices
@@ -655,7 +797,8 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
655# Library routines 797# Library routines
656# 798#
657# CONFIG_CRC_CCITT is not set 799# CONFIG_CRC_CCITT is not set
800CONFIG_CRC16=m
658CONFIG_CRC32=y 801CONFIG_CRC32=y
659CONFIG_LIBCRC32C=m 802CONFIG_LIBCRC32C=m
660CONFIG_GENERIC_HARDIRQS=y 803CONFIG_ZLIB_INFLATE=m
661CONFIG_GENERIC_IRQ_PROBE=y 804CONFIG_ZLIB_DEFLATE=m
diff --git a/arch/mips/configs/e55_defconfig b/arch/mips/configs/e55_defconfig
index ba2ec01defb1..c0d06ea5566c 100644
--- a/arch/mips/configs/e55_defconfig
+++ b/arch/mips/configs/e55_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:03 2005 4# Thu Oct 20 22:25:51 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,24 +11,29 @@ CONFIG_32BIT=y
14CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
25# CONFIG_BSD_PROCESS_ACCT is not set 24# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y 25CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set 26# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14
29# CONFIG_HOTPLUG is not set 27# CONFIG_HOTPLUG is not set
30CONFIG_KOBJECT_UEVENT=y 28CONFIG_KOBJECT_UEVENT=y
31# CONFIG_IKCONFIG is not set 29# CONFIG_IKCONFIG is not set
30CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y 31CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y 32CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_EXTRA_PASS is not set 33# CONFIG_KALLSYMS_EXTRA_PASS is not set
34CONFIG_PRINTK=y
35CONFIG_BUG=y
36CONFIG_BASE_FULL=y
35CONFIG_FUTEX=y 37CONFIG_FUTEX=y
36CONFIG_EPOLL=y 38CONFIG_EPOLL=y
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -41,6 +43,7 @@ CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0 43CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0 44CONFIG_CC_ALIGN_JUMPS=0
43# CONFIG_TINY_SHMEM is not set 45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
44 47
45# 48#
46# Loadable module support 49# Loadable module support
@@ -56,56 +59,84 @@ CONFIG_KMOD=y
56# 59#
57# Machine selection 60# Machine selection
58# 61#
59# CONFIG_MACH_JAZZ is not set 62# CONFIG_MIPS_MTX1 is not set
60CONFIG_MACH_VR41XX=y 63# CONFIG_MIPS_BOSPORUS is not set
61# CONFIG_NEC_CMBVR4133 is not set 64# CONFIG_MIPS_PB1000 is not set
62CONFIG_CASIO_E55=y 65# CONFIG_MIPS_PB1100 is not set
63# CONFIG_IBM_WORKPAD is not set 66# CONFIG_MIPS_PB1500 is not set
64# CONFIG_TANBAC_TB0226 is not set 67# CONFIG_MIPS_PB1550 is not set
65# CONFIG_TANBAC_TB0229 is not set 68# CONFIG_MIPS_PB1200 is not set
66# CONFIG_VICTOR_MPC30X is not set 69# CONFIG_MIPS_DB1000 is not set
67# CONFIG_ZAO_CAPCELLA is not set 70# CONFIG_MIPS_DB1100 is not set
68# CONFIG_VRC4171 is not set 71# CONFIG_MIPS_DB1500 is not set
69# CONFIG_TOSHIBA_JMR3927 is not set 72# CONFIG_MIPS_DB1550 is not set
73# CONFIG_MIPS_DB1200 is not set
74# CONFIG_MIPS_MIRAGE is not set
70# CONFIG_MIPS_COBALT is not set 75# CONFIG_MIPS_COBALT is not set
71# CONFIG_MACH_DECSTATION is not set 76# CONFIG_MACH_DECSTATION is not set
72# CONFIG_MIPS_EV64120 is not set 77# CONFIG_MIPS_EV64120 is not set
73# CONFIG_MIPS_EV96100 is not set 78# CONFIG_MIPS_EV96100 is not set
74# CONFIG_MIPS_IVR is not set 79# CONFIG_MIPS_IVR is not set
75# CONFIG_LASAT is not set
76# CONFIG_MIPS_ITE8172 is not set 80# CONFIG_MIPS_ITE8172 is not set
81# CONFIG_MACH_JAZZ is not set
82# CONFIG_LASAT is not set
77# CONFIG_MIPS_ATLAS is not set 83# CONFIG_MIPS_ATLAS is not set
78# CONFIG_MIPS_MALTA is not set 84# CONFIG_MIPS_MALTA is not set
79# CONFIG_MIPS_SEAD is not set 85# CONFIG_MIPS_SEAD is not set
86# CONFIG_MIPS_SIM is not set
87# CONFIG_MOMENCO_JAGUAR_ATX is not set
80# CONFIG_MOMENCO_OCELOT is not set 88# CONFIG_MOMENCO_OCELOT is not set
81# CONFIG_MOMENCO_OCELOT_G is not set
82# CONFIG_MOMENCO_OCELOT_C is not set
83# CONFIG_MOMENCO_OCELOT_3 is not set 89# CONFIG_MOMENCO_OCELOT_3 is not set
84# CONFIG_MOMENCO_JAGUAR_ATX is not set 90# CONFIG_MOMENCO_OCELOT_C is not set
85# CONFIG_PMC_YOSEMITE is not set 91# CONFIG_MOMENCO_OCELOT_G is not set
92# CONFIG_MIPS_XXS1500 is not set
93# CONFIG_PNX8550_V2PCI is not set
94# CONFIG_PNX8550_JBS is not set
86# CONFIG_DDB5074 is not set 95# CONFIG_DDB5074 is not set
87# CONFIG_DDB5476 is not set 96# CONFIG_DDB5476 is not set
88# CONFIG_DDB5477 is not set 97# CONFIG_DDB5477 is not set
89# CONFIG_NEC_OSPREY is not set 98CONFIG_MACH_VR41XX=y
99# CONFIG_PMC_YOSEMITE is not set
100# CONFIG_QEMU is not set
90# CONFIG_SGI_IP22 is not set 101# CONFIG_SGI_IP22 is not set
91# CONFIG_SOC_AU1X00 is not set 102# CONFIG_SGI_IP27 is not set
92# CONFIG_SIBYTE_SB1xxx_SOC is not set 103# CONFIG_SGI_IP32 is not set
104# CONFIG_SIBYTE_BIGSUR is not set
105# CONFIG_SIBYTE_SWARM is not set
106# CONFIG_SIBYTE_SENTOSA is not set
107# CONFIG_SIBYTE_RHONE is not set
108# CONFIG_SIBYTE_CARMEL is not set
109# CONFIG_SIBYTE_PTSWARM is not set
110# CONFIG_SIBYTE_LITTLESUR is not set
111# CONFIG_SIBYTE_CRHINE is not set
112# CONFIG_SIBYTE_CRHONE is not set
93# CONFIG_SNI_RM200_PCI is not set 113# CONFIG_SNI_RM200_PCI is not set
114# CONFIG_TOSHIBA_JMR3927 is not set
94# CONFIG_TOSHIBA_RBTX4927 is not set 115# CONFIG_TOSHIBA_RBTX4927 is not set
116# CONFIG_TOSHIBA_RBTX4938 is not set
117# CONFIG_NEC_CMBVR4133 is not set
118CONFIG_CASIO_E55=y
119# CONFIG_IBM_WORKPAD is not set
120# CONFIG_TANBAC_TB022X is not set
121# CONFIG_VICTOR_MPC30X is not set
122# CONFIG_ZAO_CAPCELLA is not set
95CONFIG_RWSEM_GENERIC_SPINLOCK=y 123CONFIG_RWSEM_GENERIC_SPINLOCK=y
96CONFIG_GENERIC_CALIBRATE_DELAY=y 124CONFIG_GENERIC_CALIBRATE_DELAY=y
97CONFIG_HAVE_DEC_LOCK=y
98CONFIG_DMA_NONCOHERENT=y 125CONFIG_DMA_NONCOHERENT=y
99CONFIG_DMA_NEED_PCI_MAP_STATE=y 126CONFIG_DMA_NEED_PCI_MAP_STATE=y
127# CONFIG_CPU_BIG_ENDIAN is not set
100CONFIG_CPU_LITTLE_ENDIAN=y 128CONFIG_CPU_LITTLE_ENDIAN=y
129CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
101CONFIG_IRQ_CPU=y 130CONFIG_IRQ_CPU=y
102CONFIG_MIPS_L1_CACHE_SHIFT=5 131CONFIG_MIPS_L1_CACHE_SHIFT=5
103 132
104# 133#
105# CPU selection 134# CPU selection
106# 135#
107# CONFIG_CPU_MIPS32 is not set 136# CONFIG_CPU_MIPS32_R1 is not set
108# CONFIG_CPU_MIPS64 is not set 137# CONFIG_CPU_MIPS32_R2 is not set
138# CONFIG_CPU_MIPS64_R1 is not set
139# CONFIG_CPU_MIPS64_R2 is not set
109# CONFIG_CPU_R3000 is not set 140# CONFIG_CPU_R3000 is not set
110# CONFIG_CPU_TX39XX is not set 141# CONFIG_CPU_TX39XX is not set
111CONFIG_CPU_VR41XX=y 142CONFIG_CPU_VR41XX=y
@@ -121,12 +152,36 @@ CONFIG_CPU_VR41XX=y
121# CONFIG_CPU_RM7000 is not set 152# CONFIG_CPU_RM7000 is not set
122# CONFIG_CPU_RM9000 is not set 153# CONFIG_CPU_RM9000 is not set
123# CONFIG_CPU_SB1 is not set 154# CONFIG_CPU_SB1 is not set
155CONFIG_SYS_HAS_CPU_VR41XX=y
156CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
157CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
158CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
159CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
160
161#
162# Kernel type
163#
164CONFIG_32BIT=y
165# CONFIG_64BIT is not set
124CONFIG_PAGE_SIZE_4KB=y 166CONFIG_PAGE_SIZE_4KB=y
125# CONFIG_PAGE_SIZE_8KB is not set 167# CONFIG_PAGE_SIZE_8KB is not set
126# CONFIG_PAGE_SIZE_16KB is not set 168# CONFIG_PAGE_SIZE_16KB is not set
127# CONFIG_PAGE_SIZE_64KB is not set 169# CONFIG_PAGE_SIZE_64KB is not set
170# CONFIG_MIPS_MT is not set
128# CONFIG_CPU_ADVANCED is not set 171# CONFIG_CPU_ADVANCED is not set
129CONFIG_CPU_HAS_SYNC=y 172CONFIG_CPU_HAS_SYNC=y
173CONFIG_GENERIC_HARDIRQS=y
174CONFIG_GENERIC_IRQ_PROBE=y
175CONFIG_ARCH_FLATMEM_ENABLE=y
176CONFIG_SELECT_MEMORY_MODEL=y
177CONFIG_FLATMEM_MANUAL=y
178# CONFIG_DISCONTIGMEM_MANUAL is not set
179# CONFIG_SPARSEMEM_MANUAL is not set
180CONFIG_FLATMEM=y
181CONFIG_FLAT_NODE_MEM_MAP=y
182# CONFIG_SPARSEMEM_STATIC is not set
183CONFIG_PREEMPT_NONE=y
184# CONFIG_PREEMPT_VOLUNTARY is not set
130# CONFIG_PREEMPT is not set 185# CONFIG_PREEMPT is not set
131 186
132# 187#
@@ -141,11 +196,6 @@ CONFIG_MMU=y
141# CONFIG_PCCARD is not set 196# CONFIG_PCCARD is not set
142 197
143# 198#
144# PC-card bridges
145#
146CONFIG_PCMCIA_PROBE=y
147
148#
149# PCI Hotplug Support 199# PCI Hotplug Support
150# 200#
151 201
@@ -157,6 +207,78 @@ CONFIG_BINFMT_ELF=y
157CONFIG_TRAD_SIGNALS=y 207CONFIG_TRAD_SIGNALS=y
158 208
159# 209#
210# Networking
211#
212CONFIG_NET=y
213
214#
215# Networking options
216#
217CONFIG_PACKET=y
218CONFIG_PACKET_MMAP=y
219CONFIG_UNIX=y
220CONFIG_XFRM=y
221CONFIG_XFRM_USER=m
222CONFIG_NET_KEY=y
223CONFIG_INET=y
224CONFIG_IP_MULTICAST=y
225# CONFIG_IP_ADVANCED_ROUTER is not set
226CONFIG_IP_FIB_HASH=y
227# CONFIG_IP_PNP is not set
228# CONFIG_NET_IPIP is not set
229# CONFIG_NET_IPGRE is not set
230# CONFIG_IP_MROUTE is not set
231# CONFIG_ARPD is not set
232# CONFIG_SYN_COOKIES is not set
233# CONFIG_INET_AH is not set
234# CONFIG_INET_ESP is not set
235# CONFIG_INET_IPCOMP is not set
236CONFIG_INET_TUNNEL=m
237CONFIG_INET_DIAG=y
238CONFIG_INET_TCP_DIAG=y
239# CONFIG_TCP_CONG_ADVANCED is not set
240CONFIG_TCP_CONG_BIC=y
241# CONFIG_IPV6 is not set
242# CONFIG_NETFILTER is not set
243
244#
245# DCCP Configuration (EXPERIMENTAL)
246#
247# CONFIG_IP_DCCP is not set
248
249#
250# SCTP Configuration (EXPERIMENTAL)
251#
252# CONFIG_IP_SCTP is not set
253# CONFIG_ATM is not set
254# CONFIG_BRIDGE is not set
255# CONFIG_VLAN_8021Q is not set
256# CONFIG_DECNET is not set
257# CONFIG_LLC2 is not set
258# CONFIG_IPX is not set
259# CONFIG_ATALK is not set
260# CONFIG_X25 is not set
261# CONFIG_LAPB is not set
262# CONFIG_NET_DIVERT is not set
263# CONFIG_ECONET is not set
264# CONFIG_WAN_ROUTER is not set
265# CONFIG_NET_SCHED is not set
266# CONFIG_NET_CLS_ROUTE is not set
267
268#
269# Network testing
270#
271# CONFIG_NET_PKTGEN is not set
272# CONFIG_HAMRADIO is not set
273# CONFIG_IRDA is not set
274# CONFIG_BT is not set
275CONFIG_IEEE80211=m
276# CONFIG_IEEE80211_DEBUG is not set
277CONFIG_IEEE80211_CRYPT_WEP=m
278CONFIG_IEEE80211_CRYPT_CCMP=m
279CONFIG_IEEE80211_CRYPT_TKIP=m
280
281#
160# Device Drivers 282# Device Drivers
161# 283#
162 284
@@ -168,6 +290,11 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
168# CONFIG_FW_LOADER is not set 290# CONFIG_FW_LOADER is not set
169 291
170# 292#
293# Connector - unified userspace <-> kernelspace linker
294#
295CONFIG_CONNECTOR=m
296
297#
171# Memory Technology Devices (MTD) 298# Memory Technology Devices (MTD)
172# 299#
173# CONFIG_MTD is not set 300# CONFIG_MTD is not set
@@ -185,18 +312,13 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
185# 312#
186# Block devices 313# Block devices
187# 314#
188# CONFIG_BLK_DEV_FD is not set
189# CONFIG_BLK_DEV_XD is not set
190# CONFIG_BLK_DEV_COW_COMMON is not set 315# CONFIG_BLK_DEV_COW_COMMON is not set
191# CONFIG_BLK_DEV_LOOP is not set 316# CONFIG_BLK_DEV_LOOP is not set
192# CONFIG_BLK_DEV_NBD is not set 317# CONFIG_BLK_DEV_NBD is not set
193# CONFIG_BLK_DEV_RAM is not set 318# CONFIG_BLK_DEV_RAM is not set
194CONFIG_BLK_DEV_RAM_COUNT=16 319CONFIG_BLK_DEV_RAM_COUNT=16
195CONFIG_INITRAMFS_SOURCE=""
196# CONFIG_LBD is not set 320# CONFIG_LBD is not set
197CONFIG_CDROM_PKTCDVD=m 321# CONFIG_CDROM_PKTCDVD is not set
198CONFIG_CDROM_PKTCDVD_BUFFERS=8
199# CONFIG_CDROM_PKTCDVD_WCACHE is not set
200 322
201# 323#
202# IO Schedulers 324# IO Schedulers
@@ -205,7 +327,7 @@ CONFIG_IOSCHED_NOOP=y
205CONFIG_IOSCHED_AS=y 327CONFIG_IOSCHED_AS=y
206CONFIG_IOSCHED_DEADLINE=y 328CONFIG_IOSCHED_DEADLINE=y
207CONFIG_IOSCHED_CFQ=y 329CONFIG_IOSCHED_CFQ=y
208CONFIG_ATA_OVER_ETH=m 330# CONFIG_ATA_OVER_ETH is not set
209 331
210# 332#
211# ATA/ATAPI/MFM/RLL support 333# ATA/ATAPI/MFM/RLL support
@@ -237,6 +359,7 @@ CONFIG_IDE_GENERIC=y
237# 359#
238# SCSI device support 360# SCSI device support
239# 361#
362# CONFIG_RAID_ATTRS is not set
240# CONFIG_SCSI is not set 363# CONFIG_SCSI is not set
241 364
242# 365#
@@ -252,6 +375,7 @@ CONFIG_IDE_GENERIC=y
252# 375#
253# Fusion MPT device support 376# Fusion MPT device support
254# 377#
378# CONFIG_FUSION is not set
255 379
256# 380#
257# IEEE 1394 (FireWire) support 381# IEEE 1394 (FireWire) support
@@ -262,76 +386,13 @@ CONFIG_IDE_GENERIC=y
262# 386#
263 387
264# 388#
265# Networking support 389# Network device support
266#
267CONFIG_NET=y
268
269#
270# Networking options
271#
272CONFIG_PACKET=y
273CONFIG_PACKET_MMAP=y
274CONFIG_NETLINK_DEV=y
275CONFIG_UNIX=y
276CONFIG_NET_KEY=y
277CONFIG_INET=y
278CONFIG_IP_MULTICAST=y
279# CONFIG_IP_ADVANCED_ROUTER is not set
280# CONFIG_IP_PNP is not set
281# CONFIG_NET_IPIP is not set
282# CONFIG_NET_IPGRE is not set
283# CONFIG_IP_MROUTE is not set
284# CONFIG_ARPD is not set
285# CONFIG_SYN_COOKIES is not set
286# CONFIG_INET_AH is not set
287# CONFIG_INET_ESP is not set
288# CONFIG_INET_IPCOMP is not set
289CONFIG_INET_TUNNEL=m
290CONFIG_IP_TCPDIAG=m
291# CONFIG_IP_TCPDIAG_IPV6 is not set
292# CONFIG_IPV6 is not set
293# CONFIG_NETFILTER is not set
294CONFIG_XFRM=y
295CONFIG_XFRM_USER=m
296
297#
298# SCTP Configuration (EXPERIMENTAL)
299#
300# CONFIG_IP_SCTP is not set
301# CONFIG_ATM is not set
302# CONFIG_BRIDGE is not set
303# CONFIG_VLAN_8021Q is not set
304# CONFIG_DECNET is not set
305# CONFIG_LLC2 is not set
306# CONFIG_IPX is not set
307# CONFIG_ATALK is not set
308# CONFIG_X25 is not set
309# CONFIG_LAPB is not set
310# CONFIG_NET_DIVERT is not set
311# CONFIG_ECONET is not set
312# CONFIG_WAN_ROUTER is not set
313
314#
315# QoS and/or fair queueing
316#
317# CONFIG_NET_SCHED is not set
318# CONFIG_NET_CLS_ROUTE is not set
319
320#
321# Network testing
322# 390#
323# CONFIG_NET_PKTGEN is not set
324# CONFIG_NETPOLL is not set
325# CONFIG_NET_POLL_CONTROLLER is not set
326# CONFIG_HAMRADIO is not set
327# CONFIG_IRDA is not set
328# CONFIG_BT is not set
329CONFIG_NETDEVICES=y 391CONFIG_NETDEVICES=y
330# CONFIG_DUMMY is not set 392# CONFIG_DUMMY is not set
331# CONFIG_BONDING is not set 393# CONFIG_BONDING is not set
332# CONFIG_EQUALIZER is not set 394# CONFIG_EQUALIZER is not set
333# CONFIG_TUN is not set 395# CONFIG_TUN is not set
334# CONFIG_ETHERTAP is not set
335 396
336# 397#
337# ARCnet devices 398# ARCnet devices
@@ -339,12 +400,26 @@ CONFIG_NETDEVICES=y
339# CONFIG_ARCNET is not set 400# CONFIG_ARCNET is not set
340 401
341# 402#
403# PHY device support
404#
405CONFIG_PHYLIB=m
406CONFIG_PHYCONTROL=y
407
408#
409# MII PHY device drivers
410#
411CONFIG_MARVELL_PHY=m
412CONFIG_DAVICOM_PHY=m
413CONFIG_QSEMI_PHY=m
414CONFIG_LXT_PHY=m
415CONFIG_CICADA_PHY=m
416
417#
342# Ethernet (10 or 100Mbit) 418# Ethernet (10 or 100Mbit)
343# 419#
344CONFIG_NET_ETHERNET=y 420CONFIG_NET_ETHERNET=y
345# CONFIG_MII is not set 421# CONFIG_MII is not set
346# CONFIG_NET_VENDOR_3COM is not set 422# CONFIG_NET_VENDOR_3COM is not set
347# CONFIG_LANCE is not set
348# CONFIG_NET_VENDOR_SMC is not set 423# CONFIG_NET_VENDOR_SMC is not set
349# CONFIG_NET_VENDOR_RACAL is not set 424# CONFIG_NET_VENDOR_RACAL is not set
350# CONFIG_AT1700 is not set 425# CONFIG_AT1700 is not set
@@ -380,6 +455,8 @@ CONFIG_NET_ETHERNET=y
380# CONFIG_SLIP is not set 455# CONFIG_SLIP is not set
381# CONFIG_SHAPER is not set 456# CONFIG_SHAPER is not set
382# CONFIG_NETCONSOLE is not set 457# CONFIG_NETCONSOLE is not set
458# CONFIG_NETPOLL is not set
459# CONFIG_NET_POLL_CONTROLLER is not set
383 460
384# 461#
385# ISDN subsystem 462# ISDN subsystem
@@ -401,26 +478,14 @@ CONFIG_INPUT=y
401# 478#
402CONFIG_INPUT_MOUSEDEV=y 479CONFIG_INPUT_MOUSEDEV=y
403CONFIG_INPUT_MOUSEDEV_PSAUX=y 480CONFIG_INPUT_MOUSEDEV_PSAUX=y
404CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 481CONFIG_INPUT_MOUSEDEV_SCREEN_X=320
405CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 482CONFIG_INPUT_MOUSEDEV_SCREEN_Y=240
406# CONFIG_INPUT_JOYDEV is not set 483# CONFIG_INPUT_JOYDEV is not set
407# CONFIG_INPUT_TSDEV is not set 484# CONFIG_INPUT_TSDEV is not set
408# CONFIG_INPUT_EVDEV is not set 485# CONFIG_INPUT_EVDEV is not set
409# CONFIG_INPUT_EVBUG is not set 486# CONFIG_INPUT_EVBUG is not set
410 487
411# 488#
412# Input I/O drivers
413#
414# CONFIG_GAMEPORT is not set
415CONFIG_SOUND_GAMEPORT=y
416CONFIG_SERIO=y
417CONFIG_SERIO_I8042=y
418CONFIG_SERIO_SERPORT=y
419# CONFIG_SERIO_CT82C710 is not set
420# CONFIG_SERIO_LIBPS2 is not set
421CONFIG_SERIO_RAW=m
422
423#
424# Input Device Drivers 489# Input Device Drivers
425# 490#
426# CONFIG_INPUT_KEYBOARD is not set 491# CONFIG_INPUT_KEYBOARD is not set
@@ -430,6 +495,16 @@ CONFIG_SERIO_RAW=m
430# CONFIG_INPUT_MISC is not set 495# CONFIG_INPUT_MISC is not set
431 496
432# 497#
498# Hardware I/O ports
499#
500CONFIG_SERIO=y
501# CONFIG_SERIO_I8042 is not set
502CONFIG_SERIO_SERPORT=y
503# CONFIG_SERIO_LIBPS2 is not set
504CONFIG_SERIO_RAW=m
505# CONFIG_GAMEPORT is not set
506
507#
433# Character devices 508# Character devices
434# 509#
435CONFIG_VT=y 510CONFIG_VT=y
@@ -440,16 +515,15 @@ CONFIG_HW_CONSOLE=y
440# 515#
441# Serial drivers 516# Serial drivers
442# 517#
443CONFIG_SERIAL_8250=y 518# CONFIG_SERIAL_8250 is not set
444CONFIG_SERIAL_8250_CONSOLE=y
445CONFIG_SERIAL_8250_NR_UARTS=4
446# CONFIG_SERIAL_8250_EXTENDED is not set
447 519
448# 520#
449# Non-8250 serial port support 521# Non-8250 serial port support
450# 522#
451CONFIG_SERIAL_CORE=y 523CONFIG_SERIAL_CORE=y
452CONFIG_SERIAL_CORE_CONSOLE=y 524CONFIG_SERIAL_CORE_CONSOLE=y
525CONFIG_SERIAL_VR41XX=y
526CONFIG_SERIAL_VR41XX_CONSOLE=y
453CONFIG_UNIX98_PTYS=y 527CONFIG_UNIX98_PTYS=y
454CONFIG_LEGACY_PTYS=y 528CONFIG_LEGACY_PTYS=y
455CONFIG_LEGACY_PTY_COUNT=256 529CONFIG_LEGACY_PTY_COUNT=256
@@ -484,10 +558,14 @@ CONFIG_WATCHDOG=y
484# 558#
485# Ftape, the floppy tape device driver 559# Ftape, the floppy tape device driver
486# 560#
487# CONFIG_DRM is not set 561CONFIG_GPIO_VR41XX=y
488# CONFIG_RAW_DRIVER is not set 562# CONFIG_RAW_DRIVER is not set
489 563
490# 564#
565# TPM devices
566#
567
568#
491# I2C support 569# I2C support
492# 570#
493# CONFIG_I2C is not set 571# CONFIG_I2C is not set
@@ -498,10 +576,20 @@ CONFIG_WATCHDOG=y
498# CONFIG_W1 is not set 576# CONFIG_W1 is not set
499 577
500# 578#
579# Hardware Monitoring support
580#
581# CONFIG_HWMON is not set
582# CONFIG_HWMON_VID is not set
583
584#
501# Misc devices 585# Misc devices
502# 586#
503 587
504# 588#
589# Multimedia Capabilities Port drivers
590#
591
592#
505# Multimedia devices 593# Multimedia devices
506# 594#
507# CONFIG_VIDEO_DEV is not set 595# CONFIG_VIDEO_DEV is not set
@@ -522,7 +610,6 @@ CONFIG_WATCHDOG=y
522# CONFIG_VGA_CONSOLE is not set 610# CONFIG_VGA_CONSOLE is not set
523# CONFIG_MDA_CONSOLE is not set 611# CONFIG_MDA_CONSOLE is not set
524CONFIG_DUMMY_CONSOLE=y 612CONFIG_DUMMY_CONSOLE=y
525# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
526 613
527# 614#
528# Sound 615# Sound
@@ -536,10 +623,6 @@ CONFIG_DUMMY_CONSOLE=y
536# CONFIG_USB_ARCH_HAS_OHCI is not set 623# CONFIG_USB_ARCH_HAS_OHCI is not set
537 624
538# 625#
539# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
540#
541
542#
543# USB Gadget Support 626# USB Gadget Support
544# 627#
545# CONFIG_USB_GADGET is not set 628# CONFIG_USB_GADGET is not set
@@ -552,24 +635,31 @@ CONFIG_DUMMY_CONSOLE=y
552# 635#
553# InfiniBand support 636# InfiniBand support
554# 637#
555# CONFIG_INFINIBAND is not set 638
639#
640# SN Devices
641#
556 642
557# 643#
558# File systems 644# File systems
559# 645#
560CONFIG_EXT2_FS=y 646CONFIG_EXT2_FS=y
561# CONFIG_EXT2_FS_XATTR is not set 647# CONFIG_EXT2_FS_XATTR is not set
648# CONFIG_EXT2_FS_XIP is not set
562# CONFIG_EXT3_FS is not set 649# CONFIG_EXT3_FS is not set
563# CONFIG_JBD is not set 650# CONFIG_JBD is not set
564# CONFIG_REISERFS_FS is not set 651# CONFIG_REISERFS_FS is not set
565# CONFIG_JFS_FS is not set 652# CONFIG_JFS_FS is not set
653# CONFIG_FS_POSIX_ACL is not set
566# CONFIG_XFS_FS is not set 654# CONFIG_XFS_FS is not set
567# CONFIG_MINIX_FS is not set 655# CONFIG_MINIX_FS is not set
568# CONFIG_ROMFS_FS is not set 656# CONFIG_ROMFS_FS is not set
657CONFIG_INOTIFY=y
569# CONFIG_QUOTA is not set 658# CONFIG_QUOTA is not set
570CONFIG_DNOTIFY=y 659CONFIG_DNOTIFY=y
571CONFIG_AUTOFS_FS=y 660CONFIG_AUTOFS_FS=y
572CONFIG_AUTOFS4_FS=y 661CONFIG_AUTOFS4_FS=y
662CONFIG_FUSE_FS=m
573 663
574# 664#
575# CD-ROM/DVD Filesystems 665# CD-ROM/DVD Filesystems
@@ -590,12 +680,10 @@ CONFIG_AUTOFS4_FS=y
590CONFIG_PROC_FS=y 680CONFIG_PROC_FS=y
591CONFIG_PROC_KCORE=y 681CONFIG_PROC_KCORE=y
592CONFIG_SYSFS=y 682CONFIG_SYSFS=y
593# CONFIG_DEVFS_FS is not set
594CONFIG_DEVPTS_FS_XATTR=y
595CONFIG_DEVPTS_FS_SECURITY=y
596# CONFIG_TMPFS is not set 683# CONFIG_TMPFS is not set
597# CONFIG_HUGETLB_PAGE is not set 684# CONFIG_HUGETLB_PAGE is not set
598CONFIG_RAMFS=y 685CONFIG_RAMFS=y
686CONFIG_RELAYFS_FS=m
599 687
600# 688#
601# Miscellaneous filesystems 689# Miscellaneous filesystems
@@ -617,16 +705,17 @@ CONFIG_RAMFS=y
617# 705#
618# Network File Systems 706# Network File Systems
619# 707#
620CONFIG_NFS_FS=y 708CONFIG_NFS_FS=m
621# CONFIG_NFS_V3 is not set 709# CONFIG_NFS_V3 is not set
622# CONFIG_NFS_V4 is not set 710# CONFIG_NFS_V4 is not set
623# CONFIG_NFS_DIRECTIO is not set 711# CONFIG_NFS_DIRECTIO is not set
624CONFIG_NFSD=y 712CONFIG_NFSD=m
625# CONFIG_NFSD_V3 is not set 713# CONFIG_NFSD_V3 is not set
626# CONFIG_NFSD_TCP is not set 714# CONFIG_NFSD_TCP is not set
627CONFIG_LOCKD=y 715CONFIG_LOCKD=m
628CONFIG_EXPORTFS=y 716CONFIG_EXPORTFS=m
629CONFIG_SUNRPC=y 717CONFIG_NFS_COMMON=y
718CONFIG_SUNRPC=m
630# CONFIG_RPCSEC_GSS_KRB5 is not set 719# CONFIG_RPCSEC_GSS_KRB5 is not set
631# CONFIG_RPCSEC_GSS_SPKM3 is not set 720# CONFIG_RPCSEC_GSS_SPKM3 is not set
632# CONFIG_SMB_FS is not set 721# CONFIG_SMB_FS is not set
@@ -634,6 +723,7 @@ CONFIG_SUNRPC=y
634# CONFIG_NCP_FS is not set 723# CONFIG_NCP_FS is not set
635# CONFIG_CODA_FS is not set 724# CONFIG_CODA_FS is not set
636# CONFIG_AFS_FS is not set 725# CONFIG_AFS_FS is not set
726# CONFIG_9P_FS is not set
637 727
638# 728#
639# Partition Types 729# Partition Types
@@ -654,9 +744,11 @@ CONFIG_MSDOS_PARTITION=y
654# 744#
655# Kernel hacking 745# Kernel hacking
656# 746#
747# CONFIG_PRINTK_TIME is not set
657# CONFIG_DEBUG_KERNEL is not set 748# CONFIG_DEBUG_KERNEL is not set
749CONFIG_LOG_BUF_SHIFT=14
658CONFIG_CROSSCOMPILE=y 750CONFIG_CROSSCOMPILE=y
659CONFIG_CMDLINE="" 751CONFIG_CMDLINE="console=ttyVR0,19200 mem=8M"
660 752
661# 753#
662# Security options 754# Security options
@@ -668,7 +760,31 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
668# 760#
669# Cryptographic options 761# Cryptographic options
670# 762#
671# CONFIG_CRYPTO is not set 763CONFIG_CRYPTO=y
764CONFIG_CRYPTO_HMAC=y
765CONFIG_CRYPTO_NULL=m
766CONFIG_CRYPTO_MD4=m
767CONFIG_CRYPTO_MD5=m
768CONFIG_CRYPTO_SHA1=m
769CONFIG_CRYPTO_SHA256=m
770CONFIG_CRYPTO_SHA512=m
771CONFIG_CRYPTO_WP512=m
772CONFIG_CRYPTO_TGR192=m
773CONFIG_CRYPTO_DES=m
774CONFIG_CRYPTO_BLOWFISH=m
775CONFIG_CRYPTO_TWOFISH=m
776CONFIG_CRYPTO_SERPENT=m
777CONFIG_CRYPTO_AES=m
778CONFIG_CRYPTO_CAST5=m
779CONFIG_CRYPTO_CAST6=m
780CONFIG_CRYPTO_TEA=m
781CONFIG_CRYPTO_ARC4=m
782CONFIG_CRYPTO_KHAZAD=m
783CONFIG_CRYPTO_ANUBIS=m
784CONFIG_CRYPTO_DEFLATE=m
785CONFIG_CRYPTO_MICHAEL_MIC=m
786CONFIG_CRYPTO_CRC32C=m
787# CONFIG_CRYPTO_TEST is not set
672 788
673# 789#
674# Hardware crypto devices 790# Hardware crypto devices
@@ -678,7 +794,8 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
678# Library routines 794# Library routines
679# 795#
680# CONFIG_CRC_CCITT is not set 796# CONFIG_CRC_CCITT is not set
681# CONFIG_CRC32 is not set 797CONFIG_CRC16=m
798CONFIG_CRC32=m
682CONFIG_LIBCRC32C=m 799CONFIG_LIBCRC32C=m
683CONFIG_GENERIC_HARDIRQS=y 800CONFIG_ZLIB_INFLATE=m
684CONFIG_GENERIC_IRQ_PROBE=y 801CONFIG_ZLIB_DEFLATE=m
diff --git a/arch/mips/configs/ev64120_defconfig b/arch/mips/configs/ev64120_defconfig
index 17e87f70f602..f1309d84d2fe 100644
--- a/arch/mips/configs/ev64120_defconfig
+++ b/arch/mips/configs/ev64120_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:03 2005 4# Thu Oct 20 22:25:54 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,24 +11,29 @@ CONFIG_32BIT=y
14CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
25# CONFIG_BSD_PROCESS_ACCT is not set 24# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y 25CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set 26# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14 27CONFIG_HOTPLUG=y
29# CONFIG_HOTPLUG is not set
30CONFIG_KOBJECT_UEVENT=y 28CONFIG_KOBJECT_UEVENT=y
31# CONFIG_IKCONFIG is not set 29# CONFIG_IKCONFIG is not set
30CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y 31CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y 32CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_EXTRA_PASS is not set 33# CONFIG_KALLSYMS_EXTRA_PASS is not set
34CONFIG_PRINTK=y
35CONFIG_BUG=y
36CONFIG_BASE_FULL=y
35CONFIG_FUTEX=y 37CONFIG_FUTEX=y
36CONFIG_EPOLL=y 38CONFIG_EPOLL=y
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -41,6 +43,7 @@ CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0 43CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0 44CONFIG_CC_ALIGN_JUMPS=0
43# CONFIG_TINY_SHMEM is not set 45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
44 47
45# 48#
46# Loadable module support 49# Loadable module support
@@ -56,41 +59,69 @@ CONFIG_MODULE_SRCVERSION_ALL=y
56# 59#
57# Machine selection 60# Machine selection
58# 61#
59# CONFIG_MACH_JAZZ is not set 62# CONFIG_MIPS_MTX1 is not set
60# CONFIG_MACH_VR41XX is not set 63# CONFIG_MIPS_BOSPORUS is not set
61# CONFIG_TOSHIBA_JMR3927 is not set 64# CONFIG_MIPS_PB1000 is not set
65# CONFIG_MIPS_PB1100 is not set
66# CONFIG_MIPS_PB1500 is not set
67# CONFIG_MIPS_PB1550 is not set
68# CONFIG_MIPS_PB1200 is not set
69# CONFIG_MIPS_DB1000 is not set
70# CONFIG_MIPS_DB1100 is not set
71# CONFIG_MIPS_DB1500 is not set
72# CONFIG_MIPS_DB1550 is not set
73# CONFIG_MIPS_DB1200 is not set
74# CONFIG_MIPS_MIRAGE is not set
62# CONFIG_MIPS_COBALT is not set 75# CONFIG_MIPS_COBALT is not set
63# CONFIG_MACH_DECSTATION is not set 76# CONFIG_MACH_DECSTATION is not set
64CONFIG_MIPS_EV64120=y 77CONFIG_MIPS_EV64120=y
65# CONFIG_EVB_PCI1 is not set
66# CONFIG_MIPS_EV96100 is not set 78# CONFIG_MIPS_EV96100 is not set
67# CONFIG_MIPS_IVR is not set 79# CONFIG_MIPS_IVR is not set
68# CONFIG_LASAT is not set
69# CONFIG_MIPS_ITE8172 is not set 80# CONFIG_MIPS_ITE8172 is not set
81# CONFIG_MACH_JAZZ is not set
82# CONFIG_LASAT is not set
70# CONFIG_MIPS_ATLAS is not set 83# CONFIG_MIPS_ATLAS is not set
71# CONFIG_MIPS_MALTA is not set 84# CONFIG_MIPS_MALTA is not set
72# CONFIG_MIPS_SEAD is not set 85# CONFIG_MIPS_SEAD is not set
86# CONFIG_MIPS_SIM is not set
87# CONFIG_MOMENCO_JAGUAR_ATX is not set
73# CONFIG_MOMENCO_OCELOT is not set 88# CONFIG_MOMENCO_OCELOT is not set
74# CONFIG_MOMENCO_OCELOT_G is not set
75# CONFIG_MOMENCO_OCELOT_C is not set
76# CONFIG_MOMENCO_OCELOT_3 is not set 89# CONFIG_MOMENCO_OCELOT_3 is not set
77# CONFIG_MOMENCO_JAGUAR_ATX is not set 90# CONFIG_MOMENCO_OCELOT_C is not set
78# CONFIG_PMC_YOSEMITE is not set 91# CONFIG_MOMENCO_OCELOT_G is not set
92# CONFIG_MIPS_XXS1500 is not set
93# CONFIG_PNX8550_V2PCI is not set
94# CONFIG_PNX8550_JBS is not set
79# CONFIG_DDB5074 is not set 95# CONFIG_DDB5074 is not set
80# CONFIG_DDB5476 is not set 96# CONFIG_DDB5476 is not set
81# CONFIG_DDB5477 is not set 97# CONFIG_DDB5477 is not set
82# CONFIG_NEC_OSPREY is not set 98# CONFIG_MACH_VR41XX is not set
99# CONFIG_PMC_YOSEMITE is not set
100# CONFIG_QEMU is not set
83# CONFIG_SGI_IP22 is not set 101# CONFIG_SGI_IP22 is not set
84# CONFIG_SOC_AU1X00 is not set 102# CONFIG_SGI_IP27 is not set
85# CONFIG_SIBYTE_SB1xxx_SOC is not set 103# CONFIG_SGI_IP32 is not set
104# CONFIG_SIBYTE_BIGSUR is not set
105# CONFIG_SIBYTE_SWARM is not set
106# CONFIG_SIBYTE_SENTOSA is not set
107# CONFIG_SIBYTE_RHONE is not set
108# CONFIG_SIBYTE_CARMEL is not set
109# CONFIG_SIBYTE_PTSWARM is not set
110# CONFIG_SIBYTE_LITTLESUR is not set
111# CONFIG_SIBYTE_CRHINE is not set
112# CONFIG_SIBYTE_CRHONE is not set
86# CONFIG_SNI_RM200_PCI is not set 113# CONFIG_SNI_RM200_PCI is not set
114# CONFIG_TOSHIBA_JMR3927 is not set
87# CONFIG_TOSHIBA_RBTX4927 is not set 115# CONFIG_TOSHIBA_RBTX4927 is not set
116# CONFIG_TOSHIBA_RBTX4938 is not set
117# CONFIG_EVB_PCI1 is not set
88CONFIG_RWSEM_GENERIC_SPINLOCK=y 118CONFIG_RWSEM_GENERIC_SPINLOCK=y
89CONFIG_GENERIC_CALIBRATE_DELAY=y 119CONFIG_GENERIC_CALIBRATE_DELAY=y
90CONFIG_HAVE_DEC_LOCK=y
91CONFIG_DMA_NONCOHERENT=y 120CONFIG_DMA_NONCOHERENT=y
92CONFIG_DMA_NEED_PCI_MAP_STATE=y 121CONFIG_DMA_NEED_PCI_MAP_STATE=y
122CONFIG_CPU_BIG_ENDIAN=y
93# CONFIG_CPU_LITTLE_ENDIAN is not set 123# CONFIG_CPU_LITTLE_ENDIAN is not set
124CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
94CONFIG_MIPS_GT64120=y 125CONFIG_MIPS_GT64120=y
95# CONFIG_SYSCLK_75 is not set 126# CONFIG_SYSCLK_75 is not set
96# CONFIG_SYSCLK_83 is not set 127# CONFIG_SYSCLK_83 is not set
@@ -100,8 +131,10 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
100# 131#
101# CPU selection 132# CPU selection
102# 133#
103# CONFIG_CPU_MIPS32 is not set 134# CONFIG_CPU_MIPS32_R1 is not set
104# CONFIG_CPU_MIPS64 is not set 135# CONFIG_CPU_MIPS32_R2 is not set
136# CONFIG_CPU_MIPS64_R1 is not set
137# CONFIG_CPU_MIPS64_R2 is not set
105# CONFIG_CPU_R3000 is not set 138# CONFIG_CPU_R3000 is not set
106# CONFIG_CPU_TX39XX is not set 139# CONFIG_CPU_TX39XX is not set
107# CONFIG_CPU_VR41XX is not set 140# CONFIG_CPU_VR41XX is not set
@@ -117,15 +150,39 @@ CONFIG_CPU_R5000=y
117# CONFIG_CPU_RM7000 is not set 150# CONFIG_CPU_RM7000 is not set
118# CONFIG_CPU_RM9000 is not set 151# CONFIG_CPU_RM9000 is not set
119# CONFIG_CPU_SB1 is not set 152# CONFIG_CPU_SB1 is not set
153CONFIG_SYS_HAS_CPU_R5000=y
154CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
155CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
156CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
157CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
158
159#
160# Kernel type
161#
162CONFIG_32BIT=y
163# CONFIG_64BIT is not set
120CONFIG_PAGE_SIZE_4KB=y 164CONFIG_PAGE_SIZE_4KB=y
121# CONFIG_PAGE_SIZE_8KB is not set 165# CONFIG_PAGE_SIZE_8KB is not set
122# CONFIG_PAGE_SIZE_16KB is not set 166# CONFIG_PAGE_SIZE_16KB is not set
123# CONFIG_PAGE_SIZE_64KB is not set 167# CONFIG_PAGE_SIZE_64KB is not set
168# CONFIG_MIPS_MT is not set
124# CONFIG_64BIT_PHYS_ADDR is not set 169# CONFIG_64BIT_PHYS_ADDR is not set
125# CONFIG_CPU_ADVANCED is not set 170# CONFIG_CPU_ADVANCED is not set
126CONFIG_CPU_HAS_LLSC=y 171CONFIG_CPU_HAS_LLSC=y
127CONFIG_CPU_HAS_LLDSCD=y 172CONFIG_CPU_HAS_LLDSCD=y
128CONFIG_CPU_HAS_SYNC=y 173CONFIG_CPU_HAS_SYNC=y
174CONFIG_GENERIC_HARDIRQS=y
175CONFIG_GENERIC_IRQ_PROBE=y
176CONFIG_ARCH_FLATMEM_ENABLE=y
177CONFIG_SELECT_MEMORY_MODEL=y
178CONFIG_FLATMEM_MANUAL=y
179# CONFIG_DISCONTIGMEM_MANUAL is not set
180# CONFIG_SPARSEMEM_MANUAL is not set
181CONFIG_FLATMEM=y
182CONFIG_FLAT_NODE_MEM_MAP=y
183# CONFIG_SPARSEMEM_STATIC is not set
184CONFIG_PREEMPT_NONE=y
185# CONFIG_PREEMPT_VOLUNTARY is not set
129# CONFIG_PREEMPT is not set 186# CONFIG_PREEMPT is not set
130 187
131# 188#
@@ -134,7 +191,6 @@ CONFIG_CPU_HAS_SYNC=y
134CONFIG_HW_HAS_PCI=y 191CONFIG_HW_HAS_PCI=y
135CONFIG_PCI=y 192CONFIG_PCI=y
136CONFIG_PCI_LEGACY_PROC=y 193CONFIG_PCI_LEGACY_PROC=y
137CONFIG_PCI_NAMES=y
138CONFIG_MMU=y 194CONFIG_MMU=y
139 195
140# 196#
@@ -143,10 +199,6 @@ CONFIG_MMU=y
143# CONFIG_PCCARD is not set 199# CONFIG_PCCARD is not set
144 200
145# 201#
146# PC-card bridges
147#
148
149#
150# PCI Hotplug Support 202# PCI Hotplug Support
151# 203#
152# CONFIG_HOTPLUG_PCI is not set 204# CONFIG_HOTPLUG_PCI is not set
@@ -159,6 +211,79 @@ CONFIG_BINFMT_ELF=y
159CONFIG_TRAD_SIGNALS=y 211CONFIG_TRAD_SIGNALS=y
160 212
161# 213#
214# Networking
215#
216CONFIG_NET=y
217
218#
219# Networking options
220#
221# CONFIG_PACKET is not set
222CONFIG_UNIX=y
223CONFIG_XFRM=y
224CONFIG_XFRM_USER=m
225CONFIG_NET_KEY=y
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
231# CONFIG_IP_PNP_DHCP is not set
232# CONFIG_IP_PNP_BOOTP is not set
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
241CONFIG_INET_TUNNEL=m
242CONFIG_INET_DIAG=y
243CONFIG_INET_TCP_DIAG=y
244# CONFIG_TCP_CONG_ADVANCED is not set
245CONFIG_TCP_CONG_BIC=y
246# CONFIG_IPV6 is not set
247# CONFIG_NETFILTER is not set
248
249#
250# DCCP Configuration (EXPERIMENTAL)
251#
252# CONFIG_IP_DCCP is not set
253
254#
255# SCTP Configuration (EXPERIMENTAL)
256#
257# CONFIG_IP_SCTP is not set
258# CONFIG_ATM is not set
259# CONFIG_BRIDGE is not set
260# CONFIG_VLAN_8021Q is not set
261# CONFIG_DECNET is not set
262# CONFIG_LLC2 is not set
263# CONFIG_IPX is not set
264# CONFIG_ATALK is not set
265# CONFIG_X25 is not set
266# CONFIG_LAPB is not set
267# CONFIG_NET_DIVERT is not set
268# CONFIG_ECONET is not set
269# CONFIG_WAN_ROUTER is not set
270# CONFIG_NET_SCHED is not set
271# CONFIG_NET_CLS_ROUTE is not set
272
273#
274# Network testing
275#
276# CONFIG_NET_PKTGEN is not set
277# CONFIG_HAMRADIO is not set
278# CONFIG_IRDA is not set
279# CONFIG_BT is not set
280CONFIG_IEEE80211=m
281# CONFIG_IEEE80211_DEBUG is not set
282CONFIG_IEEE80211_CRYPT_WEP=m
283CONFIG_IEEE80211_CRYPT_CCMP=m
284CONFIG_IEEE80211_CRYPT_TKIP=m
285
286#
162# Device Drivers 287# Device Drivers
163# 288#
164 289
@@ -167,7 +292,12 @@ CONFIG_TRAD_SIGNALS=y
167# 292#
168CONFIG_STANDALONE=y 293CONFIG_STANDALONE=y
169CONFIG_PREVENT_FIRMWARE_BUILD=y 294CONFIG_PREVENT_FIRMWARE_BUILD=y
170# CONFIG_FW_LOADER is not set 295CONFIG_FW_LOADER=m
296
297#
298# Connector - unified userspace <-> kernelspace linker
299#
300CONFIG_CONNECTOR=m
171 301
172# 302#
173# Memory Technology Devices (MTD) 303# Memory Technology Devices (MTD)
@@ -186,7 +316,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
186# 316#
187# Block devices 317# Block devices
188# 318#
189# CONFIG_BLK_DEV_FD is not set
190# CONFIG_BLK_CPQ_DA is not set 319# CONFIG_BLK_CPQ_DA is not set
191# CONFIG_BLK_CPQ_CISS_DA is not set 320# CONFIG_BLK_CPQ_CISS_DA is not set
192# CONFIG_BLK_DEV_DAC960 is not set 321# CONFIG_BLK_DEV_DAC960 is not set
@@ -197,7 +326,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
197# CONFIG_BLK_DEV_SX8 is not set 326# CONFIG_BLK_DEV_SX8 is not set
198# CONFIG_BLK_DEV_RAM is not set 327# CONFIG_BLK_DEV_RAM is not set
199CONFIG_BLK_DEV_RAM_COUNT=16 328CONFIG_BLK_DEV_RAM_COUNT=16
200CONFIG_INITRAMFS_SOURCE=""
201# CONFIG_LBD is not set 329# CONFIG_LBD is not set
202CONFIG_CDROM_PKTCDVD=m 330CONFIG_CDROM_PKTCDVD=m
203CONFIG_CDROM_PKTCDVD_BUFFERS=8 331CONFIG_CDROM_PKTCDVD_BUFFERS=8
@@ -220,6 +348,7 @@ CONFIG_ATA_OVER_ETH=m
220# 348#
221# SCSI device support 349# SCSI device support
222# 350#
351CONFIG_RAID_ATTRS=m
223# CONFIG_SCSI is not set 352# CONFIG_SCSI is not set
224 353
225# 354#
@@ -230,6 +359,7 @@ CONFIG_ATA_OVER_ETH=m
230# 359#
231# Fusion MPT device support 360# Fusion MPT device support
232# 361#
362# CONFIG_FUSION is not set
233 363
234# 364#
235# IEEE 1394 (FireWire) support 365# IEEE 1394 (FireWire) support
@@ -242,77 +372,13 @@ CONFIG_ATA_OVER_ETH=m
242# CONFIG_I2O is not set 372# CONFIG_I2O is not set
243 373
244# 374#
245# Networking support 375# Network device support
246#
247CONFIG_NET=y
248
249#
250# Networking options
251#
252# CONFIG_PACKET is not set
253CONFIG_NETLINK_DEV=y
254CONFIG_UNIX=y
255CONFIG_NET_KEY=y
256CONFIG_INET=y
257# CONFIG_IP_MULTICAST is not set
258# CONFIG_IP_ADVANCED_ROUTER is not set
259CONFIG_IP_PNP=y
260# CONFIG_IP_PNP_DHCP is not set
261# CONFIG_IP_PNP_BOOTP is not set
262# CONFIG_IP_PNP_RARP is not set
263# CONFIG_NET_IPIP is not set
264# CONFIG_NET_IPGRE is not set
265# CONFIG_ARPD is not set
266# CONFIG_SYN_COOKIES is not set
267# CONFIG_INET_AH is not set
268# CONFIG_INET_ESP is not set
269# CONFIG_INET_IPCOMP is not set
270CONFIG_INET_TUNNEL=m
271CONFIG_IP_TCPDIAG=m
272# CONFIG_IP_TCPDIAG_IPV6 is not set
273# CONFIG_IPV6 is not set
274# CONFIG_NETFILTER is not set
275CONFIG_XFRM=y
276CONFIG_XFRM_USER=m
277
278#
279# SCTP Configuration (EXPERIMENTAL)
280# 376#
281# CONFIG_IP_SCTP is not set
282# CONFIG_ATM is not set
283# CONFIG_BRIDGE is not set
284# CONFIG_VLAN_8021Q is not set
285# CONFIG_DECNET is not set
286# CONFIG_LLC2 is not set
287# CONFIG_IPX is not set
288# CONFIG_ATALK is not set
289# CONFIG_X25 is not set
290# CONFIG_LAPB is not set
291# CONFIG_NET_DIVERT is not set
292# CONFIG_ECONET is not set
293# CONFIG_WAN_ROUTER is not set
294
295#
296# QoS and/or fair queueing
297#
298# CONFIG_NET_SCHED is not set
299# CONFIG_NET_CLS_ROUTE is not set
300
301#
302# Network testing
303#
304# CONFIG_NET_PKTGEN is not set
305# CONFIG_NETPOLL is not set
306# CONFIG_NET_POLL_CONTROLLER is not set
307# CONFIG_HAMRADIO is not set
308# CONFIG_IRDA is not set
309# CONFIG_BT is not set
310CONFIG_NETDEVICES=y 377CONFIG_NETDEVICES=y
311# CONFIG_DUMMY is not set 378# CONFIG_DUMMY is not set
312# CONFIG_BONDING is not set 379# CONFIG_BONDING is not set
313# CONFIG_EQUALIZER is not set 380# CONFIG_EQUALIZER is not set
314# CONFIG_TUN is not set 381# CONFIG_TUN is not set
315# CONFIG_ETHERTAP is not set
316 382
317# 383#
318# ARCnet devices 384# ARCnet devices
@@ -320,6 +386,21 @@ CONFIG_NETDEVICES=y
320# CONFIG_ARCNET is not set 386# CONFIG_ARCNET is not set
321 387
322# 388#
389# PHY device support
390#
391CONFIG_PHYLIB=m
392CONFIG_PHYCONTROL=y
393
394#
395# MII PHY device drivers
396#
397CONFIG_MARVELL_PHY=m
398CONFIG_DAVICOM_PHY=m
399CONFIG_QSEMI_PHY=m
400CONFIG_LXT_PHY=m
401CONFIG_CICADA_PHY=m
402
403#
323# Ethernet (10 or 100Mbit) 404# Ethernet (10 or 100Mbit)
324# 405#
325CONFIG_NET_ETHERNET=y 406CONFIG_NET_ETHERNET=y
@@ -345,12 +426,16 @@ CONFIG_NET_ETHERNET=y
345# CONFIG_HAMACHI is not set 426# CONFIG_HAMACHI is not set
346# CONFIG_YELLOWFIN is not set 427# CONFIG_YELLOWFIN is not set
347# CONFIG_R8169 is not set 428# CONFIG_R8169 is not set
429# CONFIG_SIS190 is not set
430# CONFIG_SKGE is not set
348# CONFIG_SK98LIN is not set 431# CONFIG_SK98LIN is not set
349# CONFIG_TIGON3 is not set 432# CONFIG_TIGON3 is not set
433# CONFIG_BNX2 is not set
350 434
351# 435#
352# Ethernet (10000 Mbit) 436# Ethernet (10000 Mbit)
353# 437#
438# CONFIG_CHELSIO_T1 is not set
354# CONFIG_IXGB is not set 439# CONFIG_IXGB is not set
355# CONFIG_S2IO is not set 440# CONFIG_S2IO is not set
356 441
@@ -363,6 +448,8 @@ CONFIG_NET_ETHERNET=y
363# Wireless LAN (non-hamradio) 448# Wireless LAN (non-hamradio)
364# 449#
365# CONFIG_NET_RADIO is not set 450# CONFIG_NET_RADIO is not set
451# CONFIG_IPW_DEBUG is not set
452CONFIG_IPW2200=m
366 453
367# 454#
368# Wan interfaces 455# Wan interfaces
@@ -381,6 +468,8 @@ CONFIG_PPP_ASYNC=y
381# CONFIG_SLIP is not set 468# CONFIG_SLIP is not set
382# CONFIG_SHAPER is not set 469# CONFIG_SHAPER is not set
383# CONFIG_NETCONSOLE is not set 470# CONFIG_NETCONSOLE is not set
471# CONFIG_NETPOLL is not set
472# CONFIG_NET_POLL_CONTROLLER is not set
384 473
385# 474#
386# ISDN subsystem 475# ISDN subsystem
@@ -410,19 +499,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
410# CONFIG_INPUT_EVBUG is not set 499# CONFIG_INPUT_EVBUG is not set
411 500
412# 501#
413# Input I/O drivers
414#
415# CONFIG_GAMEPORT is not set
416CONFIG_SOUND_GAMEPORT=y
417CONFIG_SERIO=y
418# CONFIG_SERIO_I8042 is not set
419CONFIG_SERIO_SERPORT=y
420# CONFIG_SERIO_CT82C710 is not set
421# CONFIG_SERIO_PCIPS2 is not set
422# CONFIG_SERIO_LIBPS2 is not set
423CONFIG_SERIO_RAW=m
424
425#
426# Input Device Drivers 502# Input Device Drivers
427# 503#
428# CONFIG_INPUT_KEYBOARD is not set 504# CONFIG_INPUT_KEYBOARD is not set
@@ -432,6 +508,17 @@ CONFIG_SERIO_RAW=m
432# CONFIG_INPUT_MISC is not set 508# CONFIG_INPUT_MISC is not set
433 509
434# 510#
511# Hardware I/O ports
512#
513CONFIG_SERIO=y
514# CONFIG_SERIO_I8042 is not set
515CONFIG_SERIO_SERPORT=y
516# CONFIG_SERIO_PCIPS2 is not set
517# CONFIG_SERIO_LIBPS2 is not set
518CONFIG_SERIO_RAW=m
519# CONFIG_GAMEPORT is not set
520
521#
435# Character devices 522# Character devices
436# 523#
437CONFIG_VT=y 524CONFIG_VT=y
@@ -452,6 +539,7 @@ CONFIG_SERIAL_8250_NR_UARTS=4
452# 539#
453CONFIG_SERIAL_CORE=y 540CONFIG_SERIAL_CORE=y
454CONFIG_SERIAL_CORE_CONSOLE=y 541CONFIG_SERIAL_CORE_CONSOLE=y
542# CONFIG_SERIAL_JSM is not set
455CONFIG_UNIX98_PTYS=y 543CONFIG_UNIX98_PTYS=y
456CONFIG_LEGACY_PTYS=y 544CONFIG_LEGACY_PTYS=y
457CONFIG_LEGACY_PTY_COUNT=256 545CONFIG_LEGACY_PTY_COUNT=256
@@ -478,6 +566,11 @@ CONFIG_LEGACY_PTY_COUNT=256
478# CONFIG_RAW_DRIVER is not set 566# CONFIG_RAW_DRIVER is not set
479 567
480# 568#
569# TPM devices
570#
571# CONFIG_TCG_TPM is not set
572
573#
481# I2C support 574# I2C support
482# 575#
483# CONFIG_I2C is not set 576# CONFIG_I2C is not set
@@ -488,10 +581,20 @@ CONFIG_LEGACY_PTY_COUNT=256
488# CONFIG_W1 is not set 581# CONFIG_W1 is not set
489 582
490# 583#
584# Hardware Monitoring support
585#
586# CONFIG_HWMON is not set
587# CONFIG_HWMON_VID is not set
588
589#
491# Misc devices 590# Misc devices
492# 591#
493 592
494# 593#
594# Multimedia Capabilities Port drivers
595#
596
597#
495# Multimedia devices 598# Multimedia devices
496# 599#
497# CONFIG_VIDEO_DEV is not set 600# CONFIG_VIDEO_DEV is not set
@@ -511,7 +614,6 @@ CONFIG_LEGACY_PTY_COUNT=256
511# 614#
512# CONFIG_VGA_CONSOLE is not set 615# CONFIG_VGA_CONSOLE is not set
513CONFIG_DUMMY_CONSOLE=y 616CONFIG_DUMMY_CONSOLE=y
514# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
515 617
516# 618#
517# Sound 619# Sound
@@ -521,13 +623,9 @@ CONFIG_DUMMY_CONSOLE=y
521# 623#
522# USB support 624# USB support
523# 625#
524# CONFIG_USB is not set
525CONFIG_USB_ARCH_HAS_HCD=y 626CONFIG_USB_ARCH_HAS_HCD=y
526CONFIG_USB_ARCH_HAS_OHCI=y 627CONFIG_USB_ARCH_HAS_OHCI=y
527 628# CONFIG_USB is not set
528#
529# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
530#
531 629
532# 630#
533# USB Gadget Support 631# USB Gadget Support
@@ -545,21 +643,29 @@ CONFIG_USB_ARCH_HAS_OHCI=y
545# CONFIG_INFINIBAND is not set 643# CONFIG_INFINIBAND is not set
546 644
547# 645#
646# SN Devices
647#
648
649#
548# File systems 650# File systems
549# 651#
550CONFIG_EXT2_FS=y 652CONFIG_EXT2_FS=y
551# CONFIG_EXT2_FS_XATTR is not set 653# CONFIG_EXT2_FS_XATTR is not set
654# CONFIG_EXT2_FS_XIP is not set
552# CONFIG_EXT3_FS is not set 655# CONFIG_EXT3_FS is not set
553# CONFIG_JBD is not set 656# CONFIG_JBD is not set
554# CONFIG_REISERFS_FS is not set 657# CONFIG_REISERFS_FS is not set
555# CONFIG_JFS_FS is not set 658# CONFIG_JFS_FS is not set
659# CONFIG_FS_POSIX_ACL is not set
556# CONFIG_XFS_FS is not set 660# CONFIG_XFS_FS is not set
557# CONFIG_MINIX_FS is not set 661# CONFIG_MINIX_FS is not set
558# CONFIG_ROMFS_FS is not set 662# CONFIG_ROMFS_FS is not set
663CONFIG_INOTIFY=y
559# CONFIG_QUOTA is not set 664# CONFIG_QUOTA is not set
560CONFIG_DNOTIFY=y 665CONFIG_DNOTIFY=y
561# CONFIG_AUTOFS_FS is not set 666# CONFIG_AUTOFS_FS is not set
562# CONFIG_AUTOFS4_FS is not set 667# CONFIG_AUTOFS4_FS is not set
668CONFIG_FUSE_FS=m
563 669
564# 670#
565# CD-ROM/DVD Filesystems 671# CD-ROM/DVD Filesystems
@@ -580,12 +686,10 @@ CONFIG_DNOTIFY=y
580CONFIG_PROC_FS=y 686CONFIG_PROC_FS=y
581CONFIG_PROC_KCORE=y 687CONFIG_PROC_KCORE=y
582CONFIG_SYSFS=y 688CONFIG_SYSFS=y
583# CONFIG_DEVFS_FS is not set
584CONFIG_DEVPTS_FS_XATTR=y
585CONFIG_DEVPTS_FS_SECURITY=y
586# CONFIG_TMPFS is not set 689# CONFIG_TMPFS is not set
587# CONFIG_HUGETLB_PAGE is not set 690# CONFIG_HUGETLB_PAGE is not set
588CONFIG_RAMFS=y 691CONFIG_RAMFS=y
692CONFIG_RELAYFS_FS=m
589 693
590# 694#
591# Miscellaneous filesystems 695# Miscellaneous filesystems
@@ -614,7 +718,7 @@ CONFIG_NFS_FS=y
614# CONFIG_NFSD is not set 718# CONFIG_NFSD is not set
615CONFIG_ROOT_NFS=y 719CONFIG_ROOT_NFS=y
616CONFIG_LOCKD=y 720CONFIG_LOCKD=y
617# CONFIG_EXPORTFS is not set 721CONFIG_NFS_COMMON=y
618CONFIG_SUNRPC=y 722CONFIG_SUNRPC=y
619# CONFIG_RPCSEC_GSS_KRB5 is not set 723# CONFIG_RPCSEC_GSS_KRB5 is not set
620# CONFIG_RPCSEC_GSS_SPKM3 is not set 724# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -623,6 +727,7 @@ CONFIG_SUNRPC=y
623# CONFIG_NCP_FS is not set 727# CONFIG_NCP_FS is not set
624# CONFIG_CODA_FS is not set 728# CONFIG_CODA_FS is not set
625# CONFIG_AFS_FS is not set 729# CONFIG_AFS_FS is not set
730# CONFIG_9P_FS is not set
626 731
627# 732#
628# Partition Types 733# Partition Types
@@ -643,7 +748,9 @@ CONFIG_MSDOS_PARTITION=y
643# 748#
644# Kernel hacking 749# Kernel hacking
645# 750#
751# CONFIG_PRINTK_TIME is not set
646# CONFIG_DEBUG_KERNEL is not set 752# CONFIG_DEBUG_KERNEL is not set
753CONFIG_LOG_BUF_SHIFT=14
647CONFIG_CROSSCOMPILE=y 754CONFIG_CROSSCOMPILE=y
648CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/nfs rw nfsroot=192.168.1.1:/mnt/disk2/fs.gal ip=192.168.1.211:192.168.1.1:::gt::" 755CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/nfs rw nfsroot=192.168.1.1:/mnt/disk2/fs.gal ip=192.168.1.211:192.168.1.1:::gt::"
649 756
@@ -657,7 +764,31 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
657# 764#
658# Cryptographic options 765# Cryptographic options
659# 766#
660# CONFIG_CRYPTO is not set 767CONFIG_CRYPTO=y
768CONFIG_CRYPTO_HMAC=y
769CONFIG_CRYPTO_NULL=m
770CONFIG_CRYPTO_MD4=m
771CONFIG_CRYPTO_MD5=m
772CONFIG_CRYPTO_SHA1=m
773CONFIG_CRYPTO_SHA256=m
774CONFIG_CRYPTO_SHA512=m
775CONFIG_CRYPTO_WP512=m
776CONFIG_CRYPTO_TGR192=m
777CONFIG_CRYPTO_DES=m
778CONFIG_CRYPTO_BLOWFISH=m
779CONFIG_CRYPTO_TWOFISH=m
780CONFIG_CRYPTO_SERPENT=m
781CONFIG_CRYPTO_AES=m
782CONFIG_CRYPTO_CAST5=m
783CONFIG_CRYPTO_CAST6=m
784CONFIG_CRYPTO_TEA=m
785CONFIG_CRYPTO_ARC4=m
786CONFIG_CRYPTO_KHAZAD=m
787CONFIG_CRYPTO_ANUBIS=m
788CONFIG_CRYPTO_DEFLATE=m
789CONFIG_CRYPTO_MICHAEL_MIC=m
790CONFIG_CRYPTO_CRC32C=m
791# CONFIG_CRYPTO_TEST is not set
661 792
662# 793#
663# Hardware crypto devices 794# Hardware crypto devices
@@ -667,7 +798,8 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
667# Library routines 798# Library routines
668# 799#
669CONFIG_CRC_CCITT=y 800CONFIG_CRC_CCITT=y
670# CONFIG_CRC32 is not set 801CONFIG_CRC16=m
802CONFIG_CRC32=m
671CONFIG_LIBCRC32C=m 803CONFIG_LIBCRC32C=m
672CONFIG_GENERIC_HARDIRQS=y 804CONFIG_ZLIB_INFLATE=m
673CONFIG_GENERIC_IRQ_PROBE=y 805CONFIG_ZLIB_DEFLATE=m
diff --git a/arch/mips/configs/ev96100_defconfig b/arch/mips/configs/ev96100_defconfig
index 9da4140eae00..8ac55b7acc01 100644
--- a/arch/mips/configs/ev96100_defconfig
+++ b/arch/mips/configs/ev96100_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:03 2005 4# Thu Oct 20 22:25:57 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,24 +11,29 @@ CONFIG_32BIT=y
14CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
25# CONFIG_BSD_PROCESS_ACCT is not set 24# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y 25CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set 26# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14
29# CONFIG_HOTPLUG is not set 27# CONFIG_HOTPLUG is not set
30CONFIG_KOBJECT_UEVENT=y 28CONFIG_KOBJECT_UEVENT=y
31# CONFIG_IKCONFIG is not set 29# CONFIG_IKCONFIG is not set
30CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y 31CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y 32CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_EXTRA_PASS is not set 33# CONFIG_KALLSYMS_EXTRA_PASS is not set
34CONFIG_PRINTK=y
35CONFIG_BUG=y
36CONFIG_BASE_FULL=y
35CONFIG_FUTEX=y 37CONFIG_FUTEX=y
36CONFIG_EPOLL=y 38CONFIG_EPOLL=y
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -41,6 +43,7 @@ CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0 43CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0 44CONFIG_CC_ALIGN_JUMPS=0
43# CONFIG_TINY_SHMEM is not set 45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
44 47
45# 48#
46# Loadable module support 49# Loadable module support
@@ -56,40 +59,68 @@ CONFIG_MODULE_SRCVERSION_ALL=y
56# 59#
57# Machine selection 60# Machine selection
58# 61#
59# CONFIG_MACH_JAZZ is not set 62# CONFIG_MIPS_MTX1 is not set
60# CONFIG_MACH_VR41XX is not set 63# CONFIG_MIPS_BOSPORUS is not set
61# CONFIG_TOSHIBA_JMR3927 is not set 64# CONFIG_MIPS_PB1000 is not set
65# CONFIG_MIPS_PB1100 is not set
66# CONFIG_MIPS_PB1500 is not set
67# CONFIG_MIPS_PB1550 is not set
68# CONFIG_MIPS_PB1200 is not set
69# CONFIG_MIPS_DB1000 is not set
70# CONFIG_MIPS_DB1100 is not set
71# CONFIG_MIPS_DB1500 is not set
72# CONFIG_MIPS_DB1550 is not set
73# CONFIG_MIPS_DB1200 is not set
74# CONFIG_MIPS_MIRAGE is not set
62# CONFIG_MIPS_COBALT is not set 75# CONFIG_MIPS_COBALT is not set
63# CONFIG_MACH_DECSTATION is not set 76# CONFIG_MACH_DECSTATION is not set
64# CONFIG_MIPS_EV64120 is not set 77# CONFIG_MIPS_EV64120 is not set
65CONFIG_MIPS_EV96100=y 78CONFIG_MIPS_EV96100=y
66# CONFIG_MIPS_IVR is not set 79# CONFIG_MIPS_IVR is not set
67# CONFIG_LASAT is not set
68# CONFIG_MIPS_ITE8172 is not set 80# CONFIG_MIPS_ITE8172 is not set
81# CONFIG_MACH_JAZZ is not set
82# CONFIG_LASAT is not set
69# CONFIG_MIPS_ATLAS is not set 83# CONFIG_MIPS_ATLAS is not set
70# CONFIG_MIPS_MALTA is not set 84# CONFIG_MIPS_MALTA is not set
71# CONFIG_MIPS_SEAD is not set 85# CONFIG_MIPS_SEAD is not set
86# CONFIG_MIPS_SIM is not set
87# CONFIG_MOMENCO_JAGUAR_ATX is not set
72# CONFIG_MOMENCO_OCELOT is not set 88# CONFIG_MOMENCO_OCELOT is not set
73# CONFIG_MOMENCO_OCELOT_G is not set
74# CONFIG_MOMENCO_OCELOT_C is not set
75# CONFIG_MOMENCO_OCELOT_3 is not set 89# CONFIG_MOMENCO_OCELOT_3 is not set
76# CONFIG_MOMENCO_JAGUAR_ATX is not set 90# CONFIG_MOMENCO_OCELOT_C is not set
77# CONFIG_PMC_YOSEMITE is not set 91# CONFIG_MOMENCO_OCELOT_G is not set
92# CONFIG_MIPS_XXS1500 is not set
93# CONFIG_PNX8550_V2PCI is not set
94# CONFIG_PNX8550_JBS is not set
78# CONFIG_DDB5074 is not set 95# CONFIG_DDB5074 is not set
79# CONFIG_DDB5476 is not set 96# CONFIG_DDB5476 is not set
80# CONFIG_DDB5477 is not set 97# CONFIG_DDB5477 is not set
81# CONFIG_NEC_OSPREY is not set 98# CONFIG_MACH_VR41XX is not set
99# CONFIG_PMC_YOSEMITE is not set
100# CONFIG_QEMU is not set
82# CONFIG_SGI_IP22 is not set 101# CONFIG_SGI_IP22 is not set
83# CONFIG_SOC_AU1X00 is not set 102# CONFIG_SGI_IP27 is not set
84# CONFIG_SIBYTE_SB1xxx_SOC is not set 103# CONFIG_SGI_IP32 is not set
104# CONFIG_SIBYTE_BIGSUR is not set
105# CONFIG_SIBYTE_SWARM is not set
106# CONFIG_SIBYTE_SENTOSA is not set
107# CONFIG_SIBYTE_RHONE is not set
108# CONFIG_SIBYTE_CARMEL is not set
109# CONFIG_SIBYTE_PTSWARM is not set
110# CONFIG_SIBYTE_LITTLESUR is not set
111# CONFIG_SIBYTE_CRHINE is not set
112# CONFIG_SIBYTE_CRHONE is not set
85# CONFIG_SNI_RM200_PCI is not set 113# CONFIG_SNI_RM200_PCI is not set
114# CONFIG_TOSHIBA_JMR3927 is not set
86# CONFIG_TOSHIBA_RBTX4927 is not set 115# CONFIG_TOSHIBA_RBTX4927 is not set
116# CONFIG_TOSHIBA_RBTX4938 is not set
87CONFIG_RWSEM_GENERIC_SPINLOCK=y 117CONFIG_RWSEM_GENERIC_SPINLOCK=y
88CONFIG_GENERIC_CALIBRATE_DELAY=y 118CONFIG_GENERIC_CALIBRATE_DELAY=y
89CONFIG_HAVE_DEC_LOCK=y
90CONFIG_DMA_NONCOHERENT=y 119CONFIG_DMA_NONCOHERENT=y
91CONFIG_DMA_NEED_PCI_MAP_STATE=y 120CONFIG_DMA_NEED_PCI_MAP_STATE=y
121CONFIG_CPU_BIG_ENDIAN=y
92# CONFIG_CPU_LITTLE_ENDIAN is not set 122# CONFIG_CPU_LITTLE_ENDIAN is not set
123CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
93CONFIG_IRQ_CPU=y 124CONFIG_IRQ_CPU=y
94CONFIG_MIPS_GT64120=y 125CONFIG_MIPS_GT64120=y
95CONFIG_SWAP_IO_SPACE=y 126CONFIG_SWAP_IO_SPACE=y
@@ -99,8 +130,10 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
99# 130#
100# CPU selection 131# CPU selection
101# 132#
102# CONFIG_CPU_MIPS32 is not set 133# CONFIG_CPU_MIPS32_R1 is not set
103# CONFIG_CPU_MIPS64 is not set 134# CONFIG_CPU_MIPS32_R2 is not set
135# CONFIG_CPU_MIPS64_R1 is not set
136# CONFIG_CPU_MIPS64_R2 is not set
104# CONFIG_CPU_R3000 is not set 137# CONFIG_CPU_R3000 is not set
105# CONFIG_CPU_TX39XX is not set 138# CONFIG_CPU_TX39XX is not set
106# CONFIG_CPU_VR41XX is not set 139# CONFIG_CPU_VR41XX is not set
@@ -116,6 +149,18 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
116CONFIG_CPU_RM7000=y 149CONFIG_CPU_RM7000=y
117# CONFIG_CPU_RM9000 is not set 150# CONFIG_CPU_RM9000 is not set
118# CONFIG_CPU_SB1 is not set 151# CONFIG_CPU_SB1 is not set
152CONFIG_SYS_HAS_CPU_R5000=y
153CONFIG_SYS_HAS_CPU_RM7000=y
154CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
155CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
156CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
157CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
158
159#
160# Kernel type
161#
162CONFIG_32BIT=y
163# CONFIG_64BIT is not set
119CONFIG_PAGE_SIZE_4KB=y 164CONFIG_PAGE_SIZE_4KB=y
120# CONFIG_PAGE_SIZE_8KB is not set 165# CONFIG_PAGE_SIZE_8KB is not set
121# CONFIG_PAGE_SIZE_16KB is not set 166# CONFIG_PAGE_SIZE_16KB is not set
@@ -123,11 +168,25 @@ CONFIG_PAGE_SIZE_4KB=y
123CONFIG_BOARD_SCACHE=y 168CONFIG_BOARD_SCACHE=y
124CONFIG_RM7000_CPU_SCACHE=y 169CONFIG_RM7000_CPU_SCACHE=y
125CONFIG_CPU_HAS_PREFETCH=y 170CONFIG_CPU_HAS_PREFETCH=y
171# CONFIG_MIPS_MT is not set
126# CONFIG_64BIT_PHYS_ADDR is not set 172# CONFIG_64BIT_PHYS_ADDR is not set
127# CONFIG_CPU_ADVANCED is not set 173# CONFIG_CPU_ADVANCED is not set
128CONFIG_CPU_HAS_LLSC=y 174CONFIG_CPU_HAS_LLSC=y
129CONFIG_CPU_HAS_LLDSCD=y 175CONFIG_CPU_HAS_LLDSCD=y
130CONFIG_CPU_HAS_SYNC=y 176CONFIG_CPU_HAS_SYNC=y
177CONFIG_GENERIC_HARDIRQS=y
178CONFIG_GENERIC_IRQ_PROBE=y
179CONFIG_CPU_SUPPORTS_HIGHMEM=y
180CONFIG_ARCH_FLATMEM_ENABLE=y
181CONFIG_SELECT_MEMORY_MODEL=y
182CONFIG_FLATMEM_MANUAL=y
183# CONFIG_DISCONTIGMEM_MANUAL is not set
184# CONFIG_SPARSEMEM_MANUAL is not set
185CONFIG_FLATMEM=y
186CONFIG_FLAT_NODE_MEM_MAP=y
187# CONFIG_SPARSEMEM_STATIC is not set
188CONFIG_PREEMPT_NONE=y
189# CONFIG_PREEMPT_VOLUNTARY is not set
131# CONFIG_PREEMPT is not set 190# CONFIG_PREEMPT is not set
132 191
133# 192#
@@ -143,10 +202,6 @@ CONFIG_MMU=y
143# CONFIG_PCCARD is not set 202# CONFIG_PCCARD is not set
144 203
145# 204#
146# PC-card bridges
147#
148
149#
150# PCI Hotplug Support 205# PCI Hotplug Support
151# 206#
152 207
@@ -158,6 +213,79 @@ CONFIG_BINFMT_ELF=y
158CONFIG_TRAD_SIGNALS=y 213CONFIG_TRAD_SIGNALS=y
159 214
160# 215#
216# Networking
217#
218CONFIG_NET=y
219
220#
221# Networking options
222#
223# CONFIG_PACKET is not set
224CONFIG_UNIX=y
225CONFIG_XFRM=y
226CONFIG_XFRM_USER=m
227CONFIG_NET_KEY=y
228CONFIG_INET=y
229# CONFIG_IP_MULTICAST is not set
230# CONFIG_IP_ADVANCED_ROUTER is not set
231CONFIG_IP_FIB_HASH=y
232CONFIG_IP_PNP=y
233# CONFIG_IP_PNP_DHCP is not set
234CONFIG_IP_PNP_BOOTP=y
235# CONFIG_IP_PNP_RARP is not set
236# CONFIG_NET_IPIP is not set
237# CONFIG_NET_IPGRE is not set
238# CONFIG_ARPD is not set
239# CONFIG_SYN_COOKIES is not set
240# CONFIG_INET_AH is not set
241# CONFIG_INET_ESP is not set
242# CONFIG_INET_IPCOMP is not set
243CONFIG_INET_TUNNEL=m
244CONFIG_INET_DIAG=y
245CONFIG_INET_TCP_DIAG=y
246# CONFIG_TCP_CONG_ADVANCED is not set
247CONFIG_TCP_CONG_BIC=y
248# CONFIG_IPV6 is not set
249# CONFIG_NETFILTER is not set
250
251#
252# DCCP Configuration (EXPERIMENTAL)
253#
254# CONFIG_IP_DCCP is not set
255
256#
257# SCTP Configuration (EXPERIMENTAL)
258#
259# CONFIG_IP_SCTP 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_NET_DIVERT is not set
270# CONFIG_ECONET is not set
271# CONFIG_WAN_ROUTER is not set
272# CONFIG_NET_SCHED is not set
273# CONFIG_NET_CLS_ROUTE is not set
274
275#
276# Network testing
277#
278# CONFIG_NET_PKTGEN is not set
279# CONFIG_HAMRADIO is not set
280# CONFIG_IRDA is not set
281# CONFIG_BT is not set
282CONFIG_IEEE80211=m
283# CONFIG_IEEE80211_DEBUG is not set
284CONFIG_IEEE80211_CRYPT_WEP=m
285CONFIG_IEEE80211_CRYPT_CCMP=m
286CONFIG_IEEE80211_CRYPT_TKIP=m
287
288#
161# Device Drivers 289# Device Drivers
162# 290#
163 291
@@ -169,6 +297,11 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
169# CONFIG_FW_LOADER is not set 297# CONFIG_FW_LOADER is not set
170 298
171# 299#
300# Connector - unified userspace <-> kernelspace linker
301#
302CONFIG_CONNECTOR=m
303
304#
172# Memory Technology Devices (MTD) 305# Memory Technology Devices (MTD)
173# 306#
174# CONFIG_MTD is not set 307# CONFIG_MTD is not set
@@ -185,13 +318,11 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
185# 318#
186# Block devices 319# Block devices
187# 320#
188# CONFIG_BLK_DEV_FD is not set
189# CONFIG_BLK_DEV_COW_COMMON is not set 321# CONFIG_BLK_DEV_COW_COMMON is not set
190# CONFIG_BLK_DEV_LOOP is not set 322# CONFIG_BLK_DEV_LOOP is not set
191# CONFIG_BLK_DEV_NBD is not set 323# CONFIG_BLK_DEV_NBD is not set
192# CONFIG_BLK_DEV_RAM is not set 324# CONFIG_BLK_DEV_RAM is not set
193CONFIG_BLK_DEV_RAM_COUNT=16 325CONFIG_BLK_DEV_RAM_COUNT=16
194CONFIG_INITRAMFS_SOURCE=""
195# CONFIG_LBD is not set 326# CONFIG_LBD is not set
196CONFIG_CDROM_PKTCDVD=m 327CONFIG_CDROM_PKTCDVD=m
197CONFIG_CDROM_PKTCDVD_BUFFERS=8 328CONFIG_CDROM_PKTCDVD_BUFFERS=8
@@ -214,6 +345,7 @@ CONFIG_ATA_OVER_ETH=m
214# 345#
215# SCSI device support 346# SCSI device support
216# 347#
348CONFIG_RAID_ATTRS=m
217# CONFIG_SCSI is not set 349# CONFIG_SCSI is not set
218 350
219# 351#
@@ -224,6 +356,7 @@ CONFIG_ATA_OVER_ETH=m
224# 356#
225# Fusion MPT device support 357# Fusion MPT device support
226# 358#
359# CONFIG_FUSION is not set
227 360
228# 361#
229# IEEE 1394 (FireWire) support 362# IEEE 1394 (FireWire) support
@@ -234,77 +367,28 @@ CONFIG_ATA_OVER_ETH=m
234# 367#
235 368
236# 369#
237# Networking support 370# Network device support
238#
239CONFIG_NET=y
240
241#
242# Networking options
243# 371#
244# CONFIG_PACKET is not set 372CONFIG_NETDEVICES=y
245CONFIG_NETLINK_DEV=y 373# CONFIG_DUMMY is not set
246CONFIG_UNIX=y 374# CONFIG_BONDING is not set
247CONFIG_NET_KEY=y 375# CONFIG_EQUALIZER is not set
248CONFIG_INET=y 376# CONFIG_TUN is not set
249# CONFIG_IP_MULTICAST is not set
250# CONFIG_IP_ADVANCED_ROUTER is not set
251CONFIG_IP_PNP=y
252# CONFIG_IP_PNP_DHCP is not set
253CONFIG_IP_PNP_BOOTP=y
254# CONFIG_IP_PNP_RARP is not set
255# CONFIG_NET_IPIP is not set
256# CONFIG_NET_IPGRE is not set
257# CONFIG_ARPD is not set
258# CONFIG_SYN_COOKIES is not set
259# CONFIG_INET_AH is not set
260# CONFIG_INET_ESP is not set
261# CONFIG_INET_IPCOMP is not set
262CONFIG_INET_TUNNEL=m
263CONFIG_IP_TCPDIAG=m
264# CONFIG_IP_TCPDIAG_IPV6 is not set
265# CONFIG_IPV6 is not set
266# CONFIG_NETFILTER is not set
267CONFIG_XFRM=y
268CONFIG_XFRM_USER=m
269
270#
271# SCTP Configuration (EXPERIMENTAL)
272#
273# CONFIG_IP_SCTP is not set
274# CONFIG_ATM is not set
275# CONFIG_BRIDGE is not set
276# CONFIG_VLAN_8021Q is not set
277# CONFIG_DECNET is not set
278# CONFIG_LLC2 is not set
279# CONFIG_IPX is not set
280# CONFIG_ATALK is not set
281# CONFIG_X25 is not set
282# CONFIG_LAPB is not set
283# CONFIG_NET_DIVERT is not set
284# CONFIG_ECONET is not set
285# CONFIG_WAN_ROUTER is not set
286 377
287# 378#
288# QoS and/or fair queueing 379# PHY device support
289# 380#
290# CONFIG_NET_SCHED is not set 381CONFIG_PHYLIB=m
291# CONFIG_NET_CLS_ROUTE is not set 382CONFIG_PHYCONTROL=y
292 383
293# 384#
294# Network testing 385# MII PHY device drivers
295# 386#
296# CONFIG_NET_PKTGEN is not set 387CONFIG_MARVELL_PHY=m
297# CONFIG_NETPOLL is not set 388CONFIG_DAVICOM_PHY=m
298# CONFIG_NET_POLL_CONTROLLER is not set 389CONFIG_QSEMI_PHY=m
299# CONFIG_HAMRADIO is not set 390CONFIG_LXT_PHY=m
300# CONFIG_IRDA is not set 391CONFIG_CICADA_PHY=m
301# CONFIG_BT is not set
302CONFIG_NETDEVICES=y
303# CONFIG_DUMMY is not set
304# CONFIG_BONDING is not set
305# CONFIG_EQUALIZER is not set
306# CONFIG_TUN is not set
307# CONFIG_ETHERTAP is not set
308 392
309# 393#
310# Ethernet (10 or 100Mbit) 394# Ethernet (10 or 100Mbit)
@@ -338,6 +422,8 @@ CONFIG_MIPS_GT96100ETH=y
338# CONFIG_SLIP is not set 422# CONFIG_SLIP is not set
339# CONFIG_SHAPER is not set 423# CONFIG_SHAPER is not set
340# CONFIG_NETCONSOLE is not set 424# CONFIG_NETCONSOLE is not set
425# CONFIG_NETPOLL is not set
426# CONFIG_NET_POLL_CONTROLLER is not set
341 427
342# 428#
343# ISDN subsystem 429# ISDN subsystem
@@ -367,18 +453,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
367# CONFIG_INPUT_EVBUG is not set 453# CONFIG_INPUT_EVBUG is not set
368 454
369# 455#
370# Input I/O drivers
371#
372# CONFIG_GAMEPORT is not set
373CONFIG_SOUND_GAMEPORT=y
374CONFIG_SERIO=y
375# CONFIG_SERIO_I8042 is not set
376CONFIG_SERIO_SERPORT=y
377# CONFIG_SERIO_CT82C710 is not set
378# CONFIG_SERIO_LIBPS2 is not set
379CONFIG_SERIO_RAW=m
380
381#
382# Input Device Drivers 456# Input Device Drivers
383# 457#
384# CONFIG_INPUT_KEYBOARD is not set 458# CONFIG_INPUT_KEYBOARD is not set
@@ -388,6 +462,16 @@ CONFIG_SERIO_RAW=m
388# CONFIG_INPUT_MISC is not set 462# CONFIG_INPUT_MISC is not set
389 463
390# 464#
465# Hardware I/O ports
466#
467CONFIG_SERIO=y
468# CONFIG_SERIO_I8042 is not set
469CONFIG_SERIO_SERPORT=y
470# CONFIG_SERIO_LIBPS2 is not set
471CONFIG_SERIO_RAW=m
472# CONFIG_GAMEPORT is not set
473
474#
391# Character devices 475# Character devices
392# 476#
393CONFIG_VT=y 477CONFIG_VT=y
@@ -429,10 +513,13 @@ CONFIG_LEGACY_PTY_COUNT=256
429# 513#
430# Ftape, the floppy tape device driver 514# Ftape, the floppy tape device driver
431# 515#
432# CONFIG_DRM is not set
433# CONFIG_RAW_DRIVER is not set 516# CONFIG_RAW_DRIVER is not set
434 517
435# 518#
519# TPM devices
520#
521
522#
436# I2C support 523# I2C support
437# 524#
438# CONFIG_I2C is not set 525# CONFIG_I2C is not set
@@ -443,10 +530,20 @@ CONFIG_LEGACY_PTY_COUNT=256
443# CONFIG_W1 is not set 530# CONFIG_W1 is not set
444 531
445# 532#
533# Hardware Monitoring support
534#
535# CONFIG_HWMON is not set
536# CONFIG_HWMON_VID is not set
537
538#
446# Misc devices 539# Misc devices
447# 540#
448 541
449# 542#
543# Multimedia Capabilities Port drivers
544#
545
546#
450# Multimedia devices 547# Multimedia devices
451# 548#
452# CONFIG_VIDEO_DEV is not set 549# CONFIG_VIDEO_DEV is not set
@@ -466,7 +563,6 @@ CONFIG_LEGACY_PTY_COUNT=256
466# 563#
467# CONFIG_VGA_CONSOLE is not set 564# CONFIG_VGA_CONSOLE is not set
468CONFIG_DUMMY_CONSOLE=y 565CONFIG_DUMMY_CONSOLE=y
469# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
470 566
471# 567#
472# Sound 568# Sound
@@ -480,10 +576,6 @@ CONFIG_DUMMY_CONSOLE=y
480# CONFIG_USB_ARCH_HAS_OHCI is not set 576# CONFIG_USB_ARCH_HAS_OHCI is not set
481 577
482# 578#
483# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
484#
485
486#
487# USB Gadget Support 579# USB Gadget Support
488# 580#
489# CONFIG_USB_GADGET is not set 581# CONFIG_USB_GADGET is not set
@@ -496,24 +588,31 @@ CONFIG_DUMMY_CONSOLE=y
496# 588#
497# InfiniBand support 589# InfiniBand support
498# 590#
499# CONFIG_INFINIBAND is not set 591
592#
593# SN Devices
594#
500 595
501# 596#
502# File systems 597# File systems
503# 598#
504CONFIG_EXT2_FS=y 599CONFIG_EXT2_FS=y
505# CONFIG_EXT2_FS_XATTR is not set 600# CONFIG_EXT2_FS_XATTR is not set
601# CONFIG_EXT2_FS_XIP is not set
506# CONFIG_EXT3_FS is not set 602# CONFIG_EXT3_FS is not set
507# CONFIG_JBD is not set 603# CONFIG_JBD is not set
508# CONFIG_REISERFS_FS is not set 604# CONFIG_REISERFS_FS is not set
509# CONFIG_JFS_FS is not set 605# CONFIG_JFS_FS is not set
606# CONFIG_FS_POSIX_ACL is not set
510# CONFIG_XFS_FS is not set 607# CONFIG_XFS_FS is not set
511# CONFIG_MINIX_FS is not set 608# CONFIG_MINIX_FS is not set
512# CONFIG_ROMFS_FS is not set 609# CONFIG_ROMFS_FS is not set
610CONFIG_INOTIFY=y
513# CONFIG_QUOTA is not set 611# CONFIG_QUOTA is not set
514CONFIG_DNOTIFY=y 612CONFIG_DNOTIFY=y
515# CONFIG_AUTOFS_FS is not set 613# CONFIG_AUTOFS_FS is not set
516# CONFIG_AUTOFS4_FS is not set 614# CONFIG_AUTOFS4_FS is not set
615CONFIG_FUSE_FS=m
517 616
518# 617#
519# CD-ROM/DVD Filesystems 618# CD-ROM/DVD Filesystems
@@ -534,12 +633,10 @@ CONFIG_DNOTIFY=y
534CONFIG_PROC_FS=y 633CONFIG_PROC_FS=y
535CONFIG_PROC_KCORE=y 634CONFIG_PROC_KCORE=y
536CONFIG_SYSFS=y 635CONFIG_SYSFS=y
537# CONFIG_DEVFS_FS is not set
538CONFIG_DEVPTS_FS_XATTR=y
539CONFIG_DEVPTS_FS_SECURITY=y
540# CONFIG_TMPFS is not set 636# CONFIG_TMPFS is not set
541# CONFIG_HUGETLB_PAGE is not set 637# CONFIG_HUGETLB_PAGE is not set
542CONFIG_RAMFS=y 638CONFIG_RAMFS=y
639CONFIG_RELAYFS_FS=m
543 640
544# 641#
545# Miscellaneous filesystems 642# Miscellaneous filesystems
@@ -568,7 +665,7 @@ CONFIG_NFS_FS=y
568# CONFIG_NFSD is not set 665# CONFIG_NFSD is not set
569CONFIG_ROOT_NFS=y 666CONFIG_ROOT_NFS=y
570CONFIG_LOCKD=y 667CONFIG_LOCKD=y
571# CONFIG_EXPORTFS is not set 668CONFIG_NFS_COMMON=y
572CONFIG_SUNRPC=y 669CONFIG_SUNRPC=y
573# CONFIG_RPCSEC_GSS_KRB5 is not set 670# CONFIG_RPCSEC_GSS_KRB5 is not set
574# CONFIG_RPCSEC_GSS_SPKM3 is not set 671# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -577,6 +674,7 @@ CONFIG_SUNRPC=y
577# CONFIG_NCP_FS is not set 674# CONFIG_NCP_FS is not set
578# CONFIG_CODA_FS is not set 675# CONFIG_CODA_FS is not set
579# CONFIG_AFS_FS is not set 676# CONFIG_AFS_FS is not set
677# CONFIG_9P_FS is not set
580 678
581# 679#
582# Partition Types 680# Partition Types
@@ -597,7 +695,9 @@ CONFIG_MSDOS_PARTITION=y
597# 695#
598# Kernel hacking 696# Kernel hacking
599# 697#
698# CONFIG_PRINTK_TIME is not set
600# CONFIG_DEBUG_KERNEL is not set 699# CONFIG_DEBUG_KERNEL is not set
700CONFIG_LOG_BUF_SHIFT=14
601CONFIG_CROSSCOMPILE=y 701CONFIG_CROSSCOMPILE=y
602CONFIG_CMDLINE="" 702CONFIG_CMDLINE=""
603 703
@@ -611,7 +711,31 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
611# 711#
612# Cryptographic options 712# Cryptographic options
613# 713#
614# CONFIG_CRYPTO is not set 714CONFIG_CRYPTO=y
715CONFIG_CRYPTO_HMAC=y
716CONFIG_CRYPTO_NULL=m
717CONFIG_CRYPTO_MD4=m
718CONFIG_CRYPTO_MD5=m
719CONFIG_CRYPTO_SHA1=m
720CONFIG_CRYPTO_SHA256=m
721CONFIG_CRYPTO_SHA512=m
722CONFIG_CRYPTO_WP512=m
723CONFIG_CRYPTO_TGR192=m
724CONFIG_CRYPTO_DES=m
725CONFIG_CRYPTO_BLOWFISH=m
726CONFIG_CRYPTO_TWOFISH=m
727CONFIG_CRYPTO_SERPENT=m
728CONFIG_CRYPTO_AES=m
729CONFIG_CRYPTO_CAST5=m
730CONFIG_CRYPTO_CAST6=m
731CONFIG_CRYPTO_TEA=m
732CONFIG_CRYPTO_ARC4=m
733CONFIG_CRYPTO_KHAZAD=m
734CONFIG_CRYPTO_ANUBIS=m
735CONFIG_CRYPTO_DEFLATE=m
736CONFIG_CRYPTO_MICHAEL_MIC=m
737CONFIG_CRYPTO_CRC32C=m
738# CONFIG_CRYPTO_TEST is not set
615 739
616# 740#
617# Hardware crypto devices 741# Hardware crypto devices
@@ -621,7 +745,8 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
621# Library routines 745# Library routines
622# 746#
623# CONFIG_CRC_CCITT is not set 747# CONFIG_CRC_CCITT is not set
624# CONFIG_CRC32 is not set 748CONFIG_CRC16=m
749CONFIG_CRC32=m
625CONFIG_LIBCRC32C=m 750CONFIG_LIBCRC32C=m
626CONFIG_GENERIC_HARDIRQS=y 751CONFIG_ZLIB_INFLATE=m
627CONFIG_GENERIC_IRQ_PROBE=y 752CONFIG_ZLIB_DEFLATE=m
diff --git a/arch/mips/configs/ip22_defconfig b/arch/mips/configs/ip22_defconfig
index 17fa5c4e3ad1..3ae3838f283c 100644
--- a/arch/mips/configs/ip22_defconfig
+++ b/arch/mips/configs/ip22_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:04 2005 4# Thu Oct 20 22:26:01 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,25 +11,30 @@ CONFIG_32BIT=y
14CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
25# CONFIG_BSD_PROCESS_ACCT is not set 24# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y 25CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set 26# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14
29# CONFIG_HOTPLUG is not set 27# CONFIG_HOTPLUG is not set
30CONFIG_KOBJECT_UEVENT=y 28CONFIG_KOBJECT_UEVENT=y
31CONFIG_IKCONFIG=y 29CONFIG_IKCONFIG=y
32CONFIG_IKCONFIG_PROC=y 30CONFIG_IKCONFIG_PROC=y
31CONFIG_INITRAMFS_SOURCE=""
33CONFIG_EMBEDDED=y 32CONFIG_EMBEDDED=y
34CONFIG_KALLSYMS=y 33CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_EXTRA_PASS is not set 34# CONFIG_KALLSYMS_EXTRA_PASS is not set
35CONFIG_PRINTK=y
36CONFIG_BUG=y
37CONFIG_BASE_FULL=y
36CONFIG_FUTEX=y 38CONFIG_FUTEX=y
37CONFIG_EPOLL=y 39CONFIG_EPOLL=y
38# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 40# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -42,6 +44,7 @@ CONFIG_CC_ALIGN_LABELS=0
42CONFIG_CC_ALIGN_LOOPS=0 44CONFIG_CC_ALIGN_LOOPS=0
43CONFIG_CC_ALIGN_JUMPS=0 45CONFIG_CC_ALIGN_JUMPS=0
44# CONFIG_TINY_SHMEM is not set 46# CONFIG_TINY_SHMEM is not set
47CONFIG_BASE_SMALL=0
45 48
46# 49#
47# Loadable module support 50# Loadable module support
@@ -57,41 +60,69 @@ CONFIG_KMOD=y
57# 60#
58# Machine selection 61# Machine selection
59# 62#
60# CONFIG_MACH_JAZZ is not set 63# CONFIG_MIPS_MTX1 is not set
61# CONFIG_MACH_VR41XX is not set 64# CONFIG_MIPS_BOSPORUS is not set
62# CONFIG_TOSHIBA_JMR3927 is not set 65# CONFIG_MIPS_PB1000 is not set
66# CONFIG_MIPS_PB1100 is not set
67# CONFIG_MIPS_PB1500 is not set
68# CONFIG_MIPS_PB1550 is not set
69# CONFIG_MIPS_PB1200 is not set
70# CONFIG_MIPS_DB1000 is not set
71# CONFIG_MIPS_DB1100 is not set
72# CONFIG_MIPS_DB1500 is not set
73# CONFIG_MIPS_DB1550 is not set
74# CONFIG_MIPS_DB1200 is not set
75# CONFIG_MIPS_MIRAGE is not set
63# CONFIG_MIPS_COBALT is not set 76# CONFIG_MIPS_COBALT is not set
64# CONFIG_MACH_DECSTATION is not set 77# CONFIG_MACH_DECSTATION is not set
65# CONFIG_MIPS_EV64120 is not set 78# CONFIG_MIPS_EV64120 is not set
66# CONFIG_MIPS_EV96100 is not set 79# CONFIG_MIPS_EV96100 is not set
67# CONFIG_MIPS_IVR is not set 80# CONFIG_MIPS_IVR is not set
68# CONFIG_LASAT is not set
69# CONFIG_MIPS_ITE8172 is not set 81# CONFIG_MIPS_ITE8172 is not set
82# CONFIG_MACH_JAZZ is not set
83# CONFIG_LASAT is not set
70# CONFIG_MIPS_ATLAS is not set 84# CONFIG_MIPS_ATLAS is not set
71# CONFIG_MIPS_MALTA is not set 85# CONFIG_MIPS_MALTA is not set
72# CONFIG_MIPS_SEAD is not set 86# CONFIG_MIPS_SEAD is not set
87# CONFIG_MIPS_SIM is not set
88# CONFIG_MOMENCO_JAGUAR_ATX is not set
73# CONFIG_MOMENCO_OCELOT is not set 89# CONFIG_MOMENCO_OCELOT is not set
74# CONFIG_MOMENCO_OCELOT_G is not set
75# CONFIG_MOMENCO_OCELOT_C is not set
76# CONFIG_MOMENCO_OCELOT_3 is not set 90# CONFIG_MOMENCO_OCELOT_3 is not set
77# CONFIG_MOMENCO_JAGUAR_ATX is not set 91# CONFIG_MOMENCO_OCELOT_C is not set
78# CONFIG_PMC_YOSEMITE is not set 92# CONFIG_MOMENCO_OCELOT_G is not set
93# CONFIG_MIPS_XXS1500 is not set
94# CONFIG_PNX8550_V2PCI is not set
95# CONFIG_PNX8550_JBS is not set
79# CONFIG_DDB5074 is not set 96# CONFIG_DDB5074 is not set
80# CONFIG_DDB5476 is not set 97# CONFIG_DDB5476 is not set
81# CONFIG_DDB5477 is not set 98# CONFIG_DDB5477 is not set
82# CONFIG_NEC_OSPREY is not set 99# CONFIG_MACH_VR41XX is not set
100# CONFIG_PMC_YOSEMITE is not set
101# CONFIG_QEMU is not set
83CONFIG_SGI_IP22=y 102CONFIG_SGI_IP22=y
84# CONFIG_SOC_AU1X00 is not set 103# CONFIG_SGI_IP27 is not set
85# CONFIG_SIBYTE_SB1xxx_SOC is not set 104# CONFIG_SGI_IP32 is not set
105# CONFIG_SIBYTE_BIGSUR is not set
106# CONFIG_SIBYTE_SWARM is not set
107# CONFIG_SIBYTE_SENTOSA is not set
108# CONFIG_SIBYTE_RHONE is not set
109# CONFIG_SIBYTE_CARMEL is not set
110# CONFIG_SIBYTE_PTSWARM is not set
111# CONFIG_SIBYTE_LITTLESUR is not set
112# CONFIG_SIBYTE_CRHINE is not set
113# CONFIG_SIBYTE_CRHONE is not set
86# CONFIG_SNI_RM200_PCI is not set 114# CONFIG_SNI_RM200_PCI is not set
115# CONFIG_TOSHIBA_JMR3927 is not set
87# CONFIG_TOSHIBA_RBTX4927 is not set 116# CONFIG_TOSHIBA_RBTX4927 is not set
117# CONFIG_TOSHIBA_RBTX4938 is not set
88CONFIG_RWSEM_GENERIC_SPINLOCK=y 118CONFIG_RWSEM_GENERIC_SPINLOCK=y
89CONFIG_GENERIC_CALIBRATE_DELAY=y 119CONFIG_GENERIC_CALIBRATE_DELAY=y
90CONFIG_HAVE_DEC_LOCK=y
91CONFIG_ARC=y 120CONFIG_ARC=y
92CONFIG_DMA_NONCOHERENT=y 121CONFIG_DMA_NONCOHERENT=y
93CONFIG_DMA_NEED_PCI_MAP_STATE=y 122CONFIG_DMA_NEED_PCI_MAP_STATE=y
123CONFIG_CPU_BIG_ENDIAN=y
94# CONFIG_CPU_LITTLE_ENDIAN is not set 124# CONFIG_CPU_LITTLE_ENDIAN is not set
125CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
95CONFIG_IRQ_CPU=y 126CONFIG_IRQ_CPU=y
96CONFIG_SWAP_IO_SPACE=y 127CONFIG_SWAP_IO_SPACE=y
97CONFIG_ARC32=y 128CONFIG_ARC32=y
@@ -103,8 +134,10 @@ CONFIG_ARC_PROMLIB=y
103# 134#
104# CPU selection 135# CPU selection
105# 136#
106# CONFIG_CPU_MIPS32 is not set 137# CONFIG_CPU_MIPS32_R1 is not set
107# CONFIG_CPU_MIPS64 is not set 138# CONFIG_CPU_MIPS32_R2 is not set
139# CONFIG_CPU_MIPS64_R1 is not set
140# CONFIG_CPU_MIPS64_R2 is not set
108# CONFIG_CPU_R3000 is not set 141# CONFIG_CPU_R3000 is not set
109# CONFIG_CPU_TX39XX is not set 142# CONFIG_CPU_TX39XX is not set
110# CONFIG_CPU_VR41XX is not set 143# CONFIG_CPU_VR41XX is not set
@@ -120,22 +153,48 @@ CONFIG_CPU_R5000=y
120# CONFIG_CPU_RM7000 is not set 153# CONFIG_CPU_RM7000 is not set
121# CONFIG_CPU_RM9000 is not set 154# CONFIG_CPU_RM9000 is not set
122# CONFIG_CPU_SB1 is not set 155# CONFIG_CPU_SB1 is not set
156CONFIG_SYS_HAS_CPU_R4X00=y
157CONFIG_SYS_HAS_CPU_R5000=y
158CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
159CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
160CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
161CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
162
163#
164# Kernel type
165#
166CONFIG_32BIT=y
167# CONFIG_64BIT is not set
123CONFIG_PAGE_SIZE_4KB=y 168CONFIG_PAGE_SIZE_4KB=y
124# CONFIG_PAGE_SIZE_8KB is not set 169# CONFIG_PAGE_SIZE_8KB is not set
125# CONFIG_PAGE_SIZE_16KB is not set 170# CONFIG_PAGE_SIZE_16KB is not set
126# CONFIG_PAGE_SIZE_64KB is not set 171# CONFIG_PAGE_SIZE_64KB is not set
127CONFIG_BOARD_SCACHE=y 172CONFIG_BOARD_SCACHE=y
128CONFIG_IP22_CPU_SCACHE=y 173CONFIG_IP22_CPU_SCACHE=y
174# CONFIG_MIPS_MT is not set
129# CONFIG_64BIT_PHYS_ADDR is not set 175# CONFIG_64BIT_PHYS_ADDR is not set
130# CONFIG_CPU_ADVANCED is not set 176# CONFIG_CPU_ADVANCED is not set
131CONFIG_CPU_HAS_LLSC=y 177CONFIG_CPU_HAS_LLSC=y
132CONFIG_CPU_HAS_LLDSCD=y 178CONFIG_CPU_HAS_LLDSCD=y
133CONFIG_CPU_HAS_SYNC=y 179CONFIG_CPU_HAS_SYNC=y
180CONFIG_GENERIC_HARDIRQS=y
181CONFIG_GENERIC_IRQ_PROBE=y
182CONFIG_ARCH_FLATMEM_ENABLE=y
183CONFIG_SELECT_MEMORY_MODEL=y
184CONFIG_FLATMEM_MANUAL=y
185# CONFIG_DISCONTIGMEM_MANUAL is not set
186# CONFIG_SPARSEMEM_MANUAL is not set
187CONFIG_FLATMEM=y
188CONFIG_FLAT_NODE_MEM_MAP=y
189# CONFIG_SPARSEMEM_STATIC is not set
190# CONFIG_PREEMPT_NONE is not set
191CONFIG_PREEMPT_VOLUNTARY=y
134# CONFIG_PREEMPT is not set 192# CONFIG_PREEMPT is not set
135 193
136# 194#
137# Bus options (PCI, PCMCIA, EISA, ISA, TC) 195# Bus options (PCI, PCMCIA, EISA, ISA, TC)
138# 196#
197CONFIG_HW_HAS_EISA=y
139# CONFIG_EISA is not set 198# CONFIG_EISA is not set
140CONFIG_MMU=y 199CONFIG_MMU=y
141 200
@@ -145,10 +204,6 @@ CONFIG_MMU=y
145# CONFIG_PCCARD is not set 204# CONFIG_PCCARD is not set
146 205
147# 206#
148# PC-card bridges
149#
150
151#
152# PCI Hotplug Support 207# PCI Hotplug Support
153# 208#
154 209
@@ -160,115 +215,7 @@ CONFIG_BINFMT_MISC=m
160CONFIG_TRAD_SIGNALS=y 215CONFIG_TRAD_SIGNALS=y
161 216
162# 217#
163# Device Drivers 218# Networking
164#
165
166#
167# Generic Driver Options
168#
169CONFIG_STANDALONE=y
170CONFIG_PREVENT_FIRMWARE_BUILD=y
171# CONFIG_FW_LOADER is not set
172
173#
174# Memory Technology Devices (MTD)
175#
176# CONFIG_MTD is not set
177
178#
179# Parallel port support
180#
181# CONFIG_PARPORT is not set
182
183#
184# Plug and Play support
185#
186
187#
188# Block devices
189#
190# CONFIG_BLK_DEV_FD is not set
191# CONFIG_BLK_DEV_COW_COMMON is not set
192# CONFIG_BLK_DEV_LOOP is not set
193# CONFIG_BLK_DEV_NBD is not set
194# CONFIG_BLK_DEV_RAM is not set
195CONFIG_BLK_DEV_RAM_COUNT=16
196CONFIG_INITRAMFS_SOURCE=""
197# CONFIG_LBD is not set
198CONFIG_CDROM_PKTCDVD=m
199CONFIG_CDROM_PKTCDVD_BUFFERS=8
200# CONFIG_CDROM_PKTCDVD_WCACHE is not set
201
202#
203# IO Schedulers
204#
205CONFIG_IOSCHED_NOOP=y
206CONFIG_IOSCHED_AS=y
207CONFIG_IOSCHED_DEADLINE=y
208CONFIG_IOSCHED_CFQ=y
209CONFIG_ATA_OVER_ETH=m
210
211#
212# ATA/ATAPI/MFM/RLL support
213#
214# CONFIG_IDE is not set
215
216#
217# SCSI device support
218#
219CONFIG_SCSI=y
220CONFIG_SCSI_PROC_FS=y
221
222#
223# SCSI support type (disk, tape, CD-ROM)
224#
225CONFIG_BLK_DEV_SD=y
226CONFIG_CHR_DEV_ST=y
227# CONFIG_CHR_DEV_OSST is not set
228CONFIG_BLK_DEV_SR=y
229# CONFIG_BLK_DEV_SR_VENDOR is not set
230# CONFIG_CHR_DEV_SG is not set
231
232#
233# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
234#
235# CONFIG_SCSI_MULTI_LUN is not set
236CONFIG_SCSI_CONSTANTS=y
237# CONFIG_SCSI_LOGGING is not set
238
239#
240# SCSI Transport Attributes
241#
242CONFIG_SCSI_SPI_ATTRS=m
243# CONFIG_SCSI_FC_ATTRS is not set
244# CONFIG_SCSI_ISCSI_ATTRS is not set
245
246#
247# SCSI low-level drivers
248#
249CONFIG_SGIWD93_SCSI=y
250# CONFIG_SCSI_SATA is not set
251# CONFIG_SCSI_DEBUG is not set
252
253#
254# Multi-device support (RAID and LVM)
255#
256# CONFIG_MD is not set
257
258#
259# Fusion MPT device support
260#
261
262#
263# IEEE 1394 (FireWire) support
264#
265
266#
267# I2O device support
268#
269
270#
271# Networking support
272# 219#
273CONFIG_NET=y 220CONFIG_NET=y
274 221
@@ -277,12 +224,14 @@ CONFIG_NET=y
277# 224#
278CONFIG_PACKET=y 225CONFIG_PACKET=y
279CONFIG_PACKET_MMAP=y 226CONFIG_PACKET_MMAP=y
280CONFIG_NETLINK_DEV=y
281CONFIG_UNIX=y 227CONFIG_UNIX=y
228CONFIG_XFRM=y
229CONFIG_XFRM_USER=m
282CONFIG_NET_KEY=y 230CONFIG_NET_KEY=y
283CONFIG_INET=y 231CONFIG_INET=y
284CONFIG_IP_MULTICAST=y 232CONFIG_IP_MULTICAST=y
285# CONFIG_IP_ADVANCED_ROUTER is not set 233# CONFIG_IP_ADVANCED_ROUTER is not set
234CONFIG_IP_FIB_HASH=y
286CONFIG_IP_PNP=y 235CONFIG_IP_PNP=y
287# CONFIG_IP_PNP_DHCP is not set 236# CONFIG_IP_PNP_DHCP is not set
288CONFIG_IP_PNP_BOOTP=y 237CONFIG_IP_PNP_BOOTP=y
@@ -296,8 +245,10 @@ CONFIG_INET_AH=m
296CONFIG_INET_ESP=m 245CONFIG_INET_ESP=m
297CONFIG_INET_IPCOMP=m 246CONFIG_INET_IPCOMP=m
298CONFIG_INET_TUNNEL=m 247CONFIG_INET_TUNNEL=m
299CONFIG_IP_TCPDIAG=m 248CONFIG_INET_DIAG=y
300CONFIG_IP_TCPDIAG_IPV6=y 249CONFIG_INET_TCP_DIAG=y
250# CONFIG_TCP_CONG_ADVANCED is not set
251CONFIG_TCP_CONG_BIC=y
301 252
302# 253#
303# IP: Virtual Server Configuration 254# IP: Virtual Server Configuration
@@ -341,6 +292,9 @@ CONFIG_INET6_TUNNEL=m
341CONFIG_IPV6_TUNNEL=m 292CONFIG_IPV6_TUNNEL=m
342CONFIG_NETFILTER=y 293CONFIG_NETFILTER=y
343# CONFIG_NETFILTER_DEBUG is not set 294# CONFIG_NETFILTER_DEBUG is not set
295CONFIG_NETFILTER_NETLINK=m
296CONFIG_NETFILTER_NETLINK_QUEUE=m
297CONFIG_NETFILTER_NETLINK_LOG=m
344 298
345# 299#
346# IP: Netfilter Configuration 300# IP: Netfilter Configuration
@@ -348,11 +302,15 @@ CONFIG_NETFILTER=y
348CONFIG_IP_NF_CONNTRACK=m 302CONFIG_IP_NF_CONNTRACK=m
349CONFIG_IP_NF_CT_ACCT=y 303CONFIG_IP_NF_CT_ACCT=y
350CONFIG_IP_NF_CONNTRACK_MARK=y 304CONFIG_IP_NF_CONNTRACK_MARK=y
305CONFIG_IP_NF_CONNTRACK_EVENTS=y
306CONFIG_IP_NF_CONNTRACK_NETLINK=m
351# CONFIG_IP_NF_CT_PROTO_SCTP is not set 307# CONFIG_IP_NF_CT_PROTO_SCTP is not set
352CONFIG_IP_NF_FTP=m 308CONFIG_IP_NF_FTP=m
353CONFIG_IP_NF_IRC=m 309CONFIG_IP_NF_IRC=m
310# CONFIG_IP_NF_NETBIOS_NS is not set
354CONFIG_IP_NF_TFTP=m 311CONFIG_IP_NF_TFTP=m
355CONFIG_IP_NF_AMANDA=m 312CONFIG_IP_NF_AMANDA=m
313CONFIG_IP_NF_PPTP=m
356CONFIG_IP_NF_QUEUE=m 314CONFIG_IP_NF_QUEUE=m
357CONFIG_IP_NF_IPTABLES=m 315CONFIG_IP_NF_IPTABLES=m
358CONFIG_IP_NF_MATCH_LIMIT=m 316CONFIG_IP_NF_MATCH_LIMIT=m
@@ -376,9 +334,12 @@ CONFIG_IP_NF_MATCH_OWNER=m
376CONFIG_IP_NF_MATCH_ADDRTYPE=m 334CONFIG_IP_NF_MATCH_ADDRTYPE=m
377CONFIG_IP_NF_MATCH_REALM=m 335CONFIG_IP_NF_MATCH_REALM=m
378CONFIG_IP_NF_MATCH_SCTP=m 336CONFIG_IP_NF_MATCH_SCTP=m
337CONFIG_IP_NF_MATCH_DCCP=m
379CONFIG_IP_NF_MATCH_COMMENT=m 338CONFIG_IP_NF_MATCH_COMMENT=m
380CONFIG_IP_NF_MATCH_CONNMARK=m 339CONFIG_IP_NF_MATCH_CONNMARK=m
340CONFIG_IP_NF_MATCH_CONNBYTES=m
381CONFIG_IP_NF_MATCH_HASHLIMIT=m 341CONFIG_IP_NF_MATCH_HASHLIMIT=m
342CONFIG_IP_NF_MATCH_STRING=m
382CONFIG_IP_NF_FILTER=m 343CONFIG_IP_NF_FILTER=m
383CONFIG_IP_NF_TARGET_REJECT=m 344CONFIG_IP_NF_TARGET_REJECT=m
384CONFIG_IP_NF_TARGET_LOG=m 345CONFIG_IP_NF_TARGET_LOG=m
@@ -395,12 +356,14 @@ CONFIG_IP_NF_NAT_IRC=m
395CONFIG_IP_NF_NAT_FTP=m 356CONFIG_IP_NF_NAT_FTP=m
396CONFIG_IP_NF_NAT_TFTP=m 357CONFIG_IP_NF_NAT_TFTP=m
397CONFIG_IP_NF_NAT_AMANDA=m 358CONFIG_IP_NF_NAT_AMANDA=m
359CONFIG_IP_NF_NAT_PPTP=m
398CONFIG_IP_NF_MANGLE=m 360CONFIG_IP_NF_MANGLE=m
399CONFIG_IP_NF_TARGET_TOS=m 361CONFIG_IP_NF_TARGET_TOS=m
400CONFIG_IP_NF_TARGET_ECN=m 362CONFIG_IP_NF_TARGET_ECN=m
401CONFIG_IP_NF_TARGET_DSCP=m 363CONFIG_IP_NF_TARGET_DSCP=m
402CONFIG_IP_NF_TARGET_MARK=m 364CONFIG_IP_NF_TARGET_MARK=m
403CONFIG_IP_NF_TARGET_CLASSIFY=m 365CONFIG_IP_NF_TARGET_CLASSIFY=m
366CONFIG_IP_NF_TARGET_TTL=m
404CONFIG_IP_NF_TARGET_CONNMARK=m 367CONFIG_IP_NF_TARGET_CONNMARK=m
405CONFIG_IP_NF_TARGET_CLUSTERIP=m 368CONFIG_IP_NF_TARGET_CLUSTERIP=m
406CONFIG_IP_NF_RAW=m 369CONFIG_IP_NF_RAW=m
@@ -410,7 +373,7 @@ CONFIG_IP_NF_ARPFILTER=m
410CONFIG_IP_NF_ARP_MANGLE=m 373CONFIG_IP_NF_ARP_MANGLE=m
411 374
412# 375#
413# IPv6: Netfilter Configuration 376# IPv6: Netfilter Configuration (EXPERIMENTAL)
414# 377#
415CONFIG_IP6_NF_QUEUE=m 378CONFIG_IP6_NF_QUEUE=m
416CONFIG_IP6_NF_IPTABLES=m 379CONFIG_IP6_NF_IPTABLES=m
@@ -429,11 +392,16 @@ CONFIG_IP6_NF_MATCH_LENGTH=m
429CONFIG_IP6_NF_MATCH_EUI64=m 392CONFIG_IP6_NF_MATCH_EUI64=m
430CONFIG_IP6_NF_FILTER=m 393CONFIG_IP6_NF_FILTER=m
431CONFIG_IP6_NF_TARGET_LOG=m 394CONFIG_IP6_NF_TARGET_LOG=m
395CONFIG_IP6_NF_TARGET_REJECT=m
432CONFIG_IP6_NF_MANGLE=m 396CONFIG_IP6_NF_MANGLE=m
433CONFIG_IP6_NF_TARGET_MARK=m 397CONFIG_IP6_NF_TARGET_MARK=m
398CONFIG_IP6_NF_TARGET_HL=m
434CONFIG_IP6_NF_RAW=m 399CONFIG_IP6_NF_RAW=m
435CONFIG_XFRM=y 400
436CONFIG_XFRM_USER=m 401#
402# DCCP Configuration (EXPERIMENTAL)
403#
404# CONFIG_IP_DCCP is not set
437 405
438# 406#
439# SCTP Configuration (EXPERIMENTAL) 407# SCTP Configuration (EXPERIMENTAL)
@@ -456,10 +424,6 @@ CONFIG_SCTP_HMAC_MD5=y
456CONFIG_NET_DIVERT=y 424CONFIG_NET_DIVERT=y
457# CONFIG_ECONET is not set 425# CONFIG_ECONET is not set
458# CONFIG_WAN_ROUTER is not set 426# CONFIG_WAN_ROUTER is not set
459
460#
461# QoS and/or fair queueing
462#
463CONFIG_NET_SCHED=y 427CONFIG_NET_SCHED=y
464# CONFIG_NET_SCH_CLK_JIFFIES is not set 428# CONFIG_NET_SCH_CLK_JIFFIES is not set
465CONFIG_NET_SCH_CLK_GETTIMEOFDAY=y 429CONFIG_NET_SCH_CLK_GETTIMEOFDAY=y
@@ -479,6 +443,7 @@ CONFIG_NET_SCH_INGRESS=m
479CONFIG_NET_QOS=y 443CONFIG_NET_QOS=y
480CONFIG_NET_ESTIMATOR=y 444CONFIG_NET_ESTIMATOR=y
481CONFIG_NET_CLS=y 445CONFIG_NET_CLS=y
446CONFIG_NET_CLS_BASIC=m
482CONFIG_NET_CLS_TCINDEX=m 447CONFIG_NET_CLS_TCINDEX=m
483CONFIG_NET_CLS_ROUTE4=m 448CONFIG_NET_CLS_ROUTE4=m
484CONFIG_NET_CLS_ROUTE=y 449CONFIG_NET_CLS_ROUTE=y
@@ -489,6 +454,7 @@ CONFIG_NET_CLS_U32=m
489# CONFIG_CLS_U32_MARK is not set 454# CONFIG_CLS_U32_MARK is not set
490CONFIG_NET_CLS_RSVP=m 455CONFIG_NET_CLS_RSVP=m
491CONFIG_NET_CLS_RSVP6=m 456CONFIG_NET_CLS_RSVP6=m
457# CONFIG_NET_EMATCH is not set
492# CONFIG_NET_CLS_ACT is not set 458# CONFIG_NET_CLS_ACT is not set
493CONFIG_NET_CLS_POLICE=y 459CONFIG_NET_CLS_POLICE=y
494 460
@@ -496,17 +462,153 @@ CONFIG_NET_CLS_POLICE=y
496# Network testing 462# Network testing
497# 463#
498# CONFIG_NET_PKTGEN is not set 464# CONFIG_NET_PKTGEN is not set
499# CONFIG_NETPOLL is not set
500# CONFIG_NET_POLL_CONTROLLER is not set
501# CONFIG_HAMRADIO is not set 465# CONFIG_HAMRADIO is not set
502# CONFIG_IRDA is not set 466# CONFIG_IRDA is not set
503# CONFIG_BT is not set 467# CONFIG_BT is not set
468CONFIG_IEEE80211=m
469# CONFIG_IEEE80211_DEBUG is not set
470CONFIG_IEEE80211_CRYPT_WEP=m
471CONFIG_IEEE80211_CRYPT_CCMP=m
472CONFIG_IEEE80211_CRYPT_TKIP=m
473
474#
475# Device Drivers
476#
477
478#
479# Generic Driver Options
480#
481CONFIG_STANDALONE=y
482CONFIG_PREVENT_FIRMWARE_BUILD=y
483# CONFIG_FW_LOADER is not set
484
485#
486# Connector - unified userspace <-> kernelspace linker
487#
488CONFIG_CONNECTOR=m
489
490#
491# Memory Technology Devices (MTD)
492#
493# CONFIG_MTD is not set
494
495#
496# Parallel port support
497#
498# CONFIG_PARPORT is not set
499
500#
501# Plug and Play support
502#
503
504#
505# Block devices
506#
507# CONFIG_BLK_DEV_COW_COMMON is not set
508# CONFIG_BLK_DEV_LOOP is not set
509# CONFIG_BLK_DEV_NBD is not set
510# CONFIG_BLK_DEV_RAM is not set
511CONFIG_BLK_DEV_RAM_COUNT=16
512# CONFIG_LBD is not set
513CONFIG_CDROM_PKTCDVD=m
514CONFIG_CDROM_PKTCDVD_BUFFERS=8
515# CONFIG_CDROM_PKTCDVD_WCACHE is not set
516
517#
518# IO Schedulers
519#
520CONFIG_IOSCHED_NOOP=y
521CONFIG_IOSCHED_AS=y
522CONFIG_IOSCHED_DEADLINE=y
523CONFIG_IOSCHED_CFQ=y
524CONFIG_ATA_OVER_ETH=m
525
526#
527# ATA/ATAPI/MFM/RLL support
528#
529# CONFIG_IDE is not set
530
531#
532# SCSI device support
533#
534CONFIG_RAID_ATTRS=m
535CONFIG_SCSI=y
536CONFIG_SCSI_PROC_FS=y
537
538#
539# SCSI support type (disk, tape, CD-ROM)
540#
541CONFIG_BLK_DEV_SD=y
542CONFIG_CHR_DEV_ST=y
543# CONFIG_CHR_DEV_OSST is not set
544CONFIG_BLK_DEV_SR=y
545# CONFIG_BLK_DEV_SR_VENDOR is not set
546# CONFIG_CHR_DEV_SG is not set
547CONFIG_CHR_DEV_SCH=m
548
549#
550# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
551#
552# CONFIG_SCSI_MULTI_LUN is not set
553CONFIG_SCSI_CONSTANTS=y
554# CONFIG_SCSI_LOGGING is not set
555
556#
557# SCSI Transport Attributes
558#
559CONFIG_SCSI_SPI_ATTRS=m
560# CONFIG_SCSI_FC_ATTRS is not set
561CONFIG_SCSI_ISCSI_ATTRS=m
562CONFIG_SCSI_SAS_ATTRS=m
563
564#
565# SCSI low-level drivers
566#
567CONFIG_SGIWD93_SCSI=y
568# CONFIG_SCSI_SATA is not set
569# CONFIG_SCSI_DEBUG is not set
570
571#
572# Multi-device support (RAID and LVM)
573#
574# CONFIG_MD is not set
575
576#
577# Fusion MPT device support
578#
579# CONFIG_FUSION is not set
580
581#
582# IEEE 1394 (FireWire) support
583#
584
585#
586# I2O device support
587#
588
589#
590# Network device support
591#
504CONFIG_NETDEVICES=y 592CONFIG_NETDEVICES=y
505CONFIG_DUMMY=m 593CONFIG_DUMMY=m
506CONFIG_BONDING=m 594CONFIG_BONDING=m
507CONFIG_EQUALIZER=m 595CONFIG_EQUALIZER=m
508CONFIG_TUN=m 596CONFIG_TUN=m
509CONFIG_ETHERTAP=m 597
598#
599# PHY device support
600#
601CONFIG_PHYLIB=m
602CONFIG_PHYCONTROL=y
603
604#
605# MII PHY device drivers
606#
607CONFIG_MARVELL_PHY=m
608CONFIG_DAVICOM_PHY=m
609CONFIG_QSEMI_PHY=m
610CONFIG_LXT_PHY=m
611CONFIG_CICADA_PHY=m
510 612
511# 613#
512# Ethernet (10 or 100Mbit) 614# Ethernet (10 or 100Mbit)
@@ -540,6 +642,8 @@ CONFIG_SGISEEQ=y
540# CONFIG_SLIP is not set 642# CONFIG_SLIP is not set
541# CONFIG_SHAPER is not set 643# CONFIG_SHAPER is not set
542# CONFIG_NETCONSOLE is not set 644# CONFIG_NETCONSOLE is not set
645# CONFIG_NETPOLL is not set
646# CONFIG_NET_POLL_CONTROLLER is not set
543 647
544# 648#
545# ISDN subsystem 649# ISDN subsystem
@@ -569,18 +673,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
569# CONFIG_INPUT_EVBUG is not set 673# CONFIG_INPUT_EVBUG is not set
570 674
571# 675#
572# Input I/O drivers
573#
574# CONFIG_GAMEPORT is not set
575CONFIG_SOUND_GAMEPORT=y
576CONFIG_SERIO=y
577CONFIG_SERIO_I8042=y
578CONFIG_SERIO_SERPORT=y
579# CONFIG_SERIO_CT82C710 is not set
580CONFIG_SERIO_LIBPS2=y
581CONFIG_SERIO_RAW=m
582
583#
584# Input Device Drivers 676# Input Device Drivers
585# 677#
586CONFIG_INPUT_KEYBOARD=y 678CONFIG_INPUT_KEYBOARD=y
@@ -598,6 +690,16 @@ CONFIG_MOUSE_SERIAL=m
598# CONFIG_INPUT_MISC is not set 690# CONFIG_INPUT_MISC is not set
599 691
600# 692#
693# Hardware I/O ports
694#
695CONFIG_SERIO=y
696CONFIG_SERIO_I8042=y
697CONFIG_SERIO_SERPORT=y
698CONFIG_SERIO_LIBPS2=y
699CONFIG_SERIO_RAW=m
700# CONFIG_GAMEPORT is not set
701
702#
601# Character devices 703# Character devices
602# 704#
603CONFIG_VT=y 705CONFIG_VT=y
@@ -644,11 +746,14 @@ CONFIG_SGI_DS1286=m
644# 746#
645# Ftape, the floppy tape device driver 747# Ftape, the floppy tape device driver
646# 748#
647# CONFIG_DRM is not set
648CONFIG_RAW_DRIVER=m 749CONFIG_RAW_DRIVER=m
649CONFIG_MAX_RAW_DEVS=256 750CONFIG_MAX_RAW_DEVS=256
650 751
651# 752#
753# TPM devices
754#
755
756#
652# I2C support 757# I2C support
653# 758#
654# CONFIG_I2C is not set 759# CONFIG_I2C is not set
@@ -659,10 +764,20 @@ CONFIG_MAX_RAW_DEVS=256
659# CONFIG_W1 is not set 764# CONFIG_W1 is not set
660 765
661# 766#
767# Hardware Monitoring support
768#
769# CONFIG_HWMON is not set
770# CONFIG_HWMON_VID is not set
771
772#
662# Misc devices 773# Misc devices
663# 774#
664 775
665# 776#
777# Multimedia Capabilities Port drivers
778#
779
780#
666# Multimedia devices 781# Multimedia devices
667# 782#
668# CONFIG_VIDEO_DEV is not set 783# CONFIG_VIDEO_DEV is not set
@@ -693,7 +808,6 @@ CONFIG_LOGO=y
693# CONFIG_LOGO_LINUX_VGA16 is not set 808# CONFIG_LOGO_LINUX_VGA16 is not set
694# CONFIG_LOGO_LINUX_CLUT224 is not set 809# CONFIG_LOGO_LINUX_CLUT224 is not set
695CONFIG_LOGO_SGI_CLUT224=y 810CONFIG_LOGO_SGI_CLUT224=y
696# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
697 811
698# 812#
699# Sound 813# Sound
@@ -707,10 +821,6 @@ CONFIG_LOGO_SGI_CLUT224=y
707# CONFIG_USB_ARCH_HAS_OHCI is not set 821# CONFIG_USB_ARCH_HAS_OHCI is not set
708 822
709# 823#
710# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
711#
712
713#
714# USB Gadget Support 824# USB Gadget Support
715# 825#
716# CONFIG_USB_GADGET is not set 826# CONFIG_USB_GADGET is not set
@@ -723,13 +833,17 @@ CONFIG_LOGO_SGI_CLUT224=y
723# 833#
724# InfiniBand support 834# InfiniBand support
725# 835#
726# CONFIG_INFINIBAND is not set 836
837#
838# SN Devices
839#
727 840
728# 841#
729# File systems 842# File systems
730# 843#
731CONFIG_EXT2_FS=m 844CONFIG_EXT2_FS=m
732# CONFIG_EXT2_FS_XATTR is not set 845# CONFIG_EXT2_FS_XATTR is not set
846# CONFIG_EXT2_FS_XIP is not set
733CONFIG_EXT3_FS=y 847CONFIG_EXT3_FS=y
734CONFIG_EXT3_FS_XATTR=y 848CONFIG_EXT3_FS_XATTR=y
735CONFIG_EXT3_FS_POSIX_ACL=y 849CONFIG_EXT3_FS_POSIX_ACL=y
@@ -741,12 +855,14 @@ CONFIG_FS_MBCACHE=y
741# CONFIG_JFS_FS is not set 855# CONFIG_JFS_FS is not set
742CONFIG_FS_POSIX_ACL=y 856CONFIG_FS_POSIX_ACL=y
743CONFIG_XFS_FS=m 857CONFIG_XFS_FS=m
744# CONFIG_XFS_RT is not set 858CONFIG_XFS_EXPORT=y
745CONFIG_XFS_QUOTA=y 859CONFIG_XFS_QUOTA=m
746CONFIG_XFS_SECURITY=y 860CONFIG_XFS_SECURITY=y
747# CONFIG_XFS_POSIX_ACL is not set 861# CONFIG_XFS_POSIX_ACL is not set
862# CONFIG_XFS_RT is not set
748CONFIG_MINIX_FS=m 863CONFIG_MINIX_FS=m
749# CONFIG_ROMFS_FS is not set 864# CONFIG_ROMFS_FS is not set
865CONFIG_INOTIFY=y
750CONFIG_QUOTA=y 866CONFIG_QUOTA=y
751# CONFIG_QFMT_V1 is not set 867# CONFIG_QFMT_V1 is not set
752CONFIG_QFMT_V2=m 868CONFIG_QFMT_V2=m
@@ -754,6 +870,7 @@ CONFIG_QUOTACTL=y
754CONFIG_DNOTIFY=y 870CONFIG_DNOTIFY=y
755CONFIG_AUTOFS_FS=m 871CONFIG_AUTOFS_FS=m
756CONFIG_AUTOFS4_FS=m 872CONFIG_AUTOFS4_FS=m
873CONFIG_FUSE_FS=m
757 874
758# 875#
759# CD-ROM/DVD Filesystems 876# CD-ROM/DVD Filesystems
@@ -781,12 +898,10 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
781CONFIG_PROC_FS=y 898CONFIG_PROC_FS=y
782CONFIG_PROC_KCORE=y 899CONFIG_PROC_KCORE=y
783CONFIG_SYSFS=y 900CONFIG_SYSFS=y
784# CONFIG_DEVFS_FS is not set
785CONFIG_DEVPTS_FS_XATTR=y
786CONFIG_DEVPTS_FS_SECURITY=y
787# CONFIG_TMPFS is not set 901# CONFIG_TMPFS is not set
788# CONFIG_HUGETLB_PAGE is not set 902# CONFIG_HUGETLB_PAGE is not set
789CONFIG_RAMFS=y 903CONFIG_RAMFS=y
904CONFIG_RELAYFS_FS=m
790 905
791# 906#
792# Miscellaneous filesystems 907# Miscellaneous filesystems
@@ -811,15 +926,20 @@ CONFIG_UFS_FS=m
811# 926#
812CONFIG_NFS_FS=m 927CONFIG_NFS_FS=m
813CONFIG_NFS_V3=y 928CONFIG_NFS_V3=y
929CONFIG_NFS_V3_ACL=y
814# CONFIG_NFS_V4 is not set 930# CONFIG_NFS_V4 is not set
815# CONFIG_NFS_DIRECTIO is not set 931# CONFIG_NFS_DIRECTIO is not set
816CONFIG_NFSD=m 932CONFIG_NFSD=m
933CONFIG_NFSD_V2_ACL=y
817CONFIG_NFSD_V3=y 934CONFIG_NFSD_V3=y
935CONFIG_NFSD_V3_ACL=y
818# CONFIG_NFSD_V4 is not set 936# CONFIG_NFSD_V4 is not set
819CONFIG_NFSD_TCP=y 937CONFIG_NFSD_TCP=y
820CONFIG_LOCKD=m 938CONFIG_LOCKD=m
821CONFIG_LOCKD_V4=y 939CONFIG_LOCKD_V4=y
822CONFIG_EXPORTFS=m 940CONFIG_EXPORTFS=m
941CONFIG_NFS_ACL_SUPPORT=m
942CONFIG_NFS_COMMON=y
823CONFIG_SUNRPC=m 943CONFIG_SUNRPC=m
824CONFIG_SUNRPC_GSS=m 944CONFIG_SUNRPC_GSS=m
825CONFIG_RPCSEC_GSS_KRB5=m 945CONFIG_RPCSEC_GSS_KRB5=m
@@ -835,6 +955,7 @@ CONFIG_CIFS=m
835CONFIG_CODA_FS=m 955CONFIG_CODA_FS=m
836# CONFIG_CODA_FS_OLD_API is not set 956# CONFIG_CODA_FS_OLD_API is not set
837# CONFIG_AFS_FS is not set 957# CONFIG_AFS_FS is not set
958# CONFIG_9P_FS is not set
838 959
839# 960#
840# Partition Types 961# Partition Types
@@ -908,7 +1029,9 @@ CONFIG_NLS_UTF8=m
908# 1029#
909# Kernel hacking 1030# Kernel hacking
910# 1031#
1032# CONFIG_PRINTK_TIME is not set
911# CONFIG_DEBUG_KERNEL is not set 1033# CONFIG_DEBUG_KERNEL is not set
1034CONFIG_LOG_BUF_SHIFT=14
912CONFIG_CROSSCOMPILE=y 1035CONFIG_CROSSCOMPILE=y
913CONFIG_CMDLINE="" 1036CONFIG_CMDLINE=""
914 1037
@@ -931,6 +1054,7 @@ CONFIG_CRYPTO_SHA1=m
931CONFIG_CRYPTO_SHA256=m 1054CONFIG_CRYPTO_SHA256=m
932CONFIG_CRYPTO_SHA512=m 1055CONFIG_CRYPTO_SHA512=m
933CONFIG_CRYPTO_WP512=m 1056CONFIG_CRYPTO_WP512=m
1057CONFIG_CRYPTO_TGR192=m
934CONFIG_CRYPTO_DES=m 1058CONFIG_CRYPTO_DES=m
935CONFIG_CRYPTO_BLOWFISH=m 1059CONFIG_CRYPTO_BLOWFISH=m
936CONFIG_CRYPTO_TWOFISH=m 1060CONFIG_CRYPTO_TWOFISH=m
@@ -942,10 +1066,10 @@ CONFIG_CRYPTO_TEA=m
942CONFIG_CRYPTO_ARC4=m 1066CONFIG_CRYPTO_ARC4=m
943CONFIG_CRYPTO_KHAZAD=m 1067CONFIG_CRYPTO_KHAZAD=m
944CONFIG_CRYPTO_ANUBIS=m 1068CONFIG_CRYPTO_ANUBIS=m
945CONFIG_CRYPTO_DEFLATE=y 1069CONFIG_CRYPTO_DEFLATE=m
946CONFIG_CRYPTO_MICHAEL_MIC=m 1070CONFIG_CRYPTO_MICHAEL_MIC=m
947CONFIG_CRYPTO_CRC32C=m 1071CONFIG_CRYPTO_CRC32C=m
948CONFIG_CRYPTO_TEST=m 1072# CONFIG_CRYPTO_TEST is not set
949 1073
950# 1074#
951# Hardware crypto devices 1075# Hardware crypto devices
@@ -955,9 +1079,12 @@ CONFIG_CRYPTO_TEST=m
955# Library routines 1079# Library routines
956# 1080#
957# CONFIG_CRC_CCITT is not set 1081# CONFIG_CRC_CCITT is not set
1082CONFIG_CRC16=m
958CONFIG_CRC32=m 1083CONFIG_CRC32=m
959CONFIG_LIBCRC32C=m 1084CONFIG_LIBCRC32C=m
960CONFIG_ZLIB_INFLATE=y 1085CONFIG_ZLIB_INFLATE=m
961CONFIG_ZLIB_DEFLATE=y 1086CONFIG_ZLIB_DEFLATE=m
962CONFIG_GENERIC_HARDIRQS=y 1087CONFIG_TEXTSEARCH=y
963CONFIG_GENERIC_IRQ_PROBE=y 1088CONFIG_TEXTSEARCH_KMP=m
1089CONFIG_TEXTSEARCH_BM=m
1090CONFIG_TEXTSEARCH_FSM=m
diff --git a/arch/mips/configs/ip27_defconfig b/arch/mips/configs/ip27_defconfig
index b2a67da1e031..d962f61d5b98 100644
--- a/arch/mips/configs/ip27_defconfig
+++ b/arch/mips/configs/ip27_defconfig
@@ -1,11 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:04 2005 4# Thu Oct 20 22:26:04 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7CONFIG_64BIT=y
8CONFIG_64BIT=y
9 7
10# 8#
11# Code maturity level options 9# Code maturity level options
@@ -13,25 +11,31 @@ CONFIG_64BIT=y
13CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
14CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
15CONFIG_LOCK_KERNEL=y 13CONFIG_LOCK_KERNEL=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
16 15
17# 16#
18# General setup 17# General setup
19# 18#
20CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
21CONFIG_SWAP=y 21CONFIG_SWAP=y
22CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
23CONFIG_POSIX_MQUEUE=y 23CONFIG_POSIX_MQUEUE=y
24# CONFIG_BSD_PROCESS_ACCT is not set 24# CONFIG_BSD_PROCESS_ACCT is not set
25CONFIG_SYSCTL=y 25CONFIG_SYSCTL=y
26# CONFIG_AUDIT is not set 26# CONFIG_AUDIT is not set
27CONFIG_LOG_BUF_SHIFT=15 27CONFIG_HOTPLUG=y
28# CONFIG_HOTPLUG is not set
29CONFIG_KOBJECT_UEVENT=y 28CONFIG_KOBJECT_UEVENT=y
30CONFIG_IKCONFIG=y 29CONFIG_IKCONFIG=y
31CONFIG_IKCONFIG_PROC=y 30CONFIG_IKCONFIG_PROC=y
31CONFIG_CPUSETS=y
32CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y 33CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y 34CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_EXTRA_PASS is not set 35# CONFIG_KALLSYMS_EXTRA_PASS is not set
36CONFIG_PRINTK=y
37CONFIG_BUG=y
38CONFIG_BASE_FULL=y
35CONFIG_FUTEX=y 39CONFIG_FUTEX=y
36CONFIG_EPOLL=y 40CONFIG_EPOLL=y
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 41# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -41,6 +45,7 @@ CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0 45CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0 46CONFIG_CC_ALIGN_JUMPS=0
43# CONFIG_TINY_SHMEM is not set 47# CONFIG_TINY_SHMEM is not set
48CONFIG_BASE_SMALL=0
44 49
45# 50#
46# Loadable module support 51# Loadable module support
@@ -57,55 +62,85 @@ CONFIG_STOP_MACHINE=y
57# 62#
58# Machine selection 63# Machine selection
59# 64#
60# CONFIG_MACH_JAZZ is not set 65# CONFIG_MIPS_MTX1 is not set
61# CONFIG_MACH_VR41XX is not set 66# CONFIG_MIPS_BOSPORUS is not set
67# CONFIG_MIPS_PB1000 is not set
68# CONFIG_MIPS_PB1100 is not set
69# CONFIG_MIPS_PB1500 is not set
70# CONFIG_MIPS_PB1550 is not set
71# CONFIG_MIPS_PB1200 is not set
72# CONFIG_MIPS_DB1000 is not set
73# CONFIG_MIPS_DB1100 is not set
74# CONFIG_MIPS_DB1500 is not set
75# CONFIG_MIPS_DB1550 is not set
76# CONFIG_MIPS_DB1200 is not set
77# CONFIG_MIPS_MIRAGE is not set
62# CONFIG_MIPS_COBALT is not set 78# CONFIG_MIPS_COBALT is not set
63# CONFIG_MACH_DECSTATION is not set 79# CONFIG_MACH_DECSTATION is not set
64# CONFIG_MIPS_EV64120 is not set 80# CONFIG_MIPS_EV64120 is not set
65# CONFIG_MIPS_EV96100 is not set 81# CONFIG_MIPS_EV96100 is not set
66# CONFIG_MIPS_IVR is not set 82# CONFIG_MIPS_IVR is not set
67# CONFIG_LASAT is not set
68# CONFIG_MIPS_ITE8172 is not set 83# CONFIG_MIPS_ITE8172 is not set
84# CONFIG_MACH_JAZZ is not set
85# CONFIG_LASAT is not set
69# CONFIG_MIPS_ATLAS is not set 86# CONFIG_MIPS_ATLAS is not set
70# CONFIG_MIPS_MALTA is not set 87# CONFIG_MIPS_MALTA is not set
71# CONFIG_MIPS_SEAD is not set 88# CONFIG_MIPS_SEAD is not set
89# CONFIG_MIPS_SIM is not set
90# CONFIG_MOMENCO_JAGUAR_ATX is not set
72# CONFIG_MOMENCO_OCELOT is not set 91# CONFIG_MOMENCO_OCELOT is not set
73# CONFIG_MOMENCO_OCELOT_G is not set
74# CONFIG_MOMENCO_OCELOT_C is not set
75# CONFIG_MOMENCO_OCELOT_3 is not set 92# CONFIG_MOMENCO_OCELOT_3 is not set
76# CONFIG_MOMENCO_JAGUAR_ATX is not set 93# CONFIG_MOMENCO_OCELOT_C is not set
77# CONFIG_PMC_YOSEMITE is not set 94# CONFIG_MOMENCO_OCELOT_G is not set
95# CONFIG_MIPS_XXS1500 is not set
96# CONFIG_PNX8550_V2PCI is not set
97# CONFIG_PNX8550_JBS is not set
78# CONFIG_DDB5074 is not set 98# CONFIG_DDB5074 is not set
79# CONFIG_DDB5476 is not set 99# CONFIG_DDB5476 is not set
80# CONFIG_DDB5477 is not set 100# CONFIG_DDB5477 is not set
81# CONFIG_NEC_OSPREY is not set 101# CONFIG_MACH_VR41XX is not set
102# CONFIG_PMC_YOSEMITE is not set
103# CONFIG_QEMU is not set
82# CONFIG_SGI_IP22 is not set 104# CONFIG_SGI_IP22 is not set
83CONFIG_SGI_IP27=y 105CONFIG_SGI_IP27=y
106# CONFIG_SGI_IP32 is not set
107# CONFIG_SIBYTE_BIGSUR is not set
108# CONFIG_SIBYTE_SWARM is not set
109# CONFIG_SIBYTE_SENTOSA is not set
110# CONFIG_SIBYTE_RHONE is not set
111# CONFIG_SIBYTE_CARMEL is not set
112# CONFIG_SIBYTE_PTSWARM is not set
113# CONFIG_SIBYTE_LITTLESUR is not set
114# CONFIG_SIBYTE_CRHINE is not set
115# CONFIG_SIBYTE_CRHONE is not set
116# CONFIG_SNI_RM200_PCI is not set
117# CONFIG_TOSHIBA_JMR3927 is not set
118# CONFIG_TOSHIBA_RBTX4927 is not set
119# CONFIG_TOSHIBA_RBTX4938 is not set
84# CONFIG_SGI_SN0_N_MODE is not set 120# CONFIG_SGI_SN0_N_MODE is not set
85CONFIG_ARCH_DISCONTIGMEM_ENABLE=y 121CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
86CONFIG_NUMA=y 122CONFIG_NUMA=y
87# CONFIG_MAPPED_KERNEL is not set 123# CONFIG_MAPPED_KERNEL is not set
88# CONFIG_REPLICATE_KTEXT is not set 124# CONFIG_REPLICATE_KTEXT is not set
89# CONFIG_REPLICATE_EXHANDLERS is not set 125# CONFIG_REPLICATE_EXHANDLERS is not set
90# CONFIG_SGI_IP32 is not set
91# CONFIG_SIBYTE_SB1xxx_SOC is not set
92# CONFIG_SNI_RM200_PCI is not set
93CONFIG_RWSEM_GENERIC_SPINLOCK=y 126CONFIG_RWSEM_GENERIC_SPINLOCK=y
94CONFIG_GENERIC_CALIBRATE_DELAY=y 127CONFIG_GENERIC_CALIBRATE_DELAY=y
95CONFIG_HAVE_DEC_LOCK=y
96CONFIG_ARC=y 128CONFIG_ARC=y
97CONFIG_DMA_IP27=y 129CONFIG_DMA_IP27=y
130CONFIG_CPU_BIG_ENDIAN=y
98# CONFIG_CPU_LITTLE_ENDIAN is not set 131# CONFIG_CPU_LITTLE_ENDIAN is not set
132CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
99CONFIG_MIPS_L1_CACHE_SHIFT=7 133CONFIG_MIPS_L1_CACHE_SHIFT=7
100CONFIG_ARC64=y 134CONFIG_ARC64=y
101CONFIG_BOOT_ELF64=y 135CONFIG_BOOT_ELF64=y
102CONFIG_QL_ISP_A64=y
103 136
104# 137#
105# CPU selection 138# CPU selection
106# 139#
107# CONFIG_CPU_MIPS32 is not set 140# CONFIG_CPU_MIPS32_R1 is not set
108# CONFIG_CPU_MIPS64 is not set 141# CONFIG_CPU_MIPS32_R2 is not set
142# CONFIG_CPU_MIPS64_R1 is not set
143# CONFIG_CPU_MIPS64_R2 is not set
109# CONFIG_CPU_R3000 is not set 144# CONFIG_CPU_R3000 is not set
110# CONFIG_CPU_TX39XX is not set 145# CONFIG_CPU_TX39XX is not set
111# CONFIG_CPU_VR41XX is not set 146# CONFIG_CPU_VR41XX is not set
@@ -121,17 +156,42 @@ CONFIG_CPU_R10000=y
121# CONFIG_CPU_RM7000 is not set 156# CONFIG_CPU_RM7000 is not set
122# CONFIG_CPU_RM9000 is not set 157# CONFIG_CPU_RM9000 is not set
123# CONFIG_CPU_SB1 is not set 158# CONFIG_CPU_SB1 is not set
159CONFIG_SYS_HAS_CPU_R10000=y
160CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
161CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
162CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
163
164#
165# Kernel type
166#
167# CONFIG_32BIT is not set
168CONFIG_64BIT=y
124CONFIG_PAGE_SIZE_4KB=y 169CONFIG_PAGE_SIZE_4KB=y
125# CONFIG_PAGE_SIZE_8KB is not set 170# CONFIG_PAGE_SIZE_8KB is not set
126# CONFIG_PAGE_SIZE_16KB is not set 171# CONFIG_PAGE_SIZE_16KB is not set
127# CONFIG_PAGE_SIZE_64KB is not set 172# CONFIG_PAGE_SIZE_64KB is not set
128CONFIG_CPU_HAS_PREFETCH=y 173CONFIG_CPU_HAS_PREFETCH=y
174# CONFIG_MIPS_MT is not set
129CONFIG_CPU_HAS_LLSC=y 175CONFIG_CPU_HAS_LLSC=y
130CONFIG_CPU_HAS_LLDSCD=y 176CONFIG_CPU_HAS_LLDSCD=y
131CONFIG_CPU_HAS_SYNC=y 177CONFIG_CPU_HAS_SYNC=y
178CONFIG_GENERIC_HARDIRQS=y
179CONFIG_GENERIC_IRQ_PROBE=y
180CONFIG_CPU_SUPPORTS_HIGHMEM=y
181CONFIG_SELECT_MEMORY_MODEL=y
182# CONFIG_FLATMEM_MANUAL is not set
183CONFIG_DISCONTIGMEM_MANUAL=y
184# CONFIG_SPARSEMEM_MANUAL is not set
185CONFIG_DISCONTIGMEM=y
186CONFIG_FLAT_NODE_MEM_MAP=y
187CONFIG_NEED_MULTIPLE_NODES=y
188# CONFIG_SPARSEMEM_STATIC is not set
132CONFIG_SMP=y 189CONFIG_SMP=y
133CONFIG_NR_CPUS=64 190CONFIG_NR_CPUS=64
191CONFIG_PREEMPT_NONE=y
192# CONFIG_PREEMPT_VOLUNTARY is not set
134# CONFIG_PREEMPT is not set 193# CONFIG_PREEMPT is not set
194CONFIG_PREEMPT_BKL=y
135# CONFIG_MIPS_INSANE_LARGE is not set 195# CONFIG_MIPS_INSANE_LARGE is not set
136 196
137# 197#
@@ -141,7 +201,6 @@ CONFIG_HW_HAS_PCI=y
141CONFIG_PCI=y 201CONFIG_PCI=y
142CONFIG_PCI_DOMAINS=y 202CONFIG_PCI_DOMAINS=y
143CONFIG_PCI_LEGACY_PROC=y 203CONFIG_PCI_LEGACY_PROC=y
144CONFIG_PCI_NAMES=y
145CONFIG_MMU=y 204CONFIG_MMU=y
146 205
147# 206#
@@ -150,10 +209,6 @@ CONFIG_MMU=y
150# CONFIG_PCCARD is not set 209# CONFIG_PCCARD is not set
151 210
152# 211#
153# PC-card bridges
154#
155
156#
157# PCI Hotplug Support 212# PCI Hotplug Support
158# 213#
159# CONFIG_HOTPLUG_PCI is not set 214# CONFIG_HOTPLUG_PCI is not set
@@ -163,7 +218,7 @@ CONFIG_MMU=y
163# 218#
164CONFIG_BINFMT_ELF=y 219CONFIG_BINFMT_ELF=y
165# CONFIG_BINFMT_MISC is not set 220# CONFIG_BINFMT_MISC is not set
166# CONFIG_BUILD_ELF64 is not set 221CONFIG_BUILD_ELF64=y
167CONFIG_MIPS32_COMPAT=y 222CONFIG_MIPS32_COMPAT=y
168CONFIG_COMPAT=y 223CONFIG_COMPAT=y
169CONFIG_MIPS32_O32=y 224CONFIG_MIPS32_O32=y
@@ -171,6 +226,111 @@ CONFIG_MIPS32_O32=y
171CONFIG_BINFMT_ELF32=y 226CONFIG_BINFMT_ELF32=y
172 227
173# 228#
229# Networking
230#
231CONFIG_NET=y
232
233#
234# Networking options
235#
236CONFIG_PACKET=y
237CONFIG_PACKET_MMAP=y
238CONFIG_UNIX=y
239CONFIG_XFRM=y
240CONFIG_XFRM_USER=m
241CONFIG_NET_KEY=y
242CONFIG_INET=y
243CONFIG_IP_MULTICAST=y
244# CONFIG_IP_ADVANCED_ROUTER is not set
245CONFIG_IP_FIB_HASH=y
246CONFIG_IP_PNP=y
247# CONFIG_IP_PNP_DHCP is not set
248# CONFIG_IP_PNP_BOOTP is not set
249# CONFIG_IP_PNP_RARP is not set
250# CONFIG_NET_IPIP is not set
251# CONFIG_NET_IPGRE is not set
252# CONFIG_IP_MROUTE is not set
253# CONFIG_ARPD is not set
254# CONFIG_SYN_COOKIES is not set
255# CONFIG_INET_AH is not set
256# CONFIG_INET_ESP is not set
257# CONFIG_INET_IPCOMP is not set
258CONFIG_INET_TUNNEL=m
259CONFIG_INET_DIAG=y
260CONFIG_INET_TCP_DIAG=y
261# CONFIG_TCP_CONG_ADVANCED is not set
262CONFIG_TCP_CONG_BIC=y
263# CONFIG_IPV6 is not set
264# CONFIG_NETFILTER is not set
265
266#
267# DCCP Configuration (EXPERIMENTAL)
268#
269# CONFIG_IP_DCCP is not set
270
271#
272# SCTP Configuration (EXPERIMENTAL)
273#
274# CONFIG_IP_SCTP is not set
275# CONFIG_ATM is not set
276# CONFIG_BRIDGE is not set
277# CONFIG_VLAN_8021Q is not set
278# CONFIG_DECNET is not set
279# CONFIG_LLC2 is not set
280# CONFIG_IPX is not set
281# CONFIG_ATALK is not set
282# CONFIG_X25 is not set
283# CONFIG_LAPB is not set
284# CONFIG_NET_DIVERT is not set
285# CONFIG_ECONET is not set
286# CONFIG_WAN_ROUTER is not set
287CONFIG_NET_SCHED=y
288# CONFIG_NET_SCH_CLK_JIFFIES is not set
289CONFIG_NET_SCH_CLK_GETTIMEOFDAY=y
290# CONFIG_NET_SCH_CLK_CPU is not set
291CONFIG_NET_SCH_CBQ=m
292CONFIG_NET_SCH_HTB=m
293CONFIG_NET_SCH_HFSC=m
294CONFIG_NET_SCH_PRIO=m
295CONFIG_NET_SCH_RED=m
296CONFIG_NET_SCH_SFQ=m
297CONFIG_NET_SCH_TEQL=m
298CONFIG_NET_SCH_TBF=m
299CONFIG_NET_SCH_GRED=m
300CONFIG_NET_SCH_DSMARK=m
301CONFIG_NET_SCH_NETEM=m
302CONFIG_NET_SCH_INGRESS=m
303CONFIG_NET_QOS=y
304CONFIG_NET_ESTIMATOR=y
305CONFIG_NET_CLS=y
306CONFIG_NET_CLS_BASIC=m
307CONFIG_NET_CLS_TCINDEX=m
308CONFIG_NET_CLS_ROUTE4=m
309CONFIG_NET_CLS_ROUTE=y
310CONFIG_NET_CLS_FW=m
311CONFIG_NET_CLS_U32=m
312# CONFIG_CLS_U32_PERF is not set
313# CONFIG_NET_CLS_IND is not set
314CONFIG_NET_CLS_RSVP=m
315CONFIG_NET_CLS_RSVP6=m
316# CONFIG_NET_EMATCH is not set
317# CONFIG_NET_CLS_ACT is not set
318CONFIG_NET_CLS_POLICE=y
319
320#
321# Network testing
322#
323# CONFIG_NET_PKTGEN is not set
324# CONFIG_HAMRADIO is not set
325# CONFIG_IRDA is not set
326# CONFIG_BT is not set
327CONFIG_IEEE80211=m
328# CONFIG_IEEE80211_DEBUG is not set
329CONFIG_IEEE80211_CRYPT_WEP=m
330CONFIG_IEEE80211_CRYPT_CCMP=m
331CONFIG_IEEE80211_CRYPT_TKIP=m
332
333#
174# Device Drivers 334# Device Drivers
175# 335#
176 336
@@ -179,7 +339,12 @@ CONFIG_BINFMT_ELF32=y
179# 339#
180CONFIG_STANDALONE=y 340CONFIG_STANDALONE=y
181CONFIG_PREVENT_FIRMWARE_BUILD=y 341CONFIG_PREVENT_FIRMWARE_BUILD=y
182# CONFIG_FW_LOADER is not set 342CONFIG_FW_LOADER=m
343
344#
345# Connector - unified userspace <-> kernelspace linker
346#
347CONFIG_CONNECTOR=m
183 348
184# 349#
185# Memory Technology Devices (MTD) 350# Memory Technology Devices (MTD)
@@ -198,7 +363,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
198# 363#
199# Block devices 364# Block devices
200# 365#
201# CONFIG_BLK_DEV_FD is not set
202# CONFIG_BLK_CPQ_DA is not set 366# CONFIG_BLK_CPQ_DA is not set
203# CONFIG_BLK_CPQ_CISS_DA is not set 367# CONFIG_BLK_CPQ_CISS_DA is not set
204# CONFIG_BLK_DEV_DAC960 is not set 368# CONFIG_BLK_DEV_DAC960 is not set
@@ -210,7 +374,6 @@ CONFIG_BLK_DEV_CRYPTOLOOP=m
210# CONFIG_BLK_DEV_SX8 is not set 374# CONFIG_BLK_DEV_SX8 is not set
211# CONFIG_BLK_DEV_RAM is not set 375# CONFIG_BLK_DEV_RAM is not set
212CONFIG_BLK_DEV_RAM_COUNT=16 376CONFIG_BLK_DEV_RAM_COUNT=16
213CONFIG_INITRAMFS_SOURCE=""
214CONFIG_CDROM_PKTCDVD=m 377CONFIG_CDROM_PKTCDVD=m
215CONFIG_CDROM_PKTCDVD_BUFFERS=8 378CONFIG_CDROM_PKTCDVD_BUFFERS=8
216# CONFIG_CDROM_PKTCDVD_WCACHE is not set 379# CONFIG_CDROM_PKTCDVD_WCACHE is not set
@@ -232,6 +395,7 @@ CONFIG_ATA_OVER_ETH=m
232# 395#
233# SCSI device support 396# SCSI device support
234# 397#
398CONFIG_RAID_ATTRS=m
235CONFIG_SCSI=y 399CONFIG_SCSI=y
236CONFIG_SCSI_PROC_FS=y 400CONFIG_SCSI_PROC_FS=y
237 401
@@ -241,8 +405,10 @@ CONFIG_SCSI_PROC_FS=y
241CONFIG_BLK_DEV_SD=y 405CONFIG_BLK_DEV_SD=y
242CONFIG_CHR_DEV_ST=y 406CONFIG_CHR_DEV_ST=y
243# CONFIG_CHR_DEV_OSST is not set 407# CONFIG_CHR_DEV_OSST is not set
244# CONFIG_BLK_DEV_SR is not set 408CONFIG_BLK_DEV_SR=m
245# CONFIG_CHR_DEV_SG is not set 409CONFIG_BLK_DEV_SR_VENDOR=y
410CONFIG_CHR_DEV_SG=m
411CONFIG_CHR_DEV_SCH=m
246 412
247# 413#
248# Some SCSI devices (e.g. CD jukebox) support multiple LUNs 414# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
@@ -256,7 +422,8 @@ CONFIG_SCSI_LOGGING=y
256# 422#
257CONFIG_SCSI_SPI_ATTRS=y 423CONFIG_SCSI_SPI_ATTRS=y
258# CONFIG_SCSI_FC_ATTRS is not set 424# CONFIG_SCSI_FC_ATTRS is not set
259# CONFIG_SCSI_ISCSI_ATTRS is not set 425CONFIG_SCSI_ISCSI_ATTRS=m
426CONFIG_SCSI_SAS_ATTRS=m
260 427
261# 428#
262# SCSI low-level drivers 429# SCSI low-level drivers
@@ -271,26 +438,24 @@ CONFIG_SCSI_SPI_ATTRS=y
271# CONFIG_MEGARAID_NEWGEN is not set 438# CONFIG_MEGARAID_NEWGEN is not set
272# CONFIG_MEGARAID_LEGACY is not set 439# CONFIG_MEGARAID_LEGACY is not set
273# CONFIG_SCSI_SATA is not set 440# CONFIG_SCSI_SATA is not set
274# CONFIG_SCSI_BUSLOGIC is not set
275# CONFIG_SCSI_DMX3191D is not set 441# CONFIG_SCSI_DMX3191D is not set
276# CONFIG_SCSI_EATA is not set
277# CONFIG_SCSI_EATA_PIO is not set
278# CONFIG_SCSI_FUTURE_DOMAIN is not set 442# CONFIG_SCSI_FUTURE_DOMAIN is not set
279# CONFIG_SCSI_GDTH is not set
280# CONFIG_SCSI_IPS is not set 443# CONFIG_SCSI_IPS is not set
281# CONFIG_SCSI_INITIO is not set 444# CONFIG_SCSI_INITIO is not set
282# CONFIG_SCSI_INIA100 is not set 445# CONFIG_SCSI_INIA100 is not set
283# CONFIG_SCSI_SYM53C8XX_2 is not set 446# CONFIG_SCSI_SYM53C8XX_2 is not set
284# CONFIG_SCSI_IPR is not set 447# CONFIG_SCSI_IPR is not set
285CONFIG_SCSI_QLOGIC_ISP=y
286# CONFIG_SCSI_QLOGIC_FC is not set 448# CONFIG_SCSI_QLOGIC_FC is not set
287# CONFIG_SCSI_QLOGIC_1280 is not set 449CONFIG_SCSI_QLOGIC_1280=y
450CONFIG_SCSI_QLOGIC_1280_1040=y
288CONFIG_SCSI_QLA2XXX=y 451CONFIG_SCSI_QLA2XXX=y
289# CONFIG_SCSI_QLA21XX is not set 452# CONFIG_SCSI_QLA21XX is not set
290# CONFIG_SCSI_QLA22XX is not set 453# CONFIG_SCSI_QLA22XX is not set
291# CONFIG_SCSI_QLA2300 is not set 454# CONFIG_SCSI_QLA2300 is not set
292# CONFIG_SCSI_QLA2322 is not set 455# CONFIG_SCSI_QLA2322 is not set
293# CONFIG_SCSI_QLA6312 is not set 456# CONFIG_SCSI_QLA6312 is not set
457# CONFIG_SCSI_QLA24XX is not set
458# CONFIG_SCSI_LPFC is not set
294# CONFIG_SCSI_DC395x is not set 459# CONFIG_SCSI_DC395x is not set
295# CONFIG_SCSI_DC390T is not set 460# CONFIG_SCSI_DC390T is not set
296# CONFIG_SCSI_DEBUG is not set 461# CONFIG_SCSI_DEBUG is not set
@@ -313,11 +478,15 @@ CONFIG_DM_CRYPT=m
313CONFIG_DM_SNAPSHOT=m 478CONFIG_DM_SNAPSHOT=m
314CONFIG_DM_MIRROR=m 479CONFIG_DM_MIRROR=m
315CONFIG_DM_ZERO=m 480CONFIG_DM_ZERO=m
481CONFIG_DM_MULTIPATH=m
482CONFIG_DM_MULTIPATH_EMC=m
316 483
317# 484#
318# Fusion MPT device support 485# Fusion MPT device support
319# 486#
320# CONFIG_FUSION is not set 487# CONFIG_FUSION is not set
488# CONFIG_FUSION_SPI is not set
489# CONFIG_FUSION_FC is not set
321 490
322# 491#
323# IEEE 1394 (FireWire) support 492# IEEE 1394 (FireWire) support
@@ -330,107 +499,13 @@ CONFIG_DM_ZERO=m
330# CONFIG_I2O is not set 499# CONFIG_I2O is not set
331 500
332# 501#
333# Networking support 502# Network device support
334#
335CONFIG_NET=y
336
337#
338# Networking options
339#
340CONFIG_PACKET=y
341CONFIG_PACKET_MMAP=y
342CONFIG_NETLINK_DEV=y
343CONFIG_UNIX=y
344CONFIG_NET_KEY=y
345CONFIG_INET=y
346CONFIG_IP_MULTICAST=y
347# CONFIG_IP_ADVANCED_ROUTER is not set
348CONFIG_IP_PNP=y
349# CONFIG_IP_PNP_DHCP is not set
350# CONFIG_IP_PNP_BOOTP is not set
351# CONFIG_IP_PNP_RARP is not set
352# CONFIG_NET_IPIP is not set
353# CONFIG_NET_IPGRE is not set
354# CONFIG_IP_MROUTE is not set
355# CONFIG_ARPD is not set
356# CONFIG_SYN_COOKIES is not set
357# CONFIG_INET_AH is not set
358# CONFIG_INET_ESP is not set
359# CONFIG_INET_IPCOMP is not set
360CONFIG_INET_TUNNEL=m
361CONFIG_IP_TCPDIAG=m
362# CONFIG_IP_TCPDIAG_IPV6 is not set
363# CONFIG_IPV6 is not set
364# CONFIG_NETFILTER is not set
365CONFIG_XFRM=y
366CONFIG_XFRM_USER=m
367
368#
369# SCTP Configuration (EXPERIMENTAL)
370#
371# CONFIG_IP_SCTP is not set
372# CONFIG_ATM is not set
373# CONFIG_BRIDGE is not set
374# CONFIG_VLAN_8021Q is not set
375# CONFIG_DECNET is not set
376# CONFIG_LLC2 is not set
377# CONFIG_IPX is not set
378# CONFIG_ATALK is not set
379# CONFIG_X25 is not set
380# CONFIG_LAPB is not set
381# CONFIG_NET_DIVERT is not set
382# CONFIG_ECONET is not set
383# CONFIG_WAN_ROUTER is not set
384
385#
386# QoS and/or fair queueing
387#
388CONFIG_NET_SCHED=y
389# CONFIG_NET_SCH_CLK_JIFFIES is not set
390CONFIG_NET_SCH_CLK_GETTIMEOFDAY=y
391# CONFIG_NET_SCH_CLK_CPU is not set
392CONFIG_NET_SCH_CBQ=m
393CONFIG_NET_SCH_HTB=m
394CONFIG_NET_SCH_HFSC=m
395CONFIG_NET_SCH_PRIO=m
396CONFIG_NET_SCH_RED=m
397CONFIG_NET_SCH_SFQ=m
398CONFIG_NET_SCH_TEQL=m
399CONFIG_NET_SCH_TBF=m
400CONFIG_NET_SCH_GRED=m
401CONFIG_NET_SCH_DSMARK=m
402CONFIG_NET_SCH_NETEM=m
403CONFIG_NET_SCH_INGRESS=m
404CONFIG_NET_QOS=y
405CONFIG_NET_ESTIMATOR=y
406CONFIG_NET_CLS=y
407CONFIG_NET_CLS_TCINDEX=m
408CONFIG_NET_CLS_ROUTE4=m
409CONFIG_NET_CLS_ROUTE=y
410CONFIG_NET_CLS_FW=m
411CONFIG_NET_CLS_U32=m
412# CONFIG_CLS_U32_PERF is not set
413# CONFIG_NET_CLS_IND is not set
414CONFIG_NET_CLS_RSVP=m
415CONFIG_NET_CLS_RSVP6=m
416# CONFIG_NET_CLS_ACT is not set
417CONFIG_NET_CLS_POLICE=y
418
419#
420# Network testing
421# 503#
422# CONFIG_NET_PKTGEN is not set
423# CONFIG_NETPOLL is not set
424# CONFIG_NET_POLL_CONTROLLER is not set
425# CONFIG_HAMRADIO is not set
426# CONFIG_IRDA is not set
427# CONFIG_BT is not set
428CONFIG_NETDEVICES=y 504CONFIG_NETDEVICES=y
429# CONFIG_DUMMY is not set 505# CONFIG_DUMMY is not set
430# CONFIG_BONDING is not set 506# CONFIG_BONDING is not set
431# CONFIG_EQUALIZER is not set 507# CONFIG_EQUALIZER is not set
432# CONFIG_TUN is not set 508# CONFIG_TUN is not set
433# CONFIG_ETHERTAP is not set
434 509
435# 510#
436# ARCnet devices 511# ARCnet devices
@@ -438,13 +513,25 @@ CONFIG_NETDEVICES=y
438# CONFIG_ARCNET is not set 513# CONFIG_ARCNET is not set
439 514
440# 515#
516# PHY device support
517#
518CONFIG_PHYLIB=m
519CONFIG_PHYCONTROL=y
520
521#
522# MII PHY device drivers
523#
524CONFIG_MARVELL_PHY=m
525CONFIG_DAVICOM_PHY=m
526CONFIG_QSEMI_PHY=m
527CONFIG_LXT_PHY=m
528CONFIG_CICADA_PHY=m
529
530#
441# Ethernet (10 or 100Mbit) 531# Ethernet (10 or 100Mbit)
442# 532#
443CONFIG_NET_ETHERNET=y 533CONFIG_NET_ETHERNET=y
444CONFIG_MII=y 534CONFIG_MII=y
445CONFIG_SGI_IOC3_ETH=y
446CONFIG_SGI_IOC3_ETH_HW_RX_CSUM=y
447CONFIG_SGI_IOC3_ETH_HW_TX_CSUM=y
448# CONFIG_HAPPYMEAL is not set 535# CONFIG_HAPPYMEAL is not set
449# CONFIG_SUNGEM is not set 536# CONFIG_SUNGEM is not set
450# CONFIG_NET_VENDOR_3COM is not set 537# CONFIG_NET_VENDOR_3COM is not set
@@ -466,12 +553,16 @@ CONFIG_SGI_IOC3_ETH_HW_TX_CSUM=y
466# CONFIG_HAMACHI is not set 553# CONFIG_HAMACHI is not set
467# CONFIG_YELLOWFIN is not set 554# CONFIG_YELLOWFIN is not set
468# CONFIG_R8169 is not set 555# CONFIG_R8169 is not set
556# CONFIG_SIS190 is not set
557# CONFIG_SKGE is not set
469# CONFIG_SK98LIN is not set 558# CONFIG_SK98LIN is not set
470# CONFIG_TIGON3 is not set 559# CONFIG_TIGON3 is not set
560# CONFIG_BNX2 is not set
471 561
472# 562#
473# Ethernet (10000 Mbit) 563# Ethernet (10000 Mbit)
474# 564#
565# CONFIG_CHELSIO_T1 is not set
475# CONFIG_IXGB is not set 566# CONFIG_IXGB is not set
476# CONFIG_S2IO is not set 567# CONFIG_S2IO is not set
477 568
@@ -484,6 +575,8 @@ CONFIG_SGI_IOC3_ETH_HW_TX_CSUM=y
484# Wireless LAN (non-hamradio) 575# Wireless LAN (non-hamradio)
485# 576#
486# CONFIG_NET_RADIO is not set 577# CONFIG_NET_RADIO is not set
578# CONFIG_IPW_DEBUG is not set
579CONFIG_IPW2200=m
487 580
488# 581#
489# Wan interfaces 582# Wan interfaces
@@ -496,6 +589,8 @@ CONFIG_SGI_IOC3_ETH_HW_TX_CSUM=y
496# CONFIG_NET_FC is not set 589# CONFIG_NET_FC is not set
497# CONFIG_SHAPER is not set 590# CONFIG_SHAPER is not set
498# CONFIG_NETCONSOLE is not set 591# CONFIG_NETCONSOLE is not set
592# CONFIG_NETPOLL is not set
593# CONFIG_NET_POLL_CONTROLLER is not set
499 594
500# 595#
501# ISDN subsystem 596# ISDN subsystem
@@ -513,25 +608,15 @@ CONFIG_SGI_IOC3_ETH_HW_TX_CSUM=y
513# CONFIG_INPUT is not set 608# CONFIG_INPUT is not set
514 609
515# 610#
516# Userland interfaces 611# Hardware I/O ports
517#
518
519#
520# Input I/O drivers
521# 612#
522# CONFIG_GAMEPORT is not set
523CONFIG_SOUND_GAMEPORT=y
524CONFIG_SERIO=y 613CONFIG_SERIO=y
525# CONFIG_SERIO_I8042 is not set 614# CONFIG_SERIO_I8042 is not set
526CONFIG_SERIO_SERPORT=y 615CONFIG_SERIO_SERPORT=y
527# CONFIG_SERIO_CT82C710 is not set
528# CONFIG_SERIO_PCIPS2 is not set 616# CONFIG_SERIO_PCIPS2 is not set
529# CONFIG_SERIO_LIBPS2 is not set 617CONFIG_SERIO_LIBPS2=m
530CONFIG_SERIO_RAW=m 618CONFIG_SERIO_RAW=m
531 619# CONFIG_GAMEPORT is not set
532#
533# Input Device Drivers
534#
535 620
536# 621#
537# Character devices 622# Character devices
@@ -549,7 +634,6 @@ CONFIG_SERIAL_8250_EXTENDED=y
549CONFIG_SERIAL_8250_MANY_PORTS=y 634CONFIG_SERIAL_8250_MANY_PORTS=y
550CONFIG_SERIAL_8250_SHARE_IRQ=y 635CONFIG_SERIAL_8250_SHARE_IRQ=y
551# CONFIG_SERIAL_8250_DETECT_IRQ is not set 636# CONFIG_SERIAL_8250_DETECT_IRQ is not set
552# CONFIG_SERIAL_8250_MULTIPORT is not set
553# CONFIG_SERIAL_8250_RSA is not set 637# CONFIG_SERIAL_8250_RSA is not set
554 638
555# 639#
@@ -557,6 +641,7 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
557# 641#
558CONFIG_SERIAL_CORE=y 642CONFIG_SERIAL_CORE=y
559CONFIG_SERIAL_CORE_CONSOLE=y 643CONFIG_SERIAL_CORE_CONSOLE=y
644# CONFIG_SERIAL_JSM is not set
560CONFIG_UNIX98_PTYS=y 645CONFIG_UNIX98_PTYS=y
561CONFIG_LEGACY_PTYS=y 646CONFIG_LEGACY_PTYS=y
562CONFIG_LEGACY_PTY_COUNT=256 647CONFIG_LEGACY_PTY_COUNT=256
@@ -584,6 +669,11 @@ CONFIG_SGI_IP27_RTC=y
584# CONFIG_RAW_DRIVER is not set 669# CONFIG_RAW_DRIVER is not set
585 670
586# 671#
672# TPM devices
673#
674# CONFIG_TCG_TPM is not set
675
676#
587# I2C support 677# I2C support
588# 678#
589# CONFIG_I2C is not set 679# CONFIG_I2C is not set
@@ -594,10 +684,20 @@ CONFIG_SGI_IP27_RTC=y
594# CONFIG_W1 is not set 684# CONFIG_W1 is not set
595 685
596# 686#
687# Hardware Monitoring support
688#
689# CONFIG_HWMON is not set
690# CONFIG_HWMON_VID is not set
691
692#
597# Misc devices 693# Misc devices
598# 694#
599 695
600# 696#
697# Multimedia Capabilities Port drivers
698#
699
700#
601# Multimedia devices 701# Multimedia devices
602# 702#
603# CONFIG_VIDEO_DEV is not set 703# CONFIG_VIDEO_DEV is not set
@@ -611,7 +711,6 @@ CONFIG_SGI_IP27_RTC=y
611# Graphics support 711# Graphics support
612# 712#
613# CONFIG_FB is not set 713# CONFIG_FB is not set
614# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
615 714
616# 715#
617# Sound 716# Sound
@@ -621,13 +720,9 @@ CONFIG_SGI_IP27_RTC=y
621# 720#
622# USB support 721# USB support
623# 722#
624# CONFIG_USB is not set
625CONFIG_USB_ARCH_HAS_HCD=y 723CONFIG_USB_ARCH_HAS_HCD=y
626CONFIG_USB_ARCH_HAS_OHCI=y 724CONFIG_USB_ARCH_HAS_OHCI=y
627 725# CONFIG_USB is not set
628#
629# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
630#
631 726
632# 727#
633# USB Gadget Support 728# USB Gadget Support
@@ -645,12 +740,17 @@ CONFIG_USB_ARCH_HAS_OHCI=y
645# CONFIG_INFINIBAND is not set 740# CONFIG_INFINIBAND is not set
646 741
647# 742#
743# SN Devices
744#
745
746#
648# File systems 747# File systems
649# 748#
650CONFIG_EXT2_FS=y 749CONFIG_EXT2_FS=y
651CONFIG_EXT2_FS_XATTR=y 750CONFIG_EXT2_FS_XATTR=y
652CONFIG_EXT2_FS_POSIX_ACL=y 751CONFIG_EXT2_FS_POSIX_ACL=y
653CONFIG_EXT2_FS_SECURITY=y 752CONFIG_EXT2_FS_SECURITY=y
753# CONFIG_EXT2_FS_XIP is not set
654CONFIG_EXT3_FS=y 754CONFIG_EXT3_FS=y
655CONFIG_EXT3_FS_XATTR=y 755CONFIG_EXT3_FS_XATTR=y
656CONFIG_EXT3_FS_POSIX_ACL=y 756CONFIG_EXT3_FS_POSIX_ACL=y
@@ -662,17 +762,19 @@ CONFIG_FS_MBCACHE=y
662# CONFIG_JFS_FS is not set 762# CONFIG_JFS_FS is not set
663CONFIG_FS_POSIX_ACL=y 763CONFIG_FS_POSIX_ACL=y
664CONFIG_XFS_FS=m 764CONFIG_XFS_FS=m
665# CONFIG_XFS_RT is not set 765CONFIG_XFS_QUOTA=m
666CONFIG_XFS_QUOTA=y
667CONFIG_XFS_SECURITY=y 766CONFIG_XFS_SECURITY=y
668CONFIG_XFS_POSIX_ACL=y 767CONFIG_XFS_POSIX_ACL=y
768# CONFIG_XFS_RT is not set
669# CONFIG_MINIX_FS is not set 769# CONFIG_MINIX_FS is not set
670# CONFIG_ROMFS_FS is not set 770# CONFIG_ROMFS_FS is not set
771CONFIG_INOTIFY=y
671# CONFIG_QUOTA is not set 772# CONFIG_QUOTA is not set
672CONFIG_QUOTACTL=y 773CONFIG_QUOTACTL=y
673CONFIG_DNOTIFY=y 774CONFIG_DNOTIFY=y
674CONFIG_AUTOFS_FS=m 775CONFIG_AUTOFS_FS=m
675# CONFIG_AUTOFS4_FS is not set 776# CONFIG_AUTOFS4_FS is not set
777CONFIG_FUSE_FS=m
676 778
677# 779#
678# CD-ROM/DVD Filesystems 780# CD-ROM/DVD Filesystems
@@ -693,12 +795,10 @@ CONFIG_AUTOFS_FS=m
693CONFIG_PROC_FS=y 795CONFIG_PROC_FS=y
694CONFIG_PROC_KCORE=y 796CONFIG_PROC_KCORE=y
695CONFIG_SYSFS=y 797CONFIG_SYSFS=y
696# CONFIG_DEVFS_FS is not set
697CONFIG_DEVPTS_FS_XATTR=y
698CONFIG_DEVPTS_FS_SECURITY=y
699# CONFIG_TMPFS is not set 798# CONFIG_TMPFS is not set
700# CONFIG_HUGETLB_PAGE is not set 799# CONFIG_HUGETLB_PAGE is not set
701CONFIG_RAMFS=y 800CONFIG_RAMFS=y
801CONFIG_RELAYFS_FS=m
702 802
703# 803#
704# Miscellaneous filesystems 804# Miscellaneous filesystems
@@ -722,13 +822,14 @@ CONFIG_RAMFS=y
722# 822#
723CONFIG_NFS_FS=y 823CONFIG_NFS_FS=y
724CONFIG_NFS_V3=y 824CONFIG_NFS_V3=y
825# CONFIG_NFS_V3_ACL is not set
725# CONFIG_NFS_V4 is not set 826# CONFIG_NFS_V4 is not set
726# CONFIG_NFS_DIRECTIO is not set 827# CONFIG_NFS_DIRECTIO is not set
727# CONFIG_NFSD is not set 828# CONFIG_NFSD is not set
728# CONFIG_ROOT_NFS is not set 829# CONFIG_ROOT_NFS is not set
729CONFIG_LOCKD=y 830CONFIG_LOCKD=y
730CONFIG_LOCKD_V4=y 831CONFIG_LOCKD_V4=y
731# CONFIG_EXPORTFS is not set 832CONFIG_NFS_COMMON=y
732CONFIG_SUNRPC=y 833CONFIG_SUNRPC=y
733CONFIG_SUNRPC_GSS=y 834CONFIG_SUNRPC_GSS=y
734CONFIG_RPCSEC_GSS_KRB5=y 835CONFIG_RPCSEC_GSS_KRB5=y
@@ -738,6 +839,7 @@ CONFIG_RPCSEC_GSS_KRB5=y
738# CONFIG_NCP_FS is not set 839# CONFIG_NCP_FS is not set
739# CONFIG_CODA_FS is not set 840# CONFIG_CODA_FS is not set
740# CONFIG_AFS_FS is not set 841# CONFIG_AFS_FS is not set
842# CONFIG_9P_FS is not set
741 843
742# 844#
743# Partition Types 845# Partition Types
@@ -772,7 +874,9 @@ CONFIG_SGI_PARTITION=y
772# 874#
773# Kernel hacking 875# Kernel hacking
774# 876#
877# CONFIG_PRINTK_TIME is not set
775# CONFIG_DEBUG_KERNEL is not set 878# CONFIG_DEBUG_KERNEL is not set
879CONFIG_LOG_BUF_SHIFT=15
776CONFIG_CROSSCOMPILE=y 880CONFIG_CROSSCOMPILE=y
777CONFIG_CMDLINE="" 881CONFIG_CMDLINE=""
778 882
@@ -788,28 +892,29 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
788# 892#
789CONFIG_CRYPTO=y 893CONFIG_CRYPTO=y
790CONFIG_CRYPTO_HMAC=y 894CONFIG_CRYPTO_HMAC=y
791CONFIG_CRYPTO_NULL=y 895CONFIG_CRYPTO_NULL=m
792CONFIG_CRYPTO_MD4=y 896CONFIG_CRYPTO_MD4=m
793CONFIG_CRYPTO_MD5=y 897CONFIG_CRYPTO_MD5=y
794CONFIG_CRYPTO_SHA1=y 898CONFIG_CRYPTO_SHA1=m
795CONFIG_CRYPTO_SHA256=y 899CONFIG_CRYPTO_SHA256=m
796CONFIG_CRYPTO_SHA512=y 900CONFIG_CRYPTO_SHA512=m
797CONFIG_CRYPTO_WP512=m 901CONFIG_CRYPTO_WP512=m
902CONFIG_CRYPTO_TGR192=m
798CONFIG_CRYPTO_DES=y 903CONFIG_CRYPTO_DES=y
799CONFIG_CRYPTO_BLOWFISH=y 904CONFIG_CRYPTO_BLOWFISH=m
800CONFIG_CRYPTO_TWOFISH=y 905CONFIG_CRYPTO_TWOFISH=m
801CONFIG_CRYPTO_SERPENT=y 906CONFIG_CRYPTO_SERPENT=m
802CONFIG_CRYPTO_AES=m 907CONFIG_CRYPTO_AES=m
803CONFIG_CRYPTO_CAST5=y 908CONFIG_CRYPTO_CAST5=m
804CONFIG_CRYPTO_CAST6=y 909CONFIG_CRYPTO_CAST6=m
805CONFIG_CRYPTO_TEA=m 910CONFIG_CRYPTO_TEA=m
806CONFIG_CRYPTO_ARC4=y 911CONFIG_CRYPTO_ARC4=m
807CONFIG_CRYPTO_KHAZAD=m 912CONFIG_CRYPTO_KHAZAD=m
808CONFIG_CRYPTO_ANUBIS=m 913CONFIG_CRYPTO_ANUBIS=m
809CONFIG_CRYPTO_DEFLATE=y 914CONFIG_CRYPTO_DEFLATE=m
810CONFIG_CRYPTO_MICHAEL_MIC=y 915CONFIG_CRYPTO_MICHAEL_MIC=m
811CONFIG_CRYPTO_CRC32C=m 916CONFIG_CRYPTO_CRC32C=m
812CONFIG_CRYPTO_TEST=m 917# CONFIG_CRYPTO_TEST is not set
813 918
814# 919#
815# Hardware crypto devices 920# Hardware crypto devices
@@ -819,9 +924,8 @@ CONFIG_CRYPTO_TEST=m
819# Library routines 924# Library routines
820# 925#
821# CONFIG_CRC_CCITT is not set 926# CONFIG_CRC_CCITT is not set
927CONFIG_CRC16=m
822CONFIG_CRC32=y 928CONFIG_CRC32=y
823CONFIG_LIBCRC32C=m 929CONFIG_LIBCRC32C=m
824CONFIG_ZLIB_INFLATE=y 930CONFIG_ZLIB_INFLATE=m
825CONFIG_ZLIB_DEFLATE=y 931CONFIG_ZLIB_DEFLATE=m
826CONFIG_GENERIC_HARDIRQS=y
827CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/ip32_defconfig b/arch/mips/configs/ip32_defconfig
index b26e1173365d..bf8fb95b21dc 100644
--- a/arch/mips/configs/ip32_defconfig
+++ b/arch/mips/configs/ip32_defconfig
@@ -1,11 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:04 2005 4# Thu Oct 20 22:26:07 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7CONFIG_64BIT=y
8CONFIG_64BIT=y
9 7
10# 8#
11# Code maturity level options 9# Code maturity level options
@@ -13,11 +11,13 @@ CONFIG_64BIT=y
13CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
14CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
15CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
16 15
17# 16#
18# General setup 17# General setup
19# 18#
20CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
21CONFIG_SWAP=y 21CONFIG_SWAP=y
22CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
23# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
@@ -25,13 +25,16 @@ CONFIG_BSD_PROCESS_ACCT=y
25# CONFIG_BSD_PROCESS_ACCT_V3 is not set 25# CONFIG_BSD_PROCESS_ACCT_V3 is not set
26CONFIG_SYSCTL=y 26CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set 27# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14 28CONFIG_HOTPLUG=y
29# CONFIG_HOTPLUG is not set
30CONFIG_KOBJECT_UEVENT=y 29CONFIG_KOBJECT_UEVENT=y
31# CONFIG_IKCONFIG is not set 30# CONFIG_IKCONFIG is not set
31CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y 32CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y 33CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_EXTRA_PASS is not set 34# CONFIG_KALLSYMS_EXTRA_PASS is not set
35CONFIG_PRINTK=y
36CONFIG_BUG=y
37CONFIG_BASE_FULL=y
35CONFIG_FUTEX=y 38CONFIG_FUTEX=y
36CONFIG_EPOLL=y 39CONFIG_EPOLL=y
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 40# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -41,6 +44,7 @@ CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0 44CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0 45CONFIG_CC_ALIGN_JUMPS=0
43# CONFIG_TINY_SHMEM is not set 46# CONFIG_TINY_SHMEM is not set
47CONFIG_BASE_SMALL=0
44 48
45# 49#
46# Loadable module support 50# Loadable module support
@@ -50,42 +54,71 @@ CONFIG_CC_ALIGN_JUMPS=0
50# 54#
51# Machine selection 55# Machine selection
52# 56#
53# CONFIG_MACH_JAZZ is not set 57# CONFIG_MIPS_MTX1 is not set
54# CONFIG_MACH_VR41XX is not set 58# CONFIG_MIPS_BOSPORUS is not set
59# CONFIG_MIPS_PB1000 is not set
60# CONFIG_MIPS_PB1100 is not set
61# CONFIG_MIPS_PB1500 is not set
62# CONFIG_MIPS_PB1550 is not set
63# CONFIG_MIPS_PB1200 is not set
64# CONFIG_MIPS_DB1000 is not set
65# CONFIG_MIPS_DB1100 is not set
66# CONFIG_MIPS_DB1500 is not set
67# CONFIG_MIPS_DB1550 is not set
68# CONFIG_MIPS_DB1200 is not set
69# CONFIG_MIPS_MIRAGE is not set
55# CONFIG_MIPS_COBALT is not set 70# CONFIG_MIPS_COBALT is not set
56# CONFIG_MACH_DECSTATION is not set 71# CONFIG_MACH_DECSTATION is not set
57# CONFIG_MIPS_EV64120 is not set 72# CONFIG_MIPS_EV64120 is not set
58# CONFIG_MIPS_EV96100 is not set 73# CONFIG_MIPS_EV96100 is not set
59# CONFIG_MIPS_IVR is not set 74# CONFIG_MIPS_IVR is not set
60# CONFIG_LASAT is not set
61# CONFIG_MIPS_ITE8172 is not set 75# CONFIG_MIPS_ITE8172 is not set
76# CONFIG_MACH_JAZZ is not set
77# CONFIG_LASAT is not set
62# CONFIG_MIPS_ATLAS is not set 78# CONFIG_MIPS_ATLAS is not set
63# CONFIG_MIPS_MALTA is not set 79# CONFIG_MIPS_MALTA is not set
64# CONFIG_MIPS_SEAD is not set 80# CONFIG_MIPS_SEAD is not set
81# CONFIG_MIPS_SIM is not set
82# CONFIG_MOMENCO_JAGUAR_ATX is not set
65# CONFIG_MOMENCO_OCELOT is not set 83# CONFIG_MOMENCO_OCELOT is not set
66# CONFIG_MOMENCO_OCELOT_G is not set
67# CONFIG_MOMENCO_OCELOT_C is not set
68# CONFIG_MOMENCO_OCELOT_3 is not set 84# CONFIG_MOMENCO_OCELOT_3 is not set
69# CONFIG_MOMENCO_JAGUAR_ATX is not set 85# CONFIG_MOMENCO_OCELOT_C is not set
70# CONFIG_PMC_YOSEMITE is not set 86# CONFIG_MOMENCO_OCELOT_G is not set
87# CONFIG_MIPS_XXS1500 is not set
88# CONFIG_PNX8550_V2PCI is not set
89# CONFIG_PNX8550_JBS is not set
71# CONFIG_DDB5074 is not set 90# CONFIG_DDB5074 is not set
72# CONFIG_DDB5476 is not set 91# CONFIG_DDB5476 is not set
73# CONFIG_DDB5477 is not set 92# CONFIG_DDB5477 is not set
74# CONFIG_NEC_OSPREY is not set 93# CONFIG_MACH_VR41XX is not set
94# CONFIG_PMC_YOSEMITE is not set
95# CONFIG_QEMU is not set
75# CONFIG_SGI_IP22 is not set 96# CONFIG_SGI_IP22 is not set
76# CONFIG_SGI_IP27 is not set 97# CONFIG_SGI_IP27 is not set
77CONFIG_SGI_IP32=y 98CONFIG_SGI_IP32=y
78# CONFIG_SIBYTE_SB1xxx_SOC is not set 99# CONFIG_SIBYTE_BIGSUR is not set
100# CONFIG_SIBYTE_SWARM is not set
101# CONFIG_SIBYTE_SENTOSA is not set
102# CONFIG_SIBYTE_RHONE is not set
103# CONFIG_SIBYTE_CARMEL is not set
104# CONFIG_SIBYTE_PTSWARM is not set
105# CONFIG_SIBYTE_LITTLESUR is not set
106# CONFIG_SIBYTE_CRHINE is not set
107# CONFIG_SIBYTE_CRHONE is not set
79# CONFIG_SNI_RM200_PCI is not set 108# CONFIG_SNI_RM200_PCI is not set
109# CONFIG_TOSHIBA_JMR3927 is not set
110# CONFIG_TOSHIBA_RBTX4927 is not set
111# CONFIG_TOSHIBA_RBTX4938 is not set
80CONFIG_RWSEM_GENERIC_SPINLOCK=y 112CONFIG_RWSEM_GENERIC_SPINLOCK=y
81CONFIG_GENERIC_CALIBRATE_DELAY=y 113CONFIG_GENERIC_CALIBRATE_DELAY=y
82CONFIG_HAVE_DEC_LOCK=y
83CONFIG_ARC=y 114CONFIG_ARC=y
84CONFIG_DMA_IP32=y 115CONFIG_DMA_IP32=y
85CONFIG_OWN_DMA=y
86CONFIG_DMA_NONCOHERENT=y 116CONFIG_DMA_NONCOHERENT=y
87CONFIG_DMA_NEED_PCI_MAP_STATE=y 117CONFIG_DMA_NEED_PCI_MAP_STATE=y
118CONFIG_OWN_DMA=y
119CONFIG_CPU_BIG_ENDIAN=y
88# CONFIG_CPU_LITTLE_ENDIAN is not set 120# CONFIG_CPU_LITTLE_ENDIAN is not set
121CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
89CONFIG_ARC32=y 122CONFIG_ARC32=y
90CONFIG_BOOT_ELF32=y 123CONFIG_BOOT_ELF32=y
91CONFIG_MIPS_L1_CACHE_SHIFT=5 124CONFIG_MIPS_L1_CACHE_SHIFT=5
@@ -95,8 +128,10 @@ CONFIG_ARC_PROMLIB=y
95# 128#
96# CPU selection 129# CPU selection
97# 130#
98# CONFIG_CPU_MIPS32 is not set 131# CONFIG_CPU_MIPS32_R1 is not set
99# CONFIG_CPU_MIPS64 is not set 132# CONFIG_CPU_MIPS32_R2 is not set
133# CONFIG_CPU_MIPS64_R1 is not set
134# CONFIG_CPU_MIPS64_R2 is not set
100# CONFIG_CPU_R3000 is not set 135# CONFIG_CPU_R3000 is not set
101# CONFIG_CPU_TX39XX is not set 136# CONFIG_CPU_TX39XX is not set
102# CONFIG_CPU_VR41XX is not set 137# CONFIG_CPU_VR41XX is not set
@@ -112,6 +147,17 @@ CONFIG_CPU_R5000=y
112# CONFIG_CPU_RM7000 is not set 147# CONFIG_CPU_RM7000 is not set
113# CONFIG_CPU_RM9000 is not set 148# CONFIG_CPU_RM9000 is not set
114# CONFIG_CPU_SB1 is not set 149# CONFIG_CPU_SB1 is not set
150CONFIG_SYS_HAS_CPU_R5000=y
151CONFIG_SYS_HAS_CPU_RM7000=y
152CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
153CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
154CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
155
156#
157# Kernel type
158#
159# CONFIG_32BIT is not set
160CONFIG_64BIT=y
115CONFIG_PAGE_SIZE_4KB=y 161CONFIG_PAGE_SIZE_4KB=y
116# CONFIG_PAGE_SIZE_8KB is not set 162# CONFIG_PAGE_SIZE_8KB is not set
117# CONFIG_PAGE_SIZE_16KB is not set 163# CONFIG_PAGE_SIZE_16KB is not set
@@ -119,9 +165,22 @@ CONFIG_PAGE_SIZE_4KB=y
119CONFIG_BOARD_SCACHE=y 165CONFIG_BOARD_SCACHE=y
120CONFIG_R5000_CPU_SCACHE=y 166CONFIG_R5000_CPU_SCACHE=y
121CONFIG_RM7000_CPU_SCACHE=y 167CONFIG_RM7000_CPU_SCACHE=y
168# CONFIG_MIPS_MT is not set
122CONFIG_CPU_HAS_LLSC=y 169CONFIG_CPU_HAS_LLSC=y
123CONFIG_CPU_HAS_LLDSCD=y 170CONFIG_CPU_HAS_LLDSCD=y
124CONFIG_CPU_HAS_SYNC=y 171CONFIG_CPU_HAS_SYNC=y
172CONFIG_GENERIC_HARDIRQS=y
173CONFIG_GENERIC_IRQ_PROBE=y
174CONFIG_ARCH_FLATMEM_ENABLE=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
182# CONFIG_PREEMPT_NONE is not set
183CONFIG_PREEMPT_VOLUNTARY=y
125# CONFIG_PREEMPT is not set 184# CONFIG_PREEMPT is not set
126 185
127# 186#
@@ -130,7 +189,6 @@ CONFIG_CPU_HAS_SYNC=y
130CONFIG_HW_HAS_PCI=y 189CONFIG_HW_HAS_PCI=y
131CONFIG_PCI=y 190CONFIG_PCI=y
132CONFIG_PCI_LEGACY_PROC=y 191CONFIG_PCI_LEGACY_PROC=y
133CONFIG_PCI_NAMES=y
134CONFIG_MMU=y 192CONFIG_MMU=y
135 193
136# 194#
@@ -139,10 +197,6 @@ CONFIG_MMU=y
139# CONFIG_PCCARD is not set 197# CONFIG_PCCARD is not set
140 198
141# 199#
142# PC-card bridges
143#
144
145#
146# PCI Hotplug Support 200# PCI Hotplug Support
147# 201#
148# CONFIG_HOTPLUG_PCI is not set 202# CONFIG_HOTPLUG_PCI is not set
@@ -160,6 +214,80 @@ CONFIG_MIPS32_O32=y
160CONFIG_BINFMT_ELF32=y 214CONFIG_BINFMT_ELF32=y
161 215
162# 216#
217# Networking
218#
219CONFIG_NET=y
220
221#
222# Networking options
223#
224CONFIG_PACKET=y
225CONFIG_PACKET_MMAP=y
226CONFIG_UNIX=y
227CONFIG_XFRM=y
228CONFIG_XFRM_USER=y
229CONFIG_NET_KEY=y
230CONFIG_INET=y
231# CONFIG_IP_MULTICAST is not set
232# CONFIG_IP_ADVANCED_ROUTER is not set
233CONFIG_IP_FIB_HASH=y
234CONFIG_IP_PNP=y
235# CONFIG_IP_PNP_DHCP is not set
236CONFIG_IP_PNP_BOOTP=y
237# CONFIG_IP_PNP_RARP is not set
238# CONFIG_NET_IPIP is not set
239# CONFIG_NET_IPGRE is not set
240# CONFIG_ARPD is not set
241# CONFIG_SYN_COOKIES is not set
242# CONFIG_INET_AH is not set
243# CONFIG_INET_ESP is not set
244# CONFIG_INET_IPCOMP is not set
245CONFIG_INET_TUNNEL=y
246CONFIG_INET_DIAG=y
247CONFIG_INET_TCP_DIAG=y
248# CONFIG_TCP_CONG_ADVANCED is not set
249CONFIG_TCP_CONG_BIC=y
250# CONFIG_IPV6 is not set
251# CONFIG_NETFILTER is not set
252
253#
254# DCCP Configuration (EXPERIMENTAL)
255#
256# CONFIG_IP_DCCP is not set
257
258#
259# SCTP Configuration (EXPERIMENTAL)
260#
261# CONFIG_IP_SCTP is not set
262# CONFIG_ATM is not set
263# CONFIG_BRIDGE is not set
264# CONFIG_VLAN_8021Q is not set
265# CONFIG_DECNET is not set
266# CONFIG_LLC2 is not set
267# CONFIG_IPX is not set
268# CONFIG_ATALK is not set
269# CONFIG_X25 is not set
270# CONFIG_LAPB is not set
271# CONFIG_NET_DIVERT is not set
272# CONFIG_ECONET is not set
273# CONFIG_WAN_ROUTER is not set
274# CONFIG_NET_SCHED is not set
275# CONFIG_NET_CLS_ROUTE 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
284CONFIG_IEEE80211=y
285# CONFIG_IEEE80211_DEBUG is not set
286CONFIG_IEEE80211_CRYPT_WEP=y
287CONFIG_IEEE80211_CRYPT_CCMP=y
288CONFIG_IEEE80211_CRYPT_TKIP=y
289
290#
163# Device Drivers 291# Device Drivers
164# 292#
165 293
@@ -168,7 +296,12 @@ CONFIG_BINFMT_ELF32=y
168# 296#
169CONFIG_STANDALONE=y 297CONFIG_STANDALONE=y
170CONFIG_PREVENT_FIRMWARE_BUILD=y 298CONFIG_PREVENT_FIRMWARE_BUILD=y
171# CONFIG_FW_LOADER is not set 299CONFIG_FW_LOADER=y
300
301#
302# Connector - unified userspace <-> kernelspace linker
303#
304CONFIG_CONNECTOR=y
172 305
173# 306#
174# Memory Technology Devices (MTD) 307# Memory Technology Devices (MTD)
@@ -187,7 +320,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
187# 320#
188# Block devices 321# Block devices
189# 322#
190# CONFIG_BLK_DEV_FD is not set
191# CONFIG_BLK_CPQ_DA is not set 323# CONFIG_BLK_CPQ_DA is not set
192# CONFIG_BLK_CPQ_CISS_DA is not set 324# CONFIG_BLK_CPQ_CISS_DA is not set
193# CONFIG_BLK_DEV_DAC960 is not set 325# CONFIG_BLK_DEV_DAC960 is not set
@@ -199,7 +331,6 @@ CONFIG_BLK_DEV_LOOP=y
199# CONFIG_BLK_DEV_SX8 is not set 331# CONFIG_BLK_DEV_SX8 is not set
200# CONFIG_BLK_DEV_RAM is not set 332# CONFIG_BLK_DEV_RAM is not set
201CONFIG_BLK_DEV_RAM_COUNT=16 333CONFIG_BLK_DEV_RAM_COUNT=16
202CONFIG_INITRAMFS_SOURCE=""
203CONFIG_CDROM_PKTCDVD=y 334CONFIG_CDROM_PKTCDVD=y
204CONFIG_CDROM_PKTCDVD_BUFFERS=8 335CONFIG_CDROM_PKTCDVD_BUFFERS=8
205# CONFIG_CDROM_PKTCDVD_WCACHE is not set 336# CONFIG_CDROM_PKTCDVD_WCACHE is not set
@@ -221,6 +352,7 @@ CONFIG_ATA_OVER_ETH=y
221# 352#
222# SCSI device support 353# SCSI device support
223# 354#
355CONFIG_RAID_ATTRS=y
224CONFIG_SCSI=y 356CONFIG_SCSI=y
225CONFIG_SCSI_PROC_FS=y 357CONFIG_SCSI_PROC_FS=y
226 358
@@ -233,6 +365,7 @@ CONFIG_CHR_DEV_OSST=y
233CONFIG_BLK_DEV_SR=y 365CONFIG_BLK_DEV_SR=y
234CONFIG_BLK_DEV_SR_VENDOR=y 366CONFIG_BLK_DEV_SR_VENDOR=y
235CONFIG_CHR_DEV_SG=y 367CONFIG_CHR_DEV_SG=y
368# CONFIG_CHR_DEV_SCH is not set
236 369
237# 370#
238# Some SCSI devices (e.g. CD jukebox) support multiple LUNs 371# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
@@ -244,9 +377,10 @@ CONFIG_SCSI_LOGGING=y
244# 377#
245# SCSI Transport Attributes 378# SCSI Transport Attributes
246# 379#
247# CONFIG_SCSI_SPI_ATTRS is not set 380CONFIG_SCSI_SPI_ATTRS=y
248# CONFIG_SCSI_FC_ATTRS is not set 381# CONFIG_SCSI_FC_ATTRS is not set
249# CONFIG_SCSI_ISCSI_ATTRS is not set 382# CONFIG_SCSI_ISCSI_ATTRS is not set
383CONFIG_SCSI_SAS_ATTRS=y
250 384
251# 385#
252# SCSI low-level drivers 386# SCSI low-level drivers
@@ -266,18 +400,13 @@ CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
266# CONFIG_MEGARAID_NEWGEN is not set 400# CONFIG_MEGARAID_NEWGEN is not set
267# CONFIG_MEGARAID_LEGACY is not set 401# CONFIG_MEGARAID_LEGACY is not set
268# CONFIG_SCSI_SATA is not set 402# CONFIG_SCSI_SATA is not set
269# CONFIG_SCSI_BUSLOGIC is not set
270# CONFIG_SCSI_DMX3191D is not set 403# CONFIG_SCSI_DMX3191D is not set
271# CONFIG_SCSI_EATA is not set
272# CONFIG_SCSI_EATA_PIO is not set
273# CONFIG_SCSI_FUTURE_DOMAIN is not set 404# CONFIG_SCSI_FUTURE_DOMAIN is not set
274# CONFIG_SCSI_GDTH is not set
275# CONFIG_SCSI_IPS is not set 405# CONFIG_SCSI_IPS is not set
276# CONFIG_SCSI_INITIO is not set 406# CONFIG_SCSI_INITIO is not set
277# CONFIG_SCSI_INIA100 is not set 407# CONFIG_SCSI_INIA100 is not set
278# CONFIG_SCSI_SYM53C8XX_2 is not set 408# CONFIG_SCSI_SYM53C8XX_2 is not set
279# CONFIG_SCSI_IPR is not set 409# CONFIG_SCSI_IPR is not set
280# CONFIG_SCSI_QLOGIC_ISP is not set
281# CONFIG_SCSI_QLOGIC_FC is not set 410# CONFIG_SCSI_QLOGIC_FC is not set
282# CONFIG_SCSI_QLOGIC_1280 is not set 411# CONFIG_SCSI_QLOGIC_1280 is not set
283CONFIG_SCSI_QLA2XXX=y 412CONFIG_SCSI_QLA2XXX=y
@@ -286,6 +415,8 @@ CONFIG_SCSI_QLA2XXX=y
286# CONFIG_SCSI_QLA2300 is not set 415# CONFIG_SCSI_QLA2300 is not set
287# CONFIG_SCSI_QLA2322 is not set 416# CONFIG_SCSI_QLA2322 is not set
288# CONFIG_SCSI_QLA6312 is not set 417# CONFIG_SCSI_QLA6312 is not set
418# CONFIG_SCSI_QLA24XX is not set
419# CONFIG_SCSI_LPFC is not set
289# CONFIG_SCSI_DC395x is not set 420# CONFIG_SCSI_DC395x is not set
290# CONFIG_SCSI_DC390T is not set 421# CONFIG_SCSI_DC390T is not set
291# CONFIG_SCSI_DEBUG is not set 422# CONFIG_SCSI_DEBUG is not set
@@ -299,6 +430,8 @@ CONFIG_SCSI_QLA2XXX=y
299# Fusion MPT device support 430# Fusion MPT device support
300# 431#
301# CONFIG_FUSION is not set 432# CONFIG_FUSION is not set
433# CONFIG_FUSION_SPI is not set
434# CONFIG_FUSION_FC is not set
302 435
303# 436#
304# IEEE 1394 (FireWire) support 437# IEEE 1394 (FireWire) support
@@ -311,78 +444,13 @@ CONFIG_SCSI_QLA2XXX=y
311# CONFIG_I2O is not set 444# CONFIG_I2O is not set
312 445
313# 446#
314# Networking support 447# Network device support
315#
316CONFIG_NET=y
317
318#
319# Networking options
320#
321CONFIG_PACKET=y
322CONFIG_PACKET_MMAP=y
323CONFIG_NETLINK_DEV=y
324CONFIG_UNIX=y
325CONFIG_NET_KEY=y
326CONFIG_INET=y
327# CONFIG_IP_MULTICAST is not set
328# CONFIG_IP_ADVANCED_ROUTER is not set
329CONFIG_IP_PNP=y
330# CONFIG_IP_PNP_DHCP is not set
331CONFIG_IP_PNP_BOOTP=y
332# CONFIG_IP_PNP_RARP is not set
333# CONFIG_NET_IPIP is not set
334# CONFIG_NET_IPGRE is not set
335# CONFIG_ARPD is not set
336# CONFIG_SYN_COOKIES is not set
337# CONFIG_INET_AH is not set
338# CONFIG_INET_ESP is not set
339# CONFIG_INET_IPCOMP is not set
340CONFIG_INET_TUNNEL=y
341CONFIG_IP_TCPDIAG=y
342# CONFIG_IP_TCPDIAG_IPV6 is not set
343# CONFIG_IPV6 is not set
344# CONFIG_NETFILTER is not set
345CONFIG_XFRM=y
346CONFIG_XFRM_USER=y
347
348#
349# SCTP Configuration (EXPERIMENTAL)
350# 448#
351# CONFIG_IP_SCTP is not set
352# CONFIG_ATM is not set
353# CONFIG_BRIDGE is not set
354# CONFIG_VLAN_8021Q is not set
355# CONFIG_DECNET is not set
356# CONFIG_LLC2 is not set
357# CONFIG_IPX is not set
358# CONFIG_ATALK is not set
359# CONFIG_X25 is not set
360# CONFIG_LAPB is not set
361# CONFIG_NET_DIVERT is not set
362# CONFIG_ECONET is not set
363# CONFIG_WAN_ROUTER is not set
364
365#
366# QoS and/or fair queueing
367#
368# CONFIG_NET_SCHED is not set
369# CONFIG_NET_CLS_ROUTE is not set
370
371#
372# Network testing
373#
374# CONFIG_NET_PKTGEN is not set
375# CONFIG_NETPOLL is not set
376# CONFIG_NET_POLL_CONTROLLER is not set
377# CONFIG_HAMRADIO is not set
378# CONFIG_IRDA is not set
379# CONFIG_BT is not set
380CONFIG_NETDEVICES=y 449CONFIG_NETDEVICES=y
381# CONFIG_DUMMY is not set 450# CONFIG_DUMMY is not set
382# CONFIG_BONDING is not set 451# CONFIG_BONDING is not set
383# CONFIG_EQUALIZER is not set 452# CONFIG_EQUALIZER is not set
384# CONFIG_TUN is not set 453# CONFIG_TUN is not set
385# CONFIG_ETHERTAP is not set
386 454
387# 455#
388# ARCnet devices 456# ARCnet devices
@@ -390,6 +458,21 @@ CONFIG_NETDEVICES=y
390# CONFIG_ARCNET is not set 458# CONFIG_ARCNET is not set
391 459
392# 460#
461# PHY device support
462#
463CONFIG_PHYLIB=y
464CONFIG_PHYCONTROL=y
465
466#
467# MII PHY device drivers
468#
469CONFIG_MARVELL_PHY=y
470CONFIG_DAVICOM_PHY=y
471CONFIG_QSEMI_PHY=y
472CONFIG_LXT_PHY=y
473CONFIG_CICADA_PHY=y
474
475#
393# Ethernet (10 or 100Mbit) 476# Ethernet (10 or 100Mbit)
394# 477#
395CONFIG_NET_ETHERNET=y 478CONFIG_NET_ETHERNET=y
@@ -416,12 +499,16 @@ CONFIG_SGI_O2MACE_ETH=y
416# CONFIG_HAMACHI is not set 499# CONFIG_HAMACHI is not set
417# CONFIG_YELLOWFIN is not set 500# CONFIG_YELLOWFIN is not set
418# CONFIG_R8169 is not set 501# CONFIG_R8169 is not set
502# CONFIG_SIS190 is not set
503# CONFIG_SKGE is not set
419# CONFIG_SK98LIN is not set 504# CONFIG_SK98LIN is not set
420# CONFIG_TIGON3 is not set 505# CONFIG_TIGON3 is not set
506# CONFIG_BNX2 is not set
421 507
422# 508#
423# Ethernet (10000 Mbit) 509# Ethernet (10000 Mbit)
424# 510#
511# CONFIG_CHELSIO_T1 is not set
425# CONFIG_IXGB is not set 512# CONFIG_IXGB is not set
426# CONFIG_S2IO is not set 513# CONFIG_S2IO is not set
427 514
@@ -434,6 +521,8 @@ CONFIG_SGI_O2MACE_ETH=y
434# Wireless LAN (non-hamradio) 521# Wireless LAN (non-hamradio)
435# 522#
436# CONFIG_NET_RADIO is not set 523# CONFIG_NET_RADIO is not set
524# CONFIG_IPW_DEBUG is not set
525CONFIG_IPW2200=y
437 526
438# 527#
439# Wan interfaces 528# Wan interfaces
@@ -446,6 +535,8 @@ CONFIG_SGI_O2MACE_ETH=y
446# CONFIG_NET_FC is not set 535# CONFIG_NET_FC is not set
447# CONFIG_SHAPER is not set 536# CONFIG_SHAPER is not set
448# CONFIG_NETCONSOLE is not set 537# CONFIG_NETCONSOLE is not set
538# CONFIG_NETPOLL is not set
539# CONFIG_NET_POLL_CONTROLLER is not set
449 540
450# 541#
451# ISDN subsystem 542# ISDN subsystem
@@ -475,27 +566,25 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
475# CONFIG_INPUT_EVBUG is not set 566# CONFIG_INPUT_EVBUG is not set
476 567
477# 568#
478# Input I/O drivers 569# Input Device Drivers
570#
571# CONFIG_INPUT_KEYBOARD is not set
572# CONFIG_INPUT_MOUSE is not set
573# CONFIG_INPUT_JOYSTICK is not set
574# CONFIG_INPUT_TOUCHSCREEN is not set
575# CONFIG_INPUT_MISC is not set
576
577#
578# Hardware I/O ports
479# 579#
480# CONFIG_GAMEPORT is not set
481CONFIG_SOUND_GAMEPORT=y
482CONFIG_SERIO=y 580CONFIG_SERIO=y
483# CONFIG_SERIO_I8042 is not set 581# CONFIG_SERIO_I8042 is not set
484CONFIG_SERIO_SERPORT=y 582CONFIG_SERIO_SERPORT=y
485# CONFIG_SERIO_CT82C710 is not set
486# CONFIG_SERIO_PCIPS2 is not set 583# CONFIG_SERIO_PCIPS2 is not set
487# CONFIG_SERIO_MACEPS2 is not set 584# CONFIG_SERIO_MACEPS2 is not set
488# CONFIG_SERIO_LIBPS2 is not set 585# CONFIG_SERIO_LIBPS2 is not set
489CONFIG_SERIO_RAW=y 586CONFIG_SERIO_RAW=y
490 587# CONFIG_GAMEPORT is not set
491#
492# Input Device Drivers
493#
494# CONFIG_INPUT_KEYBOARD is not set
495# CONFIG_INPUT_MOUSE is not set
496# CONFIG_INPUT_JOYSTICK is not set
497# CONFIG_INPUT_TOUCHSCREEN is not set
498# CONFIG_INPUT_MISC is not set
499 588
500# 589#
501# Character devices 590# Character devices
@@ -518,6 +607,7 @@ CONFIG_SERIAL_8250_NR_UARTS=4
518# 607#
519CONFIG_SERIAL_CORE=y 608CONFIG_SERIAL_CORE=y
520CONFIG_SERIAL_CORE_CONSOLE=y 609CONFIG_SERIAL_CORE_CONSOLE=y
610# CONFIG_SERIAL_JSM is not set
521CONFIG_UNIX98_PTYS=y 611CONFIG_UNIX98_PTYS=y
522CONFIG_LEGACY_PTYS=y 612CONFIG_LEGACY_PTYS=y
523CONFIG_LEGACY_PTY_COUNT=256 613CONFIG_LEGACY_PTY_COUNT=256
@@ -544,6 +634,11 @@ CONFIG_LEGACY_PTY_COUNT=256
544# CONFIG_RAW_DRIVER is not set 634# CONFIG_RAW_DRIVER is not set
545 635
546# 636#
637# TPM devices
638#
639# CONFIG_TCG_TPM is not set
640
641#
547# I2C support 642# I2C support
548# 643#
549# CONFIG_I2C is not set 644# CONFIG_I2C is not set
@@ -554,10 +649,20 @@ CONFIG_LEGACY_PTY_COUNT=256
554# CONFIG_W1 is not set 649# CONFIG_W1 is not set
555 650
556# 651#
652# Hardware Monitoring support
653#
654# CONFIG_HWMON is not set
655# CONFIG_HWMON_VID is not set
656
657#
557# Misc devices 658# Misc devices
558# 659#
559 660
560# 661#
662# Multimedia Capabilities Port drivers
663#
664
665#
561# Multimedia devices 666# Multimedia devices
562# 667#
563# CONFIG_VIDEO_DEV is not set 668# CONFIG_VIDEO_DEV is not set
@@ -577,7 +682,6 @@ CONFIG_LEGACY_PTY_COUNT=256
577# 682#
578# CONFIG_VGA_CONSOLE is not set 683# CONFIG_VGA_CONSOLE is not set
579CONFIG_DUMMY_CONSOLE=y 684CONFIG_DUMMY_CONSOLE=y
580# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
581 685
582# 686#
583# Sound 687# Sound
@@ -587,13 +691,9 @@ CONFIG_DUMMY_CONSOLE=y
587# 691#
588# USB support 692# USB support
589# 693#
590# CONFIG_USB is not set
591CONFIG_USB_ARCH_HAS_HCD=y 694CONFIG_USB_ARCH_HAS_HCD=y
592CONFIG_USB_ARCH_HAS_OHCI=y 695CONFIG_USB_ARCH_HAS_OHCI=y
593 696# CONFIG_USB is not set
594#
595# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
596#
597 697
598# 698#
599# USB Gadget Support 699# USB Gadget Support
@@ -611,21 +711,29 @@ CONFIG_USB_ARCH_HAS_OHCI=y
611# CONFIG_INFINIBAND is not set 711# CONFIG_INFINIBAND is not set
612 712
613# 713#
714# SN Devices
715#
716
717#
614# File systems 718# File systems
615# 719#
616CONFIG_EXT2_FS=y 720CONFIG_EXT2_FS=y
617# CONFIG_EXT2_FS_XATTR is not set 721# CONFIG_EXT2_FS_XATTR is not set
722# CONFIG_EXT2_FS_XIP is not set
618# CONFIG_EXT3_FS is not set 723# CONFIG_EXT3_FS is not set
619# CONFIG_JBD is not set 724# CONFIG_JBD is not set
620# CONFIG_REISERFS_FS is not set 725# CONFIG_REISERFS_FS is not set
621# CONFIG_JFS_FS is not set 726# CONFIG_JFS_FS is not set
727# CONFIG_FS_POSIX_ACL is not set
622# CONFIG_XFS_FS is not set 728# CONFIG_XFS_FS is not set
623# CONFIG_MINIX_FS is not set 729# CONFIG_MINIX_FS is not set
624# CONFIG_ROMFS_FS is not set 730# CONFIG_ROMFS_FS is not set
731CONFIG_INOTIFY=y
625# CONFIG_QUOTA is not set 732# CONFIG_QUOTA is not set
626CONFIG_DNOTIFY=y 733CONFIG_DNOTIFY=y
627# CONFIG_AUTOFS_FS is not set 734# CONFIG_AUTOFS_FS is not set
628# CONFIG_AUTOFS4_FS is not set 735# CONFIG_AUTOFS4_FS is not set
736CONFIG_FUSE_FS=y
629 737
630# 738#
631# CD-ROM/DVD Filesystems 739# CD-ROM/DVD Filesystems
@@ -646,13 +754,10 @@ CONFIG_DNOTIFY=y
646CONFIG_PROC_FS=y 754CONFIG_PROC_FS=y
647CONFIG_PROC_KCORE=y 755CONFIG_PROC_KCORE=y
648CONFIG_SYSFS=y 756CONFIG_SYSFS=y
649# CONFIG_DEVFS_FS is not set
650CONFIG_DEVPTS_FS_XATTR=y
651CONFIG_DEVPTS_FS_SECURITY=y
652CONFIG_TMPFS=y 757CONFIG_TMPFS=y
653# CONFIG_TMPFS_XATTR is not set
654# CONFIG_HUGETLB_PAGE is not set 758# CONFIG_HUGETLB_PAGE is not set
655CONFIG_RAMFS=y 759CONFIG_RAMFS=y
760CONFIG_RELAYFS_FS=y
656 761
657# 762#
658# Miscellaneous filesystems 763# Miscellaneous filesystems
@@ -676,13 +781,14 @@ CONFIG_RAMFS=y
676# 781#
677CONFIG_NFS_FS=y 782CONFIG_NFS_FS=y
678CONFIG_NFS_V3=y 783CONFIG_NFS_V3=y
784# CONFIG_NFS_V3_ACL is not set
679# CONFIG_NFS_V4 is not set 785# CONFIG_NFS_V4 is not set
680# CONFIG_NFS_DIRECTIO is not set 786# CONFIG_NFS_DIRECTIO is not set
681# CONFIG_NFSD is not set 787# CONFIG_NFSD is not set
682CONFIG_ROOT_NFS=y 788CONFIG_ROOT_NFS=y
683CONFIG_LOCKD=y 789CONFIG_LOCKD=y
684CONFIG_LOCKD_V4=y 790CONFIG_LOCKD_V4=y
685# CONFIG_EXPORTFS is not set 791CONFIG_NFS_COMMON=y
686CONFIG_SUNRPC=y 792CONFIG_SUNRPC=y
687# CONFIG_RPCSEC_GSS_KRB5 is not set 793# CONFIG_RPCSEC_GSS_KRB5 is not set
688# CONFIG_RPCSEC_GSS_SPKM3 is not set 794# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -691,6 +797,7 @@ CONFIG_SUNRPC=y
691# CONFIG_NCP_FS is not set 797# CONFIG_NCP_FS is not set
692# CONFIG_CODA_FS is not set 798# CONFIG_CODA_FS is not set
693# CONFIG_AFS_FS is not set 799# CONFIG_AFS_FS is not set
800# CONFIG_9P_FS is not set
694 801
695# 802#
696# Partition Types 803# Partition Types
@@ -721,7 +828,9 @@ CONFIG_SGI_PARTITION=y
721# 828#
722# Kernel hacking 829# Kernel hacking
723# 830#
831# CONFIG_PRINTK_TIME is not set
724# CONFIG_DEBUG_KERNEL is not set 832# CONFIG_DEBUG_KERNEL is not set
833CONFIG_LOG_BUF_SHIFT=14
725CONFIG_CROSSCOMPILE=y 834CONFIG_CROSSCOMPILE=y
726CONFIG_CMDLINE="" 835CONFIG_CMDLINE=""
727 836
@@ -735,7 +844,31 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
735# 844#
736# Cryptographic options 845# Cryptographic options
737# 846#
738# CONFIG_CRYPTO is not set 847CONFIG_CRYPTO=y
848CONFIG_CRYPTO_HMAC=y
849CONFIG_CRYPTO_NULL=y
850CONFIG_CRYPTO_MD4=y
851CONFIG_CRYPTO_MD5=y
852CONFIG_CRYPTO_SHA1=y
853CONFIG_CRYPTO_SHA256=y
854CONFIG_CRYPTO_SHA512=y
855CONFIG_CRYPTO_WP512=y
856CONFIG_CRYPTO_TGR192=y
857CONFIG_CRYPTO_DES=y
858CONFIG_CRYPTO_BLOWFISH=y
859CONFIG_CRYPTO_TWOFISH=y
860CONFIG_CRYPTO_SERPENT=y
861CONFIG_CRYPTO_AES=y
862CONFIG_CRYPTO_CAST5=y
863CONFIG_CRYPTO_CAST6=y
864CONFIG_CRYPTO_TEA=y
865CONFIG_CRYPTO_ARC4=y
866CONFIG_CRYPTO_KHAZAD=y
867CONFIG_CRYPTO_ANUBIS=y
868CONFIG_CRYPTO_DEFLATE=y
869CONFIG_CRYPTO_MICHAEL_MIC=y
870CONFIG_CRYPTO_CRC32C=y
871# CONFIG_CRYPTO_TEST is not set
739 872
740# 873#
741# Hardware crypto devices 874# Hardware crypto devices
@@ -745,7 +878,8 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
745# Library routines 878# Library routines
746# 879#
747# CONFIG_CRC_CCITT is not set 880# CONFIG_CRC_CCITT is not set
748# CONFIG_CRC32 is not set 881CONFIG_CRC16=y
749# CONFIG_LIBCRC32C is not set 882CONFIG_CRC32=y
750CONFIG_GENERIC_HARDIRQS=y 883CONFIG_LIBCRC32C=y
751CONFIG_GENERIC_IRQ_PROBE=y 884CONFIG_ZLIB_INFLATE=y
885CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/mips/configs/it8172_defconfig b/arch/mips/configs/it8172_defconfig
index 08bd3ad64761..0940771bafb1 100644
--- a/arch/mips/configs/it8172_defconfig
+++ b/arch/mips/configs/it8172_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:05 2005 4# Thu Oct 20 22:26:09 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,11 +11,13 @@ CONFIG_32BIT=y
14CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
@@ -26,13 +25,16 @@ CONFIG_BSD_PROCESS_ACCT=y
26# CONFIG_BSD_PROCESS_ACCT_V3 is not set 25# CONFIG_BSD_PROCESS_ACCT_V3 is not set
27CONFIG_SYSCTL=y 26CONFIG_SYSCTL=y
28# CONFIG_AUDIT is not set 27# CONFIG_AUDIT is not set
29CONFIG_LOG_BUF_SHIFT=14
30# CONFIG_HOTPLUG is not set 28# CONFIG_HOTPLUG is not set
31CONFIG_KOBJECT_UEVENT=y 29CONFIG_KOBJECT_UEVENT=y
32# CONFIG_IKCONFIG is not set 30# CONFIG_IKCONFIG is not set
31CONFIG_INITRAMFS_SOURCE=""
33CONFIG_EMBEDDED=y 32CONFIG_EMBEDDED=y
34CONFIG_KALLSYMS=y 33CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_EXTRA_PASS is not set 34# CONFIG_KALLSYMS_EXTRA_PASS is not set
35CONFIG_PRINTK=y
36CONFIG_BUG=y
37CONFIG_BASE_FULL=y
36CONFIG_FUTEX=y 38CONFIG_FUTEX=y
37CONFIG_EPOLL=y 39CONFIG_EPOLL=y
38# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 40# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -42,6 +44,7 @@ CONFIG_CC_ALIGN_LABELS=0
42CONFIG_CC_ALIGN_LOOPS=0 44CONFIG_CC_ALIGN_LOOPS=0
43CONFIG_CC_ALIGN_JUMPS=0 45CONFIG_CC_ALIGN_JUMPS=0
44# CONFIG_TINY_SHMEM is not set 46# CONFIG_TINY_SHMEM is not set
47CONFIG_BASE_SMALL=0
45 48
46# 49#
47# Loadable module support 50# Loadable module support
@@ -57,41 +60,69 @@ CONFIG_KMOD=y
57# 60#
58# Machine selection 61# Machine selection
59# 62#
60# CONFIG_MACH_JAZZ is not set 63# CONFIG_MIPS_MTX1 is not set
61# CONFIG_MACH_VR41XX is not set 64# CONFIG_MIPS_BOSPORUS is not set
62# CONFIG_TOSHIBA_JMR3927 is not set 65# CONFIG_MIPS_PB1000 is not set
66# CONFIG_MIPS_PB1100 is not set
67# CONFIG_MIPS_PB1500 is not set
68# CONFIG_MIPS_PB1550 is not set
69# CONFIG_MIPS_PB1200 is not set
70# CONFIG_MIPS_DB1000 is not set
71# CONFIG_MIPS_DB1100 is not set
72# CONFIG_MIPS_DB1500 is not set
73# CONFIG_MIPS_DB1550 is not set
74# CONFIG_MIPS_DB1200 is not set
75# CONFIG_MIPS_MIRAGE is not set
63# CONFIG_MIPS_COBALT is not set 76# CONFIG_MIPS_COBALT is not set
64# CONFIG_MACH_DECSTATION is not set 77# CONFIG_MACH_DECSTATION is not set
65# CONFIG_MIPS_EV64120 is not set 78# CONFIG_MIPS_EV64120 is not set
66# CONFIG_MIPS_EV96100 is not set 79# CONFIG_MIPS_EV96100 is not set
67# CONFIG_MIPS_IVR is not set 80# CONFIG_MIPS_IVR is not set
68# CONFIG_LASAT is not set
69CONFIG_MIPS_ITE8172=y 81CONFIG_MIPS_ITE8172=y
70# CONFIG_IT8172_REVC is not set 82# CONFIG_MACH_JAZZ is not set
83# CONFIG_LASAT is not set
71# CONFIG_MIPS_ATLAS is not set 84# CONFIG_MIPS_ATLAS is not set
72# CONFIG_MIPS_MALTA is not set 85# CONFIG_MIPS_MALTA is not set
73# CONFIG_MIPS_SEAD is not set 86# CONFIG_MIPS_SEAD is not set
87# CONFIG_MIPS_SIM is not set
88# CONFIG_MOMENCO_JAGUAR_ATX is not set
74# CONFIG_MOMENCO_OCELOT is not set 89# CONFIG_MOMENCO_OCELOT is not set
75# CONFIG_MOMENCO_OCELOT_G is not set
76# CONFIG_MOMENCO_OCELOT_C is not set
77# CONFIG_MOMENCO_OCELOT_3 is not set 90# CONFIG_MOMENCO_OCELOT_3 is not set
78# CONFIG_MOMENCO_JAGUAR_ATX is not set 91# CONFIG_MOMENCO_OCELOT_C is not set
79# CONFIG_PMC_YOSEMITE is not set 92# CONFIG_MOMENCO_OCELOT_G is not set
93# CONFIG_MIPS_XXS1500 is not set
94# CONFIG_PNX8550_V2PCI is not set
95# CONFIG_PNX8550_JBS is not set
80# CONFIG_DDB5074 is not set 96# CONFIG_DDB5074 is not set
81# CONFIG_DDB5476 is not set 97# CONFIG_DDB5476 is not set
82# CONFIG_DDB5477 is not set 98# CONFIG_DDB5477 is not set
83# CONFIG_NEC_OSPREY is not set 99# CONFIG_MACH_VR41XX is not set
100# CONFIG_PMC_YOSEMITE is not set
101# CONFIG_QEMU is not set
84# CONFIG_SGI_IP22 is not set 102# CONFIG_SGI_IP22 is not set
85# CONFIG_SOC_AU1X00 is not set 103# CONFIG_SGI_IP27 is not set
86# CONFIG_SIBYTE_SB1xxx_SOC is not set 104# CONFIG_SGI_IP32 is not set
105# CONFIG_SIBYTE_BIGSUR is not set
106# CONFIG_SIBYTE_SWARM is not set
107# CONFIG_SIBYTE_SENTOSA is not set
108# CONFIG_SIBYTE_RHONE is not set
109# CONFIG_SIBYTE_CARMEL is not set
110# CONFIG_SIBYTE_PTSWARM is not set
111# CONFIG_SIBYTE_LITTLESUR is not set
112# CONFIG_SIBYTE_CRHINE is not set
113# CONFIG_SIBYTE_CRHONE is not set
87# CONFIG_SNI_RM200_PCI is not set 114# CONFIG_SNI_RM200_PCI is not set
115# CONFIG_TOSHIBA_JMR3927 is not set
88# CONFIG_TOSHIBA_RBTX4927 is not set 116# CONFIG_TOSHIBA_RBTX4927 is not set
117# CONFIG_TOSHIBA_RBTX4938 is not set
118# CONFIG_IT8172_REVC is not set
89CONFIG_RWSEM_GENERIC_SPINLOCK=y 119CONFIG_RWSEM_GENERIC_SPINLOCK=y
90CONFIG_GENERIC_CALIBRATE_DELAY=y 120CONFIG_GENERIC_CALIBRATE_DELAY=y
91CONFIG_HAVE_DEC_LOCK=y
92CONFIG_DMA_NONCOHERENT=y 121CONFIG_DMA_NONCOHERENT=y
93CONFIG_DMA_NEED_PCI_MAP_STATE=y 122CONFIG_DMA_NEED_PCI_MAP_STATE=y
123# CONFIG_CPU_BIG_ENDIAN is not set
94CONFIG_CPU_LITTLE_ENDIAN=y 124CONFIG_CPU_LITTLE_ENDIAN=y
125CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
95CONFIG_ITE_BOARD_GEN=y 126CONFIG_ITE_BOARD_GEN=y
96CONFIG_IT8172_CIR=y 127CONFIG_IT8172_CIR=y
97CONFIG_IT8712=y 128CONFIG_IT8712=y
@@ -100,8 +131,10 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
100# 131#
101# CPU selection 132# CPU selection
102# 133#
103# CONFIG_CPU_MIPS32 is not set 134# CONFIG_CPU_MIPS32_R1 is not set
104# CONFIG_CPU_MIPS64 is not set 135# CONFIG_CPU_MIPS32_R2 is not set
136# CONFIG_CPU_MIPS64_R1 is not set
137# CONFIG_CPU_MIPS64_R2 is not set
105# CONFIG_CPU_R3000 is not set 138# CONFIG_CPU_R3000 is not set
106# CONFIG_CPU_TX39XX is not set 139# CONFIG_CPU_TX39XX is not set
107# CONFIG_CPU_VR41XX is not set 140# CONFIG_CPU_VR41XX is not set
@@ -117,14 +150,39 @@ CONFIG_CPU_NEVADA=y
117# CONFIG_CPU_RM7000 is not set 150# CONFIG_CPU_RM7000 is not set
118# CONFIG_CPU_RM9000 is not set 151# CONFIG_CPU_RM9000 is not set
119# CONFIG_CPU_SB1 is not set 152# CONFIG_CPU_SB1 is not set
153CONFIG_SYS_HAS_CPU_R5432=y
154CONFIG_SYS_HAS_CPU_NEVADA=y
155CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
156CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
157CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
158CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
159
160#
161# Kernel type
162#
163CONFIG_32BIT=y
164# CONFIG_64BIT is not set
120CONFIG_PAGE_SIZE_4KB=y 165CONFIG_PAGE_SIZE_4KB=y
121# CONFIG_PAGE_SIZE_8KB is not set 166# CONFIG_PAGE_SIZE_8KB is not set
122# CONFIG_PAGE_SIZE_16KB is not set 167# CONFIG_PAGE_SIZE_16KB is not set
123# CONFIG_PAGE_SIZE_64KB is not set 168# CONFIG_PAGE_SIZE_64KB is not set
169# CONFIG_MIPS_MT is not set
124# CONFIG_CPU_ADVANCED is not set 170# CONFIG_CPU_ADVANCED is not set
125CONFIG_CPU_HAS_LLSC=y 171CONFIG_CPU_HAS_LLSC=y
126CONFIG_CPU_HAS_LLDSCD=y 172CONFIG_CPU_HAS_LLDSCD=y
127CONFIG_CPU_HAS_SYNC=y 173CONFIG_CPU_HAS_SYNC=y
174CONFIG_GENERIC_HARDIRQS=y
175CONFIG_GENERIC_IRQ_PROBE=y
176CONFIG_ARCH_FLATMEM_ENABLE=y
177CONFIG_SELECT_MEMORY_MODEL=y
178CONFIG_FLATMEM_MANUAL=y
179# CONFIG_DISCONTIGMEM_MANUAL is not set
180# CONFIG_SPARSEMEM_MANUAL is not set
181CONFIG_FLATMEM=y
182CONFIG_FLAT_NODE_MEM_MAP=y
183# CONFIG_SPARSEMEM_STATIC is not set
184CONFIG_PREEMPT_NONE=y
185# CONFIG_PREEMPT_VOLUNTARY is not set
128# CONFIG_PREEMPT is not set 186# CONFIG_PREEMPT is not set
129 187
130# 188#
@@ -140,10 +198,6 @@ CONFIG_MMU=y
140# CONFIG_PCCARD is not set 198# CONFIG_PCCARD is not set
141 199
142# 200#
143# PC-card bridges
144#
145
146#
147# PCI Hotplug Support 201# PCI Hotplug Support
148# 202#
149 203
@@ -155,6 +209,80 @@ CONFIG_BINFMT_ELF=y
155CONFIG_TRAD_SIGNALS=y 209CONFIG_TRAD_SIGNALS=y
156 210
157# 211#
212# Networking
213#
214CONFIG_NET=y
215
216#
217# Networking options
218#
219CONFIG_PACKET=y
220CONFIG_PACKET_MMAP=y
221CONFIG_UNIX=y
222CONFIG_XFRM=y
223CONFIG_XFRM_USER=m
224CONFIG_NET_KEY=y
225CONFIG_INET=y
226# CONFIG_IP_MULTICAST is not set
227# CONFIG_IP_ADVANCED_ROUTER is not set
228CONFIG_IP_FIB_HASH=y
229CONFIG_IP_PNP=y
230# CONFIG_IP_PNP_DHCP is not set
231CONFIG_IP_PNP_BOOTP=y
232# CONFIG_IP_PNP_RARP is not set
233# CONFIG_NET_IPIP is not set
234# CONFIG_NET_IPGRE is not set
235# CONFIG_ARPD is not set
236# CONFIG_SYN_COOKIES is not set
237# CONFIG_INET_AH is not set
238# CONFIG_INET_ESP is not set
239# CONFIG_INET_IPCOMP is not set
240CONFIG_INET_TUNNEL=m
241CONFIG_INET_DIAG=y
242CONFIG_INET_TCP_DIAG=y
243# CONFIG_TCP_CONG_ADVANCED is not set
244CONFIG_TCP_CONG_BIC=y
245# CONFIG_IPV6 is not set
246# CONFIG_NETFILTER is not set
247
248#
249# DCCP Configuration (EXPERIMENTAL)
250#
251# CONFIG_IP_DCCP is not set
252
253#
254# SCTP Configuration (EXPERIMENTAL)
255#
256# CONFIG_IP_SCTP is not set
257# CONFIG_ATM is not set
258# CONFIG_BRIDGE is not set
259# CONFIG_VLAN_8021Q is not set
260# CONFIG_DECNET is not set
261# CONFIG_LLC2 is not set
262# CONFIG_IPX is not set
263# CONFIG_ATALK is not set
264# CONFIG_X25 is not set
265# CONFIG_LAPB is not set
266# CONFIG_NET_DIVERT is not set
267# CONFIG_ECONET is not set
268# CONFIG_WAN_ROUTER is not set
269# CONFIG_NET_SCHED is not set
270# CONFIG_NET_CLS_ROUTE is not set
271
272#
273# Network testing
274#
275# CONFIG_NET_PKTGEN is not set
276# CONFIG_HAMRADIO is not set
277# CONFIG_IRDA is not set
278# CONFIG_BT is not set
279CONFIG_IEEE80211=m
280# CONFIG_IEEE80211_DEBUG is not set
281CONFIG_IEEE80211_CRYPT_WEP=m
282CONFIG_IEEE80211_CRYPT_CCMP=m
283CONFIG_IEEE80211_CRYPT_TKIP=m
284
285#
158# Device Drivers 286# Device Drivers
159# 287#
160 288
@@ -166,12 +294,17 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
166# CONFIG_FW_LOADER is not set 294# CONFIG_FW_LOADER is not set
167 295
168# 296#
297# Connector - unified userspace <-> kernelspace linker
298#
299CONFIG_CONNECTOR=m
300
301#
169# Memory Technology Devices (MTD) 302# Memory Technology Devices (MTD)
170# 303#
171CONFIG_MTD=y 304CONFIG_MTD=y
172# CONFIG_MTD_DEBUG is not set 305# CONFIG_MTD_DEBUG is not set
173# CONFIG_MTD_PARTITIONS is not set
174# CONFIG_MTD_CONCAT is not set 306# CONFIG_MTD_CONCAT is not set
307# CONFIG_MTD_PARTITIONS is not set
175 308
176# 309#
177# User Modules And Translation Layers 310# User Modules And Translation Layers
@@ -207,7 +340,6 @@ CONFIG_MTD_CFI_UTIL=y
207# CONFIG_MTD_RAM is not set 340# CONFIG_MTD_RAM is not set
208# CONFIG_MTD_ROM is not set 341# CONFIG_MTD_ROM is not set
209# CONFIG_MTD_ABSENT is not set 342# CONFIG_MTD_ABSENT is not set
210# CONFIG_MTD_XIP is not set
211 343
212# 344#
213# Mapping drivers for chip access 345# Mapping drivers for chip access
@@ -217,6 +349,7 @@ CONFIG_MTD_PHYSMAP=y
217CONFIG_MTD_PHYSMAP_START=0x8000000 349CONFIG_MTD_PHYSMAP_START=0x8000000
218CONFIG_MTD_PHYSMAP_LEN=0x2000000 350CONFIG_MTD_PHYSMAP_LEN=0x2000000
219CONFIG_MTD_PHYSMAP_BANKWIDTH=2 351CONFIG_MTD_PHYSMAP_BANKWIDTH=2
352# CONFIG_MTD_PLATRAM is not set
220 353
221# 354#
222# Self-contained MTD device drivers 355# Self-contained MTD device drivers
@@ -251,14 +384,12 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=2
251# 384#
252# Block devices 385# Block devices
253# 386#
254# CONFIG_BLK_DEV_FD is not set
255# CONFIG_BLK_DEV_COW_COMMON is not set 387# CONFIG_BLK_DEV_COW_COMMON is not set
256CONFIG_BLK_DEV_LOOP=y 388CONFIG_BLK_DEV_LOOP=y
257# CONFIG_BLK_DEV_CRYPTOLOOP is not set 389# CONFIG_BLK_DEV_CRYPTOLOOP is not set
258# CONFIG_BLK_DEV_NBD is not set 390# CONFIG_BLK_DEV_NBD is not set
259# CONFIG_BLK_DEV_RAM is not set 391# CONFIG_BLK_DEV_RAM is not set
260CONFIG_BLK_DEV_RAM_COUNT=16 392CONFIG_BLK_DEV_RAM_COUNT=16
261CONFIG_INITRAMFS_SOURCE=""
262# CONFIG_LBD is not set 393# CONFIG_LBD is not set
263CONFIG_CDROM_PKTCDVD=m 394CONFIG_CDROM_PKTCDVD=m
264CONFIG_CDROM_PKTCDVD_BUFFERS=8 395CONFIG_CDROM_PKTCDVD_BUFFERS=8
@@ -302,6 +433,7 @@ CONFIG_IDE_GENERIC=y
302# 433#
303# SCSI device support 434# SCSI device support
304# 435#
436CONFIG_RAID_ATTRS=m
305# CONFIG_SCSI is not set 437# CONFIG_SCSI is not set
306 438
307# 439#
@@ -312,6 +444,7 @@ CONFIG_IDE_GENERIC=y
312# 444#
313# Fusion MPT device support 445# Fusion MPT device support
314# 446#
447# CONFIG_FUSION is not set
315 448
316# 449#
317# IEEE 1394 (FireWire) support 450# IEEE 1394 (FireWire) support
@@ -322,78 +455,28 @@ CONFIG_IDE_GENERIC=y
322# 455#
323 456
324# 457#
325# Networking support 458# Network device support
326#
327CONFIG_NET=y
328
329#
330# Networking options
331# 459#
332CONFIG_PACKET=y 460CONFIG_NETDEVICES=y
333CONFIG_PACKET_MMAP=y 461# CONFIG_DUMMY is not set
334CONFIG_NETLINK_DEV=y 462# CONFIG_BONDING is not set
335CONFIG_UNIX=y 463# CONFIG_EQUALIZER is not set
336CONFIG_NET_KEY=y 464# CONFIG_TUN is not set
337CONFIG_INET=y
338# CONFIG_IP_MULTICAST is not set
339# CONFIG_IP_ADVANCED_ROUTER is not set
340CONFIG_IP_PNP=y
341# CONFIG_IP_PNP_DHCP is not set
342CONFIG_IP_PNP_BOOTP=y
343# CONFIG_IP_PNP_RARP is not set
344# CONFIG_NET_IPIP is not set
345# CONFIG_NET_IPGRE is not set
346# CONFIG_ARPD is not set
347# CONFIG_SYN_COOKIES is not set
348# CONFIG_INET_AH is not set
349# CONFIG_INET_ESP is not set
350# CONFIG_INET_IPCOMP is not set
351CONFIG_INET_TUNNEL=m
352CONFIG_IP_TCPDIAG=m
353# CONFIG_IP_TCPDIAG_IPV6 is not set
354# CONFIG_IPV6 is not set
355# CONFIG_NETFILTER is not set
356CONFIG_XFRM=y
357CONFIG_XFRM_USER=m
358 465
359# 466#
360# SCTP Configuration (EXPERIMENTAL) 467# PHY device support
361# 468#
362# CONFIG_IP_SCTP is not set 469CONFIG_PHYLIB=m
363# CONFIG_ATM is not set 470CONFIG_PHYCONTROL=y
364# CONFIG_BRIDGE is not set
365# CONFIG_VLAN_8021Q is not set
366# CONFIG_DECNET is not set
367# CONFIG_LLC2 is not set
368# CONFIG_IPX is not set
369# CONFIG_ATALK is not set
370# CONFIG_X25 is not set
371# CONFIG_LAPB is not set
372# CONFIG_NET_DIVERT is not set
373# CONFIG_ECONET is not set
374# CONFIG_WAN_ROUTER is not set
375 471
376# 472#
377# QoS and/or fair queueing 473# MII PHY device drivers
378# 474#
379# CONFIG_NET_SCHED is not set 475CONFIG_MARVELL_PHY=m
380# CONFIG_NET_CLS_ROUTE is not set 476CONFIG_DAVICOM_PHY=m
381 477CONFIG_QSEMI_PHY=m
382# 478CONFIG_LXT_PHY=m
383# Network testing 479CONFIG_CICADA_PHY=m
384#
385# CONFIG_NET_PKTGEN is not set
386# CONFIG_NETPOLL is not set
387# CONFIG_NET_POLL_CONTROLLER is not set
388# CONFIG_HAMRADIO is not set
389# CONFIG_IRDA is not set
390# CONFIG_BT is not set
391CONFIG_NETDEVICES=y
392# CONFIG_DUMMY is not set
393# CONFIG_BONDING is not set
394# CONFIG_EQUALIZER is not set
395# CONFIG_TUN is not set
396# CONFIG_ETHERTAP is not set
397 480
398# 481#
399# Ethernet (10 or 100Mbit) 482# Ethernet (10 or 100Mbit)
@@ -426,6 +509,8 @@ CONFIG_NET_ETHERNET=y
426# CONFIG_SLIP is not set 509# CONFIG_SLIP is not set
427# CONFIG_SHAPER is not set 510# CONFIG_SHAPER is not set
428# CONFIG_NETCONSOLE is not set 511# CONFIG_NETCONSOLE is not set
512# CONFIG_NETPOLL is not set
513# CONFIG_NET_POLL_CONTROLLER is not set
429 514
430# 515#
431# ISDN subsystem 516# ISDN subsystem
@@ -455,18 +540,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
455# CONFIG_INPUT_EVBUG is not set 540# CONFIG_INPUT_EVBUG is not set
456 541
457# 542#
458# Input I/O drivers
459#
460# CONFIG_GAMEPORT is not set
461CONFIG_SOUND_GAMEPORT=y
462CONFIG_SERIO=y
463# CONFIG_SERIO_I8042 is not set
464CONFIG_SERIO_SERPORT=y
465# CONFIG_SERIO_CT82C710 is not set
466# CONFIG_SERIO_LIBPS2 is not set
467CONFIG_SERIO_RAW=m
468
469#
470# Input Device Drivers 543# Input Device Drivers
471# 544#
472# CONFIG_INPUT_KEYBOARD is not set 545# CONFIG_INPUT_KEYBOARD is not set
@@ -476,6 +549,16 @@ CONFIG_SERIO_RAW=m
476# CONFIG_INPUT_MISC is not set 549# CONFIG_INPUT_MISC is not set
477 550
478# 551#
552# Hardware I/O ports
553#
554CONFIG_SERIO=y
555# CONFIG_SERIO_I8042 is not set
556CONFIG_SERIO_SERPORT=y
557# CONFIG_SERIO_LIBPS2 is not set
558CONFIG_SERIO_RAW=m
559# CONFIG_GAMEPORT is not set
560
561#
479# Character devices 562# Character devices
480# 563#
481CONFIG_VT=y 564CONFIG_VT=y
@@ -521,10 +604,13 @@ CONFIG_LEGACY_PTY_COUNT=256
521# 604#
522# Ftape, the floppy tape device driver 605# Ftape, the floppy tape device driver
523# 606#
524# CONFIG_DRM is not set
525# CONFIG_RAW_DRIVER is not set 607# CONFIG_RAW_DRIVER is not set
526 608
527# 609#
610# TPM devices
611#
612
613#
528# I2C support 614# I2C support
529# 615#
530# CONFIG_I2C is not set 616# CONFIG_I2C is not set
@@ -535,10 +621,20 @@ CONFIG_LEGACY_PTY_COUNT=256
535# CONFIG_W1 is not set 621# CONFIG_W1 is not set
536 622
537# 623#
624# Hardware Monitoring support
625#
626# CONFIG_HWMON is not set
627# CONFIG_HWMON_VID is not set
628
629#
538# Misc devices 630# Misc devices
539# 631#
540 632
541# 633#
634# Multimedia Capabilities Port drivers
635#
636
637#
542# Multimedia devices 638# Multimedia devices
543# 639#
544# CONFIG_VIDEO_DEV is not set 640# CONFIG_VIDEO_DEV is not set
@@ -558,7 +654,6 @@ CONFIG_LEGACY_PTY_COUNT=256
558# 654#
559# CONFIG_VGA_CONSOLE is not set 655# CONFIG_VGA_CONSOLE is not set
560CONFIG_DUMMY_CONSOLE=y 656CONFIG_DUMMY_CONSOLE=y
561# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
562 657
563# 658#
564# Sound 659# Sound
@@ -574,15 +669,9 @@ CONFIG_SOUND=y
574# Open Sound System 669# Open Sound System
575# 670#
576CONFIG_SOUND_PRIME=y 671CONFIG_SOUND_PRIME=y
577# CONFIG_SOUND_BT878 is not set
578# CONFIG_SOUND_FUSION is not set
579# CONFIG_SOUND_CS4281 is not set
580# CONFIG_SOUND_SONICVIBES is not set
581CONFIG_SOUND_IT8172=y 672CONFIG_SOUND_IT8172=y
582# CONFIG_SOUND_TRIDENT is not set
583# CONFIG_SOUND_MSNDCLAS is not set 673# CONFIG_SOUND_MSNDCLAS is not set
584# CONFIG_SOUND_MSNDPIN is not set 674# CONFIG_SOUND_MSNDPIN is not set
585# CONFIG_SOUND_OSS is not set
586# CONFIG_SOUND_AD1980 is not set 675# CONFIG_SOUND_AD1980 is not set
587 676
588# 677#
@@ -592,10 +681,6 @@ CONFIG_SOUND_IT8172=y
592# CONFIG_USB_ARCH_HAS_OHCI is not set 681# CONFIG_USB_ARCH_HAS_OHCI is not set
593 682
594# 683#
595# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
596#
597
598#
599# USB Gadget Support 684# USB Gadget Support
600# 685#
601# CONFIG_USB_GADGET is not set 686# CONFIG_USB_GADGET is not set
@@ -608,24 +693,31 @@ CONFIG_SOUND_IT8172=y
608# 693#
609# InfiniBand support 694# InfiniBand support
610# 695#
611# CONFIG_INFINIBAND is not set 696
697#
698# SN Devices
699#
612 700
613# 701#
614# File systems 702# File systems
615# 703#
616CONFIG_EXT2_FS=y 704CONFIG_EXT2_FS=y
617# CONFIG_EXT2_FS_XATTR is not set 705# CONFIG_EXT2_FS_XATTR is not set
706# CONFIG_EXT2_FS_XIP is not set
618# CONFIG_EXT3_FS is not set 707# CONFIG_EXT3_FS is not set
619# CONFIG_JBD is not set 708# CONFIG_JBD is not set
620# CONFIG_REISERFS_FS is not set 709# CONFIG_REISERFS_FS is not set
621# CONFIG_JFS_FS is not set 710# CONFIG_JFS_FS is not set
711# CONFIG_FS_POSIX_ACL is not set
622# CONFIG_XFS_FS is not set 712# CONFIG_XFS_FS is not set
623# CONFIG_MINIX_FS is not set 713# CONFIG_MINIX_FS is not set
624# CONFIG_ROMFS_FS is not set 714# CONFIG_ROMFS_FS is not set
715CONFIG_INOTIFY=y
625# CONFIG_QUOTA is not set 716# CONFIG_QUOTA is not set
626CONFIG_DNOTIFY=y 717CONFIG_DNOTIFY=y
627# CONFIG_AUTOFS_FS is not set 718# CONFIG_AUTOFS_FS is not set
628# CONFIG_AUTOFS4_FS is not set 719# CONFIG_AUTOFS4_FS is not set
720CONFIG_FUSE_FS=m
629 721
630# 722#
631# CD-ROM/DVD Filesystems 723# CD-ROM/DVD Filesystems
@@ -646,12 +738,10 @@ CONFIG_DNOTIFY=y
646CONFIG_PROC_FS=y 738CONFIG_PROC_FS=y
647CONFIG_PROC_KCORE=y 739CONFIG_PROC_KCORE=y
648CONFIG_SYSFS=y 740CONFIG_SYSFS=y
649# CONFIG_DEVFS_FS is not set
650CONFIG_DEVPTS_FS_XATTR=y
651CONFIG_DEVPTS_FS_SECURITY=y
652# CONFIG_TMPFS is not set 741# CONFIG_TMPFS is not set
653# CONFIG_HUGETLB_PAGE is not set 742# CONFIG_HUGETLB_PAGE is not set
654CONFIG_RAMFS=y 743CONFIG_RAMFS=y
744CONFIG_RELAYFS_FS=m
655 745
656# 746#
657# Miscellaneous filesystems 747# Miscellaneous filesystems
@@ -682,7 +772,7 @@ CONFIG_NFS_FS=y
682# CONFIG_NFSD is not set 772# CONFIG_NFSD is not set
683CONFIG_ROOT_NFS=y 773CONFIG_ROOT_NFS=y
684CONFIG_LOCKD=y 774CONFIG_LOCKD=y
685# CONFIG_EXPORTFS is not set 775CONFIG_NFS_COMMON=y
686CONFIG_SUNRPC=y 776CONFIG_SUNRPC=y
687# CONFIG_RPCSEC_GSS_KRB5 is not set 777# CONFIG_RPCSEC_GSS_KRB5 is not set
688# CONFIG_RPCSEC_GSS_SPKM3 is not set 778# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -691,6 +781,7 @@ CONFIG_SUNRPC=y
691# CONFIG_NCP_FS is not set 781# CONFIG_NCP_FS is not set
692# CONFIG_CODA_FS is not set 782# CONFIG_CODA_FS is not set
693# CONFIG_AFS_FS is not set 783# CONFIG_AFS_FS is not set
784# CONFIG_9P_FS is not set
694 785
695# 786#
696# Partition Types 787# Partition Types
@@ -711,7 +802,9 @@ CONFIG_MSDOS_PARTITION=y
711# 802#
712# Kernel hacking 803# Kernel hacking
713# 804#
805# CONFIG_PRINTK_TIME is not set
714# CONFIG_DEBUG_KERNEL is not set 806# CONFIG_DEBUG_KERNEL is not set
807CONFIG_LOG_BUF_SHIFT=14
715CONFIG_CROSSCOMPILE=y 808CONFIG_CROSSCOMPILE=y
716CONFIG_CMDLINE="" 809CONFIG_CMDLINE=""
717 810
@@ -725,7 +818,31 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
725# 818#
726# Cryptographic options 819# Cryptographic options
727# 820#
728# CONFIG_CRYPTO is not set 821CONFIG_CRYPTO=y
822CONFIG_CRYPTO_HMAC=y
823CONFIG_CRYPTO_NULL=m
824CONFIG_CRYPTO_MD4=m
825CONFIG_CRYPTO_MD5=m
826CONFIG_CRYPTO_SHA1=m
827CONFIG_CRYPTO_SHA256=m
828CONFIG_CRYPTO_SHA512=m
829CONFIG_CRYPTO_WP512=m
830CONFIG_CRYPTO_TGR192=m
831CONFIG_CRYPTO_DES=m
832CONFIG_CRYPTO_BLOWFISH=m
833CONFIG_CRYPTO_TWOFISH=m
834CONFIG_CRYPTO_SERPENT=m
835CONFIG_CRYPTO_AES=m
836CONFIG_CRYPTO_CAST5=m
837CONFIG_CRYPTO_CAST6=m
838CONFIG_CRYPTO_TEA=m
839CONFIG_CRYPTO_ARC4=m
840CONFIG_CRYPTO_KHAZAD=m
841CONFIG_CRYPTO_ANUBIS=m
842CONFIG_CRYPTO_DEFLATE=m
843CONFIG_CRYPTO_MICHAEL_MIC=m
844CONFIG_CRYPTO_CRC32C=m
845# CONFIG_CRYPTO_TEST is not set
729 846
730# 847#
731# Hardware crypto devices 848# Hardware crypto devices
@@ -735,7 +852,8 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
735# Library routines 852# Library routines
736# 853#
737# CONFIG_CRC_CCITT is not set 854# CONFIG_CRC_CCITT is not set
738# CONFIG_CRC32 is not set 855CONFIG_CRC16=m
856CONFIG_CRC32=m
739CONFIG_LIBCRC32C=m 857CONFIG_LIBCRC32C=m
740CONFIG_GENERIC_HARDIRQS=y 858CONFIG_ZLIB_INFLATE=m
741CONFIG_GENERIC_IRQ_PROBE=y 859CONFIG_ZLIB_DEFLATE=m
diff --git a/arch/mips/configs/ivr_defconfig b/arch/mips/configs/ivr_defconfig
index 583ef5c5b1cd..9ba61dfc490d 100644
--- a/arch/mips/configs/ivr_defconfig
+++ b/arch/mips/configs/ivr_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:05 2005 4# Thu Oct 20 22:26:12 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,11 +11,13 @@ CONFIG_32BIT=y
14CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
@@ -26,13 +25,16 @@ CONFIG_BSD_PROCESS_ACCT=y
26# CONFIG_BSD_PROCESS_ACCT_V3 is not set 25# CONFIG_BSD_PROCESS_ACCT_V3 is not set
27CONFIG_SYSCTL=y 26CONFIG_SYSCTL=y
28# CONFIG_AUDIT is not set 27# CONFIG_AUDIT is not set
29CONFIG_LOG_BUF_SHIFT=14 28CONFIG_HOTPLUG=y
30# CONFIG_HOTPLUG is not set
31CONFIG_KOBJECT_UEVENT=y 29CONFIG_KOBJECT_UEVENT=y
32# CONFIG_IKCONFIG is not set 30# CONFIG_IKCONFIG is not set
31CONFIG_INITRAMFS_SOURCE=""
33CONFIG_EMBEDDED=y 32CONFIG_EMBEDDED=y
34CONFIG_KALLSYMS=y 33CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_EXTRA_PASS is not set 34# CONFIG_KALLSYMS_EXTRA_PASS is not set
35CONFIG_PRINTK=y
36CONFIG_BUG=y
37CONFIG_BASE_FULL=y
36CONFIG_FUTEX=y 38CONFIG_FUTEX=y
37CONFIG_EPOLL=y 39CONFIG_EPOLL=y
38# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 40# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -42,6 +44,7 @@ CONFIG_CC_ALIGN_LABELS=0
42CONFIG_CC_ALIGN_LOOPS=0 44CONFIG_CC_ALIGN_LOOPS=0
43CONFIG_CC_ALIGN_JUMPS=0 45CONFIG_CC_ALIGN_JUMPS=0
44# CONFIG_TINY_SHMEM is not set 46# CONFIG_TINY_SHMEM is not set
47CONFIG_BASE_SMALL=0
45 48
46# 49#
47# Loadable module support 50# Loadable module support
@@ -57,40 +60,68 @@ CONFIG_KMOD=y
57# 60#
58# Machine selection 61# Machine selection
59# 62#
60# CONFIG_MACH_JAZZ is not set 63# CONFIG_MIPS_MTX1 is not set
61# CONFIG_MACH_VR41XX is not set 64# CONFIG_MIPS_BOSPORUS is not set
62# CONFIG_TOSHIBA_JMR3927 is not set 65# CONFIG_MIPS_PB1000 is not set
66# CONFIG_MIPS_PB1100 is not set
67# CONFIG_MIPS_PB1500 is not set
68# CONFIG_MIPS_PB1550 is not set
69# CONFIG_MIPS_PB1200 is not set
70# CONFIG_MIPS_DB1000 is not set
71# CONFIG_MIPS_DB1100 is not set
72# CONFIG_MIPS_DB1500 is not set
73# CONFIG_MIPS_DB1550 is not set
74# CONFIG_MIPS_DB1200 is not set
75# CONFIG_MIPS_MIRAGE is not set
63# CONFIG_MIPS_COBALT is not set 76# CONFIG_MIPS_COBALT is not set
64# CONFIG_MACH_DECSTATION is not set 77# CONFIG_MACH_DECSTATION is not set
65# CONFIG_MIPS_EV64120 is not set 78# CONFIG_MIPS_EV64120 is not set
66# CONFIG_MIPS_EV96100 is not set 79# CONFIG_MIPS_EV96100 is not set
67CONFIG_MIPS_IVR=y 80CONFIG_MIPS_IVR=y
68# CONFIG_LASAT is not set
69# CONFIG_MIPS_ITE8172 is not set 81# CONFIG_MIPS_ITE8172 is not set
82# CONFIG_MACH_JAZZ is not set
83# CONFIG_LASAT is not set
70# CONFIG_MIPS_ATLAS is not set 84# CONFIG_MIPS_ATLAS is not set
71# CONFIG_MIPS_MALTA is not set 85# CONFIG_MIPS_MALTA is not set
72# CONFIG_MIPS_SEAD is not set 86# CONFIG_MIPS_SEAD is not set
87# CONFIG_MIPS_SIM is not set
88# CONFIG_MOMENCO_JAGUAR_ATX is not set
73# CONFIG_MOMENCO_OCELOT is not set 89# CONFIG_MOMENCO_OCELOT is not set
74# CONFIG_MOMENCO_OCELOT_G is not set
75# CONFIG_MOMENCO_OCELOT_C is not set
76# CONFIG_MOMENCO_OCELOT_3 is not set 90# CONFIG_MOMENCO_OCELOT_3 is not set
77# CONFIG_MOMENCO_JAGUAR_ATX is not set 91# CONFIG_MOMENCO_OCELOT_C is not set
78# CONFIG_PMC_YOSEMITE is not set 92# CONFIG_MOMENCO_OCELOT_G is not set
93# CONFIG_MIPS_XXS1500 is not set
94# CONFIG_PNX8550_V2PCI is not set
95# CONFIG_PNX8550_JBS is not set
79# CONFIG_DDB5074 is not set 96# CONFIG_DDB5074 is not set
80# CONFIG_DDB5476 is not set 97# CONFIG_DDB5476 is not set
81# CONFIG_DDB5477 is not set 98# CONFIG_DDB5477 is not set
82# CONFIG_NEC_OSPREY is not set 99# CONFIG_MACH_VR41XX is not set
100# CONFIG_PMC_YOSEMITE is not set
101# CONFIG_QEMU is not set
83# CONFIG_SGI_IP22 is not set 102# CONFIG_SGI_IP22 is not set
84# CONFIG_SOC_AU1X00 is not set 103# CONFIG_SGI_IP27 is not set
85# CONFIG_SIBYTE_SB1xxx_SOC is not set 104# CONFIG_SGI_IP32 is not set
105# CONFIG_SIBYTE_BIGSUR is not set
106# CONFIG_SIBYTE_SWARM is not set
107# CONFIG_SIBYTE_SENTOSA is not set
108# CONFIG_SIBYTE_RHONE is not set
109# CONFIG_SIBYTE_CARMEL is not set
110# CONFIG_SIBYTE_PTSWARM is not set
111# CONFIG_SIBYTE_LITTLESUR is not set
112# CONFIG_SIBYTE_CRHINE is not set
113# CONFIG_SIBYTE_CRHONE is not set
86# CONFIG_SNI_RM200_PCI is not set 114# CONFIG_SNI_RM200_PCI is not set
115# CONFIG_TOSHIBA_JMR3927 is not set
87# CONFIG_TOSHIBA_RBTX4927 is not set 116# CONFIG_TOSHIBA_RBTX4927 is not set
117# CONFIG_TOSHIBA_RBTX4938 is not set
88CONFIG_RWSEM_GENERIC_SPINLOCK=y 118CONFIG_RWSEM_GENERIC_SPINLOCK=y
89CONFIG_GENERIC_CALIBRATE_DELAY=y 119CONFIG_GENERIC_CALIBRATE_DELAY=y
90CONFIG_HAVE_DEC_LOCK=y
91CONFIG_DMA_NONCOHERENT=y 120CONFIG_DMA_NONCOHERENT=y
92CONFIG_DMA_NEED_PCI_MAP_STATE=y 121CONFIG_DMA_NEED_PCI_MAP_STATE=y
122# CONFIG_CPU_BIG_ENDIAN is not set
93CONFIG_CPU_LITTLE_ENDIAN=y 123CONFIG_CPU_LITTLE_ENDIAN=y
124CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
94CONFIG_ITE_BOARD_GEN=y 125CONFIG_ITE_BOARD_GEN=y
95CONFIG_IT8172_CIR=y 126CONFIG_IT8172_CIR=y
96CONFIG_MIPS_L1_CACHE_SHIFT=5 127CONFIG_MIPS_L1_CACHE_SHIFT=5
@@ -98,8 +129,10 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
98# 129#
99# CPU selection 130# CPU selection
100# 131#
101# CONFIG_CPU_MIPS32 is not set 132# CONFIG_CPU_MIPS32_R1 is not set
102# CONFIG_CPU_MIPS64 is not set 133# CONFIG_CPU_MIPS32_R2 is not set
134# CONFIG_CPU_MIPS64_R1 is not set
135# CONFIG_CPU_MIPS64_R2 is not set
103# CONFIG_CPU_R3000 is not set 136# CONFIG_CPU_R3000 is not set
104# CONFIG_CPU_TX39XX is not set 137# CONFIG_CPU_TX39XX is not set
105# CONFIG_CPU_VR41XX is not set 138# CONFIG_CPU_VR41XX is not set
@@ -115,14 +148,38 @@ CONFIG_CPU_NEVADA=y
115# CONFIG_CPU_RM7000 is not set 148# CONFIG_CPU_RM7000 is not set
116# CONFIG_CPU_RM9000 is not set 149# CONFIG_CPU_RM9000 is not set
117# CONFIG_CPU_SB1 is not set 150# CONFIG_CPU_SB1 is not set
151CONFIG_SYS_HAS_CPU_NEVADA=y
152CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
153CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
154CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
155CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
156
157#
158# Kernel type
159#
160CONFIG_32BIT=y
161# CONFIG_64BIT is not set
118CONFIG_PAGE_SIZE_4KB=y 162CONFIG_PAGE_SIZE_4KB=y
119# CONFIG_PAGE_SIZE_8KB is not set 163# CONFIG_PAGE_SIZE_8KB is not set
120# CONFIG_PAGE_SIZE_16KB is not set 164# CONFIG_PAGE_SIZE_16KB is not set
121# CONFIG_PAGE_SIZE_64KB is not set 165# CONFIG_PAGE_SIZE_64KB is not set
166# CONFIG_MIPS_MT is not set
122# CONFIG_CPU_ADVANCED is not set 167# CONFIG_CPU_ADVANCED is not set
123CONFIG_CPU_HAS_LLSC=y 168CONFIG_CPU_HAS_LLSC=y
124CONFIG_CPU_HAS_LLDSCD=y 169CONFIG_CPU_HAS_LLDSCD=y
125CONFIG_CPU_HAS_SYNC=y 170CONFIG_CPU_HAS_SYNC=y
171CONFIG_GENERIC_HARDIRQS=y
172CONFIG_GENERIC_IRQ_PROBE=y
173CONFIG_ARCH_FLATMEM_ENABLE=y
174CONFIG_SELECT_MEMORY_MODEL=y
175CONFIG_FLATMEM_MANUAL=y
176# CONFIG_DISCONTIGMEM_MANUAL is not set
177# CONFIG_SPARSEMEM_MANUAL is not set
178CONFIG_FLATMEM=y
179CONFIG_FLAT_NODE_MEM_MAP=y
180# CONFIG_SPARSEMEM_STATIC is not set
181CONFIG_PREEMPT_NONE=y
182# CONFIG_PREEMPT_VOLUNTARY is not set
126# CONFIG_PREEMPT is not set 183# CONFIG_PREEMPT is not set
127 184
128# 185#
@@ -131,7 +188,6 @@ CONFIG_CPU_HAS_SYNC=y
131CONFIG_HW_HAS_PCI=y 188CONFIG_HW_HAS_PCI=y
132CONFIG_PCI=y 189CONFIG_PCI=y
133CONFIG_PCI_LEGACY_PROC=y 190CONFIG_PCI_LEGACY_PROC=y
134CONFIG_PCI_NAMES=y
135CONFIG_MMU=y 191CONFIG_MMU=y
136 192
137# 193#
@@ -140,10 +196,6 @@ CONFIG_MMU=y
140# CONFIG_PCCARD is not set 196# CONFIG_PCCARD is not set
141 197
142# 198#
143# PC-card bridges
144#
145
146#
147# PCI Hotplug Support 199# PCI Hotplug Support
148# 200#
149# CONFIG_HOTPLUG_PCI is not set 201# CONFIG_HOTPLUG_PCI is not set
@@ -156,6 +208,80 @@ CONFIG_BINFMT_ELF=y
156CONFIG_TRAD_SIGNALS=y 208CONFIG_TRAD_SIGNALS=y
157 209
158# 210#
211# Networking
212#
213CONFIG_NET=y
214
215#
216# Networking options
217#
218CONFIG_PACKET=y
219CONFIG_PACKET_MMAP=y
220CONFIG_UNIX=y
221CONFIG_XFRM=y
222CONFIG_XFRM_USER=m
223CONFIG_NET_KEY=y
224CONFIG_INET=y
225# CONFIG_IP_MULTICAST is not set
226# CONFIG_IP_ADVANCED_ROUTER is not set
227CONFIG_IP_FIB_HASH=y
228CONFIG_IP_PNP=y
229# CONFIG_IP_PNP_DHCP is not set
230CONFIG_IP_PNP_BOOTP=y
231# CONFIG_IP_PNP_RARP is not set
232# CONFIG_NET_IPIP is not set
233# CONFIG_NET_IPGRE is not set
234# CONFIG_ARPD is not set
235# CONFIG_SYN_COOKIES is not set
236# CONFIG_INET_AH is not set
237# CONFIG_INET_ESP is not set
238# CONFIG_INET_IPCOMP is not set
239CONFIG_INET_TUNNEL=m
240CONFIG_INET_DIAG=y
241CONFIG_INET_TCP_DIAG=y
242# CONFIG_TCP_CONG_ADVANCED is not set
243CONFIG_TCP_CONG_BIC=y
244# CONFIG_IPV6 is not set
245# CONFIG_NETFILTER is not set
246
247#
248# DCCP Configuration (EXPERIMENTAL)
249#
250# CONFIG_IP_DCCP is not set
251
252#
253# SCTP Configuration (EXPERIMENTAL)
254#
255# CONFIG_IP_SCTP is not set
256# CONFIG_ATM is not set
257# CONFIG_BRIDGE is not set
258# CONFIG_VLAN_8021Q is not set
259# CONFIG_DECNET is not set
260# CONFIG_LLC2 is not set
261# CONFIG_IPX is not set
262# CONFIG_ATALK is not set
263# CONFIG_X25 is not set
264# CONFIG_LAPB is not set
265# CONFIG_NET_DIVERT is not set
266# CONFIG_ECONET is not set
267# CONFIG_WAN_ROUTER is not set
268# CONFIG_NET_SCHED is not set
269# CONFIG_NET_CLS_ROUTE is not set
270
271#
272# Network testing
273#
274# CONFIG_NET_PKTGEN is not set
275# CONFIG_HAMRADIO is not set
276# CONFIG_IRDA is not set
277# CONFIG_BT is not set
278CONFIG_IEEE80211=m
279# CONFIG_IEEE80211_DEBUG is not set
280CONFIG_IEEE80211_CRYPT_WEP=m
281CONFIG_IEEE80211_CRYPT_CCMP=m
282CONFIG_IEEE80211_CRYPT_TKIP=m
283
284#
159# Device Drivers 285# Device Drivers
160# 286#
161 287
@@ -164,7 +290,12 @@ CONFIG_TRAD_SIGNALS=y
164# 290#
165CONFIG_STANDALONE=y 291CONFIG_STANDALONE=y
166CONFIG_PREVENT_FIRMWARE_BUILD=y 292CONFIG_PREVENT_FIRMWARE_BUILD=y
167# CONFIG_FW_LOADER is not set 293CONFIG_FW_LOADER=m
294
295#
296# Connector - unified userspace <-> kernelspace linker
297#
298CONFIG_CONNECTOR=m
168 299
169# 300#
170# Memory Technology Devices (MTD) 301# Memory Technology Devices (MTD)
@@ -183,7 +314,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
183# 314#
184# Block devices 315# Block devices
185# 316#
186# CONFIG_BLK_DEV_FD is not set
187# CONFIG_BLK_CPQ_DA is not set 317# CONFIG_BLK_CPQ_DA is not set
188# CONFIG_BLK_CPQ_CISS_DA is not set 318# CONFIG_BLK_CPQ_CISS_DA is not set
189# CONFIG_BLK_DEV_DAC960 is not set 319# CONFIG_BLK_DEV_DAC960 is not set
@@ -194,7 +324,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
194# CONFIG_BLK_DEV_SX8 is not set 324# CONFIG_BLK_DEV_SX8 is not set
195# CONFIG_BLK_DEV_RAM is not set 325# CONFIG_BLK_DEV_RAM is not set
196CONFIG_BLK_DEV_RAM_COUNT=16 326CONFIG_BLK_DEV_RAM_COUNT=16
197CONFIG_INITRAMFS_SOURCE=""
198# CONFIG_LBD is not set 327# CONFIG_LBD is not set
199CONFIG_CDROM_PKTCDVD=m 328CONFIG_CDROM_PKTCDVD=m
200CONFIG_CDROM_PKTCDVD_BUFFERS=8 329CONFIG_CDROM_PKTCDVD_BUFFERS=8
@@ -239,6 +368,7 @@ CONFIG_IDE_GENERIC=y
239# 368#
240# SCSI device support 369# SCSI device support
241# 370#
371CONFIG_RAID_ATTRS=m
242# CONFIG_SCSI is not set 372# CONFIG_SCSI is not set
243 373
244# 374#
@@ -249,6 +379,7 @@ CONFIG_IDE_GENERIC=y
249# 379#
250# Fusion MPT device support 380# Fusion MPT device support
251# 381#
382# CONFIG_FUSION is not set
252 383
253# 384#
254# IEEE 1394 (FireWire) support 385# IEEE 1394 (FireWire) support
@@ -261,78 +392,13 @@ CONFIG_IDE_GENERIC=y
261# CONFIG_I2O is not set 392# CONFIG_I2O is not set
262 393
263# 394#
264# Networking support 395# Network device support
265#
266CONFIG_NET=y
267
268#
269# Networking options
270#
271CONFIG_PACKET=y
272CONFIG_PACKET_MMAP=y
273CONFIG_NETLINK_DEV=y
274CONFIG_UNIX=y
275CONFIG_NET_KEY=y
276CONFIG_INET=y
277# CONFIG_IP_MULTICAST is not set
278# CONFIG_IP_ADVANCED_ROUTER is not set
279CONFIG_IP_PNP=y
280# CONFIG_IP_PNP_DHCP is not set
281CONFIG_IP_PNP_BOOTP=y
282# CONFIG_IP_PNP_RARP is not set
283# CONFIG_NET_IPIP is not set
284# CONFIG_NET_IPGRE is not set
285# CONFIG_ARPD is not set
286# CONFIG_SYN_COOKIES is not set
287# CONFIG_INET_AH is not set
288# CONFIG_INET_ESP is not set
289# CONFIG_INET_IPCOMP is not set
290CONFIG_INET_TUNNEL=m
291CONFIG_IP_TCPDIAG=m
292# CONFIG_IP_TCPDIAG_IPV6 is not set
293# CONFIG_IPV6 is not set
294# CONFIG_NETFILTER is not set
295CONFIG_XFRM=y
296CONFIG_XFRM_USER=m
297
298#
299# SCTP Configuration (EXPERIMENTAL)
300# 396#
301# CONFIG_IP_SCTP is not set
302# CONFIG_ATM is not set
303# CONFIG_BRIDGE is not set
304# CONFIG_VLAN_8021Q is not set
305# CONFIG_DECNET is not set
306# CONFIG_LLC2 is not set
307# CONFIG_IPX is not set
308# CONFIG_ATALK is not set
309# CONFIG_X25 is not set
310# CONFIG_LAPB is not set
311# CONFIG_NET_DIVERT is not set
312# CONFIG_ECONET is not set
313# CONFIG_WAN_ROUTER is not set
314
315#
316# QoS and/or fair queueing
317#
318# CONFIG_NET_SCHED is not set
319# CONFIG_NET_CLS_ROUTE is not set
320
321#
322# Network testing
323#
324# CONFIG_NET_PKTGEN is not set
325# CONFIG_NETPOLL is not set
326# CONFIG_NET_POLL_CONTROLLER is not set
327# CONFIG_HAMRADIO is not set
328# CONFIG_IRDA is not set
329# CONFIG_BT is not set
330CONFIG_NETDEVICES=y 397CONFIG_NETDEVICES=y
331# CONFIG_DUMMY is not set 398# CONFIG_DUMMY is not set
332# CONFIG_BONDING is not set 399# CONFIG_BONDING is not set
333# CONFIG_EQUALIZER is not set 400# CONFIG_EQUALIZER is not set
334# CONFIG_TUN is not set 401# CONFIG_TUN is not set
335# CONFIG_ETHERTAP is not set
336 402
337# 403#
338# ARCnet devices 404# ARCnet devices
@@ -340,6 +406,21 @@ CONFIG_NETDEVICES=y
340# CONFIG_ARCNET is not set 406# CONFIG_ARCNET is not set
341 407
342# 408#
409# PHY device support
410#
411CONFIG_PHYLIB=m
412CONFIG_PHYCONTROL=y
413
414#
415# MII PHY device drivers
416#
417CONFIG_MARVELL_PHY=m
418CONFIG_DAVICOM_PHY=m
419CONFIG_QSEMI_PHY=m
420CONFIG_LXT_PHY=m
421CONFIG_CICADA_PHY=m
422
423#
343# Ethernet (10 or 100Mbit) 424# Ethernet (10 or 100Mbit)
344# 425#
345CONFIG_NET_ETHERNET=y 426CONFIG_NET_ETHERNET=y
@@ -365,12 +446,16 @@ CONFIG_NET_ETHERNET=y
365# CONFIG_HAMACHI is not set 446# CONFIG_HAMACHI is not set
366# CONFIG_YELLOWFIN is not set 447# CONFIG_YELLOWFIN is not set
367# CONFIG_R8169 is not set 448# CONFIG_R8169 is not set
449# CONFIG_SIS190 is not set
450# CONFIG_SKGE is not set
368# CONFIG_SK98LIN is not set 451# CONFIG_SK98LIN is not set
369# CONFIG_TIGON3 is not set 452# CONFIG_TIGON3 is not set
453# CONFIG_BNX2 is not set
370 454
371# 455#
372# Ethernet (10000 Mbit) 456# Ethernet (10000 Mbit)
373# 457#
458# CONFIG_CHELSIO_T1 is not set
374# CONFIG_IXGB is not set 459# CONFIG_IXGB is not set
375# CONFIG_S2IO is not set 460# CONFIG_S2IO is not set
376 461
@@ -383,6 +468,8 @@ CONFIG_NET_ETHERNET=y
383# Wireless LAN (non-hamradio) 468# Wireless LAN (non-hamradio)
384# 469#
385# CONFIG_NET_RADIO is not set 470# CONFIG_NET_RADIO is not set
471# CONFIG_IPW_DEBUG is not set
472CONFIG_IPW2200=m
386 473
387# 474#
388# Wan interfaces 475# Wan interfaces
@@ -394,6 +481,8 @@ CONFIG_NET_ETHERNET=y
394# CONFIG_SLIP is not set 481# CONFIG_SLIP is not set
395# CONFIG_SHAPER is not set 482# CONFIG_SHAPER is not set
396# CONFIG_NETCONSOLE is not set 483# CONFIG_NETCONSOLE is not set
484# CONFIG_NETPOLL is not set
485# CONFIG_NET_POLL_CONTROLLER is not set
397 486
398# 487#
399# ISDN subsystem 488# ISDN subsystem
@@ -423,19 +512,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
423# CONFIG_INPUT_EVBUG is not set 512# CONFIG_INPUT_EVBUG is not set
424 513
425# 514#
426# Input I/O drivers
427#
428# CONFIG_GAMEPORT is not set
429CONFIG_SOUND_GAMEPORT=y
430CONFIG_SERIO=y
431# CONFIG_SERIO_I8042 is not set
432CONFIG_SERIO_SERPORT=y
433# CONFIG_SERIO_CT82C710 is not set
434# CONFIG_SERIO_PCIPS2 is not set
435# CONFIG_SERIO_LIBPS2 is not set
436CONFIG_SERIO_RAW=m
437
438#
439# Input Device Drivers 515# Input Device Drivers
440# 516#
441# CONFIG_INPUT_KEYBOARD is not set 517# CONFIG_INPUT_KEYBOARD is not set
@@ -445,6 +521,17 @@ CONFIG_SERIO_RAW=m
445# CONFIG_INPUT_MISC is not set 521# CONFIG_INPUT_MISC is not set
446 522
447# 523#
524# Hardware I/O ports
525#
526CONFIG_SERIO=y
527# CONFIG_SERIO_I8042 is not set
528CONFIG_SERIO_SERPORT=y
529# CONFIG_SERIO_PCIPS2 is not set
530# CONFIG_SERIO_LIBPS2 is not set
531CONFIG_SERIO_RAW=m
532# CONFIG_GAMEPORT is not set
533
534#
448# Character devices 535# Character devices
449# 536#
450CONFIG_VT=y 537CONFIG_VT=y
@@ -467,6 +554,7 @@ CONFIG_SERIAL_8250_NR_UARTS=4
467# 554#
468CONFIG_SERIAL_CORE=y 555CONFIG_SERIAL_CORE=y
469CONFIG_SERIAL_CORE_CONSOLE=y 556CONFIG_SERIAL_CORE_CONSOLE=y
557# CONFIG_SERIAL_JSM is not set
470CONFIG_UNIX98_PTYS=y 558CONFIG_UNIX98_PTYS=y
471CONFIG_LEGACY_PTYS=y 559CONFIG_LEGACY_PTYS=y
472CONFIG_LEGACY_PTY_COUNT=256 560CONFIG_LEGACY_PTY_COUNT=256
@@ -492,6 +580,11 @@ CONFIG_RTC=y
492# CONFIG_RAW_DRIVER is not set 580# CONFIG_RAW_DRIVER is not set
493 581
494# 582#
583# TPM devices
584#
585# CONFIG_TCG_TPM is not set
586
587#
495# I2C support 588# I2C support
496# 589#
497# CONFIG_I2C is not set 590# CONFIG_I2C is not set
@@ -502,10 +595,20 @@ CONFIG_RTC=y
502# CONFIG_W1 is not set 595# CONFIG_W1 is not set
503 596
504# 597#
598# Hardware Monitoring support
599#
600# CONFIG_HWMON is not set
601# CONFIG_HWMON_VID is not set
602
603#
505# Misc devices 604# Misc devices
506# 605#
507 606
508# 607#
608# Multimedia Capabilities Port drivers
609#
610
611#
509# Multimedia devices 612# Multimedia devices
510# 613#
511# CONFIG_VIDEO_DEV is not set 614# CONFIG_VIDEO_DEV is not set
@@ -525,7 +628,6 @@ CONFIG_RTC=y
525# 628#
526# CONFIG_VGA_CONSOLE is not set 629# CONFIG_VGA_CONSOLE is not set
527CONFIG_DUMMY_CONSOLE=y 630CONFIG_DUMMY_CONSOLE=y
528# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
529 631
530# 632#
531# Sound 633# Sound
@@ -535,13 +637,9 @@ CONFIG_DUMMY_CONSOLE=y
535# 637#
536# USB support 638# USB support
537# 639#
538# CONFIG_USB is not set
539CONFIG_USB_ARCH_HAS_HCD=y 640CONFIG_USB_ARCH_HAS_HCD=y
540CONFIG_USB_ARCH_HAS_OHCI=y 641CONFIG_USB_ARCH_HAS_OHCI=y
541 642# CONFIG_USB is not set
542#
543# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
544#
545 643
546# 644#
547# USB Gadget Support 645# USB Gadget Support
@@ -559,21 +657,29 @@ CONFIG_USB_ARCH_HAS_OHCI=y
559# CONFIG_INFINIBAND is not set 657# CONFIG_INFINIBAND is not set
560 658
561# 659#
660# SN Devices
661#
662
663#
562# File systems 664# File systems
563# 665#
564CONFIG_EXT2_FS=y 666CONFIG_EXT2_FS=y
565# CONFIG_EXT2_FS_XATTR is not set 667# CONFIG_EXT2_FS_XATTR is not set
668# CONFIG_EXT2_FS_XIP is not set
566# CONFIG_EXT3_FS is not set 669# CONFIG_EXT3_FS is not set
567# CONFIG_JBD is not set 670# CONFIG_JBD is not set
568# CONFIG_REISERFS_FS is not set 671# CONFIG_REISERFS_FS is not set
569# CONFIG_JFS_FS is not set 672# CONFIG_JFS_FS is not set
673# CONFIG_FS_POSIX_ACL is not set
570# CONFIG_XFS_FS is not set 674# CONFIG_XFS_FS is not set
571# CONFIG_MINIX_FS is not set 675# CONFIG_MINIX_FS is not set
572# CONFIG_ROMFS_FS is not set 676# CONFIG_ROMFS_FS is not set
677CONFIG_INOTIFY=y
573# CONFIG_QUOTA is not set 678# CONFIG_QUOTA is not set
574CONFIG_DNOTIFY=y 679CONFIG_DNOTIFY=y
575# CONFIG_AUTOFS_FS is not set 680# CONFIG_AUTOFS_FS is not set
576# CONFIG_AUTOFS4_FS is not set 681# CONFIG_AUTOFS4_FS is not set
682CONFIG_FUSE_FS=m
577 683
578# 684#
579# CD-ROM/DVD Filesystems 685# CD-ROM/DVD Filesystems
@@ -594,12 +700,10 @@ CONFIG_DNOTIFY=y
594CONFIG_PROC_FS=y 700CONFIG_PROC_FS=y
595CONFIG_PROC_KCORE=y 701CONFIG_PROC_KCORE=y
596CONFIG_SYSFS=y 702CONFIG_SYSFS=y
597# CONFIG_DEVFS_FS is not set
598CONFIG_DEVPTS_FS_XATTR=y
599CONFIG_DEVPTS_FS_SECURITY=y
600# CONFIG_TMPFS is not set 703# CONFIG_TMPFS is not set
601# CONFIG_HUGETLB_PAGE is not set 704# CONFIG_HUGETLB_PAGE is not set
602CONFIG_RAMFS=y 705CONFIG_RAMFS=y
706CONFIG_RELAYFS_FS=m
603 707
604# 708#
605# Miscellaneous filesystems 709# Miscellaneous filesystems
@@ -628,7 +732,7 @@ CONFIG_NFS_FS=y
628# CONFIG_NFSD is not set 732# CONFIG_NFSD is not set
629CONFIG_ROOT_NFS=y 733CONFIG_ROOT_NFS=y
630CONFIG_LOCKD=y 734CONFIG_LOCKD=y
631# CONFIG_EXPORTFS is not set 735CONFIG_NFS_COMMON=y
632CONFIG_SUNRPC=y 736CONFIG_SUNRPC=y
633# CONFIG_RPCSEC_GSS_KRB5 is not set 737# CONFIG_RPCSEC_GSS_KRB5 is not set
634# CONFIG_RPCSEC_GSS_SPKM3 is not set 738# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -637,6 +741,7 @@ CONFIG_SUNRPC=y
637# CONFIG_NCP_FS is not set 741# CONFIG_NCP_FS is not set
638# CONFIG_CODA_FS is not set 742# CONFIG_CODA_FS is not set
639# CONFIG_AFS_FS is not set 743# CONFIG_AFS_FS is not set
744# CONFIG_9P_FS is not set
640 745
641# 746#
642# Partition Types 747# Partition Types
@@ -657,7 +762,9 @@ CONFIG_MSDOS_PARTITION=y
657# 762#
658# Kernel hacking 763# Kernel hacking
659# 764#
765# CONFIG_PRINTK_TIME is not set
660# CONFIG_DEBUG_KERNEL is not set 766# CONFIG_DEBUG_KERNEL is not set
767CONFIG_LOG_BUF_SHIFT=14
661CONFIG_CROSSCOMPILE=y 768CONFIG_CROSSCOMPILE=y
662CONFIG_CMDLINE="" 769CONFIG_CMDLINE=""
663 770
@@ -671,7 +778,31 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
671# 778#
672# Cryptographic options 779# Cryptographic options
673# 780#
674# CONFIG_CRYPTO is not set 781CONFIG_CRYPTO=y
782CONFIG_CRYPTO_HMAC=y
783CONFIG_CRYPTO_NULL=m
784CONFIG_CRYPTO_MD4=m
785CONFIG_CRYPTO_MD5=m
786CONFIG_CRYPTO_SHA1=m
787CONFIG_CRYPTO_SHA256=m
788CONFIG_CRYPTO_SHA512=m
789CONFIG_CRYPTO_WP512=m
790CONFIG_CRYPTO_TGR192=m
791CONFIG_CRYPTO_DES=m
792CONFIG_CRYPTO_BLOWFISH=m
793CONFIG_CRYPTO_TWOFISH=m
794CONFIG_CRYPTO_SERPENT=m
795CONFIG_CRYPTO_AES=m
796CONFIG_CRYPTO_CAST5=m
797CONFIG_CRYPTO_CAST6=m
798CONFIG_CRYPTO_TEA=m
799CONFIG_CRYPTO_ARC4=m
800CONFIG_CRYPTO_KHAZAD=m
801CONFIG_CRYPTO_ANUBIS=m
802CONFIG_CRYPTO_DEFLATE=m
803CONFIG_CRYPTO_MICHAEL_MIC=m
804CONFIG_CRYPTO_CRC32C=m
805# CONFIG_CRYPTO_TEST is not set
675 806
676# 807#
677# Hardware crypto devices 808# Hardware crypto devices
@@ -681,7 +812,8 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
681# Library routines 812# Library routines
682# 813#
683# CONFIG_CRC_CCITT is not set 814# CONFIG_CRC_CCITT is not set
684# CONFIG_CRC32 is not set 815CONFIG_CRC16=m
816CONFIG_CRC32=m
685CONFIG_LIBCRC32C=m 817CONFIG_LIBCRC32C=m
686CONFIG_GENERIC_HARDIRQS=y 818CONFIG_ZLIB_INFLATE=m
687CONFIG_GENERIC_IRQ_PROBE=y 819CONFIG_ZLIB_DEFLATE=m
diff --git a/arch/mips/configs/jaguar-atx_defconfig b/arch/mips/configs/jaguar-atx_defconfig
index 8abb5a0c6c12..21b2b8042f91 100644
--- a/arch/mips/configs/jaguar-atx_defconfig
+++ b/arch/mips/configs/jaguar-atx_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:05 2005 4# Thu Oct 20 22:26:14 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,24 +11,29 @@ CONFIG_32BIT=y
14# CONFIG_EXPERIMENTAL is not set 11# CONFIG_EXPERIMENTAL is not set
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24# CONFIG_BSD_PROCESS_ACCT is not set 23# CONFIG_BSD_PROCESS_ACCT is not set
25CONFIG_SYSCTL=y 24CONFIG_SYSCTL=y
26# CONFIG_AUDIT is not set 25# CONFIG_AUDIT is not set
27CONFIG_LOG_BUF_SHIFT=14 26CONFIG_HOTPLUG=y
28# CONFIG_HOTPLUG is not set
29CONFIG_KOBJECT_UEVENT=y 27CONFIG_KOBJECT_UEVENT=y
30CONFIG_IKCONFIG=y 28CONFIG_IKCONFIG=y
31CONFIG_IKCONFIG_PROC=y 29CONFIG_IKCONFIG_PROC=y
30CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y 31CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y 32CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_EXTRA_PASS is not set 33# CONFIG_KALLSYMS_EXTRA_PASS is not set
34CONFIG_PRINTK=y
35CONFIG_BUG=y
36CONFIG_BASE_FULL=y
35CONFIG_FUTEX=y 37CONFIG_FUTEX=y
36CONFIG_EPOLL=y 38CONFIG_EPOLL=y
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -41,6 +43,7 @@ CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0 43CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0 44CONFIG_CC_ALIGN_JUMPS=0
43# CONFIG_TINY_SHMEM is not set 45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
44 47
45# 48#
46# Loadable module support 49# Loadable module support
@@ -54,36 +57,70 @@ CONFIG_KMOD=y
54# 57#
55# Machine selection 58# Machine selection
56# 59#
57# CONFIG_MACH_JAZZ is not set 60# CONFIG_MIPS_MTX1 is not set
58# CONFIG_MACH_VR41XX is not set 61# CONFIG_MIPS_BOSPORUS is not set
59# CONFIG_TOSHIBA_JMR3927 is not set 62# CONFIG_MIPS_PB1000 is not set
63# CONFIG_MIPS_PB1100 is not set
64# CONFIG_MIPS_PB1500 is not set
65# CONFIG_MIPS_PB1550 is not set
66# CONFIG_MIPS_PB1200 is not set
67# CONFIG_MIPS_DB1000 is not set
68# CONFIG_MIPS_DB1100 is not set
69# CONFIG_MIPS_DB1500 is not set
70# CONFIG_MIPS_DB1550 is not set
71# CONFIG_MIPS_DB1200 is not set
72# CONFIG_MIPS_MIRAGE is not set
73# CONFIG_MIPS_COBALT is not set
60# CONFIG_MACH_DECSTATION is not set 74# CONFIG_MACH_DECSTATION is not set
75# CONFIG_MIPS_EV64120 is not set
76# CONFIG_MIPS_EV96100 is not set
61# CONFIG_MIPS_IVR is not set 77# CONFIG_MIPS_IVR is not set
62# CONFIG_LASAT is not set
63# CONFIG_MIPS_ITE8172 is not set 78# CONFIG_MIPS_ITE8172 is not set
79# CONFIG_MACH_JAZZ is not set
80# CONFIG_LASAT is not set
64# CONFIG_MIPS_ATLAS is not set 81# CONFIG_MIPS_ATLAS is not set
65# CONFIG_MIPS_MALTA is not set 82# CONFIG_MIPS_MALTA is not set
83# CONFIG_MIPS_SEAD is not set
84# CONFIG_MIPS_SIM is not set
85CONFIG_MOMENCO_JAGUAR_ATX=y
66# CONFIG_MOMENCO_OCELOT is not set 86# CONFIG_MOMENCO_OCELOT is not set
67# CONFIG_MOMENCO_OCELOT_G is not set
68# CONFIG_MOMENCO_OCELOT_C is not set
69# CONFIG_MOMENCO_OCELOT_3 is not set 87# CONFIG_MOMENCO_OCELOT_3 is not set
70CONFIG_MOMENCO_JAGUAR_ATX=y 88# CONFIG_MOMENCO_OCELOT_C is not set
71CONFIG_JAGUAR_DMALOW=y 89# CONFIG_MOMENCO_OCELOT_G is not set
72# CONFIG_PMC_YOSEMITE is not set 90# CONFIG_MIPS_XXS1500 is not set
91# CONFIG_PNX8550_V2PCI is not set
92# CONFIG_PNX8550_JBS is not set
93# CONFIG_DDB5074 is not set
73# CONFIG_DDB5476 is not set 94# CONFIG_DDB5476 is not set
74# CONFIG_DDB5477 is not set 95# CONFIG_DDB5477 is not set
75# CONFIG_NEC_OSPREY is not set 96# CONFIG_MACH_VR41XX is not set
97# CONFIG_PMC_YOSEMITE is not set
98# CONFIG_QEMU is not set
76# CONFIG_SGI_IP22 is not set 99# CONFIG_SGI_IP22 is not set
77# CONFIG_SOC_AU1X00 is not set 100# CONFIG_SGI_IP27 is not set
101# CONFIG_SGI_IP32 is not set
102# CONFIG_SIBYTE_BIGSUR is not set
103# CONFIG_SIBYTE_SWARM is not set
104# CONFIG_SIBYTE_SENTOSA is not set
105# CONFIG_SIBYTE_RHONE is not set
106# CONFIG_SIBYTE_CARMEL is not set
107# CONFIG_SIBYTE_PTSWARM is not set
108# CONFIG_SIBYTE_LITTLESUR is not set
109# CONFIG_SIBYTE_CRHINE is not set
110# CONFIG_SIBYTE_CRHONE is not set
78# CONFIG_SNI_RM200_PCI is not set 111# CONFIG_SNI_RM200_PCI is not set
112# CONFIG_TOSHIBA_JMR3927 is not set
79# CONFIG_TOSHIBA_RBTX4927 is not set 113# CONFIG_TOSHIBA_RBTX4927 is not set
114# CONFIG_TOSHIBA_RBTX4938 is not set
115CONFIG_JAGUAR_DMALOW=y
80CONFIG_RWSEM_GENERIC_SPINLOCK=y 116CONFIG_RWSEM_GENERIC_SPINLOCK=y
81CONFIG_GENERIC_CALIBRATE_DELAY=y 117CONFIG_GENERIC_CALIBRATE_DELAY=y
82CONFIG_HAVE_DEC_LOCK=y
83CONFIG_DMA_NONCOHERENT=y 118CONFIG_DMA_NONCOHERENT=y
84CONFIG_DMA_NEED_PCI_MAP_STATE=y 119CONFIG_DMA_NEED_PCI_MAP_STATE=y
85CONFIG_LIMITED_DMA=y 120CONFIG_LIMITED_DMA=y
121CONFIG_CPU_BIG_ENDIAN=y
86# CONFIG_CPU_LITTLE_ENDIAN is not set 122# CONFIG_CPU_LITTLE_ENDIAN is not set
123CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
87CONFIG_IRQ_CPU=y 124CONFIG_IRQ_CPU=y
88CONFIG_IRQ_CPU_RM7K=y 125CONFIG_IRQ_CPU_RM7K=y
89CONFIG_IRQ_MV64340=y 126CONFIG_IRQ_MV64340=y
@@ -95,8 +132,10 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
95# 132#
96# CPU selection 133# CPU selection
97# 134#
98# CONFIG_CPU_MIPS32 is not set 135# CONFIG_CPU_MIPS32_R1 is not set
99# CONFIG_CPU_MIPS64 is not set 136# CONFIG_CPU_MIPS32_R2 is not set
137# CONFIG_CPU_MIPS64_R1 is not set
138# CONFIG_CPU_MIPS64_R2 is not set
100# CONFIG_CPU_R3000 is not set 139# CONFIG_CPU_R3000 is not set
101# CONFIG_CPU_TX39XX is not set 140# CONFIG_CPU_TX39XX is not set
102# CONFIG_CPU_VR41XX is not set 141# CONFIG_CPU_VR41XX is not set
@@ -112,6 +151,17 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
112# CONFIG_CPU_RM7000 is not set 151# CONFIG_CPU_RM7000 is not set
113CONFIG_CPU_RM9000=y 152CONFIG_CPU_RM9000=y
114# CONFIG_CPU_SB1 is not set 153# CONFIG_CPU_SB1 is not set
154CONFIG_SYS_HAS_CPU_RM9000=y
155CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
156CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
157CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
158CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
159
160#
161# Kernel type
162#
163CONFIG_32BIT=y
164# CONFIG_64BIT is not set
115CONFIG_PAGE_SIZE_4KB=y 165CONFIG_PAGE_SIZE_4KB=y
116# CONFIG_PAGE_SIZE_8KB is not set 166# CONFIG_PAGE_SIZE_8KB is not set
117# CONFIG_PAGE_SIZE_16KB is not set 167# CONFIG_PAGE_SIZE_16KB is not set
@@ -119,13 +169,24 @@ CONFIG_PAGE_SIZE_4KB=y
119CONFIG_BOARD_SCACHE=y 169CONFIG_BOARD_SCACHE=y
120CONFIG_RM7000_CPU_SCACHE=y 170CONFIG_RM7000_CPU_SCACHE=y
121CONFIG_CPU_HAS_PREFETCH=y 171CONFIG_CPU_HAS_PREFETCH=y
172# CONFIG_MIPS_MT is not set
122# CONFIG_64BIT_PHYS_ADDR is not set 173# CONFIG_64BIT_PHYS_ADDR is not set
123# CONFIG_CPU_ADVANCED is not set 174# CONFIG_CPU_ADVANCED is not set
124CONFIG_CPU_HAS_LLSC=y 175CONFIG_CPU_HAS_LLSC=y
125CONFIG_CPU_HAS_LLDSCD=y 176CONFIG_CPU_HAS_LLDSCD=y
126CONFIG_CPU_HAS_SYNC=y 177CONFIG_CPU_HAS_SYNC=y
178CONFIG_GENERIC_HARDIRQS=y
179CONFIG_GENERIC_IRQ_PROBE=y
127CONFIG_HIGHMEM=y 180CONFIG_HIGHMEM=y
181CONFIG_CPU_SUPPORTS_HIGHMEM=y
182CONFIG_SYS_SUPPORTS_HIGHMEM=y
183CONFIG_ARCH_FLATMEM_ENABLE=y
184CONFIG_FLATMEM=y
185CONFIG_FLAT_NODE_MEM_MAP=y
186# CONFIG_SPARSEMEM_STATIC is not set
128# CONFIG_SMP is not set 187# CONFIG_SMP is not set
188CONFIG_PREEMPT_NONE=y
189# CONFIG_PREEMPT_VOLUNTARY is not set
129# CONFIG_PREEMPT is not set 190# CONFIG_PREEMPT is not set
130 191
131# 192#
@@ -134,7 +195,6 @@ CONFIG_HIGHMEM=y
134CONFIG_HW_HAS_PCI=y 195CONFIG_HW_HAS_PCI=y
135CONFIG_PCI=y 196CONFIG_PCI=y
136CONFIG_PCI_LEGACY_PROC=y 197CONFIG_PCI_LEGACY_PROC=y
137CONFIG_PCI_NAMES=y
138CONFIG_MMU=y 198CONFIG_MMU=y
139 199
140# 200#
@@ -143,10 +203,6 @@ CONFIG_MMU=y
143# CONFIG_PCCARD is not set 203# CONFIG_PCCARD is not set
144 204
145# 205#
146# PC-card bridges
147#
148
149#
150# PCI Hotplug Support 206# PCI Hotplug Support
151# 207#
152 208
@@ -158,6 +214,68 @@ CONFIG_BINFMT_ELF=y
158CONFIG_TRAD_SIGNALS=y 214CONFIG_TRAD_SIGNALS=y
159 215
160# 216#
217# Networking
218#
219CONFIG_NET=y
220
221#
222# Networking options
223#
224# CONFIG_PACKET is not set
225CONFIG_UNIX=y
226CONFIG_XFRM=y
227CONFIG_XFRM_USER=m
228# CONFIG_NET_KEY is not set
229CONFIG_INET=y
230# CONFIG_IP_MULTICAST is not set
231# CONFIG_IP_ADVANCED_ROUTER is not set
232CONFIG_IP_FIB_HASH=y
233CONFIG_IP_PNP=y
234# CONFIG_IP_PNP_DHCP is not set
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_SYN_COOKIES is not set
240# CONFIG_INET_AH is not set
241# CONFIG_INET_ESP is not set
242# CONFIG_INET_IPCOMP is not set
243CONFIG_INET_TUNNEL=m
244CONFIG_INET_DIAG=y
245CONFIG_INET_TCP_DIAG=y
246# CONFIG_TCP_CONG_ADVANCED is not set
247CONFIG_TCP_CONG_BIC=y
248CONFIG_IPV6=m
249CONFIG_IPV6_PRIVACY=y
250CONFIG_INET6_AH=m
251CONFIG_INET6_ESP=m
252CONFIG_INET6_IPCOMP=m
253CONFIG_INET6_TUNNEL=m
254CONFIG_IPV6_TUNNEL=m
255# CONFIG_NETFILTER is not set
256# CONFIG_BRIDGE is not set
257# CONFIG_VLAN_8021Q is not set
258# CONFIG_DECNET is not set
259# CONFIG_LLC2 is not set
260# CONFIG_IPX is not set
261# CONFIG_ATALK is not set
262# CONFIG_NET_SCHED is not set
263# CONFIG_NET_CLS_ROUTE is not set
264
265#
266# Network testing
267#
268# CONFIG_NET_PKTGEN is not set
269# CONFIG_HAMRADIO is not set
270# CONFIG_IRDA is not set
271# CONFIG_BT is not set
272CONFIG_IEEE80211=m
273# CONFIG_IEEE80211_DEBUG is not set
274CONFIG_IEEE80211_CRYPT_WEP=m
275CONFIG_IEEE80211_CRYPT_CCMP=m
276CONFIG_IEEE80211_CRYPT_TKIP=m
277
278#
161# Device Drivers 279# Device Drivers
162# 280#
163 281
@@ -166,7 +284,12 @@ CONFIG_TRAD_SIGNALS=y
166# 284#
167CONFIG_STANDALONE=y 285CONFIG_STANDALONE=y
168CONFIG_PREVENT_FIRMWARE_BUILD=y 286CONFIG_PREVENT_FIRMWARE_BUILD=y
169# CONFIG_FW_LOADER is not set 287CONFIG_FW_LOADER=m
288
289#
290# Connector - unified userspace <-> kernelspace linker
291#
292CONFIG_CONNECTOR=m
170 293
171# 294#
172# Memory Technology Devices (MTD) 295# Memory Technology Devices (MTD)
@@ -185,7 +308,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
185# 308#
186# Block devices 309# Block devices
187# 310#
188# CONFIG_BLK_DEV_FD is not set
189# CONFIG_BLK_CPQ_DA is not set 311# CONFIG_BLK_CPQ_DA is not set
190# CONFIG_BLK_CPQ_CISS_DA is not set 312# CONFIG_BLK_CPQ_CISS_DA is not set
191# CONFIG_BLK_DEV_DAC960 is not set 313# CONFIG_BLK_DEV_DAC960 is not set
@@ -195,7 +317,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
195# CONFIG_BLK_DEV_SX8 is not set 317# CONFIG_BLK_DEV_SX8 is not set
196# CONFIG_BLK_DEV_RAM is not set 318# CONFIG_BLK_DEV_RAM is not set
197CONFIG_BLK_DEV_RAM_COUNT=16 319CONFIG_BLK_DEV_RAM_COUNT=16
198CONFIG_INITRAMFS_SOURCE=""
199# CONFIG_LBD is not set 320# CONFIG_LBD is not set
200CONFIG_CDROM_PKTCDVD=m 321CONFIG_CDROM_PKTCDVD=m
201CONFIG_CDROM_PKTCDVD_BUFFERS=8 322CONFIG_CDROM_PKTCDVD_BUFFERS=8
@@ -218,6 +339,7 @@ CONFIG_ATA_OVER_ETH=m
218# 339#
219# SCSI device support 340# SCSI device support
220# 341#
342CONFIG_RAID_ATTRS=m
221# CONFIG_SCSI is not set 343# CONFIG_SCSI is not set
222 344
223# 345#
@@ -228,6 +350,7 @@ CONFIG_ATA_OVER_ETH=m
228# 350#
229# Fusion MPT device support 351# Fusion MPT device support
230# 352#
353# CONFIG_FUSION is not set
231 354
232# 355#
233# IEEE 1394 (FireWire) support 356# IEEE 1394 (FireWire) support
@@ -240,58 +363,8 @@ CONFIG_ATA_OVER_ETH=m
240# CONFIG_I2O is not set 363# CONFIG_I2O is not set
241 364
242# 365#
243# Networking support 366# Network device support
244# 367#
245CONFIG_NET=y
246
247#
248# Networking options
249#
250# CONFIG_PACKET is not set
251# CONFIG_NETLINK_DEV is not set
252CONFIG_UNIX=y
253# CONFIG_NET_KEY is not set
254CONFIG_INET=y
255# CONFIG_IP_MULTICAST is not set
256# CONFIG_IP_ADVANCED_ROUTER is not set
257CONFIG_IP_PNP=y
258# CONFIG_IP_PNP_DHCP is not set
259CONFIG_IP_PNP_BOOTP=y
260# CONFIG_IP_PNP_RARP is not set
261# CONFIG_NET_IPIP is not set
262# CONFIG_NET_IPGRE is not set
263# CONFIG_SYN_COOKIES is not set
264# CONFIG_INET_AH is not set
265# CONFIG_INET_ESP is not set
266# CONFIG_INET_IPCOMP is not set
267CONFIG_INET_TUNNEL=m
268CONFIG_IP_TCPDIAG=m
269# CONFIG_IP_TCPDIAG_IPV6 is not set
270# CONFIG_NETFILTER is not set
271CONFIG_XFRM=y
272CONFIG_XFRM_USER=m
273# CONFIG_BRIDGE is not set
274# CONFIG_VLAN_8021Q is not set
275# CONFIG_DECNET is not set
276# CONFIG_LLC2 is not set
277# CONFIG_IPX is not set
278# CONFIG_ATALK is not set
279
280#
281# QoS and/or fair queueing
282#
283# CONFIG_NET_SCHED is not set
284# CONFIG_NET_CLS_ROUTE is not set
285
286#
287# Network testing
288#
289# CONFIG_NET_PKTGEN is not set
290# CONFIG_NETPOLL is not set
291# CONFIG_NET_POLL_CONTROLLER is not set
292# CONFIG_HAMRADIO is not set
293# CONFIG_IRDA is not set
294# CONFIG_BT is not set
295CONFIG_NETDEVICES=y 368CONFIG_NETDEVICES=y
296# CONFIG_DUMMY is not set 369# CONFIG_DUMMY is not set
297# CONFIG_BONDING is not set 370# CONFIG_BONDING is not set
@@ -304,6 +377,21 @@ CONFIG_NETDEVICES=y
304# CONFIG_ARCNET is not set 377# CONFIG_ARCNET is not set
305 378
306# 379#
380# PHY device support
381#
382CONFIG_PHYLIB=m
383CONFIG_PHYCONTROL=y
384
385#
386# MII PHY device drivers
387#
388CONFIG_MARVELL_PHY=m
389CONFIG_DAVICOM_PHY=m
390CONFIG_QSEMI_PHY=m
391CONFIG_LXT_PHY=m
392CONFIG_CICADA_PHY=m
393
394#
307# Ethernet (10 or 100Mbit) 395# Ethernet (10 or 100Mbit)
308# 396#
309CONFIG_NET_ETHERNET=y 397CONFIG_NET_ETHERNET=y
@@ -343,9 +431,11 @@ CONFIG_EEPRO100=y
343# CONFIG_NS83820 is not set 431# CONFIG_NS83820 is not set
344# CONFIG_HAMACHI is not set 432# CONFIG_HAMACHI is not set
345# CONFIG_R8169 is not set 433# CONFIG_R8169 is not set
434# CONFIG_SIS190 is not set
346# CONFIG_SK98LIN is not set 435# CONFIG_SK98LIN is not set
347# CONFIG_VIA_VELOCITY is not set 436# CONFIG_VIA_VELOCITY is not set
348# CONFIG_TIGON3 is not set 437# CONFIG_TIGON3 is not set
438# CONFIG_BNX2 is not set
349CONFIG_MV643XX_ETH=y 439CONFIG_MV643XX_ETH=y
350CONFIG_MV643XX_ETH_0=y 440CONFIG_MV643XX_ETH_0=y
351CONFIG_MV643XX_ETH_1=y 441CONFIG_MV643XX_ETH_1=y
@@ -354,6 +444,7 @@ CONFIG_MV643XX_ETH_2=y
354# 444#
355# Ethernet (10000 Mbit) 445# Ethernet (10000 Mbit)
356# 446#
447# CONFIG_CHELSIO_T1 is not set
357# CONFIG_IXGB is not set 448# CONFIG_IXGB is not set
358# CONFIG_S2IO is not set 449# CONFIG_S2IO is not set
359 450
@@ -366,6 +457,8 @@ CONFIG_MV643XX_ETH_2=y
366# Wireless LAN (non-hamradio) 457# Wireless LAN (non-hamradio)
367# 458#
368# CONFIG_NET_RADIO is not set 459# CONFIG_NET_RADIO is not set
460# CONFIG_IPW_DEBUG is not set
461CONFIG_IPW2200=m
369 462
370# 463#
371# Wan interfaces 464# Wan interfaces
@@ -374,6 +467,8 @@ CONFIG_MV643XX_ETH_2=y
374# CONFIG_FDDI is not set 467# CONFIG_FDDI is not set
375# CONFIG_PPP is not set 468# CONFIG_PPP is not set
376# CONFIG_SLIP is not set 469# CONFIG_SLIP is not set
470# CONFIG_NETPOLL is not set
471# CONFIG_NET_POLL_CONTROLLER is not set
377 472
378# 473#
379# ISDN subsystem 474# ISDN subsystem
@@ -391,20 +486,10 @@ CONFIG_MV643XX_ETH_2=y
391# CONFIG_INPUT is not set 486# CONFIG_INPUT is not set
392 487
393# 488#
394# Userland interfaces 489# Hardware I/O ports
395#
396
397#
398# Input I/O drivers
399# 490#
400# CONFIG_GAMEPORT is not set
401CONFIG_SOUND_GAMEPORT=y
402# CONFIG_SERIO is not set 491# CONFIG_SERIO is not set
403# CONFIG_SERIO_I8042 is not set 492# CONFIG_GAMEPORT is not set
404
405#
406# Input Device Drivers
407#
408 493
409# 494#
410# Character devices 495# Character devices
@@ -425,6 +510,7 @@ CONFIG_SERIAL_8250_NR_UARTS=4
425# 510#
426CONFIG_SERIAL_CORE=y 511CONFIG_SERIAL_CORE=y
427CONFIG_SERIAL_CORE_CONSOLE=y 512CONFIG_SERIAL_CORE_CONSOLE=y
513# CONFIG_SERIAL_JSM is not set
428CONFIG_UNIX98_PTYS=y 514CONFIG_UNIX98_PTYS=y
429CONFIG_LEGACY_PTYS=y 515CONFIG_LEGACY_PTYS=y
430CONFIG_LEGACY_PTY_COUNT=256 516CONFIG_LEGACY_PTY_COUNT=256
@@ -451,6 +537,10 @@ CONFIG_LEGACY_PTY_COUNT=256
451# CONFIG_RAW_DRIVER is not set 537# CONFIG_RAW_DRIVER is not set
452 538
453# 539#
540# TPM devices
541#
542
543#
454# I2C support 544# I2C support
455# 545#
456# CONFIG_I2C is not set 546# CONFIG_I2C is not set
@@ -461,10 +551,20 @@ CONFIG_LEGACY_PTY_COUNT=256
461# CONFIG_W1 is not set 551# CONFIG_W1 is not set
462 552
463# 553#
554# Hardware Monitoring support
555#
556# CONFIG_HWMON is not set
557# CONFIG_HWMON_VID is not set
558
559#
464# Misc devices 560# Misc devices
465# 561#
466 562
467# 563#
564# Multimedia Capabilities Port drivers
565#
566
567#
468# Multimedia devices 568# Multimedia devices
469# 569#
470# CONFIG_VIDEO_DEV is not set 570# CONFIG_VIDEO_DEV is not set
@@ -478,7 +578,6 @@ CONFIG_LEGACY_PTY_COUNT=256
478# Graphics support 578# Graphics support
479# 579#
480# CONFIG_FB is not set 580# CONFIG_FB is not set
481# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
482 581
483# 582#
484# Sound 583# Sound
@@ -488,13 +587,9 @@ CONFIG_LEGACY_PTY_COUNT=256
488# 587#
489# USB support 588# USB support
490# 589#
491# CONFIG_USB is not set
492CONFIG_USB_ARCH_HAS_HCD=y 590CONFIG_USB_ARCH_HAS_HCD=y
493CONFIG_USB_ARCH_HAS_OHCI=y 591CONFIG_USB_ARCH_HAS_OHCI=y
494 592# CONFIG_USB is not set
495#
496# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
497#
498 593
499# 594#
500# USB Gadget Support 595# USB Gadget Support
@@ -512,6 +607,10 @@ CONFIG_USB_ARCH_HAS_OHCI=y
512# CONFIG_INFINIBAND is not set 607# CONFIG_INFINIBAND is not set
513 608
514# 609#
610# SN Devices
611#
612
613#
515# File systems 614# File systems
516# 615#
517# CONFIG_EXT2_FS is not set 616# CONFIG_EXT2_FS is not set
@@ -519,13 +618,16 @@ CONFIG_USB_ARCH_HAS_OHCI=y
519# CONFIG_JBD is not set 618# CONFIG_JBD is not set
520# CONFIG_REISERFS_FS is not set 619# CONFIG_REISERFS_FS is not set
521# CONFIG_JFS_FS is not set 620# CONFIG_JFS_FS is not set
621# CONFIG_FS_POSIX_ACL is not set
522# CONFIG_XFS_FS is not set 622# CONFIG_XFS_FS is not set
523# CONFIG_MINIX_FS is not set 623# CONFIG_MINIX_FS is not set
524# CONFIG_ROMFS_FS is not set 624# CONFIG_ROMFS_FS is not set
625CONFIG_INOTIFY=y
525# CONFIG_QUOTA is not set 626# CONFIG_QUOTA is not set
526CONFIG_DNOTIFY=y 627CONFIG_DNOTIFY=y
527# CONFIG_AUTOFS_FS is not set 628# CONFIG_AUTOFS_FS is not set
528# CONFIG_AUTOFS4_FS is not set 629# CONFIG_AUTOFS4_FS is not set
630CONFIG_FUSE_FS=m
529 631
530# 632#
531# CD-ROM/DVD Filesystems 633# CD-ROM/DVD Filesystems
@@ -546,10 +648,10 @@ CONFIG_DNOTIFY=y
546CONFIG_PROC_FS=y 648CONFIG_PROC_FS=y
547CONFIG_PROC_KCORE=y 649CONFIG_PROC_KCORE=y
548CONFIG_SYSFS=y 650CONFIG_SYSFS=y
549# CONFIG_DEVPTS_FS_XATTR is not set
550# CONFIG_TMPFS is not set 651# CONFIG_TMPFS is not set
551# CONFIG_HUGETLB_PAGE is not set 652# CONFIG_HUGETLB_PAGE is not set
552CONFIG_RAMFS=y 653CONFIG_RAMFS=y
654CONFIG_RELAYFS_FS=m
553 655
554# 656#
555# Miscellaneous filesystems 657# Miscellaneous filesystems
@@ -570,7 +672,7 @@ CONFIG_NFS_FS=y
570# CONFIG_NFSD is not set 672# CONFIG_NFSD is not set
571CONFIG_ROOT_NFS=y 673CONFIG_ROOT_NFS=y
572CONFIG_LOCKD=y 674CONFIG_LOCKD=y
573# CONFIG_EXPORTFS is not set 675CONFIG_NFS_COMMON=y
574CONFIG_SUNRPC=y 676CONFIG_SUNRPC=y
575# CONFIG_SMB_FS is not set 677# CONFIG_SMB_FS is not set
576# CONFIG_CIFS is not set 678# CONFIG_CIFS is not set
@@ -591,7 +693,9 @@ CONFIG_MSDOS_PARTITION=y
591# 693#
592# Kernel hacking 694# Kernel hacking
593# 695#
696# CONFIG_PRINTK_TIME is not set
594# CONFIG_DEBUG_KERNEL is not set 697# CONFIG_DEBUG_KERNEL is not set
698CONFIG_LOG_BUF_SHIFT=14
595CONFIG_CROSSCOMPILE=y 699CONFIG_CROSSCOMPILE=y
596CONFIG_CMDLINE="" 700CONFIG_CMDLINE=""
597 701
@@ -605,7 +709,31 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
605# 709#
606# Cryptographic options 710# Cryptographic options
607# 711#
608# CONFIG_CRYPTO is not set 712CONFIG_CRYPTO=y
713CONFIG_CRYPTO_HMAC=y
714CONFIG_CRYPTO_NULL=m
715CONFIG_CRYPTO_MD4=m
716CONFIG_CRYPTO_MD5=m
717CONFIG_CRYPTO_SHA1=m
718CONFIG_CRYPTO_SHA256=m
719CONFIG_CRYPTO_SHA512=m
720CONFIG_CRYPTO_WP512=m
721CONFIG_CRYPTO_TGR192=m
722CONFIG_CRYPTO_DES=m
723CONFIG_CRYPTO_BLOWFISH=m
724CONFIG_CRYPTO_TWOFISH=m
725CONFIG_CRYPTO_SERPENT=m
726CONFIG_CRYPTO_AES=m
727CONFIG_CRYPTO_CAST5=m
728CONFIG_CRYPTO_CAST6=m
729CONFIG_CRYPTO_TEA=m
730CONFIG_CRYPTO_ARC4=m
731CONFIG_CRYPTO_KHAZAD=m
732CONFIG_CRYPTO_ANUBIS=m
733CONFIG_CRYPTO_DEFLATE=m
734CONFIG_CRYPTO_MICHAEL_MIC=m
735CONFIG_CRYPTO_CRC32C=m
736# CONFIG_CRYPTO_TEST is not set
609 737
610# 738#
611# Hardware crypto devices 739# Hardware crypto devices
@@ -615,7 +743,8 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
615# Library routines 743# Library routines
616# 744#
617# CONFIG_CRC_CCITT is not set 745# CONFIG_CRC_CCITT is not set
618# CONFIG_CRC32 is not set 746CONFIG_CRC16=m
619# CONFIG_LIBCRC32C is not set 747CONFIG_CRC32=m
620CONFIG_GENERIC_HARDIRQS=y 748CONFIG_LIBCRC32C=m
621CONFIG_GENERIC_IRQ_PROBE=y 749CONFIG_ZLIB_INFLATE=m
750CONFIG_ZLIB_DEFLATE=m
diff --git a/arch/mips/configs/jmr3927_defconfig b/arch/mips/configs/jmr3927_defconfig
index da5d9ee2ecce..9a728c2d8fd5 100644
--- a/arch/mips/configs/jmr3927_defconfig
+++ b/arch/mips/configs/jmr3927_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:06 2005 4# Thu Oct 20 22:26:17 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,24 +11,29 @@ CONFIG_32BIT=y
14CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
25# CONFIG_BSD_PROCESS_ACCT is not set 24# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y 25CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set 26# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14 27CONFIG_HOTPLUG=y
29# CONFIG_HOTPLUG is not set
30CONFIG_KOBJECT_UEVENT=y 28CONFIG_KOBJECT_UEVENT=y
31# CONFIG_IKCONFIG is not set 29# CONFIG_IKCONFIG is not set
30CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y 31CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y 32CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_EXTRA_PASS is not set 33# CONFIG_KALLSYMS_EXTRA_PASS is not set
34CONFIG_PRINTK=y
35CONFIG_BUG=y
36CONFIG_BASE_FULL=y
35CONFIG_FUTEX=y 37CONFIG_FUTEX=y
36CONFIG_EPOLL=y 38CONFIG_EPOLL=y
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -41,6 +43,7 @@ CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0 43CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0 44CONFIG_CC_ALIGN_JUMPS=0
43# CONFIG_TINY_SHMEM is not set 45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
44 47
45# 48#
46# Loadable module support 49# Loadable module support
@@ -50,40 +53,68 @@ CONFIG_CC_ALIGN_JUMPS=0
50# 53#
51# Machine selection 54# Machine selection
52# 55#
53# CONFIG_MACH_JAZZ is not set 56# CONFIG_MIPS_MTX1 is not set
54# CONFIG_MACH_VR41XX is not set 57# CONFIG_MIPS_BOSPORUS is not set
55CONFIG_TOSHIBA_JMR3927=y 58# CONFIG_MIPS_PB1000 is not set
59# CONFIG_MIPS_PB1100 is not set
60# CONFIG_MIPS_PB1500 is not set
61# CONFIG_MIPS_PB1550 is not set
62# CONFIG_MIPS_PB1200 is not set
63# CONFIG_MIPS_DB1000 is not set
64# CONFIG_MIPS_DB1100 is not set
65# CONFIG_MIPS_DB1500 is not set
66# CONFIG_MIPS_DB1550 is not set
67# CONFIG_MIPS_DB1200 is not set
68# CONFIG_MIPS_MIRAGE is not set
56# CONFIG_MIPS_COBALT is not set 69# CONFIG_MIPS_COBALT is not set
57# CONFIG_MACH_DECSTATION is not set 70# CONFIG_MACH_DECSTATION is not set
58# CONFIG_MIPS_EV64120 is not set 71# CONFIG_MIPS_EV64120 is not set
59# CONFIG_MIPS_EV96100 is not set 72# CONFIG_MIPS_EV96100 is not set
60# CONFIG_MIPS_IVR is not set 73# CONFIG_MIPS_IVR is not set
61# CONFIG_LASAT is not set
62# CONFIG_MIPS_ITE8172 is not set 74# CONFIG_MIPS_ITE8172 is not set
75# CONFIG_MACH_JAZZ is not set
76# CONFIG_LASAT is not set
63# CONFIG_MIPS_ATLAS is not set 77# CONFIG_MIPS_ATLAS is not set
64# CONFIG_MIPS_MALTA is not set 78# CONFIG_MIPS_MALTA is not set
65# CONFIG_MIPS_SEAD is not set 79# CONFIG_MIPS_SEAD is not set
80# CONFIG_MIPS_SIM is not set
81# CONFIG_MOMENCO_JAGUAR_ATX is not set
66# CONFIG_MOMENCO_OCELOT is not set 82# CONFIG_MOMENCO_OCELOT is not set
67# CONFIG_MOMENCO_OCELOT_G is not set
68# CONFIG_MOMENCO_OCELOT_C is not set
69# CONFIG_MOMENCO_OCELOT_3 is not set 83# CONFIG_MOMENCO_OCELOT_3 is not set
70# CONFIG_MOMENCO_JAGUAR_ATX is not set 84# CONFIG_MOMENCO_OCELOT_C is not set
71# CONFIG_PMC_YOSEMITE is not set 85# CONFIG_MOMENCO_OCELOT_G is not set
86# CONFIG_MIPS_XXS1500 is not set
87# CONFIG_PNX8550_V2PCI is not set
88# CONFIG_PNX8550_JBS is not set
72# CONFIG_DDB5074 is not set 89# CONFIG_DDB5074 is not set
73# CONFIG_DDB5476 is not set 90# CONFIG_DDB5476 is not set
74# CONFIG_DDB5477 is not set 91# CONFIG_DDB5477 is not set
75# CONFIG_NEC_OSPREY is not set 92# CONFIG_MACH_VR41XX is not set
93# CONFIG_PMC_YOSEMITE is not set
94# CONFIG_QEMU is not set
76# CONFIG_SGI_IP22 is not set 95# CONFIG_SGI_IP22 is not set
77# CONFIG_SOC_AU1X00 is not set 96# CONFIG_SGI_IP27 is not set
78# CONFIG_SIBYTE_SB1xxx_SOC is not set 97# CONFIG_SGI_IP32 is not set
98# CONFIG_SIBYTE_BIGSUR is not set
99# CONFIG_SIBYTE_SWARM is not set
100# CONFIG_SIBYTE_SENTOSA is not set
101# CONFIG_SIBYTE_RHONE is not set
102# CONFIG_SIBYTE_CARMEL is not set
103# CONFIG_SIBYTE_PTSWARM is not set
104# CONFIG_SIBYTE_LITTLESUR is not set
105# CONFIG_SIBYTE_CRHINE is not set
106# CONFIG_SIBYTE_CRHONE is not set
79# CONFIG_SNI_RM200_PCI is not set 107# CONFIG_SNI_RM200_PCI is not set
108CONFIG_TOSHIBA_JMR3927=y
80# CONFIG_TOSHIBA_RBTX4927 is not set 109# CONFIG_TOSHIBA_RBTX4927 is not set
110# CONFIG_TOSHIBA_RBTX4938 is not set
81CONFIG_RWSEM_GENERIC_SPINLOCK=y 111CONFIG_RWSEM_GENERIC_SPINLOCK=y
82CONFIG_GENERIC_CALIBRATE_DELAY=y 112CONFIG_GENERIC_CALIBRATE_DELAY=y
83CONFIG_HAVE_DEC_LOCK=y
84CONFIG_DMA_NONCOHERENT=y 113CONFIG_DMA_NONCOHERENT=y
85CONFIG_DMA_NEED_PCI_MAP_STATE=y 114CONFIG_DMA_NEED_PCI_MAP_STATE=y
115CONFIG_CPU_BIG_ENDIAN=y
86# CONFIG_CPU_LITTLE_ENDIAN is not set 116# CONFIG_CPU_LITTLE_ENDIAN is not set
117CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
87CONFIG_MIPS_TX3927=y 118CONFIG_MIPS_TX3927=y
88CONFIG_SWAP_IO_SPACE=y 119CONFIG_SWAP_IO_SPACE=y
89CONFIG_MIPS_L1_CACHE_SHIFT=5 120CONFIG_MIPS_L1_CACHE_SHIFT=5
@@ -92,8 +123,10 @@ CONFIG_TOSHIBA_BOARDS=y
92# 123#
93# CPU selection 124# CPU selection
94# 125#
95# CONFIG_CPU_MIPS32 is not set 126# CONFIG_CPU_MIPS32_R1 is not set
96# CONFIG_CPU_MIPS64 is not set 127# CONFIG_CPU_MIPS32_R2 is not set
128# CONFIG_CPU_MIPS64_R1 is not set
129# CONFIG_CPU_MIPS64_R2 is not set
97# CONFIG_CPU_R3000 is not set 130# CONFIG_CPU_R3000 is not set
98CONFIG_CPU_TX39XX=y 131CONFIG_CPU_TX39XX=y
99# CONFIG_CPU_VR41XX is not set 132# CONFIG_CPU_VR41XX is not set
@@ -109,12 +142,34 @@ CONFIG_CPU_TX39XX=y
109# CONFIG_CPU_RM7000 is not set 142# CONFIG_CPU_RM7000 is not set
110# CONFIG_CPU_RM9000 is not set 143# CONFIG_CPU_RM9000 is not set
111# CONFIG_CPU_SB1 is not set 144# CONFIG_CPU_SB1 is not set
145CONFIG_SYS_HAS_CPU_TX39XX=y
146CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
147CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
148
149#
150# Kernel type
151#
152CONFIG_32BIT=y
153# CONFIG_64BIT is not set
112CONFIG_PAGE_SIZE_4KB=y 154CONFIG_PAGE_SIZE_4KB=y
113# CONFIG_PAGE_SIZE_8KB is not set 155# CONFIG_PAGE_SIZE_8KB is not set
114# CONFIG_PAGE_SIZE_16KB is not set 156# CONFIG_PAGE_SIZE_16KB is not set
115# CONFIG_PAGE_SIZE_64KB is not set 157# CONFIG_PAGE_SIZE_64KB is not set
158# CONFIG_MIPS_MT is not set
116# CONFIG_CPU_ADVANCED is not set 159# CONFIG_CPU_ADVANCED is not set
117CONFIG_CPU_HAS_SYNC=y 160CONFIG_CPU_HAS_SYNC=y
161CONFIG_GENERIC_HARDIRQS=y
162CONFIG_GENERIC_IRQ_PROBE=y
163CONFIG_ARCH_FLATMEM_ENABLE=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_PREEMPT_NONE=y
172# CONFIG_PREEMPT_VOLUNTARY is not set
118# CONFIG_PREEMPT is not set 173# CONFIG_PREEMPT is not set
119CONFIG_RTC_DS1742=y 174CONFIG_RTC_DS1742=y
120 175
@@ -124,7 +179,6 @@ CONFIG_RTC_DS1742=y
124CONFIG_HW_HAS_PCI=y 179CONFIG_HW_HAS_PCI=y
125CONFIG_PCI=y 180CONFIG_PCI=y
126CONFIG_PCI_LEGACY_PROC=y 181CONFIG_PCI_LEGACY_PROC=y
127CONFIG_PCI_NAMES=y
128CONFIG_MMU=y 182CONFIG_MMU=y
129 183
130# 184#
@@ -133,10 +187,6 @@ CONFIG_MMU=y
133# CONFIG_PCCARD is not set 187# CONFIG_PCCARD is not set
134 188
135# 189#
136# PC-card bridges
137#
138
139#
140# PCI Hotplug Support 190# PCI Hotplug Support
141# 191#
142# CONFIG_HOTPLUG_PCI is not set 192# CONFIG_HOTPLUG_PCI is not set
@@ -149,6 +199,80 @@ CONFIG_BINFMT_ELF=y
149CONFIG_TRAD_SIGNALS=y 199CONFIG_TRAD_SIGNALS=y
150 200
151# 201#
202# Networking
203#
204CONFIG_NET=y
205
206#
207# Networking options
208#
209CONFIG_PACKET=y
210# CONFIG_PACKET_MMAP is not set
211CONFIG_UNIX=y
212CONFIG_XFRM=y
213CONFIG_XFRM_USER=y
214CONFIG_NET_KEY=y
215CONFIG_INET=y
216# CONFIG_IP_MULTICAST is not set
217# CONFIG_IP_ADVANCED_ROUTER is not set
218CONFIG_IP_FIB_HASH=y
219CONFIG_IP_PNP=y
220# CONFIG_IP_PNP_DHCP is not set
221CONFIG_IP_PNP_BOOTP=y
222# CONFIG_IP_PNP_RARP is not set
223# CONFIG_NET_IPIP is not set
224# CONFIG_NET_IPGRE is not set
225# CONFIG_ARPD is not set
226# CONFIG_SYN_COOKIES is not set
227# CONFIG_INET_AH is not set
228# CONFIG_INET_ESP is not set
229# CONFIG_INET_IPCOMP is not set
230CONFIG_INET_TUNNEL=y
231CONFIG_INET_DIAG=y
232CONFIG_INET_TCP_DIAG=y
233# CONFIG_TCP_CONG_ADVANCED is not set
234CONFIG_TCP_CONG_BIC=y
235# CONFIG_IPV6 is not set
236# CONFIG_NETFILTER is not set
237
238#
239# DCCP Configuration (EXPERIMENTAL)
240#
241# CONFIG_IP_DCCP is not set
242
243#
244# SCTP Configuration (EXPERIMENTAL)
245#
246# CONFIG_IP_SCTP is not set
247# CONFIG_ATM is not set
248# CONFIG_BRIDGE is not set
249# CONFIG_VLAN_8021Q is not set
250# CONFIG_DECNET is not set
251# CONFIG_LLC2 is not set
252# CONFIG_IPX is not set
253# CONFIG_ATALK is not set
254# CONFIG_X25 is not set
255# CONFIG_LAPB is not set
256# CONFIG_NET_DIVERT is not set
257# CONFIG_ECONET is not set
258# CONFIG_WAN_ROUTER is not set
259# CONFIG_NET_SCHED is not set
260# CONFIG_NET_CLS_ROUTE is not set
261
262#
263# Network testing
264#
265# CONFIG_NET_PKTGEN is not set
266# CONFIG_HAMRADIO is not set
267# CONFIG_IRDA is not set
268# CONFIG_BT is not set
269CONFIG_IEEE80211=y
270# CONFIG_IEEE80211_DEBUG is not set
271CONFIG_IEEE80211_CRYPT_WEP=y
272CONFIG_IEEE80211_CRYPT_CCMP=y
273CONFIG_IEEE80211_CRYPT_TKIP=y
274
275#
152# Device Drivers 276# Device Drivers
153# 277#
154 278
@@ -157,7 +281,12 @@ CONFIG_TRAD_SIGNALS=y
157# 281#
158CONFIG_STANDALONE=y 282CONFIG_STANDALONE=y
159CONFIG_PREVENT_FIRMWARE_BUILD=y 283CONFIG_PREVENT_FIRMWARE_BUILD=y
160# CONFIG_FW_LOADER is not set 284CONFIG_FW_LOADER=y
285
286#
287# Connector - unified userspace <-> kernelspace linker
288#
289CONFIG_CONNECTOR=y
161 290
162# 291#
163# Memory Technology Devices (MTD) 292# Memory Technology Devices (MTD)
@@ -176,7 +305,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
176# 305#
177# Block devices 306# Block devices
178# 307#
179# CONFIG_BLK_DEV_FD is not set
180# CONFIG_BLK_CPQ_DA is not set 308# CONFIG_BLK_CPQ_DA is not set
181# CONFIG_BLK_CPQ_CISS_DA is not set 309# CONFIG_BLK_CPQ_CISS_DA is not set
182# CONFIG_BLK_DEV_DAC960 is not set 310# CONFIG_BLK_DEV_DAC960 is not set
@@ -187,7 +315,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
187# CONFIG_BLK_DEV_SX8 is not set 315# CONFIG_BLK_DEV_SX8 is not set
188# CONFIG_BLK_DEV_RAM is not set 316# CONFIG_BLK_DEV_RAM is not set
189CONFIG_BLK_DEV_RAM_COUNT=16 317CONFIG_BLK_DEV_RAM_COUNT=16
190CONFIG_INITRAMFS_SOURCE=""
191# CONFIG_LBD is not set 318# CONFIG_LBD is not set
192CONFIG_CDROM_PKTCDVD=y 319CONFIG_CDROM_PKTCDVD=y
193CONFIG_CDROM_PKTCDVD_BUFFERS=8 320CONFIG_CDROM_PKTCDVD_BUFFERS=8
@@ -210,6 +337,7 @@ CONFIG_ATA_OVER_ETH=y
210# 337#
211# SCSI device support 338# SCSI device support
212# 339#
340CONFIG_RAID_ATTRS=y
213# CONFIG_SCSI is not set 341# CONFIG_SCSI is not set
214 342
215# 343#
@@ -220,6 +348,7 @@ CONFIG_ATA_OVER_ETH=y
220# 348#
221# Fusion MPT device support 349# Fusion MPT device support
222# 350#
351# CONFIG_FUSION is not set
223 352
224# 353#
225# IEEE 1394 (FireWire) support 354# IEEE 1394 (FireWire) support
@@ -232,78 +361,13 @@ CONFIG_ATA_OVER_ETH=y
232# CONFIG_I2O is not set 361# CONFIG_I2O is not set
233 362
234# 363#
235# Networking support 364# Network device support
236#
237CONFIG_NET=y
238
239#
240# Networking options
241#
242CONFIG_PACKET=y
243# CONFIG_PACKET_MMAP is not set
244CONFIG_NETLINK_DEV=y
245CONFIG_UNIX=y
246CONFIG_NET_KEY=y
247CONFIG_INET=y
248# CONFIG_IP_MULTICAST is not set
249# CONFIG_IP_ADVANCED_ROUTER is not set
250CONFIG_IP_PNP=y
251# CONFIG_IP_PNP_DHCP is not set
252CONFIG_IP_PNP_BOOTP=y
253# CONFIG_IP_PNP_RARP 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
261CONFIG_INET_TUNNEL=y
262CONFIG_IP_TCPDIAG=y
263# CONFIG_IP_TCPDIAG_IPV6 is not set
264# CONFIG_IPV6 is not set
265# CONFIG_NETFILTER is not set
266CONFIG_XFRM=y
267CONFIG_XFRM_USER=y
268
269#
270# SCTP Configuration (EXPERIMENTAL)
271# 365#
272# CONFIG_IP_SCTP is not set
273# CONFIG_ATM is not set
274# CONFIG_BRIDGE is not set
275# CONFIG_VLAN_8021Q is not set
276# CONFIG_DECNET is not set
277# CONFIG_LLC2 is not set
278# CONFIG_IPX is not set
279# CONFIG_ATALK is not set
280# CONFIG_X25 is not set
281# CONFIG_LAPB is not set
282# CONFIG_NET_DIVERT is not set
283# CONFIG_ECONET is not set
284# CONFIG_WAN_ROUTER is not set
285
286#
287# QoS and/or fair queueing
288#
289# CONFIG_NET_SCHED is not set
290# CONFIG_NET_CLS_ROUTE is not set
291
292#
293# Network testing
294#
295# CONFIG_NET_PKTGEN is not set
296# CONFIG_NETPOLL is not set
297# CONFIG_NET_POLL_CONTROLLER is not set
298# CONFIG_HAMRADIO is not set
299# CONFIG_IRDA is not set
300# CONFIG_BT is not set
301CONFIG_NETDEVICES=y 366CONFIG_NETDEVICES=y
302# CONFIG_DUMMY is not set 367# CONFIG_DUMMY is not set
303# CONFIG_BONDING is not set 368# CONFIG_BONDING is not set
304# CONFIG_EQUALIZER is not set 369# CONFIG_EQUALIZER is not set
305# CONFIG_TUN is not set 370# CONFIG_TUN is not set
306# CONFIG_ETHERTAP is not set
307 371
308# 372#
309# ARCnet devices 373# ARCnet devices
@@ -311,6 +375,21 @@ CONFIG_NETDEVICES=y
311# CONFIG_ARCNET is not set 375# CONFIG_ARCNET is not set
312 376
313# 377#
378# PHY device support
379#
380CONFIG_PHYLIB=y
381CONFIG_PHYCONTROL=y
382
383#
384# MII PHY device drivers
385#
386CONFIG_MARVELL_PHY=y
387CONFIG_DAVICOM_PHY=y
388CONFIG_QSEMI_PHY=y
389CONFIG_LXT_PHY=y
390CONFIG_CICADA_PHY=y
391
392#
314# Ethernet (10 or 100Mbit) 393# Ethernet (10 or 100Mbit)
315# 394#
316CONFIG_NET_ETHERNET=y 395CONFIG_NET_ETHERNET=y
@@ -336,12 +415,16 @@ CONFIG_NET_ETHERNET=y
336# CONFIG_HAMACHI is not set 415# CONFIG_HAMACHI is not set
337# CONFIG_YELLOWFIN is not set 416# CONFIG_YELLOWFIN is not set
338# CONFIG_R8169 is not set 417# CONFIG_R8169 is not set
418# CONFIG_SIS190 is not set
419# CONFIG_SKGE is not set
339# CONFIG_SK98LIN is not set 420# CONFIG_SK98LIN is not set
340# CONFIG_TIGON3 is not set 421# CONFIG_TIGON3 is not set
422# CONFIG_BNX2 is not set
341 423
342# 424#
343# Ethernet (10000 Mbit) 425# Ethernet (10000 Mbit)
344# 426#
427# CONFIG_CHELSIO_T1 is not set
345# CONFIG_IXGB is not set 428# CONFIG_IXGB is not set
346# CONFIG_S2IO is not set 429# CONFIG_S2IO is not set
347 430
@@ -354,6 +437,8 @@ CONFIG_NET_ETHERNET=y
354# Wireless LAN (non-hamradio) 437# Wireless LAN (non-hamradio)
355# 438#
356# CONFIG_NET_RADIO is not set 439# CONFIG_NET_RADIO is not set
440# CONFIG_IPW_DEBUG is not set
441CONFIG_IPW2200=y
357 442
358# 443#
359# Wan interfaces 444# Wan interfaces
@@ -365,6 +450,8 @@ CONFIG_NET_ETHERNET=y
365# CONFIG_SLIP is not set 450# CONFIG_SLIP is not set
366# CONFIG_SHAPER is not set 451# CONFIG_SHAPER is not set
367# CONFIG_NETCONSOLE is not set 452# CONFIG_NETCONSOLE is not set
453# CONFIG_NETPOLL is not set
454# CONFIG_NET_POLL_CONTROLLER is not set
368 455
369# 456#
370# ISDN subsystem 457# ISDN subsystem
@@ -394,19 +481,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
394# CONFIG_INPUT_EVBUG is not set 481# CONFIG_INPUT_EVBUG is not set
395 482
396# 483#
397# Input I/O drivers
398#
399# CONFIG_GAMEPORT is not set
400CONFIG_SOUND_GAMEPORT=y
401CONFIG_SERIO=y
402# CONFIG_SERIO_I8042 is not set
403CONFIG_SERIO_SERPORT=y
404# CONFIG_SERIO_CT82C710 is not set
405# CONFIG_SERIO_PCIPS2 is not set
406# CONFIG_SERIO_LIBPS2 is not set
407CONFIG_SERIO_RAW=y
408
409#
410# Input Device Drivers 484# Input Device Drivers
411# 485#
412# CONFIG_INPUT_KEYBOARD is not set 486# CONFIG_INPUT_KEYBOARD is not set
@@ -416,6 +490,17 @@ CONFIG_SERIO_RAW=y
416# CONFIG_INPUT_MISC is not set 490# CONFIG_INPUT_MISC is not set
417 491
418# 492#
493# Hardware I/O ports
494#
495CONFIG_SERIO=y
496# CONFIG_SERIO_I8042 is not set
497CONFIG_SERIO_SERPORT=y
498# CONFIG_SERIO_PCIPS2 is not set
499# CONFIG_SERIO_LIBPS2 is not set
500CONFIG_SERIO_RAW=y
501# CONFIG_GAMEPORT is not set
502
503#
419# Character devices 504# Character devices
420# 505#
421CONFIG_VT=y 506CONFIG_VT=y
@@ -426,11 +511,9 @@ CONFIG_SERIAL_NONSTANDARD=y
426# CONFIG_ROCKETPORT is not set 511# CONFIG_ROCKETPORT is not set
427# CONFIG_CYCLADES is not set 512# CONFIG_CYCLADES is not set
428# CONFIG_DIGIEPCA is not set 513# CONFIG_DIGIEPCA is not set
429# CONFIG_DIGI is not set
430# CONFIG_MOXA_INTELLIO is not set 514# CONFIG_MOXA_INTELLIO is not set
431# CONFIG_MOXA_SMARTIO is not set 515# CONFIG_MOXA_SMARTIO is not set
432# CONFIG_ISI is not set 516# CONFIG_ISI is not set
433# CONFIG_SYNCLINK is not set
434# CONFIG_SYNCLINKMP is not set 517# CONFIG_SYNCLINKMP is not set
435# CONFIG_N_HDLC is not set 518# CONFIG_N_HDLC is not set
436# CONFIG_RISCOM8 is not set 519# CONFIG_RISCOM8 is not set
@@ -438,10 +521,6 @@ CONFIG_SERIAL_NONSTANDARD=y
438# CONFIG_SX is not set 521# CONFIG_SX is not set
439# CONFIG_RIO is not set 522# CONFIG_RIO is not set
440# CONFIG_STALDRV is not set 523# CONFIG_STALDRV is not set
441# CONFIG_SERIAL_TX3912 is not set
442CONFIG_TXX927_SERIAL=y
443CONFIG_TXX927_SERIAL_CONSOLE=y
444# CONFIG_SERIAL_TXX9 is not set
445 524
446# 525#
447# Serial drivers 526# Serial drivers
@@ -451,6 +530,8 @@ CONFIG_TXX927_SERIAL_CONSOLE=y
451# 530#
452# Non-8250 serial port support 531# Non-8250 serial port support
453# 532#
533CONFIG_HAS_TXX9_SERIAL=y
534# CONFIG_SERIAL_JSM is not set
454# CONFIG_UNIX98_PTYS is not set 535# CONFIG_UNIX98_PTYS is not set
455CONFIG_LEGACY_PTYS=y 536CONFIG_LEGACY_PTYS=y
456CONFIG_LEGACY_PTY_COUNT=256 537CONFIG_LEGACY_PTY_COUNT=256
@@ -477,6 +558,11 @@ CONFIG_LEGACY_PTY_COUNT=256
477# CONFIG_RAW_DRIVER is not set 558# CONFIG_RAW_DRIVER is not set
478 559
479# 560#
561# TPM devices
562#
563# CONFIG_TCG_TPM is not set
564
565#
480# I2C support 566# I2C support
481# 567#
482# CONFIG_I2C is not set 568# CONFIG_I2C is not set
@@ -487,10 +573,20 @@ CONFIG_LEGACY_PTY_COUNT=256
487# CONFIG_W1 is not set 573# CONFIG_W1 is not set
488 574
489# 575#
576# Hardware Monitoring support
577#
578# CONFIG_HWMON is not set
579# CONFIG_HWMON_VID is not set
580
581#
490# Misc devices 582# Misc devices
491# 583#
492 584
493# 585#
586# Multimedia Capabilities Port drivers
587#
588
589#
494# Multimedia devices 590# Multimedia devices
495# 591#
496# CONFIG_VIDEO_DEV is not set 592# CONFIG_VIDEO_DEV is not set
@@ -504,6 +600,11 @@ CONFIG_LEGACY_PTY_COUNT=256
504# Graphics support 600# Graphics support
505# 601#
506CONFIG_FB=y 602CONFIG_FB=y
603# CONFIG_FB_CFB_FILLRECT is not set
604# CONFIG_FB_CFB_COPYAREA is not set
605# CONFIG_FB_CFB_IMAGEBLIT is not set
606# CONFIG_FB_SOFT_CURSOR is not set
607# CONFIG_FB_MACMODES is not set
507# CONFIG_FB_MODE_HELPERS is not set 608# CONFIG_FB_MODE_HELPERS is not set
508# CONFIG_FB_TILEBLITTING is not set 609# CONFIG_FB_TILEBLITTING is not set
509# CONFIG_FB_CIRRUS is not set 610# CONFIG_FB_CIRRUS is not set
@@ -511,6 +612,7 @@ CONFIG_FB=y
511# CONFIG_FB_CYBER2000 is not set 612# CONFIG_FB_CYBER2000 is not set
512# CONFIG_FB_ASILIANT is not set 613# CONFIG_FB_ASILIANT is not set
513# CONFIG_FB_IMSTT is not set 614# CONFIG_FB_IMSTT is not set
615# CONFIG_FB_NVIDIA is not set
514# CONFIG_FB_RIVA is not set 616# CONFIG_FB_RIVA is not set
515# CONFIG_FB_MATROX is not set 617# CONFIG_FB_MATROX is not set
516# CONFIG_FB_RADEON_OLD is not set 618# CONFIG_FB_RADEON_OLD is not set
@@ -523,8 +625,11 @@ CONFIG_FB=y
523# CONFIG_FB_KYRO is not set 625# CONFIG_FB_KYRO is not set
524# CONFIG_FB_3DFX is not set 626# CONFIG_FB_3DFX is not set
525# CONFIG_FB_VOODOO1 is not set 627# CONFIG_FB_VOODOO1 is not set
628# CONFIG_FB_SMIVGX is not set
629# CONFIG_FB_CYBLA is not set
526# CONFIG_FB_TRIDENT is not set 630# CONFIG_FB_TRIDENT is not set
527# CONFIG_FB_E1356 is not set 631# CONFIG_FB_E1356 is not set
632# CONFIG_FB_S1D13XXX is not set
528# CONFIG_FB_VIRTUAL is not set 633# CONFIG_FB_VIRTUAL is not set
529 634
530# 635#
@@ -548,13 +653,9 @@ CONFIG_DUMMY_CONSOLE=y
548# 653#
549# USB support 654# USB support
550# 655#
551# CONFIG_USB is not set
552CONFIG_USB_ARCH_HAS_HCD=y 656CONFIG_USB_ARCH_HAS_HCD=y
553CONFIG_USB_ARCH_HAS_OHCI=y 657CONFIG_USB_ARCH_HAS_OHCI=y
554 658# CONFIG_USB is not set
555#
556# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
557#
558 659
559# 660#
560# USB Gadget Support 661# USB Gadget Support
@@ -572,6 +673,10 @@ CONFIG_USB_ARCH_HAS_OHCI=y
572# CONFIG_INFINIBAND is not set 673# CONFIG_INFINIBAND is not set
573 674
574# 675#
676# SN Devices
677#
678
679#
575# File systems 680# File systems
576# 681#
577# CONFIG_EXT2_FS is not set 682# CONFIG_EXT2_FS is not set
@@ -579,13 +684,16 @@ CONFIG_USB_ARCH_HAS_OHCI=y
579# CONFIG_JBD is not set 684# CONFIG_JBD is not set
580# CONFIG_REISERFS_FS is not set 685# CONFIG_REISERFS_FS is not set
581# CONFIG_JFS_FS is not set 686# CONFIG_JFS_FS is not set
687# CONFIG_FS_POSIX_ACL is not set
582# CONFIG_XFS_FS is not set 688# CONFIG_XFS_FS is not set
583# CONFIG_MINIX_FS is not set 689# CONFIG_MINIX_FS is not set
584# CONFIG_ROMFS_FS is not set 690# CONFIG_ROMFS_FS is not set
691CONFIG_INOTIFY=y
585# CONFIG_QUOTA is not set 692# CONFIG_QUOTA is not set
586CONFIG_DNOTIFY=y 693CONFIG_DNOTIFY=y
587# CONFIG_AUTOFS_FS is not set 694# CONFIG_AUTOFS_FS is not set
588# CONFIG_AUTOFS4_FS is not set 695# CONFIG_AUTOFS4_FS is not set
696CONFIG_FUSE_FS=y
589 697
590# 698#
591# CD-ROM/DVD Filesystems 699# CD-ROM/DVD Filesystems
@@ -606,10 +714,10 @@ CONFIG_DNOTIFY=y
606CONFIG_PROC_FS=y 714CONFIG_PROC_FS=y
607CONFIG_PROC_KCORE=y 715CONFIG_PROC_KCORE=y
608CONFIG_SYSFS=y 716CONFIG_SYSFS=y
609# CONFIG_DEVFS_FS is not set
610# CONFIG_TMPFS is not set 717# CONFIG_TMPFS is not set
611# CONFIG_HUGETLB_PAGE is not set 718# CONFIG_HUGETLB_PAGE is not set
612CONFIG_RAMFS=y 719CONFIG_RAMFS=y
720CONFIG_RELAYFS_FS=y
613 721
614# 722#
615# Miscellaneous filesystems 723# Miscellaneous filesystems
@@ -638,7 +746,7 @@ CONFIG_NFS_FS=y
638# CONFIG_NFSD is not set 746# CONFIG_NFSD is not set
639CONFIG_ROOT_NFS=y 747CONFIG_ROOT_NFS=y
640CONFIG_LOCKD=y 748CONFIG_LOCKD=y
641# CONFIG_EXPORTFS is not set 749CONFIG_NFS_COMMON=y
642CONFIG_SUNRPC=y 750CONFIG_SUNRPC=y
643# CONFIG_RPCSEC_GSS_KRB5 is not set 751# CONFIG_RPCSEC_GSS_KRB5 is not set
644# CONFIG_RPCSEC_GSS_SPKM3 is not set 752# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -647,6 +755,7 @@ CONFIG_SUNRPC=y
647# CONFIG_NCP_FS is not set 755# CONFIG_NCP_FS is not set
648# CONFIG_CODA_FS is not set 756# CONFIG_CODA_FS is not set
649# CONFIG_AFS_FS is not set 757# CONFIG_AFS_FS is not set
758# CONFIG_9P_FS is not set
650 759
651# 760#
652# Partition Types 761# Partition Types
@@ -667,7 +776,9 @@ CONFIG_MSDOS_PARTITION=y
667# 776#
668# Kernel hacking 777# Kernel hacking
669# 778#
779# CONFIG_PRINTK_TIME is not set
670# CONFIG_DEBUG_KERNEL is not set 780# CONFIG_DEBUG_KERNEL is not set
781CONFIG_LOG_BUF_SHIFT=14
671CONFIG_CROSSCOMPILE=y 782CONFIG_CROSSCOMPILE=y
672CONFIG_CMDLINE="" 783CONFIG_CMDLINE=""
673 784
@@ -681,7 +792,31 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
681# 792#
682# Cryptographic options 793# Cryptographic options
683# 794#
684# CONFIG_CRYPTO is not set 795CONFIG_CRYPTO=y
796CONFIG_CRYPTO_HMAC=y
797CONFIG_CRYPTO_NULL=y
798CONFIG_CRYPTO_MD4=y
799CONFIG_CRYPTO_MD5=y
800CONFIG_CRYPTO_SHA1=y
801CONFIG_CRYPTO_SHA256=y
802CONFIG_CRYPTO_SHA512=y
803CONFIG_CRYPTO_WP512=y
804CONFIG_CRYPTO_TGR192=y
805CONFIG_CRYPTO_DES=y
806CONFIG_CRYPTO_BLOWFISH=y
807CONFIG_CRYPTO_TWOFISH=y
808CONFIG_CRYPTO_SERPENT=y
809CONFIG_CRYPTO_AES=y
810CONFIG_CRYPTO_CAST5=y
811CONFIG_CRYPTO_CAST6=y
812CONFIG_CRYPTO_TEA=y
813CONFIG_CRYPTO_ARC4=y
814CONFIG_CRYPTO_KHAZAD=y
815CONFIG_CRYPTO_ANUBIS=y
816CONFIG_CRYPTO_DEFLATE=y
817CONFIG_CRYPTO_MICHAEL_MIC=y
818CONFIG_CRYPTO_CRC32C=y
819# CONFIG_CRYPTO_TEST is not set
685 820
686# 821#
687# Hardware crypto devices 822# Hardware crypto devices
@@ -691,7 +826,8 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
691# Library routines 826# Library routines
692# 827#
693# CONFIG_CRC_CCITT is not set 828# CONFIG_CRC_CCITT is not set
694# CONFIG_CRC32 is not set 829CONFIG_CRC16=y
695# CONFIG_LIBCRC32C is not set 830CONFIG_CRC32=y
696CONFIG_GENERIC_HARDIRQS=y 831CONFIG_LIBCRC32C=y
697CONFIG_GENERIC_IRQ_PROBE=y 832CONFIG_ZLIB_INFLATE=y
833CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/mips/configs/lasat200_defconfig b/arch/mips/configs/lasat200_defconfig
index 8d600ae890f4..03cd0ca6e639 100644
--- a/arch/mips/configs/lasat200_defconfig
+++ b/arch/mips/configs/lasat200_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:06 2005 4# Thu Oct 20 22:26:19 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,24 +11,29 @@ CONFIG_32BIT=y
14CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
25# CONFIG_BSD_PROCESS_ACCT is not set 24# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y 25CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set 26# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14 27CONFIG_HOTPLUG=y
29# CONFIG_HOTPLUG is not set
30CONFIG_KOBJECT_UEVENT=y 28CONFIG_KOBJECT_UEVENT=y
31# CONFIG_IKCONFIG is not set 29# CONFIG_IKCONFIG is not set
30CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y 31CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y 32CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_EXTRA_PASS is not set 33# CONFIG_KALLSYMS_EXTRA_PASS is not set
34CONFIG_PRINTK=y
35CONFIG_BUG=y
36CONFIG_BASE_FULL=y
35CONFIG_FUTEX=y 37CONFIG_FUTEX=y
36CONFIG_EPOLL=y 38CONFIG_EPOLL=y
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -41,6 +43,7 @@ CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0 43CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0 44CONFIG_CC_ALIGN_JUMPS=0
43# CONFIG_TINY_SHMEM is not set 45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
44 47
45# 48#
46# Loadable module support 49# Loadable module support
@@ -56,53 +59,83 @@ CONFIG_KMOD=y
56# 59#
57# Machine selection 60# Machine selection
58# 61#
59# CONFIG_MACH_JAZZ is not set 62# CONFIG_MIPS_MTX1 is not set
60# CONFIG_MACH_VR41XX is not set 63# CONFIG_MIPS_BOSPORUS is not set
61# CONFIG_TOSHIBA_JMR3927 is not set 64# CONFIG_MIPS_PB1000 is not set
65# CONFIG_MIPS_PB1100 is not set
66# CONFIG_MIPS_PB1500 is not set
67# CONFIG_MIPS_PB1550 is not set
68# CONFIG_MIPS_PB1200 is not set
69# CONFIG_MIPS_DB1000 is not set
70# CONFIG_MIPS_DB1100 is not set
71# CONFIG_MIPS_DB1500 is not set
72# CONFIG_MIPS_DB1550 is not set
73# CONFIG_MIPS_DB1200 is not set
74# CONFIG_MIPS_MIRAGE is not set
62# CONFIG_MIPS_COBALT is not set 75# CONFIG_MIPS_COBALT is not set
63# CONFIG_MACH_DECSTATION is not set 76# CONFIG_MACH_DECSTATION is not set
64# CONFIG_MIPS_EV64120 is not set 77# CONFIG_MIPS_EV64120 is not set
65# CONFIG_MIPS_EV96100 is not set 78# CONFIG_MIPS_EV96100 is not set
66# CONFIG_MIPS_IVR is not set 79# CONFIG_MIPS_IVR is not set
67CONFIG_LASAT=y
68CONFIG_PICVUE=y
69CONFIG_PICVUE_PROC=y
70CONFIG_DS1603=y
71CONFIG_LASAT_SYSCTL=y
72# CONFIG_MIPS_ITE8172 is not set 80# CONFIG_MIPS_ITE8172 is not set
81# CONFIG_MACH_JAZZ is not set
82CONFIG_LASAT=y
73# CONFIG_MIPS_ATLAS is not set 83# CONFIG_MIPS_ATLAS is not set
74# CONFIG_MIPS_MALTA is not set 84# CONFIG_MIPS_MALTA is not set
75# CONFIG_MIPS_SEAD is not set 85# CONFIG_MIPS_SEAD is not set
86# CONFIG_MIPS_SIM is not set
87# CONFIG_MOMENCO_JAGUAR_ATX is not set
76# CONFIG_MOMENCO_OCELOT is not set 88# CONFIG_MOMENCO_OCELOT is not set
77# CONFIG_MOMENCO_OCELOT_G is not set
78# CONFIG_MOMENCO_OCELOT_C is not set
79# CONFIG_MOMENCO_OCELOT_3 is not set 89# CONFIG_MOMENCO_OCELOT_3 is not set
80# CONFIG_MOMENCO_JAGUAR_ATX is not set 90# CONFIG_MOMENCO_OCELOT_C is not set
81# CONFIG_PMC_YOSEMITE is not set 91# CONFIG_MOMENCO_OCELOT_G is not set
92# CONFIG_MIPS_XXS1500 is not set
93# CONFIG_PNX8550_V2PCI is not set
94# CONFIG_PNX8550_JBS is not set
82# CONFIG_DDB5074 is not set 95# CONFIG_DDB5074 is not set
83# CONFIG_DDB5476 is not set 96# CONFIG_DDB5476 is not set
84# CONFIG_DDB5477 is not set 97# CONFIG_DDB5477 is not set
85# CONFIG_NEC_OSPREY is not set 98# CONFIG_MACH_VR41XX is not set
99# CONFIG_PMC_YOSEMITE is not set
100# CONFIG_QEMU is not set
86# CONFIG_SGI_IP22 is not set 101# CONFIG_SGI_IP22 is not set
87# CONFIG_SOC_AU1X00 is not set 102# CONFIG_SGI_IP27 is not set
88# CONFIG_SIBYTE_SB1xxx_SOC is not set 103# CONFIG_SGI_IP32 is not set
104# CONFIG_SIBYTE_BIGSUR is not set
105# CONFIG_SIBYTE_SWARM is not set
106# CONFIG_SIBYTE_SENTOSA is not set
107# CONFIG_SIBYTE_RHONE is not set
108# CONFIG_SIBYTE_CARMEL is not set
109# CONFIG_SIBYTE_PTSWARM is not set
110# CONFIG_SIBYTE_LITTLESUR is not set
111# CONFIG_SIBYTE_CRHINE is not set
112# CONFIG_SIBYTE_CRHONE is not set
89# CONFIG_SNI_RM200_PCI is not set 113# CONFIG_SNI_RM200_PCI is not set
114# CONFIG_TOSHIBA_JMR3927 is not set
90# CONFIG_TOSHIBA_RBTX4927 is not set 115# CONFIG_TOSHIBA_RBTX4927 is not set
116# CONFIG_TOSHIBA_RBTX4938 is not set
117CONFIG_PICVUE=y
118CONFIG_PICVUE_PROC=y
119CONFIG_DS1603=y
120CONFIG_LASAT_SYSCTL=y
91CONFIG_RWSEM_GENERIC_SPINLOCK=y 121CONFIG_RWSEM_GENERIC_SPINLOCK=y
92CONFIG_GENERIC_CALIBRATE_DELAY=y 122CONFIG_GENERIC_CALIBRATE_DELAY=y
93CONFIG_HAVE_DEC_LOCK=y
94CONFIG_DMA_NONCOHERENT=y 123CONFIG_DMA_NONCOHERENT=y
95CONFIG_DMA_NEED_PCI_MAP_STATE=y 124CONFIG_DMA_NEED_PCI_MAP_STATE=y
96CONFIG_MIPS_NILE4=y 125CONFIG_MIPS_NILE4=y
126# CONFIG_CPU_BIG_ENDIAN is not set
97CONFIG_CPU_LITTLE_ENDIAN=y 127CONFIG_CPU_LITTLE_ENDIAN=y
128CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
98CONFIG_MIPS_GT64120=y 129CONFIG_MIPS_GT64120=y
99CONFIG_MIPS_L1_CACHE_SHIFT=5 130CONFIG_MIPS_L1_CACHE_SHIFT=5
100 131
101# 132#
102# CPU selection 133# CPU selection
103# 134#
104# CONFIG_CPU_MIPS32 is not set 135# CONFIG_CPU_MIPS32_R1 is not set
105# CONFIG_CPU_MIPS64 is not set 136# CONFIG_CPU_MIPS32_R2 is not set
137# CONFIG_CPU_MIPS64_R1 is not set
138# CONFIG_CPU_MIPS64_R2 is not set
106# CONFIG_CPU_R3000 is not set 139# CONFIG_CPU_R3000 is not set
107# CONFIG_CPU_TX39XX is not set 140# CONFIG_CPU_TX39XX is not set
108# CONFIG_CPU_VR41XX is not set 141# CONFIG_CPU_VR41XX is not set
@@ -118,17 +151,41 @@ CONFIG_CPU_R5000=y
118# CONFIG_CPU_RM7000 is not set 151# CONFIG_CPU_RM7000 is not set
119# CONFIG_CPU_RM9000 is not set 152# CONFIG_CPU_RM9000 is not set
120# CONFIG_CPU_SB1 is not set 153# CONFIG_CPU_SB1 is not set
154CONFIG_SYS_HAS_CPU_R5000=y
155CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
156CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
157CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
158CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
159
160#
161# Kernel type
162#
163CONFIG_32BIT=y
164# CONFIG_64BIT is not set
121CONFIG_PAGE_SIZE_4KB=y 165CONFIG_PAGE_SIZE_4KB=y
122# CONFIG_PAGE_SIZE_8KB is not set 166# CONFIG_PAGE_SIZE_8KB is not set
123# CONFIG_PAGE_SIZE_16KB is not set 167# CONFIG_PAGE_SIZE_16KB is not set
124# CONFIG_PAGE_SIZE_64KB is not set 168# CONFIG_PAGE_SIZE_64KB is not set
125CONFIG_BOARD_SCACHE=y 169CONFIG_BOARD_SCACHE=y
126CONFIG_R5000_CPU_SCACHE=y 170CONFIG_R5000_CPU_SCACHE=y
171# CONFIG_MIPS_MT is not set
127# CONFIG_64BIT_PHYS_ADDR is not set 172# CONFIG_64BIT_PHYS_ADDR is not set
128# CONFIG_CPU_ADVANCED is not set 173# CONFIG_CPU_ADVANCED is not set
129CONFIG_CPU_HAS_LLSC=y 174CONFIG_CPU_HAS_LLSC=y
130CONFIG_CPU_HAS_LLDSCD=y 175CONFIG_CPU_HAS_LLDSCD=y
131CONFIG_CPU_HAS_SYNC=y 176CONFIG_CPU_HAS_SYNC=y
177CONFIG_GENERIC_HARDIRQS=y
178CONFIG_GENERIC_IRQ_PROBE=y
179CONFIG_ARCH_FLATMEM_ENABLE=y
180CONFIG_SELECT_MEMORY_MODEL=y
181CONFIG_FLATMEM_MANUAL=y
182# CONFIG_DISCONTIGMEM_MANUAL is not set
183# CONFIG_SPARSEMEM_MANUAL is not set
184CONFIG_FLATMEM=y
185CONFIG_FLAT_NODE_MEM_MAP=y
186# CONFIG_SPARSEMEM_STATIC is not set
187CONFIG_PREEMPT_NONE=y
188# CONFIG_PREEMPT_VOLUNTARY is not set
132# CONFIG_PREEMPT is not set 189# CONFIG_PREEMPT is not set
133 190
134# 191#
@@ -137,7 +194,6 @@ CONFIG_CPU_HAS_SYNC=y
137CONFIG_HW_HAS_PCI=y 194CONFIG_HW_HAS_PCI=y
138CONFIG_PCI=y 195CONFIG_PCI=y
139CONFIG_PCI_LEGACY_PROC=y 196CONFIG_PCI_LEGACY_PROC=y
140# CONFIG_PCI_NAMES is not set
141CONFIG_MMU=y 197CONFIG_MMU=y
142 198
143# 199#
@@ -146,10 +202,6 @@ CONFIG_MMU=y
146# CONFIG_PCCARD is not set 202# CONFIG_PCCARD is not set
147 203
148# 204#
149# PC-card bridges
150#
151
152#
153# PCI Hotplug Support 205# PCI Hotplug Support
154# 206#
155# CONFIG_HOTPLUG_PCI is not set 207# CONFIG_HOTPLUG_PCI is not set
@@ -162,6 +214,76 @@ CONFIG_BINFMT_ELF=y
162CONFIG_TRAD_SIGNALS=y 214CONFIG_TRAD_SIGNALS=y
163 215
164# 216#
217# Networking
218#
219CONFIG_NET=y
220
221#
222# Networking options
223#
224# CONFIG_PACKET is not set
225CONFIG_UNIX=y
226CONFIG_XFRM=y
227CONFIG_XFRM_USER=m
228CONFIG_NET_KEY=y
229CONFIG_INET=y
230# CONFIG_IP_MULTICAST is not set
231# CONFIG_IP_ADVANCED_ROUTER is not set
232CONFIG_IP_FIB_HASH=y
233# CONFIG_IP_PNP 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
241CONFIG_INET_TUNNEL=m
242CONFIG_INET_DIAG=y
243CONFIG_INET_TCP_DIAG=y
244# CONFIG_TCP_CONG_ADVANCED is not set
245CONFIG_TCP_CONG_BIC=y
246# CONFIG_IPV6 is not set
247# CONFIG_NETFILTER is not set
248
249#
250# DCCP Configuration (EXPERIMENTAL)
251#
252# CONFIG_IP_DCCP is not set
253
254#
255# SCTP Configuration (EXPERIMENTAL)
256#
257# CONFIG_IP_SCTP is not set
258# CONFIG_ATM is not set
259# CONFIG_BRIDGE is not set
260# CONFIG_VLAN_8021Q is not set
261# CONFIG_DECNET is not set
262# CONFIG_LLC2 is not set
263# CONFIG_IPX is not set
264# CONFIG_ATALK is not set
265# CONFIG_X25 is not set
266# CONFIG_LAPB is not set
267# CONFIG_NET_DIVERT is not set
268# CONFIG_ECONET is not set
269# CONFIG_WAN_ROUTER is not set
270# CONFIG_NET_SCHED is not set
271# CONFIG_NET_CLS_ROUTE is not set
272
273#
274# Network testing
275#
276# CONFIG_NET_PKTGEN is not set
277# CONFIG_HAMRADIO is not set
278# CONFIG_IRDA is not set
279# CONFIG_BT is not set
280CONFIG_IEEE80211=m
281# CONFIG_IEEE80211_DEBUG is not set
282CONFIG_IEEE80211_CRYPT_WEP=m
283CONFIG_IEEE80211_CRYPT_CCMP=m
284CONFIG_IEEE80211_CRYPT_TKIP=m
285
286#
165# Device Drivers 287# Device Drivers
166# 288#
167 289
@@ -170,15 +292,20 @@ CONFIG_TRAD_SIGNALS=y
170# 292#
171CONFIG_STANDALONE=y 293CONFIG_STANDALONE=y
172CONFIG_PREVENT_FIRMWARE_BUILD=y 294CONFIG_PREVENT_FIRMWARE_BUILD=y
173# CONFIG_FW_LOADER is not set 295CONFIG_FW_LOADER=m
296
297#
298# Connector - unified userspace <-> kernelspace linker
299#
300CONFIG_CONNECTOR=m
174 301
175# 302#
176# Memory Technology Devices (MTD) 303# Memory Technology Devices (MTD)
177# 304#
178CONFIG_MTD=y 305CONFIG_MTD=y
179# CONFIG_MTD_DEBUG is not set 306# CONFIG_MTD_DEBUG is not set
180CONFIG_MTD_PARTITIONS=y
181# CONFIG_MTD_CONCAT is not set 307# CONFIG_MTD_CONCAT is not set
308CONFIG_MTD_PARTITIONS=y
182# CONFIG_MTD_REDBOOT_PARTS is not set 309# CONFIG_MTD_REDBOOT_PARTS is not set
183# CONFIG_MTD_CMDLINE_PARTS is not set 310# CONFIG_MTD_CMDLINE_PARTS is not set
184 311
@@ -223,6 +350,7 @@ CONFIG_MTD_CFI_UTIL=y
223# CONFIG_MTD_COMPLEX_MAPPINGS is not set 350# CONFIG_MTD_COMPLEX_MAPPINGS is not set
224# CONFIG_MTD_PHYSMAP is not set 351# CONFIG_MTD_PHYSMAP is not set
225CONFIG_MTD_LASAT=y 352CONFIG_MTD_LASAT=y
353# CONFIG_MTD_PLATRAM is not set
226 354
227# 355#
228# Self-contained MTD device drivers 356# Self-contained MTD device drivers
@@ -258,7 +386,6 @@ CONFIG_MTD_LASAT=y
258# 386#
259# Block devices 387# Block devices
260# 388#
261# CONFIG_BLK_DEV_FD is not set
262# CONFIG_BLK_CPQ_DA is not set 389# CONFIG_BLK_CPQ_DA is not set
263# CONFIG_BLK_CPQ_CISS_DA is not set 390# CONFIG_BLK_CPQ_CISS_DA is not set
264# CONFIG_BLK_DEV_DAC960 is not set 391# CONFIG_BLK_DEV_DAC960 is not set
@@ -269,7 +396,6 @@ CONFIG_MTD_LASAT=y
269# CONFIG_BLK_DEV_SX8 is not set 396# CONFIG_BLK_DEV_SX8 is not set
270# CONFIG_BLK_DEV_RAM is not set 397# CONFIG_BLK_DEV_RAM is not set
271CONFIG_BLK_DEV_RAM_COUNT=16 398CONFIG_BLK_DEV_RAM_COUNT=16
272CONFIG_INITRAMFS_SOURCE=""
273# CONFIG_LBD is not set 399# CONFIG_LBD is not set
274CONFIG_CDROM_PKTCDVD=m 400CONFIG_CDROM_PKTCDVD=m
275CONFIG_CDROM_PKTCDVD_BUFFERS=8 401CONFIG_CDROM_PKTCDVD_BUFFERS=8
@@ -326,6 +452,7 @@ CONFIG_BLK_DEV_CMD64X=y
326# CONFIG_BLK_DEV_HPT366 is not set 452# CONFIG_BLK_DEV_HPT366 is not set
327# CONFIG_BLK_DEV_SC1200 is not set 453# CONFIG_BLK_DEV_SC1200 is not set
328# CONFIG_BLK_DEV_PIIX is not set 454# CONFIG_BLK_DEV_PIIX is not set
455# CONFIG_BLK_DEV_IT821X is not set
329# CONFIG_BLK_DEV_NS87415 is not set 456# CONFIG_BLK_DEV_NS87415 is not set
330# CONFIG_BLK_DEV_PDC202XX_OLD is not set 457# CONFIG_BLK_DEV_PDC202XX_OLD is not set
331# CONFIG_BLK_DEV_PDC202XX_NEW is not set 458# CONFIG_BLK_DEV_PDC202XX_NEW is not set
@@ -343,6 +470,7 @@ CONFIG_IDEDMA_AUTO=y
343# 470#
344# SCSI device support 471# SCSI device support
345# 472#
473CONFIG_RAID_ATTRS=m
346# CONFIG_SCSI is not set 474# CONFIG_SCSI is not set
347 475
348# 476#
@@ -353,6 +481,7 @@ CONFIG_IDEDMA_AUTO=y
353# 481#
354# Fusion MPT device support 482# Fusion MPT device support
355# 483#
484# CONFIG_FUSION is not set
356 485
357# 486#
358# IEEE 1394 (FireWire) support 487# IEEE 1394 (FireWire) support
@@ -365,68 +494,8 @@ CONFIG_IDEDMA_AUTO=y
365# CONFIG_I2O is not set 494# CONFIG_I2O is not set
366 495
367# 496#
368# Networking support 497# Network device support
369#
370CONFIG_NET=y
371
372#
373# Networking options
374#
375# CONFIG_PACKET is not set
376# CONFIG_NETLINK_DEV is not set
377CONFIG_UNIX=y
378CONFIG_NET_KEY=y
379CONFIG_INET=y
380# CONFIG_IP_MULTICAST is not set
381# CONFIG_IP_ADVANCED_ROUTER is not set
382# CONFIG_IP_PNP is not set
383# CONFIG_NET_IPIP is not set
384# CONFIG_NET_IPGRE is not set
385# CONFIG_ARPD is not set
386# CONFIG_SYN_COOKIES is not set
387# CONFIG_INET_AH is not set
388# CONFIG_INET_ESP is not set
389# CONFIG_INET_IPCOMP is not set
390CONFIG_INET_TUNNEL=m
391CONFIG_IP_TCPDIAG=m
392# CONFIG_IP_TCPDIAG_IPV6 is not set
393# CONFIG_IPV6 is not set
394# CONFIG_NETFILTER is not set
395CONFIG_XFRM=y
396CONFIG_XFRM_USER=m
397
398#
399# SCTP Configuration (EXPERIMENTAL)
400#
401# CONFIG_IP_SCTP is not set
402# CONFIG_ATM is not set
403# CONFIG_BRIDGE is not set
404# CONFIG_VLAN_8021Q is not set
405# CONFIG_DECNET is not set
406# CONFIG_LLC2 is not set
407# CONFIG_IPX is not set
408# CONFIG_ATALK is not set
409# CONFIG_X25 is not set
410# CONFIG_LAPB is not set
411# CONFIG_NET_DIVERT is not set
412# CONFIG_ECONET is not set
413# CONFIG_WAN_ROUTER is not set
414
415#
416# QoS and/or fair queueing
417# 498#
418# CONFIG_NET_SCHED is not set
419# CONFIG_NET_CLS_ROUTE is not set
420
421#
422# Network testing
423#
424# CONFIG_NET_PKTGEN is not set
425# CONFIG_NETPOLL is not set
426# CONFIG_NET_POLL_CONTROLLER is not set
427# CONFIG_HAMRADIO is not set
428# CONFIG_IRDA is not set
429# CONFIG_BT is not set
430CONFIG_NETDEVICES=y 499CONFIG_NETDEVICES=y
431# CONFIG_DUMMY is not set 500# CONFIG_DUMMY is not set
432# CONFIG_BONDING is not set 501# CONFIG_BONDING is not set
@@ -439,6 +508,21 @@ CONFIG_NETDEVICES=y
439# CONFIG_ARCNET is not set 508# CONFIG_ARCNET is not set
440 509
441# 510#
511# PHY device support
512#
513CONFIG_PHYLIB=m
514CONFIG_PHYCONTROL=y
515
516#
517# MII PHY device drivers
518#
519CONFIG_MARVELL_PHY=m
520CONFIG_DAVICOM_PHY=m
521CONFIG_QSEMI_PHY=m
522CONFIG_LXT_PHY=m
523CONFIG_CICADA_PHY=m
524
525#
442# Ethernet (10 or 100Mbit) 526# Ethernet (10 or 100Mbit)
443# 527#
444CONFIG_NET_ETHERNET=y 528CONFIG_NET_ETHERNET=y
@@ -464,12 +548,16 @@ CONFIG_NET_ETHERNET=y
464# CONFIG_HAMACHI is not set 548# CONFIG_HAMACHI is not set
465# CONFIG_YELLOWFIN is not set 549# CONFIG_YELLOWFIN is not set
466# CONFIG_R8169 is not set 550# CONFIG_R8169 is not set
551# CONFIG_SIS190 is not set
552# CONFIG_SKGE is not set
467# CONFIG_SK98LIN is not set 553# CONFIG_SK98LIN is not set
468# CONFIG_TIGON3 is not set 554# CONFIG_TIGON3 is not set
555# CONFIG_BNX2 is not set
469 556
470# 557#
471# Ethernet (10000 Mbit) 558# Ethernet (10000 Mbit)
472# 559#
560# CONFIG_CHELSIO_T1 is not set
473# CONFIG_IXGB is not set 561# CONFIG_IXGB is not set
474# CONFIG_S2IO is not set 562# CONFIG_S2IO is not set
475 563
@@ -482,6 +570,8 @@ CONFIG_NET_ETHERNET=y
482# Wireless LAN (non-hamradio) 570# Wireless LAN (non-hamradio)
483# 571#
484# CONFIG_NET_RADIO is not set 572# CONFIG_NET_RADIO is not set
573# CONFIG_IPW_DEBUG is not set
574CONFIG_IPW2200=m
485 575
486# 576#
487# Wan interfaces 577# Wan interfaces
@@ -493,6 +583,8 @@ CONFIG_NET_ETHERNET=y
493# CONFIG_SLIP is not set 583# CONFIG_SLIP is not set
494# CONFIG_SHAPER is not set 584# CONFIG_SHAPER is not set
495# CONFIG_NETCONSOLE is not set 585# CONFIG_NETCONSOLE is not set
586# CONFIG_NETPOLL is not set
587# CONFIG_NET_POLL_CONTROLLER is not set
496 588
497# 589#
498# ISDN subsystem 590# ISDN subsystem
@@ -522,19 +614,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
522# CONFIG_INPUT_EVBUG is not set 614# CONFIG_INPUT_EVBUG is not set
523 615
524# 616#
525# Input I/O drivers
526#
527# CONFIG_GAMEPORT is not set
528CONFIG_SOUND_GAMEPORT=y
529CONFIG_SERIO=y
530CONFIG_SERIO_I8042=y
531CONFIG_SERIO_SERPORT=y
532# CONFIG_SERIO_CT82C710 is not set
533# CONFIG_SERIO_PCIPS2 is not set
534# CONFIG_SERIO_LIBPS2 is not set
535CONFIG_SERIO_RAW=m
536
537#
538# Input Device Drivers 617# Input Device Drivers
539# 618#
540# CONFIG_INPUT_KEYBOARD is not set 619# CONFIG_INPUT_KEYBOARD is not set
@@ -544,6 +623,17 @@ CONFIG_SERIO_RAW=m
544# CONFIG_INPUT_MISC is not set 623# CONFIG_INPUT_MISC is not set
545 624
546# 625#
626# Hardware I/O ports
627#
628CONFIG_SERIO=y
629CONFIG_SERIO_I8042=y
630CONFIG_SERIO_SERPORT=y
631# CONFIG_SERIO_PCIPS2 is not set
632# CONFIG_SERIO_LIBPS2 is not set
633CONFIG_SERIO_RAW=m
634# CONFIG_GAMEPORT is not set
635
636#
547# Character devices 637# Character devices
548# 638#
549CONFIG_VT=y 639CONFIG_VT=y
@@ -564,6 +654,7 @@ CONFIG_SERIAL_8250_NR_UARTS=4
564# 654#
565CONFIG_SERIAL_CORE=y 655CONFIG_SERIAL_CORE=y
566CONFIG_SERIAL_CORE_CONSOLE=y 656CONFIG_SERIAL_CORE_CONSOLE=y
657# CONFIG_SERIAL_JSM is not set
567CONFIG_UNIX98_PTYS=y 658CONFIG_UNIX98_PTYS=y
568CONFIG_LEGACY_PTYS=y 659CONFIG_LEGACY_PTYS=y
569CONFIG_LEGACY_PTY_COUNT=256 660CONFIG_LEGACY_PTY_COUNT=256
@@ -590,6 +681,11 @@ CONFIG_LEGACY_PTY_COUNT=256
590# CONFIG_RAW_DRIVER is not set 681# CONFIG_RAW_DRIVER is not set
591 682
592# 683#
684# TPM devices
685#
686# CONFIG_TCG_TPM is not set
687
688#
593# I2C support 689# I2C support
594# 690#
595# CONFIG_I2C is not set 691# CONFIG_I2C is not set
@@ -600,10 +696,20 @@ CONFIG_LEGACY_PTY_COUNT=256
600# CONFIG_W1 is not set 696# CONFIG_W1 is not set
601 697
602# 698#
699# Hardware Monitoring support
700#
701# CONFIG_HWMON is not set
702# CONFIG_HWMON_VID is not set
703
704#
603# Misc devices 705# Misc devices
604# 706#
605 707
606# 708#
709# Multimedia Capabilities Port drivers
710#
711
712#
607# Multimedia devices 713# Multimedia devices
608# 714#
609# CONFIG_VIDEO_DEV is not set 715# CONFIG_VIDEO_DEV is not set
@@ -623,7 +729,6 @@ CONFIG_LEGACY_PTY_COUNT=256
623# 729#
624# CONFIG_VGA_CONSOLE is not set 730# CONFIG_VGA_CONSOLE is not set
625CONFIG_DUMMY_CONSOLE=y 731CONFIG_DUMMY_CONSOLE=y
626# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
627 732
628# 733#
629# Sound 734# Sound
@@ -633,13 +738,9 @@ CONFIG_DUMMY_CONSOLE=y
633# 738#
634# USB support 739# USB support
635# 740#
636# CONFIG_USB is not set
637CONFIG_USB_ARCH_HAS_HCD=y 741CONFIG_USB_ARCH_HAS_HCD=y
638CONFIG_USB_ARCH_HAS_OHCI=y 742CONFIG_USB_ARCH_HAS_OHCI=y
639 743# CONFIG_USB is not set
640#
641# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
642#
643 744
644# 745#
645# USB Gadget Support 746# USB Gadget Support
@@ -657,10 +758,15 @@ CONFIG_USB_ARCH_HAS_OHCI=y
657# CONFIG_INFINIBAND is not set 758# CONFIG_INFINIBAND is not set
658 759
659# 760#
761# SN Devices
762#
763
764#
660# File systems 765# File systems
661# 766#
662CONFIG_EXT2_FS=y 767CONFIG_EXT2_FS=y
663# CONFIG_EXT2_FS_XATTR is not set 768# CONFIG_EXT2_FS_XATTR is not set
769# CONFIG_EXT2_FS_XIP is not set
664CONFIG_EXT3_FS=y 770CONFIG_EXT3_FS=y
665CONFIG_EXT3_FS_XATTR=y 771CONFIG_EXT3_FS_XATTR=y
666# CONFIG_EXT3_FS_POSIX_ACL is not set 772# CONFIG_EXT3_FS_POSIX_ACL is not set
@@ -670,13 +776,16 @@ CONFIG_JBD=y
670CONFIG_FS_MBCACHE=y 776CONFIG_FS_MBCACHE=y
671# CONFIG_REISERFS_FS is not set 777# CONFIG_REISERFS_FS is not set
672# CONFIG_JFS_FS is not set 778# CONFIG_JFS_FS is not set
779# CONFIG_FS_POSIX_ACL is not set
673# CONFIG_XFS_FS is not set 780# CONFIG_XFS_FS is not set
674# CONFIG_MINIX_FS is not set 781# CONFIG_MINIX_FS is not set
675# CONFIG_ROMFS_FS is not set 782# CONFIG_ROMFS_FS is not set
783CONFIG_INOTIFY=y
676# CONFIG_QUOTA is not set 784# CONFIG_QUOTA is not set
677CONFIG_DNOTIFY=y 785CONFIG_DNOTIFY=y
678# CONFIG_AUTOFS_FS is not set 786# CONFIG_AUTOFS_FS is not set
679# CONFIG_AUTOFS4_FS is not set 787# CONFIG_AUTOFS4_FS is not set
788CONFIG_FUSE_FS=m
680 789
681# 790#
682# CD-ROM/DVD Filesystems 791# CD-ROM/DVD Filesystems
@@ -697,12 +806,10 @@ CONFIG_DNOTIFY=y
697CONFIG_PROC_FS=y 806CONFIG_PROC_FS=y
698CONFIG_PROC_KCORE=y 807CONFIG_PROC_KCORE=y
699CONFIG_SYSFS=y 808CONFIG_SYSFS=y
700# CONFIG_DEVFS_FS is not set
701CONFIG_DEVPTS_FS_XATTR=y
702CONFIG_DEVPTS_FS_SECURITY=y
703# CONFIG_TMPFS is not set 809# CONFIG_TMPFS is not set
704# CONFIG_HUGETLB_PAGE is not set 810# CONFIG_HUGETLB_PAGE is not set
705CONFIG_RAMFS=y 811CONFIG_RAMFS=y
812CONFIG_RELAYFS_FS=m
706 813
707# 814#
708# Miscellaneous filesystems 815# Miscellaneous filesystems
@@ -728,12 +835,13 @@ CONFIG_RAMFS=y
728# 835#
729CONFIG_NFS_FS=y 836CONFIG_NFS_FS=y
730CONFIG_NFS_V3=y 837CONFIG_NFS_V3=y
838# CONFIG_NFS_V3_ACL is not set
731# CONFIG_NFS_V4 is not set 839# CONFIG_NFS_V4 is not set
732# CONFIG_NFS_DIRECTIO is not set 840# CONFIG_NFS_DIRECTIO is not set
733# CONFIG_NFSD is not set 841# CONFIG_NFSD is not set
734CONFIG_LOCKD=y 842CONFIG_LOCKD=y
735CONFIG_LOCKD_V4=y 843CONFIG_LOCKD_V4=y
736# CONFIG_EXPORTFS is not set 844CONFIG_NFS_COMMON=y
737CONFIG_SUNRPC=y 845CONFIG_SUNRPC=y
738# CONFIG_RPCSEC_GSS_KRB5 is not set 846# CONFIG_RPCSEC_GSS_KRB5 is not set
739# CONFIG_RPCSEC_GSS_SPKM3 is not set 847# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -742,6 +850,7 @@ CONFIG_SUNRPC=y
742# CONFIG_NCP_FS is not set 850# CONFIG_NCP_FS is not set
743# CONFIG_CODA_FS is not set 851# CONFIG_CODA_FS is not set
744# CONFIG_AFS_FS is not set 852# CONFIG_AFS_FS is not set
853# CONFIG_9P_FS is not set
745 854
746# 855#
747# Partition Types 856# Partition Types
@@ -762,7 +871,9 @@ CONFIG_MSDOS_PARTITION=y
762# 871#
763# Kernel hacking 872# Kernel hacking
764# 873#
874# CONFIG_PRINTK_TIME is not set
765# CONFIG_DEBUG_KERNEL is not set 875# CONFIG_DEBUG_KERNEL is not set
876CONFIG_LOG_BUF_SHIFT=14
766CONFIG_CROSSCOMPILE=y 877CONFIG_CROSSCOMPILE=y
767CONFIG_CMDLINE="" 878CONFIG_CMDLINE=""
768 879
@@ -776,7 +887,31 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
776# 887#
777# Cryptographic options 888# Cryptographic options
778# 889#
779# CONFIG_CRYPTO is not set 890CONFIG_CRYPTO=y
891CONFIG_CRYPTO_HMAC=y
892CONFIG_CRYPTO_NULL=m
893CONFIG_CRYPTO_MD4=m
894CONFIG_CRYPTO_MD5=m
895CONFIG_CRYPTO_SHA1=m
896CONFIG_CRYPTO_SHA256=m
897CONFIG_CRYPTO_SHA512=m
898CONFIG_CRYPTO_WP512=m
899CONFIG_CRYPTO_TGR192=m
900CONFIG_CRYPTO_DES=m
901CONFIG_CRYPTO_BLOWFISH=m
902CONFIG_CRYPTO_TWOFISH=m
903CONFIG_CRYPTO_SERPENT=m
904CONFIG_CRYPTO_AES=m
905CONFIG_CRYPTO_CAST5=m
906CONFIG_CRYPTO_CAST6=m
907CONFIG_CRYPTO_TEA=m
908CONFIG_CRYPTO_ARC4=m
909CONFIG_CRYPTO_KHAZAD=m
910CONFIG_CRYPTO_ANUBIS=m
911CONFIG_CRYPTO_DEFLATE=m
912CONFIG_CRYPTO_MICHAEL_MIC=m
913CONFIG_CRYPTO_CRC32C=m
914# CONFIG_CRYPTO_TEST is not set
780 915
781# 916#
782# Hardware crypto devices 917# Hardware crypto devices
@@ -786,7 +921,8 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
786# Library routines 921# Library routines
787# 922#
788# CONFIG_CRC_CCITT is not set 923# CONFIG_CRC_CCITT is not set
924CONFIG_CRC16=m
789CONFIG_CRC32=y 925CONFIG_CRC32=y
790CONFIG_LIBCRC32C=m 926CONFIG_LIBCRC32C=m
791CONFIG_GENERIC_HARDIRQS=y 927CONFIG_ZLIB_INFLATE=m
792CONFIG_GENERIC_IRQ_PROBE=y 928CONFIG_ZLIB_DEFLATE=m
diff --git a/arch/mips/configs/malta_defconfig b/arch/mips/configs/malta_defconfig
index 79519ac5af4a..2acdec959dd0 100644
--- a/arch/mips/configs/malta_defconfig
+++ b/arch/mips/configs/malta_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:53:14 2005 4# Thu Oct 20 22:26:22 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,24 +11,29 @@ CONFIG_32BIT=y
14CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
25# CONFIG_BSD_PROCESS_ACCT is not set 24# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y 25CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set 26# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14
29CONFIG_HOTPLUG=y 27CONFIG_HOTPLUG=y
30CONFIG_KOBJECT_UEVENT=y 28CONFIG_KOBJECT_UEVENT=y
31# CONFIG_IKCONFIG is not set 29# CONFIG_IKCONFIG is not set
30CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y 31CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y 32CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_EXTRA_PASS is not set 33# CONFIG_KALLSYMS_EXTRA_PASS is not set
34CONFIG_PRINTK=y
35CONFIG_BUG=y
36CONFIG_BASE_FULL=y
35CONFIG_FUTEX=y 37CONFIG_FUTEX=y
36CONFIG_EPOLL=y 38CONFIG_EPOLL=y
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -41,6 +43,7 @@ CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0 43CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0 44CONFIG_CC_ALIGN_JUMPS=0
43# CONFIG_TINY_SHMEM is not set 45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
44 47
45# 48#
46# Loadable module support 49# Loadable module support
@@ -56,44 +59,75 @@ CONFIG_KMOD=y
56# 59#
57# Machine selection 60# Machine selection
58# 61#
59# CONFIG_MACH_JAZZ is not set 62# CONFIG_MIPS_MTX1 is not set
60# CONFIG_MACH_VR41XX is not set 63# CONFIG_MIPS_BOSPORUS is not set
61# CONFIG_TOSHIBA_JMR3927 is not set 64# CONFIG_MIPS_PB1000 is not set
65# CONFIG_MIPS_PB1100 is not set
66# CONFIG_MIPS_PB1500 is not set
67# CONFIG_MIPS_PB1550 is not set
68# CONFIG_MIPS_PB1200 is not set
69# CONFIG_MIPS_DB1000 is not set
70# CONFIG_MIPS_DB1100 is not set
71# CONFIG_MIPS_DB1500 is not set
72# CONFIG_MIPS_DB1550 is not set
73# CONFIG_MIPS_DB1200 is not set
74# CONFIG_MIPS_MIRAGE is not set
62# CONFIG_MIPS_COBALT is not set 75# CONFIG_MIPS_COBALT is not set
63# CONFIG_MACH_DECSTATION is not set 76# CONFIG_MACH_DECSTATION is not set
64# CONFIG_MIPS_EV64120 is not set 77# CONFIG_MIPS_EV64120 is not set
65# CONFIG_MIPS_EV96100 is not set 78# CONFIG_MIPS_EV96100 is not set
66# CONFIG_MIPS_IVR is not set 79# CONFIG_MIPS_IVR is not set
67# CONFIG_LASAT is not set
68# CONFIG_MIPS_ITE8172 is not set 80# CONFIG_MIPS_ITE8172 is not set
81# CONFIG_MACH_JAZZ is not set
82# CONFIG_LASAT is not set
69# CONFIG_MIPS_ATLAS is not set 83# CONFIG_MIPS_ATLAS is not set
70CONFIG_MIPS_MALTA=y 84CONFIG_MIPS_MALTA=y
71# CONFIG_MIPS_SEAD is not set 85# CONFIG_MIPS_SEAD is not set
86# CONFIG_MIPS_SIM is not set
87# CONFIG_MOMENCO_JAGUAR_ATX is not set
72# CONFIG_MOMENCO_OCELOT is not set 88# CONFIG_MOMENCO_OCELOT is not set
73# CONFIG_MOMENCO_OCELOT_G is not set
74# CONFIG_MOMENCO_OCELOT_C is not set
75# CONFIG_MOMENCO_OCELOT_3 is not set 89# CONFIG_MOMENCO_OCELOT_3 is not set
76# CONFIG_MOMENCO_JAGUAR_ATX is not set 90# CONFIG_MOMENCO_OCELOT_C is not set
77# CONFIG_PMC_YOSEMITE is not set 91# CONFIG_MOMENCO_OCELOT_G is not set
92# CONFIG_MIPS_XXS1500 is not set
93# CONFIG_PNX8550_V2PCI is not set
94# CONFIG_PNX8550_JBS is not set
78# CONFIG_DDB5074 is not set 95# CONFIG_DDB5074 is not set
79# CONFIG_DDB5476 is not set 96# CONFIG_DDB5476 is not set
80# CONFIG_DDB5477 is not set 97# CONFIG_DDB5477 is not set
81# CONFIG_NEC_OSPREY is not set 98# CONFIG_MACH_VR41XX is not set
99# CONFIG_PMC_YOSEMITE is not set
100# CONFIG_QEMU is not set
82# CONFIG_SGI_IP22 is not set 101# CONFIG_SGI_IP22 is not set
83# CONFIG_SOC_AU1X00 is not set 102# CONFIG_SGI_IP27 is not set
84# CONFIG_SIBYTE_SB1xxx_SOC is not set 103# CONFIG_SGI_IP32 is not set
104# CONFIG_SIBYTE_BIGSUR is not set
105# CONFIG_SIBYTE_SWARM is not set
106# CONFIG_SIBYTE_SENTOSA is not set
107# CONFIG_SIBYTE_RHONE is not set
108# CONFIG_SIBYTE_CARMEL is not set
109# CONFIG_SIBYTE_PTSWARM is not set
110# CONFIG_SIBYTE_LITTLESUR is not set
111# CONFIG_SIBYTE_CRHINE is not set
112# CONFIG_SIBYTE_CRHONE is not set
85# CONFIG_SNI_RM200_PCI is not set 113# CONFIG_SNI_RM200_PCI is not set
114# CONFIG_TOSHIBA_JMR3927 is not set
86# CONFIG_TOSHIBA_RBTX4927 is not set 115# CONFIG_TOSHIBA_RBTX4927 is not set
116# CONFIG_TOSHIBA_RBTX4938 is not set
87CONFIG_RWSEM_GENERIC_SPINLOCK=y 117CONFIG_RWSEM_GENERIC_SPINLOCK=y
88CONFIG_GENERIC_CALIBRATE_DELAY=y 118CONFIG_GENERIC_CALIBRATE_DELAY=y
89CONFIG_HAVE_DEC_LOCK=y 119CONFIG_ARCH_MAY_HAVE_PC_FDC=y
90CONFIG_DMA_NONCOHERENT=y 120CONFIG_DMA_NONCOHERENT=y
91CONFIG_DMA_NEED_PCI_MAP_STATE=y 121CONFIG_DMA_NEED_PCI_MAP_STATE=y
92CONFIG_GENERIC_ISA_DMA=y 122CONFIG_GENERIC_ISA_DMA=y
93CONFIG_I8259=y 123CONFIG_I8259=y
94CONFIG_MIPS_BONITO64=y 124CONFIG_MIPS_BONITO64=y
95CONFIG_MIPS_MSC=y 125CONFIG_MIPS_MSC=y
126# CONFIG_CPU_BIG_ENDIAN is not set
96CONFIG_CPU_LITTLE_ENDIAN=y 127CONFIG_CPU_LITTLE_ENDIAN=y
128CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
129CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
130CONFIG_IRQ_CPU=y
97CONFIG_MIPS_BOARDS_GEN=y 131CONFIG_MIPS_BOARDS_GEN=y
98CONFIG_MIPS_GT64120=y 132CONFIG_MIPS_GT64120=y
99CONFIG_SWAP_IO_SPACE=y 133CONFIG_SWAP_IO_SPACE=y
@@ -104,8 +138,10 @@ CONFIG_HAVE_STD_PC_SERIAL_PORT=y
104# 138#
105# CPU selection 139# CPU selection
106# 140#
107CONFIG_CPU_MIPS32=y 141CONFIG_CPU_MIPS32_R1=y
108# CONFIG_CPU_MIPS64 is not set 142# CONFIG_CPU_MIPS32_R2 is not set
143# CONFIG_CPU_MIPS64_R1 is not set
144# CONFIG_CPU_MIPS64_R2 is not set
109# CONFIG_CPU_R3000 is not set 145# CONFIG_CPU_R3000 is not set
110# CONFIG_CPU_TX39XX is not set 146# CONFIG_CPU_TX39XX is not set
111# CONFIG_CPU_VR41XX is not set 147# CONFIG_CPU_VR41XX is not set
@@ -121,14 +157,48 @@ CONFIG_CPU_MIPS32=y
121# CONFIG_CPU_RM7000 is not set 157# CONFIG_CPU_RM7000 is not set
122# CONFIG_CPU_RM9000 is not set 158# CONFIG_CPU_RM9000 is not set
123# CONFIG_CPU_SB1 is not set 159# CONFIG_CPU_SB1 is not set
160CONFIG_SYS_HAS_CPU_MIPS32_R1=y
161CONFIG_SYS_HAS_CPU_MIPS32_R2=y
162CONFIG_SYS_HAS_CPU_MIPS64_R1=y
163CONFIG_SYS_HAS_CPU_NEVADA=y
164CONFIG_SYS_HAS_CPU_RM7000=y
165CONFIG_CPU_MIPS32=y
166CONFIG_CPU_MIPSR1=y
167CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
168CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
169CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
170
171#
172# Kernel type
173#
174CONFIG_32BIT=y
175# CONFIG_64BIT is not set
124CONFIG_PAGE_SIZE_4KB=y 176CONFIG_PAGE_SIZE_4KB=y
125# CONFIG_PAGE_SIZE_8KB is not set 177# CONFIG_PAGE_SIZE_8KB is not set
126# CONFIG_PAGE_SIZE_16KB is not set 178# CONFIG_PAGE_SIZE_16KB is not set
127# CONFIG_PAGE_SIZE_64KB is not set 179# CONFIG_PAGE_SIZE_64KB is not set
180CONFIG_CPU_HAS_PREFETCH=y
181CONFIG_MIPS_MT=y
182# CONFIG_MIPS_MT_SMP is not set
183CONFIG_MIPS_VPE_LOADER=y
184CONFIG_MIPS_VPE_LOADER_TOM=y
185CONFIG_MIPS_VPE_APSP_API=y
128# CONFIG_64BIT_PHYS_ADDR is not set 186# CONFIG_64BIT_PHYS_ADDR is not set
129# CONFIG_CPU_ADVANCED is not set 187# CONFIG_CPU_ADVANCED is not set
130CONFIG_CPU_HAS_LLSC=y 188CONFIG_CPU_HAS_LLSC=y
131CONFIG_CPU_HAS_SYNC=y 189CONFIG_CPU_HAS_SYNC=y
190CONFIG_GENERIC_HARDIRQS=y
191CONFIG_GENERIC_IRQ_PROBE=y
192CONFIG_ARCH_FLATMEM_ENABLE=y
193CONFIG_SELECT_MEMORY_MODEL=y
194CONFIG_FLATMEM_MANUAL=y
195# CONFIG_DISCONTIGMEM_MANUAL is not set
196# CONFIG_SPARSEMEM_MANUAL is not set
197CONFIG_FLATMEM=y
198CONFIG_FLAT_NODE_MEM_MAP=y
199# CONFIG_SPARSEMEM_STATIC is not set
200CONFIG_PREEMPT_NONE=y
201# CONFIG_PREEMPT_VOLUNTARY is not set
132# CONFIG_PREEMPT is not set 202# CONFIG_PREEMPT is not set
133 203
134# 204#
@@ -137,7 +207,6 @@ CONFIG_CPU_HAS_SYNC=y
137CONFIG_HW_HAS_PCI=y 207CONFIG_HW_HAS_PCI=y
138CONFIG_PCI=y 208CONFIG_PCI=y
139CONFIG_PCI_LEGACY_PROC=y 209CONFIG_PCI_LEGACY_PROC=y
140CONFIG_PCI_NAMES=y
141CONFIG_MMU=y 210CONFIG_MMU=y
142 211
143# 212#
@@ -146,10 +215,6 @@ CONFIG_MMU=y
146# CONFIG_PCCARD is not set 215# CONFIG_PCCARD is not set
147 216
148# 217#
149# PC-card bridges
150#
151
152#
153# PCI Hotplug Support 218# PCI Hotplug Support
154# 219#
155# CONFIG_HOTPLUG_PCI is not set 220# CONFIG_HOTPLUG_PCI is not set
@@ -162,229 +227,7 @@ CONFIG_BINFMT_ELF=y
162CONFIG_TRAD_SIGNALS=y 227CONFIG_TRAD_SIGNALS=y
163 228
164# 229#
165# Device Drivers 230# Networking
166#
167
168#
169# Generic Driver Options
170#
171CONFIG_STANDALONE=y
172CONFIG_PREVENT_FIRMWARE_BUILD=y
173CONFIG_FW_LOADER=y
174
175#
176# Memory Technology Devices (MTD)
177#
178# CONFIG_MTD is not set
179
180#
181# Parallel port support
182#
183# CONFIG_PARPORT is not set
184
185#
186# Plug and Play support
187#
188
189#
190# Block devices
191#
192CONFIG_BLK_DEV_FD=m
193# CONFIG_BLK_CPQ_DA is not set
194# CONFIG_BLK_CPQ_CISS_DA is not set
195# CONFIG_BLK_DEV_DAC960 is not set
196CONFIG_BLK_DEV_UMEM=m
197# CONFIG_BLK_DEV_COW_COMMON is not set
198CONFIG_BLK_DEV_LOOP=m
199CONFIG_BLK_DEV_CRYPTOLOOP=m
200CONFIG_BLK_DEV_NBD=m
201# CONFIG_BLK_DEV_SX8 is not set
202CONFIG_BLK_DEV_RAM=y
203CONFIG_BLK_DEV_RAM_COUNT=16
204CONFIG_BLK_DEV_RAM_SIZE=4096
205# CONFIG_BLK_DEV_INITRD is not set
206CONFIG_INITRAMFS_SOURCE=""
207# CONFIG_LBD is not set
208CONFIG_CDROM_PKTCDVD=m
209CONFIG_CDROM_PKTCDVD_BUFFERS=8
210# CONFIG_CDROM_PKTCDVD_WCACHE is not set
211
212#
213# IO Schedulers
214#
215CONFIG_IOSCHED_NOOP=y
216CONFIG_IOSCHED_AS=y
217CONFIG_IOSCHED_DEADLINE=y
218CONFIG_IOSCHED_CFQ=y
219CONFIG_ATA_OVER_ETH=m
220
221#
222# ATA/ATAPI/MFM/RLL support
223#
224CONFIG_IDE=y
225CONFIG_BLK_DEV_IDE=y
226
227#
228# Please see Documentation/ide.txt for help/info on IDE drives
229#
230# CONFIG_BLK_DEV_IDE_SATA is not set
231CONFIG_BLK_DEV_IDEDISK=y
232# CONFIG_IDEDISK_MULTI_MODE is not set
233CONFIG_BLK_DEV_IDECD=y
234# CONFIG_BLK_DEV_IDETAPE is not set
235# CONFIG_BLK_DEV_IDEFLOPPY is not set
236# CONFIG_BLK_DEV_IDESCSI is not set
237# CONFIG_IDE_TASK_IOCTL is not set
238
239#
240# IDE chipset support/bugfixes
241#
242CONFIG_IDE_GENERIC=y
243CONFIG_BLK_DEV_IDEPCI=y
244# CONFIG_IDEPCI_SHARE_IRQ is not set
245# CONFIG_BLK_DEV_OFFBOARD is not set
246CONFIG_BLK_DEV_GENERIC=y
247# CONFIG_BLK_DEV_OPTI621 is not set
248CONFIG_BLK_DEV_IDEDMA_PCI=y
249# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
250CONFIG_IDEDMA_PCI_AUTO=y
251# CONFIG_IDEDMA_ONLYDISK is not set
252# CONFIG_BLK_DEV_AEC62XX is not set
253# CONFIG_BLK_DEV_ALI15X3 is not set
254# CONFIG_BLK_DEV_AMD74XX is not set
255# CONFIG_BLK_DEV_CMD64X is not set
256# CONFIG_BLK_DEV_TRIFLEX is not set
257# CONFIG_BLK_DEV_CY82C693 is not set
258# CONFIG_BLK_DEV_CS5520 is not set
259# CONFIG_BLK_DEV_CS5530 is not set
260# CONFIG_BLK_DEV_HPT34X is not set
261# CONFIG_BLK_DEV_HPT366 is not set
262# CONFIG_BLK_DEV_SC1200 is not set
263CONFIG_BLK_DEV_PIIX=y
264# CONFIG_BLK_DEV_NS87415 is not set
265# CONFIG_BLK_DEV_PDC202XX_OLD is not set
266# CONFIG_BLK_DEV_PDC202XX_NEW is not set
267# CONFIG_BLK_DEV_SVWKS is not set
268# CONFIG_BLK_DEV_SIIMAGE is not set
269# CONFIG_BLK_DEV_SLC90E66 is not set
270# CONFIG_BLK_DEV_TRM290 is not set
271# CONFIG_BLK_DEV_VIA82CXXX is not set
272# CONFIG_IDE_ARM is not set
273CONFIG_BLK_DEV_IDEDMA=y
274# CONFIG_IDEDMA_IVB is not set
275CONFIG_IDEDMA_AUTO=y
276# CONFIG_BLK_DEV_HD is not set
277
278#
279# SCSI device support
280#
281CONFIG_SCSI=m
282CONFIG_SCSI_PROC_FS=y
283
284#
285# SCSI support type (disk, tape, CD-ROM)
286#
287CONFIG_BLK_DEV_SD=m
288CONFIG_CHR_DEV_ST=m
289CONFIG_CHR_DEV_OSST=m
290CONFIG_BLK_DEV_SR=m
291CONFIG_BLK_DEV_SR_VENDOR=y
292CONFIG_CHR_DEV_SG=m
293
294#
295# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
296#
297CONFIG_SCSI_MULTI_LUN=y
298CONFIG_SCSI_CONSTANTS=y
299CONFIG_SCSI_LOGGING=y
300
301#
302# SCSI Transport Attributes
303#
304CONFIG_SCSI_SPI_ATTRS=m
305CONFIG_SCSI_FC_ATTRS=m
306CONFIG_SCSI_ISCSI_ATTRS=m
307
308#
309# SCSI low-level drivers
310#
311CONFIG_BLK_DEV_3W_XXXX_RAID=m
312CONFIG_SCSI_3W_9XXX=m
313CONFIG_SCSI_ACARD=m
314CONFIG_SCSI_AACRAID=m
315CONFIG_SCSI_AIC7XXX=m
316CONFIG_AIC7XXX_CMDS_PER_DEVICE=32
317CONFIG_AIC7XXX_RESET_DELAY_MS=15000
318# CONFIG_AIC7XXX_DEBUG_ENABLE is not set
319CONFIG_AIC7XXX_DEBUG_MASK=0
320CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
321# CONFIG_SCSI_AIC7XXX_OLD is not set
322# CONFIG_SCSI_AIC79XX is not set
323# CONFIG_SCSI_DPT_I2O is not set
324# CONFIG_MEGARAID_NEWGEN is not set
325# CONFIG_MEGARAID_LEGACY is not set
326# CONFIG_SCSI_SATA is not set
327# CONFIG_SCSI_BUSLOGIC is not set
328# CONFIG_SCSI_DMX3191D is not set
329# CONFIG_SCSI_EATA is not set
330# CONFIG_SCSI_EATA_PIO is not set
331# CONFIG_SCSI_FUTURE_DOMAIN is not set
332# CONFIG_SCSI_GDTH is not set
333# CONFIG_SCSI_IPS is not set
334# CONFIG_SCSI_INITIO is not set
335# CONFIG_SCSI_INIA100 is not set
336# CONFIG_SCSI_SYM53C8XX_2 is not set
337# CONFIG_SCSI_IPR is not set
338# CONFIG_SCSI_QLOGIC_ISP is not set
339# CONFIG_SCSI_QLOGIC_FC is not set
340# CONFIG_SCSI_QLOGIC_1280 is not set
341CONFIG_SCSI_QLA2XXX=m
342# CONFIG_SCSI_QLA21XX is not set
343# CONFIG_SCSI_QLA22XX is not set
344# CONFIG_SCSI_QLA2300 is not set
345# CONFIG_SCSI_QLA2322 is not set
346# CONFIG_SCSI_QLA6312 is not set
347# CONFIG_SCSI_DC395x is not set
348# CONFIG_SCSI_DC390T is not set
349# CONFIG_SCSI_NSP32 is not set
350# CONFIG_SCSI_DEBUG is not set
351
352#
353# Multi-device support (RAID and LVM)
354#
355CONFIG_MD=y
356CONFIG_BLK_DEV_MD=m
357CONFIG_MD_LINEAR=m
358CONFIG_MD_RAID0=m
359CONFIG_MD_RAID1=m
360CONFIG_MD_RAID10=m
361CONFIG_MD_RAID5=m
362CONFIG_MD_RAID6=m
363CONFIG_MD_MULTIPATH=m
364CONFIG_MD_FAULTY=m
365CONFIG_BLK_DEV_DM=m
366CONFIG_DM_CRYPT=m
367CONFIG_DM_SNAPSHOT=m
368CONFIG_DM_MIRROR=m
369CONFIG_DM_ZERO=m
370
371#
372# Fusion MPT device support
373#
374# CONFIG_FUSION is not set
375
376#
377# IEEE 1394 (FireWire) support
378#
379# CONFIG_IEEE1394 is not set
380
381#
382# I2O device support
383#
384# CONFIG_I2O is not set
385
386#
387# Networking support
388# 231#
389CONFIG_NET=y 232CONFIG_NET=y
390 233
@@ -393,15 +236,20 @@ CONFIG_NET=y
393# 236#
394CONFIG_PACKET=y 237CONFIG_PACKET=y
395CONFIG_PACKET_MMAP=y 238CONFIG_PACKET_MMAP=y
396CONFIG_NETLINK_DEV=y
397CONFIG_UNIX=y 239CONFIG_UNIX=y
240CONFIG_XFRM=y
241CONFIG_XFRM_USER=m
398CONFIG_NET_KEY=y 242CONFIG_NET_KEY=y
399CONFIG_INET=y 243CONFIG_INET=y
400CONFIG_IP_MULTICAST=y 244CONFIG_IP_MULTICAST=y
401CONFIG_IP_ADVANCED_ROUTER=y 245CONFIG_IP_ADVANCED_ROUTER=y
246CONFIG_ASK_IP_FIB_HASH=y
247# CONFIG_IP_FIB_TRIE is not set
248CONFIG_IP_FIB_HASH=y
402CONFIG_IP_MULTIPLE_TABLES=y 249CONFIG_IP_MULTIPLE_TABLES=y
403CONFIG_IP_ROUTE_FWMARK=y 250CONFIG_IP_ROUTE_FWMARK=y
404CONFIG_IP_ROUTE_MULTIPATH=y 251CONFIG_IP_ROUTE_MULTIPATH=y
252# CONFIG_IP_ROUTE_MULTIPATH_CACHED is not set
405CONFIG_IP_ROUTE_VERBOSE=y 253CONFIG_IP_ROUTE_VERBOSE=y
406CONFIG_IP_PNP=y 254CONFIG_IP_PNP=y
407CONFIG_IP_PNP_DHCP=y 255CONFIG_IP_PNP_DHCP=y
@@ -419,8 +267,10 @@ CONFIG_INET_AH=m
419CONFIG_INET_ESP=m 267CONFIG_INET_ESP=m
420CONFIG_INET_IPCOMP=m 268CONFIG_INET_IPCOMP=m
421CONFIG_INET_TUNNEL=m 269CONFIG_INET_TUNNEL=m
422CONFIG_IP_TCPDIAG=m 270CONFIG_INET_DIAG=y
423CONFIG_IP_TCPDIAG_IPV6=y 271CONFIG_INET_TCP_DIAG=y
272# CONFIG_TCP_CONG_ADVANCED is not set
273CONFIG_TCP_CONG_BIC=y
424 274
425# 275#
426# IP: Virtual Server Configuration 276# IP: Virtual Server Configuration
@@ -465,6 +315,9 @@ CONFIG_IPV6_TUNNEL=m
465CONFIG_NETFILTER=y 315CONFIG_NETFILTER=y
466# CONFIG_NETFILTER_DEBUG is not set 316# CONFIG_NETFILTER_DEBUG is not set
467CONFIG_BRIDGE_NETFILTER=y 317CONFIG_BRIDGE_NETFILTER=y
318CONFIG_NETFILTER_NETLINK=m
319CONFIG_NETFILTER_NETLINK_QUEUE=m
320CONFIG_NETFILTER_NETLINK_LOG=m
468 321
469# 322#
470# IP: Netfilter Configuration 323# IP: Netfilter Configuration
@@ -472,11 +325,15 @@ CONFIG_BRIDGE_NETFILTER=y
472CONFIG_IP_NF_CONNTRACK=m 325CONFIG_IP_NF_CONNTRACK=m
473CONFIG_IP_NF_CT_ACCT=y 326CONFIG_IP_NF_CT_ACCT=y
474CONFIG_IP_NF_CONNTRACK_MARK=y 327CONFIG_IP_NF_CONNTRACK_MARK=y
328CONFIG_IP_NF_CONNTRACK_EVENTS=y
329CONFIG_IP_NF_CONNTRACK_NETLINK=m
475CONFIG_IP_NF_CT_PROTO_SCTP=m 330CONFIG_IP_NF_CT_PROTO_SCTP=m
476CONFIG_IP_NF_FTP=m 331CONFIG_IP_NF_FTP=m
477CONFIG_IP_NF_IRC=m 332CONFIG_IP_NF_IRC=m
333# CONFIG_IP_NF_NETBIOS_NS is not set
478CONFIG_IP_NF_TFTP=m 334CONFIG_IP_NF_TFTP=m
479CONFIG_IP_NF_AMANDA=m 335CONFIG_IP_NF_AMANDA=m
336CONFIG_IP_NF_PPTP=m
480CONFIG_IP_NF_QUEUE=m 337CONFIG_IP_NF_QUEUE=m
481CONFIG_IP_NF_IPTABLES=m 338CONFIG_IP_NF_IPTABLES=m
482CONFIG_IP_NF_MATCH_LIMIT=m 339CONFIG_IP_NF_MATCH_LIMIT=m
@@ -501,9 +358,12 @@ CONFIG_IP_NF_MATCH_PHYSDEV=m
501CONFIG_IP_NF_MATCH_ADDRTYPE=m 358CONFIG_IP_NF_MATCH_ADDRTYPE=m
502CONFIG_IP_NF_MATCH_REALM=m 359CONFIG_IP_NF_MATCH_REALM=m
503CONFIG_IP_NF_MATCH_SCTP=m 360CONFIG_IP_NF_MATCH_SCTP=m
361CONFIG_IP_NF_MATCH_DCCP=m
504CONFIG_IP_NF_MATCH_COMMENT=m 362CONFIG_IP_NF_MATCH_COMMENT=m
505CONFIG_IP_NF_MATCH_CONNMARK=m 363CONFIG_IP_NF_MATCH_CONNMARK=m
364CONFIG_IP_NF_MATCH_CONNBYTES=m
506CONFIG_IP_NF_MATCH_HASHLIMIT=m 365CONFIG_IP_NF_MATCH_HASHLIMIT=m
366CONFIG_IP_NF_MATCH_STRING=m
507CONFIG_IP_NF_FILTER=m 367CONFIG_IP_NF_FILTER=m
508CONFIG_IP_NF_TARGET_REJECT=m 368CONFIG_IP_NF_TARGET_REJECT=m
509CONFIG_IP_NF_TARGET_LOG=m 369CONFIG_IP_NF_TARGET_LOG=m
@@ -520,12 +380,14 @@ CONFIG_IP_NF_NAT_IRC=m
520CONFIG_IP_NF_NAT_FTP=m 380CONFIG_IP_NF_NAT_FTP=m
521CONFIG_IP_NF_NAT_TFTP=m 381CONFIG_IP_NF_NAT_TFTP=m
522CONFIG_IP_NF_NAT_AMANDA=m 382CONFIG_IP_NF_NAT_AMANDA=m
383CONFIG_IP_NF_NAT_PPTP=m
523CONFIG_IP_NF_MANGLE=m 384CONFIG_IP_NF_MANGLE=m
524CONFIG_IP_NF_TARGET_TOS=m 385CONFIG_IP_NF_TARGET_TOS=m
525CONFIG_IP_NF_TARGET_ECN=m 386CONFIG_IP_NF_TARGET_ECN=m
526CONFIG_IP_NF_TARGET_DSCP=m 387CONFIG_IP_NF_TARGET_DSCP=m
527CONFIG_IP_NF_TARGET_MARK=m 388CONFIG_IP_NF_TARGET_MARK=m
528CONFIG_IP_NF_TARGET_CLASSIFY=m 389CONFIG_IP_NF_TARGET_CLASSIFY=m
390CONFIG_IP_NF_TARGET_TTL=m
529CONFIG_IP_NF_TARGET_CONNMARK=m 391CONFIG_IP_NF_TARGET_CONNMARK=m
530CONFIG_IP_NF_TARGET_CLUSTERIP=m 392CONFIG_IP_NF_TARGET_CLUSTERIP=m
531CONFIG_IP_NF_RAW=m 393CONFIG_IP_NF_RAW=m
@@ -535,7 +397,7 @@ CONFIG_IP_NF_ARPFILTER=m
535CONFIG_IP_NF_ARP_MANGLE=m 397CONFIG_IP_NF_ARP_MANGLE=m
536 398
537# 399#
538# IPv6: Netfilter Configuration 400# IPv6: Netfilter Configuration (EXPERIMENTAL)
539# 401#
540CONFIG_IP6_NF_QUEUE=m 402CONFIG_IP6_NF_QUEUE=m
541CONFIG_IP6_NF_IPTABLES=m 403CONFIG_IP6_NF_IPTABLES=m
@@ -555,8 +417,10 @@ CONFIG_IP6_NF_MATCH_EUI64=m
555CONFIG_IP6_NF_MATCH_PHYSDEV=m 417CONFIG_IP6_NF_MATCH_PHYSDEV=m
556CONFIG_IP6_NF_FILTER=m 418CONFIG_IP6_NF_FILTER=m
557CONFIG_IP6_NF_TARGET_LOG=m 419CONFIG_IP6_NF_TARGET_LOG=m
420CONFIG_IP6_NF_TARGET_REJECT=m
558CONFIG_IP6_NF_MANGLE=m 421CONFIG_IP6_NF_MANGLE=m
559CONFIG_IP6_NF_TARGET_MARK=m 422CONFIG_IP6_NF_TARGET_MARK=m
423CONFIG_IP6_NF_TARGET_HL=m
560CONFIG_IP6_NF_RAW=m 424CONFIG_IP6_NF_RAW=m
561 425
562# 426#
@@ -582,8 +446,11 @@ CONFIG_BRIDGE_EBT_REDIRECT=m
582CONFIG_BRIDGE_EBT_SNAT=m 446CONFIG_BRIDGE_EBT_SNAT=m
583CONFIG_BRIDGE_EBT_LOG=m 447CONFIG_BRIDGE_EBT_LOG=m
584CONFIG_BRIDGE_EBT_ULOG=m 448CONFIG_BRIDGE_EBT_ULOG=m
585CONFIG_XFRM=y 449
586CONFIG_XFRM_USER=m 450#
451# DCCP Configuration (EXPERIMENTAL)
452#
453# CONFIG_IP_DCCP is not set
587 454
588# 455#
589# SCTP Configuration (EXPERIMENTAL) 456# SCTP Configuration (EXPERIMENTAL)
@@ -611,10 +478,6 @@ CONFIG_IPDDP_DECAP=y
611CONFIG_NET_DIVERT=y 478CONFIG_NET_DIVERT=y
612# CONFIG_ECONET is not set 479# CONFIG_ECONET is not set
613# CONFIG_WAN_ROUTER is not set 480# CONFIG_WAN_ROUTER is not set
614
615#
616# QoS and/or fair queueing
617#
618CONFIG_NET_SCHED=y 481CONFIG_NET_SCHED=y
619CONFIG_NET_SCH_CLK_JIFFIES=y 482CONFIG_NET_SCH_CLK_JIFFIES=y
620# CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set 483# CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set
@@ -634,6 +497,7 @@ CONFIG_NET_SCH_INGRESS=m
634CONFIG_NET_QOS=y 497CONFIG_NET_QOS=y
635CONFIG_NET_ESTIMATOR=y 498CONFIG_NET_ESTIMATOR=y
636CONFIG_NET_CLS=y 499CONFIG_NET_CLS=y
500CONFIG_NET_CLS_BASIC=m
637CONFIG_NET_CLS_TCINDEX=m 501CONFIG_NET_CLS_TCINDEX=m
638CONFIG_NET_CLS_ROUTE4=m 502CONFIG_NET_CLS_ROUTE4=m
639CONFIG_NET_CLS_ROUTE=y 503CONFIG_NET_CLS_ROUTE=y
@@ -644,6 +508,7 @@ CONFIG_NET_CLS_IND=y
644# CONFIG_CLS_U32_MARK is not set 508# CONFIG_CLS_U32_MARK is not set
645CONFIG_NET_CLS_RSVP=m 509CONFIG_NET_CLS_RSVP=m
646CONFIG_NET_CLS_RSVP6=m 510CONFIG_NET_CLS_RSVP6=m
511# CONFIG_NET_EMATCH is not set
647# CONFIG_NET_CLS_ACT is not set 512# CONFIG_NET_CLS_ACT is not set
648CONFIG_NET_CLS_POLICE=y 513CONFIG_NET_CLS_POLICE=y
649 514
@@ -651,17 +516,254 @@ CONFIG_NET_CLS_POLICE=y
651# Network testing 516# Network testing
652# 517#
653# CONFIG_NET_PKTGEN is not set 518# CONFIG_NET_PKTGEN is not set
654# CONFIG_NETPOLL is not set
655# CONFIG_NET_POLL_CONTROLLER is not set
656# CONFIG_HAMRADIO is not set 519# CONFIG_HAMRADIO is not set
657# CONFIG_IRDA is not set 520# CONFIG_IRDA is not set
658# CONFIG_BT is not set 521# CONFIG_BT is not set
522CONFIG_IEEE80211=m
523# CONFIG_IEEE80211_DEBUG is not set
524CONFIG_IEEE80211_CRYPT_WEP=m
525CONFIG_IEEE80211_CRYPT_CCMP=m
526CONFIG_IEEE80211_CRYPT_TKIP=m
527
528#
529# Device Drivers
530#
531
532#
533# Generic Driver Options
534#
535CONFIG_STANDALONE=y
536CONFIG_PREVENT_FIRMWARE_BUILD=y
537CONFIG_FW_LOADER=y
538
539#
540# Connector - unified userspace <-> kernelspace linker
541#
542CONFIG_CONNECTOR=m
543
544#
545# Memory Technology Devices (MTD)
546#
547# CONFIG_MTD is not set
548
549#
550# Parallel port support
551#
552# CONFIG_PARPORT is not set
553
554#
555# Plug and Play support
556#
557
558#
559# Block devices
560#
561CONFIG_BLK_DEV_FD=m
562# CONFIG_BLK_CPQ_DA is not set
563# CONFIG_BLK_CPQ_CISS_DA is not set
564# CONFIG_BLK_DEV_DAC960 is not set
565CONFIG_BLK_DEV_UMEM=m
566# CONFIG_BLK_DEV_COW_COMMON is not set
567CONFIG_BLK_DEV_LOOP=m
568CONFIG_BLK_DEV_CRYPTOLOOP=m
569CONFIG_BLK_DEV_NBD=m
570# CONFIG_BLK_DEV_SX8 is not set
571CONFIG_BLK_DEV_RAM=y
572CONFIG_BLK_DEV_RAM_COUNT=16
573CONFIG_BLK_DEV_RAM_SIZE=4096
574# CONFIG_BLK_DEV_INITRD is not set
575# CONFIG_LBD is not set
576CONFIG_CDROM_PKTCDVD=m
577CONFIG_CDROM_PKTCDVD_BUFFERS=8
578# CONFIG_CDROM_PKTCDVD_WCACHE is not set
579
580#
581# IO Schedulers
582#
583CONFIG_IOSCHED_NOOP=y
584CONFIG_IOSCHED_AS=y
585CONFIG_IOSCHED_DEADLINE=y
586CONFIG_IOSCHED_CFQ=y
587CONFIG_ATA_OVER_ETH=m
588
589#
590# ATA/ATAPI/MFM/RLL support
591#
592CONFIG_IDE=y
593CONFIG_BLK_DEV_IDE=y
594
595#
596# Please see Documentation/ide.txt for help/info on IDE drives
597#
598# CONFIG_BLK_DEV_IDE_SATA is not set
599CONFIG_BLK_DEV_IDEDISK=y
600# CONFIG_IDEDISK_MULTI_MODE is not set
601CONFIG_BLK_DEV_IDECD=y
602# CONFIG_BLK_DEV_IDETAPE is not set
603# CONFIG_BLK_DEV_IDEFLOPPY is not set
604# CONFIG_BLK_DEV_IDESCSI is not set
605# CONFIG_IDE_TASK_IOCTL is not set
606
607#
608# IDE chipset support/bugfixes
609#
610CONFIG_IDE_GENERIC=y
611CONFIG_BLK_DEV_IDEPCI=y
612# CONFIG_IDEPCI_SHARE_IRQ is not set
613# CONFIG_BLK_DEV_OFFBOARD is not set
614CONFIG_BLK_DEV_GENERIC=y
615# CONFIG_BLK_DEV_OPTI621 is not set
616CONFIG_BLK_DEV_IDEDMA_PCI=y
617# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
618CONFIG_IDEDMA_PCI_AUTO=y
619# CONFIG_IDEDMA_ONLYDISK is not set
620# CONFIG_BLK_DEV_AEC62XX is not set
621# CONFIG_BLK_DEV_ALI15X3 is not set
622# CONFIG_BLK_DEV_AMD74XX is not set
623# CONFIG_BLK_DEV_CMD64X is not set
624# CONFIG_BLK_DEV_TRIFLEX is not set
625# CONFIG_BLK_DEV_CY82C693 is not set
626# CONFIG_BLK_DEV_CS5520 is not set
627# CONFIG_BLK_DEV_CS5530 is not set
628# CONFIG_BLK_DEV_HPT34X is not set
629# CONFIG_BLK_DEV_HPT366 is not set
630# CONFIG_BLK_DEV_SC1200 is not set
631CONFIG_BLK_DEV_PIIX=y
632# CONFIG_BLK_DEV_IT821X is not set
633# CONFIG_BLK_DEV_NS87415 is not set
634# CONFIG_BLK_DEV_PDC202XX_OLD is not set
635# CONFIG_BLK_DEV_PDC202XX_NEW is not set
636# CONFIG_BLK_DEV_SVWKS is not set
637# CONFIG_BLK_DEV_SIIMAGE is not set
638# CONFIG_BLK_DEV_SLC90E66 is not set
639# CONFIG_BLK_DEV_TRM290 is not set
640# CONFIG_BLK_DEV_VIA82CXXX is not set
641# CONFIG_IDE_ARM is not set
642CONFIG_BLK_DEV_IDEDMA=y
643# CONFIG_IDEDMA_IVB is not set
644CONFIG_IDEDMA_AUTO=y
645# CONFIG_BLK_DEV_HD is not set
646
647#
648# SCSI device support
649#
650CONFIG_RAID_ATTRS=m
651CONFIG_SCSI=m
652CONFIG_SCSI_PROC_FS=y
653
654#
655# SCSI support type (disk, tape, CD-ROM)
656#
657CONFIG_BLK_DEV_SD=m
658CONFIG_CHR_DEV_ST=m
659CONFIG_CHR_DEV_OSST=m
660CONFIG_BLK_DEV_SR=m
661CONFIG_BLK_DEV_SR_VENDOR=y
662CONFIG_CHR_DEV_SG=m
663# CONFIG_CHR_DEV_SCH is not set
664
665#
666# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
667#
668CONFIG_SCSI_MULTI_LUN=y
669CONFIG_SCSI_CONSTANTS=y
670CONFIG_SCSI_LOGGING=y
671
672#
673# SCSI Transport Attributes
674#
675CONFIG_SCSI_SPI_ATTRS=m
676CONFIG_SCSI_FC_ATTRS=m
677CONFIG_SCSI_ISCSI_ATTRS=m
678CONFIG_SCSI_SAS_ATTRS=m
679
680#
681# SCSI low-level drivers
682#
683CONFIG_BLK_DEV_3W_XXXX_RAID=m
684CONFIG_SCSI_3W_9XXX=m
685CONFIG_SCSI_ACARD=m
686CONFIG_SCSI_AACRAID=m
687CONFIG_SCSI_AIC7XXX=m
688CONFIG_AIC7XXX_CMDS_PER_DEVICE=32
689CONFIG_AIC7XXX_RESET_DELAY_MS=15000
690# CONFIG_AIC7XXX_DEBUG_ENABLE is not set
691CONFIG_AIC7XXX_DEBUG_MASK=0
692CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
693# CONFIG_SCSI_AIC7XXX_OLD is not set
694# CONFIG_SCSI_AIC79XX is not set
695# CONFIG_SCSI_DPT_I2O is not set
696# CONFIG_MEGARAID_NEWGEN is not set
697# CONFIG_MEGARAID_LEGACY is not set
698# CONFIG_SCSI_SATA is not set
699# CONFIG_SCSI_DMX3191D is not set
700# CONFIG_SCSI_FUTURE_DOMAIN is not set
701# CONFIG_SCSI_IPS is not set
702# CONFIG_SCSI_INITIO is not set
703# CONFIG_SCSI_INIA100 is not set
704# CONFIG_SCSI_SYM53C8XX_2 is not set
705# CONFIG_SCSI_IPR is not set
706# CONFIG_SCSI_QLOGIC_FC is not set
707# CONFIG_SCSI_QLOGIC_1280 is not set
708CONFIG_SCSI_QLA2XXX=m
709# CONFIG_SCSI_QLA21XX is not set
710# CONFIG_SCSI_QLA22XX is not set
711# CONFIG_SCSI_QLA2300 is not set
712# CONFIG_SCSI_QLA2322 is not set
713# CONFIG_SCSI_QLA6312 is not set
714# CONFIG_SCSI_QLA24XX is not set
715# CONFIG_SCSI_LPFC is not set
716# CONFIG_SCSI_DC395x is not set
717# CONFIG_SCSI_DC390T is not set
718# CONFIG_SCSI_NSP32 is not set
719# CONFIG_SCSI_DEBUG is not set
720
721#
722# Multi-device support (RAID and LVM)
723#
724CONFIG_MD=y
725CONFIG_BLK_DEV_MD=m
726CONFIG_MD_LINEAR=m
727CONFIG_MD_RAID0=m
728CONFIG_MD_RAID1=m
729CONFIG_MD_RAID10=m
730CONFIG_MD_RAID5=m
731CONFIG_MD_RAID6=m
732CONFIG_MD_MULTIPATH=m
733CONFIG_MD_FAULTY=m
734CONFIG_BLK_DEV_DM=m
735CONFIG_DM_CRYPT=m
736CONFIG_DM_SNAPSHOT=m
737CONFIG_DM_MIRROR=m
738CONFIG_DM_ZERO=m
739CONFIG_DM_MULTIPATH=m
740CONFIG_DM_MULTIPATH_EMC=m
741
742#
743# Fusion MPT device support
744#
745# CONFIG_FUSION is not set
746# CONFIG_FUSION_SPI is not set
747# CONFIG_FUSION_FC is not set
748
749#
750# IEEE 1394 (FireWire) support
751#
752# CONFIG_IEEE1394 is not set
753
754#
755# I2O device support
756#
757# CONFIG_I2O is not set
758
759#
760# Network device support
761#
659CONFIG_NETDEVICES=y 762CONFIG_NETDEVICES=y
660CONFIG_DUMMY=m 763CONFIG_DUMMY=m
661CONFIG_BONDING=m 764CONFIG_BONDING=m
662CONFIG_EQUALIZER=m 765CONFIG_EQUALIZER=m
663CONFIG_TUN=m 766CONFIG_TUN=m
664# CONFIG_ETHERTAP is not set
665 767
666# 768#
667# ARCnet devices 769# ARCnet devices
@@ -669,6 +771,21 @@ CONFIG_TUN=m
669# CONFIG_ARCNET is not set 771# CONFIG_ARCNET is not set
670 772
671# 773#
774# PHY device support
775#
776CONFIG_PHYLIB=m
777CONFIG_PHYCONTROL=y
778
779#
780# MII PHY device drivers
781#
782CONFIG_MARVELL_PHY=m
783CONFIG_DAVICOM_PHY=m
784CONFIG_QSEMI_PHY=m
785CONFIG_LXT_PHY=m
786CONFIG_CICADA_PHY=m
787
788#
672# Ethernet (10 or 100Mbit) 789# Ethernet (10 or 100Mbit)
673# 790#
674CONFIG_NET_ETHERNET=y 791CONFIG_NET_ETHERNET=y
@@ -713,13 +830,17 @@ CONFIG_PCNET32=y
713# CONFIG_HAMACHI is not set 830# CONFIG_HAMACHI is not set
714# CONFIG_YELLOWFIN is not set 831# CONFIG_YELLOWFIN is not set
715# CONFIG_R8169 is not set 832# CONFIG_R8169 is not set
833# CONFIG_SIS190 is not set
834# CONFIG_SKGE is not set
716# CONFIG_SK98LIN is not set 835# CONFIG_SK98LIN is not set
717# CONFIG_VIA_VELOCITY is not set 836# CONFIG_VIA_VELOCITY is not set
718# CONFIG_TIGON3 is not set 837# CONFIG_TIGON3 is not set
838# CONFIG_BNX2 is not set
719 839
720# 840#
721# Ethernet (10000 Mbit) 841# Ethernet (10000 Mbit)
722# 842#
843# CONFIG_CHELSIO_T1 is not set
723# CONFIG_IXGB is not set 844# CONFIG_IXGB is not set
724# CONFIG_S2IO is not set 845# CONFIG_S2IO is not set
725 846
@@ -732,6 +853,8 @@ CONFIG_PCNET32=y
732# Wireless LAN (non-hamradio) 853# Wireless LAN (non-hamradio)
733# 854#
734# CONFIG_NET_RADIO is not set 855# CONFIG_NET_RADIO is not set
856# CONFIG_IPW_DEBUG is not set
857CONFIG_IPW2200=m
735 858
736# 859#
737# Wan interfaces 860# Wan interfaces
@@ -744,6 +867,8 @@ CONFIG_PCNET32=y
744# CONFIG_NET_FC is not set 867# CONFIG_NET_FC is not set
745# CONFIG_SHAPER is not set 868# CONFIG_SHAPER is not set
746# CONFIG_NETCONSOLE is not set 869# CONFIG_NETCONSOLE is not set
870# CONFIG_NETPOLL is not set
871# CONFIG_NET_POLL_CONTROLLER is not set
747 872
748# 873#
749# ISDN subsystem 874# ISDN subsystem
@@ -773,19 +898,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
773# CONFIG_INPUT_EVBUG is not set 898# CONFIG_INPUT_EVBUG is not set
774 899
775# 900#
776# Input I/O drivers
777#
778# CONFIG_GAMEPORT is not set
779CONFIG_SOUND_GAMEPORT=y
780CONFIG_SERIO=y
781# CONFIG_SERIO_I8042 is not set
782CONFIG_SERIO_SERPORT=y
783# CONFIG_SERIO_CT82C710 is not set
784# CONFIG_SERIO_PCIPS2 is not set
785# CONFIG_SERIO_LIBPS2 is not set
786# CONFIG_SERIO_RAW is not set
787
788#
789# Input Device Drivers 901# Input Device Drivers
790# 902#
791# CONFIG_INPUT_KEYBOARD is not set 903# CONFIG_INPUT_KEYBOARD is not set
@@ -795,6 +907,17 @@ CONFIG_SERIO_SERPORT=y
795# CONFIG_INPUT_MISC is not set 907# CONFIG_INPUT_MISC is not set
796 908
797# 909#
910# Hardware I/O ports
911#
912CONFIG_SERIO=y
913# CONFIG_SERIO_I8042 is not set
914CONFIG_SERIO_SERPORT=y
915# CONFIG_SERIO_PCIPS2 is not set
916# CONFIG_SERIO_LIBPS2 is not set
917# CONFIG_SERIO_RAW is not set
918# CONFIG_GAMEPORT is not set
919
920#
798# Character devices 921# Character devices
799# 922#
800CONFIG_VT=y 923CONFIG_VT=y
@@ -815,6 +938,7 @@ CONFIG_SERIAL_8250_NR_UARTS=4
815# 938#
816CONFIG_SERIAL_CORE=y 939CONFIG_SERIAL_CORE=y
817CONFIG_SERIAL_CORE_CONSOLE=y 940CONFIG_SERIAL_CORE_CONSOLE=y
941# CONFIG_SERIAL_JSM is not set
818CONFIG_UNIX98_PTYS=y 942CONFIG_UNIX98_PTYS=y
819CONFIG_LEGACY_PTYS=y 943CONFIG_LEGACY_PTYS=y
820CONFIG_LEGACY_PTY_COUNT=256 944CONFIG_LEGACY_PTY_COUNT=256
@@ -840,6 +964,11 @@ CONFIG_RTC=y
840# CONFIG_RAW_DRIVER is not set 964# CONFIG_RAW_DRIVER is not set
841 965
842# 966#
967# TPM devices
968#
969# CONFIG_TCG_TPM is not set
970
971#
843# I2C support 972# I2C support
844# 973#
845# CONFIG_I2C is not set 974# CONFIG_I2C is not set
@@ -850,10 +979,20 @@ CONFIG_RTC=y
850# CONFIG_W1 is not set 979# CONFIG_W1 is not set
851 980
852# 981#
982# Hardware Monitoring support
983#
984# CONFIG_HWMON is not set
985# CONFIG_HWMON_VID is not set
986
987#
853# Misc devices 988# Misc devices
854# 989#
855 990
856# 991#
992# Multimedia Capabilities Port drivers
993#
994
995#
857# Multimedia devices 996# Multimedia devices
858# 997#
859# CONFIG_VIDEO_DEV is not set 998# CONFIG_VIDEO_DEV is not set
@@ -873,7 +1012,6 @@ CONFIG_RTC=y
873# 1012#
874# CONFIG_VGA_CONSOLE is not set 1013# CONFIG_VGA_CONSOLE is not set
875CONFIG_DUMMY_CONSOLE=y 1014CONFIG_DUMMY_CONSOLE=y
876# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
877 1015
878# 1016#
879# Sound 1017# Sound
@@ -883,13 +1021,9 @@ CONFIG_DUMMY_CONSOLE=y
883# 1021#
884# USB support 1022# USB support
885# 1023#
886# CONFIG_USB is not set
887CONFIG_USB_ARCH_HAS_HCD=y 1024CONFIG_USB_ARCH_HAS_HCD=y
888CONFIG_USB_ARCH_HAS_OHCI=y 1025CONFIG_USB_ARCH_HAS_OHCI=y
889 1026# CONFIG_USB is not set
890#
891# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
892#
893 1027
894# 1028#
895# USB Gadget Support 1029# USB Gadget Support
@@ -907,10 +1041,15 @@ CONFIG_USB_ARCH_HAS_OHCI=y
907# CONFIG_INFINIBAND is not set 1041# CONFIG_INFINIBAND is not set
908 1042
909# 1043#
1044# SN Devices
1045#
1046
1047#
910# File systems 1048# File systems
911# 1049#
912CONFIG_EXT2_FS=y 1050CONFIG_EXT2_FS=y
913# CONFIG_EXT2_FS_XATTR is not set 1051# CONFIG_EXT2_FS_XATTR is not set
1052# CONFIG_EXT2_FS_XIP is not set
914CONFIG_EXT3_FS=y 1053CONFIG_EXT3_FS=y
915CONFIG_EXT3_FS_XATTR=y 1054CONFIG_EXT3_FS_XATTR=y
916# CONFIG_EXT3_FS_POSIX_ACL is not set 1055# CONFIG_EXT3_FS_POSIX_ACL is not set
@@ -931,12 +1070,14 @@ CONFIG_JFS_SECURITY=y
931# CONFIG_JFS_STATISTICS is not set 1070# CONFIG_JFS_STATISTICS is not set
932CONFIG_FS_POSIX_ACL=y 1071CONFIG_FS_POSIX_ACL=y
933CONFIG_XFS_FS=m 1072CONFIG_XFS_FS=m
934# CONFIG_XFS_RT is not set 1073CONFIG_XFS_EXPORT=y
935CONFIG_XFS_QUOTA=y 1074CONFIG_XFS_QUOTA=m
936CONFIG_XFS_SECURITY=y 1075CONFIG_XFS_SECURITY=y
937CONFIG_XFS_POSIX_ACL=y 1076CONFIG_XFS_POSIX_ACL=y
1077# CONFIG_XFS_RT is not set
938CONFIG_MINIX_FS=m 1078CONFIG_MINIX_FS=m
939CONFIG_ROMFS_FS=m 1079CONFIG_ROMFS_FS=m
1080CONFIG_INOTIFY=y
940CONFIG_QUOTA=y 1081CONFIG_QUOTA=y
941# CONFIG_QFMT_V1 is not set 1082# CONFIG_QFMT_V1 is not set
942CONFIG_QFMT_V2=y 1083CONFIG_QFMT_V2=y
@@ -944,6 +1085,7 @@ CONFIG_QUOTACTL=y
944CONFIG_DNOTIFY=y 1085CONFIG_DNOTIFY=y
945CONFIG_AUTOFS_FS=y 1086CONFIG_AUTOFS_FS=y
946# CONFIG_AUTOFS4_FS is not set 1087# CONFIG_AUTOFS4_FS is not set
1088CONFIG_FUSE_FS=m
947 1089
948# 1090#
949# CD-ROM/DVD Filesystems 1091# CD-ROM/DVD Filesystems
@@ -971,12 +1113,10 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
971CONFIG_PROC_FS=y 1113CONFIG_PROC_FS=y
972CONFIG_PROC_KCORE=y 1114CONFIG_PROC_KCORE=y
973CONFIG_SYSFS=y 1115CONFIG_SYSFS=y
974# CONFIG_DEVFS_FS is not set
975CONFIG_DEVPTS_FS_XATTR=y
976CONFIG_DEVPTS_FS_SECURITY=y
977# CONFIG_TMPFS is not set 1116# CONFIG_TMPFS is not set
978# CONFIG_HUGETLB_PAGE is not set 1117# CONFIG_HUGETLB_PAGE is not set
979CONFIG_RAMFS=y 1118CONFIG_RAMFS=y
1119CONFIG_RELAYFS_FS=m
980 1120
981# 1121#
982# Miscellaneous filesystems 1122# Miscellaneous filesystems
@@ -1002,16 +1142,19 @@ CONFIG_UFS_FS=m
1002# 1142#
1003CONFIG_NFS_FS=y 1143CONFIG_NFS_FS=y
1004CONFIG_NFS_V3=y 1144CONFIG_NFS_V3=y
1145# CONFIG_NFS_V3_ACL is not set
1005# CONFIG_NFS_V4 is not set 1146# CONFIG_NFS_V4 is not set
1006# CONFIG_NFS_DIRECTIO is not set 1147# CONFIG_NFS_DIRECTIO is not set
1007CONFIG_NFSD=y 1148CONFIG_NFSD=y
1008CONFIG_NFSD_V3=y 1149CONFIG_NFSD_V3=y
1150# CONFIG_NFSD_V3_ACL is not set
1009# CONFIG_NFSD_V4 is not set 1151# CONFIG_NFSD_V4 is not set
1010# CONFIG_NFSD_TCP is not set 1152# CONFIG_NFSD_TCP is not set
1011CONFIG_ROOT_NFS=y 1153CONFIG_ROOT_NFS=y
1012CONFIG_LOCKD=y 1154CONFIG_LOCKD=y
1013CONFIG_LOCKD_V4=y 1155CONFIG_LOCKD_V4=y
1014CONFIG_EXPORTFS=y 1156CONFIG_EXPORTFS=y
1157CONFIG_NFS_COMMON=y
1015CONFIG_SUNRPC=y 1158CONFIG_SUNRPC=y
1016# CONFIG_RPCSEC_GSS_KRB5 is not set 1159# CONFIG_RPCSEC_GSS_KRB5 is not set
1017# CONFIG_RPCSEC_GSS_SPKM3 is not set 1160# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -1020,6 +1163,7 @@ CONFIG_SUNRPC=y
1020# CONFIG_NCP_FS is not set 1163# CONFIG_NCP_FS is not set
1021# CONFIG_CODA_FS is not set 1164# CONFIG_CODA_FS is not set
1022# CONFIG_AFS_FS is not set 1165# CONFIG_AFS_FS is not set
1166# CONFIG_9P_FS is not set
1023 1167
1024# 1168#
1025# Partition Types 1169# Partition Types
@@ -1079,7 +1223,9 @@ CONFIG_NLS_UTF8=m
1079# 1223#
1080# Kernel hacking 1224# Kernel hacking
1081# 1225#
1226# CONFIG_PRINTK_TIME is not set
1082# CONFIG_DEBUG_KERNEL is not set 1227# CONFIG_DEBUG_KERNEL is not set
1228CONFIG_LOG_BUF_SHIFT=14
1083CONFIG_CROSSCOMPILE=y 1229CONFIG_CROSSCOMPILE=y
1084CONFIG_CMDLINE="" 1230CONFIG_CMDLINE=""
1085 1231
@@ -1101,6 +1247,7 @@ CONFIG_CRYPTO_SHA1=m
1101CONFIG_CRYPTO_SHA256=m 1247CONFIG_CRYPTO_SHA256=m
1102CONFIG_CRYPTO_SHA512=m 1248CONFIG_CRYPTO_SHA512=m
1103CONFIG_CRYPTO_WP512=m 1249CONFIG_CRYPTO_WP512=m
1250CONFIG_CRYPTO_TGR192=m
1104CONFIG_CRYPTO_DES=m 1251CONFIG_CRYPTO_DES=m
1105CONFIG_CRYPTO_BLOWFISH=m 1252CONFIG_CRYPTO_BLOWFISH=m
1106CONFIG_CRYPTO_TWOFISH=m 1253CONFIG_CRYPTO_TWOFISH=m
@@ -1125,9 +1272,12 @@ CONFIG_CRYPTO_CRC32C=m
1125# Library routines 1272# Library routines
1126# 1273#
1127# CONFIG_CRC_CCITT is not set 1274# CONFIG_CRC_CCITT is not set
1275CONFIG_CRC16=m
1128CONFIG_CRC32=y 1276CONFIG_CRC32=y
1129CONFIG_LIBCRC32C=m 1277CONFIG_LIBCRC32C=m
1130CONFIG_ZLIB_INFLATE=m 1278CONFIG_ZLIB_INFLATE=m
1131CONFIG_ZLIB_DEFLATE=m 1279CONFIG_ZLIB_DEFLATE=m
1132CONFIG_GENERIC_HARDIRQS=y 1280CONFIG_TEXTSEARCH=y
1133CONFIG_GENERIC_IRQ_PROBE=y 1281CONFIG_TEXTSEARCH_KMP=m
1282CONFIG_TEXTSEARCH_BM=m
1283CONFIG_TEXTSEARCH_FSM=m
diff --git a/arch/mips/configs/mipssim_defconfig b/arch/mips/configs/mipssim_defconfig
new file mode 100644
index 000000000000..fb9bdd9e3151
--- /dev/null
+++ b/arch/mips/configs/mipssim_defconfig
@@ -0,0 +1,775 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.14-rc2
4# Thu Oct 20 22:26:25 2005
5#
6CONFIG_MIPS=y
7
8#
9# Code maturity level options
10#
11CONFIG_EXPERIMENTAL=y
12CONFIG_CLEAN_COMPILE=y
13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
15
16#
17# General setup
18#
19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
21CONFIG_SWAP=y
22CONFIG_SYSVIPC=y
23# CONFIG_POSIX_MQUEUE is not set
24# CONFIG_BSD_PROCESS_ACCT is not set
25CONFIG_SYSCTL=y
26# CONFIG_AUDIT is not set
27CONFIG_HOTPLUG=y
28CONFIG_KOBJECT_UEVENT=y
29# CONFIG_IKCONFIG is not set
30CONFIG_INITRAMFS_SOURCE=""
31CONFIG_EMBEDDED=y
32CONFIG_KALLSYMS=y
33# CONFIG_KALLSYMS_ALL is not set
34# CONFIG_KALLSYMS_EXTRA_PASS is not set
35CONFIG_PRINTK=y
36CONFIG_BUG=y
37CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y
39CONFIG_EPOLL=y
40# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
41CONFIG_SHMEM=y
42CONFIG_CC_ALIGN_FUNCTIONS=0
43CONFIG_CC_ALIGN_LABELS=0
44CONFIG_CC_ALIGN_LOOPS=0
45CONFIG_CC_ALIGN_JUMPS=0
46# CONFIG_TINY_SHMEM is not set
47CONFIG_BASE_SMALL=0
48
49#
50# Loadable module support
51#
52CONFIG_MODULES=y
53CONFIG_MODULE_UNLOAD=y
54# CONFIG_MODULE_FORCE_UNLOAD is not set
55CONFIG_OBSOLETE_MODPARM=y
56CONFIG_MODVERSIONS=y
57CONFIG_MODULE_SRCVERSION_ALL=y
58CONFIG_KMOD=y
59
60#
61# Machine selection
62#
63# CONFIG_MIPS_MTX1 is not set
64# CONFIG_MIPS_BOSPORUS is not set
65# CONFIG_MIPS_PB1000 is not set
66# CONFIG_MIPS_PB1100 is not set
67# CONFIG_MIPS_PB1500 is not set
68# CONFIG_MIPS_PB1550 is not set
69# CONFIG_MIPS_PB1200 is not set
70# CONFIG_MIPS_DB1000 is not set
71# CONFIG_MIPS_DB1100 is not set
72# CONFIG_MIPS_DB1500 is not set
73# CONFIG_MIPS_DB1550 is not set
74# CONFIG_MIPS_DB1200 is not set
75# CONFIG_MIPS_MIRAGE is not set
76# CONFIG_MIPS_COBALT is not set
77# CONFIG_MACH_DECSTATION is not set
78# CONFIG_MIPS_EV64120 is not set
79# CONFIG_MIPS_EV96100 is not set
80# CONFIG_MIPS_IVR is not set
81# CONFIG_MIPS_ITE8172 is not set
82# CONFIG_MACH_JAZZ is not set
83# CONFIG_LASAT is not set
84# CONFIG_MIPS_ATLAS is not set
85# CONFIG_MIPS_MALTA is not set
86# CONFIG_MIPS_SEAD is not set
87CONFIG_MIPS_SIM=y
88# CONFIG_MOMENCO_JAGUAR_ATX is not set
89# CONFIG_MOMENCO_OCELOT is not set
90# CONFIG_MOMENCO_OCELOT_3 is not set
91# CONFIG_MOMENCO_OCELOT_C is not set
92# CONFIG_MOMENCO_OCELOT_G is not set
93# CONFIG_MIPS_XXS1500 is not set
94# CONFIG_PNX8550_V2PCI is not set
95# CONFIG_PNX8550_JBS is not set
96# CONFIG_DDB5074 is not set
97# CONFIG_DDB5476 is not set
98# CONFIG_DDB5477 is not set
99# CONFIG_MACH_VR41XX is not set
100# CONFIG_PMC_YOSEMITE is not set
101# CONFIG_QEMU is not set
102# CONFIG_SGI_IP22 is not set
103# CONFIG_SGI_IP27 is not set
104# CONFIG_SGI_IP32 is not set
105# CONFIG_SIBYTE_BIGSUR is not set
106# CONFIG_SIBYTE_SWARM is not set
107# CONFIG_SIBYTE_SENTOSA is not set
108# CONFIG_SIBYTE_RHONE is not set
109# CONFIG_SIBYTE_CARMEL is not set
110# CONFIG_SIBYTE_PTSWARM is not set
111# CONFIG_SIBYTE_LITTLESUR is not set
112# CONFIG_SIBYTE_CRHINE is not set
113# CONFIG_SIBYTE_CRHONE is not set
114# CONFIG_SNI_RM200_PCI is not set
115# CONFIG_TOSHIBA_JMR3927 is not set
116# CONFIG_TOSHIBA_RBTX4927 is not set
117# CONFIG_TOSHIBA_RBTX4938 is not set
118CONFIG_RWSEM_GENERIC_SPINLOCK=y
119CONFIG_GENERIC_CALIBRATE_DELAY=y
120CONFIG_DMA_NONCOHERENT=y
121CONFIG_DMA_NEED_PCI_MAP_STATE=y
122# CONFIG_CPU_BIG_ENDIAN is not set
123CONFIG_CPU_LITTLE_ENDIAN=y
124CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
125CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
126CONFIG_IRQ_CPU=y
127CONFIG_MIPS_L1_CACHE_SHIFT=5
128
129#
130# CPU selection
131#
132CONFIG_CPU_MIPS32_R1=y
133# CONFIG_CPU_MIPS32_R2 is not set
134# CONFIG_CPU_MIPS64_R1 is not set
135# CONFIG_CPU_MIPS64_R2 is not set
136# CONFIG_CPU_R3000 is not set
137# CONFIG_CPU_TX39XX is not set
138# CONFIG_CPU_VR41XX is not set
139# CONFIG_CPU_R4300 is not set
140# CONFIG_CPU_R4X00 is not set
141# CONFIG_CPU_TX49XX is not set
142# CONFIG_CPU_R5000 is not set
143# CONFIG_CPU_R5432 is not set
144# CONFIG_CPU_R6000 is not set
145# CONFIG_CPU_NEVADA is not set
146# CONFIG_CPU_R8000 is not set
147# CONFIG_CPU_R10000 is not set
148# CONFIG_CPU_RM7000 is not set
149# CONFIG_CPU_RM9000 is not set
150# CONFIG_CPU_SB1 is not set
151CONFIG_SYS_HAS_CPU_MIPS32_R1=y
152CONFIG_SYS_HAS_CPU_MIPS32_R2=y
153CONFIG_CPU_MIPS32=y
154CONFIG_CPU_MIPSR1=y
155CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
156CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
157
158#
159# Kernel type
160#
161CONFIG_32BIT=y
162# CONFIG_64BIT is not set
163CONFIG_PAGE_SIZE_4KB=y
164# CONFIG_PAGE_SIZE_8KB is not set
165# CONFIG_PAGE_SIZE_16KB is not set
166# CONFIG_PAGE_SIZE_64KB is not set
167CONFIG_CPU_HAS_PREFETCH=y
168CONFIG_MIPS_MT=y
169# CONFIG_MIPS_MT_SMP is not set
170CONFIG_MIPS_VPE_LOADER=y
171CONFIG_MIPS_VPE_LOADER_TOM=y
172CONFIG_MIPS_VPE_APSP_API=y
173# CONFIG_64BIT_PHYS_ADDR is not set
174# CONFIG_CPU_ADVANCED is not set
175CONFIG_CPU_HAS_LLSC=y
176CONFIG_CPU_HAS_SYNC=y
177CONFIG_GENERIC_HARDIRQS=y
178CONFIG_GENERIC_IRQ_PROBE=y
179CONFIG_ARCH_FLATMEM_ENABLE=y
180CONFIG_SELECT_MEMORY_MODEL=y
181CONFIG_FLATMEM_MANUAL=y
182# CONFIG_DISCONTIGMEM_MANUAL is not set
183# CONFIG_SPARSEMEM_MANUAL is not set
184CONFIG_FLATMEM=y
185CONFIG_FLAT_NODE_MEM_MAP=y
186# CONFIG_SPARSEMEM_STATIC is not set
187CONFIG_PREEMPT_NONE=y
188# CONFIG_PREEMPT_VOLUNTARY is not set
189# CONFIG_PREEMPT is not set
190
191#
192# Bus options (PCI, PCMCIA, EISA, ISA, TC)
193#
194CONFIG_MMU=y
195
196#
197# PCCARD (PCMCIA/CardBus) support
198#
199# CONFIG_PCCARD is not set
200
201#
202# PCI Hotplug Support
203#
204
205#
206# Executable file formats
207#
208CONFIG_BINFMT_ELF=y
209# CONFIG_BINFMT_MISC is not set
210CONFIG_TRAD_SIGNALS=y
211
212#
213# Networking
214#
215CONFIG_NET=y
216
217#
218# Networking options
219#
220CONFIG_PACKET=y
221CONFIG_PACKET_MMAP=y
222CONFIG_UNIX=y
223CONFIG_XFRM=y
224# CONFIG_XFRM_USER is not set
225CONFIG_NET_KEY=y
226CONFIG_INET=y
227CONFIG_IP_MULTICAST=y
228CONFIG_IP_ADVANCED_ROUTER=y
229CONFIG_ASK_IP_FIB_HASH=y
230# CONFIG_IP_FIB_TRIE is not set
231CONFIG_IP_FIB_HASH=y
232CONFIG_IP_MULTIPLE_TABLES=y
233CONFIG_IP_ROUTE_MULTIPATH=y
234# CONFIG_IP_ROUTE_MULTIPATH_CACHED is not set
235CONFIG_IP_ROUTE_VERBOSE=y
236CONFIG_IP_PNP=y
237CONFIG_IP_PNP_DHCP=y
238CONFIG_IP_PNP_BOOTP=y
239# CONFIG_IP_PNP_RARP is not set
240# CONFIG_NET_IPIP is not set
241# CONFIG_NET_IPGRE is not set
242CONFIG_IP_MROUTE=y
243CONFIG_IP_PIMSM_V1=y
244CONFIG_IP_PIMSM_V2=y
245# CONFIG_ARPD is not set
246CONFIG_SYN_COOKIES=y
247# CONFIG_INET_AH is not set
248# CONFIG_INET_ESP is not set
249# CONFIG_INET_IPCOMP is not set
250# CONFIG_INET_TUNNEL is not set
251CONFIG_INET_DIAG=y
252CONFIG_INET_TCP_DIAG=y
253# CONFIG_TCP_CONG_ADVANCED is not set
254CONFIG_TCP_CONG_BIC=y
255# CONFIG_IPV6 is not set
256# CONFIG_NETFILTER is not set
257
258#
259# DCCP Configuration (EXPERIMENTAL)
260#
261# CONFIG_IP_DCCP is not set
262
263#
264# SCTP Configuration (EXPERIMENTAL)
265#
266CONFIG_IP_SCTP=m
267# CONFIG_SCTP_DBG_MSG is not set
268# CONFIG_SCTP_DBG_OBJCNT is not set
269# CONFIG_SCTP_HMAC_NONE is not set
270# CONFIG_SCTP_HMAC_SHA1 is not set
271CONFIG_SCTP_HMAC_MD5=y
272# CONFIG_ATM is not set
273# CONFIG_BRIDGE is not set
274# CONFIG_VLAN_8021Q is not set
275# CONFIG_DECNET is not set
276# CONFIG_LLC2 is not set
277# CONFIG_IPX is not set
278# CONFIG_ATALK is not set
279# CONFIG_X25 is not set
280# CONFIG_LAPB is not set
281CONFIG_NET_DIVERT=y
282# CONFIG_ECONET is not set
283# CONFIG_WAN_ROUTER is not set
284CONFIG_NET_SCHED=y
285CONFIG_NET_SCH_CLK_JIFFIES=y
286# CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set
287# CONFIG_NET_SCH_CLK_CPU is not set
288CONFIG_NET_SCH_CBQ=m
289CONFIG_NET_SCH_HTB=m
290CONFIG_NET_SCH_HFSC=m
291CONFIG_NET_SCH_PRIO=m
292CONFIG_NET_SCH_RED=m
293CONFIG_NET_SCH_SFQ=m
294CONFIG_NET_SCH_TEQL=m
295CONFIG_NET_SCH_TBF=m
296CONFIG_NET_SCH_GRED=m
297CONFIG_NET_SCH_DSMARK=m
298CONFIG_NET_SCH_NETEM=m
299CONFIG_NET_SCH_INGRESS=m
300CONFIG_NET_QOS=y
301CONFIG_NET_ESTIMATOR=y
302CONFIG_NET_CLS=y
303CONFIG_NET_CLS_BASIC=m
304CONFIG_NET_CLS_TCINDEX=m
305CONFIG_NET_CLS_ROUTE4=m
306CONFIG_NET_CLS_ROUTE=y
307# CONFIG_NET_CLS_FW is not set
308# CONFIG_NET_CLS_U32 is not set
309# CONFIG_NET_CLS_RSVP is not set
310# CONFIG_NET_CLS_RSVP6 is not set
311# CONFIG_NET_EMATCH is not set
312# CONFIG_NET_CLS_ACT is not set
313# CONFIG_NET_CLS_POLICE is not set
314
315#
316# Network testing
317#
318# CONFIG_NET_PKTGEN is not set
319# CONFIG_HAMRADIO is not set
320# CONFIG_IRDA is not set
321# CONFIG_BT is not set
322# CONFIG_IEEE80211 is not set
323
324#
325# Device Drivers
326#
327
328#
329# Generic Driver Options
330#
331# CONFIG_STANDALONE is not set
332# CONFIG_PREVENT_FIRMWARE_BUILD is not set
333# CONFIG_FW_LOADER is not set
334# CONFIG_DEBUG_DRIVER is not set
335
336#
337# Connector - unified userspace <-> kernelspace linker
338#
339# CONFIG_CONNECTOR is not set
340
341#
342# Memory Technology Devices (MTD)
343#
344# CONFIG_MTD is not set
345
346#
347# Parallel port support
348#
349# CONFIG_PARPORT is not set
350
351#
352# Plug and Play support
353#
354
355#
356# Block devices
357#
358# CONFIG_BLK_DEV_COW_COMMON is not set
359CONFIG_BLK_DEV_LOOP=y
360# CONFIG_BLK_DEV_CRYPTOLOOP is not set
361CONFIG_BLK_DEV_NBD=y
362# CONFIG_BLK_DEV_RAM is not set
363CONFIG_BLK_DEV_RAM_COUNT=16
364# CONFIG_LBD is not set
365# CONFIG_CDROM_PKTCDVD is not set
366
367#
368# IO Schedulers
369#
370CONFIG_IOSCHED_NOOP=y
371CONFIG_IOSCHED_AS=y
372CONFIG_IOSCHED_DEADLINE=y
373CONFIG_IOSCHED_CFQ=y
374# CONFIG_ATA_OVER_ETH is not set
375
376#
377# ATA/ATAPI/MFM/RLL support
378#
379# CONFIG_IDE is not set
380
381#
382# SCSI device support
383#
384# CONFIG_RAID_ATTRS is not set
385# CONFIG_SCSI is not set
386
387#
388# Multi-device support (RAID and LVM)
389#
390# CONFIG_MD is not set
391
392#
393# Fusion MPT device support
394#
395# CONFIG_FUSION is not set
396
397#
398# IEEE 1394 (FireWire) support
399#
400
401#
402# I2O device support
403#
404
405#
406# Network device support
407#
408CONFIG_NETDEVICES=y
409# CONFIG_DUMMY is not set
410# CONFIG_BONDING is not set
411# CONFIG_EQUALIZER is not set
412# CONFIG_TUN is not set
413
414#
415# PHY device support
416#
417
418#
419# Ethernet (10 or 100Mbit)
420#
421# CONFIG_NET_ETHERNET is not set
422# CONFIG_MIPS_SIM_NET is not set
423
424#
425# Ethernet (1000 Mbit)
426#
427
428#
429# Ethernet (10000 Mbit)
430#
431
432#
433# Token Ring devices
434#
435
436#
437# Wireless LAN (non-hamradio)
438#
439# CONFIG_NET_RADIO is not set
440
441#
442# Wan interfaces
443#
444# CONFIG_WAN is not set
445# CONFIG_PPP is not set
446# CONFIG_SLIP is not set
447# CONFIG_SHAPER is not set
448# CONFIG_NETCONSOLE is not set
449# CONFIG_NETPOLL is not set
450# CONFIG_NET_POLL_CONTROLLER is not set
451
452#
453# ISDN subsystem
454#
455# CONFIG_ISDN is not set
456
457#
458# Telephony Support
459#
460# CONFIG_PHONE is not set
461
462#
463# Input device support
464#
465CONFIG_INPUT=y
466
467#
468# Userland interfaces
469#
470# CONFIG_INPUT_MOUSEDEV is not set
471# CONFIG_INPUT_JOYDEV is not set
472# CONFIG_INPUT_TSDEV is not set
473# CONFIG_INPUT_EVDEV is not set
474# CONFIG_INPUT_EVBUG is not set
475
476#
477# Input Device Drivers
478#
479# CONFIG_INPUT_KEYBOARD is not set
480# CONFIG_INPUT_MOUSE is not set
481# CONFIG_INPUT_JOYSTICK is not set
482# CONFIG_INPUT_TOUCHSCREEN is not set
483# CONFIG_INPUT_MISC is not set
484
485#
486# Hardware I/O ports
487#
488CONFIG_SERIO=y
489# CONFIG_SERIO_I8042 is not set
490CONFIG_SERIO_SERPORT=y
491# CONFIG_SERIO_LIBPS2 is not set
492# CONFIG_SERIO_RAW is not set
493# CONFIG_GAMEPORT is not set
494
495#
496# Character devices
497#
498# CONFIG_VT is not set
499# CONFIG_SERIAL_NONSTANDARD is not set
500
501#
502# Serial drivers
503#
504CONFIG_SERIAL_8250=y
505CONFIG_SERIAL_8250_CONSOLE=y
506CONFIG_SERIAL_8250_NR_UARTS=1
507# CONFIG_SERIAL_8250_EXTENDED is not set
508
509#
510# Non-8250 serial port support
511#
512CONFIG_SERIAL_CORE=y
513CONFIG_SERIAL_CORE_CONSOLE=y
514CONFIG_UNIX98_PTYS=y
515CONFIG_LEGACY_PTYS=y
516CONFIG_LEGACY_PTY_COUNT=256
517
518#
519# IPMI
520#
521# CONFIG_IPMI_HANDLER is not set
522
523#
524# Watchdog Cards
525#
526# CONFIG_WATCHDOG is not set
527# CONFIG_RTC is not set
528# CONFIG_GEN_RTC is not set
529# CONFIG_DTLK is not set
530# CONFIG_R3964 is not set
531
532#
533# Ftape, the floppy tape device driver
534#
535# CONFIG_RAW_DRIVER is not set
536
537#
538# TPM devices
539#
540
541#
542# I2C support
543#
544# CONFIG_I2C is not set
545
546#
547# Dallas's 1-wire bus
548#
549# CONFIG_W1 is not set
550
551#
552# Hardware Monitoring support
553#
554# CONFIG_HWMON is not set
555# CONFIG_HWMON_VID is not set
556
557#
558# Misc devices
559#
560
561#
562# Multimedia Capabilities Port drivers
563#
564
565#
566# Multimedia devices
567#
568# CONFIG_VIDEO_DEV is not set
569
570#
571# Digital Video Broadcasting Devices
572#
573# CONFIG_DVB is not set
574
575#
576# Graphics support
577#
578# CONFIG_FB is not set
579
580#
581# Sound
582#
583# CONFIG_SOUND is not set
584
585#
586# USB support
587#
588# CONFIG_USB_ARCH_HAS_HCD is not set
589# CONFIG_USB_ARCH_HAS_OHCI is not set
590
591#
592# USB Gadget Support
593#
594# CONFIG_USB_GADGET is not set
595
596#
597# MMC/SD Card support
598#
599# CONFIG_MMC is not set
600
601#
602# InfiniBand support
603#
604
605#
606# SN Devices
607#
608
609#
610# File systems
611#
612CONFIG_EXT2_FS=y
613# CONFIG_EXT2_FS_XATTR is not set
614# CONFIG_EXT2_FS_XIP is not set
615# CONFIG_EXT3_FS is not set
616# CONFIG_JBD is not set
617# CONFIG_REISERFS_FS is not set
618# CONFIG_JFS_FS is not set
619# CONFIG_FS_POSIX_ACL is not set
620# CONFIG_XFS_FS is not set
621# CONFIG_MINIX_FS is not set
622CONFIG_ROMFS_FS=y
623# CONFIG_INOTIFY is not set
624# CONFIG_QUOTA is not set
625# CONFIG_DNOTIFY is not set
626# CONFIG_AUTOFS_FS is not set
627# CONFIG_AUTOFS4_FS is not set
628# CONFIG_FUSE_FS is not set
629
630#
631# CD-ROM/DVD Filesystems
632#
633# CONFIG_ISO9660_FS is not set
634# CONFIG_UDF_FS is not set
635
636#
637# DOS/FAT/NT Filesystems
638#
639# CONFIG_MSDOS_FS is not set
640# CONFIG_VFAT_FS is not set
641# CONFIG_NTFS_FS is not set
642
643#
644# Pseudo filesystems
645#
646CONFIG_PROC_FS=y
647# CONFIG_PROC_KCORE is not set
648# CONFIG_SYSFS is not set
649# CONFIG_TMPFS is not set
650# CONFIG_HUGETLB_PAGE is not set
651CONFIG_RAMFS=y
652# CONFIG_RELAYFS_FS is not set
653
654#
655# Miscellaneous filesystems
656#
657# CONFIG_ADFS_FS is not set
658# CONFIG_AFFS_FS is not set
659# CONFIG_HFS_FS is not set
660# CONFIG_HFSPLUS_FS is not set
661# CONFIG_BEFS_FS is not set
662# CONFIG_BFS_FS is not set
663# CONFIG_EFS_FS is not set
664# CONFIG_CRAMFS is not set
665# CONFIG_VXFS_FS is not set
666# CONFIG_HPFS_FS is not set
667# CONFIG_QNX4FS_FS is not set
668# CONFIG_SYSV_FS is not set
669# CONFIG_UFS_FS is not set
670
671#
672# Network File Systems
673#
674CONFIG_NFS_FS=y
675CONFIG_NFS_V3=y
676# CONFIG_NFS_V3_ACL is not set
677# CONFIG_NFS_V4 is not set
678# CONFIG_NFS_DIRECTIO is not set
679# CONFIG_NFSD is not set
680CONFIG_ROOT_NFS=y
681CONFIG_LOCKD=y
682CONFIG_LOCKD_V4=y
683CONFIG_NFS_COMMON=y
684CONFIG_SUNRPC=y
685# CONFIG_RPCSEC_GSS_KRB5 is not set
686# CONFIG_RPCSEC_GSS_SPKM3 is not set
687# CONFIG_SMB_FS is not set
688# CONFIG_CIFS is not set
689# CONFIG_NCP_FS is not set
690# CONFIG_CODA_FS is not set
691# CONFIG_AFS_FS is not set
692# CONFIG_9P_FS is not set
693
694#
695# Partition Types
696#
697# CONFIG_PARTITION_ADVANCED is not set
698CONFIG_MSDOS_PARTITION=y
699
700#
701# Native Language Support
702#
703# CONFIG_NLS is not set
704
705#
706# Profiling support
707#
708# CONFIG_PROFILING is not set
709
710#
711# Kernel hacking
712#
713# CONFIG_PRINTK_TIME is not set
714CONFIG_DEBUG_KERNEL=y
715# CONFIG_MAGIC_SYSRQ is not set
716CONFIG_LOG_BUF_SHIFT=14
717# CONFIG_DETECT_SOFTLOCKUP is not set
718# CONFIG_SCHEDSTATS is not set
719# CONFIG_DEBUG_SLAB is not set
720# CONFIG_DEBUG_SPINLOCK is not set
721# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
722# CONFIG_DEBUG_KOBJECT is not set
723CONFIG_DEBUG_INFO=y
724CONFIG_CROSSCOMPILE=y
725CONFIG_CMDLINE="nfsroot=192.168.192.169:/u1/mipsel,timeo=20 ip=dhcp"
726# CONFIG_DEBUG_STACK_USAGE is not set
727# CONFIG_KGDB is not set
728# CONFIG_RUNTIME_DEBUG is not set
729# CONFIG_MIPS_UNCACHED is not set
730
731#
732# Security options
733#
734# CONFIG_KEYS is not set
735
736#
737# Cryptographic options
738#
739CONFIG_CRYPTO=y
740CONFIG_CRYPTO_HMAC=y
741# CONFIG_CRYPTO_NULL is not set
742# CONFIG_CRYPTO_MD4 is not set
743CONFIG_CRYPTO_MD5=y
744# CONFIG_CRYPTO_SHA1 is not set
745# CONFIG_CRYPTO_SHA256 is not set
746# CONFIG_CRYPTO_SHA512 is not set
747# CONFIG_CRYPTO_WP512 is not set
748# CONFIG_CRYPTO_TGR192 is not set
749# CONFIG_CRYPTO_DES is not set
750# CONFIG_CRYPTO_BLOWFISH is not set
751# CONFIG_CRYPTO_TWOFISH is not set
752# CONFIG_CRYPTO_SERPENT is not set
753# CONFIG_CRYPTO_AES is not set
754# CONFIG_CRYPTO_CAST5 is not set
755# CONFIG_CRYPTO_CAST6 is not set
756# CONFIG_CRYPTO_TEA is not set
757# CONFIG_CRYPTO_ARC4 is not set
758# CONFIG_CRYPTO_KHAZAD is not set
759# CONFIG_CRYPTO_ANUBIS is not set
760# CONFIG_CRYPTO_DEFLATE is not set
761# CONFIG_CRYPTO_MICHAEL_MIC is not set
762# CONFIG_CRYPTO_CRC32C is not set
763# CONFIG_CRYPTO_TEST is not set
764
765#
766# Hardware crypto devices
767#
768
769#
770# Library routines
771#
772# CONFIG_CRC_CCITT is not set
773CONFIG_CRC16=y
774CONFIG_CRC32=y
775# CONFIG_LIBCRC32C is not set
diff --git a/arch/mips/configs/mpc30x_defconfig b/arch/mips/configs/mpc30x_defconfig
index 0fea57ef18f2..e2c082128532 100644
--- a/arch/mips/configs/mpc30x_defconfig
+++ b/arch/mips/configs/mpc30x_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:07 2005 4# Thu Oct 20 22:26:28 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,24 +11,29 @@ CONFIG_32BIT=y
14CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
25# CONFIG_BSD_PROCESS_ACCT is not set 24# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y 25CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set 26# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14 27CONFIG_HOTPLUG=y
29# CONFIG_HOTPLUG is not set
30CONFIG_KOBJECT_UEVENT=y 28CONFIG_KOBJECT_UEVENT=y
31# CONFIG_IKCONFIG is not set 29# CONFIG_IKCONFIG is not set
30CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y 31CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y 32CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_EXTRA_PASS is not set 33# CONFIG_KALLSYMS_EXTRA_PASS is not set
34CONFIG_PRINTK=y
35CONFIG_BUG=y
36CONFIG_BASE_FULL=y
35CONFIG_FUTEX=y 37CONFIG_FUTEX=y
36CONFIG_EPOLL=y 38CONFIG_EPOLL=y
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -41,6 +43,7 @@ CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0 43CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0 44CONFIG_CC_ALIGN_JUMPS=0
43# CONFIG_TINY_SHMEM is not set 45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
44 47
45# 48#
46# Loadable module support 49# Loadable module support
@@ -56,57 +59,86 @@ CONFIG_KMOD=y
56# 59#
57# Machine selection 60# Machine selection
58# 61#
59# CONFIG_MACH_JAZZ is not set 62# CONFIG_MIPS_MTX1 is not set
60CONFIG_MACH_VR41XX=y 63# CONFIG_MIPS_BOSPORUS is not set
61# CONFIG_NEC_CMBVR4133 is not set 64# CONFIG_MIPS_PB1000 is not set
62# CONFIG_CASIO_E55 is not set 65# CONFIG_MIPS_PB1100 is not set
63# CONFIG_IBM_WORKPAD is not set 66# CONFIG_MIPS_PB1500 is not set
64# CONFIG_TANBAC_TB0226 is not set 67# CONFIG_MIPS_PB1550 is not set
65# CONFIG_TANBAC_TB0229 is not set 68# CONFIG_MIPS_PB1200 is not set
66CONFIG_VICTOR_MPC30X=y 69# CONFIG_MIPS_DB1000 is not set
67# CONFIG_ZAO_CAPCELLA is not set 70# CONFIG_MIPS_DB1100 is not set
68CONFIG_PCI_VR41XX=y 71# CONFIG_MIPS_DB1500 is not set
69CONFIG_VRC4173=y 72# CONFIG_MIPS_DB1550 is not set
70# CONFIG_TOSHIBA_JMR3927 is not set 73# CONFIG_MIPS_DB1200 is not set
74# CONFIG_MIPS_MIRAGE is not set
71# CONFIG_MIPS_COBALT is not set 75# CONFIG_MIPS_COBALT is not set
72# CONFIG_MACH_DECSTATION is not set 76# CONFIG_MACH_DECSTATION is not set
73# CONFIG_MIPS_EV64120 is not set 77# CONFIG_MIPS_EV64120 is not set
74# CONFIG_MIPS_EV96100 is not set 78# CONFIG_MIPS_EV96100 is not set
75# CONFIG_MIPS_IVR is not set 79# CONFIG_MIPS_IVR is not set
76# CONFIG_LASAT is not set
77# CONFIG_MIPS_ITE8172 is not set 80# CONFIG_MIPS_ITE8172 is not set
81# CONFIG_MACH_JAZZ is not set
82# CONFIG_LASAT is not set
78# CONFIG_MIPS_ATLAS is not set 83# CONFIG_MIPS_ATLAS is not set
79# CONFIG_MIPS_MALTA is not set 84# CONFIG_MIPS_MALTA is not set
80# CONFIG_MIPS_SEAD is not set 85# CONFIG_MIPS_SEAD is not set
86# CONFIG_MIPS_SIM is not set
87# CONFIG_MOMENCO_JAGUAR_ATX is not set
81# CONFIG_MOMENCO_OCELOT is not set 88# CONFIG_MOMENCO_OCELOT is not set
82# CONFIG_MOMENCO_OCELOT_G is not set
83# CONFIG_MOMENCO_OCELOT_C is not set
84# CONFIG_MOMENCO_OCELOT_3 is not set 89# CONFIG_MOMENCO_OCELOT_3 is not set
85# CONFIG_MOMENCO_JAGUAR_ATX is not set 90# CONFIG_MOMENCO_OCELOT_C is not set
86# CONFIG_PMC_YOSEMITE is not set 91# CONFIG_MOMENCO_OCELOT_G is not set
92# CONFIG_MIPS_XXS1500 is not set
93# CONFIG_PNX8550_V2PCI is not set
94# CONFIG_PNX8550_JBS is not set
87# CONFIG_DDB5074 is not set 95# CONFIG_DDB5074 is not set
88# CONFIG_DDB5476 is not set 96# CONFIG_DDB5476 is not set
89# CONFIG_DDB5477 is not set 97# CONFIG_DDB5477 is not set
90# CONFIG_NEC_OSPREY is not set 98CONFIG_MACH_VR41XX=y
99# CONFIG_PMC_YOSEMITE is not set
100# CONFIG_QEMU is not set
91# CONFIG_SGI_IP22 is not set 101# CONFIG_SGI_IP22 is not set
92# CONFIG_SOC_AU1X00 is not set 102# CONFIG_SGI_IP27 is not set
93# CONFIG_SIBYTE_SB1xxx_SOC is not set 103# CONFIG_SGI_IP32 is not set
104# CONFIG_SIBYTE_BIGSUR is not set
105# CONFIG_SIBYTE_SWARM is not set
106# CONFIG_SIBYTE_SENTOSA is not set
107# CONFIG_SIBYTE_RHONE is not set
108# CONFIG_SIBYTE_CARMEL is not set
109# CONFIG_SIBYTE_PTSWARM is not set
110# CONFIG_SIBYTE_LITTLESUR is not set
111# CONFIG_SIBYTE_CRHINE is not set
112# CONFIG_SIBYTE_CRHONE is not set
94# CONFIG_SNI_RM200_PCI is not set 113# CONFIG_SNI_RM200_PCI is not set
114# CONFIG_TOSHIBA_JMR3927 is not set
95# CONFIG_TOSHIBA_RBTX4927 is not set 115# CONFIG_TOSHIBA_RBTX4927 is not set
116# CONFIG_TOSHIBA_RBTX4938 is not set
117# CONFIG_NEC_CMBVR4133 is not set
118# CONFIG_CASIO_E55 is not set
119# CONFIG_IBM_WORKPAD is not set
120# CONFIG_TANBAC_TB022X is not set
121CONFIG_VICTOR_MPC30X=y
122# CONFIG_ZAO_CAPCELLA is not set
123CONFIG_PCI_VR41XX=y
124CONFIG_VRC4173=y
96CONFIG_RWSEM_GENERIC_SPINLOCK=y 125CONFIG_RWSEM_GENERIC_SPINLOCK=y
97CONFIG_GENERIC_CALIBRATE_DELAY=y 126CONFIG_GENERIC_CALIBRATE_DELAY=y
98CONFIG_HAVE_DEC_LOCK=y
99CONFIG_DMA_NONCOHERENT=y 127CONFIG_DMA_NONCOHERENT=y
100CONFIG_DMA_NEED_PCI_MAP_STATE=y 128CONFIG_DMA_NEED_PCI_MAP_STATE=y
129# CONFIG_CPU_BIG_ENDIAN is not set
101CONFIG_CPU_LITTLE_ENDIAN=y 130CONFIG_CPU_LITTLE_ENDIAN=y
131CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
102CONFIG_IRQ_CPU=y 132CONFIG_IRQ_CPU=y
103CONFIG_MIPS_L1_CACHE_SHIFT=5 133CONFIG_MIPS_L1_CACHE_SHIFT=5
104 134
105# 135#
106# CPU selection 136# CPU selection
107# 137#
108# CONFIG_CPU_MIPS32 is not set 138# CONFIG_CPU_MIPS32_R1 is not set
109# CONFIG_CPU_MIPS64 is not set 139# CONFIG_CPU_MIPS32_R2 is not set
140# CONFIG_CPU_MIPS64_R1 is not set
141# CONFIG_CPU_MIPS64_R2 is not set
110# CONFIG_CPU_R3000 is not set 142# CONFIG_CPU_R3000 is not set
111# CONFIG_CPU_TX39XX is not set 143# CONFIG_CPU_TX39XX is not set
112CONFIG_CPU_VR41XX=y 144CONFIG_CPU_VR41XX=y
@@ -122,12 +154,36 @@ CONFIG_CPU_VR41XX=y
122# CONFIG_CPU_RM7000 is not set 154# CONFIG_CPU_RM7000 is not set
123# CONFIG_CPU_RM9000 is not set 155# CONFIG_CPU_RM9000 is not set
124# CONFIG_CPU_SB1 is not set 156# CONFIG_CPU_SB1 is not set
157CONFIG_SYS_HAS_CPU_VR41XX=y
158CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
159CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
160CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
161CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
162
163#
164# Kernel type
165#
166CONFIG_32BIT=y
167# CONFIG_64BIT is not set
125CONFIG_PAGE_SIZE_4KB=y 168CONFIG_PAGE_SIZE_4KB=y
126# CONFIG_PAGE_SIZE_8KB is not set 169# CONFIG_PAGE_SIZE_8KB is not set
127# CONFIG_PAGE_SIZE_16KB is not set 170# CONFIG_PAGE_SIZE_16KB is not set
128# CONFIG_PAGE_SIZE_64KB is not set 171# CONFIG_PAGE_SIZE_64KB is not set
172# CONFIG_MIPS_MT is not set
129# CONFIG_CPU_ADVANCED is not set 173# CONFIG_CPU_ADVANCED is not set
130CONFIG_CPU_HAS_SYNC=y 174CONFIG_CPU_HAS_SYNC=y
175CONFIG_GENERIC_HARDIRQS=y
176CONFIG_GENERIC_IRQ_PROBE=y
177CONFIG_ARCH_FLATMEM_ENABLE=y
178CONFIG_SELECT_MEMORY_MODEL=y
179CONFIG_FLATMEM_MANUAL=y
180# CONFIG_DISCONTIGMEM_MANUAL is not set
181# CONFIG_SPARSEMEM_MANUAL is not set
182CONFIG_FLATMEM=y
183CONFIG_FLAT_NODE_MEM_MAP=y
184# CONFIG_SPARSEMEM_STATIC is not set
185CONFIG_PREEMPT_NONE=y
186# CONFIG_PREEMPT_VOLUNTARY is not set
131# CONFIG_PREEMPT is not set 187# CONFIG_PREEMPT is not set
132 188
133# 189#
@@ -136,17 +192,26 @@ CONFIG_CPU_HAS_SYNC=y
136CONFIG_HW_HAS_PCI=y 192CONFIG_HW_HAS_PCI=y
137CONFIG_PCI=y 193CONFIG_PCI=y
138CONFIG_PCI_LEGACY_PROC=y 194CONFIG_PCI_LEGACY_PROC=y
139CONFIG_PCI_NAMES=y
140CONFIG_MMU=y 195CONFIG_MMU=y
141 196
142# 197#
143# PCCARD (PCMCIA/CardBus) support 198# PCCARD (PCMCIA/CardBus) support
144# 199#
145# CONFIG_PCCARD is not set 200CONFIG_PCCARD=y
201# CONFIG_PCMCIA_DEBUG is not set
202CONFIG_PCMCIA=y
203CONFIG_PCMCIA_LOAD_CIS=y
204CONFIG_PCMCIA_IOCTL=y
205# CONFIG_CARDBUS is not set
146 206
147# 207#
148# PC-card bridges 208# PC-card bridges
149# 209#
210# CONFIG_YENTA is not set
211# CONFIG_PD6729 is not set
212# CONFIG_I82092 is not set
213# CONFIG_TCIC is not set
214CONFIG_PCMCIA_VRC4173=y
150 215
151# 216#
152# PCI Hotplug Support 217# PCI Hotplug Support
@@ -161,6 +226,78 @@ CONFIG_BINFMT_ELF=y
161CONFIG_TRAD_SIGNALS=y 226CONFIG_TRAD_SIGNALS=y
162 227
163# 228#
229# Networking
230#
231CONFIG_NET=y
232
233#
234# Networking options
235#
236CONFIG_PACKET=y
237CONFIG_PACKET_MMAP=y
238CONFIG_UNIX=y
239CONFIG_XFRM=y
240CONFIG_XFRM_USER=m
241CONFIG_NET_KEY=y
242CONFIG_INET=y
243CONFIG_IP_MULTICAST=y
244# CONFIG_IP_ADVANCED_ROUTER is not set
245CONFIG_IP_FIB_HASH=y
246# CONFIG_IP_PNP is not set
247# CONFIG_NET_IPIP is not set
248# CONFIG_NET_IPGRE is not set
249# CONFIG_IP_MROUTE is not set
250# CONFIG_ARPD is not set
251# CONFIG_SYN_COOKIES is not set
252# CONFIG_INET_AH is not set
253# CONFIG_INET_ESP is not set
254# CONFIG_INET_IPCOMP is not set
255CONFIG_INET_TUNNEL=m
256CONFIG_INET_DIAG=y
257CONFIG_INET_TCP_DIAG=y
258# CONFIG_TCP_CONG_ADVANCED is not set
259CONFIG_TCP_CONG_BIC=y
260# CONFIG_IPV6 is not set
261# CONFIG_NETFILTER is not set
262
263#
264# DCCP Configuration (EXPERIMENTAL)
265#
266# CONFIG_IP_DCCP is not set
267
268#
269# SCTP Configuration (EXPERIMENTAL)
270#
271# CONFIG_IP_SCTP is not set
272# CONFIG_ATM is not set
273# CONFIG_BRIDGE is not set
274# CONFIG_VLAN_8021Q is not set
275# CONFIG_DECNET is not set
276# CONFIG_LLC2 is not set
277# CONFIG_IPX is not set
278# CONFIG_ATALK is not set
279# CONFIG_X25 is not set
280# CONFIG_LAPB is not set
281# CONFIG_NET_DIVERT is not set
282# CONFIG_ECONET is not set
283# CONFIG_WAN_ROUTER is not set
284# CONFIG_NET_SCHED is not set
285# CONFIG_NET_CLS_ROUTE 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
294CONFIG_IEEE80211=m
295# CONFIG_IEEE80211_DEBUG is not set
296CONFIG_IEEE80211_CRYPT_WEP=m
297CONFIG_IEEE80211_CRYPT_CCMP=m
298CONFIG_IEEE80211_CRYPT_TKIP=m
299
300#
164# Device Drivers 301# Device Drivers
165# 302#
166 303
@@ -169,7 +306,12 @@ CONFIG_TRAD_SIGNALS=y
169# 306#
170CONFIG_STANDALONE=y 307CONFIG_STANDALONE=y
171CONFIG_PREVENT_FIRMWARE_BUILD=y 308CONFIG_PREVENT_FIRMWARE_BUILD=y
172# CONFIG_FW_LOADER is not set 309CONFIG_FW_LOADER=y
310
311#
312# Connector - unified userspace <-> kernelspace linker
313#
314CONFIG_CONNECTOR=m
173 315
174# 316#
175# Memory Technology Devices (MTD) 317# Memory Technology Devices (MTD)
@@ -188,7 +330,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
188# 330#
189# Block devices 331# Block devices
190# 332#
191# CONFIG_BLK_DEV_FD is not set
192# CONFIG_BLK_CPQ_DA is not set 333# CONFIG_BLK_CPQ_DA is not set
193# CONFIG_BLK_CPQ_CISS_DA is not set 334# CONFIG_BLK_CPQ_CISS_DA is not set
194# CONFIG_BLK_DEV_DAC960 is not set 335# CONFIG_BLK_DEV_DAC960 is not set
@@ -197,13 +338,11 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
197# CONFIG_BLK_DEV_LOOP is not set 338# CONFIG_BLK_DEV_LOOP is not set
198# CONFIG_BLK_DEV_NBD is not set 339# CONFIG_BLK_DEV_NBD is not set
199# CONFIG_BLK_DEV_SX8 is not set 340# CONFIG_BLK_DEV_SX8 is not set
341# CONFIG_BLK_DEV_UB is not set
200# CONFIG_BLK_DEV_RAM is not set 342# CONFIG_BLK_DEV_RAM is not set
201CONFIG_BLK_DEV_RAM_COUNT=16 343CONFIG_BLK_DEV_RAM_COUNT=16
202CONFIG_INITRAMFS_SOURCE=""
203# CONFIG_LBD is not set 344# CONFIG_LBD is not set
204CONFIG_CDROM_PKTCDVD=m 345# CONFIG_CDROM_PKTCDVD is not set
205CONFIG_CDROM_PKTCDVD_BUFFERS=8
206# CONFIG_CDROM_PKTCDVD_WCACHE is not set
207 346
208# 347#
209# IO Schedulers 348# IO Schedulers
@@ -217,11 +356,35 @@ CONFIG_ATA_OVER_ETH=m
217# 356#
218# ATA/ATAPI/MFM/RLL support 357# ATA/ATAPI/MFM/RLL support
219# 358#
220# CONFIG_IDE is not set 359CONFIG_IDE=y
360CONFIG_BLK_DEV_IDE=y
361
362#
363# Please see Documentation/ide.txt for help/info on IDE drives
364#
365# CONFIG_BLK_DEV_IDE_SATA is not set
366CONFIG_BLK_DEV_IDEDISK=y
367# CONFIG_IDEDISK_MULTI_MODE is not set
368CONFIG_BLK_DEV_IDECS=m
369# CONFIG_BLK_DEV_IDECD is not set
370# CONFIG_BLK_DEV_IDETAPE is not set
371# CONFIG_BLK_DEV_IDEFLOPPY is not set
372# CONFIG_IDE_TASK_IOCTL is not set
373
374#
375# IDE chipset support/bugfixes
376#
377CONFIG_IDE_GENERIC=y
378# CONFIG_BLK_DEV_IDEPCI is not set
379# CONFIG_IDE_ARM is not set
380# CONFIG_BLK_DEV_IDEDMA is not set
381# CONFIG_IDEDMA_AUTO is not set
382# CONFIG_BLK_DEV_HD is not set
221 383
222# 384#
223# SCSI device support 385# SCSI device support
224# 386#
387# CONFIG_RAID_ATTRS is not set
225# CONFIG_SCSI is not set 388# CONFIG_SCSI is not set
226 389
227# 390#
@@ -232,6 +395,7 @@ CONFIG_ATA_OVER_ETH=m
232# 395#
233# Fusion MPT device support 396# Fusion MPT device support
234# 397#
398# CONFIG_FUSION is not set
235 399
236# 400#
237# IEEE 1394 (FireWire) support 401# IEEE 1394 (FireWire) support
@@ -244,79 +408,13 @@ CONFIG_ATA_OVER_ETH=m
244# CONFIG_I2O is not set 408# CONFIG_I2O is not set
245 409
246# 410#
247# Networking support 411# Network device support
248#
249CONFIG_NET=y
250
251#
252# Networking options
253#
254CONFIG_PACKET=y
255CONFIG_PACKET_MMAP=y
256CONFIG_NETLINK_DEV=y
257CONFIG_UNIX=y
258CONFIG_NET_KEY=y
259CONFIG_INET=y
260CONFIG_IP_MULTICAST=y
261# CONFIG_IP_ADVANCED_ROUTER is not set
262CONFIG_IP_PNP=y
263# CONFIG_IP_PNP_DHCP is not set
264CONFIG_IP_PNP_BOOTP=y
265# CONFIG_IP_PNP_RARP is not set
266# CONFIG_NET_IPIP is not set
267# CONFIG_NET_IPGRE is not set
268# CONFIG_IP_MROUTE is not set
269# CONFIG_ARPD is not set
270# CONFIG_SYN_COOKIES is not set
271# CONFIG_INET_AH is not set
272# CONFIG_INET_ESP is not set
273# CONFIG_INET_IPCOMP is not set
274CONFIG_INET_TUNNEL=m
275CONFIG_IP_TCPDIAG=m
276# CONFIG_IP_TCPDIAG_IPV6 is not set
277# CONFIG_IPV6 is not set
278# CONFIG_NETFILTER is not set
279CONFIG_XFRM=y
280CONFIG_XFRM_USER=m
281
282#
283# SCTP Configuration (EXPERIMENTAL)
284# 412#
285# CONFIG_IP_SCTP is not set
286# CONFIG_ATM is not set
287# CONFIG_BRIDGE is not set
288# CONFIG_VLAN_8021Q is not set
289# CONFIG_DECNET is not set
290# CONFIG_LLC2 is not set
291# CONFIG_IPX is not set
292# CONFIG_ATALK is not set
293# CONFIG_X25 is not set
294# CONFIG_LAPB is not set
295# CONFIG_NET_DIVERT is not set
296# CONFIG_ECONET is not set
297# CONFIG_WAN_ROUTER is not set
298
299#
300# QoS and/or fair queueing
301#
302# CONFIG_NET_SCHED is not set
303# CONFIG_NET_CLS_ROUTE is not set
304
305#
306# Network testing
307#
308# CONFIG_NET_PKTGEN is not set
309# CONFIG_NETPOLL is not set
310# CONFIG_NET_POLL_CONTROLLER is not set
311# CONFIG_HAMRADIO is not set
312# CONFIG_IRDA is not set
313# CONFIG_BT is not set
314CONFIG_NETDEVICES=y 413CONFIG_NETDEVICES=y
315# CONFIG_DUMMY is not set 414# CONFIG_DUMMY is not set
316# CONFIG_BONDING is not set 415# CONFIG_BONDING is not set
317# CONFIG_EQUALIZER is not set 416# CONFIG_EQUALIZER is not set
318# CONFIG_TUN is not set 417# CONFIG_TUN is not set
319# CONFIG_ETHERTAP is not set
320 418
321# 419#
322# ARCnet devices 420# ARCnet devices
@@ -324,20 +422,14 @@ CONFIG_NETDEVICES=y
324# CONFIG_ARCNET is not set 422# CONFIG_ARCNET is not set
325 423
326# 424#
327# Ethernet (10 or 100Mbit) 425# PHY device support
328# 426#
329CONFIG_NET_ETHERNET=y
330# CONFIG_MII is not set
331# CONFIG_HAPPYMEAL is not set
332# CONFIG_SUNGEM is not set
333# CONFIG_NET_VENDOR_3COM is not set
334 427
335# 428#
336# Tulip family network device support 429# Ethernet (10 or 100Mbit)
337# 430#
338# CONFIG_NET_TULIP is not set 431# CONFIG_NET_ETHERNET is not set
339# CONFIG_HP100 is not set 432CONFIG_MII=m
340# CONFIG_NET_PCI is not set
341 433
342# 434#
343# Ethernet (1000 Mbit) 435# Ethernet (1000 Mbit)
@@ -349,12 +441,16 @@ CONFIG_NET_ETHERNET=y
349# CONFIG_HAMACHI is not set 441# CONFIG_HAMACHI is not set
350# CONFIG_YELLOWFIN is not set 442# CONFIG_YELLOWFIN is not set
351# CONFIG_R8169 is not set 443# CONFIG_R8169 is not set
444# CONFIG_SIS190 is not set
445# CONFIG_SKGE is not set
352# CONFIG_SK98LIN is not set 446# CONFIG_SK98LIN is not set
353# CONFIG_TIGON3 is not set 447# CONFIG_TIGON3 is not set
448# CONFIG_BNX2 is not set
354 449
355# 450#
356# Ethernet (10000 Mbit) 451# Ethernet (10000 Mbit)
357# 452#
453# CONFIG_CHELSIO_T1 is not set
358# CONFIG_IXGB is not set 454# CONFIG_IXGB is not set
359# CONFIG_S2IO is not set 455# CONFIG_S2IO is not set
360 456
@@ -366,7 +462,59 @@ CONFIG_NET_ETHERNET=y
366# 462#
367# Wireless LAN (non-hamradio) 463# Wireless LAN (non-hamradio)
368# 464#
369# CONFIG_NET_RADIO is not set 465CONFIG_NET_RADIO=y
466
467#
468# Obsolete Wireless cards support (pre-802.11)
469#
470# CONFIG_STRIP is not set
471# CONFIG_PCMCIA_WAVELAN is not set
472# CONFIG_PCMCIA_NETWAVE is not set
473
474#
475# Wireless 802.11 Frequency Hopping cards support
476#
477# CONFIG_PCMCIA_RAYCS is not set
478
479#
480# Wireless 802.11b ISA/PCI cards support
481#
482# CONFIG_IPW2100 is not set
483# CONFIG_IPW2200 is not set
484CONFIG_HERMES=m
485# CONFIG_PLX_HERMES is not set
486# CONFIG_TMD_HERMES is not set
487# CONFIG_NORTEL_HERMES is not set
488# CONFIG_PCI_HERMES is not set
489# CONFIG_ATMEL is not set
490
491#
492# Wireless 802.11b Pcmcia/Cardbus cards support
493#
494CONFIG_PCMCIA_HERMES=m
495# CONFIG_PCMCIA_SPECTRUM is not set
496# CONFIG_AIRO_CS is not set
497# CONFIG_PCMCIA_WL3501 is not set
498
499#
500# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
501#
502# CONFIG_PRISM54 is not set
503# CONFIG_HOSTAP is not set
504CONFIG_NET_WIRELESS=y
505
506#
507# PCMCIA network device support
508#
509CONFIG_NET_PCMCIA=y
510CONFIG_PCMCIA_3C589=m
511CONFIG_PCMCIA_3C574=m
512CONFIG_PCMCIA_FMVJ18X=m
513CONFIG_PCMCIA_PCNET=m
514CONFIG_PCMCIA_NMCLAN=m
515CONFIG_PCMCIA_SMC91C92=m
516CONFIG_PCMCIA_XIRC2PS=m
517CONFIG_PCMCIA_AXNET=m
370 518
371# 519#
372# Wan interfaces 520# Wan interfaces
@@ -378,6 +526,8 @@ CONFIG_NET_ETHERNET=y
378# CONFIG_SLIP is not set 526# CONFIG_SLIP is not set
379# CONFIG_SHAPER is not set 527# CONFIG_SHAPER is not set
380# CONFIG_NETCONSOLE is not set 528# CONFIG_NETCONSOLE is not set
529# CONFIG_NETPOLL is not set
530# CONFIG_NET_POLL_CONTROLLER is not set
381 531
382# 532#
383# ISDN subsystem 533# ISDN subsystem
@@ -407,19 +557,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
407# CONFIG_INPUT_EVBUG is not set 557# CONFIG_INPUT_EVBUG is not set
408 558
409# 559#
410# Input I/O drivers
411#
412# CONFIG_GAMEPORT is not set
413CONFIG_SOUND_GAMEPORT=y
414CONFIG_SERIO=y
415CONFIG_SERIO_I8042=y
416CONFIG_SERIO_SERPORT=y
417# CONFIG_SERIO_CT82C710 is not set
418# CONFIG_SERIO_PCIPS2 is not set
419# CONFIG_SERIO_LIBPS2 is not set
420CONFIG_SERIO_RAW=m
421
422#
423# Input Device Drivers 560# Input Device Drivers
424# 561#
425# CONFIG_INPUT_KEYBOARD is not set 562# CONFIG_INPUT_KEYBOARD is not set
@@ -429,6 +566,17 @@ CONFIG_SERIO_RAW=m
429# CONFIG_INPUT_MISC is not set 566# CONFIG_INPUT_MISC is not set
430 567
431# 568#
569# Hardware I/O ports
570#
571CONFIG_SERIO=y
572# CONFIG_SERIO_I8042 is not set
573CONFIG_SERIO_SERPORT=y
574# CONFIG_SERIO_PCIPS2 is not set
575# CONFIG_SERIO_LIBPS2 is not set
576CONFIG_SERIO_RAW=m
577# CONFIG_GAMEPORT is not set
578
579#
432# Character devices 580# Character devices
433# 581#
434CONFIG_VT=y 582CONFIG_VT=y
@@ -439,16 +587,16 @@ CONFIG_HW_CONSOLE=y
439# 587#
440# Serial drivers 588# Serial drivers
441# 589#
442CONFIG_SERIAL_8250=y 590# CONFIG_SERIAL_8250 is not set
443CONFIG_SERIAL_8250_CONSOLE=y
444CONFIG_SERIAL_8250_NR_UARTS=4
445# CONFIG_SERIAL_8250_EXTENDED is not set
446 591
447# 592#
448# Non-8250 serial port support 593# Non-8250 serial port support
449# 594#
450CONFIG_SERIAL_CORE=y 595CONFIG_SERIAL_CORE=y
451CONFIG_SERIAL_CORE_CONSOLE=y 596CONFIG_SERIAL_CORE_CONSOLE=y
597CONFIG_SERIAL_VR41XX=y
598CONFIG_SERIAL_VR41XX_CONSOLE=y
599# CONFIG_SERIAL_JSM is not set
452CONFIG_UNIX98_PTYS=y 600CONFIG_UNIX98_PTYS=y
453CONFIG_LEGACY_PTYS=y 601CONFIG_LEGACY_PTYS=y
454CONFIG_LEGACY_PTY_COUNT=256 602CONFIG_LEGACY_PTY_COUNT=256
@@ -472,9 +620,20 @@ CONFIG_LEGACY_PTY_COUNT=256
472# Ftape, the floppy tape device driver 620# Ftape, the floppy tape device driver
473# 621#
474# CONFIG_DRM is not set 622# CONFIG_DRM is not set
623
624#
625# PCMCIA character devices
626#
627# CONFIG_SYNCLINK_CS is not set
628CONFIG_GPIO_VR41XX=y
475# CONFIG_RAW_DRIVER is not set 629# CONFIG_RAW_DRIVER is not set
476 630
477# 631#
632# TPM devices
633#
634# CONFIG_TCG_TPM is not set
635
636#
478# I2C support 637# I2C support
479# 638#
480# CONFIG_I2C is not set 639# CONFIG_I2C is not set
@@ -485,10 +644,20 @@ CONFIG_LEGACY_PTY_COUNT=256
485# CONFIG_W1 is not set 644# CONFIG_W1 is not set
486 645
487# 646#
647# Hardware Monitoring support
648#
649# CONFIG_HWMON is not set
650# CONFIG_HWMON_VID is not set
651
652#
488# Misc devices 653# Misc devices
489# 654#
490 655
491# 656#
657# Multimedia Capabilities Port drivers
658#
659
660#
492# Multimedia devices 661# Multimedia devices
493# 662#
494# CONFIG_VIDEO_DEV is not set 663# CONFIG_VIDEO_DEV is not set
@@ -508,7 +677,6 @@ CONFIG_LEGACY_PTY_COUNT=256
508# 677#
509# CONFIG_VGA_CONSOLE is not set 678# CONFIG_VGA_CONSOLE is not set
510CONFIG_DUMMY_CONSOLE=y 679CONFIG_DUMMY_CONSOLE=y
511# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
512 680
513# 681#
514# Sound 682# Sound
@@ -518,13 +686,120 @@ CONFIG_DUMMY_CONSOLE=y
518# 686#
519# USB support 687# USB support
520# 688#
521# CONFIG_USB is not set
522CONFIG_USB_ARCH_HAS_HCD=y 689CONFIG_USB_ARCH_HAS_HCD=y
523CONFIG_USB_ARCH_HAS_OHCI=y 690CONFIG_USB_ARCH_HAS_OHCI=y
691CONFIG_USB=m
692# CONFIG_USB_DEBUG is not set
693
694#
695# Miscellaneous USB options
696#
697CONFIG_USB_DEVICEFS=y
698# CONFIG_USB_BANDWIDTH is not set
699# CONFIG_USB_DYNAMIC_MINORS is not set
700# CONFIG_USB_OTG is not set
701
702#
703# USB Host Controller Drivers
704#
705# CONFIG_USB_EHCI_HCD is not set
706# CONFIG_USB_ISP116X_HCD is not set
707CONFIG_USB_OHCI_HCD=m
708# CONFIG_USB_OHCI_BIG_ENDIAN is not set
709CONFIG_USB_OHCI_LITTLE_ENDIAN=y
710# CONFIG_USB_UHCI_HCD is not set
711# CONFIG_USB_SL811_HCD is not set
712
713#
714# USB Device Class drivers
715#
716# CONFIG_USB_BLUETOOTH_TTY is not set
717# CONFIG_USB_ACM is not set
718# CONFIG_USB_PRINTER is not set
524 719
525# 720#
526# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information 721# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
527# 722#
723# CONFIG_USB_STORAGE is not set
724
725#
726# USB Input Devices
727#
728# CONFIG_USB_HID is not set
729
730#
731# USB HID Boot Protocol drivers
732#
733# CONFIG_USB_KBD is not set
734# CONFIG_USB_MOUSE is not set
735# CONFIG_USB_AIPTEK is not set
736# CONFIG_USB_WACOM is not set
737# CONFIG_USB_ACECAD is not set
738# CONFIG_USB_KBTAB is not set
739# CONFIG_USB_POWERMATE is not set
740# CONFIG_USB_MTOUCH is not set
741# CONFIG_USB_ITMTOUCH is not set
742# CONFIG_USB_EGALAX is not set
743# CONFIG_USB_YEALINK is not set
744# CONFIG_USB_XPAD is not set
745# CONFIG_USB_ATI_REMOTE is not set
746# CONFIG_USB_KEYSPAN_REMOTE is not set
747# CONFIG_USB_APPLETOUCH is not set
748
749#
750# USB Imaging devices
751#
752# CONFIG_USB_MDC800 is not set
753
754#
755# USB Multimedia devices
756#
757# CONFIG_USB_DABUSB is not set
758
759#
760# Video4Linux support is needed for USB Multimedia device support
761#
762
763#
764# USB Network Adapters
765#
766# CONFIG_USB_CATC is not set
767# CONFIG_USB_KAWETH is not set
768CONFIG_USB_PEGASUS=m
769# CONFIG_USB_RTL8150 is not set
770# CONFIG_USB_USBNET is not set
771# CONFIG_USB_ZD1201 is not set
772# CONFIG_USB_MON is not set
773
774#
775# USB port drivers
776#
777
778#
779# USB Serial Converter support
780#
781# CONFIG_USB_SERIAL is not set
782
783#
784# USB Miscellaneous drivers
785#
786# CONFIG_USB_EMI62 is not set
787# CONFIG_USB_EMI26 is not set
788# CONFIG_USB_AUERSWALD is not set
789# CONFIG_USB_RIO500 is not set
790# CONFIG_USB_LEGOTOWER is not set
791# CONFIG_USB_LCD is not set
792# CONFIG_USB_LED is not set
793# CONFIG_USB_CYTHERM is not set
794# CONFIG_USB_PHIDGETKIT is not set
795# CONFIG_USB_PHIDGETSERVO is not set
796# CONFIG_USB_IDMOUSE is not set
797# CONFIG_USB_LD is not set
798# CONFIG_USB_TEST is not set
799
800#
801# USB DSL modem support
802#
528 803
529# 804#
530# USB Gadget Support 805# USB Gadget Support
@@ -542,21 +817,29 @@ CONFIG_USB_ARCH_HAS_OHCI=y
542# CONFIG_INFINIBAND is not set 817# CONFIG_INFINIBAND is not set
543 818
544# 819#
820# SN Devices
821#
822
823#
545# File systems 824# File systems
546# 825#
547CONFIG_EXT2_FS=y 826CONFIG_EXT2_FS=y
548# CONFIG_EXT2_FS_XATTR is not set 827# CONFIG_EXT2_FS_XATTR is not set
828# CONFIG_EXT2_FS_XIP is not set
549# CONFIG_EXT3_FS is not set 829# CONFIG_EXT3_FS is not set
550# CONFIG_JBD is not set 830# CONFIG_JBD is not set
551# CONFIG_REISERFS_FS is not set 831# CONFIG_REISERFS_FS is not set
552# CONFIG_JFS_FS is not set 832# CONFIG_JFS_FS is not set
833# CONFIG_FS_POSIX_ACL is not set
553# CONFIG_XFS_FS is not set 834# CONFIG_XFS_FS is not set
554# CONFIG_MINIX_FS is not set 835# CONFIG_MINIX_FS is not set
555# CONFIG_ROMFS_FS is not set 836# CONFIG_ROMFS_FS is not set
837CONFIG_INOTIFY=y
556# CONFIG_QUOTA is not set 838# CONFIG_QUOTA is not set
557CONFIG_DNOTIFY=y 839CONFIG_DNOTIFY=y
558CONFIG_AUTOFS_FS=y 840CONFIG_AUTOFS_FS=y
559CONFIG_AUTOFS4_FS=y 841CONFIG_AUTOFS4_FS=y
842CONFIG_FUSE_FS=m
560 843
561# 844#
562# CD-ROM/DVD Filesystems 845# CD-ROM/DVD Filesystems
@@ -577,12 +860,10 @@ CONFIG_AUTOFS4_FS=y
577CONFIG_PROC_FS=y 860CONFIG_PROC_FS=y
578CONFIG_PROC_KCORE=y 861CONFIG_PROC_KCORE=y
579CONFIG_SYSFS=y 862CONFIG_SYSFS=y
580# CONFIG_DEVFS_FS is not set
581CONFIG_DEVPTS_FS_XATTR=y
582CONFIG_DEVPTS_FS_SECURITY=y
583# CONFIG_TMPFS is not set 863# CONFIG_TMPFS is not set
584# CONFIG_HUGETLB_PAGE is not set 864# CONFIG_HUGETLB_PAGE is not set
585CONFIG_RAMFS=y 865CONFIG_RAMFS=y
866CONFIG_RELAYFS_FS=m
586 867
587# 868#
588# Miscellaneous filesystems 869# Miscellaneous filesystems
@@ -609,9 +890,8 @@ CONFIG_NFS_FS=y
609# CONFIG_NFS_V4 is not set 890# CONFIG_NFS_V4 is not set
610# CONFIG_NFS_DIRECTIO is not set 891# CONFIG_NFS_DIRECTIO is not set
611# CONFIG_NFSD is not set 892# CONFIG_NFSD is not set
612CONFIG_ROOT_NFS=y
613CONFIG_LOCKD=y 893CONFIG_LOCKD=y
614# CONFIG_EXPORTFS is not set 894CONFIG_NFS_COMMON=y
615CONFIG_SUNRPC=y 895CONFIG_SUNRPC=y
616# CONFIG_RPCSEC_GSS_KRB5 is not set 896# CONFIG_RPCSEC_GSS_KRB5 is not set
617# CONFIG_RPCSEC_GSS_SPKM3 is not set 897# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -620,6 +900,7 @@ CONFIG_SUNRPC=y
620# CONFIG_NCP_FS is not set 900# CONFIG_NCP_FS is not set
621# CONFIG_CODA_FS is not set 901# CONFIG_CODA_FS is not set
622# CONFIG_AFS_FS is not set 902# CONFIG_AFS_FS is not set
903# CONFIG_9P_FS is not set
623 904
624# 905#
625# Partition Types 906# Partition Types
@@ -640,9 +921,11 @@ CONFIG_MSDOS_PARTITION=y
640# 921#
641# Kernel hacking 922# Kernel hacking
642# 923#
924# CONFIG_PRINTK_TIME is not set
643# CONFIG_DEBUG_KERNEL is not set 925# CONFIG_DEBUG_KERNEL is not set
926CONFIG_LOG_BUF_SHIFT=14
644CONFIG_CROSSCOMPILE=y 927CONFIG_CROSSCOMPILE=y
645CONFIG_CMDLINE="" 928CONFIG_CMDLINE="mem=32M console=ttyVR0,19200"
646 929
647# 930#
648# Security options 931# Security options
@@ -656,26 +939,27 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
656# 939#
657CONFIG_CRYPTO=y 940CONFIG_CRYPTO=y
658CONFIG_CRYPTO_HMAC=y 941CONFIG_CRYPTO_HMAC=y
659CONFIG_CRYPTO_NULL=y 942CONFIG_CRYPTO_NULL=m
660# CONFIG_CRYPTO_MD4 is not set 943CONFIG_CRYPTO_MD4=m
661# CONFIG_CRYPTO_MD5 is not set 944CONFIG_CRYPTO_MD5=m
662# CONFIG_CRYPTO_SHA1 is not set 945CONFIG_CRYPTO_SHA1=m
663# CONFIG_CRYPTO_SHA256 is not set 946CONFIG_CRYPTO_SHA256=m
664CONFIG_CRYPTO_SHA512=y 947CONFIG_CRYPTO_SHA512=m
665CONFIG_CRYPTO_WP512=m 948CONFIG_CRYPTO_WP512=m
666# CONFIG_CRYPTO_DES is not set 949CONFIG_CRYPTO_TGR192=m
667# CONFIG_CRYPTO_BLOWFISH is not set 950CONFIG_CRYPTO_DES=m
668CONFIG_CRYPTO_TWOFISH=y 951CONFIG_CRYPTO_BLOWFISH=m
669# CONFIG_CRYPTO_SERPENT is not set 952CONFIG_CRYPTO_TWOFISH=m
953CONFIG_CRYPTO_SERPENT=m
670CONFIG_CRYPTO_AES=m 954CONFIG_CRYPTO_AES=m
671# CONFIG_CRYPTO_CAST5 is not set 955CONFIG_CRYPTO_CAST5=m
672# CONFIG_CRYPTO_CAST6 is not set 956CONFIG_CRYPTO_CAST6=m
673CONFIG_CRYPTO_TEA=m 957CONFIG_CRYPTO_TEA=m
674# CONFIG_CRYPTO_ARC4 is not set 958CONFIG_CRYPTO_ARC4=m
675CONFIG_CRYPTO_KHAZAD=m 959CONFIG_CRYPTO_KHAZAD=m
676CONFIG_CRYPTO_ANUBIS=m 960CONFIG_CRYPTO_ANUBIS=m
677CONFIG_CRYPTO_DEFLATE=y 961CONFIG_CRYPTO_DEFLATE=m
678CONFIG_CRYPTO_MICHAEL_MIC=y 962CONFIG_CRYPTO_MICHAEL_MIC=m
679CONFIG_CRYPTO_CRC32C=m 963CONFIG_CRYPTO_CRC32C=m
680# CONFIG_CRYPTO_TEST is not set 964# CONFIG_CRYPTO_TEST is not set
681 965
@@ -687,9 +971,8 @@ CONFIG_CRYPTO_CRC32C=m
687# Library routines 971# Library routines
688# 972#
689# CONFIG_CRC_CCITT is not set 973# CONFIG_CRC_CCITT is not set
690# CONFIG_CRC32 is not set 974CONFIG_CRC16=m
975CONFIG_CRC32=y
691CONFIG_LIBCRC32C=m 976CONFIG_LIBCRC32C=m
692CONFIG_ZLIB_INFLATE=y 977CONFIG_ZLIB_INFLATE=m
693CONFIG_ZLIB_DEFLATE=y 978CONFIG_ZLIB_DEFLATE=m
694CONFIG_GENERIC_HARDIRQS=y
695CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/ocelot_3_defconfig b/arch/mips/configs/ocelot_3_defconfig
index b4cf97a732bc..ffb23fcab862 100644
--- a/arch/mips/configs/ocelot_3_defconfig
+++ b/arch/mips/configs/ocelot_3_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:07 2005 4# Thu Oct 20 22:26:30 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,25 +11,30 @@ CONFIG_32BIT=y
14CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
25# CONFIG_BSD_PROCESS_ACCT is not set 24# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y 25CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set 26# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14 27CONFIG_HOTPLUG=y
29# CONFIG_HOTPLUG is not set
30CONFIG_KOBJECT_UEVENT=y 28CONFIG_KOBJECT_UEVENT=y
31CONFIG_IKCONFIG=y 29CONFIG_IKCONFIG=y
32CONFIG_IKCONFIG_PROC=y 30CONFIG_IKCONFIG_PROC=y
31CONFIG_INITRAMFS_SOURCE=""
33CONFIG_EMBEDDED=y 32CONFIG_EMBEDDED=y
34CONFIG_KALLSYMS=y 33CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_EXTRA_PASS is not set 34# CONFIG_KALLSYMS_EXTRA_PASS is not set
35CONFIG_PRINTK=y
36CONFIG_BUG=y
37CONFIG_BASE_FULL=y
36CONFIG_FUTEX=y 38CONFIG_FUTEX=y
37CONFIG_EPOLL=y 39CONFIG_EPOLL=y
38# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 40# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -42,6 +44,7 @@ CONFIG_CC_ALIGN_LABELS=0
42CONFIG_CC_ALIGN_LOOPS=0 44CONFIG_CC_ALIGN_LOOPS=0
43CONFIG_CC_ALIGN_JUMPS=0 45CONFIG_CC_ALIGN_JUMPS=0
44# CONFIG_TINY_SHMEM is not set 46# CONFIG_TINY_SHMEM is not set
47CONFIG_BASE_SMALL=0
45 48
46# 49#
47# Loadable module support 50# Loadable module support
@@ -57,40 +60,68 @@ CONFIG_KMOD=y
57# 60#
58# Machine selection 61# Machine selection
59# 62#
60# CONFIG_MACH_JAZZ is not set 63# CONFIG_MIPS_MTX1 is not set
61# CONFIG_MACH_VR41XX is not set 64# CONFIG_MIPS_BOSPORUS is not set
62# CONFIG_TOSHIBA_JMR3927 is not set 65# CONFIG_MIPS_PB1000 is not set
66# CONFIG_MIPS_PB1100 is not set
67# CONFIG_MIPS_PB1500 is not set
68# CONFIG_MIPS_PB1550 is not set
69# CONFIG_MIPS_PB1200 is not set
70# CONFIG_MIPS_DB1000 is not set
71# CONFIG_MIPS_DB1100 is not set
72# CONFIG_MIPS_DB1500 is not set
73# CONFIG_MIPS_DB1550 is not set
74# CONFIG_MIPS_DB1200 is not set
75# CONFIG_MIPS_MIRAGE is not set
63# CONFIG_MIPS_COBALT is not set 76# CONFIG_MIPS_COBALT is not set
64# CONFIG_MACH_DECSTATION is not set 77# CONFIG_MACH_DECSTATION is not set
65# CONFIG_MIPS_EV64120 is not set 78# CONFIG_MIPS_EV64120 is not set
66# CONFIG_MIPS_EV96100 is not set 79# CONFIG_MIPS_EV96100 is not set
67# CONFIG_MIPS_IVR is not set 80# CONFIG_MIPS_IVR is not set
68# CONFIG_LASAT is not set
69# CONFIG_MIPS_ITE8172 is not set 81# CONFIG_MIPS_ITE8172 is not set
82# CONFIG_MACH_JAZZ is not set
83# CONFIG_LASAT is not set
70# CONFIG_MIPS_ATLAS is not set 84# CONFIG_MIPS_ATLAS is not set
71# CONFIG_MIPS_MALTA is not set 85# CONFIG_MIPS_MALTA is not set
72# CONFIG_MIPS_SEAD is not set 86# CONFIG_MIPS_SEAD is not set
87# CONFIG_MIPS_SIM is not set
88# CONFIG_MOMENCO_JAGUAR_ATX is not set
73# CONFIG_MOMENCO_OCELOT is not set 89# CONFIG_MOMENCO_OCELOT is not set
74# CONFIG_MOMENCO_OCELOT_G is not set
75# CONFIG_MOMENCO_OCELOT_C is not set
76CONFIG_MOMENCO_OCELOT_3=y 90CONFIG_MOMENCO_OCELOT_3=y
77# CONFIG_MOMENCO_JAGUAR_ATX is not set 91# CONFIG_MOMENCO_OCELOT_C is not set
78# CONFIG_PMC_YOSEMITE is not set 92# CONFIG_MOMENCO_OCELOT_G is not set
93# CONFIG_MIPS_XXS1500 is not set
94# CONFIG_PNX8550_V2PCI is not set
95# CONFIG_PNX8550_JBS is not set
79# CONFIG_DDB5074 is not set 96# CONFIG_DDB5074 is not set
80# CONFIG_DDB5476 is not set 97# CONFIG_DDB5476 is not set
81# CONFIG_DDB5477 is not set 98# CONFIG_DDB5477 is not set
82# CONFIG_NEC_OSPREY is not set 99# CONFIG_MACH_VR41XX is not set
100# CONFIG_PMC_YOSEMITE is not set
101# CONFIG_QEMU is not set
83# CONFIG_SGI_IP22 is not set 102# CONFIG_SGI_IP22 is not set
84# CONFIG_SOC_AU1X00 is not set 103# CONFIG_SGI_IP27 is not set
85# CONFIG_SIBYTE_SB1xxx_SOC is not set 104# CONFIG_SGI_IP32 is not set
105# CONFIG_SIBYTE_BIGSUR is not set
106# CONFIG_SIBYTE_SWARM is not set
107# CONFIG_SIBYTE_SENTOSA is not set
108# CONFIG_SIBYTE_RHONE is not set
109# CONFIG_SIBYTE_CARMEL is not set
110# CONFIG_SIBYTE_PTSWARM is not set
111# CONFIG_SIBYTE_LITTLESUR is not set
112# CONFIG_SIBYTE_CRHINE is not set
113# CONFIG_SIBYTE_CRHONE is not set
86# CONFIG_SNI_RM200_PCI is not set 114# CONFIG_SNI_RM200_PCI is not set
115# CONFIG_TOSHIBA_JMR3927 is not set
87# CONFIG_TOSHIBA_RBTX4927 is not set 116# CONFIG_TOSHIBA_RBTX4927 is not set
117# CONFIG_TOSHIBA_RBTX4938 is not set
88CONFIG_RWSEM_GENERIC_SPINLOCK=y 118CONFIG_RWSEM_GENERIC_SPINLOCK=y
89CONFIG_GENERIC_CALIBRATE_DELAY=y 119CONFIG_GENERIC_CALIBRATE_DELAY=y
90CONFIG_HAVE_DEC_LOCK=y
91CONFIG_DMA_NONCOHERENT=y 120CONFIG_DMA_NONCOHERENT=y
92CONFIG_DMA_NEED_PCI_MAP_STATE=y 121CONFIG_DMA_NEED_PCI_MAP_STATE=y
122CONFIG_CPU_BIG_ENDIAN=y
93# CONFIG_CPU_LITTLE_ENDIAN is not set 123# CONFIG_CPU_LITTLE_ENDIAN is not set
124CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
94CONFIG_IRQ_CPU=y 125CONFIG_IRQ_CPU=y
95CONFIG_IRQ_CPU_RM7K=y 126CONFIG_IRQ_CPU_RM7K=y
96CONFIG_IRQ_MV64340=y 127CONFIG_IRQ_MV64340=y
@@ -102,8 +133,10 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
102# 133#
103# CPU selection 134# CPU selection
104# 135#
105# CONFIG_CPU_MIPS32 is not set 136# CONFIG_CPU_MIPS32_R1 is not set
106# CONFIG_CPU_MIPS64 is not set 137# CONFIG_CPU_MIPS32_R2 is not set
138# CONFIG_CPU_MIPS64_R1 is not set
139# CONFIG_CPU_MIPS64_R2 is not set
107# CONFIG_CPU_R3000 is not set 140# CONFIG_CPU_R3000 is not set
108# CONFIG_CPU_TX39XX is not set 141# CONFIG_CPU_TX39XX is not set
109# CONFIG_CPU_VR41XX is not set 142# CONFIG_CPU_VR41XX is not set
@@ -119,6 +152,17 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
119# CONFIG_CPU_RM7000 is not set 152# CONFIG_CPU_RM7000 is not set
120CONFIG_CPU_RM9000=y 153CONFIG_CPU_RM9000=y
121# CONFIG_CPU_SB1 is not set 154# CONFIG_CPU_SB1 is not set
155CONFIG_SYS_HAS_CPU_RM9000=y
156CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
157CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
158CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
159CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
160
161#
162# Kernel type
163#
164CONFIG_32BIT=y
165# CONFIG_64BIT is not set
122CONFIG_PAGE_SIZE_4KB=y 166CONFIG_PAGE_SIZE_4KB=y
123# CONFIG_PAGE_SIZE_8KB is not set 167# CONFIG_PAGE_SIZE_8KB is not set
124# CONFIG_PAGE_SIZE_16KB is not set 168# CONFIG_PAGE_SIZE_16KB is not set
@@ -126,13 +170,26 @@ CONFIG_PAGE_SIZE_4KB=y
126CONFIG_BOARD_SCACHE=y 170CONFIG_BOARD_SCACHE=y
127CONFIG_RM7000_CPU_SCACHE=y 171CONFIG_RM7000_CPU_SCACHE=y
128CONFIG_CPU_HAS_PREFETCH=y 172CONFIG_CPU_HAS_PREFETCH=y
173# CONFIG_MIPS_MT is not set
129# CONFIG_64BIT_PHYS_ADDR is not set 174# CONFIG_64BIT_PHYS_ADDR is not set
130# CONFIG_CPU_ADVANCED is not set 175# CONFIG_CPU_ADVANCED is not set
131CONFIG_CPU_HAS_LLSC=y 176CONFIG_CPU_HAS_LLSC=y
132CONFIG_CPU_HAS_LLDSCD=y 177CONFIG_CPU_HAS_LLDSCD=y
133CONFIG_CPU_HAS_SYNC=y 178CONFIG_CPU_HAS_SYNC=y
134# CONFIG_HIGHMEM is not set 179CONFIG_GENERIC_HARDIRQS=y
180CONFIG_GENERIC_IRQ_PROBE=y
181CONFIG_CPU_SUPPORTS_HIGHMEM=y
182CONFIG_ARCH_FLATMEM_ENABLE=y
183CONFIG_SELECT_MEMORY_MODEL=y
184CONFIG_FLATMEM_MANUAL=y
185# CONFIG_DISCONTIGMEM_MANUAL is not set
186# CONFIG_SPARSEMEM_MANUAL is not set
187CONFIG_FLATMEM=y
188CONFIG_FLAT_NODE_MEM_MAP=y
189# CONFIG_SPARSEMEM_STATIC is not set
135# CONFIG_SMP is not set 190# CONFIG_SMP is not set
191CONFIG_PREEMPT_NONE=y
192# CONFIG_PREEMPT_VOLUNTARY is not set
136# CONFIG_PREEMPT is not set 193# CONFIG_PREEMPT is not set
137 194
138# 195#
@@ -141,7 +198,6 @@ CONFIG_CPU_HAS_SYNC=y
141CONFIG_HW_HAS_PCI=y 198CONFIG_HW_HAS_PCI=y
142CONFIG_PCI=y 199CONFIG_PCI=y
143CONFIG_PCI_LEGACY_PROC=y 200CONFIG_PCI_LEGACY_PROC=y
144CONFIG_PCI_NAMES=y
145CONFIG_MMU=y 201CONFIG_MMU=y
146 202
147# 203#
@@ -150,10 +206,6 @@ CONFIG_MMU=y
150# CONFIG_PCCARD is not set 206# CONFIG_PCCARD is not set
151 207
152# 208#
153# PC-card bridges
154#
155
156#
157# PCI Hotplug Support 209# PCI Hotplug Support
158# 210#
159# CONFIG_HOTPLUG_PCI is not set 211# CONFIG_HOTPLUG_PCI is not set
@@ -166,6 +218,110 @@ CONFIG_BINFMT_ELF=y
166CONFIG_TRAD_SIGNALS=y 218CONFIG_TRAD_SIGNALS=y
167 219
168# 220#
221# Networking
222#
223CONFIG_NET=y
224
225#
226# Networking options
227#
228CONFIG_PACKET=y
229# CONFIG_PACKET_MMAP is not set
230CONFIG_UNIX=y
231CONFIG_XFRM=y
232# CONFIG_XFRM_USER is not set
233CONFIG_NET_KEY=y
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_TUNNEL is not set
250CONFIG_INET_DIAG=y
251CONFIG_INET_TCP_DIAG=y
252# CONFIG_TCP_CONG_ADVANCED is not set
253CONFIG_TCP_CONG_BIC=y
254
255#
256# IP: Virtual Server Configuration
257#
258# CONFIG_IP_VS is not set
259CONFIG_IPV6=m
260# CONFIG_IPV6_PRIVACY is not set
261# CONFIG_INET6_AH is not set
262# CONFIG_INET6_ESP is not set
263# CONFIG_INET6_IPCOMP is not set
264# CONFIG_INET6_TUNNEL is not set
265# CONFIG_IPV6_TUNNEL is not set
266CONFIG_NETFILTER=y
267# CONFIG_NETFILTER_DEBUG is not set
268CONFIG_NETFILTER_NETLINK=m
269CONFIG_NETFILTER_NETLINK_QUEUE=m
270CONFIG_NETFILTER_NETLINK_LOG=m
271
272#
273# IP: Netfilter Configuration
274#
275# CONFIG_IP_NF_CONNTRACK is not set
276CONFIG_IP_NF_PPTP=m
277# CONFIG_IP_NF_QUEUE is not set
278# CONFIG_IP_NF_IPTABLES is not set
279# CONFIG_IP_NF_ARPTABLES is not set
280
281#
282# IPv6: Netfilter Configuration (EXPERIMENTAL)
283#
284# CONFIG_IP6_NF_QUEUE is not set
285# CONFIG_IP6_NF_IPTABLES is not set
286
287#
288# DCCP Configuration (EXPERIMENTAL)
289#
290# CONFIG_IP_DCCP is not set
291
292#
293# SCTP Configuration (EXPERIMENTAL)
294#
295# CONFIG_IP_SCTP is not set
296# CONFIG_ATM is not set
297# CONFIG_BRIDGE is not set
298# CONFIG_VLAN_8021Q is not set
299# CONFIG_DECNET is not set
300# CONFIG_LLC2 is not set
301# CONFIG_IPX is not set
302# CONFIG_ATALK is not set
303# CONFIG_X25 is not set
304# CONFIG_LAPB is not set
305# CONFIG_NET_DIVERT is not set
306# CONFIG_ECONET is not set
307# CONFIG_WAN_ROUTER is not set
308# CONFIG_NET_SCHED is not set
309# CONFIG_NET_CLS_ROUTE is not set
310
311#
312# Network testing
313#
314# CONFIG_NET_PKTGEN is not set
315# CONFIG_HAMRADIO is not set
316# CONFIG_IRDA is not set
317# CONFIG_BT is not set
318CONFIG_IEEE80211=m
319# CONFIG_IEEE80211_DEBUG is not set
320CONFIG_IEEE80211_CRYPT_WEP=m
321CONFIG_IEEE80211_CRYPT_CCMP=m
322CONFIG_IEEE80211_CRYPT_TKIP=m
323
324#
169# Device Drivers 325# Device Drivers
170# 326#
171 327
@@ -174,7 +330,12 @@ CONFIG_TRAD_SIGNALS=y
174# 330#
175CONFIG_STANDALONE=y 331CONFIG_STANDALONE=y
176CONFIG_PREVENT_FIRMWARE_BUILD=y 332CONFIG_PREVENT_FIRMWARE_BUILD=y
177# CONFIG_FW_LOADER is not set 333CONFIG_FW_LOADER=m
334
335#
336# Connector - unified userspace <-> kernelspace linker
337#
338CONFIG_CONNECTOR=m
178 339
179# 340#
180# Memory Technology Devices (MTD) 341# Memory Technology Devices (MTD)
@@ -193,7 +354,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
193# 354#
194# Block devices 355# Block devices
195# 356#
196# CONFIG_BLK_DEV_FD is not set
197# CONFIG_BLK_CPQ_DA is not set 357# CONFIG_BLK_CPQ_DA is not set
198# CONFIG_BLK_CPQ_CISS_DA is not set 358# CONFIG_BLK_CPQ_CISS_DA is not set
199# CONFIG_BLK_DEV_DAC960 is not set 359# CONFIG_BLK_DEV_DAC960 is not set
@@ -205,7 +365,6 @@ CONFIG_BLK_DEV_LOOP=y
205# CONFIG_BLK_DEV_SX8 is not set 365# CONFIG_BLK_DEV_SX8 is not set
206# CONFIG_BLK_DEV_RAM is not set 366# CONFIG_BLK_DEV_RAM is not set
207CONFIG_BLK_DEV_RAM_COUNT=16 367CONFIG_BLK_DEV_RAM_COUNT=16
208CONFIG_INITRAMFS_SOURCE=""
209# CONFIG_LBD is not set 368# CONFIG_LBD is not set
210# CONFIG_CDROM_PKTCDVD is not set 369# CONFIG_CDROM_PKTCDVD is not set
211 370
@@ -226,6 +385,7 @@ CONFIG_ATA_OVER_ETH=m
226# 385#
227# SCSI device support 386# SCSI device support
228# 387#
388CONFIG_RAID_ATTRS=m
229CONFIG_SCSI=m 389CONFIG_SCSI=m
230CONFIG_SCSI_PROC_FS=y 390CONFIG_SCSI_PROC_FS=y
231 391
@@ -237,6 +397,7 @@ CONFIG_SCSI_PROC_FS=y
237# CONFIG_CHR_DEV_OSST is not set 397# CONFIG_CHR_DEV_OSST is not set
238# CONFIG_BLK_DEV_SR is not set 398# CONFIG_BLK_DEV_SR is not set
239# CONFIG_CHR_DEV_SG is not set 399# CONFIG_CHR_DEV_SG is not set
400# CONFIG_CHR_DEV_SCH is not set
240 401
241# 402#
242# Some SCSI devices (e.g. CD jukebox) support multiple LUNs 403# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
@@ -251,6 +412,7 @@ CONFIG_SCSI_PROC_FS=y
251# CONFIG_SCSI_SPI_ATTRS is not set 412# CONFIG_SCSI_SPI_ATTRS is not set
252# CONFIG_SCSI_FC_ATTRS is not set 413# CONFIG_SCSI_FC_ATTRS is not set
253# CONFIG_SCSI_ISCSI_ATTRS is not set 414# CONFIG_SCSI_ISCSI_ATTRS is not set
415CONFIG_SCSI_SAS_ATTRS=m
254 416
255# 417#
256# SCSI low-level drivers 418# SCSI low-level drivers
@@ -266,18 +428,13 @@ CONFIG_SCSI_PROC_FS=y
266# CONFIG_MEGARAID_NEWGEN is not set 428# CONFIG_MEGARAID_NEWGEN is not set
267# CONFIG_MEGARAID_LEGACY is not set 429# CONFIG_MEGARAID_LEGACY is not set
268# CONFIG_SCSI_SATA is not set 430# CONFIG_SCSI_SATA is not set
269# CONFIG_SCSI_BUSLOGIC is not set
270# CONFIG_SCSI_DMX3191D is not set 431# CONFIG_SCSI_DMX3191D is not set
271# CONFIG_SCSI_EATA is not set
272# CONFIG_SCSI_EATA_PIO is not set
273# CONFIG_SCSI_FUTURE_DOMAIN is not set 432# CONFIG_SCSI_FUTURE_DOMAIN is not set
274# CONFIG_SCSI_GDTH is not set
275# CONFIG_SCSI_IPS is not set 433# CONFIG_SCSI_IPS is not set
276# CONFIG_SCSI_INITIO is not set 434# CONFIG_SCSI_INITIO is not set
277# CONFIG_SCSI_INIA100 is not set 435# CONFIG_SCSI_INIA100 is not set
278# CONFIG_SCSI_SYM53C8XX_2 is not set 436# CONFIG_SCSI_SYM53C8XX_2 is not set
279# CONFIG_SCSI_IPR is not set 437# CONFIG_SCSI_IPR is not set
280# CONFIG_SCSI_QLOGIC_ISP is not set
281# CONFIG_SCSI_QLOGIC_FC is not set 438# CONFIG_SCSI_QLOGIC_FC is not set
282# CONFIG_SCSI_QLOGIC_1280 is not set 439# CONFIG_SCSI_QLOGIC_1280 is not set
283CONFIG_SCSI_QLA2XXX=m 440CONFIG_SCSI_QLA2XXX=m
@@ -286,6 +443,8 @@ CONFIG_SCSI_QLA2XXX=m
286# CONFIG_SCSI_QLA2300 is not set 443# CONFIG_SCSI_QLA2300 is not set
287# CONFIG_SCSI_QLA2322 is not set 444# CONFIG_SCSI_QLA2322 is not set
288# CONFIG_SCSI_QLA6312 is not set 445# CONFIG_SCSI_QLA6312 is not set
446# CONFIG_SCSI_QLA24XX is not set
447# CONFIG_SCSI_LPFC is not set
289# CONFIG_SCSI_DC395x is not set 448# CONFIG_SCSI_DC395x is not set
290# CONFIG_SCSI_DC390T is not set 449# CONFIG_SCSI_DC390T is not set
291# CONFIG_SCSI_NSP32 is not set 450# CONFIG_SCSI_NSP32 is not set
@@ -300,6 +459,8 @@ CONFIG_SCSI_QLA2XXX=m
300# Fusion MPT device support 459# Fusion MPT device support
301# 460#
302# CONFIG_FUSION is not set 461# CONFIG_FUSION is not set
462# CONFIG_FUSION_SPI is not set
463# CONFIG_FUSION_FC is not set
303 464
304# 465#
305# IEEE 1394 (FireWire) support 466# IEEE 1394 (FireWire) support
@@ -312,105 +473,13 @@ CONFIG_SCSI_QLA2XXX=m
312# CONFIG_I2O is not set 473# CONFIG_I2O is not set
313 474
314# 475#
315# Networking support 476# Network device support
316#
317CONFIG_NET=y
318
319#
320# Networking options
321#
322CONFIG_PACKET=y
323# CONFIG_PACKET_MMAP is not set
324CONFIG_NETLINK_DEV=y
325CONFIG_UNIX=y
326CONFIG_NET_KEY=y
327CONFIG_INET=y
328# CONFIG_IP_MULTICAST is not set
329# CONFIG_IP_ADVANCED_ROUTER is not set
330CONFIG_IP_PNP=y
331CONFIG_IP_PNP_DHCP=y
332CONFIG_IP_PNP_BOOTP=y
333# CONFIG_IP_PNP_RARP is not set
334# CONFIG_NET_IPIP is not set
335# CONFIG_NET_IPGRE is not set
336# CONFIG_ARPD is not set
337# CONFIG_SYN_COOKIES is not set
338# CONFIG_INET_AH is not set
339# CONFIG_INET_ESP is not set
340# CONFIG_INET_IPCOMP is not set
341# CONFIG_INET_TUNNEL is not set
342CONFIG_IP_TCPDIAG=m
343CONFIG_IP_TCPDIAG_IPV6=y
344
345#
346# IP: Virtual Server Configuration
347#
348# CONFIG_IP_VS is not set
349CONFIG_IPV6=m
350# CONFIG_IPV6_PRIVACY is not set
351# CONFIG_INET6_AH is not set
352# CONFIG_INET6_ESP is not set
353# CONFIG_INET6_IPCOMP is not set
354# CONFIG_INET6_TUNNEL is not set
355# CONFIG_IPV6_TUNNEL is not set
356CONFIG_NETFILTER=y
357# CONFIG_NETFILTER_DEBUG is not set
358
359#
360# IP: Netfilter Configuration
361#
362# CONFIG_IP_NF_CONNTRACK is not set
363# CONFIG_IP_NF_CONNTRACK_MARK is not set
364# CONFIG_IP_NF_QUEUE is not set
365# CONFIG_IP_NF_IPTABLES is not set
366# CONFIG_IP_NF_ARPTABLES is not set
367
368#
369# IPv6: Netfilter Configuration
370#
371# CONFIG_IP6_NF_QUEUE is not set
372# CONFIG_IP6_NF_IPTABLES is not set
373CONFIG_XFRM=y
374# CONFIG_XFRM_USER is not set
375
376#
377# SCTP Configuration (EXPERIMENTAL)
378#
379# CONFIG_IP_SCTP is not set
380# CONFIG_ATM is not set
381# CONFIG_BRIDGE is not set
382# CONFIG_VLAN_8021Q is not set
383# CONFIG_DECNET is not set
384# CONFIG_LLC2 is not set
385# CONFIG_IPX is not set
386# CONFIG_ATALK 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
393#
394# QoS and/or fair queueing
395#
396# CONFIG_NET_SCHED is not set
397# CONFIG_NET_CLS_ROUTE is not set
398
399#
400# Network testing
401# 477#
402# CONFIG_NET_PKTGEN is not set
403# CONFIG_NETPOLL is not set
404# CONFIG_NET_POLL_CONTROLLER is not set
405# CONFIG_HAMRADIO is not set
406# CONFIG_IRDA is not set
407# CONFIG_BT is not set
408CONFIG_NETDEVICES=y 478CONFIG_NETDEVICES=y
409# CONFIG_DUMMY is not set 479# CONFIG_DUMMY is not set
410# CONFIG_BONDING is not set 480# CONFIG_BONDING is not set
411# CONFIG_EQUALIZER is not set 481# CONFIG_EQUALIZER is not set
412CONFIG_TUN=m 482CONFIG_TUN=m
413# CONFIG_ETHERTAP is not set
414 483
415# 484#
416# ARCnet devices 485# ARCnet devices
@@ -418,6 +487,21 @@ CONFIG_TUN=m
418# CONFIG_ARCNET is not set 487# CONFIG_ARCNET is not set
419 488
420# 489#
490# PHY device support
491#
492CONFIG_PHYLIB=m
493CONFIG_PHYCONTROL=y
494
495#
496# MII PHY device drivers
497#
498CONFIG_MARVELL_PHY=m
499CONFIG_DAVICOM_PHY=m
500CONFIG_QSEMI_PHY=m
501CONFIG_LXT_PHY=m
502CONFIG_CICADA_PHY=m
503
504#
421# Ethernet (10 or 100Mbit) 505# Ethernet (10 or 100Mbit)
422# 506#
423CONFIG_NET_ETHERNET=y 507CONFIG_NET_ETHERNET=y
@@ -440,7 +524,6 @@ CONFIG_NET_PCI=y
440# CONFIG_DGRS is not set 524# CONFIG_DGRS is not set
441# CONFIG_EEPRO100 is not set 525# CONFIG_EEPRO100 is not set
442CONFIG_E100=y 526CONFIG_E100=y
443# CONFIG_E100_NAPI is not set
444# CONFIG_FEALNX is not set 527# CONFIG_FEALNX is not set
445# CONFIG_NATSEMI is not set 528# CONFIG_NATSEMI is not set
446# CONFIG_NE2K_PCI is not set 529# CONFIG_NE2K_PCI is not set
@@ -463,9 +546,12 @@ CONFIG_E100=y
463# CONFIG_HAMACHI is not set 546# CONFIG_HAMACHI is not set
464# CONFIG_YELLOWFIN is not set 547# CONFIG_YELLOWFIN is not set
465# CONFIG_R8169 is not set 548# CONFIG_R8169 is not set
549# CONFIG_SIS190 is not set
550# CONFIG_SKGE is not set
466# CONFIG_SK98LIN is not set 551# CONFIG_SK98LIN is not set
467# CONFIG_VIA_VELOCITY is not set 552# CONFIG_VIA_VELOCITY is not set
468# CONFIG_TIGON3 is not set 553# CONFIG_TIGON3 is not set
554# CONFIG_BNX2 is not set
469CONFIG_MV643XX_ETH=y 555CONFIG_MV643XX_ETH=y
470CONFIG_MV643XX_ETH_0=y 556CONFIG_MV643XX_ETH_0=y
471CONFIG_MV643XX_ETH_1=y 557CONFIG_MV643XX_ETH_1=y
@@ -474,6 +560,7 @@ CONFIG_MV643XX_ETH_2=y
474# 560#
475# Ethernet (10000 Mbit) 561# Ethernet (10000 Mbit)
476# 562#
563# CONFIG_CHELSIO_T1 is not set
477# CONFIG_IXGB is not set 564# CONFIG_IXGB is not set
478# CONFIG_S2IO is not set 565# CONFIG_S2IO is not set
479 566
@@ -486,6 +573,8 @@ CONFIG_MV643XX_ETH_2=y
486# Wireless LAN (non-hamradio) 573# Wireless LAN (non-hamradio)
487# 574#
488# CONFIG_NET_RADIO is not set 575# CONFIG_NET_RADIO is not set
576# CONFIG_IPW_DEBUG is not set
577CONFIG_IPW2200=m
489 578
490# 579#
491# Wan interfaces 580# Wan interfaces
@@ -505,6 +594,8 @@ CONFIG_PPPOE=m
505# CONFIG_NET_FC is not set 594# CONFIG_NET_FC is not set
506# CONFIG_SHAPER is not set 595# CONFIG_SHAPER is not set
507# CONFIG_NETCONSOLE is not set 596# CONFIG_NETCONSOLE is not set
597# CONFIG_NETPOLL is not set
598# CONFIG_NET_POLL_CONTROLLER is not set
508 599
509# 600#
510# ISDN subsystem 601# ISDN subsystem
@@ -531,19 +622,6 @@ CONFIG_INPUT=y
531# CONFIG_INPUT_EVBUG is not set 622# CONFIG_INPUT_EVBUG is not set
532 623
533# 624#
534# Input I/O drivers
535#
536# CONFIG_GAMEPORT is not set
537CONFIG_SOUND_GAMEPORT=y
538CONFIG_SERIO=y
539# CONFIG_SERIO_I8042 is not set
540# CONFIG_SERIO_SERPORT is not set
541# CONFIG_SERIO_CT82C710 is not set
542# CONFIG_SERIO_PCIPS2 is not set
543# CONFIG_SERIO_LIBPS2 is not set
544# CONFIG_SERIO_RAW is not set
545
546#
547# Input Device Drivers 625# Input Device Drivers
548# 626#
549# CONFIG_INPUT_KEYBOARD is not set 627# CONFIG_INPUT_KEYBOARD is not set
@@ -553,6 +631,17 @@ CONFIG_SERIO=y
553# CONFIG_INPUT_MISC is not set 631# CONFIG_INPUT_MISC is not set
554 632
555# 633#
634# Hardware I/O ports
635#
636CONFIG_SERIO=y
637# CONFIG_SERIO_I8042 is not set
638# CONFIG_SERIO_SERPORT is not set
639# CONFIG_SERIO_PCIPS2 is not set
640# CONFIG_SERIO_LIBPS2 is not set
641# CONFIG_SERIO_RAW is not set
642# CONFIG_GAMEPORT is not set
643
644#
556# Character devices 645# Character devices
557# 646#
558CONFIG_VT=y 647CONFIG_VT=y
@@ -573,6 +662,7 @@ CONFIG_SERIAL_8250_NR_UARTS=4
573# 662#
574CONFIG_SERIAL_CORE=y 663CONFIG_SERIAL_CORE=y
575CONFIG_SERIAL_CORE_CONSOLE=y 664CONFIG_SERIAL_CORE_CONSOLE=y
665# CONFIG_SERIAL_JSM is not set
576CONFIG_UNIX98_PTYS=y 666CONFIG_UNIX98_PTYS=y
577CONFIG_LEGACY_PTYS=y 667CONFIG_LEGACY_PTYS=y
578CONFIG_LEGACY_PTY_COUNT=256 668CONFIG_LEGACY_PTY_COUNT=256
@@ -598,6 +688,11 @@ CONFIG_RTC=y
598# CONFIG_RAW_DRIVER is not set 688# CONFIG_RAW_DRIVER is not set
599 689
600# 690#
691# TPM devices
692#
693# CONFIG_TCG_TPM is not set
694
695#
601# I2C support 696# I2C support
602# 697#
603# CONFIG_I2C is not set 698# CONFIG_I2C is not set
@@ -608,10 +703,20 @@ CONFIG_RTC=y
608# CONFIG_W1 is not set 703# CONFIG_W1 is not set
609 704
610# 705#
706# Hardware Monitoring support
707#
708# CONFIG_HWMON is not set
709# CONFIG_HWMON_VID is not set
710
711#
611# Misc devices 712# Misc devices
612# 713#
613 714
614# 715#
716# Multimedia Capabilities Port drivers
717#
718
719#
615# Multimedia devices 720# Multimedia devices
616# 721#
617# CONFIG_VIDEO_DEV is not set 722# CONFIG_VIDEO_DEV is not set
@@ -625,6 +730,11 @@ CONFIG_RTC=y
625# Graphics support 730# Graphics support
626# 731#
627CONFIG_FB=y 732CONFIG_FB=y
733# CONFIG_FB_CFB_FILLRECT is not set
734# CONFIG_FB_CFB_COPYAREA is not set
735# CONFIG_FB_CFB_IMAGEBLIT is not set
736# CONFIG_FB_SOFT_CURSOR is not set
737# CONFIG_FB_MACMODES is not set
628CONFIG_FB_MODE_HELPERS=y 738CONFIG_FB_MODE_HELPERS=y
629# CONFIG_FB_TILEBLITTING is not set 739# CONFIG_FB_TILEBLITTING is not set
630# CONFIG_FB_CIRRUS is not set 740# CONFIG_FB_CIRRUS is not set
@@ -632,6 +742,7 @@ CONFIG_FB_MODE_HELPERS=y
632# CONFIG_FB_CYBER2000 is not set 742# CONFIG_FB_CYBER2000 is not set
633# CONFIG_FB_ASILIANT is not set 743# CONFIG_FB_ASILIANT is not set
634# CONFIG_FB_IMSTT is not set 744# CONFIG_FB_IMSTT is not set
745# CONFIG_FB_NVIDIA is not set
635# CONFIG_FB_RIVA is not set 746# CONFIG_FB_RIVA is not set
636# CONFIG_FB_MATROX is not set 747# CONFIG_FB_MATROX is not set
637# CONFIG_FB_RADEON_OLD is not set 748# CONFIG_FB_RADEON_OLD is not set
@@ -644,8 +755,11 @@ CONFIG_FB_MODE_HELPERS=y
644# CONFIG_FB_KYRO is not set 755# CONFIG_FB_KYRO is not set
645# CONFIG_FB_3DFX is not set 756# CONFIG_FB_3DFX is not set
646# CONFIG_FB_VOODOO1 is not set 757# CONFIG_FB_VOODOO1 is not set
758# CONFIG_FB_SMIVGX is not set
759# CONFIG_FB_CYBLA is not set
647# CONFIG_FB_TRIDENT is not set 760# CONFIG_FB_TRIDENT is not set
648# CONFIG_FB_E1356 is not set 761# CONFIG_FB_E1356 is not set
762# CONFIG_FB_S1D13XXX is not set
649# CONFIG_FB_VIRTUAL is not set 763# CONFIG_FB_VIRTUAL is not set
650 764
651# 765#
@@ -675,13 +789,9 @@ CONFIG_LOGO_LINUX_CLUT224=y
675# 789#
676# USB support 790# USB support
677# 791#
678# CONFIG_USB is not set
679CONFIG_USB_ARCH_HAS_HCD=y 792CONFIG_USB_ARCH_HAS_HCD=y
680CONFIG_USB_ARCH_HAS_OHCI=y 793CONFIG_USB_ARCH_HAS_OHCI=y
681 794# CONFIG_USB is not set
682#
683# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
684#
685 795
686# 796#
687# USB Gadget Support 797# USB Gadget Support
@@ -699,10 +809,15 @@ CONFIG_USB_ARCH_HAS_OHCI=y
699# CONFIG_INFINIBAND is not set 809# CONFIG_INFINIBAND is not set
700 810
701# 811#
812# SN Devices
813#
814
815#
702# File systems 816# File systems
703# 817#
704CONFIG_EXT2_FS=y 818CONFIG_EXT2_FS=y
705# CONFIG_EXT2_FS_XATTR is not set 819# CONFIG_EXT2_FS_XATTR is not set
820# CONFIG_EXT2_FS_XIP is not set
706CONFIG_EXT3_FS=m 821CONFIG_EXT3_FS=m
707CONFIG_EXT3_FS_XATTR=y 822CONFIG_EXT3_FS_XATTR=y
708# CONFIG_EXT3_FS_POSIX_ACL is not set 823# CONFIG_EXT3_FS_POSIX_ACL is not set
@@ -715,17 +830,21 @@ CONFIG_REISERFS_FS=m
715# CONFIG_REISERFS_PROC_INFO is not set 830# CONFIG_REISERFS_PROC_INFO is not set
716# CONFIG_REISERFS_FS_XATTR is not set 831# CONFIG_REISERFS_FS_XATTR is not set
717# CONFIG_JFS_FS is not set 832# CONFIG_JFS_FS is not set
833# CONFIG_FS_POSIX_ACL is not set
718CONFIG_XFS_FS=m 834CONFIG_XFS_FS=m
719# CONFIG_XFS_RT is not set 835CONFIG_XFS_EXPORT=y
720# CONFIG_XFS_QUOTA is not set 836# CONFIG_XFS_QUOTA is not set
721# CONFIG_XFS_SECURITY is not set 837# CONFIG_XFS_SECURITY is not set
722# CONFIG_XFS_POSIX_ACL is not set 838# CONFIG_XFS_POSIX_ACL is not set
839# CONFIG_XFS_RT is not set
723# CONFIG_MINIX_FS is not set 840# CONFIG_MINIX_FS is not set
724# CONFIG_ROMFS_FS is not set 841# CONFIG_ROMFS_FS is not set
842CONFIG_INOTIFY=y
725# CONFIG_QUOTA is not set 843# CONFIG_QUOTA is not set
726CONFIG_DNOTIFY=y 844CONFIG_DNOTIFY=y
727CONFIG_AUTOFS_FS=y 845CONFIG_AUTOFS_FS=y
728CONFIG_AUTOFS4_FS=m 846CONFIG_AUTOFS4_FS=m
847CONFIG_FUSE_FS=m
729 848
730# 849#
731# CD-ROM/DVD Filesystems 850# CD-ROM/DVD Filesystems
@@ -746,15 +865,10 @@ CONFIG_AUTOFS4_FS=m
746CONFIG_PROC_FS=y 865CONFIG_PROC_FS=y
747CONFIG_PROC_KCORE=y 866CONFIG_PROC_KCORE=y
748CONFIG_SYSFS=y 867CONFIG_SYSFS=y
749CONFIG_DEVFS_FS=y
750CONFIG_DEVFS_MOUNT=y
751# CONFIG_DEVFS_DEBUG is not set
752CONFIG_DEVPTS_FS_XATTR=y
753CONFIG_DEVPTS_FS_SECURITY=y
754CONFIG_TMPFS=y 868CONFIG_TMPFS=y
755# CONFIG_TMPFS_XATTR is not set
756# CONFIG_HUGETLB_PAGE is not set 869# CONFIG_HUGETLB_PAGE is not set
757CONFIG_RAMFS=y 870CONFIG_RAMFS=y
871CONFIG_RELAYFS_FS=m
758 872
759# 873#
760# Miscellaneous filesystems 874# Miscellaneous filesystems
@@ -778,16 +892,19 @@ CONFIG_CRAMFS=y
778# 892#
779CONFIG_NFS_FS=y 893CONFIG_NFS_FS=y
780CONFIG_NFS_V3=y 894CONFIG_NFS_V3=y
895# CONFIG_NFS_V3_ACL is not set
781# CONFIG_NFS_V4 is not set 896# CONFIG_NFS_V4 is not set
782# CONFIG_NFS_DIRECTIO is not set 897# CONFIG_NFS_DIRECTIO is not set
783CONFIG_NFSD=y 898CONFIG_NFSD=y
784CONFIG_NFSD_V3=y 899CONFIG_NFSD_V3=y
900# CONFIG_NFSD_V3_ACL is not set
785# CONFIG_NFSD_V4 is not set 901# CONFIG_NFSD_V4 is not set
786# CONFIG_NFSD_TCP is not set 902# CONFIG_NFSD_TCP is not set
787CONFIG_ROOT_NFS=y 903CONFIG_ROOT_NFS=y
788CONFIG_LOCKD=y 904CONFIG_LOCKD=y
789CONFIG_LOCKD_V4=y 905CONFIG_LOCKD_V4=y
790CONFIG_EXPORTFS=y 906CONFIG_EXPORTFS=y
907CONFIG_NFS_COMMON=y
791CONFIG_SUNRPC=y 908CONFIG_SUNRPC=y
792# CONFIG_RPCSEC_GSS_KRB5 is not set 909# CONFIG_RPCSEC_GSS_KRB5 is not set
793# CONFIG_RPCSEC_GSS_SPKM3 is not set 910# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -797,6 +914,7 @@ CONFIG_SMB_FS=m
797# CONFIG_NCP_FS is not set 914# CONFIG_NCP_FS is not set
798# CONFIG_CODA_FS is not set 915# CONFIG_CODA_FS is not set
799# CONFIG_AFS_FS is not set 916# CONFIG_AFS_FS is not set
917# CONFIG_9P_FS is not set
800 918
801# 919#
802# Partition Types 920# Partition Types
@@ -856,7 +974,9 @@ CONFIG_NLS_DEFAULT="iso8859-1"
856# 974#
857# Kernel hacking 975# Kernel hacking
858# 976#
977# CONFIG_PRINTK_TIME is not set
859# CONFIG_DEBUG_KERNEL is not set 978# CONFIG_DEBUG_KERNEL is not set
979CONFIG_LOG_BUF_SHIFT=14
860CONFIG_CROSSCOMPILE=y 980CONFIG_CROSSCOMPILE=y
861CONFIG_CMDLINE="ip=any root=nfs" 981CONFIG_CMDLINE="ip=any root=nfs"
862 982
@@ -869,7 +989,31 @@ CONFIG_CMDLINE="ip=any root=nfs"
869# 989#
870# Cryptographic options 990# Cryptographic options
871# 991#
872# CONFIG_CRYPTO is not set 992CONFIG_CRYPTO=y
993CONFIG_CRYPTO_HMAC=y
994CONFIG_CRYPTO_NULL=m
995CONFIG_CRYPTO_MD4=m
996CONFIG_CRYPTO_MD5=m
997CONFIG_CRYPTO_SHA1=m
998CONFIG_CRYPTO_SHA256=m
999CONFIG_CRYPTO_SHA512=m
1000CONFIG_CRYPTO_WP512=m
1001CONFIG_CRYPTO_TGR192=m
1002CONFIG_CRYPTO_DES=m
1003CONFIG_CRYPTO_BLOWFISH=m
1004CONFIG_CRYPTO_TWOFISH=m
1005CONFIG_CRYPTO_SERPENT=m
1006CONFIG_CRYPTO_AES=m
1007CONFIG_CRYPTO_CAST5=m
1008CONFIG_CRYPTO_CAST6=m
1009CONFIG_CRYPTO_TEA=m
1010CONFIG_CRYPTO_ARC4=m
1011CONFIG_CRYPTO_KHAZAD=m
1012CONFIG_CRYPTO_ANUBIS=m
1013CONFIG_CRYPTO_DEFLATE=m
1014CONFIG_CRYPTO_MICHAEL_MIC=m
1015CONFIG_CRYPTO_CRC32C=m
1016# CONFIG_CRYPTO_TEST is not set
873 1017
874# 1018#
875# Hardware crypto devices 1019# Hardware crypto devices
@@ -879,9 +1023,8 @@ CONFIG_CMDLINE="ip=any root=nfs"
879# Library routines 1023# Library routines
880# 1024#
881CONFIG_CRC_CCITT=m 1025CONFIG_CRC_CCITT=m
1026CONFIG_CRC16=m
882CONFIG_CRC32=y 1027CONFIG_CRC32=y
883CONFIG_LIBCRC32C=m 1028CONFIG_LIBCRC32C=m
884CONFIG_ZLIB_INFLATE=y 1029CONFIG_ZLIB_INFLATE=y
885CONFIG_ZLIB_DEFLATE=m 1030CONFIG_ZLIB_DEFLATE=m
886CONFIG_GENERIC_HARDIRQS=y
887CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/ocelot_c_defconfig b/arch/mips/configs/ocelot_c_defconfig
index a38903db85a0..d3a5fee02b79 100644
--- a/arch/mips/configs/ocelot_c_defconfig
+++ b/arch/mips/configs/ocelot_c_defconfig
@@ -1,11 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:07 2005 4# Thu Oct 20 22:26:33 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7CONFIG_64BIT=y
8CONFIG_64BIT=y
9 7
10# 8#
11# Code maturity level options 9# Code maturity level options
@@ -13,24 +11,29 @@ CONFIG_64BIT=y
13CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
14CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
15CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
16 15
17# 16#
18# General setup 17# General setup
19# 18#
20CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
21CONFIG_SWAP=y 21CONFIG_SWAP=y
22CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
23# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
24# CONFIG_BSD_PROCESS_ACCT is not set 24# CONFIG_BSD_PROCESS_ACCT is not set
25CONFIG_SYSCTL=y 25CONFIG_SYSCTL=y
26# CONFIG_AUDIT is not set 26# CONFIG_AUDIT is not set
27CONFIG_LOG_BUF_SHIFT=14 27CONFIG_HOTPLUG=y
28# CONFIG_HOTPLUG is not set
29CONFIG_KOBJECT_UEVENT=y 28CONFIG_KOBJECT_UEVENT=y
30# CONFIG_IKCONFIG is not set 29# CONFIG_IKCONFIG is not set
30CONFIG_INITRAMFS_SOURCE=""
31CONFIG_EMBEDDED=y 31CONFIG_EMBEDDED=y
32CONFIG_KALLSYMS=y 32CONFIG_KALLSYMS=y
33# CONFIG_KALLSYMS_EXTRA_PASS is not set 33# CONFIG_KALLSYMS_EXTRA_PASS is not set
34CONFIG_PRINTK=y
35CONFIG_BUG=y
36CONFIG_BASE_FULL=y
34CONFIG_FUTEX=y 37CONFIG_FUTEX=y
35CONFIG_EPOLL=y 38CONFIG_EPOLL=y
36# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -40,6 +43,7 @@ CONFIG_CC_ALIGN_LABELS=0
40CONFIG_CC_ALIGN_LOOPS=0 43CONFIG_CC_ALIGN_LOOPS=0
41CONFIG_CC_ALIGN_JUMPS=0 44CONFIG_CC_ALIGN_JUMPS=0
42# CONFIG_TINY_SHMEM is not set 45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
43 47
44# 48#
45# Loadable module support 49# Loadable module support
@@ -49,39 +53,68 @@ CONFIG_CC_ALIGN_JUMPS=0
49# 53#
50# Machine selection 54# Machine selection
51# 55#
52# CONFIG_MACH_JAZZ is not set 56# CONFIG_MIPS_MTX1 is not set
53# CONFIG_MACH_VR41XX is not set 57# CONFIG_MIPS_BOSPORUS is not set
58# CONFIG_MIPS_PB1000 is not set
59# CONFIG_MIPS_PB1100 is not set
60# CONFIG_MIPS_PB1500 is not set
61# CONFIG_MIPS_PB1550 is not set
62# CONFIG_MIPS_PB1200 is not set
63# CONFIG_MIPS_DB1000 is not set
64# CONFIG_MIPS_DB1100 is not set
65# CONFIG_MIPS_DB1500 is not set
66# CONFIG_MIPS_DB1550 is not set
67# CONFIG_MIPS_DB1200 is not set
68# CONFIG_MIPS_MIRAGE is not set
54# CONFIG_MIPS_COBALT is not set 69# CONFIG_MIPS_COBALT is not set
55# CONFIG_MACH_DECSTATION is not set 70# CONFIG_MACH_DECSTATION is not set
56# CONFIG_MIPS_EV64120 is not set 71# CONFIG_MIPS_EV64120 is not set
57# CONFIG_MIPS_EV96100 is not set 72# CONFIG_MIPS_EV96100 is not set
58# CONFIG_MIPS_IVR is not set 73# CONFIG_MIPS_IVR is not set
59# CONFIG_LASAT is not set
60# CONFIG_MIPS_ITE8172 is not set 74# CONFIG_MIPS_ITE8172 is not set
75# CONFIG_MACH_JAZZ is not set
76# CONFIG_LASAT is not set
61# CONFIG_MIPS_ATLAS is not set 77# CONFIG_MIPS_ATLAS is not set
62# CONFIG_MIPS_MALTA is not set 78# CONFIG_MIPS_MALTA is not set
63# CONFIG_MIPS_SEAD is not set 79# CONFIG_MIPS_SEAD is not set
80# CONFIG_MIPS_SIM is not set
81# CONFIG_MOMENCO_JAGUAR_ATX is not set
64# CONFIG_MOMENCO_OCELOT is not set 82# CONFIG_MOMENCO_OCELOT is not set
65# CONFIG_MOMENCO_OCELOT_G is not set
66CONFIG_MOMENCO_OCELOT_C=y
67# CONFIG_MOMENCO_OCELOT_3 is not set 83# CONFIG_MOMENCO_OCELOT_3 is not set
68# CONFIG_MOMENCO_JAGUAR_ATX is not set 84CONFIG_MOMENCO_OCELOT_C=y
69# CONFIG_PMC_YOSEMITE is not set 85# CONFIG_MOMENCO_OCELOT_G is not set
86# CONFIG_MIPS_XXS1500 is not set
87# CONFIG_PNX8550_V2PCI is not set
88# CONFIG_PNX8550_JBS is not set
70# CONFIG_DDB5074 is not set 89# CONFIG_DDB5074 is not set
71# CONFIG_DDB5476 is not set 90# CONFIG_DDB5476 is not set
72# CONFIG_DDB5477 is not set 91# CONFIG_DDB5477 is not set
73# CONFIG_NEC_OSPREY is not set 92# CONFIG_MACH_VR41XX is not set
93# CONFIG_PMC_YOSEMITE is not set
94# CONFIG_QEMU is not set
74# CONFIG_SGI_IP22 is not set 95# CONFIG_SGI_IP22 is not set
75# CONFIG_SGI_IP27 is not set 96# CONFIG_SGI_IP27 is not set
76# CONFIG_SGI_IP32 is not set 97# CONFIG_SGI_IP32 is not set
77# CONFIG_SIBYTE_SB1xxx_SOC is not set 98# CONFIG_SIBYTE_BIGSUR is not set
99# CONFIG_SIBYTE_SWARM is not set
100# CONFIG_SIBYTE_SENTOSA is not set
101# CONFIG_SIBYTE_RHONE is not set
102# CONFIG_SIBYTE_CARMEL is not set
103# CONFIG_SIBYTE_PTSWARM is not set
104# CONFIG_SIBYTE_LITTLESUR is not set
105# CONFIG_SIBYTE_CRHINE is not set
106# CONFIG_SIBYTE_CRHONE is not set
78# CONFIG_SNI_RM200_PCI is not set 107# CONFIG_SNI_RM200_PCI is not set
108# CONFIG_TOSHIBA_JMR3927 is not set
109# CONFIG_TOSHIBA_RBTX4927 is not set
110# CONFIG_TOSHIBA_RBTX4938 is not set
79CONFIG_RWSEM_GENERIC_SPINLOCK=y 111CONFIG_RWSEM_GENERIC_SPINLOCK=y
80CONFIG_GENERIC_CALIBRATE_DELAY=y 112CONFIG_GENERIC_CALIBRATE_DELAY=y
81CONFIG_HAVE_DEC_LOCK=y
82CONFIG_DMA_NONCOHERENT=y 113CONFIG_DMA_NONCOHERENT=y
83CONFIG_DMA_NEED_PCI_MAP_STATE=y 114CONFIG_DMA_NEED_PCI_MAP_STATE=y
115CONFIG_CPU_BIG_ENDIAN=y
84# CONFIG_CPU_LITTLE_ENDIAN is not set 116# CONFIG_CPU_LITTLE_ENDIAN is not set
117CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
85CONFIG_IRQ_CPU=y 118CONFIG_IRQ_CPU=y
86CONFIG_IRQ_MV64340=y 119CONFIG_IRQ_MV64340=y
87CONFIG_PCI_MARVELL=y 120CONFIG_PCI_MARVELL=y
@@ -91,8 +124,10 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
91# 124#
92# CPU selection 125# CPU selection
93# 126#
94# CONFIG_CPU_MIPS32 is not set 127# CONFIG_CPU_MIPS32_R1 is not set
95# CONFIG_CPU_MIPS64 is not set 128# CONFIG_CPU_MIPS32_R2 is not set
129# CONFIG_CPU_MIPS64_R1 is not set
130# CONFIG_CPU_MIPS64_R2 is not set
96# CONFIG_CPU_R3000 is not set 131# CONFIG_CPU_R3000 is not set
97# CONFIG_CPU_TX39XX is not set 132# CONFIG_CPU_TX39XX is not set
98# CONFIG_CPU_VR41XX is not set 133# CONFIG_CPU_VR41XX is not set
@@ -108,6 +143,17 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
108CONFIG_CPU_RM7000=y 143CONFIG_CPU_RM7000=y
109# CONFIG_CPU_RM9000 is not set 144# CONFIG_CPU_RM9000 is not set
110# CONFIG_CPU_SB1 is not set 145# CONFIG_CPU_SB1 is not set
146CONFIG_SYS_HAS_CPU_RM7000=y
147CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
148CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
149CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
150CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
151
152#
153# Kernel type
154#
155# CONFIG_32BIT is not set
156CONFIG_64BIT=y
111CONFIG_PAGE_SIZE_4KB=y 157CONFIG_PAGE_SIZE_4KB=y
112# CONFIG_PAGE_SIZE_8KB is not set 158# CONFIG_PAGE_SIZE_8KB is not set
113# CONFIG_PAGE_SIZE_16KB is not set 159# CONFIG_PAGE_SIZE_16KB is not set
@@ -115,9 +161,23 @@ CONFIG_PAGE_SIZE_4KB=y
115CONFIG_BOARD_SCACHE=y 161CONFIG_BOARD_SCACHE=y
116CONFIG_RM7000_CPU_SCACHE=y 162CONFIG_RM7000_CPU_SCACHE=y
117CONFIG_CPU_HAS_PREFETCH=y 163CONFIG_CPU_HAS_PREFETCH=y
164# CONFIG_MIPS_MT is not set
118CONFIG_CPU_HAS_LLSC=y 165CONFIG_CPU_HAS_LLSC=y
119CONFIG_CPU_HAS_LLDSCD=y 166CONFIG_CPU_HAS_LLDSCD=y
120CONFIG_CPU_HAS_SYNC=y 167CONFIG_CPU_HAS_SYNC=y
168CONFIG_GENERIC_HARDIRQS=y
169CONFIG_GENERIC_IRQ_PROBE=y
170CONFIG_CPU_SUPPORTS_HIGHMEM=y
171CONFIG_ARCH_FLATMEM_ENABLE=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_PREEMPT_NONE=y
180# CONFIG_PREEMPT_VOLUNTARY is not set
121# CONFIG_PREEMPT is not set 181# CONFIG_PREEMPT is not set
122 182
123# 183#
@@ -126,7 +186,6 @@ CONFIG_CPU_HAS_SYNC=y
126CONFIG_HW_HAS_PCI=y 186CONFIG_HW_HAS_PCI=y
127CONFIG_PCI=y 187CONFIG_PCI=y
128CONFIG_PCI_LEGACY_PROC=y 188CONFIG_PCI_LEGACY_PROC=y
129CONFIG_PCI_NAMES=y
130CONFIG_MMU=y 189CONFIG_MMU=y
131 190
132# 191#
@@ -135,10 +194,6 @@ CONFIG_MMU=y
135# CONFIG_PCCARD is not set 194# CONFIG_PCCARD is not set
136 195
137# 196#
138# PC-card bridges
139#
140
141#
142# PCI Hotplug Support 197# PCI Hotplug Support
143# 198#
144# CONFIG_HOTPLUG_PCI is not set 199# CONFIG_HOTPLUG_PCI is not set
@@ -156,6 +211,79 @@ CONFIG_MIPS32_N32=y
156CONFIG_BINFMT_ELF32=y 211CONFIG_BINFMT_ELF32=y
157 212
158# 213#
214# Networking
215#
216CONFIG_NET=y
217
218#
219# Networking options
220#
221# CONFIG_PACKET is not set
222CONFIG_UNIX=y
223CONFIG_XFRM=y
224CONFIG_XFRM_USER=y
225CONFIG_NET_KEY=y
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
232# CONFIG_IP_PNP_BOOTP is not set
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
241CONFIG_INET_TUNNEL=y
242CONFIG_INET_DIAG=y
243CONFIG_INET_TCP_DIAG=y
244# CONFIG_TCP_CONG_ADVANCED is not set
245CONFIG_TCP_CONG_BIC=y
246# CONFIG_IPV6 is not set
247# CONFIG_NETFILTER is not set
248
249#
250# DCCP Configuration (EXPERIMENTAL)
251#
252# CONFIG_IP_DCCP is not set
253
254#
255# SCTP Configuration (EXPERIMENTAL)
256#
257# CONFIG_IP_SCTP is not set
258# CONFIG_ATM is not set
259# CONFIG_BRIDGE is not set
260# CONFIG_VLAN_8021Q is not set
261# CONFIG_DECNET is not set
262# CONFIG_LLC2 is not set
263# CONFIG_IPX is not set
264# CONFIG_ATALK is not set
265# CONFIG_X25 is not set
266# CONFIG_LAPB is not set
267# CONFIG_NET_DIVERT is not set
268# CONFIG_ECONET is not set
269# CONFIG_WAN_ROUTER is not set
270# CONFIG_NET_SCHED is not set
271# CONFIG_NET_CLS_ROUTE is not set
272
273#
274# Network testing
275#
276# CONFIG_NET_PKTGEN is not set
277# CONFIG_HAMRADIO is not set
278# CONFIG_IRDA is not set
279# CONFIG_BT is not set
280CONFIG_IEEE80211=y
281# CONFIG_IEEE80211_DEBUG is not set
282CONFIG_IEEE80211_CRYPT_WEP=y
283CONFIG_IEEE80211_CRYPT_CCMP=y
284CONFIG_IEEE80211_CRYPT_TKIP=y
285
286#
159# Device Drivers 287# Device Drivers
160# 288#
161 289
@@ -164,7 +292,12 @@ CONFIG_BINFMT_ELF32=y
164# 292#
165CONFIG_STANDALONE=y 293CONFIG_STANDALONE=y
166CONFIG_PREVENT_FIRMWARE_BUILD=y 294CONFIG_PREVENT_FIRMWARE_BUILD=y
167# CONFIG_FW_LOADER is not set 295CONFIG_FW_LOADER=y
296
297#
298# Connector - unified userspace <-> kernelspace linker
299#
300CONFIG_CONNECTOR=y
168 301
169# 302#
170# Memory Technology Devices (MTD) 303# Memory Technology Devices (MTD)
@@ -183,7 +316,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
183# 316#
184# Block devices 317# Block devices
185# 318#
186# CONFIG_BLK_DEV_FD is not set
187# CONFIG_BLK_CPQ_DA is not set 319# CONFIG_BLK_CPQ_DA is not set
188# CONFIG_BLK_CPQ_CISS_DA is not set 320# CONFIG_BLK_CPQ_CISS_DA is not set
189# CONFIG_BLK_DEV_DAC960 is not set 321# CONFIG_BLK_DEV_DAC960 is not set
@@ -194,7 +326,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
194# CONFIG_BLK_DEV_SX8 is not set 326# CONFIG_BLK_DEV_SX8 is not set
195# CONFIG_BLK_DEV_RAM is not set 327# CONFIG_BLK_DEV_RAM is not set
196CONFIG_BLK_DEV_RAM_COUNT=16 328CONFIG_BLK_DEV_RAM_COUNT=16
197CONFIG_INITRAMFS_SOURCE=""
198CONFIG_CDROM_PKTCDVD=y 329CONFIG_CDROM_PKTCDVD=y
199CONFIG_CDROM_PKTCDVD_BUFFERS=8 330CONFIG_CDROM_PKTCDVD_BUFFERS=8
200# CONFIG_CDROM_PKTCDVD_WCACHE is not set 331# CONFIG_CDROM_PKTCDVD_WCACHE is not set
@@ -216,6 +347,7 @@ CONFIG_ATA_OVER_ETH=y
216# 347#
217# SCSI device support 348# SCSI device support
218# 349#
350CONFIG_RAID_ATTRS=y
219# CONFIG_SCSI is not set 351# CONFIG_SCSI is not set
220 352
221# 353#
@@ -226,6 +358,7 @@ CONFIG_ATA_OVER_ETH=y
226# 358#
227# Fusion MPT device support 359# Fusion MPT device support
228# 360#
361# CONFIG_FUSION is not set
229 362
230# 363#
231# IEEE 1394 (FireWire) support 364# IEEE 1394 (FireWire) support
@@ -238,77 +371,13 @@ CONFIG_ATA_OVER_ETH=y
238# CONFIG_I2O is not set 371# CONFIG_I2O is not set
239 372
240# 373#
241# Networking support 374# Network device support
242#
243CONFIG_NET=y
244
245#
246# Networking options
247#
248# CONFIG_PACKET is not set
249CONFIG_NETLINK_DEV=y
250CONFIG_UNIX=y
251CONFIG_NET_KEY=y
252CONFIG_INET=y
253# CONFIG_IP_MULTICAST is not set
254# CONFIG_IP_ADVANCED_ROUTER is not set
255CONFIG_IP_PNP=y
256CONFIG_IP_PNP_DHCP=y
257# CONFIG_IP_PNP_BOOTP is not set
258# CONFIG_IP_PNP_RARP is not set
259# CONFIG_NET_IPIP is not set
260# CONFIG_NET_IPGRE is not set
261# CONFIG_ARPD is not set
262# CONFIG_SYN_COOKIES is not set
263# CONFIG_INET_AH is not set
264# CONFIG_INET_ESP is not set
265# CONFIG_INET_IPCOMP is not set
266CONFIG_INET_TUNNEL=y
267CONFIG_IP_TCPDIAG=y
268# CONFIG_IP_TCPDIAG_IPV6 is not set
269# CONFIG_IPV6 is not set
270# CONFIG_NETFILTER is not set
271CONFIG_XFRM=y
272CONFIG_XFRM_USER=y
273
274#
275# SCTP Configuration (EXPERIMENTAL)
276#
277# CONFIG_IP_SCTP is not set
278# CONFIG_ATM is not set
279# CONFIG_BRIDGE is not set
280# CONFIG_VLAN_8021Q is not set
281# CONFIG_DECNET is not set
282# CONFIG_LLC2 is not set
283# CONFIG_IPX is not set
284# CONFIG_ATALK is not set
285# CONFIG_X25 is not set
286# CONFIG_LAPB is not set
287# CONFIG_NET_DIVERT 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# CONFIG_NET_CLS_ROUTE is not set
296
297#
298# Network testing
299# 375#
300# CONFIG_NET_PKTGEN is not set
301# CONFIG_NETPOLL is not set
302# CONFIG_NET_POLL_CONTROLLER is not set
303# CONFIG_HAMRADIO is not set
304# CONFIG_IRDA is not set
305# CONFIG_BT is not set
306CONFIG_NETDEVICES=y 376CONFIG_NETDEVICES=y
307# CONFIG_DUMMY is not set 377# CONFIG_DUMMY is not set
308# CONFIG_BONDING is not set 378# CONFIG_BONDING is not set
309# CONFIG_EQUALIZER is not set 379# CONFIG_EQUALIZER is not set
310# CONFIG_TUN is not set 380# CONFIG_TUN is not set
311# CONFIG_ETHERTAP is not set
312 381
313# 382#
314# ARCnet devices 383# ARCnet devices
@@ -316,6 +385,21 @@ CONFIG_NETDEVICES=y
316# CONFIG_ARCNET is not set 385# CONFIG_ARCNET is not set
317 386
318# 387#
388# PHY device support
389#
390CONFIG_PHYLIB=y
391CONFIG_PHYCONTROL=y
392
393#
394# MII PHY device drivers
395#
396CONFIG_MARVELL_PHY=y
397CONFIG_DAVICOM_PHY=y
398CONFIG_QSEMI_PHY=y
399CONFIG_LXT_PHY=y
400CONFIG_CICADA_PHY=y
401
402#
319# Ethernet (10 or 100Mbit) 403# Ethernet (10 or 100Mbit)
320# 404#
321CONFIG_NET_ETHERNET=y 405CONFIG_NET_ETHERNET=y
@@ -341,13 +425,17 @@ CONFIG_NET_ETHERNET=y
341# CONFIG_HAMACHI is not set 425# CONFIG_HAMACHI is not set
342# CONFIG_YELLOWFIN is not set 426# CONFIG_YELLOWFIN is not set
343# CONFIG_R8169 is not set 427# CONFIG_R8169 is not set
428# CONFIG_SIS190 is not set
429# CONFIG_SKGE is not set
344# CONFIG_SK98LIN is not set 430# CONFIG_SK98LIN is not set
345# CONFIG_TIGON3 is not set 431# CONFIG_TIGON3 is not set
432# CONFIG_BNX2 is not set
346# CONFIG_MV643XX_ETH is not set 433# CONFIG_MV643XX_ETH is not set
347 434
348# 435#
349# Ethernet (10000 Mbit) 436# Ethernet (10000 Mbit)
350# 437#
438# CONFIG_CHELSIO_T1 is not set
351# CONFIG_IXGB is not set 439# CONFIG_IXGB is not set
352# CONFIG_S2IO is not set 440# CONFIG_S2IO is not set
353 441
@@ -360,6 +448,8 @@ CONFIG_NET_ETHERNET=y
360# Wireless LAN (non-hamradio) 448# Wireless LAN (non-hamradio)
361# 449#
362# CONFIG_NET_RADIO is not set 450# CONFIG_NET_RADIO is not set
451# CONFIG_IPW_DEBUG is not set
452CONFIG_IPW2200=y
363 453
364# 454#
365# Wan interfaces 455# Wan interfaces
@@ -371,6 +461,8 @@ CONFIG_NET_ETHERNET=y
371# CONFIG_SLIP is not set 461# CONFIG_SLIP is not set
372# CONFIG_SHAPER is not set 462# CONFIG_SHAPER is not set
373# CONFIG_NETCONSOLE is not set 463# CONFIG_NETCONSOLE is not set
464# CONFIG_NETPOLL is not set
465# CONFIG_NET_POLL_CONTROLLER is not set
374 466
375# 467#
376# ISDN subsystem 468# ISDN subsystem
@@ -400,19 +492,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
400# CONFIG_INPUT_EVBUG is not set 492# CONFIG_INPUT_EVBUG is not set
401 493
402# 494#
403# Input I/O drivers
404#
405# CONFIG_GAMEPORT is not set
406CONFIG_SOUND_GAMEPORT=y
407CONFIG_SERIO=y
408# CONFIG_SERIO_I8042 is not set
409CONFIG_SERIO_SERPORT=y
410# CONFIG_SERIO_CT82C710 is not set
411# CONFIG_SERIO_PCIPS2 is not set
412# CONFIG_SERIO_LIBPS2 is not set
413CONFIG_SERIO_RAW=y
414
415#
416# Input Device Drivers 495# Input Device Drivers
417# 496#
418# CONFIG_INPUT_KEYBOARD is not set 497# CONFIG_INPUT_KEYBOARD is not set
@@ -422,6 +501,17 @@ CONFIG_SERIO_RAW=y
422# CONFIG_INPUT_MISC is not set 501# CONFIG_INPUT_MISC is not set
423 502
424# 503#
504# Hardware I/O ports
505#
506CONFIG_SERIO=y
507# CONFIG_SERIO_I8042 is not set
508CONFIG_SERIO_SERPORT=y
509# CONFIG_SERIO_PCIPS2 is not set
510# CONFIG_SERIO_LIBPS2 is not set
511CONFIG_SERIO_RAW=y
512# CONFIG_GAMEPORT is not set
513
514#
425# Character devices 515# Character devices
426# 516#
427CONFIG_VT=y 517CONFIG_VT=y
@@ -442,6 +532,7 @@ CONFIG_SERIAL_8250_NR_UARTS=4
442# 532#
443CONFIG_SERIAL_CORE=y 533CONFIG_SERIAL_CORE=y
444CONFIG_SERIAL_CORE_CONSOLE=y 534CONFIG_SERIAL_CORE_CONSOLE=y
535# CONFIG_SERIAL_JSM is not set
445CONFIG_UNIX98_PTYS=y 536CONFIG_UNIX98_PTYS=y
446CONFIG_LEGACY_PTYS=y 537CONFIG_LEGACY_PTYS=y
447CONFIG_LEGACY_PTY_COUNT=256 538CONFIG_LEGACY_PTY_COUNT=256
@@ -468,6 +559,11 @@ CONFIG_LEGACY_PTY_COUNT=256
468# CONFIG_RAW_DRIVER is not set 559# CONFIG_RAW_DRIVER is not set
469 560
470# 561#
562# TPM devices
563#
564# CONFIG_TCG_TPM is not set
565
566#
471# I2C support 567# I2C support
472# 568#
473# CONFIG_I2C is not set 569# CONFIG_I2C is not set
@@ -478,10 +574,20 @@ CONFIG_LEGACY_PTY_COUNT=256
478# CONFIG_W1 is not set 574# CONFIG_W1 is not set
479 575
480# 576#
577# Hardware Monitoring support
578#
579# CONFIG_HWMON is not set
580# CONFIG_HWMON_VID is not set
581
582#
481# Misc devices 583# Misc devices
482# 584#
483 585
484# 586#
587# Multimedia Capabilities Port drivers
588#
589
590#
485# Multimedia devices 591# Multimedia devices
486# 592#
487# CONFIG_VIDEO_DEV is not set 593# CONFIG_VIDEO_DEV is not set
@@ -501,7 +607,6 @@ CONFIG_LEGACY_PTY_COUNT=256
501# 607#
502# CONFIG_VGA_CONSOLE is not set 608# CONFIG_VGA_CONSOLE is not set
503CONFIG_DUMMY_CONSOLE=y 609CONFIG_DUMMY_CONSOLE=y
504# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
505 610
506# 611#
507# Sound 612# Sound
@@ -511,13 +616,9 @@ CONFIG_DUMMY_CONSOLE=y
511# 616#
512# USB support 617# USB support
513# 618#
514# CONFIG_USB is not set
515CONFIG_USB_ARCH_HAS_HCD=y 619CONFIG_USB_ARCH_HAS_HCD=y
516CONFIG_USB_ARCH_HAS_OHCI=y 620CONFIG_USB_ARCH_HAS_OHCI=y
517 621# CONFIG_USB is not set
518#
519# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
520#
521 622
522# 623#
523# USB Gadget Support 624# USB Gadget Support
@@ -535,21 +636,29 @@ CONFIG_USB_ARCH_HAS_OHCI=y
535# CONFIG_INFINIBAND is not set 636# CONFIG_INFINIBAND is not set
536 637
537# 638#
639# SN Devices
640#
641
642#
538# File systems 643# File systems
539# 644#
540CONFIG_EXT2_FS=y 645CONFIG_EXT2_FS=y
541# CONFIG_EXT2_FS_XATTR is not set 646# CONFIG_EXT2_FS_XATTR is not set
647# CONFIG_EXT2_FS_XIP is not set
542# CONFIG_EXT3_FS is not set 648# CONFIG_EXT3_FS is not set
543# CONFIG_JBD is not set 649# CONFIG_JBD is not set
544# CONFIG_REISERFS_FS is not set 650# CONFIG_REISERFS_FS is not set
545# CONFIG_JFS_FS is not set 651# CONFIG_JFS_FS is not set
652# CONFIG_FS_POSIX_ACL is not set
546# CONFIG_XFS_FS is not set 653# CONFIG_XFS_FS is not set
547# CONFIG_MINIX_FS is not set 654# CONFIG_MINIX_FS is not set
548# CONFIG_ROMFS_FS is not set 655# CONFIG_ROMFS_FS is not set
656CONFIG_INOTIFY=y
549# CONFIG_QUOTA is not set 657# CONFIG_QUOTA is not set
550CONFIG_DNOTIFY=y 658CONFIG_DNOTIFY=y
551# CONFIG_AUTOFS_FS is not set 659# CONFIG_AUTOFS_FS is not set
552# CONFIG_AUTOFS4_FS is not set 660# CONFIG_AUTOFS4_FS is not set
661CONFIG_FUSE_FS=y
553 662
554# 663#
555# CD-ROM/DVD Filesystems 664# CD-ROM/DVD Filesystems
@@ -570,12 +679,10 @@ CONFIG_DNOTIFY=y
570CONFIG_PROC_FS=y 679CONFIG_PROC_FS=y
571CONFIG_PROC_KCORE=y 680CONFIG_PROC_KCORE=y
572CONFIG_SYSFS=y 681CONFIG_SYSFS=y
573# CONFIG_DEVFS_FS is not set
574CONFIG_DEVPTS_FS_XATTR=y
575CONFIG_DEVPTS_FS_SECURITY=y
576# CONFIG_TMPFS is not set 682# CONFIG_TMPFS is not set
577# CONFIG_HUGETLB_PAGE is not set 683# CONFIG_HUGETLB_PAGE is not set
578CONFIG_RAMFS=y 684CONFIG_RAMFS=y
685CONFIG_RELAYFS_FS=y
579 686
580# 687#
581# Miscellaneous filesystems 688# Miscellaneous filesystems
@@ -607,6 +714,7 @@ CONFIG_NFSD=y
607CONFIG_ROOT_NFS=y 714CONFIG_ROOT_NFS=y
608CONFIG_LOCKD=y 715CONFIG_LOCKD=y
609CONFIG_EXPORTFS=y 716CONFIG_EXPORTFS=y
717CONFIG_NFS_COMMON=y
610CONFIG_SUNRPC=y 718CONFIG_SUNRPC=y
611# CONFIG_RPCSEC_GSS_KRB5 is not set 719# CONFIG_RPCSEC_GSS_KRB5 is not set
612# CONFIG_RPCSEC_GSS_SPKM3 is not set 720# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -615,6 +723,7 @@ CONFIG_SUNRPC=y
615# CONFIG_NCP_FS is not set 723# CONFIG_NCP_FS is not set
616# CONFIG_CODA_FS is not set 724# CONFIG_CODA_FS is not set
617# CONFIG_AFS_FS is not set 725# CONFIG_AFS_FS is not set
726# CONFIG_9P_FS is not set
618 727
619# 728#
620# Partition Types 729# Partition Types
@@ -635,7 +744,9 @@ CONFIG_MSDOS_PARTITION=y
635# 744#
636# Kernel hacking 745# Kernel hacking
637# 746#
747# CONFIG_PRINTK_TIME is not set
638# CONFIG_DEBUG_KERNEL is not set 748# CONFIG_DEBUG_KERNEL is not set
749CONFIG_LOG_BUF_SHIFT=14
639CONFIG_CROSSCOMPILE=y 750CONFIG_CROSSCOMPILE=y
640CONFIG_CMDLINE="" 751CONFIG_CMDLINE=""
641 752
@@ -649,7 +760,31 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
649# 760#
650# Cryptographic options 761# Cryptographic options
651# 762#
652# CONFIG_CRYPTO is not set 763CONFIG_CRYPTO=y
764CONFIG_CRYPTO_HMAC=y
765CONFIG_CRYPTO_NULL=y
766CONFIG_CRYPTO_MD4=y
767CONFIG_CRYPTO_MD5=y
768CONFIG_CRYPTO_SHA1=y
769CONFIG_CRYPTO_SHA256=y
770CONFIG_CRYPTO_SHA512=y
771CONFIG_CRYPTO_WP512=y
772CONFIG_CRYPTO_TGR192=y
773CONFIG_CRYPTO_DES=y
774CONFIG_CRYPTO_BLOWFISH=y
775CONFIG_CRYPTO_TWOFISH=y
776CONFIG_CRYPTO_SERPENT=y
777CONFIG_CRYPTO_AES=y
778CONFIG_CRYPTO_CAST5=y
779CONFIG_CRYPTO_CAST6=y
780CONFIG_CRYPTO_TEA=y
781CONFIG_CRYPTO_ARC4=y
782CONFIG_CRYPTO_KHAZAD=y
783CONFIG_CRYPTO_ANUBIS=y
784CONFIG_CRYPTO_DEFLATE=y
785CONFIG_CRYPTO_MICHAEL_MIC=y
786CONFIG_CRYPTO_CRC32C=y
787# CONFIG_CRYPTO_TEST is not set
653 788
654# 789#
655# Hardware crypto devices 790# Hardware crypto devices
@@ -659,7 +794,8 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
659# Library routines 794# Library routines
660# 795#
661# CONFIG_CRC_CCITT is not set 796# CONFIG_CRC_CCITT is not set
662# CONFIG_CRC32 is not set 797CONFIG_CRC16=y
663# CONFIG_LIBCRC32C is not set 798CONFIG_CRC32=y
664CONFIG_GENERIC_HARDIRQS=y 799CONFIG_LIBCRC32C=y
665CONFIG_GENERIC_IRQ_PROBE=y 800CONFIG_ZLIB_INFLATE=y
801CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/mips/configs/ocelot_defconfig b/arch/mips/configs/ocelot_defconfig
index 920d59b56a4e..1edde12ebff9 100644
--- a/arch/mips/configs/ocelot_defconfig
+++ b/arch/mips/configs/ocelot_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:08 2005 4# Thu Oct 20 22:26:35 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,24 +11,29 @@ CONFIG_32BIT=y
14CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
25# CONFIG_BSD_PROCESS_ACCT is not set 24# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y 25CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set 26# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14
29# CONFIG_HOTPLUG is not set 27# CONFIG_HOTPLUG is not set
30CONFIG_KOBJECT_UEVENT=y 28CONFIG_KOBJECT_UEVENT=y
31# CONFIG_IKCONFIG is not set 29# CONFIG_IKCONFIG is not set
30CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y 31CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y 32CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_EXTRA_PASS is not set 33# CONFIG_KALLSYMS_EXTRA_PASS is not set
34CONFIG_PRINTK=y
35CONFIG_BUG=y
36CONFIG_BASE_FULL=y
35CONFIG_FUTEX=y 37CONFIG_FUTEX=y
36CONFIG_EPOLL=y 38CONFIG_EPOLL=y
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -41,6 +43,7 @@ CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0 43CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0 44CONFIG_CC_ALIGN_JUMPS=0
43# CONFIG_TINY_SHMEM is not set 45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
44 47
45# 48#
46# Loadable module support 49# Loadable module support
@@ -50,40 +53,68 @@ CONFIG_CC_ALIGN_JUMPS=0
50# 53#
51# Machine selection 54# Machine selection
52# 55#
53# CONFIG_MACH_JAZZ is not set 56# CONFIG_MIPS_MTX1 is not set
54# CONFIG_MACH_VR41XX is not set 57# CONFIG_MIPS_BOSPORUS is not set
55# CONFIG_TOSHIBA_JMR3927 is not set 58# CONFIG_MIPS_PB1000 is not set
59# CONFIG_MIPS_PB1100 is not set
60# CONFIG_MIPS_PB1500 is not set
61# CONFIG_MIPS_PB1550 is not set
62# CONFIG_MIPS_PB1200 is not set
63# CONFIG_MIPS_DB1000 is not set
64# CONFIG_MIPS_DB1100 is not set
65# CONFIG_MIPS_DB1500 is not set
66# CONFIG_MIPS_DB1550 is not set
67# CONFIG_MIPS_DB1200 is not set
68# CONFIG_MIPS_MIRAGE is not set
56# CONFIG_MIPS_COBALT is not set 69# CONFIG_MIPS_COBALT is not set
57# CONFIG_MACH_DECSTATION is not set 70# CONFIG_MACH_DECSTATION is not set
58# CONFIG_MIPS_EV64120 is not set 71# CONFIG_MIPS_EV64120 is not set
59# CONFIG_MIPS_EV96100 is not set 72# CONFIG_MIPS_EV96100 is not set
60# CONFIG_MIPS_IVR is not set 73# CONFIG_MIPS_IVR is not set
61# CONFIG_LASAT is not set
62# CONFIG_MIPS_ITE8172 is not set 74# CONFIG_MIPS_ITE8172 is not set
75# CONFIG_MACH_JAZZ is not set
76# CONFIG_LASAT is not set
63# CONFIG_MIPS_ATLAS is not set 77# CONFIG_MIPS_ATLAS is not set
64# CONFIG_MIPS_MALTA is not set 78# CONFIG_MIPS_MALTA is not set
65# CONFIG_MIPS_SEAD is not set 79# CONFIG_MIPS_SEAD is not set
80# CONFIG_MIPS_SIM is not set
81# CONFIG_MOMENCO_JAGUAR_ATX is not set
66CONFIG_MOMENCO_OCELOT=y 82CONFIG_MOMENCO_OCELOT=y
67# CONFIG_MOMENCO_OCELOT_G is not set
68# CONFIG_MOMENCO_OCELOT_C is not set
69# CONFIG_MOMENCO_OCELOT_3 is not set 83# CONFIG_MOMENCO_OCELOT_3 is not set
70# CONFIG_MOMENCO_JAGUAR_ATX is not set 84# CONFIG_MOMENCO_OCELOT_C is not set
71# CONFIG_PMC_YOSEMITE is not set 85# CONFIG_MOMENCO_OCELOT_G is not set
86# CONFIG_MIPS_XXS1500 is not set
87# CONFIG_PNX8550_V2PCI is not set
88# CONFIG_PNX8550_JBS is not set
72# CONFIG_DDB5074 is not set 89# CONFIG_DDB5074 is not set
73# CONFIG_DDB5476 is not set 90# CONFIG_DDB5476 is not set
74# CONFIG_DDB5477 is not set 91# CONFIG_DDB5477 is not set
75# CONFIG_NEC_OSPREY is not set 92# CONFIG_MACH_VR41XX is not set
93# CONFIG_PMC_YOSEMITE is not set
94# CONFIG_QEMU is not set
76# CONFIG_SGI_IP22 is not set 95# CONFIG_SGI_IP22 is not set
77# CONFIG_SOC_AU1X00 is not set 96# CONFIG_SGI_IP27 is not set
78# CONFIG_SIBYTE_SB1xxx_SOC is not set 97# CONFIG_SGI_IP32 is not set
98# CONFIG_SIBYTE_BIGSUR is not set
99# CONFIG_SIBYTE_SWARM is not set
100# CONFIG_SIBYTE_SENTOSA is not set
101# CONFIG_SIBYTE_RHONE is not set
102# CONFIG_SIBYTE_CARMEL is not set
103# CONFIG_SIBYTE_PTSWARM is not set
104# CONFIG_SIBYTE_LITTLESUR is not set
105# CONFIG_SIBYTE_CRHINE is not set
106# CONFIG_SIBYTE_CRHONE is not set
79# CONFIG_SNI_RM200_PCI is not set 107# CONFIG_SNI_RM200_PCI is not set
108# CONFIG_TOSHIBA_JMR3927 is not set
80# CONFIG_TOSHIBA_RBTX4927 is not set 109# CONFIG_TOSHIBA_RBTX4927 is not set
110# CONFIG_TOSHIBA_RBTX4938 is not set
81CONFIG_RWSEM_GENERIC_SPINLOCK=y 111CONFIG_RWSEM_GENERIC_SPINLOCK=y
82CONFIG_GENERIC_CALIBRATE_DELAY=y 112CONFIG_GENERIC_CALIBRATE_DELAY=y
83CONFIG_HAVE_DEC_LOCK=y
84CONFIG_DMA_NONCOHERENT=y 113CONFIG_DMA_NONCOHERENT=y
85CONFIG_DMA_NEED_PCI_MAP_STATE=y 114CONFIG_DMA_NEED_PCI_MAP_STATE=y
115CONFIG_CPU_BIG_ENDIAN=y
86# CONFIG_CPU_LITTLE_ENDIAN is not set 116# CONFIG_CPU_LITTLE_ENDIAN is not set
117CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
87CONFIG_IRQ_CPU=y 118CONFIG_IRQ_CPU=y
88CONFIG_IRQ_CPU_RM7K=y 119CONFIG_IRQ_CPU_RM7K=y
89CONFIG_MIPS_GT64120=y 120CONFIG_MIPS_GT64120=y
@@ -96,8 +127,10 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
96# 127#
97# CPU selection 128# CPU selection
98# 129#
99# CONFIG_CPU_MIPS32 is not set 130# CONFIG_CPU_MIPS32_R1 is not set
100# CONFIG_CPU_MIPS64 is not set 131# CONFIG_CPU_MIPS32_R2 is not set
132# CONFIG_CPU_MIPS64_R1 is not set
133# CONFIG_CPU_MIPS64_R2 is not set
101# CONFIG_CPU_R3000 is not set 134# CONFIG_CPU_R3000 is not set
102# CONFIG_CPU_TX39XX is not set 135# CONFIG_CPU_TX39XX is not set
103# CONFIG_CPU_VR41XX is not set 136# CONFIG_CPU_VR41XX is not set
@@ -113,6 +146,17 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
113CONFIG_CPU_RM7000=y 146CONFIG_CPU_RM7000=y
114# CONFIG_CPU_RM9000 is not set 147# CONFIG_CPU_RM9000 is not set
115# CONFIG_CPU_SB1 is not set 148# CONFIG_CPU_SB1 is not set
149CONFIG_SYS_HAS_CPU_RM7000=y
150CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
151CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
152CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
153CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
154
155#
156# Kernel type
157#
158CONFIG_32BIT=y
159# CONFIG_64BIT is not set
116CONFIG_PAGE_SIZE_4KB=y 160CONFIG_PAGE_SIZE_4KB=y
117# CONFIG_PAGE_SIZE_8KB is not set 161# CONFIG_PAGE_SIZE_8KB is not set
118# CONFIG_PAGE_SIZE_16KB is not set 162# CONFIG_PAGE_SIZE_16KB is not set
@@ -120,11 +164,25 @@ CONFIG_PAGE_SIZE_4KB=y
120CONFIG_BOARD_SCACHE=y 164CONFIG_BOARD_SCACHE=y
121CONFIG_RM7000_CPU_SCACHE=y 165CONFIG_RM7000_CPU_SCACHE=y
122CONFIG_CPU_HAS_PREFETCH=y 166CONFIG_CPU_HAS_PREFETCH=y
167# CONFIG_MIPS_MT is not set
123# CONFIG_64BIT_PHYS_ADDR is not set 168# CONFIG_64BIT_PHYS_ADDR is not set
124# CONFIG_CPU_ADVANCED is not set 169# CONFIG_CPU_ADVANCED is not set
125CONFIG_CPU_HAS_LLSC=y 170CONFIG_CPU_HAS_LLSC=y
126CONFIG_CPU_HAS_LLDSCD=y 171CONFIG_CPU_HAS_LLDSCD=y
127CONFIG_CPU_HAS_SYNC=y 172CONFIG_CPU_HAS_SYNC=y
173CONFIG_GENERIC_HARDIRQS=y
174CONFIG_GENERIC_IRQ_PROBE=y
175CONFIG_CPU_SUPPORTS_HIGHMEM=y
176CONFIG_ARCH_FLATMEM_ENABLE=y
177CONFIG_SELECT_MEMORY_MODEL=y
178CONFIG_FLATMEM_MANUAL=y
179# CONFIG_DISCONTIGMEM_MANUAL is not set
180# CONFIG_SPARSEMEM_MANUAL is not set
181CONFIG_FLATMEM=y
182CONFIG_FLAT_NODE_MEM_MAP=y
183# CONFIG_SPARSEMEM_STATIC is not set
184CONFIG_PREEMPT_NONE=y
185# CONFIG_PREEMPT_VOLUNTARY is not set
128# CONFIG_PREEMPT is not set 186# CONFIG_PREEMPT is not set
129 187
130# 188#
@@ -140,10 +198,6 @@ CONFIG_MMU=y
140# CONFIG_PCCARD is not set 198# CONFIG_PCCARD is not set
141 199
142# 200#
143# PC-card bridges
144#
145
146#
147# PCI Hotplug Support 201# PCI Hotplug Support
148# 202#
149 203
@@ -155,6 +209,79 @@ CONFIG_BINFMT_ELF=y
155CONFIG_TRAD_SIGNALS=y 209CONFIG_TRAD_SIGNALS=y
156 210
157# 211#
212# Networking
213#
214CONFIG_NET=y
215
216#
217# Networking options
218#
219# CONFIG_PACKET is not set
220CONFIG_UNIX=y
221CONFIG_XFRM=y
222CONFIG_XFRM_USER=y
223CONFIG_NET_KEY=y
224CONFIG_INET=y
225# CONFIG_IP_MULTICAST is not set
226# CONFIG_IP_ADVANCED_ROUTER is not set
227CONFIG_IP_FIB_HASH=y
228CONFIG_IP_PNP=y
229# CONFIG_IP_PNP_DHCP is not set
230CONFIG_IP_PNP_BOOTP=y
231# CONFIG_IP_PNP_RARP is not set
232# CONFIG_NET_IPIP is not set
233# CONFIG_NET_IPGRE is not set
234# CONFIG_ARPD is not set
235# CONFIG_SYN_COOKIES is not set
236# CONFIG_INET_AH is not set
237# CONFIG_INET_ESP is not set
238# CONFIG_INET_IPCOMP is not set
239CONFIG_INET_TUNNEL=y
240CONFIG_INET_DIAG=y
241CONFIG_INET_TCP_DIAG=y
242# CONFIG_TCP_CONG_ADVANCED is not set
243CONFIG_TCP_CONG_BIC=y
244# CONFIG_IPV6 is not set
245# CONFIG_NETFILTER is not set
246
247#
248# DCCP Configuration (EXPERIMENTAL)
249#
250# CONFIG_IP_DCCP is not set
251
252#
253# SCTP Configuration (EXPERIMENTAL)
254#
255# CONFIG_IP_SCTP is not set
256# CONFIG_ATM is not set
257# CONFIG_BRIDGE is not set
258# CONFIG_VLAN_8021Q is not set
259# CONFIG_DECNET is not set
260# CONFIG_LLC2 is not set
261# CONFIG_IPX is not set
262# CONFIG_ATALK is not set
263# CONFIG_X25 is not set
264# CONFIG_LAPB is not set
265# CONFIG_NET_DIVERT is not set
266# CONFIG_ECONET is not set
267# CONFIG_WAN_ROUTER is not set
268# CONFIG_NET_SCHED is not set
269# CONFIG_NET_CLS_ROUTE is not set
270
271#
272# Network testing
273#
274# CONFIG_NET_PKTGEN is not set
275# CONFIG_HAMRADIO is not set
276# CONFIG_IRDA is not set
277# CONFIG_BT is not set
278CONFIG_IEEE80211=y
279# CONFIG_IEEE80211_DEBUG is not set
280CONFIG_IEEE80211_CRYPT_WEP=y
281CONFIG_IEEE80211_CRYPT_CCMP=y
282CONFIG_IEEE80211_CRYPT_TKIP=y
283
284#
158# Device Drivers 285# Device Drivers
159# 286#
160 287
@@ -166,6 +293,11 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
166# CONFIG_FW_LOADER is not set 293# CONFIG_FW_LOADER is not set
167 294
168# 295#
296# Connector - unified userspace <-> kernelspace linker
297#
298CONFIG_CONNECTOR=y
299
300#
169# Memory Technology Devices (MTD) 301# Memory Technology Devices (MTD)
170# 302#
171# CONFIG_MTD is not set 303# CONFIG_MTD is not set
@@ -182,13 +314,11 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
182# 314#
183# Block devices 315# Block devices
184# 316#
185# CONFIG_BLK_DEV_FD is not set
186# CONFIG_BLK_DEV_COW_COMMON is not set 317# CONFIG_BLK_DEV_COW_COMMON is not set
187# CONFIG_BLK_DEV_LOOP is not set 318# CONFIG_BLK_DEV_LOOP is not set
188# CONFIG_BLK_DEV_NBD is not set 319# CONFIG_BLK_DEV_NBD is not set
189# CONFIG_BLK_DEV_RAM is not set 320# CONFIG_BLK_DEV_RAM is not set
190CONFIG_BLK_DEV_RAM_COUNT=16 321CONFIG_BLK_DEV_RAM_COUNT=16
191CONFIG_INITRAMFS_SOURCE=""
192# CONFIG_LBD is not set 322# CONFIG_LBD is not set
193CONFIG_CDROM_PKTCDVD=y 323CONFIG_CDROM_PKTCDVD=y
194CONFIG_CDROM_PKTCDVD_BUFFERS=8 324CONFIG_CDROM_PKTCDVD_BUFFERS=8
@@ -211,6 +341,7 @@ CONFIG_ATA_OVER_ETH=y
211# 341#
212# SCSI device support 342# SCSI device support
213# 343#
344CONFIG_RAID_ATTRS=y
214# CONFIG_SCSI is not set 345# CONFIG_SCSI is not set
215 346
216# 347#
@@ -221,6 +352,7 @@ CONFIG_ATA_OVER_ETH=y
221# 352#
222# Fusion MPT device support 353# Fusion MPT device support
223# 354#
355# CONFIG_FUSION is not set
224 356
225# 357#
226# IEEE 1394 (FireWire) support 358# IEEE 1394 (FireWire) support
@@ -231,77 +363,28 @@ CONFIG_ATA_OVER_ETH=y
231# 363#
232 364
233# 365#
234# Networking support 366# Network device support
235#
236CONFIG_NET=y
237
238#
239# Networking options
240# 367#
241# CONFIG_PACKET is not set 368CONFIG_NETDEVICES=y
242CONFIG_NETLINK_DEV=y 369# CONFIG_DUMMY is not set
243CONFIG_UNIX=y 370# CONFIG_BONDING is not set
244CONFIG_NET_KEY=y 371# CONFIG_EQUALIZER is not set
245CONFIG_INET=y 372# CONFIG_TUN is not set
246# CONFIG_IP_MULTICAST is not set
247# CONFIG_IP_ADVANCED_ROUTER is not set
248CONFIG_IP_PNP=y
249# CONFIG_IP_PNP_DHCP is not set
250CONFIG_IP_PNP_BOOTP=y
251# CONFIG_IP_PNP_RARP is not set
252# CONFIG_NET_IPIP is not set
253# CONFIG_NET_IPGRE is not set
254# CONFIG_ARPD is not set
255# CONFIG_SYN_COOKIES is not set
256# CONFIG_INET_AH is not set
257# CONFIG_INET_ESP is not set
258# CONFIG_INET_IPCOMP is not set
259CONFIG_INET_TUNNEL=y
260CONFIG_IP_TCPDIAG=y
261# CONFIG_IP_TCPDIAG_IPV6 is not set
262# CONFIG_IPV6 is not set
263# CONFIG_NETFILTER is not set
264CONFIG_XFRM=y
265CONFIG_XFRM_USER=y
266
267#
268# SCTP Configuration (EXPERIMENTAL)
269#
270# CONFIG_IP_SCTP is not set
271# CONFIG_ATM is not set
272# CONFIG_BRIDGE is not set
273# CONFIG_VLAN_8021Q is not set
274# CONFIG_DECNET is not set
275# CONFIG_LLC2 is not set
276# CONFIG_IPX is not set
277# CONFIG_ATALK is not set
278# CONFIG_X25 is not set
279# CONFIG_LAPB is not set
280# CONFIG_NET_DIVERT is not set
281# CONFIG_ECONET is not set
282# CONFIG_WAN_ROUTER is not set
283 373
284# 374#
285# QoS and/or fair queueing 375# PHY device support
286# 376#
287# CONFIG_NET_SCHED is not set 377CONFIG_PHYLIB=y
288# CONFIG_NET_CLS_ROUTE is not set 378CONFIG_PHYCONTROL=y
289 379
290# 380#
291# Network testing 381# MII PHY device drivers
292# 382#
293# CONFIG_NET_PKTGEN is not set 383CONFIG_MARVELL_PHY=y
294# CONFIG_NETPOLL is not set 384CONFIG_DAVICOM_PHY=y
295# CONFIG_NET_POLL_CONTROLLER is not set 385CONFIG_QSEMI_PHY=y
296# CONFIG_HAMRADIO is not set 386CONFIG_LXT_PHY=y
297# CONFIG_IRDA is not set 387CONFIG_CICADA_PHY=y
298# CONFIG_BT is not set
299CONFIG_NETDEVICES=y
300# CONFIG_DUMMY is not set
301# CONFIG_BONDING is not set
302# CONFIG_EQUALIZER is not set
303# CONFIG_TUN is not set
304# CONFIG_ETHERTAP is not set
305 388
306# 389#
307# Ethernet (10 or 100Mbit) 390# Ethernet (10 or 100Mbit)
@@ -334,6 +417,8 @@ CONFIG_NET_ETHERNET=y
334# CONFIG_SLIP is not set 417# CONFIG_SLIP is not set
335# CONFIG_SHAPER is not set 418# CONFIG_SHAPER is not set
336# CONFIG_NETCONSOLE is not set 419# CONFIG_NETCONSOLE is not set
420# CONFIG_NETPOLL is not set
421# CONFIG_NET_POLL_CONTROLLER is not set
337 422
338# 423#
339# ISDN subsystem 424# ISDN subsystem
@@ -363,18 +448,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
363# CONFIG_INPUT_EVBUG is not set 448# CONFIG_INPUT_EVBUG is not set
364 449
365# 450#
366# Input I/O drivers
367#
368# CONFIG_GAMEPORT is not set
369CONFIG_SOUND_GAMEPORT=y
370CONFIG_SERIO=y
371# CONFIG_SERIO_I8042 is not set
372CONFIG_SERIO_SERPORT=y
373# CONFIG_SERIO_CT82C710 is not set
374# CONFIG_SERIO_LIBPS2 is not set
375CONFIG_SERIO_RAW=y
376
377#
378# Input Device Drivers 451# Input Device Drivers
379# 452#
380# CONFIG_INPUT_KEYBOARD is not set 453# CONFIG_INPUT_KEYBOARD is not set
@@ -384,6 +457,16 @@ CONFIG_SERIO_RAW=y
384# CONFIG_INPUT_MISC is not set 457# CONFIG_INPUT_MISC is not set
385 458
386# 459#
460# Hardware I/O ports
461#
462CONFIG_SERIO=y
463# CONFIG_SERIO_I8042 is not set
464CONFIG_SERIO_SERPORT=y
465# CONFIG_SERIO_LIBPS2 is not set
466CONFIG_SERIO_RAW=y
467# CONFIG_GAMEPORT is not set
468
469#
387# Character devices 470# Character devices
388# 471#
389CONFIG_VT=y 472CONFIG_VT=y
@@ -425,10 +508,13 @@ CONFIG_LEGACY_PTY_COUNT=256
425# 508#
426# Ftape, the floppy tape device driver 509# Ftape, the floppy tape device driver
427# 510#
428# CONFIG_DRM is not set
429# CONFIG_RAW_DRIVER is not set 511# CONFIG_RAW_DRIVER is not set
430 512
431# 513#
514# TPM devices
515#
516
517#
432# I2C support 518# I2C support
433# 519#
434# CONFIG_I2C is not set 520# CONFIG_I2C is not set
@@ -439,10 +525,20 @@ CONFIG_LEGACY_PTY_COUNT=256
439# CONFIG_W1 is not set 525# CONFIG_W1 is not set
440 526
441# 527#
528# Hardware Monitoring support
529#
530# CONFIG_HWMON is not set
531# CONFIG_HWMON_VID is not set
532
533#
442# Misc devices 534# Misc devices
443# 535#
444 536
445# 537#
538# Multimedia Capabilities Port drivers
539#
540
541#
446# Multimedia devices 542# Multimedia devices
447# 543#
448# CONFIG_VIDEO_DEV is not set 544# CONFIG_VIDEO_DEV is not set
@@ -462,7 +558,6 @@ CONFIG_LEGACY_PTY_COUNT=256
462# 558#
463# CONFIG_VGA_CONSOLE is not set 559# CONFIG_VGA_CONSOLE is not set
464CONFIG_DUMMY_CONSOLE=y 560CONFIG_DUMMY_CONSOLE=y
465# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
466 561
467# 562#
468# Sound 563# Sound
@@ -476,10 +571,6 @@ CONFIG_DUMMY_CONSOLE=y
476# CONFIG_USB_ARCH_HAS_OHCI is not set 571# CONFIG_USB_ARCH_HAS_OHCI is not set
477 572
478# 573#
479# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
480#
481
482#
483# USB Gadget Support 574# USB Gadget Support
484# 575#
485# CONFIG_USB_GADGET is not set 576# CONFIG_USB_GADGET is not set
@@ -492,24 +583,31 @@ CONFIG_DUMMY_CONSOLE=y
492# 583#
493# InfiniBand support 584# InfiniBand support
494# 585#
495# CONFIG_INFINIBAND is not set 586
587#
588# SN Devices
589#
496 590
497# 591#
498# File systems 592# File systems
499# 593#
500CONFIG_EXT2_FS=y 594CONFIG_EXT2_FS=y
501# CONFIG_EXT2_FS_XATTR is not set 595# CONFIG_EXT2_FS_XATTR is not set
596# CONFIG_EXT2_FS_XIP is not set
502# CONFIG_EXT3_FS is not set 597# CONFIG_EXT3_FS is not set
503# CONFIG_JBD is not set 598# CONFIG_JBD is not set
504# CONFIG_REISERFS_FS is not set 599# CONFIG_REISERFS_FS is not set
505# CONFIG_JFS_FS is not set 600# CONFIG_JFS_FS is not set
601# CONFIG_FS_POSIX_ACL is not set
506# CONFIG_XFS_FS is not set 602# CONFIG_XFS_FS is not set
507# CONFIG_MINIX_FS is not set 603# CONFIG_MINIX_FS is not set
508# CONFIG_ROMFS_FS is not set 604# CONFIG_ROMFS_FS is not set
605CONFIG_INOTIFY=y
509# CONFIG_QUOTA is not set 606# CONFIG_QUOTA is not set
510CONFIG_DNOTIFY=y 607CONFIG_DNOTIFY=y
511# CONFIG_AUTOFS_FS is not set 608# CONFIG_AUTOFS_FS is not set
512# CONFIG_AUTOFS4_FS is not set 609# CONFIG_AUTOFS4_FS is not set
610CONFIG_FUSE_FS=y
513 611
514# 612#
515# CD-ROM/DVD Filesystems 613# CD-ROM/DVD Filesystems
@@ -530,12 +628,10 @@ CONFIG_DNOTIFY=y
530CONFIG_PROC_FS=y 628CONFIG_PROC_FS=y
531CONFIG_PROC_KCORE=y 629CONFIG_PROC_KCORE=y
532CONFIG_SYSFS=y 630CONFIG_SYSFS=y
533# CONFIG_DEVFS_FS is not set
534CONFIG_DEVPTS_FS_XATTR=y
535CONFIG_DEVPTS_FS_SECURITY=y
536# CONFIG_TMPFS is not set 631# CONFIG_TMPFS is not set
537# CONFIG_HUGETLB_PAGE is not set 632# CONFIG_HUGETLB_PAGE is not set
538CONFIG_RAMFS=y 633CONFIG_RAMFS=y
634CONFIG_RELAYFS_FS=y
539 635
540# 636#
541# Miscellaneous filesystems 637# Miscellaneous filesystems
@@ -567,6 +663,7 @@ CONFIG_NFSD=y
567CONFIG_ROOT_NFS=y 663CONFIG_ROOT_NFS=y
568CONFIG_LOCKD=y 664CONFIG_LOCKD=y
569CONFIG_EXPORTFS=y 665CONFIG_EXPORTFS=y
666CONFIG_NFS_COMMON=y
570CONFIG_SUNRPC=y 667CONFIG_SUNRPC=y
571# CONFIG_RPCSEC_GSS_KRB5 is not set 668# CONFIG_RPCSEC_GSS_KRB5 is not set
572# CONFIG_RPCSEC_GSS_SPKM3 is not set 669# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -575,6 +672,7 @@ CONFIG_SUNRPC=y
575# CONFIG_NCP_FS is not set 672# CONFIG_NCP_FS is not set
576# CONFIG_CODA_FS is not set 673# CONFIG_CODA_FS is not set
577# CONFIG_AFS_FS is not set 674# CONFIG_AFS_FS is not set
675# CONFIG_9P_FS is not set
578 676
579# 677#
580# Partition Types 678# Partition Types
@@ -595,7 +693,9 @@ CONFIG_MSDOS_PARTITION=y
595# 693#
596# Kernel hacking 694# Kernel hacking
597# 695#
696# CONFIG_PRINTK_TIME is not set
598# CONFIG_DEBUG_KERNEL is not set 697# CONFIG_DEBUG_KERNEL is not set
698CONFIG_LOG_BUF_SHIFT=14
599CONFIG_CROSSCOMPILE=y 699CONFIG_CROSSCOMPILE=y
600CONFIG_CMDLINE="" 700CONFIG_CMDLINE=""
601 701
@@ -609,7 +709,31 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
609# 709#
610# Cryptographic options 710# Cryptographic options
611# 711#
612# CONFIG_CRYPTO is not set 712CONFIG_CRYPTO=y
713CONFIG_CRYPTO_HMAC=y
714CONFIG_CRYPTO_NULL=y
715CONFIG_CRYPTO_MD4=y
716CONFIG_CRYPTO_MD5=y
717CONFIG_CRYPTO_SHA1=y
718CONFIG_CRYPTO_SHA256=y
719CONFIG_CRYPTO_SHA512=y
720CONFIG_CRYPTO_WP512=y
721CONFIG_CRYPTO_TGR192=y
722CONFIG_CRYPTO_DES=y
723CONFIG_CRYPTO_BLOWFISH=y
724CONFIG_CRYPTO_TWOFISH=y
725CONFIG_CRYPTO_SERPENT=y
726CONFIG_CRYPTO_AES=y
727CONFIG_CRYPTO_CAST5=y
728CONFIG_CRYPTO_CAST6=y
729CONFIG_CRYPTO_TEA=y
730CONFIG_CRYPTO_ARC4=y
731CONFIG_CRYPTO_KHAZAD=y
732CONFIG_CRYPTO_ANUBIS=y
733CONFIG_CRYPTO_DEFLATE=y
734CONFIG_CRYPTO_MICHAEL_MIC=y
735CONFIG_CRYPTO_CRC32C=y
736# CONFIG_CRYPTO_TEST is not set
613 737
614# 738#
615# Hardware crypto devices 739# Hardware crypto devices
@@ -619,7 +743,8 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
619# Library routines 743# Library routines
620# 744#
621# CONFIG_CRC_CCITT is not set 745# CONFIG_CRC_CCITT is not set
622# CONFIG_CRC32 is not set 746CONFIG_CRC16=y
623# CONFIG_LIBCRC32C is not set 747CONFIG_CRC32=y
624CONFIG_GENERIC_HARDIRQS=y 748CONFIG_LIBCRC32C=y
625CONFIG_GENERIC_IRQ_PROBE=y 749CONFIG_ZLIB_INFLATE=y
750CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/mips/configs/ocelot_g_defconfig b/arch/mips/configs/ocelot_g_defconfig
index ef5ea50893d1..e2d5188cdc15 100644
--- a/arch/mips/configs/ocelot_g_defconfig
+++ b/arch/mips/configs/ocelot_g_defconfig
@@ -1,11 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:08 2005 4# Thu Oct 20 22:26:38 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7CONFIG_64BIT=y
8CONFIG_64BIT=y
9 7
10# 8#
11# Code maturity level options 9# Code maturity level options
@@ -13,24 +11,29 @@ CONFIG_64BIT=y
13CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
14CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
15CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
16 15
17# 16#
18# General setup 17# General setup
19# 18#
20CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
21CONFIG_SWAP=y 21CONFIG_SWAP=y
22CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
23# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
24# CONFIG_BSD_PROCESS_ACCT is not set 24# CONFIG_BSD_PROCESS_ACCT is not set
25CONFIG_SYSCTL=y 25CONFIG_SYSCTL=y
26# CONFIG_AUDIT is not set 26# CONFIG_AUDIT is not set
27CONFIG_LOG_BUF_SHIFT=14 27CONFIG_HOTPLUG=y
28# CONFIG_HOTPLUG is not set
29CONFIG_KOBJECT_UEVENT=y 28CONFIG_KOBJECT_UEVENT=y
30# CONFIG_IKCONFIG is not set 29# CONFIG_IKCONFIG is not set
30CONFIG_INITRAMFS_SOURCE=""
31CONFIG_EMBEDDED=y 31CONFIG_EMBEDDED=y
32CONFIG_KALLSYMS=y 32CONFIG_KALLSYMS=y
33# CONFIG_KALLSYMS_EXTRA_PASS is not set 33# CONFIG_KALLSYMS_EXTRA_PASS is not set
34CONFIG_PRINTK=y
35CONFIG_BUG=y
36CONFIG_BASE_FULL=y
34CONFIG_FUTEX=y 37CONFIG_FUTEX=y
35CONFIG_EPOLL=y 38CONFIG_EPOLL=y
36# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -40,6 +43,7 @@ CONFIG_CC_ALIGN_LABELS=0
40CONFIG_CC_ALIGN_LOOPS=0 43CONFIG_CC_ALIGN_LOOPS=0
41CONFIG_CC_ALIGN_JUMPS=0 44CONFIG_CC_ALIGN_JUMPS=0
42# CONFIG_TINY_SHMEM is not set 45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
43 47
44# 48#
45# Loadable module support 49# Loadable module support
@@ -49,39 +53,68 @@ CONFIG_CC_ALIGN_JUMPS=0
49# 53#
50# Machine selection 54# Machine selection
51# 55#
52# CONFIG_MACH_JAZZ is not set 56# CONFIG_MIPS_MTX1 is not set
53# CONFIG_MACH_VR41XX is not set 57# CONFIG_MIPS_BOSPORUS is not set
58# CONFIG_MIPS_PB1000 is not set
59# CONFIG_MIPS_PB1100 is not set
60# CONFIG_MIPS_PB1500 is not set
61# CONFIG_MIPS_PB1550 is not set
62# CONFIG_MIPS_PB1200 is not set
63# CONFIG_MIPS_DB1000 is not set
64# CONFIG_MIPS_DB1100 is not set
65# CONFIG_MIPS_DB1500 is not set
66# CONFIG_MIPS_DB1550 is not set
67# CONFIG_MIPS_DB1200 is not set
68# CONFIG_MIPS_MIRAGE is not set
54# CONFIG_MIPS_COBALT is not set 69# CONFIG_MIPS_COBALT is not set
55# CONFIG_MACH_DECSTATION is not set 70# CONFIG_MACH_DECSTATION is not set
56# CONFIG_MIPS_EV64120 is not set 71# CONFIG_MIPS_EV64120 is not set
57# CONFIG_MIPS_EV96100 is not set 72# CONFIG_MIPS_EV96100 is not set
58# CONFIG_MIPS_IVR is not set 73# CONFIG_MIPS_IVR is not set
59# CONFIG_LASAT is not set
60# CONFIG_MIPS_ITE8172 is not set 74# CONFIG_MIPS_ITE8172 is not set
75# CONFIG_MACH_JAZZ is not set
76# CONFIG_LASAT is not set
61# CONFIG_MIPS_ATLAS is not set 77# CONFIG_MIPS_ATLAS is not set
62# CONFIG_MIPS_MALTA is not set 78# CONFIG_MIPS_MALTA is not set
63# CONFIG_MIPS_SEAD is not set 79# CONFIG_MIPS_SEAD is not set
80# CONFIG_MIPS_SIM is not set
81# CONFIG_MOMENCO_JAGUAR_ATX is not set
64# CONFIG_MOMENCO_OCELOT is not set 82# CONFIG_MOMENCO_OCELOT is not set
65CONFIG_MOMENCO_OCELOT_G=y
66# CONFIG_MOMENCO_OCELOT_C is not set
67# CONFIG_MOMENCO_OCELOT_3 is not set 83# CONFIG_MOMENCO_OCELOT_3 is not set
68# CONFIG_MOMENCO_JAGUAR_ATX is not set 84# CONFIG_MOMENCO_OCELOT_C is not set
69# CONFIG_PMC_YOSEMITE is not set 85CONFIG_MOMENCO_OCELOT_G=y
86# CONFIG_MIPS_XXS1500 is not set
87# CONFIG_PNX8550_V2PCI is not set
88# CONFIG_PNX8550_JBS is not set
70# CONFIG_DDB5074 is not set 89# CONFIG_DDB5074 is not set
71# CONFIG_DDB5476 is not set 90# CONFIG_DDB5476 is not set
72# CONFIG_DDB5477 is not set 91# CONFIG_DDB5477 is not set
73# CONFIG_NEC_OSPREY is not set 92# CONFIG_MACH_VR41XX is not set
93# CONFIG_PMC_YOSEMITE is not set
94# CONFIG_QEMU is not set
74# CONFIG_SGI_IP22 is not set 95# CONFIG_SGI_IP22 is not set
75# CONFIG_SGI_IP27 is not set 96# CONFIG_SGI_IP27 is not set
76# CONFIG_SGI_IP32 is not set 97# CONFIG_SGI_IP32 is not set
77# CONFIG_SIBYTE_SB1xxx_SOC is not set 98# CONFIG_SIBYTE_BIGSUR is not set
99# CONFIG_SIBYTE_SWARM is not set
100# CONFIG_SIBYTE_SENTOSA is not set
101# CONFIG_SIBYTE_RHONE is not set
102# CONFIG_SIBYTE_CARMEL is not set
103# CONFIG_SIBYTE_PTSWARM is not set
104# CONFIG_SIBYTE_LITTLESUR is not set
105# CONFIG_SIBYTE_CRHINE is not set
106# CONFIG_SIBYTE_CRHONE is not set
78# CONFIG_SNI_RM200_PCI is not set 107# CONFIG_SNI_RM200_PCI is not set
108# CONFIG_TOSHIBA_JMR3927 is not set
109# CONFIG_TOSHIBA_RBTX4927 is not set
110# CONFIG_TOSHIBA_RBTX4938 is not set
79CONFIG_RWSEM_GENERIC_SPINLOCK=y 111CONFIG_RWSEM_GENERIC_SPINLOCK=y
80CONFIG_GENERIC_CALIBRATE_DELAY=y 112CONFIG_GENERIC_CALIBRATE_DELAY=y
81CONFIG_HAVE_DEC_LOCK=y
82CONFIG_DMA_NONCOHERENT=y 113CONFIG_DMA_NONCOHERENT=y
83CONFIG_DMA_NEED_PCI_MAP_STATE=y 114CONFIG_DMA_NEED_PCI_MAP_STATE=y
115CONFIG_CPU_BIG_ENDIAN=y
84# CONFIG_CPU_LITTLE_ENDIAN is not set 116# CONFIG_CPU_LITTLE_ENDIAN is not set
117CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
85CONFIG_IRQ_CPU=y 118CONFIG_IRQ_CPU=y
86CONFIG_IRQ_CPU_RM7K=y 119CONFIG_IRQ_CPU_RM7K=y
87CONFIG_PCI_MARVELL=y 120CONFIG_PCI_MARVELL=y
@@ -94,8 +127,10 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
94# 127#
95# CPU selection 128# CPU selection
96# 129#
97# CONFIG_CPU_MIPS32 is not set 130# CONFIG_CPU_MIPS32_R1 is not set
98# CONFIG_CPU_MIPS64 is not set 131# CONFIG_CPU_MIPS32_R2 is not set
132# CONFIG_CPU_MIPS64_R1 is not set
133# CONFIG_CPU_MIPS64_R2 is not set
99# CONFIG_CPU_R3000 is not set 134# CONFIG_CPU_R3000 is not set
100# CONFIG_CPU_TX39XX is not set 135# CONFIG_CPU_TX39XX is not set
101# CONFIG_CPU_VR41XX is not set 136# CONFIG_CPU_VR41XX is not set
@@ -111,6 +146,17 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
111CONFIG_CPU_RM7000=y 146CONFIG_CPU_RM7000=y
112# CONFIG_CPU_RM9000 is not set 147# CONFIG_CPU_RM9000 is not set
113# CONFIG_CPU_SB1 is not set 148# CONFIG_CPU_SB1 is not set
149CONFIG_SYS_HAS_CPU_RM7000=y
150CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
151CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
152CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
153CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
154
155#
156# Kernel type
157#
158# CONFIG_32BIT is not set
159CONFIG_64BIT=y
114CONFIG_PAGE_SIZE_4KB=y 160CONFIG_PAGE_SIZE_4KB=y
115# CONFIG_PAGE_SIZE_8KB is not set 161# CONFIG_PAGE_SIZE_8KB is not set
116# CONFIG_PAGE_SIZE_16KB is not set 162# CONFIG_PAGE_SIZE_16KB is not set
@@ -118,9 +164,23 @@ CONFIG_PAGE_SIZE_4KB=y
118CONFIG_BOARD_SCACHE=y 164CONFIG_BOARD_SCACHE=y
119CONFIG_RM7000_CPU_SCACHE=y 165CONFIG_RM7000_CPU_SCACHE=y
120CONFIG_CPU_HAS_PREFETCH=y 166CONFIG_CPU_HAS_PREFETCH=y
167# CONFIG_MIPS_MT is not set
121CONFIG_CPU_HAS_LLSC=y 168CONFIG_CPU_HAS_LLSC=y
122CONFIG_CPU_HAS_LLDSCD=y 169CONFIG_CPU_HAS_LLDSCD=y
123CONFIG_CPU_HAS_SYNC=y 170CONFIG_CPU_HAS_SYNC=y
171CONFIG_GENERIC_HARDIRQS=y
172CONFIG_GENERIC_IRQ_PROBE=y
173CONFIG_CPU_SUPPORTS_HIGHMEM=y
174CONFIG_ARCH_FLATMEM_ENABLE=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_PREEMPT_NONE=y
183# CONFIG_PREEMPT_VOLUNTARY is not set
124# CONFIG_PREEMPT is not set 184# CONFIG_PREEMPT is not set
125 185
126# 186#
@@ -129,7 +189,6 @@ CONFIG_CPU_HAS_SYNC=y
129CONFIG_HW_HAS_PCI=y 189CONFIG_HW_HAS_PCI=y
130CONFIG_PCI=y 190CONFIG_PCI=y
131CONFIG_PCI_LEGACY_PROC=y 191CONFIG_PCI_LEGACY_PROC=y
132CONFIG_PCI_NAMES=y
133CONFIG_MMU=y 192CONFIG_MMU=y
134 193
135# 194#
@@ -138,10 +197,6 @@ CONFIG_MMU=y
138# CONFIG_PCCARD is not set 197# CONFIG_PCCARD is not set
139 198
140# 199#
141# PC-card bridges
142#
143
144#
145# PCI Hotplug Support 200# PCI Hotplug Support
146# 201#
147# CONFIG_HOTPLUG_PCI is not set 202# CONFIG_HOTPLUG_PCI is not set
@@ -159,6 +214,79 @@ CONFIG_MIPS32_N32=y
159CONFIG_BINFMT_ELF32=y 214CONFIG_BINFMT_ELF32=y
160 215
161# 216#
217# Networking
218#
219CONFIG_NET=y
220
221#
222# Networking options
223#
224# CONFIG_PACKET is not set
225CONFIG_UNIX=y
226CONFIG_XFRM=y
227CONFIG_XFRM_USER=y
228CONFIG_NET_KEY=y
229CONFIG_INET=y
230# CONFIG_IP_MULTICAST is not set
231# CONFIG_IP_ADVANCED_ROUTER is not set
232CONFIG_IP_FIB_HASH=y
233CONFIG_IP_PNP=y
234CONFIG_IP_PNP_DHCP=y
235# CONFIG_IP_PNP_BOOTP is not set
236# CONFIG_IP_PNP_RARP is not set
237# CONFIG_NET_IPIP is not set
238# CONFIG_NET_IPGRE is not set
239# CONFIG_ARPD is not set
240# CONFIG_SYN_COOKIES is not set
241# CONFIG_INET_AH is not set
242# CONFIG_INET_ESP is not set
243# CONFIG_INET_IPCOMP is not set
244CONFIG_INET_TUNNEL=y
245CONFIG_INET_DIAG=y
246CONFIG_INET_TCP_DIAG=y
247# CONFIG_TCP_CONG_ADVANCED is not set
248CONFIG_TCP_CONG_BIC=y
249# CONFIG_IPV6 is not set
250# CONFIG_NETFILTER is not set
251
252#
253# DCCP Configuration (EXPERIMENTAL)
254#
255# CONFIG_IP_DCCP is not set
256
257#
258# SCTP Configuration (EXPERIMENTAL)
259#
260# CONFIG_IP_SCTP is not set
261# CONFIG_ATM is not set
262# CONFIG_BRIDGE is not set
263# CONFIG_VLAN_8021Q is not set
264# CONFIG_DECNET is not set
265# CONFIG_LLC2 is not set
266# CONFIG_IPX is not set
267# CONFIG_ATALK is not set
268# CONFIG_X25 is not set
269# CONFIG_LAPB is not set
270# CONFIG_NET_DIVERT is not set
271# CONFIG_ECONET is not set
272# CONFIG_WAN_ROUTER is not set
273# CONFIG_NET_SCHED is not set
274# CONFIG_NET_CLS_ROUTE is not set
275
276#
277# Network testing
278#
279# CONFIG_NET_PKTGEN is not set
280# CONFIG_HAMRADIO is not set
281# CONFIG_IRDA is not set
282# CONFIG_BT is not set
283CONFIG_IEEE80211=y
284# CONFIG_IEEE80211_DEBUG is not set
285CONFIG_IEEE80211_CRYPT_WEP=y
286CONFIG_IEEE80211_CRYPT_CCMP=y
287CONFIG_IEEE80211_CRYPT_TKIP=y
288
289#
162# Device Drivers 290# Device Drivers
163# 291#
164 292
@@ -167,7 +295,12 @@ CONFIG_BINFMT_ELF32=y
167# 295#
168CONFIG_STANDALONE=y 296CONFIG_STANDALONE=y
169CONFIG_PREVENT_FIRMWARE_BUILD=y 297CONFIG_PREVENT_FIRMWARE_BUILD=y
170# CONFIG_FW_LOADER is not set 298CONFIG_FW_LOADER=y
299
300#
301# Connector - unified userspace <-> kernelspace linker
302#
303CONFIG_CONNECTOR=y
171 304
172# 305#
173# Memory Technology Devices (MTD) 306# Memory Technology Devices (MTD)
@@ -186,7 +319,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
186# 319#
187# Block devices 320# Block devices
188# 321#
189# CONFIG_BLK_DEV_FD is not set
190# CONFIG_BLK_CPQ_DA is not set 322# CONFIG_BLK_CPQ_DA is not set
191# CONFIG_BLK_CPQ_CISS_DA is not set 323# CONFIG_BLK_CPQ_CISS_DA is not set
192# CONFIG_BLK_DEV_DAC960 is not set 324# CONFIG_BLK_DEV_DAC960 is not set
@@ -197,7 +329,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
197# CONFIG_BLK_DEV_SX8 is not set 329# CONFIG_BLK_DEV_SX8 is not set
198# CONFIG_BLK_DEV_RAM is not set 330# CONFIG_BLK_DEV_RAM is not set
199CONFIG_BLK_DEV_RAM_COUNT=16 331CONFIG_BLK_DEV_RAM_COUNT=16
200CONFIG_INITRAMFS_SOURCE=""
201CONFIG_CDROM_PKTCDVD=y 332CONFIG_CDROM_PKTCDVD=y
202CONFIG_CDROM_PKTCDVD_BUFFERS=8 333CONFIG_CDROM_PKTCDVD_BUFFERS=8
203# CONFIG_CDROM_PKTCDVD_WCACHE is not set 334# CONFIG_CDROM_PKTCDVD_WCACHE is not set
@@ -219,6 +350,7 @@ CONFIG_ATA_OVER_ETH=y
219# 350#
220# SCSI device support 351# SCSI device support
221# 352#
353CONFIG_RAID_ATTRS=y
222# CONFIG_SCSI is not set 354# CONFIG_SCSI is not set
223 355
224# 356#
@@ -229,6 +361,7 @@ CONFIG_ATA_OVER_ETH=y
229# 361#
230# Fusion MPT device support 362# Fusion MPT device support
231# 363#
364# CONFIG_FUSION is not set
232 365
233# 366#
234# IEEE 1394 (FireWire) support 367# IEEE 1394 (FireWire) support
@@ -241,77 +374,13 @@ CONFIG_ATA_OVER_ETH=y
241# CONFIG_I2O is not set 374# CONFIG_I2O is not set
242 375
243# 376#
244# Networking support 377# Network device support
245#
246CONFIG_NET=y
247
248#
249# Networking options
250#
251# CONFIG_PACKET is not set
252CONFIG_NETLINK_DEV=y
253CONFIG_UNIX=y
254CONFIG_NET_KEY=y
255CONFIG_INET=y
256# CONFIG_IP_MULTICAST is not set
257# CONFIG_IP_ADVANCED_ROUTER is not set
258CONFIG_IP_PNP=y
259CONFIG_IP_PNP_DHCP=y
260# CONFIG_IP_PNP_BOOTP is not set
261# CONFIG_IP_PNP_RARP is not set
262# CONFIG_NET_IPIP is not set
263# CONFIG_NET_IPGRE is not set
264# CONFIG_ARPD is not set
265# CONFIG_SYN_COOKIES is not set
266# CONFIG_INET_AH is not set
267# CONFIG_INET_ESP is not set
268# CONFIG_INET_IPCOMP is not set
269CONFIG_INET_TUNNEL=y
270CONFIG_IP_TCPDIAG=y
271# CONFIG_IP_TCPDIAG_IPV6 is not set
272# CONFIG_IPV6 is not set
273# CONFIG_NETFILTER is not set
274CONFIG_XFRM=y
275CONFIG_XFRM_USER=y
276
277#
278# SCTP Configuration (EXPERIMENTAL)
279#
280# CONFIG_IP_SCTP is not set
281# CONFIG_ATM is not set
282# CONFIG_BRIDGE is not set
283# CONFIG_VLAN_8021Q is not set
284# CONFIG_DECNET is not set
285# CONFIG_LLC2 is not set
286# CONFIG_IPX is not set
287# CONFIG_ATALK is not set
288# CONFIG_X25 is not set
289# CONFIG_LAPB is not set
290# CONFIG_NET_DIVERT is not set
291# CONFIG_ECONET is not set
292# CONFIG_WAN_ROUTER is not set
293
294#
295# QoS and/or fair queueing
296#
297# CONFIG_NET_SCHED is not set
298# CONFIG_NET_CLS_ROUTE is not set
299
300#
301# Network testing
302# 378#
303# CONFIG_NET_PKTGEN is not set
304# CONFIG_NETPOLL is not set
305# CONFIG_NET_POLL_CONTROLLER is not set
306# CONFIG_HAMRADIO is not set
307# CONFIG_IRDA is not set
308# CONFIG_BT is not set
309CONFIG_NETDEVICES=y 379CONFIG_NETDEVICES=y
310# CONFIG_DUMMY is not set 380# CONFIG_DUMMY is not set
311# CONFIG_BONDING is not set 381# CONFIG_BONDING is not set
312# CONFIG_EQUALIZER is not set 382# CONFIG_EQUALIZER is not set
313# CONFIG_TUN is not set 383# CONFIG_TUN is not set
314# CONFIG_ETHERTAP is not set
315 384
316# 385#
317# ARCnet devices 386# ARCnet devices
@@ -319,6 +388,21 @@ CONFIG_NETDEVICES=y
319# CONFIG_ARCNET is not set 388# CONFIG_ARCNET is not set
320 389
321# 390#
391# PHY device support
392#
393CONFIG_PHYLIB=y
394CONFIG_PHYCONTROL=y
395
396#
397# MII PHY device drivers
398#
399CONFIG_MARVELL_PHY=y
400CONFIG_DAVICOM_PHY=y
401CONFIG_QSEMI_PHY=y
402CONFIG_LXT_PHY=y
403CONFIG_CICADA_PHY=y
404
405#
322# Ethernet (10 or 100Mbit) 406# Ethernet (10 or 100Mbit)
323# 407#
324CONFIG_NET_ETHERNET=y 408CONFIG_NET_ETHERNET=y
@@ -345,12 +429,16 @@ CONFIG_GALILEO_64240_ETH=y
345# CONFIG_HAMACHI is not set 429# CONFIG_HAMACHI is not set
346# CONFIG_YELLOWFIN is not set 430# CONFIG_YELLOWFIN is not set
347# CONFIG_R8169 is not set 431# CONFIG_R8169 is not set
432# CONFIG_SIS190 is not set
433# CONFIG_SKGE is not set
348# CONFIG_SK98LIN is not set 434# CONFIG_SK98LIN is not set
349# CONFIG_TIGON3 is not set 435# CONFIG_TIGON3 is not set
436# CONFIG_BNX2 is not set
350 437
351# 438#
352# Ethernet (10000 Mbit) 439# Ethernet (10000 Mbit)
353# 440#
441# CONFIG_CHELSIO_T1 is not set
354# CONFIG_IXGB is not set 442# CONFIG_IXGB is not set
355# CONFIG_S2IO is not set 443# CONFIG_S2IO is not set
356 444
@@ -363,6 +451,8 @@ CONFIG_GALILEO_64240_ETH=y
363# Wireless LAN (non-hamradio) 451# Wireless LAN (non-hamradio)
364# 452#
365# CONFIG_NET_RADIO is not set 453# CONFIG_NET_RADIO is not set
454# CONFIG_IPW_DEBUG is not set
455CONFIG_IPW2200=y
366 456
367# 457#
368# Wan interfaces 458# Wan interfaces
@@ -374,6 +464,8 @@ CONFIG_GALILEO_64240_ETH=y
374# CONFIG_SLIP is not set 464# CONFIG_SLIP is not set
375# CONFIG_SHAPER is not set 465# CONFIG_SHAPER is not set
376# CONFIG_NETCONSOLE is not set 466# CONFIG_NETCONSOLE is not set
467# CONFIG_NETPOLL is not set
468# CONFIG_NET_POLL_CONTROLLER is not set
377 469
378# 470#
379# ISDN subsystem 471# ISDN subsystem
@@ -403,19 +495,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
403# CONFIG_INPUT_EVBUG is not set 495# CONFIG_INPUT_EVBUG is not set
404 496
405# 497#
406# Input I/O drivers
407#
408# CONFIG_GAMEPORT is not set
409CONFIG_SOUND_GAMEPORT=y
410CONFIG_SERIO=y
411# CONFIG_SERIO_I8042 is not set
412CONFIG_SERIO_SERPORT=y
413# CONFIG_SERIO_CT82C710 is not set
414# CONFIG_SERIO_PCIPS2 is not set
415# CONFIG_SERIO_LIBPS2 is not set
416CONFIG_SERIO_RAW=y
417
418#
419# Input Device Drivers 498# Input Device Drivers
420# 499#
421# CONFIG_INPUT_KEYBOARD is not set 500# CONFIG_INPUT_KEYBOARD is not set
@@ -425,6 +504,17 @@ CONFIG_SERIO_RAW=y
425# CONFIG_INPUT_MISC is not set 504# CONFIG_INPUT_MISC is not set
426 505
427# 506#
507# Hardware I/O ports
508#
509CONFIG_SERIO=y
510# CONFIG_SERIO_I8042 is not set
511CONFIG_SERIO_SERPORT=y
512# CONFIG_SERIO_PCIPS2 is not set
513# CONFIG_SERIO_LIBPS2 is not set
514CONFIG_SERIO_RAW=y
515# CONFIG_GAMEPORT is not set
516
517#
428# Character devices 518# Character devices
429# 519#
430CONFIG_VT=y 520CONFIG_VT=y
@@ -445,6 +535,7 @@ CONFIG_SERIAL_8250_NR_UARTS=4
445# 535#
446CONFIG_SERIAL_CORE=y 536CONFIG_SERIAL_CORE=y
447CONFIG_SERIAL_CORE_CONSOLE=y 537CONFIG_SERIAL_CORE_CONSOLE=y
538# CONFIG_SERIAL_JSM is not set
448CONFIG_UNIX98_PTYS=y 539CONFIG_UNIX98_PTYS=y
449CONFIG_LEGACY_PTYS=y 540CONFIG_LEGACY_PTYS=y
450CONFIG_LEGACY_PTY_COUNT=256 541CONFIG_LEGACY_PTY_COUNT=256
@@ -471,6 +562,11 @@ CONFIG_LEGACY_PTY_COUNT=256
471# CONFIG_RAW_DRIVER is not set 562# CONFIG_RAW_DRIVER is not set
472 563
473# 564#
565# TPM devices
566#
567# CONFIG_TCG_TPM is not set
568
569#
474# I2C support 570# I2C support
475# 571#
476# CONFIG_I2C is not set 572# CONFIG_I2C is not set
@@ -481,10 +577,20 @@ CONFIG_LEGACY_PTY_COUNT=256
481# CONFIG_W1 is not set 577# CONFIG_W1 is not set
482 578
483# 579#
580# Hardware Monitoring support
581#
582# CONFIG_HWMON is not set
583# CONFIG_HWMON_VID is not set
584
585#
484# Misc devices 586# Misc devices
485# 587#
486 588
487# 589#
590# Multimedia Capabilities Port drivers
591#
592
593#
488# Multimedia devices 594# Multimedia devices
489# 595#
490# CONFIG_VIDEO_DEV is not set 596# CONFIG_VIDEO_DEV is not set
@@ -504,7 +610,6 @@ CONFIG_LEGACY_PTY_COUNT=256
504# 610#
505# CONFIG_VGA_CONSOLE is not set 611# CONFIG_VGA_CONSOLE is not set
506CONFIG_DUMMY_CONSOLE=y 612CONFIG_DUMMY_CONSOLE=y
507# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
508 613
509# 614#
510# Sound 615# Sound
@@ -514,13 +619,9 @@ CONFIG_DUMMY_CONSOLE=y
514# 619#
515# USB support 620# USB support
516# 621#
517# CONFIG_USB is not set
518CONFIG_USB_ARCH_HAS_HCD=y 622CONFIG_USB_ARCH_HAS_HCD=y
519CONFIG_USB_ARCH_HAS_OHCI=y 623CONFIG_USB_ARCH_HAS_OHCI=y
520 624# CONFIG_USB is not set
521#
522# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
523#
524 625
525# 626#
526# USB Gadget Support 627# USB Gadget Support
@@ -538,21 +639,29 @@ CONFIG_USB_ARCH_HAS_OHCI=y
538# CONFIG_INFINIBAND is not set 639# CONFIG_INFINIBAND is not set
539 640
540# 641#
642# SN Devices
643#
644
645#
541# File systems 646# File systems
542# 647#
543CONFIG_EXT2_FS=y 648CONFIG_EXT2_FS=y
544# CONFIG_EXT2_FS_XATTR is not set 649# CONFIG_EXT2_FS_XATTR is not set
650# CONFIG_EXT2_FS_XIP is not set
545# CONFIG_EXT3_FS is not set 651# CONFIG_EXT3_FS is not set
546# CONFIG_JBD is not set 652# CONFIG_JBD is not set
547# CONFIG_REISERFS_FS is not set 653# CONFIG_REISERFS_FS is not set
548# CONFIG_JFS_FS is not set 654# CONFIG_JFS_FS is not set
655# CONFIG_FS_POSIX_ACL is not set
549# CONFIG_XFS_FS is not set 656# CONFIG_XFS_FS is not set
550# CONFIG_MINIX_FS is not set 657# CONFIG_MINIX_FS is not set
551# CONFIG_ROMFS_FS is not set 658# CONFIG_ROMFS_FS is not set
659CONFIG_INOTIFY=y
552# CONFIG_QUOTA is not set 660# CONFIG_QUOTA is not set
553CONFIG_DNOTIFY=y 661CONFIG_DNOTIFY=y
554# CONFIG_AUTOFS_FS is not set 662# CONFIG_AUTOFS_FS is not set
555# CONFIG_AUTOFS4_FS is not set 663# CONFIG_AUTOFS4_FS is not set
664CONFIG_FUSE_FS=y
556 665
557# 666#
558# CD-ROM/DVD Filesystems 667# CD-ROM/DVD Filesystems
@@ -573,12 +682,10 @@ CONFIG_DNOTIFY=y
573CONFIG_PROC_FS=y 682CONFIG_PROC_FS=y
574CONFIG_PROC_KCORE=y 683CONFIG_PROC_KCORE=y
575CONFIG_SYSFS=y 684CONFIG_SYSFS=y
576# CONFIG_DEVFS_FS is not set
577CONFIG_DEVPTS_FS_XATTR=y
578CONFIG_DEVPTS_FS_SECURITY=y
579# CONFIG_TMPFS is not set 685# CONFIG_TMPFS is not set
580# CONFIG_HUGETLB_PAGE is not set 686# CONFIG_HUGETLB_PAGE is not set
581CONFIG_RAMFS=y 687CONFIG_RAMFS=y
688CONFIG_RELAYFS_FS=y
582 689
583# 690#
584# Miscellaneous filesystems 691# Miscellaneous filesystems
@@ -610,6 +717,7 @@ CONFIG_NFSD=y
610CONFIG_ROOT_NFS=y 717CONFIG_ROOT_NFS=y
611CONFIG_LOCKD=y 718CONFIG_LOCKD=y
612CONFIG_EXPORTFS=y 719CONFIG_EXPORTFS=y
720CONFIG_NFS_COMMON=y
613CONFIG_SUNRPC=y 721CONFIG_SUNRPC=y
614# CONFIG_RPCSEC_GSS_KRB5 is not set 722# CONFIG_RPCSEC_GSS_KRB5 is not set
615# CONFIG_RPCSEC_GSS_SPKM3 is not set 723# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -618,6 +726,7 @@ CONFIG_SUNRPC=y
618# CONFIG_NCP_FS is not set 726# CONFIG_NCP_FS is not set
619# CONFIG_CODA_FS is not set 727# CONFIG_CODA_FS is not set
620# CONFIG_AFS_FS is not set 728# CONFIG_AFS_FS is not set
729# CONFIG_9P_FS is not set
621 730
622# 731#
623# Partition Types 732# Partition Types
@@ -638,7 +747,9 @@ CONFIG_MSDOS_PARTITION=y
638# 747#
639# Kernel hacking 748# Kernel hacking
640# 749#
750# CONFIG_PRINTK_TIME is not set
641# CONFIG_DEBUG_KERNEL is not set 751# CONFIG_DEBUG_KERNEL is not set
752CONFIG_LOG_BUF_SHIFT=14
642CONFIG_CROSSCOMPILE=y 753CONFIG_CROSSCOMPILE=y
643CONFIG_CMDLINE="" 754CONFIG_CMDLINE=""
644 755
@@ -652,7 +763,31 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
652# 763#
653# Cryptographic options 764# Cryptographic options
654# 765#
655# CONFIG_CRYPTO is not set 766CONFIG_CRYPTO=y
767CONFIG_CRYPTO_HMAC=y
768CONFIG_CRYPTO_NULL=y
769CONFIG_CRYPTO_MD4=y
770CONFIG_CRYPTO_MD5=y
771CONFIG_CRYPTO_SHA1=y
772CONFIG_CRYPTO_SHA256=y
773CONFIG_CRYPTO_SHA512=y
774CONFIG_CRYPTO_WP512=y
775CONFIG_CRYPTO_TGR192=y
776CONFIG_CRYPTO_DES=y
777CONFIG_CRYPTO_BLOWFISH=y
778CONFIG_CRYPTO_TWOFISH=y
779CONFIG_CRYPTO_SERPENT=y
780CONFIG_CRYPTO_AES=y
781CONFIG_CRYPTO_CAST5=y
782CONFIG_CRYPTO_CAST6=y
783CONFIG_CRYPTO_TEA=y
784CONFIG_CRYPTO_ARC4=y
785CONFIG_CRYPTO_KHAZAD=y
786CONFIG_CRYPTO_ANUBIS=y
787CONFIG_CRYPTO_DEFLATE=y
788CONFIG_CRYPTO_MICHAEL_MIC=y
789CONFIG_CRYPTO_CRC32C=y
790# CONFIG_CRYPTO_TEST is not set
656 791
657# 792#
658# Hardware crypto devices 793# Hardware crypto devices
@@ -662,7 +797,8 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
662# Library routines 797# Library routines
663# 798#
664# CONFIG_CRC_CCITT is not set 799# CONFIG_CRC_CCITT is not set
665# CONFIG_CRC32 is not set 800CONFIG_CRC16=y
666# CONFIG_LIBCRC32C is not set 801CONFIG_CRC32=y
667CONFIG_GENERIC_HARDIRQS=y 802CONFIG_LIBCRC32C=y
668CONFIG_GENERIC_IRQ_PROBE=y 803CONFIG_ZLIB_INFLATE=y
804CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/mips/configs/pb1100_defconfig b/arch/mips/configs/pb1100_defconfig
index 813e3a8b480b..47247addee1b 100644
--- a/arch/mips/configs/pb1100_defconfig
+++ b/arch/mips/configs/pb1100_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:08 2005 4# Thu Oct 20 22:26:41 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,24 +11,29 @@ CONFIG_32BIT=y
14CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
25# CONFIG_BSD_PROCESS_ACCT is not set 24# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y 25CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set 26# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14
29CONFIG_HOTPLUG=y 27CONFIG_HOTPLUG=y
30CONFIG_KOBJECT_UEVENT=y 28CONFIG_KOBJECT_UEVENT=y
31# CONFIG_IKCONFIG is not set 29# CONFIG_IKCONFIG is not set
30CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y 31CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y 32CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_EXTRA_PASS is not set 33# CONFIG_KALLSYMS_EXTRA_PASS is not set
34CONFIG_PRINTK=y
35CONFIG_BUG=y
36CONFIG_BASE_FULL=y
35CONFIG_FUTEX=y 37CONFIG_FUTEX=y
36CONFIG_EPOLL=y 38CONFIG_EPOLL=y
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -41,6 +43,7 @@ CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0 43CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0 44CONFIG_CC_ALIGN_JUMPS=0
43# CONFIG_TINY_SHMEM is not set 45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
44 47
45# 48#
46# Loadable module support 49# Loadable module support
@@ -56,56 +59,70 @@ CONFIG_KMOD=y
56# 59#
57# Machine selection 60# Machine selection
58# 61#
59# CONFIG_MACH_JAZZ is not set 62# CONFIG_MIPS_MTX1 is not set
60# CONFIG_MACH_VR41XX is not set 63# CONFIG_MIPS_BOSPORUS is not set
61# CONFIG_TOSHIBA_JMR3927 is not set 64# CONFIG_MIPS_PB1000 is not set
65CONFIG_MIPS_PB1100=y
66# CONFIG_MIPS_PB1500 is not set
67# CONFIG_MIPS_PB1550 is not set
68# CONFIG_MIPS_PB1200 is not set
69# CONFIG_MIPS_DB1000 is not set
70# CONFIG_MIPS_DB1100 is not set
71# CONFIG_MIPS_DB1500 is not set
72# CONFIG_MIPS_DB1550 is not set
73# CONFIG_MIPS_DB1200 is not set
74# CONFIG_MIPS_MIRAGE is not set
62# CONFIG_MIPS_COBALT is not set 75# CONFIG_MIPS_COBALT is not set
63# CONFIG_MACH_DECSTATION is not set 76# CONFIG_MACH_DECSTATION is not set
64# CONFIG_MIPS_EV64120 is not set 77# CONFIG_MIPS_EV64120 is not set
65# CONFIG_MIPS_EV96100 is not set 78# CONFIG_MIPS_EV96100 is not set
66# CONFIG_MIPS_IVR is not set 79# CONFIG_MIPS_IVR is not set
67# CONFIG_LASAT is not set
68# CONFIG_MIPS_ITE8172 is not set 80# CONFIG_MIPS_ITE8172 is not set
81# CONFIG_MACH_JAZZ is not set
82# CONFIG_LASAT is not set
69# CONFIG_MIPS_ATLAS is not set 83# CONFIG_MIPS_ATLAS is not set
70# CONFIG_MIPS_MALTA is not set 84# CONFIG_MIPS_MALTA is not set
71# CONFIG_MIPS_SEAD is not set 85# CONFIG_MIPS_SEAD is not set
86# CONFIG_MIPS_SIM is not set
87# CONFIG_MOMENCO_JAGUAR_ATX is not set
72# CONFIG_MOMENCO_OCELOT is not set 88# CONFIG_MOMENCO_OCELOT is not set
73# CONFIG_MOMENCO_OCELOT_G is not set
74# CONFIG_MOMENCO_OCELOT_C is not set
75# CONFIG_MOMENCO_OCELOT_3 is not set 89# CONFIG_MOMENCO_OCELOT_3 is not set
76# CONFIG_MOMENCO_JAGUAR_ATX is not set 90# CONFIG_MOMENCO_OCELOT_C is not set
77# CONFIG_PMC_YOSEMITE is not set 91# CONFIG_MOMENCO_OCELOT_G is not set
92# CONFIG_MIPS_XXS1500 is not set
93# CONFIG_PNX8550_V2PCI is not set
94# CONFIG_PNX8550_JBS is not set
78# CONFIG_DDB5074 is not set 95# CONFIG_DDB5074 is not set
79# CONFIG_DDB5476 is not set 96# CONFIG_DDB5476 is not set
80# CONFIG_DDB5477 is not set 97# CONFIG_DDB5477 is not set
81# CONFIG_NEC_OSPREY is not set 98# CONFIG_MACH_VR41XX is not set
99# CONFIG_PMC_YOSEMITE is not set
100# CONFIG_QEMU is not set
82# CONFIG_SGI_IP22 is not set 101# CONFIG_SGI_IP22 is not set
83CONFIG_SOC_AU1X00=y 102# CONFIG_SGI_IP27 is not set
84# CONFIG_SOC_AU1000 is not set 103# CONFIG_SGI_IP32 is not set
85CONFIG_SOC_AU1100=y 104# CONFIG_SIBYTE_BIGSUR is not set
86# CONFIG_SOC_AU1500 is not set 105# CONFIG_SIBYTE_SWARM is not set
87# CONFIG_SOC_AU1550 is not set 106# CONFIG_SIBYTE_SENTOSA is not set
88# CONFIG_MIPS_PB1000 is not set 107# CONFIG_SIBYTE_RHONE is not set
89CONFIG_MIPS_PB1100=y 108# CONFIG_SIBYTE_CARMEL is not set
90# CONFIG_MIPS_PB1500 is not set 109# CONFIG_SIBYTE_PTSWARM is not set
91# CONFIG_MIPS_PB1550 is not set 110# CONFIG_SIBYTE_LITTLESUR is not set
92# CONFIG_MIPS_DB1000 is not set 111# CONFIG_SIBYTE_CRHINE is not set
93# CONFIG_MIPS_DB1100 is not set 112# CONFIG_SIBYTE_CRHONE is not set
94# CONFIG_MIPS_DB1500 is not set
95# CONFIG_MIPS_DB1550 is not set
96# CONFIG_MIPS_BOSPORUS is not set
97# CONFIG_MIPS_MIRAGE is not set
98# CONFIG_MIPS_XXS1500 is not set
99# CONFIG_MIPS_MTX1 is not set
100# CONFIG_SIBYTE_SB1xxx_SOC is not set
101# CONFIG_SNI_RM200_PCI is not set 113# CONFIG_SNI_RM200_PCI is not set
114# CONFIG_TOSHIBA_JMR3927 is not set
102# CONFIG_TOSHIBA_RBTX4927 is not set 115# CONFIG_TOSHIBA_RBTX4927 is not set
116# CONFIG_TOSHIBA_RBTX4938 is not set
103CONFIG_RWSEM_GENERIC_SPINLOCK=y 117CONFIG_RWSEM_GENERIC_SPINLOCK=y
104CONFIG_GENERIC_CALIBRATE_DELAY=y 118CONFIG_GENERIC_CALIBRATE_DELAY=y
105CONFIG_HAVE_DEC_LOCK=y
106CONFIG_DMA_NONCOHERENT=y 119CONFIG_DMA_NONCOHERENT=y
107CONFIG_DMA_NEED_PCI_MAP_STATE=y 120CONFIG_DMA_NEED_PCI_MAP_STATE=y
121# CONFIG_CPU_BIG_ENDIAN is not set
108CONFIG_CPU_LITTLE_ENDIAN=y 122CONFIG_CPU_LITTLE_ENDIAN=y
123CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
124CONFIG_SOC_AU1100=y
125CONFIG_SOC_AU1X00=y
109CONFIG_SWAP_IO_SPACE=y 126CONFIG_SWAP_IO_SPACE=y
110# CONFIG_AU1X00_USB_DEVICE is not set 127# CONFIG_AU1X00_USB_DEVICE is not set
111CONFIG_MIPS_L1_CACHE_SHIFT=5 128CONFIG_MIPS_L1_CACHE_SHIFT=5
@@ -113,8 +130,10 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
113# 130#
114# CPU selection 131# CPU selection
115# 132#
116CONFIG_CPU_MIPS32=y 133CONFIG_CPU_MIPS32_R1=y
117# CONFIG_CPU_MIPS64 is not set 134# CONFIG_CPU_MIPS32_R2 is not set
135# CONFIG_CPU_MIPS64_R1 is not set
136# CONFIG_CPU_MIPS64_R2 is not set
118# CONFIG_CPU_R3000 is not set 137# CONFIG_CPU_R3000 is not set
119# CONFIG_CPU_TX39XX is not set 138# CONFIG_CPU_TX39XX is not set
120# CONFIG_CPU_VR41XX is not set 139# CONFIG_CPU_VR41XX is not set
@@ -130,15 +149,39 @@ CONFIG_CPU_MIPS32=y
130# CONFIG_CPU_RM7000 is not set 149# CONFIG_CPU_RM7000 is not set
131# CONFIG_CPU_RM9000 is not set 150# CONFIG_CPU_RM9000 is not set
132# CONFIG_CPU_SB1 is not set 151# CONFIG_CPU_SB1 is not set
152CONFIG_SYS_HAS_CPU_MIPS32_R1=y
153CONFIG_CPU_MIPS32=y
154CONFIG_CPU_MIPSR1=y
155CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
156CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
157
158#
159# Kernel type
160#
161CONFIG_32BIT=y
162# CONFIG_64BIT is not set
133CONFIG_PAGE_SIZE_4KB=y 163CONFIG_PAGE_SIZE_4KB=y
134# CONFIG_PAGE_SIZE_8KB is not set 164# CONFIG_PAGE_SIZE_8KB is not set
135# CONFIG_PAGE_SIZE_16KB is not set 165# CONFIG_PAGE_SIZE_16KB is not set
136# CONFIG_PAGE_SIZE_64KB is not set 166# CONFIG_PAGE_SIZE_64KB is not set
137CONFIG_CPU_HAS_PREFETCH=y 167CONFIG_CPU_HAS_PREFETCH=y
138# CONFIG_64BIT_PHYS_ADDR is not set 168# CONFIG_MIPS_MT is not set
169CONFIG_64BIT_PHYS_ADDR=y
139# CONFIG_CPU_ADVANCED is not set 170# CONFIG_CPU_ADVANCED is not set
140CONFIG_CPU_HAS_LLSC=y 171CONFIG_CPU_HAS_LLSC=y
141CONFIG_CPU_HAS_SYNC=y 172CONFIG_CPU_HAS_SYNC=y
173CONFIG_GENERIC_HARDIRQS=y
174CONFIG_GENERIC_IRQ_PROBE=y
175CONFIG_ARCH_FLATMEM_ENABLE=y
176CONFIG_SELECT_MEMORY_MODEL=y
177CONFIG_FLATMEM_MANUAL=y
178# CONFIG_DISCONTIGMEM_MANUAL is not set
179# CONFIG_SPARSEMEM_MANUAL is not set
180CONFIG_FLATMEM=y
181CONFIG_FLAT_NODE_MEM_MAP=y
182# CONFIG_SPARSEMEM_STATIC is not set
183CONFIG_PREEMPT_NONE=y
184# CONFIG_PREEMPT_VOLUNTARY is not set
142# CONFIG_PREEMPT is not set 185# CONFIG_PREEMPT is not set
143 186
144# 187#
@@ -154,6 +197,8 @@ CONFIG_MMU=y
154CONFIG_PCCARD=m 197CONFIG_PCCARD=m
155# CONFIG_PCMCIA_DEBUG is not set 198# CONFIG_PCMCIA_DEBUG is not set
156CONFIG_PCMCIA=m 199CONFIG_PCMCIA=m
200CONFIG_PCMCIA_LOAD_CIS=y
201CONFIG_PCMCIA_IOCTL=y
157 202
158# 203#
159# PC-card bridges 204# PC-card bridges
@@ -171,6 +216,100 @@ CONFIG_PCMCIA=m
171CONFIG_BINFMT_ELF=y 216CONFIG_BINFMT_ELF=y
172# CONFIG_BINFMT_MISC is not set 217# CONFIG_BINFMT_MISC is not set
173CONFIG_TRAD_SIGNALS=y 218CONFIG_TRAD_SIGNALS=y
219# CONFIG_PM is not set
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=m
234CONFIG_NET_KEY=y
235CONFIG_INET=y
236CONFIG_IP_MULTICAST=y
237# CONFIG_IP_ADVANCED_ROUTER is not set
238CONFIG_IP_FIB_HASH=y
239CONFIG_IP_PNP=y
240# CONFIG_IP_PNP_DHCP is not set
241CONFIG_IP_PNP_BOOTP=y
242# CONFIG_IP_PNP_RARP is not set
243# CONFIG_NET_IPIP is not set
244# CONFIG_NET_IPGRE is not set
245# CONFIG_IP_MROUTE 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
251CONFIG_INET_TUNNEL=m
252CONFIG_INET_DIAG=y
253CONFIG_INET_TCP_DIAG=y
254# CONFIG_TCP_CONG_ADVANCED is not set
255CONFIG_TCP_CONG_BIC=y
256
257#
258# IP: Virtual Server Configuration
259#
260# CONFIG_IP_VS is not set
261# CONFIG_IPV6 is not set
262CONFIG_NETFILTER=y
263# CONFIG_NETFILTER_DEBUG is not set
264CONFIG_NETFILTER_NETLINK=m
265CONFIG_NETFILTER_NETLINK_QUEUE=m
266CONFIG_NETFILTER_NETLINK_LOG=m
267
268#
269# IP: Netfilter Configuration
270#
271# CONFIG_IP_NF_CONNTRACK is not set
272CONFIG_IP_NF_PPTP=m
273# CONFIG_IP_NF_QUEUE is not set
274# CONFIG_IP_NF_IPTABLES is not set
275# CONFIG_IP_NF_ARPTABLES is not set
276
277#
278# DCCP Configuration (EXPERIMENTAL)
279#
280# CONFIG_IP_DCCP is not set
281
282#
283# SCTP Configuration (EXPERIMENTAL)
284#
285# CONFIG_IP_SCTP is not set
286# CONFIG_ATM is not set
287# CONFIG_BRIDGE is not set
288# CONFIG_VLAN_8021Q is not set
289# CONFIG_DECNET is not set
290# CONFIG_LLC2 is not set
291# CONFIG_IPX is not set
292# CONFIG_ATALK is not set
293# CONFIG_X25 is not set
294# CONFIG_LAPB is not set
295# CONFIG_NET_DIVERT is not set
296# CONFIG_ECONET is not set
297# CONFIG_WAN_ROUTER is not set
298# CONFIG_NET_SCHED is not set
299# CONFIG_NET_CLS_ROUTE is not set
300
301#
302# Network testing
303#
304# CONFIG_NET_PKTGEN is not set
305# CONFIG_HAMRADIO is not set
306# CONFIG_IRDA is not set
307# CONFIG_BT is not set
308CONFIG_IEEE80211=m
309# CONFIG_IEEE80211_DEBUG is not set
310CONFIG_IEEE80211_CRYPT_WEP=m
311CONFIG_IEEE80211_CRYPT_CCMP=m
312CONFIG_IEEE80211_CRYPT_TKIP=m
174 313
175# 314#
176# Device Drivers 315# Device Drivers
@@ -181,15 +320,20 @@ CONFIG_TRAD_SIGNALS=y
181# 320#
182CONFIG_STANDALONE=y 321CONFIG_STANDALONE=y
183CONFIG_PREVENT_FIRMWARE_BUILD=y 322CONFIG_PREVENT_FIRMWARE_BUILD=y
184# CONFIG_FW_LOADER is not set 323CONFIG_FW_LOADER=m
324
325#
326# Connector - unified userspace <-> kernelspace linker
327#
328CONFIG_CONNECTOR=m
185 329
186# 330#
187# Memory Technology Devices (MTD) 331# Memory Technology Devices (MTD)
188# 332#
189CONFIG_MTD=y 333CONFIG_MTD=y
190# CONFIG_MTD_DEBUG is not set 334# CONFIG_MTD_DEBUG is not set
191CONFIG_MTD_PARTITIONS=y
192# CONFIG_MTD_CONCAT is not set 335# CONFIG_MTD_CONCAT is not set
336CONFIG_MTD_PARTITIONS=y
193# CONFIG_MTD_REDBOOT_PARTS is not set 337# CONFIG_MTD_REDBOOT_PARTS is not set
194# CONFIG_MTD_CMDLINE_PARTS is not set 338# CONFIG_MTD_CMDLINE_PARTS is not set
195 339
@@ -233,9 +377,8 @@ CONFIG_MTD_CFI_UTIL=y
233# 377#
234# CONFIG_MTD_COMPLEX_MAPPINGS is not set 378# CONFIG_MTD_COMPLEX_MAPPINGS is not set
235# CONFIG_MTD_PHYSMAP is not set 379# CONFIG_MTD_PHYSMAP is not set
236CONFIG_MTD_PB1100=y 380CONFIG_MTD_ALCHEMY=y
237CONFIG_MTD_PB1500_BOOT=y 381# CONFIG_MTD_PLATRAM is not set
238CONFIG_MTD_PB1500_USER=y
239 382
240# 383#
241# Self-contained MTD device drivers 384# Self-contained MTD device drivers
@@ -270,14 +413,12 @@ CONFIG_MTD_PB1500_USER=y
270# 413#
271# Block devices 414# Block devices
272# 415#
273# CONFIG_BLK_DEV_FD is not set
274# CONFIG_BLK_DEV_COW_COMMON is not set 416# CONFIG_BLK_DEV_COW_COMMON is not set
275CONFIG_BLK_DEV_LOOP=y 417CONFIG_BLK_DEV_LOOP=y
276# CONFIG_BLK_DEV_CRYPTOLOOP is not set 418# CONFIG_BLK_DEV_CRYPTOLOOP is not set
277# CONFIG_BLK_DEV_NBD is not set 419# CONFIG_BLK_DEV_NBD is not set
278# CONFIG_BLK_DEV_RAM is not set 420# CONFIG_BLK_DEV_RAM is not set
279CONFIG_BLK_DEV_RAM_COUNT=16 421CONFIG_BLK_DEV_RAM_COUNT=16
280CONFIG_INITRAMFS_SOURCE=""
281# CONFIG_LBD is not set 422# CONFIG_LBD is not set
282CONFIG_CDROM_PKTCDVD=m 423CONFIG_CDROM_PKTCDVD=m
283CONFIG_CDROM_PKTCDVD_BUFFERS=8 424CONFIG_CDROM_PKTCDVD_BUFFERS=8
@@ -300,6 +441,7 @@ CONFIG_ATA_OVER_ETH=m
300# 441#
301# SCSI device support 442# SCSI device support
302# 443#
444CONFIG_RAID_ATTRS=m
303# CONFIG_SCSI is not set 445# CONFIG_SCSI is not set
304 446
305# 447#
@@ -310,6 +452,7 @@ CONFIG_ATA_OVER_ETH=m
310# 452#
311# Fusion MPT device support 453# Fusion MPT device support
312# 454#
455# CONFIG_FUSION is not set
313 456
314# 457#
315# IEEE 1394 (FireWire) support 458# IEEE 1394 (FireWire) support
@@ -320,94 +463,28 @@ CONFIG_ATA_OVER_ETH=m
320# 463#
321 464
322# 465#
323# Networking support 466# Network device support
324#
325CONFIG_NET=y
326
327#
328# Networking options
329#
330CONFIG_PACKET=y
331# CONFIG_PACKET_MMAP is not set
332CONFIG_NETLINK_DEV=y
333CONFIG_UNIX=y
334CONFIG_NET_KEY=y
335CONFIG_INET=y
336CONFIG_IP_MULTICAST=y
337# CONFIG_IP_ADVANCED_ROUTER is not set
338CONFIG_IP_PNP=y
339# CONFIG_IP_PNP_DHCP is not set
340CONFIG_IP_PNP_BOOTP=y
341# CONFIG_IP_PNP_RARP is not set
342# CONFIG_NET_IPIP is not set
343# CONFIG_NET_IPGRE is not set
344# CONFIG_IP_MROUTE is not set
345# CONFIG_ARPD is not set
346# CONFIG_SYN_COOKIES is not set
347# CONFIG_INET_AH is not set
348# CONFIG_INET_ESP is not set
349# CONFIG_INET_IPCOMP is not set
350CONFIG_INET_TUNNEL=m
351CONFIG_IP_TCPDIAG=m
352# CONFIG_IP_TCPDIAG_IPV6 is not set
353
354#
355# IP: Virtual Server Configuration
356#
357# CONFIG_IP_VS is not set
358# CONFIG_IPV6 is not set
359CONFIG_NETFILTER=y
360# CONFIG_NETFILTER_DEBUG is not set
361
362#
363# IP: Netfilter Configuration
364#
365# CONFIG_IP_NF_CONNTRACK is not set
366CONFIG_IP_NF_CONNTRACK_MARK=y
367# CONFIG_IP_NF_QUEUE is not set
368# CONFIG_IP_NF_IPTABLES is not set
369# CONFIG_IP_NF_ARPTABLES is not set
370CONFIG_XFRM=y
371CONFIG_XFRM_USER=m
372
373#
374# SCTP Configuration (EXPERIMENTAL)
375# 467#
376# CONFIG_IP_SCTP is not set 468CONFIG_NETDEVICES=y
377# CONFIG_ATM is not set 469# CONFIG_DUMMY is not set
378# CONFIG_BRIDGE is not set 470# CONFIG_BONDING is not set
379# CONFIG_VLAN_8021Q is not set 471# CONFIG_EQUALIZER is not set
380# CONFIG_DECNET is not set 472# CONFIG_TUN is not set
381# CONFIG_LLC2 is not set
382# CONFIG_IPX is not set
383# CONFIG_ATALK is not set
384# CONFIG_X25 is not set
385# CONFIG_LAPB is not set
386# CONFIG_NET_DIVERT is not set
387# CONFIG_ECONET is not set
388# CONFIG_WAN_ROUTER is not set
389 473
390# 474#
391# QoS and/or fair queueing 475# PHY device support
392# 476#
393# CONFIG_NET_SCHED is not set 477CONFIG_PHYLIB=m
394# CONFIG_NET_CLS_ROUTE is not set 478CONFIG_PHYCONTROL=y
395 479
396# 480#
397# Network testing 481# MII PHY device drivers
398# 482#
399# CONFIG_NET_PKTGEN is not set 483CONFIG_MARVELL_PHY=m
400# CONFIG_NETPOLL is not set 484CONFIG_DAVICOM_PHY=m
401# CONFIG_NET_POLL_CONTROLLER is not set 485CONFIG_QSEMI_PHY=m
402# CONFIG_HAMRADIO is not set 486CONFIG_LXT_PHY=m
403# CONFIG_IRDA is not set 487CONFIG_CICADA_PHY=m
404# CONFIG_BT is not set
405CONFIG_NETDEVICES=y
406# CONFIG_DUMMY is not set
407# CONFIG_BONDING is not set
408# CONFIG_EQUALIZER is not set
409# CONFIG_TUN is not set
410# CONFIG_ETHERTAP is not set
411 488
412# 489#
413# Ethernet (10 or 100Mbit) 490# Ethernet (10 or 100Mbit)
@@ -453,6 +530,8 @@ CONFIG_PPPOE=m
453# CONFIG_SLIP is not set 530# CONFIG_SLIP is not set
454# CONFIG_SHAPER is not set 531# CONFIG_SHAPER is not set
455# CONFIG_NETCONSOLE is not set 532# CONFIG_NETCONSOLE is not set
533# CONFIG_NETPOLL is not set
534# CONFIG_NET_POLL_CONTROLLER is not set
456 535
457# 536#
458# ISDN subsystem 537# ISDN subsystem
@@ -482,18 +561,6 @@ CONFIG_INPUT_EVDEV=y
482# CONFIG_INPUT_EVBUG is not set 561# CONFIG_INPUT_EVBUG is not set
483 562
484# 563#
485# Input I/O drivers
486#
487# CONFIG_GAMEPORT is not set
488CONFIG_SOUND_GAMEPORT=y
489CONFIG_SERIO=y
490# CONFIG_SERIO_I8042 is not set
491CONFIG_SERIO_SERPORT=y
492# CONFIG_SERIO_CT82C710 is not set
493# CONFIG_SERIO_LIBPS2 is not set
494CONFIG_SERIO_RAW=m
495
496#
497# Input Device Drivers 564# Input Device Drivers
498# 565#
499# CONFIG_INPUT_KEYBOARD is not set 566# CONFIG_INPUT_KEYBOARD is not set
@@ -503,6 +570,16 @@ CONFIG_SERIO_RAW=m
503# CONFIG_INPUT_MISC is not set 570# CONFIG_INPUT_MISC is not set
504 571
505# 572#
573# Hardware I/O ports
574#
575CONFIG_SERIO=y
576# CONFIG_SERIO_I8042 is not set
577CONFIG_SERIO_SERPORT=y
578# CONFIG_SERIO_LIBPS2 is not set
579CONFIG_SERIO_RAW=m
580# CONFIG_GAMEPORT is not set
581
582#
506# Character devices 583# Character devices
507# 584#
508CONFIG_VT=y 585CONFIG_VT=y
@@ -534,14 +611,14 @@ CONFIG_LEGACY_PTY_COUNT=256
534# Watchdog Cards 611# Watchdog Cards
535# 612#
536# CONFIG_WATCHDOG is not set 613# CONFIG_WATCHDOG is not set
537CONFIG_RTC=y 614# CONFIG_RTC is not set
615# CONFIG_GEN_RTC is not set
538# CONFIG_DTLK is not set 616# CONFIG_DTLK is not set
539# CONFIG_R3964 is not set 617# CONFIG_R3964 is not set
540 618
541# 619#
542# Ftape, the floppy tape device driver 620# Ftape, the floppy tape device driver
543# 621#
544# CONFIG_DRM is not set
545 622
546# 623#
547# PCMCIA character devices 624# PCMCIA character devices
@@ -550,6 +627,10 @@ CONFIG_SYNCLINK_CS=m
550# CONFIG_RAW_DRIVER is not set 627# CONFIG_RAW_DRIVER is not set
551 628
552# 629#
630# TPM devices
631#
632
633#
553# I2C support 634# I2C support
554# 635#
555# CONFIG_I2C is not set 636# CONFIG_I2C is not set
@@ -560,10 +641,20 @@ CONFIG_SYNCLINK_CS=m
560# CONFIG_W1 is not set 641# CONFIG_W1 is not set
561 642
562# 643#
644# Hardware Monitoring support
645#
646# CONFIG_HWMON is not set
647# CONFIG_HWMON_VID is not set
648
649#
563# Misc devices 650# Misc devices
564# 651#
565 652
566# 653#
654# Multimedia Capabilities Port drivers
655#
656
657#
567# Multimedia devices 658# Multimedia devices
568# 659#
569# CONFIG_VIDEO_DEV is not set 660# CONFIG_VIDEO_DEV is not set
@@ -583,7 +674,6 @@ CONFIG_SYNCLINK_CS=m
583# 674#
584# CONFIG_VGA_CONSOLE is not set 675# CONFIG_VGA_CONSOLE is not set
585CONFIG_DUMMY_CONSOLE=y 676CONFIG_DUMMY_CONSOLE=y
586# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
587 677
588# 678#
589# Sound 679# Sound
@@ -593,12 +683,9 @@ CONFIG_DUMMY_CONSOLE=y
593# 683#
594# USB support 684# USB support
595# 685#
596# CONFIG_USB_ARCH_HAS_HCD is not set 686CONFIG_USB_ARCH_HAS_HCD=y
597# CONFIG_USB_ARCH_HAS_OHCI is not set 687CONFIG_USB_ARCH_HAS_OHCI=y
598 688# CONFIG_USB is not set
599#
600# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
601#
602 689
603# 690#
604# USB Gadget Support 691# USB Gadget Support
@@ -613,7 +700,10 @@ CONFIG_DUMMY_CONSOLE=y
613# 700#
614# InfiniBand support 701# InfiniBand support
615# 702#
616# CONFIG_INFINIBAND is not set 703
704#
705# SN Devices
706#
617 707
618# 708#
619# File systems 709# File systems
@@ -622,6 +712,7 @@ CONFIG_EXT2_FS=y
622CONFIG_EXT2_FS_XATTR=y 712CONFIG_EXT2_FS_XATTR=y
623CONFIG_EXT2_FS_POSIX_ACL=y 713CONFIG_EXT2_FS_POSIX_ACL=y
624# CONFIG_EXT2_FS_SECURITY is not set 714# CONFIG_EXT2_FS_SECURITY is not set
715# CONFIG_EXT2_FS_XIP is not set
625CONFIG_EXT3_FS=y 716CONFIG_EXT3_FS=y
626CONFIG_EXT3_FS_XATTR=y 717CONFIG_EXT3_FS_XATTR=y
627CONFIG_EXT3_FS_POSIX_ACL=y 718CONFIG_EXT3_FS_POSIX_ACL=y
@@ -640,10 +731,12 @@ CONFIG_FS_POSIX_ACL=y
640# CONFIG_XFS_FS is not set 731# CONFIG_XFS_FS is not set
641# CONFIG_MINIX_FS is not set 732# CONFIG_MINIX_FS is not set
642# CONFIG_ROMFS_FS is not set 733# CONFIG_ROMFS_FS is not set
734CONFIG_INOTIFY=y
643# CONFIG_QUOTA is not set 735# CONFIG_QUOTA is not set
644CONFIG_DNOTIFY=y 736CONFIG_DNOTIFY=y
645CONFIG_AUTOFS_FS=m 737CONFIG_AUTOFS_FS=m
646CONFIG_AUTOFS4_FS=m 738CONFIG_AUTOFS4_FS=m
739CONFIG_FUSE_FS=m
647 740
648# 741#
649# CD-ROM/DVD Filesystems 742# CD-ROM/DVD Filesystems
@@ -664,13 +757,10 @@ CONFIG_AUTOFS4_FS=m
664CONFIG_PROC_FS=y 757CONFIG_PROC_FS=y
665CONFIG_PROC_KCORE=y 758CONFIG_PROC_KCORE=y
666CONFIG_SYSFS=y 759CONFIG_SYSFS=y
667# CONFIG_DEVFS_FS is not set
668CONFIG_DEVPTS_FS_XATTR=y
669CONFIG_DEVPTS_FS_SECURITY=y
670CONFIG_TMPFS=y 760CONFIG_TMPFS=y
671# CONFIG_TMPFS_XATTR is not set
672# CONFIG_HUGETLB_PAGE is not set 761# CONFIG_HUGETLB_PAGE is not set
673CONFIG_RAMFS=y 762CONFIG_RAMFS=y
763CONFIG_RELAYFS_FS=m
674 764
675# 765#
676# Miscellaneous filesystems 766# Miscellaneous filesystems
@@ -704,6 +794,7 @@ CONFIG_NFSD=m
704CONFIG_ROOT_NFS=y 794CONFIG_ROOT_NFS=y
705CONFIG_LOCKD=y 795CONFIG_LOCKD=y
706CONFIG_EXPORTFS=m 796CONFIG_EXPORTFS=m
797CONFIG_NFS_COMMON=y
707CONFIG_SUNRPC=y 798CONFIG_SUNRPC=y
708# CONFIG_RPCSEC_GSS_KRB5 is not set 799# CONFIG_RPCSEC_GSS_KRB5 is not set
709# CONFIG_RPCSEC_GSS_SPKM3 is not set 800# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -713,6 +804,7 @@ CONFIG_SMB_FS=m
713# CONFIG_NCP_FS is not set 804# CONFIG_NCP_FS is not set
714# CONFIG_CODA_FS is not set 805# CONFIG_CODA_FS is not set
715# CONFIG_AFS_FS is not set 806# CONFIG_AFS_FS is not set
807# CONFIG_9P_FS is not set
716 808
717# 809#
718# Partition Types 810# Partition Types
@@ -772,7 +864,9 @@ CONFIG_NLS_DEFAULT="iso8859-1"
772# 864#
773# Kernel hacking 865# Kernel hacking
774# 866#
867# CONFIG_PRINTK_TIME is not set
775# CONFIG_DEBUG_KERNEL is not set 868# CONFIG_DEBUG_KERNEL is not set
869CONFIG_LOG_BUF_SHIFT=14
776CONFIG_CROSSCOMPILE=y 870CONFIG_CROSSCOMPILE=y
777CONFIG_CMDLINE="" 871CONFIG_CMDLINE=""
778 872
@@ -788,26 +882,27 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
788# 882#
789CONFIG_CRYPTO=y 883CONFIG_CRYPTO=y
790CONFIG_CRYPTO_HMAC=y 884CONFIG_CRYPTO_HMAC=y
791CONFIG_CRYPTO_NULL=y 885CONFIG_CRYPTO_NULL=m
792# CONFIG_CRYPTO_MD4 is not set 886CONFIG_CRYPTO_MD4=m
793# CONFIG_CRYPTO_MD5 is not set 887CONFIG_CRYPTO_MD5=m
794# CONFIG_CRYPTO_SHA1 is not set 888CONFIG_CRYPTO_SHA1=m
795# CONFIG_CRYPTO_SHA256 is not set 889CONFIG_CRYPTO_SHA256=m
796CONFIG_CRYPTO_SHA512=y 890CONFIG_CRYPTO_SHA512=m
797CONFIG_CRYPTO_WP512=m 891CONFIG_CRYPTO_WP512=m
798# CONFIG_CRYPTO_DES is not set 892CONFIG_CRYPTO_TGR192=m
799# CONFIG_CRYPTO_BLOWFISH is not set 893CONFIG_CRYPTO_DES=m
800CONFIG_CRYPTO_TWOFISH=y 894CONFIG_CRYPTO_BLOWFISH=m
801# CONFIG_CRYPTO_SERPENT is not set 895CONFIG_CRYPTO_TWOFISH=m
896CONFIG_CRYPTO_SERPENT=m
802CONFIG_CRYPTO_AES=m 897CONFIG_CRYPTO_AES=m
803# CONFIG_CRYPTO_CAST5 is not set 898CONFIG_CRYPTO_CAST5=m
804# CONFIG_CRYPTO_CAST6 is not set 899CONFIG_CRYPTO_CAST6=m
805CONFIG_CRYPTO_TEA=m 900CONFIG_CRYPTO_TEA=m
806# CONFIG_CRYPTO_ARC4 is not set 901CONFIG_CRYPTO_ARC4=m
807CONFIG_CRYPTO_KHAZAD=m 902CONFIG_CRYPTO_KHAZAD=m
808CONFIG_CRYPTO_ANUBIS=m 903CONFIG_CRYPTO_ANUBIS=m
809CONFIG_CRYPTO_DEFLATE=y 904CONFIG_CRYPTO_DEFLATE=m
810CONFIG_CRYPTO_MICHAEL_MIC=y 905CONFIG_CRYPTO_MICHAEL_MIC=m
811CONFIG_CRYPTO_CRC32C=m 906CONFIG_CRYPTO_CRC32C=m
812# CONFIG_CRYPTO_TEST is not set 907# CONFIG_CRYPTO_TEST is not set
813 908
@@ -819,9 +914,8 @@ CONFIG_CRYPTO_CRC32C=m
819# Library routines 914# Library routines
820# 915#
821CONFIG_CRC_CCITT=m 916CONFIG_CRC_CCITT=m
917CONFIG_CRC16=m
822CONFIG_CRC32=y 918CONFIG_CRC32=y
823CONFIG_LIBCRC32C=m 919CONFIG_LIBCRC32C=m
824CONFIG_ZLIB_INFLATE=y 920CONFIG_ZLIB_INFLATE=m
825CONFIG_ZLIB_DEFLATE=y 921CONFIG_ZLIB_DEFLATE=m
826CONFIG_GENERIC_HARDIRQS=y
827CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/pb1500_defconfig b/arch/mips/configs/pb1500_defconfig
index 49e528340a39..f91a4eaae51a 100644
--- a/arch/mips/configs/pb1500_defconfig
+++ b/arch/mips/configs/pb1500_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:09 2005 4# Thu Oct 20 22:26:44 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,24 +11,29 @@ CONFIG_32BIT=y
14CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
25# CONFIG_BSD_PROCESS_ACCT is not set 24# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y 25CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set 26# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14
29CONFIG_HOTPLUG=y 27CONFIG_HOTPLUG=y
30CONFIG_KOBJECT_UEVENT=y 28CONFIG_KOBJECT_UEVENT=y
31# CONFIG_IKCONFIG is not set 29# CONFIG_IKCONFIG is not set
30CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y 31CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y 32CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_EXTRA_PASS is not set 33# CONFIG_KALLSYMS_EXTRA_PASS is not set
34CONFIG_PRINTK=y
35CONFIG_BUG=y
36CONFIG_BASE_FULL=y
35CONFIG_FUTEX=y 37CONFIG_FUTEX=y
36CONFIG_EPOLL=y 38CONFIG_EPOLL=y
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -41,6 +43,7 @@ CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0 43CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0 44CONFIG_CC_ALIGN_JUMPS=0
43# CONFIG_TINY_SHMEM is not set 45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
44 47
45# 48#
46# Loadable module support 49# Loadable module support
@@ -56,63 +59,80 @@ CONFIG_KMOD=y
56# 59#
57# Machine selection 60# Machine selection
58# 61#
59# CONFIG_MACH_JAZZ is not set 62# CONFIG_MIPS_MTX1 is not set
60# CONFIG_MACH_VR41XX is not set 63# CONFIG_MIPS_BOSPORUS is not set
61# CONFIG_TOSHIBA_JMR3927 is not set 64# CONFIG_MIPS_PB1000 is not set
65# CONFIG_MIPS_PB1100 is not set
66CONFIG_MIPS_PB1500=y
67# CONFIG_MIPS_PB1550 is not set
68# CONFIG_MIPS_PB1200 is not set
69# CONFIG_MIPS_DB1000 is not set
70# CONFIG_MIPS_DB1100 is not set
71# CONFIG_MIPS_DB1500 is not set
72# CONFIG_MIPS_DB1550 is not set
73# CONFIG_MIPS_DB1200 is not set
74# CONFIG_MIPS_MIRAGE is not set
62# CONFIG_MIPS_COBALT is not set 75# CONFIG_MIPS_COBALT is not set
63# CONFIG_MACH_DECSTATION is not set 76# CONFIG_MACH_DECSTATION is not set
64# CONFIG_MIPS_EV64120 is not set 77# CONFIG_MIPS_EV64120 is not set
65# CONFIG_MIPS_EV96100 is not set 78# CONFIG_MIPS_EV96100 is not set
66# CONFIG_MIPS_IVR is not set 79# CONFIG_MIPS_IVR is not set
67# CONFIG_LASAT is not set
68# CONFIG_MIPS_ITE8172 is not set 80# CONFIG_MIPS_ITE8172 is not set
81# CONFIG_MACH_JAZZ is not set
82# CONFIG_LASAT is not set
69# CONFIG_MIPS_ATLAS is not set 83# CONFIG_MIPS_ATLAS is not set
70# CONFIG_MIPS_MALTA is not set 84# CONFIG_MIPS_MALTA is not set
71# CONFIG_MIPS_SEAD is not set 85# CONFIG_MIPS_SEAD is not set
86# CONFIG_MIPS_SIM is not set
87# CONFIG_MOMENCO_JAGUAR_ATX is not set
72# CONFIG_MOMENCO_OCELOT is not set 88# CONFIG_MOMENCO_OCELOT is not set
73# CONFIG_MOMENCO_OCELOT_G is not set
74# CONFIG_MOMENCO_OCELOT_C is not set
75# CONFIG_MOMENCO_OCELOT_3 is not set 89# CONFIG_MOMENCO_OCELOT_3 is not set
76# CONFIG_MOMENCO_JAGUAR_ATX is not set 90# CONFIG_MOMENCO_OCELOT_C is not set
77# CONFIG_PMC_YOSEMITE is not set 91# CONFIG_MOMENCO_OCELOT_G is not set
92# CONFIG_MIPS_XXS1500 is not set
93# CONFIG_PNX8550_V2PCI is not set
94# CONFIG_PNX8550_JBS is not set
78# CONFIG_DDB5074 is not set 95# CONFIG_DDB5074 is not set
79# CONFIG_DDB5476 is not set 96# CONFIG_DDB5476 is not set
80# CONFIG_DDB5477 is not set 97# CONFIG_DDB5477 is not set
81# CONFIG_NEC_OSPREY is not set 98# CONFIG_MACH_VR41XX is not set
99# CONFIG_PMC_YOSEMITE is not set
100# CONFIG_QEMU is not set
82# CONFIG_SGI_IP22 is not set 101# CONFIG_SGI_IP22 is not set
83CONFIG_SOC_AU1X00=y 102# CONFIG_SGI_IP27 is not set
84# CONFIG_SOC_AU1000 is not set 103# CONFIG_SGI_IP32 is not set
85# CONFIG_SOC_AU1100 is not set 104# CONFIG_SIBYTE_BIGSUR is not set
86CONFIG_SOC_AU1500=y 105# CONFIG_SIBYTE_SWARM is not set
87# CONFIG_SOC_AU1550 is not set 106# CONFIG_SIBYTE_SENTOSA is not set
88# CONFIG_MIPS_PB1000 is not set 107# CONFIG_SIBYTE_RHONE is not set
89# CONFIG_MIPS_PB1100 is not set 108# CONFIG_SIBYTE_CARMEL is not set
90CONFIG_MIPS_PB1500=y 109# CONFIG_SIBYTE_PTSWARM is not set
91# CONFIG_MIPS_PB1550 is not set 110# CONFIG_SIBYTE_LITTLESUR is not set
92# CONFIG_MIPS_DB1000 is not set 111# CONFIG_SIBYTE_CRHINE is not set
93# CONFIG_MIPS_DB1100 is not set 112# CONFIG_SIBYTE_CRHONE is not set
94# CONFIG_MIPS_DB1500 is not set
95# CONFIG_MIPS_DB1550 is not set
96# CONFIG_MIPS_BOSPORUS is not set
97# CONFIG_MIPS_MIRAGE is not set
98# CONFIG_MIPS_XXS1500 is not set
99# CONFIG_MIPS_MTX1 is not set
100# CONFIG_SIBYTE_SB1xxx_SOC is not set
101# CONFIG_SNI_RM200_PCI is not set 113# CONFIG_SNI_RM200_PCI is not set
114# CONFIG_TOSHIBA_JMR3927 is not set
102# CONFIG_TOSHIBA_RBTX4927 is not set 115# CONFIG_TOSHIBA_RBTX4927 is not set
116# CONFIG_TOSHIBA_RBTX4938 is not set
103CONFIG_RWSEM_GENERIC_SPINLOCK=y 117CONFIG_RWSEM_GENERIC_SPINLOCK=y
104CONFIG_GENERIC_CALIBRATE_DELAY=y 118CONFIG_GENERIC_CALIBRATE_DELAY=y
105CONFIG_HAVE_DEC_LOCK=y 119CONFIG_DMA_NONCOHERENT=y
106CONFIG_DMA_COHERENT=y 120CONFIG_DMA_NEED_PCI_MAP_STATE=y
121# CONFIG_CPU_BIG_ENDIAN is not set
107CONFIG_CPU_LITTLE_ENDIAN=y 122CONFIG_CPU_LITTLE_ENDIAN=y
123CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
124CONFIG_SOC_AU1500=y
125CONFIG_SOC_AU1X00=y
108# CONFIG_AU1X00_USB_DEVICE is not set 126# CONFIG_AU1X00_USB_DEVICE is not set
109CONFIG_MIPS_L1_CACHE_SHIFT=5 127CONFIG_MIPS_L1_CACHE_SHIFT=5
110 128
111# 129#
112# CPU selection 130# CPU selection
113# 131#
114CONFIG_CPU_MIPS32=y 132CONFIG_CPU_MIPS32_R1=y
115# CONFIG_CPU_MIPS64 is not set 133# CONFIG_CPU_MIPS32_R2 is not set
134# CONFIG_CPU_MIPS64_R1 is not set
135# CONFIG_CPU_MIPS64_R2 is not set
116# CONFIG_CPU_R3000 is not set 136# CONFIG_CPU_R3000 is not set
117# CONFIG_CPU_TX39XX is not set 137# CONFIG_CPU_TX39XX is not set
118# CONFIG_CPU_VR41XX is not set 138# CONFIG_CPU_VR41XX is not set
@@ -128,15 +148,39 @@ CONFIG_CPU_MIPS32=y
128# CONFIG_CPU_RM7000 is not set 148# CONFIG_CPU_RM7000 is not set
129# CONFIG_CPU_RM9000 is not set 149# CONFIG_CPU_RM9000 is not set
130# CONFIG_CPU_SB1 is not set 150# CONFIG_CPU_SB1 is not set
151CONFIG_SYS_HAS_CPU_MIPS32_R1=y
152CONFIG_CPU_MIPS32=y
153CONFIG_CPU_MIPSR1=y
154CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
155CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
156
157#
158# Kernel type
159#
160CONFIG_32BIT=y
161# CONFIG_64BIT is not set
131CONFIG_PAGE_SIZE_4KB=y 162CONFIG_PAGE_SIZE_4KB=y
132# CONFIG_PAGE_SIZE_8KB is not set 163# CONFIG_PAGE_SIZE_8KB is not set
133# CONFIG_PAGE_SIZE_16KB is not set 164# CONFIG_PAGE_SIZE_16KB is not set
134# CONFIG_PAGE_SIZE_64KB is not set 165# CONFIG_PAGE_SIZE_64KB is not set
135CONFIG_CPU_HAS_PREFETCH=y 166CONFIG_CPU_HAS_PREFETCH=y
167# CONFIG_MIPS_MT is not set
136CONFIG_64BIT_PHYS_ADDR=y 168CONFIG_64BIT_PHYS_ADDR=y
137# CONFIG_CPU_ADVANCED is not set 169# CONFIG_CPU_ADVANCED is not set
138CONFIG_CPU_HAS_LLSC=y 170CONFIG_CPU_HAS_LLSC=y
139CONFIG_CPU_HAS_SYNC=y 171CONFIG_CPU_HAS_SYNC=y
172CONFIG_GENERIC_HARDIRQS=y
173CONFIG_GENERIC_IRQ_PROBE=y
174CONFIG_ARCH_FLATMEM_ENABLE=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_PREEMPT_NONE=y
183# CONFIG_PREEMPT_VOLUNTARY is not set
140# CONFIG_PREEMPT is not set 184# CONFIG_PREEMPT is not set
141 185
142# 186#
@@ -145,7 +189,6 @@ CONFIG_CPU_HAS_SYNC=y
145CONFIG_HW_HAS_PCI=y 189CONFIG_HW_HAS_PCI=y
146CONFIG_PCI=y 190CONFIG_PCI=y
147CONFIG_PCI_LEGACY_PROC=y 191CONFIG_PCI_LEGACY_PROC=y
148CONFIG_PCI_NAMES=y
149CONFIG_MMU=y 192CONFIG_MMU=y
150 193
151# 194#
@@ -154,6 +197,8 @@ CONFIG_MMU=y
154CONFIG_PCCARD=m 197CONFIG_PCCARD=m
155# CONFIG_PCMCIA_DEBUG is not set 198# CONFIG_PCMCIA_DEBUG is not set
156CONFIG_PCMCIA=m 199CONFIG_PCMCIA=m
200CONFIG_PCMCIA_LOAD_CIS=y
201CONFIG_PCMCIA_IOCTL=y
157CONFIG_CARDBUS=y 202CONFIG_CARDBUS=y
158 203
159# 204#
@@ -177,6 +222,100 @@ CONFIG_PCCARD_NONSTATIC=m
177CONFIG_BINFMT_ELF=y 222CONFIG_BINFMT_ELF=y
178# CONFIG_BINFMT_MISC is not set 223# CONFIG_BINFMT_MISC is not set
179CONFIG_TRAD_SIGNALS=y 224CONFIG_TRAD_SIGNALS=y
225# CONFIG_PM is not set
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=m
240CONFIG_NET_KEY=y
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
247CONFIG_IP_PNP_BOOTP=y
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
253# CONFIG_SYN_COOKIES is not set
254# CONFIG_INET_AH is not set
255# CONFIG_INET_ESP is not set
256# CONFIG_INET_IPCOMP is not set
257CONFIG_INET_TUNNEL=m
258CONFIG_INET_DIAG=y
259CONFIG_INET_TCP_DIAG=y
260# CONFIG_TCP_CONG_ADVANCED is not set
261CONFIG_TCP_CONG_BIC=y
262
263#
264# IP: Virtual Server Configuration
265#
266# CONFIG_IP_VS is not set
267# CONFIG_IPV6 is not set
268CONFIG_NETFILTER=y
269# CONFIG_NETFILTER_DEBUG is not set
270CONFIG_NETFILTER_NETLINK=m
271CONFIG_NETFILTER_NETLINK_QUEUE=m
272CONFIG_NETFILTER_NETLINK_LOG=m
273
274#
275# IP: Netfilter Configuration
276#
277# CONFIG_IP_NF_CONNTRACK is not set
278CONFIG_IP_NF_PPTP=m
279# CONFIG_IP_NF_QUEUE is not set
280# CONFIG_IP_NF_IPTABLES is not set
281# CONFIG_IP_NF_ARPTABLES is not set
282
283#
284# DCCP Configuration (EXPERIMENTAL)
285#
286# CONFIG_IP_DCCP is not set
287
288#
289# SCTP Configuration (EXPERIMENTAL)
290#
291# CONFIG_IP_SCTP is not set
292# CONFIG_ATM is not set
293# CONFIG_BRIDGE is not set
294# CONFIG_VLAN_8021Q is not set
295# CONFIG_DECNET is not set
296# CONFIG_LLC2 is not set
297# CONFIG_IPX is not set
298# CONFIG_ATALK is not set
299# CONFIG_X25 is not set
300# CONFIG_LAPB is not set
301# CONFIG_NET_DIVERT is not set
302# CONFIG_ECONET is not set
303# CONFIG_WAN_ROUTER is not set
304# CONFIG_NET_SCHED is not set
305# CONFIG_NET_CLS_ROUTE is not set
306
307#
308# Network testing
309#
310# CONFIG_NET_PKTGEN is not set
311# CONFIG_HAMRADIO is not set
312# CONFIG_IRDA is not set
313# CONFIG_BT is not set
314CONFIG_IEEE80211=m
315# CONFIG_IEEE80211_DEBUG is not set
316CONFIG_IEEE80211_CRYPT_WEP=m
317CONFIG_IEEE80211_CRYPT_CCMP=m
318CONFIG_IEEE80211_CRYPT_TKIP=m
180 319
181# 320#
182# Device Drivers 321# Device Drivers
@@ -187,12 +326,87 @@ CONFIG_TRAD_SIGNALS=y
187# 326#
188CONFIG_STANDALONE=y 327CONFIG_STANDALONE=y
189CONFIG_PREVENT_FIRMWARE_BUILD=y 328CONFIG_PREVENT_FIRMWARE_BUILD=y
190# CONFIG_FW_LOADER is not set 329CONFIG_FW_LOADER=m
330
331#
332# Connector - unified userspace <-> kernelspace linker
333#
334CONFIG_CONNECTOR=m
191 335
192# 336#
193# Memory Technology Devices (MTD) 337# Memory Technology Devices (MTD)
194# 338#
195# CONFIG_MTD is not set 339CONFIG_MTD=y
340# CONFIG_MTD_DEBUG is not set
341# CONFIG_MTD_CONCAT is not set
342CONFIG_MTD_PARTITIONS=y
343# CONFIG_MTD_REDBOOT_PARTS is not set
344# CONFIG_MTD_CMDLINE_PARTS is not set
345
346#
347# User Modules And Translation Layers
348#
349CONFIG_MTD_CHAR=y
350CONFIG_MTD_BLOCK=y
351# CONFIG_FTL is not set
352# CONFIG_NFTL is not set
353# CONFIG_INFTL is not set
354
355#
356# RAM/ROM/Flash chip drivers
357#
358CONFIG_MTD_CFI=y
359# CONFIG_MTD_JEDECPROBE is not set
360CONFIG_MTD_GEN_PROBE=y
361# CONFIG_MTD_CFI_ADV_OPTIONS is not set
362CONFIG_MTD_MAP_BANK_WIDTH_1=y
363CONFIG_MTD_MAP_BANK_WIDTH_2=y
364CONFIG_MTD_MAP_BANK_WIDTH_4=y
365# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
366# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
367# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
368CONFIG_MTD_CFI_I1=y
369CONFIG_MTD_CFI_I2=y
370# CONFIG_MTD_CFI_I4 is not set
371# CONFIG_MTD_CFI_I8 is not set
372# CONFIG_MTD_CFI_INTELEXT is not set
373CONFIG_MTD_CFI_AMDSTD=y
374CONFIG_MTD_CFI_AMDSTD_RETRY=0
375# CONFIG_MTD_CFI_STAA is not set
376CONFIG_MTD_CFI_UTIL=y
377# CONFIG_MTD_RAM is not set
378# CONFIG_MTD_ROM is not set
379# CONFIG_MTD_ABSENT is not set
380
381#
382# Mapping drivers for chip access
383#
384# CONFIG_MTD_COMPLEX_MAPPINGS is not set
385# CONFIG_MTD_PHYSMAP is not set
386CONFIG_MTD_ALCHEMY=y
387# CONFIG_MTD_PLATRAM is not set
388
389#
390# Self-contained MTD device drivers
391#
392# CONFIG_MTD_PMC551 is not set
393# CONFIG_MTD_SLRAM is not set
394# CONFIG_MTD_PHRAM is not set
395# CONFIG_MTD_MTDRAM is not set
396# CONFIG_MTD_BLKMTD is not set
397# CONFIG_MTD_BLOCK2MTD is not set
398
399#
400# Disk-On-Chip Device Drivers
401#
402# CONFIG_MTD_DOC2000 is not set
403# CONFIG_MTD_DOC2001 is not set
404# CONFIG_MTD_DOC2001PLUS is not set
405
406#
407# NAND Flash Device Drivers
408#
409# CONFIG_MTD_NAND is not set
196 410
197# 411#
198# Parallel port support 412# Parallel port support
@@ -206,7 +420,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
206# 420#
207# Block devices 421# Block devices
208# 422#
209# CONFIG_BLK_DEV_FD is not set
210# CONFIG_BLK_CPQ_DA is not set 423# CONFIG_BLK_CPQ_DA is not set
211# CONFIG_BLK_CPQ_CISS_DA is not set 424# CONFIG_BLK_CPQ_CISS_DA is not set
212# CONFIG_BLK_DEV_DAC960 is not set 425# CONFIG_BLK_DEV_DAC960 is not set
@@ -218,7 +431,6 @@ CONFIG_BLK_DEV_LOOP=y
218# CONFIG_BLK_DEV_SX8 is not set 431# CONFIG_BLK_DEV_SX8 is not set
219# CONFIG_BLK_DEV_RAM is not set 432# CONFIG_BLK_DEV_RAM is not set
220CONFIG_BLK_DEV_RAM_COUNT=16 433CONFIG_BLK_DEV_RAM_COUNT=16
221CONFIG_INITRAMFS_SOURCE=""
222# CONFIG_LBD is not set 434# CONFIG_LBD is not set
223CONFIG_CDROM_PKTCDVD=m 435CONFIG_CDROM_PKTCDVD=m
224CONFIG_CDROM_PKTCDVD_BUFFERS=8 436CONFIG_CDROM_PKTCDVD_BUFFERS=8
@@ -275,6 +487,7 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y
275CONFIG_BLK_DEV_HPT366=y 487CONFIG_BLK_DEV_HPT366=y
276# CONFIG_BLK_DEV_SC1200 is not set 488# CONFIG_BLK_DEV_SC1200 is not set
277# CONFIG_BLK_DEV_PIIX is not set 489# CONFIG_BLK_DEV_PIIX is not set
490# CONFIG_BLK_DEV_IT821X is not set
278# CONFIG_BLK_DEV_NS87415 is not set 491# CONFIG_BLK_DEV_NS87415 is not set
279# CONFIG_BLK_DEV_PDC202XX_OLD is not set 492# CONFIG_BLK_DEV_PDC202XX_OLD is not set
280# CONFIG_BLK_DEV_PDC202XX_NEW is not set 493# CONFIG_BLK_DEV_PDC202XX_NEW is not set
@@ -292,6 +505,7 @@ CONFIG_BLK_DEV_IDEDMA=y
292# 505#
293# SCSI device support 506# SCSI device support
294# 507#
508CONFIG_RAID_ATTRS=m
295# CONFIG_SCSI is not set 509# CONFIG_SCSI is not set
296 510
297# 511#
@@ -302,6 +516,7 @@ CONFIG_BLK_DEV_IDEDMA=y
302# 516#
303# Fusion MPT device support 517# Fusion MPT device support
304# 518#
519# CONFIG_FUSION is not set
305 520
306# 521#
307# IEEE 1394 (FireWire) support 522# IEEE 1394 (FireWire) support
@@ -314,94 +529,13 @@ CONFIG_BLK_DEV_IDEDMA=y
314# CONFIG_I2O is not set 529# CONFIG_I2O is not set
315 530
316# 531#
317# Networking support 532# Network device support
318#
319CONFIG_NET=y
320
321#
322# Networking options
323#
324CONFIG_PACKET=y
325# CONFIG_PACKET_MMAP is not set
326CONFIG_NETLINK_DEV=y
327CONFIG_UNIX=y
328CONFIG_NET_KEY=y
329CONFIG_INET=y
330CONFIG_IP_MULTICAST=y
331# CONFIG_IP_ADVANCED_ROUTER is not set
332CONFIG_IP_PNP=y
333# CONFIG_IP_PNP_DHCP is not set
334CONFIG_IP_PNP_BOOTP=y
335# CONFIG_IP_PNP_RARP is not set
336# CONFIG_NET_IPIP is not set
337# CONFIG_NET_IPGRE is not set
338# CONFIG_IP_MROUTE is not set
339# CONFIG_ARPD is not set
340# CONFIG_SYN_COOKIES is not set
341# CONFIG_INET_AH is not set
342# CONFIG_INET_ESP is not set
343# CONFIG_INET_IPCOMP is not set
344CONFIG_INET_TUNNEL=m
345CONFIG_IP_TCPDIAG=m
346# CONFIG_IP_TCPDIAG_IPV6 is not set
347
348#
349# IP: Virtual Server Configuration
350#
351# CONFIG_IP_VS is not set
352# CONFIG_IPV6 is not set
353CONFIG_NETFILTER=y
354# CONFIG_NETFILTER_DEBUG is not set
355
356#
357# IP: Netfilter Configuration
358# 533#
359# CONFIG_IP_NF_CONNTRACK is not set
360CONFIG_IP_NF_CONNTRACK_MARK=y
361# CONFIG_IP_NF_QUEUE is not set
362# CONFIG_IP_NF_IPTABLES is not set
363# CONFIG_IP_NF_ARPTABLES is not set
364CONFIG_XFRM=y
365CONFIG_XFRM_USER=m
366
367#
368# SCTP Configuration (EXPERIMENTAL)
369#
370# CONFIG_IP_SCTP is not set
371# CONFIG_ATM is not set
372# CONFIG_BRIDGE is not set
373# CONFIG_VLAN_8021Q is not set
374# CONFIG_DECNET is not set
375# CONFIG_LLC2 is not set
376# CONFIG_IPX is not set
377# CONFIG_ATALK is not set
378# CONFIG_X25 is not set
379# CONFIG_LAPB is not set
380# CONFIG_NET_DIVERT is not set
381# CONFIG_ECONET is not set
382# CONFIG_WAN_ROUTER is not set
383
384#
385# QoS and/or fair queueing
386#
387# CONFIG_NET_SCHED is not set
388# CONFIG_NET_CLS_ROUTE is not set
389
390#
391# Network testing
392#
393# CONFIG_NET_PKTGEN is not set
394# CONFIG_NETPOLL is not set
395# CONFIG_NET_POLL_CONTROLLER is not set
396# CONFIG_HAMRADIO is not set
397# CONFIG_IRDA is not set
398# CONFIG_BT is not set
399CONFIG_NETDEVICES=y 534CONFIG_NETDEVICES=y
400# CONFIG_DUMMY is not set 535# CONFIG_DUMMY is not set
401# CONFIG_BONDING is not set 536# CONFIG_BONDING is not set
402# CONFIG_EQUALIZER is not set 537# CONFIG_EQUALIZER is not set
403# CONFIG_TUN is not set 538# CONFIG_TUN is not set
404# CONFIG_ETHERTAP is not set
405 539
406# 540#
407# ARCnet devices 541# ARCnet devices
@@ -409,6 +543,21 @@ CONFIG_NETDEVICES=y
409# CONFIG_ARCNET is not set 543# CONFIG_ARCNET is not set
410 544
411# 545#
546# PHY device support
547#
548CONFIG_PHYLIB=m
549CONFIG_PHYCONTROL=y
550
551#
552# MII PHY device drivers
553#
554CONFIG_MARVELL_PHY=m
555CONFIG_DAVICOM_PHY=m
556CONFIG_QSEMI_PHY=m
557CONFIG_LXT_PHY=m
558CONFIG_CICADA_PHY=m
559
560#
412# Ethernet (10 or 100Mbit) 561# Ethernet (10 or 100Mbit)
413# 562#
414CONFIG_NET_ETHERNET=y 563CONFIG_NET_ETHERNET=y
@@ -435,12 +584,16 @@ CONFIG_MIPS_AU1X00_ENET=y
435# CONFIG_HAMACHI is not set 584# CONFIG_HAMACHI is not set
436# CONFIG_YELLOWFIN is not set 585# CONFIG_YELLOWFIN is not set
437# CONFIG_R8169 is not set 586# CONFIG_R8169 is not set
587# CONFIG_SIS190 is not set
588# CONFIG_SKGE is not set
438# CONFIG_SK98LIN is not set 589# CONFIG_SK98LIN is not set
439# CONFIG_TIGON3 is not set 590# CONFIG_TIGON3 is not set
591# CONFIG_BNX2 is not set
440 592
441# 593#
442# Ethernet (10000 Mbit) 594# Ethernet (10000 Mbit)
443# 595#
596# CONFIG_CHELSIO_T1 is not set
444# CONFIG_IXGB is not set 597# CONFIG_IXGB is not set
445# CONFIG_S2IO is not set 598# CONFIG_S2IO is not set
446 599
@@ -453,6 +606,8 @@ CONFIG_MIPS_AU1X00_ENET=y
453# Wireless LAN (non-hamradio) 606# Wireless LAN (non-hamradio)
454# 607#
455# CONFIG_NET_RADIO is not set 608# CONFIG_NET_RADIO is not set
609# CONFIG_IPW_DEBUG is not set
610CONFIG_IPW2200=m
456 611
457# 612#
458# PCMCIA network device support 613# PCMCIA network device support
@@ -484,6 +639,8 @@ CONFIG_PPPOE=m
484# CONFIG_SLIP is not set 639# CONFIG_SLIP is not set
485# CONFIG_SHAPER is not set 640# CONFIG_SHAPER is not set
486# CONFIG_NETCONSOLE is not set 641# CONFIG_NETCONSOLE is not set
642# CONFIG_NETPOLL is not set
643# CONFIG_NET_POLL_CONTROLLER is not set
487 644
488# 645#
489# ISDN subsystem 646# ISDN subsystem
@@ -513,19 +670,6 @@ CONFIG_INPUT_EVDEV=y
513# CONFIG_INPUT_EVBUG is not set 670# CONFIG_INPUT_EVBUG is not set
514 671
515# 672#
516# Input I/O drivers
517#
518# CONFIG_GAMEPORT is not set
519CONFIG_SOUND_GAMEPORT=y
520CONFIG_SERIO=y
521# CONFIG_SERIO_I8042 is not set
522CONFIG_SERIO_SERPORT=y
523# CONFIG_SERIO_CT82C710 is not set
524# CONFIG_SERIO_PCIPS2 is not set
525# CONFIG_SERIO_LIBPS2 is not set
526CONFIG_SERIO_RAW=m
527
528#
529# Input Device Drivers 673# Input Device Drivers
530# 674#
531# CONFIG_INPUT_KEYBOARD is not set 675# CONFIG_INPUT_KEYBOARD is not set
@@ -535,6 +679,17 @@ CONFIG_SERIO_RAW=m
535# CONFIG_INPUT_MISC is not set 679# CONFIG_INPUT_MISC is not set
536 680
537# 681#
682# Hardware I/O ports
683#
684CONFIG_SERIO=y
685# CONFIG_SERIO_I8042 is not set
686CONFIG_SERIO_SERPORT=y
687# CONFIG_SERIO_PCIPS2 is not set
688# CONFIG_SERIO_LIBPS2 is not set
689CONFIG_SERIO_RAW=m
690# CONFIG_GAMEPORT is not set
691
692#
538# Character devices 693# Character devices
539# 694#
540# CONFIG_VT is not set 695# CONFIG_VT is not set
@@ -554,6 +709,7 @@ CONFIG_SERIAL_AU1X00=y
554CONFIG_SERIAL_AU1X00_CONSOLE=y 709CONFIG_SERIAL_AU1X00_CONSOLE=y
555CONFIG_SERIAL_CORE=y 710CONFIG_SERIAL_CORE=y
556CONFIG_SERIAL_CORE_CONSOLE=y 711CONFIG_SERIAL_CORE_CONSOLE=y
712# CONFIG_SERIAL_JSM is not set
557CONFIG_UNIX98_PTYS=y 713CONFIG_UNIX98_PTYS=y
558CONFIG_LEGACY_PTYS=y 714CONFIG_LEGACY_PTYS=y
559CONFIG_LEGACY_PTY_COUNT=256 715CONFIG_LEGACY_PTY_COUNT=256
@@ -585,6 +741,11 @@ CONFIG_SYNCLINK_CS=m
585# CONFIG_RAW_DRIVER is not set 741# CONFIG_RAW_DRIVER is not set
586 742
587# 743#
744# TPM devices
745#
746# CONFIG_TCG_TPM is not set
747
748#
588# I2C support 749# I2C support
589# 750#
590# CONFIG_I2C is not set 751# CONFIG_I2C is not set
@@ -595,10 +756,20 @@ CONFIG_SYNCLINK_CS=m
595# CONFIG_W1 is not set 756# CONFIG_W1 is not set
596 757
597# 758#
759# Hardware Monitoring support
760#
761# CONFIG_HWMON is not set
762# CONFIG_HWMON_VID is not set
763
764#
598# Misc devices 765# Misc devices
599# 766#
600 767
601# 768#
769# Multimedia Capabilities Port drivers
770#
771
772#
602# Multimedia devices 773# Multimedia devices
603# 774#
604# CONFIG_VIDEO_DEV is not set 775# CONFIG_VIDEO_DEV is not set
@@ -612,7 +783,6 @@ CONFIG_SYNCLINK_CS=m
612# Graphics support 783# Graphics support
613# 784#
614# CONFIG_FB is not set 785# CONFIG_FB is not set
615# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
616 786
617# 787#
618# Sound 788# Sound
@@ -622,13 +792,9 @@ CONFIG_SYNCLINK_CS=m
622# 792#
623# USB support 793# USB support
624# 794#
625# CONFIG_USB is not set
626CONFIG_USB_ARCH_HAS_HCD=y 795CONFIG_USB_ARCH_HAS_HCD=y
627CONFIG_USB_ARCH_HAS_OHCI=y 796CONFIG_USB_ARCH_HAS_OHCI=y
628 797# CONFIG_USB is not set
629#
630# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
631#
632 798
633# 799#
634# USB Gadget Support 800# USB Gadget Support
@@ -646,12 +812,17 @@ CONFIG_USB_ARCH_HAS_OHCI=y
646# CONFIG_INFINIBAND is not set 812# CONFIG_INFINIBAND is not set
647 813
648# 814#
815# SN Devices
816#
817
818#
649# File systems 819# File systems
650# 820#
651CONFIG_EXT2_FS=y 821CONFIG_EXT2_FS=y
652CONFIG_EXT2_FS_XATTR=y 822CONFIG_EXT2_FS_XATTR=y
653CONFIG_EXT2_FS_POSIX_ACL=y 823CONFIG_EXT2_FS_POSIX_ACL=y
654# CONFIG_EXT2_FS_SECURITY is not set 824# CONFIG_EXT2_FS_SECURITY is not set
825# CONFIG_EXT2_FS_XIP is not set
655CONFIG_EXT3_FS=y 826CONFIG_EXT3_FS=y
656CONFIG_EXT3_FS_XATTR=y 827CONFIG_EXT3_FS_XATTR=y
657CONFIG_EXT3_FS_POSIX_ACL=y 828CONFIG_EXT3_FS_POSIX_ACL=y
@@ -670,10 +841,12 @@ CONFIG_FS_POSIX_ACL=y
670# CONFIG_XFS_FS is not set 841# CONFIG_XFS_FS is not set
671# CONFIG_MINIX_FS is not set 842# CONFIG_MINIX_FS is not set
672# CONFIG_ROMFS_FS is not set 843# CONFIG_ROMFS_FS is not set
844CONFIG_INOTIFY=y
673# CONFIG_QUOTA is not set 845# CONFIG_QUOTA is not set
674CONFIG_DNOTIFY=y 846CONFIG_DNOTIFY=y
675CONFIG_AUTOFS_FS=m 847CONFIG_AUTOFS_FS=m
676CONFIG_AUTOFS4_FS=m 848CONFIG_AUTOFS4_FS=m
849CONFIG_FUSE_FS=m
677 850
678# 851#
679# CD-ROM/DVD Filesystems 852# CD-ROM/DVD Filesystems
@@ -694,13 +867,10 @@ CONFIG_AUTOFS4_FS=m
694CONFIG_PROC_FS=y 867CONFIG_PROC_FS=y
695CONFIG_PROC_KCORE=y 868CONFIG_PROC_KCORE=y
696CONFIG_SYSFS=y 869CONFIG_SYSFS=y
697# CONFIG_DEVFS_FS is not set
698CONFIG_DEVPTS_FS_XATTR=y
699CONFIG_DEVPTS_FS_SECURITY=y
700CONFIG_TMPFS=y 870CONFIG_TMPFS=y
701# CONFIG_TMPFS_XATTR is not set
702# CONFIG_HUGETLB_PAGE is not set 871# CONFIG_HUGETLB_PAGE is not set
703CONFIG_RAMFS=y 872CONFIG_RAMFS=y
873CONFIG_RELAYFS_FS=m
704 874
705# 875#
706# Miscellaneous filesystems 876# Miscellaneous filesystems
@@ -712,6 +882,8 @@ CONFIG_RAMFS=y
712# CONFIG_BEFS_FS is not set 882# CONFIG_BEFS_FS is not set
713# CONFIG_BFS_FS is not set 883# CONFIG_BFS_FS is not set
714# CONFIG_EFS_FS is not set 884# CONFIG_EFS_FS is not set
885# CONFIG_JFFS_FS is not set
886# CONFIG_JFFS2_FS is not set
715CONFIG_CRAMFS=m 887CONFIG_CRAMFS=m
716# CONFIG_VXFS_FS is not set 888# CONFIG_VXFS_FS is not set
717# CONFIG_HPFS_FS is not set 889# CONFIG_HPFS_FS is not set
@@ -732,6 +904,7 @@ CONFIG_NFSD=m
732CONFIG_ROOT_NFS=y 904CONFIG_ROOT_NFS=y
733CONFIG_LOCKD=y 905CONFIG_LOCKD=y
734CONFIG_EXPORTFS=m 906CONFIG_EXPORTFS=m
907CONFIG_NFS_COMMON=y
735CONFIG_SUNRPC=y 908CONFIG_SUNRPC=y
736# CONFIG_RPCSEC_GSS_KRB5 is not set 909# CONFIG_RPCSEC_GSS_KRB5 is not set
737# CONFIG_RPCSEC_GSS_SPKM3 is not set 910# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -741,6 +914,7 @@ CONFIG_SMB_FS=m
741# CONFIG_NCP_FS is not set 914# CONFIG_NCP_FS is not set
742# CONFIG_CODA_FS is not set 915# CONFIG_CODA_FS is not set
743# CONFIG_AFS_FS is not set 916# CONFIG_AFS_FS is not set
917# CONFIG_9P_FS is not set
744 918
745# 919#
746# Partition Types 920# Partition Types
@@ -800,7 +974,9 @@ CONFIG_NLS_DEFAULT="iso8859-1"
800# 974#
801# Kernel hacking 975# Kernel hacking
802# 976#
977# CONFIG_PRINTK_TIME is not set
803# CONFIG_DEBUG_KERNEL is not set 978# CONFIG_DEBUG_KERNEL is not set
979CONFIG_LOG_BUF_SHIFT=14
804CONFIG_CROSSCOMPILE=y 980CONFIG_CROSSCOMPILE=y
805CONFIG_CMDLINE="" 981CONFIG_CMDLINE=""
806 982
@@ -816,27 +992,28 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
816# 992#
817CONFIG_CRYPTO=y 993CONFIG_CRYPTO=y
818CONFIG_CRYPTO_HMAC=y 994CONFIG_CRYPTO_HMAC=y
819CONFIG_CRYPTO_NULL=y 995CONFIG_CRYPTO_NULL=m
820# CONFIG_CRYPTO_MD4 is not set 996CONFIG_CRYPTO_MD4=m
821# CONFIG_CRYPTO_MD5 is not set 997CONFIG_CRYPTO_MD5=m
822# CONFIG_CRYPTO_SHA1 is not set 998CONFIG_CRYPTO_SHA1=m
823# CONFIG_CRYPTO_SHA256 is not set 999CONFIG_CRYPTO_SHA256=m
824CONFIG_CRYPTO_SHA512=y 1000CONFIG_CRYPTO_SHA512=m
825CONFIG_CRYPTO_WP512=m 1001CONFIG_CRYPTO_WP512=m
826# CONFIG_CRYPTO_DES is not set 1002CONFIG_CRYPTO_TGR192=m
827# CONFIG_CRYPTO_BLOWFISH is not set 1003CONFIG_CRYPTO_DES=m
828CONFIG_CRYPTO_TWOFISH=y 1004CONFIG_CRYPTO_BLOWFISH=m
829# CONFIG_CRYPTO_SERPENT is not set 1005CONFIG_CRYPTO_TWOFISH=m
1006CONFIG_CRYPTO_SERPENT=m
830CONFIG_CRYPTO_AES=m 1007CONFIG_CRYPTO_AES=m
831# CONFIG_CRYPTO_CAST5 is not set 1008CONFIG_CRYPTO_CAST5=m
832# CONFIG_CRYPTO_CAST6 is not set 1009CONFIG_CRYPTO_CAST6=m
833CONFIG_CRYPTO_TEA=m 1010CONFIG_CRYPTO_TEA=m
834# CONFIG_CRYPTO_ARC4 is not set 1011CONFIG_CRYPTO_ARC4=m
835CONFIG_CRYPTO_KHAZAD=m 1012CONFIG_CRYPTO_KHAZAD=m
836CONFIG_CRYPTO_ANUBIS=m 1013CONFIG_CRYPTO_ANUBIS=m
837CONFIG_CRYPTO_DEFLATE=y 1014CONFIG_CRYPTO_DEFLATE=m
838CONFIG_CRYPTO_MICHAEL_MIC=y 1015CONFIG_CRYPTO_MICHAEL_MIC=m
839# CONFIG_CRYPTO_CRC32C is not set 1016CONFIG_CRYPTO_CRC32C=m
840# CONFIG_CRYPTO_TEST is not set 1017# CONFIG_CRYPTO_TEST is not set
841 1018
842# 1019#
@@ -847,9 +1024,8 @@ CONFIG_CRYPTO_MICHAEL_MIC=y
847# Library routines 1024# Library routines
848# 1025#
849CONFIG_CRC_CCITT=m 1026CONFIG_CRC_CCITT=m
1027CONFIG_CRC16=m
850CONFIG_CRC32=y 1028CONFIG_CRC32=y
851# CONFIG_LIBCRC32C is not set 1029CONFIG_LIBCRC32C=m
852CONFIG_ZLIB_INFLATE=y 1030CONFIG_ZLIB_INFLATE=m
853CONFIG_ZLIB_DEFLATE=y 1031CONFIG_ZLIB_DEFLATE=m
854CONFIG_GENERIC_HARDIRQS=y
855CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/pb1550_defconfig b/arch/mips/configs/pb1550_defconfig
index 8e426776c098..bbad27cb40a2 100644
--- a/arch/mips/configs/pb1550_defconfig
+++ b/arch/mips/configs/pb1550_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:09 2005 4# Thu Oct 20 22:26:47 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,24 +11,29 @@ CONFIG_32BIT=y
14CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
25# CONFIG_BSD_PROCESS_ACCT is not set 24# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y 25CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set 26# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14
29CONFIG_HOTPLUG=y 27CONFIG_HOTPLUG=y
30CONFIG_KOBJECT_UEVENT=y 28CONFIG_KOBJECT_UEVENT=y
31# CONFIG_IKCONFIG is not set 29# CONFIG_IKCONFIG is not set
30CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y 31CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y 32CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_EXTRA_PASS is not set 33# CONFIG_KALLSYMS_EXTRA_PASS is not set
34CONFIG_PRINTK=y
35CONFIG_BUG=y
36CONFIG_BASE_FULL=y
35CONFIG_FUTEX=y 37CONFIG_FUTEX=y
36CONFIG_EPOLL=y 38CONFIG_EPOLL=y
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -41,6 +43,7 @@ CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0 43CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0 44CONFIG_CC_ALIGN_JUMPS=0
43# CONFIG_TINY_SHMEM is not set 45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
44 47
45# 48#
46# Loadable module support 49# Loadable module support
@@ -56,63 +59,80 @@ CONFIG_KMOD=y
56# 59#
57# Machine selection 60# Machine selection
58# 61#
59# CONFIG_MACH_JAZZ is not set 62# CONFIG_MIPS_MTX1 is not set
60# CONFIG_MACH_VR41XX is not set 63# CONFIG_MIPS_BOSPORUS is not set
61# CONFIG_TOSHIBA_JMR3927 is not set 64# CONFIG_MIPS_PB1000 is not set
65# CONFIG_MIPS_PB1100 is not set
66# CONFIG_MIPS_PB1500 is not set
67CONFIG_MIPS_PB1550=y
68# CONFIG_MIPS_PB1200 is not set
69# CONFIG_MIPS_DB1000 is not set
70# CONFIG_MIPS_DB1100 is not set
71# CONFIG_MIPS_DB1500 is not set
72# CONFIG_MIPS_DB1550 is not set
73# CONFIG_MIPS_DB1200 is not set
74# CONFIG_MIPS_MIRAGE is not set
62# CONFIG_MIPS_COBALT is not set 75# CONFIG_MIPS_COBALT is not set
63# CONFIG_MACH_DECSTATION is not set 76# CONFIG_MACH_DECSTATION is not set
64# CONFIG_MIPS_EV64120 is not set 77# CONFIG_MIPS_EV64120 is not set
65# CONFIG_MIPS_EV96100 is not set 78# CONFIG_MIPS_EV96100 is not set
66# CONFIG_MIPS_IVR is not set 79# CONFIG_MIPS_IVR is not set
67# CONFIG_LASAT is not set
68# CONFIG_MIPS_ITE8172 is not set 80# CONFIG_MIPS_ITE8172 is not set
81# CONFIG_MACH_JAZZ is not set
82# CONFIG_LASAT is not set
69# CONFIG_MIPS_ATLAS is not set 83# CONFIG_MIPS_ATLAS is not set
70# CONFIG_MIPS_MALTA is not set 84# CONFIG_MIPS_MALTA is not set
71# CONFIG_MIPS_SEAD is not set 85# CONFIG_MIPS_SEAD is not set
86# CONFIG_MIPS_SIM is not set
87# CONFIG_MOMENCO_JAGUAR_ATX is not set
72# CONFIG_MOMENCO_OCELOT is not set 88# CONFIG_MOMENCO_OCELOT is not set
73# CONFIG_MOMENCO_OCELOT_G is not set
74# CONFIG_MOMENCO_OCELOT_C is not set
75# CONFIG_MOMENCO_OCELOT_3 is not set 89# CONFIG_MOMENCO_OCELOT_3 is not set
76# CONFIG_MOMENCO_JAGUAR_ATX is not set 90# CONFIG_MOMENCO_OCELOT_C is not set
77# CONFIG_PMC_YOSEMITE is not set 91# CONFIG_MOMENCO_OCELOT_G is not set
92# CONFIG_MIPS_XXS1500 is not set
93# CONFIG_PNX8550_V2PCI is not set
94# CONFIG_PNX8550_JBS is not set
78# CONFIG_DDB5074 is not set 95# CONFIG_DDB5074 is not set
79# CONFIG_DDB5476 is not set 96# CONFIG_DDB5476 is not set
80# CONFIG_DDB5477 is not set 97# CONFIG_DDB5477 is not set
81# CONFIG_NEC_OSPREY is not set 98# CONFIG_MACH_VR41XX is not set
99# CONFIG_PMC_YOSEMITE is not set
100# CONFIG_QEMU is not set
82# CONFIG_SGI_IP22 is not set 101# CONFIG_SGI_IP22 is not set
83CONFIG_SOC_AU1X00=y 102# CONFIG_SGI_IP27 is not set
84# CONFIG_SOC_AU1000 is not set 103# CONFIG_SGI_IP32 is not set
85# CONFIG_SOC_AU1100 is not set 104# CONFIG_SIBYTE_BIGSUR is not set
86# CONFIG_SOC_AU1500 is not set 105# CONFIG_SIBYTE_SWARM is not set
87CONFIG_SOC_AU1550=y 106# CONFIG_SIBYTE_SENTOSA is not set
88# CONFIG_MIPS_PB1000 is not set 107# CONFIG_SIBYTE_RHONE is not set
89# CONFIG_MIPS_PB1100 is not set 108# CONFIG_SIBYTE_CARMEL is not set
90# CONFIG_MIPS_PB1500 is not set 109# CONFIG_SIBYTE_PTSWARM is not set
91CONFIG_MIPS_PB1550=y 110# CONFIG_SIBYTE_LITTLESUR is not set
92# CONFIG_MIPS_DB1000 is not set 111# CONFIG_SIBYTE_CRHINE is not set
93# CONFIG_MIPS_DB1100 is not set 112# CONFIG_SIBYTE_CRHONE is not set
94# CONFIG_MIPS_DB1500 is not set
95# CONFIG_MIPS_DB1550 is not set
96# CONFIG_MIPS_BOSPORUS is not set
97# CONFIG_MIPS_MIRAGE is not set
98# CONFIG_MIPS_XXS1500 is not set
99# CONFIG_MIPS_MTX1 is not set
100# CONFIG_SIBYTE_SB1xxx_SOC is not set
101# CONFIG_SNI_RM200_PCI is not set 113# CONFIG_SNI_RM200_PCI is not set
114# CONFIG_TOSHIBA_JMR3927 is not set
102# CONFIG_TOSHIBA_RBTX4927 is not set 115# CONFIG_TOSHIBA_RBTX4927 is not set
116# CONFIG_TOSHIBA_RBTX4938 is not set
103CONFIG_RWSEM_GENERIC_SPINLOCK=y 117CONFIG_RWSEM_GENERIC_SPINLOCK=y
104CONFIG_GENERIC_CALIBRATE_DELAY=y 118CONFIG_GENERIC_CALIBRATE_DELAY=y
105CONFIG_HAVE_DEC_LOCK=y 119CONFIG_DMA_NONCOHERENT=y
106CONFIG_DMA_COHERENT=y 120CONFIG_DMA_NEED_PCI_MAP_STATE=y
107CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y 121CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y
122# CONFIG_CPU_BIG_ENDIAN is not set
108CONFIG_CPU_LITTLE_ENDIAN=y 123CONFIG_CPU_LITTLE_ENDIAN=y
124CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
125CONFIG_SOC_AU1550=y
126CONFIG_SOC_AU1X00=y
109CONFIG_MIPS_L1_CACHE_SHIFT=5 127CONFIG_MIPS_L1_CACHE_SHIFT=5
110 128
111# 129#
112# CPU selection 130# CPU selection
113# 131#
114CONFIG_CPU_MIPS32=y 132CONFIG_CPU_MIPS32_R1=y
115# CONFIG_CPU_MIPS64 is not set 133# CONFIG_CPU_MIPS32_R2 is not set
134# CONFIG_CPU_MIPS64_R1 is not set
135# CONFIG_CPU_MIPS64_R2 is not set
116# CONFIG_CPU_R3000 is not set 136# CONFIG_CPU_R3000 is not set
117# CONFIG_CPU_TX39XX is not set 137# CONFIG_CPU_TX39XX is not set
118# CONFIG_CPU_VR41XX is not set 138# CONFIG_CPU_VR41XX is not set
@@ -128,15 +148,39 @@ CONFIG_CPU_MIPS32=y
128# CONFIG_CPU_RM7000 is not set 148# CONFIG_CPU_RM7000 is not set
129# CONFIG_CPU_RM9000 is not set 149# CONFIG_CPU_RM9000 is not set
130# CONFIG_CPU_SB1 is not set 150# CONFIG_CPU_SB1 is not set
151CONFIG_SYS_HAS_CPU_MIPS32_R1=y
152CONFIG_CPU_MIPS32=y
153CONFIG_CPU_MIPSR1=y
154CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
155CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
156
157#
158# Kernel type
159#
160CONFIG_32BIT=y
161# CONFIG_64BIT is not set
131CONFIG_PAGE_SIZE_4KB=y 162CONFIG_PAGE_SIZE_4KB=y
132# CONFIG_PAGE_SIZE_8KB is not set 163# CONFIG_PAGE_SIZE_8KB is not set
133# CONFIG_PAGE_SIZE_16KB is not set 164# CONFIG_PAGE_SIZE_16KB is not set
134# CONFIG_PAGE_SIZE_64KB is not set 165# CONFIG_PAGE_SIZE_64KB is not set
135CONFIG_CPU_HAS_PREFETCH=y 166CONFIG_CPU_HAS_PREFETCH=y
167# CONFIG_MIPS_MT is not set
136CONFIG_64BIT_PHYS_ADDR=y 168CONFIG_64BIT_PHYS_ADDR=y
137# CONFIG_CPU_ADVANCED is not set 169# CONFIG_CPU_ADVANCED is not set
138CONFIG_CPU_HAS_LLSC=y 170CONFIG_CPU_HAS_LLSC=y
139CONFIG_CPU_HAS_SYNC=y 171CONFIG_CPU_HAS_SYNC=y
172CONFIG_GENERIC_HARDIRQS=y
173CONFIG_GENERIC_IRQ_PROBE=y
174CONFIG_ARCH_FLATMEM_ENABLE=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_PREEMPT_NONE=y
183# CONFIG_PREEMPT_VOLUNTARY is not set
140# CONFIG_PREEMPT is not set 184# CONFIG_PREEMPT is not set
141 185
142# 186#
@@ -145,7 +189,6 @@ CONFIG_CPU_HAS_SYNC=y
145CONFIG_HW_HAS_PCI=y 189CONFIG_HW_HAS_PCI=y
146CONFIG_PCI=y 190CONFIG_PCI=y
147CONFIG_PCI_LEGACY_PROC=y 191CONFIG_PCI_LEGACY_PROC=y
148CONFIG_PCI_NAMES=y
149CONFIG_MMU=y 192CONFIG_MMU=y
150 193
151# 194#
@@ -154,6 +197,8 @@ CONFIG_MMU=y
154CONFIG_PCCARD=m 197CONFIG_PCCARD=m
155# CONFIG_PCMCIA_DEBUG is not set 198# CONFIG_PCMCIA_DEBUG is not set
156CONFIG_PCMCIA=m 199CONFIG_PCMCIA=m
200CONFIG_PCMCIA_LOAD_CIS=y
201CONFIG_PCMCIA_IOCTL=y
157CONFIG_CARDBUS=y 202CONFIG_CARDBUS=y
158 203
159# 204#
@@ -177,6 +222,100 @@ CONFIG_PCCARD_NONSTATIC=m
177CONFIG_BINFMT_ELF=y 222CONFIG_BINFMT_ELF=y
178# CONFIG_BINFMT_MISC is not set 223# CONFIG_BINFMT_MISC is not set
179CONFIG_TRAD_SIGNALS=y 224CONFIG_TRAD_SIGNALS=y
225# CONFIG_PM is not set
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=m
240CONFIG_NET_KEY=y
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
247CONFIG_IP_PNP_BOOTP=y
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
253# CONFIG_SYN_COOKIES is not set
254# CONFIG_INET_AH is not set
255# CONFIG_INET_ESP is not set
256# CONFIG_INET_IPCOMP is not set
257CONFIG_INET_TUNNEL=m
258CONFIG_INET_DIAG=y
259CONFIG_INET_TCP_DIAG=y
260# CONFIG_TCP_CONG_ADVANCED is not set
261CONFIG_TCP_CONG_BIC=y
262
263#
264# IP: Virtual Server Configuration
265#
266# CONFIG_IP_VS is not set
267# CONFIG_IPV6 is not set
268CONFIG_NETFILTER=y
269# CONFIG_NETFILTER_DEBUG is not set
270CONFIG_NETFILTER_NETLINK=m
271CONFIG_NETFILTER_NETLINK_QUEUE=m
272CONFIG_NETFILTER_NETLINK_LOG=m
273
274#
275# IP: Netfilter Configuration
276#
277# CONFIG_IP_NF_CONNTRACK is not set
278CONFIG_IP_NF_PPTP=m
279# CONFIG_IP_NF_QUEUE is not set
280# CONFIG_IP_NF_IPTABLES is not set
281# CONFIG_IP_NF_ARPTABLES is not set
282
283#
284# DCCP Configuration (EXPERIMENTAL)
285#
286# CONFIG_IP_DCCP is not set
287
288#
289# SCTP Configuration (EXPERIMENTAL)
290#
291# CONFIG_IP_SCTP is not set
292# CONFIG_ATM is not set
293# CONFIG_BRIDGE is not set
294# CONFIG_VLAN_8021Q is not set
295# CONFIG_DECNET is not set
296# CONFIG_LLC2 is not set
297# CONFIG_IPX is not set
298# CONFIG_ATALK is not set
299# CONFIG_X25 is not set
300# CONFIG_LAPB is not set
301# CONFIG_NET_DIVERT is not set
302# CONFIG_ECONET is not set
303# CONFIG_WAN_ROUTER is not set
304# CONFIG_NET_SCHED is not set
305# CONFIG_NET_CLS_ROUTE is not set
306
307#
308# Network testing
309#
310# CONFIG_NET_PKTGEN is not set
311# CONFIG_HAMRADIO is not set
312# CONFIG_IRDA is not set
313# CONFIG_BT is not set
314CONFIG_IEEE80211=m
315# CONFIG_IEEE80211_DEBUG is not set
316CONFIG_IEEE80211_CRYPT_WEP=m
317CONFIG_IEEE80211_CRYPT_CCMP=m
318CONFIG_IEEE80211_CRYPT_TKIP=m
180 319
181# 320#
182# Device Drivers 321# Device Drivers
@@ -187,12 +326,87 @@ CONFIG_TRAD_SIGNALS=y
187# 326#
188CONFIG_STANDALONE=y 327CONFIG_STANDALONE=y
189CONFIG_PREVENT_FIRMWARE_BUILD=y 328CONFIG_PREVENT_FIRMWARE_BUILD=y
190# CONFIG_FW_LOADER is not set 329CONFIG_FW_LOADER=m
330
331#
332# Connector - unified userspace <-> kernelspace linker
333#
334CONFIG_CONNECTOR=m
191 335
192# 336#
193# Memory Technology Devices (MTD) 337# Memory Technology Devices (MTD)
194# 338#
195# CONFIG_MTD is not set 339CONFIG_MTD=y
340# CONFIG_MTD_DEBUG is not set
341# CONFIG_MTD_CONCAT is not set
342CONFIG_MTD_PARTITIONS=y
343# CONFIG_MTD_REDBOOT_PARTS is not set
344# CONFIG_MTD_CMDLINE_PARTS is not set
345
346#
347# User Modules And Translation Layers
348#
349CONFIG_MTD_CHAR=y
350CONFIG_MTD_BLOCK=y
351# CONFIG_FTL is not set
352# CONFIG_NFTL is not set
353# CONFIG_INFTL is not set
354
355#
356# RAM/ROM/Flash chip drivers
357#
358CONFIG_MTD_CFI=y
359# CONFIG_MTD_JEDECPROBE is not set
360CONFIG_MTD_GEN_PROBE=y
361# CONFIG_MTD_CFI_ADV_OPTIONS is not set
362CONFIG_MTD_MAP_BANK_WIDTH_1=y
363CONFIG_MTD_MAP_BANK_WIDTH_2=y
364CONFIG_MTD_MAP_BANK_WIDTH_4=y
365# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
366# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
367# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
368CONFIG_MTD_CFI_I1=y
369CONFIG_MTD_CFI_I2=y
370# CONFIG_MTD_CFI_I4 is not set
371# CONFIG_MTD_CFI_I8 is not set
372# CONFIG_MTD_CFI_INTELEXT is not set
373CONFIG_MTD_CFI_AMDSTD=y
374CONFIG_MTD_CFI_AMDSTD_RETRY=0
375# CONFIG_MTD_CFI_STAA is not set
376CONFIG_MTD_CFI_UTIL=y
377# CONFIG_MTD_RAM is not set
378# CONFIG_MTD_ROM is not set
379# CONFIG_MTD_ABSENT is not set
380
381#
382# Mapping drivers for chip access
383#
384# CONFIG_MTD_COMPLEX_MAPPINGS is not set
385# CONFIG_MTD_PHYSMAP is not set
386CONFIG_MTD_ALCHEMY=y
387# CONFIG_MTD_PLATRAM is not set
388
389#
390# Self-contained MTD device drivers
391#
392# CONFIG_MTD_PMC551 is not set
393# CONFIG_MTD_SLRAM is not set
394# CONFIG_MTD_PHRAM is not set
395# CONFIG_MTD_MTDRAM is not set
396# CONFIG_MTD_BLKMTD is not set
397# CONFIG_MTD_BLOCK2MTD is not set
398
399#
400# Disk-On-Chip Device Drivers
401#
402# CONFIG_MTD_DOC2000 is not set
403# CONFIG_MTD_DOC2001 is not set
404# CONFIG_MTD_DOC2001PLUS is not set
405
406#
407# NAND Flash Device Drivers
408#
409# CONFIG_MTD_NAND is not set
196 410
197# 411#
198# Parallel port support 412# Parallel port support
@@ -206,7 +420,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
206# 420#
207# Block devices 421# Block devices
208# 422#
209# CONFIG_BLK_DEV_FD is not set
210# CONFIG_BLK_CPQ_DA is not set 423# CONFIG_BLK_CPQ_DA is not set
211# CONFIG_BLK_CPQ_CISS_DA is not set 424# CONFIG_BLK_CPQ_CISS_DA is not set
212# CONFIG_BLK_DEV_DAC960 is not set 425# CONFIG_BLK_DEV_DAC960 is not set
@@ -218,7 +431,6 @@ CONFIG_BLK_DEV_LOOP=y
218# CONFIG_BLK_DEV_SX8 is not set 431# CONFIG_BLK_DEV_SX8 is not set
219# CONFIG_BLK_DEV_RAM is not set 432# CONFIG_BLK_DEV_RAM is not set
220CONFIG_BLK_DEV_RAM_COUNT=16 433CONFIG_BLK_DEV_RAM_COUNT=16
221CONFIG_INITRAMFS_SOURCE=""
222# CONFIG_LBD is not set 434# CONFIG_LBD is not set
223CONFIG_CDROM_PKTCDVD=m 435CONFIG_CDROM_PKTCDVD=m
224CONFIG_CDROM_PKTCDVD_BUFFERS=8 436CONFIG_CDROM_PKTCDVD_BUFFERS=8
@@ -275,6 +487,7 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y
275CONFIG_BLK_DEV_HPT366=y 487CONFIG_BLK_DEV_HPT366=y
276# CONFIG_BLK_DEV_SC1200 is not set 488# CONFIG_BLK_DEV_SC1200 is not set
277# CONFIG_BLK_DEV_PIIX is not set 489# CONFIG_BLK_DEV_PIIX is not set
490# CONFIG_BLK_DEV_IT821X is not set
278# CONFIG_BLK_DEV_NS87415 is not set 491# CONFIG_BLK_DEV_NS87415 is not set
279# CONFIG_BLK_DEV_PDC202XX_OLD is not set 492# CONFIG_BLK_DEV_PDC202XX_OLD is not set
280# CONFIG_BLK_DEV_PDC202XX_NEW is not set 493# CONFIG_BLK_DEV_PDC202XX_NEW is not set
@@ -292,6 +505,7 @@ CONFIG_BLK_DEV_IDEDMA=y
292# 505#
293# SCSI device support 506# SCSI device support
294# 507#
508CONFIG_RAID_ATTRS=m
295# CONFIG_SCSI is not set 509# CONFIG_SCSI is not set
296 510
297# 511#
@@ -302,6 +516,7 @@ CONFIG_BLK_DEV_IDEDMA=y
302# 516#
303# Fusion MPT device support 517# Fusion MPT device support
304# 518#
519# CONFIG_FUSION is not set
305 520
306# 521#
307# IEEE 1394 (FireWire) support 522# IEEE 1394 (FireWire) support
@@ -314,94 +529,13 @@ CONFIG_BLK_DEV_IDEDMA=y
314# CONFIG_I2O is not set 529# CONFIG_I2O is not set
315 530
316# 531#
317# Networking support 532# Network device support
318#
319CONFIG_NET=y
320
321#
322# Networking options
323#
324CONFIG_PACKET=y
325# CONFIG_PACKET_MMAP is not set
326CONFIG_NETLINK_DEV=y
327CONFIG_UNIX=y
328CONFIG_NET_KEY=y
329CONFIG_INET=y
330CONFIG_IP_MULTICAST=y
331# CONFIG_IP_ADVANCED_ROUTER is not set
332CONFIG_IP_PNP=y
333# CONFIG_IP_PNP_DHCP is not set
334CONFIG_IP_PNP_BOOTP=y
335# CONFIG_IP_PNP_RARP is not set
336# CONFIG_NET_IPIP is not set
337# CONFIG_NET_IPGRE is not set
338# CONFIG_IP_MROUTE is not set
339# CONFIG_ARPD is not set
340# CONFIG_SYN_COOKIES is not set
341# CONFIG_INET_AH is not set
342# CONFIG_INET_ESP is not set
343# CONFIG_INET_IPCOMP is not set
344CONFIG_INET_TUNNEL=m
345CONFIG_IP_TCPDIAG=m
346# CONFIG_IP_TCPDIAG_IPV6 is not set
347
348#
349# IP: Virtual Server Configuration
350#
351# CONFIG_IP_VS is not set
352# CONFIG_IPV6 is not set
353CONFIG_NETFILTER=y
354# CONFIG_NETFILTER_DEBUG is not set
355
356#
357# IP: Netfilter Configuration
358# 533#
359# CONFIG_IP_NF_CONNTRACK is not set
360CONFIG_IP_NF_CONNTRACK_MARK=y
361# CONFIG_IP_NF_QUEUE is not set
362# CONFIG_IP_NF_IPTABLES is not set
363# CONFIG_IP_NF_ARPTABLES is not set
364CONFIG_XFRM=y
365CONFIG_XFRM_USER=m
366
367#
368# SCTP Configuration (EXPERIMENTAL)
369#
370# CONFIG_IP_SCTP is not set
371# CONFIG_ATM is not set
372# CONFIG_BRIDGE is not set
373# CONFIG_VLAN_8021Q is not set
374# CONFIG_DECNET is not set
375# CONFIG_LLC2 is not set
376# CONFIG_IPX is not set
377# CONFIG_ATALK is not set
378# CONFIG_X25 is not set
379# CONFIG_LAPB is not set
380# CONFIG_NET_DIVERT is not set
381# CONFIG_ECONET is not set
382# CONFIG_WAN_ROUTER is not set
383
384#
385# QoS and/or fair queueing
386#
387# CONFIG_NET_SCHED is not set
388# CONFIG_NET_CLS_ROUTE is not set
389
390#
391# Network testing
392#
393# CONFIG_NET_PKTGEN is not set
394# CONFIG_NETPOLL is not set
395# CONFIG_NET_POLL_CONTROLLER is not set
396# CONFIG_HAMRADIO is not set
397# CONFIG_IRDA is not set
398# CONFIG_BT is not set
399CONFIG_NETDEVICES=y 534CONFIG_NETDEVICES=y
400# CONFIG_DUMMY is not set 535# CONFIG_DUMMY is not set
401# CONFIG_BONDING is not set 536# CONFIG_BONDING is not set
402# CONFIG_EQUALIZER is not set 537# CONFIG_EQUALIZER is not set
403# CONFIG_TUN is not set 538# CONFIG_TUN is not set
404# CONFIG_ETHERTAP is not set
405 539
406# 540#
407# ARCnet devices 541# ARCnet devices
@@ -409,6 +543,21 @@ CONFIG_NETDEVICES=y
409# CONFIG_ARCNET is not set 543# CONFIG_ARCNET is not set
410 544
411# 545#
546# PHY device support
547#
548CONFIG_PHYLIB=m
549CONFIG_PHYCONTROL=y
550
551#
552# MII PHY device drivers
553#
554CONFIG_MARVELL_PHY=m
555CONFIG_DAVICOM_PHY=m
556CONFIG_QSEMI_PHY=m
557CONFIG_LXT_PHY=m
558CONFIG_CICADA_PHY=m
559
560#
412# Ethernet (10 or 100Mbit) 561# Ethernet (10 or 100Mbit)
413# 562#
414CONFIG_NET_ETHERNET=y 563CONFIG_NET_ETHERNET=y
@@ -435,12 +584,16 @@ CONFIG_MIPS_AU1X00_ENET=y
435# CONFIG_HAMACHI is not set 584# CONFIG_HAMACHI is not set
436# CONFIG_YELLOWFIN is not set 585# CONFIG_YELLOWFIN is not set
437# CONFIG_R8169 is not set 586# CONFIG_R8169 is not set
587# CONFIG_SIS190 is not set
588# CONFIG_SKGE is not set
438# CONFIG_SK98LIN is not set 589# CONFIG_SK98LIN is not set
439# CONFIG_TIGON3 is not set 590# CONFIG_TIGON3 is not set
591# CONFIG_BNX2 is not set
440 592
441# 593#
442# Ethernet (10000 Mbit) 594# Ethernet (10000 Mbit)
443# 595#
596# CONFIG_CHELSIO_T1 is not set
444# CONFIG_IXGB is not set 597# CONFIG_IXGB is not set
445# CONFIG_S2IO is not set 598# CONFIG_S2IO is not set
446 599
@@ -453,6 +606,8 @@ CONFIG_MIPS_AU1X00_ENET=y
453# Wireless LAN (non-hamradio) 606# Wireless LAN (non-hamradio)
454# 607#
455# CONFIG_NET_RADIO is not set 608# CONFIG_NET_RADIO is not set
609# CONFIG_IPW_DEBUG is not set
610CONFIG_IPW2200=m
456 611
457# 612#
458# PCMCIA network device support 613# PCMCIA network device support
@@ -476,6 +631,8 @@ CONFIG_PPPOE=m
476# CONFIG_SLIP is not set 631# CONFIG_SLIP is not set
477# CONFIG_SHAPER is not set 632# CONFIG_SHAPER is not set
478# CONFIG_NETCONSOLE is not set 633# CONFIG_NETCONSOLE is not set
634# CONFIG_NETPOLL is not set
635# CONFIG_NET_POLL_CONTROLLER is not set
479 636
480# 637#
481# ISDN subsystem 638# ISDN subsystem
@@ -505,19 +662,6 @@ CONFIG_INPUT_EVDEV=y
505# CONFIG_INPUT_EVBUG is not set 662# CONFIG_INPUT_EVBUG is not set
506 663
507# 664#
508# Input I/O drivers
509#
510# CONFIG_GAMEPORT is not set
511CONFIG_SOUND_GAMEPORT=y
512CONFIG_SERIO=y
513# CONFIG_SERIO_I8042 is not set
514CONFIG_SERIO_SERPORT=y
515# CONFIG_SERIO_CT82C710 is not set
516# CONFIG_SERIO_PCIPS2 is not set
517# CONFIG_SERIO_LIBPS2 is not set
518CONFIG_SERIO_RAW=m
519
520#
521# Input Device Drivers 665# Input Device Drivers
522# 666#
523# CONFIG_INPUT_KEYBOARD is not set 667# CONFIG_INPUT_KEYBOARD is not set
@@ -527,6 +671,17 @@ CONFIG_SERIO_RAW=m
527# CONFIG_INPUT_MISC is not set 671# CONFIG_INPUT_MISC is not set
528 672
529# 673#
674# Hardware I/O ports
675#
676CONFIG_SERIO=y
677# CONFIG_SERIO_I8042 is not set
678CONFIG_SERIO_SERPORT=y
679# CONFIG_SERIO_PCIPS2 is not set
680# CONFIG_SERIO_LIBPS2 is not set
681CONFIG_SERIO_RAW=m
682# CONFIG_GAMEPORT is not set
683
684#
530# Character devices 685# Character devices
531# 686#
532# CONFIG_VT is not set 687# CONFIG_VT is not set
@@ -546,6 +701,7 @@ CONFIG_SERIAL_AU1X00=y
546CONFIG_SERIAL_AU1X00_CONSOLE=y 701CONFIG_SERIAL_AU1X00_CONSOLE=y
547CONFIG_SERIAL_CORE=y 702CONFIG_SERIAL_CORE=y
548CONFIG_SERIAL_CORE_CONSOLE=y 703CONFIG_SERIAL_CORE_CONSOLE=y
704# CONFIG_SERIAL_JSM is not set
549CONFIG_UNIX98_PTYS=y 705CONFIG_UNIX98_PTYS=y
550CONFIG_LEGACY_PTYS=y 706CONFIG_LEGACY_PTYS=y
551CONFIG_LEGACY_PTY_COUNT=256 707CONFIG_LEGACY_PTY_COUNT=256
@@ -577,6 +733,11 @@ CONFIG_SYNCLINK_CS=m
577# CONFIG_RAW_DRIVER is not set 733# CONFIG_RAW_DRIVER is not set
578 734
579# 735#
736# TPM devices
737#
738# CONFIG_TCG_TPM is not set
739
740#
580# I2C support 741# I2C support
581# 742#
582# CONFIG_I2C is not set 743# CONFIG_I2C is not set
@@ -587,10 +748,20 @@ CONFIG_SYNCLINK_CS=m
587# CONFIG_W1 is not set 748# CONFIG_W1 is not set
588 749
589# 750#
751# Hardware Monitoring support
752#
753# CONFIG_HWMON is not set
754# CONFIG_HWMON_VID is not set
755
756#
590# Misc devices 757# Misc devices
591# 758#
592 759
593# 760#
761# Multimedia Capabilities Port drivers
762#
763
764#
594# Multimedia devices 765# Multimedia devices
595# 766#
596# CONFIG_VIDEO_DEV is not set 767# CONFIG_VIDEO_DEV is not set
@@ -604,7 +775,6 @@ CONFIG_SYNCLINK_CS=m
604# Graphics support 775# Graphics support
605# 776#
606# CONFIG_FB is not set 777# CONFIG_FB is not set
607# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
608 778
609# 779#
610# Sound 780# Sound
@@ -614,13 +784,9 @@ CONFIG_SYNCLINK_CS=m
614# 784#
615# USB support 785# USB support
616# 786#
617# CONFIG_USB is not set
618CONFIG_USB_ARCH_HAS_HCD=y 787CONFIG_USB_ARCH_HAS_HCD=y
619CONFIG_USB_ARCH_HAS_OHCI=y 788CONFIG_USB_ARCH_HAS_OHCI=y
620 789# CONFIG_USB is not set
621#
622# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
623#
624 790
625# 791#
626# USB Gadget Support 792# USB Gadget Support
@@ -638,12 +804,17 @@ CONFIG_USB_ARCH_HAS_OHCI=y
638# CONFIG_INFINIBAND is not set 804# CONFIG_INFINIBAND is not set
639 805
640# 806#
807# SN Devices
808#
809
810#
641# File systems 811# File systems
642# 812#
643CONFIG_EXT2_FS=y 813CONFIG_EXT2_FS=y
644CONFIG_EXT2_FS_XATTR=y 814CONFIG_EXT2_FS_XATTR=y
645CONFIG_EXT2_FS_POSIX_ACL=y 815CONFIG_EXT2_FS_POSIX_ACL=y
646# CONFIG_EXT2_FS_SECURITY is not set 816# CONFIG_EXT2_FS_SECURITY is not set
817# CONFIG_EXT2_FS_XIP is not set
647CONFIG_EXT3_FS=y 818CONFIG_EXT3_FS=y
648CONFIG_EXT3_FS_XATTR=y 819CONFIG_EXT3_FS_XATTR=y
649CONFIG_EXT3_FS_POSIX_ACL=y 820CONFIG_EXT3_FS_POSIX_ACL=y
@@ -662,10 +833,12 @@ CONFIG_FS_POSIX_ACL=y
662# CONFIG_XFS_FS is not set 833# CONFIG_XFS_FS is not set
663# CONFIG_MINIX_FS is not set 834# CONFIG_MINIX_FS is not set
664# CONFIG_ROMFS_FS is not set 835# CONFIG_ROMFS_FS is not set
836CONFIG_INOTIFY=y
665# CONFIG_QUOTA is not set 837# CONFIG_QUOTA is not set
666CONFIG_DNOTIFY=y 838CONFIG_DNOTIFY=y
667CONFIG_AUTOFS_FS=m 839CONFIG_AUTOFS_FS=m
668CONFIG_AUTOFS4_FS=m 840CONFIG_AUTOFS4_FS=m
841CONFIG_FUSE_FS=m
669 842
670# 843#
671# CD-ROM/DVD Filesystems 844# CD-ROM/DVD Filesystems
@@ -686,13 +859,10 @@ CONFIG_AUTOFS4_FS=m
686CONFIG_PROC_FS=y 859CONFIG_PROC_FS=y
687CONFIG_PROC_KCORE=y 860CONFIG_PROC_KCORE=y
688CONFIG_SYSFS=y 861CONFIG_SYSFS=y
689# CONFIG_DEVFS_FS is not set
690CONFIG_DEVPTS_FS_XATTR=y
691CONFIG_DEVPTS_FS_SECURITY=y
692CONFIG_TMPFS=y 862CONFIG_TMPFS=y
693# CONFIG_TMPFS_XATTR is not set
694# CONFIG_HUGETLB_PAGE is not set 863# CONFIG_HUGETLB_PAGE is not set
695CONFIG_RAMFS=y 864CONFIG_RAMFS=y
865CONFIG_RELAYFS_FS=m
696 866
697# 867#
698# Miscellaneous filesystems 868# Miscellaneous filesystems
@@ -704,6 +874,8 @@ CONFIG_RAMFS=y
704# CONFIG_BEFS_FS is not set 874# CONFIG_BEFS_FS is not set
705# CONFIG_BFS_FS is not set 875# CONFIG_BFS_FS is not set
706# CONFIG_EFS_FS is not set 876# CONFIG_EFS_FS is not set
877# CONFIG_JFFS_FS is not set
878# CONFIG_JFFS2_FS is not set
707CONFIG_CRAMFS=m 879CONFIG_CRAMFS=m
708# CONFIG_VXFS_FS is not set 880# CONFIG_VXFS_FS is not set
709# CONFIG_HPFS_FS is not set 881# CONFIG_HPFS_FS is not set
@@ -724,6 +896,7 @@ CONFIG_NFSD=m
724CONFIG_ROOT_NFS=y 896CONFIG_ROOT_NFS=y
725CONFIG_LOCKD=y 897CONFIG_LOCKD=y
726CONFIG_EXPORTFS=m 898CONFIG_EXPORTFS=m
899CONFIG_NFS_COMMON=y
727CONFIG_SUNRPC=y 900CONFIG_SUNRPC=y
728# CONFIG_RPCSEC_GSS_KRB5 is not set 901# CONFIG_RPCSEC_GSS_KRB5 is not set
729# CONFIG_RPCSEC_GSS_SPKM3 is not set 902# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -733,6 +906,7 @@ CONFIG_SMB_FS=m
733# CONFIG_NCP_FS is not set 906# CONFIG_NCP_FS is not set
734# CONFIG_CODA_FS is not set 907# CONFIG_CODA_FS is not set
735# CONFIG_AFS_FS is not set 908# CONFIG_AFS_FS is not set
909# CONFIG_9P_FS is not set
736 910
737# 911#
738# Partition Types 912# Partition Types
@@ -792,7 +966,9 @@ CONFIG_NLS_DEFAULT="iso8859-1"
792# 966#
793# Kernel hacking 967# Kernel hacking
794# 968#
969# CONFIG_PRINTK_TIME is not set
795# CONFIG_DEBUG_KERNEL is not set 970# CONFIG_DEBUG_KERNEL is not set
971CONFIG_LOG_BUF_SHIFT=14
796CONFIG_CROSSCOMPILE=y 972CONFIG_CROSSCOMPILE=y
797CONFIG_CMDLINE="" 973CONFIG_CMDLINE=""
798 974
@@ -808,26 +984,27 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
808# 984#
809CONFIG_CRYPTO=y 985CONFIG_CRYPTO=y
810CONFIG_CRYPTO_HMAC=y 986CONFIG_CRYPTO_HMAC=y
811CONFIG_CRYPTO_NULL=y 987CONFIG_CRYPTO_NULL=m
812# CONFIG_CRYPTO_MD4 is not set 988CONFIG_CRYPTO_MD4=m
813# CONFIG_CRYPTO_MD5 is not set 989CONFIG_CRYPTO_MD5=m
814# CONFIG_CRYPTO_SHA1 is not set 990CONFIG_CRYPTO_SHA1=m
815# CONFIG_CRYPTO_SHA256 is not set 991CONFIG_CRYPTO_SHA256=m
816CONFIG_CRYPTO_SHA512=y 992CONFIG_CRYPTO_SHA512=m
817CONFIG_CRYPTO_WP512=m 993CONFIG_CRYPTO_WP512=m
818# CONFIG_CRYPTO_DES is not set 994CONFIG_CRYPTO_TGR192=m
819# CONFIG_CRYPTO_BLOWFISH is not set 995CONFIG_CRYPTO_DES=m
820CONFIG_CRYPTO_TWOFISH=y 996CONFIG_CRYPTO_BLOWFISH=m
821# CONFIG_CRYPTO_SERPENT is not set 997CONFIG_CRYPTO_TWOFISH=m
998CONFIG_CRYPTO_SERPENT=m
822CONFIG_CRYPTO_AES=m 999CONFIG_CRYPTO_AES=m
823# CONFIG_CRYPTO_CAST5 is not set 1000CONFIG_CRYPTO_CAST5=m
824# CONFIG_CRYPTO_CAST6 is not set 1001CONFIG_CRYPTO_CAST6=m
825CONFIG_CRYPTO_TEA=m 1002CONFIG_CRYPTO_TEA=m
826# CONFIG_CRYPTO_ARC4 is not set 1003CONFIG_CRYPTO_ARC4=m
827CONFIG_CRYPTO_KHAZAD=m 1004CONFIG_CRYPTO_KHAZAD=m
828CONFIG_CRYPTO_ANUBIS=m 1005CONFIG_CRYPTO_ANUBIS=m
829CONFIG_CRYPTO_DEFLATE=y 1006CONFIG_CRYPTO_DEFLATE=m
830CONFIG_CRYPTO_MICHAEL_MIC=y 1007CONFIG_CRYPTO_MICHAEL_MIC=m
831CONFIG_CRYPTO_CRC32C=m 1008CONFIG_CRYPTO_CRC32C=m
832# CONFIG_CRYPTO_TEST is not set 1009# CONFIG_CRYPTO_TEST is not set
833 1010
@@ -839,9 +1016,8 @@ CONFIG_CRYPTO_CRC32C=m
839# Library routines 1016# Library routines
840# 1017#
841CONFIG_CRC_CCITT=m 1018CONFIG_CRC_CCITT=m
1019CONFIG_CRC16=m
842CONFIG_CRC32=y 1020CONFIG_CRC32=y
843CONFIG_LIBCRC32C=m 1021CONFIG_LIBCRC32C=m
844CONFIG_ZLIB_INFLATE=y 1022CONFIG_ZLIB_INFLATE=m
845CONFIG_ZLIB_DEFLATE=y 1023CONFIG_ZLIB_DEFLATE=m
846CONFIG_GENERIC_HARDIRQS=y
847CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/pnx8550-jbs_defconfig b/arch/mips/configs/pnx8550-jbs_defconfig
new file mode 100644
index 000000000000..95f84d711912
--- /dev/null
+++ b/arch/mips/configs/pnx8550-jbs_defconfig
@@ -0,0 +1,1069 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.14-rc2
4# Thu Oct 20 22:26:50 2005
5#
6CONFIG_MIPS=y
7
8#
9# Code maturity level options
10#
11CONFIG_EXPERIMENTAL=y
12CONFIG_CLEAN_COMPILE=y
13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
15
16#
17# General setup
18#
19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
21CONFIG_SWAP=y
22CONFIG_SYSVIPC=y
23# CONFIG_POSIX_MQUEUE is not set
24# CONFIG_BSD_PROCESS_ACCT is not set
25CONFIG_SYSCTL=y
26# CONFIG_AUDIT is not set
27# CONFIG_HOTPLUG is not set
28CONFIG_KOBJECT_UEVENT=y
29CONFIG_IKCONFIG=y
30CONFIG_IKCONFIG_PROC=y
31CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_ALL is not set
35# CONFIG_KALLSYMS_EXTRA_PASS is not set
36CONFIG_PRINTK=y
37CONFIG_BUG=y
38CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y
40CONFIG_EPOLL=y
41# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
42CONFIG_SHMEM=y
43CONFIG_CC_ALIGN_FUNCTIONS=0
44CONFIG_CC_ALIGN_LABELS=0
45CONFIG_CC_ALIGN_LOOPS=0
46CONFIG_CC_ALIGN_JUMPS=0
47# CONFIG_TINY_SHMEM is not set
48CONFIG_BASE_SMALL=0
49
50#
51# Loadable module support
52#
53CONFIG_MODULES=y
54# CONFIG_MODULE_UNLOAD is not set
55CONFIG_OBSOLETE_MODPARM=y
56# CONFIG_MODVERSIONS is not set
57# CONFIG_MODULE_SRCVERSION_ALL is not set
58CONFIG_KMOD=y
59
60#
61# Machine selection
62#
63# CONFIG_MIPS_MTX1 is not set
64# CONFIG_MIPS_BOSPORUS is not set
65# CONFIG_MIPS_PB1000 is not set
66# CONFIG_MIPS_PB1100 is not set
67# CONFIG_MIPS_PB1500 is not set
68# CONFIG_MIPS_PB1550 is not set
69# CONFIG_MIPS_PB1200 is not set
70# CONFIG_MIPS_DB1000 is not set
71# CONFIG_MIPS_DB1100 is not set
72# CONFIG_MIPS_DB1500 is not set
73# CONFIG_MIPS_DB1550 is not set
74# CONFIG_MIPS_DB1200 is not set
75# CONFIG_MIPS_MIRAGE is not set
76# CONFIG_MIPS_COBALT is not set
77# CONFIG_MACH_DECSTATION is not set
78# CONFIG_MIPS_EV64120 is not set
79# CONFIG_MIPS_EV96100 is not set
80# CONFIG_MIPS_IVR is not set
81# CONFIG_MIPS_ITE8172 is not set
82# CONFIG_MACH_JAZZ is not set
83# CONFIG_LASAT is not set
84# CONFIG_MIPS_ATLAS is not set
85# CONFIG_MIPS_MALTA is not set
86# CONFIG_MIPS_SEAD is not set
87# CONFIG_MIPS_SIM is not set
88# CONFIG_MOMENCO_JAGUAR_ATX is not set
89# CONFIG_MOMENCO_OCELOT is not set
90# CONFIG_MOMENCO_OCELOT_3 is not set
91# CONFIG_MOMENCO_OCELOT_C is not set
92# CONFIG_MOMENCO_OCELOT_G is not set
93# CONFIG_MIPS_XXS1500 is not set
94# CONFIG_PNX8550_V2PCI is not set
95CONFIG_PNX8550_JBS=y
96# CONFIG_DDB5074 is not set
97# CONFIG_DDB5476 is not set
98# CONFIG_DDB5477 is not set
99# CONFIG_MACH_VR41XX is not set
100# CONFIG_PMC_YOSEMITE is not set
101# CONFIG_QEMU is not set
102# CONFIG_SGI_IP22 is not set
103# CONFIG_SGI_IP27 is not set
104# CONFIG_SGI_IP32 is not set
105# CONFIG_SIBYTE_BIGSUR is not set
106# CONFIG_SIBYTE_SWARM is not set
107# CONFIG_SIBYTE_SENTOSA is not set
108# CONFIG_SIBYTE_RHONE is not set
109# CONFIG_SIBYTE_CARMEL is not set
110# CONFIG_SIBYTE_PTSWARM is not set
111# CONFIG_SIBYTE_LITTLESUR is not set
112# CONFIG_SIBYTE_CRHINE is not set
113# CONFIG_SIBYTE_CRHONE is not set
114# CONFIG_SNI_RM200_PCI is not set
115# CONFIG_TOSHIBA_JMR3927 is not set
116# CONFIG_TOSHIBA_RBTX4927 is not set
117# CONFIG_TOSHIBA_RBTX4938 is not set
118CONFIG_RWSEM_GENERIC_SPINLOCK=y
119CONFIG_GENERIC_CALIBRATE_DELAY=y
120CONFIG_DMA_NONCOHERENT=y
121CONFIG_DMA_NEED_PCI_MAP_STATE=y
122# CONFIG_CPU_BIG_ENDIAN is not set
123CONFIG_CPU_LITTLE_ENDIAN=y
124CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
125CONFIG_PNX8550=y
126CONFIG_SOC_PNX8550=y
127CONFIG_MIPS_L1_CACHE_SHIFT=5
128
129#
130# CPU selection
131#
132# CONFIG_CPU_MIPS32_R1 is not set
133# CONFIG_CPU_MIPS32_R2 is not set
134# CONFIG_CPU_MIPS64_R1 is not set
135# CONFIG_CPU_MIPS64_R2 is not set
136# CONFIG_CPU_R3000 is not set
137# CONFIG_CPU_TX39XX is not set
138# CONFIG_CPU_VR41XX is not set
139# CONFIG_CPU_R4300 is not set
140CONFIG_CPU_R4X00=y
141# CONFIG_CPU_TX49XX is not set
142# CONFIG_CPU_R5000 is not set
143# CONFIG_CPU_R5432 is not set
144# CONFIG_CPU_R6000 is not set
145# CONFIG_CPU_NEVADA is not set
146# CONFIG_CPU_R8000 is not set
147# CONFIG_CPU_R10000 is not set
148# CONFIG_CPU_RM7000 is not set
149# CONFIG_CPU_RM9000 is not set
150# CONFIG_CPU_SB1 is not set
151CONFIG_SYS_HAS_CPU_R4X00=y
152CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
153CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
154CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
155
156#
157# Kernel type
158#
159CONFIG_32BIT=y
160# CONFIG_64BIT is not set
161CONFIG_PAGE_SIZE_4KB=y
162# CONFIG_PAGE_SIZE_8KB is not set
163# CONFIG_PAGE_SIZE_16KB is not set
164# CONFIG_PAGE_SIZE_64KB is not set
165# CONFIG_MIPS_MT is not set
166# CONFIG_64BIT_PHYS_ADDR is not set
167# CONFIG_CPU_ADVANCED is not set
168CONFIG_CPU_HAS_LLSC=y
169CONFIG_CPU_HAS_LLDSCD=y
170CONFIG_CPU_HAS_SYNC=y
171CONFIG_GENERIC_HARDIRQS=y
172CONFIG_GENERIC_IRQ_PROBE=y
173CONFIG_ARCH_FLATMEM_ENABLE=y
174CONFIG_SELECT_MEMORY_MODEL=y
175CONFIG_FLATMEM_MANUAL=y
176# CONFIG_DISCONTIGMEM_MANUAL is not set
177# CONFIG_SPARSEMEM_MANUAL is not set
178CONFIG_FLATMEM=y
179CONFIG_FLAT_NODE_MEM_MAP=y
180# CONFIG_SPARSEMEM_STATIC is not set
181CONFIG_PREEMPT_NONE=y
182# CONFIG_PREEMPT_VOLUNTARY is not set
183# CONFIG_PREEMPT is not set
184
185#
186# Bus options (PCI, PCMCIA, EISA, ISA, TC)
187#
188CONFIG_HW_HAS_PCI=y
189CONFIG_PCI=y
190# CONFIG_PCI_LEGACY_PROC is not set
191# CONFIG_PCI_DEBUG is not set
192CONFIG_MMU=y
193
194#
195# PCCARD (PCMCIA/CardBus) support
196#
197# CONFIG_PCCARD is not set
198
199#
200# PCI Hotplug Support
201#
202# CONFIG_HOTPLUG_PCI is not set
203
204#
205# Executable file formats
206#
207CONFIG_BINFMT_ELF=y
208# CONFIG_BINFMT_MISC is not set
209CONFIG_TRAD_SIGNALS=y
210
211#
212# Networking
213#
214CONFIG_NET=y
215
216#
217# Networking options
218#
219CONFIG_PACKET=y
220# CONFIG_PACKET_MMAP is not set
221CONFIG_UNIX=y
222# CONFIG_NET_KEY is not set
223CONFIG_INET=y
224# CONFIG_IP_MULTICAST is not set
225# CONFIG_IP_ADVANCED_ROUTER is not set
226CONFIG_IP_FIB_HASH=y
227CONFIG_IP_PNP=y
228CONFIG_IP_PNP_DHCP=y
229CONFIG_IP_PNP_BOOTP=y
230# CONFIG_IP_PNP_RARP is not set
231# CONFIG_NET_IPIP is not set
232# CONFIG_NET_IPGRE is not set
233# CONFIG_ARPD is not set
234# CONFIG_SYN_COOKIES is not set
235# CONFIG_INET_AH is not set
236# CONFIG_INET_ESP is not set
237# CONFIG_INET_IPCOMP is not set
238# CONFIG_INET_TUNNEL is not set
239CONFIG_INET_DIAG=y
240CONFIG_INET_TCP_DIAG=y
241# CONFIG_TCP_CONG_ADVANCED is not set
242CONFIG_TCP_CONG_BIC=y
243# CONFIG_IPV6 is not set
244# CONFIG_NETFILTER is not set
245
246#
247# DCCP Configuration (EXPERIMENTAL)
248#
249# CONFIG_IP_DCCP is not set
250
251#
252# SCTP Configuration (EXPERIMENTAL)
253#
254# CONFIG_IP_SCTP is not set
255# CONFIG_ATM is not set
256# CONFIG_BRIDGE is not set
257# CONFIG_VLAN_8021Q is not set
258# CONFIG_DECNET is not set
259# CONFIG_LLC2 is not set
260# CONFIG_IPX is not set
261# CONFIG_ATALK is not set
262# CONFIG_X25 is not set
263# CONFIG_LAPB is not set
264# CONFIG_NET_DIVERT is not set
265# CONFIG_ECONET is not set
266# CONFIG_WAN_ROUTER is not set
267# CONFIG_NET_SCHED is not set
268# CONFIG_NET_CLS_ROUTE is not set
269
270#
271# Network testing
272#
273# CONFIG_NET_PKTGEN is not set
274# CONFIG_HAMRADIO is not set
275# CONFIG_IRDA is not set
276# CONFIG_BT is not set
277# CONFIG_IEEE80211 is not set
278
279#
280# Device Drivers
281#
282
283#
284# Generic Driver Options
285#
286CONFIG_STANDALONE=y
287CONFIG_PREVENT_FIRMWARE_BUILD=y
288# CONFIG_FW_LOADER is not set
289# CONFIG_DEBUG_DRIVER is not set
290
291#
292# Connector - unified userspace <-> kernelspace linker
293#
294# CONFIG_CONNECTOR is not set
295
296#
297# Memory Technology Devices (MTD)
298#
299# CONFIG_MTD is not set
300
301#
302# Parallel port support
303#
304# CONFIG_PARPORT is not set
305
306#
307# Plug and Play support
308#
309
310#
311# Block devices
312#
313# CONFIG_BLK_CPQ_DA is not set
314# CONFIG_BLK_CPQ_CISS_DA is not set
315# CONFIG_BLK_DEV_DAC960 is not set
316# CONFIG_BLK_DEV_UMEM is not set
317# CONFIG_BLK_DEV_COW_COMMON is not set
318CONFIG_BLK_DEV_LOOP=y
319# CONFIG_BLK_DEV_CRYPTOLOOP is not set
320# CONFIG_BLK_DEV_NBD is not set
321# CONFIG_BLK_DEV_SX8 is not set
322# CONFIG_BLK_DEV_UB is not set
323CONFIG_BLK_DEV_RAM=y
324CONFIG_BLK_DEV_RAM_COUNT=16
325CONFIG_BLK_DEV_RAM_SIZE=8192
326CONFIG_BLK_DEV_INITRD=y
327# CONFIG_LBD is not set
328# CONFIG_CDROM_PKTCDVD is not set
329
330#
331# IO Schedulers
332#
333CONFIG_IOSCHED_NOOP=y
334CONFIG_IOSCHED_AS=y
335CONFIG_IOSCHED_DEADLINE=y
336CONFIG_IOSCHED_CFQ=y
337# CONFIG_ATA_OVER_ETH is not set
338
339#
340# ATA/ATAPI/MFM/RLL support
341#
342CONFIG_IDE=y
343CONFIG_BLK_DEV_IDE=y
344
345#
346# Please see Documentation/ide.txt for help/info on IDE drives
347#
348# CONFIG_BLK_DEV_IDE_SATA is not set
349CONFIG_BLK_DEV_IDEDISK=y
350# CONFIG_IDEDISK_MULTI_MODE is not set
351CONFIG_BLK_DEV_IDECD=m
352# CONFIG_BLK_DEV_IDETAPE is not set
353# CONFIG_BLK_DEV_IDEFLOPPY is not set
354CONFIG_BLK_DEV_IDESCSI=y
355# CONFIG_IDE_TASK_IOCTL is not set
356
357#
358# IDE chipset support/bugfixes
359#
360CONFIG_IDE_GENERIC=y
361CONFIG_BLK_DEV_IDEPCI=y
362CONFIG_IDEPCI_SHARE_IRQ=y
363CONFIG_BLK_DEV_OFFBOARD=y
364CONFIG_BLK_DEV_GENERIC=y
365# CONFIG_BLK_DEV_OPTI621 is not set
366CONFIG_BLK_DEV_IDEDMA_PCI=y
367# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
368# CONFIG_IDEDMA_PCI_AUTO is not set
369# CONFIG_BLK_DEV_AEC62XX is not set
370# CONFIG_BLK_DEV_ALI15X3 is not set
371# CONFIG_BLK_DEV_AMD74XX is not set
372# CONFIG_BLK_DEV_CMD64X is not set
373# CONFIG_BLK_DEV_TRIFLEX is not set
374# CONFIG_BLK_DEV_CY82C693 is not set
375# CONFIG_BLK_DEV_CS5520 is not set
376# CONFIG_BLK_DEV_CS5530 is not set
377# CONFIG_BLK_DEV_HPT34X is not set
378CONFIG_BLK_DEV_HPT366=y
379# CONFIG_BLK_DEV_SC1200 is not set
380# CONFIG_BLK_DEV_PIIX is not set
381# CONFIG_BLK_DEV_IT821X is not set
382# CONFIG_BLK_DEV_NS87415 is not set
383# CONFIG_BLK_DEV_PDC202XX_OLD is not set
384# CONFIG_BLK_DEV_PDC202XX_NEW is not set
385# CONFIG_BLK_DEV_SVWKS is not set
386# CONFIG_BLK_DEV_SIIMAGE is not set
387# CONFIG_BLK_DEV_SLC90E66 is not set
388# CONFIG_BLK_DEV_TRM290 is not set
389# CONFIG_BLK_DEV_VIA82CXXX is not set
390# CONFIG_IDE_ARM is not set
391CONFIG_BLK_DEV_IDEDMA=y
392# CONFIG_IDEDMA_IVB is not set
393# CONFIG_IDEDMA_AUTO is not set
394# CONFIG_BLK_DEV_HD is not set
395
396#
397# SCSI device support
398#
399# CONFIG_RAID_ATTRS is not set
400CONFIG_SCSI=y
401CONFIG_SCSI_PROC_FS=y
402
403#
404# SCSI support type (disk, tape, CD-ROM)
405#
406CONFIG_BLK_DEV_SD=y
407# CONFIG_CHR_DEV_ST is not set
408# CONFIG_CHR_DEV_OSST is not set
409# CONFIG_BLK_DEV_SR is not set
410# CONFIG_CHR_DEV_SG is not set
411# CONFIG_CHR_DEV_SCH is not set
412
413#
414# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
415#
416# CONFIG_SCSI_MULTI_LUN is not set
417CONFIG_SCSI_CONSTANTS=y
418# CONFIG_SCSI_LOGGING is not set
419
420#
421# SCSI Transport Attributes
422#
423# CONFIG_SCSI_SPI_ATTRS is not set
424# CONFIG_SCSI_FC_ATTRS is not set
425# CONFIG_SCSI_ISCSI_ATTRS is not set
426# CONFIG_SCSI_SAS_ATTRS is not set
427
428#
429# SCSI low-level drivers
430#
431# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
432# CONFIG_SCSI_3W_9XXX is not set
433# CONFIG_SCSI_ACARD is not set
434# CONFIG_SCSI_AACRAID is not set
435# CONFIG_SCSI_AIC7XXX is not set
436# CONFIG_SCSI_AIC7XXX_OLD is not set
437# CONFIG_SCSI_AIC79XX is not set
438# CONFIG_SCSI_DPT_I2O is not set
439# CONFIG_MEGARAID_NEWGEN is not set
440# CONFIG_MEGARAID_LEGACY is not set
441# CONFIG_SCSI_SATA is not set
442# CONFIG_SCSI_DMX3191D is not set
443# CONFIG_SCSI_FUTURE_DOMAIN is not set
444# CONFIG_SCSI_IPS is not set
445# CONFIG_SCSI_INITIO is not set
446# CONFIG_SCSI_INIA100 is not set
447# CONFIG_SCSI_SYM53C8XX_2 is not set
448# CONFIG_SCSI_IPR is not set
449# CONFIG_SCSI_QLOGIC_FC is not set
450# CONFIG_SCSI_QLOGIC_1280 is not set
451CONFIG_SCSI_QLA2XXX=y
452# CONFIG_SCSI_QLA21XX is not set
453# CONFIG_SCSI_QLA22XX is not set
454# CONFIG_SCSI_QLA2300 is not set
455# CONFIG_SCSI_QLA2322 is not set
456# CONFIG_SCSI_QLA6312 is not set
457# CONFIG_SCSI_QLA24XX is not set
458# CONFIG_SCSI_LPFC is not set
459# CONFIG_SCSI_DC395x is not set
460# CONFIG_SCSI_DC390T is not set
461# CONFIG_SCSI_NSP32 is not set
462# CONFIG_SCSI_DEBUG is not set
463
464#
465# Multi-device support (RAID and LVM)
466#
467# CONFIG_MD is not set
468
469#
470# Fusion MPT device support
471#
472# CONFIG_FUSION is not set
473# CONFIG_FUSION_SPI is not set
474# CONFIG_FUSION_FC is not set
475
476#
477# IEEE 1394 (FireWire) support
478#
479# CONFIG_IEEE1394 is not set
480
481#
482# I2O device support
483#
484# CONFIG_I2O is not set
485
486#
487# Network device support
488#
489CONFIG_NETDEVICES=y
490# CONFIG_DUMMY is not set
491# CONFIG_BONDING is not set
492# CONFIG_EQUALIZER is not set
493# CONFIG_TUN is not set
494
495#
496# ARCnet devices
497#
498# CONFIG_ARCNET is not set
499
500#
501# PHY device support
502#
503# CONFIG_PHYLIB is not set
504
505#
506# Ethernet (10 or 100Mbit)
507#
508CONFIG_NET_ETHERNET=y
509CONFIG_MII=y
510# CONFIG_HAPPYMEAL is not set
511# CONFIG_SUNGEM is not set
512# CONFIG_NET_VENDOR_3COM is not set
513
514#
515# Tulip family network device support
516#
517# CONFIG_NET_TULIP is not set
518# CONFIG_HP100 is not set
519CONFIG_NET_PCI=y
520# CONFIG_PCNET32 is not set
521# CONFIG_AMD8111_ETH is not set
522# CONFIG_ADAPTEC_STARFIRE is not set
523# CONFIG_B44 is not set
524# CONFIG_FORCEDETH is not set
525# CONFIG_DGRS is not set
526# CONFIG_EEPRO100 is not set
527# CONFIG_E100 is not set
528# CONFIG_FEALNX is not set
529# CONFIG_NATSEMI is not set
530# CONFIG_NE2K_PCI is not set
531# CONFIG_8139CP is not set
532CONFIG_8139TOO=y
533# CONFIG_8139TOO_PIO is not set
534CONFIG_8139TOO_TUNE_TWISTER=y
535CONFIG_8139TOO_8129=y
536# CONFIG_8139_OLD_RX_RESET is not set
537# CONFIG_SIS900 is not set
538# CONFIG_EPIC100 is not set
539# CONFIG_SUNDANCE is not set
540# CONFIG_TLAN is not set
541# CONFIG_VIA_RHINE is not set
542# CONFIG_LAN_SAA9730 is not set
543
544#
545# Ethernet (1000 Mbit)
546#
547# CONFIG_ACENIC is not set
548# CONFIG_DL2K is not set
549# CONFIG_E1000 is not set
550# CONFIG_NS83820 is not set
551# CONFIG_HAMACHI is not set
552# CONFIG_YELLOWFIN is not set
553# CONFIG_R8169 is not set
554# CONFIG_SIS190 is not set
555# CONFIG_SKGE is not set
556# CONFIG_SK98LIN is not set
557# CONFIG_VIA_VELOCITY is not set
558# CONFIG_TIGON3 is not set
559# CONFIG_BNX2 is not set
560
561#
562# Ethernet (10000 Mbit)
563#
564# CONFIG_CHELSIO_T1 is not set
565# CONFIG_IXGB is not set
566# CONFIG_S2IO is not set
567
568#
569# Token Ring devices
570#
571# CONFIG_TR is not set
572
573#
574# Wireless LAN (non-hamradio)
575#
576# CONFIG_NET_RADIO is not set
577
578#
579# Wan interfaces
580#
581# CONFIG_WAN is not set
582# CONFIG_FDDI is not set
583# CONFIG_HIPPI is not set
584# CONFIG_PPP is not set
585# CONFIG_SLIP is not set
586# CONFIG_NET_FC is not set
587# CONFIG_SHAPER is not set
588# CONFIG_NETCONSOLE is not set
589# CONFIG_NETPOLL is not set
590# CONFIG_NET_POLL_CONTROLLER is not set
591
592#
593# ISDN subsystem
594#
595# CONFIG_ISDN is not set
596
597#
598# Telephony Support
599#
600# CONFIG_PHONE is not set
601
602#
603# Input device support
604#
605CONFIG_INPUT=y
606
607#
608# Userland interfaces
609#
610# CONFIG_INPUT_MOUSEDEV is not set
611# CONFIG_INPUT_JOYDEV is not set
612# CONFIG_INPUT_TSDEV is not set
613# CONFIG_INPUT_EVDEV is not set
614# CONFIG_INPUT_EVBUG is not set
615
616#
617# Input Device Drivers
618#
619# CONFIG_INPUT_KEYBOARD is not set
620# CONFIG_INPUT_MOUSE is not set
621# CONFIG_INPUT_JOYSTICK is not set
622# CONFIG_INPUT_TOUCHSCREEN is not set
623# CONFIG_INPUT_MISC is not set
624
625#
626# Hardware I/O ports
627#
628CONFIG_SERIO=y
629# CONFIG_SERIO_I8042 is not set
630# CONFIG_SERIO_SERPORT is not set
631# CONFIG_SERIO_PCIPS2 is not set
632CONFIG_SERIO_LIBPS2=y
633# CONFIG_SERIO_RAW is not set
634# CONFIG_GAMEPORT is not set
635
636#
637# Character devices
638#
639CONFIG_VT=y
640CONFIG_VT_CONSOLE=y
641CONFIG_HW_CONSOLE=y
642# CONFIG_SERIAL_NONSTANDARD is not set
643
644#
645# Serial drivers
646#
647# CONFIG_SERIAL_8250 is not set
648
649#
650# Non-8250 serial port support
651#
652# CONFIG_SERIAL_IP3106 is not set
653# CONFIG_SERIAL_JSM is not set
654CONFIG_UNIX98_PTYS=y
655CONFIG_LEGACY_PTYS=y
656CONFIG_LEGACY_PTY_COUNT=256
657
658#
659# IPMI
660#
661# CONFIG_IPMI_HANDLER is not set
662
663#
664# Watchdog Cards
665#
666# CONFIG_WATCHDOG is not set
667# CONFIG_RTC is not set
668# CONFIG_GEN_RTC is not set
669# CONFIG_DTLK is not set
670# CONFIG_R3964 is not set
671# CONFIG_APPLICOM is not set
672
673#
674# Ftape, the floppy tape device driver
675#
676# CONFIG_DRM is not set
677# CONFIG_RAW_DRIVER is not set
678
679#
680# TPM devices
681#
682# CONFIG_TCG_TPM is not set
683
684#
685# I2C support
686#
687# CONFIG_I2C is not set
688
689#
690# Dallas's 1-wire bus
691#
692# CONFIG_W1 is not set
693
694#
695# Hardware Monitoring support
696#
697CONFIG_HWMON=y
698# CONFIG_HWMON_VID is not set
699# CONFIG_HWMON_DEBUG_CHIP is not set
700
701#
702# Misc devices
703#
704
705#
706# Multimedia Capabilities Port drivers
707#
708
709#
710# Multimedia devices
711#
712# CONFIG_VIDEO_DEV is not set
713
714#
715# Digital Video Broadcasting Devices
716#
717# CONFIG_DVB is not set
718
719#
720# Graphics support
721#
722# CONFIG_FB is not set
723
724#
725# Console display driver support
726#
727# CONFIG_VGA_CONSOLE is not set
728CONFIG_DUMMY_CONSOLE=y
729
730#
731# Sound
732#
733# CONFIG_SOUND is not set
734
735#
736# USB support
737#
738CONFIG_USB_ARCH_HAS_HCD=y
739CONFIG_USB_ARCH_HAS_OHCI=y
740CONFIG_USB=y
741# CONFIG_USB_DEBUG is not set
742
743#
744# Miscellaneous USB options
745#
746# CONFIG_USB_DEVICEFS is not set
747# CONFIG_USB_BANDWIDTH is not set
748# CONFIG_USB_DYNAMIC_MINORS is not set
749# CONFIG_USB_OTG is not set
750
751#
752# USB Host Controller Drivers
753#
754# CONFIG_USB_EHCI_HCD is not set
755# CONFIG_USB_ISP116X_HCD is not set
756CONFIG_USB_OHCI_HCD=y
757# CONFIG_USB_OHCI_BIG_ENDIAN is not set
758CONFIG_USB_OHCI_LITTLE_ENDIAN=y
759# CONFIG_USB_UHCI_HCD is not set
760# CONFIG_USB_SL811_HCD is not set
761
762#
763# USB Device Class drivers
764#
765# CONFIG_USB_BLUETOOTH_TTY is not set
766# CONFIG_USB_ACM is not set
767# CONFIG_USB_PRINTER is not set
768
769#
770# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
771#
772CONFIG_USB_STORAGE=y
773# CONFIG_USB_STORAGE_DEBUG is not set
774CONFIG_USB_STORAGE_DATAFAB=y
775CONFIG_USB_STORAGE_FREECOM=y
776CONFIG_USB_STORAGE_ISD200=y
777CONFIG_USB_STORAGE_DPCM=y
778CONFIG_USB_STORAGE_USBAT=y
779CONFIG_USB_STORAGE_SDDR09=y
780CONFIG_USB_STORAGE_SDDR55=y
781CONFIG_USB_STORAGE_JUMPSHOT=y
782
783#
784# USB Input Devices
785#
786# CONFIG_USB_HID is not set
787
788#
789# USB HID Boot Protocol drivers
790#
791# CONFIG_USB_KBD is not set
792# CONFIG_USB_MOUSE is not set
793# CONFIG_USB_AIPTEK is not set
794# CONFIG_USB_WACOM is not set
795# CONFIG_USB_ACECAD is not set
796# CONFIG_USB_KBTAB is not set
797# CONFIG_USB_POWERMATE is not set
798# CONFIG_USB_MTOUCH is not set
799# CONFIG_USB_ITMTOUCH is not set
800# CONFIG_USB_EGALAX is not set
801# CONFIG_USB_YEALINK is not set
802# CONFIG_USB_XPAD is not set
803# CONFIG_USB_ATI_REMOTE is not set
804# CONFIG_USB_KEYSPAN_REMOTE is not set
805# CONFIG_USB_APPLETOUCH is not set
806
807#
808# USB Imaging devices
809#
810# CONFIG_USB_MDC800 is not set
811# CONFIG_USB_MICROTEK is not set
812
813#
814# USB Multimedia devices
815#
816# CONFIG_USB_DABUSB is not set
817
818#
819# Video4Linux support is needed for USB Multimedia device support
820#
821
822#
823# USB Network Adapters
824#
825# CONFIG_USB_CATC is not set
826# CONFIG_USB_KAWETH is not set
827# CONFIG_USB_PEGASUS is not set
828# CONFIG_USB_RTL8150 is not set
829# CONFIG_USB_USBNET is not set
830CONFIG_USB_MON=y
831
832#
833# USB port drivers
834#
835
836#
837# USB Serial Converter support
838#
839# CONFIG_USB_SERIAL is not set
840
841#
842# USB Miscellaneous drivers
843#
844# CONFIG_USB_EMI62 is not set
845# CONFIG_USB_EMI26 is not set
846# CONFIG_USB_AUERSWALD is not set
847# CONFIG_USB_RIO500 is not set
848# CONFIG_USB_LEGOTOWER is not set
849# CONFIG_USB_LCD is not set
850# CONFIG_USB_LED is not set
851# CONFIG_USB_CYTHERM is not set
852# CONFIG_USB_PHIDGETKIT is not set
853# CONFIG_USB_PHIDGETSERVO is not set
854# CONFIG_USB_IDMOUSE is not set
855# CONFIG_USB_LD is not set
856
857#
858# USB DSL modem support
859#
860
861#
862# USB Gadget Support
863#
864# CONFIG_USB_GADGET is not set
865
866#
867# MMC/SD Card support
868#
869# CONFIG_MMC is not set
870
871#
872# InfiniBand support
873#
874# CONFIG_INFINIBAND is not set
875
876#
877# SN Devices
878#
879
880#
881# File systems
882#
883CONFIG_EXT2_FS=y
884# CONFIG_EXT2_FS_XATTR is not set
885# CONFIG_EXT2_FS_XIP is not set
886# CONFIG_EXT3_FS is not set
887# CONFIG_JBD is not set
888# CONFIG_REISERFS_FS is not set
889# CONFIG_JFS_FS is not set
890# CONFIG_FS_POSIX_ACL is not set
891# CONFIG_XFS_FS is not set
892# CONFIG_MINIX_FS is not set
893# CONFIG_ROMFS_FS is not set
894CONFIG_INOTIFY=y
895# CONFIG_QUOTA is not set
896# CONFIG_DNOTIFY is not set
897# CONFIG_AUTOFS_FS is not set
898# CONFIG_AUTOFS4_FS is not set
899# CONFIG_FUSE_FS is not set
900
901#
902# CD-ROM/DVD Filesystems
903#
904# CONFIG_ISO9660_FS is not set
905# CONFIG_UDF_FS is not set
906
907#
908# DOS/FAT/NT Filesystems
909#
910CONFIG_FAT_FS=y
911CONFIG_MSDOS_FS=y
912CONFIG_VFAT_FS=y
913CONFIG_FAT_DEFAULT_CODEPAGE=437
914CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
915# CONFIG_NTFS_FS is not set
916
917#
918# Pseudo filesystems
919#
920CONFIG_PROC_FS=y
921# CONFIG_PROC_KCORE is not set
922CONFIG_SYSFS=y
923CONFIG_TMPFS=y
924# CONFIG_HUGETLB_PAGE is not set
925CONFIG_RAMFS=y
926# CONFIG_RELAYFS_FS is not set
927
928#
929# Miscellaneous filesystems
930#
931# CONFIG_ADFS_FS is not set
932# CONFIG_AFFS_FS is not set
933# CONFIG_HFS_FS is not set
934# CONFIG_HFSPLUS_FS is not set
935# CONFIG_BEFS_FS is not set
936# CONFIG_BFS_FS is not set
937# CONFIG_EFS_FS is not set
938# CONFIG_CRAMFS is not set
939# CONFIG_VXFS_FS is not set
940# CONFIG_HPFS_FS is not set
941# CONFIG_QNX4FS_FS is not set
942# CONFIG_SYSV_FS is not set
943# CONFIG_UFS_FS is not set
944
945#
946# Network File Systems
947#
948CONFIG_NFS_FS=y
949CONFIG_NFS_V3=y
950# CONFIG_NFS_V3_ACL is not set
951# CONFIG_NFS_V4 is not set
952# CONFIG_NFS_DIRECTIO is not set
953CONFIG_NFSD=m
954# CONFIG_NFSD_V3 is not set
955# CONFIG_NFSD_TCP is not set
956CONFIG_ROOT_NFS=y
957CONFIG_LOCKD=y
958CONFIG_LOCKD_V4=y
959CONFIG_EXPORTFS=m
960CONFIG_NFS_COMMON=y
961CONFIG_SUNRPC=y
962# CONFIG_RPCSEC_GSS_KRB5 is not set
963# CONFIG_RPCSEC_GSS_SPKM3 is not set
964# CONFIG_SMB_FS is not set
965# CONFIG_CIFS is not set
966# CONFIG_NCP_FS is not set
967# CONFIG_CODA_FS is not set
968# CONFIG_AFS_FS is not set
969# CONFIG_9P_FS is not set
970
971#
972# Partition Types
973#
974# CONFIG_PARTITION_ADVANCED is not set
975CONFIG_MSDOS_PARTITION=y
976
977#
978# Native Language Support
979#
980CONFIG_NLS=y
981CONFIG_NLS_DEFAULT="iso8859-1"
982# CONFIG_NLS_CODEPAGE_437 is not set
983# CONFIG_NLS_CODEPAGE_737 is not set
984# CONFIG_NLS_CODEPAGE_775 is not set
985# CONFIG_NLS_CODEPAGE_850 is not set
986# CONFIG_NLS_CODEPAGE_852 is not set
987# CONFIG_NLS_CODEPAGE_855 is not set
988# CONFIG_NLS_CODEPAGE_857 is not set
989# CONFIG_NLS_CODEPAGE_860 is not set
990# CONFIG_NLS_CODEPAGE_861 is not set
991# CONFIG_NLS_CODEPAGE_862 is not set
992# CONFIG_NLS_CODEPAGE_863 is not set
993# CONFIG_NLS_CODEPAGE_864 is not set
994# CONFIG_NLS_CODEPAGE_865 is not set
995# CONFIG_NLS_CODEPAGE_866 is not set
996# CONFIG_NLS_CODEPAGE_869 is not set
997# CONFIG_NLS_CODEPAGE_936 is not set
998# CONFIG_NLS_CODEPAGE_950 is not set
999# CONFIG_NLS_CODEPAGE_932 is not set
1000# CONFIG_NLS_CODEPAGE_949 is not set
1001# CONFIG_NLS_CODEPAGE_874 is not set
1002# CONFIG_NLS_ISO8859_8 is not set
1003# CONFIG_NLS_CODEPAGE_1250 is not set
1004# CONFIG_NLS_CODEPAGE_1251 is not set
1005# CONFIG_NLS_ASCII is not set
1006# CONFIG_NLS_ISO8859_1 is not set
1007# CONFIG_NLS_ISO8859_2 is not set
1008# CONFIG_NLS_ISO8859_3 is not set
1009# CONFIG_NLS_ISO8859_4 is not set
1010# CONFIG_NLS_ISO8859_5 is not set
1011# CONFIG_NLS_ISO8859_6 is not set
1012# CONFIG_NLS_ISO8859_7 is not set
1013# CONFIG_NLS_ISO8859_9 is not set
1014# CONFIG_NLS_ISO8859_13 is not set
1015# CONFIG_NLS_ISO8859_14 is not set
1016# CONFIG_NLS_ISO8859_15 is not set
1017# CONFIG_NLS_KOI8_R is not set
1018# CONFIG_NLS_KOI8_U is not set
1019# CONFIG_NLS_UTF8 is not set
1020
1021#
1022# Profiling support
1023#
1024# CONFIG_PROFILING is not set
1025
1026#
1027# Kernel hacking
1028#
1029# CONFIG_PRINTK_TIME is not set
1030CONFIG_DEBUG_KERNEL=y
1031CONFIG_MAGIC_SYSRQ=y
1032CONFIG_LOG_BUF_SHIFT=14
1033CONFIG_DETECT_SOFTLOCKUP=y
1034# CONFIG_SCHEDSTATS is not set
1035CONFIG_DEBUG_SLAB=y
1036# CONFIG_DEBUG_SPINLOCK is not set
1037# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1038# CONFIG_DEBUG_KOBJECT is not set
1039# CONFIG_DEBUG_INFO is not set
1040# CONFIG_DEBUG_FS is not set
1041CONFIG_CROSSCOMPILE=y
1042CONFIG_CMDLINE="console=ttyS1,38400n8 kgdb=ttyS0 root=/dev/nfs ip=bootp"
1043# CONFIG_DEBUG_STACK_USAGE is not set
1044# CONFIG_KGDB is not set
1045# CONFIG_RUNTIME_DEBUG is not set
1046# CONFIG_MIPS_UNCACHED is not set
1047
1048#
1049# Security options
1050#
1051# CONFIG_KEYS is not set
1052# CONFIG_SECURITY is not set
1053
1054#
1055# Cryptographic options
1056#
1057# CONFIG_CRYPTO is not set
1058
1059#
1060# Hardware crypto devices
1061#
1062
1063#
1064# Library routines
1065#
1066CONFIG_CRC_CCITT=m
1067# CONFIG_CRC16 is not set
1068CONFIG_CRC32=y
1069# CONFIG_LIBCRC32C is not set
diff --git a/arch/mips/configs/pnx8550-v2pci_defconfig b/arch/mips/configs/pnx8550-v2pci_defconfig
new file mode 100644
index 000000000000..deb24c29ac0a
--- /dev/null
+++ b/arch/mips/configs/pnx8550-v2pci_defconfig
@@ -0,0 +1,1251 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.14-rc2
4# Thu Oct 20 22:26:53 2005
5#
6CONFIG_MIPS=y
7
8#
9# Code maturity level options
10#
11CONFIG_EXPERIMENTAL=y
12CONFIG_CLEAN_COMPILE=y
13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
15
16#
17# General setup
18#
19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
21CONFIG_SWAP=y
22CONFIG_SYSVIPC=y
23# CONFIG_POSIX_MQUEUE is not set
24# CONFIG_BSD_PROCESS_ACCT is not set
25CONFIG_SYSCTL=y
26# CONFIG_AUDIT is not set
27# CONFIG_HOTPLUG is not set
28CONFIG_KOBJECT_UEVENT=y
29CONFIG_IKCONFIG=y
30CONFIG_IKCONFIG_PROC=y
31CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_EXTRA_PASS is not set
35CONFIG_PRINTK=y
36CONFIG_BUG=y
37CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y
39CONFIG_EPOLL=y
40# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
41CONFIG_SHMEM=y
42CONFIG_CC_ALIGN_FUNCTIONS=0
43CONFIG_CC_ALIGN_LABELS=0
44CONFIG_CC_ALIGN_LOOPS=0
45CONFIG_CC_ALIGN_JUMPS=0
46# CONFIG_TINY_SHMEM is not set
47CONFIG_BASE_SMALL=0
48
49#
50# Loadable module support
51#
52CONFIG_MODULES=y
53# CONFIG_MODULE_UNLOAD is not set
54CONFIG_OBSOLETE_MODPARM=y
55# CONFIG_MODVERSIONS is not set
56# CONFIG_MODULE_SRCVERSION_ALL is not set
57CONFIG_KMOD=y
58
59#
60# Machine selection
61#
62# CONFIG_MIPS_MTX1 is not set
63# CONFIG_MIPS_BOSPORUS is not set
64# CONFIG_MIPS_PB1000 is not set
65# CONFIG_MIPS_PB1100 is not set
66# CONFIG_MIPS_PB1500 is not set
67# CONFIG_MIPS_PB1550 is not set
68# CONFIG_MIPS_PB1200 is not set
69# CONFIG_MIPS_DB1000 is not set
70# CONFIG_MIPS_DB1100 is not set
71# CONFIG_MIPS_DB1500 is not set
72# CONFIG_MIPS_DB1550 is not set
73# CONFIG_MIPS_DB1200 is not set
74# CONFIG_MIPS_MIRAGE is not set
75# CONFIG_MIPS_COBALT is not set
76# CONFIG_MACH_DECSTATION is not set
77# CONFIG_MIPS_EV64120 is not set
78# CONFIG_MIPS_EV96100 is not set
79# CONFIG_MIPS_IVR is not set
80# CONFIG_MIPS_ITE8172 is not set
81# CONFIG_MACH_JAZZ is not set
82# CONFIG_LASAT is not set
83# CONFIG_MIPS_ATLAS is not set
84# CONFIG_MIPS_MALTA is not set
85# CONFIG_MIPS_SEAD is not set
86# CONFIG_MIPS_SIM is not set
87# CONFIG_MOMENCO_JAGUAR_ATX is not set
88# CONFIG_MOMENCO_OCELOT is not set
89# CONFIG_MOMENCO_OCELOT_3 is not set
90# CONFIG_MOMENCO_OCELOT_C is not set
91# CONFIG_MOMENCO_OCELOT_G is not set
92# CONFIG_MIPS_XXS1500 is not set
93CONFIG_PNX8550_V2PCI=y
94# CONFIG_PNX8550_JBS is not set
95# CONFIG_DDB5074 is not set
96# CONFIG_DDB5476 is not set
97# CONFIG_DDB5477 is not set
98# CONFIG_MACH_VR41XX is not set
99# CONFIG_PMC_YOSEMITE is not set
100# CONFIG_QEMU is not set
101# CONFIG_SGI_IP22 is not set
102# CONFIG_SGI_IP27 is not set
103# CONFIG_SGI_IP32 is not set
104# CONFIG_SIBYTE_BIGSUR is not set
105# CONFIG_SIBYTE_SWARM is not set
106# CONFIG_SIBYTE_SENTOSA is not set
107# CONFIG_SIBYTE_RHONE is not set
108# CONFIG_SIBYTE_CARMEL is not set
109# CONFIG_SIBYTE_PTSWARM is not set
110# CONFIG_SIBYTE_LITTLESUR is not set
111# CONFIG_SIBYTE_CRHINE is not set
112# CONFIG_SIBYTE_CRHONE is not set
113# CONFIG_SNI_RM200_PCI is not set
114# CONFIG_TOSHIBA_JMR3927 is not set
115# CONFIG_TOSHIBA_RBTX4927 is not set
116# CONFIG_TOSHIBA_RBTX4938 is not set
117CONFIG_RWSEM_GENERIC_SPINLOCK=y
118CONFIG_GENERIC_CALIBRATE_DELAY=y
119CONFIG_DMA_NONCOHERENT=y
120CONFIG_DMA_NEED_PCI_MAP_STATE=y
121# CONFIG_CPU_BIG_ENDIAN is not set
122CONFIG_CPU_LITTLE_ENDIAN=y
123CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
124CONFIG_PNX8550=y
125CONFIG_SOC_PNX8550=y
126CONFIG_MIPS_L1_CACHE_SHIFT=5
127
128#
129# CPU selection
130#
131# CONFIG_CPU_MIPS32_R1 is not set
132# CONFIG_CPU_MIPS32_R2 is not set
133# CONFIG_CPU_MIPS64_R1 is not set
134# CONFIG_CPU_MIPS64_R2 is not set
135# CONFIG_CPU_R3000 is not set
136# CONFIG_CPU_TX39XX is not set
137# CONFIG_CPU_VR41XX is not set
138# CONFIG_CPU_R4300 is not set
139CONFIG_CPU_R4X00=y
140# CONFIG_CPU_TX49XX is not set
141# CONFIG_CPU_R5000 is not set
142# CONFIG_CPU_R5432 is not set
143# CONFIG_CPU_R6000 is not set
144# CONFIG_CPU_NEVADA is not set
145# CONFIG_CPU_R8000 is not set
146# CONFIG_CPU_R10000 is not set
147# CONFIG_CPU_RM7000 is not set
148# CONFIG_CPU_RM9000 is not set
149# CONFIG_CPU_SB1 is not set
150CONFIG_SYS_HAS_CPU_R4X00=y
151CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
152CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
153CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
154
155#
156# Kernel type
157#
158CONFIG_32BIT=y
159# CONFIG_64BIT is not set
160CONFIG_PAGE_SIZE_4KB=y
161# CONFIG_PAGE_SIZE_8KB is not set
162# CONFIG_PAGE_SIZE_16KB is not set
163# CONFIG_PAGE_SIZE_64KB is not set
164# CONFIG_MIPS_MT is not set
165# CONFIG_64BIT_PHYS_ADDR is not set
166CONFIG_CPU_ADVANCED=y
167CONFIG_CPU_HAS_LLSC=y
168# CONFIG_CPU_HAS_LLDSCD is not set
169# CONFIG_CPU_HAS_WB is not set
170CONFIG_CPU_HAS_SYNC=y
171CONFIG_GENERIC_HARDIRQS=y
172CONFIG_GENERIC_IRQ_PROBE=y
173CONFIG_ARCH_FLATMEM_ENABLE=y
174CONFIG_SELECT_MEMORY_MODEL=y
175CONFIG_FLATMEM_MANUAL=y
176# CONFIG_DISCONTIGMEM_MANUAL is not set
177# CONFIG_SPARSEMEM_MANUAL is not set
178CONFIG_FLATMEM=y
179CONFIG_FLAT_NODE_MEM_MAP=y
180# CONFIG_SPARSEMEM_STATIC is not set
181CONFIG_PREEMPT_NONE=y
182# CONFIG_PREEMPT_VOLUNTARY is not set
183# CONFIG_PREEMPT is not set
184
185#
186# Bus options (PCI, PCMCIA, EISA, ISA, TC)
187#
188CONFIG_HW_HAS_PCI=y
189CONFIG_PCI=y
190# CONFIG_PCI_LEGACY_PROC is not set
191CONFIG_MMU=y
192
193#
194# PCCARD (PCMCIA/CardBus) support
195#
196# CONFIG_PCCARD is not set
197
198#
199# PCI Hotplug Support
200#
201# CONFIG_HOTPLUG_PCI is not set
202
203#
204# Executable file formats
205#
206CONFIG_BINFMT_ELF=y
207# CONFIG_BINFMT_MISC is not set
208CONFIG_TRAD_SIGNALS=y
209
210#
211# Networking
212#
213CONFIG_NET=y
214
215#
216# Networking options
217#
218CONFIG_PACKET=y
219# CONFIG_PACKET_MMAP is not set
220CONFIG_UNIX=y
221# CONFIG_NET_KEY is not set
222CONFIG_INET=y
223# CONFIG_IP_MULTICAST is not set
224# CONFIG_IP_ADVANCED_ROUTER is not set
225CONFIG_IP_FIB_HASH=y
226CONFIG_IP_PNP=y
227# CONFIG_IP_PNP_DHCP is not set
228# CONFIG_IP_PNP_BOOTP is not set
229# CONFIG_IP_PNP_RARP is not set
230# CONFIG_NET_IPIP is not set
231# CONFIG_NET_IPGRE is not set
232# CONFIG_ARPD is not set
233# CONFIG_SYN_COOKIES is not set
234# CONFIG_INET_AH is not set
235# CONFIG_INET_ESP is not set
236# CONFIG_INET_IPCOMP is not set
237# CONFIG_INET_TUNNEL is not set
238CONFIG_INET_DIAG=y
239CONFIG_INET_TCP_DIAG=y
240# CONFIG_TCP_CONG_ADVANCED is not set
241CONFIG_TCP_CONG_BIC=y
242
243#
244# IP: Virtual Server Configuration
245#
246# CONFIG_IP_VS is not set
247CONFIG_IPV6=m
248# CONFIG_IPV6_PRIVACY is not set
249# CONFIG_INET6_AH is not set
250# CONFIG_INET6_ESP is not set
251# CONFIG_INET6_IPCOMP is not set
252# CONFIG_INET6_TUNNEL is not set
253# CONFIG_IPV6_TUNNEL is not set
254CONFIG_NETFILTER=y
255# CONFIG_NETFILTER_DEBUG is not set
256# CONFIG_NETFILTER_NETLINK is not set
257
258#
259# IP: Netfilter Configuration
260#
261# CONFIG_IP_NF_CONNTRACK is not set
262CONFIG_IP_NF_PPTP=m
263# CONFIG_IP_NF_QUEUE is not set
264# CONFIG_IP_NF_IPTABLES is not set
265# CONFIG_IP_NF_ARPTABLES is not set
266
267#
268# IPv6: Netfilter Configuration (EXPERIMENTAL)
269#
270# CONFIG_IP6_NF_QUEUE is not set
271# CONFIG_IP6_NF_IPTABLES is not set
272
273#
274# DCCP Configuration (EXPERIMENTAL)
275#
276# CONFIG_IP_DCCP is not set
277
278#
279# SCTP Configuration (EXPERIMENTAL)
280#
281# CONFIG_IP_SCTP is not set
282# CONFIG_ATM is not set
283# CONFIG_BRIDGE is not set
284# CONFIG_VLAN_8021Q is not set
285# CONFIG_DECNET is not set
286# CONFIG_LLC2 is not set
287# CONFIG_IPX is not set
288# CONFIG_ATALK is not set
289# CONFIG_X25 is not set
290# CONFIG_LAPB is not set
291# CONFIG_NET_DIVERT is not set
292# CONFIG_ECONET is not set
293# CONFIG_WAN_ROUTER is not set
294# CONFIG_NET_SCHED is not set
295# CONFIG_NET_CLS_ROUTE is not set
296
297#
298# Network testing
299#
300# CONFIG_NET_PKTGEN is not set
301# CONFIG_HAMRADIO is not set
302# CONFIG_IRDA is not set
303# CONFIG_BT is not set
304# CONFIG_IEEE80211 is not set
305
306#
307# Device Drivers
308#
309
310#
311# Generic Driver Options
312#
313CONFIG_STANDALONE=y
314CONFIG_PREVENT_FIRMWARE_BUILD=y
315# CONFIG_FW_LOADER is not set
316
317#
318# Connector - unified userspace <-> kernelspace linker
319#
320# CONFIG_CONNECTOR is not set
321
322#
323# Memory Technology Devices (MTD)
324#
325# CONFIG_MTD is not set
326
327#
328# Parallel port support
329#
330# CONFIG_PARPORT is not set
331
332#
333# Plug and Play support
334#
335
336#
337# Block devices
338#
339# CONFIG_BLK_CPQ_DA is not set
340# CONFIG_BLK_CPQ_CISS_DA is not set
341# CONFIG_BLK_DEV_DAC960 is not set
342# CONFIG_BLK_DEV_UMEM is not set
343# CONFIG_BLK_DEV_COW_COMMON is not set
344CONFIG_BLK_DEV_LOOP=y
345# CONFIG_BLK_DEV_CRYPTOLOOP is not set
346# CONFIG_BLK_DEV_NBD is not set
347# CONFIG_BLK_DEV_SX8 is not set
348# CONFIG_BLK_DEV_UB is not set
349CONFIG_BLK_DEV_RAM=y
350CONFIG_BLK_DEV_RAM_COUNT=16
351CONFIG_BLK_DEV_RAM_SIZE=8192
352CONFIG_BLK_DEV_INITRD=y
353# CONFIG_LBD is not set
354# CONFIG_CDROM_PKTCDVD is not set
355
356#
357# IO Schedulers
358#
359CONFIG_IOSCHED_NOOP=y
360CONFIG_IOSCHED_AS=y
361CONFIG_IOSCHED_DEADLINE=y
362CONFIG_IOSCHED_CFQ=y
363# CONFIG_ATA_OVER_ETH is not set
364
365#
366# ATA/ATAPI/MFM/RLL support
367#
368CONFIG_IDE=y
369CONFIG_BLK_DEV_IDE=y
370
371#
372# Please see Documentation/ide.txt for help/info on IDE drives
373#
374# CONFIG_BLK_DEV_IDE_SATA is not set
375CONFIG_BLK_DEV_IDEDISK=y
376CONFIG_IDEDISK_MULTI_MODE=y
377# CONFIG_BLK_DEV_IDECD is not set
378# CONFIG_BLK_DEV_IDETAPE is not set
379# CONFIG_BLK_DEV_IDEFLOPPY is not set
380# CONFIG_BLK_DEV_IDESCSI is not set
381# CONFIG_IDE_TASK_IOCTL is not set
382
383#
384# IDE chipset support/bugfixes
385#
386CONFIG_IDE_GENERIC=y
387CONFIG_BLK_DEV_IDEPCI=y
388CONFIG_IDEPCI_SHARE_IRQ=y
389# CONFIG_BLK_DEV_OFFBOARD is not set
390# CONFIG_BLK_DEV_GENERIC is not set
391# CONFIG_BLK_DEV_OPTI621 is not set
392CONFIG_BLK_DEV_IDEDMA_PCI=y
393# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
394CONFIG_IDEDMA_PCI_AUTO=y
395# CONFIG_IDEDMA_ONLYDISK is not set
396# CONFIG_BLK_DEV_AEC62XX is not set
397# CONFIG_BLK_DEV_ALI15X3 is not set
398# CONFIG_BLK_DEV_AMD74XX is not set
399CONFIG_BLK_DEV_CMD64X=y
400# CONFIG_BLK_DEV_TRIFLEX is not set
401# CONFIG_BLK_DEV_CY82C693 is not set
402# CONFIG_BLK_DEV_CS5520 is not set
403# CONFIG_BLK_DEV_CS5530 is not set
404# CONFIG_BLK_DEV_HPT34X is not set
405# CONFIG_BLK_DEV_HPT366 is not set
406# CONFIG_BLK_DEV_SC1200 is not set
407# CONFIG_BLK_DEV_PIIX is not set
408# CONFIG_BLK_DEV_IT821X is not set
409# CONFIG_BLK_DEV_NS87415 is not set
410# CONFIG_BLK_DEV_PDC202XX_OLD is not set
411# CONFIG_BLK_DEV_PDC202XX_NEW is not set
412# CONFIG_BLK_DEV_SVWKS is not set
413# CONFIG_BLK_DEV_SIIMAGE is not set
414# CONFIG_BLK_DEV_SLC90E66 is not set
415# CONFIG_BLK_DEV_TRM290 is not set
416# CONFIG_BLK_DEV_VIA82CXXX is not set
417# CONFIG_IDE_ARM is not set
418CONFIG_BLK_DEV_IDEDMA=y
419# CONFIG_IDEDMA_IVB is not set
420CONFIG_IDEDMA_AUTO=y
421# CONFIG_BLK_DEV_HD is not set
422
423#
424# SCSI device support
425#
426# CONFIG_RAID_ATTRS is not set
427CONFIG_SCSI=y
428CONFIG_SCSI_PROC_FS=y
429
430#
431# SCSI support type (disk, tape, CD-ROM)
432#
433CONFIG_BLK_DEV_SD=y
434# CONFIG_CHR_DEV_ST is not set
435# CONFIG_CHR_DEV_OSST is not set
436# CONFIG_BLK_DEV_SR is not set
437# CONFIG_CHR_DEV_SG is not set
438# CONFIG_CHR_DEV_SCH is not set
439
440#
441# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
442#
443# CONFIG_SCSI_MULTI_LUN is not set
444# CONFIG_SCSI_CONSTANTS is not set
445# CONFIG_SCSI_LOGGING is not set
446
447#
448# SCSI Transport Attributes
449#
450CONFIG_SCSI_SPI_ATTRS=m
451# CONFIG_SCSI_FC_ATTRS is not set
452# CONFIG_SCSI_ISCSI_ATTRS is not set
453# CONFIG_SCSI_SAS_ATTRS is not set
454
455#
456# SCSI low-level drivers
457#
458# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
459# CONFIG_SCSI_3W_9XXX is not set
460# CONFIG_SCSI_ACARD is not set
461# CONFIG_SCSI_AACRAID is not set
462CONFIG_SCSI_AIC7XXX=m
463CONFIG_AIC7XXX_CMDS_PER_DEVICE=32
464CONFIG_AIC7XXX_RESET_DELAY_MS=15000
465# CONFIG_AIC7XXX_DEBUG_ENABLE is not set
466CONFIG_AIC7XXX_DEBUG_MASK=0
467# CONFIG_AIC7XXX_REG_PRETTY_PRINT is not set
468# CONFIG_SCSI_AIC7XXX_OLD is not set
469# CONFIG_SCSI_AIC79XX is not set
470# CONFIG_SCSI_DPT_I2O is not set
471# CONFIG_MEGARAID_NEWGEN is not set
472# CONFIG_MEGARAID_LEGACY is not set
473# CONFIG_SCSI_SATA is not set
474# CONFIG_SCSI_DMX3191D is not set
475# CONFIG_SCSI_FUTURE_DOMAIN is not set
476# CONFIG_SCSI_IPS is not set
477# CONFIG_SCSI_INITIO is not set
478# CONFIG_SCSI_INIA100 is not set
479# CONFIG_SCSI_SYM53C8XX_2 is not set
480# CONFIG_SCSI_IPR is not set
481# CONFIG_SCSI_QLOGIC_FC is not set
482# CONFIG_SCSI_QLOGIC_1280 is not set
483CONFIG_SCSI_QLA2XXX=y
484# CONFIG_SCSI_QLA21XX is not set
485# CONFIG_SCSI_QLA22XX is not set
486# CONFIG_SCSI_QLA2300 is not set
487# CONFIG_SCSI_QLA2322 is not set
488# CONFIG_SCSI_QLA6312 is not set
489# CONFIG_SCSI_QLA24XX is not set
490# CONFIG_SCSI_LPFC is not set
491# CONFIG_SCSI_DC395x is not set
492# CONFIG_SCSI_DC390T is not set
493# CONFIG_SCSI_NSP32 is not set
494# CONFIG_SCSI_DEBUG is not set
495
496#
497# Multi-device support (RAID and LVM)
498#
499# CONFIG_MD is not set
500
501#
502# Fusion MPT device support
503#
504# CONFIG_FUSION is not set
505# CONFIG_FUSION_SPI is not set
506# CONFIG_FUSION_FC is not set
507
508#
509# IEEE 1394 (FireWire) support
510#
511# CONFIG_IEEE1394 is not set
512
513#
514# I2O device support
515#
516# CONFIG_I2O is not set
517
518#
519# Network device support
520#
521CONFIG_NETDEVICES=y
522# CONFIG_DUMMY is not set
523# CONFIG_BONDING is not set
524# CONFIG_EQUALIZER is not set
525CONFIG_TUN=m
526
527#
528# ARCnet devices
529#
530# CONFIG_ARCNET is not set
531
532#
533# PHY device support
534#
535# CONFIG_PHYLIB is not set
536
537#
538# Ethernet (10 or 100Mbit)
539#
540CONFIG_NET_ETHERNET=y
541CONFIG_MII=y
542# CONFIG_HAPPYMEAL is not set
543# CONFIG_SUNGEM is not set
544# CONFIG_NET_VENDOR_3COM is not set
545
546#
547# Tulip family network device support
548#
549# CONFIG_NET_TULIP is not set
550# CONFIG_HP100 is not set
551CONFIG_NET_PCI=y
552# CONFIG_PCNET32 is not set
553# CONFIG_AMD8111_ETH is not set
554# CONFIG_ADAPTEC_STARFIRE is not set
555# CONFIG_B44 is not set
556# CONFIG_FORCEDETH is not set
557# CONFIG_DGRS is not set
558# CONFIG_EEPRO100 is not set
559# CONFIG_E100 is not set
560# CONFIG_FEALNX is not set
561CONFIG_NATSEMI=y
562# CONFIG_NE2K_PCI is not set
563# CONFIG_8139CP is not set
564CONFIG_8139TOO=y
565# CONFIG_8139TOO_PIO is not set
566# CONFIG_8139TOO_TUNE_TWISTER is not set
567# CONFIG_8139TOO_8129 is not set
568# CONFIG_8139_OLD_RX_RESET is not set
569# CONFIG_SIS900 is not set
570# CONFIG_EPIC100 is not set
571# CONFIG_SUNDANCE is not set
572# CONFIG_TLAN is not set
573# CONFIG_VIA_RHINE is not set
574# CONFIG_LAN_SAA9730 is not set
575
576#
577# Ethernet (1000 Mbit)
578#
579# CONFIG_ACENIC is not set
580# CONFIG_DL2K is not set
581# CONFIG_E1000 is not set
582# CONFIG_NS83820 is not set
583# CONFIG_HAMACHI is not set
584# CONFIG_YELLOWFIN is not set
585# CONFIG_R8169 is not set
586# CONFIG_SIS190 is not set
587# CONFIG_SKGE is not set
588# CONFIG_SK98LIN is not set
589# CONFIG_VIA_VELOCITY is not set
590# CONFIG_TIGON3 is not set
591# CONFIG_BNX2 is not set
592
593#
594# Ethernet (10000 Mbit)
595#
596# CONFIG_CHELSIO_T1 is not set
597# CONFIG_IXGB is not set
598# CONFIG_S2IO is not set
599
600#
601# Token Ring devices
602#
603# CONFIG_TR is not set
604
605#
606# Wireless LAN (non-hamradio)
607#
608# CONFIG_NET_RADIO is not set
609
610#
611# Wan interfaces
612#
613# CONFIG_WAN is not set
614# CONFIG_FDDI is not set
615# CONFIG_HIPPI is not set
616CONFIG_PPP=m
617# CONFIG_PPP_MULTILINK is not set
618# CONFIG_PPP_FILTER is not set
619CONFIG_PPP_ASYNC=m
620CONFIG_PPP_SYNC_TTY=m
621CONFIG_PPP_DEFLATE=m
622# CONFIG_PPP_BSDCOMP is not set
623# CONFIG_PPPOE is not set
624# CONFIG_SLIP is not set
625# CONFIG_NET_FC is not set
626# CONFIG_SHAPER is not set
627# CONFIG_NETCONSOLE is not set
628# CONFIG_NETPOLL is not set
629# CONFIG_NET_POLL_CONTROLLER is not set
630
631#
632# ISDN subsystem
633#
634# CONFIG_ISDN is not set
635
636#
637# Telephony Support
638#
639# CONFIG_PHONE is not set
640
641#
642# Input device support
643#
644CONFIG_INPUT=y
645
646#
647# Userland interfaces
648#
649CONFIG_INPUT_MOUSEDEV=y
650CONFIG_INPUT_MOUSEDEV_PSAUX=y
651CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
652CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
653# CONFIG_INPUT_JOYDEV is not set
654# CONFIG_INPUT_TSDEV is not set
655CONFIG_INPUT_EVDEV=m
656# CONFIG_INPUT_EVBUG is not set
657
658#
659# Input Device Drivers
660#
661CONFIG_INPUT_KEYBOARD=y
662CONFIG_KEYBOARD_ATKBD=y
663# CONFIG_KEYBOARD_SUNKBD is not set
664# CONFIG_KEYBOARD_LKKBD is not set
665# CONFIG_KEYBOARD_XTKBD is not set
666# CONFIG_KEYBOARD_NEWTON is not set
667CONFIG_INPUT_MOUSE=y
668CONFIG_MOUSE_PS2=y
669# CONFIG_MOUSE_SERIAL is not set
670# CONFIG_MOUSE_VSXXXAA is not set
671# CONFIG_INPUT_JOYSTICK is not set
672# CONFIG_INPUT_TOUCHSCREEN is not set
673# CONFIG_INPUT_MISC is not set
674
675#
676# Hardware I/O ports
677#
678CONFIG_SERIO=y
679CONFIG_SERIO_I8042=y
680CONFIG_SERIO_SERPORT=y
681# CONFIG_SERIO_PCIPS2 is not set
682CONFIG_SERIO_LIBPS2=y
683# CONFIG_SERIO_RAW is not set
684# CONFIG_GAMEPORT is not set
685
686#
687# Character devices
688#
689CONFIG_VT=y
690# CONFIG_VT_CONSOLE is not set
691CONFIG_HW_CONSOLE=y
692CONFIG_SERIAL_NONSTANDARD=y
693# CONFIG_COMPUTONE is not set
694# CONFIG_ROCKETPORT is not set
695# CONFIG_CYCLADES is not set
696# CONFIG_DIGIEPCA is not set
697# CONFIG_MOXA_INTELLIO is not set
698# CONFIG_MOXA_SMARTIO is not set
699# CONFIG_ISI is not set
700# CONFIG_SYNCLINKMP is not set
701# CONFIG_N_HDLC is not set
702# CONFIG_RISCOM8 is not set
703# CONFIG_SPECIALIX is not set
704# CONFIG_SX is not set
705# CONFIG_RIO is not set
706# CONFIG_STALDRV is not set
707
708#
709# Serial drivers
710#
711# CONFIG_SERIAL_8250 is not set
712
713#
714# Non-8250 serial port support
715#
716# CONFIG_SERIAL_IP3106 is not set
717# CONFIG_SERIAL_JSM is not set
718CONFIG_UNIX98_PTYS=y
719CONFIG_LEGACY_PTYS=y
720CONFIG_LEGACY_PTY_COUNT=256
721
722#
723# IPMI
724#
725# CONFIG_IPMI_HANDLER is not set
726
727#
728# Watchdog Cards
729#
730# CONFIG_WATCHDOG is not set
731# CONFIG_RTC is not set
732# CONFIG_GEN_RTC is not set
733# CONFIG_DTLK is not set
734# CONFIG_R3964 is not set
735# CONFIG_APPLICOM is not set
736
737#
738# Ftape, the floppy tape device driver
739#
740# CONFIG_DRM is not set
741# CONFIG_RAW_DRIVER is not set
742
743#
744# TPM devices
745#
746# CONFIG_TCG_TPM is not set
747
748#
749# I2C support
750#
751CONFIG_I2C=m
752CONFIG_I2C_CHARDEV=m
753
754#
755# I2C Algorithms
756#
757CONFIG_I2C_ALGOBIT=m
758# CONFIG_I2C_ALGOPCF is not set
759# CONFIG_I2C_ALGOPCA is not set
760
761#
762# I2C Hardware Bus support
763#
764# CONFIG_I2C_ALI1535 is not set
765# CONFIG_I2C_ALI1563 is not set
766# CONFIG_I2C_ALI15X3 is not set
767# CONFIG_I2C_AMD756 is not set
768# CONFIG_I2C_AMD8111 is not set
769# CONFIG_I2C_I801 is not set
770# CONFIG_I2C_I810 is not set
771# CONFIG_I2C_PIIX4 is not set
772# CONFIG_I2C_NFORCE2 is not set
773# CONFIG_I2C_PARPORT_LIGHT is not set
774# CONFIG_I2C_PROSAVAGE is not set
775# CONFIG_I2C_SAVAGE4 is not set
776# CONFIG_SCx200_ACB is not set
777# CONFIG_I2C_SIS5595 is not set
778# CONFIG_I2C_SIS630 is not set
779# CONFIG_I2C_SIS96X is not set
780# CONFIG_I2C_STUB is not set
781# CONFIG_I2C_VIA is not set
782# CONFIG_I2C_VIAPRO is not set
783# CONFIG_I2C_VOODOO3 is not set
784# CONFIG_I2C_PCA_ISA is not set
785
786#
787# Miscellaneous I2C Chip support
788#
789# CONFIG_SENSORS_DS1337 is not set
790# CONFIG_SENSORS_DS1374 is not set
791# CONFIG_SENSORS_EEPROM is not set
792# CONFIG_SENSORS_PCF8574 is not set
793# CONFIG_SENSORS_PCA9539 is not set
794# CONFIG_SENSORS_PCF8591 is not set
795# CONFIG_SENSORS_RTC8564 is not set
796# CONFIG_SENSORS_MAX6875 is not set
797# CONFIG_I2C_DEBUG_CORE is not set
798# CONFIG_I2C_DEBUG_ALGO is not set
799# CONFIG_I2C_DEBUG_BUS is not set
800# CONFIG_I2C_DEBUG_CHIP is not set
801
802#
803# Dallas's 1-wire bus
804#
805# CONFIG_W1 is not set
806
807#
808# Hardware Monitoring support
809#
810CONFIG_HWMON=y
811# CONFIG_HWMON_VID is not set
812# CONFIG_SENSORS_ADM1021 is not set
813# CONFIG_SENSORS_ADM1025 is not set
814# CONFIG_SENSORS_ADM1026 is not set
815# CONFIG_SENSORS_ADM1031 is not set
816# CONFIG_SENSORS_ADM9240 is not set
817# CONFIG_SENSORS_ASB100 is not set
818# CONFIG_SENSORS_ATXP1 is not set
819# CONFIG_SENSORS_DS1621 is not set
820# CONFIG_SENSORS_FSCHER is not set
821# CONFIG_SENSORS_FSCPOS is not set
822# CONFIG_SENSORS_GL518SM is not set
823# CONFIG_SENSORS_GL520SM is not set
824# CONFIG_SENSORS_IT87 is not set
825# CONFIG_SENSORS_LM63 is not set
826# CONFIG_SENSORS_LM75 is not set
827# CONFIG_SENSORS_LM77 is not set
828# CONFIG_SENSORS_LM78 is not set
829# CONFIG_SENSORS_LM80 is not set
830# CONFIG_SENSORS_LM83 is not set
831# CONFIG_SENSORS_LM85 is not set
832# CONFIG_SENSORS_LM87 is not set
833# CONFIG_SENSORS_LM90 is not set
834# CONFIG_SENSORS_LM92 is not set
835# CONFIG_SENSORS_MAX1619 is not set
836# CONFIG_SENSORS_PC87360 is not set
837# CONFIG_SENSORS_SIS5595 is not set
838# CONFIG_SENSORS_SMSC47M1 is not set
839# CONFIG_SENSORS_SMSC47B397 is not set
840# CONFIG_SENSORS_VIA686A is not set
841# CONFIG_SENSORS_W83781D is not set
842# CONFIG_SENSORS_W83792D is not set
843# CONFIG_SENSORS_W83L785TS is not set
844# CONFIG_SENSORS_W83627HF is not set
845# CONFIG_SENSORS_W83627EHF is not set
846# CONFIG_HWMON_DEBUG_CHIP is not set
847
848#
849# Misc devices
850#
851
852#
853# Multimedia Capabilities Port drivers
854#
855
856#
857# Multimedia devices
858#
859# CONFIG_VIDEO_DEV is not set
860
861#
862# Digital Video Broadcasting Devices
863#
864# CONFIG_DVB is not set
865
866#
867# Graphics support
868#
869CONFIG_FB=y
870# CONFIG_FB_CFB_FILLRECT is not set
871# CONFIG_FB_CFB_COPYAREA is not set
872# CONFIG_FB_CFB_IMAGEBLIT is not set
873# CONFIG_FB_SOFT_CURSOR is not set
874# CONFIG_FB_MACMODES is not set
875# CONFIG_FB_MODE_HELPERS is not set
876# CONFIG_FB_TILEBLITTING is not set
877# CONFIG_FB_CIRRUS is not set
878# CONFIG_FB_PM2 is not set
879# CONFIG_FB_CYBER2000 is not set
880# CONFIG_FB_ASILIANT is not set
881# CONFIG_FB_IMSTT is not set
882# CONFIG_FB_NVIDIA is not set
883# CONFIG_FB_RIVA is not set
884# CONFIG_FB_MATROX is not set
885# CONFIG_FB_RADEON_OLD is not set
886# CONFIG_FB_RADEON is not set
887# CONFIG_FB_ATY128 is not set
888# CONFIG_FB_ATY is not set
889# CONFIG_FB_SAVAGE is not set
890# CONFIG_FB_SIS is not set
891# CONFIG_FB_NEOMAGIC is not set
892# CONFIG_FB_KYRO is not set
893# CONFIG_FB_3DFX is not set
894# CONFIG_FB_VOODOO1 is not set
895# CONFIG_FB_SMIVGX is not set
896# CONFIG_FB_CYBLA is not set
897# CONFIG_FB_TRIDENT is not set
898# CONFIG_FB_E1356 is not set
899# CONFIG_FB_S1D13XXX is not set
900# CONFIG_FB_VIRTUAL is not set
901
902#
903# Console display driver support
904#
905# CONFIG_VGA_CONSOLE is not set
906CONFIG_DUMMY_CONSOLE=y
907# CONFIG_FRAMEBUFFER_CONSOLE is not set
908
909#
910# Logo configuration
911#
912# CONFIG_LOGO is not set
913# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
914
915#
916# Sound
917#
918# CONFIG_SOUND is not set
919
920#
921# USB support
922#
923CONFIG_USB_ARCH_HAS_HCD=y
924CONFIG_USB_ARCH_HAS_OHCI=y
925CONFIG_USB=y
926# CONFIG_USB_DEBUG is not set
927
928#
929# Miscellaneous USB options
930#
931CONFIG_USB_DEVICEFS=y
932# CONFIG_USB_BANDWIDTH is not set
933# CONFIG_USB_DYNAMIC_MINORS is not set
934# CONFIG_USB_OTG is not set
935
936#
937# USB Host Controller Drivers
938#
939# CONFIG_USB_EHCI_HCD is not set
940# CONFIG_USB_ISP116X_HCD is not set
941# CONFIG_USB_OHCI_HCD is not set
942# CONFIG_USB_UHCI_HCD is not set
943# CONFIG_USB_SL811_HCD is not set
944
945#
946# USB Device Class drivers
947#
948# CONFIG_USB_BLUETOOTH_TTY is not set
949# CONFIG_USB_ACM is not set
950# CONFIG_USB_PRINTER is not set
951
952#
953# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
954#
955CONFIG_USB_STORAGE=y
956# CONFIG_USB_STORAGE_DEBUG is not set
957# CONFIG_USB_STORAGE_DATAFAB is not set
958# CONFIG_USB_STORAGE_FREECOM is not set
959# CONFIG_USB_STORAGE_ISD200 is not set
960# CONFIG_USB_STORAGE_DPCM is not set
961# CONFIG_USB_STORAGE_USBAT is not set
962# CONFIG_USB_STORAGE_SDDR09 is not set
963# CONFIG_USB_STORAGE_SDDR55 is not set
964# CONFIG_USB_STORAGE_JUMPSHOT is not set
965# CONFIG_USB_STORAGE_ONETOUCH is not set
966
967#
968# USB Input Devices
969#
970CONFIG_USB_HID=y
971CONFIG_USB_HIDINPUT=y
972# CONFIG_HID_FF is not set
973CONFIG_USB_HIDDEV=y
974# CONFIG_USB_AIPTEK is not set
975# CONFIG_USB_WACOM is not set
976# CONFIG_USB_ACECAD is not set
977# CONFIG_USB_KBTAB is not set
978# CONFIG_USB_POWERMATE is not set
979# CONFIG_USB_MTOUCH is not set
980# CONFIG_USB_ITMTOUCH is not set
981# CONFIG_USB_EGALAX is not set
982# CONFIG_USB_YEALINK is not set
983# CONFIG_USB_XPAD is not set
984# CONFIG_USB_ATI_REMOTE is not set
985# CONFIG_USB_KEYSPAN_REMOTE is not set
986# CONFIG_USB_APPLETOUCH is not set
987
988#
989# USB Imaging devices
990#
991# CONFIG_USB_MDC800 is not set
992# CONFIG_USB_MICROTEK is not set
993
994#
995# USB Multimedia devices
996#
997# CONFIG_USB_DABUSB is not set
998
999#
1000# Video4Linux support is needed for USB Multimedia device support
1001#
1002
1003#
1004# USB Network Adapters
1005#
1006# CONFIG_USB_CATC is not set
1007# CONFIG_USB_KAWETH is not set
1008# CONFIG_USB_PEGASUS is not set
1009# CONFIG_USB_RTL8150 is not set
1010# CONFIG_USB_USBNET is not set
1011CONFIG_USB_MON=y
1012
1013#
1014# USB port drivers
1015#
1016
1017#
1018# USB Serial Converter support
1019#
1020# CONFIG_USB_SERIAL is not set
1021
1022#
1023# USB Miscellaneous drivers
1024#
1025# CONFIG_USB_EMI62 is not set
1026# CONFIG_USB_EMI26 is not set
1027# CONFIG_USB_AUERSWALD is not set
1028# CONFIG_USB_RIO500 is not set
1029# CONFIG_USB_LEGOTOWER is not set
1030# CONFIG_USB_LCD is not set
1031# CONFIG_USB_LED is not set
1032# CONFIG_USB_CYTHERM is not set
1033# CONFIG_USB_PHIDGETKIT is not set
1034# CONFIG_USB_PHIDGETSERVO is not set
1035# CONFIG_USB_IDMOUSE is not set
1036# CONFIG_USB_LD is not set
1037# CONFIG_USB_TEST is not set
1038
1039#
1040# USB DSL modem support
1041#
1042
1043#
1044# USB Gadget Support
1045#
1046# CONFIG_USB_GADGET is not set
1047
1048#
1049# MMC/SD Card support
1050#
1051# CONFIG_MMC is not set
1052
1053#
1054# InfiniBand support
1055#
1056# CONFIG_INFINIBAND is not set
1057
1058#
1059# SN Devices
1060#
1061
1062#
1063# File systems
1064#
1065CONFIG_EXT2_FS=y
1066# CONFIG_EXT2_FS_XATTR is not set
1067# CONFIG_EXT2_FS_XIP is not set
1068CONFIG_EXT3_FS=y
1069CONFIG_EXT3_FS_XATTR=y
1070# CONFIG_EXT3_FS_POSIX_ACL is not set
1071# CONFIG_EXT3_FS_SECURITY is not set
1072CONFIG_JBD=y
1073# CONFIG_JBD_DEBUG is not set
1074CONFIG_FS_MBCACHE=y
1075# CONFIG_REISERFS_FS is not set
1076# CONFIG_JFS_FS is not set
1077# CONFIG_FS_POSIX_ACL is not set
1078CONFIG_XFS_FS=m
1079CONFIG_XFS_EXPORT=y
1080# CONFIG_XFS_QUOTA is not set
1081# CONFIG_XFS_SECURITY is not set
1082# CONFIG_XFS_POSIX_ACL is not set
1083# CONFIG_XFS_RT is not set
1084# CONFIG_MINIX_FS is not set
1085# CONFIG_ROMFS_FS is not set
1086CONFIG_INOTIFY=y
1087# CONFIG_QUOTA is not set
1088CONFIG_DNOTIFY=y
1089CONFIG_AUTOFS_FS=y
1090CONFIG_AUTOFS4_FS=y
1091# CONFIG_FUSE_FS is not set
1092
1093#
1094# CD-ROM/DVD Filesystems
1095#
1096# CONFIG_ISO9660_FS is not set
1097# CONFIG_UDF_FS is not set
1098
1099#
1100# DOS/FAT/NT Filesystems
1101#
1102CONFIG_FAT_FS=y
1103CONFIG_MSDOS_FS=y
1104CONFIG_VFAT_FS=y
1105CONFIG_FAT_DEFAULT_CODEPAGE=437
1106CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1107# CONFIG_NTFS_FS is not set
1108
1109#
1110# Pseudo filesystems
1111#
1112CONFIG_PROC_FS=y
1113# CONFIG_PROC_KCORE is not set
1114CONFIG_SYSFS=y
1115CONFIG_TMPFS=y
1116# CONFIG_HUGETLB_PAGE is not set
1117CONFIG_RAMFS=y
1118# CONFIG_RELAYFS_FS is not set
1119
1120#
1121# Miscellaneous filesystems
1122#
1123# CONFIG_ADFS_FS is not set
1124# CONFIG_AFFS_FS is not set
1125# CONFIG_HFS_FS is not set
1126# CONFIG_HFSPLUS_FS is not set
1127# CONFIG_BEFS_FS is not set
1128# CONFIG_BFS_FS is not set
1129# CONFIG_EFS_FS is not set
1130CONFIG_CRAMFS=y
1131# CONFIG_VXFS_FS is not set
1132# CONFIG_HPFS_FS is not set
1133# CONFIG_QNX4FS_FS is not set
1134# CONFIG_SYSV_FS is not set
1135# CONFIG_UFS_FS is not set
1136
1137#
1138# Network File Systems
1139#
1140CONFIG_NFS_FS=y
1141CONFIG_NFS_V3=y
1142# CONFIG_NFS_V3_ACL is not set
1143# CONFIG_NFS_V4 is not set
1144# CONFIG_NFS_DIRECTIO is not set
1145CONFIG_NFSD=m
1146# CONFIG_NFSD_V3 is not set
1147# CONFIG_NFSD_TCP is not set
1148CONFIG_ROOT_NFS=y
1149CONFIG_LOCKD=y
1150CONFIG_LOCKD_V4=y
1151CONFIG_EXPORTFS=m
1152CONFIG_NFS_COMMON=y
1153CONFIG_SUNRPC=y
1154# CONFIG_RPCSEC_GSS_KRB5 is not set
1155# CONFIG_RPCSEC_GSS_SPKM3 is not set
1156CONFIG_SMB_FS=m
1157# CONFIG_SMB_NLS_DEFAULT is not set
1158# CONFIG_CIFS is not set
1159# CONFIG_NCP_FS is not set
1160# CONFIG_CODA_FS is not set
1161# CONFIG_AFS_FS is not set
1162# CONFIG_9P_FS is not set
1163
1164#
1165# Partition Types
1166#
1167# CONFIG_PARTITION_ADVANCED is not set
1168CONFIG_MSDOS_PARTITION=y
1169
1170#
1171# Native Language Support
1172#
1173CONFIG_NLS=y
1174CONFIG_NLS_DEFAULT="iso8859-1"
1175# CONFIG_NLS_CODEPAGE_437 is not set
1176# CONFIG_NLS_CODEPAGE_737 is not set
1177# CONFIG_NLS_CODEPAGE_775 is not set
1178# CONFIG_NLS_CODEPAGE_850 is not set
1179# CONFIG_NLS_CODEPAGE_852 is not set
1180# CONFIG_NLS_CODEPAGE_855 is not set
1181# CONFIG_NLS_CODEPAGE_857 is not set
1182# CONFIG_NLS_CODEPAGE_860 is not set
1183# CONFIG_NLS_CODEPAGE_861 is not set
1184# CONFIG_NLS_CODEPAGE_862 is not set
1185# CONFIG_NLS_CODEPAGE_863 is not set
1186# CONFIG_NLS_CODEPAGE_864 is not set
1187# CONFIG_NLS_CODEPAGE_865 is not set
1188# CONFIG_NLS_CODEPAGE_866 is not set
1189# CONFIG_NLS_CODEPAGE_869 is not set
1190# CONFIG_NLS_CODEPAGE_936 is not set
1191# CONFIG_NLS_CODEPAGE_950 is not set
1192# CONFIG_NLS_CODEPAGE_932 is not set
1193# CONFIG_NLS_CODEPAGE_949 is not set
1194# CONFIG_NLS_CODEPAGE_874 is not set
1195# CONFIG_NLS_ISO8859_8 is not set
1196# CONFIG_NLS_CODEPAGE_1250 is not set
1197# CONFIG_NLS_CODEPAGE_1251 is not set
1198# CONFIG_NLS_ASCII is not set
1199# CONFIG_NLS_ISO8859_1 is not set
1200# CONFIG_NLS_ISO8859_2 is not set
1201# CONFIG_NLS_ISO8859_3 is not set
1202# CONFIG_NLS_ISO8859_4 is not set
1203# CONFIG_NLS_ISO8859_5 is not set
1204# CONFIG_NLS_ISO8859_6 is not set
1205# CONFIG_NLS_ISO8859_7 is not set
1206# CONFIG_NLS_ISO8859_9 is not set
1207# CONFIG_NLS_ISO8859_13 is not set
1208# CONFIG_NLS_ISO8859_14 is not set
1209# CONFIG_NLS_ISO8859_15 is not set
1210# CONFIG_NLS_KOI8_R is not set
1211# CONFIG_NLS_KOI8_U is not set
1212# CONFIG_NLS_UTF8 is not set
1213
1214#
1215# Profiling support
1216#
1217# CONFIG_PROFILING is not set
1218
1219#
1220# Kernel hacking
1221#
1222# CONFIG_PRINTK_TIME is not set
1223# CONFIG_DEBUG_KERNEL is not set
1224CONFIG_LOG_BUF_SHIFT=14
1225CONFIG_CROSSCOMPILE=y
1226CONFIG_CMDLINE=""
1227
1228#
1229# Security options
1230#
1231# CONFIG_KEYS is not set
1232# CONFIG_SECURITY is not set
1233
1234#
1235# Cryptographic options
1236#
1237# CONFIG_CRYPTO is not set
1238
1239#
1240# Hardware crypto devices
1241#
1242
1243#
1244# Library routines
1245#
1246CONFIG_CRC_CCITT=m
1247# CONFIG_CRC16 is not set
1248CONFIG_CRC32=y
1249# CONFIG_LIBCRC32C is not set
1250CONFIG_ZLIB_INFLATE=y
1251CONFIG_ZLIB_DEFLATE=m
diff --git a/arch/mips/configs/qemu_defconfig b/arch/mips/configs/qemu_defconfig
index b6568e421b99..741a9a971367 100644
--- a/arch/mips/configs/qemu_defconfig
+++ b/arch/mips/configs/qemu_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.13-rc6 3# Linux kernel version: 2.6.14-rc2
4# Mon Aug 8 11:49:54 2005 4# Thu Oct 20 22:26:56 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -17,6 +17,7 @@ CONFIG_INIT_ENV_ARG_LIMIT=32
17# General setup 17# General setup
18# 18#
19CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
20# CONFIG_SWAP is not set 21# CONFIG_SWAP is not set
21# CONFIG_SYSVIPC is not set 22# CONFIG_SYSVIPC is not set
22# CONFIG_BSD_PROCESS_ACCT is not set 23# CONFIG_BSD_PROCESS_ACCT is not set
@@ -25,6 +26,7 @@ CONFIG_LOCALVERSION=""
25# CONFIG_HOTPLUG is not set 26# CONFIG_HOTPLUG is not set
26CONFIG_KOBJECT_UEVENT=y 27CONFIG_KOBJECT_UEVENT=y
27# CONFIG_IKCONFIG is not set 28# CONFIG_IKCONFIG is not set
29CONFIG_INITRAMFS_SOURCE=""
28CONFIG_EMBEDDED=y 30CONFIG_EMBEDDED=y
29CONFIG_KALLSYMS=y 31CONFIG_KALLSYMS=y
30# CONFIG_KALLSYMS_EXTRA_PASS is not set 32# CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -74,6 +76,7 @@ CONFIG_BASE_SMALL=1
74# CONFIG_MIPS_ATLAS is not set 76# CONFIG_MIPS_ATLAS is not set
75# CONFIG_MIPS_MALTA is not set 77# CONFIG_MIPS_MALTA is not set
76# CONFIG_MIPS_SEAD is not set 78# CONFIG_MIPS_SEAD is not set
79# CONFIG_MIPS_SIM is not set
77# CONFIG_MOMENCO_JAGUAR_ATX is not set 80# CONFIG_MOMENCO_JAGUAR_ATX is not set
78# CONFIG_MOMENCO_OCELOT is not set 81# CONFIG_MOMENCO_OCELOT is not set
79# CONFIG_MOMENCO_OCELOT_3 is not set 82# CONFIG_MOMENCO_OCELOT_3 is not set
@@ -91,6 +94,7 @@ CONFIG_QEMU=y
91# CONFIG_SGI_IP22 is not set 94# CONFIG_SGI_IP22 is not set
92# CONFIG_SGI_IP27 is not set 95# CONFIG_SGI_IP27 is not set
93# CONFIG_SGI_IP32 is not set 96# CONFIG_SGI_IP32 is not set
97# CONFIG_SIBYTE_BIGSUR is not set
94# CONFIG_SIBYTE_SWARM is not set 98# CONFIG_SIBYTE_SWARM is not set
95# CONFIG_SIBYTE_SENTOSA is not set 99# CONFIG_SIBYTE_SENTOSA is not set
96# CONFIG_SIBYTE_RHONE is not set 100# CONFIG_SIBYTE_RHONE is not set
@@ -105,7 +109,6 @@ CONFIG_QEMU=y
105# CONFIG_TOSHIBA_RBTX4938 is not set 109# CONFIG_TOSHIBA_RBTX4938 is not set
106CONFIG_RWSEM_GENERIC_SPINLOCK=y 110CONFIG_RWSEM_GENERIC_SPINLOCK=y
107CONFIG_GENERIC_CALIBRATE_DELAY=y 111CONFIG_GENERIC_CALIBRATE_DELAY=y
108CONFIG_HAVE_DEC_LOCK=y
109CONFIG_DMA_COHERENT=y 112CONFIG_DMA_COHERENT=y
110CONFIG_GENERIC_ISA_DMA=y 113CONFIG_GENERIC_ISA_DMA=y
111CONFIG_I8259=y 114CONFIG_I8259=y
@@ -119,7 +122,7 @@ CONFIG_HAVE_STD_PC_SERIAL_PORT=y
119# 122#
120# CPU selection 123# CPU selection
121# 124#
122# CONFIG_CPU_MIPS32_R1 is not set 125CONFIG_CPU_MIPS32_R1=y
123# CONFIG_CPU_MIPS32_R2 is not set 126# CONFIG_CPU_MIPS32_R2 is not set
124# CONFIG_CPU_MIPS64_R1 is not set 127# CONFIG_CPU_MIPS64_R1 is not set
125# CONFIG_CPU_MIPS64_R2 is not set 128# CONFIG_CPU_MIPS64_R2 is not set
@@ -127,7 +130,7 @@ CONFIG_HAVE_STD_PC_SERIAL_PORT=y
127# CONFIG_CPU_TX39XX is not set 130# CONFIG_CPU_TX39XX is not set
128# CONFIG_CPU_VR41XX is not set 131# CONFIG_CPU_VR41XX is not set
129# CONFIG_CPU_R4300 is not set 132# CONFIG_CPU_R4300 is not set
130CONFIG_CPU_R4X00=y 133# CONFIG_CPU_R4X00 is not set
131# CONFIG_CPU_TX49XX is not set 134# CONFIG_CPU_TX49XX is not set
132# CONFIG_CPU_R5000 is not set 135# CONFIG_CPU_R5000 is not set
133# CONFIG_CPU_R5432 is not set 136# CONFIG_CPU_R5432 is not set
@@ -138,9 +141,11 @@ CONFIG_CPU_R4X00=y
138# CONFIG_CPU_RM7000 is not set 141# CONFIG_CPU_RM7000 is not set
139# CONFIG_CPU_RM9000 is not set 142# CONFIG_CPU_RM9000 is not set
140# CONFIG_CPU_SB1 is not set 143# CONFIG_CPU_SB1 is not set
144CONFIG_SYS_HAS_CPU_MIPS32_R1=y
145CONFIG_CPU_MIPS32=y
146CONFIG_CPU_MIPSR1=y
141CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y 147CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
142CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y 148CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
143CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
144 149
145# 150#
146# Kernel type 151# Kernel type
@@ -151,15 +156,18 @@ CONFIG_PAGE_SIZE_4KB=y
151# CONFIG_PAGE_SIZE_8KB is not set 156# CONFIG_PAGE_SIZE_8KB is not set
152# CONFIG_PAGE_SIZE_16KB is not set 157# CONFIG_PAGE_SIZE_16KB is not set
153# CONFIG_PAGE_SIZE_64KB is not set 158# CONFIG_PAGE_SIZE_64KB is not set
159CONFIG_CPU_HAS_PREFETCH=y
154# CONFIG_MIPS_MT is not set 160# CONFIG_MIPS_MT is not set
155# CONFIG_64BIT_PHYS_ADDR is not set 161# CONFIG_64BIT_PHYS_ADDR is not set
156# CONFIG_CPU_ADVANCED is not set 162# CONFIG_CPU_ADVANCED is not set
157CONFIG_CPU_HAS_LLSC=y 163CONFIG_CPU_HAS_LLSC=y
158CONFIG_CPU_HAS_LLDSCD=y
159CONFIG_CPU_HAS_SYNC=y 164CONFIG_CPU_HAS_SYNC=y
165CONFIG_GENERIC_HARDIRQS=y
166CONFIG_GENERIC_IRQ_PROBE=y
160CONFIG_ARCH_FLATMEM_ENABLE=y 167CONFIG_ARCH_FLATMEM_ENABLE=y
161CONFIG_FLATMEM=y 168CONFIG_FLATMEM=y
162CONFIG_FLAT_NODE_MEM_MAP=y 169CONFIG_FLAT_NODE_MEM_MAP=y
170# CONFIG_SPARSEMEM_STATIC is not set
163CONFIG_PREEMPT_NONE=y 171CONFIG_PREEMPT_NONE=y
164# CONFIG_PREEMPT_VOLUNTARY is not set 172# CONFIG_PREEMPT_VOLUNTARY is not set
165# CONFIG_PREEMPT is not set 173# CONFIG_PREEMPT is not set
@@ -214,8 +222,8 @@ CONFIG_IP_PNP_BOOTP=y
214# CONFIG_INET_ESP is not set 222# CONFIG_INET_ESP is not set
215# CONFIG_INET_IPCOMP is not set 223# CONFIG_INET_IPCOMP is not set
216# CONFIG_INET_TUNNEL is not set 224# CONFIG_INET_TUNNEL is not set
217CONFIG_IP_TCPDIAG=y 225CONFIG_INET_DIAG=y
218# CONFIG_IP_TCPDIAG_IPV6 is not set 226CONFIG_INET_TCP_DIAG=y
219# CONFIG_TCP_CONG_ADVANCED is not set 227# CONFIG_TCP_CONG_ADVANCED is not set
220CONFIG_TCP_CONG_BIC=y 228CONFIG_TCP_CONG_BIC=y
221# CONFIG_IPV6 is not set 229# CONFIG_IPV6 is not set
@@ -232,9 +240,15 @@ CONFIG_TCP_CONG_BIC=y
232# 240#
233# Network testing 241# Network testing
234# 242#
243# CONFIG_NET_PKTGEN is not set
235# CONFIG_HAMRADIO is not set 244# CONFIG_HAMRADIO is not set
236# CONFIG_IRDA is not set 245# CONFIG_IRDA is not set
237# CONFIG_BT is not set 246# CONFIG_BT is not set
247CONFIG_IEEE80211=y
248# CONFIG_IEEE80211_DEBUG is not set
249CONFIG_IEEE80211_CRYPT_WEP=y
250CONFIG_IEEE80211_CRYPT_CCMP=y
251CONFIG_IEEE80211_CRYPT_TKIP=y
238 252
239# 253#
240# Device Drivers 254# Device Drivers
@@ -248,6 +262,11 @@ CONFIG_STANDALONE=y
248# CONFIG_FW_LOADER is not set 262# CONFIG_FW_LOADER is not set
249 263
250# 264#
265# Connector - unified userspace <-> kernelspace linker
266#
267CONFIG_CONNECTOR=y
268
269#
251# Memory Technology Devices (MTD) 270# Memory Technology Devices (MTD)
252# 271#
253# CONFIG_MTD is not set 272# CONFIG_MTD is not set
@@ -265,13 +284,12 @@ CONFIG_STANDALONE=y
265# 284#
266# Block devices 285# Block devices
267# 286#
268# CONFIG_BLK_DEV_FD is not set
269# CONFIG_BLK_DEV_COW_COMMON is not set 287# CONFIG_BLK_DEV_COW_COMMON is not set
270# CONFIG_BLK_DEV_LOOP is not set 288# CONFIG_BLK_DEV_LOOP is not set
271# CONFIG_BLK_DEV_NBD is not set 289# CONFIG_BLK_DEV_NBD is not set
272# CONFIG_BLK_DEV_RAM is not set 290# CONFIG_BLK_DEV_RAM is not set
273CONFIG_BLK_DEV_RAM_COUNT=16 291CONFIG_BLK_DEV_RAM_COUNT=16
274CONFIG_INITRAMFS_SOURCE="" 292# CONFIG_LBD is not set
275# CONFIG_CDROM_PKTCDVD is not set 293# CONFIG_CDROM_PKTCDVD is not set
276 294
277# 295#
@@ -291,6 +309,7 @@ CONFIG_IOSCHED_NOOP=y
291# 309#
292# SCSI device support 310# SCSI device support
293# 311#
312CONFIG_RAID_ATTRS=y
294# CONFIG_SCSI is not set 313# CONFIG_SCSI is not set
295 314
296# 315#
@@ -331,6 +350,21 @@ CONFIG_NETDEVICES=y
331# CONFIG_ARCNET is not set 350# CONFIG_ARCNET is not set
332 351
333# 352#
353# PHY device support
354#
355CONFIG_PHYLIB=y
356CONFIG_PHYCONTROL=y
357
358#
359# MII PHY device drivers
360#
361CONFIG_MARVELL_PHY=y
362CONFIG_DAVICOM_PHY=y
363CONFIG_QSEMI_PHY=y
364CONFIG_LXT_PHY=y
365CONFIG_CICADA_PHY=y
366
367#
334# Ethernet (10 or 100Mbit) 368# Ethernet (10 or 100Mbit)
335# 369#
336CONFIG_NET_ETHERNET=y 370CONFIG_NET_ETHERNET=y
@@ -470,7 +504,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y
470# I2C support 504# I2C support
471# 505#
472# CONFIG_I2C is not set 506# CONFIG_I2C is not set
473# CONFIG_I2C_SENSOR is not set
474 507
475# 508#
476# Dallas's 1-wire bus 509# Dallas's 1-wire bus
@@ -481,12 +514,17 @@ CONFIG_SERIAL_CORE_CONSOLE=y
481# Hardware Monitoring support 514# Hardware Monitoring support
482# 515#
483# CONFIG_HWMON is not set 516# CONFIG_HWMON is not set
517# CONFIG_HWMON_VID is not set
484 518
485# 519#
486# Misc devices 520# Misc devices
487# 521#
488 522
489# 523#
524# Multimedia Capabilities Port drivers
525#
526
527#
490# Multimedia devices 528# Multimedia devices
491# 529#
492# CONFIG_VIDEO_DEV is not set 530# CONFIG_VIDEO_DEV is not set
@@ -532,7 +570,6 @@ CONFIG_DUMMY_CONSOLE=y
532# 570#
533# InfiniBand support 571# InfiniBand support
534# 572#
535# CONFIG_INFINIBAND is not set
536 573
537# 574#
538# SN Devices 575# SN Devices
@@ -547,10 +584,6 @@ CONFIG_DUMMY_CONSOLE=y
547# CONFIG_REISERFS_FS is not set 584# CONFIG_REISERFS_FS is not set
548# CONFIG_JFS_FS is not set 585# CONFIG_JFS_FS is not set
549# CONFIG_FS_POSIX_ACL is not set 586# CONFIG_FS_POSIX_ACL is not set
550
551#
552# XFS support
553#
554# CONFIG_XFS_FS is not set 587# CONFIG_XFS_FS is not set
555# CONFIG_MINIX_FS is not set 588# CONFIG_MINIX_FS is not set
556# CONFIG_ROMFS_FS is not set 589# CONFIG_ROMFS_FS is not set
@@ -559,6 +592,7 @@ CONFIG_INOTIFY=y
559# CONFIG_DNOTIFY is not set 592# CONFIG_DNOTIFY is not set
560# CONFIG_AUTOFS_FS is not set 593# CONFIG_AUTOFS_FS is not set
561# CONFIG_AUTOFS4_FS is not set 594# CONFIG_AUTOFS4_FS is not set
595CONFIG_FUSE_FS=y
562 596
563# 597#
564# CD-ROM/DVD Filesystems 598# CD-ROM/DVD Filesystems
@@ -576,11 +610,13 @@ CONFIG_INOTIFY=y
576# 610#
577# Pseudo filesystems 611# Pseudo filesystems
578# 612#
579# CONFIG_PROC_FS is not set 613CONFIG_PROC_FS=y
614CONFIG_PROC_KCORE=y
580# CONFIG_SYSFS is not set 615# CONFIG_SYSFS is not set
581# CONFIG_TMPFS is not set 616# CONFIG_TMPFS is not set
582# CONFIG_HUGETLB_PAGE is not set 617# CONFIG_HUGETLB_PAGE is not set
583CONFIG_RAMFS=y 618CONFIG_RAMFS=y
619CONFIG_RELAYFS_FS=y
584 620
585# 621#
586# Miscellaneous filesystems 622# Miscellaneous filesystems
@@ -634,12 +670,35 @@ CONFIG_CMDLINE="console=ttyS0 debug ip=172.20.0.2:172.20.0.1::255.255.0.0"
634# Security options 670# Security options
635# 671#
636# CONFIG_KEYS is not set 672# CONFIG_KEYS is not set
637# CONFIG_SECURITY is not set
638 673
639# 674#
640# Cryptographic options 675# Cryptographic options
641# 676#
642# CONFIG_CRYPTO is not set 677CONFIG_CRYPTO=y
678CONFIG_CRYPTO_HMAC=y
679CONFIG_CRYPTO_NULL=y
680CONFIG_CRYPTO_MD4=y
681CONFIG_CRYPTO_MD5=y
682CONFIG_CRYPTO_SHA1=y
683CONFIG_CRYPTO_SHA256=y
684CONFIG_CRYPTO_SHA512=y
685CONFIG_CRYPTO_WP512=y
686CONFIG_CRYPTO_TGR192=y
687CONFIG_CRYPTO_DES=y
688CONFIG_CRYPTO_BLOWFISH=y
689CONFIG_CRYPTO_TWOFISH=y
690CONFIG_CRYPTO_SERPENT=y
691CONFIG_CRYPTO_AES=y
692CONFIG_CRYPTO_CAST5=y
693CONFIG_CRYPTO_CAST6=y
694CONFIG_CRYPTO_TEA=y
695CONFIG_CRYPTO_ARC4=y
696CONFIG_CRYPTO_KHAZAD=y
697CONFIG_CRYPTO_ANUBIS=y
698CONFIG_CRYPTO_DEFLATE=y
699CONFIG_CRYPTO_MICHAEL_MIC=y
700CONFIG_CRYPTO_CRC32C=y
701# CONFIG_CRYPTO_TEST is not set
643 702
644# 703#
645# Hardware crypto devices 704# Hardware crypto devices
@@ -649,7 +708,8 @@ CONFIG_CMDLINE="console=ttyS0 debug ip=172.20.0.2:172.20.0.1::255.255.0.0"
649# Library routines 708# Library routines
650# 709#
651# CONFIG_CRC_CCITT is not set 710# CONFIG_CRC_CCITT is not set
711CONFIG_CRC16=y
652CONFIG_CRC32=y 712CONFIG_CRC32=y
653# CONFIG_LIBCRC32C is not set 713CONFIG_LIBCRC32C=y
654CONFIG_GENERIC_HARDIRQS=y 714CONFIG_ZLIB_INFLATE=y
655CONFIG_GENERIC_IRQ_PROBE=y 715CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/mips/configs/rbhma4500_defconfig b/arch/mips/configs/rbhma4500_defconfig
new file mode 100644
index 000000000000..2bc61ca4ba08
--- /dev/null
+++ b/arch/mips/configs/rbhma4500_defconfig
@@ -0,0 +1,1259 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.14-rc2
4# Thu Oct 20 22:26:59 2005
5#
6CONFIG_MIPS=y
7
8#
9# Code maturity level options
10#
11CONFIG_EXPERIMENTAL=y
12CONFIG_CLEAN_COMPILE=y
13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
15
16#
17# General setup
18#
19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
21CONFIG_SWAP=y
22CONFIG_SYSVIPC=y
23# CONFIG_POSIX_MQUEUE is not set
24# CONFIG_BSD_PROCESS_ACCT is not set
25CONFIG_SYSCTL=y
26# CONFIG_AUDIT is not set
27CONFIG_HOTPLUG=y
28# CONFIG_KOBJECT_UEVENT is not set
29CONFIG_IKCONFIG=y
30CONFIG_IKCONFIG_PROC=y
31CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_EXTRA_PASS is not set
35CONFIG_PRINTK=y
36CONFIG_BUG=y
37CONFIG_BASE_FULL=y
38# CONFIG_FUTEX is not set
39# CONFIG_EPOLL is not set
40# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
41CONFIG_SHMEM=y
42CONFIG_CC_ALIGN_FUNCTIONS=0
43CONFIG_CC_ALIGN_LABELS=0
44CONFIG_CC_ALIGN_LOOPS=0
45CONFIG_CC_ALIGN_JUMPS=0
46# CONFIG_TINY_SHMEM is not set
47CONFIG_BASE_SMALL=0
48
49#
50# Loadable module support
51#
52CONFIG_MODULES=y
53# CONFIG_MODULE_UNLOAD is not set
54CONFIG_OBSOLETE_MODPARM=y
55# CONFIG_MODVERSIONS is not set
56# CONFIG_MODULE_SRCVERSION_ALL is not set
57CONFIG_KMOD=y
58
59#
60# Machine selection
61#
62# CONFIG_MIPS_MTX1 is not set
63# CONFIG_MIPS_BOSPORUS is not set
64# CONFIG_MIPS_PB1000 is not set
65# CONFIG_MIPS_PB1100 is not set
66# CONFIG_MIPS_PB1500 is not set
67# CONFIG_MIPS_PB1550 is not set
68# CONFIG_MIPS_PB1200 is not set
69# CONFIG_MIPS_DB1000 is not set
70# CONFIG_MIPS_DB1100 is not set
71# CONFIG_MIPS_DB1500 is not set
72# CONFIG_MIPS_DB1550 is not set
73# CONFIG_MIPS_DB1200 is not set
74# CONFIG_MIPS_MIRAGE is not set
75# CONFIG_MIPS_COBALT is not set
76# CONFIG_MACH_DECSTATION is not set
77# CONFIG_MIPS_EV64120 is not set
78# CONFIG_MIPS_EV96100 is not set
79# CONFIG_MIPS_IVR is not set
80# CONFIG_MIPS_ITE8172 is not set
81# CONFIG_MACH_JAZZ is not set
82# CONFIG_LASAT is not set
83# CONFIG_MIPS_ATLAS is not set
84# CONFIG_MIPS_MALTA is not set
85# CONFIG_MIPS_SEAD is not set
86# CONFIG_MIPS_SIM is not set
87# CONFIG_MOMENCO_JAGUAR_ATX is not set
88# CONFIG_MOMENCO_OCELOT is not set
89# CONFIG_MOMENCO_OCELOT_3 is not set
90# CONFIG_MOMENCO_OCELOT_C is not set
91# CONFIG_MOMENCO_OCELOT_G is not set
92# CONFIG_MIPS_XXS1500 is not set
93# CONFIG_PNX8550_V2PCI is not set
94# CONFIG_PNX8550_JBS is not set
95# CONFIG_DDB5074 is not set
96# CONFIG_DDB5476 is not set
97# CONFIG_DDB5477 is not set
98# CONFIG_MACH_VR41XX is not set
99# CONFIG_PMC_YOSEMITE is not set
100# CONFIG_QEMU is not set
101# CONFIG_SGI_IP22 is not set
102# CONFIG_SGI_IP27 is not set
103# CONFIG_SGI_IP32 is not set
104# CONFIG_SIBYTE_BIGSUR is not set
105# CONFIG_SIBYTE_SWARM is not set
106# CONFIG_SIBYTE_SENTOSA is not set
107# CONFIG_SIBYTE_RHONE is not set
108# CONFIG_SIBYTE_CARMEL is not set
109# CONFIG_SIBYTE_PTSWARM is not set
110# CONFIG_SIBYTE_LITTLESUR is not set
111# CONFIG_SIBYTE_CRHINE is not set
112# CONFIG_SIBYTE_CRHONE is not set
113# CONFIG_SNI_RM200_PCI is not set
114# CONFIG_TOSHIBA_JMR3927 is not set
115# CONFIG_TOSHIBA_RBTX4927 is not set
116CONFIG_TOSHIBA_RBTX4938=y
117
118#
119# Multiplex Pin Select
120#
121CONFIG_TOSHIBA_RBTX4938_MPLEX_PIO58_61=y
122# CONFIG_TOSHIBA_RBTX4938_MPLEX_NAND is not set
123# CONFIG_TOSHIBA_RBTX4938_MPLEX_ATA is not set
124CONFIG_RWSEM_GENERIC_SPINLOCK=y
125CONFIG_GENERIC_CALIBRATE_DELAY=y
126CONFIG_DMA_NONCOHERENT=y
127CONFIG_DMA_NEED_PCI_MAP_STATE=y
128CONFIG_GENERIC_ISA_DMA=y
129CONFIG_I8259=y
130# CONFIG_CPU_BIG_ENDIAN is not set
131CONFIG_CPU_LITTLE_ENDIAN=y
132CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
133CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
134CONFIG_SWAP_IO_SPACE=y
135CONFIG_MIPS_L1_CACHE_SHIFT=5
136CONFIG_HAVE_STD_PC_SERIAL_PORT=y
137CONFIG_TOSHIBA_BOARDS=y
138
139#
140# CPU selection
141#
142# CONFIG_CPU_MIPS32_R1 is not set
143# CONFIG_CPU_MIPS32_R2 is not set
144# CONFIG_CPU_MIPS64_R1 is not set
145# CONFIG_CPU_MIPS64_R2 is not set
146# CONFIG_CPU_R3000 is not set
147# CONFIG_CPU_TX39XX is not set
148# CONFIG_CPU_VR41XX is not set
149# CONFIG_CPU_R4300 is not set
150# CONFIG_CPU_R4X00 is not set
151CONFIG_CPU_TX49XX=y
152# CONFIG_CPU_R5000 is not set
153# CONFIG_CPU_R5432 is not set
154# CONFIG_CPU_R6000 is not set
155# CONFIG_CPU_NEVADA is not set
156# CONFIG_CPU_R8000 is not set
157# CONFIG_CPU_R10000 is not set
158# CONFIG_CPU_RM7000 is not set
159# CONFIG_CPU_RM9000 is not set
160# CONFIG_CPU_SB1 is not set
161CONFIG_SYS_HAS_CPU_TX49XX=y
162CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
163CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
164CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
165
166#
167# Kernel type
168#
169CONFIG_32BIT=y
170# CONFIG_64BIT is not set
171CONFIG_PAGE_SIZE_4KB=y
172# CONFIG_PAGE_SIZE_8KB is not set
173# CONFIG_PAGE_SIZE_16KB is not set
174# CONFIG_PAGE_SIZE_64KB is not set
175# CONFIG_MIPS_MT is not set
176CONFIG_CPU_ADVANCED=y
177CONFIG_CPU_HAS_LLSC=y
178CONFIG_CPU_HAS_LLDSCD=y
179CONFIG_CPU_HAS_WB=y
180CONFIG_CPU_HAS_SYNC=y
181CONFIG_GENERIC_HARDIRQS=y
182CONFIG_GENERIC_IRQ_PROBE=y
183CONFIG_ARCH_FLATMEM_ENABLE=y
184CONFIG_SELECT_MEMORY_MODEL=y
185CONFIG_FLATMEM_MANUAL=y
186# CONFIG_DISCONTIGMEM_MANUAL is not set
187# CONFIG_SPARSEMEM_MANUAL is not set
188CONFIG_FLATMEM=y
189CONFIG_FLAT_NODE_MEM_MAP=y
190# CONFIG_SPARSEMEM_STATIC is not set
191CONFIG_PREEMPT_NONE=y
192# CONFIG_PREEMPT_VOLUNTARY is not set
193# CONFIG_PREEMPT is not set
194
195#
196# Bus options (PCI, PCMCIA, EISA, ISA, TC)
197#
198CONFIG_HW_HAS_PCI=y
199CONFIG_PCI=y
200# CONFIG_PCI_LEGACY_PROC is not set
201CONFIG_ISA=y
202CONFIG_MMU=y
203
204#
205# PCCARD (PCMCIA/CardBus) support
206#
207# CONFIG_PCCARD is not set
208
209#
210# PCI Hotplug Support
211#
212# CONFIG_HOTPLUG_PCI is not set
213
214#
215# Executable file formats
216#
217CONFIG_BINFMT_ELF=y
218# CONFIG_BINFMT_MISC is not set
219CONFIG_TRAD_SIGNALS=y
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
232# CONFIG_NET_KEY is not set
233CONFIG_INET=y
234CONFIG_IP_MULTICAST=y
235# CONFIG_IP_ADVANCED_ROUTER is not set
236CONFIG_IP_FIB_HASH=y
237CONFIG_IP_PNP=y
238# CONFIG_IP_PNP_DHCP is not set
239CONFIG_IP_PNP_BOOTP=y
240# CONFIG_IP_PNP_RARP is not set
241# CONFIG_NET_IPIP is not set
242# CONFIG_NET_IPGRE is not set
243# CONFIG_IP_MROUTE 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_TUNNEL is not set
250CONFIG_INET_DIAG=y
251CONFIG_INET_TCP_DIAG=y
252# CONFIG_TCP_CONG_ADVANCED is not set
253CONFIG_TCP_CONG_BIC=y
254
255#
256# IP: Virtual Server Configuration
257#
258# CONFIG_IP_VS is not set
259CONFIG_IPV6=m
260# CONFIG_IPV6_PRIVACY is not set
261# CONFIG_INET6_AH is not set
262# CONFIG_INET6_ESP is not set
263# CONFIG_INET6_IPCOMP is not set
264# CONFIG_INET6_TUNNEL is not set
265# CONFIG_IPV6_TUNNEL is not set
266CONFIG_NETFILTER=y
267# CONFIG_NETFILTER_DEBUG is not set
268CONFIG_NETFILTER_NETLINK=m
269CONFIG_NETFILTER_NETLINK_QUEUE=m
270CONFIG_NETFILTER_NETLINK_LOG=m
271
272#
273# IP: Netfilter Configuration
274#
275# CONFIG_IP_NF_CONNTRACK is not set
276CONFIG_IP_NF_PPTP=m
277# CONFIG_IP_NF_QUEUE is not set
278# CONFIG_IP_NF_IPTABLES is not set
279# CONFIG_IP_NF_ARPTABLES is not set
280
281#
282# IPv6: Netfilter Configuration (EXPERIMENTAL)
283#
284# CONFIG_IP6_NF_QUEUE is not set
285# CONFIG_IP6_NF_IPTABLES is not set
286
287#
288# DCCP Configuration (EXPERIMENTAL)
289#
290# CONFIG_IP_DCCP is not set
291
292#
293# SCTP Configuration (EXPERIMENTAL)
294#
295# CONFIG_IP_SCTP is not set
296# CONFIG_ATM is not set
297# CONFIG_BRIDGE is not set
298# CONFIG_VLAN_8021Q is not set
299# CONFIG_DECNET is not set
300# CONFIG_LLC2 is not set
301# CONFIG_IPX is not set
302# CONFIG_ATALK is not set
303# CONFIG_X25 is not set
304# CONFIG_LAPB is not set
305# CONFIG_NET_DIVERT is not set
306# CONFIG_ECONET is not set
307# CONFIG_WAN_ROUTER is not set
308# CONFIG_NET_SCHED is not set
309# CONFIG_NET_CLS_ROUTE is not set
310
311#
312# Network testing
313#
314# CONFIG_NET_PKTGEN is not set
315# CONFIG_HAMRADIO is not set
316# CONFIG_IRDA is not set
317# CONFIG_BT is not set
318CONFIG_IEEE80211=m
319# CONFIG_IEEE80211_DEBUG is not set
320CONFIG_IEEE80211_CRYPT_WEP=m
321CONFIG_IEEE80211_CRYPT_CCMP=m
322CONFIG_IEEE80211_CRYPT_TKIP=m
323
324#
325# Device Drivers
326#
327
328#
329# Generic Driver Options
330#
331CONFIG_STANDALONE=y
332CONFIG_PREVENT_FIRMWARE_BUILD=y
333CONFIG_FW_LOADER=m
334
335#
336# Connector - unified userspace <-> kernelspace linker
337#
338CONFIG_CONNECTOR=m
339
340#
341# Memory Technology Devices (MTD)
342#
343CONFIG_MTD=y
344# CONFIG_MTD_DEBUG is not set
345# CONFIG_MTD_CONCAT is not set
346CONFIG_MTD_PARTITIONS=y
347# CONFIG_MTD_REDBOOT_PARTS is not set
348# CONFIG_MTD_CMDLINE_PARTS is not set
349
350#
351# User Modules And Translation Layers
352#
353CONFIG_MTD_CHAR=y
354CONFIG_MTD_BLOCK=y
355# CONFIG_FTL is not set
356# CONFIG_NFTL is not set
357# CONFIG_INFTL is not set
358
359#
360# RAM/ROM/Flash chip drivers
361#
362CONFIG_MTD_CFI=y
363# CONFIG_MTD_JEDECPROBE is not set
364CONFIG_MTD_GEN_PROBE=y
365# CONFIG_MTD_CFI_ADV_OPTIONS is not set
366CONFIG_MTD_MAP_BANK_WIDTH_1=y
367CONFIG_MTD_MAP_BANK_WIDTH_2=y
368CONFIG_MTD_MAP_BANK_WIDTH_4=y
369# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
370# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
371# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
372CONFIG_MTD_CFI_I1=y
373CONFIG_MTD_CFI_I2=y
374# CONFIG_MTD_CFI_I4 is not set
375# CONFIG_MTD_CFI_I8 is not set
376CONFIG_MTD_CFI_INTELEXT=y
377CONFIG_MTD_CFI_AMDSTD=y
378CONFIG_MTD_CFI_AMDSTD_RETRY=0
379# CONFIG_MTD_CFI_STAA is not set
380CONFIG_MTD_CFI_UTIL=y
381# CONFIG_MTD_RAM is not set
382# CONFIG_MTD_ROM is not set
383# CONFIG_MTD_ABSENT is not set
384
385#
386# Mapping drivers for chip access
387#
388# CONFIG_MTD_COMPLEX_MAPPINGS is not set
389# CONFIG_MTD_PHYSMAP is not set
390# CONFIG_MTD_PLATRAM is not set
391
392#
393# Self-contained MTD device drivers
394#
395# CONFIG_MTD_PMC551 is not set
396# CONFIG_MTD_SLRAM is not set
397# CONFIG_MTD_PHRAM is not set
398# CONFIG_MTD_MTDRAM is not set
399# CONFIG_MTD_BLKMTD is not set
400# CONFIG_MTD_BLOCK2MTD is not set
401
402#
403# Disk-On-Chip Device Drivers
404#
405# CONFIG_MTD_DOC2000 is not set
406# CONFIG_MTD_DOC2001 is not set
407# CONFIG_MTD_DOC2001PLUS is not set
408
409#
410# NAND Flash Device Drivers
411#
412# CONFIG_MTD_NAND is not set
413
414#
415# Parallel port support
416#
417# CONFIG_PARPORT is not set
418
419#
420# Plug and Play support
421#
422# CONFIG_PNP is not set
423
424#
425# Block devices
426#
427# CONFIG_BLK_CPQ_DA is not set
428# CONFIG_BLK_CPQ_CISS_DA is not set
429# CONFIG_BLK_DEV_DAC960 is not set
430# CONFIG_BLK_DEV_UMEM is not set
431# CONFIG_BLK_DEV_COW_COMMON is not set
432CONFIG_BLK_DEV_LOOP=y
433# CONFIG_BLK_DEV_CRYPTOLOOP is not set
434CONFIG_BLK_DEV_NBD=m
435# CONFIG_BLK_DEV_SX8 is not set
436# CONFIG_BLK_DEV_UB is not set
437CONFIG_BLK_DEV_RAM=y
438CONFIG_BLK_DEV_RAM_COUNT=16
439CONFIG_BLK_DEV_RAM_SIZE=8192
440CONFIG_BLK_DEV_INITRD=y
441# CONFIG_LBD is not set
442# CONFIG_CDROM_PKTCDVD is not set
443
444#
445# IO Schedulers
446#
447CONFIG_IOSCHED_NOOP=y
448CONFIG_IOSCHED_AS=y
449CONFIG_IOSCHED_DEADLINE=y
450CONFIG_IOSCHED_CFQ=y
451# CONFIG_ATA_OVER_ETH is not set
452
453#
454# ATA/ATAPI/MFM/RLL support
455#
456CONFIG_IDE=y
457CONFIG_BLK_DEV_IDE=y
458
459#
460# Please see Documentation/ide.txt for help/info on IDE drives
461#
462# CONFIG_BLK_DEV_IDE_SATA is not set
463CONFIG_BLK_DEV_IDEDISK=y
464# CONFIG_IDEDISK_MULTI_MODE is not set
465CONFIG_BLK_DEV_IDECD=y
466# CONFIG_BLK_DEV_IDETAPE is not set
467# CONFIG_BLK_DEV_IDEFLOPPY is not set
468# CONFIG_IDE_TASK_IOCTL is not set
469
470#
471# IDE chipset support/bugfixes
472#
473CONFIG_IDE_GENERIC=y
474CONFIG_BLK_DEV_IDEPCI=y
475CONFIG_IDEPCI_SHARE_IRQ=y
476# CONFIG_BLK_DEV_OFFBOARD is not set
477# CONFIG_BLK_DEV_GENERIC is not set
478# CONFIG_BLK_DEV_OPTI621 is not set
479CONFIG_BLK_DEV_IDEDMA_PCI=y
480# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
481# CONFIG_IDEDMA_PCI_AUTO is not set
482# CONFIG_BLK_DEV_AEC62XX is not set
483# CONFIG_BLK_DEV_ALI15X3 is not set
484# CONFIG_BLK_DEV_AMD74XX is not set
485# CONFIG_BLK_DEV_CMD64X is not set
486# CONFIG_BLK_DEV_TRIFLEX is not set
487# CONFIG_BLK_DEV_CY82C693 is not set
488# CONFIG_BLK_DEV_CS5520 is not set
489# CONFIG_BLK_DEV_CS5530 is not set
490# CONFIG_BLK_DEV_HPT34X is not set
491# CONFIG_BLK_DEV_HPT366 is not set
492# CONFIG_BLK_DEV_SC1200 is not set
493# CONFIG_BLK_DEV_PIIX is not set
494# CONFIG_BLK_DEV_IT821X is not set
495# CONFIG_BLK_DEV_NS87415 is not set
496# CONFIG_BLK_DEV_PDC202XX_OLD is not set
497# CONFIG_BLK_DEV_PDC202XX_NEW is not set
498# CONFIG_BLK_DEV_SVWKS is not set
499# CONFIG_BLK_DEV_SIIMAGE is not set
500# CONFIG_BLK_DEV_SLC90E66 is not set
501# CONFIG_BLK_DEV_TRM290 is not set
502# CONFIG_BLK_DEV_VIA82CXXX is not set
503# CONFIG_IDE_ARM is not set
504# CONFIG_IDE_CHIPSETS is not set
505CONFIG_BLK_DEV_IDEDMA=y
506# CONFIG_IDEDMA_IVB is not set
507# CONFIG_IDEDMA_AUTO is not set
508# CONFIG_BLK_DEV_HD is not set
509
510#
511# SCSI device support
512#
513CONFIG_RAID_ATTRS=m
514# CONFIG_SCSI is not set
515
516#
517# Old CD-ROM drivers (not SCSI, not IDE)
518#
519# CONFIG_CD_NO_IDESCSI is not set
520
521#
522# Multi-device support (RAID and LVM)
523#
524# CONFIG_MD is not set
525
526#
527# Fusion MPT device support
528#
529# CONFIG_FUSION is not set
530
531#
532# IEEE 1394 (FireWire) support
533#
534# CONFIG_IEEE1394 is not set
535
536#
537# I2O device support
538#
539# CONFIG_I2O is not set
540
541#
542# Network device support
543#
544CONFIG_NETDEVICES=y
545# CONFIG_DUMMY is not set
546# CONFIG_BONDING is not set
547# CONFIG_EQUALIZER is not set
548CONFIG_TUN=m
549
550#
551# ARCnet devices
552#
553# CONFIG_ARCNET is not set
554
555#
556# PHY device support
557#
558CONFIG_PHYLIB=m
559CONFIG_PHYCONTROL=y
560
561#
562# MII PHY device drivers
563#
564CONFIG_MARVELL_PHY=m
565CONFIG_DAVICOM_PHY=m
566CONFIG_QSEMI_PHY=m
567CONFIG_LXT_PHY=m
568CONFIG_CICADA_PHY=m
569
570#
571# Ethernet (10 or 100Mbit)
572#
573CONFIG_NET_ETHERNET=y
574# CONFIG_MII is not set
575# CONFIG_HAPPYMEAL is not set
576# CONFIG_SUNGEM is not set
577# CONFIG_NET_VENDOR_3COM is not set
578# CONFIG_NET_VENDOR_SMC is not set
579# CONFIG_NET_VENDOR_RACAL is not set
580
581#
582# Tulip family network device support
583#
584# CONFIG_NET_TULIP is not set
585# CONFIG_AT1700 is not set
586# CONFIG_DEPCA is not set
587# CONFIG_HP100 is not set
588CONFIG_NET_ISA=y
589# CONFIG_E2100 is not set
590# CONFIG_EWRK3 is not set
591# CONFIG_EEXPRESS is not set
592# CONFIG_EEXPRESS_PRO is not set
593# CONFIG_HPLAN_PLUS is not set
594# CONFIG_HPLAN is not set
595# CONFIG_LP486E is not set
596# CONFIG_ETH16I is not set
597CONFIG_NE2000=y
598# CONFIG_SEEQ8005 is not set
599CONFIG_NET_PCI=y
600# CONFIG_PCNET32 is not set
601# CONFIG_AMD8111_ETH is not set
602# CONFIG_ADAPTEC_STARFIRE is not set
603# CONFIG_AC3200 is not set
604# CONFIG_APRICOT is not set
605# CONFIG_B44 is not set
606# CONFIG_FORCEDETH is not set
607# CONFIG_CS89x0 is not set
608# CONFIG_DGRS is not set
609# CONFIG_EEPRO100 is not set
610# CONFIG_E100 is not set
611# CONFIG_FEALNX is not set
612# CONFIG_NATSEMI is not set
613# CONFIG_NE2K_PCI is not set
614# CONFIG_8139CP is not set
615# CONFIG_8139TOO is not set
616# CONFIG_SIS900 is not set
617# CONFIG_EPIC100 is not set
618# CONFIG_SUNDANCE is not set
619# CONFIG_TLAN is not set
620# CONFIG_VIA_RHINE is not set
621# CONFIG_LAN_SAA9730 is not set
622# CONFIG_NET_POCKET is not set
623
624#
625# Ethernet (1000 Mbit)
626#
627# CONFIG_ACENIC is not set
628# CONFIG_DL2K is not set
629# CONFIG_E1000 is not set
630# CONFIG_NS83820 is not set
631# CONFIG_HAMACHI is not set
632# CONFIG_YELLOWFIN is not set
633# CONFIG_R8169 is not set
634# CONFIG_SIS190 is not set
635# CONFIG_SKGE is not set
636# CONFIG_SK98LIN is not set
637# CONFIG_VIA_VELOCITY is not set
638# CONFIG_TIGON3 is not set
639# CONFIG_BNX2 is not set
640
641#
642# Ethernet (10000 Mbit)
643#
644# CONFIG_CHELSIO_T1 is not set
645# CONFIG_IXGB is not set
646# CONFIG_S2IO is not set
647
648#
649# Token Ring devices
650#
651# CONFIG_TR is not set
652
653#
654# Wireless LAN (non-hamradio)
655#
656CONFIG_NET_RADIO=y
657
658#
659# Obsolete Wireless cards support (pre-802.11)
660#
661# CONFIG_STRIP is not set
662# CONFIG_ARLAN is not set
663# CONFIG_WAVELAN is not set
664
665#
666# Wireless 802.11b ISA/PCI cards support
667#
668# CONFIG_IPW2100 is not set
669# CONFIG_IPW_DEBUG is not set
670CONFIG_IPW2200=m
671# CONFIG_AIRO is not set
672# CONFIG_HERMES is not set
673# CONFIG_ATMEL is not set
674
675#
676# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
677#
678# CONFIG_PRISM54 is not set
679# CONFIG_HOSTAP is not set
680CONFIG_NET_WIRELESS=y
681
682#
683# Wan interfaces
684#
685# CONFIG_WAN is not set
686# CONFIG_FDDI is not set
687# CONFIG_HIPPI is not set
688CONFIG_PPP=m
689CONFIG_PPP_MULTILINK=y
690# CONFIG_PPP_FILTER is not set
691CONFIG_PPP_ASYNC=m
692CONFIG_PPP_SYNC_TTY=m
693CONFIG_PPP_DEFLATE=m
694# CONFIG_PPP_BSDCOMP is not set
695CONFIG_PPPOE=m
696# CONFIG_SLIP is not set
697# CONFIG_SHAPER is not set
698# CONFIG_NETCONSOLE is not set
699# CONFIG_NETPOLL is not set
700# CONFIG_NET_POLL_CONTROLLER is not set
701
702#
703# ISDN subsystem
704#
705# CONFIG_ISDN is not set
706
707#
708# Telephony Support
709#
710# CONFIG_PHONE is not set
711
712#
713# Input device support
714#
715CONFIG_INPUT=y
716
717#
718# Userland interfaces
719#
720CONFIG_INPUT_MOUSEDEV=y
721CONFIG_INPUT_MOUSEDEV_PSAUX=y
722CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
723CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
724# CONFIG_INPUT_JOYDEV is not set
725# CONFIG_INPUT_TSDEV is not set
726CONFIG_INPUT_EVDEV=y
727# CONFIG_INPUT_EVBUG is not set
728
729#
730# Input Device Drivers
731#
732CONFIG_INPUT_KEYBOARD=y
733CONFIG_KEYBOARD_ATKBD=y
734# CONFIG_KEYBOARD_SUNKBD is not set
735# CONFIG_KEYBOARD_LKKBD is not set
736# CONFIG_KEYBOARD_XTKBD is not set
737# CONFIG_KEYBOARD_NEWTON is not set
738CONFIG_INPUT_MOUSE=y
739CONFIG_MOUSE_PS2=y
740# CONFIG_MOUSE_SERIAL is not set
741# CONFIG_MOUSE_INPORT is not set
742# CONFIG_MOUSE_LOGIBM is not set
743# CONFIG_MOUSE_PC110PAD is not set
744# CONFIG_MOUSE_VSXXXAA is not set
745# CONFIG_INPUT_JOYSTICK is not set
746# CONFIG_INPUT_TOUCHSCREEN is not set
747# CONFIG_INPUT_MISC is not set
748
749#
750# Hardware I/O ports
751#
752CONFIG_SERIO=y
753CONFIG_SERIO_I8042=y
754CONFIG_SERIO_SERPORT=y
755# CONFIG_SERIO_PCIPS2 is not set
756CONFIG_SERIO_LIBPS2=y
757# CONFIG_SERIO_RAW is not set
758# CONFIG_GAMEPORT is not set
759
760#
761# Character devices
762#
763CONFIG_VT=y
764CONFIG_VT_CONSOLE=y
765CONFIG_HW_CONSOLE=y
766# CONFIG_SERIAL_NONSTANDARD is not set
767
768#
769# Serial drivers
770#
771# CONFIG_SERIAL_8250 is not set
772
773#
774# Non-8250 serial port support
775#
776CONFIG_HAS_TXX9_SERIAL=y
777# CONFIG_SERIAL_JSM is not set
778CONFIG_UNIX98_PTYS=y
779CONFIG_LEGACY_PTYS=y
780CONFIG_LEGACY_PTY_COUNT=256
781
782#
783# IPMI
784#
785# CONFIG_IPMI_HANDLER is not set
786
787#
788# Watchdog Cards
789#
790# CONFIG_WATCHDOG is not set
791# CONFIG_RTC is not set
792# CONFIG_GEN_RTC is not set
793# CONFIG_DTLK is not set
794# CONFIG_R3964 is not set
795# CONFIG_APPLICOM is not set
796
797#
798# Ftape, the floppy tape device driver
799#
800# CONFIG_DRM is not set
801# CONFIG_RAW_DRIVER is not set
802
803#
804# TPM devices
805#
806# CONFIG_TCG_TPM is not set
807
808#
809# I2C support
810#
811# CONFIG_I2C is not set
812
813#
814# Dallas's 1-wire bus
815#
816# CONFIG_W1 is not set
817
818#
819# Hardware Monitoring support
820#
821CONFIG_HWMON=y
822# CONFIG_HWMON_VID is not set
823# CONFIG_HWMON_DEBUG_CHIP is not set
824
825#
826# Misc devices
827#
828
829#
830# Multimedia Capabilities Port drivers
831#
832
833#
834# Multimedia devices
835#
836# CONFIG_VIDEO_DEV is not set
837
838#
839# Digital Video Broadcasting Devices
840#
841# CONFIG_DVB is not set
842
843#
844# Graphics support
845#
846CONFIG_FB=y
847CONFIG_FB_CFB_FILLRECT=y
848CONFIG_FB_CFB_COPYAREA=y
849CONFIG_FB_CFB_IMAGEBLIT=y
850CONFIG_FB_SOFT_CURSOR=y
851# CONFIG_FB_MACMODES is not set
852# CONFIG_FB_MODE_HELPERS is not set
853# CONFIG_FB_TILEBLITTING is not set
854# CONFIG_FB_CIRRUS is not set
855# CONFIG_FB_PM2 is not set
856# CONFIG_FB_CYBER2000 is not set
857# CONFIG_FB_ASILIANT is not set
858# CONFIG_FB_IMSTT is not set
859# CONFIG_FB_NVIDIA is not set
860# CONFIG_FB_RIVA is not set
861# CONFIG_FB_MATROX is not set
862# CONFIG_FB_RADEON_OLD is not set
863# CONFIG_FB_RADEON is not set
864# CONFIG_FB_ATY128 is not set
865CONFIG_FB_ATY=y
866CONFIG_FB_ATY_CT=y
867# CONFIG_FB_ATY_GENERIC_LCD is not set
868# CONFIG_FB_ATY_XL_INIT is not set
869# CONFIG_FB_ATY_GX is not set
870# CONFIG_FB_SAVAGE is not set
871# CONFIG_FB_SIS is not set
872# CONFIG_FB_NEOMAGIC is not set
873# CONFIG_FB_KYRO is not set
874# CONFIG_FB_3DFX is not set
875# CONFIG_FB_VOODOO1 is not set
876# CONFIG_FB_SMIVGX is not set
877# CONFIG_FB_CYBLA is not set
878# CONFIG_FB_TRIDENT is not set
879# CONFIG_FB_E1356 is not set
880# CONFIG_FB_S1D13XXX is not set
881# CONFIG_FB_VIRTUAL is not set
882
883#
884# Console display driver support
885#
886CONFIG_VGA_CONSOLE=y
887# CONFIG_MDA_CONSOLE is not set
888CONFIG_DUMMY_CONSOLE=y
889# CONFIG_FRAMEBUFFER_CONSOLE is not set
890
891#
892# Logo configuration
893#
894# CONFIG_LOGO is not set
895# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
896
897#
898# Sound
899#
900# CONFIG_SOUND is not set
901
902#
903# USB support
904#
905CONFIG_USB_ARCH_HAS_HCD=y
906CONFIG_USB_ARCH_HAS_OHCI=y
907CONFIG_USB=y
908# CONFIG_USB_DEBUG is not set
909
910#
911# Miscellaneous USB options
912#
913# CONFIG_USB_DEVICEFS is not set
914# CONFIG_USB_BANDWIDTH is not set
915# CONFIG_USB_DYNAMIC_MINORS is not set
916# CONFIG_USB_OTG is not set
917
918#
919# USB Host Controller Drivers
920#
921# CONFIG_USB_EHCI_HCD is not set
922# CONFIG_USB_ISP116X_HCD is not set
923# CONFIG_USB_OHCI_HCD is not set
924# CONFIG_USB_UHCI_HCD is not set
925# CONFIG_USB_SL811_HCD is not set
926
927#
928# USB Device Class drivers
929#
930# CONFIG_USB_BLUETOOTH_TTY is not set
931# CONFIG_USB_ACM is not set
932# CONFIG_USB_PRINTER is not set
933
934#
935# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
936#
937# CONFIG_USB_STORAGE is not set
938
939#
940# USB Input Devices
941#
942CONFIG_USB_HID=y
943CONFIG_USB_HIDINPUT=y
944# CONFIG_HID_FF is not set
945CONFIG_USB_HIDDEV=y
946# CONFIG_USB_AIPTEK is not set
947# CONFIG_USB_WACOM is not set
948# CONFIG_USB_ACECAD is not set
949# CONFIG_USB_KBTAB is not set
950# CONFIG_USB_POWERMATE is not set
951# CONFIG_USB_MTOUCH is not set
952# CONFIG_USB_ITMTOUCH is not set
953# CONFIG_USB_EGALAX is not set
954CONFIG_USB_YEALINK=m
955# CONFIG_USB_XPAD is not set
956# CONFIG_USB_ATI_REMOTE is not set
957# CONFIG_USB_KEYSPAN_REMOTE is not set
958# CONFIG_USB_APPLETOUCH is not set
959
960#
961# USB Imaging devices
962#
963# CONFIG_USB_MDC800 is not set
964
965#
966# USB Multimedia devices
967#
968# CONFIG_USB_DABUSB is not set
969
970#
971# Video4Linux support is needed for USB Multimedia device support
972#
973
974#
975# USB Network Adapters
976#
977# CONFIG_USB_CATC is not set
978# CONFIG_USB_KAWETH is not set
979# CONFIG_USB_PEGASUS is not set
980# CONFIG_USB_RTL8150 is not set
981# CONFIG_USB_USBNET is not set
982# CONFIG_USB_ZD1201 is not set
983CONFIG_USB_MON=y
984
985#
986# USB port drivers
987#
988
989#
990# USB Serial Converter support
991#
992# CONFIG_USB_SERIAL is not set
993
994#
995# USB Miscellaneous drivers
996#
997# CONFIG_USB_EMI62 is not set
998# CONFIG_USB_EMI26 is not set
999# CONFIG_USB_AUERSWALD is not set
1000# CONFIG_USB_RIO500 is not set
1001# CONFIG_USB_LEGOTOWER is not set
1002# CONFIG_USB_LCD is not set
1003# CONFIG_USB_LED is not set
1004# CONFIG_USB_CYTHERM is not set
1005# CONFIG_USB_PHIDGETKIT is not set
1006# CONFIG_USB_PHIDGETSERVO is not set
1007# CONFIG_USB_IDMOUSE is not set
1008# CONFIG_USB_LD is not set
1009
1010#
1011# USB DSL modem support
1012#
1013
1014#
1015# USB Gadget Support
1016#
1017# CONFIG_USB_GADGET is not set
1018
1019#
1020# MMC/SD Card support
1021#
1022# CONFIG_MMC is not set
1023
1024#
1025# InfiniBand support
1026#
1027# CONFIG_INFINIBAND is not set
1028
1029#
1030# SN Devices
1031#
1032
1033#
1034# File systems
1035#
1036CONFIG_EXT2_FS=y
1037# CONFIG_EXT2_FS_XATTR is not set
1038# CONFIG_EXT2_FS_XIP is not set
1039CONFIG_EXT3_FS=m
1040CONFIG_EXT3_FS_XATTR=y
1041# CONFIG_EXT3_FS_POSIX_ACL is not set
1042# CONFIG_EXT3_FS_SECURITY is not set
1043CONFIG_JBD=m
1044# CONFIG_JBD_DEBUG is not set
1045CONFIG_FS_MBCACHE=y
1046CONFIG_REISERFS_FS=m
1047# CONFIG_REISERFS_CHECK is not set
1048# CONFIG_REISERFS_PROC_INFO is not set
1049# CONFIG_REISERFS_FS_XATTR is not set
1050# CONFIG_JFS_FS is not set
1051# CONFIG_FS_POSIX_ACL is not set
1052CONFIG_XFS_FS=m
1053CONFIG_XFS_EXPORT=y
1054# CONFIG_XFS_QUOTA is not set
1055# CONFIG_XFS_SECURITY is not set
1056# CONFIG_XFS_POSIX_ACL is not set
1057# CONFIG_XFS_RT is not set
1058# CONFIG_MINIX_FS is not set
1059# CONFIG_ROMFS_FS is not set
1060CONFIG_INOTIFY=y
1061# CONFIG_QUOTA is not set
1062# CONFIG_DNOTIFY is not set
1063# CONFIG_AUTOFS_FS is not set
1064CONFIG_AUTOFS4_FS=m
1065CONFIG_FUSE_FS=m
1066
1067#
1068# CD-ROM/DVD Filesystems
1069#
1070CONFIG_ISO9660_FS=y
1071# CONFIG_JOLIET is not set
1072# CONFIG_ZISOFS is not set
1073# CONFIG_UDF_FS is not set
1074
1075#
1076# DOS/FAT/NT Filesystems
1077#
1078CONFIG_FAT_FS=y
1079# CONFIG_MSDOS_FS is not set
1080CONFIG_VFAT_FS=y
1081CONFIG_FAT_DEFAULT_CODEPAGE=437
1082CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1083# CONFIG_NTFS_FS is not set
1084
1085#
1086# Pseudo filesystems
1087#
1088CONFIG_PROC_FS=y
1089# CONFIG_PROC_KCORE is not set
1090CONFIG_SYSFS=y
1091CONFIG_TMPFS=y
1092# CONFIG_HUGETLB_PAGE is not set
1093CONFIG_RAMFS=y
1094CONFIG_RELAYFS_FS=m
1095
1096#
1097# Miscellaneous filesystems
1098#
1099# CONFIG_ADFS_FS is not set
1100# CONFIG_AFFS_FS is not set
1101# CONFIG_HFS_FS is not set
1102# CONFIG_HFSPLUS_FS is not set
1103# CONFIG_BEFS_FS is not set
1104# CONFIG_BFS_FS is not set
1105# CONFIG_EFS_FS is not set
1106# CONFIG_JFFS_FS is not set
1107CONFIG_JFFS2_FS=y
1108CONFIG_JFFS2_FS_DEBUG=0
1109CONFIG_JFFS2_FS_WRITEBUFFER=y
1110# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
1111CONFIG_JFFS2_ZLIB=y
1112CONFIG_JFFS2_RTIME=y
1113# CONFIG_JFFS2_RUBIN is not set
1114CONFIG_CRAMFS=y
1115# CONFIG_VXFS_FS is not set
1116# CONFIG_HPFS_FS is not set
1117# CONFIG_QNX4FS_FS is not set
1118# CONFIG_SYSV_FS is not set
1119# CONFIG_UFS_FS is not set
1120
1121#
1122# Network File Systems
1123#
1124CONFIG_NFS_FS=y
1125CONFIG_NFS_V3=y
1126# CONFIG_NFS_V3_ACL is not set
1127# CONFIG_NFS_V4 is not set
1128# CONFIG_NFS_DIRECTIO is not set
1129CONFIG_NFSD=m
1130# CONFIG_NFSD_V3 is not set
1131# CONFIG_NFSD_TCP is not set
1132CONFIG_ROOT_NFS=y
1133CONFIG_LOCKD=y
1134CONFIG_LOCKD_V4=y
1135CONFIG_EXPORTFS=m
1136CONFIG_NFS_COMMON=y
1137CONFIG_SUNRPC=y
1138# CONFIG_RPCSEC_GSS_KRB5 is not set
1139# CONFIG_RPCSEC_GSS_SPKM3 is not set
1140CONFIG_SMB_FS=m
1141# CONFIG_SMB_NLS_DEFAULT is not set
1142# CONFIG_CIFS is not set
1143# CONFIG_NCP_FS is not set
1144# CONFIG_CODA_FS is not set
1145# CONFIG_AFS_FS is not set
1146# CONFIG_9P_FS is not set
1147
1148#
1149# Partition Types
1150#
1151# CONFIG_PARTITION_ADVANCED is not set
1152CONFIG_MSDOS_PARTITION=y
1153
1154#
1155# Native Language Support
1156#
1157CONFIG_NLS=y
1158CONFIG_NLS_DEFAULT="iso8859-1"
1159# CONFIG_NLS_CODEPAGE_437 is not set
1160# CONFIG_NLS_CODEPAGE_737 is not set
1161# CONFIG_NLS_CODEPAGE_775 is not set
1162# CONFIG_NLS_CODEPAGE_850 is not set
1163# CONFIG_NLS_CODEPAGE_852 is not set
1164# CONFIG_NLS_CODEPAGE_855 is not set
1165# CONFIG_NLS_CODEPAGE_857 is not set
1166# CONFIG_NLS_CODEPAGE_860 is not set
1167# CONFIG_NLS_CODEPAGE_861 is not set
1168# CONFIG_NLS_CODEPAGE_862 is not set
1169# CONFIG_NLS_CODEPAGE_863 is not set
1170# CONFIG_NLS_CODEPAGE_864 is not set
1171# CONFIG_NLS_CODEPAGE_865 is not set
1172# CONFIG_NLS_CODEPAGE_866 is not set
1173# CONFIG_NLS_CODEPAGE_869 is not set
1174# CONFIG_NLS_CODEPAGE_936 is not set
1175# CONFIG_NLS_CODEPAGE_950 is not set
1176# CONFIG_NLS_CODEPAGE_932 is not set
1177# CONFIG_NLS_CODEPAGE_949 is not set
1178# CONFIG_NLS_CODEPAGE_874 is not set
1179# CONFIG_NLS_ISO8859_8 is not set
1180# CONFIG_NLS_CODEPAGE_1250 is not set
1181# CONFIG_NLS_CODEPAGE_1251 is not set
1182# CONFIG_NLS_ASCII is not set
1183# CONFIG_NLS_ISO8859_1 is not set
1184# CONFIG_NLS_ISO8859_2 is not set
1185# CONFIG_NLS_ISO8859_3 is not set
1186# CONFIG_NLS_ISO8859_4 is not set
1187# CONFIG_NLS_ISO8859_5 is not set
1188# CONFIG_NLS_ISO8859_6 is not set
1189# CONFIG_NLS_ISO8859_7 is not set
1190# CONFIG_NLS_ISO8859_9 is not set
1191# CONFIG_NLS_ISO8859_13 is not set
1192# CONFIG_NLS_ISO8859_14 is not set
1193# CONFIG_NLS_ISO8859_15 is not set
1194# CONFIG_NLS_KOI8_R is not set
1195# CONFIG_NLS_KOI8_U is not set
1196# CONFIG_NLS_UTF8 is not set
1197
1198#
1199# Profiling support
1200#
1201# CONFIG_PROFILING is not set
1202
1203#
1204# Kernel hacking
1205#
1206# CONFIG_PRINTK_TIME is not set
1207# CONFIG_DEBUG_KERNEL is not set
1208CONFIG_LOG_BUF_SHIFT=14
1209CONFIG_CROSSCOMPILE=y
1210CONFIG_CMDLINE=""
1211
1212#
1213# Security options
1214#
1215# CONFIG_KEYS is not set
1216# CONFIG_SECURITY is not set
1217
1218#
1219# Cryptographic options
1220#
1221CONFIG_CRYPTO=y
1222CONFIG_CRYPTO_HMAC=y
1223CONFIG_CRYPTO_NULL=m
1224CONFIG_CRYPTO_MD4=m
1225CONFIG_CRYPTO_MD5=m
1226CONFIG_CRYPTO_SHA1=m
1227CONFIG_CRYPTO_SHA256=m
1228CONFIG_CRYPTO_SHA512=m
1229CONFIG_CRYPTO_WP512=m
1230CONFIG_CRYPTO_TGR192=m
1231CONFIG_CRYPTO_DES=m
1232CONFIG_CRYPTO_BLOWFISH=m
1233CONFIG_CRYPTO_TWOFISH=m
1234CONFIG_CRYPTO_SERPENT=m
1235CONFIG_CRYPTO_AES=m
1236CONFIG_CRYPTO_CAST5=m
1237CONFIG_CRYPTO_CAST6=m
1238CONFIG_CRYPTO_TEA=m
1239CONFIG_CRYPTO_ARC4=m
1240CONFIG_CRYPTO_KHAZAD=m
1241CONFIG_CRYPTO_ANUBIS=m
1242CONFIG_CRYPTO_DEFLATE=m
1243CONFIG_CRYPTO_MICHAEL_MIC=m
1244CONFIG_CRYPTO_CRC32C=m
1245# CONFIG_CRYPTO_TEST is not set
1246
1247#
1248# Hardware crypto devices
1249#
1250
1251#
1252# Library routines
1253#
1254CONFIG_CRC_CCITT=m
1255CONFIG_CRC16=m
1256CONFIG_CRC32=y
1257CONFIG_LIBCRC32C=m
1258CONFIG_ZLIB_INFLATE=y
1259CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/mips/configs/rm200_defconfig b/arch/mips/configs/rm200_defconfig
index 17d4fce6c4c6..988a05824f01 100644
--- a/arch/mips/configs/rm200_defconfig
+++ b/arch/mips/configs/rm200_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:09 2005 4# Thu Oct 20 22:27:03 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,11 +11,13 @@ CONFIG_32BIT=y
14CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24CONFIG_POSIX_MQUEUE=y 23CONFIG_POSIX_MQUEUE=y
@@ -26,14 +25,17 @@ CONFIG_BSD_PROCESS_ACCT=y
26# CONFIG_BSD_PROCESS_ACCT_V3 is not set 25# CONFIG_BSD_PROCESS_ACCT_V3 is not set
27CONFIG_SYSCTL=y 26CONFIG_SYSCTL=y
28# CONFIG_AUDIT is not set 27# CONFIG_AUDIT is not set
29CONFIG_LOG_BUF_SHIFT=14 28CONFIG_HOTPLUG=y
30# CONFIG_HOTPLUG is not set
31CONFIG_KOBJECT_UEVENT=y 29CONFIG_KOBJECT_UEVENT=y
32CONFIG_IKCONFIG=y 30CONFIG_IKCONFIG=y
33CONFIG_IKCONFIG_PROC=y 31CONFIG_IKCONFIG_PROC=y
32CONFIG_INITRAMFS_SOURCE=""
34CONFIG_EMBEDDED=y 33CONFIG_EMBEDDED=y
35CONFIG_KALLSYMS=y 34CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_EXTRA_PASS is not set 35# CONFIG_KALLSYMS_EXTRA_PASS is not set
36CONFIG_PRINTK=y
37CONFIG_BUG=y
38CONFIG_BASE_FULL=y
37CONFIG_FUTEX=y 39CONFIG_FUTEX=y
38CONFIG_EPOLL=y 40CONFIG_EPOLL=y
39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 41# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -43,6 +45,7 @@ CONFIG_CC_ALIGN_LABELS=0
43CONFIG_CC_ALIGN_LOOPS=0 45CONFIG_CC_ALIGN_LOOPS=0
44CONFIG_CC_ALIGN_JUMPS=0 46CONFIG_CC_ALIGN_JUMPS=0
45# CONFIG_TINY_SHMEM is not set 47# CONFIG_TINY_SHMEM is not set
48CONFIG_BASE_SMALL=0
46 49
47# 50#
48# Loadable module support 51# Loadable module support
@@ -58,43 +61,73 @@ CONFIG_KMOD=y
58# 61#
59# Machine selection 62# Machine selection
60# 63#
61# CONFIG_MACH_JAZZ is not set 64# CONFIG_MIPS_MTX1 is not set
62# CONFIG_MACH_VR41XX is not set 65# CONFIG_MIPS_BOSPORUS is not set
63# CONFIG_TOSHIBA_JMR3927 is not set 66# CONFIG_MIPS_PB1000 is not set
67# CONFIG_MIPS_PB1100 is not set
68# CONFIG_MIPS_PB1500 is not set
69# CONFIG_MIPS_PB1550 is not set
70# CONFIG_MIPS_PB1200 is not set
71# CONFIG_MIPS_DB1000 is not set
72# CONFIG_MIPS_DB1100 is not set
73# CONFIG_MIPS_DB1500 is not set
74# CONFIG_MIPS_DB1550 is not set
75# CONFIG_MIPS_DB1200 is not set
76# CONFIG_MIPS_MIRAGE is not set
64# CONFIG_MIPS_COBALT is not set 77# CONFIG_MIPS_COBALT is not set
65# CONFIG_MACH_DECSTATION is not set 78# CONFIG_MACH_DECSTATION is not set
66# CONFIG_MIPS_EV64120 is not set 79# CONFIG_MIPS_EV64120 is not set
67# CONFIG_MIPS_EV96100 is not set 80# CONFIG_MIPS_EV96100 is not set
68# CONFIG_MIPS_IVR is not set 81# CONFIG_MIPS_IVR is not set
69# CONFIG_LASAT is not set
70# CONFIG_MIPS_ITE8172 is not set 82# CONFIG_MIPS_ITE8172 is not set
83# CONFIG_MACH_JAZZ is not set
84# CONFIG_LASAT is not set
71# CONFIG_MIPS_ATLAS is not set 85# CONFIG_MIPS_ATLAS is not set
72# CONFIG_MIPS_MALTA is not set 86# CONFIG_MIPS_MALTA is not set
73# CONFIG_MIPS_SEAD is not set 87# CONFIG_MIPS_SEAD is not set
88# CONFIG_MIPS_SIM is not set
89# CONFIG_MOMENCO_JAGUAR_ATX is not set
74# CONFIG_MOMENCO_OCELOT is not set 90# CONFIG_MOMENCO_OCELOT is not set
75# CONFIG_MOMENCO_OCELOT_G is not set
76# CONFIG_MOMENCO_OCELOT_C is not set
77# CONFIG_MOMENCO_OCELOT_3 is not set 91# CONFIG_MOMENCO_OCELOT_3 is not set
78# CONFIG_MOMENCO_JAGUAR_ATX is not set 92# CONFIG_MOMENCO_OCELOT_C is not set
79# CONFIG_PMC_YOSEMITE is not set 93# CONFIG_MOMENCO_OCELOT_G is not set
94# CONFIG_MIPS_XXS1500 is not set
95# CONFIG_PNX8550_V2PCI is not set
96# CONFIG_PNX8550_JBS is not set
80# CONFIG_DDB5074 is not set 97# CONFIG_DDB5074 is not set
81# CONFIG_DDB5476 is not set 98# CONFIG_DDB5476 is not set
82# CONFIG_DDB5477 is not set 99# CONFIG_DDB5477 is not set
83# CONFIG_NEC_OSPREY is not set 100# CONFIG_MACH_VR41XX is not set
101# CONFIG_PMC_YOSEMITE is not set
102# CONFIG_QEMU is not set
84# CONFIG_SGI_IP22 is not set 103# CONFIG_SGI_IP22 is not set
85# CONFIG_SOC_AU1X00 is not set 104# CONFIG_SGI_IP27 is not set
86# CONFIG_SIBYTE_SB1xxx_SOC is not set 105# CONFIG_SGI_IP32 is not set
106# CONFIG_SIBYTE_BIGSUR is not set
107# CONFIG_SIBYTE_SWARM is not set
108# CONFIG_SIBYTE_SENTOSA is not set
109# CONFIG_SIBYTE_RHONE is not set
110# CONFIG_SIBYTE_CARMEL is not set
111# CONFIG_SIBYTE_PTSWARM is not set
112# CONFIG_SIBYTE_LITTLESUR is not set
113# CONFIG_SIBYTE_CRHINE is not set
114# CONFIG_SIBYTE_CRHONE is not set
87CONFIG_SNI_RM200_PCI=y 115CONFIG_SNI_RM200_PCI=y
116# CONFIG_TOSHIBA_JMR3927 is not set
88# CONFIG_TOSHIBA_RBTX4927 is not set 117# CONFIG_TOSHIBA_RBTX4927 is not set
118# CONFIG_TOSHIBA_RBTX4938 is not set
89CONFIG_RWSEM_GENERIC_SPINLOCK=y 119CONFIG_RWSEM_GENERIC_SPINLOCK=y
90CONFIG_GENERIC_CALIBRATE_DELAY=y 120CONFIG_GENERIC_CALIBRATE_DELAY=y
91CONFIG_HAVE_DEC_LOCK=y
92CONFIG_ARC=y 121CONFIG_ARC=y
122CONFIG_ARCH_MAY_HAVE_PC_FDC=y
93CONFIG_DMA_NONCOHERENT=y 123CONFIG_DMA_NONCOHERENT=y
94CONFIG_DMA_NEED_PCI_MAP_STATE=y 124CONFIG_DMA_NEED_PCI_MAP_STATE=y
95CONFIG_GENERIC_ISA_DMA=y 125CONFIG_GENERIC_ISA_DMA=y
96CONFIG_I8259=y 126CONFIG_I8259=y
127# CONFIG_CPU_BIG_ENDIAN is not set
97CONFIG_CPU_LITTLE_ENDIAN=y 128CONFIG_CPU_LITTLE_ENDIAN=y
129CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
130CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
98CONFIG_ARC32=y 131CONFIG_ARC32=y
99CONFIG_BOOT_ELF32=y 132CONFIG_BOOT_ELF32=y
100CONFIG_MIPS_L1_CACHE_SHIFT=5 133CONFIG_MIPS_L1_CACHE_SHIFT=5
@@ -106,8 +139,10 @@ CONFIG_ARC_PROMLIB=y
106# 139#
107# CPU selection 140# CPU selection
108# 141#
109# CONFIG_CPU_MIPS32 is not set 142# CONFIG_CPU_MIPS32_R1 is not set
110# CONFIG_CPU_MIPS64 is not set 143# CONFIG_CPU_MIPS32_R2 is not set
144# CONFIG_CPU_MIPS64_R1 is not set
145# CONFIG_CPU_MIPS64_R2 is not set
111# CONFIG_CPU_R3000 is not set 146# CONFIG_CPU_R3000 is not set
112# CONFIG_CPU_TX39XX is not set 147# CONFIG_CPU_TX39XX is not set
113# CONFIG_CPU_VR41XX is not set 148# CONFIG_CPU_VR41XX is not set
@@ -123,24 +158,49 @@ CONFIG_CPU_R4X00=y
123# CONFIG_CPU_RM7000 is not set 158# CONFIG_CPU_RM7000 is not set
124# CONFIG_CPU_RM9000 is not set 159# CONFIG_CPU_RM9000 is not set
125# CONFIG_CPU_SB1 is not set 160# CONFIG_CPU_SB1 is not set
161CONFIG_SYS_HAS_CPU_R4X00=y
162CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
163CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
164CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
165CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
166
167#
168# Kernel type
169#
170CONFIG_32BIT=y
171# CONFIG_64BIT is not set
126CONFIG_PAGE_SIZE_4KB=y 172CONFIG_PAGE_SIZE_4KB=y
127# CONFIG_PAGE_SIZE_8KB is not set 173# CONFIG_PAGE_SIZE_8KB is not set
128# CONFIG_PAGE_SIZE_16KB is not set 174# CONFIG_PAGE_SIZE_16KB is not set
129# CONFIG_PAGE_SIZE_64KB is not set 175# CONFIG_PAGE_SIZE_64KB is not set
176# CONFIG_MIPS_MT is not set
130# CONFIG_64BIT_PHYS_ADDR is not set 177# CONFIG_64BIT_PHYS_ADDR is not set
131# CONFIG_CPU_ADVANCED is not set 178# CONFIG_CPU_ADVANCED is not set
132CONFIG_CPU_HAS_LLSC=y 179CONFIG_CPU_HAS_LLSC=y
133CONFIG_CPU_HAS_LLDSCD=y 180CONFIG_CPU_HAS_LLDSCD=y
134CONFIG_CPU_HAS_SYNC=y 181CONFIG_CPU_HAS_SYNC=y
182CONFIG_GENERIC_HARDIRQS=y
183CONFIG_GENERIC_IRQ_PROBE=y
184CONFIG_SYS_SUPPORTS_HIGHMEM=y
185CONFIG_ARCH_FLATMEM_ENABLE=y
186CONFIG_SELECT_MEMORY_MODEL=y
187CONFIG_FLATMEM_MANUAL=y
188# CONFIG_DISCONTIGMEM_MANUAL is not set
189# CONFIG_SPARSEMEM_MANUAL is not set
190CONFIG_FLATMEM=y
191CONFIG_FLAT_NODE_MEM_MAP=y
192# CONFIG_SPARSEMEM_STATIC is not set
193# CONFIG_PREEMPT_NONE is not set
194CONFIG_PREEMPT_VOLUNTARY=y
135# CONFIG_PREEMPT is not set 195# CONFIG_PREEMPT is not set
136 196
137# 197#
138# Bus options (PCI, PCMCIA, EISA, ISA, TC) 198# Bus options (PCI, PCMCIA, EISA, ISA, TC)
139# 199#
200CONFIG_HW_HAS_EISA=y
140CONFIG_HW_HAS_PCI=y 201CONFIG_HW_HAS_PCI=y
141CONFIG_PCI=y 202CONFIG_PCI=y
142CONFIG_PCI_LEGACY_PROC=y 203CONFIG_PCI_LEGACY_PROC=y
143# CONFIG_PCI_NAMES is not set
144CONFIG_ISA=y 204CONFIG_ISA=y
145# CONFIG_EISA is not set 205# CONFIG_EISA is not set
146CONFIG_MMU=y 206CONFIG_MMU=y
@@ -151,11 +211,6 @@ CONFIG_MMU=y
151# CONFIG_PCCARD is not set 211# CONFIG_PCCARD is not set
152 212
153# 213#
154# PC-card bridges
155#
156CONFIG_PCMCIA_PROBE=y
157
158#
159# PCI Hotplug Support 214# PCI Hotplug Support
160# 215#
161# CONFIG_HOTPLUG_PCI is not set 216# CONFIG_HOTPLUG_PCI is not set
@@ -168,240 +223,7 @@ CONFIG_BINFMT_MISC=m
168CONFIG_TRAD_SIGNALS=y 223CONFIG_TRAD_SIGNALS=y
169 224
170# 225#
171# Device Drivers 226# Networking
172#
173
174#
175# Generic Driver Options
176#
177CONFIG_STANDALONE=y
178CONFIG_PREVENT_FIRMWARE_BUILD=y
179# CONFIG_FW_LOADER is not set
180
181#
182# Memory Technology Devices (MTD)
183#
184# CONFIG_MTD is not set
185
186#
187# Parallel port support
188#
189CONFIG_PARPORT=m
190CONFIG_PARPORT_PC=m
191CONFIG_PARPORT_PC_CML1=m
192CONFIG_PARPORT_SERIAL=m
193# CONFIG_PARPORT_PC_FIFO is not set
194# CONFIG_PARPORT_PC_SUPERIO is not set
195# CONFIG_PARPORT_OTHER is not set
196CONFIG_PARPORT_1284=y
197
198#
199# Plug and Play support
200#
201# CONFIG_PNP is not set
202
203#
204# Block devices
205#
206CONFIG_BLK_DEV_FD=m
207# CONFIG_BLK_DEV_XD is not set
208CONFIG_PARIDE=m
209CONFIG_PARIDE_PARPORT=m
210
211#
212# Parallel IDE high-level drivers
213#
214CONFIG_PARIDE_PD=m
215CONFIG_PARIDE_PCD=m
216CONFIG_PARIDE_PF=m
217CONFIG_PARIDE_PT=m
218CONFIG_PARIDE_PG=m
219
220#
221# Parallel IDE protocol modules
222#
223CONFIG_PARIDE_ATEN=m
224CONFIG_PARIDE_BPCK=m
225CONFIG_PARIDE_BPCK6=m
226CONFIG_PARIDE_COMM=m
227CONFIG_PARIDE_DSTR=m
228CONFIG_PARIDE_FIT2=m
229CONFIG_PARIDE_FIT3=m
230CONFIG_PARIDE_EPAT=m
231# CONFIG_PARIDE_EPATC8 is not set
232CONFIG_PARIDE_EPIA=m
233CONFIG_PARIDE_FRIQ=m
234CONFIG_PARIDE_FRPW=m
235CONFIG_PARIDE_KBIC=m
236CONFIG_PARIDE_KTTI=m
237CONFIG_PARIDE_ON20=m
238CONFIG_PARIDE_ON26=m
239# CONFIG_BLK_CPQ_DA is not set
240# CONFIG_BLK_CPQ_CISS_DA is not set
241# CONFIG_BLK_DEV_DAC960 is not set
242# CONFIG_BLK_DEV_UMEM is not set
243# CONFIG_BLK_DEV_COW_COMMON is not set
244CONFIG_BLK_DEV_LOOP=m
245CONFIG_BLK_DEV_CRYPTOLOOP=m
246CONFIG_BLK_DEV_NBD=m
247CONFIG_BLK_DEV_SX8=m
248CONFIG_BLK_DEV_UB=m
249CONFIG_BLK_DEV_RAM=m
250CONFIG_BLK_DEV_RAM_COUNT=16
251CONFIG_BLK_DEV_RAM_SIZE=4096
252CONFIG_INITRAMFS_SOURCE=""
253# CONFIG_LBD is not set
254CONFIG_CDROM_PKTCDVD=m
255CONFIG_CDROM_PKTCDVD_BUFFERS=8
256# CONFIG_CDROM_PKTCDVD_WCACHE is not set
257
258#
259# IO Schedulers
260#
261CONFIG_IOSCHED_NOOP=y
262CONFIG_IOSCHED_AS=y
263CONFIG_IOSCHED_DEADLINE=y
264CONFIG_IOSCHED_CFQ=y
265CONFIG_ATA_OVER_ETH=m
266
267#
268# ATA/ATAPI/MFM/RLL support
269#
270# CONFIG_IDE is not set
271
272#
273# SCSI device support
274#
275CONFIG_SCSI=y
276CONFIG_SCSI_PROC_FS=y
277
278#
279# SCSI support type (disk, tape, CD-ROM)
280#
281CONFIG_BLK_DEV_SD=y
282CONFIG_CHR_DEV_ST=m
283# CONFIG_CHR_DEV_OSST is not set
284CONFIG_BLK_DEV_SR=m
285CONFIG_BLK_DEV_SR_VENDOR=y
286# CONFIG_CHR_DEV_SG is not set
287
288#
289# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
290#
291# CONFIG_SCSI_MULTI_LUN is not set
292CONFIG_SCSI_CONSTANTS=y
293# CONFIG_SCSI_LOGGING is not set
294
295#
296# SCSI Transport Attributes
297#
298CONFIG_SCSI_SPI_ATTRS=y
299# CONFIG_SCSI_FC_ATTRS is not set
300# CONFIG_SCSI_ISCSI_ATTRS is not set
301
302#
303# SCSI low-level drivers
304#
305# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
306# CONFIG_SCSI_3W_9XXX is not set
307# CONFIG_SCSI_7000FASST is not set
308# CONFIG_SCSI_ACARD is not set
309# CONFIG_SCSI_AHA152X is not set
310# CONFIG_SCSI_AHA1542 is not set
311# CONFIG_SCSI_AACRAID is not set
312# CONFIG_SCSI_AIC7XXX is not set
313# CONFIG_SCSI_AIC7XXX_OLD is not set
314# CONFIG_SCSI_AIC79XX is not set
315# CONFIG_SCSI_DPT_I2O is not set
316# CONFIG_SCSI_IN2000 is not set
317CONFIG_MEGARAID_NEWGEN=y
318CONFIG_MEGARAID_MM=m
319CONFIG_MEGARAID_MAILBOX=m
320# CONFIG_SCSI_SATA is not set
321# CONFIG_SCSI_BUSLOGIC is not set
322# CONFIG_SCSI_DMX3191D is not set
323# CONFIG_SCSI_DTC3280 is not set
324# CONFIG_SCSI_EATA is not set
325# CONFIG_SCSI_EATA_PIO is not set
326# CONFIG_SCSI_FUTURE_DOMAIN is not set
327# CONFIG_SCSI_GDTH is not set
328# CONFIG_SCSI_GENERIC_NCR5380 is not set
329# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
330# CONFIG_SCSI_IPS is not set
331# CONFIG_SCSI_INITIO is not set
332# CONFIG_SCSI_INIA100 is not set
333CONFIG_SCSI_PPA=m
334CONFIG_SCSI_IMM=m
335# CONFIG_SCSI_IZIP_EPP16 is not set
336# CONFIG_SCSI_IZIP_SLOW_CTR is not set
337# CONFIG_SCSI_NCR53C406A is not set
338CONFIG_SCSI_SYM53C8XX_2=y
339CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
340CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
341CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
342# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
343# CONFIG_SCSI_IPR is not set
344# CONFIG_SCSI_PAS16 is not set
345# CONFIG_SCSI_PSI240I is not set
346# CONFIG_SCSI_QLOGIC_FAS is not set
347# CONFIG_SCSI_QLOGIC_ISP is not set
348# CONFIG_SCSI_QLOGIC_FC is not set
349# CONFIG_SCSI_QLOGIC_1280 is not set
350CONFIG_SCSI_QLA2XXX=y
351# CONFIG_SCSI_QLA21XX is not set
352# CONFIG_SCSI_QLA22XX is not set
353# CONFIG_SCSI_QLA2300 is not set
354# CONFIG_SCSI_QLA2322 is not set
355# CONFIG_SCSI_QLA6312 is not set
356# CONFIG_SCSI_SYM53C416 is not set
357# CONFIG_SCSI_DC395x is not set
358# CONFIG_SCSI_DC390T is not set
359# CONFIG_SCSI_T128 is not set
360# CONFIG_SCSI_U14_34F is not set
361# CONFIG_SCSI_NSP32 is not set
362# CONFIG_SCSI_DEBUG is not set
363
364#
365# Old CD-ROM drivers (not SCSI, not IDE)
366#
367# CONFIG_CD_NO_IDESCSI is not set
368
369#
370# Multi-device support (RAID and LVM)
371#
372CONFIG_MD=y
373CONFIG_BLK_DEV_MD=m
374CONFIG_MD_LINEAR=m
375CONFIG_MD_RAID0=m
376CONFIG_MD_RAID1=m
377CONFIG_MD_RAID10=m
378CONFIG_MD_RAID5=m
379# CONFIG_MD_RAID6 is not set
380CONFIG_MD_MULTIPATH=m
381CONFIG_MD_FAULTY=m
382CONFIG_BLK_DEV_DM=m
383# CONFIG_DM_CRYPT is not set
384CONFIG_DM_SNAPSHOT=m
385CONFIG_DM_MIRROR=m
386CONFIG_DM_ZERO=m
387
388#
389# Fusion MPT device support
390#
391# CONFIG_FUSION is not set
392
393#
394# IEEE 1394 (FireWire) support
395#
396# CONFIG_IEEE1394 is not set
397
398#
399# I2O device support
400#
401# CONFIG_I2O is not set
402
403#
404# Networking support
405# 227#
406CONFIG_NET=y 228CONFIG_NET=y
407 229
@@ -410,12 +232,14 @@ CONFIG_NET=y
410# 232#
411CONFIG_PACKET=m 233CONFIG_PACKET=m
412CONFIG_PACKET_MMAP=y 234CONFIG_PACKET_MMAP=y
413CONFIG_NETLINK_DEV=m
414CONFIG_UNIX=y 235CONFIG_UNIX=y
236CONFIG_XFRM=y
237# CONFIG_XFRM_USER is not set
415CONFIG_NET_KEY=m 238CONFIG_NET_KEY=m
416CONFIG_INET=y 239CONFIG_INET=y
417CONFIG_IP_MULTICAST=y 240CONFIG_IP_MULTICAST=y
418# CONFIG_IP_ADVANCED_ROUTER is not set 241# CONFIG_IP_ADVANCED_ROUTER is not set
242CONFIG_IP_FIB_HASH=y
419# CONFIG_IP_PNP is not set 243# CONFIG_IP_PNP is not set
420CONFIG_NET_IPIP=m 244CONFIG_NET_IPIP=m
421CONFIG_NET_IPGRE=m 245CONFIG_NET_IPGRE=m
@@ -429,8 +253,10 @@ CONFIG_IP_PIMSM_V2=y
429# CONFIG_INET_ESP is not set 253# CONFIG_INET_ESP is not set
430# CONFIG_INET_IPCOMP is not set 254# CONFIG_INET_IPCOMP is not set
431CONFIG_INET_TUNNEL=m 255CONFIG_INET_TUNNEL=m
432CONFIG_IP_TCPDIAG=m 256CONFIG_INET_DIAG=y
433CONFIG_IP_TCPDIAG_IPV6=y 257CONFIG_INET_TCP_DIAG=y
258# CONFIG_TCP_CONG_ADVANCED is not set
259CONFIG_TCP_CONG_BIC=y
434 260
435# 261#
436# IP: Virtual Server Configuration 262# IP: Virtual Server Configuration
@@ -446,6 +272,9 @@ CONFIG_IPV6_TUNNEL=m
446CONFIG_NETFILTER=y 272CONFIG_NETFILTER=y
447# CONFIG_NETFILTER_DEBUG is not set 273# CONFIG_NETFILTER_DEBUG is not set
448CONFIG_BRIDGE_NETFILTER=y 274CONFIG_BRIDGE_NETFILTER=y
275CONFIG_NETFILTER_NETLINK=m
276CONFIG_NETFILTER_NETLINK_QUEUE=m
277CONFIG_NETFILTER_NETLINK_LOG=m
449 278
450# 279#
451# IP: Netfilter Configuration 280# IP: Netfilter Configuration
@@ -453,11 +282,15 @@ CONFIG_BRIDGE_NETFILTER=y
453CONFIG_IP_NF_CONNTRACK=m 282CONFIG_IP_NF_CONNTRACK=m
454# CONFIG_IP_NF_CT_ACCT is not set 283# CONFIG_IP_NF_CT_ACCT is not set
455CONFIG_IP_NF_CONNTRACK_MARK=y 284CONFIG_IP_NF_CONNTRACK_MARK=y
285CONFIG_IP_NF_CONNTRACK_EVENTS=y
286CONFIG_IP_NF_CONNTRACK_NETLINK=m
456CONFIG_IP_NF_CT_PROTO_SCTP=m 287CONFIG_IP_NF_CT_PROTO_SCTP=m
457CONFIG_IP_NF_FTP=m 288CONFIG_IP_NF_FTP=m
458CONFIG_IP_NF_IRC=m 289CONFIG_IP_NF_IRC=m
290# CONFIG_IP_NF_NETBIOS_NS is not set
459CONFIG_IP_NF_TFTP=m 291CONFIG_IP_NF_TFTP=m
460CONFIG_IP_NF_AMANDA=m 292CONFIG_IP_NF_AMANDA=m
293CONFIG_IP_NF_PPTP=m
461CONFIG_IP_NF_QUEUE=m 294CONFIG_IP_NF_QUEUE=m
462CONFIG_IP_NF_IPTABLES=m 295CONFIG_IP_NF_IPTABLES=m
463CONFIG_IP_NF_MATCH_LIMIT=m 296CONFIG_IP_NF_MATCH_LIMIT=m
@@ -482,9 +315,11 @@ CONFIG_IP_NF_MATCH_PHYSDEV=m
482CONFIG_IP_NF_MATCH_ADDRTYPE=m 315CONFIG_IP_NF_MATCH_ADDRTYPE=m
483CONFIG_IP_NF_MATCH_REALM=m 316CONFIG_IP_NF_MATCH_REALM=m
484CONFIG_IP_NF_MATCH_SCTP=m 317CONFIG_IP_NF_MATCH_SCTP=m
318CONFIG_IP_NF_MATCH_DCCP=m
485CONFIG_IP_NF_MATCH_COMMENT=m 319CONFIG_IP_NF_MATCH_COMMENT=m
486CONFIG_IP_NF_MATCH_CONNMARK=m 320CONFIG_IP_NF_MATCH_CONNMARK=m
487CONFIG_IP_NF_MATCH_HASHLIMIT=m 321CONFIG_IP_NF_MATCH_HASHLIMIT=m
322CONFIG_IP_NF_MATCH_STRING=m
488CONFIG_IP_NF_FILTER=m 323CONFIG_IP_NF_FILTER=m
489CONFIG_IP_NF_TARGET_REJECT=m 324CONFIG_IP_NF_TARGET_REJECT=m
490CONFIG_IP_NF_TARGET_LOG=m 325CONFIG_IP_NF_TARGET_LOG=m
@@ -501,12 +336,14 @@ CONFIG_IP_NF_NAT_IRC=m
501CONFIG_IP_NF_NAT_FTP=m 336CONFIG_IP_NF_NAT_FTP=m
502CONFIG_IP_NF_NAT_TFTP=m 337CONFIG_IP_NF_NAT_TFTP=m
503CONFIG_IP_NF_NAT_AMANDA=m 338CONFIG_IP_NF_NAT_AMANDA=m
339CONFIG_IP_NF_NAT_PPTP=m
504CONFIG_IP_NF_MANGLE=m 340CONFIG_IP_NF_MANGLE=m
505CONFIG_IP_NF_TARGET_TOS=m 341CONFIG_IP_NF_TARGET_TOS=m
506CONFIG_IP_NF_TARGET_ECN=m 342CONFIG_IP_NF_TARGET_ECN=m
507CONFIG_IP_NF_TARGET_DSCP=m 343CONFIG_IP_NF_TARGET_DSCP=m
508CONFIG_IP_NF_TARGET_MARK=m 344CONFIG_IP_NF_TARGET_MARK=m
509CONFIG_IP_NF_TARGET_CLASSIFY=m 345CONFIG_IP_NF_TARGET_CLASSIFY=m
346CONFIG_IP_NF_TARGET_TTL=m
510CONFIG_IP_NF_TARGET_CONNMARK=m 347CONFIG_IP_NF_TARGET_CONNMARK=m
511CONFIG_IP_NF_TARGET_CLUSTERIP=m 348CONFIG_IP_NF_TARGET_CLUSTERIP=m
512CONFIG_IP_NF_RAW=m 349CONFIG_IP_NF_RAW=m
@@ -516,7 +353,7 @@ CONFIG_IP_NF_ARPFILTER=m
516CONFIG_IP_NF_ARP_MANGLE=m 353CONFIG_IP_NF_ARP_MANGLE=m
517 354
518# 355#
519# IPv6: Netfilter Configuration 356# IPv6: Netfilter Configuration (EXPERIMENTAL)
520# 357#
521CONFIG_IP6_NF_QUEUE=m 358CONFIG_IP6_NF_QUEUE=m
522CONFIG_IP6_NF_IPTABLES=m 359CONFIG_IP6_NF_IPTABLES=m
@@ -536,8 +373,10 @@ CONFIG_IP6_NF_MATCH_EUI64=m
536CONFIG_IP6_NF_MATCH_PHYSDEV=m 373CONFIG_IP6_NF_MATCH_PHYSDEV=m
537CONFIG_IP6_NF_FILTER=m 374CONFIG_IP6_NF_FILTER=m
538CONFIG_IP6_NF_TARGET_LOG=m 375CONFIG_IP6_NF_TARGET_LOG=m
376CONFIG_IP6_NF_TARGET_REJECT=m
539CONFIG_IP6_NF_MANGLE=m 377CONFIG_IP6_NF_MANGLE=m
540CONFIG_IP6_NF_TARGET_MARK=m 378CONFIG_IP6_NF_TARGET_MARK=m
379CONFIG_IP6_NF_TARGET_HL=m
541CONFIG_IP6_NF_RAW=m 380CONFIG_IP6_NF_RAW=m
542 381
543# 382#
@@ -567,9 +406,12 @@ CONFIG_BRIDGE_EBT_MARK_T=m
567CONFIG_BRIDGE_EBT_REDIRECT=m 406CONFIG_BRIDGE_EBT_REDIRECT=m
568CONFIG_BRIDGE_EBT_SNAT=m 407CONFIG_BRIDGE_EBT_SNAT=m
569CONFIG_BRIDGE_EBT_LOG=m 408CONFIG_BRIDGE_EBT_LOG=m
570# CONFIG_BRIDGE_EBT_ULOG is not set 409CONFIG_BRIDGE_EBT_ULOG=m
571CONFIG_XFRM=y 410
572# CONFIG_XFRM_USER is not set 411#
412# DCCP Configuration (EXPERIMENTAL)
413#
414# CONFIG_IP_DCCP is not set
573 415
574# 416#
575# SCTP Configuration (EXPERIMENTAL) 417# SCTP Configuration (EXPERIMENTAL)
@@ -588,10 +430,6 @@ CONFIG_DECNET=m
588# CONFIG_NET_DIVERT is not set 430# CONFIG_NET_DIVERT is not set
589# CONFIG_ECONET is not set 431# CONFIG_ECONET is not set
590# CONFIG_WAN_ROUTER is not set 432# CONFIG_WAN_ROUTER is not set
591
592#
593# QoS and/or fair queueing
594#
595CONFIG_NET_SCHED=y 433CONFIG_NET_SCHED=y
596CONFIG_NET_SCH_CLK_JIFFIES=y 434CONFIG_NET_SCH_CLK_JIFFIES=y
597# CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set 435# CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set
@@ -611,6 +449,7 @@ CONFIG_NET_SCH_INGRESS=m
611CONFIG_NET_QOS=y 449CONFIG_NET_QOS=y
612CONFIG_NET_ESTIMATOR=y 450CONFIG_NET_ESTIMATOR=y
613CONFIG_NET_CLS=y 451CONFIG_NET_CLS=y
452CONFIG_NET_CLS_BASIC=m
614CONFIG_NET_CLS_TCINDEX=m 453CONFIG_NET_CLS_TCINDEX=m
615CONFIG_NET_CLS_ROUTE4=m 454CONFIG_NET_CLS_ROUTE4=m
616CONFIG_NET_CLS_ROUTE=y 455CONFIG_NET_CLS_ROUTE=y
@@ -621,6 +460,7 @@ CONFIG_NET_CLS_U32=m
621# CONFIG_CLS_U32_MARK is not set 460# CONFIG_CLS_U32_MARK is not set
622CONFIG_NET_CLS_RSVP=m 461CONFIG_NET_CLS_RSVP=m
623CONFIG_NET_CLS_RSVP6=m 462CONFIG_NET_CLS_RSVP6=m
463# CONFIG_NET_EMATCH is not set
624# CONFIG_NET_CLS_ACT is not set 464# CONFIG_NET_CLS_ACT is not set
625CONFIG_NET_CLS_POLICE=y 465CONFIG_NET_CLS_POLICE=y
626 466
@@ -628,8 +468,6 @@ CONFIG_NET_CLS_POLICE=y
628# Network testing 468# Network testing
629# 469#
630# CONFIG_NET_PKTGEN is not set 470# CONFIG_NET_PKTGEN is not set
631# CONFIG_NETPOLL is not set
632# CONFIG_NET_POLL_CONTROLLER is not set
633CONFIG_HAMRADIO=y 471CONFIG_HAMRADIO=y
634 472
635# 473#
@@ -646,8 +484,6 @@ CONFIG_ROSE=m
646CONFIG_MKISS=m 484CONFIG_MKISS=m
647CONFIG_6PACK=m 485CONFIG_6PACK=m
648CONFIG_BPQETHER=m 486CONFIG_BPQETHER=m
649# CONFIG_DMASCC is not set
650# CONFIG_SCC is not set
651# CONFIG_BAYCOM_SER_FDX is not set 487# CONFIG_BAYCOM_SER_FDX is not set
652# CONFIG_BAYCOM_SER_HDX is not set 488# CONFIG_BAYCOM_SER_HDX is not set
653# CONFIG_BAYCOM_PAR is not set 489# CONFIG_BAYCOM_PAR is not set
@@ -655,12 +491,257 @@ CONFIG_BPQETHER=m
655# CONFIG_YAM is not set 491# CONFIG_YAM is not set
656# CONFIG_IRDA is not set 492# CONFIG_IRDA is not set
657# CONFIG_BT is not set 493# CONFIG_BT is not set
494CONFIG_IEEE80211=m
495# CONFIG_IEEE80211_DEBUG is not set
496CONFIG_IEEE80211_CRYPT_WEP=m
497CONFIG_IEEE80211_CRYPT_CCMP=m
498CONFIG_IEEE80211_CRYPT_TKIP=m
499
500#
501# Device Drivers
502#
503
504#
505# Generic Driver Options
506#
507CONFIG_STANDALONE=y
508CONFIG_PREVENT_FIRMWARE_BUILD=y
509CONFIG_FW_LOADER=m
510
511#
512# Connector - unified userspace <-> kernelspace linker
513#
514CONFIG_CONNECTOR=m
515
516#
517# Memory Technology Devices (MTD)
518#
519# CONFIG_MTD is not set
520
521#
522# Parallel port support
523#
524CONFIG_PARPORT=m
525CONFIG_PARPORT_PC=m
526CONFIG_PARPORT_SERIAL=m
527# CONFIG_PARPORT_PC_FIFO is not set
528# CONFIG_PARPORT_PC_SUPERIO is not set
529CONFIG_PARPORT_NOT_PC=y
530# CONFIG_PARPORT_GSC is not set
531CONFIG_PARPORT_1284=y
532
533#
534# Plug and Play support
535#
536# CONFIG_PNP is not set
537
538#
539# Block devices
540#
541CONFIG_BLK_DEV_FD=m
542CONFIG_PARIDE=m
543CONFIG_PARIDE_PARPORT=m
544
545#
546# Parallel IDE high-level drivers
547#
548CONFIG_PARIDE_PD=m
549CONFIG_PARIDE_PCD=m
550CONFIG_PARIDE_PF=m
551CONFIG_PARIDE_PT=m
552CONFIG_PARIDE_PG=m
553
554#
555# Parallel IDE protocol modules
556#
557CONFIG_PARIDE_ATEN=m
558CONFIG_PARIDE_BPCK=m
559CONFIG_PARIDE_BPCK6=m
560CONFIG_PARIDE_COMM=m
561CONFIG_PARIDE_DSTR=m
562CONFIG_PARIDE_FIT2=m
563CONFIG_PARIDE_FIT3=m
564CONFIG_PARIDE_EPAT=m
565# CONFIG_PARIDE_EPATC8 is not set
566CONFIG_PARIDE_EPIA=m
567CONFIG_PARIDE_FRIQ=m
568CONFIG_PARIDE_FRPW=m
569CONFIG_PARIDE_KBIC=m
570CONFIG_PARIDE_KTTI=m
571CONFIG_PARIDE_ON20=m
572CONFIG_PARIDE_ON26=m
573# CONFIG_BLK_CPQ_DA is not set
574# CONFIG_BLK_CPQ_CISS_DA is not set
575# CONFIG_BLK_DEV_DAC960 is not set
576# CONFIG_BLK_DEV_UMEM is not set
577# CONFIG_BLK_DEV_COW_COMMON is not set
578CONFIG_BLK_DEV_LOOP=m
579CONFIG_BLK_DEV_CRYPTOLOOP=m
580CONFIG_BLK_DEV_NBD=m
581CONFIG_BLK_DEV_SX8=m
582CONFIG_BLK_DEV_UB=m
583CONFIG_BLK_DEV_RAM=m
584CONFIG_BLK_DEV_RAM_COUNT=16
585CONFIG_BLK_DEV_RAM_SIZE=4096
586# CONFIG_LBD is not set
587CONFIG_CDROM_PKTCDVD=m
588CONFIG_CDROM_PKTCDVD_BUFFERS=8
589# CONFIG_CDROM_PKTCDVD_WCACHE is not set
590
591#
592# IO Schedulers
593#
594CONFIG_IOSCHED_NOOP=y
595CONFIG_IOSCHED_AS=y
596CONFIG_IOSCHED_DEADLINE=y
597CONFIG_IOSCHED_CFQ=y
598CONFIG_ATA_OVER_ETH=m
599
600#
601# ATA/ATAPI/MFM/RLL support
602#
603# CONFIG_IDE is not set
604
605#
606# SCSI device support
607#
608CONFIG_RAID_ATTRS=m
609CONFIG_SCSI=y
610CONFIG_SCSI_PROC_FS=y
611
612#
613# SCSI support type (disk, tape, CD-ROM)
614#
615CONFIG_BLK_DEV_SD=y
616CONFIG_CHR_DEV_ST=m
617# CONFIG_CHR_DEV_OSST is not set
618CONFIG_BLK_DEV_SR=m
619CONFIG_BLK_DEV_SR_VENDOR=y
620# CONFIG_CHR_DEV_SG is not set
621# CONFIG_CHR_DEV_SCH is not set
622
623#
624# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
625#
626# CONFIG_SCSI_MULTI_LUN is not set
627CONFIG_SCSI_CONSTANTS=y
628# CONFIG_SCSI_LOGGING is not set
629
630#
631# SCSI Transport Attributes
632#
633CONFIG_SCSI_SPI_ATTRS=y
634# CONFIG_SCSI_FC_ATTRS is not set
635CONFIG_SCSI_ISCSI_ATTRS=m
636CONFIG_SCSI_SAS_ATTRS=m
637
638#
639# SCSI low-level drivers
640#
641# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
642# CONFIG_SCSI_3W_9XXX is not set
643# CONFIG_SCSI_ACARD is not set
644# CONFIG_SCSI_AHA152X is not set
645# CONFIG_SCSI_AACRAID is not set
646# CONFIG_SCSI_AIC7XXX is not set
647# CONFIG_SCSI_AIC7XXX_OLD is not set
648# CONFIG_SCSI_AIC79XX is not set
649# CONFIG_SCSI_DPT_I2O is not set
650# CONFIG_SCSI_IN2000 is not set
651CONFIG_MEGARAID_NEWGEN=y
652CONFIG_MEGARAID_MM=m
653CONFIG_MEGARAID_MAILBOX=m
654# CONFIG_SCSI_SATA is not set
655# CONFIG_SCSI_DMX3191D is not set
656# CONFIG_SCSI_DTC3280 is not set
657# CONFIG_SCSI_FUTURE_DOMAIN is not set
658# CONFIG_SCSI_GENERIC_NCR5380 is not set
659# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
660# CONFIG_SCSI_IPS is not set
661# CONFIG_SCSI_INITIO is not set
662# CONFIG_SCSI_INIA100 is not set
663CONFIG_SCSI_PPA=m
664CONFIG_SCSI_IMM=m
665# CONFIG_SCSI_IZIP_EPP16 is not set
666# CONFIG_SCSI_IZIP_SLOW_CTR is not set
667# CONFIG_SCSI_NCR53C406A is not set
668CONFIG_SCSI_SYM53C8XX_2=y
669CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
670CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
671CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
672# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
673# CONFIG_SCSI_IPR is not set
674# CONFIG_SCSI_PAS16 is not set
675# CONFIG_SCSI_PSI240I is not set
676# CONFIG_SCSI_QLOGIC_FAS is not set
677# CONFIG_SCSI_QLOGIC_FC is not set
678# CONFIG_SCSI_QLOGIC_1280 is not set
679CONFIG_SCSI_QLA2XXX=y
680# CONFIG_SCSI_QLA21XX is not set
681# CONFIG_SCSI_QLA22XX is not set
682# CONFIG_SCSI_QLA2300 is not set
683# CONFIG_SCSI_QLA2322 is not set
684# CONFIG_SCSI_QLA6312 is not set
685# CONFIG_SCSI_QLA24XX is not set
686# CONFIG_SCSI_LPFC is not set
687# CONFIG_SCSI_SYM53C416 is not set
688# CONFIG_SCSI_DC395x is not set
689# CONFIG_SCSI_DC390T is not set
690# CONFIG_SCSI_T128 is not set
691# CONFIG_SCSI_NSP32 is not set
692# CONFIG_SCSI_DEBUG is not set
693
694#
695# Old CD-ROM drivers (not SCSI, not IDE)
696#
697# CONFIG_CD_NO_IDESCSI is not set
698
699#
700# Multi-device support (RAID and LVM)
701#
702CONFIG_MD=y
703CONFIG_BLK_DEV_MD=m
704CONFIG_MD_LINEAR=m
705CONFIG_MD_RAID0=m
706CONFIG_MD_RAID1=m
707CONFIG_MD_RAID10=m
708CONFIG_MD_RAID5=m
709# CONFIG_MD_RAID6 is not set
710CONFIG_MD_MULTIPATH=m
711CONFIG_MD_FAULTY=m
712CONFIG_BLK_DEV_DM=m
713# CONFIG_DM_CRYPT is not set
714CONFIG_DM_SNAPSHOT=m
715CONFIG_DM_MIRROR=m
716CONFIG_DM_ZERO=m
717CONFIG_DM_MULTIPATH=m
718CONFIG_DM_MULTIPATH_EMC=m
719
720#
721# Fusion MPT device support
722#
723# CONFIG_FUSION is not set
724# CONFIG_FUSION_SPI is not set
725# CONFIG_FUSION_FC is not set
726
727#
728# IEEE 1394 (FireWire) support
729#
730# CONFIG_IEEE1394 is not set
731
732#
733# I2O device support
734#
735# CONFIG_I2O is not set
736
737#
738# Network device support
739#
658CONFIG_NETDEVICES=y 740CONFIG_NETDEVICES=y
659CONFIG_DUMMY=m 741CONFIG_DUMMY=m
660CONFIG_BONDING=m 742CONFIG_BONDING=m
661CONFIG_EQUALIZER=m 743CONFIG_EQUALIZER=m
662CONFIG_TUN=m 744CONFIG_TUN=m
663CONFIG_ETHERTAP=m
664 745
665# 746#
666# ARCnet devices 747# ARCnet devices
@@ -668,6 +749,21 @@ CONFIG_ETHERTAP=m
668# CONFIG_ARCNET is not set 749# CONFIG_ARCNET is not set
669 750
670# 751#
752# PHY device support
753#
754CONFIG_PHYLIB=m
755CONFIG_PHYCONTROL=y
756
757#
758# MII PHY device drivers
759#
760CONFIG_MARVELL_PHY=m
761CONFIG_DAVICOM_PHY=m
762CONFIG_QSEMI_PHY=m
763CONFIG_LXT_PHY=m
764CONFIG_CICADA_PHY=m
765
766#
671# Ethernet (10 or 100Mbit) 767# Ethernet (10 or 100Mbit)
672# 768#
673CONFIG_NET_ETHERNET=y 769CONFIG_NET_ETHERNET=y
@@ -675,7 +771,6 @@ CONFIG_MII=y
675# CONFIG_HAPPYMEAL is not set 771# CONFIG_HAPPYMEAL is not set
676# CONFIG_SUNGEM is not set 772# CONFIG_SUNGEM is not set
677# CONFIG_NET_VENDOR_3COM is not set 773# CONFIG_NET_VENDOR_3COM is not set
678# CONFIG_LANCE is not set
679# CONFIG_NET_VENDOR_SMC is not set 774# CONFIG_NET_VENDOR_SMC is not set
680# CONFIG_NET_VENDOR_RACAL is not set 775# CONFIG_NET_VENDOR_RACAL is not set
681 776
@@ -696,7 +791,6 @@ CONFIG_NET_ISA=y
696# CONFIG_LP486E is not set 791# CONFIG_LP486E is not set
697# CONFIG_ETH16I is not set 792# CONFIG_ETH16I is not set
698CONFIG_NE2000=m 793CONFIG_NE2000=m
699# CONFIG_ZNET is not set
700# CONFIG_SEEQ8005 is not set 794# CONFIG_SEEQ8005 is not set
701CONFIG_NET_PCI=y 795CONFIG_NET_PCI=y
702CONFIG_PCNET32=y 796CONFIG_PCNET32=y
@@ -733,13 +827,17 @@ CONFIG_EEPRO100=m
733# CONFIG_HAMACHI is not set 827# CONFIG_HAMACHI is not set
734# CONFIG_YELLOWFIN is not set 828# CONFIG_YELLOWFIN is not set
735# CONFIG_R8169 is not set 829# CONFIG_R8169 is not set
830# CONFIG_SIS190 is not set
831# CONFIG_SKGE is not set
736# CONFIG_SK98LIN is not set 832# CONFIG_SK98LIN is not set
737CONFIG_VIA_VELOCITY=m 833CONFIG_VIA_VELOCITY=m
738# CONFIG_TIGON3 is not set 834# CONFIG_TIGON3 is not set
835# CONFIG_BNX2 is not set
739 836
740# 837#
741# Ethernet (10000 Mbit) 838# Ethernet (10000 Mbit)
742# 839#
840# CONFIG_CHELSIO_T1 is not set
743# CONFIG_IXGB is not set 841# CONFIG_IXGB is not set
744# CONFIG_S2IO is not set 842# CONFIG_S2IO is not set
745 843
@@ -752,6 +850,8 @@ CONFIG_VIA_VELOCITY=m
752# Wireless LAN (non-hamradio) 850# Wireless LAN (non-hamradio)
753# 851#
754# CONFIG_NET_RADIO is not set 852# CONFIG_NET_RADIO is not set
853# CONFIG_IPW_DEBUG is not set
854CONFIG_IPW2200=m
755 855
756# 856#
757# Wan interfaces 857# Wan interfaces
@@ -765,6 +865,8 @@ CONFIG_PLIP=m
765# CONFIG_NET_FC is not set 865# CONFIG_NET_FC is not set
766# CONFIG_SHAPER is not set 866# CONFIG_SHAPER is not set
767# CONFIG_NETCONSOLE is not set 867# CONFIG_NETCONSOLE is not set
868# CONFIG_NETPOLL is not set
869# CONFIG_NET_POLL_CONTROLLER is not set
768 870
769# 871#
770# ISDN subsystem 872# ISDN subsystem
@@ -794,20 +896,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
794# CONFIG_INPUT_EVBUG is not set 896# CONFIG_INPUT_EVBUG is not set
795 897
796# 898#
797# Input I/O drivers
798#
799# CONFIG_GAMEPORT is not set
800CONFIG_SOUND_GAMEPORT=y
801CONFIG_SERIO=y
802CONFIG_SERIO_I8042=y
803CONFIG_SERIO_SERPORT=y
804# CONFIG_SERIO_CT82C710 is not set
805CONFIG_SERIO_PARKBD=m
806# CONFIG_SERIO_PCIPS2 is not set
807CONFIG_SERIO_LIBPS2=y
808CONFIG_SERIO_RAW=m
809
810#
811# Input Device Drivers 899# Input Device Drivers
812# 900#
813CONFIG_INPUT_KEYBOARD=y 901CONFIG_INPUT_KEYBOARD=y
@@ -828,6 +916,18 @@ CONFIG_MOUSE_PS2=y
828# CONFIG_INPUT_MISC is not set 916# CONFIG_INPUT_MISC is not set
829 917
830# 918#
919# Hardware I/O ports
920#
921CONFIG_SERIO=y
922CONFIG_SERIO_I8042=y
923CONFIG_SERIO_SERPORT=y
924CONFIG_SERIO_PARKBD=m
925# CONFIG_SERIO_PCIPS2 is not set
926CONFIG_SERIO_LIBPS2=y
927CONFIG_SERIO_RAW=m
928# CONFIG_GAMEPORT is not set
929
930#
831# Character devices 931# Character devices
832# 932#
833CONFIG_VT=y 933CONFIG_VT=y
@@ -844,13 +944,13 @@ CONFIG_SERIAL_8250_EXTENDED=y
844# CONFIG_SERIAL_8250_MANY_PORTS is not set 944# CONFIG_SERIAL_8250_MANY_PORTS is not set
845CONFIG_SERIAL_8250_SHARE_IRQ=y 945CONFIG_SERIAL_8250_SHARE_IRQ=y
846CONFIG_SERIAL_8250_DETECT_IRQ=y 946CONFIG_SERIAL_8250_DETECT_IRQ=y
847CONFIG_SERIAL_8250_MULTIPORT=y
848CONFIG_SERIAL_8250_RSA=y 947CONFIG_SERIAL_8250_RSA=y
849 948
850# 949#
851# Non-8250 serial port support 950# Non-8250 serial port support
852# 951#
853CONFIG_SERIAL_CORE=m 952CONFIG_SERIAL_CORE=m
953# CONFIG_SERIAL_JSM is not set
854CONFIG_UNIX98_PTYS=y 954CONFIG_UNIX98_PTYS=y
855CONFIG_LEGACY_PTYS=y 955CONFIG_LEGACY_PTYS=y
856CONFIG_LEGACY_PTY_COUNT=256 956CONFIG_LEGACY_PTY_COUNT=256
@@ -881,6 +981,11 @@ CONFIG_RTC=m
881# CONFIG_RAW_DRIVER is not set 981# CONFIG_RAW_DRIVER is not set
882 982
883# 983#
984# TPM devices
985#
986# CONFIG_TCG_TPM is not set
987
988#
884# I2C support 989# I2C support
885# 990#
886# CONFIG_I2C is not set 991# CONFIG_I2C is not set
@@ -891,15 +996,26 @@ CONFIG_RTC=m
891CONFIG_W1=m 996CONFIG_W1=m
892CONFIG_W1_MATROX=m 997CONFIG_W1_MATROX=m
893CONFIG_W1_DS9490=m 998CONFIG_W1_DS9490=m
894CONFIG_W1_DS9490_BRIDGE=m 999# CONFIG_W1_DS9490_BRIDGE is not set
895CONFIG_W1_THERM=m 1000CONFIG_W1_THERM=m
896CONFIG_W1_SMEM=m 1001CONFIG_W1_SMEM=m
1002# CONFIG_W1_DS2433 is not set
1003
1004#
1005# Hardware Monitoring support
1006#
1007# CONFIG_HWMON is not set
1008# CONFIG_HWMON_VID is not set
897 1009
898# 1010#
899# Misc devices 1011# Misc devices
900# 1012#
901 1013
902# 1014#
1015# Multimedia Capabilities Port drivers
1016#
1017
1018#
903# Multimedia devices 1019# Multimedia devices
904# 1020#
905# CONFIG_VIDEO_DEV is not set 1021# CONFIG_VIDEO_DEV is not set
@@ -920,7 +1036,6 @@ CONFIG_W1_SMEM=m
920CONFIG_VGA_CONSOLE=y 1036CONFIG_VGA_CONSOLE=y
921# CONFIG_MDA_CONSOLE is not set 1037# CONFIG_MDA_CONSOLE is not set
922CONFIG_DUMMY_CONSOLE=y 1038CONFIG_DUMMY_CONSOLE=y
923# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
924 1039
925# 1040#
926# Sound 1041# Sound
@@ -930,6 +1045,8 @@ CONFIG_DUMMY_CONSOLE=y
930# 1045#
931# USB support 1046# USB support
932# 1047#
1048CONFIG_USB_ARCH_HAS_HCD=y
1049CONFIG_USB_ARCH_HAS_OHCI=y
933CONFIG_USB=m 1050CONFIG_USB=m
934# CONFIG_USB_DEBUG is not set 1051# CONFIG_USB_DEBUG is not set
935 1052
@@ -940,8 +1057,6 @@ CONFIG_USB_DEVICEFS=y
940# CONFIG_USB_BANDWIDTH is not set 1057# CONFIG_USB_BANDWIDTH is not set
941# CONFIG_USB_DYNAMIC_MINORS is not set 1058# CONFIG_USB_DYNAMIC_MINORS is not set
942# CONFIG_USB_OTG is not set 1059# CONFIG_USB_OTG is not set
943CONFIG_USB_ARCH_HAS_HCD=y
944CONFIG_USB_ARCH_HAS_OHCI=y
945 1060
946# 1061#
947# USB Host Controller Drivers 1062# USB Host Controller Drivers
@@ -949,7 +1064,10 @@ CONFIG_USB_ARCH_HAS_OHCI=y
949CONFIG_USB_EHCI_HCD=m 1064CONFIG_USB_EHCI_HCD=m
950# CONFIG_USB_EHCI_SPLIT_ISO is not set 1065# CONFIG_USB_EHCI_SPLIT_ISO is not set
951# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 1066# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1067# CONFIG_USB_ISP116X_HCD is not set
952CONFIG_USB_OHCI_HCD=m 1068CONFIG_USB_OHCI_HCD=m
1069# CONFIG_USB_OHCI_BIG_ENDIAN is not set
1070CONFIG_USB_OHCI_LITTLE_ENDIAN=y
953CONFIG_USB_UHCI_HCD=m 1071CONFIG_USB_UHCI_HCD=m
954# CONFIG_USB_SL811_HCD is not set 1072# CONFIG_USB_SL811_HCD is not set
955 1073
@@ -965,11 +1083,10 @@ CONFIG_USB_PRINTER=m
965# 1083#
966CONFIG_USB_STORAGE=m 1084CONFIG_USB_STORAGE=m
967# CONFIG_USB_STORAGE_DEBUG is not set 1085# CONFIG_USB_STORAGE_DEBUG is not set
968# CONFIG_USB_STORAGE_RW_DETECT is not set
969CONFIG_USB_STORAGE_DATAFAB=y 1086CONFIG_USB_STORAGE_DATAFAB=y
970CONFIG_USB_STORAGE_FREECOM=y 1087CONFIG_USB_STORAGE_FREECOM=y
971CONFIG_USB_STORAGE_DPCM=y 1088CONFIG_USB_STORAGE_DPCM=y
972CONFIG_USB_STORAGE_HP8200e=y 1089# CONFIG_USB_STORAGE_USBAT is not set
973CONFIG_USB_STORAGE_SDDR09=y 1090CONFIG_USB_STORAGE_SDDR09=y
974CONFIG_USB_STORAGE_SDDR55=y 1091CONFIG_USB_STORAGE_SDDR55=y
975CONFIG_USB_STORAGE_JUMPSHOT=y 1092CONFIG_USB_STORAGE_JUMPSHOT=y
@@ -992,12 +1109,17 @@ CONFIG_USB_KBD=m
992CONFIG_USB_MOUSE=m 1109CONFIG_USB_MOUSE=m
993CONFIG_USB_AIPTEK=m 1110CONFIG_USB_AIPTEK=m
994CONFIG_USB_WACOM=m 1111CONFIG_USB_WACOM=m
1112# CONFIG_USB_ACECAD is not set
995CONFIG_USB_KBTAB=m 1113CONFIG_USB_KBTAB=m
996CONFIG_USB_POWERMATE=m 1114CONFIG_USB_POWERMATE=m
997# CONFIG_USB_MTOUCH is not set 1115# CONFIG_USB_MTOUCH is not set
1116# CONFIG_USB_ITMTOUCH is not set
998CONFIG_USB_EGALAX=m 1117CONFIG_USB_EGALAX=m
1118CONFIG_USB_YEALINK=m
999CONFIG_USB_XPAD=m 1119CONFIG_USB_XPAD=m
1000# CONFIG_USB_ATI_REMOTE is not set 1120# CONFIG_USB_ATI_REMOTE is not set
1121# CONFIG_USB_KEYSPAN_REMOTE is not set
1122# CONFIG_USB_APPLETOUCH is not set
1001 1123
1002# 1124#
1003# USB Imaging devices 1125# USB Imaging devices
@@ -1022,30 +1144,15 @@ CONFIG_USB_KAWETH=m
1022CONFIG_USB_PEGASUS=m 1144CONFIG_USB_PEGASUS=m
1023CONFIG_USB_RTL8150=m 1145CONFIG_USB_RTL8150=m
1024CONFIG_USB_USBNET=m 1146CONFIG_USB_USBNET=m
1025 1147CONFIG_USB_NET_AX8817X=m
1026# 1148CONFIG_USB_NET_CDCETHER=m
1027# USB Host-to-Host Cables 1149# CONFIG_USB_NET_GL620A is not set
1028# 1150CONFIG_USB_NET_NET1080=m
1029CONFIG_USB_ALI_M5632=y 1151# CONFIG_USB_NET_PLUSB is not set
1030CONFIG_USB_AN2720=y 1152# CONFIG_USB_NET_RNDIS_HOST is not set
1031CONFIG_USB_BELKIN=y 1153# CONFIG_USB_NET_CDC_SUBSET is not set
1032CONFIG_USB_GENESYS=y 1154CONFIG_USB_NET_ZAURUS=m
1033CONFIG_USB_NET1080=y 1155CONFIG_USB_MON=y
1034CONFIG_USB_PL2301=y
1035CONFIG_USB_KC2190=y
1036
1037#
1038# Intelligent USB Devices/Gadgets
1039#
1040CONFIG_USB_ARMLINUX=y
1041CONFIG_USB_EPSON2888=y
1042CONFIG_USB_ZAURUS=y
1043CONFIG_USB_CDCETHER=y
1044
1045#
1046# USB Network Adapters
1047#
1048CONFIG_USB_AX8817X=y
1049 1156
1050# 1157#
1051# USB port drivers 1158# USB port drivers
@@ -1057,9 +1164,11 @@ CONFIG_USB_USS720=m
1057# 1164#
1058CONFIG_USB_SERIAL=m 1165CONFIG_USB_SERIAL=m
1059CONFIG_USB_SERIAL_GENERIC=y 1166CONFIG_USB_SERIAL_GENERIC=y
1167CONFIG_USB_SERIAL_AIRPRIME=m
1060CONFIG_USB_SERIAL_BELKIN=m 1168CONFIG_USB_SERIAL_BELKIN=m
1061CONFIG_USB_SERIAL_WHITEHEAT=m 1169CONFIG_USB_SERIAL_WHITEHEAT=m
1062CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m 1170CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
1171# CONFIG_USB_SERIAL_CP2101 is not set
1063CONFIG_USB_SERIAL_CYPRESS_M8=m 1172CONFIG_USB_SERIAL_CYPRESS_M8=m
1064CONFIG_USB_SERIAL_EMPEG=m 1173CONFIG_USB_SERIAL_EMPEG=m
1065CONFIG_USB_SERIAL_FTDI_SIO=m 1174CONFIG_USB_SERIAL_FTDI_SIO=m
@@ -1088,6 +1197,7 @@ CONFIG_USB_SERIAL_KLSI=m
1088CONFIG_USB_SERIAL_KOBIL_SCT=m 1197CONFIG_USB_SERIAL_KOBIL_SCT=m
1089CONFIG_USB_SERIAL_MCT_U232=m 1198CONFIG_USB_SERIAL_MCT_U232=m
1090CONFIG_USB_SERIAL_PL2303=m 1199CONFIG_USB_SERIAL_PL2303=m
1200CONFIG_USB_SERIAL_HP4X=m
1091CONFIG_USB_SERIAL_SAFE=m 1201CONFIG_USB_SERIAL_SAFE=m
1092CONFIG_USB_SERIAL_SAFE_PADDED=y 1202CONFIG_USB_SERIAL_SAFE_PADDED=y
1093# CONFIG_USB_SERIAL_TI is not set 1203# CONFIG_USB_SERIAL_TI is not set
@@ -1110,10 +1220,13 @@ CONFIG_USB_CYTHERM=m
1110CONFIG_USB_PHIDGETKIT=m 1220CONFIG_USB_PHIDGETKIT=m
1111CONFIG_USB_PHIDGETSERVO=m 1221CONFIG_USB_PHIDGETSERVO=m
1112# CONFIG_USB_IDMOUSE is not set 1222# CONFIG_USB_IDMOUSE is not set
1223CONFIG_USB_SISUSBVGA=m
1224# CONFIG_USB_SISUSBVGA_CON is not set
1225CONFIG_USB_LD=m
1113CONFIG_USB_TEST=m 1226CONFIG_USB_TEST=m
1114 1227
1115# 1228#
1116# USB ATM/DSL drivers 1229# USB DSL modem support
1117# 1230#
1118 1231
1119# 1232#
@@ -1132,10 +1245,15 @@ CONFIG_USB_TEST=m
1132# CONFIG_INFINIBAND is not set 1245# CONFIG_INFINIBAND is not set
1133 1246
1134# 1247#
1248# SN Devices
1249#
1250
1251#
1135# File systems 1252# File systems
1136# 1253#
1137CONFIG_EXT2_FS=m 1254CONFIG_EXT2_FS=m
1138# CONFIG_EXT2_FS_XATTR is not set 1255# CONFIG_EXT2_FS_XATTR is not set
1256# CONFIG_EXT2_FS_XIP is not set
1139CONFIG_EXT3_FS=y 1257CONFIG_EXT3_FS=y
1140CONFIG_EXT3_FS_XATTR=y 1258CONFIG_EXT3_FS_XATTR=y
1141# CONFIG_EXT3_FS_POSIX_ACL is not set 1259# CONFIG_EXT3_FS_POSIX_ACL is not set
@@ -1152,17 +1270,20 @@ CONFIG_REISERFS_FS_SECURITY=y
1152# CONFIG_JFS_FS is not set 1270# CONFIG_JFS_FS is not set
1153CONFIG_FS_POSIX_ACL=y 1271CONFIG_FS_POSIX_ACL=y
1154CONFIG_XFS_FS=m 1272CONFIG_XFS_FS=m
1155# CONFIG_XFS_RT is not set 1273CONFIG_XFS_EXPORT=y
1156CONFIG_XFS_QUOTA=y 1274CONFIG_XFS_QUOTA=m
1157CONFIG_XFS_SECURITY=y 1275CONFIG_XFS_SECURITY=y
1158# CONFIG_XFS_POSIX_ACL is not set 1276# CONFIG_XFS_POSIX_ACL is not set
1277# CONFIG_XFS_RT is not set
1159CONFIG_MINIX_FS=m 1278CONFIG_MINIX_FS=m
1160CONFIG_ROMFS_FS=m 1279CONFIG_ROMFS_FS=m
1280CONFIG_INOTIFY=y
1161# CONFIG_QUOTA is not set 1281# CONFIG_QUOTA is not set
1162CONFIG_QUOTACTL=y 1282CONFIG_QUOTACTL=y
1163CONFIG_DNOTIFY=y 1283CONFIG_DNOTIFY=y
1164CONFIG_AUTOFS_FS=m 1284CONFIG_AUTOFS_FS=m
1165CONFIG_AUTOFS4_FS=m 1285CONFIG_AUTOFS4_FS=m
1286CONFIG_FUSE_FS=m
1166 1287
1167# 1288#
1168# CD-ROM/DVD Filesystems 1289# CD-ROM/DVD Filesystems
@@ -1192,12 +1313,10 @@ CONFIG_NTFS_FS=m
1192CONFIG_PROC_FS=y 1313CONFIG_PROC_FS=y
1193CONFIG_PROC_KCORE=y 1314CONFIG_PROC_KCORE=y
1194CONFIG_SYSFS=y 1315CONFIG_SYSFS=y
1195# CONFIG_DEVFS_FS is not set
1196CONFIG_DEVPTS_FS_XATTR=y
1197CONFIG_DEVPTS_FS_SECURITY=y
1198# CONFIG_TMPFS is not set 1316# CONFIG_TMPFS is not set
1199# CONFIG_HUGETLB_PAGE is not set 1317# CONFIG_HUGETLB_PAGE is not set
1200CONFIG_RAMFS=y 1318CONFIG_RAMFS=y
1319CONFIG_RELAYFS_FS=m
1201 1320
1202# 1321#
1203# Miscellaneous filesystems 1322# Miscellaneous filesystems
@@ -1224,15 +1343,18 @@ CONFIG_UFS_FS=m
1224# 1343#
1225CONFIG_NFS_FS=m 1344CONFIG_NFS_FS=m
1226CONFIG_NFS_V3=y 1345CONFIG_NFS_V3=y
1346# CONFIG_NFS_V3_ACL is not set
1227# CONFIG_NFS_V4 is not set 1347# CONFIG_NFS_V4 is not set
1228# CONFIG_NFS_DIRECTIO is not set 1348# CONFIG_NFS_DIRECTIO is not set
1229CONFIG_NFSD=m 1349CONFIG_NFSD=m
1230CONFIG_NFSD_V3=y 1350CONFIG_NFSD_V3=y
1351# CONFIG_NFSD_V3_ACL is not set
1231# CONFIG_NFSD_V4 is not set 1352# CONFIG_NFSD_V4 is not set
1232CONFIG_NFSD_TCP=y 1353CONFIG_NFSD_TCP=y
1233CONFIG_LOCKD=m 1354CONFIG_LOCKD=m
1234CONFIG_LOCKD_V4=y 1355CONFIG_LOCKD_V4=y
1235CONFIG_EXPORTFS=m 1356CONFIG_EXPORTFS=m
1357CONFIG_NFS_COMMON=y
1236CONFIG_SUNRPC=m 1358CONFIG_SUNRPC=m
1237CONFIG_SUNRPC_GSS=m 1359CONFIG_SUNRPC_GSS=m
1238CONFIG_RPCSEC_GSS_KRB5=m 1360CONFIG_RPCSEC_GSS_KRB5=m
@@ -1256,6 +1378,7 @@ CONFIG_CODA_FS=m
1256CONFIG_CODA_FS_OLD_API=y 1378CONFIG_CODA_FS_OLD_API=y
1257CONFIG_AFS_FS=m 1379CONFIG_AFS_FS=m
1258CONFIG_RXRPC=m 1380CONFIG_RXRPC=m
1381# CONFIG_9P_FS is not set
1259 1382
1260# 1383#
1261# Partition Types 1384# Partition Types
@@ -1329,7 +1452,9 @@ CONFIG_NLS_UTF8=m
1329# 1452#
1330# Kernel hacking 1453# Kernel hacking
1331# 1454#
1455# CONFIG_PRINTK_TIME is not set
1332# CONFIG_DEBUG_KERNEL is not set 1456# CONFIG_DEBUG_KERNEL is not set
1457CONFIG_LOG_BUF_SHIFT=14
1333CONFIG_CROSSCOMPILE=y 1458CONFIG_CROSSCOMPILE=y
1334CONFIG_CMDLINE="" 1459CONFIG_CMDLINE=""
1335 1460
@@ -1352,6 +1477,7 @@ CONFIG_CRYPTO_SHA1=m
1352CONFIG_CRYPTO_SHA256=m 1477CONFIG_CRYPTO_SHA256=m
1353CONFIG_CRYPTO_SHA512=m 1478CONFIG_CRYPTO_SHA512=m
1354CONFIG_CRYPTO_WP512=m 1479CONFIG_CRYPTO_WP512=m
1480CONFIG_CRYPTO_TGR192=m
1355CONFIG_CRYPTO_DES=m 1481CONFIG_CRYPTO_DES=m
1356CONFIG_CRYPTO_BLOWFISH=m 1482CONFIG_CRYPTO_BLOWFISH=m
1357CONFIG_CRYPTO_TWOFISH=m 1483CONFIG_CRYPTO_TWOFISH=m
@@ -1360,13 +1486,13 @@ CONFIG_CRYPTO_AES=m
1360CONFIG_CRYPTO_CAST5=m 1486CONFIG_CRYPTO_CAST5=m
1361CONFIG_CRYPTO_CAST6=m 1487CONFIG_CRYPTO_CAST6=m
1362CONFIG_CRYPTO_TEA=m 1488CONFIG_CRYPTO_TEA=m
1363# CONFIG_CRYPTO_ARC4 is not set 1489CONFIG_CRYPTO_ARC4=m
1364CONFIG_CRYPTO_KHAZAD=m 1490CONFIG_CRYPTO_KHAZAD=m
1365CONFIG_CRYPTO_ANUBIS=m 1491CONFIG_CRYPTO_ANUBIS=m
1366CONFIG_CRYPTO_DEFLATE=m 1492CONFIG_CRYPTO_DEFLATE=m
1367CONFIG_CRYPTO_MICHAEL_MIC=m 1493CONFIG_CRYPTO_MICHAEL_MIC=m
1368# CONFIG_CRYPTO_CRC32C is not set 1494CONFIG_CRYPTO_CRC32C=m
1369CONFIG_CRYPTO_TEST=m 1495# CONFIG_CRYPTO_TEST is not set
1370 1496
1371# 1497#
1372# Hardware crypto devices 1498# Hardware crypto devices
@@ -1376,9 +1502,12 @@ CONFIG_CRYPTO_TEST=m
1376# Library routines 1502# Library routines
1377# 1503#
1378CONFIG_CRC_CCITT=m 1504CONFIG_CRC_CCITT=m
1505CONFIG_CRC16=m
1379CONFIG_CRC32=y 1506CONFIG_CRC32=y
1380# CONFIG_LIBCRC32C is not set 1507CONFIG_LIBCRC32C=m
1381CONFIG_ZLIB_INFLATE=m 1508CONFIG_ZLIB_INFLATE=m
1382CONFIG_ZLIB_DEFLATE=m 1509CONFIG_ZLIB_DEFLATE=m
1383CONFIG_GENERIC_HARDIRQS=y 1510CONFIG_TEXTSEARCH=y
1384CONFIG_GENERIC_IRQ_PROBE=y 1511CONFIG_TEXTSEARCH_KMP=m
1512CONFIG_TEXTSEARCH_BM=m
1513CONFIG_TEXTSEARCH_FSM=m
diff --git a/arch/mips/configs/sb1250-swarm_defconfig b/arch/mips/configs/sb1250-swarm_defconfig
index 1dc935f37582..4365d9c8c42e 100644
--- a/arch/mips/configs/sb1250-swarm_defconfig
+++ b/arch/mips/configs/sb1250-swarm_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:10 2005 4# Thu Oct 20 22:27:05 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,24 +11,30 @@ CONFIG_32BIT=y
14CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_LOCK_KERNEL=y 13CONFIG_LOCK_KERNEL=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
25# CONFIG_BSD_PROCESS_ACCT is not set 24# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y 25CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set 26# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=15 27CONFIG_HOTPLUG=y
29# CONFIG_HOTPLUG is not set
30CONFIG_KOBJECT_UEVENT=y 28CONFIG_KOBJECT_UEVENT=y
31# CONFIG_IKCONFIG is not set 29# CONFIG_IKCONFIG is not set
30CONFIG_CPUSETS=y
31CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y 32CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y 33CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_EXTRA_PASS is not set 34# CONFIG_KALLSYMS_EXTRA_PASS is not set
35CONFIG_PRINTK=y
36CONFIG_BUG=y
37CONFIG_BASE_FULL=y
35CONFIG_FUTEX=y 38CONFIG_FUTEX=y
36CONFIG_EPOLL=y 39CONFIG_EPOLL=y
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 40# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -41,6 +44,7 @@ CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0 44CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0 45CONFIG_CC_ALIGN_JUMPS=0
43# CONFIG_TINY_SHMEM is not set 46# CONFIG_TINY_SHMEM is not set
47CONFIG_BASE_SMALL=0
44 48
45# 49#
46# Loadable module support 50# Loadable module support
@@ -57,32 +61,49 @@ CONFIG_STOP_MACHINE=y
57# 61#
58# Machine selection 62# Machine selection
59# 63#
60# CONFIG_MACH_JAZZ is not set 64# CONFIG_MIPS_MTX1 is not set
61# CONFIG_MACH_VR41XX is not set 65# CONFIG_MIPS_BOSPORUS is not set
62# CONFIG_TOSHIBA_JMR3927 is not set 66# CONFIG_MIPS_PB1000 is not set
67# CONFIG_MIPS_PB1100 is not set
68# CONFIG_MIPS_PB1500 is not set
69# CONFIG_MIPS_PB1550 is not set
70# CONFIG_MIPS_PB1200 is not set
71# CONFIG_MIPS_DB1000 is not set
72# CONFIG_MIPS_DB1100 is not set
73# CONFIG_MIPS_DB1500 is not set
74# CONFIG_MIPS_DB1550 is not set
75# CONFIG_MIPS_DB1200 is not set
76# CONFIG_MIPS_MIRAGE is not set
63# CONFIG_MIPS_COBALT is not set 77# CONFIG_MIPS_COBALT is not set
64# CONFIG_MACH_DECSTATION is not set 78# CONFIG_MACH_DECSTATION is not set
65# CONFIG_MIPS_EV64120 is not set 79# CONFIG_MIPS_EV64120 is not set
66# CONFIG_MIPS_EV96100 is not set 80# CONFIG_MIPS_EV96100 is not set
67# CONFIG_MIPS_IVR is not set 81# CONFIG_MIPS_IVR is not set
68# CONFIG_LASAT is not set
69# CONFIG_MIPS_ITE8172 is not set 82# CONFIG_MIPS_ITE8172 is not set
83# CONFIG_MACH_JAZZ is not set
84# CONFIG_LASAT is not set
70# CONFIG_MIPS_ATLAS is not set 85# CONFIG_MIPS_ATLAS is not set
71# CONFIG_MIPS_MALTA is not set 86# CONFIG_MIPS_MALTA is not set
72# CONFIG_MIPS_SEAD is not set 87# CONFIG_MIPS_SEAD is not set
88# CONFIG_MIPS_SIM is not set
89# CONFIG_MOMENCO_JAGUAR_ATX is not set
73# CONFIG_MOMENCO_OCELOT is not set 90# CONFIG_MOMENCO_OCELOT is not set
74# CONFIG_MOMENCO_OCELOT_G is not set
75# CONFIG_MOMENCO_OCELOT_C is not set
76# CONFIG_MOMENCO_OCELOT_3 is not set 91# CONFIG_MOMENCO_OCELOT_3 is not set
77# CONFIG_MOMENCO_JAGUAR_ATX is not set 92# CONFIG_MOMENCO_OCELOT_C is not set
78# CONFIG_PMC_YOSEMITE is not set 93# CONFIG_MOMENCO_OCELOT_G is not set
94# CONFIG_MIPS_XXS1500 is not set
95# CONFIG_PNX8550_V2PCI is not set
96# CONFIG_PNX8550_JBS is not set
79# CONFIG_DDB5074 is not set 97# CONFIG_DDB5074 is not set
80# CONFIG_DDB5476 is not set 98# CONFIG_DDB5476 is not set
81# CONFIG_DDB5477 is not set 99# CONFIG_DDB5477 is not set
82# CONFIG_NEC_OSPREY is not set 100# CONFIG_MACH_VR41XX is not set
101# CONFIG_PMC_YOSEMITE is not set
102# CONFIG_QEMU is not set
83# CONFIG_SGI_IP22 is not set 103# CONFIG_SGI_IP22 is not set
84# CONFIG_SOC_AU1X00 is not set 104# CONFIG_SGI_IP27 is not set
85CONFIG_SIBYTE_SB1xxx_SOC=y 105# CONFIG_SGI_IP32 is not set
106# CONFIG_SIBYTE_BIGSUR is not set
86CONFIG_SIBYTE_SWARM=y 107CONFIG_SIBYTE_SWARM=y
87# CONFIG_SIBYTE_SENTOSA is not set 108# CONFIG_SIBYTE_SENTOSA is not set
88# CONFIG_SIBYTE_RHONE is not set 109# CONFIG_SIBYTE_RHONE is not set
@@ -91,9 +112,12 @@ CONFIG_SIBYTE_SWARM=y
91# CONFIG_SIBYTE_LITTLESUR is not set 112# CONFIG_SIBYTE_LITTLESUR is not set
92# CONFIG_SIBYTE_CRHINE is not set 113# CONFIG_SIBYTE_CRHINE is not set
93# CONFIG_SIBYTE_CRHONE is not set 114# CONFIG_SIBYTE_CRHONE is not set
94# CONFIG_SIBYTE_UNKNOWN is not set 115# CONFIG_SNI_RM200_PCI is not set
95CONFIG_SIBYTE_BOARD=y 116# CONFIG_TOSHIBA_JMR3927 is not set
117# CONFIG_TOSHIBA_RBTX4927 is not set
118# CONFIG_TOSHIBA_RBTX4938 is not set
96CONFIG_SIBYTE_SB1250=y 119CONFIG_SIBYTE_SB1250=y
120CONFIG_SIBYTE_SB1xxx_SOC=y
97CONFIG_CPU_SB1_PASS_1=y 121CONFIG_CPU_SB1_PASS_1=y
98# CONFIG_CPU_SB1_PASS_2_1250 is not set 122# CONFIG_CPU_SB1_PASS_2_1250 is not set
99# CONFIG_CPU_SB1_PASS_2_2 is not set 123# CONFIG_CPU_SB1_PASS_2_2 is not set
@@ -102,18 +126,20 @@ CONFIG_CPU_SB1_PASS_1=y
102# CONFIG_CPU_SB1_PASS_3 is not set 126# CONFIG_CPU_SB1_PASS_3 is not set
103CONFIG_SIBYTE_HAS_LDT=y 127CONFIG_SIBYTE_HAS_LDT=y
104# CONFIG_SIMULATION is not set 128# CONFIG_SIMULATION is not set
129# CONFIG_CONFIG_SB1_CEX_ALWAYS_FATAL is not set
130# CONFIG_CONFIG_SB1_CERR_STALL is not set
105CONFIG_SIBYTE_CFE=y 131CONFIG_SIBYTE_CFE=y
106# CONFIG_SIBYTE_CFE_CONSOLE is not set 132# CONFIG_SIBYTE_CFE_CONSOLE is not set
107# CONFIG_SIBYTE_BUS_WATCHER is not set 133# CONFIG_SIBYTE_BUS_WATCHER is not set
108# CONFIG_SIBYTE_SB1250_PROF is not set 134# CONFIG_SIBYTE_SB1250_PROF is not set
109# CONFIG_SIBYTE_TBPROF is not set 135# CONFIG_SIBYTE_TBPROF is not set
110# CONFIG_SNI_RM200_PCI is not set
111# CONFIG_TOSHIBA_RBTX4927 is not set
112CONFIG_RWSEM_GENERIC_SPINLOCK=y 136CONFIG_RWSEM_GENERIC_SPINLOCK=y
113CONFIG_GENERIC_CALIBRATE_DELAY=y 137CONFIG_GENERIC_CALIBRATE_DELAY=y
114CONFIG_HAVE_DEC_LOCK=y
115CONFIG_DMA_COHERENT=y 138CONFIG_DMA_COHERENT=y
139CONFIG_CPU_BIG_ENDIAN=y
116# CONFIG_CPU_LITTLE_ENDIAN is not set 140# CONFIG_CPU_LITTLE_ENDIAN is not set
141CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
142CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
117CONFIG_SWAP_IO_SPACE=y 143CONFIG_SWAP_IO_SPACE=y
118CONFIG_BOOT_ELF32=y 144CONFIG_BOOT_ELF32=y
119CONFIG_MIPS_L1_CACHE_SHIFT=5 145CONFIG_MIPS_L1_CACHE_SHIFT=5
@@ -121,8 +147,10 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
121# 147#
122# CPU selection 148# CPU selection
123# 149#
124# CONFIG_CPU_MIPS32 is not set 150# CONFIG_CPU_MIPS32_R1 is not set
125# CONFIG_CPU_MIPS64 is not set 151# CONFIG_CPU_MIPS32_R2 is not set
152# CONFIG_CPU_MIPS64_R1 is not set
153# CONFIG_CPU_MIPS64_R2 is not set
126# CONFIG_CPU_R3000 is not set 154# CONFIG_CPU_R3000 is not set
127# CONFIG_CPU_TX39XX is not set 155# CONFIG_CPU_TX39XX is not set
128# CONFIG_CPU_VR41XX is not set 156# CONFIG_CPU_VR41XX is not set
@@ -138,22 +166,46 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
138# CONFIG_CPU_RM7000 is not set 166# CONFIG_CPU_RM7000 is not set
139# CONFIG_CPU_RM9000 is not set 167# CONFIG_CPU_RM9000 is not set
140CONFIG_CPU_SB1=y 168CONFIG_CPU_SB1=y
169CONFIG_SYS_HAS_CPU_SB1=y
170CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
171CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
172CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
173CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
174
175#
176# Kernel type
177#
178# CONFIG_32BIT is not set
179CONFIG_64BIT=y
141CONFIG_PAGE_SIZE_4KB=y 180CONFIG_PAGE_SIZE_4KB=y
142# CONFIG_PAGE_SIZE_8KB is not set 181# CONFIG_PAGE_SIZE_8KB is not set
143# CONFIG_PAGE_SIZE_16KB is not set 182# CONFIG_PAGE_SIZE_16KB is not set
144# CONFIG_PAGE_SIZE_64KB is not set 183# CONFIG_PAGE_SIZE_64KB is not set
145# CONFIG_SIBYTE_DMA_PAGEOPS is not set 184# CONFIG_SIBYTE_DMA_PAGEOPS is not set
146CONFIG_CPU_HAS_PREFETCH=y 185CONFIG_CPU_HAS_PREFETCH=y
186# CONFIG_MIPS_MT is not set
147CONFIG_SB1_PASS_1_WORKAROUNDS=y 187CONFIG_SB1_PASS_1_WORKAROUNDS=y
148# CONFIG_64BIT_PHYS_ADDR is not set
149# CONFIG_CPU_ADVANCED is not set
150CONFIG_CPU_HAS_LLSC=y 188CONFIG_CPU_HAS_LLSC=y
151CONFIG_CPU_HAS_LLDSCD=y 189CONFIG_CPU_HAS_LLDSCD=y
152CONFIG_CPU_HAS_SYNC=y 190CONFIG_CPU_HAS_SYNC=y
153# CONFIG_HIGHMEM is not set 191CONFIG_GENERIC_HARDIRQS=y
192CONFIG_GENERIC_IRQ_PROBE=y
193CONFIG_CPU_SUPPORTS_HIGHMEM=y
194CONFIG_SYS_SUPPORTS_HIGHMEM=y
195CONFIG_ARCH_FLATMEM_ENABLE=y
196CONFIG_SELECT_MEMORY_MODEL=y
197CONFIG_FLATMEM_MANUAL=y
198# CONFIG_DISCONTIGMEM_MANUAL is not set
199# CONFIG_SPARSEMEM_MANUAL is not set
200CONFIG_FLATMEM=y
201CONFIG_FLAT_NODE_MEM_MAP=y
202# CONFIG_SPARSEMEM_STATIC is not set
154CONFIG_SMP=y 203CONFIG_SMP=y
155CONFIG_NR_CPUS=2 204CONFIG_NR_CPUS=2
205CONFIG_PREEMPT_NONE=y
206# CONFIG_PREEMPT_VOLUNTARY is not set
156# CONFIG_PREEMPT is not set 207# CONFIG_PREEMPT is not set
208CONFIG_PREEMPT_BKL=y
157 209
158# 210#
159# Bus options (PCI, PCMCIA, EISA, ISA, TC) 211# Bus options (PCI, PCMCIA, EISA, ISA, TC)
@@ -161,7 +213,6 @@ CONFIG_NR_CPUS=2
161CONFIG_HW_HAS_PCI=y 213CONFIG_HW_HAS_PCI=y
162CONFIG_PCI=y 214CONFIG_PCI=y
163CONFIG_PCI_LEGACY_PROC=y 215CONFIG_PCI_LEGACY_PROC=y
164CONFIG_PCI_NAMES=y
165CONFIG_MMU=y 216CONFIG_MMU=y
166 217
167# 218#
@@ -170,10 +221,6 @@ CONFIG_MMU=y
170# CONFIG_PCCARD is not set 221# CONFIG_PCCARD is not set
171 222
172# 223#
173# PC-card bridges
174#
175
176#
177# PCI Hotplug Support 224# PCI Hotplug Support
178# 225#
179# CONFIG_HOTPLUG_PCI is not set 226# CONFIG_HOTPLUG_PCI is not set
@@ -183,7 +230,86 @@ CONFIG_MMU=y
183# 230#
184CONFIG_BINFMT_ELF=y 231CONFIG_BINFMT_ELF=y
185# CONFIG_BINFMT_MISC is not set 232# CONFIG_BINFMT_MISC is not set
186CONFIG_TRAD_SIGNALS=y 233# CONFIG_BUILD_ELF64 is not set
234CONFIG_MIPS32_COMPAT=y
235CONFIG_COMPAT=y
236CONFIG_MIPS32_O32=y
237# CONFIG_MIPS32_N32 is not set
238CONFIG_BINFMT_ELF32=y
239
240#
241# Networking
242#
243CONFIG_NET=y
244
245#
246# Networking options
247#
248CONFIG_PACKET=y
249CONFIG_PACKET_MMAP=y
250CONFIG_UNIX=y
251CONFIG_XFRM=y
252CONFIG_XFRM_USER=m
253CONFIG_NET_KEY=y
254CONFIG_INET=y
255# CONFIG_IP_MULTICAST is not set
256# CONFIG_IP_ADVANCED_ROUTER is not set
257CONFIG_IP_FIB_HASH=y
258CONFIG_IP_PNP=y
259CONFIG_IP_PNP_DHCP=y
260CONFIG_IP_PNP_BOOTP=y
261# CONFIG_IP_PNP_RARP is not set
262# CONFIG_NET_IPIP is not set
263# CONFIG_NET_IPGRE is not set
264# CONFIG_ARPD is not set
265# CONFIG_SYN_COOKIES is not set
266# CONFIG_INET_AH is not set
267# CONFIG_INET_ESP is not set
268# CONFIG_INET_IPCOMP is not set
269CONFIG_INET_TUNNEL=m
270CONFIG_INET_DIAG=y
271CONFIG_INET_TCP_DIAG=y
272# CONFIG_TCP_CONG_ADVANCED is not set
273CONFIG_TCP_CONG_BIC=y
274# CONFIG_IPV6 is not set
275# CONFIG_NETFILTER is not set
276
277#
278# DCCP Configuration (EXPERIMENTAL)
279#
280# CONFIG_IP_DCCP is not set
281
282#
283# SCTP Configuration (EXPERIMENTAL)
284#
285# CONFIG_IP_SCTP is not set
286# CONFIG_ATM is not set
287# CONFIG_BRIDGE is not set
288# CONFIG_VLAN_8021Q is not set
289# CONFIG_DECNET is not set
290# CONFIG_LLC2 is not set
291# CONFIG_IPX is not set
292# CONFIG_ATALK is not set
293# CONFIG_X25 is not set
294# CONFIG_LAPB is not set
295# CONFIG_NET_DIVERT is not set
296# CONFIG_ECONET is not set
297# CONFIG_WAN_ROUTER is not set
298# CONFIG_NET_SCHED is not set
299# CONFIG_NET_CLS_ROUTE is not set
300
301#
302# Network testing
303#
304# CONFIG_NET_PKTGEN is not set
305# CONFIG_HAMRADIO is not set
306# CONFIG_IRDA is not set
307# CONFIG_BT is not set
308CONFIG_IEEE80211=m
309# CONFIG_IEEE80211_DEBUG is not set
310CONFIG_IEEE80211_CRYPT_WEP=m
311CONFIG_IEEE80211_CRYPT_CCMP=m
312CONFIG_IEEE80211_CRYPT_TKIP=m
187 313
188# 314#
189# Device Drivers 315# Device Drivers
@@ -194,7 +320,12 @@ CONFIG_TRAD_SIGNALS=y
194# 320#
195CONFIG_STANDALONE=y 321CONFIG_STANDALONE=y
196CONFIG_PREVENT_FIRMWARE_BUILD=y 322CONFIG_PREVENT_FIRMWARE_BUILD=y
197# CONFIG_FW_LOADER is not set 323CONFIG_FW_LOADER=m
324
325#
326# Connector - unified userspace <-> kernelspace linker
327#
328CONFIG_CONNECTOR=m
198 329
199# 330#
200# Memory Technology Devices (MTD) 331# Memory Technology Devices (MTD)
@@ -213,7 +344,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
213# 344#
214# Block devices 345# Block devices
215# 346#
216# CONFIG_BLK_DEV_FD is not set
217# CONFIG_BLK_CPQ_DA is not set 347# CONFIG_BLK_CPQ_DA is not set
218# CONFIG_BLK_CPQ_CISS_DA is not set 348# CONFIG_BLK_CPQ_CISS_DA is not set
219# CONFIG_BLK_DEV_DAC960 is not set 349# CONFIG_BLK_DEV_DAC960 is not set
@@ -226,8 +356,6 @@ CONFIG_BLK_DEV_RAM=y
226CONFIG_BLK_DEV_RAM_COUNT=16 356CONFIG_BLK_DEV_RAM_COUNT=16
227CONFIG_BLK_DEV_RAM_SIZE=9220 357CONFIG_BLK_DEV_RAM_SIZE=9220
228CONFIG_BLK_DEV_INITRD=y 358CONFIG_BLK_DEV_INITRD=y
229CONFIG_INITRAMFS_SOURCE=""
230# CONFIG_LBD is not set
231CONFIG_CDROM_PKTCDVD=m 359CONFIG_CDROM_PKTCDVD=m
232CONFIG_CDROM_PKTCDVD_BUFFERS=8 360CONFIG_CDROM_PKTCDVD_BUFFERS=8
233# CONFIG_CDROM_PKTCDVD_WCACHE is not set 361# CONFIG_CDROM_PKTCDVD_WCACHE is not set
@@ -263,7 +391,7 @@ CONFIG_BLK_DEV_IDEFLOPPY=y
263# 391#
264CONFIG_IDE_GENERIC=y 392CONFIG_IDE_GENERIC=y
265# CONFIG_BLK_DEV_IDEPCI is not set 393# CONFIG_BLK_DEV_IDEPCI is not set
266CONFIG_BLK_DEV_IDE_SWARM=y 394# CONFIG_BLK_DEV_IDE_SWARM is not set
267# CONFIG_IDE_ARM is not set 395# CONFIG_IDE_ARM is not set
268# CONFIG_BLK_DEV_IDEDMA is not set 396# CONFIG_BLK_DEV_IDEDMA is not set
269# CONFIG_IDEDMA_AUTO is not set 397# CONFIG_IDEDMA_AUTO is not set
@@ -272,6 +400,7 @@ CONFIG_BLK_DEV_IDE_SWARM=y
272# 400#
273# SCSI device support 401# SCSI device support
274# 402#
403CONFIG_RAID_ATTRS=m
275# CONFIG_SCSI is not set 404# CONFIG_SCSI is not set
276 405
277# 406#
@@ -282,6 +411,7 @@ CONFIG_BLK_DEV_IDE_SWARM=y
282# 411#
283# Fusion MPT device support 412# Fusion MPT device support
284# 413#
414# CONFIG_FUSION is not set
285 415
286# 416#
287# IEEE 1394 (FireWire) support 417# IEEE 1394 (FireWire) support
@@ -294,78 +424,13 @@ CONFIG_BLK_DEV_IDE_SWARM=y
294# CONFIG_I2O is not set 424# CONFIG_I2O is not set
295 425
296# 426#
297# Networking support 427# Network device support
298# 428#
299CONFIG_NET=y
300
301#
302# Networking options
303#
304CONFIG_PACKET=y
305CONFIG_PACKET_MMAP=y
306CONFIG_NETLINK_DEV=y
307CONFIG_UNIX=y
308CONFIG_NET_KEY=y
309CONFIG_INET=y
310# CONFIG_IP_MULTICAST is not set
311# CONFIG_IP_ADVANCED_ROUTER is not set
312CONFIG_IP_PNP=y
313CONFIG_IP_PNP_DHCP=y
314CONFIG_IP_PNP_BOOTP=y
315# CONFIG_IP_PNP_RARP is not set
316# CONFIG_NET_IPIP is not set
317# CONFIG_NET_IPGRE is not set
318# CONFIG_ARPD is not set
319# CONFIG_SYN_COOKIES is not set
320# CONFIG_INET_AH is not set
321# CONFIG_INET_ESP is not set
322# CONFIG_INET_IPCOMP is not set
323CONFIG_INET_TUNNEL=m
324CONFIG_IP_TCPDIAG=m
325# CONFIG_IP_TCPDIAG_IPV6 is not set
326# CONFIG_IPV6 is not set
327# CONFIG_NETFILTER is not set
328CONFIG_XFRM=y
329CONFIG_XFRM_USER=m
330
331#
332# SCTP Configuration (EXPERIMENTAL)
333#
334# CONFIG_IP_SCTP is not set
335# CONFIG_ATM is not set
336# CONFIG_BRIDGE is not set
337# CONFIG_VLAN_8021Q is not set
338# CONFIG_DECNET is not set
339# CONFIG_LLC2 is not set
340# CONFIG_IPX is not set
341# CONFIG_ATALK is not set
342# CONFIG_X25 is not set
343# CONFIG_LAPB is not set
344# CONFIG_NET_DIVERT is not set
345# CONFIG_ECONET is not set
346# CONFIG_WAN_ROUTER is not set
347
348#
349# QoS and/or fair queueing
350#
351# CONFIG_NET_SCHED is not set
352# CONFIG_NET_CLS_ROUTE is not set
353
354#
355# Network testing
356#
357# CONFIG_NET_PKTGEN is not set
358# CONFIG_NETPOLL is not set
359# CONFIG_NET_POLL_CONTROLLER is not set
360# CONFIG_HAMRADIO is not set
361# CONFIG_IRDA is not set
362# CONFIG_BT is not set
363CONFIG_NETDEVICES=y 429CONFIG_NETDEVICES=y
364# CONFIG_DUMMY is not set 430# CONFIG_DUMMY is not set
365# CONFIG_BONDING is not set 431# CONFIG_BONDING is not set
366# CONFIG_EQUALIZER is not set 432# CONFIG_EQUALIZER is not set
367# CONFIG_TUN is not set 433# CONFIG_TUN is not set
368# CONFIG_ETHERTAP is not set
369 434
370# 435#
371# ARCnet devices 436# ARCnet devices
@@ -373,6 +438,21 @@ CONFIG_NETDEVICES=y
373# CONFIG_ARCNET is not set 438# CONFIG_ARCNET is not set
374 439
375# 440#
441# PHY device support
442#
443CONFIG_PHYLIB=m
444CONFIG_PHYCONTROL=y
445
446#
447# MII PHY device drivers
448#
449CONFIG_MARVELL_PHY=m
450CONFIG_DAVICOM_PHY=m
451CONFIG_QSEMI_PHY=m
452CONFIG_LXT_PHY=m
453CONFIG_CICADA_PHY=m
454
455#
376# Ethernet (10 or 100Mbit) 456# Ethernet (10 or 100Mbit)
377# 457#
378CONFIG_NET_ETHERNET=y 458CONFIG_NET_ETHERNET=y
@@ -399,12 +479,16 @@ CONFIG_MII=y
399# CONFIG_YELLOWFIN is not set 479# CONFIG_YELLOWFIN is not set
400# CONFIG_R8169 is not set 480# CONFIG_R8169 is not set
401CONFIG_NET_SB1250_MAC=y 481CONFIG_NET_SB1250_MAC=y
482# CONFIG_SIS190 is not set
483# CONFIG_SKGE is not set
402# CONFIG_SK98LIN is not set 484# CONFIG_SK98LIN is not set
403# CONFIG_TIGON3 is not set 485# CONFIG_TIGON3 is not set
486# CONFIG_BNX2 is not set
404 487
405# 488#
406# Ethernet (10000 Mbit) 489# Ethernet (10000 Mbit)
407# 490#
491# CONFIG_CHELSIO_T1 is not set
408# CONFIG_IXGB is not set 492# CONFIG_IXGB is not set
409# CONFIG_S2IO is not set 493# CONFIG_S2IO is not set
410 494
@@ -417,6 +501,8 @@ CONFIG_NET_SB1250_MAC=y
417# Wireless LAN (non-hamradio) 501# Wireless LAN (non-hamradio)
418# 502#
419# CONFIG_NET_RADIO is not set 503# CONFIG_NET_RADIO is not set
504# CONFIG_IPW_DEBUG is not set
505CONFIG_IPW2200=m
420 506
421# 507#
422# Wan interfaces 508# Wan interfaces
@@ -428,6 +514,8 @@ CONFIG_NET_SB1250_MAC=y
428# CONFIG_SLIP is not set 514# CONFIG_SLIP is not set
429# CONFIG_SHAPER is not set 515# CONFIG_SHAPER is not set
430# CONFIG_NETCONSOLE is not set 516# CONFIG_NETCONSOLE is not set
517# CONFIG_NETPOLL is not set
518# CONFIG_NET_POLL_CONTROLLER is not set
431 519
432# 520#
433# ISDN subsystem 521# ISDN subsystem
@@ -445,25 +533,15 @@ CONFIG_NET_SB1250_MAC=y
445# CONFIG_INPUT is not set 533# CONFIG_INPUT is not set
446 534
447# 535#
448# Userland interfaces 536# Hardware I/O ports
449#
450
451#
452# Input I/O drivers
453# 537#
454# CONFIG_GAMEPORT is not set
455CONFIG_SOUND_GAMEPORT=y
456CONFIG_SERIO=y 538CONFIG_SERIO=y
457# CONFIG_SERIO_I8042 is not set 539# CONFIG_SERIO_I8042 is not set
458CONFIG_SERIO_SERPORT=y 540CONFIG_SERIO_SERPORT=y
459# CONFIG_SERIO_CT82C710 is not set
460# CONFIG_SERIO_PCIPS2 is not set 541# CONFIG_SERIO_PCIPS2 is not set
461# CONFIG_SERIO_LIBPS2 is not set 542# CONFIG_SERIO_LIBPS2 is not set
462CONFIG_SERIO_RAW=m 543CONFIG_SERIO_RAW=m
463 544# CONFIG_GAMEPORT is not set
464#
465# Input Device Drivers
466#
467 545
468# 546#
469# Character devices 547# Character devices
@@ -472,11 +550,13 @@ CONFIG_SERIO_RAW=m
472CONFIG_SERIAL_NONSTANDARD=y 550CONFIG_SERIAL_NONSTANDARD=y
473# CONFIG_ROCKETPORT is not set 551# CONFIG_ROCKETPORT is not set
474# CONFIG_CYCLADES is not set 552# CONFIG_CYCLADES is not set
553# CONFIG_DIGIEPCA is not set
475# CONFIG_MOXA_SMARTIO is not set 554# CONFIG_MOXA_SMARTIO is not set
476# CONFIG_ISI is not set 555# CONFIG_ISI is not set
477# CONFIG_SYNCLINK is not set
478# CONFIG_SYNCLINKMP is not set 556# CONFIG_SYNCLINKMP is not set
479# CONFIG_N_HDLC is not set 557# CONFIG_N_HDLC is not set
558# CONFIG_SPECIALIX is not set
559# CONFIG_SX is not set
480# CONFIG_STALDRV is not set 560# CONFIG_STALDRV is not set
481CONFIG_SIBYTE_SB1250_DUART=y 561CONFIG_SIBYTE_SB1250_DUART=y
482CONFIG_SIBYTE_SB1250_DUART_CONSOLE=y 562CONFIG_SIBYTE_SB1250_DUART_CONSOLE=y
@@ -489,6 +569,7 @@ CONFIG_SIBYTE_SB1250_DUART_CONSOLE=y
489# 569#
490# Non-8250 serial port support 570# Non-8250 serial port support
491# 571#
572# CONFIG_SERIAL_JSM is not set
492CONFIG_UNIX98_PTYS=y 573CONFIG_UNIX98_PTYS=y
493CONFIG_LEGACY_PTYS=y 574CONFIG_LEGACY_PTYS=y
494CONFIG_LEGACY_PTY_COUNT=256 575CONFIG_LEGACY_PTY_COUNT=256
@@ -515,6 +596,11 @@ CONFIG_LEGACY_PTY_COUNT=256
515# CONFIG_RAW_DRIVER is not set 596# CONFIG_RAW_DRIVER is not set
516 597
517# 598#
599# TPM devices
600#
601# CONFIG_TCG_TPM is not set
602
603#
518# I2C support 604# I2C support
519# 605#
520# CONFIG_I2C is not set 606# CONFIG_I2C is not set
@@ -525,10 +611,20 @@ CONFIG_LEGACY_PTY_COUNT=256
525# CONFIG_W1 is not set 611# CONFIG_W1 is not set
526 612
527# 613#
614# Hardware Monitoring support
615#
616# CONFIG_HWMON is not set
617# CONFIG_HWMON_VID is not set
618
619#
528# Misc devices 620# Misc devices
529# 621#
530 622
531# 623#
624# Multimedia Capabilities Port drivers
625#
626
627#
532# Multimedia devices 628# Multimedia devices
533# 629#
534# CONFIG_VIDEO_DEV is not set 630# CONFIG_VIDEO_DEV is not set
@@ -542,7 +638,6 @@ CONFIG_LEGACY_PTY_COUNT=256
542# Graphics support 638# Graphics support
543# 639#
544# CONFIG_FB is not set 640# CONFIG_FB is not set
545# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
546 641
547# 642#
548# Sound 643# Sound
@@ -552,13 +647,9 @@ CONFIG_LEGACY_PTY_COUNT=256
552# 647#
553# USB support 648# USB support
554# 649#
555# CONFIG_USB is not set
556CONFIG_USB_ARCH_HAS_HCD=y 650CONFIG_USB_ARCH_HAS_HCD=y
557CONFIG_USB_ARCH_HAS_OHCI=y 651CONFIG_USB_ARCH_HAS_OHCI=y
558 652# CONFIG_USB is not set
559#
560# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
561#
562 653
563# 654#
564# USB Gadget Support 655# USB Gadget Support
@@ -576,12 +667,17 @@ CONFIG_USB_ARCH_HAS_OHCI=y
576# CONFIG_INFINIBAND is not set 667# CONFIG_INFINIBAND is not set
577 668
578# 669#
670# SN Devices
671#
672
673#
579# File systems 674# File systems
580# 675#
581CONFIG_EXT2_FS=y 676CONFIG_EXT2_FS=y
582CONFIG_EXT2_FS_XATTR=y 677CONFIG_EXT2_FS_XATTR=y
583CONFIG_EXT2_FS_POSIX_ACL=y 678CONFIG_EXT2_FS_POSIX_ACL=y
584CONFIG_EXT2_FS_SECURITY=y 679CONFIG_EXT2_FS_SECURITY=y
680# CONFIG_EXT2_FS_XIP is not set
585# CONFIG_EXT3_FS is not set 681# CONFIG_EXT3_FS is not set
586# CONFIG_JBD is not set 682# CONFIG_JBD is not set
587CONFIG_FS_MBCACHE=y 683CONFIG_FS_MBCACHE=y
@@ -591,10 +687,12 @@ CONFIG_FS_POSIX_ACL=y
591# CONFIG_XFS_FS is not set 687# CONFIG_XFS_FS is not set
592# CONFIG_MINIX_FS is not set 688# CONFIG_MINIX_FS is not set
593# CONFIG_ROMFS_FS is not set 689# CONFIG_ROMFS_FS is not set
690CONFIG_INOTIFY=y
594# CONFIG_QUOTA is not set 691# CONFIG_QUOTA is not set
595CONFIG_DNOTIFY=y 692CONFIG_DNOTIFY=y
596# CONFIG_AUTOFS_FS is not set 693# CONFIG_AUTOFS_FS is not set
597# CONFIG_AUTOFS4_FS is not set 694# CONFIG_AUTOFS4_FS is not set
695CONFIG_FUSE_FS=m
598 696
599# 697#
600# CD-ROM/DVD Filesystems 698# CD-ROM/DVD Filesystems
@@ -615,11 +713,10 @@ CONFIG_DNOTIFY=y
615CONFIG_PROC_FS=y 713CONFIG_PROC_FS=y
616CONFIG_PROC_KCORE=y 714CONFIG_PROC_KCORE=y
617CONFIG_SYSFS=y 715CONFIG_SYSFS=y
618# CONFIG_DEVFS_FS is not set
619# CONFIG_DEVPTS_FS_XATTR is not set
620# CONFIG_TMPFS is not set 716# CONFIG_TMPFS is not set
621# CONFIG_HUGETLB_PAGE is not set 717# CONFIG_HUGETLB_PAGE is not set
622CONFIG_RAMFS=y 718CONFIG_RAMFS=y
719CONFIG_RELAYFS_FS=m
623 720
624# 721#
625# Miscellaneous filesystems 722# Miscellaneous filesystems
@@ -643,13 +740,14 @@ CONFIG_RAMFS=y
643# 740#
644CONFIG_NFS_FS=y 741CONFIG_NFS_FS=y
645CONFIG_NFS_V3=y 742CONFIG_NFS_V3=y
743# CONFIG_NFS_V3_ACL is not set
646# CONFIG_NFS_V4 is not set 744# CONFIG_NFS_V4 is not set
647# CONFIG_NFS_DIRECTIO is not set 745# CONFIG_NFS_DIRECTIO is not set
648# CONFIG_NFSD is not set 746# CONFIG_NFSD is not set
649CONFIG_ROOT_NFS=y 747CONFIG_ROOT_NFS=y
650CONFIG_LOCKD=y 748CONFIG_LOCKD=y
651CONFIG_LOCKD_V4=y 749CONFIG_LOCKD_V4=y
652# CONFIG_EXPORTFS is not set 750CONFIG_NFS_COMMON=y
653CONFIG_SUNRPC=y 751CONFIG_SUNRPC=y
654# CONFIG_RPCSEC_GSS_KRB5 is not set 752# CONFIG_RPCSEC_GSS_KRB5 is not set
655# CONFIG_RPCSEC_GSS_SPKM3 is not set 753# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -658,6 +756,7 @@ CONFIG_SUNRPC=y
658# CONFIG_NCP_FS is not set 756# CONFIG_NCP_FS is not set
659# CONFIG_CODA_FS is not set 757# CONFIG_CODA_FS is not set
660# CONFIG_AFS_FS is not set 758# CONFIG_AFS_FS is not set
759# CONFIG_9P_FS is not set
661 760
662# 761#
663# Partition Types 762# Partition Types
@@ -678,7 +777,9 @@ CONFIG_MSDOS_PARTITION=y
678# 777#
679# Kernel hacking 778# Kernel hacking
680# 779#
780# CONFIG_PRINTK_TIME is not set
681# CONFIG_DEBUG_KERNEL is not set 781# CONFIG_DEBUG_KERNEL is not set
782CONFIG_LOG_BUF_SHIFT=15
682CONFIG_CROSSCOMPILE=y 783CONFIG_CROSSCOMPILE=y
683CONFIG_CMDLINE="" 784CONFIG_CMDLINE=""
684# CONFIG_SB1XXX_CORELIS is not set 785# CONFIG_SB1XXX_CORELIS is not set
@@ -695,27 +796,28 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
695# 796#
696CONFIG_CRYPTO=y 797CONFIG_CRYPTO=y
697CONFIG_CRYPTO_HMAC=y 798CONFIG_CRYPTO_HMAC=y
698CONFIG_CRYPTO_NULL=y 799CONFIG_CRYPTO_NULL=m
699CONFIG_CRYPTO_MD4=y 800CONFIG_CRYPTO_MD4=m
700CONFIG_CRYPTO_MD5=y 801CONFIG_CRYPTO_MD5=m
701CONFIG_CRYPTO_SHA1=y 802CONFIG_CRYPTO_SHA1=m
702CONFIG_CRYPTO_SHA256=y 803CONFIG_CRYPTO_SHA256=m
703CONFIG_CRYPTO_SHA512=y 804CONFIG_CRYPTO_SHA512=m
704CONFIG_CRYPTO_WP512=m 805CONFIG_CRYPTO_WP512=m
705CONFIG_CRYPTO_DES=y 806CONFIG_CRYPTO_TGR192=m
706CONFIG_CRYPTO_BLOWFISH=y 807CONFIG_CRYPTO_DES=m
707CONFIG_CRYPTO_TWOFISH=y 808CONFIG_CRYPTO_BLOWFISH=m
708CONFIG_CRYPTO_SERPENT=y 809CONFIG_CRYPTO_TWOFISH=m
810CONFIG_CRYPTO_SERPENT=m
709CONFIG_CRYPTO_AES=m 811CONFIG_CRYPTO_AES=m
710# CONFIG_CRYPTO_CAST5 is not set 812CONFIG_CRYPTO_CAST5=m
711# CONFIG_CRYPTO_CAST6 is not set 813CONFIG_CRYPTO_CAST6=m
712CONFIG_CRYPTO_TEA=m 814CONFIG_CRYPTO_TEA=m
713# CONFIG_CRYPTO_ARC4 is not set 815CONFIG_CRYPTO_ARC4=m
714CONFIG_CRYPTO_KHAZAD=m 816CONFIG_CRYPTO_KHAZAD=m
715CONFIG_CRYPTO_ANUBIS=m 817CONFIG_CRYPTO_ANUBIS=m
716CONFIG_CRYPTO_DEFLATE=y 818CONFIG_CRYPTO_DEFLATE=m
717CONFIG_CRYPTO_MICHAEL_MIC=y 819CONFIG_CRYPTO_MICHAEL_MIC=m
718# CONFIG_CRYPTO_CRC32C is not set 820CONFIG_CRYPTO_CRC32C=m
719# CONFIG_CRYPTO_TEST is not set 821# CONFIG_CRYPTO_TEST is not set
720 822
721# 823#
@@ -726,9 +828,8 @@ CONFIG_CRYPTO_MICHAEL_MIC=y
726# Library routines 828# Library routines
727# 829#
728# CONFIG_CRC_CCITT is not set 830# CONFIG_CRC_CCITT is not set
831CONFIG_CRC16=m
729CONFIG_CRC32=y 832CONFIG_CRC32=y
730# CONFIG_LIBCRC32C is not set 833CONFIG_LIBCRC32C=m
731CONFIG_ZLIB_INFLATE=y 834CONFIG_ZLIB_INFLATE=m
732CONFIG_ZLIB_DEFLATE=y 835CONFIG_ZLIB_DEFLATE=m
733CONFIG_GENERIC_HARDIRQS=y
734CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/sead_defconfig b/arch/mips/configs/sead_defconfig
index dd07e866b128..d835f6db1f41 100644
--- a/arch/mips/configs/sead_defconfig
+++ b/arch/mips/configs/sead_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:10 2005 4# Thu Oct 20 22:27:07 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,22 +11,26 @@ CONFIG_32BIT=y
14CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
22CONFIG_SWAP=y 20CONFIG_LOCALVERSION_AUTO=y
23# CONFIG_SYSVIPC is not set 21# CONFIG_SWAP is not set
22CONFIG_SYSVIPC=y
24# CONFIG_BSD_PROCESS_ACCT is not set 23# CONFIG_BSD_PROCESS_ACCT is not set
25CONFIG_SYSCTL=y 24CONFIG_SYSCTL=y
26# CONFIG_AUDIT is not set
27CONFIG_LOG_BUF_SHIFT=14
28# CONFIG_HOTPLUG is not set 25# CONFIG_HOTPLUG is not set
29# CONFIG_IKCONFIG is not set 26# CONFIG_IKCONFIG is not set
27CONFIG_INITRAMFS_SOURCE=""
30CONFIG_EMBEDDED=y 28CONFIG_EMBEDDED=y
31CONFIG_KALLSYMS=y 29CONFIG_KALLSYMS=y
32# CONFIG_KALLSYMS_EXTRA_PASS is not set 30# CONFIG_KALLSYMS_EXTRA_PASS is not set
31CONFIG_PRINTK=y
32CONFIG_BUG=y
33CONFIG_BASE_FULL=y
33CONFIG_FUTEX=y 34CONFIG_FUTEX=y
34CONFIG_EPOLL=y 35CONFIG_EPOLL=y
35# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 36# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -39,6 +40,7 @@ CONFIG_CC_ALIGN_LABELS=0
39CONFIG_CC_ALIGN_LOOPS=0 40CONFIG_CC_ALIGN_LOOPS=0
40CONFIG_CC_ALIGN_JUMPS=0 41CONFIG_CC_ALIGN_JUMPS=0
41# CONFIG_TINY_SHMEM is not set 42# CONFIG_TINY_SHMEM is not set
43CONFIG_BASE_SMALL=0
42 44
43# 45#
44# Loadable module support 46# Loadable module support
@@ -48,40 +50,69 @@ CONFIG_CC_ALIGN_JUMPS=0
48# 50#
49# Machine selection 51# Machine selection
50# 52#
51# CONFIG_MACH_JAZZ is not set 53# CONFIG_MIPS_MTX1 is not set
52# CONFIG_MACH_VR41XX is not set 54# CONFIG_MIPS_BOSPORUS is not set
53# CONFIG_TOSHIBA_JMR3927 is not set 55# CONFIG_MIPS_PB1000 is not set
56# CONFIG_MIPS_PB1100 is not set
57# CONFIG_MIPS_PB1500 is not set
58# CONFIG_MIPS_PB1550 is not set
59# CONFIG_MIPS_PB1200 is not set
60# CONFIG_MIPS_DB1000 is not set
61# CONFIG_MIPS_DB1100 is not set
62# CONFIG_MIPS_DB1500 is not set
63# CONFIG_MIPS_DB1550 is not set
64# CONFIG_MIPS_DB1200 is not set
65# CONFIG_MIPS_MIRAGE is not set
54# CONFIG_MIPS_COBALT is not set 66# CONFIG_MIPS_COBALT is not set
55# CONFIG_MACH_DECSTATION is not set 67# CONFIG_MACH_DECSTATION is not set
56# CONFIG_MIPS_EV64120 is not set 68# CONFIG_MIPS_EV64120 is not set
57# CONFIG_MIPS_EV96100 is not set 69# CONFIG_MIPS_EV96100 is not set
58# CONFIG_MIPS_IVR is not set 70# CONFIG_MIPS_IVR is not set
59# CONFIG_LASAT is not set
60# CONFIG_MIPS_ITE8172 is not set 71# CONFIG_MIPS_ITE8172 is not set
72# CONFIG_MACH_JAZZ is not set
73# CONFIG_LASAT is not set
61# CONFIG_MIPS_ATLAS is not set 74# CONFIG_MIPS_ATLAS is not set
62# CONFIG_MIPS_MALTA is not set 75# CONFIG_MIPS_MALTA is not set
63CONFIG_MIPS_SEAD=y 76CONFIG_MIPS_SEAD=y
77# CONFIG_MIPS_SIM is not set
78# CONFIG_MOMENCO_JAGUAR_ATX is not set
64# CONFIG_MOMENCO_OCELOT is not set 79# CONFIG_MOMENCO_OCELOT is not set
65# CONFIG_MOMENCO_OCELOT_G is not set
66# CONFIG_MOMENCO_OCELOT_C is not set
67# CONFIG_MOMENCO_OCELOT_3 is not set 80# CONFIG_MOMENCO_OCELOT_3 is not set
68# CONFIG_MOMENCO_JAGUAR_ATX is not set 81# CONFIG_MOMENCO_OCELOT_C is not set
69# CONFIG_PMC_YOSEMITE is not set 82# CONFIG_MOMENCO_OCELOT_G is not set
83# CONFIG_MIPS_XXS1500 is not set
84# CONFIG_PNX8550_V2PCI is not set
85# CONFIG_PNX8550_JBS is not set
70# CONFIG_DDB5074 is not set 86# CONFIG_DDB5074 is not set
71# CONFIG_DDB5476 is not set 87# CONFIG_DDB5476 is not set
72# CONFIG_DDB5477 is not set 88# CONFIG_DDB5477 is not set
73# CONFIG_NEC_OSPREY is not set 89# CONFIG_MACH_VR41XX is not set
90# CONFIG_PMC_YOSEMITE is not set
91# CONFIG_QEMU is not set
74# CONFIG_SGI_IP22 is not set 92# CONFIG_SGI_IP22 is not set
75# CONFIG_SOC_AU1X00 is not set 93# CONFIG_SGI_IP27 is not set
76# CONFIG_SIBYTE_SB1xxx_SOC is not set 94# CONFIG_SGI_IP32 is not set
95# CONFIG_SIBYTE_BIGSUR is not set
96# CONFIG_SIBYTE_SWARM is not set
97# CONFIG_SIBYTE_SENTOSA is not set
98# CONFIG_SIBYTE_RHONE is not set
99# CONFIG_SIBYTE_CARMEL is not set
100# CONFIG_SIBYTE_PTSWARM is not set
101# CONFIG_SIBYTE_LITTLESUR is not set
102# CONFIG_SIBYTE_CRHINE is not set
103# CONFIG_SIBYTE_CRHONE is not set
77# CONFIG_SNI_RM200_PCI is not set 104# CONFIG_SNI_RM200_PCI is not set
105# CONFIG_TOSHIBA_JMR3927 is not set
78# CONFIG_TOSHIBA_RBTX4927 is not set 106# CONFIG_TOSHIBA_RBTX4927 is not set
107# CONFIG_TOSHIBA_RBTX4938 is not set
79CONFIG_RWSEM_GENERIC_SPINLOCK=y 108CONFIG_RWSEM_GENERIC_SPINLOCK=y
80CONFIG_GENERIC_CALIBRATE_DELAY=y 109CONFIG_GENERIC_CALIBRATE_DELAY=y
81CONFIG_HAVE_DEC_LOCK=y
82CONFIG_DMA_NONCOHERENT=y 110CONFIG_DMA_NONCOHERENT=y
83CONFIG_DMA_NEED_PCI_MAP_STATE=y 111CONFIG_DMA_NEED_PCI_MAP_STATE=y
112# CONFIG_CPU_BIG_ENDIAN is not set
84CONFIG_CPU_LITTLE_ENDIAN=y 113CONFIG_CPU_LITTLE_ENDIAN=y
114CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
115CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
85CONFIG_IRQ_CPU=y 116CONFIG_IRQ_CPU=y
86CONFIG_MIPS_BOARDS_GEN=y 117CONFIG_MIPS_BOARDS_GEN=y
87CONFIG_MIPS_L1_CACHE_SHIFT=5 118CONFIG_MIPS_L1_CACHE_SHIFT=5
@@ -89,8 +120,10 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
89# 120#
90# CPU selection 121# CPU selection
91# 122#
92CONFIG_CPU_MIPS32=y 123CONFIG_CPU_MIPS32_R1=y
93# CONFIG_CPU_MIPS64 is not set 124# CONFIG_CPU_MIPS32_R2 is not set
125# CONFIG_CPU_MIPS64_R1 is not set
126# CONFIG_CPU_MIPS64_R2 is not set
94# CONFIG_CPU_R3000 is not set 127# CONFIG_CPU_R3000 is not set
95# CONFIG_CPU_TX39XX is not set 128# CONFIG_CPU_TX39XX is not set
96# CONFIG_CPU_VR41XX is not set 129# CONFIG_CPU_VR41XX is not set
@@ -106,15 +139,42 @@ CONFIG_CPU_MIPS32=y
106# CONFIG_CPU_RM7000 is not set 139# CONFIG_CPU_RM7000 is not set
107# CONFIG_CPU_RM9000 is not set 140# CONFIG_CPU_RM9000 is not set
108# CONFIG_CPU_SB1 is not set 141# CONFIG_CPU_SB1 is not set
142CONFIG_SYS_HAS_CPU_MIPS32_R1=y
143CONFIG_SYS_HAS_CPU_MIPS32_R2=y
144CONFIG_SYS_HAS_CPU_MIPS64_R1=y
145CONFIG_CPU_MIPS32=y
146CONFIG_CPU_MIPSR1=y
147CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
148CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
149CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
150
151#
152# Kernel type
153#
154CONFIG_32BIT=y
155# CONFIG_64BIT is not set
109CONFIG_PAGE_SIZE_4KB=y 156CONFIG_PAGE_SIZE_4KB=y
110# CONFIG_PAGE_SIZE_8KB is not set 157# CONFIG_PAGE_SIZE_8KB is not set
111# CONFIG_PAGE_SIZE_16KB is not set 158# CONFIG_PAGE_SIZE_16KB is not set
112# CONFIG_PAGE_SIZE_64KB is not set 159# CONFIG_PAGE_SIZE_64KB is not set
113CONFIG_CPU_HAS_PREFETCH=y 160CONFIG_CPU_HAS_PREFETCH=y
161# CONFIG_MIPS_MT is not set
114# CONFIG_64BIT_PHYS_ADDR is not set 162# CONFIG_64BIT_PHYS_ADDR is not set
115# CONFIG_CPU_ADVANCED is not set 163# CONFIG_CPU_ADVANCED is not set
116CONFIG_CPU_HAS_LLSC=y 164CONFIG_CPU_HAS_LLSC=y
117CONFIG_CPU_HAS_SYNC=y 165CONFIG_CPU_HAS_SYNC=y
166CONFIG_GENERIC_HARDIRQS=y
167CONFIG_GENERIC_IRQ_PROBE=y
168CONFIG_ARCH_FLATMEM_ENABLE=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_PREEMPT_NONE=y
177# CONFIG_PREEMPT_VOLUNTARY is not set
118# CONFIG_PREEMPT is not set 178# CONFIG_PREEMPT is not set
119 179
120# 180#
@@ -128,10 +188,6 @@ CONFIG_MMU=y
128# CONFIG_PCCARD is not set 188# CONFIG_PCCARD is not set
129 189
130# 190#
131# PC-card bridges
132#
133
134#
135# PCI Hotplug Support 191# PCI Hotplug Support
136# 192#
137 193
@@ -143,6 +199,11 @@ CONFIG_BINFMT_ELF=y
143CONFIG_TRAD_SIGNALS=y 199CONFIG_TRAD_SIGNALS=y
144 200
145# 201#
202# Networking
203#
204# CONFIG_NET is not set
205
206#
146# Device Drivers 207# Device Drivers
147# 208#
148 209
@@ -154,6 +215,10 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
154# CONFIG_FW_LOADER is not set 215# CONFIG_FW_LOADER is not set
155 216
156# 217#
218# Connector - unified userspace <-> kernelspace linker
219#
220
221#
157# Memory Technology Devices (MTD) 222# Memory Technology Devices (MTD)
158# 223#
159# CONFIG_MTD is not set 224# CONFIG_MTD is not set
@@ -170,7 +235,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
170# 235#
171# Block devices 236# Block devices
172# 237#
173# CONFIG_BLK_DEV_FD is not set
174# CONFIG_BLK_DEV_COW_COMMON is not set 238# CONFIG_BLK_DEV_COW_COMMON is not set
175CONFIG_BLK_DEV_LOOP=y 239CONFIG_BLK_DEV_LOOP=y
176# CONFIG_BLK_DEV_CRYPTOLOOP is not set 240# CONFIG_BLK_DEV_CRYPTOLOOP is not set
@@ -178,11 +242,8 @@ CONFIG_BLK_DEV_RAM=y
178CONFIG_BLK_DEV_RAM_COUNT=16 242CONFIG_BLK_DEV_RAM_COUNT=16
179CONFIG_BLK_DEV_RAM_SIZE=18432 243CONFIG_BLK_DEV_RAM_SIZE=18432
180CONFIG_BLK_DEV_INITRD=y 244CONFIG_BLK_DEV_INITRD=y
181CONFIG_INITRAMFS_SOURCE=""
182# CONFIG_LBD is not set 245# CONFIG_LBD is not set
183CONFIG_CDROM_PKTCDVD=y 246# CONFIG_CDROM_PKTCDVD is not set
184CONFIG_CDROM_PKTCDVD_BUFFERS=8
185# CONFIG_CDROM_PKTCDVD_WCACHE is not set
186 247
187# 248#
188# IO Schedulers 249# IO Schedulers
@@ -200,6 +261,7 @@ CONFIG_IOSCHED_CFQ=y
200# 261#
201# SCSI device support 262# SCSI device support
202# 263#
264CONFIG_RAID_ATTRS=y
203# CONFIG_SCSI is not set 265# CONFIG_SCSI is not set
204 266
205# 267#
@@ -210,6 +272,7 @@ CONFIG_IOSCHED_CFQ=y
210# 272#
211# Fusion MPT device support 273# Fusion MPT device support
212# 274#
275# CONFIG_FUSION is not set
213 276
214# 277#
215# IEEE 1394 (FireWire) support 278# IEEE 1394 (FireWire) support
@@ -220,9 +283,8 @@ CONFIG_IOSCHED_CFQ=y
220# 283#
221 284
222# 285#
223# Networking support 286# Network device support
224# 287#
225# CONFIG_NET is not set
226# CONFIG_NETPOLL is not set 288# CONFIG_NETPOLL is not set
227# CONFIG_NET_POLL_CONTROLLER is not set 289# CONFIG_NET_POLL_CONTROLLER is not set
228 290
@@ -238,47 +300,18 @@ CONFIG_IOSCHED_CFQ=y
238# 300#
239# Input device support 301# Input device support
240# 302#
241CONFIG_INPUT=y 303# CONFIG_INPUT is not set
242 304
243# 305#
244# Userland interfaces 306# Hardware I/O ports
245#
246CONFIG_INPUT_MOUSEDEV=y
247CONFIG_INPUT_MOUSEDEV_PSAUX=y
248CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
249CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
250# CONFIG_INPUT_JOYDEV is not set
251# CONFIG_INPUT_TSDEV is not set
252# CONFIG_INPUT_EVDEV is not set
253# CONFIG_INPUT_EVBUG is not set
254
255#
256# Input I/O drivers
257# 307#
308# CONFIG_SERIO is not set
258# CONFIG_GAMEPORT is not set 309# CONFIG_GAMEPORT is not set
259CONFIG_SOUND_GAMEPORT=y
260CONFIG_SERIO=y
261# CONFIG_SERIO_I8042 is not set
262CONFIG_SERIO_SERPORT=y
263# CONFIG_SERIO_CT82C710 is not set
264# CONFIG_SERIO_LIBPS2 is not set
265CONFIG_SERIO_RAW=y
266
267#
268# Input Device Drivers
269#
270# CONFIG_INPUT_KEYBOARD is not set
271# CONFIG_INPUT_MOUSE is not set
272# CONFIG_INPUT_JOYSTICK is not set
273# CONFIG_INPUT_TOUCHSCREEN is not set
274# CONFIG_INPUT_MISC is not set
275 310
276# 311#
277# Character devices 312# Character devices
278# 313#
279CONFIG_VT=y 314# CONFIG_VT is not set
280CONFIG_VT_CONSOLE=y
281CONFIG_HW_CONSOLE=y
282# CONFIG_SERIAL_NONSTANDARD is not set 315# CONFIG_SERIAL_NONSTANDARD is not set
283 316
284# 317#
@@ -294,7 +327,7 @@ CONFIG_SERIAL_8250_NR_UARTS=4
294# 327#
295CONFIG_SERIAL_CORE=y 328CONFIG_SERIAL_CORE=y
296CONFIG_SERIAL_CORE_CONSOLE=y 329CONFIG_SERIAL_CORE_CONSOLE=y
297# CONFIG_UNIX98_PTYS is not set 330CONFIG_UNIX98_PTYS=y
298CONFIG_LEGACY_PTYS=y 331CONFIG_LEGACY_PTYS=y
299CONFIG_LEGACY_PTY_COUNT=256 332CONFIG_LEGACY_PTY_COUNT=256
300 333
@@ -315,10 +348,13 @@ CONFIG_LEGACY_PTY_COUNT=256
315# 348#
316# Ftape, the floppy tape device driver 349# Ftape, the floppy tape device driver
317# 350#
318# CONFIG_DRM is not set
319# CONFIG_RAW_DRIVER is not set 351# CONFIG_RAW_DRIVER is not set
320 352
321# 353#
354# TPM devices
355#
356
357#
322# I2C support 358# I2C support
323# 359#
324# CONFIG_I2C is not set 360# CONFIG_I2C is not set
@@ -329,10 +365,20 @@ CONFIG_LEGACY_PTY_COUNT=256
329# CONFIG_W1 is not set 365# CONFIG_W1 is not set
330 366
331# 367#
368# Hardware Monitoring support
369#
370# CONFIG_HWMON is not set
371# CONFIG_HWMON_VID is not set
372
373#
332# Misc devices 374# Misc devices
333# 375#
334 376
335# 377#
378# Multimedia Capabilities Port drivers
379#
380
381#
336# Multimedia devices 382# Multimedia devices
337# 383#
338# CONFIG_VIDEO_DEV is not set 384# CONFIG_VIDEO_DEV is not set
@@ -347,13 +393,6 @@ CONFIG_LEGACY_PTY_COUNT=256
347# CONFIG_FB is not set 393# CONFIG_FB is not set
348 394
349# 395#
350# Console display driver support
351#
352# CONFIG_VGA_CONSOLE is not set
353CONFIG_DUMMY_CONSOLE=y
354# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
355
356#
357# Sound 396# Sound
358# 397#
359# CONFIG_SOUND is not set 398# CONFIG_SOUND is not set
@@ -365,10 +404,6 @@ CONFIG_DUMMY_CONSOLE=y
365# CONFIG_USB_ARCH_HAS_OHCI is not set 404# CONFIG_USB_ARCH_HAS_OHCI is not set
366 405
367# 406#
368# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
369#
370
371#
372# USB Gadget Support 407# USB Gadget Support
373# 408#
374# CONFIG_USB_GADGET is not set 409# CONFIG_USB_GADGET is not set
@@ -381,28 +416,31 @@ CONFIG_DUMMY_CONSOLE=y
381# 416#
382# InfiniBand support 417# InfiniBand support
383# 418#
384# CONFIG_INFINIBAND is not set 419
420#
421# SN Devices
422#
385 423
386# 424#
387# File systems 425# File systems
388# 426#
389CONFIG_EXT2_FS=y 427CONFIG_EXT2_FS=y
390CONFIG_EXT2_FS_XATTR=y 428# CONFIG_EXT2_FS_XATTR is not set
391CONFIG_EXT2_FS_POSIX_ACL=y 429# CONFIG_EXT2_FS_XIP is not set
392CONFIG_EXT2_FS_SECURITY=y
393# CONFIG_EXT3_FS is not set 430# CONFIG_EXT3_FS is not set
394# CONFIG_JBD is not set 431# CONFIG_JBD is not set
395CONFIG_FS_MBCACHE=y
396# CONFIG_REISERFS_FS is not set 432# CONFIG_REISERFS_FS is not set
397# CONFIG_JFS_FS is not set 433# CONFIG_JFS_FS is not set
398CONFIG_FS_POSIX_ACL=y 434# CONFIG_FS_POSIX_ACL is not set
399# CONFIG_XFS_FS is not set 435# CONFIG_XFS_FS is not set
400# CONFIG_MINIX_FS is not set 436# CONFIG_MINIX_FS is not set
401# CONFIG_ROMFS_FS is not set 437# CONFIG_ROMFS_FS is not set
438CONFIG_INOTIFY=y
402# CONFIG_QUOTA is not set 439# CONFIG_QUOTA is not set
403CONFIG_DNOTIFY=y 440CONFIG_DNOTIFY=y
404# CONFIG_AUTOFS_FS is not set 441# CONFIG_AUTOFS_FS is not set
405# CONFIG_AUTOFS4_FS is not set 442# CONFIG_AUTOFS4_FS is not set
443CONFIG_FUSE_FS=y
406 444
407# 445#
408# CD-ROM/DVD Filesystems 446# CD-ROM/DVD Filesystems
@@ -423,10 +461,10 @@ CONFIG_DNOTIFY=y
423CONFIG_PROC_FS=y 461CONFIG_PROC_FS=y
424CONFIG_PROC_KCORE=y 462CONFIG_PROC_KCORE=y
425CONFIG_SYSFS=y 463CONFIG_SYSFS=y
426# CONFIG_DEVFS_FS is not set
427# CONFIG_TMPFS is not set 464# CONFIG_TMPFS is not set
428# CONFIG_HUGETLB_PAGE is not set 465# CONFIG_HUGETLB_PAGE is not set
429CONFIG_RAMFS=y 466CONFIG_RAMFS=y
467CONFIG_RELAYFS_FS=y
430 468
431# 469#
432# Miscellaneous filesystems 470# Miscellaneous filesystems
@@ -448,8 +486,18 @@ CONFIG_RAMFS=y
448# 486#
449# Partition Types 487# Partition Types
450# 488#
451# CONFIG_PARTITION_ADVANCED is not set 489CONFIG_PARTITION_ADVANCED=y
452CONFIG_MSDOS_PARTITION=y 490# CONFIG_ACORN_PARTITION is not set
491# CONFIG_OSF_PARTITION is not set
492# CONFIG_AMIGA_PARTITION is not set
493# CONFIG_ATARI_PARTITION is not set
494# CONFIG_MAC_PARTITION is not set
495# CONFIG_MSDOS_PARTITION is not set
496# CONFIG_LDM_PARTITION is not set
497# CONFIG_SGI_PARTITION is not set
498# CONFIG_ULTRIX_PARTITION is not set
499# CONFIG_SUN_PARTITION is not set
500# CONFIG_EFI_PARTITION is not set
453 501
454# 502#
455# Native Language Support 503# Native Language Support
@@ -464,15 +512,16 @@ CONFIG_MSDOS_PARTITION=y
464# 512#
465# Kernel hacking 513# Kernel hacking
466# 514#
515# CONFIG_PRINTK_TIME is not set
467# CONFIG_DEBUG_KERNEL is not set 516# CONFIG_DEBUG_KERNEL is not set
517CONFIG_LOG_BUF_SHIFT=14
468CONFIG_CROSSCOMPILE=y 518CONFIG_CROSSCOMPILE=y
469CONFIG_CMDLINE="" 519CONFIG_CMDLINE=""
470 520
471# 521#
472# Security options 522# Security options
473# 523#
474CONFIG_KEYS=y 524# CONFIG_KEYS is not set
475CONFIG_KEYS_DEBUG_PROC_KEYS=y
476# CONFIG_SECURITY is not set 525# CONFIG_SECURITY is not set
477 526
478# 527#
@@ -488,7 +537,6 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
488# Library routines 537# Library routines
489# 538#
490# CONFIG_CRC_CCITT is not set 539# CONFIG_CRC_CCITT is not set
540CONFIG_CRC16=y
491# CONFIG_CRC32 is not set 541# CONFIG_CRC32 is not set
492# CONFIG_LIBCRC32C is not set 542# CONFIG_LIBCRC32C is not set
493CONFIG_GENERIC_HARDIRQS=y
494CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/tb0226_defconfig b/arch/mips/configs/tb0226_defconfig
index c9d3f83caf0f..bf60a17de2b0 100644
--- a/arch/mips/configs/tb0226_defconfig
+++ b/arch/mips/configs/tb0226_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:12 2005 4# Thu Oct 20 22:27:10 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,24 +11,29 @@ CONFIG_32BIT=y
14CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
25# CONFIG_BSD_PROCESS_ACCT is not set 24# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y 25CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set 26# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14
29# CONFIG_HOTPLUG is not set 27# CONFIG_HOTPLUG is not set
30CONFIG_KOBJECT_UEVENT=y 28CONFIG_KOBJECT_UEVENT=y
31# CONFIG_IKCONFIG is not set 29# CONFIG_IKCONFIG is not set
30CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y 31CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y 32CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_EXTRA_PASS is not set 33# CONFIG_KALLSYMS_EXTRA_PASS is not set
34CONFIG_PRINTK=y
35CONFIG_BUG=y
36CONFIG_BASE_FULL=y
35CONFIG_FUTEX=y 37CONFIG_FUTEX=y
36CONFIG_EPOLL=y 38CONFIG_EPOLL=y
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -41,6 +43,7 @@ CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0 43CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0 44CONFIG_CC_ALIGN_JUMPS=0
43# CONFIG_TINY_SHMEM is not set 45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
44 47
45# 48#
46# Loadable module support 49# Loadable module support
@@ -56,55 +59,87 @@ CONFIG_KMOD=y
56# 59#
57# Machine selection 60# Machine selection
58# 61#
59# CONFIG_MACH_JAZZ is not set 62# CONFIG_MIPS_MTX1 is not set
60CONFIG_MACH_VR41XX=y 63# CONFIG_MIPS_BOSPORUS is not set
61# CONFIG_NEC_CMBVR4133 is not set 64# CONFIG_MIPS_PB1000 is not set
62# CONFIG_CASIO_E55 is not set 65# CONFIG_MIPS_PB1100 is not set
63# CONFIG_IBM_WORKPAD is not set 66# CONFIG_MIPS_PB1500 is not set
64CONFIG_TANBAC_TB0226=y 67# CONFIG_MIPS_PB1550 is not set
65# CONFIG_TANBAC_TB0229 is not set 68# CONFIG_MIPS_PB1200 is not set
66# CONFIG_VICTOR_MPC30X is not set 69# CONFIG_MIPS_DB1000 is not set
67# CONFIG_ZAO_CAPCELLA is not set 70# CONFIG_MIPS_DB1100 is not set
68# CONFIG_TOSHIBA_JMR3927 is not set 71# CONFIG_MIPS_DB1500 is not set
72# CONFIG_MIPS_DB1550 is not set
73# CONFIG_MIPS_DB1200 is not set
74# CONFIG_MIPS_MIRAGE is not set
69# CONFIG_MIPS_COBALT is not set 75# CONFIG_MIPS_COBALT is not set
70# CONFIG_MACH_DECSTATION is not set 76# CONFIG_MACH_DECSTATION is not set
71# CONFIG_MIPS_EV64120 is not set 77# CONFIG_MIPS_EV64120 is not set
72# CONFIG_MIPS_EV96100 is not set 78# CONFIG_MIPS_EV96100 is not set
73# CONFIG_MIPS_IVR is not set 79# CONFIG_MIPS_IVR is not set
74# CONFIG_LASAT is not set
75# CONFIG_MIPS_ITE8172 is not set 80# CONFIG_MIPS_ITE8172 is not set
81# CONFIG_MACH_JAZZ is not set
82# CONFIG_LASAT is not set
76# CONFIG_MIPS_ATLAS is not set 83# CONFIG_MIPS_ATLAS is not set
77# CONFIG_MIPS_MALTA is not set 84# CONFIG_MIPS_MALTA is not set
78# CONFIG_MIPS_SEAD is not set 85# CONFIG_MIPS_SEAD is not set
86# CONFIG_MIPS_SIM is not set
87# CONFIG_MOMENCO_JAGUAR_ATX is not set
79# CONFIG_MOMENCO_OCELOT is not set 88# CONFIG_MOMENCO_OCELOT is not set
80# CONFIG_MOMENCO_OCELOT_G is not set
81# CONFIG_MOMENCO_OCELOT_C is not set
82# CONFIG_MOMENCO_OCELOT_3 is not set 89# CONFIG_MOMENCO_OCELOT_3 is not set
83# CONFIG_MOMENCO_JAGUAR_ATX is not set 90# CONFIG_MOMENCO_OCELOT_C is not set
84# CONFIG_PMC_YOSEMITE is not set 91# CONFIG_MOMENCO_OCELOT_G is not set
92# CONFIG_MIPS_XXS1500 is not set
93# CONFIG_PNX8550_V2PCI is not set
94# CONFIG_PNX8550_JBS is not set
85# CONFIG_DDB5074 is not set 95# CONFIG_DDB5074 is not set
86# CONFIG_DDB5476 is not set 96# CONFIG_DDB5476 is not set
87# CONFIG_DDB5477 is not set 97# CONFIG_DDB5477 is not set
88# CONFIG_NEC_OSPREY is not set 98CONFIG_MACH_VR41XX=y
99# CONFIG_PMC_YOSEMITE is not set
100# CONFIG_QEMU is not set
89# CONFIG_SGI_IP22 is not set 101# CONFIG_SGI_IP22 is not set
90# CONFIG_SOC_AU1X00 is not set 102# CONFIG_SGI_IP27 is not set
91# CONFIG_SIBYTE_SB1xxx_SOC is not set 103# CONFIG_SGI_IP32 is not set
104# CONFIG_SIBYTE_BIGSUR is not set
105# CONFIG_SIBYTE_SWARM is not set
106# CONFIG_SIBYTE_SENTOSA is not set
107# CONFIG_SIBYTE_RHONE is not set
108# CONFIG_SIBYTE_CARMEL is not set
109# CONFIG_SIBYTE_PTSWARM is not set
110# CONFIG_SIBYTE_LITTLESUR is not set
111# CONFIG_SIBYTE_CRHINE is not set
112# CONFIG_SIBYTE_CRHONE is not set
92# CONFIG_SNI_RM200_PCI is not set 113# CONFIG_SNI_RM200_PCI is not set
114# CONFIG_TOSHIBA_JMR3927 is not set
93# CONFIG_TOSHIBA_RBTX4927 is not set 115# CONFIG_TOSHIBA_RBTX4927 is not set
116# CONFIG_TOSHIBA_RBTX4938 is not set
117# CONFIG_NEC_CMBVR4133 is not set
118# CONFIG_CASIO_E55 is not set
119# CONFIG_IBM_WORKPAD is not set
120CONFIG_TANBAC_TB022X=y
121CONFIG_TANBAC_TB0226=y
122# CONFIG_VICTOR_MPC30X is not set
123# CONFIG_ZAO_CAPCELLA is not set
124CONFIG_PCI_VR41XX=y
125# CONFIG_VRC4173 is not set
94CONFIG_RWSEM_GENERIC_SPINLOCK=y 126CONFIG_RWSEM_GENERIC_SPINLOCK=y
95CONFIG_GENERIC_CALIBRATE_DELAY=y 127CONFIG_GENERIC_CALIBRATE_DELAY=y
96CONFIG_HAVE_DEC_LOCK=y
97CONFIG_DMA_NONCOHERENT=y 128CONFIG_DMA_NONCOHERENT=y
98CONFIG_DMA_NEED_PCI_MAP_STATE=y 129CONFIG_DMA_NEED_PCI_MAP_STATE=y
130# CONFIG_CPU_BIG_ENDIAN is not set
99CONFIG_CPU_LITTLE_ENDIAN=y 131CONFIG_CPU_LITTLE_ENDIAN=y
132CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
100CONFIG_IRQ_CPU=y 133CONFIG_IRQ_CPU=y
101CONFIG_MIPS_L1_CACHE_SHIFT=5 134CONFIG_MIPS_L1_CACHE_SHIFT=5
102 135
103# 136#
104# CPU selection 137# CPU selection
105# 138#
106# CONFIG_CPU_MIPS32 is not set 139# CONFIG_CPU_MIPS32_R1 is not set
107# CONFIG_CPU_MIPS64 is not set 140# CONFIG_CPU_MIPS32_R2 is not set
141# CONFIG_CPU_MIPS64_R1 is not set
142# CONFIG_CPU_MIPS64_R2 is not set
108# CONFIG_CPU_R3000 is not set 143# CONFIG_CPU_R3000 is not set
109# CONFIG_CPU_TX39XX is not set 144# CONFIG_CPU_TX39XX is not set
110CONFIG_CPU_VR41XX=y 145CONFIG_CPU_VR41XX=y
@@ -120,19 +155,44 @@ CONFIG_CPU_VR41XX=y
120# CONFIG_CPU_RM7000 is not set 155# CONFIG_CPU_RM7000 is not set
121# CONFIG_CPU_RM9000 is not set 156# CONFIG_CPU_RM9000 is not set
122# CONFIG_CPU_SB1 is not set 157# CONFIG_CPU_SB1 is not set
158CONFIG_SYS_HAS_CPU_VR41XX=y
159CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
160CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
161CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
162CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
163
164#
165# Kernel type
166#
167CONFIG_32BIT=y
168# CONFIG_64BIT is not set
123CONFIG_PAGE_SIZE_4KB=y 169CONFIG_PAGE_SIZE_4KB=y
124# CONFIG_PAGE_SIZE_8KB is not set 170# CONFIG_PAGE_SIZE_8KB is not set
125# CONFIG_PAGE_SIZE_16KB is not set 171# CONFIG_PAGE_SIZE_16KB is not set
126# CONFIG_PAGE_SIZE_64KB is not set 172# CONFIG_PAGE_SIZE_64KB is not set
173# CONFIG_MIPS_MT is not set
127# CONFIG_CPU_ADVANCED is not set 174# CONFIG_CPU_ADVANCED is not set
128CONFIG_CPU_HAS_SYNC=y 175CONFIG_CPU_HAS_SYNC=y
176CONFIG_GENERIC_HARDIRQS=y
177CONFIG_GENERIC_IRQ_PROBE=y
178CONFIG_ARCH_FLATMEM_ENABLE=y
179CONFIG_SELECT_MEMORY_MODEL=y
180CONFIG_FLATMEM_MANUAL=y
181# CONFIG_DISCONTIGMEM_MANUAL is not set
182# CONFIG_SPARSEMEM_MANUAL is not set
183CONFIG_FLATMEM=y
184CONFIG_FLAT_NODE_MEM_MAP=y
185# CONFIG_SPARSEMEM_STATIC is not set
186CONFIG_PREEMPT_NONE=y
187# CONFIG_PREEMPT_VOLUNTARY is not set
129# CONFIG_PREEMPT is not set 188# CONFIG_PREEMPT is not set
130 189
131# 190#
132# Bus options (PCI, PCMCIA, EISA, ISA, TC) 191# Bus options (PCI, PCMCIA, EISA, ISA, TC)
133# 192#
134CONFIG_HW_HAS_PCI=y 193CONFIG_HW_HAS_PCI=y
135# CONFIG_PCI is not set 194CONFIG_PCI=y
195# CONFIG_PCI_LEGACY_PROC is not set
136CONFIG_MMU=y 196CONFIG_MMU=y
137 197
138# 198#
@@ -141,12 +201,9 @@ CONFIG_MMU=y
141# CONFIG_PCCARD is not set 201# CONFIG_PCCARD is not set
142 202
143# 203#
144# PC-card bridges
145#
146
147#
148# PCI Hotplug Support 204# PCI Hotplug Support
149# 205#
206# CONFIG_HOTPLUG_PCI is not set
150 207
151# 208#
152# Executable file formats 209# Executable file formats
@@ -156,6 +213,87 @@ CONFIG_BINFMT_ELF=y
156CONFIG_TRAD_SIGNALS=y 213CONFIG_TRAD_SIGNALS=y
157 214
158# 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
227CONFIG_XFRM_USER=m
228# CONFIG_NET_KEY is not set
229CONFIG_INET=y
230CONFIG_IP_MULTICAST=y
231CONFIG_IP_ADVANCED_ROUTER=y
232CONFIG_ASK_IP_FIB_HASH=y
233# CONFIG_IP_FIB_TRIE is not set
234CONFIG_IP_FIB_HASH=y
235CONFIG_IP_MULTIPLE_TABLES=y
236CONFIG_IP_ROUTE_MULTIPATH=y
237# CONFIG_IP_ROUTE_MULTIPATH_CACHED is not set
238CONFIG_IP_ROUTE_VERBOSE=y
239CONFIG_IP_PNP=y
240# CONFIG_IP_PNP_DHCP is not set
241CONFIG_IP_PNP_BOOTP=y
242# CONFIG_IP_PNP_RARP is not set
243# CONFIG_NET_IPIP is not set
244# CONFIG_NET_IPGRE is not set
245# CONFIG_IP_MROUTE is not set
246# CONFIG_ARPD is not set
247CONFIG_SYN_COOKIES=y
248# CONFIG_INET_AH is not set
249# CONFIG_INET_ESP is not set
250# CONFIG_INET_IPCOMP is not set
251CONFIG_INET_TUNNEL=m
252CONFIG_INET_DIAG=y
253CONFIG_INET_TCP_DIAG=y
254# CONFIG_TCP_CONG_ADVANCED is not set
255CONFIG_TCP_CONG_BIC=y
256# CONFIG_IPV6 is not set
257# CONFIG_NETFILTER is not set
258
259#
260# DCCP Configuration (EXPERIMENTAL)
261#
262# CONFIG_IP_DCCP is not set
263
264#
265# SCTP Configuration (EXPERIMENTAL)
266#
267# CONFIG_IP_SCTP 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_NET_DIVERT is not set
278# CONFIG_ECONET is not set
279# CONFIG_WAN_ROUTER is not set
280# CONFIG_NET_SCHED is not set
281# CONFIG_NET_CLS_ROUTE is not set
282
283#
284# Network testing
285#
286# CONFIG_NET_PKTGEN is not set
287# CONFIG_HAMRADIO is not set
288# CONFIG_IRDA is not set
289# CONFIG_BT is not set
290CONFIG_IEEE80211=m
291# CONFIG_IEEE80211_DEBUG is not set
292CONFIG_IEEE80211_CRYPT_WEP=m
293CONFIG_IEEE80211_CRYPT_CCMP=m
294CONFIG_IEEE80211_CRYPT_TKIP=m
295
296#
159# Device Drivers 297# Device Drivers
160# 298#
161 299
@@ -167,6 +305,11 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
167# CONFIG_FW_LOADER is not set 305# CONFIG_FW_LOADER is not set
168 306
169# 307#
308# Connector - unified userspace <-> kernelspace linker
309#
310CONFIG_CONNECTOR=m
311
312#
170# Memory Technology Devices (MTD) 313# Memory Technology Devices (MTD)
171# 314#
172# CONFIG_MTD is not set 315# CONFIG_MTD is not set
@@ -183,19 +326,21 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
183# 326#
184# Block devices 327# Block devices
185# 328#
186# CONFIG_BLK_DEV_FD is not set 329# CONFIG_BLK_CPQ_DA is not set
330# CONFIG_BLK_CPQ_CISS_DA is not set
331# CONFIG_BLK_DEV_DAC960 is not set
332# CONFIG_BLK_DEV_UMEM is not set
187# CONFIG_BLK_DEV_COW_COMMON is not set 333# CONFIG_BLK_DEV_COW_COMMON is not set
188CONFIG_BLK_DEV_LOOP=m 334CONFIG_BLK_DEV_LOOP=m
189# CONFIG_BLK_DEV_CRYPTOLOOP is not set 335# CONFIG_BLK_DEV_CRYPTOLOOP is not set
190CONFIG_BLK_DEV_NBD=m 336CONFIG_BLK_DEV_NBD=m
337# CONFIG_BLK_DEV_SX8 is not set
338# CONFIG_BLK_DEV_UB is not set
191CONFIG_BLK_DEV_RAM=m 339CONFIG_BLK_DEV_RAM=m
192CONFIG_BLK_DEV_RAM_COUNT=16 340CONFIG_BLK_DEV_RAM_COUNT=16
193CONFIG_BLK_DEV_RAM_SIZE=4096 341CONFIG_BLK_DEV_RAM_SIZE=4096
194CONFIG_INITRAMFS_SOURCE=""
195# CONFIG_LBD is not set 342# CONFIG_LBD is not set
196CONFIG_CDROM_PKTCDVD=m 343# CONFIG_CDROM_PKTCDVD is not set
197CONFIG_CDROM_PKTCDVD_BUFFERS=8
198# CONFIG_CDROM_PKTCDVD_WCACHE is not set
199 344
200# 345#
201# IO Schedulers 346# IO Schedulers
@@ -209,33 +354,12 @@ CONFIG_ATA_OVER_ETH=m
209# 354#
210# ATA/ATAPI/MFM/RLL support 355# ATA/ATAPI/MFM/RLL support
211# 356#
212CONFIG_IDE=y 357# CONFIG_IDE is not set
213CONFIG_BLK_DEV_IDE=y
214
215#
216# Please see Documentation/ide.txt for help/info on IDE drives
217#
218# CONFIG_BLK_DEV_IDE_SATA is not set
219CONFIG_BLK_DEV_IDEDISK=y
220CONFIG_IDEDISK_MULTI_MODE=y
221# CONFIG_BLK_DEV_IDECD is not set
222# CONFIG_BLK_DEV_IDETAPE is not set
223# CONFIG_BLK_DEV_IDEFLOPPY is not set
224CONFIG_BLK_DEV_IDESCSI=y
225# CONFIG_IDE_TASK_IOCTL is not set
226
227#
228# IDE chipset support/bugfixes
229#
230CONFIG_IDE_GENERIC=y
231# CONFIG_IDE_ARM is not set
232# CONFIG_BLK_DEV_IDEDMA is not set
233# CONFIG_IDEDMA_AUTO is not set
234# CONFIG_BLK_DEV_HD is not set
235 358
236# 359#
237# SCSI device support 360# SCSI device support
238# 361#
362# CONFIG_RAID_ATTRS is not set
239CONFIG_SCSI=y 363CONFIG_SCSI=y
240CONFIG_SCSI_PROC_FS=y 364CONFIG_SCSI_PROC_FS=y
241 365
@@ -245,15 +369,15 @@ CONFIG_SCSI_PROC_FS=y
245CONFIG_BLK_DEV_SD=y 369CONFIG_BLK_DEV_SD=y
246# CONFIG_CHR_DEV_ST is not set 370# CONFIG_CHR_DEV_ST is not set
247# CONFIG_CHR_DEV_OSST is not set 371# CONFIG_CHR_DEV_OSST is not set
248CONFIG_BLK_DEV_SR=y 372# CONFIG_BLK_DEV_SR is not set
249# CONFIG_BLK_DEV_SR_VENDOR is not set 373# CONFIG_CHR_DEV_SG is not set
250CONFIG_CHR_DEV_SG=y 374# CONFIG_CHR_DEV_SCH is not set
251 375
252# 376#
253# Some SCSI devices (e.g. CD jukebox) support multiple LUNs 377# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
254# 378#
255CONFIG_SCSI_MULTI_LUN=y 379CONFIG_SCSI_MULTI_LUN=y
256CONFIG_SCSI_CONSTANTS=y 380# CONFIG_SCSI_CONSTANTS is not set
257# CONFIG_SCSI_LOGGING is not set 381# CONFIG_SCSI_LOGGING is not set
258 382
259# 383#
@@ -262,11 +386,42 @@ CONFIG_SCSI_CONSTANTS=y
262# CONFIG_SCSI_SPI_ATTRS is not set 386# CONFIG_SCSI_SPI_ATTRS is not set
263# CONFIG_SCSI_FC_ATTRS is not set 387# CONFIG_SCSI_FC_ATTRS is not set
264# CONFIG_SCSI_ISCSI_ATTRS is not set 388# CONFIG_SCSI_ISCSI_ATTRS is not set
389# CONFIG_SCSI_SAS_ATTRS is not set
265 390
266# 391#
267# SCSI low-level drivers 392# SCSI low-level drivers
268# 393#
394# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
395# CONFIG_SCSI_3W_9XXX is not set
396# CONFIG_SCSI_ACARD is not set
397# CONFIG_SCSI_AACRAID is not set
398# CONFIG_SCSI_AIC7XXX is not set
399# CONFIG_SCSI_AIC7XXX_OLD is not set
400# CONFIG_SCSI_AIC79XX is not set
401# CONFIG_SCSI_DPT_I2O is not set
402# CONFIG_MEGARAID_NEWGEN is not set
403# CONFIG_MEGARAID_LEGACY is not set
269# CONFIG_SCSI_SATA is not set 404# CONFIG_SCSI_SATA is not set
405# CONFIG_SCSI_DMX3191D is not set
406# CONFIG_SCSI_FUTURE_DOMAIN is not set
407# CONFIG_SCSI_IPS is not set
408# CONFIG_SCSI_INITIO is not set
409# CONFIG_SCSI_INIA100 is not set
410# CONFIG_SCSI_SYM53C8XX_2 is not set
411# CONFIG_SCSI_IPR is not set
412# CONFIG_SCSI_QLOGIC_FC is not set
413# CONFIG_SCSI_QLOGIC_1280 is not set
414CONFIG_SCSI_QLA2XXX=y
415# CONFIG_SCSI_QLA21XX is not set
416# CONFIG_SCSI_QLA22XX is not set
417# CONFIG_SCSI_QLA2300 is not set
418# CONFIG_SCSI_QLA2322 is not set
419# CONFIG_SCSI_QLA6312 is not set
420# CONFIG_SCSI_QLA24XX is not set
421# CONFIG_SCSI_LPFC is not set
422# CONFIG_SCSI_DC395x is not set
423# CONFIG_SCSI_DC390T is not set
424# CONFIG_SCSI_NSP32 is not set
270# CONFIG_SCSI_DEBUG is not set 425# CONFIG_SCSI_DEBUG is not set
271 426
272# 427#
@@ -277,131 +432,132 @@ CONFIG_SCSI_CONSTANTS=y
277# 432#
278# Fusion MPT device support 433# Fusion MPT device support
279# 434#
435# CONFIG_FUSION is not set
436# CONFIG_FUSION_SPI is not set
437# CONFIG_FUSION_FC is not set
280 438
281# 439#
282# IEEE 1394 (FireWire) support 440# IEEE 1394 (FireWire) support
283# 441#
442# CONFIG_IEEE1394 is not set
284 443
285# 444#
286# I2O device support 445# I2O device support
287# 446#
447# CONFIG_I2O is not set
288 448
289# 449#
290# Networking support 450# Network device support
291#
292CONFIG_NET=y
293
294#
295# Networking options
296# 451#
297CONFIG_PACKET=y 452CONFIG_NETDEVICES=y
298# CONFIG_PACKET_MMAP is not set 453# CONFIG_DUMMY is not set
299CONFIG_NETLINK_DEV=m 454# CONFIG_BONDING is not set
300CONFIG_UNIX=y 455# CONFIG_EQUALIZER is not set
301# CONFIG_NET_KEY is not set 456# CONFIG_TUN is not set
302CONFIG_INET=y
303CONFIG_IP_MULTICAST=y
304CONFIG_IP_ADVANCED_ROUTER=y
305CONFIG_IP_MULTIPLE_TABLES=y
306CONFIG_IP_ROUTE_MULTIPATH=y
307CONFIG_IP_ROUTE_VERBOSE=y
308CONFIG_IP_PNP=y
309# CONFIG_IP_PNP_DHCP is not set
310CONFIG_IP_PNP_BOOTP=y
311# CONFIG_IP_PNP_RARP is not set
312# CONFIG_NET_IPIP is not set
313# CONFIG_NET_IPGRE is not set
314# CONFIG_IP_MROUTE is not set
315# CONFIG_ARPD is not set
316CONFIG_SYN_COOKIES=y
317# CONFIG_INET_AH is not set
318# CONFIG_INET_ESP is not set
319# CONFIG_INET_IPCOMP is not set
320CONFIG_INET_TUNNEL=m
321CONFIG_IP_TCPDIAG=m
322# CONFIG_IP_TCPDIAG_IPV6 is not set
323# CONFIG_IPV6 is not set
324# CONFIG_NETFILTER is not set
325CONFIG_XFRM=y
326CONFIG_XFRM_USER=m
327 457
328# 458#
329# SCTP Configuration (EXPERIMENTAL) 459# ARCnet devices
330# 460#
331# CONFIG_IP_SCTP is not set 461# CONFIG_ARCNET is not set
332# CONFIG_ATM is not set
333# CONFIG_BRIDGE is not set
334# CONFIG_VLAN_8021Q is not set
335# CONFIG_DECNET is not set
336# CONFIG_LLC2 is not set
337# CONFIG_IPX is not set
338# CONFIG_ATALK is not set
339# CONFIG_X25 is not set
340# CONFIG_LAPB is not set
341# CONFIG_NET_DIVERT is not set
342# CONFIG_ECONET is not set
343# CONFIG_WAN_ROUTER is not set
344 462
345# 463#
346# QoS and/or fair queueing 464# PHY device support
347# 465#
348# CONFIG_NET_SCHED is not set 466CONFIG_PHYLIB=m
349# CONFIG_NET_CLS_ROUTE is not set 467CONFIG_PHYCONTROL=y
350 468
351# 469#
352# Network testing 470# MII PHY device drivers
353# 471#
354# CONFIG_NET_PKTGEN is not set 472CONFIG_MARVELL_PHY=m
355# CONFIG_NETPOLL is not set 473CONFIG_DAVICOM_PHY=m
356# CONFIG_NET_POLL_CONTROLLER is not set 474CONFIG_QSEMI_PHY=m
357# CONFIG_HAMRADIO is not set 475CONFIG_LXT_PHY=m
358# CONFIG_IRDA is not set 476CONFIG_CICADA_PHY=m
359# CONFIG_BT is not set
360CONFIG_NETDEVICES=y
361# CONFIG_DUMMY is not set
362# CONFIG_BONDING is not set
363# CONFIG_EQUALIZER is not set
364# CONFIG_TUN is not set
365# CONFIG_ETHERTAP is not set
366 477
367# 478#
368# Ethernet (10 or 100Mbit) 479# Ethernet (10 or 100Mbit)
369# 480#
370CONFIG_NET_ETHERNET=y 481CONFIG_NET_ETHERNET=y
371# CONFIG_MII is not set 482CONFIG_MII=y
483# CONFIG_HAPPYMEAL is not set
484# CONFIG_SUNGEM is not set
485# CONFIG_NET_VENDOR_3COM is not set
486
487#
488# Tulip family network device support
489#
490# CONFIG_NET_TULIP is not set
491# CONFIG_HP100 is not set
492CONFIG_NET_PCI=y
493# CONFIG_PCNET32 is not set
494# CONFIG_AMD8111_ETH is not set
495# CONFIG_ADAPTEC_STARFIRE is not set
496# CONFIG_B44 is not set
497# CONFIG_FORCEDETH is not set
498# CONFIG_DGRS is not set
499CONFIG_EEPRO100=y
500# CONFIG_E100 is not set
501# CONFIG_FEALNX is not set
502# CONFIG_NATSEMI is not set
503# CONFIG_NE2K_PCI is not set
504# CONFIG_8139CP is not set
505# CONFIG_8139TOO is not set
506# CONFIG_SIS900 is not set
507# CONFIG_EPIC100 is not set
508# CONFIG_SUNDANCE is not set
509# CONFIG_TLAN is not set
510# CONFIG_VIA_RHINE is not set
511# CONFIG_LAN_SAA9730 is not set
372 512
373# 513#
374# Ethernet (1000 Mbit) 514# Ethernet (1000 Mbit)
375# 515#
516# CONFIG_ACENIC is not set
517# CONFIG_DL2K is not set
518# CONFIG_E1000 is not set
519# CONFIG_NS83820 is not set
520# CONFIG_HAMACHI is not set
521# CONFIG_YELLOWFIN is not set
522# CONFIG_R8169 is not set
523# CONFIG_SIS190 is not set
524# CONFIG_SKGE is not set
525# CONFIG_SK98LIN is not set
526# CONFIG_VIA_VELOCITY is not set
527# CONFIG_TIGON3 is not set
528# CONFIG_BNX2 is not set
376 529
377# 530#
378# Ethernet (10000 Mbit) 531# Ethernet (10000 Mbit)
379# 532#
533# CONFIG_CHELSIO_T1 is not set
534# CONFIG_IXGB is not set
535# CONFIG_S2IO is not set
380 536
381# 537#
382# Token Ring devices 538# Token Ring devices
383# 539#
540# CONFIG_TR is not set
384 541
385# 542#
386# Wireless LAN (non-hamradio) 543# Wireless LAN (non-hamradio)
387# 544#
388# CONFIG_NET_RADIO is not set 545# CONFIG_NET_RADIO is not set
546# CONFIG_IPW2200 is not set
389 547
390# 548#
391# Wan interfaces 549# Wan interfaces
392# 550#
393# CONFIG_WAN is not set 551# CONFIG_WAN is not set
394CONFIG_PPP=m 552# CONFIG_FDDI is not set
395CONFIG_PPP_MULTILINK=y 553# CONFIG_HIPPI is not set
396# CONFIG_PPP_FILTER is not set 554# CONFIG_PPP is not set
397CONFIG_PPP_ASYNC=m
398CONFIG_PPP_SYNC_TTY=m
399CONFIG_PPP_DEFLATE=m
400CONFIG_PPP_BSDCOMP=m
401CONFIG_PPPOE=m
402# CONFIG_SLIP is not set 555# CONFIG_SLIP is not set
556# CONFIG_NET_FC is not set
403# CONFIG_SHAPER is not set 557# CONFIG_SHAPER is not set
404# CONFIG_NETCONSOLE is not set 558# CONFIG_NETCONSOLE is not set
559# CONFIG_NETPOLL is not set
560# CONFIG_NET_POLL_CONTROLLER is not set
405 561
406# 562#
407# ISDN subsystem 563# ISDN subsystem
@@ -421,28 +577,13 @@ CONFIG_INPUT=y
421# 577#
422# Userland interfaces 578# Userland interfaces
423# 579#
424CONFIG_INPUT_MOUSEDEV=y 580# CONFIG_INPUT_MOUSEDEV is not set
425CONFIG_INPUT_MOUSEDEV_PSAUX=y
426CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
427CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
428# CONFIG_INPUT_JOYDEV is not set 581# CONFIG_INPUT_JOYDEV is not set
429# CONFIG_INPUT_TSDEV is not set 582# CONFIG_INPUT_TSDEV is not set
430# CONFIG_INPUT_EVDEV is not set 583# CONFIG_INPUT_EVDEV is not set
431# CONFIG_INPUT_EVBUG is not set 584# CONFIG_INPUT_EVBUG is not set
432 585
433# 586#
434# Input I/O drivers
435#
436# CONFIG_GAMEPORT is not set
437CONFIG_SOUND_GAMEPORT=y
438CONFIG_SERIO=y
439CONFIG_SERIO_I8042=y
440CONFIG_SERIO_SERPORT=y
441# CONFIG_SERIO_CT82C710 is not set
442# CONFIG_SERIO_LIBPS2 is not set
443CONFIG_SERIO_RAW=m
444
445#
446# Input Device Drivers 587# Input Device Drivers
447# 588#
448# CONFIG_INPUT_KEYBOARD is not set 589# CONFIG_INPUT_KEYBOARD is not set
@@ -452,6 +593,12 @@ CONFIG_SERIO_RAW=m
452# CONFIG_INPUT_MISC is not set 593# CONFIG_INPUT_MISC is not set
453 594
454# 595#
596# Hardware I/O ports
597#
598# CONFIG_SERIO is not set
599# CONFIG_GAMEPORT is not set
600
601#
455# Character devices 602# Character devices
456# 603#
457CONFIG_VT=y 604CONFIG_VT=y
@@ -462,16 +609,16 @@ CONFIG_HW_CONSOLE=y
462# 609#
463# Serial drivers 610# Serial drivers
464# 611#
465CONFIG_SERIAL_8250=y 612# CONFIG_SERIAL_8250 is not set
466CONFIG_SERIAL_8250_CONSOLE=y
467CONFIG_SERIAL_8250_NR_UARTS=4
468# CONFIG_SERIAL_8250_EXTENDED is not set
469 613
470# 614#
471# Non-8250 serial port support 615# Non-8250 serial port support
472# 616#
473CONFIG_SERIAL_CORE=y 617CONFIG_SERIAL_CORE=y
474CONFIG_SERIAL_CORE_CONSOLE=y 618CONFIG_SERIAL_CORE_CONSOLE=y
619CONFIG_SERIAL_VR41XX=y
620CONFIG_SERIAL_VR41XX_CONSOLE=y
621# CONFIG_SERIAL_JSM is not set
475CONFIG_UNIX98_PTYS=y 622CONFIG_UNIX98_PTYS=y
476CONFIG_LEGACY_PTYS=y 623CONFIG_LEGACY_PTYS=y
477CONFIG_LEGACY_PTY_COUNT=256 624CONFIG_LEGACY_PTY_COUNT=256
@@ -489,14 +636,22 @@ CONFIG_LEGACY_PTY_COUNT=256
489# CONFIG_GEN_RTC is not set 636# CONFIG_GEN_RTC is not set
490# CONFIG_DTLK is not set 637# CONFIG_DTLK is not set
491# CONFIG_R3964 is not set 638# CONFIG_R3964 is not set
639# CONFIG_APPLICOM is not set
640# CONFIG_TANBAC_TB0219 is not set
492 641
493# 642#
494# Ftape, the floppy tape device driver 643# Ftape, the floppy tape device driver
495# 644#
496# CONFIG_DRM is not set 645# CONFIG_DRM is not set
646CONFIG_GPIO_VR41XX=y
497# CONFIG_RAW_DRIVER is not set 647# CONFIG_RAW_DRIVER is not set
498 648
499# 649#
650# TPM devices
651#
652# CONFIG_TCG_TPM is not set
653
654#
500# I2C support 655# I2C support
501# 656#
502# CONFIG_I2C is not set 657# CONFIG_I2C is not set
@@ -507,10 +662,20 @@ CONFIG_LEGACY_PTY_COUNT=256
507# CONFIG_W1 is not set 662# CONFIG_W1 is not set
508 663
509# 664#
665# Hardware Monitoring support
666#
667# CONFIG_HWMON is not set
668# CONFIG_HWMON_VID is not set
669
670#
510# Misc devices 671# Misc devices
511# 672#
512 673
513# 674#
675# Multimedia Capabilities Port drivers
676#
677
678#
514# Multimedia devices 679# Multimedia devices
515# 680#
516# CONFIG_VIDEO_DEV is not set 681# CONFIG_VIDEO_DEV is not set
@@ -523,48 +688,147 @@ CONFIG_LEGACY_PTY_COUNT=256
523# 688#
524# Graphics support 689# Graphics support
525# 690#
526CONFIG_FB=y 691# CONFIG_FB is not set
527# CONFIG_FB_MODE_HELPERS is not set
528# CONFIG_FB_TILEBLITTING is not set
529# CONFIG_FB_VIRTUAL is not set
530 692
531# 693#
532# Console display driver support 694# Console display driver support
533# 695#
534# CONFIG_VGA_CONSOLE is not set 696# CONFIG_VGA_CONSOLE is not set
535CONFIG_DUMMY_CONSOLE=y 697CONFIG_DUMMY_CONSOLE=y
536# CONFIG_FRAMEBUFFER_CONSOLE is not set
537 698
538# 699#
539# Logo configuration 700# Sound
540# 701#
541# CONFIG_LOGO is not set 702# CONFIG_SOUND is not set
542# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
543 703
544# 704#
545# Sound 705# USB support
546# 706#
547CONFIG_SOUND=y 707CONFIG_USB_ARCH_HAS_HCD=y
708CONFIG_USB_ARCH_HAS_OHCI=y
709CONFIG_USB=y
710# CONFIG_USB_DEBUG is not set
548 711
549# 712#
550# Advanced Linux Sound Architecture 713# Miscellaneous USB options
551# 714#
552# CONFIG_SND is not set 715CONFIG_USB_DEVICEFS=y
716# CONFIG_USB_BANDWIDTH is not set
717# CONFIG_USB_DYNAMIC_MINORS is not set
718# CONFIG_USB_OTG is not set
553 719
554# 720#
555# Open Sound System 721# USB Host Controller Drivers
556# 722#
557# CONFIG_SOUND_PRIME is not set 723CONFIG_USB_EHCI_HCD=y
724# CONFIG_USB_EHCI_SPLIT_ISO is not set
725# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
726# CONFIG_USB_ISP116X_HCD is not set
727CONFIG_USB_OHCI_HCD=y
728# CONFIG_USB_OHCI_BIG_ENDIAN is not set
729CONFIG_USB_OHCI_LITTLE_ENDIAN=y
730# CONFIG_USB_UHCI_HCD is not set
731# CONFIG_USB_SL811_HCD is not set
558 732
559# 733#
560# USB support 734# USB Device Class drivers
561# 735#
562# CONFIG_USB_ARCH_HAS_HCD is not set 736# CONFIG_USB_BLUETOOTH_TTY is not set
563# CONFIG_USB_ARCH_HAS_OHCI is not set 737# CONFIG_USB_ACM is not set
738# CONFIG_USB_PRINTER is not set
564 739
565# 740#
566# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information 741# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
567# 742#
743CONFIG_USB_STORAGE=m
744# CONFIG_USB_STORAGE_DEBUG is not set
745# CONFIG_USB_STORAGE_DATAFAB is not set
746# CONFIG_USB_STORAGE_FREECOM is not set
747# CONFIG_USB_STORAGE_DPCM is not set
748# CONFIG_USB_STORAGE_USBAT is not set
749# CONFIG_USB_STORAGE_SDDR09 is not set
750# CONFIG_USB_STORAGE_SDDR55 is not set
751# CONFIG_USB_STORAGE_JUMPSHOT is not set
752
753#
754# USB Input Devices
755#
756# CONFIG_USB_HID is not set
757
758#
759# USB HID Boot Protocol drivers
760#
761# CONFIG_USB_KBD is not set
762# CONFIG_USB_MOUSE is not set
763# CONFIG_USB_AIPTEK is not set
764# CONFIG_USB_WACOM is not set
765# CONFIG_USB_ACECAD is not set
766# CONFIG_USB_KBTAB is not set
767# CONFIG_USB_POWERMATE is not set
768# CONFIG_USB_MTOUCH is not set
769# CONFIG_USB_ITMTOUCH is not set
770# CONFIG_USB_EGALAX is not set
771# CONFIG_USB_YEALINK is not set
772# CONFIG_USB_XPAD is not set
773# CONFIG_USB_ATI_REMOTE is not set
774# CONFIG_USB_KEYSPAN_REMOTE is not set
775# CONFIG_USB_APPLETOUCH is not set
776
777#
778# USB Imaging devices
779#
780# CONFIG_USB_MDC800 is not set
781# CONFIG_USB_MICROTEK is not set
782
783#
784# USB Multimedia devices
785#
786# CONFIG_USB_DABUSB is not set
787
788#
789# Video4Linux support is needed for USB Multimedia device support
790#
791
792#
793# USB Network Adapters
794#
795# CONFIG_USB_CATC is not set
796# CONFIG_USB_KAWETH is not set
797# CONFIG_USB_PEGASUS is not set
798# CONFIG_USB_RTL8150 is not set
799# CONFIG_USB_USBNET is not set
800CONFIG_USB_MON=y
801
802#
803# USB port drivers
804#
805
806#
807# USB Serial Converter support
808#
809# CONFIG_USB_SERIAL is not set
810
811#
812# USB Miscellaneous drivers
813#
814# CONFIG_USB_EMI62 is not set
815# CONFIG_USB_EMI26 is not set
816# CONFIG_USB_AUERSWALD is not set
817# CONFIG_USB_RIO500 is not set
818# CONFIG_USB_LEGOTOWER is not set
819# CONFIG_USB_LCD is not set
820# CONFIG_USB_LED is not set
821# CONFIG_USB_CYTHERM is not set
822# CONFIG_USB_PHIDGETKIT is not set
823# CONFIG_USB_PHIDGETSERVO is not set
824# CONFIG_USB_IDMOUSE is not set
825# CONFIG_USB_SISUSBVGA is not set
826# CONFIG_USB_LD is not set
827# CONFIG_USB_TEST is not set
828
829#
830# USB DSL modem support
831#
568 832
569# 833#
570# USB Gadget Support 834# USB Gadget Support
@@ -582,39 +846,41 @@ CONFIG_SOUND=y
582# CONFIG_INFINIBAND is not set 846# CONFIG_INFINIBAND is not set
583 847
584# 848#
849# SN Devices
850#
851
852#
585# File systems 853# File systems
586# 854#
587CONFIG_EXT2_FS=y 855CONFIG_EXT2_FS=y
588# CONFIG_EXT2_FS_XATTR is not set 856# CONFIG_EXT2_FS_XATTR is not set
857# CONFIG_EXT2_FS_XIP is not set
589# CONFIG_EXT3_FS is not set 858# CONFIG_EXT3_FS is not set
590# CONFIG_JBD is not set 859# CONFIG_JBD is not set
591# CONFIG_REISERFS_FS is not set 860# CONFIG_REISERFS_FS is not set
592# CONFIG_JFS_FS is not set 861# CONFIG_JFS_FS is not set
862# CONFIG_FS_POSIX_ACL is not set
593# CONFIG_XFS_FS is not set 863# CONFIG_XFS_FS is not set
594# CONFIG_MINIX_FS is not set 864# CONFIG_MINIX_FS is not set
595CONFIG_ROMFS_FS=m 865CONFIG_ROMFS_FS=m
866CONFIG_INOTIFY=y
596# CONFIG_QUOTA is not set 867# CONFIG_QUOTA is not set
597CONFIG_DNOTIFY=y 868CONFIG_DNOTIFY=y
598# CONFIG_AUTOFS_FS is not set 869# CONFIG_AUTOFS_FS is not set
599CONFIG_AUTOFS4_FS=y 870CONFIG_AUTOFS4_FS=y
871CONFIG_FUSE_FS=m
600 872
601# 873#
602# CD-ROM/DVD Filesystems 874# CD-ROM/DVD Filesystems
603# 875#
604CONFIG_ISO9660_FS=y 876# CONFIG_ISO9660_FS is not set
605CONFIG_JOLIET=y
606CONFIG_ZISOFS=y
607CONFIG_ZISOFS_FS=y
608# CONFIG_UDF_FS is not set 877# CONFIG_UDF_FS is not set
609 878
610# 879#
611# DOS/FAT/NT Filesystems 880# DOS/FAT/NT Filesystems
612# 881#
613CONFIG_FAT_FS=m 882# CONFIG_MSDOS_FS is not set
614CONFIG_MSDOS_FS=m 883# CONFIG_VFAT_FS is not set
615CONFIG_VFAT_FS=m
616CONFIG_FAT_DEFAULT_CODEPAGE=437
617CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
618# CONFIG_NTFS_FS is not set 884# CONFIG_NTFS_FS is not set
619 885
620# 886#
@@ -623,13 +889,10 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
623CONFIG_PROC_FS=y 889CONFIG_PROC_FS=y
624CONFIG_PROC_KCORE=y 890CONFIG_PROC_KCORE=y
625CONFIG_SYSFS=y 891CONFIG_SYSFS=y
626# CONFIG_DEVFS_FS is not set
627CONFIG_DEVPTS_FS_XATTR=y
628CONFIG_DEVPTS_FS_SECURITY=y
629CONFIG_TMPFS=y 892CONFIG_TMPFS=y
630# CONFIG_TMPFS_XATTR is not set
631# CONFIG_HUGETLB_PAGE is not set 893# CONFIG_HUGETLB_PAGE is not set
632CONFIG_RAMFS=y 894CONFIG_RAMFS=y
895CONFIG_RELAYFS_FS=m
633 896
634# 897#
635# Miscellaneous filesystems 898# Miscellaneous filesystems
@@ -653,16 +916,19 @@ CONFIG_CRAMFS=m
653# 916#
654CONFIG_NFS_FS=y 917CONFIG_NFS_FS=y
655CONFIG_NFS_V3=y 918CONFIG_NFS_V3=y
919# CONFIG_NFS_V3_ACL is not set
656# CONFIG_NFS_V4 is not set 920# CONFIG_NFS_V4 is not set
657# CONFIG_NFS_DIRECTIO is not set 921# CONFIG_NFS_DIRECTIO is not set
658CONFIG_NFSD=m 922CONFIG_NFSD=m
659CONFIG_NFSD_V3=y 923CONFIG_NFSD_V3=y
924# CONFIG_NFSD_V3_ACL is not set
660# CONFIG_NFSD_V4 is not set 925# CONFIG_NFSD_V4 is not set
661# CONFIG_NFSD_TCP is not set 926# CONFIG_NFSD_TCP is not set
662CONFIG_ROOT_NFS=y 927CONFIG_ROOT_NFS=y
663CONFIG_LOCKD=y 928CONFIG_LOCKD=y
664CONFIG_LOCKD_V4=y 929CONFIG_LOCKD_V4=y
665CONFIG_EXPORTFS=m 930CONFIG_EXPORTFS=m
931CONFIG_NFS_COMMON=y
666CONFIG_SUNRPC=y 932CONFIG_SUNRPC=y
667# CONFIG_RPCSEC_GSS_KRB5 is not set 933# CONFIG_RPCSEC_GSS_KRB5 is not set
668# CONFIG_RPCSEC_GSS_SPKM3 is not set 934# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -673,6 +939,7 @@ CONFIG_SMB_NLS_REMOTE="cp932"
673# CONFIG_NCP_FS is not set 939# CONFIG_NCP_FS is not set
674# CONFIG_CODA_FS is not set 940# CONFIG_CODA_FS is not set
675# CONFIG_AFS_FS is not set 941# CONFIG_AFS_FS is not set
942# CONFIG_9P_FS is not set
676 943
677# 944#
678# Partition Types 945# Partition Types
@@ -732,9 +999,11 @@ CONFIG_NLS_ISO8859_1=m
732# 999#
733# Kernel hacking 1000# Kernel hacking
734# 1001#
1002# CONFIG_PRINTK_TIME is not set
735# CONFIG_DEBUG_KERNEL is not set 1003# CONFIG_DEBUG_KERNEL is not set
1004CONFIG_LOG_BUF_SHIFT=14
736CONFIG_CROSSCOMPILE=y 1005CONFIG_CROSSCOMPILE=y
737CONFIG_CMDLINE="" 1006CONFIG_CMDLINE="mem=32M console=ttyVR0,115200"
738 1007
739# 1008#
740# Security options 1009# Security options
@@ -746,7 +1015,31 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
746# 1015#
747# Cryptographic options 1016# Cryptographic options
748# 1017#
749# CONFIG_CRYPTO is not set 1018CONFIG_CRYPTO=y
1019CONFIG_CRYPTO_HMAC=y
1020CONFIG_CRYPTO_NULL=m
1021CONFIG_CRYPTO_MD4=m
1022CONFIG_CRYPTO_MD5=m
1023CONFIG_CRYPTO_SHA1=m
1024CONFIG_CRYPTO_SHA256=m
1025CONFIG_CRYPTO_SHA512=m
1026CONFIG_CRYPTO_WP512=m
1027CONFIG_CRYPTO_TGR192=m
1028CONFIG_CRYPTO_DES=m
1029CONFIG_CRYPTO_BLOWFISH=m
1030CONFIG_CRYPTO_TWOFISH=m
1031CONFIG_CRYPTO_SERPENT=m
1032CONFIG_CRYPTO_AES=m
1033CONFIG_CRYPTO_CAST5=m
1034CONFIG_CRYPTO_CAST6=m
1035CONFIG_CRYPTO_TEA=m
1036CONFIG_CRYPTO_ARC4=m
1037CONFIG_CRYPTO_KHAZAD=m
1038CONFIG_CRYPTO_ANUBIS=m
1039CONFIG_CRYPTO_DEFLATE=m
1040CONFIG_CRYPTO_MICHAEL_MIC=m
1041CONFIG_CRYPTO_CRC32C=m
1042# CONFIG_CRYPTO_TEST is not set
750 1043
751# 1044#
752# Hardware crypto devices 1045# Hardware crypto devices
@@ -756,9 +1049,8 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
756# Library routines 1049# Library routines
757# 1050#
758CONFIG_CRC_CCITT=m 1051CONFIG_CRC_CCITT=m
759# CONFIG_CRC32 is not set 1052CONFIG_CRC16=m
760# CONFIG_LIBCRC32C is not set 1053CONFIG_CRC32=m
761CONFIG_ZLIB_INFLATE=y 1054CONFIG_LIBCRC32C=m
1055CONFIG_ZLIB_INFLATE=m
762CONFIG_ZLIB_DEFLATE=m 1056CONFIG_ZLIB_DEFLATE=m
763CONFIG_GENERIC_HARDIRQS=y
764CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/tb0229_defconfig b/arch/mips/configs/tb0229_defconfig
index 2cb669188aa9..ac8b64e87b8a 100644
--- a/arch/mips/configs/tb0229_defconfig
+++ b/arch/mips/configs/tb0229_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:12 2005 4# Thu Oct 20 22:27:13 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,24 +11,29 @@ CONFIG_32BIT=y
14CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
25# CONFIG_BSD_PROCESS_ACCT is not set 24# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y 25CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set 26# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14 27CONFIG_HOTPLUG=y
29# CONFIG_HOTPLUG is not set
30CONFIG_KOBJECT_UEVENT=y 28CONFIG_KOBJECT_UEVENT=y
31# CONFIG_IKCONFIG is not set 29# CONFIG_IKCONFIG is not set
30CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y 31CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y 32CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_EXTRA_PASS is not set 33# CONFIG_KALLSYMS_EXTRA_PASS is not set
34CONFIG_PRINTK=y
35CONFIG_BUG=y
36CONFIG_BASE_FULL=y
35CONFIG_FUTEX=y 37CONFIG_FUTEX=y
36CONFIG_EPOLL=y 38CONFIG_EPOLL=y
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -41,6 +43,7 @@ CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0 43CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0 44CONFIG_CC_ALIGN_JUMPS=0
43# CONFIG_TINY_SHMEM is not set 45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
44 47
45# 48#
46# Loadable module support 49# Loadable module support
@@ -56,58 +59,87 @@ CONFIG_KMOD=y
56# 59#
57# Machine selection 60# Machine selection
58# 61#
59# CONFIG_MACH_JAZZ is not set 62# CONFIG_MIPS_MTX1 is not set
60CONFIG_MACH_VR41XX=y 63# CONFIG_MIPS_BOSPORUS is not set
61# CONFIG_NEC_CMBVR4133 is not set 64# CONFIG_MIPS_PB1000 is not set
62# CONFIG_CASIO_E55 is not set 65# CONFIG_MIPS_PB1100 is not set
63# CONFIG_IBM_WORKPAD is not set 66# CONFIG_MIPS_PB1500 is not set
64# CONFIG_TANBAC_TB0226 is not set 67# CONFIG_MIPS_PB1550 is not set
65CONFIG_TANBAC_TB0229=y 68# CONFIG_MIPS_PB1200 is not set
66CONFIG_TANBAC_TB0219=y 69# CONFIG_MIPS_DB1000 is not set
67# CONFIG_VICTOR_MPC30X is not set 70# CONFIG_MIPS_DB1100 is not set
68# CONFIG_ZAO_CAPCELLA is not set 71# CONFIG_MIPS_DB1500 is not set
69CONFIG_PCI_VR41XX=y 72# CONFIG_MIPS_DB1550 is not set
70# CONFIG_VRC4173 is not set 73# CONFIG_MIPS_DB1200 is not set
71# CONFIG_TOSHIBA_JMR3927 is not set 74# CONFIG_MIPS_MIRAGE is not set
72# CONFIG_MIPS_COBALT is not set 75# CONFIG_MIPS_COBALT is not set
73# CONFIG_MACH_DECSTATION is not set 76# CONFIG_MACH_DECSTATION is not set
74# CONFIG_MIPS_EV64120 is not set 77# CONFIG_MIPS_EV64120 is not set
75# CONFIG_MIPS_EV96100 is not set 78# CONFIG_MIPS_EV96100 is not set
76# CONFIG_MIPS_IVR is not set 79# CONFIG_MIPS_IVR is not set
77# CONFIG_LASAT is not set
78# CONFIG_MIPS_ITE8172 is not set 80# CONFIG_MIPS_ITE8172 is not set
81# CONFIG_MACH_JAZZ is not set
82# CONFIG_LASAT is not set
79# CONFIG_MIPS_ATLAS is not set 83# CONFIG_MIPS_ATLAS is not set
80# CONFIG_MIPS_MALTA is not set 84# CONFIG_MIPS_MALTA is not set
81# CONFIG_MIPS_SEAD is not set 85# CONFIG_MIPS_SEAD is not set
86# CONFIG_MIPS_SIM is not set
87# CONFIG_MOMENCO_JAGUAR_ATX is not set
82# CONFIG_MOMENCO_OCELOT is not set 88# CONFIG_MOMENCO_OCELOT is not set
83# CONFIG_MOMENCO_OCELOT_G is not set
84# CONFIG_MOMENCO_OCELOT_C is not set
85# CONFIG_MOMENCO_OCELOT_3 is not set 89# CONFIG_MOMENCO_OCELOT_3 is not set
86# CONFIG_MOMENCO_JAGUAR_ATX is not set 90# CONFIG_MOMENCO_OCELOT_C is not set
87# CONFIG_PMC_YOSEMITE is not set 91# CONFIG_MOMENCO_OCELOT_G is not set
92# CONFIG_MIPS_XXS1500 is not set
93# CONFIG_PNX8550_V2PCI is not set
94# CONFIG_PNX8550_JBS is not set
88# CONFIG_DDB5074 is not set 95# CONFIG_DDB5074 is not set
89# CONFIG_DDB5476 is not set 96# CONFIG_DDB5476 is not set
90# CONFIG_DDB5477 is not set 97# CONFIG_DDB5477 is not set
91# CONFIG_NEC_OSPREY is not set 98CONFIG_MACH_VR41XX=y
99# CONFIG_PMC_YOSEMITE is not set
100# CONFIG_QEMU is not set
92# CONFIG_SGI_IP22 is not set 101# CONFIG_SGI_IP22 is not set
93# CONFIG_SOC_AU1X00 is not set 102# CONFIG_SGI_IP27 is not set
94# CONFIG_SIBYTE_SB1xxx_SOC is not set 103# CONFIG_SGI_IP32 is not set
104# CONFIG_SIBYTE_BIGSUR is not set
105# CONFIG_SIBYTE_SWARM is not set
106# CONFIG_SIBYTE_SENTOSA is not set
107# CONFIG_SIBYTE_RHONE is not set
108# CONFIG_SIBYTE_CARMEL is not set
109# CONFIG_SIBYTE_PTSWARM is not set
110# CONFIG_SIBYTE_LITTLESUR is not set
111# CONFIG_SIBYTE_CRHINE is not set
112# CONFIG_SIBYTE_CRHONE is not set
95# CONFIG_SNI_RM200_PCI is not set 113# CONFIG_SNI_RM200_PCI is not set
114# CONFIG_TOSHIBA_JMR3927 is not set
96# CONFIG_TOSHIBA_RBTX4927 is not set 115# CONFIG_TOSHIBA_RBTX4927 is not set
116# CONFIG_TOSHIBA_RBTX4938 is not set
117# CONFIG_NEC_CMBVR4133 is not set
118# CONFIG_CASIO_E55 is not set
119# CONFIG_IBM_WORKPAD is not set
120CONFIG_TANBAC_TB022X=y
121# CONFIG_TANBAC_TB0226 is not set
122# CONFIG_VICTOR_MPC30X is not set
123# CONFIG_ZAO_CAPCELLA is not set
124CONFIG_PCI_VR41XX=y
125# CONFIG_VRC4173 is not set
97CONFIG_RWSEM_GENERIC_SPINLOCK=y 126CONFIG_RWSEM_GENERIC_SPINLOCK=y
98CONFIG_GENERIC_CALIBRATE_DELAY=y 127CONFIG_GENERIC_CALIBRATE_DELAY=y
99CONFIG_HAVE_DEC_LOCK=y
100CONFIG_DMA_NONCOHERENT=y 128CONFIG_DMA_NONCOHERENT=y
101CONFIG_DMA_NEED_PCI_MAP_STATE=y 129CONFIG_DMA_NEED_PCI_MAP_STATE=y
130# CONFIG_CPU_BIG_ENDIAN is not set
102CONFIG_CPU_LITTLE_ENDIAN=y 131CONFIG_CPU_LITTLE_ENDIAN=y
132CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
103CONFIG_IRQ_CPU=y 133CONFIG_IRQ_CPU=y
104CONFIG_MIPS_L1_CACHE_SHIFT=5 134CONFIG_MIPS_L1_CACHE_SHIFT=5
105 135
106# 136#
107# CPU selection 137# CPU selection
108# 138#
109# CONFIG_CPU_MIPS32 is not set 139# CONFIG_CPU_MIPS32_R1 is not set
110# CONFIG_CPU_MIPS64 is not set 140# CONFIG_CPU_MIPS32_R2 is not set
141# CONFIG_CPU_MIPS64_R1 is not set
142# CONFIG_CPU_MIPS64_R2 is not set
111# CONFIG_CPU_R3000 is not set 143# CONFIG_CPU_R3000 is not set
112# CONFIG_CPU_TX39XX is not set 144# CONFIG_CPU_TX39XX is not set
113CONFIG_CPU_VR41XX=y 145CONFIG_CPU_VR41XX=y
@@ -123,12 +155,36 @@ CONFIG_CPU_VR41XX=y
123# CONFIG_CPU_RM7000 is not set 155# CONFIG_CPU_RM7000 is not set
124# CONFIG_CPU_RM9000 is not set 156# CONFIG_CPU_RM9000 is not set
125# CONFIG_CPU_SB1 is not set 157# CONFIG_CPU_SB1 is not set
158CONFIG_SYS_HAS_CPU_VR41XX=y
159CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
160CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
161CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
162CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
163
164#
165# Kernel type
166#
167CONFIG_32BIT=y
168# CONFIG_64BIT is not set
126CONFIG_PAGE_SIZE_4KB=y 169CONFIG_PAGE_SIZE_4KB=y
127# CONFIG_PAGE_SIZE_8KB is not set 170# CONFIG_PAGE_SIZE_8KB is not set
128# CONFIG_PAGE_SIZE_16KB is not set 171# CONFIG_PAGE_SIZE_16KB is not set
129# CONFIG_PAGE_SIZE_64KB is not set 172# CONFIG_PAGE_SIZE_64KB is not set
173# CONFIG_MIPS_MT is not set
130# CONFIG_CPU_ADVANCED is not set 174# CONFIG_CPU_ADVANCED is not set
131CONFIG_CPU_HAS_SYNC=y 175CONFIG_CPU_HAS_SYNC=y
176CONFIG_GENERIC_HARDIRQS=y
177CONFIG_GENERIC_IRQ_PROBE=y
178CONFIG_ARCH_FLATMEM_ENABLE=y
179CONFIG_SELECT_MEMORY_MODEL=y
180CONFIG_FLATMEM_MANUAL=y
181# CONFIG_DISCONTIGMEM_MANUAL is not set
182# CONFIG_SPARSEMEM_MANUAL is not set
183CONFIG_FLATMEM=y
184CONFIG_FLAT_NODE_MEM_MAP=y
185# CONFIG_SPARSEMEM_STATIC is not set
186CONFIG_PREEMPT_NONE=y
187# CONFIG_PREEMPT_VOLUNTARY is not set
132# CONFIG_PREEMPT is not set 188# CONFIG_PREEMPT is not set
133 189
134# 190#
@@ -136,8 +192,7 @@ CONFIG_CPU_HAS_SYNC=y
136# 192#
137CONFIG_HW_HAS_PCI=y 193CONFIG_HW_HAS_PCI=y
138CONFIG_PCI=y 194CONFIG_PCI=y
139CONFIG_PCI_LEGACY_PROC=y 195# CONFIG_PCI_LEGACY_PROC is not set
140CONFIG_PCI_NAMES=y
141CONFIG_MMU=y 196CONFIG_MMU=y
142 197
143# 198#
@@ -146,10 +201,6 @@ CONFIG_MMU=y
146# CONFIG_PCCARD is not set 201# CONFIG_PCCARD is not set
147 202
148# 203#
149# PC-card bridges
150#
151
152#
153# PCI Hotplug Support 204# PCI Hotplug Support
154# 205#
155# CONFIG_HOTPLUG_PCI is not set 206# CONFIG_HOTPLUG_PCI is not set
@@ -162,6 +213,88 @@ CONFIG_BINFMT_ELF=y
162CONFIG_TRAD_SIGNALS=y 213CONFIG_TRAD_SIGNALS=y
163 214
164# 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
227CONFIG_XFRM_USER=m
228# CONFIG_NET_KEY is not set
229CONFIG_INET=y
230CONFIG_IP_MULTICAST=y
231CONFIG_IP_ADVANCED_ROUTER=y
232CONFIG_ASK_IP_FIB_HASH=y
233# CONFIG_IP_FIB_TRIE is not set
234CONFIG_IP_FIB_HASH=y
235CONFIG_IP_MULTIPLE_TABLES=y
236CONFIG_IP_ROUTE_MULTIPATH=y
237# CONFIG_IP_ROUTE_MULTIPATH_CACHED is not set
238CONFIG_IP_ROUTE_VERBOSE=y
239CONFIG_IP_PNP=y
240# CONFIG_IP_PNP_DHCP is not set
241CONFIG_IP_PNP_BOOTP=y
242# CONFIG_IP_PNP_RARP is not set
243CONFIG_NET_IPIP=m
244CONFIG_NET_IPGRE=m
245# CONFIG_NET_IPGRE_BROADCAST is not set
246# CONFIG_IP_MROUTE is not set
247# CONFIG_ARPD is not set
248CONFIG_SYN_COOKIES=y
249# CONFIG_INET_AH is not set
250# CONFIG_INET_ESP is not set
251# CONFIG_INET_IPCOMP is not set
252CONFIG_INET_TUNNEL=m
253CONFIG_INET_DIAG=y
254CONFIG_INET_TCP_DIAG=y
255# CONFIG_TCP_CONG_ADVANCED is not set
256CONFIG_TCP_CONG_BIC=y
257# CONFIG_IPV6 is not set
258# CONFIG_NETFILTER is not set
259
260#
261# DCCP Configuration (EXPERIMENTAL)
262#
263# CONFIG_IP_DCCP is not set
264
265#
266# SCTP Configuration (EXPERIMENTAL)
267#
268# CONFIG_IP_SCTP is not set
269# CONFIG_ATM is not set
270# CONFIG_BRIDGE is not set
271# CONFIG_VLAN_8021Q is not set
272# CONFIG_DECNET is not set
273# CONFIG_LLC2 is not set
274# CONFIG_IPX is not set
275# CONFIG_ATALK is not set
276# CONFIG_X25 is not set
277# CONFIG_LAPB is not set
278# CONFIG_NET_DIVERT is not set
279# CONFIG_ECONET is not set
280# CONFIG_WAN_ROUTER is not set
281# CONFIG_NET_SCHED is not set
282# CONFIG_NET_CLS_ROUTE is not set
283
284#
285# Network testing
286#
287# CONFIG_NET_PKTGEN is not set
288# CONFIG_HAMRADIO is not set
289# CONFIG_IRDA is not set
290# CONFIG_BT is not set
291CONFIG_IEEE80211=m
292# CONFIG_IEEE80211_DEBUG is not set
293CONFIG_IEEE80211_CRYPT_WEP=m
294CONFIG_IEEE80211_CRYPT_CCMP=m
295CONFIG_IEEE80211_CRYPT_TKIP=m
296
297#
165# Device Drivers 298# Device Drivers
166# 299#
167 300
@@ -170,7 +303,12 @@ CONFIG_TRAD_SIGNALS=y
170# 303#
171CONFIG_STANDALONE=y 304CONFIG_STANDALONE=y
172CONFIG_PREVENT_FIRMWARE_BUILD=y 305CONFIG_PREVENT_FIRMWARE_BUILD=y
173# CONFIG_FW_LOADER is not set 306CONFIG_FW_LOADER=m
307
308#
309# Connector - unified userspace <-> kernelspace linker
310#
311CONFIG_CONNECTOR=m
174 312
175# 313#
176# Memory Technology Devices (MTD) 314# Memory Technology Devices (MTD)
@@ -189,7 +327,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
189# 327#
190# Block devices 328# Block devices
191# 329#
192# CONFIG_BLK_DEV_FD is not set
193# CONFIG_BLK_CPQ_DA is not set 330# CONFIG_BLK_CPQ_DA is not set
194# CONFIG_BLK_CPQ_CISS_DA is not set 331# CONFIG_BLK_CPQ_CISS_DA is not set
195# CONFIG_BLK_DEV_DAC960 is not set 332# CONFIG_BLK_DEV_DAC960 is not set
@@ -199,11 +336,11 @@ CONFIG_BLK_DEV_LOOP=m
199# CONFIG_BLK_DEV_CRYPTOLOOP is not set 336# CONFIG_BLK_DEV_CRYPTOLOOP is not set
200CONFIG_BLK_DEV_NBD=m 337CONFIG_BLK_DEV_NBD=m
201# CONFIG_BLK_DEV_SX8 is not set 338# CONFIG_BLK_DEV_SX8 is not set
339# CONFIG_BLK_DEV_UB is not set
202CONFIG_BLK_DEV_RAM=y 340CONFIG_BLK_DEV_RAM=y
203CONFIG_BLK_DEV_RAM_COUNT=16 341CONFIG_BLK_DEV_RAM_COUNT=16
204CONFIG_BLK_DEV_RAM_SIZE=4096 342CONFIG_BLK_DEV_RAM_SIZE=4096
205# CONFIG_BLK_DEV_INITRD is not set 343# CONFIG_BLK_DEV_INITRD is not set
206CONFIG_INITRAMFS_SOURCE=""
207# CONFIG_LBD is not set 344# CONFIG_LBD is not set
208CONFIG_CDROM_PKTCDVD=m 345CONFIG_CDROM_PKTCDVD=m
209CONFIG_CDROM_PKTCDVD_BUFFERS=8 346CONFIG_CDROM_PKTCDVD_BUFFERS=8
@@ -226,6 +363,7 @@ CONFIG_ATA_OVER_ETH=m
226# 363#
227# SCSI device support 364# SCSI device support
228# 365#
366# CONFIG_RAID_ATTRS is not set
229# CONFIG_SCSI is not set 367# CONFIG_SCSI is not set
230 368
231# 369#
@@ -236,6 +374,7 @@ CONFIG_ATA_OVER_ETH=m
236# 374#
237# Fusion MPT device support 375# Fusion MPT device support
238# 376#
377# CONFIG_FUSION is not set
239 378
240# 379#
241# IEEE 1394 (FireWire) support 380# IEEE 1394 (FireWire) support
@@ -248,83 +387,13 @@ CONFIG_ATA_OVER_ETH=m
248# CONFIG_I2O is not set 387# CONFIG_I2O is not set
249 388
250# 389#
251# Networking support 390# Network device support
252#
253CONFIG_NET=y
254
255#
256# Networking options
257#
258CONFIG_PACKET=y
259# CONFIG_PACKET_MMAP is not set
260CONFIG_NETLINK_DEV=m
261CONFIG_UNIX=y
262# CONFIG_NET_KEY is not set
263CONFIG_INET=y
264CONFIG_IP_MULTICAST=y
265CONFIG_IP_ADVANCED_ROUTER=y
266CONFIG_IP_MULTIPLE_TABLES=y
267CONFIG_IP_ROUTE_MULTIPATH=y
268CONFIG_IP_ROUTE_VERBOSE=y
269CONFIG_IP_PNP=y
270# CONFIG_IP_PNP_DHCP is not set
271CONFIG_IP_PNP_BOOTP=y
272# CONFIG_IP_PNP_RARP is not set
273CONFIG_NET_IPIP=m
274CONFIG_NET_IPGRE=m
275# CONFIG_NET_IPGRE_BROADCAST is not set
276# CONFIG_IP_MROUTE is not set
277# CONFIG_ARPD is not set
278CONFIG_SYN_COOKIES=y
279# CONFIG_INET_AH is not set
280# CONFIG_INET_ESP is not set
281# CONFIG_INET_IPCOMP is not set
282CONFIG_INET_TUNNEL=m
283CONFIG_IP_TCPDIAG=m
284# CONFIG_IP_TCPDIAG_IPV6 is not set
285# CONFIG_IPV6 is not set
286# CONFIG_NETFILTER is not set
287CONFIG_XFRM=y
288CONFIG_XFRM_USER=m
289
290#
291# SCTP Configuration (EXPERIMENTAL)
292#
293# CONFIG_IP_SCTP is not set
294# CONFIG_ATM is not set
295# CONFIG_BRIDGE is not set
296# CONFIG_VLAN_8021Q is not set
297# CONFIG_DECNET is not set
298# CONFIG_LLC2 is not set
299# CONFIG_IPX is not set
300# CONFIG_ATALK is not set
301# CONFIG_X25 is not set
302# CONFIG_LAPB is not set
303# CONFIG_NET_DIVERT is not set
304# CONFIG_ECONET is not set
305# CONFIG_WAN_ROUTER is not set
306
307#
308# QoS and/or fair queueing
309#
310# CONFIG_NET_SCHED is not set
311# CONFIG_NET_CLS_ROUTE is not set
312
313#
314# Network testing
315# 391#
316# CONFIG_NET_PKTGEN is not set
317# CONFIG_NETPOLL is not set
318# CONFIG_NET_POLL_CONTROLLER is not set
319# CONFIG_HAMRADIO is not set
320# CONFIG_IRDA is not set
321# CONFIG_BT is not set
322CONFIG_NETDEVICES=y 392CONFIG_NETDEVICES=y
323CONFIG_DUMMY=m 393CONFIG_DUMMY=m
324# CONFIG_BONDING is not set 394# CONFIG_BONDING is not set
325# CONFIG_EQUALIZER is not set 395# CONFIG_EQUALIZER is not set
326# CONFIG_TUN is not set 396# CONFIG_TUN is not set
327# CONFIG_ETHERTAP is not set
328 397
329# 398#
330# ARCnet devices 399# ARCnet devices
@@ -332,6 +401,21 @@ CONFIG_DUMMY=m
332# CONFIG_ARCNET is not set 401# CONFIG_ARCNET is not set
333 402
334# 403#
404# PHY device support
405#
406CONFIG_PHYLIB=m
407CONFIG_PHYCONTROL=y
408
409#
410# MII PHY device drivers
411#
412CONFIG_MARVELL_PHY=m
413CONFIG_DAVICOM_PHY=m
414CONFIG_QSEMI_PHY=m
415CONFIG_LXT_PHY=m
416CONFIG_CICADA_PHY=m
417
418#
335# Ethernet (10 or 100Mbit) 419# Ethernet (10 or 100Mbit)
336# 420#
337CONFIG_NET_ETHERNET=y 421CONFIG_NET_ETHERNET=y
@@ -346,7 +430,7 @@ CONFIG_MII=y
346# CONFIG_NET_TULIP is not set 430# CONFIG_NET_TULIP is not set
347# CONFIG_HP100 is not set 431# CONFIG_HP100 is not set
348CONFIG_NET_PCI=y 432CONFIG_NET_PCI=y
349CONFIG_PCNET32=y 433# CONFIG_PCNET32 is not set
350# CONFIG_AMD8111_ETH is not set 434# CONFIG_AMD8111_ETH is not set
351# CONFIG_ADAPTEC_STARFIRE is not set 435# CONFIG_ADAPTEC_STARFIRE is not set
352# CONFIG_B44 is not set 436# CONFIG_B44 is not set
@@ -358,7 +442,11 @@ CONFIG_EEPRO100=y
358# CONFIG_NATSEMI is not set 442# CONFIG_NATSEMI is not set
359# CONFIG_NE2K_PCI is not set 443# CONFIG_NE2K_PCI is not set
360# CONFIG_8139CP is not set 444# CONFIG_8139CP is not set
361# CONFIG_8139TOO is not set 445CONFIG_8139TOO=y
446CONFIG_8139TOO_PIO=y
447# CONFIG_8139TOO_TUNE_TWISTER is not set
448# CONFIG_8139TOO_8129 is not set
449# CONFIG_8139_OLD_RX_RESET is not set
362# CONFIG_SIS900 is not set 450# CONFIG_SIS900 is not set
363# CONFIG_EPIC100 is not set 451# CONFIG_EPIC100 is not set
364# CONFIG_SUNDANCE is not set 452# CONFIG_SUNDANCE is not set
@@ -375,14 +463,19 @@ CONFIG_EEPRO100=y
375# CONFIG_NS83820 is not set 463# CONFIG_NS83820 is not set
376# CONFIG_HAMACHI is not set 464# CONFIG_HAMACHI is not set
377# CONFIG_YELLOWFIN is not set 465# CONFIG_YELLOWFIN is not set
378# CONFIG_R8169 is not set 466CONFIG_R8169=y
467# CONFIG_R8169_NAPI is not set
468# CONFIG_SIS190 is not set
469# CONFIG_SKGE is not set
379# CONFIG_SK98LIN is not set 470# CONFIG_SK98LIN is not set
380# CONFIG_VIA_VELOCITY is not set 471# CONFIG_VIA_VELOCITY is not set
381# CONFIG_TIGON3 is not set 472# CONFIG_TIGON3 is not set
473# CONFIG_BNX2 is not set
382 474
383# 475#
384# Ethernet (10000 Mbit) 476# Ethernet (10000 Mbit)
385# 477#
478# CONFIG_CHELSIO_T1 is not set
386# CONFIG_IXGB is not set 479# CONFIG_IXGB is not set
387# CONFIG_S2IO is not set 480# CONFIG_S2IO is not set
388 481
@@ -395,6 +488,8 @@ CONFIG_EEPRO100=y
395# Wireless LAN (non-hamradio) 488# Wireless LAN (non-hamradio)
396# 489#
397# CONFIG_NET_RADIO is not set 490# CONFIG_NET_RADIO is not set
491# CONFIG_IPW_DEBUG is not set
492CONFIG_IPW2200=m
398 493
399# 494#
400# Wan interfaces 495# Wan interfaces
@@ -416,6 +511,8 @@ CONFIG_SLIP_SMART=y
416CONFIG_SLIP_MODE_SLIP6=y 511CONFIG_SLIP_MODE_SLIP6=y
417# CONFIG_SHAPER is not set 512# CONFIG_SHAPER is not set
418# CONFIG_NETCONSOLE is not set 513# CONFIG_NETCONSOLE is not set
514# CONFIG_NETPOLL is not set
515# CONFIG_NET_POLL_CONTROLLER is not set
419 516
420# 517#
421# ISDN subsystem 518# ISDN subsystem
@@ -435,29 +532,13 @@ CONFIG_INPUT=y
435# 532#
436# Userland interfaces 533# Userland interfaces
437# 534#
438CONFIG_INPUT_MOUSEDEV=y 535# CONFIG_INPUT_MOUSEDEV is not set
439CONFIG_INPUT_MOUSEDEV_PSAUX=y
440CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
441CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
442# CONFIG_INPUT_JOYDEV is not set 536# CONFIG_INPUT_JOYDEV is not set
443# CONFIG_INPUT_TSDEV is not set 537# CONFIG_INPUT_TSDEV is not set
444# CONFIG_INPUT_EVDEV is not set 538# CONFIG_INPUT_EVDEV is not set
445# CONFIG_INPUT_EVBUG is not set 539# CONFIG_INPUT_EVBUG is not set
446 540
447# 541#
448# Input I/O drivers
449#
450# CONFIG_GAMEPORT is not set
451CONFIG_SOUND_GAMEPORT=y
452CONFIG_SERIO=y
453CONFIG_SERIO_I8042=y
454CONFIG_SERIO_SERPORT=y
455# CONFIG_SERIO_CT82C710 is not set
456# CONFIG_SERIO_PCIPS2 is not set
457# CONFIG_SERIO_LIBPS2 is not set
458CONFIG_SERIO_RAW=m
459
460#
461# Input Device Drivers 542# Input Device Drivers
462# 543#
463# CONFIG_INPUT_KEYBOARD is not set 544# CONFIG_INPUT_KEYBOARD is not set
@@ -467,6 +548,12 @@ CONFIG_SERIO_RAW=m
467# CONFIG_INPUT_MISC is not set 548# CONFIG_INPUT_MISC is not set
468 549
469# 550#
551# Hardware I/O ports
552#
553# CONFIG_SERIO is not set
554# CONFIG_GAMEPORT is not set
555
556#
470# Character devices 557# Character devices
471# 558#
472CONFIG_VT=y 559CONFIG_VT=y
@@ -477,16 +564,16 @@ CONFIG_HW_CONSOLE=y
477# 564#
478# Serial drivers 565# Serial drivers
479# 566#
480CONFIG_SERIAL_8250=y 567# CONFIG_SERIAL_8250 is not set
481CONFIG_SERIAL_8250_CONSOLE=y
482CONFIG_SERIAL_8250_NR_UARTS=4
483# CONFIG_SERIAL_8250_EXTENDED is not set
484 568
485# 569#
486# Non-8250 serial port support 570# Non-8250 serial port support
487# 571#
488CONFIG_SERIAL_CORE=y 572CONFIG_SERIAL_CORE=y
489CONFIG_SERIAL_CORE_CONSOLE=y 573CONFIG_SERIAL_CORE_CONSOLE=y
574CONFIG_SERIAL_VR41XX=y
575CONFIG_SERIAL_VR41XX_CONSOLE=y
576# CONFIG_SERIAL_JSM is not set
490CONFIG_UNIX98_PTYS=y 577CONFIG_UNIX98_PTYS=y
491CONFIG_LEGACY_PTYS=y 578CONFIG_LEGACY_PTYS=y
492CONFIG_LEGACY_PTY_COUNT=256 579CONFIG_LEGACY_PTY_COUNT=256
@@ -505,14 +592,21 @@ CONFIG_LEGACY_PTY_COUNT=256
505# CONFIG_DTLK is not set 592# CONFIG_DTLK is not set
506# CONFIG_R3964 is not set 593# CONFIG_R3964 is not set
507# CONFIG_APPLICOM is not set 594# CONFIG_APPLICOM is not set
595CONFIG_TANBAC_TB0219=y
508 596
509# 597#
510# Ftape, the floppy tape device driver 598# Ftape, the floppy tape device driver
511# 599#
512# CONFIG_DRM is not set 600# CONFIG_DRM is not set
601CONFIG_GPIO_VR41XX=y
513# CONFIG_RAW_DRIVER is not set 602# CONFIG_RAW_DRIVER is not set
514 603
515# 604#
605# TPM devices
606#
607# CONFIG_TCG_TPM is not set
608
609#
516# I2C support 610# I2C support
517# 611#
518# CONFIG_I2C is not set 612# CONFIG_I2C is not set
@@ -523,10 +617,20 @@ CONFIG_LEGACY_PTY_COUNT=256
523# CONFIG_W1 is not set 617# CONFIG_W1 is not set
524 618
525# 619#
620# Hardware Monitoring support
621#
622# CONFIG_HWMON is not set
623# CONFIG_HWMON_VID is not set
624
625#
526# Misc devices 626# Misc devices
527# 627#
528 628
529# 629#
630# Multimedia Capabilities Port drivers
631#
632
633#
530# Multimedia devices 634# Multimedia devices
531# 635#
532# CONFIG_VIDEO_DEV is not set 636# CONFIG_VIDEO_DEV is not set
@@ -546,7 +650,6 @@ CONFIG_LEGACY_PTY_COUNT=256
546# 650#
547# CONFIG_VGA_CONSOLE is not set 651# CONFIG_VGA_CONSOLE is not set
548CONFIG_DUMMY_CONSOLE=y 652CONFIG_DUMMY_CONSOLE=y
549# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
550 653
551# 654#
552# Sound 655# Sound
@@ -556,13 +659,122 @@ CONFIG_DUMMY_CONSOLE=y
556# 659#
557# USB support 660# USB support
558# 661#
559# CONFIG_USB is not set
560CONFIG_USB_ARCH_HAS_HCD=y 662CONFIG_USB_ARCH_HAS_HCD=y
561CONFIG_USB_ARCH_HAS_OHCI=y 663CONFIG_USB_ARCH_HAS_OHCI=y
664CONFIG_USB=m
665# CONFIG_USB_DEBUG is not set
666
667#
668# Miscellaneous USB options
669#
670CONFIG_USB_DEVICEFS=y
671# CONFIG_USB_BANDWIDTH is not set
672# CONFIG_USB_DYNAMIC_MINORS is not set
673# CONFIG_USB_OTG is not set
674
675#
676# USB Host Controller Drivers
677#
678CONFIG_USB_EHCI_HCD=m
679# CONFIG_USB_EHCI_SPLIT_ISO is not set
680# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
681# CONFIG_USB_ISP116X_HCD is not set
682CONFIG_USB_OHCI_HCD=m
683# CONFIG_USB_OHCI_BIG_ENDIAN is not set
684CONFIG_USB_OHCI_LITTLE_ENDIAN=y
685# CONFIG_USB_UHCI_HCD is not set
686# CONFIG_USB_SL811_HCD is not set
687
688#
689# USB Device Class drivers
690#
691# CONFIG_USB_BLUETOOTH_TTY is not set
692# CONFIG_USB_ACM is not set
693# CONFIG_USB_PRINTER is not set
562 694
563# 695#
564# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information 696# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
565# 697#
698# CONFIG_USB_STORAGE is not set
699
700#
701# USB Input Devices
702#
703# CONFIG_USB_HID is not set
704
705#
706# USB HID Boot Protocol drivers
707#
708# CONFIG_USB_KBD is not set
709# CONFIG_USB_MOUSE is not set
710# CONFIG_USB_AIPTEK is not set
711# CONFIG_USB_WACOM is not set
712# CONFIG_USB_ACECAD is not set
713# CONFIG_USB_KBTAB is not set
714# CONFIG_USB_POWERMATE is not set
715# CONFIG_USB_MTOUCH is not set
716# CONFIG_USB_ITMTOUCH is not set
717# CONFIG_USB_EGALAX is not set
718# CONFIG_USB_YEALINK is not set
719# CONFIG_USB_XPAD is not set
720# CONFIG_USB_ATI_REMOTE is not set
721# CONFIG_USB_KEYSPAN_REMOTE is not set
722# CONFIG_USB_APPLETOUCH is not set
723
724#
725# USB Imaging devices
726#
727# CONFIG_USB_MDC800 is not set
728
729#
730# USB Multimedia devices
731#
732# CONFIG_USB_DABUSB is not set
733
734#
735# Video4Linux support is needed for USB Multimedia device support
736#
737
738#
739# USB Network Adapters
740#
741# CONFIG_USB_CATC is not set
742# CONFIG_USB_KAWETH is not set
743# CONFIG_USB_PEGASUS is not set
744# CONFIG_USB_RTL8150 is not set
745# CONFIG_USB_USBNET is not set
746CONFIG_USB_MON=y
747
748#
749# USB port drivers
750#
751
752#
753# USB Serial Converter support
754#
755# CONFIG_USB_SERIAL is not set
756
757#
758# USB Miscellaneous drivers
759#
760# CONFIG_USB_EMI62 is not set
761# CONFIG_USB_EMI26 is not set
762# CONFIG_USB_AUERSWALD is not set
763# CONFIG_USB_RIO500 is not set
764# CONFIG_USB_LEGOTOWER is not set
765# CONFIG_USB_LCD is not set
766# CONFIG_USB_LED is not set
767# CONFIG_USB_CYTHERM is not set
768# CONFIG_USB_PHIDGETKIT is not set
769# CONFIG_USB_PHIDGETSERVO is not set
770# CONFIG_USB_IDMOUSE is not set
771# CONFIG_USB_SISUSBVGA is not set
772# CONFIG_USB_LD is not set
773# CONFIG_USB_TEST is not set
774
775#
776# USB DSL modem support
777#
566 778
567# 779#
568# USB Gadget Support 780# USB Gadget Support
@@ -580,10 +792,15 @@ CONFIG_USB_ARCH_HAS_OHCI=y
580# CONFIG_INFINIBAND is not set 792# CONFIG_INFINIBAND is not set
581 793
582# 794#
795# SN Devices
796#
797
798#
583# File systems 799# File systems
584# 800#
585CONFIG_EXT2_FS=y 801CONFIG_EXT2_FS=y
586# CONFIG_EXT2_FS_XATTR is not set 802# CONFIG_EXT2_FS_XATTR is not set
803# CONFIG_EXT2_FS_XIP is not set
587CONFIG_EXT3_FS=m 804CONFIG_EXT3_FS=m
588CONFIG_EXT3_FS_XATTR=y 805CONFIG_EXT3_FS_XATTR=y
589# CONFIG_EXT3_FS_POSIX_ACL is not set 806# CONFIG_EXT3_FS_POSIX_ACL is not set
@@ -597,18 +814,22 @@ CONFIG_JFS_FS=m
597# CONFIG_JFS_SECURITY is not set 814# CONFIG_JFS_SECURITY is not set
598# CONFIG_JFS_DEBUG is not set 815# CONFIG_JFS_DEBUG is not set
599# CONFIG_JFS_STATISTICS is not set 816# CONFIG_JFS_STATISTICS is not set
817# CONFIG_FS_POSIX_ACL is not set
600CONFIG_XFS_FS=y 818CONFIG_XFS_FS=y
601# CONFIG_XFS_RT is not set 819CONFIG_XFS_EXPORT=y
602CONFIG_XFS_QUOTA=y 820CONFIG_XFS_QUOTA=y
603# CONFIG_XFS_SECURITY is not set 821# CONFIG_XFS_SECURITY is not set
604CONFIG_XFS_POSIX_ACL=y 822CONFIG_XFS_POSIX_ACL=y
823# CONFIG_XFS_RT is not set
605# CONFIG_MINIX_FS is not set 824# CONFIG_MINIX_FS is not set
606CONFIG_ROMFS_FS=m 825CONFIG_ROMFS_FS=m
826CONFIG_INOTIFY=y
607# CONFIG_QUOTA is not set 827# CONFIG_QUOTA is not set
608CONFIG_QUOTACTL=y 828CONFIG_QUOTACTL=y
609CONFIG_DNOTIFY=y 829CONFIG_DNOTIFY=y
610# CONFIG_AUTOFS_FS is not set 830# CONFIG_AUTOFS_FS is not set
611CONFIG_AUTOFS4_FS=y 831CONFIG_AUTOFS4_FS=y
832CONFIG_FUSE_FS=m
612 833
613# 834#
614# CD-ROM/DVD Filesystems 835# CD-ROM/DVD Filesystems
@@ -635,13 +856,10 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
635CONFIG_PROC_FS=y 856CONFIG_PROC_FS=y
636CONFIG_PROC_KCORE=y 857CONFIG_PROC_KCORE=y
637CONFIG_SYSFS=y 858CONFIG_SYSFS=y
638# CONFIG_DEVFS_FS is not set
639CONFIG_DEVPTS_FS_XATTR=y
640CONFIG_DEVPTS_FS_SECURITY=y
641CONFIG_TMPFS=y 859CONFIG_TMPFS=y
642# CONFIG_TMPFS_XATTR is not set
643# CONFIG_HUGETLB_PAGE is not set 860# CONFIG_HUGETLB_PAGE is not set
644CONFIG_RAMFS=y 861CONFIG_RAMFS=y
862CONFIG_RELAYFS_FS=m
645 863
646# 864#
647# Miscellaneous filesystems 865# Miscellaneous filesystems
@@ -665,16 +883,19 @@ CONFIG_CRAMFS=m
665# 883#
666CONFIG_NFS_FS=y 884CONFIG_NFS_FS=y
667CONFIG_NFS_V3=y 885CONFIG_NFS_V3=y
886# CONFIG_NFS_V3_ACL is not set
668# CONFIG_NFS_V4 is not set 887# CONFIG_NFS_V4 is not set
669# CONFIG_NFS_DIRECTIO is not set 888# CONFIG_NFS_DIRECTIO is not set
670CONFIG_NFSD=y 889CONFIG_NFSD=y
671CONFIG_NFSD_V3=y 890CONFIG_NFSD_V3=y
891# CONFIG_NFSD_V3_ACL is not set
672# CONFIG_NFSD_V4 is not set 892# CONFIG_NFSD_V4 is not set
673CONFIG_NFSD_TCP=y 893CONFIG_NFSD_TCP=y
674CONFIG_ROOT_NFS=y 894CONFIG_ROOT_NFS=y
675CONFIG_LOCKD=y 895CONFIG_LOCKD=y
676CONFIG_LOCKD_V4=y 896CONFIG_LOCKD_V4=y
677CONFIG_EXPORTFS=y 897CONFIG_EXPORTFS=y
898CONFIG_NFS_COMMON=y
678CONFIG_SUNRPC=y 899CONFIG_SUNRPC=y
679# CONFIG_RPCSEC_GSS_KRB5 is not set 900# CONFIG_RPCSEC_GSS_KRB5 is not set
680# CONFIG_RPCSEC_GSS_SPKM3 is not set 901# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -685,6 +906,7 @@ CONFIG_SMB_NLS_REMOTE="cp932"
685# CONFIG_NCP_FS is not set 906# CONFIG_NCP_FS is not set
686# CONFIG_CODA_FS is not set 907# CONFIG_CODA_FS is not set
687# CONFIG_AFS_FS is not set 908# CONFIG_AFS_FS is not set
909# CONFIG_9P_FS is not set
688 910
689# 911#
690# Partition Types 912# Partition Types
@@ -744,9 +966,11 @@ CONFIG_NLS_ISO8859_1=m
744# 966#
745# Kernel hacking 967# Kernel hacking
746# 968#
969# CONFIG_PRINTK_TIME is not set
747# CONFIG_DEBUG_KERNEL is not set 970# CONFIG_DEBUG_KERNEL is not set
971CONFIG_LOG_BUF_SHIFT=14
748CONFIG_CROSSCOMPILE=y 972CONFIG_CROSSCOMPILE=y
749CONFIG_CMDLINE="mem=64M console=ttyS0,38400 ip=bootp root=/dev/nfs" 973CONFIG_CMDLINE="mem=64M console=ttyVR0,115200 ip=any root=/dev/nfs"
750 974
751# 975#
752# Security options 976# Security options
@@ -758,7 +982,31 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
758# 982#
759# Cryptographic options 983# Cryptographic options
760# 984#
761# CONFIG_CRYPTO is not set 985CONFIG_CRYPTO=y
986CONFIG_CRYPTO_HMAC=y
987CONFIG_CRYPTO_NULL=m
988CONFIG_CRYPTO_MD4=m
989CONFIG_CRYPTO_MD5=m
990CONFIG_CRYPTO_SHA1=m
991CONFIG_CRYPTO_SHA256=m
992CONFIG_CRYPTO_SHA512=m
993CONFIG_CRYPTO_WP512=m
994CONFIG_CRYPTO_TGR192=m
995CONFIG_CRYPTO_DES=m
996CONFIG_CRYPTO_BLOWFISH=m
997CONFIG_CRYPTO_TWOFISH=m
998CONFIG_CRYPTO_SERPENT=m
999CONFIG_CRYPTO_AES=m
1000CONFIG_CRYPTO_CAST5=m
1001CONFIG_CRYPTO_CAST6=m
1002CONFIG_CRYPTO_TEA=m
1003CONFIG_CRYPTO_ARC4=m
1004CONFIG_CRYPTO_KHAZAD=m
1005CONFIG_CRYPTO_ANUBIS=m
1006CONFIG_CRYPTO_DEFLATE=m
1007CONFIG_CRYPTO_MICHAEL_MIC=m
1008CONFIG_CRYPTO_CRC32C=m
1009# CONFIG_CRYPTO_TEST is not set
762 1010
763# 1011#
764# Hardware crypto devices 1012# Hardware crypto devices
@@ -768,9 +1016,8 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
768# Library routines 1016# Library routines
769# 1017#
770CONFIG_CRC_CCITT=m 1018CONFIG_CRC_CCITT=m
1019CONFIG_CRC16=m
771CONFIG_CRC32=y 1020CONFIG_CRC32=y
772# CONFIG_LIBCRC32C is not set 1021CONFIG_LIBCRC32C=m
773CONFIG_ZLIB_INFLATE=y 1022CONFIG_ZLIB_INFLATE=y
774CONFIG_ZLIB_DEFLATE=m 1023CONFIG_ZLIB_DEFLATE=m
775CONFIG_GENERIC_HARDIRQS=y
776CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/tb0287_defconfig b/arch/mips/configs/tb0287_defconfig
index 17b9f2f65ba0..95344832d66e 100644
--- a/arch/mips/configs/tb0287_defconfig
+++ b/arch/mips/configs/tb0287_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.13-mm1 3# Linux kernel version: 2.6.14-rc5-mm1
4# Thu Sep 1 22:58:34 2005 4# Tue Oct 25 00:20:22 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -19,6 +19,7 @@ CONFIG_INIT_ENV_ARG_LIMIT=32
19CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y 20CONFIG_LOCALVERSION_AUTO=y
21CONFIG_SWAP=y 21CONFIG_SWAP=y
22CONFIG_SWAP_PREFETCH=y
22CONFIG_SYSVIPC=y 23CONFIG_SYSVIPC=y
23# CONFIG_POSIX_MQUEUE is not set 24# CONFIG_POSIX_MQUEUE is not set
24# CONFIG_BSD_PROCESS_ACCT is not set 25# CONFIG_BSD_PROCESS_ACCT is not set
@@ -55,74 +56,91 @@ CONFIG_OBSOLETE_MODPARM=y
55CONFIG_MODVERSIONS=y 56CONFIG_MODVERSIONS=y
56CONFIG_MODULE_SRCVERSION_ALL=y 57CONFIG_MODULE_SRCVERSION_ALL=y
57CONFIG_KMOD=y 58CONFIG_KMOD=y
58CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
59CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
60CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
61CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
62
63#
64# Kernel type
65#
66CONFIG_32BIT=y
67# CONFIG_64BIT is not set
68 59
69# 60#
70# Machine selection 61# Machine selection
71# 62#
72# CONFIG_MACH_JAZZ is not set 63# CONFIG_MIPS_MTX1 is not set
73CONFIG_MACH_VR41XX=y 64# CONFIG_MIPS_BOSPORUS is not set
74# CONFIG_NEC_CMBVR4133 is not set 65# CONFIG_MIPS_PB1000 is not set
75# CONFIG_CASIO_E55 is not set 66# CONFIG_MIPS_PB1100 is not set
76# CONFIG_IBM_WORKPAD is not set 67# CONFIG_MIPS_PB1500 is not set
77CONFIG_TANBAC_TB022X=y 68# CONFIG_MIPS_PB1550 is not set
78# CONFIG_TANBAC_TB0226 is not set 69# CONFIG_MIPS_PB1200 is not set
79CONFIG_TANBAC_TB0287=y 70# CONFIG_MIPS_DB1000 is not set
80# CONFIG_VICTOR_MPC30X is not set 71# CONFIG_MIPS_DB1100 is not set
81# CONFIG_ZAO_CAPCELLA is not set 72# CONFIG_MIPS_DB1500 is not set
82CONFIG_PCI_VR41XX=y 73# CONFIG_MIPS_DB1550 is not set
83# CONFIG_VRC4173 is not set 74# CONFIG_MIPS_DB1200 is not set
84# CONFIG_TOSHIBA_JMR3927 is not set 75# CONFIG_MIPS_MIRAGE is not set
85# CONFIG_MIPS_COBALT is not set 76# CONFIG_MIPS_COBALT is not set
86# CONFIG_MACH_DECSTATION is not set 77# CONFIG_MACH_DECSTATION is not set
87# CONFIG_MIPS_EV64120 is not set 78# CONFIG_MIPS_EV64120 is not set
88# CONFIG_MIPS_EV96100 is not set 79# CONFIG_MIPS_EV96100 is not set
89# CONFIG_MIPS_IVR is not set 80# CONFIG_MIPS_IVR is not set
90# CONFIG_LASAT is not set
91# CONFIG_MIPS_ITE8172 is not set 81# CONFIG_MIPS_ITE8172 is not set
82# CONFIG_MACH_JAZZ is not set
83# CONFIG_LASAT is not set
92# CONFIG_MIPS_ATLAS is not set 84# CONFIG_MIPS_ATLAS is not set
93# CONFIG_MIPS_MALTA is not set 85# CONFIG_MIPS_MALTA is not set
94# CONFIG_MIPS_SEAD is not set 86# CONFIG_MIPS_SEAD is not set
87# CONFIG_MIPS_SIM is not set
88# CONFIG_MOMENCO_JAGUAR_ATX is not set
95# CONFIG_MOMENCO_OCELOT is not set 89# CONFIG_MOMENCO_OCELOT is not set
96# CONFIG_MOMENCO_OCELOT_G is not set
97# CONFIG_MOMENCO_OCELOT_C is not set
98# CONFIG_MOMENCO_OCELOT_3 is not set 90# CONFIG_MOMENCO_OCELOT_3 is not set
99# CONFIG_MOMENCO_JAGUAR_ATX is not set 91# CONFIG_MOMENCO_OCELOT_C is not set
100# CONFIG_PMC_YOSEMITE is not set 92# CONFIG_MOMENCO_OCELOT_G is not set
93# CONFIG_MIPS_XXS1500 is not set
94# CONFIG_PNX8550_V2PCI is not set
95# CONFIG_PNX8550_JBS is not set
101# CONFIG_DDB5074 is not set 96# CONFIG_DDB5074 is not set
102# CONFIG_DDB5476 is not set 97# CONFIG_DDB5476 is not set
103# CONFIG_DDB5477 is not set 98# CONFIG_DDB5477 is not set
99CONFIG_MACH_VR41XX=y
100# CONFIG_PMC_YOSEMITE is not set
104# CONFIG_QEMU is not set 101# CONFIG_QEMU is not set
105# CONFIG_SGI_IP22 is not set 102# CONFIG_SGI_IP22 is not set
106# CONFIG_SGI_IP27 is not set 103# CONFIG_SGI_IP27 is not set
107# CONFIG_SGI_IP32 is not set 104# CONFIG_SGI_IP32 is not set
108# CONFIG_SOC_AU1X00 is not set 105# CONFIG_SIBYTE_SWARM is not set
109# CONFIG_SIBYTE_SB1xxx_SOC is not set 106# CONFIG_SIBYTE_SENTOSA is not set
107# CONFIG_SIBYTE_RHONE is not set
108# CONFIG_SIBYTE_CARMEL is not set
109# CONFIG_SIBYTE_PTSWARM is not set
110# CONFIG_SIBYTE_LITTLESUR is not set
111# CONFIG_SIBYTE_CRHINE is not set
112# CONFIG_SIBYTE_CRHONE is not set
110# CONFIG_SNI_RM200_PCI is not set 113# CONFIG_SNI_RM200_PCI is not set
114# CONFIG_TOSHIBA_JMR3927 is not set
111# CONFIG_TOSHIBA_RBTX4927 is not set 115# CONFIG_TOSHIBA_RBTX4927 is not set
116# CONFIG_TOSHIBA_RBTX4938 is not set
117# CONFIG_CASIO_E55 is not set
118# CONFIG_IBM_WORKPAD is not set
119# CONFIG_NEC_CMBVR4133 is not set
120CONFIG_TANBAC_TB022X=y
121# CONFIG_TANBAC_TB0226 is not set
122CONFIG_TANBAC_TB0287=y
123# CONFIG_VICTOR_MPC30X is not set
124# CONFIG_ZAO_CAPCELLA is not set
125CONFIG_PCI_VR41XX=y
126# CONFIG_VRC4173 is not set
112CONFIG_RWSEM_GENERIC_SPINLOCK=y 127CONFIG_RWSEM_GENERIC_SPINLOCK=y
113CONFIG_GENERIC_CALIBRATE_DELAY=y 128CONFIG_GENERIC_CALIBRATE_DELAY=y
114CONFIG_HAVE_DEC_LOCK=y
115CONFIG_DMA_NONCOHERENT=y 129CONFIG_DMA_NONCOHERENT=y
116CONFIG_DMA_NEED_PCI_MAP_STATE=y 130CONFIG_DMA_NEED_PCI_MAP_STATE=y
131# CONFIG_CPU_BIG_ENDIAN is not set
117CONFIG_CPU_LITTLE_ENDIAN=y 132CONFIG_CPU_LITTLE_ENDIAN=y
133CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
118CONFIG_IRQ_CPU=y 134CONFIG_IRQ_CPU=y
119CONFIG_MIPS_L1_CACHE_SHIFT=5 135CONFIG_MIPS_L1_CACHE_SHIFT=5
120 136
121# 137#
122# CPU selection 138# CPU selection
123# 139#
124# CONFIG_CPU_MIPS32 is not set 140# CONFIG_CPU_MIPS32_R1 is not set
125# CONFIG_CPU_MIPS64 is not set 141# CONFIG_CPU_MIPS32_R2 is not set
142# CONFIG_CPU_MIPS64_R1 is not set
143# CONFIG_CPU_MIPS64_R2 is not set
126# CONFIG_CPU_R3000 is not set 144# CONFIG_CPU_R3000 is not set
127# CONFIG_CPU_TX39XX is not set 145# CONFIG_CPU_TX39XX is not set
128CONFIG_CPU_VR41XX=y 146CONFIG_CPU_VR41XX=y
@@ -138,12 +156,25 @@ CONFIG_CPU_VR41XX=y
138# CONFIG_CPU_RM7000 is not set 156# CONFIG_CPU_RM7000 is not set
139# CONFIG_CPU_RM9000 is not set 157# CONFIG_CPU_RM9000 is not set
140# CONFIG_CPU_SB1 is not set 158# CONFIG_CPU_SB1 is not set
159CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
160CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
161CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
162CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
163
164#
165# Kernel type
166#
167CONFIG_32BIT=y
168# CONFIG_64BIT is not set
141CONFIG_PAGE_SIZE_4KB=y 169CONFIG_PAGE_SIZE_4KB=y
142# CONFIG_PAGE_SIZE_8KB is not set 170# CONFIG_PAGE_SIZE_8KB is not set
143# CONFIG_PAGE_SIZE_16KB is not set 171# CONFIG_PAGE_SIZE_16KB is not set
144# CONFIG_PAGE_SIZE_64KB is not set 172# CONFIG_PAGE_SIZE_64KB is not set
173# CONFIG_MIPS_MT is not set
145# CONFIG_CPU_ADVANCED is not set 174# CONFIG_CPU_ADVANCED is not set
146CONFIG_CPU_HAS_SYNC=y 175CONFIG_CPU_HAS_SYNC=y
176CONFIG_GENERIC_HARDIRQS=y
177CONFIG_GENERIC_IRQ_PROBE=y
147CONFIG_ARCH_FLATMEM_ENABLE=y 178CONFIG_ARCH_FLATMEM_ENABLE=y
148CONFIG_SELECT_MEMORY_MODEL=y 179CONFIG_SELECT_MEMORY_MODEL=y
149CONFIG_FLATMEM_MANUAL=y 180CONFIG_FLATMEM_MANUAL=y
@@ -152,6 +183,9 @@ CONFIG_FLATMEM_MANUAL=y
152CONFIG_FLATMEM=y 183CONFIG_FLATMEM=y
153CONFIG_FLAT_NODE_MEM_MAP=y 184CONFIG_FLAT_NODE_MEM_MAP=y
154# CONFIG_SPARSEMEM_STATIC is not set 185# CONFIG_SPARSEMEM_STATIC is not set
186CONFIG_SPLIT_PTLOCK_CPUS=4
187CONFIG_PREEMPT_NONE=y
188# CONFIG_PREEMPT_VOLUNTARY is not set
155# CONFIG_PREEMPT is not set 189# CONFIG_PREEMPT is not set
156 190
157# 191#
@@ -262,7 +296,6 @@ CONFIG_TCP_CONG_HTCP=m
262# Network testing 296# Network testing
263# 297#
264# CONFIG_NET_PKTGEN is not set 298# CONFIG_NET_PKTGEN is not set
265# CONFIG_NETFILTER_NETLINK is not set
266# CONFIG_HAMRADIO is not set 299# CONFIG_HAMRADIO is not set
267# CONFIG_IRDA is not set 300# CONFIG_IRDA is not set
268# CONFIG_BT is not set 301# CONFIG_BT is not set
@@ -280,6 +313,11 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
280# CONFIG_FW_LOADER is not set 313# CONFIG_FW_LOADER is not set
281 314
282# 315#
316# Connector - unified userspace <-> kernelspace linker
317#
318# CONFIG_CONNECTOR is not set
319
320#
283# Memory Technology Devices (MTD) 321# Memory Technology Devices (MTD)
284# 322#
285# CONFIG_MTD is not set 323# CONFIG_MTD is not set
@@ -296,7 +334,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
296# 334#
297# Block devices 335# Block devices
298# 336#
299# CONFIG_BLK_DEV_FD is not set
300# CONFIG_BLK_CPQ_DA is not set 337# CONFIG_BLK_CPQ_DA is not set
301# CONFIG_BLK_CPQ_CISS_DA is not set 338# CONFIG_BLK_CPQ_CISS_DA is not set
302# CONFIG_BLK_DEV_DAC960 is not set 339# CONFIG_BLK_DEV_DAC960 is not set
@@ -312,6 +349,7 @@ CONFIG_BLK_DEV_RAM_COUNT=16
312CONFIG_BLK_DEV_RAM_SIZE=4096 349CONFIG_BLK_DEV_RAM_SIZE=4096
313# CONFIG_BLK_DEV_INITRD is not set 350# CONFIG_BLK_DEV_INITRD is not set
314# CONFIG_LBD is not set 351# CONFIG_LBD is not set
352# CONFIG_BLK_DEV_IO_TRACE is not set
315# CONFIG_CDROM_PKTCDVD is not set 353# CONFIG_CDROM_PKTCDVD is not set
316 354
317# 355#
@@ -321,6 +359,11 @@ CONFIG_IOSCHED_NOOP=y
321CONFIG_IOSCHED_AS=y 359CONFIG_IOSCHED_AS=y
322CONFIG_IOSCHED_DEADLINE=y 360CONFIG_IOSCHED_DEADLINE=y
323CONFIG_IOSCHED_CFQ=y 361CONFIG_IOSCHED_CFQ=y
362CONFIG_DEFAULT_AS=y
363# CONFIG_DEFAULT_DEADLINE is not set
364# CONFIG_DEFAULT_CFQ is not set
365# CONFIG_DEFAULT_NOOP is not set
366CONFIG_DEFAULT_IOSCHED="anticipatory"
324# CONFIG_ATA_OVER_ETH is not set 367# CONFIG_ATA_OVER_ETH is not set
325 368
326# 369#
@@ -410,13 +453,20 @@ CONFIG_BLK_DEV_SD=y
410# CONFIG_SCSI_SPI_ATTRS is not set 453# CONFIG_SCSI_SPI_ATTRS is not set
411# CONFIG_SCSI_FC_ATTRS is not set 454# CONFIG_SCSI_FC_ATTRS is not set
412# CONFIG_SCSI_ISCSI_ATTRS is not set 455# CONFIG_SCSI_ISCSI_ATTRS is not set
456# CONFIG_SCSI_SAS_ATTRS is not set
457
458#
459# SCSI Transport Layers
460#
461# CONFIG_SAS_CLASS is not set
413 462
414# 463#
415# SCSI low-level drivers 464# SCSI low-level drivers
416# 465#
466# CONFIG_ISCSI_TCP is not set
467# CONFIG_SCSI_ARCMSR is not set
417# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 468# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
418# CONFIG_SCSI_3W_9XXX is not set 469# CONFIG_SCSI_3W_9XXX is not set
419# CONFIG_SCSI_ARCMSR is not set
420# CONFIG_SCSI_ACARD is not set 470# CONFIG_SCSI_ACARD is not set
421# CONFIG_SCSI_AACRAID is not set 471# CONFIG_SCSI_AACRAID is not set
422# CONFIG_SCSI_AIC7XXX is not set 472# CONFIG_SCSI_AIC7XXX is not set
@@ -425,12 +475,10 @@ CONFIG_BLK_DEV_SD=y
425# CONFIG_SCSI_DPT_I2O is not set 475# CONFIG_SCSI_DPT_I2O is not set
426# CONFIG_MEGARAID_NEWGEN is not set 476# CONFIG_MEGARAID_NEWGEN is not set
427# CONFIG_MEGARAID_LEGACY is not set 477# CONFIG_MEGARAID_LEGACY is not set
478# CONFIG_MEGARAID_SAS is not set
428# CONFIG_SCSI_SATA is not set 479# CONFIG_SCSI_SATA is not set
429# CONFIG_SCSI_BUSLOGIC is not set
430# CONFIG_SCSI_DMX3191D is not set 480# CONFIG_SCSI_DMX3191D is not set
431# CONFIG_SCSI_EATA is not set
432# CONFIG_SCSI_FUTURE_DOMAIN is not set 481# CONFIG_SCSI_FUTURE_DOMAIN is not set
433# CONFIG_SCSI_GDTH is not set
434# CONFIG_SCSI_IPS is not set 482# CONFIG_SCSI_IPS is not set
435# CONFIG_SCSI_INITIO is not set 483# CONFIG_SCSI_INITIO is not set
436# CONFIG_SCSI_INIA100 is not set 484# CONFIG_SCSI_INIA100 is not set
@@ -462,6 +510,7 @@ CONFIG_SCSI_QLA2XXX=y
462# CONFIG_FUSION is not set 510# CONFIG_FUSION is not set
463# CONFIG_FUSION_SPI is not set 511# CONFIG_FUSION_SPI is not set
464# CONFIG_FUSION_FC is not set 512# CONFIG_FUSION_FC is not set
513# CONFIG_FUSION_SAS is not set
465 514
466# 515#
467# IEEE 1394 (FireWire) support 516# IEEE 1394 (FireWire) support
@@ -529,6 +578,7 @@ CONFIG_NET_ETHERNET=y
529CONFIG_MII=y 578CONFIG_MII=y
530# CONFIG_HAPPYMEAL is not set 579# CONFIG_HAPPYMEAL is not set
531# CONFIG_SUNGEM is not set 580# CONFIG_SUNGEM is not set
581# CONFIG_CASSINI is not set
532# CONFIG_NET_VENDOR_3COM is not set 582# CONFIG_NET_VENDOR_3COM is not set
533 583
534# 584#
@@ -572,6 +622,7 @@ CONFIG_R8169=y
572# Wireless LAN (non-hamradio) 622# Wireless LAN (non-hamradio)
573# 623#
574# CONFIG_NET_RADIO is not set 624# CONFIG_NET_RADIO is not set
625# CONFIG_HOSTAP is not set
575 626
576# 627#
577# Wan interfaces 628# Wan interfaces
@@ -682,6 +733,7 @@ CONFIG_GPIO_VR41XX=y
682# TPM devices 733# TPM devices
683# 734#
684# CONFIG_TCG_TPM is not set 735# CONFIG_TCG_TPM is not set
736# CONFIG_TELCLOCK is not set
685 737
686# 738#
687# I2C support 739# I2C support
@@ -770,12 +822,15 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
770# 822#
771# USB Device Class drivers 823# USB Device Class drivers
772# 824#
773# CONFIG_USB_BLUETOOTH_TTY is not set
774# CONFIG_USB_ACM is not set 825# CONFIG_USB_ACM is not set
775# CONFIG_USB_PRINTER is not set 826# CONFIG_USB_PRINTER is not set
776 827
777# 828#
778# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information 829# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
830#
831
832#
833# may also be needed; see USB_STORAGE Help for more information
779# 834#
780CONFIG_USB_STORAGE=m 835CONFIG_USB_STORAGE=m
781# CONFIG_USB_STORAGE_DEBUG is not set 836# CONFIG_USB_STORAGE_DEBUG is not set
@@ -891,6 +946,11 @@ CONFIG_USB_MON=y
891# 946#
892 947
893# 948#
949# EDAC - error detection and reporting (RAS)
950#
951# CONFIG_EDAC is not set
952
953#
894# Distributed Lock Manager 954# Distributed Lock Manager
895# 955#
896# CONFIG_DLM is not set 956# CONFIG_DLM is not set
@@ -901,20 +961,22 @@ CONFIG_USB_MON=y
901CONFIG_EXT2_FS=y 961CONFIG_EXT2_FS=y
902# CONFIG_EXT2_FS_XATTR is not set 962# CONFIG_EXT2_FS_XATTR is not set
903# CONFIG_EXT2_FS_XIP is not set 963# CONFIG_EXT2_FS_XIP is not set
904# CONFIG_EXT3_FS is not set 964CONFIG_EXT3_FS=y
965CONFIG_EXT3_FS_XATTR=y
966# CONFIG_EXT3_FS_POSIX_ACL is not set
967# CONFIG_EXT3_FS_SECURITY is not set
968CONFIG_JBD=y
969# CONFIG_JBD_DEBUG is not set
970CONFIG_FS_MBCACHE=y
905# CONFIG_REISER4_FS is not set 971# CONFIG_REISER4_FS is not set
906# CONFIG_REISERFS_FS is not set 972# CONFIG_REISERFS_FS is not set
907# CONFIG_JFS_FS is not set 973# CONFIG_JFS_FS is not set
908# CONFIG_FS_POSIX_ACL is not set 974# CONFIG_FS_POSIX_ACL is not set
909
910#
911# XFS support
912#
913CONFIG_XFS_FS=y 975CONFIG_XFS_FS=y
914# CONFIG_XFS_RT is not set
915CONFIG_XFS_QUOTA=y 976CONFIG_XFS_QUOTA=y
916# CONFIG_XFS_SECURITY is not set 977# CONFIG_XFS_SECURITY is not set
917CONFIG_XFS_POSIX_ACL=y 978CONFIG_XFS_POSIX_ACL=y
979# CONFIG_XFS_RT is not set
918# CONFIG_OCFS2_FS is not set 980# CONFIG_OCFS2_FS is not set
919# CONFIG_MINIX_FS is not set 981# CONFIG_MINIX_FS is not set
920CONFIG_ROMFS_FS=m 982CONFIG_ROMFS_FS=m
@@ -948,8 +1010,8 @@ CONFIG_SYSFS=y
948CONFIG_TMPFS=y 1010CONFIG_TMPFS=y
949# CONFIG_HUGETLB_PAGE is not set 1011# CONFIG_HUGETLB_PAGE is not set
950CONFIG_RAMFS=y 1012CONFIG_RAMFS=y
951# CONFIG_CONFIGFS_FS is not set
952# CONFIG_RELAYFS_FS is not set 1013# CONFIG_RELAYFS_FS is not set
1014# CONFIG_CONFIGFS_FS is not set
953 1015
954# 1016#
955# Miscellaneous filesystems 1017# Miscellaneous filesystems
@@ -1004,6 +1066,11 @@ CONFIG_MSDOS_PARTITION=y
1004# CONFIG_NLS is not set 1066# CONFIG_NLS is not set
1005 1067
1006# 1068#
1069# Profiling support
1070#
1071# CONFIG_PROFILING is not set
1072
1073#
1007# Kernel hacking 1074# Kernel hacking
1008# 1075#
1009# CONFIG_PRINTK_TIME is not set 1076# CONFIG_PRINTK_TIME is not set
@@ -1036,6 +1103,3 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
1036CONFIG_CRC32=y 1103CONFIG_CRC32=y
1037# CONFIG_LIBCRC32C is not set 1104# CONFIG_LIBCRC32C is not set
1038CONFIG_ZLIB_INFLATE=m 1105CONFIG_ZLIB_INFLATE=m
1039CONFIG_GENERIC_HARDIRQS=y
1040CONFIG_GENERIC_IRQ_PROBE=y
1041CONFIG_ISA_DMA_API=y
diff --git a/arch/mips/configs/workpad_defconfig b/arch/mips/configs/workpad_defconfig
index 16e07fca446f..ab13621ef3b9 100644
--- a/arch/mips/configs/workpad_defconfig
+++ b/arch/mips/configs/workpad_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:12 2005 4# Thu Oct 20 22:27:16 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,24 +11,29 @@ CONFIG_32BIT=y
14CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
25# CONFIG_BSD_PROCESS_ACCT is not set 24# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y 25CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set 26# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14 27CONFIG_HOTPLUG=y
29# CONFIG_HOTPLUG is not set
30CONFIG_KOBJECT_UEVENT=y 28CONFIG_KOBJECT_UEVENT=y
31# CONFIG_IKCONFIG is not set 29# CONFIG_IKCONFIG is not set
30CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y 31CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y 32CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_EXTRA_PASS is not set 33# CONFIG_KALLSYMS_EXTRA_PASS is not set
34CONFIG_PRINTK=y
35CONFIG_BUG=y
36CONFIG_BASE_FULL=y
35CONFIG_FUTEX=y 37CONFIG_FUTEX=y
36CONFIG_EPOLL=y 38CONFIG_EPOLL=y
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -41,6 +43,7 @@ CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0 43CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0 44CONFIG_CC_ALIGN_JUMPS=0
43# CONFIG_TINY_SHMEM is not set 45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
44 47
45# 48#
46# Loadable module support 49# Loadable module support
@@ -56,56 +59,84 @@ CONFIG_KMOD=y
56# 59#
57# Machine selection 60# Machine selection
58# 61#
59# CONFIG_MACH_JAZZ is not set 62# CONFIG_MIPS_MTX1 is not set
60CONFIG_MACH_VR41XX=y 63# CONFIG_MIPS_BOSPORUS is not set
61# CONFIG_NEC_CMBVR4133 is not set 64# CONFIG_MIPS_PB1000 is not set
62# CONFIG_CASIO_E55 is not set 65# CONFIG_MIPS_PB1100 is not set
63CONFIG_IBM_WORKPAD=y 66# CONFIG_MIPS_PB1500 is not set
64# CONFIG_TANBAC_TB0226 is not set 67# CONFIG_MIPS_PB1550 is not set
65# CONFIG_TANBAC_TB0229 is not set 68# CONFIG_MIPS_PB1200 is not set
66# CONFIG_VICTOR_MPC30X is not set 69# CONFIG_MIPS_DB1000 is not set
67# CONFIG_ZAO_CAPCELLA is not set 70# CONFIG_MIPS_DB1100 is not set
68CONFIG_VRC4171=y 71# CONFIG_MIPS_DB1500 is not set
69# CONFIG_TOSHIBA_JMR3927 is not set 72# CONFIG_MIPS_DB1550 is not set
73# CONFIG_MIPS_DB1200 is not set
74# CONFIG_MIPS_MIRAGE is not set
70# CONFIG_MIPS_COBALT is not set 75# CONFIG_MIPS_COBALT is not set
71# CONFIG_MACH_DECSTATION is not set 76# CONFIG_MACH_DECSTATION is not set
72# CONFIG_MIPS_EV64120 is not set 77# CONFIG_MIPS_EV64120 is not set
73# CONFIG_MIPS_EV96100 is not set 78# CONFIG_MIPS_EV96100 is not set
74# CONFIG_MIPS_IVR is not set 79# CONFIG_MIPS_IVR is not set
75# CONFIG_LASAT is not set
76# CONFIG_MIPS_ITE8172 is not set 80# CONFIG_MIPS_ITE8172 is not set
81# CONFIG_MACH_JAZZ is not set
82# CONFIG_LASAT is not set
77# CONFIG_MIPS_ATLAS is not set 83# CONFIG_MIPS_ATLAS is not set
78# CONFIG_MIPS_MALTA is not set 84# CONFIG_MIPS_MALTA is not set
79# CONFIG_MIPS_SEAD is not set 85# CONFIG_MIPS_SEAD is not set
86# CONFIG_MIPS_SIM is not set
87# CONFIG_MOMENCO_JAGUAR_ATX is not set
80# CONFIG_MOMENCO_OCELOT is not set 88# CONFIG_MOMENCO_OCELOT is not set
81# CONFIG_MOMENCO_OCELOT_G is not set
82# CONFIG_MOMENCO_OCELOT_C is not set
83# CONFIG_MOMENCO_OCELOT_3 is not set 89# CONFIG_MOMENCO_OCELOT_3 is not set
84# CONFIG_MOMENCO_JAGUAR_ATX is not set 90# CONFIG_MOMENCO_OCELOT_C is not set
85# CONFIG_PMC_YOSEMITE is not set 91# CONFIG_MOMENCO_OCELOT_G is not set
92# CONFIG_MIPS_XXS1500 is not set
93# CONFIG_PNX8550_V2PCI is not set
94# CONFIG_PNX8550_JBS is not set
86# CONFIG_DDB5074 is not set 95# CONFIG_DDB5074 is not set
87# CONFIG_DDB5476 is not set 96# CONFIG_DDB5476 is not set
88# CONFIG_DDB5477 is not set 97# CONFIG_DDB5477 is not set
89# CONFIG_NEC_OSPREY is not set 98CONFIG_MACH_VR41XX=y
99# CONFIG_PMC_YOSEMITE is not set
100# CONFIG_QEMU is not set
90# CONFIG_SGI_IP22 is not set 101# CONFIG_SGI_IP22 is not set
91# CONFIG_SOC_AU1X00 is not set 102# CONFIG_SGI_IP27 is not set
92# CONFIG_SIBYTE_SB1xxx_SOC is not set 103# CONFIG_SGI_IP32 is not set
104# CONFIG_SIBYTE_BIGSUR is not set
105# CONFIG_SIBYTE_SWARM is not set
106# CONFIG_SIBYTE_SENTOSA is not set
107# CONFIG_SIBYTE_RHONE is not set
108# CONFIG_SIBYTE_CARMEL is not set
109# CONFIG_SIBYTE_PTSWARM is not set
110# CONFIG_SIBYTE_LITTLESUR is not set
111# CONFIG_SIBYTE_CRHINE is not set
112# CONFIG_SIBYTE_CRHONE is not set
93# CONFIG_SNI_RM200_PCI is not set 113# CONFIG_SNI_RM200_PCI is not set
114# CONFIG_TOSHIBA_JMR3927 is not set
94# CONFIG_TOSHIBA_RBTX4927 is not set 115# CONFIG_TOSHIBA_RBTX4927 is not set
116# CONFIG_TOSHIBA_RBTX4938 is not set
117# CONFIG_NEC_CMBVR4133 is not set
118# CONFIG_CASIO_E55 is not set
119CONFIG_IBM_WORKPAD=y
120# CONFIG_TANBAC_TB022X is not set
121# CONFIG_VICTOR_MPC30X is not set
122# CONFIG_ZAO_CAPCELLA is not set
95CONFIG_RWSEM_GENERIC_SPINLOCK=y 123CONFIG_RWSEM_GENERIC_SPINLOCK=y
96CONFIG_GENERIC_CALIBRATE_DELAY=y 124CONFIG_GENERIC_CALIBRATE_DELAY=y
97CONFIG_HAVE_DEC_LOCK=y
98CONFIG_DMA_NONCOHERENT=y 125CONFIG_DMA_NONCOHERENT=y
99CONFIG_DMA_NEED_PCI_MAP_STATE=y 126CONFIG_DMA_NEED_PCI_MAP_STATE=y
127# CONFIG_CPU_BIG_ENDIAN is not set
100CONFIG_CPU_LITTLE_ENDIAN=y 128CONFIG_CPU_LITTLE_ENDIAN=y
129CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
101CONFIG_IRQ_CPU=y 130CONFIG_IRQ_CPU=y
102CONFIG_MIPS_L1_CACHE_SHIFT=5 131CONFIG_MIPS_L1_CACHE_SHIFT=5
103 132
104# 133#
105# CPU selection 134# CPU selection
106# 135#
107# CONFIG_CPU_MIPS32 is not set 136# CONFIG_CPU_MIPS32_R1 is not set
108# CONFIG_CPU_MIPS64 is not set 137# CONFIG_CPU_MIPS32_R2 is not set
138# CONFIG_CPU_MIPS64_R1 is not set
139# CONFIG_CPU_MIPS64_R2 is not set
109# CONFIG_CPU_R3000 is not set 140# CONFIG_CPU_R3000 is not set
110# CONFIG_CPU_TX39XX is not set 141# CONFIG_CPU_TX39XX is not set
111CONFIG_CPU_VR41XX=y 142CONFIG_CPU_VR41XX=y
@@ -121,12 +152,36 @@ CONFIG_CPU_VR41XX=y
121# CONFIG_CPU_RM7000 is not set 152# CONFIG_CPU_RM7000 is not set
122# CONFIG_CPU_RM9000 is not set 153# CONFIG_CPU_RM9000 is not set
123# CONFIG_CPU_SB1 is not set 154# CONFIG_CPU_SB1 is not set
155CONFIG_SYS_HAS_CPU_VR41XX=y
156CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
157CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
158CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
159CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
160
161#
162# Kernel type
163#
164CONFIG_32BIT=y
165# CONFIG_64BIT is not set
124CONFIG_PAGE_SIZE_4KB=y 166CONFIG_PAGE_SIZE_4KB=y
125# CONFIG_PAGE_SIZE_8KB is not set 167# CONFIG_PAGE_SIZE_8KB is not set
126# CONFIG_PAGE_SIZE_16KB is not set 168# CONFIG_PAGE_SIZE_16KB is not set
127# CONFIG_PAGE_SIZE_64KB is not set 169# CONFIG_PAGE_SIZE_64KB is not set
170# CONFIG_MIPS_MT is not set
128# CONFIG_CPU_ADVANCED is not set 171# CONFIG_CPU_ADVANCED is not set
129CONFIG_CPU_HAS_SYNC=y 172CONFIG_CPU_HAS_SYNC=y
173CONFIG_GENERIC_HARDIRQS=y
174CONFIG_GENERIC_IRQ_PROBE=y
175CONFIG_ARCH_FLATMEM_ENABLE=y
176CONFIG_SELECT_MEMORY_MODEL=y
177CONFIG_FLATMEM_MANUAL=y
178# CONFIG_DISCONTIGMEM_MANUAL is not set
179# CONFIG_SPARSEMEM_MANUAL is not set
180CONFIG_FLATMEM=y
181CONFIG_FLAT_NODE_MEM_MAP=y
182# CONFIG_SPARSEMEM_STATIC is not set
183CONFIG_PREEMPT_NONE=y
184# CONFIG_PREEMPT_VOLUNTARY is not set
130# CONFIG_PREEMPT is not set 185# CONFIG_PREEMPT is not set
131 186
132# 187#
@@ -138,11 +193,17 @@ CONFIG_MMU=y
138# 193#
139# PCCARD (PCMCIA/CardBus) support 194# PCCARD (PCMCIA/CardBus) support
140# 195#
141# CONFIG_PCCARD is not set 196CONFIG_PCCARD=y
197# CONFIG_PCMCIA_DEBUG is not set
198CONFIG_PCMCIA=y
199CONFIG_PCMCIA_LOAD_CIS=y
200CONFIG_PCMCIA_IOCTL=y
142 201
143# 202#
144# PC-card bridges 203# PC-card bridges
145# 204#
205# CONFIG_I82365 is not set
206# CONFIG_TCIC is not set
146CONFIG_PCMCIA_PROBE=y 207CONFIG_PCMCIA_PROBE=y
147 208
148# 209#
@@ -157,6 +218,78 @@ CONFIG_BINFMT_ELF=y
157CONFIG_TRAD_SIGNALS=y 218CONFIG_TRAD_SIGNALS=y
158 219
159# 220#
221# Networking
222#
223CONFIG_NET=y
224
225#
226# Networking options
227#
228CONFIG_PACKET=y
229CONFIG_PACKET_MMAP=y
230CONFIG_UNIX=y
231CONFIG_XFRM=y
232CONFIG_XFRM_USER=m
233CONFIG_NET_KEY=y
234CONFIG_INET=y
235CONFIG_IP_MULTICAST=y
236# CONFIG_IP_ADVANCED_ROUTER is not set
237CONFIG_IP_FIB_HASH=y
238# CONFIG_IP_PNP is not set
239# CONFIG_NET_IPIP is not set
240# CONFIG_NET_IPGRE is not set
241# CONFIG_IP_MROUTE is not set
242# CONFIG_ARPD is not set
243# CONFIG_SYN_COOKIES is not set
244# CONFIG_INET_AH is not set
245# CONFIG_INET_ESP is not set
246# CONFIG_INET_IPCOMP is not set
247CONFIG_INET_TUNNEL=m
248CONFIG_INET_DIAG=y
249CONFIG_INET_TCP_DIAG=y
250# CONFIG_TCP_CONG_ADVANCED is not set
251CONFIG_TCP_CONG_BIC=y
252# CONFIG_IPV6 is not set
253# CONFIG_NETFILTER is not set
254
255#
256# DCCP Configuration (EXPERIMENTAL)
257#
258# CONFIG_IP_DCCP is not set
259
260#
261# SCTP Configuration (EXPERIMENTAL)
262#
263# CONFIG_IP_SCTP is not set
264# CONFIG_ATM is not set
265# CONFIG_BRIDGE is not set
266# CONFIG_VLAN_8021Q is not set
267# CONFIG_DECNET is not set
268# CONFIG_LLC2 is not set
269# CONFIG_IPX is not set
270# CONFIG_ATALK is not set
271# CONFIG_X25 is not set
272# CONFIG_LAPB is not set
273# CONFIG_NET_DIVERT is not set
274# CONFIG_ECONET is not set
275# CONFIG_WAN_ROUTER is not set
276# CONFIG_NET_SCHED is not set
277# CONFIG_NET_CLS_ROUTE is not set
278
279#
280# Network testing
281#
282# CONFIG_NET_PKTGEN is not set
283# CONFIG_HAMRADIO is not set
284# CONFIG_IRDA is not set
285# CONFIG_BT is not set
286CONFIG_IEEE80211=m
287# CONFIG_IEEE80211_DEBUG is not set
288CONFIG_IEEE80211_CRYPT_WEP=m
289CONFIG_IEEE80211_CRYPT_CCMP=m
290CONFIG_IEEE80211_CRYPT_TKIP=m
291
292#
160# Device Drivers 293# Device Drivers
161# 294#
162 295
@@ -165,7 +298,12 @@ CONFIG_TRAD_SIGNALS=y
165# 298#
166CONFIG_STANDALONE=y 299CONFIG_STANDALONE=y
167CONFIG_PREVENT_FIRMWARE_BUILD=y 300CONFIG_PREVENT_FIRMWARE_BUILD=y
168# CONFIG_FW_LOADER is not set 301CONFIG_FW_LOADER=y
302
303#
304# Connector - unified userspace <-> kernelspace linker
305#
306CONFIG_CONNECTOR=m
169 307
170# 308#
171# Memory Technology Devices (MTD) 309# Memory Technology Devices (MTD)
@@ -185,18 +323,13 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
185# 323#
186# Block devices 324# Block devices
187# 325#
188# CONFIG_BLK_DEV_FD is not set
189# CONFIG_BLK_DEV_XD is not set
190# CONFIG_BLK_DEV_COW_COMMON is not set 326# CONFIG_BLK_DEV_COW_COMMON is not set
191# CONFIG_BLK_DEV_LOOP is not set 327# CONFIG_BLK_DEV_LOOP is not set
192# CONFIG_BLK_DEV_NBD is not set 328# CONFIG_BLK_DEV_NBD is not set
193# CONFIG_BLK_DEV_RAM is not set 329# CONFIG_BLK_DEV_RAM is not set
194CONFIG_BLK_DEV_RAM_COUNT=16 330CONFIG_BLK_DEV_RAM_COUNT=16
195CONFIG_INITRAMFS_SOURCE=""
196# CONFIG_LBD is not set 331# CONFIG_LBD is not set
197CONFIG_CDROM_PKTCDVD=m 332# CONFIG_CDROM_PKTCDVD is not set
198CONFIG_CDROM_PKTCDVD_BUFFERS=8
199# CONFIG_CDROM_PKTCDVD_WCACHE is not set
200 333
201# 334#
202# IO Schedulers 335# IO Schedulers
@@ -219,6 +352,7 @@ CONFIG_BLK_DEV_IDE=y
219# CONFIG_BLK_DEV_IDE_SATA is not set 352# CONFIG_BLK_DEV_IDE_SATA is not set
220CONFIG_BLK_DEV_IDEDISK=y 353CONFIG_BLK_DEV_IDEDISK=y
221# CONFIG_IDEDISK_MULTI_MODE is not set 354# CONFIG_IDEDISK_MULTI_MODE is not set
355CONFIG_BLK_DEV_IDECS=m
222# CONFIG_BLK_DEV_IDECD is not set 356# CONFIG_BLK_DEV_IDECD is not set
223# CONFIG_BLK_DEV_IDETAPE is not set 357# CONFIG_BLK_DEV_IDETAPE is not set
224# CONFIG_BLK_DEV_IDEFLOPPY is not set 358# CONFIG_BLK_DEV_IDEFLOPPY is not set
@@ -237,6 +371,7 @@ CONFIG_IDE_GENERIC=y
237# 371#
238# SCSI device support 372# SCSI device support
239# 373#
374# CONFIG_RAID_ATTRS is not set
240# CONFIG_SCSI is not set 375# CONFIG_SCSI is not set
241 376
242# 377#
@@ -252,6 +387,7 @@ CONFIG_IDE_GENERIC=y
252# 387#
253# Fusion MPT device support 388# Fusion MPT device support
254# 389#
390# CONFIG_FUSION is not set
255 391
256# 392#
257# IEEE 1394 (FireWire) support 393# IEEE 1394 (FireWire) support
@@ -262,76 +398,13 @@ CONFIG_IDE_GENERIC=y
262# 398#
263 399
264# 400#
265# Networking support 401# Network device support
266#
267CONFIG_NET=y
268
269# 402#
270# Networking options
271#
272CONFIG_PACKET=y
273CONFIG_PACKET_MMAP=y
274CONFIG_NETLINK_DEV=y
275CONFIG_UNIX=y
276CONFIG_NET_KEY=y
277CONFIG_INET=y
278CONFIG_IP_MULTICAST=y
279# CONFIG_IP_ADVANCED_ROUTER is not set
280# CONFIG_IP_PNP is not set
281# CONFIG_NET_IPIP is not set
282# CONFIG_NET_IPGRE is not set
283# CONFIG_IP_MROUTE is not set
284# CONFIG_ARPD is not set
285# CONFIG_SYN_COOKIES is not set
286# CONFIG_INET_AH is not set
287# CONFIG_INET_ESP is not set
288# CONFIG_INET_IPCOMP is not set
289CONFIG_INET_TUNNEL=m
290CONFIG_IP_TCPDIAG=m
291# CONFIG_IP_TCPDIAG_IPV6 is not set
292# CONFIG_IPV6 is not set
293# CONFIG_NETFILTER is not set
294CONFIG_XFRM=y
295CONFIG_XFRM_USER=m
296
297#
298# SCTP Configuration (EXPERIMENTAL)
299#
300# CONFIG_IP_SCTP is not set
301# CONFIG_ATM is not set
302# CONFIG_BRIDGE is not set
303# CONFIG_VLAN_8021Q is not set
304# CONFIG_DECNET is not set
305# CONFIG_LLC2 is not set
306# CONFIG_IPX is not set
307# CONFIG_ATALK is not set
308# CONFIG_X25 is not set
309# CONFIG_LAPB is not set
310# CONFIG_NET_DIVERT is not set
311# CONFIG_ECONET is not set
312# CONFIG_WAN_ROUTER is not set
313
314#
315# QoS and/or fair queueing
316#
317# CONFIG_NET_SCHED is not set
318# CONFIG_NET_CLS_ROUTE is not set
319
320#
321# Network testing
322#
323# CONFIG_NET_PKTGEN is not set
324# CONFIG_NETPOLL is not set
325# CONFIG_NET_POLL_CONTROLLER is not set
326# CONFIG_HAMRADIO is not set
327# CONFIG_IRDA is not set
328# CONFIG_BT is not set
329CONFIG_NETDEVICES=y 403CONFIG_NETDEVICES=y
330# CONFIG_DUMMY is not set 404# CONFIG_DUMMY is not set
331# CONFIG_BONDING is not set 405# CONFIG_BONDING is not set
332# CONFIG_EQUALIZER is not set 406# CONFIG_EQUALIZER is not set
333# CONFIG_TUN is not set 407# CONFIG_TUN is not set
334# CONFIG_ETHERTAP is not set
335 408
336# 409#
337# ARCnet devices 410# ARCnet devices
@@ -339,12 +412,26 @@ CONFIG_NETDEVICES=y
339# CONFIG_ARCNET is not set 412# CONFIG_ARCNET is not set
340 413
341# 414#
415# PHY device support
416#
417CONFIG_PHYLIB=m
418CONFIG_PHYCONTROL=y
419
420#
421# MII PHY device drivers
422#
423CONFIG_MARVELL_PHY=m
424CONFIG_DAVICOM_PHY=m
425CONFIG_QSEMI_PHY=m
426CONFIG_LXT_PHY=m
427CONFIG_CICADA_PHY=m
428
429#
342# Ethernet (10 or 100Mbit) 430# Ethernet (10 or 100Mbit)
343# 431#
344CONFIG_NET_ETHERNET=y 432CONFIG_NET_ETHERNET=y
345# CONFIG_MII is not set 433CONFIG_MII=m
346# CONFIG_NET_VENDOR_3COM is not set 434# CONFIG_NET_VENDOR_3COM is not set
347# CONFIG_LANCE is not set
348# CONFIG_NET_VENDOR_SMC is not set 435# CONFIG_NET_VENDOR_SMC is not set
349# CONFIG_NET_VENDOR_RACAL is not set 436# CONFIG_NET_VENDOR_RACAL is not set
350# CONFIG_AT1700 is not set 437# CONFIG_AT1700 is not set
@@ -373,6 +460,19 @@ CONFIG_NET_ETHERNET=y
373# CONFIG_NET_RADIO is not set 460# CONFIG_NET_RADIO is not set
374 461
375# 462#
463# PCMCIA network device support
464#
465CONFIG_NET_PCMCIA=y
466CONFIG_PCMCIA_3C589=m
467CONFIG_PCMCIA_3C574=m
468CONFIG_PCMCIA_FMVJ18X=m
469CONFIG_PCMCIA_PCNET=m
470CONFIG_PCMCIA_NMCLAN=m
471CONFIG_PCMCIA_SMC91C92=m
472CONFIG_PCMCIA_XIRC2PS=m
473CONFIG_PCMCIA_AXNET=m
474
475#
376# Wan interfaces 476# Wan interfaces
377# 477#
378# CONFIG_WAN is not set 478# CONFIG_WAN is not set
@@ -380,6 +480,8 @@ CONFIG_NET_ETHERNET=y
380# CONFIG_SLIP is not set 480# CONFIG_SLIP is not set
381# CONFIG_SHAPER is not set 481# CONFIG_SHAPER is not set
382# CONFIG_NETCONSOLE is not set 482# CONFIG_NETCONSOLE is not set
483# CONFIG_NETPOLL is not set
484# CONFIG_NET_POLL_CONTROLLER is not set
383 485
384# 486#
385# ISDN subsystem 487# ISDN subsystem
@@ -409,18 +511,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
409# CONFIG_INPUT_EVBUG is not set 511# CONFIG_INPUT_EVBUG is not set
410 512
411# 513#
412# Input I/O drivers
413#
414# CONFIG_GAMEPORT is not set
415CONFIG_SOUND_GAMEPORT=y
416CONFIG_SERIO=y
417CONFIG_SERIO_I8042=y
418CONFIG_SERIO_SERPORT=y
419# CONFIG_SERIO_CT82C710 is not set
420# CONFIG_SERIO_LIBPS2 is not set
421CONFIG_SERIO_RAW=m
422
423#
424# Input Device Drivers 514# Input Device Drivers
425# 515#
426# CONFIG_INPUT_KEYBOARD is not set 516# CONFIG_INPUT_KEYBOARD is not set
@@ -430,6 +520,16 @@ CONFIG_SERIO_RAW=m
430# CONFIG_INPUT_MISC is not set 520# CONFIG_INPUT_MISC is not set
431 521
432# 522#
523# Hardware I/O ports
524#
525CONFIG_SERIO=y
526# CONFIG_SERIO_I8042 is not set
527CONFIG_SERIO_SERPORT=y
528# CONFIG_SERIO_LIBPS2 is not set
529CONFIG_SERIO_RAW=m
530# CONFIG_GAMEPORT is not set
531
532#
433# Character devices 533# Character devices
434# 534#
435CONFIG_VT=y 535CONFIG_VT=y
@@ -440,16 +540,15 @@ CONFIG_HW_CONSOLE=y
440# 540#
441# Serial drivers 541# Serial drivers
442# 542#
443CONFIG_SERIAL_8250=y 543# CONFIG_SERIAL_8250 is not set
444CONFIG_SERIAL_8250_CONSOLE=y
445CONFIG_SERIAL_8250_NR_UARTS=4
446# CONFIG_SERIAL_8250_EXTENDED is not set
447 544
448# 545#
449# Non-8250 serial port support 546# Non-8250 serial port support
450# 547#
451CONFIG_SERIAL_CORE=y 548CONFIG_SERIAL_CORE=y
452CONFIG_SERIAL_CORE_CONSOLE=y 549CONFIG_SERIAL_CORE_CONSOLE=y
550CONFIG_SERIAL_VR41XX=y
551CONFIG_SERIAL_VR41XX_CONSOLE=y
453CONFIG_UNIX98_PTYS=y 552CONFIG_UNIX98_PTYS=y
454CONFIG_LEGACY_PTYS=y 553CONFIG_LEGACY_PTYS=y
455CONFIG_LEGACY_PTY_COUNT=256 554CONFIG_LEGACY_PTY_COUNT=256
@@ -484,10 +583,19 @@ CONFIG_WATCHDOG=y
484# 583#
485# Ftape, the floppy tape device driver 584# Ftape, the floppy tape device driver
486# 585#
487# CONFIG_DRM is not set 586
587#
588# PCMCIA character devices
589#
590# CONFIG_SYNCLINK_CS is not set
591# CONFIG_GPIO_VR41XX is not set
488# CONFIG_RAW_DRIVER is not set 592# CONFIG_RAW_DRIVER is not set
489 593
490# 594#
595# TPM devices
596#
597
598#
491# I2C support 599# I2C support
492# 600#
493# CONFIG_I2C is not set 601# CONFIG_I2C is not set
@@ -498,10 +606,20 @@ CONFIG_WATCHDOG=y
498# CONFIG_W1 is not set 606# CONFIG_W1 is not set
499 607
500# 608#
609# Hardware Monitoring support
610#
611# CONFIG_HWMON is not set
612# CONFIG_HWMON_VID is not set
613
614#
501# Misc devices 615# Misc devices
502# 616#
503 617
504# 618#
619# Multimedia Capabilities Port drivers
620#
621
622#
505# Multimedia devices 623# Multimedia devices
506# 624#
507# CONFIG_VIDEO_DEV is not set 625# CONFIG_VIDEO_DEV is not set
@@ -522,7 +640,6 @@ CONFIG_WATCHDOG=y
522# CONFIG_VGA_CONSOLE is not set 640# CONFIG_VGA_CONSOLE is not set
523# CONFIG_MDA_CONSOLE is not set 641# CONFIG_MDA_CONSOLE is not set
524CONFIG_DUMMY_CONSOLE=y 642CONFIG_DUMMY_CONSOLE=y
525# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
526 643
527# 644#
528# Sound 645# Sound
@@ -536,10 +653,6 @@ CONFIG_DUMMY_CONSOLE=y
536# CONFIG_USB_ARCH_HAS_OHCI is not set 653# CONFIG_USB_ARCH_HAS_OHCI is not set
537 654
538# 655#
539# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
540#
541
542#
543# USB Gadget Support 656# USB Gadget Support
544# 657#
545# CONFIG_USB_GADGET is not set 658# CONFIG_USB_GADGET is not set
@@ -552,7 +665,10 @@ CONFIG_DUMMY_CONSOLE=y
552# 665#
553# InfiniBand support 666# InfiniBand support
554# 667#
555# CONFIG_INFINIBAND is not set 668
669#
670# SN Devices
671#
556 672
557# 673#
558# File systems 674# File systems
@@ -561,6 +677,7 @@ CONFIG_EXT2_FS=y
561CONFIG_EXT2_FS_XATTR=y 677CONFIG_EXT2_FS_XATTR=y
562CONFIG_EXT2_FS_POSIX_ACL=y 678CONFIG_EXT2_FS_POSIX_ACL=y
563CONFIG_EXT2_FS_SECURITY=y 679CONFIG_EXT2_FS_SECURITY=y
680# CONFIG_EXT2_FS_XIP is not set
564# CONFIG_EXT3_FS is not set 681# CONFIG_EXT3_FS is not set
565# CONFIG_JBD is not set 682# CONFIG_JBD is not set
566CONFIG_FS_MBCACHE=y 683CONFIG_FS_MBCACHE=y
@@ -570,10 +687,12 @@ CONFIG_FS_POSIX_ACL=y
570# CONFIG_XFS_FS is not set 687# CONFIG_XFS_FS is not set
571# CONFIG_MINIX_FS is not set 688# CONFIG_MINIX_FS is not set
572# CONFIG_ROMFS_FS is not set 689# CONFIG_ROMFS_FS is not set
690CONFIG_INOTIFY=y
573# CONFIG_QUOTA is not set 691# CONFIG_QUOTA is not set
574CONFIG_DNOTIFY=y 692CONFIG_DNOTIFY=y
575CONFIG_AUTOFS_FS=y 693CONFIG_AUTOFS_FS=y
576CONFIG_AUTOFS4_FS=y 694CONFIG_AUTOFS4_FS=y
695CONFIG_FUSE_FS=m
577 696
578# 697#
579# CD-ROM/DVD Filesystems 698# CD-ROM/DVD Filesystems
@@ -594,12 +713,10 @@ CONFIG_AUTOFS4_FS=y
594CONFIG_PROC_FS=y 713CONFIG_PROC_FS=y
595CONFIG_PROC_KCORE=y 714CONFIG_PROC_KCORE=y
596CONFIG_SYSFS=y 715CONFIG_SYSFS=y
597# CONFIG_DEVFS_FS is not set
598CONFIG_DEVPTS_FS_XATTR=y
599CONFIG_DEVPTS_FS_SECURITY=y
600# CONFIG_TMPFS is not set 716# CONFIG_TMPFS is not set
601# CONFIG_HUGETLB_PAGE is not set 717# CONFIG_HUGETLB_PAGE is not set
602CONFIG_RAMFS=y 718CONFIG_RAMFS=y
719CONFIG_RELAYFS_FS=m
603 720
604# 721#
605# Miscellaneous filesystems 722# Miscellaneous filesystems
@@ -630,6 +747,7 @@ CONFIG_NFSD=y
630# CONFIG_NFSD_TCP is not set 747# CONFIG_NFSD_TCP is not set
631CONFIG_LOCKD=y 748CONFIG_LOCKD=y
632CONFIG_EXPORTFS=y 749CONFIG_EXPORTFS=y
750CONFIG_NFS_COMMON=y
633CONFIG_SUNRPC=y 751CONFIG_SUNRPC=y
634# CONFIG_RPCSEC_GSS_KRB5 is not set 752# CONFIG_RPCSEC_GSS_KRB5 is not set
635# CONFIG_RPCSEC_GSS_SPKM3 is not set 753# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -638,6 +756,7 @@ CONFIG_SUNRPC=y
638# CONFIG_NCP_FS is not set 756# CONFIG_NCP_FS is not set
639# CONFIG_CODA_FS is not set 757# CONFIG_CODA_FS is not set
640# CONFIG_AFS_FS is not set 758# CONFIG_AFS_FS is not set
759# CONFIG_9P_FS is not set
641 760
642# 761#
643# Partition Types 762# Partition Types
@@ -658,9 +777,11 @@ CONFIG_MSDOS_PARTITION=y
658# 777#
659# Kernel hacking 778# Kernel hacking
660# 779#
780# CONFIG_PRINTK_TIME is not set
661# CONFIG_DEBUG_KERNEL is not set 781# CONFIG_DEBUG_KERNEL is not set
782CONFIG_LOG_BUF_SHIFT=14
662CONFIG_CROSSCOMPILE=y 783CONFIG_CROSSCOMPILE=y
663CONFIG_CMDLINE="" 784CONFIG_CMDLINE="console=ttyVR0,19200 mem=16M"
664 785
665# 786#
666# Security options 787# Security options
@@ -672,7 +793,31 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
672# 793#
673# Cryptographic options 794# Cryptographic options
674# 795#
675# CONFIG_CRYPTO is not set 796CONFIG_CRYPTO=y
797CONFIG_CRYPTO_HMAC=y
798CONFIG_CRYPTO_NULL=m
799CONFIG_CRYPTO_MD4=m
800CONFIG_CRYPTO_MD5=m
801CONFIG_CRYPTO_SHA1=m
802CONFIG_CRYPTO_SHA256=m
803CONFIG_CRYPTO_SHA512=m
804CONFIG_CRYPTO_WP512=m
805CONFIG_CRYPTO_TGR192=m
806CONFIG_CRYPTO_DES=m
807CONFIG_CRYPTO_BLOWFISH=m
808CONFIG_CRYPTO_TWOFISH=m
809CONFIG_CRYPTO_SERPENT=m
810CONFIG_CRYPTO_AES=m
811CONFIG_CRYPTO_CAST5=m
812CONFIG_CRYPTO_CAST6=m
813CONFIG_CRYPTO_TEA=m
814CONFIG_CRYPTO_ARC4=m
815CONFIG_CRYPTO_KHAZAD=m
816CONFIG_CRYPTO_ANUBIS=m
817CONFIG_CRYPTO_DEFLATE=m
818CONFIG_CRYPTO_MICHAEL_MIC=m
819CONFIG_CRYPTO_CRC32C=m
820# CONFIG_CRYPTO_TEST is not set
676 821
677# 822#
678# Hardware crypto devices 823# Hardware crypto devices
@@ -682,7 +827,8 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
682# Library routines 827# Library routines
683# 828#
684# CONFIG_CRC_CCITT is not set 829# CONFIG_CRC_CCITT is not set
685# CONFIG_CRC32 is not set 830CONFIG_CRC16=m
686# CONFIG_LIBCRC32C is not set 831CONFIG_CRC32=y
687CONFIG_GENERIC_HARDIRQS=y 832CONFIG_LIBCRC32C=m
688CONFIG_GENERIC_IRQ_PROBE=y 833CONFIG_ZLIB_INFLATE=m
834CONFIG_ZLIB_DEFLATE=m
diff --git a/arch/mips/configs/yosemite_defconfig b/arch/mips/configs/yosemite_defconfig
index 6d2290777ad7..5b0b7f30e205 100644
--- a/arch/mips/configs/yosemite_defconfig
+++ b/arch/mips/configs/yosemite_defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:49:13 2005 4# Thu Oct 20 22:27:18 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,25 +11,31 @@ CONFIG_32BIT=y
14# CONFIG_EXPERIMENTAL is not set 11# CONFIG_EXPERIMENTAL is not set
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_LOCK_KERNEL=y 13CONFIG_LOCK_KERNEL=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24# CONFIG_BSD_PROCESS_ACCT is not set 23# CONFIG_BSD_PROCESS_ACCT is not set
25CONFIG_SYSCTL=y 24CONFIG_SYSCTL=y
26# CONFIG_AUDIT is not set 25# CONFIG_AUDIT is not set
27CONFIG_LOG_BUF_SHIFT=14 26CONFIG_HOTPLUG=y
28# CONFIG_HOTPLUG is not set
29CONFIG_KOBJECT_UEVENT=y 27CONFIG_KOBJECT_UEVENT=y
30CONFIG_IKCONFIG=y 28CONFIG_IKCONFIG=y
31CONFIG_IKCONFIG_PROC=y 29CONFIG_IKCONFIG_PROC=y
30# CONFIG_CPUSETS is not set
31CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y 32CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y 33CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_ALL is not set 34# CONFIG_KALLSYMS_ALL is not set
35# CONFIG_KALLSYMS_EXTRA_PASS is not set 35# CONFIG_KALLSYMS_EXTRA_PASS is not set
36CONFIG_PRINTK=y
37CONFIG_BUG=y
38CONFIG_BASE_FULL=y
36CONFIG_FUTEX=y 39CONFIG_FUTEX=y
37CONFIG_EPOLL=y 40CONFIG_EPOLL=y
38# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 41# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -42,6 +45,7 @@ CONFIG_CC_ALIGN_LABELS=0
42CONFIG_CC_ALIGN_LOOPS=0 45CONFIG_CC_ALIGN_LOOPS=0
43CONFIG_CC_ALIGN_JUMPS=0 46CONFIG_CC_ALIGN_JUMPS=0
44# CONFIG_TINY_SHMEM is not set 47# CONFIG_TINY_SHMEM is not set
48CONFIG_BASE_SMALL=0
45 49
46# 50#
47# Loadable module support 51# Loadable module support
@@ -56,34 +60,68 @@ CONFIG_STOP_MACHINE=y
56# 60#
57# Machine selection 61# Machine selection
58# 62#
59# CONFIG_MACH_JAZZ is not set 63# CONFIG_MIPS_MTX1 is not set
60# CONFIG_MACH_VR41XX is not set 64# CONFIG_MIPS_BOSPORUS is not set
61# CONFIG_TOSHIBA_JMR3927 is not set 65# CONFIG_MIPS_PB1000 is not set
66# CONFIG_MIPS_PB1100 is not set
67# CONFIG_MIPS_PB1500 is not set
68# CONFIG_MIPS_PB1550 is not set
69# CONFIG_MIPS_PB1200 is not set
70# CONFIG_MIPS_DB1000 is not set
71# CONFIG_MIPS_DB1100 is not set
72# CONFIG_MIPS_DB1500 is not set
73# CONFIG_MIPS_DB1550 is not set
74# CONFIG_MIPS_DB1200 is not set
75# CONFIG_MIPS_MIRAGE is not set
76# CONFIG_MIPS_COBALT is not set
62# CONFIG_MACH_DECSTATION is not set 77# CONFIG_MACH_DECSTATION is not set
78# CONFIG_MIPS_EV64120 is not set
79# CONFIG_MIPS_EV96100 is not set
63# CONFIG_MIPS_IVR is not set 80# CONFIG_MIPS_IVR is not set
64# CONFIG_LASAT is not set
65# CONFIG_MIPS_ITE8172 is not set 81# CONFIG_MIPS_ITE8172 is not set
82# CONFIG_MACH_JAZZ is not set
83# CONFIG_LASAT is not set
66# CONFIG_MIPS_ATLAS is not set 84# CONFIG_MIPS_ATLAS is not set
67# CONFIG_MIPS_MALTA is not set 85# CONFIG_MIPS_MALTA is not set
86# CONFIG_MIPS_SEAD is not set
87# CONFIG_MIPS_SIM is not set
88# CONFIG_MOMENCO_JAGUAR_ATX is not set
68# CONFIG_MOMENCO_OCELOT is not set 89# CONFIG_MOMENCO_OCELOT is not set
69# CONFIG_MOMENCO_OCELOT_G is not set
70# CONFIG_MOMENCO_OCELOT_C is not set
71# CONFIG_MOMENCO_OCELOT_3 is not set 90# CONFIG_MOMENCO_OCELOT_3 is not set
72# CONFIG_MOMENCO_JAGUAR_ATX is not set 91# CONFIG_MOMENCO_OCELOT_C is not set
73CONFIG_PMC_YOSEMITE=y 92# CONFIG_MOMENCO_OCELOT_G is not set
74# CONFIG_HYPERTRANSPORT is not set 93# CONFIG_MIPS_XXS1500 is not set
94# CONFIG_PNX8550_V2PCI is not set
95# CONFIG_PNX8550_JBS is not set
96# CONFIG_DDB5074 is not set
75# CONFIG_DDB5476 is not set 97# CONFIG_DDB5476 is not set
76# CONFIG_DDB5477 is not set 98# CONFIG_DDB5477 is not set
77# CONFIG_NEC_OSPREY is not set 99# CONFIG_MACH_VR41XX is not set
100CONFIG_PMC_YOSEMITE=y
101# CONFIG_QEMU is not set
78# CONFIG_SGI_IP22 is not set 102# CONFIG_SGI_IP22 is not set
79# CONFIG_SOC_AU1X00 is not set 103# CONFIG_SGI_IP27 is not set
104# CONFIG_SGI_IP32 is not set
105# CONFIG_SIBYTE_BIGSUR is not set
106# CONFIG_SIBYTE_SWARM is not set
107# CONFIG_SIBYTE_SENTOSA is not set
108# CONFIG_SIBYTE_RHONE is not set
109# CONFIG_SIBYTE_CARMEL is not set
110# CONFIG_SIBYTE_PTSWARM is not set
111# CONFIG_SIBYTE_LITTLESUR is not set
112# CONFIG_SIBYTE_CRHINE is not set
113# CONFIG_SIBYTE_CRHONE is not set
80# CONFIG_SNI_RM200_PCI is not set 114# CONFIG_SNI_RM200_PCI is not set
115# CONFIG_TOSHIBA_JMR3927 is not set
81# CONFIG_TOSHIBA_RBTX4927 is not set 116# CONFIG_TOSHIBA_RBTX4927 is not set
117# CONFIG_TOSHIBA_RBTX4938 is not set
118# CONFIG_HYPERTRANSPORT is not set
82CONFIG_RWSEM_GENERIC_SPINLOCK=y 119CONFIG_RWSEM_GENERIC_SPINLOCK=y
83CONFIG_GENERIC_CALIBRATE_DELAY=y 120CONFIG_GENERIC_CALIBRATE_DELAY=y
84CONFIG_HAVE_DEC_LOCK=y
85CONFIG_DMA_COHERENT=y 121CONFIG_DMA_COHERENT=y
122CONFIG_CPU_BIG_ENDIAN=y
86# CONFIG_CPU_LITTLE_ENDIAN is not set 123# CONFIG_CPU_LITTLE_ENDIAN is not set
124CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
87CONFIG_IRQ_CPU=y 125CONFIG_IRQ_CPU=y
88CONFIG_IRQ_CPU_RM7K=y 126CONFIG_IRQ_CPU_RM7K=y
89CONFIG_IRQ_CPU_RM9K=y 127CONFIG_IRQ_CPU_RM9K=y
@@ -93,8 +131,10 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
93# 131#
94# CPU selection 132# CPU selection
95# 133#
96# CONFIG_CPU_MIPS32 is not set 134# CONFIG_CPU_MIPS32_R1 is not set
97# CONFIG_CPU_MIPS64 is not set 135# CONFIG_CPU_MIPS32_R2 is not set
136# CONFIG_CPU_MIPS64_R1 is not set
137# CONFIG_CPU_MIPS64_R2 is not set
98# CONFIG_CPU_R3000 is not set 138# CONFIG_CPU_R3000 is not set
99# CONFIG_CPU_TX39XX is not set 139# CONFIG_CPU_TX39XX is not set
100# CONFIG_CPU_VR41XX is not set 140# CONFIG_CPU_VR41XX is not set
@@ -110,20 +150,43 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
110# CONFIG_CPU_RM7000 is not set 150# CONFIG_CPU_RM7000 is not set
111CONFIG_CPU_RM9000=y 151CONFIG_CPU_RM9000=y
112# CONFIG_CPU_SB1 is not set 152# CONFIG_CPU_SB1 is not set
153CONFIG_SYS_HAS_CPU_RM9000=y
154CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
155CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
156CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
157CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
158
159#
160# Kernel type
161#
162CONFIG_32BIT=y
163# CONFIG_64BIT is not set
113CONFIG_PAGE_SIZE_4KB=y 164CONFIG_PAGE_SIZE_4KB=y
114# CONFIG_PAGE_SIZE_8KB is not set 165# CONFIG_PAGE_SIZE_8KB is not set
115# CONFIG_PAGE_SIZE_16KB is not set 166# CONFIG_PAGE_SIZE_16KB is not set
116# CONFIG_PAGE_SIZE_64KB is not set 167# CONFIG_PAGE_SIZE_64KB is not set
117CONFIG_CPU_HAS_PREFETCH=y 168CONFIG_CPU_HAS_PREFETCH=y
169# CONFIG_MIPS_MT is not set
118# CONFIG_64BIT_PHYS_ADDR is not set 170# CONFIG_64BIT_PHYS_ADDR is not set
119# CONFIG_CPU_ADVANCED is not set 171# CONFIG_CPU_ADVANCED is not set
120CONFIG_CPU_HAS_LLSC=y 172CONFIG_CPU_HAS_LLSC=y
121CONFIG_CPU_HAS_LLDSCD=y 173CONFIG_CPU_HAS_LLDSCD=y
122CONFIG_CPU_HAS_SYNC=y 174CONFIG_CPU_HAS_SYNC=y
175CONFIG_GENERIC_HARDIRQS=y
176CONFIG_GENERIC_IRQ_PROBE=y
123CONFIG_HIGHMEM=y 177CONFIG_HIGHMEM=y
178CONFIG_CPU_SUPPORTS_HIGHMEM=y
179CONFIG_SYS_SUPPORTS_HIGHMEM=y
180CONFIG_ARCH_FLATMEM_ENABLE=y
181CONFIG_FLATMEM=y
182CONFIG_FLAT_NODE_MEM_MAP=y
183# CONFIG_SPARSEMEM_STATIC is not set
124CONFIG_SMP=y 184CONFIG_SMP=y
125CONFIG_NR_CPUS=2 185CONFIG_NR_CPUS=2
186CONFIG_PREEMPT_NONE=y
187# CONFIG_PREEMPT_VOLUNTARY is not set
126# CONFIG_PREEMPT is not set 188# CONFIG_PREEMPT is not set
189CONFIG_PREEMPT_BKL=y
127 190
128# 191#
129# Bus options (PCI, PCMCIA, EISA, ISA, TC) 192# Bus options (PCI, PCMCIA, EISA, ISA, TC)
@@ -131,7 +194,7 @@ CONFIG_NR_CPUS=2
131CONFIG_HW_HAS_PCI=y 194CONFIG_HW_HAS_PCI=y
132CONFIG_PCI=y 195CONFIG_PCI=y
133CONFIG_PCI_LEGACY_PROC=y 196CONFIG_PCI_LEGACY_PROC=y
134CONFIG_PCI_NAMES=y 197# CONFIG_PCI_DEBUG is not set
135CONFIG_MMU=y 198CONFIG_MMU=y
136 199
137# 200#
@@ -140,10 +203,6 @@ CONFIG_MMU=y
140# CONFIG_PCCARD is not set 203# CONFIG_PCCARD is not set
141 204
142# 205#
143# PC-card bridges
144#
145
146#
147# PCI Hotplug Support 206# PCI Hotplug Support
148# 207#
149 208
@@ -155,6 +214,69 @@ CONFIG_BINFMT_ELF=y
155CONFIG_TRAD_SIGNALS=y 214CONFIG_TRAD_SIGNALS=y
156 215
157# 216#
217# Networking
218#
219CONFIG_NET=y
220
221#
222# Networking options
223#
224CONFIG_PACKET=m
225CONFIG_PACKET_MMAP=y
226CONFIG_UNIX=y
227CONFIG_XFRM=y
228CONFIG_XFRM_USER=m
229# CONFIG_NET_KEY is not set
230CONFIG_INET=y
231# CONFIG_IP_MULTICAST is not set
232# CONFIG_IP_ADVANCED_ROUTER is not set
233CONFIG_IP_FIB_HASH=y
234CONFIG_IP_PNP=y
235# CONFIG_IP_PNP_DHCP is not set
236CONFIG_IP_PNP_BOOTP=y
237# CONFIG_IP_PNP_RARP is not set
238# CONFIG_NET_IPIP is not set
239# CONFIG_NET_IPGRE is not set
240# CONFIG_SYN_COOKIES is not set
241# CONFIG_INET_AH is not set
242# CONFIG_INET_ESP is not set
243# CONFIG_INET_IPCOMP is not set
244CONFIG_INET_TUNNEL=m
245CONFIG_INET_DIAG=y
246CONFIG_INET_TCP_DIAG=y
247# CONFIG_TCP_CONG_ADVANCED is not set
248CONFIG_TCP_CONG_BIC=y
249CONFIG_IPV6=m
250CONFIG_IPV6_PRIVACY=y
251CONFIG_INET6_AH=m
252CONFIG_INET6_ESP=m
253CONFIG_INET6_IPCOMP=m
254CONFIG_INET6_TUNNEL=m
255CONFIG_IPV6_TUNNEL=m
256# CONFIG_NETFILTER is not set
257# CONFIG_BRIDGE is not set
258# CONFIG_VLAN_8021Q is not set
259# CONFIG_DECNET is not set
260# CONFIG_LLC2 is not set
261# CONFIG_IPX is not set
262# CONFIG_ATALK is not set
263# CONFIG_NET_SCHED is not set
264# CONFIG_NET_CLS_ROUTE is not set
265
266#
267# Network testing
268#
269# CONFIG_NET_PKTGEN is not set
270# CONFIG_HAMRADIO is not set
271# CONFIG_IRDA is not set
272# CONFIG_BT is not set
273CONFIG_IEEE80211=m
274# CONFIG_IEEE80211_DEBUG is not set
275CONFIG_IEEE80211_CRYPT_WEP=m
276CONFIG_IEEE80211_CRYPT_CCMP=m
277CONFIG_IEEE80211_CRYPT_TKIP=m
278
279#
158# Device Drivers 280# Device Drivers
159# 281#
160 282
@@ -163,10 +285,15 @@ CONFIG_TRAD_SIGNALS=y
163# 285#
164CONFIG_STANDALONE=y 286CONFIG_STANDALONE=y
165CONFIG_PREVENT_FIRMWARE_BUILD=y 287CONFIG_PREVENT_FIRMWARE_BUILD=y
166# CONFIG_FW_LOADER is not set 288CONFIG_FW_LOADER=m
167# CONFIG_DEBUG_DRIVER is not set 289# CONFIG_DEBUG_DRIVER is not set
168 290
169# 291#
292# Connector - unified userspace <-> kernelspace linker
293#
294CONFIG_CONNECTOR=m
295
296#
170# Memory Technology Devices (MTD) 297# Memory Technology Devices (MTD)
171# 298#
172# CONFIG_MTD is not set 299# CONFIG_MTD is not set
@@ -183,7 +310,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
183# 310#
184# Block devices 311# Block devices
185# 312#
186# CONFIG_BLK_DEV_FD is not set
187# CONFIG_BLK_CPQ_DA is not set 313# CONFIG_BLK_CPQ_DA is not set
188# CONFIG_BLK_CPQ_CISS_DA is not set 314# CONFIG_BLK_CPQ_CISS_DA is not set
189# CONFIG_BLK_DEV_DAC960 is not set 315# CONFIG_BLK_DEV_DAC960 is not set
@@ -193,7 +319,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
193# CONFIG_BLK_DEV_SX8 is not set 319# CONFIG_BLK_DEV_SX8 is not set
194# CONFIG_BLK_DEV_RAM is not set 320# CONFIG_BLK_DEV_RAM is not set
195CONFIG_BLK_DEV_RAM_COUNT=16 321CONFIG_BLK_DEV_RAM_COUNT=16
196CONFIG_INITRAMFS_SOURCE=""
197# CONFIG_LBD is not set 322# CONFIG_LBD is not set
198CONFIG_CDROM_PKTCDVD=m 323CONFIG_CDROM_PKTCDVD=m
199CONFIG_CDROM_PKTCDVD_BUFFERS=8 324CONFIG_CDROM_PKTCDVD_BUFFERS=8
@@ -216,6 +341,7 @@ CONFIG_ATA_OVER_ETH=m
216# 341#
217# SCSI device support 342# SCSI device support
218# 343#
344CONFIG_RAID_ATTRS=m
219# CONFIG_SCSI is not set 345# CONFIG_SCSI is not set
220 346
221# 347#
@@ -226,6 +352,7 @@ CONFIG_ATA_OVER_ETH=m
226# 352#
227# Fusion MPT device support 353# Fusion MPT device support
228# 354#
355# CONFIG_FUSION is not set
229 356
230# 357#
231# IEEE 1394 (FireWire) support 358# IEEE 1394 (FireWire) support
@@ -238,59 +365,8 @@ CONFIG_ATA_OVER_ETH=m
238# CONFIG_I2O is not set 365# CONFIG_I2O is not set
239 366
240# 367#
241# Networking support 368# Network device support
242# 369#
243CONFIG_NET=y
244
245#
246# Networking options
247#
248CONFIG_PACKET=m
249CONFIG_PACKET_MMAP=y
250CONFIG_NETLINK_DEV=m
251CONFIG_UNIX=y
252# CONFIG_NET_KEY is not set
253CONFIG_INET=y
254# CONFIG_IP_MULTICAST is not set
255# CONFIG_IP_ADVANCED_ROUTER is not set
256CONFIG_IP_PNP=y
257# CONFIG_IP_PNP_DHCP is not set
258CONFIG_IP_PNP_BOOTP=y
259# CONFIG_IP_PNP_RARP is not set
260# CONFIG_NET_IPIP is not set
261# CONFIG_NET_IPGRE is not set
262# CONFIG_SYN_COOKIES is not set
263# CONFIG_INET_AH is not set
264# CONFIG_INET_ESP is not set
265# CONFIG_INET_IPCOMP is not set
266CONFIG_INET_TUNNEL=m
267CONFIG_IP_TCPDIAG=m
268# CONFIG_IP_TCPDIAG_IPV6 is not set
269# CONFIG_NETFILTER is not set
270CONFIG_XFRM=y
271CONFIG_XFRM_USER=m
272# CONFIG_BRIDGE is not set
273# CONFIG_VLAN_8021Q is not set
274# CONFIG_DECNET is not set
275# CONFIG_LLC2 is not set
276# CONFIG_IPX is not set
277# CONFIG_ATALK is not set
278
279#
280# QoS and/or fair queueing
281#
282# CONFIG_NET_SCHED is not set
283# CONFIG_NET_CLS_ROUTE is not set
284
285#
286# Network testing
287#
288# CONFIG_NET_PKTGEN is not set
289# CONFIG_NETPOLL is not set
290# CONFIG_NET_POLL_CONTROLLER is not set
291# CONFIG_HAMRADIO is not set
292# CONFIG_IRDA is not set
293# CONFIG_BT is not set
294CONFIG_NETDEVICES=y 370CONFIG_NETDEVICES=y
295# CONFIG_DUMMY is not set 371# CONFIG_DUMMY is not set
296# CONFIG_BONDING is not set 372# CONFIG_BONDING is not set
@@ -303,6 +379,21 @@ CONFIG_NETDEVICES=y
303# CONFIG_ARCNET is not set 379# CONFIG_ARCNET is not set
304 380
305# 381#
382# PHY device support
383#
384CONFIG_PHYLIB=m
385CONFIG_PHYCONTROL=y
386
387#
388# MII PHY device drivers
389#
390CONFIG_MARVELL_PHY=m
391CONFIG_DAVICOM_PHY=m
392CONFIG_QSEMI_PHY=m
393CONFIG_LXT_PHY=m
394CONFIG_CICADA_PHY=m
395
396#
306# Ethernet (10 or 100Mbit) 397# Ethernet (10 or 100Mbit)
307# 398#
308CONFIG_NET_ETHERNET=y 399CONFIG_NET_ETHERNET=y
@@ -327,13 +418,16 @@ CONFIG_MII=y
327# CONFIG_NS83820 is not set 418# CONFIG_NS83820 is not set
328# CONFIG_HAMACHI is not set 419# CONFIG_HAMACHI is not set
329# CONFIG_R8169 is not set 420# CONFIG_R8169 is not set
421# CONFIG_SIS190 is not set
330# CONFIG_SK98LIN is not set 422# CONFIG_SK98LIN is not set
331# CONFIG_TIGON3 is not set 423# CONFIG_TIGON3 is not set
424# CONFIG_BNX2 is not set
332CONFIG_TITAN_GE=y 425CONFIG_TITAN_GE=y
333 426
334# 427#
335# Ethernet (10000 Mbit) 428# Ethernet (10000 Mbit)
336# 429#
430# CONFIG_CHELSIO_T1 is not set
337# CONFIG_IXGB is not set 431# CONFIG_IXGB is not set
338# CONFIG_S2IO is not set 432# CONFIG_S2IO is not set
339 433
@@ -346,6 +440,8 @@ CONFIG_TITAN_GE=y
346# Wireless LAN (non-hamradio) 440# Wireless LAN (non-hamradio)
347# 441#
348# CONFIG_NET_RADIO is not set 442# CONFIG_NET_RADIO is not set
443# CONFIG_IPW_DEBUG is not set
444CONFIG_IPW2200=m
349 445
350# 446#
351# Wan interfaces 447# Wan interfaces
@@ -354,6 +450,8 @@ CONFIG_TITAN_GE=y
354# CONFIG_FDDI is not set 450# CONFIG_FDDI is not set
355# CONFIG_PPP is not set 451# CONFIG_PPP is not set
356# CONFIG_SLIP is not set 452# CONFIG_SLIP is not set
453# CONFIG_NETPOLL is not set
454# CONFIG_NET_POLL_CONTROLLER is not set
357 455
358# 456#
359# ISDN subsystem 457# ISDN subsystem
@@ -371,20 +469,10 @@ CONFIG_TITAN_GE=y
371# CONFIG_INPUT is not set 469# CONFIG_INPUT is not set
372 470
373# 471#
374# Userland interfaces 472# Hardware I/O ports
375#
376
377#
378# Input I/O drivers
379# 473#
380# CONFIG_GAMEPORT is not set
381CONFIG_SOUND_GAMEPORT=y
382# CONFIG_SERIO is not set 474# CONFIG_SERIO is not set
383# CONFIG_SERIO_I8042 is not set 475# CONFIG_GAMEPORT is not set
384
385#
386# Input Device Drivers
387#
388 476
389# 477#
390# Character devices 478# Character devices
@@ -405,6 +493,7 @@ CONFIG_SERIAL_8250_NR_UARTS=4
405# 493#
406CONFIG_SERIAL_CORE=y 494CONFIG_SERIAL_CORE=y
407CONFIG_SERIAL_CORE_CONSOLE=y 495CONFIG_SERIAL_CORE_CONSOLE=y
496# CONFIG_SERIAL_JSM is not set
408CONFIG_UNIX98_PTYS=y 497CONFIG_UNIX98_PTYS=y
409CONFIG_LEGACY_PTYS=y 498CONFIG_LEGACY_PTYS=y
410CONFIG_LEGACY_PTY_COUNT=256 499CONFIG_LEGACY_PTY_COUNT=256
@@ -432,6 +521,10 @@ CONFIG_GEN_RTC_X=y
432# CONFIG_RAW_DRIVER is not set 521# CONFIG_RAW_DRIVER is not set
433 522
434# 523#
524# TPM devices
525#
526
527#
435# I2C support 528# I2C support
436# 529#
437# CONFIG_I2C is not set 530# CONFIG_I2C is not set
@@ -442,10 +535,20 @@ CONFIG_GEN_RTC_X=y
442# CONFIG_W1 is not set 535# CONFIG_W1 is not set
443 536
444# 537#
538# Hardware Monitoring support
539#
540# CONFIG_HWMON is not set
541# CONFIG_HWMON_VID is not set
542
543#
445# Misc devices 544# Misc devices
446# 545#
447 546
448# 547#
548# Multimedia Capabilities Port drivers
549#
550
551#
449# Multimedia devices 552# Multimedia devices
450# 553#
451# CONFIG_VIDEO_DEV is not set 554# CONFIG_VIDEO_DEV is not set
@@ -459,7 +562,6 @@ CONFIG_GEN_RTC_X=y
459# Graphics support 562# Graphics support
460# 563#
461# CONFIG_FB is not set 564# CONFIG_FB is not set
462# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
463 565
464# 566#
465# Sound 567# Sound
@@ -469,13 +571,9 @@ CONFIG_GEN_RTC_X=y
469# 571#
470# USB support 572# USB support
471# 573#
472# CONFIG_USB is not set
473CONFIG_USB_ARCH_HAS_HCD=y 574CONFIG_USB_ARCH_HAS_HCD=y
474CONFIG_USB_ARCH_HAS_OHCI=y 575CONFIG_USB_ARCH_HAS_OHCI=y
475 576# CONFIG_USB is not set
476#
477# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
478#
479 577
480# 578#
481# USB Gadget Support 579# USB Gadget Support
@@ -493,6 +591,10 @@ CONFIG_USB_ARCH_HAS_OHCI=y
493# CONFIG_INFINIBAND is not set 591# CONFIG_INFINIBAND is not set
494 592
495# 593#
594# SN Devices
595#
596
597#
496# File systems 598# File systems
497# 599#
498# CONFIG_EXT2_FS is not set 600# CONFIG_EXT2_FS is not set
@@ -500,13 +602,16 @@ CONFIG_USB_ARCH_HAS_OHCI=y
500# CONFIG_JBD is not set 602# CONFIG_JBD is not set
501# CONFIG_REISERFS_FS is not set 603# CONFIG_REISERFS_FS is not set
502# CONFIG_JFS_FS is not set 604# CONFIG_JFS_FS is not set
605# CONFIG_FS_POSIX_ACL is not set
503# CONFIG_XFS_FS is not set 606# CONFIG_XFS_FS is not set
504# CONFIG_MINIX_FS is not set 607# CONFIG_MINIX_FS is not set
505# CONFIG_ROMFS_FS is not set 608# CONFIG_ROMFS_FS is not set
609CONFIG_INOTIFY=y
506# CONFIG_QUOTA is not set 610# CONFIG_QUOTA is not set
507CONFIG_DNOTIFY=y 611CONFIG_DNOTIFY=y
508# CONFIG_AUTOFS_FS is not set 612# CONFIG_AUTOFS_FS is not set
509# CONFIG_AUTOFS4_FS is not set 613# CONFIG_AUTOFS4_FS is not set
614CONFIG_FUSE_FS=m
510 615
511# 616#
512# CD-ROM/DVD Filesystems 617# CD-ROM/DVD Filesystems
@@ -527,11 +632,10 @@ CONFIG_DNOTIFY=y
527CONFIG_PROC_FS=y 632CONFIG_PROC_FS=y
528CONFIG_PROC_KCORE=y 633CONFIG_PROC_KCORE=y
529CONFIG_SYSFS=y 634CONFIG_SYSFS=y
530# CONFIG_DEVPTS_FS_XATTR is not set
531CONFIG_TMPFS=y 635CONFIG_TMPFS=y
532# CONFIG_TMPFS_XATTR is not set
533# CONFIG_HUGETLB_PAGE is not set 636# CONFIG_HUGETLB_PAGE is not set
534CONFIG_RAMFS=y 637CONFIG_RAMFS=y
638CONFIG_RELAYFS_FS=m
535 639
536# 640#
537# Miscellaneous filesystems 641# Miscellaneous filesystems
@@ -552,7 +656,7 @@ CONFIG_NFS_FS=y
552# CONFIG_NFSD is not set 656# CONFIG_NFSD is not set
553CONFIG_ROOT_NFS=y 657CONFIG_ROOT_NFS=y
554CONFIG_LOCKD=y 658CONFIG_LOCKD=y
555# CONFIG_EXPORTFS is not set 659CONFIG_NFS_COMMON=y
556CONFIG_SUNRPC=y 660CONFIG_SUNRPC=y
557# CONFIG_SMB_FS is not set 661# CONFIG_SMB_FS is not set
558# CONFIG_CIFS is not set 662# CONFIG_CIFS is not set
@@ -573,8 +677,11 @@ CONFIG_MSDOS_PARTITION=y
573# 677#
574# Kernel hacking 678# Kernel hacking
575# 679#
680# CONFIG_PRINTK_TIME is not set
576CONFIG_DEBUG_KERNEL=y 681CONFIG_DEBUG_KERNEL=y
577# CONFIG_MAGIC_SYSRQ is not set 682# CONFIG_MAGIC_SYSRQ is not set
683CONFIG_LOG_BUF_SHIFT=14
684CONFIG_DETECT_SOFTLOCKUP=y
578# CONFIG_SCHEDSTATS is not set 685# CONFIG_SCHEDSTATS is not set
579# CONFIG_DEBUG_SLAB is not set 686# CONFIG_DEBUG_SLAB is not set
580# CONFIG_DEBUG_SPINLOCK is not set 687# CONFIG_DEBUG_SPINLOCK is not set
@@ -599,7 +706,31 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
599# 706#
600# Cryptographic options 707# Cryptographic options
601# 708#
602# CONFIG_CRYPTO is not set 709CONFIG_CRYPTO=y
710CONFIG_CRYPTO_HMAC=y
711CONFIG_CRYPTO_NULL=m
712CONFIG_CRYPTO_MD4=m
713CONFIG_CRYPTO_MD5=m
714CONFIG_CRYPTO_SHA1=m
715CONFIG_CRYPTO_SHA256=m
716CONFIG_CRYPTO_SHA512=m
717CONFIG_CRYPTO_WP512=m
718CONFIG_CRYPTO_TGR192=m
719CONFIG_CRYPTO_DES=m
720CONFIG_CRYPTO_BLOWFISH=m
721CONFIG_CRYPTO_TWOFISH=m
722CONFIG_CRYPTO_SERPENT=m
723CONFIG_CRYPTO_AES=m
724CONFIG_CRYPTO_CAST5=m
725CONFIG_CRYPTO_CAST6=m
726CONFIG_CRYPTO_TEA=m
727CONFIG_CRYPTO_ARC4=m
728CONFIG_CRYPTO_KHAZAD=m
729CONFIG_CRYPTO_ANUBIS=m
730CONFIG_CRYPTO_DEFLATE=m
731CONFIG_CRYPTO_MICHAEL_MIC=m
732CONFIG_CRYPTO_CRC32C=m
733# CONFIG_CRYPTO_TEST is not set
603 734
604# 735#
605# Hardware crypto devices 736# Hardware crypto devices
@@ -609,7 +740,8 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
609# Library routines 740# Library routines
610# 741#
611# CONFIG_CRC_CCITT is not set 742# CONFIG_CRC_CCITT is not set
612# CONFIG_CRC32 is not set 743CONFIG_CRC16=m
613# CONFIG_LIBCRC32C is not set 744CONFIG_CRC32=m
614CONFIG_GENERIC_HARDIRQS=y 745CONFIG_LIBCRC32C=m
615CONFIG_GENERIC_IRQ_PROBE=y 746CONFIG_ZLIB_INFLATE=m
747CONFIG_ZLIB_DEFLATE=m
diff --git a/arch/mips/ddb5xxx/Kconfig b/arch/mips/ddb5xxx/Kconfig
new file mode 100644
index 000000000000..e9b5de49f4c2
--- /dev/null
+++ b/arch/mips/ddb5xxx/Kconfig
@@ -0,0 +1,4 @@
1config DDB5477_BUS_FREQUENCY
2 int "bus frequency (in kHZ, 0 for auto-detect)"
3 depends on DDB5477
4 default 0
diff --git a/arch/mips/ddb5xxx/ddb5074/nile4_pic.c b/arch/mips/ddb5xxx/ddb5074/nile4_pic.c
index 68c127cd70c9..8743ffce8653 100644
--- a/arch/mips/ddb5xxx/ddb5074/nile4_pic.c
+++ b/arch/mips/ddb5xxx/ddb5074/nile4_pic.c
@@ -209,14 +209,13 @@ static void nile4_irq_end(unsigned int irq) {
209#define nile4_irq_shutdown nile4_disable_irq 209#define nile4_irq_shutdown nile4_disable_irq
210 210
211static hw_irq_controller nile4_irq_controller = { 211static hw_irq_controller nile4_irq_controller = {
212 "nile4", 212 .typename = "nile4",
213 nile4_irq_startup, 213 .startup = nile4_irq_startup,
214 nile4_irq_shutdown, 214 .shutdown = nile4_irq_shutdown,
215 nile4_enable_irq, 215 .enable = nile4_enable_irq,
216 nile4_disable_irq, 216 .disable = nile4_disable_irq,
217 nile4_ack_irq, 217 .ack = nile4_ack_irq,
218 nile4_irq_end, 218 .end = nile4_irq_end,
219 NULL
220}; 219};
221 220
222void nile4_irq_setup(u32 base) { 221void nile4_irq_setup(u32 base) {
diff --git a/arch/mips/ddb5xxx/ddb5074/setup.c b/arch/mips/ddb5xxx/ddb5074/setup.c
index a73a5978d550..11535be265b9 100644
--- a/arch/mips/ddb5xxx/ddb5074/setup.c
+++ b/arch/mips/ddb5xxx/ddb5074/setup.c
@@ -85,7 +85,7 @@ static void __init ddb_time_init(void)
85 85
86 86
87 87
88static void __init ddb5074_setup(void) 88void __init plat_setup(void)
89{ 89{
90 set_io_port_base(NILE4_PCI_IO_BASE); 90 set_io_port_base(NILE4_PCI_IO_BASE);
91 isa_slot_offset = NILE4_PCI_MEM_BASE; 91 isa_slot_offset = NILE4_PCI_MEM_BASE;
@@ -106,8 +106,6 @@ static void __init ddb5074_setup(void)
106 panic_timeout = 180; 106 panic_timeout = 180;
107} 107}
108 108
109early_initcall(ddb5074_setup);
110
111#define USE_NILE4_SERIAL 0 109#define USE_NILE4_SERIAL 0
112 110
113#if USE_NILE4_SERIAL 111#if USE_NILE4_SERIAL
diff --git a/arch/mips/ddb5xxx/ddb5476/setup.c b/arch/mips/ddb5xxx/ddb5476/setup.c
index 71531f8146ea..f4e480a74edf 100644
--- a/arch/mips/ddb5xxx/ddb5476/setup.c
+++ b/arch/mips/ddb5xxx/ddb5476/setup.c
@@ -124,7 +124,7 @@ static struct {
124 124
125static void ddb5476_board_init(void); 125static void ddb5476_board_init(void);
126 126
127static void __init ddb5476_setup(void) 127void __init plat_setup(void)
128{ 128{
129 set_io_port_base(KSEG1ADDR(DDB_PCI_IO_BASE)); 129 set_io_port_base(KSEG1ADDR(DDB_PCI_IO_BASE));
130 130
@@ -158,8 +158,6 @@ static void __init ddb5476_setup(void)
158 ddb5476_board_init(); 158 ddb5476_board_init();
159} 159}
160 160
161early_initcall(ddb5476_setup);
162
163/* 161/*
164 * We don't trust bios. We essentially does hardware re-initialization 162 * We don't trust bios. We essentially does hardware re-initialization
165 * as complete as possible, as far as we know we can safely do. 163 * as complete as possible, as far as we know we can safely do.
diff --git a/arch/mips/ddb5xxx/ddb5476/vrc5476_irq.c b/arch/mips/ddb5xxx/ddb5476/vrc5476_irq.c
index a77682be01ac..f66fe5b58636 100644
--- a/arch/mips/ddb5xxx/ddb5476/vrc5476_irq.c
+++ b/arch/mips/ddb5xxx/ddb5476/vrc5476_irq.c
@@ -53,14 +53,13 @@ static void vrc5476_irq_end(uint irq)
53} 53}
54 54
55static hw_irq_controller vrc5476_irq_controller = { 55static hw_irq_controller vrc5476_irq_controller = {
56 "vrc5476", 56 .typename = "vrc5476",
57 vrc5476_irq_startup, 57 .startup = vrc5476_irq_startup,
58 vrc5476_irq_shutdown, 58 .shutdown = vrc5476_irq_shutdown,
59 vrc5476_irq_enable, 59 .enable = vrc5476_irq_enable,
60 vrc5476_irq_disable, 60 .disable = vrc5476_irq_disable,
61 vrc5476_irq_ack, 61 .ack = vrc5476_irq_ack,
62 vrc5476_irq_end, 62 .end = vrc5476_irq_end
63 NULL /* no affinity stuff for UP */
64}; 63};
65 64
66void __init 65void __init
diff --git a/arch/mips/ddb5xxx/ddb5477/irq_5477.c b/arch/mips/ddb5xxx/ddb5477/irq_5477.c
index 0d5e706207ec..5fcd5f070cdc 100644
--- a/arch/mips/ddb5xxx/ddb5477/irq_5477.c
+++ b/arch/mips/ddb5xxx/ddb5477/irq_5477.c
@@ -90,14 +90,13 @@ vrc5477_irq_end(unsigned int irq)
90} 90}
91 91
92hw_irq_controller vrc5477_irq_controller = { 92hw_irq_controller vrc5477_irq_controller = {
93 "vrc5477_irq", 93 .typename = "vrc5477_irq",
94 vrc5477_irq_startup, 94 .startup = vrc5477_irq_startup,
95 vrc5477_irq_shutdown, 95 .shutdown = vrc5477_irq_shutdown,
96 vrc5477_irq_enable, 96 .enable = vrc5477_irq_enable,
97 vrc5477_irq_disable, 97 .disable = vrc5477_irq_disable,
98 vrc5477_irq_ack, 98 .ack = vrc5477_irq_ack,
99 vrc5477_irq_end, 99 .end = vrc5477_irq_end
100 NULL /* no affinity stuff for UP */
101}; 100};
102 101
103void __init vrc5477_irq_init(u32 irq_base) 102void __init vrc5477_irq_init(u32 irq_base)
diff --git a/arch/mips/ddb5xxx/ddb5477/setup.c b/arch/mips/ddb5xxx/ddb5477/setup.c
index d62f5a789b05..81163353c4a8 100644
--- a/arch/mips/ddb5xxx/ddb5477/setup.c
+++ b/arch/mips/ddb5xxx/ddb5477/setup.c
@@ -170,7 +170,7 @@ static void ddb5477_board_init(void);
170extern struct pci_controller ddb5477_ext_controller; 170extern struct pci_controller ddb5477_ext_controller;
171extern struct pci_controller ddb5477_io_controller; 171extern struct pci_controller ddb5477_io_controller;
172 172
173static int ddb5477_setup(void) 173void __init plat_setup(void)
174{ 174{
175 /* initialize board - we don't trust the loader */ 175 /* initialize board - we don't trust the loader */
176 ddb5477_board_init(); 176 ddb5477_board_init();
@@ -193,12 +193,8 @@ static int ddb5477_setup(void)
193 193
194 register_pci_controller (&ddb5477_ext_controller); 194 register_pci_controller (&ddb5477_ext_controller);
195 register_pci_controller (&ddb5477_io_controller); 195 register_pci_controller (&ddb5477_io_controller);
196
197 return 0;
198} 196}
199 197
200early_initcall(ddb5477_setup);
201
202static void __init ddb5477_board_init(void) 198static void __init ddb5477_board_init(void)
203{ 199{
204 /* ----------- setup PDARs ------------ */ 200 /* ----------- setup PDARs ------------ */
diff --git a/arch/mips/dec/Makefile b/arch/mips/dec/Makefile
index 688757a97cb8..ed181fdc3ac9 100644
--- a/arch/mips/dec/Makefile
+++ b/arch/mips/dec/Makefile
@@ -2,8 +2,8 @@
2# Makefile for the DECstation family specific parts of the kernel 2# Makefile for the DECstation family specific parts of the kernel
3# 3#
4 4
5obj-y := ecc-berr.o int-handler.o ioasic-irq.o kn02-irq.o reset.o \ 5obj-y := ecc-berr.o int-handler.o ioasic-irq.o kn01-berr.o \
6 setup.o time.o 6 kn02-irq.o kn02xa-berr.o reset.o setup.o time.o
7 7
8obj-$(CONFIG_PROM_CONSOLE) += promcon.o 8obj-$(CONFIG_PROM_CONSOLE) += promcon.o
9obj-$(CONFIG_CPU_HAS_WB) += wbflush.o 9obj-$(CONFIG_CPU_HAS_WB) += wbflush.o
diff --git a/arch/mips/dec/ecc-berr.c b/arch/mips/dec/ecc-berr.c
index 6dbce92eb068..cc24c5ed0c05 100644
--- a/arch/mips/dec/ecc-berr.c
+++ b/arch/mips/dec/ecc-berr.c
@@ -6,7 +6,7 @@
6 * 5000/240 (KN03), 5000/260 (KN05) and DECsystem 5900 (KN03), 6 * 5000/240 (KN03), 5000/260 (KN05) and DECsystem 5900 (KN03),
7 * 5900/260 (KN05) systems. 7 * 5900/260 (KN05) systems.
8 * 8 *
9 * Copyright (c) 2003 Maciej W. Rozycki 9 * Copyright (c) 2003, 2005 Maciej W. Rozycki
10 * 10 *
11 * This program is free software; you can redistribute it and/or 11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License 12 * modify it under the terms of the GNU General Public License
@@ -15,6 +15,7 @@
15 */ 15 */
16 16
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/interrupt.h>
18#include <linux/kernel.h> 19#include <linux/kernel.h>
19#include <linux/sched.h> 20#include <linux/sched.h>
20#include <linux/spinlock.h> 21#include <linux/spinlock.h>
@@ -57,7 +58,7 @@ static int dec_ecc_be_backend(struct pt_regs *regs, int is_fixup, int invoker)
57 58
58 const char *kind, *agent, *cycle, *event; 59 const char *kind, *agent, *cycle, *event;
59 const char *status = "", *xbit = "", *fmt = ""; 60 const char *status = "", *xbit = "", *fmt = "";
60 dma_addr_t address; 61 unsigned long address;
61 u16 syn = 0, sngl; 62 u16 syn = 0, sngl;
62 63
63 int i = 0; 64 int i = 0;
@@ -66,7 +67,7 @@ static int dec_ecc_be_backend(struct pt_regs *regs, int is_fixup, int invoker)
66 u32 chksyn = *kn0x_chksyn; 67 u32 chksyn = *kn0x_chksyn;
67 int action = MIPS_BE_FATAL; 68 int action = MIPS_BE_FATAL;
68 69
69 /* For non-ECC ack ASAP, so any subsequent errors get caught. */ 70 /* For non-ECC ack ASAP, so that any subsequent errors get caught. */
70 if ((erraddr & (KN0X_EAR_VALID | KN0X_EAR_ECCERR)) == KN0X_EAR_VALID) 71 if ((erraddr & (KN0X_EAR_VALID | KN0X_EAR_ECCERR)) == KN0X_EAR_VALID)
71 dec_ecc_be_ack(); 72 dec_ecc_be_ack();
72 73
@@ -74,7 +75,7 @@ static int dec_ecc_be_backend(struct pt_regs *regs, int is_fixup, int invoker)
74 75
75 if (!(erraddr & KN0X_EAR_VALID)) { 76 if (!(erraddr & KN0X_EAR_VALID)) {
76 /* No idea what happened. */ 77 /* No idea what happened. */
77 printk(KERN_ALERT "Unidentified bus error %s.\n", kind); 78 printk(KERN_ALERT "Unidentified bus error %s\n", kind);
78 return action; 79 return action;
79 } 80 }
80 81
@@ -126,7 +127,7 @@ static int dec_ecc_be_backend(struct pt_regs *regs, int is_fixup, int invoker)
126 /* Ack now, no rewrite will happen. */ 127 /* Ack now, no rewrite will happen. */
127 dec_ecc_be_ack(); 128 dec_ecc_be_ack();
128 129
129 fmt = KERN_ALERT "%s" "invalid.\n"; 130 fmt = KERN_ALERT "%s" "invalid\n";
130 } else { 131 } else {
131 sngl = syn & KN0X_ESR_SNGLO; 132 sngl = syn & KN0X_ESR_SNGLO;
132 syn &= KN0X_ESR_SYNLO; 133 syn &= KN0X_ESR_SYNLO;
@@ -144,7 +145,8 @@ static int dec_ecc_be_backend(struct pt_regs *regs, int is_fixup, int invoker)
144 } else if (!sngl) { 145 } else if (!sngl) {
145 status = dbestr; 146 status = dbestr;
146 } else { 147 } else {
147 volatile u32 *ptr = (void *)KSEG1ADDR(address); 148 volatile u32 *ptr =
149 (void *)CKSEG1ADDR(address);
148 150
149 *ptr = *ptr; /* Rewrite. */ 151 *ptr = *ptr; /* Rewrite. */
150 iob(); 152 iob();
@@ -160,12 +162,12 @@ static int dec_ecc_be_backend(struct pt_regs *regs, int is_fixup, int invoker)
160 if (syn == 0x01) { 162 if (syn == 0x01) {
161 fmt = KERN_ALERT "%s" 163 fmt = KERN_ALERT "%s"
162 "%#04x -- %s bit error " 164 "%#04x -- %s bit error "
163 "at check bit C%s.\n"; 165 "at check bit C%s\n";
164 xbit = "X"; 166 xbit = "X";
165 } else { 167 } else {
166 fmt = KERN_ALERT "%s" 168 fmt = KERN_ALERT "%s"
167 "%#04x -- %s bit error " 169 "%#04x -- %s bit error "
168 "at check bit C%s%u.\n"; 170 "at check bit C%s%u\n";
169 } 171 }
170 i = syn >> 2; 172 i = syn >> 2;
171 } else { 173 } else {
@@ -175,16 +177,16 @@ static int dec_ecc_be_backend(struct pt_regs *regs, int is_fixup, int invoker)
175 if (i < 32) 177 if (i < 32)
176 fmt = KERN_ALERT "%s" 178 fmt = KERN_ALERT "%s"
177 "%#04x -- %s bit error " 179 "%#04x -- %s bit error "
178 "at data bit D%s%u.\n"; 180 "at data bit D%s%u\n";
179 else 181 else
180 fmt = KERN_ALERT "%s" 182 fmt = KERN_ALERT "%s"
181 "%#04x -- %s bit error.\n"; 183 "%#04x -- %s bit error\n";
182 } 184 }
183 } 185 }
184 } 186 }
185 187
186 if (action != MIPS_BE_FIXUP) 188 if (action != MIPS_BE_FIXUP)
187 printk(KERN_ALERT "Bus error %s: %s %s %s at %#010lx.\n", 189 printk(KERN_ALERT "Bus error %s: %s %s %s at %#010lx\n",
188 kind, agent, cycle, event, address); 190 kind, agent, cycle, event, address);
189 191
190 if (action != MIPS_BE_FIXUP && erraddr & KN0X_EAR_ECCERR) 192 if (action != MIPS_BE_FIXUP && erraddr & KN0X_EAR_ECCERR)
@@ -203,11 +205,11 @@ irqreturn_t dec_ecc_be_interrupt(int irq, void *dev_id, struct pt_regs *regs)
203 int action = dec_ecc_be_backend(regs, 0, 1); 205 int action = dec_ecc_be_backend(regs, 0, 1);
204 206
205 if (action == MIPS_BE_DISCARD) 207 if (action == MIPS_BE_DISCARD)
206 return IRQ_NONE; 208 return IRQ_HANDLED;
207 209
208 /* 210 /*
209 * FIXME: Find affected processes and kill them, otherwise we 211 * FIXME: Find the affected processes and kill them, otherwise
210 * must die. 212 * we must die.
211 * 213 *
212 * The interrupt is asynchronously delivered thus EPC and RA 214 * The interrupt is asynchronously delivered thus EPC and RA
213 * may be irrelevant, but are printed for a reference. 215 * may be irrelevant, but are printed for a reference.
@@ -225,16 +227,16 @@ irqreturn_t dec_ecc_be_interrupt(int irq, void *dev_id, struct pt_regs *regs)
225 */ 227 */
226static inline void dec_kn02_be_init(void) 228static inline void dec_kn02_be_init(void)
227{ 229{
228 volatile u32 *csr = (void *)KN02_CSR_BASE; 230 volatile u32 *csr = (void *)CKSEG1ADDR(KN02_SLOT_BASE + KN02_CSR);
229 unsigned long flags; 231 unsigned long flags;
230 232
231 kn0x_erraddr = (void *)(KN02_SLOT_BASE + KN02_ERRADDR); 233 kn0x_erraddr = (void *)CKSEG1ADDR(KN02_SLOT_BASE + KN02_ERRADDR);
232 kn0x_chksyn = (void *)(KN02_SLOT_BASE + KN02_CHKSYN); 234 kn0x_chksyn = (void *)CKSEG1ADDR(KN02_SLOT_BASE + KN02_CHKSYN);
233 235
234 spin_lock_irqsave(&kn02_lock, flags); 236 spin_lock_irqsave(&kn02_lock, flags);
235 237
236 /* Preset write-only bits of the Control Register cache. */ 238 /* Preset write-only bits of the Control Register cache. */
237 cached_kn02_csr = *csr | KN03_CSR_LEDS; 239 cached_kn02_csr = *csr | KN02_CSR_LEDS;
238 240
239 /* Set normal ECC detection and generation. */ 241 /* Set normal ECC detection and generation. */
240 cached_kn02_csr &= ~(KN02_CSR_DIAGCHK | KN02_CSR_DIAGGEN); 242 cached_kn02_csr &= ~(KN02_CSR_DIAGCHK | KN02_CSR_DIAGGEN);
@@ -248,11 +250,11 @@ static inline void dec_kn02_be_init(void)
248 250
249static inline void dec_kn03_be_init(void) 251static inline void dec_kn03_be_init(void)
250{ 252{
251 volatile u32 *mcr = (void *)(KN03_SLOT_BASE + IOASIC_MCR); 253 volatile u32 *mcr = (void *)CKSEG1ADDR(KN03_SLOT_BASE + IOASIC_MCR);
252 volatile u32 *mbcs = (void *)(KN03_SLOT_BASE + KN05_MB_CSR); 254 volatile u32 *mbcs = (void *)CKSEG1ADDR(KN4K_SLOT_BASE + KN4K_MB_CSR);
253 255
254 kn0x_erraddr = (void *)(KN03_SLOT_BASE + IOASIC_ERRADDR); 256 kn0x_erraddr = (void *)CKSEG1ADDR(KN03_SLOT_BASE + IOASIC_ERRADDR);
255 kn0x_chksyn = (void *)(KN03_SLOT_BASE + IOASIC_CHKSYN); 257 kn0x_chksyn = (void *)CKSEG1ADDR(KN03_SLOT_BASE + IOASIC_CHKSYN);
256 258
257 /* 259 /*
258 * Set normal ECC detection and generation, enable ECC correction. 260 * Set normal ECC detection and generation, enable ECC correction.
@@ -264,7 +266,7 @@ static inline void dec_kn03_be_init(void)
264 *mcr = (*mcr & ~(KN03_MCR_DIAGCHK | KN03_MCR_DIAGGEN)) | 266 *mcr = (*mcr & ~(KN03_MCR_DIAGCHK | KN03_MCR_DIAGGEN)) |
265 KN03_MCR_CORRECT; 267 KN03_MCR_CORRECT;
266 if (current_cpu_data.cputype == CPU_R4400SC) 268 if (current_cpu_data.cputype == CPU_R4400SC)
267 *mbcs |= KN05_MB_CSR_EE; 269 *mbcs |= KN4K_MB_CSR_EE;
268 fast_iob(); 270 fast_iob();
269} 271}
270 272
diff --git a/arch/mips/dec/int-handler.S b/arch/mips/dec/int-handler.S
index c89768d5c4e5..41fa372007bf 100644
--- a/arch/mips/dec/int-handler.S
+++ b/arch/mips/dec/int-handler.S
@@ -2,9 +2,9 @@
2 * arch/mips/dec/int-handler.S 2 * arch/mips/dec/int-handler.S
3 * 3 *
4 * Copyright (C) 1995, 1996, 1997 Paul M. Antoine and Harald Koerfgen 4 * Copyright (C) 1995, 1996, 1997 Paul M. Antoine and Harald Koerfgen
5 * Copyright (C) 2000, 2001, 2002, 2003 Maciej W. Rozycki 5 * Copyright (C) 2000, 2001, 2002, 2003, 2005 Maciej W. Rozycki
6 * 6 *
7 * Written by Ralf Baechle and Andreas Busse, modified for DECStation 7 * Written by Ralf Baechle and Andreas Busse, modified for DECstation
8 * support by Paul Antoine and Harald Koerfgen. 8 * support by Paul Antoine and Harald Koerfgen.
9 * 9 *
10 * completly rewritten: 10 * completly rewritten:
@@ -14,11 +14,12 @@
14 * by Maciej W. Rozycki. 14 * by Maciej W. Rozycki.
15 */ 15 */
16#include <linux/config.h> 16#include <linux/config.h>
17
18#include <asm/addrspace.h>
17#include <asm/asm.h> 19#include <asm/asm.h>
18#include <asm/regdef.h>
19#include <asm/mipsregs.h> 20#include <asm/mipsregs.h>
21#include <asm/regdef.h>
20#include <asm/stackframe.h> 22#include <asm/stackframe.h>
21#include <asm/addrspace.h>
22 23
23#include <asm/dec/interrupts.h> 24#include <asm/dec/interrupts.h>
24#include <asm/dec/ioasic_addrs.h> 25#include <asm/dec/ioasic_addrs.h>
@@ -28,11 +29,14 @@
28#include <asm/dec/kn02xa.h> 29#include <asm/dec/kn02xa.h>
29#include <asm/dec/kn03.h> 30#include <asm/dec/kn03.h>
30 31
32#define KN02_CSR_BASE CKSEG1ADDR(KN02_SLOT_BASE + KN02_CSR)
33#define KN02XA_IOASIC_BASE CKSEG1ADDR(KN02XA_SLOT_BASE + IOASIC_IOCTL)
34#define KN03_IOASIC_BASE CKSEG1ADDR(KN03_SLOT_BASE + IOASIC_IOCTL)
31 35
32 .text 36 .text
33 .set noreorder 37 .set noreorder
34/* 38/*
35 * decstation_handle_int: Interrupt handler for DECStations 39 * decstation_handle_int: Interrupt handler for DECstations
36 * 40 *
37 * We follow the model in the Indy interrupt code by David Miller, where he 41 * We follow the model in the Indy interrupt code by David Miller, where he
38 * says: a lot of complication here is taken away because: 42 * says: a lot of complication here is taken away because:
@@ -48,7 +52,7 @@
48 * 3) Linux only thinks in terms of all IRQs on or all IRQs 52 * 3) Linux only thinks in terms of all IRQs on or all IRQs
49 * off, nothing in between like BSD spl() brain-damage. 53 * off, nothing in between like BSD spl() brain-damage.
50 * 54 *
51 * Furthermore, the IRQs on the DECStations look basically (barring 55 * Furthermore, the IRQs on the DECstations look basically (barring
52 * software IRQs which we don't use at all) like... 56 * software IRQs which we don't use at all) like...
53 * 57 *
54 * DS2100/3100's, aka kn01, aka Pmax: 58 * DS2100/3100's, aka kn01, aka Pmax:
@@ -61,7 +65,7 @@
61 * 3 Lance Ethernet 65 * 3 Lance Ethernet
62 * 4 DZ11 serial 66 * 4 DZ11 serial
63 * 5 RTC 67 * 5 RTC
64 * 6 Memory Controller 68 * 6 Memory Controller & Video
65 * 7 FPU 69 * 7 FPU
66 * 70 *
67 * DS5000/200, aka kn02, aka 3max: 71 * DS5000/200, aka kn02, aka 3max:
diff --git a/arch/mips/dec/kn01-berr.c b/arch/mips/dec/kn01-berr.c
new file mode 100644
index 000000000000..b9271db9bc76
--- /dev/null
+++ b/arch/mips/dec/kn01-berr.c
@@ -0,0 +1,201 @@
1/*
2 * linux/arch/mips/dec/kn01-berr.c
3 *
4 * Bus error event handling code for DECstation/DECsystem 3100
5 * and 2100 (KN01) systems equipped with parity error detection
6 * logic.
7 *
8 * Copyright (c) 2005 Maciej W. Rozycki
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
14 */
15
16#include <linux/init.h>
17#include <linux/interrupt.h>
18#include <linux/kernel.h>
19#include <linux/spinlock.h>
20#include <linux/types.h>
21
22#include <asm/inst.h>
23#include <asm/mipsregs.h>
24#include <asm/page.h>
25#include <asm/system.h>
26#include <asm/traps.h>
27#include <asm/uaccess.h>
28
29#include <asm/dec/kn01.h>
30
31
32/* CP0 hazard avoidance. */
33#define BARRIER \
34 __asm__ __volatile__( \
35 ".set push\n\t" \
36 ".set noreorder\n\t" \
37 "nop\n\t" \
38 ".set pop\n\t")
39
40/*
41 * Bits 7:0 of the Control Register are write-only -- the
42 * corresponding bits of the Status Register have a different
43 * meaning. Hence we use a cache. It speeds up things a bit
44 * as well.
45 *
46 * There is no default value -- it has to be initialized.
47 */
48u16 cached_kn01_csr;
49DEFINE_SPINLOCK(kn01_lock);
50
51
52static inline void dec_kn01_be_ack(void)
53{
54 volatile u16 *csr = (void *)CKSEG1ADDR(KN01_SLOT_BASE + KN01_CSR);
55 unsigned long flags;
56
57 spin_lock_irqsave(&kn01_lock, flags);
58
59 *csr = cached_kn01_csr | KN01_CSR_MEMERR; /* Clear bus IRQ. */
60 iob();
61
62 spin_unlock_irqrestore(&kn01_lock, flags);
63}
64
65static int dec_kn01_be_backend(struct pt_regs *regs, int is_fixup, int invoker)
66{
67 volatile u32 *kn01_erraddr = (void *)CKSEG1ADDR(KN01_SLOT_BASE +
68 KN01_ERRADDR);
69
70 static const char excstr[] = "exception";
71 static const char intstr[] = "interrupt";
72 static const char cpustr[] = "CPU";
73 static const char mreadstr[] = "memory read";
74 static const char readstr[] = "read";
75 static const char writestr[] = "write";
76 static const char timestr[] = "timeout";
77 static const char paritystr[] = "parity error";
78
79 int data = regs->cp0_cause & 4;
80 unsigned int __user *pc = (unsigned int __user *)regs->cp0_epc +
81 ((regs->cp0_cause & CAUSEF_BD) != 0);
82 union mips_instruction insn;
83 unsigned long entrylo, offset;
84 long asid, entryhi, vaddr;
85
86 const char *kind, *agent, *cycle, *event;
87 unsigned long address;
88
89 u32 erraddr = *kn01_erraddr;
90 int action = MIPS_BE_FATAL;
91
92 /* Ack ASAP, so that any subsequent errors get caught. */
93 dec_kn01_be_ack();
94
95 kind = invoker ? intstr : excstr;
96
97 agent = cpustr;
98
99 if (invoker)
100 address = erraddr;
101 else {
102 /* Bloody hardware doesn't record the address for reads... */
103 if (data) {
104 /* This never faults. */
105 __get_user(insn.word, pc);
106 vaddr = regs->regs[insn.i_format.rs] +
107 insn.i_format.simmediate;
108 } else
109 vaddr = (long)pc;
110 if (KSEGX(vaddr) == CKSEG0 || KSEGX(vaddr) == CKSEG1)
111 address = CPHYSADDR(vaddr);
112 else {
113 /* Peek at what physical address the CPU used. */
114 asid = read_c0_entryhi();
115 entryhi = asid & (PAGE_SIZE - 1);
116 entryhi |= vaddr & ~(PAGE_SIZE - 1);
117 write_c0_entryhi(entryhi);
118 BARRIER;
119 tlb_probe();
120 /* No need to check for presence. */
121 tlb_read();
122 entrylo = read_c0_entrylo0();
123 write_c0_entryhi(asid);
124 offset = vaddr & (PAGE_SIZE - 1);
125 address = (entrylo & ~(PAGE_SIZE - 1)) | offset;
126 }
127 }
128
129 /* Treat low 256MB as memory, high -- as I/O. */
130 if (address < 0x10000000) {
131 cycle = mreadstr;
132 event = paritystr;
133 } else {
134 cycle = invoker ? writestr : readstr;
135 event = timestr;
136 }
137
138 if (is_fixup)
139 action = MIPS_BE_FIXUP;
140
141 if (action != MIPS_BE_FIXUP)
142 printk(KERN_ALERT "Bus error %s: %s %s %s at %#010lx\n",
143 kind, agent, cycle, event, address);
144
145 return action;
146}
147
148int dec_kn01_be_handler(struct pt_regs *regs, int is_fixup)
149{
150 return dec_kn01_be_backend(regs, is_fixup, 0);
151}
152
153irqreturn_t dec_kn01_be_interrupt(int irq, void *dev_id,
154 struct pt_regs *regs)
155{
156 volatile u16 *csr = (void *)CKSEG1ADDR(KN01_SLOT_BASE + KN01_CSR);
157 int action;
158
159 if (!(*csr & KN01_CSR_MEMERR))
160 return IRQ_NONE; /* Must have been video. */
161
162 action = dec_kn01_be_backend(regs, 0, 1);
163
164 if (action == MIPS_BE_DISCARD)
165 return IRQ_HANDLED;
166
167 /*
168 * FIXME: Find the affected processes and kill them, otherwise
169 * we must die.
170 *
171 * The interrupt is asynchronously delivered thus EPC and RA
172 * may be irrelevant, but are printed for a reference.
173 */
174 printk(KERN_ALERT "Fatal bus interrupt, epc == %08lx, ra == %08lx\n",
175 regs->cp0_epc, regs->regs[31]);
176 die("Unrecoverable bus error", regs);
177}
178
179
180void __init dec_kn01_be_init(void)
181{
182 volatile u16 *csr = (void *)CKSEG1ADDR(KN01_SLOT_BASE + KN01_CSR);
183 unsigned long flags;
184
185 spin_lock_irqsave(&kn01_lock, flags);
186
187 /* Preset write-only bits of the Control Register cache. */
188 cached_kn01_csr = *csr;
189 cached_kn01_csr &= KN01_CSR_STATUS | KN01_CSR_PARDIS | KN01_CSR_TXDIS;
190 cached_kn01_csr |= KN01_CSR_LEDS;
191
192 /* Enable parity error detection. */
193 cached_kn01_csr &= ~KN01_CSR_PARDIS;
194 *csr = cached_kn01_csr;
195 iob();
196
197 spin_unlock_irqrestore(&kn01_lock, flags);
198
199 /* Clear any leftover errors from the firmware. */
200 dec_kn01_be_ack();
201}
diff --git a/arch/mips/dec/kn02-irq.c b/arch/mips/dec/kn02-irq.c
index e0bfcd1521e2..898bed502a34 100644
--- a/arch/mips/dec/kn02-irq.c
+++ b/arch/mips/dec/kn02-irq.c
@@ -4,7 +4,7 @@
4 * DECstation 5000/200 (KN02) Control and Status Register 4 * DECstation 5000/200 (KN02) Control and Status Register
5 * interrupts. 5 * interrupts.
6 * 6 *
7 * Copyright (c) 2002, 2003 Maciej W. Rozycki 7 * Copyright (c) 2002, 2003, 2005 Maciej W. Rozycki
8 * 8 *
9 * This program is free software; you can redistribute it and/or 9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License 10 * modify it under the terms of the GNU General Public License
@@ -37,7 +37,8 @@ static int kn02_irq_base;
37 37
38static inline void unmask_kn02_irq(unsigned int irq) 38static inline void unmask_kn02_irq(unsigned int irq)
39{ 39{
40 volatile u32 *csr = (volatile u32 *)KN02_CSR_BASE; 40 volatile u32 *csr = (volatile u32 *)CKSEG1ADDR(KN02_SLOT_BASE +
41 KN02_CSR);
41 42
42 cached_kn02_csr |= (1 << (irq - kn02_irq_base + 16)); 43 cached_kn02_csr |= (1 << (irq - kn02_irq_base + 16));
43 *csr = cached_kn02_csr; 44 *csr = cached_kn02_csr;
@@ -45,7 +46,8 @@ static inline void unmask_kn02_irq(unsigned int irq)
45 46
46static inline void mask_kn02_irq(unsigned int irq) 47static inline void mask_kn02_irq(unsigned int irq)
47{ 48{
48 volatile u32 *csr = (volatile u32 *)KN02_CSR_BASE; 49 volatile u32 *csr = (volatile u32 *)CKSEG1ADDR(KN02_SLOT_BASE +
50 KN02_CSR);
49 51
50 cached_kn02_csr &= ~(1 << (irq - kn02_irq_base + 16)); 52 cached_kn02_csr &= ~(1 << (irq - kn02_irq_base + 16));
51 *csr = cached_kn02_csr; 53 *csr = cached_kn02_csr;
@@ -105,13 +107,14 @@ static struct hw_interrupt_type kn02_irq_type = {
105 107
106void __init init_kn02_irqs(int base) 108void __init init_kn02_irqs(int base)
107{ 109{
108 volatile u32 *csr = (volatile u32 *)KN02_CSR_BASE; 110 volatile u32 *csr = (volatile u32 *)CKSEG1ADDR(KN02_SLOT_BASE +
111 KN02_CSR);
109 unsigned long flags; 112 unsigned long flags;
110 int i; 113 int i;
111 114
112 /* Mask interrupts. */ 115 /* Mask interrupts. */
113 spin_lock_irqsave(&kn02_lock, flags); 116 spin_lock_irqsave(&kn02_lock, flags);
114 cached_kn02_csr &= ~KN03_CSR_IOINTEN; 117 cached_kn02_csr &= ~KN02_CSR_IOINTEN;
115 *csr = cached_kn02_csr; 118 *csr = cached_kn02_csr;
116 iob(); 119 iob();
117 spin_unlock_irqrestore(&kn02_lock, flags); 120 spin_unlock_irqrestore(&kn02_lock, flags);
diff --git a/arch/mips/dec/kn02xa-berr.c b/arch/mips/dec/kn02xa-berr.c
new file mode 100644
index 000000000000..6cd3f94f79fe
--- /dev/null
+++ b/arch/mips/dec/kn02xa-berr.c
@@ -0,0 +1,139 @@
1/*
2 * linux/arch/mips/dec/kn02xa-berr.c
3 *
4 * Bus error event handling code for 5000-series systems equipped
5 * with parity error detection logic, i.e. DECstation/DECsystem
6 * 5000/120, /125, /133 (KN02-BA), 5000/150 (KN04-BA) and Personal
7 * DECstation/DECsystem 5000/20, /25, /33 (KN02-CA), 5000/50
8 * (KN04-CA) systems.
9 *
10 * Copyright (c) 2005 Maciej W. Rozycki
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version
15 * 2 of the License, or (at your option) any later version.
16 */
17
18#include <linux/init.h>
19#include <linux/interrupt.h>
20#include <linux/kernel.h>
21#include <linux/types.h>
22
23#include <asm/addrspace.h>
24#include <asm/system.h>
25#include <asm/traps.h>
26
27#include <asm/dec/kn02ca.h>
28#include <asm/dec/kn02xa.h>
29#include <asm/dec/kn05.h>
30
31static inline void dec_kn02xa_be_ack(void)
32{
33 volatile u32 *mer = (void *)CKSEG1ADDR(KN02XA_MER);
34 volatile u32 *mem_intr = (void *)CKSEG1ADDR(KN02XA_MEM_INTR);
35
36 *mer = KN02CA_MER_INTR; /* Clear errors; keep the ARC IRQ. */
37 *mem_intr = 0; /* Any write clears the bus IRQ. */
38 iob();
39}
40
41static int dec_kn02xa_be_backend(struct pt_regs *regs, int is_fixup,
42 int invoker)
43{
44 volatile u32 *kn02xa_mer = (void *)CKSEG1ADDR(KN02XA_MER);
45 volatile u32 *kn02xa_ear = (void *)CKSEG1ADDR(KN02XA_EAR);
46
47 static const char excstr[] = "exception";
48 static const char intstr[] = "interrupt";
49 static const char cpustr[] = "CPU";
50 static const char mreadstr[] = "memory read";
51 static const char readstr[] = "read";
52 static const char writestr[] = "write";
53 static const char timestr[] = "timeout";
54 static const char paritystr[] = "parity error";
55 static const char lanestat[][4] = { " OK", "BAD" };
56
57 const char *kind, *agent, *cycle, *event;
58 unsigned long address;
59
60 u32 mer = *kn02xa_mer;
61 u32 ear = *kn02xa_ear;
62 int action = MIPS_BE_FATAL;
63
64 /* Ack ASAP, so that any subsequent errors get caught. */
65 dec_kn02xa_be_ack();
66
67 kind = invoker ? intstr : excstr;
68
69 /* No DMA errors? */
70 agent = cpustr;
71
72 address = ear & KN02XA_EAR_ADDRESS;
73
74 /* Low 256MB is decoded as memory, high -- as TC. */
75 if (address < 0x10000000) {
76 cycle = mreadstr;
77 event = paritystr;
78 } else {
79 cycle = invoker ? writestr : readstr;
80 event = timestr;
81 }
82
83 if (is_fixup)
84 action = MIPS_BE_FIXUP;
85
86 if (action != MIPS_BE_FIXUP)
87 printk(KERN_ALERT "Bus error %s: %s %s %s at %#010lx\n",
88 kind, agent, cycle, event, address);
89
90 if (action != MIPS_BE_FIXUP && address < 0x10000000)
91 printk(KERN_ALERT " Byte lane status %#3x -- "
92 "#3: %s, #2: %s, #1: %s, #0: %s\n",
93 (mer & KN02XA_MER_BYTERR) >> 8,
94 lanestat[(mer & KN02XA_MER_BYTERR_3) != 0],
95 lanestat[(mer & KN02XA_MER_BYTERR_2) != 0],
96 lanestat[(mer & KN02XA_MER_BYTERR_1) != 0],
97 lanestat[(mer & KN02XA_MER_BYTERR_0) != 0]);
98
99 return action;
100}
101
102int dec_kn02xa_be_handler(struct pt_regs *regs, int is_fixup)
103{
104 return dec_kn02xa_be_backend(regs, is_fixup, 0);
105}
106
107irqreturn_t dec_kn02xa_be_interrupt(int irq, void *dev_id,
108 struct pt_regs *regs)
109{
110 int action = dec_kn02xa_be_backend(regs, 0, 1);
111
112 if (action == MIPS_BE_DISCARD)
113 return IRQ_HANDLED;
114
115 /*
116 * FIXME: Find the affected processes and kill them, otherwise
117 * we must die.
118 *
119 * The interrupt is asynchronously delivered thus EPC and RA
120 * may be irrelevant, but are printed for a reference.
121 */
122 printk(KERN_ALERT "Fatal bus interrupt, epc == %08lx, ra == %08lx\n",
123 regs->cp0_epc, regs->regs[31]);
124 die("Unrecoverable bus error", regs);
125}
126
127
128void __init dec_kn02xa_be_init(void)
129{
130 volatile u32 *mbcs = (void *)CKSEG1ADDR(KN4K_SLOT_BASE + KN4K_MB_CSR);
131
132 /* For KN04 we need to make sure EE (?) is enabled in the MB. */
133 if (current_cpu_data.cputype == CPU_R4000SC)
134 *mbcs |= KN4K_MB_CSR_EE;
135 fast_iob();
136
137 /* Clear any leftover errors from the firmware. */
138 dec_kn02xa_be_ack();
139}
diff --git a/arch/mips/dec/prom/identify.c b/arch/mips/dec/prom/identify.c
index 9380588cb15c..81d5e878ddce 100644
--- a/arch/mips/dec/prom/identify.c
+++ b/arch/mips/dec/prom/identify.c
@@ -2,7 +2,7 @@
2 * identify.c: machine identification code. 2 * identify.c: machine identification code.
3 * 3 *
4 * Copyright (C) 1998 Harald Koerfgen and Paul M. Antoine 4 * Copyright (C) 1998 Harald Koerfgen and Paul M. Antoine
5 * Copyright (C) 2002, 2003, 2004 Maciej W. Rozycki 5 * Copyright (C) 2002, 2003, 2004, 2005 Maciej W. Rozycki
6 */ 6 */
7#include <linux/init.h> 7#include <linux/init.h>
8#include <linux/kernel.h> 8#include <linux/kernel.h>
@@ -12,6 +12,7 @@
12#include <linux/types.h> 12#include <linux/types.h>
13 13
14#include <asm/bootinfo.h> 14#include <asm/bootinfo.h>
15
15#include <asm/dec/ioasic.h> 16#include <asm/dec/ioasic.h>
16#include <asm/dec/ioasic_addrs.h> 17#include <asm/dec/ioasic_addrs.h>
17#include <asm/dec/kn01.h> 18#include <asm/dec/kn01.h>
@@ -21,6 +22,7 @@
21#include <asm/dec/kn03.h> 22#include <asm/dec/kn03.h>
22#include <asm/dec/kn230.h> 23#include <asm/dec/kn230.h>
23#include <asm/dec/prom.h> 24#include <asm/dec/prom.h>
25#include <asm/dec/system.h>
24 26
25#include "dectypes.h" 27#include "dectypes.h"
26 28
@@ -68,34 +70,44 @@ EXPORT_SYMBOL(dec_rtc_base);
68 70
69static inline void prom_init_kn01(void) 71static inline void prom_init_kn01(void)
70{ 72{
71 dec_rtc_base = (void *)KN01_RTC_BASE; 73 dec_kn_slot_base = KN01_SLOT_BASE;
72 dec_kn_slot_size = KN01_SLOT_SIZE; 74 dec_kn_slot_size = KN01_SLOT_SIZE;
75
76 dec_rtc_base = (void *)CKSEG1ADDR(dec_kn_slot_base + KN01_RTC);
73} 77}
74 78
75static inline void prom_init_kn230(void) 79static inline void prom_init_kn230(void)
76{ 80{
77 dec_rtc_base = (void *)KN01_RTC_BASE; 81 dec_kn_slot_base = KN01_SLOT_BASE;
78 dec_kn_slot_size = KN01_SLOT_SIZE; 82 dec_kn_slot_size = KN01_SLOT_SIZE;
83
84 dec_rtc_base = (void *)CKSEG1ADDR(dec_kn_slot_base + KN01_RTC);
79} 85}
80 86
81static inline void prom_init_kn02(void) 87static inline void prom_init_kn02(void)
82{ 88{
83 dec_rtc_base = (void *)KN02_RTC_BASE; 89 dec_kn_slot_base = KN02_SLOT_BASE;
84 dec_kn_slot_size = KN02_SLOT_SIZE; 90 dec_kn_slot_size = KN02_SLOT_SIZE;
91
92 dec_rtc_base = (void *)CKSEG1ADDR(dec_kn_slot_base + KN02_RTC);
85} 93}
86 94
87static inline void prom_init_kn02xa(void) 95static inline void prom_init_kn02xa(void)
88{ 96{
89 ioasic_base = (void *)KN02XA_IOASIC_BASE; 97 dec_kn_slot_base = KN02XA_SLOT_BASE;
90 dec_rtc_base = (void *)KN02XA_RTC_BASE;
91 dec_kn_slot_size = IOASIC_SLOT_SIZE; 98 dec_kn_slot_size = IOASIC_SLOT_SIZE;
99
100 ioasic_base = (void *)CKSEG1ADDR(dec_kn_slot_base + IOASIC_IOCTL);
101 dec_rtc_base = (void *)CKSEG1ADDR(dec_kn_slot_base + IOASIC_TOY);
92} 102}
93 103
94static inline void prom_init_kn03(void) 104static inline void prom_init_kn03(void)
95{ 105{
96 ioasic_base = (void *)KN03_IOASIC_BASE; 106 dec_kn_slot_base = KN03_SLOT_BASE;
97 dec_rtc_base = (void *)KN03_RTC_BASE;
98 dec_kn_slot_size = IOASIC_SLOT_SIZE; 107 dec_kn_slot_size = IOASIC_SLOT_SIZE;
108
109 ioasic_base = (void *)CKSEG1ADDR(dec_kn_slot_base + IOASIC_IOCTL);
110 dec_rtc_base = (void *)CKSEG1ADDR(dec_kn_slot_base + IOASIC_TOY);
99} 111}
100 112
101 113
diff --git a/arch/mips/dec/prom/init.c b/arch/mips/dec/prom/init.c
index 60f74256e689..32a7cc7e4c65 100644
--- a/arch/mips/dec/prom/init.c
+++ b/arch/mips/dec/prom/init.c
@@ -6,6 +6,8 @@
6 */ 6 */
7#include <linux/config.h> 7#include <linux/config.h>
8#include <linux/init.h> 8#include <linux/init.h>
9#include <linux/kernel.h>
10#include <linux/linkage.h>
9#include <linux/smp.h> 11#include <linux/smp.h>
10#include <linux/string.h> 12#include <linux/string.h>
11#include <linux/types.h> 13#include <linux/types.h>
@@ -85,17 +87,13 @@ void __init which_prom(s32 magic, s32 *prom_vec)
85 87
86void __init prom_init(void) 88void __init prom_init(void)
87{ 89{
88 extern void dec_machine_halt(void); 90 extern void ATTRIB_NORET dec_machine_halt(void);
89 static char cpu_msg[] __initdata = 91 static char cpu_msg[] __initdata =
90 "Sorry, this kernel is compiled for a wrong CPU type!\n"; 92 "Sorry, this kernel is compiled for a wrong CPU type!\n";
91 static char r3k_msg[] __initdata =
92 "Please recompile with \"CONFIG_CPU_R3000 = y\".\n";
93 static char r4k_msg[] __initdata =
94 "Please recompile with \"CONFIG_CPU_R4x00 = y\".\n";
95 s32 argc = fw_arg0; 93 s32 argc = fw_arg0;
96 s32 argv = fw_arg1; 94 s32 *argv = (void *)fw_arg1;
97 u32 magic = fw_arg2; 95 u32 magic = fw_arg2;
98 s32 prom_vec = fw_arg3; 96 s32 *prom_vec = (void *)fw_arg3;
99 97
100 /* 98 /*
101 * Determine which PROM we have 99 * Determine which PROM we have
@@ -113,6 +111,8 @@ void __init prom_init(void)
113#if defined(CONFIG_CPU_R3000) 111#if defined(CONFIG_CPU_R3000)
114 if ((current_cpu_data.cputype == CPU_R4000SC) || 112 if ((current_cpu_data.cputype == CPU_R4000SC) ||
115 (current_cpu_data.cputype == CPU_R4400SC)) { 113 (current_cpu_data.cputype == CPU_R4400SC)) {
114 static char r4k_msg[] __initdata =
115 "Please recompile with \"CONFIG_CPU_R4x00 = y\".\n";
116 printk(cpu_msg); 116 printk(cpu_msg);
117 printk(r4k_msg); 117 printk(r4k_msg);
118 dec_machine_halt(); 118 dec_machine_halt();
@@ -122,6 +122,8 @@ void __init prom_init(void)
122#if defined(CONFIG_CPU_R4X00) 122#if defined(CONFIG_CPU_R4X00)
123 if ((current_cpu_data.cputype == CPU_R3000) || 123 if ((current_cpu_data.cputype == CPU_R3000) ||
124 (current_cpu_data.cputype == CPU_R3000A)) { 124 (current_cpu_data.cputype == CPU_R3000A)) {
125 static char r3k_msg[] __initdata =
126 "Please recompile with \"CONFIG_CPU_R3000 = y\".\n";
125 printk(cpu_msg); 127 printk(cpu_msg);
126 printk(r3k_msg); 128 printk(r3k_msg);
127 dec_machine_halt(); 129 dec_machine_halt();
diff --git a/arch/mips/dec/prom/memory.c b/arch/mips/dec/prom/memory.c
index e4f6f26425ea..83d4556c3cb5 100644
--- a/arch/mips/dec/prom/memory.c
+++ b/arch/mips/dec/prom/memory.c
@@ -35,22 +35,22 @@ static inline void pmax_setup_memory_region(void)
35 extern char genexcept_early; 35 extern char genexcept_early;
36 36
37 /* Install exception handler */ 37 /* Install exception handler */
38 memcpy(&old_handler, (void *)(KSEG0 + 0x80), 0x80); 38 memcpy(&old_handler, (void *)(CKSEG0 + 0x80), 0x80);
39 memcpy((void *)(KSEG0 + 0x80), &genexcept_early, 0x80); 39 memcpy((void *)(CKSEG0 + 0x80), &genexcept_early, 0x80);
40 40
41 /* read unmapped and uncached (KSEG1) 41 /* read unmapped and uncached (KSEG1)
42 * DECstations have at least 4MB RAM 42 * DECstations have at least 4MB RAM
43 * Assume less than 480MB of RAM, as this is max for 5000/2xx 43 * Assume less than 480MB of RAM, as this is max for 5000/2xx
44 * FIXME this should be replaced by the first free page! 44 * FIXME this should be replaced by the first free page!
45 */ 45 */
46 for (memory_page = (unsigned char *) KSEG1 + CHUNK_SIZE; 46 for (memory_page = (unsigned char *)CKSEG1 + CHUNK_SIZE;
47 (mem_err== 0) && (memory_page < ((unsigned char *) KSEG1+0x1E000000)); 47 mem_err == 0 && memory_page < (unsigned char *)CKSEG1 + 0x1e00000;
48 memory_page += CHUNK_SIZE) { 48 memory_page += CHUNK_SIZE) {
49 dummy = *memory_page; 49 dummy = *memory_page;
50 } 50 }
51 memcpy((void *)(KSEG0 + 0x80), &old_handler, 0x80); 51 memcpy((void *)(CKSEG0 + 0x80), &old_handler, 0x80);
52 52
53 add_memory_region(0, (unsigned long)memory_page - KSEG1 - CHUNK_SIZE, 53 add_memory_region(0, (unsigned long)memory_page - CKSEG1 - CHUNK_SIZE,
54 BOOT_MEM_RAM); 54 BOOT_MEM_RAM);
55} 55}
56 56
@@ -65,7 +65,7 @@ static inline void rex_setup_memory_region(void)
65 memmap *bm; 65 memmap *bm;
66 66
67 /* some free 64k */ 67 /* some free 64k */
68 bm = (memmap *)KSEG0ADDR(0x28000); 68 bm = (memmap *)CKSEG0ADDR(0x28000);
69 69
70 bitmap_size = rex_getbitmap(bm); 70 bitmap_size = rex_getbitmap(bm);
71 71
diff --git a/arch/mips/dec/reset.c b/arch/mips/dec/reset.c
index 7e4d34d0573d..f78c6da47921 100644
--- a/arch/mips/dec/reset.c
+++ b/arch/mips/dec/reset.c
@@ -14,7 +14,7 @@ typedef void ATTRIB_NORET (* noret_func_t)(void);
14 14
15static inline void ATTRIB_NORET back_to_prom(void) 15static inline void ATTRIB_NORET back_to_prom(void)
16{ 16{
17 noret_func_t func = (void *) KSEG1ADDR(0x1fc00000); 17 noret_func_t func = (void *)CKSEG1ADDR(0x1fc00000);
18 18
19 func(); 19 func();
20} 20}
diff --git a/arch/mips/dec/setup.c b/arch/mips/dec/setup.c
index 6a69309baf40..9ef54fe1feaa 100644
--- a/arch/mips/dec/setup.c
+++ b/arch/mips/dec/setup.c
@@ -1,19 +1,20 @@
1/* 1/*
2 * Setup the interrupt stuff. 2 * System-specific setup, especially interrupts.
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
6 * for more details. 6 * for more details.
7 * 7 *
8 * Copyright (C) 1998 Harald Koerfgen 8 * Copyright (C) 1998 Harald Koerfgen
9 * Copyright (C) 2000, 2001, 2002, 2003 Maciej W. Rozycki 9 * Copyright (C) 2000, 2001, 2002, 2003, 2005 Maciej W. Rozycki
10 */ 10 */
11#include <linux/sched.h>
12#include <linux/interrupt.h>
13#include <linux/param.h>
14#include <linux/console.h> 11#include <linux/console.h>
15#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/interrupt.h>
14#include <linux/ioport.h>
16#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/param.h>
17#include <linux/sched.h>
17#include <linux/spinlock.h> 18#include <linux/spinlock.h>
18#include <linux/types.h> 19#include <linux/types.h>
19 20
@@ -38,6 +39,7 @@
38#include <asm/dec/kn02ca.h> 39#include <asm/dec/kn02ca.h>
39#include <asm/dec/kn03.h> 40#include <asm/dec/kn03.h>
40#include <asm/dec/kn230.h> 41#include <asm/dec/kn230.h>
42#include <asm/dec/system.h>
41 43
42 44
43extern void dec_machine_restart(char *command); 45extern void dec_machine_restart(char *command);
@@ -47,10 +49,16 @@ extern irqreturn_t dec_intr_halt(int irq, void *dev_id, struct pt_regs *regs);
47 49
48extern asmlinkage void decstation_handle_int(void); 50extern asmlinkage void decstation_handle_int(void);
49 51
52unsigned long dec_kn_slot_base, dec_kn_slot_size;
53
54EXPORT_SYMBOL(dec_kn_slot_base);
55EXPORT_SYMBOL(dec_kn_slot_size);
56
50spinlock_t ioasic_ssr_lock; 57spinlock_t ioasic_ssr_lock;
51 58
52volatile u32 *ioasic_base; 59volatile u32 *ioasic_base;
53unsigned long dec_kn_slot_size; 60
61EXPORT_SYMBOL(ioasic_base);
54 62
55/* 63/*
56 * IRQ routing and priority tables. Priorites are set as follows: 64 * IRQ routing and priority tables. Priorites are set as follows:
@@ -77,6 +85,9 @@ unsigned long dec_kn_slot_size;
77int dec_interrupt[DEC_NR_INTS] = { 85int dec_interrupt[DEC_NR_INTS] = {
78 [0 ... DEC_NR_INTS - 1] = -1 86 [0 ... DEC_NR_INTS - 1] = -1
79}; 87};
88
89EXPORT_SYMBOL(dec_interrupt);
90
80int_ptr cpu_mask_nr_tbl[DEC_MAX_CPU_INTS][2] = { 91int_ptr cpu_mask_nr_tbl[DEC_MAX_CPU_INTS][2] = {
81 { { .i = ~0 }, { .p = dec_intr_unimplemented } }, 92 { { .i = ~0 }, { .p = dec_intr_unimplemented } },
82}; 93};
@@ -108,11 +119,20 @@ static struct irqaction haltirq = {
108/* 119/*
109 * Bus error (DBE/IBE exceptions and bus interrupts) handling setup. 120 * Bus error (DBE/IBE exceptions and bus interrupts) handling setup.
110 */ 121 */
111void __init dec_be_init(void) 122static void __init dec_be_init(void)
112{ 123{
113 switch (mips_machtype) { 124 switch (mips_machtype) {
114 case MACH_DS23100: /* DS2100/DS3100 Pmin/Pmax */ 125 case MACH_DS23100: /* DS2100/DS3100 Pmin/Pmax */
126 board_be_handler = dec_kn01_be_handler;
127 busirq.handler = dec_kn01_be_interrupt;
115 busirq.flags |= SA_SHIRQ; 128 busirq.flags |= SA_SHIRQ;
129 dec_kn01_be_init();
130 break;
131 case MACH_DS5000_1XX: /* DS5000/1xx 3min */
132 case MACH_DS5000_XX: /* DS5000/xx Maxine */
133 board_be_handler = dec_kn02xa_be_handler;
134 busirq.handler = dec_kn02xa_be_interrupt;
135 dec_kn02xa_be_init();
116 break; 136 break;
117 case MACH_DS5000_200: /* DS5000/200 3max */ 137 case MACH_DS5000_200: /* DS5000/200 3max */
118 case MACH_DS5000_2X0: /* DS5000/240 3max+ */ 138 case MACH_DS5000_2X0: /* DS5000/240 3max+ */
@@ -128,7 +148,7 @@ void __init dec_be_init(void)
128extern void dec_time_init(void); 148extern void dec_time_init(void);
129extern void dec_timer_setup(struct irqaction *); 149extern void dec_timer_setup(struct irqaction *);
130 150
131static void __init decstation_setup(void) 151void __init plat_setup(void)
132{ 152{
133 board_be_init = dec_be_init; 153 board_be_init = dec_be_init;
134 board_time_init = dec_time_init; 154 board_time_init = dec_time_init;
@@ -139,9 +159,10 @@ static void __init decstation_setup(void)
139 _machine_restart = dec_machine_restart; 159 _machine_restart = dec_machine_restart;
140 _machine_halt = dec_machine_halt; 160 _machine_halt = dec_machine_halt;
141 _machine_power_off = dec_machine_power_off; 161 _machine_power_off = dec_machine_power_off;
142}
143 162
144early_initcall(decstation_setup); 163 ioport_resource.start = ~0UL;
164 ioport_resource.end = 0UL;
165}
145 166
146/* 167/*
147 * Machine-specific initialisation for KN01, aka DS2100 (aka Pmin) 168 * Machine-specific initialisation for KN01, aka DS2100 (aka Pmin)
@@ -206,7 +227,7 @@ static int_ptr kn01_cpu_mask_nr_tbl[][2] __initdata = {
206 { .p = cpu_all_int } }, 227 { .p = cpu_all_int } },
207}; 228};
208 229
209void __init dec_init_kn01(void) 230static void __init dec_init_kn01(void)
210{ 231{
211 /* IRQ routing. */ 232 /* IRQ routing. */
212 memcpy(&dec_interrupt, &kn01_interrupt, 233 memcpy(&dec_interrupt, &kn01_interrupt,
@@ -281,7 +302,7 @@ static int_ptr kn230_cpu_mask_nr_tbl[][2] __initdata = {
281 { .p = cpu_all_int } }, 302 { .p = cpu_all_int } },
282}; 303};
283 304
284void __init dec_init_kn230(void) 305static void __init dec_init_kn230(void)
285{ 306{
286 /* IRQ routing. */ 307 /* IRQ routing. */
287 memcpy(&dec_interrupt, &kn230_interrupt, 308 memcpy(&dec_interrupt, &kn230_interrupt,
@@ -371,7 +392,7 @@ static int_ptr kn02_asic_mask_nr_tbl[][2] __initdata = {
371 { .p = kn02_all_int } }, 392 { .p = kn02_all_int } },
372}; 393};
373 394
374void __init dec_init_kn02(void) 395static void __init dec_init_kn02(void)
375{ 396{
376 /* IRQ routing. */ 397 /* IRQ routing. */
377 memcpy(&dec_interrupt, &kn02_interrupt, 398 memcpy(&dec_interrupt, &kn02_interrupt,
@@ -472,7 +493,7 @@ static int_ptr kn02ba_asic_mask_nr_tbl[][2] __initdata = {
472 { .p = asic_all_int } }, 493 { .p = asic_all_int } },
473}; 494};
474 495
475void __init dec_init_kn02ba(void) 496static void __init dec_init_kn02ba(void)
476{ 497{
477 /* IRQ routing. */ 498 /* IRQ routing. */
478 memcpy(&dec_interrupt, &kn02ba_interrupt, 499 memcpy(&dec_interrupt, &kn02ba_interrupt,
@@ -569,7 +590,7 @@ static int_ptr kn02ca_asic_mask_nr_tbl[][2] __initdata = {
569 { .p = asic_all_int } }, 590 { .p = asic_all_int } },
570}; 591};
571 592
572void __init dec_init_kn02ca(void) 593static void __init dec_init_kn02ca(void)
573{ 594{
574 /* IRQ routing. */ 595 /* IRQ routing. */
575 memcpy(&dec_interrupt, &kn02ca_interrupt, 596 memcpy(&dec_interrupt, &kn02ca_interrupt,
@@ -670,7 +691,7 @@ static int_ptr kn03_asic_mask_nr_tbl[][2] __initdata = {
670 { .p = asic_all_int } }, 691 { .p = asic_all_int } },
671}; 692};
672 693
673void __init dec_init_kn03(void) 694static void __init dec_init_kn03(void)
674{ 695{
675 /* IRQ routing. */ 696 /* IRQ routing. */
676 memcpy(&dec_interrupt, &kn03_interrupt, 697 memcpy(&dec_interrupt, &kn03_interrupt,
@@ -744,7 +765,3 @@ void __init arch_init_irq(void)
744 if (dec_interrupt[DEC_IRQ_HALT] >= 0) 765 if (dec_interrupt[DEC_IRQ_HALT] >= 0)
745 setup_irq(dec_interrupt[DEC_IRQ_HALT], &haltirq); 766 setup_irq(dec_interrupt[DEC_IRQ_HALT], &haltirq);
746} 767}
747
748EXPORT_SYMBOL(ioasic_base);
749EXPORT_SYMBOL(dec_kn_slot_size);
750EXPORT_SYMBOL(dec_interrupt);
diff --git a/arch/mips/defconfig b/arch/mips/defconfig
index 20f84b119b4c..4b585e642c2a 100644
--- a/arch/mips/defconfig
+++ b/arch/mips/defconfig
@@ -1,12 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.14-rc2
4# Wed Jan 26 02:48:59 2005 4# Thu Oct 20 22:25:09 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_64BIT is not set
8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
@@ -14,25 +11,30 @@ CONFIG_32BIT=y
14CONFIG_EXPERIMENTAL=y 11CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
22CONFIG_SWAP=y 21CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 22CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set 23# CONFIG_POSIX_MQUEUE is not set
25# CONFIG_BSD_PROCESS_ACCT is not set 24# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y 25CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set 26# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14
29# CONFIG_HOTPLUG is not set 27# CONFIG_HOTPLUG is not set
30CONFIG_KOBJECT_UEVENT=y 28CONFIG_KOBJECT_UEVENT=y
31CONFIG_IKCONFIG=y 29CONFIG_IKCONFIG=y
32CONFIG_IKCONFIG_PROC=y 30CONFIG_IKCONFIG_PROC=y
31CONFIG_INITRAMFS_SOURCE=""
33CONFIG_EMBEDDED=y 32CONFIG_EMBEDDED=y
34CONFIG_KALLSYMS=y 33CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_EXTRA_PASS is not set 34# CONFIG_KALLSYMS_EXTRA_PASS is not set
35CONFIG_PRINTK=y
36CONFIG_BUG=y
37CONFIG_BASE_FULL=y
36CONFIG_FUTEX=y 38CONFIG_FUTEX=y
37CONFIG_EPOLL=y 39CONFIG_EPOLL=y
38# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 40# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -42,6 +44,7 @@ CONFIG_CC_ALIGN_LABELS=0
42CONFIG_CC_ALIGN_LOOPS=0 44CONFIG_CC_ALIGN_LOOPS=0
43CONFIG_CC_ALIGN_JUMPS=0 45CONFIG_CC_ALIGN_JUMPS=0
44# CONFIG_TINY_SHMEM is not set 46# CONFIG_TINY_SHMEM is not set
47CONFIG_BASE_SMALL=0
45 48
46# 49#
47# Loadable module support 50# Loadable module support
@@ -57,41 +60,69 @@ CONFIG_KMOD=y
57# 60#
58# Machine selection 61# Machine selection
59# 62#
60# CONFIG_MACH_JAZZ is not set 63# CONFIG_MIPS_MTX1 is not set
61# CONFIG_MACH_VR41XX is not set 64# CONFIG_MIPS_BOSPORUS is not set
62# CONFIG_TOSHIBA_JMR3927 is not set 65# CONFIG_MIPS_PB1000 is not set
66# CONFIG_MIPS_PB1100 is not set
67# CONFIG_MIPS_PB1500 is not set
68# CONFIG_MIPS_PB1550 is not set
69# CONFIG_MIPS_PB1200 is not set
70# CONFIG_MIPS_DB1000 is not set
71# CONFIG_MIPS_DB1100 is not set
72# CONFIG_MIPS_DB1500 is not set
73# CONFIG_MIPS_DB1550 is not set
74# CONFIG_MIPS_DB1200 is not set
75# CONFIG_MIPS_MIRAGE is not set
63# CONFIG_MIPS_COBALT is not set 76# CONFIG_MIPS_COBALT is not set
64# CONFIG_MACH_DECSTATION is not set 77# CONFIG_MACH_DECSTATION is not set
65# CONFIG_MIPS_EV64120 is not set 78# CONFIG_MIPS_EV64120 is not set
66# CONFIG_MIPS_EV96100 is not set 79# CONFIG_MIPS_EV96100 is not set
67# CONFIG_MIPS_IVR is not set 80# CONFIG_MIPS_IVR is not set
68# CONFIG_LASAT is not set
69# CONFIG_MIPS_ITE8172 is not set 81# CONFIG_MIPS_ITE8172 is not set
82# CONFIG_MACH_JAZZ is not set
83# CONFIG_LASAT is not set
70# CONFIG_MIPS_ATLAS is not set 84# CONFIG_MIPS_ATLAS is not set
71# CONFIG_MIPS_MALTA is not set 85# CONFIG_MIPS_MALTA is not set
72# CONFIG_MIPS_SEAD is not set 86# CONFIG_MIPS_SEAD is not set
87# CONFIG_MIPS_SIM is not set
88# CONFIG_MOMENCO_JAGUAR_ATX is not set
73# CONFIG_MOMENCO_OCELOT is not set 89# CONFIG_MOMENCO_OCELOT is not set
74# CONFIG_MOMENCO_OCELOT_G is not set
75# CONFIG_MOMENCO_OCELOT_C is not set
76# CONFIG_MOMENCO_OCELOT_3 is not set 90# CONFIG_MOMENCO_OCELOT_3 is not set
77# CONFIG_MOMENCO_JAGUAR_ATX is not set 91# CONFIG_MOMENCO_OCELOT_C is not set
78# CONFIG_PMC_YOSEMITE is not set 92# CONFIG_MOMENCO_OCELOT_G is not set
93# CONFIG_MIPS_XXS1500 is not set
94# CONFIG_PNX8550_V2PCI is not set
95# CONFIG_PNX8550_JBS is not set
79# CONFIG_DDB5074 is not set 96# CONFIG_DDB5074 is not set
80# CONFIG_DDB5476 is not set 97# CONFIG_DDB5476 is not set
81# CONFIG_DDB5477 is not set 98# CONFIG_DDB5477 is not set
82# CONFIG_NEC_OSPREY is not set 99# CONFIG_MACH_VR41XX is not set
100# CONFIG_PMC_YOSEMITE is not set
101# CONFIG_QEMU is not set
83CONFIG_SGI_IP22=y 102CONFIG_SGI_IP22=y
84# CONFIG_SOC_AU1X00 is not set 103# CONFIG_SGI_IP27 is not set
85# CONFIG_SIBYTE_SB1xxx_SOC is not set 104# CONFIG_SGI_IP32 is not set
105# CONFIG_SIBYTE_BIGSUR is not set
106# CONFIG_SIBYTE_SWARM is not set
107# CONFIG_SIBYTE_SENTOSA is not set
108# CONFIG_SIBYTE_RHONE is not set
109# CONFIG_SIBYTE_CARMEL is not set
110# CONFIG_SIBYTE_PTSWARM is not set
111# CONFIG_SIBYTE_LITTLESUR is not set
112# CONFIG_SIBYTE_CRHINE is not set
113# CONFIG_SIBYTE_CRHONE is not set
86# CONFIG_SNI_RM200_PCI is not set 114# CONFIG_SNI_RM200_PCI is not set
115# CONFIG_TOSHIBA_JMR3927 is not set
87# CONFIG_TOSHIBA_RBTX4927 is not set 116# CONFIG_TOSHIBA_RBTX4927 is not set
117# CONFIG_TOSHIBA_RBTX4938 is not set
88CONFIG_RWSEM_GENERIC_SPINLOCK=y 118CONFIG_RWSEM_GENERIC_SPINLOCK=y
89CONFIG_GENERIC_CALIBRATE_DELAY=y 119CONFIG_GENERIC_CALIBRATE_DELAY=y
90CONFIG_HAVE_DEC_LOCK=y
91CONFIG_ARC=y 120CONFIG_ARC=y
92CONFIG_DMA_NONCOHERENT=y 121CONFIG_DMA_NONCOHERENT=y
93CONFIG_DMA_NEED_PCI_MAP_STATE=y 122CONFIG_DMA_NEED_PCI_MAP_STATE=y
123CONFIG_CPU_BIG_ENDIAN=y
94# CONFIG_CPU_LITTLE_ENDIAN is not set 124# CONFIG_CPU_LITTLE_ENDIAN is not set
125CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
95CONFIG_IRQ_CPU=y 126CONFIG_IRQ_CPU=y
96CONFIG_SWAP_IO_SPACE=y 127CONFIG_SWAP_IO_SPACE=y
97CONFIG_ARC32=y 128CONFIG_ARC32=y
@@ -103,8 +134,10 @@ CONFIG_ARC_PROMLIB=y
103# 134#
104# CPU selection 135# CPU selection
105# 136#
106# CONFIG_CPU_MIPS32 is not set 137# CONFIG_CPU_MIPS32_R1 is not set
107# CONFIG_CPU_MIPS64 is not set 138# CONFIG_CPU_MIPS32_R2 is not set
139# CONFIG_CPU_MIPS64_R1 is not set
140# CONFIG_CPU_MIPS64_R2 is not set
108# CONFIG_CPU_R3000 is not set 141# CONFIG_CPU_R3000 is not set
109# CONFIG_CPU_TX39XX is not set 142# CONFIG_CPU_TX39XX is not set
110# CONFIG_CPU_VR41XX is not set 143# CONFIG_CPU_VR41XX is not set
@@ -120,22 +153,48 @@ CONFIG_CPU_R5000=y
120# CONFIG_CPU_RM7000 is not set 153# CONFIG_CPU_RM7000 is not set
121# CONFIG_CPU_RM9000 is not set 154# CONFIG_CPU_RM9000 is not set
122# CONFIG_CPU_SB1 is not set 155# CONFIG_CPU_SB1 is not set
156CONFIG_SYS_HAS_CPU_R4X00=y
157CONFIG_SYS_HAS_CPU_R5000=y
158CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
159CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
160CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
161CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
162
163#
164# Kernel type
165#
166CONFIG_32BIT=y
167# CONFIG_64BIT is not set
123CONFIG_PAGE_SIZE_4KB=y 168CONFIG_PAGE_SIZE_4KB=y
124# CONFIG_PAGE_SIZE_8KB is not set 169# CONFIG_PAGE_SIZE_8KB is not set
125# CONFIG_PAGE_SIZE_16KB is not set 170# CONFIG_PAGE_SIZE_16KB is not set
126# CONFIG_PAGE_SIZE_64KB is not set 171# CONFIG_PAGE_SIZE_64KB is not set
127CONFIG_BOARD_SCACHE=y 172CONFIG_BOARD_SCACHE=y
128CONFIG_IP22_CPU_SCACHE=y 173CONFIG_IP22_CPU_SCACHE=y
174# CONFIG_MIPS_MT is not set
129# CONFIG_64BIT_PHYS_ADDR is not set 175# CONFIG_64BIT_PHYS_ADDR is not set
130# CONFIG_CPU_ADVANCED is not set 176# CONFIG_CPU_ADVANCED is not set
131CONFIG_CPU_HAS_LLSC=y 177CONFIG_CPU_HAS_LLSC=y
132CONFIG_CPU_HAS_LLDSCD=y 178CONFIG_CPU_HAS_LLDSCD=y
133CONFIG_CPU_HAS_SYNC=y 179CONFIG_CPU_HAS_SYNC=y
180CONFIG_GENERIC_HARDIRQS=y
181CONFIG_GENERIC_IRQ_PROBE=y
182CONFIG_ARCH_FLATMEM_ENABLE=y
183CONFIG_SELECT_MEMORY_MODEL=y
184CONFIG_FLATMEM_MANUAL=y
185# CONFIG_DISCONTIGMEM_MANUAL is not set
186# CONFIG_SPARSEMEM_MANUAL is not set
187CONFIG_FLATMEM=y
188CONFIG_FLAT_NODE_MEM_MAP=y
189# CONFIG_SPARSEMEM_STATIC is not set
190# CONFIG_PREEMPT_NONE is not set
191CONFIG_PREEMPT_VOLUNTARY=y
134# CONFIG_PREEMPT is not set 192# CONFIG_PREEMPT is not set
135 193
136# 194#
137# Bus options (PCI, PCMCIA, EISA, ISA, TC) 195# Bus options (PCI, PCMCIA, EISA, ISA, TC)
138# 196#
197CONFIG_HW_HAS_EISA=y
139# CONFIG_EISA is not set 198# CONFIG_EISA is not set
140CONFIG_MMU=y 199CONFIG_MMU=y
141 200
@@ -145,10 +204,6 @@ CONFIG_MMU=y
145# CONFIG_PCCARD is not set 204# CONFIG_PCCARD is not set
146 205
147# 206#
148# PC-card bridges
149#
150
151#
152# PCI Hotplug Support 207# PCI Hotplug Support
153# 208#
154 209
@@ -160,115 +215,7 @@ CONFIG_BINFMT_MISC=m
160CONFIG_TRAD_SIGNALS=y 215CONFIG_TRAD_SIGNALS=y
161 216
162# 217#
163# Device Drivers 218# Networking
164#
165
166#
167# Generic Driver Options
168#
169CONFIG_STANDALONE=y
170CONFIG_PREVENT_FIRMWARE_BUILD=y
171# CONFIG_FW_LOADER is not set
172
173#
174# Memory Technology Devices (MTD)
175#
176# CONFIG_MTD is not set
177
178#
179# Parallel port support
180#
181# CONFIG_PARPORT is not set
182
183#
184# Plug and Play support
185#
186
187#
188# Block devices
189#
190# CONFIG_BLK_DEV_FD is not set
191# CONFIG_BLK_DEV_COW_COMMON is not set
192# CONFIG_BLK_DEV_LOOP is not set
193# CONFIG_BLK_DEV_NBD is not set
194# CONFIG_BLK_DEV_RAM is not set
195CONFIG_BLK_DEV_RAM_COUNT=16
196CONFIG_INITRAMFS_SOURCE=""
197# CONFIG_LBD is not set
198CONFIG_CDROM_PKTCDVD=m
199CONFIG_CDROM_PKTCDVD_BUFFERS=8
200# CONFIG_CDROM_PKTCDVD_WCACHE is not set
201
202#
203# IO Schedulers
204#
205CONFIG_IOSCHED_NOOP=y
206CONFIG_IOSCHED_AS=y
207CONFIG_IOSCHED_DEADLINE=y
208CONFIG_IOSCHED_CFQ=y
209CONFIG_ATA_OVER_ETH=m
210
211#
212# ATA/ATAPI/MFM/RLL support
213#
214# CONFIG_IDE is not set
215
216#
217# SCSI device support
218#
219CONFIG_SCSI=y
220CONFIG_SCSI_PROC_FS=y
221
222#
223# SCSI support type (disk, tape, CD-ROM)
224#
225CONFIG_BLK_DEV_SD=y
226CONFIG_CHR_DEV_ST=y
227# CONFIG_CHR_DEV_OSST is not set
228CONFIG_BLK_DEV_SR=y
229# CONFIG_BLK_DEV_SR_VENDOR is not set
230# CONFIG_CHR_DEV_SG is not set
231
232#
233# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
234#
235# CONFIG_SCSI_MULTI_LUN is not set
236CONFIG_SCSI_CONSTANTS=y
237# CONFIG_SCSI_LOGGING is not set
238
239#
240# SCSI Transport Attributes
241#
242CONFIG_SCSI_SPI_ATTRS=m
243# CONFIG_SCSI_FC_ATTRS is not set
244CONFIG_SCSI_ISCSI_ATTRS=m
245
246#
247# SCSI low-level drivers
248#
249CONFIG_SGIWD93_SCSI=y
250# CONFIG_SCSI_SATA is not set
251# CONFIG_SCSI_DEBUG is not set
252
253#
254# Multi-device support (RAID and LVM)
255#
256# CONFIG_MD is not set
257
258#
259# Fusion MPT device support
260#
261
262#
263# IEEE 1394 (FireWire) support
264#
265
266#
267# I2O device support
268#
269
270#
271# Networking support
272# 219#
273CONFIG_NET=y 220CONFIG_NET=y
274 221
@@ -277,12 +224,14 @@ CONFIG_NET=y
277# 224#
278CONFIG_PACKET=y 225CONFIG_PACKET=y
279CONFIG_PACKET_MMAP=y 226CONFIG_PACKET_MMAP=y
280CONFIG_NETLINK_DEV=y
281CONFIG_UNIX=y 227CONFIG_UNIX=y
228CONFIG_XFRM=y
229CONFIG_XFRM_USER=m
282CONFIG_NET_KEY=y 230CONFIG_NET_KEY=y
283CONFIG_INET=y 231CONFIG_INET=y
284CONFIG_IP_MULTICAST=y 232CONFIG_IP_MULTICAST=y
285# CONFIG_IP_ADVANCED_ROUTER is not set 233# CONFIG_IP_ADVANCED_ROUTER is not set
234CONFIG_IP_FIB_HASH=y
286CONFIG_IP_PNP=y 235CONFIG_IP_PNP=y
287# CONFIG_IP_PNP_DHCP is not set 236# CONFIG_IP_PNP_DHCP is not set
288CONFIG_IP_PNP_BOOTP=y 237CONFIG_IP_PNP_BOOTP=y
@@ -296,8 +245,10 @@ CONFIG_INET_AH=m
296CONFIG_INET_ESP=m 245CONFIG_INET_ESP=m
297CONFIG_INET_IPCOMP=m 246CONFIG_INET_IPCOMP=m
298CONFIG_INET_TUNNEL=m 247CONFIG_INET_TUNNEL=m
299CONFIG_IP_TCPDIAG=m 248CONFIG_INET_DIAG=y
300CONFIG_IP_TCPDIAG_IPV6=y 249CONFIG_INET_TCP_DIAG=y
250# CONFIG_TCP_CONG_ADVANCED is not set
251CONFIG_TCP_CONG_BIC=y
301 252
302# 253#
303# IP: Virtual Server Configuration 254# IP: Virtual Server Configuration
@@ -341,6 +292,9 @@ CONFIG_INET6_TUNNEL=m
341CONFIG_IPV6_TUNNEL=m 292CONFIG_IPV6_TUNNEL=m
342CONFIG_NETFILTER=y 293CONFIG_NETFILTER=y
343# CONFIG_NETFILTER_DEBUG is not set 294# CONFIG_NETFILTER_DEBUG is not set
295CONFIG_NETFILTER_NETLINK=m
296CONFIG_NETFILTER_NETLINK_QUEUE=m
297CONFIG_NETFILTER_NETLINK_LOG=m
344 298
345# 299#
346# IP: Netfilter Configuration 300# IP: Netfilter Configuration
@@ -348,11 +302,15 @@ CONFIG_NETFILTER=y
348CONFIG_IP_NF_CONNTRACK=m 302CONFIG_IP_NF_CONNTRACK=m
349CONFIG_IP_NF_CT_ACCT=y 303CONFIG_IP_NF_CT_ACCT=y
350CONFIG_IP_NF_CONNTRACK_MARK=y 304CONFIG_IP_NF_CONNTRACK_MARK=y
305CONFIG_IP_NF_CONNTRACK_EVENTS=y
306CONFIG_IP_NF_CONNTRACK_NETLINK=m
351# CONFIG_IP_NF_CT_PROTO_SCTP is not set 307# CONFIG_IP_NF_CT_PROTO_SCTP is not set
352CONFIG_IP_NF_FTP=m 308CONFIG_IP_NF_FTP=m
353CONFIG_IP_NF_IRC=m 309CONFIG_IP_NF_IRC=m
310# CONFIG_IP_NF_NETBIOS_NS is not set
354CONFIG_IP_NF_TFTP=m 311CONFIG_IP_NF_TFTP=m
355CONFIG_IP_NF_AMANDA=m 312CONFIG_IP_NF_AMANDA=m
313CONFIG_IP_NF_PPTP=m
356CONFIG_IP_NF_QUEUE=m 314CONFIG_IP_NF_QUEUE=m
357CONFIG_IP_NF_IPTABLES=m 315CONFIG_IP_NF_IPTABLES=m
358CONFIG_IP_NF_MATCH_LIMIT=m 316CONFIG_IP_NF_MATCH_LIMIT=m
@@ -376,9 +334,12 @@ CONFIG_IP_NF_MATCH_OWNER=m
376CONFIG_IP_NF_MATCH_ADDRTYPE=m 334CONFIG_IP_NF_MATCH_ADDRTYPE=m
377CONFIG_IP_NF_MATCH_REALM=m 335CONFIG_IP_NF_MATCH_REALM=m
378CONFIG_IP_NF_MATCH_SCTP=m 336CONFIG_IP_NF_MATCH_SCTP=m
337CONFIG_IP_NF_MATCH_DCCP=m
379CONFIG_IP_NF_MATCH_COMMENT=m 338CONFIG_IP_NF_MATCH_COMMENT=m
380CONFIG_IP_NF_MATCH_CONNMARK=m 339CONFIG_IP_NF_MATCH_CONNMARK=m
340CONFIG_IP_NF_MATCH_CONNBYTES=m
381CONFIG_IP_NF_MATCH_HASHLIMIT=m 341CONFIG_IP_NF_MATCH_HASHLIMIT=m
342CONFIG_IP_NF_MATCH_STRING=m
382CONFIG_IP_NF_FILTER=m 343CONFIG_IP_NF_FILTER=m
383CONFIG_IP_NF_TARGET_REJECT=m 344CONFIG_IP_NF_TARGET_REJECT=m
384CONFIG_IP_NF_TARGET_LOG=m 345CONFIG_IP_NF_TARGET_LOG=m
@@ -395,12 +356,14 @@ CONFIG_IP_NF_NAT_IRC=m
395CONFIG_IP_NF_NAT_FTP=m 356CONFIG_IP_NF_NAT_FTP=m
396CONFIG_IP_NF_NAT_TFTP=m 357CONFIG_IP_NF_NAT_TFTP=m
397CONFIG_IP_NF_NAT_AMANDA=m 358CONFIG_IP_NF_NAT_AMANDA=m
359CONFIG_IP_NF_NAT_PPTP=m
398CONFIG_IP_NF_MANGLE=m 360CONFIG_IP_NF_MANGLE=m
399CONFIG_IP_NF_TARGET_TOS=m 361CONFIG_IP_NF_TARGET_TOS=m
400CONFIG_IP_NF_TARGET_ECN=m 362CONFIG_IP_NF_TARGET_ECN=m
401CONFIG_IP_NF_TARGET_DSCP=m 363CONFIG_IP_NF_TARGET_DSCP=m
402CONFIG_IP_NF_TARGET_MARK=m 364CONFIG_IP_NF_TARGET_MARK=m
403CONFIG_IP_NF_TARGET_CLASSIFY=m 365CONFIG_IP_NF_TARGET_CLASSIFY=m
366CONFIG_IP_NF_TARGET_TTL=m
404CONFIG_IP_NF_TARGET_CONNMARK=m 367CONFIG_IP_NF_TARGET_CONNMARK=m
405CONFIG_IP_NF_TARGET_CLUSTERIP=m 368CONFIG_IP_NF_TARGET_CLUSTERIP=m
406CONFIG_IP_NF_RAW=m 369CONFIG_IP_NF_RAW=m
@@ -410,7 +373,7 @@ CONFIG_IP_NF_ARPFILTER=m
410CONFIG_IP_NF_ARP_MANGLE=m 373CONFIG_IP_NF_ARP_MANGLE=m
411 374
412# 375#
413# IPv6: Netfilter Configuration 376# IPv6: Netfilter Configuration (EXPERIMENTAL)
414# 377#
415CONFIG_IP6_NF_QUEUE=m 378CONFIG_IP6_NF_QUEUE=m
416CONFIG_IP6_NF_IPTABLES=m 379CONFIG_IP6_NF_IPTABLES=m
@@ -429,11 +392,16 @@ CONFIG_IP6_NF_MATCH_LENGTH=m
429CONFIG_IP6_NF_MATCH_EUI64=m 392CONFIG_IP6_NF_MATCH_EUI64=m
430CONFIG_IP6_NF_FILTER=m 393CONFIG_IP6_NF_FILTER=m
431CONFIG_IP6_NF_TARGET_LOG=m 394CONFIG_IP6_NF_TARGET_LOG=m
395CONFIG_IP6_NF_TARGET_REJECT=m
432CONFIG_IP6_NF_MANGLE=m 396CONFIG_IP6_NF_MANGLE=m
433CONFIG_IP6_NF_TARGET_MARK=m 397CONFIG_IP6_NF_TARGET_MARK=m
398CONFIG_IP6_NF_TARGET_HL=m
434CONFIG_IP6_NF_RAW=m 399CONFIG_IP6_NF_RAW=m
435CONFIG_XFRM=y 400
436CONFIG_XFRM_USER=m 401#
402# DCCP Configuration (EXPERIMENTAL)
403#
404# CONFIG_IP_DCCP is not set
437 405
438# 406#
439# SCTP Configuration (EXPERIMENTAL) 407# SCTP Configuration (EXPERIMENTAL)
@@ -456,10 +424,6 @@ CONFIG_SCTP_HMAC_MD5=y
456CONFIG_NET_DIVERT=y 424CONFIG_NET_DIVERT=y
457# CONFIG_ECONET is not set 425# CONFIG_ECONET is not set
458# CONFIG_WAN_ROUTER is not set 426# CONFIG_WAN_ROUTER is not set
459
460#
461# QoS and/or fair queueing
462#
463CONFIG_NET_SCHED=y 427CONFIG_NET_SCHED=y
464# CONFIG_NET_SCH_CLK_JIFFIES is not set 428# CONFIG_NET_SCH_CLK_JIFFIES is not set
465CONFIG_NET_SCH_CLK_GETTIMEOFDAY=y 429CONFIG_NET_SCH_CLK_GETTIMEOFDAY=y
@@ -479,6 +443,7 @@ CONFIG_NET_SCH_INGRESS=m
479CONFIG_NET_QOS=y 443CONFIG_NET_QOS=y
480CONFIG_NET_ESTIMATOR=y 444CONFIG_NET_ESTIMATOR=y
481CONFIG_NET_CLS=y 445CONFIG_NET_CLS=y
446CONFIG_NET_CLS_BASIC=m
482CONFIG_NET_CLS_TCINDEX=m 447CONFIG_NET_CLS_TCINDEX=m
483CONFIG_NET_CLS_ROUTE4=m 448CONFIG_NET_CLS_ROUTE4=m
484CONFIG_NET_CLS_ROUTE=y 449CONFIG_NET_CLS_ROUTE=y
@@ -489,6 +454,7 @@ CONFIG_NET_CLS_U32=m
489# CONFIG_CLS_U32_MARK is not set 454# CONFIG_CLS_U32_MARK is not set
490CONFIG_NET_CLS_RSVP=m 455CONFIG_NET_CLS_RSVP=m
491CONFIG_NET_CLS_RSVP6=m 456CONFIG_NET_CLS_RSVP6=m
457# CONFIG_NET_EMATCH is not set
492# CONFIG_NET_CLS_ACT is not set 458# CONFIG_NET_CLS_ACT is not set
493CONFIG_NET_CLS_POLICE=y 459CONFIG_NET_CLS_POLICE=y
494 460
@@ -496,17 +462,153 @@ CONFIG_NET_CLS_POLICE=y
496# Network testing 462# Network testing
497# 463#
498# CONFIG_NET_PKTGEN is not set 464# CONFIG_NET_PKTGEN is not set
499# CONFIG_NETPOLL is not set
500# CONFIG_NET_POLL_CONTROLLER is not set
501# CONFIG_HAMRADIO is not set 465# CONFIG_HAMRADIO is not set
502# CONFIG_IRDA is not set 466# CONFIG_IRDA is not set
503# CONFIG_BT is not set 467# CONFIG_BT is not set
468CONFIG_IEEE80211=m
469# CONFIG_IEEE80211_DEBUG is not set
470CONFIG_IEEE80211_CRYPT_WEP=m
471CONFIG_IEEE80211_CRYPT_CCMP=m
472CONFIG_IEEE80211_CRYPT_TKIP=m
473
474#
475# Device Drivers
476#
477
478#
479# Generic Driver Options
480#
481CONFIG_STANDALONE=y
482CONFIG_PREVENT_FIRMWARE_BUILD=y
483# CONFIG_FW_LOADER is not set
484
485#
486# Connector - unified userspace <-> kernelspace linker
487#
488CONFIG_CONNECTOR=m
489
490#
491# Memory Technology Devices (MTD)
492#
493# CONFIG_MTD is not set
494
495#
496# Parallel port support
497#
498# CONFIG_PARPORT is not set
499
500#
501# Plug and Play support
502#
503
504#
505# Block devices
506#
507# CONFIG_BLK_DEV_COW_COMMON is not set
508# CONFIG_BLK_DEV_LOOP is not set
509# CONFIG_BLK_DEV_NBD is not set
510# CONFIG_BLK_DEV_RAM is not set
511CONFIG_BLK_DEV_RAM_COUNT=16
512# CONFIG_LBD is not set
513CONFIG_CDROM_PKTCDVD=m
514CONFIG_CDROM_PKTCDVD_BUFFERS=8
515# CONFIG_CDROM_PKTCDVD_WCACHE is not set
516
517#
518# IO Schedulers
519#
520CONFIG_IOSCHED_NOOP=y
521CONFIG_IOSCHED_AS=y
522CONFIG_IOSCHED_DEADLINE=y
523CONFIG_IOSCHED_CFQ=y
524CONFIG_ATA_OVER_ETH=m
525
526#
527# ATA/ATAPI/MFM/RLL support
528#
529# CONFIG_IDE is not set
530
531#
532# SCSI device support
533#
534CONFIG_RAID_ATTRS=m
535CONFIG_SCSI=y
536CONFIG_SCSI_PROC_FS=y
537
538#
539# SCSI support type (disk, tape, CD-ROM)
540#
541CONFIG_BLK_DEV_SD=y
542CONFIG_CHR_DEV_ST=y
543# CONFIG_CHR_DEV_OSST is not set
544CONFIG_BLK_DEV_SR=y
545# CONFIG_BLK_DEV_SR_VENDOR is not set
546# CONFIG_CHR_DEV_SG is not set
547CONFIG_CHR_DEV_SCH=m
548
549#
550# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
551#
552# CONFIG_SCSI_MULTI_LUN is not set
553CONFIG_SCSI_CONSTANTS=y
554# CONFIG_SCSI_LOGGING is not set
555
556#
557# SCSI Transport Attributes
558#
559CONFIG_SCSI_SPI_ATTRS=m
560# CONFIG_SCSI_FC_ATTRS is not set
561CONFIG_SCSI_ISCSI_ATTRS=m
562CONFIG_SCSI_SAS_ATTRS=m
563
564#
565# SCSI low-level drivers
566#
567CONFIG_SGIWD93_SCSI=y
568# CONFIG_SCSI_SATA is not set
569# CONFIG_SCSI_DEBUG is not set
570
571#
572# Multi-device support (RAID and LVM)
573#
574# CONFIG_MD is not set
575
576#
577# Fusion MPT device support
578#
579# CONFIG_FUSION is not set
580
581#
582# IEEE 1394 (FireWire) support
583#
584
585#
586# I2O device support
587#
588
589#
590# Network device support
591#
504CONFIG_NETDEVICES=y 592CONFIG_NETDEVICES=y
505CONFIG_DUMMY=m 593CONFIG_DUMMY=m
506CONFIG_BONDING=m 594CONFIG_BONDING=m
507CONFIG_EQUALIZER=m 595CONFIG_EQUALIZER=m
508CONFIG_TUN=m 596CONFIG_TUN=m
509CONFIG_ETHERTAP=m 597
598#
599# PHY device support
600#
601CONFIG_PHYLIB=m
602CONFIG_PHYCONTROL=y
603
604#
605# MII PHY device drivers
606#
607CONFIG_MARVELL_PHY=m
608CONFIG_DAVICOM_PHY=m
609CONFIG_QSEMI_PHY=m
610CONFIG_LXT_PHY=m
611CONFIG_CICADA_PHY=m
510 612
511# 613#
512# Ethernet (10 or 100Mbit) 614# Ethernet (10 or 100Mbit)
@@ -540,6 +642,8 @@ CONFIG_SGISEEQ=y
540# CONFIG_SLIP is not set 642# CONFIG_SLIP is not set
541# CONFIG_SHAPER is not set 643# CONFIG_SHAPER is not set
542# CONFIG_NETCONSOLE is not set 644# CONFIG_NETCONSOLE is not set
645# CONFIG_NETPOLL is not set
646# CONFIG_NET_POLL_CONTROLLER is not set
543 647
544# 648#
545# ISDN subsystem 649# ISDN subsystem
@@ -569,18 +673,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
569# CONFIG_INPUT_EVBUG is not set 673# CONFIG_INPUT_EVBUG is not set
570 674
571# 675#
572# Input I/O drivers
573#
574# CONFIG_GAMEPORT is not set
575CONFIG_SOUND_GAMEPORT=y
576CONFIG_SERIO=y
577CONFIG_SERIO_I8042=y
578CONFIG_SERIO_SERPORT=y
579# CONFIG_SERIO_CT82C710 is not set
580CONFIG_SERIO_LIBPS2=y
581CONFIG_SERIO_RAW=m
582
583#
584# Input Device Drivers 676# Input Device Drivers
585# 677#
586CONFIG_INPUT_KEYBOARD=y 678CONFIG_INPUT_KEYBOARD=y
@@ -598,6 +690,16 @@ CONFIG_MOUSE_SERIAL=m
598# CONFIG_INPUT_MISC is not set 690# CONFIG_INPUT_MISC is not set
599 691
600# 692#
693# Hardware I/O ports
694#
695CONFIG_SERIO=y
696CONFIG_SERIO_I8042=y
697CONFIG_SERIO_SERPORT=y
698CONFIG_SERIO_LIBPS2=y
699CONFIG_SERIO_RAW=m
700# CONFIG_GAMEPORT is not set
701
702#
601# Character devices 703# Character devices
602# 704#
603CONFIG_VT=y 705CONFIG_VT=y
@@ -644,11 +746,14 @@ CONFIG_SGI_DS1286=m
644# 746#
645# Ftape, the floppy tape device driver 747# Ftape, the floppy tape device driver
646# 748#
647# CONFIG_DRM is not set
648CONFIG_RAW_DRIVER=m 749CONFIG_RAW_DRIVER=m
649CONFIG_MAX_RAW_DEVS=256 750CONFIG_MAX_RAW_DEVS=256
650 751
651# 752#
753# TPM devices
754#
755
756#
652# I2C support 757# I2C support
653# 758#
654# CONFIG_I2C is not set 759# CONFIG_I2C is not set
@@ -659,10 +764,20 @@ CONFIG_MAX_RAW_DEVS=256
659# CONFIG_W1 is not set 764# CONFIG_W1 is not set
660 765
661# 766#
767# Hardware Monitoring support
768#
769# CONFIG_HWMON is not set
770# CONFIG_HWMON_VID is not set
771
772#
662# Misc devices 773# Misc devices
663# 774#
664 775
665# 776#
777# Multimedia Capabilities Port drivers
778#
779
780#
666# Multimedia devices 781# Multimedia devices
667# 782#
668# CONFIG_VIDEO_DEV is not set 783# CONFIG_VIDEO_DEV is not set
@@ -693,7 +808,6 @@ CONFIG_LOGO=y
693# CONFIG_LOGO_LINUX_VGA16 is not set 808# CONFIG_LOGO_LINUX_VGA16 is not set
694# CONFIG_LOGO_LINUX_CLUT224 is not set 809# CONFIG_LOGO_LINUX_CLUT224 is not set
695CONFIG_LOGO_SGI_CLUT224=y 810CONFIG_LOGO_SGI_CLUT224=y
696# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
697 811
698# 812#
699# Sound 813# Sound
@@ -707,10 +821,6 @@ CONFIG_LOGO_SGI_CLUT224=y
707# CONFIG_USB_ARCH_HAS_OHCI is not set 821# CONFIG_USB_ARCH_HAS_OHCI is not set
708 822
709# 823#
710# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
711#
712
713#
714# USB Gadget Support 824# USB Gadget Support
715# 825#
716# CONFIG_USB_GADGET is not set 826# CONFIG_USB_GADGET is not set
@@ -723,13 +833,17 @@ CONFIG_LOGO_SGI_CLUT224=y
723# 833#
724# InfiniBand support 834# InfiniBand support
725# 835#
726# CONFIG_INFINIBAND is not set 836
837#
838# SN Devices
839#
727 840
728# 841#
729# File systems 842# File systems
730# 843#
731CONFIG_EXT2_FS=m 844CONFIG_EXT2_FS=m
732# CONFIG_EXT2_FS_XATTR is not set 845# CONFIG_EXT2_FS_XATTR is not set
846# CONFIG_EXT2_FS_XIP is not set
733CONFIG_EXT3_FS=y 847CONFIG_EXT3_FS=y
734CONFIG_EXT3_FS_XATTR=y 848CONFIG_EXT3_FS_XATTR=y
735CONFIG_EXT3_FS_POSIX_ACL=y 849CONFIG_EXT3_FS_POSIX_ACL=y
@@ -741,12 +855,14 @@ CONFIG_FS_MBCACHE=y
741# CONFIG_JFS_FS is not set 855# CONFIG_JFS_FS is not set
742CONFIG_FS_POSIX_ACL=y 856CONFIG_FS_POSIX_ACL=y
743CONFIG_XFS_FS=m 857CONFIG_XFS_FS=m
744# CONFIG_XFS_RT is not set 858CONFIG_XFS_EXPORT=y
745CONFIG_XFS_QUOTA=y 859CONFIG_XFS_QUOTA=m
746CONFIG_XFS_SECURITY=y 860CONFIG_XFS_SECURITY=y
747# CONFIG_XFS_POSIX_ACL is not set 861# CONFIG_XFS_POSIX_ACL is not set
862# CONFIG_XFS_RT is not set
748CONFIG_MINIX_FS=m 863CONFIG_MINIX_FS=m
749# CONFIG_ROMFS_FS is not set 864# CONFIG_ROMFS_FS is not set
865CONFIG_INOTIFY=y
750CONFIG_QUOTA=y 866CONFIG_QUOTA=y
751# CONFIG_QFMT_V1 is not set 867# CONFIG_QFMT_V1 is not set
752CONFIG_QFMT_V2=m 868CONFIG_QFMT_V2=m
@@ -754,6 +870,7 @@ CONFIG_QUOTACTL=y
754CONFIG_DNOTIFY=y 870CONFIG_DNOTIFY=y
755CONFIG_AUTOFS_FS=m 871CONFIG_AUTOFS_FS=m
756CONFIG_AUTOFS4_FS=m 872CONFIG_AUTOFS4_FS=m
873CONFIG_FUSE_FS=m
757 874
758# 875#
759# CD-ROM/DVD Filesystems 876# CD-ROM/DVD Filesystems
@@ -781,12 +898,10 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
781CONFIG_PROC_FS=y 898CONFIG_PROC_FS=y
782CONFIG_PROC_KCORE=y 899CONFIG_PROC_KCORE=y
783CONFIG_SYSFS=y 900CONFIG_SYSFS=y
784# CONFIG_DEVFS_FS is not set
785CONFIG_DEVPTS_FS_XATTR=y
786CONFIG_DEVPTS_FS_SECURITY=y
787# CONFIG_TMPFS is not set 901# CONFIG_TMPFS is not set
788# CONFIG_HUGETLB_PAGE is not set 902# CONFIG_HUGETLB_PAGE is not set
789CONFIG_RAMFS=y 903CONFIG_RAMFS=y
904CONFIG_RELAYFS_FS=m
790 905
791# 906#
792# Miscellaneous filesystems 907# Miscellaneous filesystems
@@ -811,15 +926,20 @@ CONFIG_UFS_FS=m
811# 926#
812CONFIG_NFS_FS=m 927CONFIG_NFS_FS=m
813CONFIG_NFS_V3=y 928CONFIG_NFS_V3=y
929CONFIG_NFS_V3_ACL=y
814# CONFIG_NFS_V4 is not set 930# CONFIG_NFS_V4 is not set
815# CONFIG_NFS_DIRECTIO is not set 931# CONFIG_NFS_DIRECTIO is not set
816CONFIG_NFSD=m 932CONFIG_NFSD=m
933CONFIG_NFSD_V2_ACL=y
817CONFIG_NFSD_V3=y 934CONFIG_NFSD_V3=y
935CONFIG_NFSD_V3_ACL=y
818# CONFIG_NFSD_V4 is not set 936# CONFIG_NFSD_V4 is not set
819CONFIG_NFSD_TCP=y 937CONFIG_NFSD_TCP=y
820CONFIG_LOCKD=m 938CONFIG_LOCKD=m
821CONFIG_LOCKD_V4=y 939CONFIG_LOCKD_V4=y
822CONFIG_EXPORTFS=m 940CONFIG_EXPORTFS=m
941CONFIG_NFS_ACL_SUPPORT=m
942CONFIG_NFS_COMMON=y
823CONFIG_SUNRPC=m 943CONFIG_SUNRPC=m
824CONFIG_SUNRPC_GSS=m 944CONFIG_SUNRPC_GSS=m
825CONFIG_RPCSEC_GSS_KRB5=m 945CONFIG_RPCSEC_GSS_KRB5=m
@@ -835,6 +955,7 @@ CONFIG_CIFS=m
835CONFIG_CODA_FS=m 955CONFIG_CODA_FS=m
836# CONFIG_CODA_FS_OLD_API is not set 956# CONFIG_CODA_FS_OLD_API is not set
837# CONFIG_AFS_FS is not set 957# CONFIG_AFS_FS is not set
958# CONFIG_9P_FS is not set
838 959
839# 960#
840# Partition Types 961# Partition Types
@@ -908,7 +1029,9 @@ CONFIG_NLS_UTF8=m
908# 1029#
909# Kernel hacking 1030# Kernel hacking
910# 1031#
1032# CONFIG_PRINTK_TIME is not set
911# CONFIG_DEBUG_KERNEL is not set 1033# CONFIG_DEBUG_KERNEL is not set
1034CONFIG_LOG_BUF_SHIFT=14
912CONFIG_CROSSCOMPILE=y 1035CONFIG_CROSSCOMPILE=y
913CONFIG_CMDLINE="" 1036CONFIG_CMDLINE=""
914 1037
@@ -931,6 +1054,7 @@ CONFIG_CRYPTO_SHA1=m
931CONFIG_CRYPTO_SHA256=m 1054CONFIG_CRYPTO_SHA256=m
932CONFIG_CRYPTO_SHA512=m 1055CONFIG_CRYPTO_SHA512=m
933CONFIG_CRYPTO_WP512=m 1056CONFIG_CRYPTO_WP512=m
1057CONFIG_CRYPTO_TGR192=m
934CONFIG_CRYPTO_DES=m 1058CONFIG_CRYPTO_DES=m
935CONFIG_CRYPTO_BLOWFISH=m 1059CONFIG_CRYPTO_BLOWFISH=m
936CONFIG_CRYPTO_TWOFISH=m 1060CONFIG_CRYPTO_TWOFISH=m
@@ -942,10 +1066,10 @@ CONFIG_CRYPTO_TEA=m
942CONFIG_CRYPTO_ARC4=m 1066CONFIG_CRYPTO_ARC4=m
943CONFIG_CRYPTO_KHAZAD=m 1067CONFIG_CRYPTO_KHAZAD=m
944CONFIG_CRYPTO_ANUBIS=m 1068CONFIG_CRYPTO_ANUBIS=m
945CONFIG_CRYPTO_DEFLATE=y 1069CONFIG_CRYPTO_DEFLATE=m
946CONFIG_CRYPTO_MICHAEL_MIC=m 1070CONFIG_CRYPTO_MICHAEL_MIC=m
947CONFIG_CRYPTO_CRC32C=m 1071CONFIG_CRYPTO_CRC32C=m
948CONFIG_CRYPTO_TEST=m 1072# CONFIG_CRYPTO_TEST is not set
949 1073
950# 1074#
951# Hardware crypto devices 1075# Hardware crypto devices
@@ -955,9 +1079,12 @@ CONFIG_CRYPTO_TEST=m
955# Library routines 1079# Library routines
956# 1080#
957# CONFIG_CRC_CCITT is not set 1081# CONFIG_CRC_CCITT is not set
1082CONFIG_CRC16=m
958CONFIG_CRC32=m 1083CONFIG_CRC32=m
959CONFIG_LIBCRC32C=m 1084CONFIG_LIBCRC32C=m
960CONFIG_ZLIB_INFLATE=y 1085CONFIG_ZLIB_INFLATE=m
961CONFIG_ZLIB_DEFLATE=y 1086CONFIG_ZLIB_DEFLATE=m
962CONFIG_GENERIC_HARDIRQS=y 1087CONFIG_TEXTSEARCH=y
963CONFIG_GENERIC_IRQ_PROBE=y 1088CONFIG_TEXTSEARCH_KMP=m
1089CONFIG_TEXTSEARCH_BM=m
1090CONFIG_TEXTSEARCH_FSM=m
diff --git a/arch/mips/galileo-boards/ev96100/setup.c b/arch/mips/galileo-boards/ev96100/setup.c
index 28bd908c6d55..78dbb18edeb8 100644
--- a/arch/mips/galileo-boards/ev96100/setup.c
+++ b/arch/mips/galileo-boards/ev96100/setup.c
@@ -55,7 +55,7 @@ extern void mips_reboot_setup(void);
55 55
56unsigned char mac_0_1[12]; 56unsigned char mac_0_1[12];
57 57
58static void __init ev96100_setup(void) 58void __init plat_setup(void)
59{ 59{
60 unsigned int config = read_c0_config(); 60 unsigned int config = read_c0_config();
61 unsigned int status = read_c0_status(); 61 unsigned int status = read_c0_status();
@@ -142,8 +142,6 @@ static void __init ev96100_setup(void)
142 tmp = GT_READ(GT_PCI0_CFGDATA_OFS); 142 tmp = GT_READ(GT_PCI0_CFGDATA_OFS);
143} 143}
144 144
145early_initcall(ev96100_setup);
146
147unsigned short get_gt_devid(void) 145unsigned short get_gt_devid(void)
148{ 146{
149 u32 gt_devid; 147 u32 gt_devid;
diff --git a/arch/mips/gt64120/ev64120/Kconfig b/arch/mips/gt64120/ev64120/Kconfig
new file mode 100644
index 000000000000..d691762cb0f7
--- /dev/null
+++ b/arch/mips/gt64120/ev64120/Kconfig
@@ -0,0 +1,3 @@
1config EVB_PCI1
2 bool "Enable Second PCI (PCI1)"
3 depends on MIPS_EV64120
diff --git a/arch/mips/gt64120/ev64120/setup.c b/arch/mips/gt64120/ev64120/setup.c
index dba0961400cc..98b5a96cc039 100644
--- a/arch/mips/gt64120/ev64120/setup.c
+++ b/arch/mips/gt64120/ev64120/setup.c
@@ -69,7 +69,7 @@ unsigned long __init prom_free_prom_memory(void)
69 */ 69 */
70extern void gt64120_time_init(void); 70extern void gt64120_time_init(void);
71 71
72static void __init ev64120_setup(void) 72void __init plat_setup(void)
73{ 73{
74 _machine_restart = galileo_machine_restart; 74 _machine_restart = galileo_machine_restart;
75 _machine_halt = galileo_machine_halt; 75 _machine_halt = galileo_machine_halt;
@@ -79,8 +79,6 @@ static void __init ev64120_setup(void)
79 set_io_port_base(KSEG1); 79 set_io_port_base(KSEG1);
80} 80}
81 81
82early_initcall(ev64120_setup);
83
84const char *get_system_type(void) 82const char *get_system_type(void)
85{ 83{
86 return "Galileo EV64120A"; 84 return "Galileo EV64120A";
diff --git a/arch/mips/gt64120/momenco_ocelot/setup.c b/arch/mips/gt64120/momenco_ocelot/setup.c
index d610f8c17c81..0d07c33112d0 100644
--- a/arch/mips/gt64120/momenco_ocelot/setup.c
+++ b/arch/mips/gt64120/momenco_ocelot/setup.c
@@ -150,7 +150,7 @@ void PMON_v2_setup()
150 gt64120_base = 0xe0000000; 150 gt64120_base = 0xe0000000;
151} 151}
152 152
153static void __init momenco_ocelot_setup(void) 153void __init plat_setup(void)
154{ 154{
155 void (*l3func)(unsigned long)=KSEG1ADDR(&setup_l3cache); 155 void (*l3func)(unsigned long)=KSEG1ADDR(&setup_l3cache);
156 unsigned int tmpword; 156 unsigned int tmpword;
@@ -307,8 +307,6 @@ static void __init momenco_ocelot_setup(void)
307 GT_WRITE(GT_DEV_B3_OFS, 0xfef73); 307 GT_WRITE(GT_DEV_B3_OFS, 0xfef73);
308} 308}
309 309
310early_initcall(momenco_ocelot_setup);
311
312extern int rm7k_tcache_enabled; 310extern int rm7k_tcache_enabled;
313/* 311/*
314 * This runs in KSEG1. See the verbiage in rm7k.c::probe_scache() 312 * This runs in KSEG1. See the verbiage in rm7k.c::probe_scache()
diff --git a/arch/mips/ite-boards/Kconfig b/arch/mips/ite-boards/Kconfig
new file mode 100644
index 000000000000..a6d59ad8f846
--- /dev/null
+++ b/arch/mips/ite-boards/Kconfig
@@ -0,0 +1,8 @@
1config IT8172_REVC
2 bool "Support for older IT8172 (Rev C)"
3 depends on MIPS_ITE8172
4 help
5 Say Y here to support the older, Revision C version of the Integrated
6 Technology Express, Inc. ITE8172 SBC. Vendor page at
7 <http://www.ite.com.tw/ia/brief_it8172bsp.htm>; picture of the
8 board at <http://www.mvista.com/partners/semiconductor/ite.html>.
diff --git a/arch/mips/ite-boards/generic/irq.c b/arch/mips/ite-boards/generic/irq.c
index cb71b9024d6f..e67f96129491 100644
--- a/arch/mips/ite-boards/generic/irq.c
+++ b/arch/mips/ite-boards/generic/irq.c
@@ -138,14 +138,13 @@ static void end_ite_irq(unsigned int irq)
138} 138}
139 139
140static struct hw_interrupt_type it8172_irq_type = { 140static struct hw_interrupt_type it8172_irq_type = {
141 "ITE8172", 141 .typename = "ITE8172",
142 startup_ite_irq, 142 .startup = startup_ite_irq,
143 shutdown_ite_irq, 143 .shutdown = shutdown_ite_irq,
144 enable_it8172_irq, 144 .enable = enable_it8172_irq,
145 disable_it8172_irq, 145 .disable = disable_it8172_irq,
146 mask_and_ack_ite_irq, 146 .ack = mask_and_ack_ite_irq,
147 end_ite_irq, 147 .end = end_ite_irq,
148 NULL
149}; 148};
150 149
151 150
@@ -159,13 +158,13 @@ static void ack_none(unsigned int irq) { }
159#define end_none enable_none 158#define end_none enable_none
160 159
161static struct hw_interrupt_type cp0_irq_type = { 160static struct hw_interrupt_type cp0_irq_type = {
162 "CP0 Count", 161 .typename = "CP0 Count",
163 startup_none, 162 .startup = startup_none,
164 shutdown_none, 163 .shutdown = shutdown_none,
165 enable_none, 164 .enable = enable_none,
166 disable_none, 165 .disable = disable_none,
167 ack_none, 166 .ack = ack_none,
168 end_none 167 .end = end_none
169}; 168};
170 169
171void enable_cpu_timer(void) 170void enable_cpu_timer(void)
@@ -182,7 +181,6 @@ void __init arch_init_irq(void)
182 int i; 181 int i;
183 unsigned long flags; 182 unsigned long flags;
184 183
185 memset(irq_desc, 0, sizeof(irq_desc));
186 set_except_vector(0, it8172_IRQ); 184 set_except_vector(0, it8172_IRQ);
187 185
188 /* mask all interrupts */ 186 /* mask all interrupts */
diff --git a/arch/mips/ite-boards/generic/it8172_setup.c b/arch/mips/ite-boards/generic/it8172_setup.c
index a5f6d84bc181..062429dd7ca0 100644
--- a/arch/mips/ite-boards/generic/it8172_setup.c
+++ b/arch/mips/ite-boards/generic/it8172_setup.c
@@ -105,7 +105,7 @@ void __init it8172_init_ram_resource(unsigned long memsize)
105 it8172_resources.ram.end = memsize; 105 it8172_resources.ram.end = memsize;
106} 106}
107 107
108static void __init it8172_setup(void) 108void __init plat_setup(void)
109{ 109{
110 unsigned short dsr; 110 unsigned short dsr;
111 char *argptr; 111 char *argptr;
@@ -251,8 +251,6 @@ static void __init it8172_setup(void)
251#endif /* CONFIG_IT8172_SCR1 */ 251#endif /* CONFIG_IT8172_SCR1 */
252} 252}
253 253
254early_initcall(it8172_setup);
255
256#ifdef CONFIG_SERIO_I8042 254#ifdef CONFIG_SERIO_I8042
257/* 255/*
258 * According to the ITE Special BIOS Note for waking up the 256 * According to the ITE Special BIOS Note for waking up the
diff --git a/arch/mips/jazz/Kconfig b/arch/mips/jazz/Kconfig
new file mode 100644
index 000000000000..1f372b0d2559
--- /dev/null
+++ b/arch/mips/jazz/Kconfig
@@ -0,0 +1,33 @@
1config ACER_PICA_61
2 bool "Support for Acer PICA 1 chipset (EXPERIMENTAL)"
3 depends on MACH_JAZZ && EXPERIMENTAL
4 select DMA_NONCOHERENT
5 select SYS_SUPPORTS_LITTLE_ENDIAN
6 help
7 This is a machine with a R4400 133/150 MHz CPU. To compile a Linux
8 kernel that runs on these, say Y here. For details about Linux on
9 the MIPS architecture, check out the Linux/MIPS FAQ on the WWW at
10 <http://www.linux-mips.org/>.
11
12config MIPS_MAGNUM_4000
13 bool "Support for MIPS Magnum 4000"
14 depends on MACH_JAZZ
15 select DMA_NONCOHERENT
16 select SYS_SUPPORTS_BIG_ENDIAN if EXPERIMENTAL
17 select SYS_SUPPORTS_LITTLE_ENDIAN
18 help
19 This is a machine with a R4000 100 MHz CPU. To compile a Linux
20 kernel that runs on these, say Y here. For details about Linux on
21 the MIPS architecture, check out the Linux/MIPS FAQ on the WWW at
22 <http://www.linux-mips.org/>.
23
24config OLIVETTI_M700
25 bool "Support for Olivetti M700-10"
26 depends on MACH_JAZZ
27 select DMA_NONCOHERENT
28 select SYS_SUPPORTS_LITTLE_ENDIAN
29 help
30 This is a machine with a R4000 100 MHz CPU. To compile a Linux
31 kernel that runs on these, say Y here. For details about Linux on
32 the MIPS architecture, check out the Linux/MIPS FAQ on the WWW at
33 <http://www.linux-mips.org/>.
diff --git a/arch/mips/jazz/irq.c b/arch/mips/jazz/irq.c
index 0b608fa98d5a..b309b1bcf2e8 100644
--- a/arch/mips/jazz/irq.c
+++ b/arch/mips/jazz/irq.c
@@ -58,14 +58,13 @@ static void end_r4030_irq(unsigned int irq)
58} 58}
59 59
60static struct hw_interrupt_type r4030_irq_type = { 60static struct hw_interrupt_type r4030_irq_type = {
61 "R4030", 61 .typename = "R4030",
62 startup_r4030_irq, 62 .startup = startup_r4030_irq,
63 shutdown_r4030_irq, 63 .shutdown = shutdown_r4030_irq,
64 enable_r4030_irq, 64 .enable = enable_r4030_irq,
65 disable_r4030_irq, 65 .disable = disable_r4030_irq,
66 mask_and_ack_r4030_irq, 66 .ack = mask_and_ack_r4030_irq,
67 end_r4030_irq, 67 .end = end_r4030_irq,
68 NULL
69}; 68};
70 69
71void __init init_r4030_ints(void) 70void __init init_r4030_ints(void)
diff --git a/arch/mips/jazz/setup.c b/arch/mips/jazz/setup.c
index fccb06fe209d..044df9d4ab7c 100644
--- a/arch/mips/jazz/setup.c
+++ b/arch/mips/jazz/setup.c
@@ -50,7 +50,7 @@ static struct resource jazz_io_resources[] = {
50 { "dma2", 0xc0, 0xdf, IORESOURCE_BUSY }, 50 { "dma2", 0xc0, 0xdf, IORESOURCE_BUSY },
51}; 51};
52 52
53static void __init jazz_setup(void) 53void __init plat_setup(void)
54{ 54{
55 int i; 55 int i;
56 56
@@ -97,5 +97,3 @@ static void __init jazz_setup(void)
97 97
98 vdma_init(); 98 vdma_init();
99} 99}
100
101early_initcall(jazz_setup);
diff --git a/arch/mips/jmr3927/rbhma3100/irq.c b/arch/mips/jmr3927/rbhma3100/irq.c
index b9799b86fc79..7cbe14483f13 100644
--- a/arch/mips/jmr3927/rbhma3100/irq.c
+++ b/arch/mips/jmr3927/rbhma3100/irq.c
@@ -412,13 +412,13 @@ void __init arch_init_irq(void)
412} 412}
413 413
414static hw_irq_controller jmr3927_irq_controller = { 414static hw_irq_controller jmr3927_irq_controller = {
415 "jmr3927_irq", 415 .typename = "jmr3927_irq",
416 jmr3927_irq_startup, 416 .startup = jmr3927_irq_startup,
417 jmr3927_irq_shutdown, 417 .shutdown = jmr3927_irq_shutdown,
418 jmr3927_irq_enable, 418 .enable = jmr3927_irq_enable,
419 jmr3927_irq_disable, 419 .disable = jmr3927_irq_disable,
420 jmr3927_irq_ack, 420 .ack = jmr3927_irq_ack,
421 jmr3927_irq_end, 421 .end = jmr3927_irq_end,
422}; 422};
423 423
424void jmr3927_irq_init(u32 irq_base) 424void jmr3927_irq_init(u32 irq_base)
diff --git a/arch/mips/jmr3927/rbhma3100/setup.c b/arch/mips/jmr3927/rbhma3100/setup.c
index 32039bb2f440..3e2fbdc66097 100644
--- a/arch/mips/jmr3927/rbhma3100/setup.c
+++ b/arch/mips/jmr3927/rbhma3100/setup.c
@@ -44,6 +44,11 @@
44#include <linux/ioport.h> 44#include <linux/ioport.h>
45#include <linux/param.h> /* for HZ */ 45#include <linux/param.h> /* for HZ */
46#include <linux/delay.h> 46#include <linux/delay.h>
47#ifdef CONFIG_SERIAL_TXX9
48#include <linux/tty.h>
49#include <linux/serial.h>
50#include <linux/serial_core.h>
51#endif
47 52
48#include <asm/addrspace.h> 53#include <asm/addrspace.h>
49#include <asm/time.h> 54#include <asm/time.h>
@@ -193,7 +198,7 @@ static void jmr3927_board_init(void);
193extern struct resource pci_io_resource; 198extern struct resource pci_io_resource;
194extern struct resource pci_mem_resource; 199extern struct resource pci_mem_resource;
195 200
196static void __init jmr3927_setup(void) 201void __init plat_setup(void)
197{ 202{
198 char *argptr; 203 char *argptr;
199 204
@@ -211,8 +216,8 @@ static void __init jmr3927_setup(void)
211 */ 216 */
212 ioport_resource.start = pci_io_resource.start; 217 ioport_resource.start = pci_io_resource.start;
213 ioport_resource.end = pci_io_resource.end; 218 ioport_resource.end = pci_io_resource.end;
214 iomem_resource.start = pci_mem_resource.start; 219 iomem_resource.start = 0;
215 iomem_resource.end = pci_mem_resource.end; 220 iomem_resource.end = 0xffffffff;
216 221
217 /* Reboot on panic */ 222 /* Reboot on panic */
218 panic_timeout = 180; 223 panic_timeout = 180;
@@ -265,18 +270,35 @@ static void __init jmr3927_setup(void)
265 strcat(argptr, " ip=bootp"); 270 strcat(argptr, " ip=bootp");
266 } 271 }
267 272
268#ifdef CONFIG_TXX927_SERIAL_CONSOLE 273#ifdef CONFIG_SERIAL_TXX9
274 {
275 extern int early_serial_txx9_setup(struct uart_port *port);
276 int i;
277 struct uart_port req;
278 for(i = 0; i < 2; i++) {
279 memset(&req, 0, sizeof(req));
280 req.line = i;
281 req.iotype = UPIO_MEM;
282 req.membase = (char *)TX3927_SIO_REG(i);
283 req.mapbase = TX3927_SIO_REG(i);
284 req.irq = i == 0 ?
285 JMR3927_IRQ_IRC_SIO0 : JMR3927_IRQ_IRC_SIO1;
286 if (i == 0)
287 req.flags |= UPF_BUGGY_UART /*HAVE_CTS_LINE*/;
288 req.uartclk = JMR3927_IMCLK;
289 early_serial_txx9_setup(&req);
290 }
291 }
292#ifdef CONFIG_SERIAL_TXX9_CONSOLE
269 argptr = prom_getcmdline(); 293 argptr = prom_getcmdline();
270 if ((argptr = strstr(argptr, "console=")) == NULL) { 294 if ((argptr = strstr(argptr, "console=")) == NULL) {
271 argptr = prom_getcmdline(); 295 argptr = prom_getcmdline();
272 strcat(argptr, " console=ttyS1,115200"); 296 strcat(argptr, " console=ttyS1,115200");
273 } 297 }
274#endif 298#endif
299#endif
275} 300}
276 301
277early_initcall(jmr3927_setup);
278
279
280static void tx3927_setup(void); 302static void tx3927_setup(void);
281 303
282#ifdef CONFIG_PCI 304#ifdef CONFIG_PCI
@@ -335,7 +357,7 @@ static void __init jmr3927_board_init(void)
335 jmr3927_io_dipsw()); 357 jmr3927_io_dipsw());
336} 358}
337 359
338static void __init tx3927_setup(void) 360void __init plat_setup(void)
339{ 361{
340 int i; 362 int i;
341 363
diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
index d3303584fbd1..72f2126ad19d 100644
--- a/arch/mips/kernel/Makefile
+++ b/arch/mips/kernel/Makefile
@@ -11,11 +11,7 @@ obj-y += cpu-probe.o branch.o entry.o genex.o irq.o process.o \
11binfmt_irix-objs := irixelf.o irixinv.o irixioctl.o irixsig.o \ 11binfmt_irix-objs := irixelf.o irixinv.o irixioctl.o irixsig.o \
12 irix5sys.o sysirix.o 12 irix5sys.o sysirix.o
13 13
14ifdef CONFIG_MODULES 14obj-$(CONFIG_MODULES) += mips_ksyms.o module.o
15obj-y += mips_ksyms.o module.o
16obj-$(CONFIG_32BIT) += module-elf32.o
17obj-$(CONFIG_64BIT) += module-elf64.o
18endif
19 15
20obj-$(CONFIG_CPU_R3000) += r2300_fpu.o r2300_switch.o 16obj-$(CONFIG_CPU_R3000) += r2300_fpu.o r2300_switch.o
21obj-$(CONFIG_CPU_TX39XX) += r2300_fpu.o r2300_switch.o 17obj-$(CONFIG_CPU_TX39XX) += r2300_fpu.o r2300_switch.o
@@ -38,12 +34,18 @@ obj-$(CONFIG_CPU_R6000) += r6000_fpu.o r4k_switch.o
38 34
39obj-$(CONFIG_SMP) += smp.o 35obj-$(CONFIG_SMP) += smp.o
40 36
37obj-$(CONFIG_MIPS_MT_SMP) += smp_mt.o
38
39obj-$(CONFIG_MIPS_VPE_LOADER) += vpe.o
40obj-$(CONFIG_MIPS_VPE_APSP_API) += rtlx.o
41
41obj-$(CONFIG_NO_ISA) += dma-no-isa.o 42obj-$(CONFIG_NO_ISA) += dma-no-isa.o
42obj-$(CONFIG_I8259) += i8259.o 43obj-$(CONFIG_I8259) += i8259.o
43obj-$(CONFIG_IRQ_CPU) += irq_cpu.o 44obj-$(CONFIG_IRQ_CPU) += irq_cpu.o
44obj-$(CONFIG_IRQ_CPU_RM7K) += irq-rm7000.o 45obj-$(CONFIG_IRQ_CPU_RM7K) += irq-rm7000.o
45obj-$(CONFIG_IRQ_CPU_RM9K) += irq-rm9000.o 46obj-$(CONFIG_IRQ_CPU_RM9K) += irq-rm9000.o
46obj-$(CONFIG_IRQ_MV64340) += irq-mv6434x.o 47obj-$(CONFIG_IRQ_MV64340) += irq-mv6434x.o
48obj-$(CONFIG_MIPS_BOARDS_GEN) += irq-msc01.o
47 49
48obj-$(CONFIG_32BIT) += scall32-o32.o 50obj-$(CONFIG_32BIT) += scall32-o32.o
49obj-$(CONFIG_64BIT) += scall64-64.o 51obj-$(CONFIG_64BIT) += scall64-64.o
@@ -57,8 +59,6 @@ obj-$(CONFIG_PROC_FS) += proc.o
57 59
58obj-$(CONFIG_64BIT) += cpu-bugs64.o 60obj-$(CONFIG_64BIT) += cpu-bugs64.o
59 61
60obj-$(CONFIG_GEN_RTC) += genrtc.o
61
62CFLAGS_cpu-bugs64.o = $(shell if $(CC) $(CFLAGS) -Wa,-mdaddi -c -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi) 62CFLAGS_cpu-bugs64.o = $(shell if $(CC) $(CFLAGS) -Wa,-mdaddi -c -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi)
63CFLAGS_ioctl32.o += -Ifs/ 63CFLAGS_ioctl32.o += -Ifs/
64 64
diff --git a/arch/mips/kernel/asm-offsets.c b/arch/mips/kernel/asm-offsets.c
index 2c11abb5a406..ca6b03c773be 100644
--- a/arch/mips/kernel/asm-offsets.c
+++ b/arch/mips/kernel/asm-offsets.c
@@ -95,6 +95,7 @@ void output_thread_info_defines(void)
95 offset("#define TI_PRE_COUNT ", struct thread_info, preempt_count); 95 offset("#define TI_PRE_COUNT ", struct thread_info, preempt_count);
96 offset("#define TI_ADDR_LIMIT ", struct thread_info, addr_limit); 96 offset("#define TI_ADDR_LIMIT ", struct thread_info, addr_limit);
97 offset("#define TI_RESTART_BLOCK ", struct thread_info, restart_block); 97 offset("#define TI_RESTART_BLOCK ", struct thread_info, restart_block);
98 offset("#define TI_TP_VALUE ", struct thread_info, tp_value);
98 constant("#define _THREAD_SIZE_ORDER ", THREAD_SIZE_ORDER); 99 constant("#define _THREAD_SIZE_ORDER ", THREAD_SIZE_ORDER);
99 constant("#define _THREAD_SIZE ", THREAD_SIZE); 100 constant("#define _THREAD_SIZE ", THREAD_SIZE);
100 constant("#define _THREAD_MASK ", THREAD_MASK); 101 constant("#define _THREAD_MASK ", THREAD_MASK);
@@ -240,6 +241,7 @@ void output_mm_defines(void)
240 linefeed; 241 linefeed;
241} 242}
242 243
244#ifdef CONFIG_32BIT
243void output_sc_defines(void) 245void output_sc_defines(void)
244{ 246{
245 text("/* Linux sigcontext offsets. */"); 247 text("/* Linux sigcontext offsets. */");
@@ -251,10 +253,29 @@ void output_sc_defines(void)
251 offset("#define SC_STATUS ", struct sigcontext, sc_status); 253 offset("#define SC_STATUS ", struct sigcontext, sc_status);
252 offset("#define SC_FPC_CSR ", struct sigcontext, sc_fpc_csr); 254 offset("#define SC_FPC_CSR ", struct sigcontext, sc_fpc_csr);
253 offset("#define SC_FPC_EIR ", struct sigcontext, sc_fpc_eir); 255 offset("#define SC_FPC_EIR ", struct sigcontext, sc_fpc_eir);
254 offset("#define SC_CAUSE ", struct sigcontext, sc_cause); 256 offset("#define SC_HI1 ", struct sigcontext, sc_hi1);
255 offset("#define SC_BADVADDR ", struct sigcontext, sc_badvaddr); 257 offset("#define SC_LO1 ", struct sigcontext, sc_lo1);
258 offset("#define SC_HI2 ", struct sigcontext, sc_hi2);
259 offset("#define SC_LO2 ", struct sigcontext, sc_lo2);
260 offset("#define SC_HI3 ", struct sigcontext, sc_hi3);
261 offset("#define SC_LO3 ", struct sigcontext, sc_lo3);
256 linefeed; 262 linefeed;
257} 263}
264#endif
265
266#ifdef CONFIG_64BIT
267void output_sc_defines(void)
268{
269 text("/* Linux sigcontext offsets. */");
270 offset("#define SC_REGS ", struct sigcontext, sc_regs);
271 offset("#define SC_FPREGS ", struct sigcontext, sc_fpregs);
272 offset("#define SC_MDHI ", struct sigcontext, sc_hi);
273 offset("#define SC_MDLO ", struct sigcontext, sc_lo);
274 offset("#define SC_PC ", struct sigcontext, sc_pc);
275 offset("#define SC_FPC_CSR ", struct sigcontext, sc_fpc_csr);
276 linefeed;
277}
278#endif
258 279
259#ifdef CONFIG_MIPS32_COMPAT 280#ifdef CONFIG_MIPS32_COMPAT
260void output_sc32_defines(void) 281void output_sc32_defines(void)
diff --git a/arch/mips/kernel/binfmt_elfn32.c b/arch/mips/kernel/binfmt_elfn32.c
index 6b645fbb1ddc..d8e2674a1543 100644
--- a/arch/mips/kernel/binfmt_elfn32.c
+++ b/arch/mips/kernel/binfmt_elfn32.c
@@ -52,7 +52,6 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
52 52
53#include <asm/processor.h> 53#include <asm/processor.h>
54#include <linux/module.h> 54#include <linux/module.h>
55#include <linux/config.h>
56#include <linux/elfcore.h> 55#include <linux/elfcore.h>
57#include <linux/compat.h> 56#include <linux/compat.h>
58 57
@@ -116,4 +115,7 @@ MODULE_AUTHOR("Ralf Baechle (ralf@linux-mips.org)");
116#undef MODULE_DESCRIPTION 115#undef MODULE_DESCRIPTION
117#undef MODULE_AUTHOR 116#undef MODULE_AUTHOR
118 117
118#undef TASK_SIZE
119#define TASK_SIZE TASK_SIZE32
120
119#include "../../../fs/binfmt_elf.c" 121#include "../../../fs/binfmt_elf.c"
diff --git a/arch/mips/kernel/binfmt_elfo32.c b/arch/mips/kernel/binfmt_elfo32.c
index b4075e99c452..cec5f327e360 100644
--- a/arch/mips/kernel/binfmt_elfo32.c
+++ b/arch/mips/kernel/binfmt_elfo32.c
@@ -54,7 +54,6 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
54 54
55#include <asm/processor.h> 55#include <asm/processor.h>
56#include <linux/module.h> 56#include <linux/module.h>
57#include <linux/config.h>
58#include <linux/elfcore.h> 57#include <linux/elfcore.h>
59#include <linux/compat.h> 58#include <linux/compat.h>
60 59
@@ -98,7 +97,7 @@ struct elf_prpsinfo32
98#define init_elf_binfmt init_elf32_binfmt 97#define init_elf_binfmt init_elf32_binfmt
99 98
100#define jiffies_to_timeval jiffies_to_compat_timeval 99#define jiffies_to_timeval jiffies_to_compat_timeval
101static __inline__ void 100static inline void
102jiffies_to_compat_timeval(unsigned long jiffies, struct compat_timeval *value) 101jiffies_to_compat_timeval(unsigned long jiffies, struct compat_timeval *value)
103{ 102{
104 /* 103 /*
@@ -113,21 +112,26 @@ jiffies_to_compat_timeval(unsigned long jiffies, struct compat_timeval *value)
113#undef ELF_CORE_COPY_REGS 112#undef ELF_CORE_COPY_REGS
114#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);
115 114
116void elf32_core_copy_regs(elf_gregset_t _dest, struct pt_regs *_regs) 115void elf32_core_copy_regs(elf_gregset_t grp, struct pt_regs *regs)
117{ 116{
118 int i; 117 int i;
119 118
120 memset(_dest, 0, sizeof(elf_gregset_t)); 119 for (i = 0; i < EF_R0; i++)
121 120 grp[i] = 0;
122 /* XXXKW the 6 is from EF_REG0 in gdb/gdb/mips-linux-tdep.c, include/asm-mips/reg.h */ 121 grp[EF_R0] = 0;
123 for (i=6; i<38; i++) 122 for (i = 1; i <= 31; i++)
124 _dest[i] = (elf_greg_t) _regs->regs[i-6]; 123 grp[EF_R0 + i] = (elf_greg_t) regs->regs[i];
125 _dest[i++] = (elf_greg_t) _regs->lo; 124 grp[EF_R26] = 0;
126 _dest[i++] = (elf_greg_t) _regs->hi; 125 grp[EF_R27] = 0;
127 _dest[i++] = (elf_greg_t) _regs->cp0_epc; 126 grp[EF_LO] = (elf_greg_t) regs->lo;
128 _dest[i++] = (elf_greg_t) _regs->cp0_badvaddr; 127 grp[EF_HI] = (elf_greg_t) regs->hi;
129 _dest[i++] = (elf_greg_t) _regs->cp0_status; 128 grp[EF_CP0_EPC] = (elf_greg_t) regs->cp0_epc;
130 _dest[i++] = (elf_greg_t) _regs->cp0_cause; 129 grp[EF_CP0_BADVADDR] = (elf_greg_t) regs->cp0_badvaddr;
130 grp[EF_CP0_STATUS] = (elf_greg_t) regs->cp0_status;
131 grp[EF_CP0_CAUSE] = (elf_greg_t) regs->cp0_cause;
132#ifdef EF_UNUSED0
133 grp[EF_UNUSED0] = 0;
134#endif
131} 135}
132 136
133MODULE_DESCRIPTION("Binary format loader for compatibility with o32 Linux/MIPS binaries"); 137MODULE_DESCRIPTION("Binary format loader for compatibility with o32 Linux/MIPS binaries");
@@ -136,4 +140,7 @@ MODULE_AUTHOR("Ralf Baechle (ralf@linux-mips.org)");
136#undef MODULE_DESCRIPTION 140#undef MODULE_DESCRIPTION
137#undef MODULE_AUTHOR 141#undef MODULE_AUTHOR
138 142
143#undef TASK_SIZE
144#define TASK_SIZE TASK_SIZE32
145
139#include "../../../fs/binfmt_elf.c" 146#include "../../../fs/binfmt_elf.c"
diff --git a/arch/mips/kernel/branch.c b/arch/mips/kernel/branch.c
index 01117e977a7f..374de839558d 100644
--- a/arch/mips/kernel/branch.c
+++ b/arch/mips/kernel/branch.c
@@ -12,6 +12,7 @@
12#include <asm/branch.h> 12#include <asm/branch.h>
13#include <asm/cpu.h> 13#include <asm/cpu.h>
14#include <asm/cpu-features.h> 14#include <asm/cpu-features.h>
15#include <asm/fpu.h>
15#include <asm/inst.h> 16#include <asm/inst.h>
16#include <asm/ptrace.h> 17#include <asm/ptrace.h>
17#include <asm/uaccess.h> 18#include <asm/uaccess.h>
@@ -21,7 +22,7 @@
21 */ 22 */
22int __compute_return_epc(struct pt_regs *regs) 23int __compute_return_epc(struct pt_regs *regs)
23{ 24{
24 unsigned int *addr, bit, fcr31; 25 unsigned int *addr, bit, fcr31, dspcontrol;
25 long epc; 26 long epc;
26 union mips_instruction insn; 27 union mips_instruction insn;
27 28
@@ -98,6 +99,18 @@ int __compute_return_epc(struct pt_regs *regs)
98 epc += 8; 99 epc += 8;
99 regs->cp0_epc = epc; 100 regs->cp0_epc = epc;
100 break; 101 break;
102 case bposge32_op:
103 if (!cpu_has_dsp)
104 goto sigill;
105
106 dspcontrol = rddsp(0x01);
107
108 if (dspcontrol >= 32) {
109 epc = epc + 4 + (insn.i_format.simmediate << 2);
110 } else
111 epc += 8;
112 regs->cp0_epc = epc;
113 break;
101 } 114 }
102 break; 115 break;
103 116
@@ -161,10 +174,13 @@ int __compute_return_epc(struct pt_regs *regs)
161 * And now the FPA/cp1 branch instructions. 174 * And now the FPA/cp1 branch instructions.
162 */ 175 */
163 case cop1_op: 176 case cop1_op:
164 if (!cpu_has_fpu) 177 preempt_disable();
165 fcr31 = current->thread.fpu.soft.fcr31; 178 if (is_fpu_owner())
166 else
167 asm volatile("cfc1\t%0,$31" : "=r" (fcr31)); 179 asm volatile("cfc1\t%0,$31" : "=r" (fcr31));
180 else
181 fcr31 = current->thread.fpu.hard.fcr31;
182 preempt_enable();
183
168 bit = (insn.i_format.rt >> 2); 184 bit = (insn.i_format.rt >> 2);
169 bit += (bit != 0); 185 bit += (bit != 0);
170 bit += 23; 186 bit += 23;
@@ -196,4 +212,9 @@ unaligned:
196 printk("%s: unaligned epc - sending SIGBUS.\n", current->comm); 212 printk("%s: unaligned epc - sending SIGBUS.\n", current->comm);
197 force_sig(SIGBUS, current); 213 force_sig(SIGBUS, current);
198 return -EFAULT; 214 return -EFAULT;
215
216sigill:
217 printk("%s: DSP branch but not DSP ASE - sending SIGBUS.\n", current->comm);
218 force_sig(SIGBUS, current);
219 return -EFAULT;
199} 220}
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index 7685f8baf3f0..a263fb7a3971 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -2,9 +2,9 @@
2 * Processor capabilities determination functions. 2 * Processor capabilities determination functions.
3 * 3 *
4 * Copyright (C) xxxx the Anonymous 4 * Copyright (C) xxxx the Anonymous
5 * Copyright (C) 2003 Maciej W. Rozycki 5 * Copyright (C) 2003, 2004 Maciej W. Rozycki
6 * Copyright (C) 1994 - 2003 Ralf Baechle 6 * Copyright (C) 1994 - 2003 Ralf Baechle
7 * Copyright (C) 2001 MIPS Inc. 7 * Copyright (C) 2001, 2004 MIPS Inc.
8 * 8 *
9 * This program is free software; you can redistribute it and/or 9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License 10 * modify it under the terms of the GNU General Public License
@@ -17,7 +17,6 @@
17#include <linux/ptrace.h> 17#include <linux/ptrace.h>
18#include <linux/stddef.h> 18#include <linux/stddef.h>
19 19
20#include <asm/bugs.h>
21#include <asm/cpu.h> 20#include <asm/cpu.h>
22#include <asm/fpu.h> 21#include <asm/fpu.h>
23#include <asm/mipsregs.h> 22#include <asm/mipsregs.h>
@@ -51,36 +50,48 @@ static void r4k_wait(void)
51 ".set\tmips0"); 50 ".set\tmips0");
52} 51}
53 52
54/* 53/* The Au1xxx wait is available only if using 32khz counter or
55 * The Au1xxx wait is available only if we run CONFIG_PM and 54 * external timer source, but specifically not CP0 Counter. */
56 * the timer setup found we had a 32KHz counter available. 55int allow_au1k_wait;
57 * There are still problems with functions that may call au1k_wait
58 * directly, but that will be discovered pretty quickly.
59 */
60extern void (*au1k_wait_ptr)(void);
61 56
62void au1k_wait(void) 57static void au1k_wait(void)
63{ 58{
64#ifdef CONFIG_PM
65 /* using the wait instruction makes CP0 counter unusable */ 59 /* using the wait instruction makes CP0 counter unusable */
66 __asm__(".set\tmips3\n\t" 60 __asm__(".set mips3\n\t"
61 "cache 0x14, 0(%0)\n\t"
62 "cache 0x14, 32(%0)\n\t"
63 "sync\n\t"
64 "nop\n\t"
67 "wait\n\t" 65 "wait\n\t"
68 "nop\n\t" 66 "nop\n\t"
69 "nop\n\t" 67 "nop\n\t"
70 "nop\n\t" 68 "nop\n\t"
71 "nop\n\t" 69 "nop\n\t"
72 ".set\tmips0"); 70 ".set mips0\n\t"
73#else 71 : : "r" (au1k_wait));
74 __asm__("nop\n\t"
75 "nop");
76#endif
77} 72}
78 73
74static int __initdata nowait = 0;
75
76int __init wait_disable(char *s)
77{
78 nowait = 1;
79
80 return 1;
81}
82
83__setup("nowait", wait_disable);
84
79static inline void check_wait(void) 85static inline void check_wait(void)
80{ 86{
81 struct cpuinfo_mips *c = &current_cpu_data; 87 struct cpuinfo_mips *c = &current_cpu_data;
82 88
83 printk("Checking for 'wait' instruction... "); 89 printk("Checking for 'wait' instruction... ");
90 if (nowait) {
91 printk (" disabled.\n");
92 return;
93 }
94
84 switch (c->cputype) { 95 switch (c->cputype) {
85 case CPU_R3081: 96 case CPU_R3081:
86 case CPU_R3081E: 97 case CPU_R3081E:
@@ -109,22 +120,22 @@ static inline void check_wait(void)
109/* case CPU_20KC:*/ 120/* case CPU_20KC:*/
110 case CPU_24K: 121 case CPU_24K:
111 case CPU_25KF: 122 case CPU_25KF:
123 case CPU_34K:
124 case CPU_PR4450:
112 cpu_wait = r4k_wait; 125 cpu_wait = r4k_wait;
113 printk(" available.\n"); 126 printk(" available.\n");
114 break; 127 break;
115#ifdef CONFIG_PM
116 case CPU_AU1000: 128 case CPU_AU1000:
117 case CPU_AU1100: 129 case CPU_AU1100:
118 case CPU_AU1500: 130 case CPU_AU1500:
119 if (au1k_wait_ptr != NULL) { 131 case CPU_AU1550:
120 cpu_wait = au1k_wait_ptr; 132 case CPU_AU1200:
133 if (allow_au1k_wait) {
134 cpu_wait = au1k_wait;
121 printk(" available.\n"); 135 printk(" available.\n");
122 } 136 } else
123 else {
124 printk(" unavailable.\n"); 137 printk(" unavailable.\n");
125 }
126 break; 138 break;
127#endif
128 default: 139 default:
129 printk(" unavailable.\n"); 140 printk(" unavailable.\n");
130 break; 141 break;
@@ -180,7 +191,7 @@ static inline int __cpu_has_fpu(void)
180 return ((cpu_get_fpu_id() & 0xff00) != FPIR_IMP_NONE); 191 return ((cpu_get_fpu_id() & 0xff00) != FPIR_IMP_NONE);
181} 192}
182 193
183#define R4K_OPTS (MIPS_CPU_TLB | MIPS_CPU_4KEX | MIPS_CPU_4KTLB \ 194#define R4K_OPTS (MIPS_CPU_TLB | MIPS_CPU_4KEX | MIPS_CPU_4K_CACHE \
184 | MIPS_CPU_COUNTER) 195 | MIPS_CPU_COUNTER)
185 196
186static inline void cpu_probe_legacy(struct cpuinfo_mips *c) 197static inline void cpu_probe_legacy(struct cpuinfo_mips *c)
@@ -189,7 +200,8 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c)
189 case PRID_IMP_R2000: 200 case PRID_IMP_R2000:
190 c->cputype = CPU_R2000; 201 c->cputype = CPU_R2000;
191 c->isa_level = MIPS_CPU_ISA_I; 202 c->isa_level = MIPS_CPU_ISA_I;
192 c->options = MIPS_CPU_TLB | MIPS_CPU_NOFPUEX; 203 c->options = MIPS_CPU_TLB | MIPS_CPU_3K_CACHE |
204 MIPS_CPU_NOFPUEX;
193 if (__cpu_has_fpu()) 205 if (__cpu_has_fpu())
194 c->options |= MIPS_CPU_FPU; 206 c->options |= MIPS_CPU_FPU;
195 c->tlbsize = 64; 207 c->tlbsize = 64;
@@ -203,7 +215,8 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c)
203 else 215 else
204 c->cputype = CPU_R3000; 216 c->cputype = CPU_R3000;
205 c->isa_level = MIPS_CPU_ISA_I; 217 c->isa_level = MIPS_CPU_ISA_I;
206 c->options = MIPS_CPU_TLB | MIPS_CPU_NOFPUEX; 218 c->options = MIPS_CPU_TLB | MIPS_CPU_3K_CACHE |
219 MIPS_CPU_NOFPUEX;
207 if (__cpu_has_fpu()) 220 if (__cpu_has_fpu())
208 c->options |= MIPS_CPU_FPU; 221 c->options |= MIPS_CPU_FPU;
209 c->tlbsize = 64; 222 c->tlbsize = 64;
@@ -266,7 +279,8 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c)
266 case PRID_IMP_R4600: 279 case PRID_IMP_R4600:
267 c->cputype = CPU_R4600; 280 c->cputype = CPU_R4600;
268 c->isa_level = MIPS_CPU_ISA_III; 281 c->isa_level = MIPS_CPU_ISA_III;
269 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_LLSC; 282 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
283 MIPS_CPU_LLSC;
270 c->tlbsize = 48; 284 c->tlbsize = 48;
271 break; 285 break;
272 #if 0 286 #if 0
@@ -285,7 +299,7 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c)
285 #endif 299 #endif
286 case PRID_IMP_TX39: 300 case PRID_IMP_TX39:
287 c->isa_level = MIPS_CPU_ISA_I; 301 c->isa_level = MIPS_CPU_ISA_I;
288 c->options = MIPS_CPU_TLB; 302 c->options = MIPS_CPU_TLB | MIPS_CPU_TX39_CACHE;
289 303
290 if ((c->processor_id & 0xf0) == (PRID_REV_TX3927 & 0xf0)) { 304 if ((c->processor_id & 0xf0) == (PRID_REV_TX3927 & 0xf0)) {
291 c->cputype = CPU_TX3927; 305 c->cputype = CPU_TX3927;
@@ -421,74 +435,147 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c)
421 } 435 }
422} 436}
423 437
424static inline void decode_config1(struct cpuinfo_mips *c) 438static inline unsigned int decode_config0(struct cpuinfo_mips *c)
425{ 439{
426 unsigned long config0 = read_c0_config(); 440 unsigned int config0;
427 unsigned long config1; 441 int isa;
442
443 config0 = read_c0_config();
428 444
429 if ((config0 & (1 << 31)) == 0) 445 if (((config0 & MIPS_CONF_MT) >> 7) == 1)
430 return; /* actually wort a panic() */ 446 c->options |= MIPS_CPU_TLB;
447 isa = (config0 & MIPS_CONF_AT) >> 13;
448 switch (isa) {
449 case 0:
450 c->isa_level = MIPS_CPU_ISA_M32;
451 break;
452 case 2:
453 c->isa_level = MIPS_CPU_ISA_M64;
454 break;
455 default:
456 panic("Unsupported ISA type, cp0.config0.at: %d.", isa);
457 }
458
459 return config0 & MIPS_CONF_M;
460}
461
462static inline unsigned int decode_config1(struct cpuinfo_mips *c)
463{
464 unsigned int config1;
431 465
432 /* MIPS32 or MIPS64 compliant CPU. Read Config 1 register. */
433 c->options = MIPS_CPU_TLB | MIPS_CPU_4KEX |
434 MIPS_CPU_4KTLB | MIPS_CPU_COUNTER | MIPS_CPU_DIVEC |
435 MIPS_CPU_LLSC | MIPS_CPU_MCHECK;
436 config1 = read_c0_config1(); 466 config1 = read_c0_config1();
437 if (config1 & (1 << 3)) 467
468 if (config1 & MIPS_CONF1_MD)
469 c->ases |= MIPS_ASE_MDMX;
470 if (config1 & MIPS_CONF1_WR)
438 c->options |= MIPS_CPU_WATCH; 471 c->options |= MIPS_CPU_WATCH;
439 if (config1 & (1 << 2)) 472 if (config1 & MIPS_CONF1_CA)
440 c->options |= MIPS_CPU_MIPS16; 473 c->ases |= MIPS_ASE_MIPS16;
441 if (config1 & (1 << 1)) 474 if (config1 & MIPS_CONF1_EP)
442 c->options |= MIPS_CPU_EJTAG; 475 c->options |= MIPS_CPU_EJTAG;
443 if (config1 & 1) { 476 if (config1 & MIPS_CONF1_FP) {
444 c->options |= MIPS_CPU_FPU; 477 c->options |= MIPS_CPU_FPU;
445 c->options |= MIPS_CPU_32FPR; 478 c->options |= MIPS_CPU_32FPR;
446 } 479 }
480 if (cpu_has_tlb)
481 c->tlbsize = ((config1 & MIPS_CONF1_TLBS) >> 25) + 1;
482
483 return config1 & MIPS_CONF_M;
484}
485
486static inline unsigned int decode_config2(struct cpuinfo_mips *c)
487{
488 unsigned int config2;
489
490 config2 = read_c0_config2();
491
492 if (config2 & MIPS_CONF2_SL)
493 c->scache.flags &= ~MIPS_CACHE_NOT_PRESENT;
494
495 return config2 & MIPS_CONF_M;
496}
497
498static inline unsigned int decode_config3(struct cpuinfo_mips *c)
499{
500 unsigned int config3;
501
502 config3 = read_c0_config3();
503
504 if (config3 & MIPS_CONF3_SM)
505 c->ases |= MIPS_ASE_SMARTMIPS;
506 if (config3 & MIPS_CONF3_DSP)
507 c->ases |= MIPS_ASE_DSP;
508 if (config3 & MIPS_CONF3_VINT)
509 c->options |= MIPS_CPU_VINT;
510 if (config3 & MIPS_CONF3_VEIC)
511 c->options |= MIPS_CPU_VEIC;
512 if (config3 & MIPS_CONF3_MT)
513 c->ases |= MIPS_ASE_MIPSMT;
514
515 return config3 & MIPS_CONF_M;
516}
517
518static inline void decode_configs(struct cpuinfo_mips *c)
519{
520 /* MIPS32 or MIPS64 compliant CPU. */
521 c->options = MIPS_CPU_4KEX | MIPS_CPU_4K_CACHE | MIPS_CPU_COUNTER |
522 MIPS_CPU_DIVEC | MIPS_CPU_LLSC | MIPS_CPU_MCHECK;
523
447 c->scache.flags = MIPS_CACHE_NOT_PRESENT; 524 c->scache.flags = MIPS_CACHE_NOT_PRESENT;
448 525
449 c->tlbsize = ((config1 >> 25) & 0x3f) + 1; 526 /* Read Config registers. */
527 if (!decode_config0(c))
528 return; /* actually worth a panic() */
529 if (!decode_config1(c))
530 return;
531 if (!decode_config2(c))
532 return;
533 if (!decode_config3(c))
534 return;
450} 535}
451 536
452static inline void cpu_probe_mips(struct cpuinfo_mips *c) 537static inline void cpu_probe_mips(struct cpuinfo_mips *c)
453{ 538{
454 decode_config1(c); 539 decode_configs(c);
455 switch (c->processor_id & 0xff00) { 540 switch (c->processor_id & 0xff00) {
456 case PRID_IMP_4KC: 541 case PRID_IMP_4KC:
457 c->cputype = CPU_4KC; 542 c->cputype = CPU_4KC;
458 c->isa_level = MIPS_CPU_ISA_M32;
459 break; 543 break;
460 case PRID_IMP_4KEC: 544 case PRID_IMP_4KEC:
461 c->cputype = CPU_4KEC; 545 c->cputype = CPU_4KEC;
462 c->isa_level = MIPS_CPU_ISA_M32; 546 break;
547 case PRID_IMP_4KECR2:
548 c->cputype = CPU_4KEC;
463 break; 549 break;
464 case PRID_IMP_4KSC: 550 case PRID_IMP_4KSC:
551 case PRID_IMP_4KSD:
465 c->cputype = CPU_4KSC; 552 c->cputype = CPU_4KSC;
466 c->isa_level = MIPS_CPU_ISA_M32;
467 break; 553 break;
468 case PRID_IMP_5KC: 554 case PRID_IMP_5KC:
469 c->cputype = CPU_5KC; 555 c->cputype = CPU_5KC;
470 c->isa_level = MIPS_CPU_ISA_M64;
471 break; 556 break;
472 case PRID_IMP_20KC: 557 case PRID_IMP_20KC:
473 c->cputype = CPU_20KC; 558 c->cputype = CPU_20KC;
474 c->isa_level = MIPS_CPU_ISA_M64;
475 break; 559 break;
476 case PRID_IMP_24K: 560 case PRID_IMP_24K:
561 case PRID_IMP_24KE:
477 c->cputype = CPU_24K; 562 c->cputype = CPU_24K;
478 c->isa_level = MIPS_CPU_ISA_M32;
479 break; 563 break;
480 case PRID_IMP_25KF: 564 case PRID_IMP_25KF:
481 c->cputype = CPU_25KF; 565 c->cputype = CPU_25KF;
482 c->isa_level = MIPS_CPU_ISA_M64;
483 /* Probe for L2 cache */ 566 /* Probe for L2 cache */
484 c->scache.flags &= ~MIPS_CACHE_NOT_PRESENT; 567 c->scache.flags &= ~MIPS_CACHE_NOT_PRESENT;
485 break; 568 break;
569 case PRID_IMP_34K:
570 c->cputype = CPU_34K;
571 c->isa_level = MIPS_CPU_ISA_M32;
572 break;
486 } 573 }
487} 574}
488 575
489static inline void cpu_probe_alchemy(struct cpuinfo_mips *c) 576static inline void cpu_probe_alchemy(struct cpuinfo_mips *c)
490{ 577{
491 decode_config1(c); 578 decode_configs(c);
492 switch (c->processor_id & 0xff00) { 579 switch (c->processor_id & 0xff00) {
493 case PRID_IMP_AU1_REV1: 580 case PRID_IMP_AU1_REV1:
494 case PRID_IMP_AU1_REV2: 581 case PRID_IMP_AU1_REV2:
@@ -505,50 +592,70 @@ static inline void cpu_probe_alchemy(struct cpuinfo_mips *c)
505 case 3: 592 case 3:
506 c->cputype = CPU_AU1550; 593 c->cputype = CPU_AU1550;
507 break; 594 break;
595 case 4:
596 c->cputype = CPU_AU1200;
597 break;
508 default: 598 default:
509 panic("Unknown Au Core!"); 599 panic("Unknown Au Core!");
510 break; 600 break;
511 } 601 }
512 c->isa_level = MIPS_CPU_ISA_M32;
513 break; 602 break;
514 } 603 }
515} 604}
516 605
517static inline void cpu_probe_sibyte(struct cpuinfo_mips *c) 606static inline void cpu_probe_sibyte(struct cpuinfo_mips *c)
518{ 607{
519 decode_config1(c); 608 decode_configs(c);
609
610 /*
611 * For historical reasons the SB1 comes with it's own variant of
612 * cache code which eventually will be folded into c-r4k.c. Until
613 * then we pretend it's got it's own cache architecture.
614 */
615 c->options &= ~MIPS_CPU_4K_CACHE;
616 c->options |= MIPS_CPU_SB1_CACHE;
617
520 switch (c->processor_id & 0xff00) { 618 switch (c->processor_id & 0xff00) {
521 case PRID_IMP_SB1: 619 case PRID_IMP_SB1:
522 c->cputype = CPU_SB1; 620 c->cputype = CPU_SB1;
523 c->isa_level = MIPS_CPU_ISA_M64; 621#ifdef CONFIG_SB1_PASS_1_WORKAROUNDS
524 c->options = MIPS_CPU_TLB | MIPS_CPU_4KEX |
525 MIPS_CPU_COUNTER | MIPS_CPU_DIVEC |
526 MIPS_CPU_MCHECK | MIPS_CPU_EJTAG |
527 MIPS_CPU_WATCH | MIPS_CPU_LLSC;
528#ifndef CONFIG_SB1_PASS_1_WORKAROUNDS
529 /* FPU in pass1 is known to have issues. */ 622 /* FPU in pass1 is known to have issues. */
530 c->options |= MIPS_CPU_FPU | MIPS_CPU_32FPR; 623 c->options &= ~(MIPS_CPU_FPU | MIPS_CPU_32FPR);
531#endif 624#endif
532 break; 625 break;
626 case PRID_IMP_SB1A:
627 c->cputype = CPU_SB1A;
628 break;
533 } 629 }
534} 630}
535 631
536static inline void cpu_probe_sandcraft(struct cpuinfo_mips *c) 632static inline void cpu_probe_sandcraft(struct cpuinfo_mips *c)
537{ 633{
538 decode_config1(c); 634 decode_configs(c);
539 switch (c->processor_id & 0xff00) { 635 switch (c->processor_id & 0xff00) {
540 case PRID_IMP_SR71000: 636 case PRID_IMP_SR71000:
541 c->cputype = CPU_SR71000; 637 c->cputype = CPU_SR71000;
542 c->isa_level = MIPS_CPU_ISA_M64;
543 c->options = MIPS_CPU_TLB | MIPS_CPU_4KEX |
544 MIPS_CPU_4KTLB | MIPS_CPU_FPU |
545 MIPS_CPU_COUNTER | MIPS_CPU_MCHECK;
546 c->scache.ways = 8; 638 c->scache.ways = 8;
547 c->tlbsize = 64; 639 c->tlbsize = 64;
548 break; 640 break;
549 } 641 }
550} 642}
551 643
644static inline void cpu_probe_philips(struct cpuinfo_mips *c)
645{
646 decode_configs(c);
647 switch (c->processor_id & 0xff00) {
648 case PRID_IMP_PR4450:
649 c->cputype = CPU_PR4450;
650 c->isa_level = MIPS_CPU_ISA_M32;
651 break;
652 default:
653 panic("Unknown Philips Core!"); /* REVISIT: die? */
654 break;
655 }
656}
657
658
552__init void cpu_probe(void) 659__init void cpu_probe(void)
553{ 660{
554 struct cpuinfo_mips *c = &current_cpu_data; 661 struct cpuinfo_mips *c = &current_cpu_data;
@@ -571,15 +678,24 @@ __init void cpu_probe(void)
571 case PRID_COMP_SIBYTE: 678 case PRID_COMP_SIBYTE:
572 cpu_probe_sibyte(c); 679 cpu_probe_sibyte(c);
573 break; 680 break;
574
575 case PRID_COMP_SANDCRAFT: 681 case PRID_COMP_SANDCRAFT:
576 cpu_probe_sandcraft(c); 682 cpu_probe_sandcraft(c);
577 break; 683 break;
684 case PRID_COMP_PHILIPS:
685 cpu_probe_philips(c);
686 break;
578 default: 687 default:
579 c->cputype = CPU_UNKNOWN; 688 c->cputype = CPU_UNKNOWN;
580 } 689 }
581 if (c->options & MIPS_CPU_FPU) 690 if (c->options & MIPS_CPU_FPU) {
582 c->fpu_id = cpu_get_fpu_id(); 691 c->fpu_id = cpu_get_fpu_id();
692
693 if (c->isa_level == MIPS_CPU_ISA_M32 ||
694 c->isa_level == MIPS_CPU_ISA_M64) {
695 if (c->fpu_id & MIPS_FPIR_3D)
696 c->ases |= MIPS_ASE_MIPS3D;
697 }
698 }
583} 699}
584 700
585__init void cpu_report(void) 701__init void cpu_report(void)
diff --git a/arch/mips/kernel/dma-no-isa.c b/arch/mips/kernel/dma-no-isa.c
new file mode 100644
index 000000000000..6df8b07741e3
--- /dev/null
+++ b/arch/mips/kernel/dma-no-isa.c
@@ -0,0 +1,28 @@
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) 2004 by Ralf Baechle
7 *
8 * Dummy ISA DMA functions for systems that don't have ISA but share drivers
9 * with ISA such as legacy free PCI.
10 */
11#include <linux/errno.h>
12#include <linux/module.h>
13#include <linux/spinlock.h>
14
15DEFINE_SPINLOCK(dma_spin_lock);
16
17int request_dma(unsigned int dmanr, const char * device_id)
18{
19 return -EINVAL;
20}
21
22void free_dma(unsigned int dmanr)
23{
24}
25
26EXPORT_SYMBOL(dma_spin_lock);
27EXPORT_SYMBOL(request_dma);
28EXPORT_SYMBOL(free_dma);
diff --git a/arch/mips/kernel/entry.S b/arch/mips/kernel/entry.S
index 5eb429137e06..83c87fe4ee4f 100644
--- a/arch/mips/kernel/entry.S
+++ b/arch/mips/kernel/entry.S
@@ -19,11 +19,11 @@
19#include <asm/war.h> 19#include <asm/war.h>
20 20
21#ifdef CONFIG_PREEMPT 21#ifdef CONFIG_PREEMPT
22 .macro preempt_stop reg=t0 22 .macro preempt_stop
23 .endm 23 .endm
24#else 24#else
25 .macro preempt_stop reg=t0 25 .macro preempt_stop
26 local_irq_disable \reg 26 local_irq_disable
27 .endm 27 .endm
28#define resume_kernel restore_all 28#define resume_kernel restore_all
29#endif 29#endif
@@ -37,17 +37,18 @@ FEXPORT(ret_from_irq)
37 andi t0, t0, KU_USER 37 andi t0, t0, KU_USER
38 beqz t0, resume_kernel 38 beqz t0, resume_kernel
39 39
40FEXPORT(resume_userspace) 40resume_userspace:
41 local_irq_disable t0 # make sure we dont miss an 41 local_irq_disable # make sure we dont miss an
42 # interrupt setting need_resched 42 # interrupt setting need_resched
43 # between sampling and return 43 # between sampling and return
44 LONG_L a2, TI_FLAGS($28) # current->work 44 LONG_L a2, TI_FLAGS($28) # current->work
45 andi a2, _TIF_WORK_MASK # (ignoring syscall_trace) 45 andi t0, a2, _TIF_WORK_MASK # (ignoring syscall_trace)
46 bnez a2, work_pending 46 bnez t0, work_pending
47 j restore_all 47 j restore_all
48 48
49#ifdef CONFIG_PREEMPT 49#ifdef CONFIG_PREEMPT
50ENTRY(resume_kernel) 50resume_kernel:
51 local_irq_disable
51 lw t0, TI_PRE_COUNT($28) 52 lw t0, TI_PRE_COUNT($28)
52 bnez t0, restore_all 53 bnez t0, restore_all
53need_resched: 54need_resched:
@@ -57,12 +58,7 @@ need_resched:
57 LONG_L t0, PT_STATUS(sp) # Interrupts off? 58 LONG_L t0, PT_STATUS(sp) # Interrupts off?
58 andi t0, 1 59 andi t0, 1
59 beqz t0, restore_all 60 beqz t0, restore_all
60 li t0, PREEMPT_ACTIVE 61 jal preempt_schedule_irq
61 sw t0, TI_PRE_COUNT($28)
62 local_irq_enable t0
63 jal schedule
64 sw zero, TI_PRE_COUNT($28)
65 local_irq_disable t0
66 b need_resched 62 b need_resched
67#endif 63#endif
68 64
@@ -88,13 +84,13 @@ FEXPORT(restore_partial) # restore partial frame
88 RESTORE_SP_AND_RET 84 RESTORE_SP_AND_RET
89 .set at 85 .set at
90 86
91FEXPORT(work_pending) 87work_pending:
92 andi t0, a2, _TIF_NEED_RESCHED 88 andi t0, a2, _TIF_NEED_RESCHED # a2 is preloaded with TI_FLAGS
93 beqz t0, work_notifysig 89 beqz t0, work_notifysig
94work_resched: 90work_resched:
95 jal schedule 91 jal schedule
96 92
97 local_irq_disable t0 # make sure need_resched and 93 local_irq_disable # make sure need_resched and
98 # signals dont change between 94 # signals dont change between
99 # sampling and return 95 # sampling and return
100 LONG_L a2, TI_FLAGS($28) 96 LONG_L a2, TI_FLAGS($28)
@@ -109,15 +105,14 @@ work_notifysig: # deal with pending signals and
109 move a0, sp 105 move a0, sp
110 li a1, 0 106 li a1, 0
111 jal do_notify_resume # a2 already loaded 107 jal do_notify_resume # a2 already loaded
112 j restore_all 108 j resume_userspace
113 109
114FEXPORT(syscall_exit_work_partial) 110FEXPORT(syscall_exit_work_partial)
115 SAVE_STATIC 111 SAVE_STATIC
116FEXPORT(syscall_exit_work) 112syscall_exit_work:
117 LONG_L t0, TI_FLAGS($28) 113 li t0, _TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT
118 li t1, _TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT 114 and t0, a2 # a2 is preloaded with TI_FLAGS
119 and t0, t1 115 beqz t0, work_pending # trace bit set?
120 beqz t0, work_pending # trace bit is set
121 local_irq_enable # could let do_syscall_trace() 116 local_irq_enable # could let do_syscall_trace()
122 # call schedule() instead 117 # call schedule() instead
123 move a0, sp 118 move a0, sp
@@ -128,28 +123,25 @@ FEXPORT(syscall_exit_work)
128/* 123/*
129 * Common spurious interrupt handler. 124 * Common spurious interrupt handler.
130 */ 125 */
131 .text
132 .align 5
133LEAF(spurious_interrupt) 126LEAF(spurious_interrupt)
134 /* 127 /*
135 * Someone tried to fool us by sending an interrupt but we 128 * Someone tried to fool us by sending an interrupt but we
136 * couldn't find a cause for it. 129 * couldn't find a cause for it.
137 */ 130 */
131 PTR_LA t1, irq_err_count
138#ifdef CONFIG_SMP 132#ifdef CONFIG_SMP
139 lui t1, %hi(irq_err_count) 1331: ll t0, (t1)
1401: ll t0, %lo(irq_err_count)(t1)
141 addiu t0, 1 134 addiu t0, 1
142 sc t0, %lo(irq_err_count)(t1) 135 sc t0, (t1)
143#if R10000_LLSC_WAR 136#if R10000_LLSC_WAR
144 beqzl t0, 1b 137 beqzl t0, 1b
145#else 138#else
146 beqz t0, 1b 139 beqz t0, 1b
147#endif 140#endif
148#else 141#else
149 lui t1, %hi(irq_err_count) 142 lw t0, (t1)
150 lw t0, %lo(irq_err_count)(t1)
151 addiu t0, 1 143 addiu t0, 1
152 sw t0, %lo(irq_err_count)(t1) 144 sw t0, (t1)
153#endif 145#endif
154 j ret_from_irq 146 j ret_from_irq
155 END(spurious_interrupt) 147 END(spurious_interrupt)
diff --git a/arch/mips/kernel/gdb-low.S b/arch/mips/kernel/gdb-low.S
index 512bedbfa7b9..83b8986f9401 100644
--- a/arch/mips/kernel/gdb-low.S
+++ b/arch/mips/kernel/gdb-low.S
@@ -52,16 +52,15 @@
52 /* 52 /*
53 * Called from user mode, go somewhere else. 53 * Called from user mode, go somewhere else.
54 */ 54 */
55 lui k1, %hi(saved_vectors)
56 mfc0 k0, CP0_CAUSE 55 mfc0 k0, CP0_CAUSE
57 andi k0, k0, 0x7c 56 andi k0, k0, 0x7c
58 add k1, k1, k0 57 add k1, k1, k0
59 lw k0, %lo(saved_vectors)(k1) 58 PTR_L k0, saved_vectors(k1)
60 jr k0 59 jr k0
61 nop 60 nop
621: 611:
63 move k0, sp 62 move k0, sp
64 subu sp, k1, GDB_FR_SIZE*2 # see comment above 63 PTR_SUBU sp, k1, GDB_FR_SIZE*2 # see comment above
65 LONG_S k0, GDB_FR_REG29(sp) 64 LONG_S k0, GDB_FR_REG29(sp)
66 LONG_S $2, GDB_FR_REG2(sp) 65 LONG_S $2, GDB_FR_REG2(sp)
67 66
diff --git a/arch/mips/kernel/gdb-stub.c b/arch/mips/kernel/gdb-stub.c
index d3fd1ab14274..96d18c43dca0 100644
--- a/arch/mips/kernel/gdb-stub.c
+++ b/arch/mips/kernel/gdb-stub.c
@@ -176,8 +176,10 @@ int kgdb_enabled;
176/* 176/*
177 * spin locks for smp case 177 * spin locks for smp case
178 */ 178 */
179static spinlock_t kgdb_lock = SPIN_LOCK_UNLOCKED; 179static DEFINE_SPINLOCK(kgdb_lock);
180static spinlock_t kgdb_cpulock[NR_CPUS] = { [0 ... NR_CPUS-1] = SPIN_LOCK_UNLOCKED}; 180static raw_spinlock_t kgdb_cpulock[NR_CPUS] = {
181 [0 ... NR_CPUS-1] = __RAW_SPIN_LOCK_UNLOCKED;
182};
181 183
182/* 184/*
183 * BUFMAX defines the maximum number of characters in inbound/outbound buffers 185 * BUFMAX defines the maximum number of characters in inbound/outbound buffers
@@ -637,29 +639,32 @@ static struct gdb_bp_save async_bp;
637 * and only one can be active at a time. 639 * and only one can be active at a time.
638 */ 640 */
639extern spinlock_t smp_call_lock; 641extern spinlock_t smp_call_lock;
642
640void set_async_breakpoint(unsigned long *epc) 643void set_async_breakpoint(unsigned long *epc)
641{ 644{
642 /* skip breaking into userland */ 645 /* skip breaking into userland */
643 if ((*epc & 0x80000000) == 0) 646 if ((*epc & 0x80000000) == 0)
644 return; 647 return;
645 648
649#ifdef CONFIG_SMP
646 /* avoid deadlock if someone is make IPC */ 650 /* avoid deadlock if someone is make IPC */
647 if (spin_is_locked(&smp_call_lock)) 651 if (spin_is_locked(&smp_call_lock))
648 return; 652 return;
653#endif
649 654
650 async_bp.addr = *epc; 655 async_bp.addr = *epc;
651 *epc = (unsigned long)async_breakpoint; 656 *epc = (unsigned long)async_breakpoint;
652} 657}
653 658
654void kgdb_wait(void *arg) 659static void kgdb_wait(void *arg)
655{ 660{
656 unsigned flags; 661 unsigned flags;
657 int cpu = smp_processor_id(); 662 int cpu = smp_processor_id();
658 663
659 local_irq_save(flags); 664 local_irq_save(flags);
660 665
661 spin_lock(&kgdb_cpulock[cpu]); 666 __raw_spin_lock(&kgdb_cpulock[cpu]);
662 spin_unlock(&kgdb_cpulock[cpu]); 667 __raw_spin_unlock(&kgdb_cpulock[cpu]);
663 668
664 local_irq_restore(flags); 669 local_irq_restore(flags);
665} 670}
@@ -707,7 +712,7 @@ void handle_exception (struct gdb_regs *regs)
707 * acquire the CPU spinlocks 712 * acquire the CPU spinlocks
708 */ 713 */
709 for (i = num_online_cpus()-1; i >= 0; i--) 714 for (i = num_online_cpus()-1; i >= 0; i--)
710 if (spin_trylock(&kgdb_cpulock[i]) == 0) 715 if (__raw_spin_trylock(&kgdb_cpulock[i]) == 0)
711 panic("kgdb: couldn't get cpulock %d\n", i); 716 panic("kgdb: couldn't get cpulock %d\n", i);
712 717
713 /* 718 /*
@@ -982,7 +987,7 @@ finish_kgdb:
982exit_kgdb_exception: 987exit_kgdb_exception:
983 /* release locks so other CPUs can go */ 988 /* release locks so other CPUs can go */
984 for (i = num_online_cpus()-1; i >= 0; i--) 989 for (i = num_online_cpus()-1; i >= 0; i--)
985 spin_unlock(&kgdb_cpulock[i]); 990 __raw_spin_unlock(&kgdb_cpulock[i]);
986 spin_unlock(&kgdb_lock); 991 spin_unlock(&kgdb_lock);
987 992
988 __flush_cache_all(); 993 __flush_cache_all();
@@ -1036,12 +1041,12 @@ void adel(void)
1036 * malloc is needed by gdb client in "call func()", even a private one 1041 * malloc is needed by gdb client in "call func()", even a private one
1037 * will make gdb happy 1042 * will make gdb happy
1038 */ 1043 */
1039static void *malloc(size_t size) 1044static void * __attribute_used__ malloc(size_t size)
1040{ 1045{
1041 return kmalloc(size, GFP_ATOMIC); 1046 return kmalloc(size, GFP_ATOMIC);
1042} 1047}
1043 1048
1044static void free(void *where) 1049static void __attribute_used__ free (void *where)
1045{ 1050{
1046 kfree(where); 1051 kfree(where);
1047} 1052}
diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S
index e7f6c1b90806..aa18a8b7b380 100644
--- a/arch/mips/kernel/genex.S
+++ b/arch/mips/kernel/genex.S
@@ -82,7 +82,7 @@ NESTED(except_vec3_r4000, 0, sp)
82 li k0, 14<<2 82 li k0, 14<<2
83 beq k1, k0, handle_vcei 83 beq k1, k0, handle_vcei
84#ifdef CONFIG_64BIT 84#ifdef CONFIG_64BIT
85 dsll k1, k1, 1 85 dsll k1, k1, 1
86#endif 86#endif
87 .set pop 87 .set pop
88 PTR_L k0, exception_handlers(k1) 88 PTR_L k0, exception_handlers(k1)
@@ -90,17 +90,17 @@ NESTED(except_vec3_r4000, 0, sp)
90 90
91 /* 91 /*
92 * Big shit, we now may have two dirty primary cache lines for the same 92 * Big shit, we now may have two dirty primary cache lines for the same
93 * physical address. We can savely invalidate the line pointed to by 93 * physical address. We can safely invalidate the line pointed to by
94 * c0_badvaddr because after return from this exception handler the 94 * c0_badvaddr because after return from this exception handler the
95 * load / store will be re-executed. 95 * load / store will be re-executed.
96 */ 96 */
97handle_vced: 97handle_vced:
98 DMFC0 k0, CP0_BADVADDR 98 MFC0 k0, CP0_BADVADDR
99 li k1, -4 # Is this ... 99 li k1, -4 # Is this ...
100 and k0, k1 # ... really needed? 100 and k0, k1 # ... really needed?
101 mtc0 zero, CP0_TAGLO 101 mtc0 zero, CP0_TAGLO
102 cache Index_Store_Tag_D,(k0) 102 cache Index_Store_Tag_D, (k0)
103 cache Hit_Writeback_Inv_SD,(k0) 103 cache Hit_Writeback_Inv_SD, (k0)
104#ifdef CONFIG_PROC_FS 104#ifdef CONFIG_PROC_FS
105 PTR_LA k0, vced_count 105 PTR_LA k0, vced_count
106 lw k1, (k0) 106 lw k1, (k0)
@@ -148,6 +148,38 @@ NESTED(except_vec_ejtag_debug, 0, sp)
148 __FINIT 148 __FINIT
149 149
150/* 150/*
151 * Vectored interrupt handler.
152 * This prototype is copied to ebase + n*IntCtl.VS and patched
153 * to invoke the handler
154 */
155NESTED(except_vec_vi, 0, sp)
156 SAVE_SOME
157 SAVE_AT
158 .set push
159 .set noreorder
160EXPORT(except_vec_vi_lui)
161 lui v0, 0 /* Patched */
162 j except_vec_vi_handler
163EXPORT(except_vec_vi_ori)
164 ori v0, 0 /* Patched */
165 .set pop
166 END(except_vec_vi)
167EXPORT(except_vec_vi_end)
168
169/*
170 * Common Vectored Interrupt code
171 * Complete the register saves and invoke the handler which is passed in $v0
172 */
173NESTED(except_vec_vi_handler, 0, sp)
174 SAVE_TEMP
175 SAVE_STATIC
176 CLI
177 move a0, sp
178 jalr v0
179 j ret_from_irq
180 END(except_vec_vi_handler)
181
182/*
151 * EJTAG debug exception handler. 183 * EJTAG debug exception handler.
152 */ 184 */
153NESTED(ejtag_debug_handler, PT_SIZE, sp) 185NESTED(ejtag_debug_handler, PT_SIZE, sp)
@@ -291,6 +323,8 @@ NESTED(nmi_handler, PT_SIZE, sp)
291 BUILD_HANDLER mdmx mdmx sti silent /* #22 */ 323 BUILD_HANDLER mdmx mdmx sti silent /* #22 */
292 BUILD_HANDLER watch watch sti verbose /* #23 */ 324 BUILD_HANDLER watch watch sti verbose /* #23 */
293 BUILD_HANDLER mcheck mcheck cli verbose /* #24 */ 325 BUILD_HANDLER mcheck mcheck cli verbose /* #24 */
326 BUILD_HANDLER mt mt sti verbose /* #25 */
327 BUILD_HANDLER dsp dsp sti silent /* #26 */
294 BUILD_HANDLER reserved reserved sti verbose /* others */ 328 BUILD_HANDLER reserved reserved sti verbose /* others */
295 329
296#ifdef CONFIG_64BIT 330#ifdef CONFIG_64BIT
diff --git a/arch/mips/kernel/genrtc.c b/arch/mips/kernel/genrtc.c
deleted file mode 100644
index 71416e7bbbaa..000000000000
--- a/arch/mips/kernel/genrtc.c
+++ /dev/null
@@ -1,64 +0,0 @@
1/*
2 * A glue layer that provides RTC read/write to drivers/char/genrtc.c driver
3 * based on MIPS internal RTC routines. It does take care locking
4 * issues so that we are SMP/Preemption safe.
5 *
6 * Copyright (C) 2004 MontaVista Software Inc.
7 * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
8 *
9 * Please read the COPYING file for all license details.
10 */
11
12#include <linux/spinlock.h>
13
14#include <asm/rtc.h>
15#include <asm/time.h>
16
17static DEFINE_SPINLOCK(mips_rtc_lock);
18
19unsigned int get_rtc_time(struct rtc_time *time)
20{
21 unsigned long nowtime;
22
23 spin_lock(&mips_rtc_lock);
24 nowtime = rtc_get_time();
25 to_tm(nowtime, time);
26 time->tm_year -= 1900;
27 spin_unlock(&mips_rtc_lock);
28
29 return RTC_24H;
30}
31
32int set_rtc_time(struct rtc_time *time)
33{
34 unsigned long nowtime;
35 int ret;
36
37 spin_lock(&mips_rtc_lock);
38 nowtime = mktime(time->tm_year+1900, time->tm_mon+1,
39 time->tm_mday, time->tm_hour, time->tm_min,
40 time->tm_sec);
41 ret = rtc_set_time(nowtime);
42 spin_unlock(&mips_rtc_lock);
43
44 return ret;
45}
46
47unsigned int get_rtc_ss(void)
48{
49 struct rtc_time h;
50
51 get_rtc_time(&h);
52 return h.tm_sec;
53}
54
55int get_rtc_pll(struct rtc_pll_info *pll)
56{
57 return -EINVAL;
58}
59
60int set_rtc_pll(struct rtc_pll_info *pll)
61{
62 return -EINVAL;
63}
64
diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S
index 2a1b45d66f04..2e9122a4213a 100644
--- a/arch/mips/kernel/head.S
+++ b/arch/mips/kernel/head.S
@@ -22,11 +22,8 @@
22#include <asm/page.h> 22#include <asm/page.h>
23#include <asm/mipsregs.h> 23#include <asm/mipsregs.h>
24#include <asm/stackframe.h> 24#include <asm/stackframe.h>
25#ifdef CONFIG_SGI_IP27 25
26#include <asm/sn/addrs.h> 26#include <kernel-entry-init.h>
27#include <asm/sn/sn0/hubni.h>
28#include <asm/sn/klkernvars.h>
29#endif
30 27
31 .macro ARC64_TWIDDLE_PC 28 .macro ARC64_TWIDDLE_PC
32#if defined(CONFIG_ARC64) || defined(CONFIG_MAPPED_KERNEL) 29#if defined(CONFIG_ARC64) || defined(CONFIG_MAPPED_KERNEL)
@@ -38,18 +35,6 @@
38#endif 35#endif
39 .endm 36 .endm
40 37
41#ifdef CONFIG_SGI_IP27
42 /*
43 * outputs the local nasid into res. IP27 stuff.
44 */
45 .macro GET_NASID_ASM res
46 dli \res, LOCAL_HUB_ADDR(NI_STATUS_REV_ID)
47 ld \res, (\res)
48 and \res, NSRI_NODEID_MASK
49 dsrl \res, NSRI_NODEID_SHFT
50 .endm
51#endif /* CONFIG_SGI_IP27 */
52
53 /* 38 /*
54 * inputs are the text nasid in t1, data nasid in t2. 39 * inputs are the text nasid in t1, data nasid in t2.
55 */ 40 */
@@ -131,16 +116,21 @@
131EXPORT(stext) # used for profiling 116EXPORT(stext) # used for profiling
132EXPORT(_stext) 117EXPORT(_stext)
133 118
119#if defined(CONFIG_QEMU) || defined(CONFIG_MIPS_SIM)
120 /*
121 * Give us a fighting chance of running if execution beings at the
122 * kernel load address. This is needed because this platform does
123 * not have a ELF loader yet.
124 */
125 j kernel_entry
126#endif
134 __INIT 127 __INIT
135 128
136NESTED(kernel_entry, 16, sp) # kernel entry point 129NESTED(kernel_entry, 16, sp) # kernel entry point
137 setup_c0_status_pri
138 130
139#ifdef CONFIG_SGI_IP27 131 kernel_entry_setup # cpu specific setup
140 GET_NASID_ASM t1 132
141 move t2, t1 # text and data are here 133 setup_c0_status_pri
142 MAPPED_KERNEL_SETUP_TLB
143#endif /* IP27 */
144 134
145 ARC64_TWIDDLE_PC 135 ARC64_TWIDDLE_PC
146 136
@@ -157,6 +147,7 @@ NESTED(kernel_entry, 16, sp) # kernel entry point
157 LONG_S a2, fw_arg2 147 LONG_S a2, fw_arg2
158 LONG_S a3, fw_arg3 148 LONG_S a3, fw_arg3
159 149
150 MTC0 zero, CP0_CONTEXT # clear context register
160 PTR_LA $28, init_thread_union 151 PTR_LA $28, init_thread_union
161 PTR_ADDIU sp, $28, _THREAD_SIZE - 32 152 PTR_ADDIU sp, $28, _THREAD_SIZE - 32
162 set_saved_sp sp, t0, t1 153 set_saved_sp sp, t0, t1
@@ -165,6 +156,10 @@ NESTED(kernel_entry, 16, sp) # kernel entry point
165 j start_kernel 156 j start_kernel
166 END(kernel_entry) 157 END(kernel_entry)
167 158
159#ifdef CONFIG_QEMU
160 __INIT
161#endif
162
168#ifdef CONFIG_SMP 163#ifdef CONFIG_SMP
169/* 164/*
170 * SMP slave cpus entry point. Board specific code for bootstrap calls this 165 * SMP slave cpus entry point. Board specific code for bootstrap calls this
@@ -172,20 +167,7 @@ NESTED(kernel_entry, 16, sp) # kernel entry point
172 */ 167 */
173NESTED(smp_bootstrap, 16, sp) 168NESTED(smp_bootstrap, 16, sp)
174 setup_c0_status_sec 169 setup_c0_status_sec
175 170 smp_slave_setup
176#ifdef CONFIG_SGI_IP27
177 GET_NASID_ASM t1
178 dli t0, KLDIR_OFFSET + (KLI_KERN_VARS * KLDIR_ENT_SIZE) + \
179 KLDIR_OFF_POINTER + CAC_BASE
180 dsll t1, NASID_SHFT
181 or t0, t0, t1
182 ld t0, 0(t0) # t0 points to kern_vars struct
183 lh t1, KV_RO_NASID_OFFSET(t0)
184 lh t2, KV_RW_NASID_OFFSET(t0)
185 MAPPED_KERNEL_SETUP_TLB
186 ARC64_TWIDDLE_PC
187#endif /* CONFIG_SGI_IP27 */
188
189 j start_secondary 171 j start_secondary
190 END(smp_bootstrap) 172 END(smp_bootstrap)
191#endif /* CONFIG_SMP */ 173#endif /* CONFIG_SMP */
@@ -200,19 +182,13 @@ NESTED(smp_bootstrap, 16, sp)
200 .comm fw_arg2, SZREG, SZREG 182 .comm fw_arg2, SZREG, SZREG
201 .comm fw_arg3, SZREG, SZREG 183 .comm fw_arg3, SZREG, SZREG
202 184
203 .macro page name, order=0 185 .macro page name, order
204 .globl \name 186 .comm \name, (_PAGE_SIZE << \order), (_PAGE_SIZE << \order)
205\name: .size \name, (_PAGE_SIZE << \order)
206 .org . + (_PAGE_SIZE << \order)
207 .type \name, @object
208 .endm 187 .endm
209 188
210 .data
211 .align PAGE_SHIFT
212
213 /* 189 /*
214 * ... but on 64-bit we've got three-level pagetables with a 190 * On 64-bit we've got three-level pagetables with a slightly
215 * slightly different layout ... 191 * different layout ...
216 */ 192 */
217 page swapper_pg_dir, _PGD_ORDER 193 page swapper_pg_dir, _PGD_ORDER
218#ifdef CONFIG_64BIT 194#ifdef CONFIG_64BIT
diff --git a/arch/mips/kernel/i8259.c b/arch/mips/kernel/i8259.c
index 447759201d1d..b974ac9057f6 100644
--- a/arch/mips/kernel/i8259.c
+++ b/arch/mips/kernel/i8259.c
@@ -31,7 +31,7 @@ void disable_8259A_irq(unsigned int irq);
31 * moves to arch independent land 31 * moves to arch independent land
32 */ 32 */
33 33
34spinlock_t DEFINE_SPINLOCK(i8259A_lock); 34DEFINE_SPINLOCK(i8259A_lock);
35 35
36static void end_8259A_irq (unsigned int irq) 36static void end_8259A_irq (unsigned int irq)
37{ 37{
@@ -52,14 +52,13 @@ static unsigned int startup_8259A_irq(unsigned int irq)
52} 52}
53 53
54static struct hw_interrupt_type i8259A_irq_type = { 54static struct hw_interrupt_type i8259A_irq_type = {
55 "XT-PIC", 55 .typename = "XT-PIC",
56 startup_8259A_irq, 56 .startup = startup_8259A_irq,
57 shutdown_8259A_irq, 57 .shutdown = shutdown_8259A_irq,
58 enable_8259A_irq, 58 .enable = enable_8259A_irq,
59 disable_8259A_irq, 59 .disable = disable_8259A_irq,
60 mask_and_ack_8259A, 60 .ack = mask_and_ack_8259A,
61 end_8259A_irq, 61 .end = end_8259A_irq,
62 NULL
63}; 62};
64 63
65/* 64/*
@@ -308,7 +307,7 @@ static struct resource pic2_io_resource = {
308 307
309/* 308/*
310 * On systems with i8259-style interrupt controllers we assume for 309 * On systems with i8259-style interrupt controllers we assume for
311 * driver compatibility reasons interrupts 0 - 15 to be the i8295 310 * driver compatibility reasons interrupts 0 - 15 to be the i8259
312 * interrupts even if the hardware uses a different interrupt numbering. 311 * interrupts even if the hardware uses a different interrupt numbering.
313 */ 312 */
314void __init init_i8259_irqs (void) 313void __init init_i8259_irqs (void)
@@ -322,7 +321,7 @@ void __init init_i8259_irqs (void)
322 321
323 for (i = 0; i < 16; i++) { 322 for (i = 0; i < 16; i++) {
324 irq_desc[i].status = IRQ_DISABLED; 323 irq_desc[i].status = IRQ_DISABLED;
325 irq_desc[i].action = 0; 324 irq_desc[i].action = NULL;
326 irq_desc[i].depth = 1; 325 irq_desc[i].depth = 1;
327 irq_desc[i].handler = &i8259A_irq_type; 326 irq_desc[i].handler = &i8259A_irq_type;
328 } 327 }
diff --git a/arch/mips/kernel/ioctl32.c b/arch/mips/kernel/ioctl32.c
index c069719ff0d8..ed9b2da510be 100644
--- a/arch/mips/kernel/ioctl32.c
+++ b/arch/mips/kernel/ioctl32.c
@@ -41,12 +41,6 @@ IOCTL_TABLE_START
41#define DECLARES 41#define DECLARES
42#include "compat_ioctl.c" 42#include "compat_ioctl.c"
43 43
44#ifdef CONFIG_SIBYTE_TBPROF
45COMPATIBLE_IOCTL(SBPROF_ZBSTART)
46COMPATIBLE_IOCTL(SBPROF_ZBSTOP)
47COMPATIBLE_IOCTL(SBPROF_ZBWAITFULL)
48#endif /* CONFIG_SIBYTE_TBPROF */
49
50/*HANDLE_IOCTL(RTC_IRQP_READ, w_long) 44/*HANDLE_IOCTL(RTC_IRQP_READ, w_long)
51COMPATIBLE_IOCTL(RTC_IRQP_SET) 45COMPATIBLE_IOCTL(RTC_IRQP_SET)
52HANDLE_IOCTL(RTC_EPOCH_READ, w_long) 46HANDLE_IOCTL(RTC_EPOCH_READ, w_long)
diff --git a/arch/mips/kernel/irixelf.c b/arch/mips/kernel/irixelf.c
index 4af20cd91f9f..10d3644e3608 100644
--- a/arch/mips/kernel/irixelf.c
+++ b/arch/mips/kernel/irixelf.c
@@ -8,7 +8,7 @@
8 * 8 *
9 * Copyright (C) 1993 - 1994 Eric Youngdale <ericy@cais.com> 9 * Copyright (C) 1993 - 1994 Eric Youngdale <ericy@cais.com>
10 * Copyright (C) 1996 - 2004 David S. Miller <dm@engr.sgi.com> 10 * Copyright (C) 1996 - 2004 David S. Miller <dm@engr.sgi.com>
11 * Copyright (C) 2004 Steven J. Hill <sjhill@realitydiluted.com> 11 * Copyright (C) 2004 - 2005 Steven J. Hill <sjhill@realitydiluted.com>
12 */ 12 */
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/fs.h> 14#include <linux/fs.h>
@@ -31,15 +31,16 @@
31#include <linux/elfcore.h> 31#include <linux/elfcore.h>
32#include <linux/smp_lock.h> 32#include <linux/smp_lock.h>
33 33
34#include <asm/uaccess.h>
35#include <asm/mipsregs.h> 34#include <asm/mipsregs.h>
35#include <asm/namei.h>
36#include <asm/prctl.h> 36#include <asm/prctl.h>
37#include <asm/uaccess.h>
37 38
38#define DLINFO_ITEMS 12 39#define DLINFO_ITEMS 12
39 40
40#include <linux/elf.h> 41#include <linux/elf.h>
41 42
42#undef DEBUG_ELF 43#undef DEBUG
43 44
44static int load_irix_binary(struct linux_binprm * bprm, struct pt_regs * regs); 45static int load_irix_binary(struct linux_binprm * bprm, struct pt_regs * regs);
45static int load_irix_library(struct file *); 46static int load_irix_library(struct file *);
@@ -55,7 +56,7 @@ static struct linux_binfmt irix_format = {
55#define elf_addr_t unsigned long 56#define elf_addr_t unsigned long
56#endif 57#endif
57 58
58#ifdef DEBUG_ELF 59#ifdef DEBUG
59/* Debugging routines. */ 60/* Debugging routines. */
60static char *get_elf_p_type(Elf32_Word p_type) 61static char *get_elf_p_type(Elf32_Word p_type)
61{ 62{
@@ -120,7 +121,7 @@ static void dump_phdrs(struct elf_phdr *ep, int pnum)
120 print_phdr(i, ep); 121 print_phdr(i, ep);
121 } 122 }
122} 123}
123#endif /* (DEBUG_ELF) */ 124#endif /* DEBUG */
124 125
125static void set_brk(unsigned long start, unsigned long end) 126static void set_brk(unsigned long start, unsigned long end)
126{ 127{
@@ -146,20 +147,20 @@ static void padzero(unsigned long elf_bss)
146 nbyte = elf_bss & (PAGE_SIZE-1); 147 nbyte = elf_bss & (PAGE_SIZE-1);
147 if (nbyte) { 148 if (nbyte) {
148 nbyte = PAGE_SIZE - nbyte; 149 nbyte = PAGE_SIZE - nbyte;
149 clear_user((void *) elf_bss, nbyte); 150 clear_user((void __user *) elf_bss, nbyte);
150 } 151 }
151} 152}
152 153
153unsigned long * create_irix_tables(char * p, int argc, int envc, 154static unsigned long * create_irix_tables(char * p, int argc, int envc,
154 struct elfhdr * exec, unsigned int load_addr, 155 struct elfhdr * exec, unsigned int load_addr,
155 unsigned int interp_load_addr, 156 unsigned int interp_load_addr, struct pt_regs *regs,
156 struct pt_regs *regs, struct elf_phdr *ephdr) 157 struct elf_phdr *ephdr)
157{ 158{
158 elf_addr_t *argv; 159 elf_addr_t *argv;
159 elf_addr_t *envp; 160 elf_addr_t *envp;
160 elf_addr_t *sp, *csp; 161 elf_addr_t *sp, *csp;
161 162
162#ifdef DEBUG_ELF 163#ifdef DEBUG
163 printk("create_irix_tables: p[%p] argc[%d] envc[%d] " 164 printk("create_irix_tables: p[%p] argc[%d] envc[%d] "
164 "load_addr[%08x] interp_load_addr[%08x]\n", 165 "load_addr[%08x] interp_load_addr[%08x]\n",
165 p, argc, envc, load_addr, interp_load_addr); 166 p, argc, envc, load_addr, interp_load_addr);
@@ -248,14 +249,13 @@ static unsigned int load_irix_interp(struct elfhdr * interp_elf_ex,
248 last_bss = 0; 249 last_bss = 0;
249 error = load_addr = 0; 250 error = load_addr = 0;
250 251
251#ifdef DEBUG_ELF 252#ifdef DEBUG
252 print_elfhdr(interp_elf_ex); 253 print_elfhdr(interp_elf_ex);
253#endif 254#endif
254 255
255 /* First of all, some simple consistency checks */ 256 /* First of all, some simple consistency checks */
256 if ((interp_elf_ex->e_type != ET_EXEC && 257 if ((interp_elf_ex->e_type != ET_EXEC &&
257 interp_elf_ex->e_type != ET_DYN) || 258 interp_elf_ex->e_type != ET_DYN) ||
258 !irix_elf_check_arch(interp_elf_ex) ||
259 !interpreter->f_op->mmap) { 259 !interpreter->f_op->mmap) {
260 printk("IRIX interp has bad e_type %d\n", interp_elf_ex->e_type); 260 printk("IRIX interp has bad e_type %d\n", interp_elf_ex->e_type);
261 return 0xffffffff; 261 return 0xffffffff;
@@ -290,7 +290,7 @@ static unsigned int load_irix_interp(struct elfhdr * interp_elf_ex,
290 (char *) elf_phdata, 290 (char *) elf_phdata,
291 sizeof(struct elf_phdr) * interp_elf_ex->e_phnum); 291 sizeof(struct elf_phdr) * interp_elf_ex->e_phnum);
292 292
293#ifdef DEBUG_ELF 293#ifdef DEBUG
294 dump_phdrs(elf_phdata, interp_elf_ex->e_phnum); 294 dump_phdrs(elf_phdata, interp_elf_ex->e_phnum);
295#endif 295#endif
296 296
@@ -306,13 +306,11 @@ static unsigned int load_irix_interp(struct elfhdr * interp_elf_ex,
306 elf_type |= MAP_FIXED; 306 elf_type |= MAP_FIXED;
307 vaddr = eppnt->p_vaddr; 307 vaddr = eppnt->p_vaddr;
308 308
309#ifdef DEBUG_ELF 309 pr_debug("INTERP do_mmap(%p, %08lx, %08lx, %08lx, %08lx, %08lx) ",
310 printk("INTERP do_mmap(%p, %08lx, %08lx, %08lx, %08lx, %08lx) ",
311 interpreter, vaddr, 310 interpreter, vaddr,
312 (unsigned long) (eppnt->p_filesz + (eppnt->p_vaddr & 0xfff)), 311 (unsigned long) (eppnt->p_filesz + (eppnt->p_vaddr & 0xfff)),
313 (unsigned long) elf_prot, (unsigned long) elf_type, 312 (unsigned long) elf_prot, (unsigned long) elf_type,
314 (unsigned long) (eppnt->p_offset & 0xfffff000)); 313 (unsigned long) (eppnt->p_offset & 0xfffff000));
315#endif
316 down_write(&current->mm->mmap_sem); 314 down_write(&current->mm->mmap_sem);
317 error = do_mmap(interpreter, vaddr, 315 error = do_mmap(interpreter, vaddr,
318 eppnt->p_filesz + (eppnt->p_vaddr & 0xfff), 316 eppnt->p_filesz + (eppnt->p_vaddr & 0xfff),
@@ -324,14 +322,10 @@ static unsigned int load_irix_interp(struct elfhdr * interp_elf_ex,
324 printk("Aieee IRIX interp mmap error=%d\n", error); 322 printk("Aieee IRIX interp mmap error=%d\n", error);
325 break; /* Real error */ 323 break; /* Real error */
326 } 324 }
327#ifdef DEBUG_ELF 325 pr_debug("error=%08lx ", (unsigned long) error);
328 printk("error=%08lx ", (unsigned long) error);
329#endif
330 if(!load_addr && interp_elf_ex->e_type == ET_DYN) { 326 if(!load_addr && interp_elf_ex->e_type == ET_DYN) {
331 load_addr = error; 327 load_addr = error;
332#ifdef DEBUG_ELF 328 pr_debug("load_addr = error ");
333 printk("load_addr = error ");
334#endif
335 } 329 }
336 330
337 /* Find the end of the file mapping for this phdr, and keep 331 /* Find the end of the file mapping for this phdr, and keep
@@ -345,17 +339,13 @@ static unsigned int load_irix_interp(struct elfhdr * interp_elf_ex,
345 */ 339 */
346 k = eppnt->p_memsz + eppnt->p_vaddr; 340 k = eppnt->p_memsz + eppnt->p_vaddr;
347 if(k > last_bss) last_bss = k; 341 if(k > last_bss) last_bss = k;
348#ifdef DEBUG_ELF 342 pr_debug("\n");
349 printk("\n");
350#endif
351 } 343 }
352 } 344 }
353 345
354 /* Now use mmap to map the library into memory. */ 346 /* Now use mmap to map the library into memory. */
355 if(error < 0 && error > -1024) { 347 if(error < 0 && error > -1024) {
356#ifdef DEBUG_ELF 348 pr_debug("got error %d\n", error);
357 printk("got error %d\n", error);
358#endif
359 kfree(elf_phdata); 349 kfree(elf_phdata);
360 return 0xffffffff; 350 return 0xffffffff;
361 } 351 }
@@ -365,16 +355,12 @@ static unsigned int load_irix_interp(struct elfhdr * interp_elf_ex,
365 * that there are zero-mapped pages up to and including the 355 * that there are zero-mapped pages up to and including the
366 * last bss page. 356 * last bss page.
367 */ 357 */
368#ifdef DEBUG_ELF 358 pr_debug("padzero(%08lx) ", (unsigned long) (elf_bss));
369 printk("padzero(%08lx) ", (unsigned long) (elf_bss));
370#endif
371 padzero(elf_bss); 359 padzero(elf_bss);
372 len = (elf_bss + 0xfff) & 0xfffff000; /* What we have mapped so far */ 360 len = (elf_bss + 0xfff) & 0xfffff000; /* What we have mapped so far */
373 361
374#ifdef DEBUG_ELF 362 pr_debug("last_bss[%08lx] len[%08lx]\n", (unsigned long) last_bss,
375 printk("last_bss[%08lx] len[%08lx]\n", (unsigned long) last_bss, 363 (unsigned long) len);
376 (unsigned long) len);
377#endif
378 364
379 /* Map the last of the bss segment */ 365 /* Map the last of the bss segment */
380 if (last_bss > len) { 366 if (last_bss > len) {
@@ -396,12 +382,7 @@ static int verify_binary(struct elfhdr *ehp, struct linux_binprm *bprm)
396 382
397 /* First of all, some simple consistency checks */ 383 /* First of all, some simple consistency checks */
398 if((ehp->e_type != ET_EXEC && ehp->e_type != ET_DYN) || 384 if((ehp->e_type != ET_EXEC && ehp->e_type != ET_DYN) ||
399 !irix_elf_check_arch(ehp) || !bprm->file->f_op->mmap) { 385 !bprm->file->f_op->mmap) {
400 return -ENOEXEC;
401 }
402
403 /* Only support MIPS ARCH2 or greater IRIX binaries for now. */
404 if(!(ehp->e_flags & EF_MIPS_ARCH) && !(ehp->e_flags & 0x04)) {
405 return -ENOEXEC; 386 return -ENOEXEC;
406 } 387 }
407 388
@@ -411,16 +392,17 @@ static int verify_binary(struct elfhdr *ehp, struct linux_binprm *bprm)
411 * XXX all registers as 64bits on cpu's capable of this at 392 * XXX all registers as 64bits on cpu's capable of this at
412 * XXX exception time plus frob the XTLB exception vector. 393 * XXX exception time plus frob the XTLB exception vector.
413 */ 394 */
414 if((ehp->e_flags & 0x20)) { 395 if((ehp->e_flags & EF_MIPS_ABI2))
415 return -ENOEXEC; 396 return -ENOEXEC;
416 }
417 397
418 return 0; /* It's ok. */ 398 return 0;
419} 399}
420 400
421#define IRIX_INTERP_PREFIX "/usr/gnemul/irix" 401/*
422 402 * This is where the detailed check is performed. Irix binaries
423/* Look for an IRIX ELF interpreter. */ 403 * use interpreters with 'libc.so' in the name, so this function
404 * can differentiate between Linux and Irix binaries.
405 */
424static inline int look_for_irix_interpreter(char **name, 406static inline int look_for_irix_interpreter(char **name,
425 struct file **interpreter, 407 struct file **interpreter,
426 struct elfhdr *interp_elf_ex, 408 struct elfhdr *interp_elf_ex,
@@ -440,12 +422,11 @@ static inline int look_for_irix_interpreter(char **name,
440 if (*name != NULL) 422 if (*name != NULL)
441 goto out; 423 goto out;
442 424
443 *name = kmalloc((epp->p_filesz + strlen(IRIX_INTERP_PREFIX)), 425 *name = kmalloc(epp->p_filesz + strlen(IRIX_EMUL), GFP_KERNEL);
444 GFP_KERNEL);
445 if (!*name) 426 if (!*name)
446 return -ENOMEM; 427 return -ENOMEM;
447 428
448 strcpy(*name, IRIX_INTERP_PREFIX); 429 strcpy(*name, IRIX_EMUL);
449 retval = kernel_read(bprm->file, epp->p_offset, (*name + 16), 430 retval = kernel_read(bprm->file, epp->p_offset, (*name + 16),
450 epp->p_filesz); 431 epp->p_filesz);
451 if (retval < 0) 432 if (retval < 0)
@@ -562,7 +543,7 @@ static inline int map_interpreter(struct elf_phdr *epp, struct elfhdr *ihp,
562 * process and the system, here we map the page and fill the 543 * process and the system, here we map the page and fill the
563 * structure 544 * structure
564 */ 545 */
565void irix_map_prda_page (void) 546static void irix_map_prda_page(void)
566{ 547{
567 unsigned long v; 548 unsigned long v;
568 struct prda *pp; 549 struct prda *pp;
@@ -601,14 +582,33 @@ static int load_irix_binary(struct linux_binprm * bprm, struct pt_regs * regs)
601 582
602 load_addr = 0; 583 load_addr = 0;
603 has_interp = has_ephdr = 0; 584 has_interp = has_ephdr = 0;
604 elf_ihdr = elf_ephdr = 0; 585 elf_ihdr = elf_ephdr = NULL;
605 elf_ex = *((struct elfhdr *) bprm->buf); 586 elf_ex = *((struct elfhdr *) bprm->buf);
606 retval = -ENOEXEC; 587 retval = -ENOEXEC;
607 588
608 if (verify_binary(&elf_ex, bprm)) 589 if (verify_binary(&elf_ex, bprm))
609 goto out; 590 goto out;
610 591
611#ifdef DEBUG_ELF 592 /*
593 * Telling -o32 static binaries from Linux and Irix apart from each
594 * other is difficult. There are 2 differences to be noted for static
595 * binaries from the 2 operating systems:
596 *
597 * 1) Irix binaries have their .text section before their .init
598 * section. Linux binaries are just the opposite.
599 *
600 * 2) Irix binaries usually have <= 12 sections and Linux
601 * binaries have > 20.
602 *
603 * We will use Method #2 since Method #1 would require us to read in
604 * the section headers which is way too much overhead. This appears
605 * to work for everything we have ran into so far. If anyone has a
606 * better method to tell the binaries apart, I'm listening.
607 */
608 if (elf_ex.e_shnum > 20)
609 goto out;
610
611#ifdef DEBUG
612 print_elfhdr(&elf_ex); 612 print_elfhdr(&elf_ex);
613#endif 613#endif
614 614
@@ -623,11 +623,10 @@ static int load_irix_binary(struct linux_binprm * bprm, struct pt_regs * regs)
623 } 623 }
624 624
625 retval = kernel_read(bprm->file, elf_ex.e_phoff, (char *)elf_phdata, size); 625 retval = kernel_read(bprm->file, elf_ex.e_phoff, (char *)elf_phdata, size);
626
627 if (retval < 0) 626 if (retval < 0)
628 goto out_free_ph; 627 goto out_free_ph;
629 628
630#ifdef DEBUG_ELF 629#ifdef DEBUG
631 dump_phdrs(elf_phdata, elf_ex.e_phnum); 630 dump_phdrs(elf_phdata, elf_ex.e_phnum);
632#endif 631#endif
633 632
@@ -644,9 +643,8 @@ static int load_irix_binary(struct linux_binprm * bprm, struct pt_regs * regs)
644 break; 643 break;
645 }; 644 };
646 } 645 }
647#ifdef DEBUG_ELF 646
648 printk("\n"); 647 pr_debug("\n");
649#endif
650 648
651 elf_bss = 0; 649 elf_bss = 0;
652 elf_brk = 0; 650 elf_brk = 0;
@@ -657,12 +655,19 @@ static int load_irix_binary(struct linux_binprm * bprm, struct pt_regs * regs)
657 end_code = 0; 655 end_code = 0;
658 end_data = 0; 656 end_data = 0;
659 657
660 retval = look_for_irix_interpreter(&elf_interpreter, 658 /*
661 &interpreter, 659 * If we get a return value, we change the value to be ENOEXEC
660 * so that we can exit gracefully and the main binary format
661 * search loop in 'fs/exec.c' will move onto the next handler
662 * which should be the normal ELF binary handler.
663 */
664 retval = look_for_irix_interpreter(&elf_interpreter, &interpreter,
662 &interp_elf_ex, elf_phdata, bprm, 665 &interp_elf_ex, elf_phdata, bprm,
663 elf_ex.e_phnum); 666 elf_ex.e_phnum);
664 if (retval) 667 if (retval) {
668 retval = -ENOEXEC;
665 goto out_free_file; 669 goto out_free_file;
670 }
666 671
667 if (elf_interpreter) { 672 if (elf_interpreter) {
668 retval = verify_irix_interpreter(&interp_elf_ex); 673 retval = verify_irix_interpreter(&interp_elf_ex);
@@ -692,7 +697,6 @@ static int load_irix_binary(struct linux_binprm * bprm, struct pt_regs * regs)
692 /* Do this so that we can load the interpreter, if need be. We will 697 /* Do this so that we can load the interpreter, if need be. We will
693 * change some of these later. 698 * change some of these later.
694 */ 699 */
695 set_mm_counter(current->mm, rss, 0);
696 setup_arg_pages(bprm, STACK_TOP, EXSTACK_DEFAULT); 700 setup_arg_pages(bprm, STACK_TOP, EXSTACK_DEFAULT);
697 current->mm->start_stack = bprm->p; 701 current->mm->start_stack = bprm->p;
698 702
@@ -746,18 +750,16 @@ static int load_irix_binary(struct linux_binprm * bprm, struct pt_regs * regs)
746 * IRIX maps a page at 0x200000 which holds some system 750 * IRIX maps a page at 0x200000 which holds some system
747 * information. Programs depend on this. 751 * information. Programs depend on this.
748 */ 752 */
749 irix_map_prda_page (); 753 irix_map_prda_page();
750 754
751 padzero(elf_bss); 755 padzero(elf_bss);
752 756
753#ifdef DEBUG_ELF 757 pr_debug("(start_brk) %lx\n" , (long) current->mm->start_brk);
754 printk("(start_brk) %lx\n" , (long) current->mm->start_brk); 758 pr_debug("(end_code) %lx\n" , (long) current->mm->end_code);
755 printk("(end_code) %lx\n" , (long) current->mm->end_code); 759 pr_debug("(start_code) %lx\n" , (long) current->mm->start_code);
756 printk("(start_code) %lx\n" , (long) current->mm->start_code); 760 pr_debug("(end_data) %lx\n" , (long) current->mm->end_data);
757 printk("(end_data) %lx\n" , (long) current->mm->end_data); 761 pr_debug("(start_stack) %lx\n" , (long) current->mm->start_stack);
758 printk("(start_stack) %lx\n" , (long) current->mm->start_stack); 762 pr_debug("(brk) %lx\n" , (long) current->mm->brk);
759 printk("(brk) %lx\n" , (long) current->mm->brk);
760#endif
761 763
762#if 0 /* XXX No fucking way dude... */ 764#if 0 /* XXX No fucking way dude... */
763 /* Why this, you ask??? Well SVr4 maps page 0 as read-only, 765 /* Why this, you ask??? Well SVr4 maps page 0 as read-only,
@@ -782,8 +784,7 @@ out_free_dentry:
782 allow_write_access(interpreter); 784 allow_write_access(interpreter);
783 fput(interpreter); 785 fput(interpreter);
784out_free_interp: 786out_free_interp:
785 if (elf_interpreter) 787 kfree(elf_interpreter);
786 kfree(elf_interpreter);
787out_free_file: 788out_free_file:
788out_free_ph: 789out_free_ph:
789 kfree (elf_phdata); 790 kfree (elf_phdata);
@@ -813,7 +814,7 @@ static int load_irix_library(struct file *file)
813 814
814 /* First of all, some simple consistency checks. */ 815 /* First of all, some simple consistency checks. */
815 if(elf_ex.e_type != ET_EXEC || elf_ex.e_phnum > 2 || 816 if(elf_ex.e_type != ET_EXEC || elf_ex.e_phnum > 2 ||
816 !irix_elf_check_arch(&elf_ex) || !file->f_op->mmap) 817 !file->f_op->mmap)
817 return -ENOEXEC; 818 return -ENOEXEC;
818 819
819 /* Now read in all of the header information. */ 820 /* Now read in all of the header information. */
@@ -874,35 +875,36 @@ static int load_irix_library(struct file *file)
874 * phdrs there are in the USER_PHDRP array. We return the vaddr the 875 * phdrs there are in the USER_PHDRP array. We return the vaddr the
875 * first phdr was successfully mapped to. 876 * first phdr was successfully mapped to.
876 */ 877 */
877unsigned long irix_mapelf(int fd, struct elf_phdr *user_phdrp, int cnt) 878unsigned long irix_mapelf(int fd, struct elf_phdr __user *user_phdrp, int cnt)
878{ 879{
879 struct elf_phdr *hp; 880 unsigned long type, vaddr, filesz, offset, flags;
881 struct elf_phdr __user *hp;
880 struct file *filp; 882 struct file *filp;
881 int i, retval; 883 int i, retval;
882 884
883#ifdef DEBUG_ELF 885 pr_debug("irix_mapelf: fd[%d] user_phdrp[%p] cnt[%d]\n",
884 printk("irix_mapelf: fd[%d] user_phdrp[%p] cnt[%d]\n", 886 fd, user_phdrp, cnt);
885 fd, user_phdrp, cnt);
886#endif
887 887
888 /* First get the verification out of the way. */ 888 /* First get the verification out of the way. */
889 hp = user_phdrp; 889 hp = user_phdrp;
890 if (!access_ok(VERIFY_READ, hp, (sizeof(struct elf_phdr) * cnt))) { 890 if (!access_ok(VERIFY_READ, hp, (sizeof(struct elf_phdr) * cnt))) {
891#ifdef DEBUG_ELF 891 pr_debug("irix_mapelf: bad pointer to ELF PHDR!\n");
892 printk("irix_mapelf: access_ok fails!\n"); 892
893#endif
894 return -EFAULT; 893 return -EFAULT;
895 } 894 }
896 895
897#ifdef DEBUG_ELF 896#ifdef DEBUG
898 dump_phdrs(user_phdrp, cnt); 897 dump_phdrs(user_phdrp, cnt);
899#endif 898#endif
900 899
901 for(i = 0; i < cnt; i++, hp++) 900 for (i = 0; i < cnt; i++, hp++) {
902 if(hp->p_type != PT_LOAD) { 901 if (__get_user(type, &hp->p_type))
902 return -EFAULT;
903 if (type != PT_LOAD) {
903 printk("irix_mapelf: One section is not PT_LOAD!\n"); 904 printk("irix_mapelf: One section is not PT_LOAD!\n");
904 return -ENOEXEC; 905 return -ENOEXEC;
905 } 906 }
907 }
906 908
907 filp = fget(fd); 909 filp = fget(fd);
908 if (!filp) 910 if (!filp)
@@ -917,29 +919,40 @@ unsigned long irix_mapelf(int fd, struct elf_phdr *user_phdrp, int cnt)
917 for(i = 0; i < cnt; i++, hp++) { 919 for(i = 0; i < cnt; i++, hp++) {
918 int prot; 920 int prot;
919 921
920 prot = (hp->p_flags & PF_R) ? PROT_READ : 0; 922 retval = __get_user(vaddr, &hp->p_vaddr);
921 prot |= (hp->p_flags & PF_W) ? PROT_WRITE : 0; 923 retval |= __get_user(filesz, &hp->p_filesz);
922 prot |= (hp->p_flags & PF_X) ? PROT_EXEC : 0; 924 retval |= __get_user(offset, &hp->p_offset);
925 retval |= __get_user(flags, &hp->p_flags);
926 if (retval)
927 return retval;
928
929 prot = (flags & PF_R) ? PROT_READ : 0;
930 prot |= (flags & PF_W) ? PROT_WRITE : 0;
931 prot |= (flags & PF_X) ? PROT_EXEC : 0;
932
923 down_write(&current->mm->mmap_sem); 933 down_write(&current->mm->mmap_sem);
924 retval = do_mmap(filp, (hp->p_vaddr & 0xfffff000), 934 retval = do_mmap(filp, (vaddr & 0xfffff000),
925 (hp->p_filesz + (hp->p_vaddr & 0xfff)), 935 (filesz + (vaddr & 0xfff)),
926 prot, (MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE), 936 prot, (MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE),
927 (hp->p_offset & 0xfffff000)); 937 (offset & 0xfffff000));
928 up_write(&current->mm->mmap_sem); 938 up_write(&current->mm->mmap_sem);
929 939
930 if(retval != (hp->p_vaddr & 0xfffff000)) { 940 if (retval != (vaddr & 0xfffff000)) {
931 printk("irix_mapelf: do_mmap fails with %d!\n", retval); 941 printk("irix_mapelf: do_mmap fails with %d!\n", retval);
932 fput(filp); 942 fput(filp);
933 return retval; 943 return retval;
934 } 944 }
935 } 945 }
936 946
937#ifdef DEBUG_ELF 947 pr_debug("irix_mapelf: Success, returning %08lx\n",
938 printk("irix_mapelf: Success, returning %08lx\n", 948 (unsigned long) user_phdrp->p_vaddr);
939 (unsigned long) user_phdrp->p_vaddr); 949
940#endif
941 fput(filp); 950 fput(filp);
942 return user_phdrp->p_vaddr; 951
952 if (__get_user(vaddr, &user_phdrp->p_vaddr))
953 return -EFAULT;
954
955 return vaddr;
943} 956}
944 957
945/* 958/*
@@ -952,9 +965,9 @@ unsigned long irix_mapelf(int fd, struct elf_phdr *user_phdrp, int cnt)
952/* These are the only things you should do on a core-file: use only these 965/* These are the only things you should do on a core-file: use only these
953 * functions to write out all the necessary info. 966 * functions to write out all the necessary info.
954 */ 967 */
955static int dump_write(struct file *file, const void *addr, int nr) 968static int dump_write(struct file *file, const void __user *addr, int nr)
956{ 969{
957 return file->f_op->write(file, addr, nr, &file->f_pos) == nr; 970 return file->f_op->write(file, (const char __user *) addr, nr, &file->f_pos) == nr;
958} 971}
959 972
960static int dump_seek(struct file *file, off_t off) 973static int dump_seek(struct file *file, off_t off)
@@ -1064,8 +1077,8 @@ static int irix_core_dump(long signr, struct pt_regs * regs, struct file *file)
1064 struct elfhdr elf; 1077 struct elfhdr elf;
1065 off_t offset = 0, dataoff; 1078 off_t offset = 0, dataoff;
1066 int limit = current->signal->rlim[RLIMIT_CORE].rlim_cur; 1079 int limit = current->signal->rlim[RLIMIT_CORE].rlim_cur;
1067 int numnote = 4; 1080 int numnote = 3;
1068 struct memelfnote notes[4]; 1081 struct memelfnote notes[3];
1069 struct elf_prstatus prstatus; /* NT_PRSTATUS */ 1082 struct elf_prstatus prstatus; /* NT_PRSTATUS */
1070 elf_fpregset_t fpu; /* NT_PRFPREG */ 1083 elf_fpregset_t fpu; /* NT_PRFPREG */
1071 struct elf_prpsinfo psinfo; /* NT_PRPSINFO */ 1084 struct elf_prpsinfo psinfo; /* NT_PRPSINFO */
@@ -1073,7 +1086,7 @@ static int irix_core_dump(long signr, struct pt_regs * regs, struct file *file)
1073 /* Count what's needed to dump, up to the limit of coredump size. */ 1086 /* Count what's needed to dump, up to the limit of coredump size. */
1074 segs = 0; 1087 segs = 0;
1075 size = 0; 1088 size = 0;
1076 for(vma = current->mm->mmap; vma != NULL; vma = vma->vm_next) { 1089 for (vma = current->mm->mmap; vma != NULL; vma = vma->vm_next) {
1077 if (maydump(vma)) 1090 if (maydump(vma))
1078 { 1091 {
1079 int sz = vma->vm_end-vma->vm_start; 1092 int sz = vma->vm_end-vma->vm_start;
@@ -1187,9 +1200,9 @@ static int irix_core_dump(long signr, struct pt_regs * regs, struct file *file)
1187 1200
1188 len = current->mm->arg_end - current->mm->arg_start; 1201 len = current->mm->arg_end - current->mm->arg_start;
1189 len = len >= ELF_PRARGSZ ? ELF_PRARGSZ : len; 1202 len = len >= ELF_PRARGSZ ? ELF_PRARGSZ : len;
1190 copy_from_user(&psinfo.pr_psargs, 1203 (void *) copy_from_user(&psinfo.pr_psargs,
1191 (const char *)current->mm->arg_start, len); 1204 (const char __user *)current->mm->arg_start, len);
1192 for(i = 0; i < len; i++) 1205 for (i = 0; i < len; i++)
1193 if (psinfo.pr_psargs[i] == 0) 1206 if (psinfo.pr_psargs[i] == 0)
1194 psinfo.pr_psargs[i] = ' '; 1207 psinfo.pr_psargs[i] = ' ';
1195 psinfo.pr_psargs[len] = 0; 1208 psinfo.pr_psargs[len] = 0;
@@ -1198,20 +1211,15 @@ static int irix_core_dump(long signr, struct pt_regs * regs, struct file *file)
1198 } 1211 }
1199 strlcpy(psinfo.pr_fname, current->comm, sizeof(psinfo.pr_fname)); 1212 strlcpy(psinfo.pr_fname, current->comm, sizeof(psinfo.pr_fname));
1200 1213
1201 notes[2].name = "CORE";
1202 notes[2].type = NT_TASKSTRUCT;
1203 notes[2].datasz = sizeof(*current);
1204 notes[2].data = current;
1205
1206 /* Try to dump the FPU. */ 1214 /* Try to dump the FPU. */
1207 prstatus.pr_fpvalid = dump_fpu (regs, &fpu); 1215 prstatus.pr_fpvalid = dump_fpu (regs, &fpu);
1208 if (!prstatus.pr_fpvalid) { 1216 if (!prstatus.pr_fpvalid) {
1209 numnote--; 1217 numnote--;
1210 } else { 1218 } else {
1211 notes[3].name = "CORE"; 1219 notes[2].name = "CORE";
1212 notes[3].type = NT_PRFPREG; 1220 notes[2].type = NT_PRFPREG;
1213 notes[3].datasz = sizeof(fpu); 1221 notes[2].datasz = sizeof(fpu);
1214 notes[3].data = &fpu; 1222 notes[2].data = &fpu;
1215 } 1223 }
1216 1224
1217 /* Write notes phdr entry. */ 1225 /* Write notes phdr entry. */
@@ -1256,8 +1264,10 @@ static int irix_core_dump(long signr, struct pt_regs * regs, struct file *file)
1256 phdr.p_memsz = sz; 1264 phdr.p_memsz = sz;
1257 offset += phdr.p_filesz; 1265 offset += phdr.p_filesz;
1258 phdr.p_flags = vma->vm_flags & VM_READ ? PF_R : 0; 1266 phdr.p_flags = vma->vm_flags & VM_READ ? PF_R : 0;
1259 if (vma->vm_flags & VM_WRITE) phdr.p_flags |= PF_W; 1267 if (vma->vm_flags & VM_WRITE)
1260 if (vma->vm_flags & VM_EXEC) phdr.p_flags |= PF_X; 1268 phdr.p_flags |= PF_W;
1269 if (vma->vm_flags & VM_EXEC)
1270 phdr.p_flags |= PF_X;
1261 phdr.p_align = PAGE_SIZE; 1271 phdr.p_align = PAGE_SIZE;
1262 1272
1263 DUMP_WRITE(&phdr, sizeof(phdr)); 1273 DUMP_WRITE(&phdr, sizeof(phdr));
@@ -1283,7 +1293,7 @@ static int irix_core_dump(long signr, struct pt_regs * regs, struct file *file)
1283#ifdef DEBUG 1293#ifdef DEBUG
1284 printk("elf_core_dump: writing %08lx %lx\n", addr, len); 1294 printk("elf_core_dump: writing %08lx %lx\n", addr, len);
1285#endif 1295#endif
1286 DUMP_WRITE((void *)addr, len); 1296 DUMP_WRITE((void __user *)addr, len);
1287 } 1297 }
1288 1298
1289 if ((off_t) file->f_pos != offset) { 1299 if ((off_t) file->f_pos != offset) {
@@ -1299,7 +1309,7 @@ end_coredump:
1299 1309
1300static int __init init_irix_binfmt(void) 1310static int __init init_irix_binfmt(void)
1301{ 1311{
1302 int init_inventory(void); 1312 extern int init_inventory(void);
1303 extern asmlinkage unsigned long sys_call_table; 1313 extern asmlinkage unsigned long sys_call_table;
1304 extern asmlinkage unsigned long sys_call_table_irix5; 1314 extern asmlinkage unsigned long sys_call_table_irix5;
1305 1315
@@ -1318,7 +1328,9 @@ static int __init init_irix_binfmt(void)
1318 1328
1319static void __exit exit_irix_binfmt(void) 1329static void __exit exit_irix_binfmt(void)
1320{ 1330{
1321 /* Remove the IRIX ELF loaders. */ 1331 /*
1332 * Remove the Irix ELF loader.
1333 */
1322 unregister_binfmt(&irix_format); 1334 unregister_binfmt(&irix_format);
1323} 1335}
1324 1336
diff --git a/arch/mips/kernel/irixinv.c b/arch/mips/kernel/irixinv.c
index 60aa98cd1791..de8584f62311 100644
--- a/arch/mips/kernel/irixinv.c
+++ b/arch/mips/kernel/irixinv.c
@@ -30,10 +30,10 @@ 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 *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 = userbuf; 36 inventory_t __user *user = userbuf;
37 int v; 37 int v;
38 38
39 if (!access_ok(VERIFY_WRITE, userbuf, size)) 39 if (!access_ok(VERIFY_WRITE, userbuf, size))
@@ -41,7 +41,8 @@ int dump_inventory_to_user (void *userbuf, int size)
41 41
42 for (v = 0; v < inventory_items; v++){ 42 for (v = 0; v < inventory_items; v++){
43 inv = &inventory [v]; 43 inv = &inventory [v];
44 copy_to_user (user, inv, sizeof (inventory_t)); 44 if (copy_to_user (user, inv, sizeof (inventory_t)))
45 return -EFAULT;
45 user++; 46 user++;
46 } 47 }
47 return inventory_items * sizeof (inventory_t); 48 return inventory_items * sizeof (inventory_t);
diff --git a/arch/mips/kernel/irixioctl.c b/arch/mips/kernel/irixioctl.c
index 3cdc22346f4c..e2863821a3dd 100644
--- a/arch/mips/kernel/irixioctl.c
+++ b/arch/mips/kernel/irixioctl.c
@@ -59,7 +59,7 @@ asmlinkage int irix_ioctl(int fd, unsigned long cmd, unsigned long arg)
59{ 59{
60 struct tty_struct *tp, *rtp; 60 struct tty_struct *tp, *rtp;
61 mm_segment_t old_fs; 61 mm_segment_t old_fs;
62 int error = 0; 62 int i, error = 0;
63 63
64#ifdef DEBUG_IOCTLS 64#ifdef DEBUG_IOCTLS
65 printk("[%s:%d] irix_ioctl(%d, ", current->comm, current->pid, fd); 65 printk("[%s:%d] irix_ioctl(%d, ", current->comm, current->pid, fd);
@@ -74,12 +74,13 @@ asmlinkage int irix_ioctl(int fd, unsigned long cmd, unsigned long arg)
74 74
75 case 0x0000540d: { 75 case 0x0000540d: {
76 struct termios kt; 76 struct termios kt;
77 struct irix_termios *it = (struct irix_termios *) arg; 77 struct irix_termios __user *it =
78 (struct irix_termios __user *) arg;
78 79
79#ifdef DEBUG_IOCTLS 80#ifdef DEBUG_IOCTLS
80 printk("TCGETS, %08lx) ", arg); 81 printk("TCGETS, %08lx) ", arg);
81#endif 82#endif
82 if(!access_ok(VERIFY_WRITE, it, sizeof(*it))) { 83 if (!access_ok(VERIFY_WRITE, it, sizeof(*it))) {
83 error = -EFAULT; 84 error = -EFAULT;
84 break; 85 break;
85 } 86 }
@@ -88,13 +89,14 @@ asmlinkage int irix_ioctl(int fd, unsigned long cmd, unsigned long arg)
88 set_fs(old_fs); 89 set_fs(old_fs);
89 if (error) 90 if (error)
90 break; 91 break;
91 __put_user(kt.c_iflag, &it->c_iflag); 92
92 __put_user(kt.c_oflag, &it->c_oflag); 93 error = __put_user(kt.c_iflag, &it->c_iflag);
93 __put_user(kt.c_cflag, &it->c_cflag); 94 error |= __put_user(kt.c_oflag, &it->c_oflag);
94 __put_user(kt.c_lflag, &it->c_lflag); 95 error |= __put_user(kt.c_cflag, &it->c_cflag);
95 for(error = 0; error < NCCS; error++) 96 error |= __put_user(kt.c_lflag, &it->c_lflag);
96 __put_user(kt.c_cc[error], &it->c_cc[error]); 97
97 error = 0; 98 for (i = 0; i < NCCS; i++)
99 error |= __put_user(kt.c_cc[i], &it->c_cc[i]);
98 break; 100 break;
99 } 101 }
100 102
@@ -112,14 +114,19 @@ asmlinkage int irix_ioctl(int fd, unsigned long cmd, unsigned long arg)
112 old_fs = get_fs(); set_fs(get_ds()); 114 old_fs = get_fs(); set_fs(get_ds());
113 error = sys_ioctl(fd, TCGETS, (unsigned long) &kt); 115 error = sys_ioctl(fd, TCGETS, (unsigned long) &kt);
114 set_fs(old_fs); 116 set_fs(old_fs);
115 if(error) 117 if (error)
118 break;
119
120 error = __get_user(kt.c_iflag, &it->c_iflag);
121 error |= __get_user(kt.c_oflag, &it->c_oflag);
122 error |= __get_user(kt.c_cflag, &it->c_cflag);
123 error |= __get_user(kt.c_lflag, &it->c_lflag);
124
125 for (i = 0; i < NCCS; i++)
126 error |= __get_user(kt.c_cc[i], &it->c_cc[i]);
127
128 if (error)
116 break; 129 break;
117 __get_user(kt.c_iflag, &it->c_iflag);
118 __get_user(kt.c_oflag, &it->c_oflag);
119 __get_user(kt.c_cflag, &it->c_cflag);
120 __get_user(kt.c_lflag, &it->c_lflag);
121 for(error = 0; error < NCCS; error++)
122 __get_user(kt.c_cc[error], &it->c_cc[error]);
123 old_fs = get_fs(); set_fs(get_ds()); 130 old_fs = get_fs(); set_fs(get_ds());
124 error = sys_ioctl(fd, TCSETS, (unsigned long) &kt); 131 error = sys_ioctl(fd, TCSETS, (unsigned long) &kt);
125 set_fs(old_fs); 132 set_fs(old_fs);
@@ -153,7 +160,7 @@ asmlinkage int irix_ioctl(int fd, unsigned long cmd, unsigned long arg)
153#ifdef DEBUG_IOCTLS 160#ifdef DEBUG_IOCTLS
154 printk("rtp->session=%d ", rtp->session); 161 printk("rtp->session=%d ", rtp->session);
155#endif 162#endif
156 error = put_user(rtp->session, (unsigned long *) arg); 163 error = put_user(rtp->session, (unsigned long __user *) arg);
157 break; 164 break;
158 165
159 case 0x746e: 166 case 0x746e:
@@ -195,50 +202,32 @@ asmlinkage int irix_ioctl(int fd, unsigned long cmd, unsigned long arg)
195 break; 202 break;
196 203
197 case 0x8004667e: 204 case 0x8004667e:
198#ifdef DEBUG_IOCTLS
199 printk("FIONBIO, %08lx) arg=%d ", arg, *(int *)arg);
200#endif
201 error = sys_ioctl(fd, FIONBIO, arg); 205 error = sys_ioctl(fd, FIONBIO, arg);
202 break; 206 break;
203 207
204 case 0x80047476: 208 case 0x80047476:
205#ifdef DEBUG_IOCTLS
206 printk("TIOCSPGRP, %08lx) arg=%d ", arg, *(int *)arg);
207#endif
208 error = sys_ioctl(fd, TIOCSPGRP, arg); 209 error = sys_ioctl(fd, TIOCSPGRP, arg);
209 break; 210 break;
210 211
211 case 0x8020690c: 212 case 0x8020690c:
212#ifdef DEBUG_IOCTLS
213 printk("SIOCSIFADDR, %08lx) arg=%d ", arg, *(int *)arg);
214#endif
215 error = sys_ioctl(fd, SIOCSIFADDR, arg); 213 error = sys_ioctl(fd, SIOCSIFADDR, arg);
216 break; 214 break;
217 215
218 case 0x80206910: 216 case 0x80206910:
219#ifdef DEBUG_IOCTLS
220 printk("SIOCSIFFLAGS, %08lx) arg=%d ", arg, *(int *)arg);
221#endif
222 error = sys_ioctl(fd, SIOCSIFFLAGS, arg); 217 error = sys_ioctl(fd, SIOCSIFFLAGS, arg);
223 break; 218 break;
224 219
225 case 0xc0206911: 220 case 0xc0206911:
226#ifdef DEBUG_IOCTLS
227 printk("SIOCGIFFLAGS, %08lx) arg=%d ", arg, *(int *)arg);
228#endif
229 error = sys_ioctl(fd, SIOCGIFFLAGS, arg); 221 error = sys_ioctl(fd, SIOCGIFFLAGS, arg);
230 break; 222 break;
231 223
232 case 0xc020691b: 224 case 0xc020691b:
233#ifdef DEBUG_IOCTLS
234 printk("SIOCGIFMETRIC, %08lx) arg=%d ", arg, *(int *)arg);
235#endif
236 error = sys_ioctl(fd, SIOCGIFMETRIC, arg); 225 error = sys_ioctl(fd, SIOCGIFMETRIC, arg);
237 break; 226 break;
238 227
239 default: { 228 default: {
240#ifdef DEBUG_MISSING_IOCTL 229#ifdef DEBUG_MISSING_IOCTL
241 char *msg = "Unimplemented IOCTL cmd tell linux@engr.sgi.com\n"; 230 char *msg = "Unimplemented IOCTL cmd tell linux-mips@linux-mips.org\n";
242 231
243#ifdef DEBUG_IOCTLS 232#ifdef DEBUG_IOCTLS
244 printk("UNIMP_IOCTL, %08lx)\n", arg); 233 printk("UNIMP_IOCTL, %08lx)\n", arg);
diff --git a/arch/mips/kernel/irixsig.c b/arch/mips/kernel/irixsig.c
index eff89322ba50..908e63684208 100644
--- a/arch/mips/kernel/irixsig.c
+++ b/arch/mips/kernel/irixsig.c
@@ -76,36 +76,39 @@ static inline void dump_irix5_sigctx(struct sigctx_irix5 *c)
76} 76}
77#endif 77#endif
78 78
79static void setup_irix_frame(struct k_sigaction *ka, struct pt_regs *regs, 79static int setup_irix_frame(struct k_sigaction *ka, struct pt_regs *regs,
80 int signr, sigset_t *oldmask) 80 int signr, sigset_t *oldmask)
81{ 81{
82 struct sigctx_irix5 __user *ctx;
82 unsigned long sp; 83 unsigned long sp;
83 struct sigctx_irix5 *ctx; 84 int error, i;
84 int i;
85 85
86 sp = regs->regs[29]; 86 sp = regs->regs[29];
87 sp -= sizeof(struct sigctx_irix5); 87 sp -= sizeof(struct sigctx_irix5);
88 sp &= ~(0xf); 88 sp &= ~(0xf);
89 ctx = (struct sigctx_irix5 *) sp; 89 ctx = (struct sigctx_irix5 __user *) sp;
90 if (!access_ok(VERIFY_WRITE, ctx, sizeof(*ctx))) 90 if (!access_ok(VERIFY_WRITE, ctx, sizeof(*ctx)))
91 goto segv_and_exit; 91 goto segv_and_exit;
92 92
93 __put_user(0, &ctx->weird_fpu_thing); 93 error = __put_user(0, &ctx->weird_fpu_thing);
94 __put_user(~(0x00000001), &ctx->rmask); 94 error |= __put_user(~(0x00000001), &ctx->rmask);
95 __put_user(0, &ctx->regs[0]); 95 error |= __put_user(0, &ctx->regs[0]);
96 for(i = 1; i < 32; i++) 96 for(i = 1; i < 32; i++)
97 __put_user((u64) regs->regs[i], &ctx->regs[i]); 97 error |= __put_user((u64) regs->regs[i], &ctx->regs[i]);
98
99 error |= __put_user((u64) regs->hi, &ctx->hi);
100 error |= __put_user((u64) regs->lo, &ctx->lo);
101 error |= __put_user((u64) regs->cp0_epc, &ctx->pc);
102 error |= __put_user(!!used_math(), &ctx->usedfp);
103 error |= __put_user((u64) regs->cp0_cause, &ctx->cp0_cause);
104 error |= __put_user((u64) regs->cp0_badvaddr, &ctx->cp0_badvaddr);
98 105
99 __put_user((u64) regs->hi, &ctx->hi); 106 error |= __put_user(0, &ctx->sstk_flags); /* XXX sigstack unimp... todo... */
100 __put_user((u64) regs->lo, &ctx->lo);
101 __put_user((u64) regs->cp0_epc, &ctx->pc);
102 __put_user(!!used_math(), &ctx->usedfp);
103 __put_user((u64) regs->cp0_cause, &ctx->cp0_cause);
104 __put_user((u64) regs->cp0_badvaddr, &ctx->cp0_badvaddr);
105 107
106 __put_user(0, &ctx->sstk_flags); /* XXX sigstack unimp... todo... */ 108 error |= __copy_to_user(&ctx->sigset, oldmask, sizeof(irix_sigset_t)) ? -EFAULT : 0;
107 109
108 __copy_to_user(&ctx->sigset, oldmask, sizeof(irix_sigset_t)); 110 if (error)
111 goto segv_and_exit;
109 112
110#ifdef DEBUG_SIG 113#ifdef DEBUG_SIG
111 dump_irix5_sigctx(ctx); 114 dump_irix5_sigctx(ctx);
@@ -117,13 +120,14 @@ static void setup_irix_frame(struct k_sigaction *ka, struct pt_regs *regs,
117 regs->regs[7] = (unsigned long) ka->sa.sa_handler; 120 regs->regs[7] = (unsigned long) ka->sa.sa_handler;
118 regs->regs[25] = regs->cp0_epc = (unsigned long) ka->sa_restorer; 121 regs->regs[25] = regs->cp0_epc = (unsigned long) ka->sa_restorer;
119 122
120 return; 123 return 1;
121 124
122segv_and_exit: 125segv_and_exit:
123 force_sigsegv(signr, current); 126 force_sigsegv(signr, current);
127 return 0;
124} 128}
125 129
126static void inline 130static int inline
127setup_irix_rt_frame(struct k_sigaction * ka, struct pt_regs *regs, 131setup_irix_rt_frame(struct k_sigaction * ka, struct pt_regs *regs,
128 int signr, sigset_t *oldmask, siginfo_t *info) 132 int signr, sigset_t *oldmask, siginfo_t *info)
129{ 133{
@@ -131,9 +135,11 @@ setup_irix_rt_frame(struct k_sigaction * ka, struct pt_regs *regs,
131 do_exit(SIGSEGV); 135 do_exit(SIGSEGV);
132} 136}
133 137
134static inline void handle_signal(unsigned long sig, siginfo_t *info, 138static inline int handle_signal(unsigned long sig, siginfo_t *info,
135 struct k_sigaction *ka, sigset_t *oldset, struct pt_regs * regs) 139 struct k_sigaction *ka, sigset_t *oldset, struct pt_regs * regs)
136{ 140{
141 int ret;
142
137 switch(regs->regs[0]) { 143 switch(regs->regs[0]) {
138 case ERESTARTNOHAND: 144 case ERESTARTNOHAND:
139 regs->regs[2] = EINTR; 145 regs->regs[2] = EINTR;
@@ -151,9 +157,9 @@ static inline void handle_signal(unsigned long sig, siginfo_t *info,
151 regs->regs[0] = 0; /* Don't deal with this again. */ 157 regs->regs[0] = 0; /* Don't deal with this again. */
152 158
153 if (ka->sa.sa_flags & SA_SIGINFO) 159 if (ka->sa.sa_flags & SA_SIGINFO)
154 setup_irix_rt_frame(ka, regs, sig, oldset, info); 160 ret = setup_irix_rt_frame(ka, regs, sig, oldset, info);
155 else 161 else
156 setup_irix_frame(ka, regs, sig, oldset); 162 ret = setup_irix_frame(ka, regs, sig, oldset);
157 163
158 spin_lock_irq(&current->sighand->siglock); 164 spin_lock_irq(&current->sighand->siglock);
159 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 165 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
@@ -161,6 +167,8 @@ static inline void handle_signal(unsigned long sig, siginfo_t *info,
161 sigaddset(&current->blocked,sig); 167 sigaddset(&current->blocked,sig);
162 recalc_sigpending(); 168 recalc_sigpending();
163 spin_unlock_irq(&current->sighand->siglock); 169 spin_unlock_irq(&current->sighand->siglock);
170
171 return ret;
164} 172}
165 173
166asmlinkage int do_irix_signal(sigset_t *oldset, struct pt_regs *regs) 174asmlinkage int do_irix_signal(sigset_t *oldset, struct pt_regs *regs)
@@ -184,10 +192,8 @@ asmlinkage int do_irix_signal(sigset_t *oldset, struct pt_regs *regs)
184 oldset = &current->blocked; 192 oldset = &current->blocked;
185 193
186 signr = get_signal_to_deliver(&info, &ka, regs, NULL); 194 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
187 if (signr > 0) { 195 if (signr > 0)
188 handle_signal(signr, &info, &ka, oldset, regs); 196 return handle_signal(signr, &info, &ka, oldset, regs);
189 return 1;
190 }
191 197
192no_signal: 198no_signal:
193 /* 199 /*
@@ -208,10 +214,11 @@ no_signal:
208asmlinkage void 214asmlinkage void
209irix_sigreturn(struct pt_regs *regs) 215irix_sigreturn(struct pt_regs *regs)
210{ 216{
211 struct sigctx_irix5 *context, *magic; 217 struct sigctx_irix5 __user *context, *magic;
212 unsigned long umask, mask; 218 unsigned long umask, mask;
213 u64 *fregs; 219 u64 *fregs;
214 int sig, i, base = 0; 220 u32 usedfp;
221 int error, sig, i, base = 0;
215 sigset_t blocked; 222 sigset_t blocked;
216 223
217 /* Always make any pending restarted system calls return -EINTR */ 224 /* Always make any pending restarted system calls return -EINTR */
@@ -220,8 +227,8 @@ irix_sigreturn(struct pt_regs *regs)
220 if (regs->regs[2] == 1000) 227 if (regs->regs[2] == 1000)
221 base = 1; 228 base = 1;
222 229
223 context = (struct sigctx_irix5 *) regs->regs[base + 4]; 230 context = (struct sigctx_irix5 __user *) regs->regs[base + 4];
224 magic = (struct sigctx_irix5 *) regs->regs[base + 5]; 231 magic = (struct sigctx_irix5 __user *) regs->regs[base + 5];
225 sig = (int) regs->regs[base + 6]; 232 sig = (int) regs->regs[base + 6];
226#ifdef DEBUG_SIG 233#ifdef DEBUG_SIG
227 printk("[%s:%d] IRIX sigreturn(scp[%p],ucp[%p],sig[%d])\n", 234 printk("[%s:%d] IRIX sigreturn(scp[%p],ucp[%p],sig[%d])\n",
@@ -236,25 +243,31 @@ irix_sigreturn(struct pt_regs *regs)
236 dump_irix5_sigctx(context); 243 dump_irix5_sigctx(context);
237#endif 244#endif
238 245
239 __get_user(regs->cp0_epc, &context->pc); 246 error = __get_user(regs->cp0_epc, &context->pc);
240 umask = context->rmask; mask = 2; 247 error |= __get_user(umask, &context->rmask);
248
249 mask = 2;
241 for (i = 1; i < 32; i++, mask <<= 1) { 250 for (i = 1; i < 32; i++, mask <<= 1) {
242 if(umask & mask) 251 if (umask & mask)
243 __get_user(regs->regs[i], &context->regs[i]); 252 error |= __get_user(regs->regs[i], &context->regs[i]);
244 } 253 }
245 __get_user(regs->hi, &context->hi); 254 error |= __get_user(regs->hi, &context->hi);
246 __get_user(regs->lo, &context->lo); 255 error |= __get_user(regs->lo, &context->lo);
247 256
248 if ((umask & 1) && context->usedfp) { 257 error |= __get_user(usedfp, &context->usedfp);
258 if ((umask & 1) && usedfp) {
249 fregs = (u64 *) &current->thread.fpu; 259 fregs = (u64 *) &current->thread.fpu;
260
250 for(i = 0; i < 32; i++) 261 for(i = 0; i < 32; i++)
251 fregs[i] = (u64) context->fpregs[i]; 262 error |= __get_user(fregs[i], &context->fpregs[i]);
252 __get_user(current->thread.fpu.hard.fcr31, &context->fpcsr); 263 error |= __get_user(current->thread.fpu.hard.fcr31, &context->fpcsr);
253 } 264 }
254 265
255 /* XXX do sigstack crapola here... XXX */ 266 /* XXX do sigstack crapola here... XXX */
256 267
257 if (__copy_from_user(&blocked, &context->sigset, sizeof(blocked))) 268 error |= __copy_from_user(&blocked, &context->sigset, sizeof(blocked)) ? -EFAULT : 0;
269
270 if (error)
258 goto badframe; 271 goto badframe;
259 272
260 sigdelsetmask(&blocked, ~_BLOCKABLE); 273 sigdelsetmask(&blocked, ~_BLOCKABLE);
@@ -296,8 +309,8 @@ static inline void dump_sigact_irix5(struct sigact_irix5 *p)
296#endif 309#endif
297 310
298asmlinkage int 311asmlinkage int
299irix_sigaction(int sig, const struct sigaction *act, 312irix_sigaction(int sig, const struct sigaction __user *act,
300 struct sigaction *oact, void *trampoline) 313 struct sigaction __user *oact, void __user *trampoline)
301{ 314{
302 struct k_sigaction new_ka, old_ka; 315 struct k_sigaction new_ka, old_ka;
303 int ret; 316 int ret;
@@ -311,12 +324,16 @@ irix_sigaction(int sig, const struct sigaction *act,
311#endif 324#endif
312 if (act) { 325 if (act) {
313 sigset_t mask; 326 sigset_t mask;
314 if (!access_ok(VERIFY_READ, act, sizeof(*act)) || 327 int err;
315 __get_user(new_ka.sa.sa_handler, &act->sa_handler) || 328
316 __get_user(new_ka.sa.sa_flags, &act->sa_flags)) 329 if (!access_ok(VERIFY_READ, act, sizeof(*act)))
317 return -EFAULT; 330 return -EFAULT;
331 err = __get_user(new_ka.sa.sa_handler, &act->sa_handler);
332 err |= __get_user(new_ka.sa.sa_flags, &act->sa_flags);
318 333
319 __copy_from_user(&mask, &act->sa_mask, sizeof(sigset_t)); 334 err |= __copy_from_user(&mask, &act->sa_mask, sizeof(sigset_t)) ? -EFAULT : 0;
335 if (err)
336 return err;
320 337
321 /* 338 /*
322 * Hmmm... methinks IRIX libc always passes a valid trampoline 339 * Hmmm... methinks IRIX libc always passes a valid trampoline
@@ -330,30 +347,37 @@ irix_sigaction(int sig, const struct sigaction *act,
330 ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); 347 ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
331 348
332 if (!ret && oact) { 349 if (!ret && oact) {
333 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || 350 int err;
334 __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || 351
335 __put_user(old_ka.sa.sa_flags, &oact->sa_flags)) 352 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)))
353 return -EFAULT;
354
355 err = __put_user(old_ka.sa.sa_handler, &oact->sa_handler);
356 err |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags);
357 err |= __copy_to_user(&oact->sa_mask, &old_ka.sa.sa_mask,
358 sizeof(sigset_t)) ? -EFAULT : 0;
359 if (err)
336 return -EFAULT; 360 return -EFAULT;
337 __copy_to_user(&old_ka.sa.sa_mask, &oact->sa_mask,
338 sizeof(sigset_t));
339 } 361 }
340 362
341 return ret; 363 return ret;
342} 364}
343 365
344asmlinkage int irix_sigpending(irix_sigset_t *set) 366asmlinkage int irix_sigpending(irix_sigset_t __user *set)
345{ 367{
346 return do_sigpending(set, sizeof(*set)); 368 return do_sigpending(set, sizeof(*set));
347} 369}
348 370
349asmlinkage int irix_sigprocmask(int how, irix_sigset_t *new, irix_sigset_t *old) 371asmlinkage int irix_sigprocmask(int how, irix_sigset_t __user *new,
372 irix_sigset_t __user *old)
350{ 373{
351 sigset_t oldbits, newbits; 374 sigset_t oldbits, newbits;
352 375
353 if (new) { 376 if (new) {
354 if (!access_ok(VERIFY_READ, new, sizeof(*new))) 377 if (!access_ok(VERIFY_READ, new, sizeof(*new)))
355 return -EFAULT; 378 return -EFAULT;
356 __copy_from_user(&newbits, new, sizeof(unsigned long)*4); 379 if (__copy_from_user(&newbits, new, sizeof(unsigned long)*4))
380 return -EFAULT;
357 sigdelsetmask(&newbits, ~_BLOCKABLE); 381 sigdelsetmask(&newbits, ~_BLOCKABLE);
358 382
359 spin_lock_irq(&current->sighand->siglock); 383 spin_lock_irq(&current->sighand->siglock);
@@ -381,20 +405,19 @@ asmlinkage int irix_sigprocmask(int how, irix_sigset_t *new, irix_sigset_t *old)
381 recalc_sigpending(); 405 recalc_sigpending();
382 spin_unlock_irq(&current->sighand->siglock); 406 spin_unlock_irq(&current->sighand->siglock);
383 } 407 }
384 if(old) { 408 if (old)
385 if (!access_ok(VERIFY_WRITE, old, sizeof(*old))) 409 return copy_to_user(old, &current->blocked,
386 return -EFAULT; 410 sizeof(unsigned long)*4) ? -EFAULT : 0;
387 __copy_to_user(old, &current->blocked, sizeof(unsigned long)*4);
388 }
389 411
390 return 0; 412 return 0;
391} 413}
392 414
393asmlinkage int irix_sigsuspend(struct pt_regs *regs) 415asmlinkage int irix_sigsuspend(struct pt_regs *regs)
394{ 416{
395 sigset_t *uset, saveset, newset; 417 sigset_t saveset, newset;
418 sigset_t __user *uset;
396 419
397 uset = (sigset_t *) regs->regs[4]; 420 uset = (sigset_t __user *) regs->regs[4];
398 if (copy_from_user(&newset, uset, sizeof(sigset_t))) 421 if (copy_from_user(&newset, uset, sizeof(sigset_t)))
399 return -EFAULT; 422 return -EFAULT;
400 sigdelsetmask(&newset, ~_BLOCKABLE); 423 sigdelsetmask(&newset, ~_BLOCKABLE);
@@ -440,12 +463,13 @@ struct irix5_siginfo {
440 } stuff; 463 } stuff;
441}; 464};
442 465
443asmlinkage int irix_sigpoll_sys(unsigned long *set, struct irix5_siginfo *info, 466asmlinkage int irix_sigpoll_sys(unsigned long __user *set,
444 struct timespec *tp) 467 struct irix5_siginfo __user *info, struct timespec __user *tp)
445{ 468{
446 long expire = MAX_SCHEDULE_TIMEOUT; 469 long expire = MAX_SCHEDULE_TIMEOUT;
447 sigset_t kset; 470 sigset_t kset;
448 int i, sig, error, timeo = 0; 471 int i, sig, error, timeo = 0;
472 struct timespec ktp;
449 473
450#ifdef DEBUG_SIG 474#ifdef DEBUG_SIG
451 printk("[%s:%d] irix_sigpoll_sys(%p,%p,%p)\n", 475 printk("[%s:%d] irix_sigpoll_sys(%p,%p,%p)\n",
@@ -456,14 +480,8 @@ asmlinkage int irix_sigpoll_sys(unsigned long *set, struct irix5_siginfo *info,
456 if (!set) 480 if (!set)
457 return -EINVAL; 481 return -EINVAL;
458 482
459 if (!access_ok(VERIFY_READ, set, sizeof(kset))) { 483 if (copy_from_user(&kset, set, sizeof(set)))
460 error = -EFAULT; 484 return -EFAULT;
461 goto out;
462 }
463
464 __copy_from_user(&kset, set, sizeof(set));
465 if (error)
466 goto out;
467 485
468 if (info && clear_user(info, sizeof(*info))) { 486 if (info && clear_user(info, sizeof(*info))) {
469 error = -EFAULT; 487 error = -EFAULT;
@@ -471,19 +489,21 @@ asmlinkage int irix_sigpoll_sys(unsigned long *set, struct irix5_siginfo *info,
471 } 489 }
472 490
473 if (tp) { 491 if (tp) {
474 if (!access_ok(VERIFY_READ, tp, sizeof(*tp))) 492 if (copy_from_user(&ktp, tp, sizeof(*tp)))
475 return -EFAULT; 493 return -EFAULT;
476 if (!tp->tv_sec && !tp->tv_nsec) { 494
477 error = -EINVAL; 495 if (!ktp.tv_sec && !ktp.tv_nsec)
478 goto out; 496 return -EINVAL;
479 } 497
480 expire = timespec_to_jiffies(tp) + (tp->tv_sec||tp->tv_nsec); 498 expire = timespec_to_jiffies(&ktp) +
499 (ktp.tv_sec || ktp.tv_nsec);
481 } 500 }
482 501
483 while(1) { 502 while(1) {
484 long tmp = 0; 503 long tmp = 0;
485 504
486 expire = schedule_timeout_interruptible(expire); 505 current->state = TASK_INTERRUPTIBLE;
506 expire = schedule_timeout(expire);
487 507
488 for (i=0; i<=4; i++) 508 for (i=0; i<=4; i++)
489 tmp |= (current->pending.signal.sig[i] & kset.sig[i]); 509 tmp |= (current->pending.signal.sig[i] & kset.sig[i]);
@@ -500,15 +520,14 @@ asmlinkage int irix_sigpoll_sys(unsigned long *set, struct irix5_siginfo *info,
500 if (timeo) 520 if (timeo)
501 return -EAGAIN; 521 return -EAGAIN;
502 522
503 for(sig = 1; i <= 65 /* IRIX_NSIG */; sig++) { 523 for (sig = 1; i <= 65 /* IRIX_NSIG */; sig++) {
504 if (sigismember (&kset, sig)) 524 if (sigismember (&kset, sig))
505 continue; 525 continue;
506 if (sigismember (&current->pending.signal, sig)) { 526 if (sigismember (&current->pending.signal, sig)) {
507 /* XXX need more than this... */ 527 /* XXX need more than this... */
508 if (info) 528 if (info)
509 info->sig = sig; 529 return copy_to_user(&info->sig, &sig, sizeof(sig));
510 error = 0; 530 return 0;
511 goto out;
512 } 531 }
513 } 532 }
514 533
@@ -534,8 +553,9 @@ extern int getrusage(struct task_struct *, int, struct rusage __user *);
534 553
535#define W_MASK (W_EXITED | W_TRAPPED | W_STOPPED | W_CONT | W_NOHANG) 554#define W_MASK (W_EXITED | W_TRAPPED | W_STOPPED | W_CONT | W_NOHANG)
536 555
537asmlinkage int irix_waitsys(int type, int pid, struct irix5_siginfo *info, 556asmlinkage int irix_waitsys(int type, int pid,
538 int options, struct rusage *ru) 557 struct irix5_siginfo __user *info, int options,
558 struct rusage __user *ru)
539{ 559{
540 int flag, retval; 560 int flag, retval;
541 DECLARE_WAITQUEUE(wait, current); 561 DECLARE_WAITQUEUE(wait, current);
@@ -543,28 +563,22 @@ asmlinkage int irix_waitsys(int type, int pid, struct irix5_siginfo *info,
543 struct task_struct *p; 563 struct task_struct *p;
544 struct list_head *_p; 564 struct list_head *_p;
545 565
546 if (!info) { 566 if (!info)
547 retval = -EINVAL; 567 return -EINVAL;
548 goto out; 568
549 } 569 if (!access_ok(VERIFY_WRITE, info, sizeof(*info)))
550 if (!access_ok(VERIFY_WRITE, info, sizeof(*info))) { 570 return -EFAULT;
551 retval = -EFAULT; 571
552 goto out; 572 if (ru)
553 } 573 if (!access_ok(VERIFY_WRITE, ru, sizeof(*ru)))
554 if (ru) { 574 return -EFAULT;
555 if (!access_ok(VERIFY_WRITE, ru, sizeof(*ru))) { 575
556 retval = -EFAULT; 576 if (options & ~W_MASK)
557 goto out; 577 return -EINVAL;
558 } 578
559 } 579 if (type != IRIX_P_PID && type != IRIX_P_PGID && type != IRIX_P_ALL)
560 if (options & ~(W_MASK)) { 580 return -EINVAL;
561 retval = -EINVAL; 581
562 goto out;
563 }
564 if (type != IRIX_P_PID && type != IRIX_P_PGID && type != IRIX_P_ALL) {
565 retval = -EINVAL;
566 goto out;
567 }
568 add_wait_queue(&current->signal->wait_chldexit, &wait); 582 add_wait_queue(&current->signal->wait_chldexit, &wait);
569repeat: 583repeat:
570 flag = 0; 584 flag = 0;
@@ -595,18 +609,20 @@ repeat:
595 add_parent(p, p->parent); 609 add_parent(p, p->parent);
596 write_unlock_irq(&tasklist_lock); 610 write_unlock_irq(&tasklist_lock);
597 retval = ru ? getrusage(p, RUSAGE_BOTH, ru) : 0; 611 retval = ru ? getrusage(p, RUSAGE_BOTH, ru) : 0;
598 if (!retval && ru) { 612 if (retval)
599 retval |= __put_user(SIGCHLD, &info->sig); 613 goto end_waitsys;
600 retval |= __put_user(0, &info->code); 614
601 retval |= __put_user(p->pid, &info->stuff.procinfo.pid); 615 retval = __put_user(SIGCHLD, &info->sig);
602 retval |= __put_user((p->exit_code >> 8) & 0xff, 616 retval |= __put_user(0, &info->code);
603 &info->stuff.procinfo.procdata.child.status); 617 retval |= __put_user(p->pid, &info->stuff.procinfo.pid);
604 retval |= __put_user(p->utime, &info->stuff.procinfo.procdata.child.utime); 618 retval |= __put_user((p->exit_code >> 8) & 0xff,
605 retval |= __put_user(p->stime, &info->stuff.procinfo.procdata.child.stime); 619 &info->stuff.procinfo.procdata.child.status);
606 } 620 retval |= __put_user(p->utime, &info->stuff.procinfo.procdata.child.utime);
607 if (!retval) { 621 retval |= __put_user(p->stime, &info->stuff.procinfo.procdata.child.stime);
608 p->exit_code = 0; 622 if (retval)
609 } 623 goto end_waitsys;
624
625 p->exit_code = 0;
610 goto end_waitsys; 626 goto end_waitsys;
611 627
612 case EXIT_ZOMBIE: 628 case EXIT_ZOMBIE:
@@ -614,16 +630,18 @@ repeat:
614 current->signal->cstime += p->stime + p->signal->cstime; 630 current->signal->cstime += p->stime + p->signal->cstime;
615 if (ru != NULL) 631 if (ru != NULL)
616 getrusage(p, RUSAGE_BOTH, ru); 632 getrusage(p, RUSAGE_BOTH, ru);
617 __put_user(SIGCHLD, &info->sig); 633 retval = __put_user(SIGCHLD, &info->sig);
618 __put_user(1, &info->code); /* CLD_EXITED */ 634 retval |= __put_user(1, &info->code); /* CLD_EXITED */
619 __put_user(p->pid, &info->stuff.procinfo.pid); 635 retval |= __put_user(p->pid, &info->stuff.procinfo.pid);
620 __put_user((p->exit_code >> 8) & 0xff, 636 retval |= __put_user((p->exit_code >> 8) & 0xff,
621 &info->stuff.procinfo.procdata.child.status); 637 &info->stuff.procinfo.procdata.child.status);
622 __put_user(p->utime, 638 retval |= __put_user(p->utime,
623 &info->stuff.procinfo.procdata.child.utime); 639 &info->stuff.procinfo.procdata.child.utime);
624 __put_user(p->stime, 640 retval |= __put_user(p->stime,
625 &info->stuff.procinfo.procdata.child.stime); 641 &info->stuff.procinfo.procdata.child.stime);
626 retval = 0; 642 if (retval)
643 return retval;
644
627 if (p->real_parent != p->parent) { 645 if (p->real_parent != p->parent) {
628 write_lock_irq(&tasklist_lock); 646 write_lock_irq(&tasklist_lock);
629 remove_parent(p); 647 remove_parent(p);
@@ -656,7 +674,6 @@ end_waitsys:
656 current->state = TASK_RUNNING; 674 current->state = TASK_RUNNING;
657 remove_wait_queue(&current->signal->wait_chldexit, &wait); 675 remove_wait_queue(&current->signal->wait_chldexit, &wait);
658 676
659out:
660 return retval; 677 return retval;
661} 678}
662 679
@@ -675,39 +692,39 @@ struct irix5_context {
675 692
676asmlinkage int irix_getcontext(struct pt_regs *regs) 693asmlinkage int irix_getcontext(struct pt_regs *regs)
677{ 694{
678 int i, base = 0; 695 int error, i, base = 0;
679 struct irix5_context *ctx; 696 struct irix5_context __user *ctx;
680 unsigned long flags; 697 unsigned long flags;
681 698
682 if (regs->regs[2] == 1000) 699 if (regs->regs[2] == 1000)
683 base = 1; 700 base = 1;
684 ctx = (struct irix5_context *) regs->regs[base + 4]; 701 ctx = (struct irix5_context __user *) regs->regs[base + 4];
685 702
686#ifdef DEBUG_SIG 703#ifdef DEBUG_SIG
687 printk("[%s:%d] irix_getcontext(%p)\n", 704 printk("[%s:%d] irix_getcontext(%p)\n",
688 current->comm, current->pid, ctx); 705 current->comm, current->pid, ctx);
689#endif 706#endif
690 707
691 if (!access_ok(VERIFY_WRITE, ctx, sizeof(*ctx))) 708 if (!access_ok(VERIFY_WRITE, ctx, sizeof(*ctx)));
692 return -EFAULT; 709 return -EFAULT;
693 710
694 __put_user(current->thread.irix_oldctx, &ctx->link); 711 error = __put_user(current->thread.irix_oldctx, &ctx->link);
695 712
696 __copy_to_user(&ctx->sigmask, &current->blocked, sizeof(irix_sigset_t)); 713 error |= __copy_to_user(&ctx->sigmask, &current->blocked, sizeof(irix_sigset_t)) ? -EFAULT : 0;
697 714
698 /* XXX Do sigstack stuff someday... */ 715 /* XXX Do sigstack stuff someday... */
699 __put_user(0, &ctx->stack.sp); 716 error |= __put_user(0, &ctx->stack.sp);
700 __put_user(0, &ctx->stack.size); 717 error |= __put_user(0, &ctx->stack.size);
701 __put_user(0, &ctx->stack.flags); 718 error |= __put_user(0, &ctx->stack.flags);
702 719
703 __put_user(0, &ctx->weird_graphics_thing); 720 error |= __put_user(0, &ctx->weird_graphics_thing);
704 __put_user(0, &ctx->regs[0]); 721 error |= __put_user(0, &ctx->regs[0]);
705 for (i = 1; i < 32; i++) 722 for (i = 1; i < 32; i++)
706 __put_user(regs->regs[i], &ctx->regs[i]); 723 error |= __put_user(regs->regs[i], &ctx->regs[i]);
707 __put_user(regs->lo, &ctx->regs[32]); 724 error |= __put_user(regs->lo, &ctx->regs[32]);
708 __put_user(regs->hi, &ctx->regs[33]); 725 error |= __put_user(regs->hi, &ctx->regs[33]);
709 __put_user(regs->cp0_cause, &ctx->regs[34]); 726 error |= __put_user(regs->cp0_cause, &ctx->regs[34]);
710 __put_user(regs->cp0_epc, &ctx->regs[35]); 727 error |= __put_user(regs->cp0_epc, &ctx->regs[35]);
711 728
712 flags = 0x0f; 729 flags = 0x0f;
713 if (!used_math()) { 730 if (!used_math()) {
@@ -716,119 +733,124 @@ asmlinkage int irix_getcontext(struct pt_regs *regs)
716 /* XXX wheee... */ 733 /* XXX wheee... */
717 printk("Wheee, no code for saving IRIX FPU context yet.\n"); 734 printk("Wheee, no code for saving IRIX FPU context yet.\n");
718 } 735 }
719 __put_user(flags, &ctx->flags); 736 error |= __put_user(flags, &ctx->flags);
720 737
721 return 0; 738 return error;
722} 739}
723 740
724asmlinkage unsigned long irix_setcontext(struct pt_regs *regs) 741asmlinkage void irix_setcontext(struct pt_regs *regs)
725{ 742{
726 int error, base = 0; 743 struct irix5_context __user *ctx;
727 struct irix5_context *ctx; 744 int err, base = 0;
745 u32 flags;
728 746
729 if(regs->regs[2] == 1000) 747 if (regs->regs[2] == 1000)
730 base = 1; 748 base = 1;
731 ctx = (struct irix5_context *) regs->regs[base + 4]; 749 ctx = (struct irix5_context __user *) regs->regs[base + 4];
732 750
733#ifdef DEBUG_SIG 751#ifdef DEBUG_SIG
734 printk("[%s:%d] irix_setcontext(%p)\n", 752 printk("[%s:%d] irix_setcontext(%p)\n",
735 current->comm, current->pid, ctx); 753 current->comm, current->pid, ctx);
736#endif 754#endif
737 755
738 if (!access_ok(VERIFY_READ, ctx, sizeof(*ctx))) { 756 if (!access_ok(VERIFY_READ, ctx, sizeof(*ctx)))
739 error = -EFAULT; 757 goto segv_and_exit;
740 goto out;
741 }
742 758
743 if (ctx->flags & 0x02) { 759 err = __get_user(flags, &ctx->flags);
760 if (flags & 0x02) {
744 /* XXX sigstack garbage, todo... */ 761 /* XXX sigstack garbage, todo... */
745 printk("Wheee, cannot do sigstack stuff in setcontext\n"); 762 printk("Wheee, cannot do sigstack stuff in setcontext\n");
746 } 763 }
747 764
748 if (ctx->flags & 0x04) { 765 if (flags & 0x04) {
749 int i; 766 int i;
750 767
751 /* XXX extra control block stuff... todo... */ 768 /* XXX extra control block stuff... todo... */
752 for(i = 1; i < 32; i++) 769 for (i = 1; i < 32; i++)
753 regs->regs[i] = ctx->regs[i]; 770 err |= __get_user(regs->regs[i], &ctx->regs[i]);
754 regs->lo = ctx->regs[32]; 771 err |= __get_user(regs->lo, &ctx->regs[32]);
755 regs->hi = ctx->regs[33]; 772 err |= __get_user(regs->hi, &ctx->regs[33]);
756 regs->cp0_epc = ctx->regs[35]; 773 err |= __get_user(regs->cp0_epc, &ctx->regs[35]);
757 } 774 }
758 775
759 if (ctx->flags & 0x08) { 776 if (flags & 0x08)
760 /* XXX fpu context, blah... */ 777 /* XXX fpu context, blah... */
761 printk("Wheee, cannot restore FPU context yet...\n"); 778 printk(KERN_ERR "Wheee, cannot restore FPU context yet...\n");
762 }
763 current->thread.irix_oldctx = ctx->link;
764 error = regs->regs[2];
765 779
766out: 780 err |= __get_user(current->thread.irix_oldctx, &ctx->link);
767 return error; 781 if (err)
782 goto segv_and_exit;
783
784 /*
785 * Don't let your children do this ...
786 */
787 if (current_thread_info()->flags & TIF_SYSCALL_TRACE)
788 do_syscall_trace(regs, 1);
789 __asm__ __volatile__(
790 "move\t$29,%0\n\t"
791 "j\tsyscall_exit"
792 :/* no outputs */
793 :"r" (&regs));
794 /* Unreached */
795
796segv_and_exit:
797 force_sigsegv(SIGSEGV, current);
768} 798}
769 799
770struct irix_sigstack { unsigned long sp; int status; }; 800struct irix_sigstack {
801 unsigned long sp;
802 int status;
803};
771 804
772asmlinkage int irix_sigstack(struct irix_sigstack *new, struct irix_sigstack *old) 805asmlinkage int irix_sigstack(struct irix_sigstack __user *new,
806 struct irix_sigstack __user *old)
773{ 807{
774 int error = -EFAULT;
775
776#ifdef DEBUG_SIG 808#ifdef DEBUG_SIG
777 printk("[%s:%d] irix_sigstack(%p,%p)\n", 809 printk("[%s:%d] irix_sigstack(%p,%p)\n",
778 current->comm, current->pid, new, old); 810 current->comm, current->pid, new, old);
779#endif 811#endif
780 if(new) { 812 if (new) {
781 if (!access_ok(VERIFY_READ, new, sizeof(*new))) 813 if (!access_ok(VERIFY_READ, new, sizeof(*new)))
782 goto out; 814 return -EFAULT;
783 } 815 }
784 816
785 if(old) { 817 if (old) {
786 if (!access_ok(VERIFY_WRITE, old, sizeof(*old))) 818 if (!access_ok(VERIFY_WRITE, old, sizeof(*old)))
787 goto out; 819 return -EFAULT;
788 } 820 }
789 error = 0;
790 821
791out: 822 return 0;
792 return error;
793} 823}
794 824
795struct irix_sigaltstack { unsigned long sp; int size; int status; }; 825struct irix_sigaltstack { unsigned long sp; int size; int status; };
796 826
797asmlinkage int irix_sigaltstack(struct irix_sigaltstack *new, 827asmlinkage int irix_sigaltstack(struct irix_sigaltstack __user *new,
798 struct irix_sigaltstack *old) 828 struct irix_sigaltstack __user *old)
799{ 829{
800 int error = -EFAULT;
801
802#ifdef DEBUG_SIG 830#ifdef DEBUG_SIG
803 printk("[%s:%d] irix_sigaltstack(%p,%p)\n", 831 printk("[%s:%d] irix_sigaltstack(%p,%p)\n",
804 current->comm, current->pid, new, old); 832 current->comm, current->pid, new, old);
805#endif 833#endif
806 if (new) { 834 if (new)
807 if (!access_ok(VERIFY_READ, new, sizeof(*new))) 835 if (!access_ok(VERIFY_READ, new, sizeof(*new)))
808 goto out; 836 return -EFAULT;
809 }
810 837
811 if (old) { 838 if (old) {
812 if (!access_ok(VERIFY_WRITE, old, sizeof(*old))) 839 if (!access_ok(VERIFY_WRITE, old, sizeof(*old)))
813 goto out; 840 return -EFAULT;
814 } 841 }
815 error = 0;
816
817out:
818 error = 0;
819 842
820 return error; 843 return 0;
821} 844}
822 845
823struct irix_procset { 846struct irix_procset {
824 int cmd, ltype, lid, rtype, rid; 847 int cmd, ltype, lid, rtype, rid;
825}; 848};
826 849
827asmlinkage int irix_sigsendset(struct irix_procset *pset, int sig) 850asmlinkage int irix_sigsendset(struct irix_procset __user *pset, int sig)
828{ 851{
829 if (!access_ok(VERIFY_READ, pset, sizeof(*pset))) 852 if (!access_ok(VERIFY_READ, pset, sizeof(*pset)))
830 return -EFAULT; 853 return -EFAULT;
831
832#ifdef DEBUG_SIG 854#ifdef DEBUG_SIG
833 printk("[%s:%d] irix_sigsendset([%d,%d,%d,%d,%d],%d)\n", 855 printk("[%s:%d] irix_sigsendset([%d,%d,%d,%d,%d],%d)\n",
834 current->comm, current->pid, 856 current->comm, current->pid,
diff --git a/arch/mips/kernel/irq-msc01.c b/arch/mips/kernel/irq-msc01.c
index 43c00ac0b88d..3f653c7cfbf3 100644
--- a/arch/mips/kernel/irq-msc01.c
+++ b/arch/mips/kernel/irq-msc01.c
@@ -74,7 +74,7 @@ static void disable_msc_irq(unsigned int irq)
74static void level_mask_and_ack_msc_irq(unsigned int irq) 74static void level_mask_and_ack_msc_irq(unsigned int irq)
75{ 75{
76 mask_msc_irq(irq); 76 mask_msc_irq(irq);
77 if (!cpu_has_ei) 77 if (!cpu_has_veic)
78 MSCIC_WRITE(MSC01_IC_EOI, 0); 78 MSCIC_WRITE(MSC01_IC_EOI, 0);
79} 79}
80 80
@@ -84,7 +84,7 @@ static void level_mask_and_ack_msc_irq(unsigned int irq)
84static void edge_mask_and_ack_msc_irq(unsigned int irq) 84static void edge_mask_and_ack_msc_irq(unsigned int irq)
85{ 85{
86 mask_msc_irq(irq); 86 mask_msc_irq(irq);
87 if (!cpu_has_ei) 87 if (!cpu_has_veic)
88 MSCIC_WRITE(MSC01_IC_EOI, 0); 88 MSCIC_WRITE(MSC01_IC_EOI, 0);
89 else { 89 else {
90 u32 r; 90 u32 r;
@@ -129,25 +129,23 @@ msc_bind_eic_interrupt (unsigned int irq, unsigned int set)
129#define shutdown_msc_irq disable_msc_irq 129#define shutdown_msc_irq disable_msc_irq
130 130
131struct hw_interrupt_type msc_levelirq_type = { 131struct hw_interrupt_type msc_levelirq_type = {
132 "SOC-it-Level", 132 .typename = "SOC-it-Level",
133 startup_msc_irq, 133 .startup = startup_msc_irq,
134 shutdown_msc_irq, 134 .shutdown = shutdown_msc_irq,
135 enable_msc_irq, 135 .enable = enable_msc_irq,
136 disable_msc_irq, 136 .disable = disable_msc_irq,
137 level_mask_and_ack_msc_irq, 137 .ack = level_mask_and_ack_msc_irq,
138 end_msc_irq, 138 .end = end_msc_irq,
139 NULL
140}; 139};
141 140
142struct hw_interrupt_type msc_edgeirq_type = { 141struct hw_interrupt_type msc_edgeirq_type = {
143 "SOC-it-Edge", 142 .typename = "SOC-it-Edge",
144 startup_msc_irq, 143 .startup =startup_msc_irq,
145 shutdown_msc_irq, 144 .shutdown = shutdown_msc_irq,
146 enable_msc_irq, 145 .enable = enable_msc_irq,
147 disable_msc_irq, 146 .disable = disable_msc_irq,
148 edge_mask_and_ack_msc_irq, 147 .ack = edge_mask_and_ack_msc_irq,
149 end_msc_irq, 148 .end = end_msc_irq,
150 NULL
151}; 149};
152 150
153 151
@@ -168,14 +166,14 @@ void __init init_msc_irqs(unsigned int base, msc_irqmap_t *imp, int nirq)
168 switch (imp->im_type) { 166 switch (imp->im_type) {
169 case MSC01_IRQ_EDGE: 167 case MSC01_IRQ_EDGE:
170 irq_desc[base+n].handler = &msc_edgeirq_type; 168 irq_desc[base+n].handler = &msc_edgeirq_type;
171 if (cpu_has_ei) 169 if (cpu_has_veic)
172 MSCIC_WRITE(MSC01_IC_SUP+n*8, MSC01_IC_SUP_EDGE_BIT); 170 MSCIC_WRITE(MSC01_IC_SUP+n*8, MSC01_IC_SUP_EDGE_BIT);
173 else 171 else
174 MSCIC_WRITE(MSC01_IC_SUP+n*8, MSC01_IC_SUP_EDGE_BIT | imp->im_lvl); 172 MSCIC_WRITE(MSC01_IC_SUP+n*8, MSC01_IC_SUP_EDGE_BIT | imp->im_lvl);
175 break; 173 break;
176 case MSC01_IRQ_LEVEL: 174 case MSC01_IRQ_LEVEL:
177 irq_desc[base+n].handler = &msc_levelirq_type; 175 irq_desc[base+n].handler = &msc_levelirq_type;
178 if (cpu_has_ei) 176 if (cpu_has_veic)
179 MSCIC_WRITE(MSC01_IC_SUP+n*8, 0); 177 MSCIC_WRITE(MSC01_IC_SUP+n*8, 0);
180 else 178 else
181 MSCIC_WRITE(MSC01_IC_SUP+n*8, imp->im_lvl); 179 MSCIC_WRITE(MSC01_IC_SUP+n*8, imp->im_lvl);
diff --git a/arch/mips/kernel/irq-mv6434x.c b/arch/mips/kernel/irq-mv6434x.c
index 088bbbc869e6..0ac067f45cf5 100644
--- a/arch/mips/kernel/irq-mv6434x.c
+++ b/arch/mips/kernel/irq-mv6434x.c
@@ -135,14 +135,13 @@ void ll_mv64340_irq(struct pt_regs *regs)
135#define shutdown_mv64340_irq disable_mv64340_irq 135#define shutdown_mv64340_irq disable_mv64340_irq
136 136
137struct hw_interrupt_type mv64340_irq_type = { 137struct hw_interrupt_type mv64340_irq_type = {
138 "MV-64340", 138 .typename = "MV-64340",
139 startup_mv64340_irq, 139 .startup = startup_mv64340_irq,
140 shutdown_mv64340_irq, 140 .shutdown = shutdown_mv64340_irq,
141 enable_mv64340_irq, 141 .enable = enable_mv64340_irq,
142 disable_mv64340_irq, 142 .disable = disable_mv64340_irq,
143 mask_and_ack_mv64340_irq, 143 .ack = mask_and_ack_mv64340_irq,
144 end_mv64340_irq, 144 .end = end_mv64340_irq,
145 NULL
146}; 145};
147 146
148void __init mv64340_irq_init(unsigned int base) 147void __init mv64340_irq_init(unsigned int base)
diff --git a/arch/mips/kernel/irq-rm7000.c b/arch/mips/kernel/irq-rm7000.c
index f5d779fd0355..0b130c5ac5d9 100644
--- a/arch/mips/kernel/irq-rm7000.c
+++ b/arch/mips/kernel/irq-rm7000.c
@@ -72,13 +72,13 @@ static void rm7k_cpu_irq_end(unsigned int irq)
72} 72}
73 73
74static hw_irq_controller rm7k_irq_controller = { 74static hw_irq_controller rm7k_irq_controller = {
75 "RM7000", 75 .typename = "RM7000",
76 rm7k_cpu_irq_startup, 76 .startup = rm7k_cpu_irq_startup,
77 rm7k_cpu_irq_shutdown, 77 .shutdown = rm7k_cpu_irq_shutdown,
78 rm7k_cpu_irq_enable, 78 .enable = rm7k_cpu_irq_enable,
79 rm7k_cpu_irq_disable, 79 .disable = rm7k_cpu_irq_disable,
80 rm7k_cpu_irq_ack, 80 .ack = rm7k_cpu_irq_ack,
81 rm7k_cpu_irq_end, 81 .end = rm7k_cpu_irq_end,
82}; 82};
83 83
84void __init rm7k_cpu_irq_init(int base) 84void __init rm7k_cpu_irq_init(int base)
diff --git a/arch/mips/kernel/irq-rm9000.c b/arch/mips/kernel/irq-rm9000.c
index bdd130296256..9b5f20c32acb 100644
--- a/arch/mips/kernel/irq-rm9000.c
+++ b/arch/mips/kernel/irq-rm9000.c
@@ -106,23 +106,23 @@ static void rm9k_cpu_irq_end(unsigned int irq)
106} 106}
107 107
108static hw_irq_controller rm9k_irq_controller = { 108static hw_irq_controller rm9k_irq_controller = {
109 "RM9000", 109 .typename = "RM9000",
110 rm9k_cpu_irq_startup, 110 .startup = rm9k_cpu_irq_startup,
111 rm9k_cpu_irq_shutdown, 111 .shutdown = rm9k_cpu_irq_shutdown,
112 rm9k_cpu_irq_enable, 112 .enable = rm9k_cpu_irq_enable,
113 rm9k_cpu_irq_disable, 113 .disable = rm9k_cpu_irq_disable,
114 rm9k_cpu_irq_ack, 114 .ack = rm9k_cpu_irq_ack,
115 rm9k_cpu_irq_end, 115 .end = rm9k_cpu_irq_end,
116}; 116};
117 117
118static hw_irq_controller rm9k_perfcounter_irq = { 118static hw_irq_controller rm9k_perfcounter_irq = {
119 "RM9000", 119 .typename = "RM9000",
120 rm9k_perfcounter_irq_startup, 120 .startup = rm9k_perfcounter_irq_startup,
121 rm9k_perfcounter_irq_shutdown, 121 .shutdown = rm9k_perfcounter_irq_shutdown,
122 rm9k_cpu_irq_enable, 122 .enable = rm9k_cpu_irq_enable,
123 rm9k_cpu_irq_disable, 123 .disable = rm9k_cpu_irq_disable,
124 rm9k_cpu_irq_ack, 124 .ack = rm9k_cpu_irq_ack,
125 rm9k_cpu_irq_end, 125 .end = rm9k_cpu_irq_end,
126}; 126};
127 127
128unsigned int rm9000_perfcount_irq; 128unsigned int rm9000_perfcount_irq;
diff --git a/arch/mips/kernel/irq_cpu.c b/arch/mips/kernel/irq_cpu.c
index 2b936cf1ef70..5db67e31ec1a 100644
--- a/arch/mips/kernel/irq_cpu.c
+++ b/arch/mips/kernel/irq_cpu.c
@@ -3,6 +3,8 @@
3 * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net 3 * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
4 * 4 *
5 * Copyright (C) 2001 Ralf Baechle 5 * Copyright (C) 2001 Ralf Baechle
6 * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved.
7 * Author: Maciej W. Rozycki <macro@mips.com>
6 * 8 *
7 * This file define the irq handler for MIPS CPU interrupts. 9 * This file define the irq handler for MIPS CPU interrupts.
8 * 10 *
@@ -31,19 +33,21 @@
31 33
32#include <asm/irq_cpu.h> 34#include <asm/irq_cpu.h>
33#include <asm/mipsregs.h> 35#include <asm/mipsregs.h>
36#include <asm/mipsmtregs.h>
34#include <asm/system.h> 37#include <asm/system.h>
35 38
36static int mips_cpu_irq_base; 39static int mips_cpu_irq_base;
37 40
38static inline void unmask_mips_irq(unsigned int irq) 41static inline void unmask_mips_irq(unsigned int irq)
39{ 42{
40 clear_c0_cause(0x100 << (irq - mips_cpu_irq_base));
41 set_c0_status(0x100 << (irq - mips_cpu_irq_base)); 43 set_c0_status(0x100 << (irq - mips_cpu_irq_base));
44 irq_enable_hazard();
42} 45}
43 46
44static inline void mask_mips_irq(unsigned int irq) 47static inline void mask_mips_irq(unsigned int irq)
45{ 48{
46 clear_c0_status(0x100 << (irq - mips_cpu_irq_base)); 49 clear_c0_status(0x100 << (irq - mips_cpu_irq_base));
50 irq_disable_hazard();
47} 51}
48 52
49static inline void mips_cpu_irq_enable(unsigned int irq) 53static inline void mips_cpu_irq_enable(unsigned int irq)
@@ -52,6 +56,7 @@ static inline void mips_cpu_irq_enable(unsigned int irq)
52 56
53 local_irq_save(flags); 57 local_irq_save(flags);
54 unmask_mips_irq(irq); 58 unmask_mips_irq(irq);
59 back_to_back_c0_hazard();
55 local_irq_restore(flags); 60 local_irq_restore(flags);
56} 61}
57 62
@@ -61,6 +66,7 @@ static void mips_cpu_irq_disable(unsigned int irq)
61 66
62 local_irq_save(flags); 67 local_irq_save(flags);
63 mask_mips_irq(irq); 68 mask_mips_irq(irq);
69 back_to_back_c0_hazard();
64 local_irq_restore(flags); 70 local_irq_restore(flags);
65} 71}
66 72
@@ -71,7 +77,7 @@ static unsigned int mips_cpu_irq_startup(unsigned int irq)
71 return 0; 77 return 0;
72} 78}
73 79
74#define mips_cpu_irq_shutdown mips_cpu_irq_disable 80#define mips_cpu_irq_shutdown mips_cpu_irq_disable
75 81
76/* 82/*
77 * While we ack the interrupt interrupts are disabled and thus we don't need 83 * While we ack the interrupt interrupts are disabled and thus we don't need
@@ -79,9 +85,6 @@ static unsigned int mips_cpu_irq_startup(unsigned int irq)
79 */ 85 */
80static void mips_cpu_irq_ack(unsigned int irq) 86static void mips_cpu_irq_ack(unsigned int irq)
81{ 87{
82 /* Only necessary for soft interrupts */
83 clear_c0_cause(0x100 << (irq - mips_cpu_irq_base));
84
85 mask_mips_irq(irq); 88 mask_mips_irq(irq);
86} 89}
87 90
@@ -92,22 +95,82 @@ static void mips_cpu_irq_end(unsigned int irq)
92} 95}
93 96
94static hw_irq_controller mips_cpu_irq_controller = { 97static hw_irq_controller mips_cpu_irq_controller = {
95 "MIPS", 98 .typename = "MIPS",
96 mips_cpu_irq_startup, 99 .startup = mips_cpu_irq_startup,
97 mips_cpu_irq_shutdown, 100 .shutdown = mips_cpu_irq_shutdown,
98 mips_cpu_irq_enable, 101 .enable = mips_cpu_irq_enable,
99 mips_cpu_irq_disable, 102 .disable = mips_cpu_irq_disable,
100 mips_cpu_irq_ack, 103 .ack = mips_cpu_irq_ack,
101 mips_cpu_irq_end, 104 .end = mips_cpu_irq_end,
102 NULL /* no affinity stuff for UP */
103}; 105};
104 106
107/*
108 * Basically the same as above but taking care of all the MT stuff
109 */
110
111#define unmask_mips_mt_irq unmask_mips_irq
112#define mask_mips_mt_irq mask_mips_irq
113#define mips_mt_cpu_irq_enable mips_cpu_irq_enable
114#define mips_mt_cpu_irq_disable mips_cpu_irq_disable
115
116static unsigned int mips_mt_cpu_irq_startup(unsigned int irq)
117{
118 unsigned int vpflags = dvpe();
119
120 clear_c0_cause(0x100 << (irq - mips_cpu_irq_base));
121 evpe(vpflags);
122 mips_mt_cpu_irq_enable(irq);
123
124 return 0;
125}
126
127#define mips_mt_cpu_irq_shutdown mips_mt_cpu_irq_disable
128
129/*
130 * While we ack the interrupt interrupts are disabled and thus we don't need
131 * to deal with concurrency issues. Same for mips_cpu_irq_end.
132 */
133static void mips_mt_cpu_irq_ack(unsigned int irq)
134{
135 unsigned int vpflags = dvpe();
136 clear_c0_cause(0x100 << (irq - mips_cpu_irq_base));
137 evpe(vpflags);
138 mask_mips_mt_irq(irq);
139}
140
141#define mips_mt_cpu_irq_end mips_cpu_irq_end
142
143static hw_irq_controller mips_mt_cpu_irq_controller = {
144 .typename = "MIPS",
145 .startup = mips_mt_cpu_irq_startup,
146 .shutdown = mips_mt_cpu_irq_shutdown,
147 .enable = mips_mt_cpu_irq_enable,
148 .disable = mips_mt_cpu_irq_disable,
149 .ack = mips_mt_cpu_irq_ack,
150 .end = mips_mt_cpu_irq_end,
151};
105 152
106void __init mips_cpu_irq_init(int irq_base) 153void __init mips_cpu_irq_init(int irq_base)
107{ 154{
108 int i; 155 int i;
109 156
110 for (i = irq_base; i < irq_base + 8; i++) { 157 /* Mask interrupts. */
158 clear_c0_status(ST0_IM);
159 clear_c0_cause(CAUSEF_IP);
160
161 /*
162 * Only MT is using the software interrupts currently, so we just
163 * leave them uninitialized for other processors.
164 */
165 if (cpu_has_mipsmt)
166 for (i = irq_base; i < irq_base + 2; i++) {
167 irq_desc[i].status = IRQ_DISABLED;
168 irq_desc[i].action = NULL;
169 irq_desc[i].depth = 1;
170 irq_desc[i].handler = &mips_mt_cpu_irq_controller;
171 }
172
173 for (i = irq_base + 2; i < irq_base + 8; i++) {
111 irq_desc[i].status = IRQ_DISABLED; 174 irq_desc[i].status = IRQ_DISABLED;
112 irq_desc[i].action = NULL; 175 irq_desc[i].action = NULL;
113 irq_desc[i].depth = 1; 176 irq_desc[i].depth = 1;
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
index ece4564919d8..330cf84d21fe 100644
--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -215,81 +215,32 @@ sys32_readdir(unsigned int fd, void * dirent32, unsigned int count)
215 return(n); 215 return(n);
216} 216}
217 217
218struct rusage32 { 218asmlinkage int
219 struct compat_timeval ru_utime; 219sys32_waitpid(compat_pid_t pid, unsigned int *stat_addr, int options)
220 struct compat_timeval ru_stime;
221 int ru_maxrss;
222 int ru_ixrss;
223 int ru_idrss;
224 int ru_isrss;
225 int ru_minflt;
226 int ru_majflt;
227 int ru_nswap;
228 int ru_inblock;
229 int ru_oublock;
230 int ru_msgsnd;
231 int ru_msgrcv;
232 int ru_nsignals;
233 int ru_nvcsw;
234 int ru_nivcsw;
235};
236
237static int
238put_rusage (struct rusage32 *ru, struct rusage *r)
239{ 220{
240 int err; 221 return compat_sys_wait4(pid, stat_addr, options, NULL);
241
242 if (!access_ok(VERIFY_WRITE, ru, sizeof *ru))
243 return -EFAULT;
244
245 err = __put_user (r->ru_utime.tv_sec, &ru->ru_utime.tv_sec);
246 err |= __put_user (r->ru_utime.tv_usec, &ru->ru_utime.tv_usec);
247 err |= __put_user (r->ru_stime.tv_sec, &ru->ru_stime.tv_sec);
248 err |= __put_user (r->ru_stime.tv_usec, &ru->ru_stime.tv_usec);
249 err |= __put_user (r->ru_maxrss, &ru->ru_maxrss);
250 err |= __put_user (r->ru_ixrss, &ru->ru_ixrss);
251 err |= __put_user (r->ru_idrss, &ru->ru_idrss);
252 err |= __put_user (r->ru_isrss, &ru->ru_isrss);
253 err |= __put_user (r->ru_minflt, &ru->ru_minflt);
254 err |= __put_user (r->ru_majflt, &ru->ru_majflt);
255 err |= __put_user (r->ru_nswap, &ru->ru_nswap);
256 err |= __put_user (r->ru_inblock, &ru->ru_inblock);
257 err |= __put_user (r->ru_oublock, &ru->ru_oublock);
258 err |= __put_user (r->ru_msgsnd, &ru->ru_msgsnd);
259 err |= __put_user (r->ru_msgrcv, &ru->ru_msgrcv);
260 err |= __put_user (r->ru_nsignals, &ru->ru_nsignals);
261 err |= __put_user (r->ru_nvcsw, &ru->ru_nvcsw);
262 err |= __put_user (r->ru_nivcsw, &ru->ru_nivcsw);
263
264 return err;
265} 222}
266 223
267asmlinkage int 224asmlinkage long
268sys32_wait4(compat_pid_t pid, unsigned int * stat_addr, int options, 225sysn32_waitid(int which, compat_pid_t pid,
269 struct rusage32 * ru) 226 siginfo_t __user *uinfo, int options,
227 struct compat_rusage __user *uru)
270{ 228{
271 if (!ru) 229 struct rusage ru;
272 return sys_wait4(pid, stat_addr, options, NULL); 230 long ret;
273 else { 231 mm_segment_t old_fs = get_fs();
274 struct rusage r;
275 int ret;
276 unsigned int status;
277 mm_segment_t old_fs = get_fs();
278 232
279 set_fs(KERNEL_DS); 233 set_fs (KERNEL_DS);
280 ret = sys_wait4(pid, stat_addr ? &status : NULL, options, &r); 234 ret = sys_waitid(which, pid, uinfo, options,
281 set_fs(old_fs); 235 uru ? (struct rusage __user *) &ru : NULL);
282 if (put_rusage (ru, &r)) return -EFAULT; 236 set_fs (old_fs);
283 if (stat_addr && put_user (status, stat_addr)) 237
284 return -EFAULT; 238 if (ret < 0 || uinfo->si_signo == 0)
285 return ret; 239 return ret;
286 }
287}
288 240
289asmlinkage int 241 if (uru)
290sys32_waitpid(compat_pid_t pid, unsigned int *stat_addr, int options) 242 ret = put_compat_rusage(&ru, uru);
291{ 243 return ret;
292 return sys32_wait4(pid, stat_addr, options, NULL);
293} 244}
294 245
295struct sysinfo32 { 246struct sysinfo32 {
@@ -1467,3 +1418,80 @@ asmlinkage long sys32_socketcall(int call, unsigned int *args32)
1467 } 1418 }
1468 return err; 1419 return err;
1469} 1420}
1421
1422struct sigevent32 {
1423 u32 sigev_value;
1424 u32 sigev_signo;
1425 u32 sigev_notify;
1426 u32 payload[(64 / 4) - 3];
1427};
1428
1429extern asmlinkage long
1430sys_timer_create(clockid_t which_clock,
1431 struct sigevent __user *timer_event_spec,
1432 timer_t __user * created_timer_id);
1433
1434long
1435sys32_timer_create(u32 clock, struct sigevent32 __user *se32, timer_t __user *timer_id)
1436{
1437 struct sigevent __user *p = NULL;
1438 if (se32) {
1439 struct sigevent se;
1440 p = compat_alloc_user_space(sizeof(struct sigevent));
1441 memset(&se, 0, sizeof(struct sigevent));
1442 if (get_user(se.sigev_value.sival_int, &se32->sigev_value) ||
1443 __get_user(se.sigev_signo, &se32->sigev_signo) ||
1444 __get_user(se.sigev_notify, &se32->sigev_notify) ||
1445 __copy_from_user(&se._sigev_un._pad, &se32->payload,
1446 sizeof(se32->payload)) ||
1447 copy_to_user(p, &se, sizeof(se)))
1448 return -EFAULT;
1449 }
1450 return sys_timer_create(clock, p, timer_id);
1451}
1452
1453asmlinkage long
1454sysn32_rt_sigtimedwait(const sigset_t __user *uthese,
1455 siginfo_t __user *uinfo,
1456 const struct compat_timespec __user *uts32,
1457 size_t sigsetsize)
1458{
1459 struct timespec __user *uts = NULL;
1460
1461 if (uts32) {
1462 struct timespec ts;
1463 uts = compat_alloc_user_space(sizeof(struct timespec));
1464 if (get_user(ts.tv_sec, &uts32->tv_sec) ||
1465 get_user(ts.tv_nsec, &uts32->tv_nsec) ||
1466 copy_to_user (uts, &ts, sizeof (ts)))
1467 return -EFAULT;
1468 }
1469 return sys_rt_sigtimedwait(uthese, uinfo, uts, sigsetsize);
1470}
1471
1472save_static_function(sys32_clone);
1473__attribute_used__ noinline static int
1474_sys32_clone(nabi_no_regargs struct pt_regs regs)
1475{
1476 unsigned long clone_flags;
1477 unsigned long newsp;
1478 int __user *parent_tidptr, *child_tidptr;
1479
1480 clone_flags = regs.regs[4];
1481 newsp = regs.regs[5];
1482 if (!newsp)
1483 newsp = regs.regs[29];
1484 parent_tidptr = (int *) regs.regs[6];
1485
1486 /* Use __dummy4 instead of getting it off the stack, so that
1487 syscall() works. */
1488 child_tidptr = (int __user *) __dummy4;
1489 return do_fork(clone_flags, newsp, &regs, 0,
1490 parent_tidptr, child_tidptr);
1491}
1492
1493extern asmlinkage void sys_set_thread_area(u32 addr);
1494asmlinkage void sys32_set_thread_area(u32 addr)
1495{
1496 sys_set_thread_area(AA(addr));
1497}
diff --git a/arch/mips/kernel/module-elf32.c b/arch/mips/kernel/module-elf32.c
deleted file mode 100644
index ffd216d6d6dc..000000000000
--- a/arch/mips/kernel/module-elf32.c
+++ /dev/null
@@ -1,250 +0,0 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15 *
16 * Copyright (C) 2001 Rusty Russell.
17 * Copyright (C) 2003, 2004 Ralf Baechle (ralf@linux-mips.org)
18 */
19
20#undef DEBUG
21
22#include <linux/moduleloader.h>
23#include <linux/elf.h>
24#include <linux/vmalloc.h>
25#include <linux/slab.h>
26#include <linux/fs.h>
27#include <linux/string.h>
28#include <linux/kernel.h>
29
30struct mips_hi16 {
31 struct mips_hi16 *next;
32 Elf32_Addr *addr;
33 Elf32_Addr value;
34};
35
36static struct mips_hi16 *mips_hi16_list;
37
38void *module_alloc(unsigned long size)
39{
40 if (size == 0)
41 return NULL;
42 return vmalloc(size);
43}
44
45
46/* Free memory returned from module_alloc */
47void module_free(struct module *mod, void *module_region)
48{
49 vfree(module_region);
50 /* FIXME: If module_region == mod->init_region, trim exception
51 table entries. */
52}
53
54int module_frob_arch_sections(Elf_Ehdr *hdr,
55 Elf_Shdr *sechdrs,
56 char *secstrings,
57 struct module *mod)
58{
59 return 0;
60}
61
62static int apply_r_mips_none(struct module *me, uint32_t *location,
63 Elf32_Addr v)
64{
65 return 0;
66}
67
68static int apply_r_mips_32(struct module *me, uint32_t *location,
69 Elf32_Addr v)
70{
71 *location += v;
72
73 return 0;
74}
75
76static int apply_r_mips_26(struct module *me, uint32_t *location,
77 Elf32_Addr v)
78{
79 if (v % 4) {
80 printk(KERN_ERR "module %s: dangerous relocation\n", me->name);
81 return -ENOEXEC;
82 }
83
84 if ((v & 0xf0000000) != (((unsigned long)location + 4) & 0xf0000000)) {
85 printk(KERN_ERR
86 "module %s: relocation overflow\n",
87 me->name);
88 return -ENOEXEC;
89 }
90
91 *location = (*location & ~0x03ffffff) |
92 ((*location + (v >> 2)) & 0x03ffffff);
93
94 return 0;
95}
96
97static int apply_r_mips_hi16(struct module *me, uint32_t *location,
98 Elf32_Addr v)
99{
100 struct mips_hi16 *n;
101
102 /*
103 * We cannot relocate this one now because we don't know the value of
104 * the carry we need to add. Save the information, and let LO16 do the
105 * actual relocation.
106 */
107 n = kmalloc(sizeof *n, GFP_KERNEL);
108 if (!n)
109 return -ENOMEM;
110
111 n->addr = location;
112 n->value = v;
113 n->next = mips_hi16_list;
114 mips_hi16_list = n;
115
116 return 0;
117}
118
119static int apply_r_mips_lo16(struct module *me, uint32_t *location,
120 Elf32_Addr v)
121{
122 unsigned long insnlo = *location;
123 Elf32_Addr val, vallo;
124
125 /* Sign extend the addend we extract from the lo insn. */
126 vallo = ((insnlo & 0xffff) ^ 0x8000) - 0x8000;
127
128 if (mips_hi16_list != NULL) {
129 struct mips_hi16 *l;
130
131 l = mips_hi16_list;
132 while (l != NULL) {
133 struct mips_hi16 *next;
134 unsigned long insn;
135
136 /*
137 * The value for the HI16 had best be the same.
138 */
139 if (v != l->value)
140 goto out_danger;
141
142 /*
143 * Do the HI16 relocation. Note that we actually don't
144 * need to know anything about the LO16 itself, except
145 * where to find the low 16 bits of the addend needed
146 * by the LO16.
147 */
148 insn = *l->addr;
149 val = ((insn & 0xffff) << 16) + vallo;
150 val += v;
151
152 /*
153 * Account for the sign extension that will happen in
154 * the low bits.
155 */
156 val = ((val >> 16) + ((val & 0x8000) != 0)) & 0xffff;
157
158 insn = (insn & ~0xffff) | val;
159 *l->addr = insn;
160
161 next = l->next;
162 kfree(l);
163 l = next;
164 }
165
166 mips_hi16_list = NULL;
167 }
168
169 /*
170 * Ok, we're done with the HI16 relocs. Now deal with the LO16.
171 */
172 val = v + vallo;
173 insnlo = (insnlo & ~0xffff) | (val & 0xffff);
174 *location = insnlo;
175
176 return 0;
177
178out_danger:
179 printk(KERN_ERR "module %s: dangerous " "relocation\n", me->name);
180
181 return -ENOEXEC;
182}
183
184static int (*reloc_handlers[]) (struct module *me, uint32_t *location,
185 Elf32_Addr v) = {
186 [R_MIPS_NONE] = apply_r_mips_none,
187 [R_MIPS_32] = apply_r_mips_32,
188 [R_MIPS_26] = apply_r_mips_26,
189 [R_MIPS_HI16] = apply_r_mips_hi16,
190 [R_MIPS_LO16] = apply_r_mips_lo16
191};
192
193int apply_relocate(Elf32_Shdr *sechdrs,
194 const char *strtab,
195 unsigned int symindex,
196 unsigned int relsec,
197 struct module *me)
198{
199 Elf32_Rel *rel = (void *) sechdrs[relsec].sh_addr;
200 Elf32_Sym *sym;
201 uint32_t *location;
202 unsigned int i;
203 Elf32_Addr v;
204 int res;
205
206 pr_debug("Applying relocate section %u to %u\n", relsec,
207 sechdrs[relsec].sh_info);
208
209 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {
210 Elf32_Word r_info = rel[i].r_info;
211
212 /* This is where to make the change */
213 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr
214 + rel[i].r_offset;
215 /* This is the symbol it is referring to */
216 sym = (Elf32_Sym *)sechdrs[symindex].sh_addr
217 + ELF32_R_SYM(r_info);
218 if (!sym->st_value) {
219 printk(KERN_WARNING "%s: Unknown symbol %s\n",
220 me->name, strtab + sym->st_name);
221 return -ENOENT;
222 }
223
224 v = sym->st_value;
225
226 res = reloc_handlers[ELF32_R_TYPE(r_info)](me, location, v);
227 if (res)
228 return res;
229 }
230
231 return 0;
232}
233
234int apply_relocate_add(Elf32_Shdr *sechdrs,
235 const char *strtab,
236 unsigned int symindex,
237 unsigned int relsec,
238 struct module *me)
239{
240 /*
241 * Current binutils always generate .rela relocations. Keep smiling
242 * if it's empty, abort otherwise.
243 */
244 if (!sechdrs[relsec].sh_size)
245 return 0;
246
247 printk(KERN_ERR "module %s: ADD RELOCATION unsupported\n",
248 me->name);
249 return -ENOEXEC;
250}
diff --git a/arch/mips/kernel/module-elf64.c b/arch/mips/kernel/module-elf64.c
deleted file mode 100644
index e804792ee1ee..000000000000
--- a/arch/mips/kernel/module-elf64.c
+++ /dev/null
@@ -1,274 +0,0 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15 *
16 * Copyright (C) 2001 Rusty Russell.
17 * Copyright (C) 2003, 2004 Ralf Baechle (ralf@linux-mips.org)
18 */
19
20#undef DEBUG
21
22#include <linux/moduleloader.h>
23#include <linux/elf.h>
24#include <linux/vmalloc.h>
25#include <linux/slab.h>
26#include <linux/fs.h>
27#include <linux/string.h>
28#include <linux/kernel.h>
29
30struct mips_hi16 {
31 struct mips_hi16 *next;
32 Elf32_Addr *addr;
33 Elf64_Addr value;
34};
35
36static struct mips_hi16 *mips_hi16_list;
37
38void *module_alloc(unsigned long size)
39{
40 if (size == 0)
41 return NULL;
42 return vmalloc(size);
43}
44
45
46/* Free memory returned from module_alloc */
47void module_free(struct module *mod, void *module_region)
48{
49 vfree(module_region);
50 /* FIXME: If module_region == mod->init_region, trim exception
51 table entries. */
52}
53
54int module_frob_arch_sections(Elf_Ehdr *hdr,
55 Elf_Shdr *sechdrs,
56 char *secstrings,
57 struct module *mod)
58{
59 return 0;
60}
61
62int apply_relocate(Elf64_Shdr *sechdrs,
63 const char *strtab,
64 unsigned int symindex,
65 unsigned int relsec,
66 struct module *me)
67{
68 /*
69 * We don't want to deal with REL relocations - RELA is so much saner.
70 */
71 if (!sechdrs[relsec].sh_size)
72 return 0;
73
74 printk(KERN_ERR "module %s: REL relocation unsupported\n",
75 me->name);
76 return -ENOEXEC;
77}
78
79static int apply_r_mips_none(struct module *me, uint32_t *location,
80 Elf64_Addr v)
81{
82 return 0;
83}
84
85static int apply_r_mips_32(struct module *me, uint32_t *location,
86 Elf64_Addr v)
87{
88 *location = v;
89
90 return 0;
91}
92
93static int apply_r_mips_26(struct module *me, uint32_t *location,
94 Elf64_Addr v)
95{
96 if (v % 4) {
97 printk(KERN_ERR "module %s: dangerous relocation\n", me->name);
98 return -ENOEXEC;
99 }
100
101 if ((v & 0xf0000000) != (((unsigned long)location + 4) & 0xf0000000)) {
102 printk(KERN_ERR
103 "module %s: relocation overflow\n",
104 me->name);
105 return -ENOEXEC;
106 }
107
108 *location = (*location & ~0x03ffffff) | ((v >> 2) & 0x03ffffff);
109
110 return 0;
111}
112
113static int apply_r_mips_hi16(struct module *me, uint32_t *location,
114 Elf64_Addr v)
115{
116 struct mips_hi16 *n;
117
118 /*
119 * We cannot relocate this one now because we don't know the value of
120 * the carry we need to add. Save the information, and let LO16 do the
121 * actual relocation.
122 */
123 n = kmalloc(sizeof *n, GFP_KERNEL);
124 if (!n)
125 return -ENOMEM;
126
127 n->addr = location;
128 n->value = v;
129 n->next = mips_hi16_list;
130 mips_hi16_list = n;
131
132 return 0;
133}
134
135static int apply_r_mips_lo16(struct module *me, uint32_t *location,
136 Elf64_Addr v)
137{
138 unsigned long insnlo = *location;
139 Elf32_Addr val, vallo;
140
141 /* Sign extend the addend we extract from the lo insn. */
142 vallo = ((insnlo & 0xffff) ^ 0x8000) - 0x8000;
143
144 if (mips_hi16_list != NULL) {
145 struct mips_hi16 *l;
146
147 l = mips_hi16_list;
148 while (l != NULL) {
149 struct mips_hi16 *next;
150 unsigned long insn;
151
152 /*
153 * The value for the HI16 had best be the same.
154 */
155 if (v != l->value)
156 goto out_danger;
157
158 /*
159 * Do the HI16 relocation. Note that we actually don't
160 * need to know anything about the LO16 itself, except
161 * where to find the low 16 bits of the addend needed
162 * by the LO16.
163 */
164 insn = *l->addr;
165 val = ((insn & 0xffff) << 16) + vallo;
166 val += v;
167
168 /*
169 * Account for the sign extension that will happen in
170 * the low bits.
171 */
172 val = ((val >> 16) + ((val & 0x8000) != 0)) & 0xffff;
173
174 insn = (insn & ~0xffff) | val;
175 *l->addr = insn;
176
177 next = l->next;
178 kfree(l);
179 l = next;
180 }
181
182 mips_hi16_list = NULL;
183 }
184
185 /*
186 * Ok, we're done with the HI16 relocs. Now deal with the LO16.
187 */
188 insnlo = (insnlo & ~0xffff) | (v & 0xffff);
189 *location = insnlo;
190
191 return 0;
192
193out_danger:
194 printk(KERN_ERR "module %s: dangerous " "relocation\n", me->name);
195
196 return -ENOEXEC;
197}
198
199static int apply_r_mips_64(struct module *me, uint32_t *location,
200 Elf64_Addr v)
201{
202 *(uint64_t *) location = v;
203
204 return 0;
205}
206
207
208static int apply_r_mips_higher(struct module *me, uint32_t *location,
209 Elf64_Addr v)
210{
211 *location = (*location & 0xffff0000) |
212 ((((long long) v + 0x80008000LL) >> 32) & 0xffff);
213
214 return 0;
215}
216
217static int apply_r_mips_highest(struct module *me, uint32_t *location,
218 Elf64_Addr v)
219{
220 *location = (*location & 0xffff0000) |
221 ((((long long) v + 0x800080008000LL) >> 48) & 0xffff);
222
223 return 0;
224}
225
226static int (*reloc_handlers[]) (struct module *me, uint32_t *location,
227 Elf64_Addr v) = {
228 [R_MIPS_NONE] = apply_r_mips_none,
229 [R_MIPS_32] = apply_r_mips_32,
230 [R_MIPS_26] = apply_r_mips_26,
231 [R_MIPS_HI16] = apply_r_mips_hi16,
232 [R_MIPS_LO16] = apply_r_mips_lo16,
233 [R_MIPS_64] = apply_r_mips_64,
234 [R_MIPS_HIGHER] = apply_r_mips_higher,
235 [R_MIPS_HIGHEST] = apply_r_mips_highest
236};
237
238int apply_relocate_add(Elf64_Shdr *sechdrs,
239 const char *strtab,
240 unsigned int symindex,
241 unsigned int relsec,
242 struct module *me)
243{
244 Elf64_Mips_Rela *rel = (void *) sechdrs[relsec].sh_addr;
245 Elf64_Sym *sym;
246 uint32_t *location;
247 unsigned int i;
248 Elf64_Addr v;
249 int res;
250
251 pr_debug("Applying relocate section %u to %u\n", relsec,
252 sechdrs[relsec].sh_info);
253
254 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {
255 /* This is where to make the change */
256 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr
257 + rel[i].r_offset;
258 /* This is the symbol it is referring to */
259 sym = (Elf64_Sym *)sechdrs[symindex].sh_addr + rel[i].r_sym;
260 if (!sym->st_value) {
261 printk(KERN_WARNING "%s: Unknown symbol %s\n",
262 me->name, strtab + sym->st_name);
263 return -ENOENT;
264 }
265
266 v = sym->st_value;
267
268 res = reloc_handlers[rel[i].r_type](me, location, v);
269 if (res)
270 return res;
271 }
272
273 return 0;
274}
diff --git a/arch/mips/kernel/module.c b/arch/mips/kernel/module.c
index 458af3c7a639..e54a7f442f8a 100644
--- a/arch/mips/kernel/module.c
+++ b/arch/mips/kernel/module.c
@@ -1,9 +1,345 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15 *
16 * Copyright (C) 2001 Rusty Russell.
17 * Copyright (C) 2003, 2004 Ralf Baechle (ralf@linux-mips.org)
18 * Copyright (C) 2005 Thiemo Seufer
19 */
20
21#undef DEBUG
22
23#include <linux/moduleloader.h>
24#include <linux/elf.h>
25#include <linux/vmalloc.h>
26#include <linux/slab.h>
27#include <linux/fs.h>
28#include <linux/string.h>
29#include <linux/kernel.h>
1#include <linux/module.h> 30#include <linux/module.h>
2#include <linux/spinlock.h> 31#include <linux/spinlock.h>
3 32
33struct mips_hi16 {
34 struct mips_hi16 *next;
35 Elf_Addr *addr;
36 Elf_Addr value;
37};
38
39static struct mips_hi16 *mips_hi16_list;
40
4static LIST_HEAD(dbe_list); 41static LIST_HEAD(dbe_list);
5static DEFINE_SPINLOCK(dbe_lock); 42static DEFINE_SPINLOCK(dbe_lock);
6 43
44void *module_alloc(unsigned long size)
45{
46 if (size == 0)
47 return NULL;
48 return vmalloc(size);
49}
50
51/* Free memory returned from module_alloc */
52void module_free(struct module *mod, void *module_region)
53{
54 vfree(module_region);
55 /* FIXME: If module_region == mod->init_region, trim exception
56 table entries. */
57}
58
59int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
60 char *secstrings, struct module *mod)
61{
62 return 0;
63}
64
65static int apply_r_mips_none(struct module *me, u32 *location, Elf_Addr v)
66{
67 return 0;
68}
69
70static int apply_r_mips_32_rel(struct module *me, u32 *location, Elf_Addr v)
71{
72 *location += v;
73
74 return 0;
75}
76
77static int apply_r_mips_32_rela(struct module *me, u32 *location, Elf_Addr v)
78{
79 *location = v;
80
81 return 0;
82}
83
84static int apply_r_mips_26_rel(struct module *me, u32 *location, Elf_Addr v)
85{
86 if (v % 4) {
87 printk(KERN_ERR "module %s: dangerous relocation\n", me->name);
88 return -ENOEXEC;
89 }
90
91 if ((v & 0xf0000000) != (((unsigned long)location + 4) & 0xf0000000)) {
92 printk(KERN_ERR
93 "module %s: relocation overflow\n",
94 me->name);
95 return -ENOEXEC;
96 }
97
98 *location = (*location & ~0x03ffffff) |
99 ((*location + (v >> 2)) & 0x03ffffff);
100
101 return 0;
102}
103
104static int apply_r_mips_26_rela(struct module *me, u32 *location, Elf_Addr v)
105{
106 if (v % 4) {
107 printk(KERN_ERR "module %s: dangerous relocation\n", me->name);
108 return -ENOEXEC;
109 }
110
111 if ((v & 0xf0000000) != (((unsigned long)location + 4) & 0xf0000000)) {
112 printk(KERN_ERR
113 "module %s: relocation overflow\n",
114 me->name);
115 return -ENOEXEC;
116 }
117
118 *location = (*location & ~0x03ffffff) | ((v >> 2) & 0x03ffffff);
119
120 return 0;
121}
122
123static int apply_r_mips_hi16_rel(struct module *me, u32 *location, Elf_Addr v)
124{
125 struct mips_hi16 *n;
126
127 /*
128 * We cannot relocate this one now because we don't know the value of
129 * the carry we need to add. Save the information, and let LO16 do the
130 * actual relocation.
131 */
132 n = kmalloc(sizeof *n, GFP_KERNEL);
133 if (!n)
134 return -ENOMEM;
135
136 n->addr = (Elf_Addr *)location;
137 n->value = v;
138 n->next = mips_hi16_list;
139 mips_hi16_list = n;
140
141 return 0;
142}
143
144static int apply_r_mips_hi16_rela(struct module *me, u32 *location, Elf_Addr v)
145{
146 *location = (*location & 0xffff0000) |
147 ((((long long) v + 0x8000LL) >> 16) & 0xffff);
148
149 return 0;
150}
151
152static int apply_r_mips_lo16_rel(struct module *me, u32 *location, Elf_Addr v)
153{
154 unsigned long insnlo = *location;
155 Elf_Addr val, vallo;
156
157 /* Sign extend the addend we extract from the lo insn. */
158 vallo = ((insnlo & 0xffff) ^ 0x8000) - 0x8000;
159
160 if (mips_hi16_list != NULL) {
161 struct mips_hi16 *l;
162
163 l = mips_hi16_list;
164 while (l != NULL) {
165 struct mips_hi16 *next;
166 unsigned long insn;
167
168 /*
169 * The value for the HI16 had best be the same.
170 */
171 if (v != l->value)
172 goto out_danger;
173
174 /*
175 * Do the HI16 relocation. Note that we actually don't
176 * need to know anything about the LO16 itself, except
177 * where to find the low 16 bits of the addend needed
178 * by the LO16.
179 */
180 insn = *l->addr;
181 val = ((insn & 0xffff) << 16) + vallo;
182 val += v;
183
184 /*
185 * Account for the sign extension that will happen in
186 * the low bits.
187 */
188 val = ((val >> 16) + ((val & 0x8000) != 0)) & 0xffff;
189
190 insn = (insn & ~0xffff) | val;
191 *l->addr = insn;
192
193 next = l->next;
194 kfree(l);
195 l = next;
196 }
197
198 mips_hi16_list = NULL;
199 }
200
201 /*
202 * Ok, we're done with the HI16 relocs. Now deal with the LO16.
203 */
204 val = v + vallo;
205 insnlo = (insnlo & ~0xffff) | (val & 0xffff);
206 *location = insnlo;
207
208 return 0;
209
210out_danger:
211 printk(KERN_ERR "module %s: dangerous " "relocation\n", me->name);
212
213 return -ENOEXEC;
214}
215
216static int apply_r_mips_lo16_rela(struct module *me, u32 *location, Elf_Addr v)
217{
218 *location = (*location & 0xffff0000) | (v & 0xffff);
219
220 return 0;
221}
222
223static int apply_r_mips_64_rela(struct module *me, u32 *location, Elf_Addr v)
224{
225 *(Elf_Addr *)location = v;
226
227 return 0;
228}
229
230static int apply_r_mips_higher_rela(struct module *me, u32 *location,
231 Elf_Addr v)
232{
233 *location = (*location & 0xffff0000) |
234 ((((long long) v + 0x80008000LL) >> 32) & 0xffff);
235
236 return 0;
237}
238
239static int apply_r_mips_highest_rela(struct module *me, u32 *location,
240 Elf_Addr v)
241{
242 *location = (*location & 0xffff0000) |
243 ((((long long) v + 0x800080008000LL) >> 48) & 0xffff);
244
245 return 0;
246}
247
248static int (*reloc_handlers_rel[]) (struct module *me, u32 *location,
249 Elf_Addr v) = {
250 [R_MIPS_NONE] = apply_r_mips_none,
251 [R_MIPS_32] = apply_r_mips_32_rel,
252 [R_MIPS_26] = apply_r_mips_26_rel,
253 [R_MIPS_HI16] = apply_r_mips_hi16_rel,
254 [R_MIPS_LO16] = apply_r_mips_lo16_rel
255};
256
257static int (*reloc_handlers_rela[]) (struct module *me, u32 *location,
258 Elf_Addr v) = {
259 [R_MIPS_NONE] = apply_r_mips_none,
260 [R_MIPS_32] = apply_r_mips_32_rela,
261 [R_MIPS_26] = apply_r_mips_26_rela,
262 [R_MIPS_HI16] = apply_r_mips_hi16_rela,
263 [R_MIPS_LO16] = apply_r_mips_lo16_rela,
264 [R_MIPS_64] = apply_r_mips_64_rela,
265 [R_MIPS_HIGHER] = apply_r_mips_higher_rela,
266 [R_MIPS_HIGHEST] = apply_r_mips_highest_rela
267};
268
269int apply_relocate(Elf_Shdr *sechdrs, const char *strtab,
270 unsigned int symindex, unsigned int relsec,
271 struct module *me)
272{
273 Elf_Mips_Rel *rel = (void *) sechdrs[relsec].sh_addr;
274 Elf_Sym *sym;
275 u32 *location;
276 unsigned int i;
277 Elf_Addr v;
278 int res;
279
280 pr_debug("Applying relocate section %u to %u\n", relsec,
281 sechdrs[relsec].sh_info);
282
283 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {
284 /* This is where to make the change */
285 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr
286 + rel[i].r_offset;
287 /* This is the symbol it is referring to */
288 sym = (Elf_Sym *)sechdrs[symindex].sh_addr
289 + ELF_MIPS_R_SYM(rel[i]);
290 if (!sym->st_value) {
291 printk(KERN_WARNING "%s: Unknown symbol %s\n",
292 me->name, strtab + sym->st_name);
293 return -ENOENT;
294 }
295
296 v = sym->st_value;
297
298 res = reloc_handlers_rel[ELF_MIPS_R_TYPE(rel[i])](me, location, v);
299 if (res)
300 return res;
301 }
302
303 return 0;
304}
305
306int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
307 unsigned int symindex, unsigned int relsec,
308 struct module *me)
309{
310 Elf_Mips_Rela *rel = (void *) sechdrs[relsec].sh_addr;
311 Elf_Sym *sym;
312 u32 *location;
313 unsigned int i;
314 Elf_Addr v;
315 int res;
316
317 pr_debug("Applying relocate section %u to %u\n", relsec,
318 sechdrs[relsec].sh_info);
319
320 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {
321 /* This is where to make the change */
322 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr
323 + rel[i].r_offset;
324 /* This is the symbol it is referring to */
325 sym = (Elf_Sym *)sechdrs[symindex].sh_addr
326 + ELF_MIPS_R_SYM(rel[i]);
327 if (!sym->st_value) {
328 printk(KERN_WARNING "%s: Unknown symbol %s\n",
329 me->name, strtab + sym->st_name);
330 return -ENOENT;
331 }
332
333 v = sym->st_value + rel[i].r_addend;
334
335 res = reloc_handlers_rela[ELF_MIPS_R_TYPE(rel[i])](me, location, v);
336 if (res)
337 return res;
338 }
339
340 return 0;
341}
342
7/* Given an address, look for it in the module exception tables. */ 343/* Given an address, look for it in the module exception tables. */
8const struct exception_table_entry *search_module_dbetables(unsigned long addr) 344const struct exception_table_entry *search_module_dbetables(unsigned long addr)
9{ 345{
diff --git a/arch/mips/kernel/proc.c b/arch/mips/kernel/proc.c
index 0f159f30e894..86fe15b273cd 100644
--- a/arch/mips/kernel/proc.c
+++ b/arch/mips/kernel/proc.c
@@ -2,7 +2,8 @@
2 * linux/arch/mips/kernel/proc.c 2 * linux/arch/mips/kernel/proc.c
3 * 3 *
4 * Copyright (C) 1995, 1996, 2001 Ralf Baechle 4 * Copyright (C) 1995, 1996, 2001 Ralf Baechle
5 * Copyright (C) 2001 MIPS Technologies, Inc. 5 * Copyright (C) 2001, 2004 MIPS Technologies, Inc.
6 * Copyright (C) 2004 Maciej W. Rozycki
6 */ 7 */
7#include <linux/config.h> 8#include <linux/config.h>
8#include <linux/delay.h> 9#include <linux/delay.h>
@@ -19,63 +20,69 @@
19unsigned int vced_count, vcei_count; 20unsigned int vced_count, vcei_count;
20 21
21static const char *cpu_name[] = { 22static const char *cpu_name[] = {
22 [CPU_UNKNOWN] "unknown", 23 [CPU_UNKNOWN] = "unknown",
23 [CPU_R2000] "R2000", 24 [CPU_R2000] = "R2000",
24 [CPU_R3000] "R3000", 25 [CPU_R3000] = "R3000",
25 [CPU_R3000A] "R3000A", 26 [CPU_R3000A] = "R3000A",
26 [CPU_R3041] "R3041", 27 [CPU_R3041] = "R3041",
27 [CPU_R3051] "R3051", 28 [CPU_R3051] = "R3051",
28 [CPU_R3052] "R3052", 29 [CPU_R3052] = "R3052",
29 [CPU_R3081] "R3081", 30 [CPU_R3081] = "R3081",
30 [CPU_R3081E] "R3081E", 31 [CPU_R3081E] = "R3081E",
31 [CPU_R4000PC] "R4000PC", 32 [CPU_R4000PC] = "R4000PC",
32 [CPU_R4000SC] "R4000SC", 33 [CPU_R4000SC] = "R4000SC",
33 [CPU_R4000MC] "R4000MC", 34 [CPU_R4000MC] = "R4000MC",
34 [CPU_R4200] "R4200", 35 [CPU_R4200] = "R4200",
35 [CPU_R4400PC] "R4400PC", 36 [CPU_R4400PC] = "R4400PC",
36 [CPU_R4400SC] "R4400SC", 37 [CPU_R4400SC] = "R4400SC",
37 [CPU_R4400MC] "R4400MC", 38 [CPU_R4400MC] = "R4400MC",
38 [CPU_R4600] "R4600", 39 [CPU_R4600] = "R4600",
39 [CPU_R6000] "R6000", 40 [CPU_R6000] = "R6000",
40 [CPU_R6000A] "R6000A", 41 [CPU_R6000A] = "R6000A",
41 [CPU_R8000] "R8000", 42 [CPU_R8000] = "R8000",
42 [CPU_R10000] "R10000", 43 [CPU_R10000] = "R10000",
43 [CPU_R12000] "R12000", 44 [CPU_R12000] = "R12000",
44 [CPU_R4300] "R4300", 45 [CPU_R4300] = "R4300",
45 [CPU_R4650] "R4650", 46 [CPU_R4650] = "R4650",
46 [CPU_R4700] "R4700", 47 [CPU_R4700] = "R4700",
47 [CPU_R5000] "R5000", 48 [CPU_R5000] = "R5000",
48 [CPU_R5000A] "R5000A", 49 [CPU_R5000A] = "R5000A",
49 [CPU_R4640] "R4640", 50 [CPU_R4640] = "R4640",
50 [CPU_NEVADA] "Nevada", 51 [CPU_NEVADA] = "Nevada",
51 [CPU_RM7000] "RM7000", 52 [CPU_RM7000] = "RM7000",
52 [CPU_RM9000] "RM9000", 53 [CPU_RM9000] = "RM9000",
53 [CPU_R5432] "R5432", 54 [CPU_R5432] = "R5432",
54 [CPU_4KC] "MIPS 4Kc", 55 [CPU_4KC] = "MIPS 4Kc",
55 [CPU_5KC] "MIPS 5Kc", 56 [CPU_5KC] = "MIPS 5Kc",
56 [CPU_R4310] "R4310", 57 [CPU_R4310] = "R4310",
57 [CPU_SB1] "SiByte SB1", 58 [CPU_SB1] = "SiByte SB1",
58 [CPU_TX3912] "TX3912", 59 [CPU_SB1A] = "SiByte SB1A",
59 [CPU_TX3922] "TX3922", 60 [CPU_TX3912] = "TX3912",
60 [CPU_TX3927] "TX3927", 61 [CPU_TX3922] = "TX3922",
61 [CPU_AU1000] "Au1000", 62 [CPU_TX3927] = "TX3927",
62 [CPU_AU1500] "Au1500", 63 [CPU_AU1000] = "Au1000",
63 [CPU_4KEC] "MIPS 4KEc", 64 [CPU_AU1500] = "Au1500",
64 [CPU_4KSC] "MIPS 4KSc", 65 [CPU_AU1100] = "Au1100",
65 [CPU_VR41XX] "NEC Vr41xx", 66 [CPU_AU1550] = "Au1550",
66 [CPU_R5500] "R5500", 67 [CPU_AU1200] = "Au1200",
67 [CPU_TX49XX] "TX49xx", 68 [CPU_4KEC] = "MIPS 4KEc",
68 [CPU_20KC] "MIPS 20Kc", 69 [CPU_4KSC] = "MIPS 4KSc",
69 [CPU_24K] "MIPS 24K", 70 [CPU_VR41XX] = "NEC Vr41xx",
70 [CPU_25KF] "MIPS 25Kf", 71 [CPU_R5500] = "R5500",
71 [CPU_VR4111] "NEC VR4111", 72 [CPU_TX49XX] = "TX49xx",
72 [CPU_VR4121] "NEC VR4121", 73 [CPU_20KC] = "MIPS 20Kc",
73 [CPU_VR4122] "NEC VR4122", 74 [CPU_24K] = "MIPS 24K",
74 [CPU_VR4131] "NEC VR4131", 75 [CPU_25KF] = "MIPS 25Kf",
75 [CPU_VR4133] "NEC VR4133", 76 [CPU_34K] = "MIPS 34K",
76 [CPU_VR4181] "NEC VR4181", 77 [CPU_VR4111] = "NEC VR4111",
77 [CPU_VR4181A] "NEC VR4181A", 78 [CPU_VR4121] = "NEC VR4121",
78 [CPU_SR71000] "Sandcraft SR71000" 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",
79}; 86};
80 87
81 88
@@ -105,8 +112,8 @@ static int show_cpuinfo(struct seq_file *m, void *v)
105 (version >> 4) & 0x0f, version & 0x0f, 112 (version >> 4) & 0x0f, version & 0x0f,
106 (fp_vers >> 4) & 0x0f, fp_vers & 0x0f); 113 (fp_vers >> 4) & 0x0f, fp_vers & 0x0f);
107 seq_printf(m, "BogoMIPS\t\t: %lu.%02lu\n", 114 seq_printf(m, "BogoMIPS\t\t: %lu.%02lu\n",
108 loops_per_jiffy / (500000/HZ), 115 cpu_data[n].udelay_val / (500000/HZ),
109 (loops_per_jiffy / (5000/HZ)) % 100); 116 (cpu_data[n].udelay_val / (5000/HZ)) % 100);
110 seq_printf(m, "wait instruction\t: %s\n", cpu_wait ? "yes" : "no"); 117 seq_printf(m, "wait instruction\t: %s\n", cpu_wait ? "yes" : "no");
111 seq_printf(m, "microsecond timers\t: %s\n", 118 seq_printf(m, "microsecond timers\t: %s\n",
112 cpu_has_counter ? "yes" : "no"); 119 cpu_has_counter ? "yes" : "no");
@@ -115,6 +122,14 @@ static int show_cpuinfo(struct seq_file *m, void *v)
115 cpu_has_divec ? "yes" : "no"); 122 cpu_has_divec ? "yes" : "no");
116 seq_printf(m, "hardware watchpoint\t: %s\n", 123 seq_printf(m, "hardware watchpoint\t: %s\n",
117 cpu_has_watch ? "yes" : "no"); 124 cpu_has_watch ? "yes" : "no");
125 seq_printf(m, "ASEs implemented\t:%s%s%s%s%s%s\n",
126 cpu_has_mips16 ? " mips16" : "",
127 cpu_has_mdmx ? " mdmx" : "",
128 cpu_has_mips3d ? " mips3d" : "",
129 cpu_has_smartmips ? " smartmips" : "",
130 cpu_has_dsp ? " dsp" : "",
131 cpu_has_mipsmt ? " mt" : ""
132 );
118 133
119 sprintf(fmt, "VCE%%c exceptions\t\t: %s\n", 134 sprintf(fmt, "VCE%%c exceptions\t\t: %s\n",
120 cpu_has_vce ? "%u" : "not available"); 135 cpu_has_vce ? "%u" : "not available");
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index e4f2f8011387..4fe3d5715c41 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -25,8 +25,10 @@
25#include <linux/init.h> 25#include <linux/init.h>
26#include <linux/completion.h> 26#include <linux/completion.h>
27 27
28#include <asm/abi.h>
28#include <asm/bootinfo.h> 29#include <asm/bootinfo.h>
29#include <asm/cpu.h> 30#include <asm/cpu.h>
31#include <asm/dsp.h>
30#include <asm/fpu.h> 32#include <asm/fpu.h>
31#include <asm/pgtable.h> 33#include <asm/pgtable.h>
32#include <asm/system.h> 34#include <asm/system.h>
@@ -39,14 +41,6 @@
39#include <asm/inst.h> 41#include <asm/inst.h>
40 42
41/* 43/*
42 * We use this if we don't have any better idle routine..
43 * (This to kill: kernel/platform.c.
44 */
45void default_idle (void)
46{
47}
48
49/*
50 * The idle thread. There's no useful work to be done, so just try to conserve 44 * The idle thread. There's no useful work to be done, so just try to conserve
51 * power and have a low exit latency (ie sit in a loop waiting for somebody to 45 * power and have a low exit latency (ie sit in a loop waiting for somebody to
52 * say that they'd like to reschedule) 46 * say that they'd like to reschedule)
@@ -62,6 +56,54 @@ ATTRIB_NORET void cpu_idle(void)
62 } 56 }
63} 57}
64 58
59extern int do_signal(sigset_t *oldset, struct pt_regs *regs);
60extern int do_signal32(sigset_t *oldset, struct pt_regs *regs);
61
62/*
63 * Native o32 and N64 ABI without DSP ASE
64 */
65extern int setup_frame(struct k_sigaction * ka, struct pt_regs *regs,
66 int signr, sigset_t *set);
67extern int setup_rt_frame(struct k_sigaction * ka, struct pt_regs *regs,
68 int signr, sigset_t *set, siginfo_t *info);
69
70struct mips_abi mips_abi = {
71 .do_signal = do_signal,
72#ifdef CONFIG_TRAD_SIGNALS
73 .setup_frame = setup_frame,
74#endif
75 .setup_rt_frame = setup_rt_frame
76};
77
78#ifdef CONFIG_MIPS32_O32
79/*
80 * o32 compatibility on 64-bit kernels, without DSP ASE
81 */
82extern int setup_frame_32(struct k_sigaction * ka, struct pt_regs *regs,
83 int signr, sigset_t *set);
84extern int setup_rt_frame_32(struct k_sigaction * ka, struct pt_regs *regs,
85 int signr, sigset_t *set, siginfo_t *info);
86
87struct mips_abi mips_abi_32 = {
88 .do_signal = do_signal32,
89 .setup_frame = setup_frame_32,
90 .setup_rt_frame = setup_rt_frame_32
91};
92#endif /* CONFIG_MIPS32_O32 */
93
94#ifdef CONFIG_MIPS32_N32
95/*
96 * N32 on 64-bit kernels, without DSP ASE
97 */
98extern int setup_rt_frame_n32(struct k_sigaction * ka, struct pt_regs *regs,
99 int signr, sigset_t *set, siginfo_t *info);
100
101struct mips_abi mips_abi_n32 = {
102 .do_signal = do_signal,
103 .setup_rt_frame = setup_rt_frame_n32
104};
105#endif /* CONFIG_MIPS32_N32 */
106
65asmlinkage void ret_from_fork(void); 107asmlinkage void ret_from_fork(void);
66 108
67void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp) 109void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp)
@@ -78,6 +120,8 @@ void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp)
78 regs->cp0_status = status; 120 regs->cp0_status = status;
79 clear_used_math(); 121 clear_used_math();
80 lose_fpu(); 122 lose_fpu();
123 if (cpu_has_dsp)
124 __init_dsp();
81 regs->cp0_epc = pc; 125 regs->cp0_epc = pc;
82 regs->regs[29] = sp; 126 regs->regs[29] = sp;
83 current_thread_info()->addr_limit = USER_DS; 127 current_thread_info()->addr_limit = USER_DS;
@@ -97,14 +141,17 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
97 struct thread_info *ti = p->thread_info; 141 struct thread_info *ti = p->thread_info;
98 struct pt_regs *childregs; 142 struct pt_regs *childregs;
99 long childksp; 143 long childksp;
144 p->set_child_tid = p->clear_child_tid = NULL;
100 145
101 childksp = (unsigned long)ti + THREAD_SIZE - 32; 146 childksp = (unsigned long)ti + THREAD_SIZE - 32;
102 147
103 preempt_disable(); 148 preempt_disable();
104 149
105 if (is_fpu_owner()) { 150 if (is_fpu_owner())
106 save_fp(p); 151 save_fp(p);
107 } 152
153 if (cpu_has_dsp)
154 save_dsp(p);
108 155
109 preempt_enable(); 156 preempt_enable();
110 157
@@ -142,6 +189,9 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
142 childregs->cp0_status &= ~(ST0_CU2|ST0_CU1); 189 childregs->cp0_status &= ~(ST0_CU2|ST0_CU1);
143 clear_tsk_thread_flag(p, TIF_USEDFPU); 190 clear_tsk_thread_flag(p, TIF_USEDFPU);
144 191
192 if (clone_flags & CLONE_SETTLS)
193 ti->tp_value = regs->regs[7];
194
145 return 0; 195 return 0;
146} 196}
147 197
@@ -175,6 +225,14 @@ void dump_regs(elf_greg_t *gp, struct pt_regs *regs)
175#endif 225#endif
176} 226}
177 227
228int dump_task_regs (struct task_struct *tsk, elf_gregset_t *regs)
229{
230 struct thread_info *ti = tsk->thread_info;
231 long ksp = (unsigned long)ti + THREAD_SIZE - 32;
232 dump_regs(&(*regs)[0], (struct pt_regs *) ksp - 1);
233 return 1;
234}
235
178int dump_task_fpu (struct task_struct *t, elf_fpregset_t *fpr) 236int dump_task_fpu (struct task_struct *t, elf_fpregset_t *fpr)
179{ 237{
180 memcpy(fpr, &t->thread.fpu, sizeof(current->thread.fpu)); 238 memcpy(fpr, &t->thread.fpu, sizeof(current->thread.fpu));
@@ -211,22 +269,48 @@ long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
211 return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL); 269 return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
212} 270}
213 271
214struct mips_frame_info { 272static struct mips_frame_info {
273 void *func;
274 int omit_fp; /* compiled without fno-omit-frame-pointer */
215 int frame_offset; 275 int frame_offset;
216 int pc_offset; 276 int pc_offset;
277} schedule_frame, mfinfo[] = {
278 { schedule, 0 }, /* must be first */
279 /* arch/mips/kernel/semaphore.c */
280 { __down, 1 },
281 { __down_interruptible, 1 },
282 /* kernel/sched.c */
283#ifdef CONFIG_PREEMPT
284 { preempt_schedule, 0 },
285#endif
286 { wait_for_completion, 0 },
287 { interruptible_sleep_on, 0 },
288 { interruptible_sleep_on_timeout, 0 },
289 { sleep_on, 0 },
290 { sleep_on_timeout, 0 },
291 { yield, 0 },
292 { io_schedule, 0 },
293 { io_schedule_timeout, 0 },
294#if defined(CONFIG_SMP) && defined(CONFIG_PREEMPT)
295 { __preempt_spin_lock, 0 },
296 { __preempt_write_lock, 0 },
297#endif
298 /* kernel/timer.c */
299 { schedule_timeout, 1 },
300/* { nanosleep_restart, 1 }, */
301 /* lib/rwsem-spinlock.c */
302 { __down_read, 1 },
303 { __down_write, 1 },
217}; 304};
218static struct mips_frame_info schedule_frame; 305
219static struct mips_frame_info schedule_timeout_frame;
220static struct mips_frame_info sleep_on_frame;
221static struct mips_frame_info sleep_on_timeout_frame;
222static struct mips_frame_info wait_for_completion_frame;
223static int mips_frame_info_initialized; 306static int mips_frame_info_initialized;
224static int __init get_frame_info(struct mips_frame_info *info, void *func) 307static int __init get_frame_info(struct mips_frame_info *info)
225{ 308{
226 int i; 309 int i;
310 void *func = info->func;
227 union mips_instruction *ip = (union mips_instruction *)func; 311 union mips_instruction *ip = (union mips_instruction *)func;
228 info->pc_offset = -1; 312 info->pc_offset = -1;
229 info->frame_offset = -1; 313 info->frame_offset = info->omit_fp ? 0 : -1;
230 for (i = 0; i < 128; i++, ip++) { 314 for (i = 0; i < 128; i++, ip++) {
231 /* if jal, jalr, jr, stop. */ 315 /* if jal, jalr, jr, stop. */
232 if (ip->j_format.opcode == jal_op || 316 if (ip->j_format.opcode == jal_op ||
@@ -247,14 +331,16 @@ static int __init get_frame_info(struct mips_frame_info *info, void *func)
247 /* sw / sd $ra, offset($sp) */ 331 /* sw / sd $ra, offset($sp) */
248 if (ip->i_format.rt == 31) { 332 if (ip->i_format.rt == 31) {
249 if (info->pc_offset != -1) 333 if (info->pc_offset != -1)
250 break; 334 continue;
251 info->pc_offset = 335 info->pc_offset =
252 ip->i_format.simmediate / sizeof(long); 336 ip->i_format.simmediate / sizeof(long);
253 } 337 }
254 /* sw / sd $s8, offset($sp) */ 338 /* sw / sd $s8, offset($sp) */
255 if (ip->i_format.rt == 30) { 339 if (ip->i_format.rt == 30) {
340//#if 0 /* gcc 3.4 does aggressive optimization... */
256 if (info->frame_offset != -1) 341 if (info->frame_offset != -1)
257 break; 342 continue;
343//#endif
258 info->frame_offset = 344 info->frame_offset =
259 ip->i_format.simmediate / sizeof(long); 345 ip->i_format.simmediate / sizeof(long);
260 } 346 }
@@ -272,13 +358,25 @@ static int __init get_frame_info(struct mips_frame_info *info, void *func)
272 358
273static int __init frame_info_init(void) 359static int __init frame_info_init(void)
274{ 360{
275 mips_frame_info_initialized = 361 int i, found;
276 !get_frame_info(&schedule_frame, schedule) && 362 for (i = 0; i < ARRAY_SIZE(mfinfo); i++)
277 !get_frame_info(&schedule_timeout_frame, schedule_timeout) && 363 if (get_frame_info(&mfinfo[i]))
278 !get_frame_info(&sleep_on_frame, sleep_on) && 364 return -1;
279 !get_frame_info(&sleep_on_timeout_frame, sleep_on_timeout) && 365 schedule_frame = mfinfo[0];
280 !get_frame_info(&wait_for_completion_frame, wait_for_completion); 366 /* bubble sort */
281 367 do {
368 struct mips_frame_info tmp;
369 found = 0;
370 for (i = 1; i < ARRAY_SIZE(mfinfo); i++) {
371 if (mfinfo[i-1].func > mfinfo[i].func) {
372 tmp = mfinfo[i];
373 mfinfo[i] = mfinfo[i-1];
374 mfinfo[i-1] = tmp;
375 found = 1;
376 }
377 }
378 } while (found);
379 mips_frame_info_initialized = 1;
282 return 0; 380 return 0;
283} 381}
284 382
@@ -303,60 +401,39 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
303/* get_wchan - a maintenance nightmare^W^Wpain in the ass ... */ 401/* get_wchan - a maintenance nightmare^W^Wpain in the ass ... */
304unsigned long get_wchan(struct task_struct *p) 402unsigned long get_wchan(struct task_struct *p)
305{ 403{
404 unsigned long stack_page;
306 unsigned long frame, pc; 405 unsigned long frame, pc;
307 406
308 if (!p || p == current || p->state == TASK_RUNNING) 407 if (!p || p == current || p->state == TASK_RUNNING)
309 return 0; 408 return 0;
310 409
311 if (!mips_frame_info_initialized) 410 stack_page = (unsigned long)p->thread_info;
411 if (!stack_page || !mips_frame_info_initialized)
312 return 0; 412 return 0;
413
313 pc = thread_saved_pc(p); 414 pc = thread_saved_pc(p);
314 if (!in_sched_functions(pc)) 415 if (!in_sched_functions(pc))
315 goto out; 416 return pc;
316
317 if (pc >= (unsigned long) sleep_on_timeout)
318 goto schedule_timeout_caller;
319 if (pc >= (unsigned long) sleep_on)
320 goto schedule_caller;
321 if (pc >= (unsigned long) interruptible_sleep_on_timeout)
322 goto schedule_timeout_caller;
323 if (pc >= (unsigned long)interruptible_sleep_on)
324 goto schedule_caller;
325 if (pc >= (unsigned long)wait_for_completion)
326 goto schedule_caller;
327 goto schedule_timeout_caller;
328
329schedule_caller:
330 frame = ((unsigned long *)p->thread.reg30)[schedule_frame.frame_offset];
331 if (pc >= (unsigned long) sleep_on)
332 pc = ((unsigned long *)frame)[sleep_on_frame.pc_offset];
333 else
334 pc = ((unsigned long *)frame)[wait_for_completion_frame.pc_offset];
335 goto out;
336 417
337schedule_timeout_caller:
338 /*
339 * The schedule_timeout frame
340 */
341 frame = ((unsigned long *)p->thread.reg30)[schedule_frame.frame_offset]; 418 frame = ((unsigned long *)p->thread.reg30)[schedule_frame.frame_offset];
419 do {
420 int i;
342 421
343 /* 422 if (frame < stack_page || frame > stack_page + THREAD_SIZE - 32)
344 * frame now points to sleep_on_timeout's frame 423 return 0;
345 */
346 pc = ((unsigned long *)frame)[schedule_timeout_frame.pc_offset];
347
348 if (in_sched_functions(pc)) {
349 /* schedule_timeout called by [interruptible_]sleep_on_timeout */
350 frame = ((unsigned long *)frame)[schedule_timeout_frame.frame_offset];
351 pc = ((unsigned long *)frame)[sleep_on_timeout_frame.pc_offset];
352 }
353 424
354out: 425 for (i = ARRAY_SIZE(mfinfo) - 1; i >= 0; i--) {
426 if (pc >= (unsigned long) mfinfo[i].func)
427 break;
428 }
429 if (i < 0)
430 break;
355 431
356#ifdef CONFIG_64BIT 432 if (mfinfo[i].omit_fp)
357 if (current->thread.mflags & MF_32BIT_REGS) /* Kludge for 32-bit ps */ 433 break;
358 pc &= 0xffffffffUL; 434 pc = ((unsigned long *)frame)[mfinfo[i].pc_offset];
359#endif 435 frame = ((unsigned long *)frame)[mfinfo[i].frame_offset];
436 } while (in_sched_functions(pc));
360 437
361 return pc; 438 return pc;
362} 439}
diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c
index 0b571a5b4b83..f1b0f3e1f95b 100644
--- a/arch/mips/kernel/ptrace.c
+++ b/arch/mips/kernel/ptrace.c
@@ -28,14 +28,18 @@
28#include <linux/security.h> 28#include <linux/security.h>
29#include <linux/signal.h> 29#include <linux/signal.h>
30 30
31#include <asm/byteorder.h>
31#include <asm/cpu.h> 32#include <asm/cpu.h>
33#include <asm/dsp.h>
32#include <asm/fpu.h> 34#include <asm/fpu.h>
33#include <asm/mipsregs.h> 35#include <asm/mipsregs.h>
36#include <asm/mipsmtregs.h>
34#include <asm/pgtable.h> 37#include <asm/pgtable.h>
35#include <asm/page.h> 38#include <asm/page.h>
36#include <asm/system.h> 39#include <asm/system.h>
37#include <asm/uaccess.h> 40#include <asm/uaccess.h>
38#include <asm/bootinfo.h> 41#include <asm/bootinfo.h>
42#include <asm/reg.h>
39 43
40/* 44/*
41 * Called by kernel/ptrace.c when detaching.. 45 * Called by kernel/ptrace.c when detaching..
@@ -47,7 +51,130 @@ void ptrace_disable(struct task_struct *child)
47 /* Nothing to do.. */ 51 /* Nothing to do.. */
48} 52}
49 53
50asmlinkage int sys_ptrace(long request, long pid, long addr, long data) 54/*
55 * Read a general register set. We always use the 64-bit format, even
56 * for 32-bit kernels and for 32-bit processes on a 64-bit kernel.
57 * Registers are sign extended to fill the available space.
58 */
59int ptrace_getregs (struct task_struct *child, __s64 __user *data)
60{
61 struct pt_regs *regs;
62 int i;
63
64 if (!access_ok(VERIFY_WRITE, data, 38 * 8))
65 return -EIO;
66
67 regs = (struct pt_regs *) ((unsigned long) child->thread_info +
68 THREAD_SIZE - 32 - sizeof(struct pt_regs));
69
70 for (i = 0; i < 32; i++)
71 __put_user (regs->regs[i], data + i);
72 __put_user (regs->lo, data + EF_LO - EF_R0);
73 __put_user (regs->hi, data + EF_HI - EF_R0);
74 __put_user (regs->cp0_epc, data + EF_CP0_EPC - EF_R0);
75 __put_user (regs->cp0_badvaddr, data + EF_CP0_BADVADDR - EF_R0);
76 __put_user (regs->cp0_status, data + EF_CP0_STATUS - EF_R0);
77 __put_user (regs->cp0_cause, data + EF_CP0_CAUSE - EF_R0);
78
79 return 0;
80}
81
82/*
83 * Write a general register set. As for PTRACE_GETREGS, we always use
84 * the 64-bit format. On a 32-bit kernel only the lower order half
85 * (according to endianness) will be used.
86 */
87int ptrace_setregs (struct task_struct *child, __s64 __user *data)
88{
89 struct pt_regs *regs;
90 int i;
91
92 if (!access_ok(VERIFY_READ, data, 38 * 8))
93 return -EIO;
94
95 regs = (struct pt_regs *) ((unsigned long) child->thread_info +
96 THREAD_SIZE - 32 - sizeof(struct pt_regs));
97
98 for (i = 0; i < 32; i++)
99 __get_user (regs->regs[i], data + i);
100 __get_user (regs->lo, data + EF_LO - EF_R0);
101 __get_user (regs->hi, data + EF_HI - EF_R0);
102 __get_user (regs->cp0_epc, data + EF_CP0_EPC - EF_R0);
103
104 /* badvaddr, status, and cause may not be written. */
105
106 return 0;
107}
108
109int ptrace_getfpregs (struct task_struct *child, __u32 __user *data)
110{
111 int i;
112
113 if (!access_ok(VERIFY_WRITE, data, 33 * 8))
114 return -EIO;
115
116 if (tsk_used_math(child)) {
117 fpureg_t *fregs = get_fpu_regs(child);
118 for (i = 0; i < 32; i++)
119 __put_user (fregs[i], i + (__u64 __user *) data);
120 } else {
121 for (i = 0; i < 32; i++)
122 __put_user ((__u64) -1, i + (__u64 __user *) data);
123 }
124
125 if (cpu_has_fpu) {
126 unsigned int flags, tmp;
127
128 __put_user (child->thread.fpu.hard.fcr31, data + 64);
129
130 preempt_disable();
131 if (cpu_has_mipsmt) {
132 unsigned int vpflags = dvpe();
133 flags = read_c0_status();
134 __enable_fpu();
135 __asm__ __volatile__("cfc1\t%0,$0" : "=r" (tmp));
136 write_c0_status(flags);
137 evpe(vpflags);
138 } else {
139 flags = read_c0_status();
140 __enable_fpu();
141 __asm__ __volatile__("cfc1\t%0,$0" : "=r" (tmp));
142 write_c0_status(flags);
143 }
144 preempt_enable();
145 __put_user (tmp, data + 65);
146 } else {
147 __put_user (child->thread.fpu.soft.fcr31, data + 64);
148 __put_user ((__u32) 0, data + 65);
149 }
150
151 return 0;
152}
153
154int ptrace_setfpregs (struct task_struct *child, __u32 __user *data)
155{
156 fpureg_t *fregs;
157 int i;
158
159 if (!access_ok(VERIFY_READ, data, 33 * 8))
160 return -EIO;
161
162 fregs = get_fpu_regs(child);
163
164 for (i = 0; i < 32; i++)
165 __get_user (fregs[i], i + (__u64 __user *) data);
166
167 if (cpu_has_fpu)
168 __get_user (child->thread.fpu.hard.fcr31, data + 64);
169 else
170 __get_user (child->thread.fpu.soft.fcr31, data + 64);
171
172 /* FIR may not be written. */
173
174 return 0;
175}
176
177asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
51{ 178{
52 struct task_struct *child; 179 struct task_struct *child;
53 int ret; 180 int ret;
@@ -103,7 +230,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
103 ret = -EIO; 230 ret = -EIO;
104 if (copied != sizeof(tmp)) 231 if (copied != sizeof(tmp))
105 break; 232 break;
106 ret = put_user(tmp,(unsigned long *) data); 233 ret = put_user(tmp,(unsigned long __user *) data);
107 break; 234 break;
108 } 235 }
109 236
@@ -169,18 +296,53 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
169 if (!cpu_has_fpu) 296 if (!cpu_has_fpu)
170 break; 297 break;
171 298
172 flags = read_c0_status(); 299 preempt_disable();
173 __enable_fpu(); 300 if (cpu_has_mipsmt) {
174 __asm__ __volatile__("cfc1\t%0,$0": "=r" (tmp)); 301 unsigned int vpflags = dvpe();
175 write_c0_status(flags); 302 flags = read_c0_status();
303 __enable_fpu();
304 __asm__ __volatile__("cfc1\t%0,$0": "=r" (tmp));
305 write_c0_status(flags);
306 evpe(vpflags);
307 } else {
308 flags = read_c0_status();
309 __enable_fpu();
310 __asm__ __volatile__("cfc1\t%0,$0": "=r" (tmp));
311 write_c0_status(flags);
312 }
313 preempt_enable();
314 break;
315 }
316 case DSP_BASE ... DSP_BASE + 5: {
317 dspreg_t *dregs;
318
319 if (!cpu_has_dsp) {
320 tmp = 0;
321 ret = -EIO;
322 goto out_tsk;
323 }
324 if (child->thread.dsp.used_dsp) {
325 dregs = __get_dsp_regs(child);
326 tmp = (unsigned long) (dregs[addr - DSP_BASE]);
327 } else {
328 tmp = -1; /* DSP registers yet used */
329 }
176 break; 330 break;
177 } 331 }
332 case DSP_CONTROL:
333 if (!cpu_has_dsp) {
334 tmp = 0;
335 ret = -EIO;
336 goto out_tsk;
337 }
338 tmp = child->thread.dsp.dspcontrol;
339 break;
178 default: 340 default:
179 tmp = 0; 341 tmp = 0;
180 ret = -EIO; 342 ret = -EIO;
181 goto out_tsk; 343 goto out_tsk;
182 } 344 }
183 ret = put_user(tmp, (unsigned long *) data); 345 ret = put_user(tmp, (unsigned long __user *) data);
184 break; 346 break;
185 } 347 }
186 348
@@ -247,6 +409,25 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
247 else 409 else
248 child->thread.fpu.soft.fcr31 = data; 410 child->thread.fpu.soft.fcr31 = data;
249 break; 411 break;
412 case DSP_BASE ... DSP_BASE + 5: {
413 dspreg_t *dregs;
414
415 if (!cpu_has_dsp) {
416 ret = -EIO;
417 break;
418 }
419
420 dregs = __get_dsp_regs(child);
421 dregs[addr - DSP_BASE] = data;
422 break;
423 }
424 case DSP_CONTROL:
425 if (!cpu_has_dsp) {
426 ret = -EIO;
427 break;
428 }
429 child->thread.dsp.dspcontrol = data;
430 break;
250 default: 431 default:
251 /* The rest are not allowed. */ 432 /* The rest are not allowed. */
252 ret = -EIO; 433 ret = -EIO;
@@ -255,6 +436,22 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
255 break; 436 break;
256 } 437 }
257 438
439 case PTRACE_GETREGS:
440 ret = ptrace_getregs (child, (__u64 __user *) data);
441 break;
442
443 case PTRACE_SETREGS:
444 ret = ptrace_setregs (child, (__u64 __user *) data);
445 break;
446
447 case PTRACE_GETFPREGS:
448 ret = ptrace_getfpregs (child, (__u32 __user *) data);
449 break;
450
451 case PTRACE_SETFPREGS:
452 ret = ptrace_setfpregs (child, (__u32 __user *) data);
453 break;
454
258 case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ 455 case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
259 case PTRACE_CONT: { /* restart after signal. */ 456 case PTRACE_CONT: { /* restart after signal. */
260 ret = -EIO; 457 ret = -EIO;
@@ -289,6 +486,11 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
289 ret = ptrace_detach(child, data); 486 ret = ptrace_detach(child, data);
290 break; 487 break;
291 488
489 case PTRACE_GET_THREAD_AREA:
490 ret = put_user(child->thread_info->tp_value,
491 (unsigned long __user *) data);
492 break;
493
292 default: 494 default:
293 ret = ptrace_request(child, request, addr, data); 495 ret = ptrace_request(child, request, addr, data);
294 break; 496 break;
@@ -303,21 +505,14 @@ out:
303 505
304static inline int audit_arch(void) 506static inline int audit_arch(void)
305{ 507{
306#ifdef CONFIG_CPU_LITTLE_ENDIAN 508 int arch = EM_MIPS;
307#ifdef CONFIG_64BIT
308 if (!(current->thread.mflags & MF_32BIT_REGS))
309 return AUDIT_ARCH_MIPSEL64;
310#endif /* MIPS64 */
311 return AUDIT_ARCH_MIPSEL;
312
313#else /* big endian... */
314#ifdef CONFIG_64BIT 509#ifdef CONFIG_64BIT
315 if (!(current->thread.mflags & MF_32BIT_REGS)) 510 arch |= __AUDIT_ARCH_64BIT;
316 return AUDIT_ARCH_MIPS64; 511#endif
317#endif /* MIPS64 */ 512#if defined(__LITTLE_ENDIAN)
318 return AUDIT_ARCH_MIPS; 513 arch |= __AUDIT_ARCH_LE;
319 514#endif
320#endif /* endian */ 515 return arch;
321} 516}
322 517
323/* 518/*
@@ -327,12 +522,13 @@ static inline int audit_arch(void)
327asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit) 522asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit)
328{ 523{
329 if (unlikely(current->audit_context) && entryexit) 524 if (unlikely(current->audit_context) && entryexit)
330 audit_syscall_exit(current, AUDITSC_RESULT(regs->regs[2]), regs->regs[2]); 525 audit_syscall_exit(current, AUDITSC_RESULT(regs->regs[2]),
526 regs->regs[2]);
331 527
332 if (!test_thread_flag(TIF_SYSCALL_TRACE))
333 goto out;
334 if (!(current->ptrace & PT_PTRACED)) 528 if (!(current->ptrace & PT_PTRACED))
335 goto out; 529 goto out;
530 if (!test_thread_flag(TIF_SYSCALL_TRACE))
531 goto out;
336 532
337 /* The 0x80 provides a way for the tracing parent to distinguish 533 /* The 0x80 provides a way for the tracing parent to distinguish
338 between a syscall stop and SIGTRAP delivery */ 534 between a syscall stop and SIGTRAP delivery */
diff --git a/arch/mips/kernel/ptrace32.c b/arch/mips/kernel/ptrace32.c
index eee207969c21..9a9b04972132 100644
--- a/arch/mips/kernel/ptrace32.c
+++ b/arch/mips/kernel/ptrace32.c
@@ -24,17 +24,24 @@
24#include <linux/smp_lock.h> 24#include <linux/smp_lock.h>
25#include <linux/user.h> 25#include <linux/user.h>
26#include <linux/security.h> 26#include <linux/security.h>
27#include <linux/signal.h>
28 27
29#include <asm/cpu.h> 28#include <asm/cpu.h>
29#include <asm/dsp.h>
30#include <asm/fpu.h> 30#include <asm/fpu.h>
31#include <asm/mipsregs.h> 31#include <asm/mipsregs.h>
32#include <asm/mipsmtregs.h>
32#include <asm/pgtable.h> 33#include <asm/pgtable.h>
33#include <asm/page.h> 34#include <asm/page.h>
34#include <asm/system.h> 35#include <asm/system.h>
35#include <asm/uaccess.h> 36#include <asm/uaccess.h>
36#include <asm/bootinfo.h> 37#include <asm/bootinfo.h>
37 38
39int ptrace_getregs (struct task_struct *child, __s64 __user *data);
40int ptrace_setregs (struct task_struct *child, __s64 __user *data);
41
42int ptrace_getfpregs (struct task_struct *child, __u32 __user *data);
43int ptrace_setfpregs (struct task_struct *child, __u32 __user *data);
44
38/* 45/*
39 * 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
40 * work. I don't know how to fix this. 47 * work. I don't know how to fix this.
@@ -99,6 +106,35 @@ asmlinkage int sys32_ptrace(int request, int pid, int addr, int data)
99 break; 106 break;
100 } 107 }
101 108
109 /*
110 * Read 4 bytes of the other process' storage
111 * data is a pointer specifying where the user wants the
112 * 4 bytes copied into
113 * addr is a pointer in the user's storage that contains an 8 byte
114 * address in the other process of the 4 bytes that is to be read
115 * (this is run in a 32-bit process looking at a 64-bit process)
116 * when I and D space are separate, these will need to be fixed.
117 */
118 case PTRACE_PEEKTEXT_3264:
119 case PTRACE_PEEKDATA_3264: {
120 u32 tmp;
121 int copied;
122 u32 __user * addrOthers;
123
124 ret = -EIO;
125
126 /* Get the addr in the other process that we want to read */
127 if (get_user(addrOthers, (u32 __user * __user *) (unsigned long) addr) != 0)
128 break;
129
130 copied = access_process_vm(child, (u64)addrOthers, &tmp,
131 sizeof(tmp), 0);
132 if (copied != sizeof(tmp))
133 break;
134 ret = put_user(tmp, (u32 __user *) (unsigned long) data);
135 break;
136 }
137
102 /* Read the word at location addr in the USER area. */ 138 /* Read the word at location addr in the USER area. */
103 case PTRACE_PEEKUSR: { 139 case PTRACE_PEEKUSR: {
104 struct pt_regs *regs; 140 struct pt_regs *regs;
@@ -156,12 +192,44 @@ asmlinkage int sys32_ptrace(int request, int pid, int addr, int data)
156 if (!cpu_has_fpu) 192 if (!cpu_has_fpu)
157 break; 193 break;
158 194
159 flags = read_c0_status(); 195 preempt_disable();
160 __enable_fpu(); 196 if (cpu_has_mipsmt) {
161 __asm__ __volatile__("cfc1\t%0,$0": "=r" (tmp)); 197 unsigned int vpflags = dvpe();
162 write_c0_status(flags); 198 flags = read_c0_status();
199 __enable_fpu();
200 __asm__ __volatile__("cfc1\t%0,$0": "=r" (tmp));
201 write_c0_status(flags);
202 evpe(vpflags);
203 } else {
204 flags = read_c0_status();
205 __enable_fpu();
206 __asm__ __volatile__("cfc1\t%0,$0": "=r" (tmp));
207 write_c0_status(flags);
208 }
209 preempt_enable();
163 break; 210 break;
164 } 211 }
212 case DSP_BASE ... DSP_BASE + 5:
213 if (!cpu_has_dsp) {
214 tmp = 0;
215 ret = -EIO;
216 goto out_tsk;
217 }
218 if (child->thread.dsp.used_dsp) {
219 dspreg_t *dregs = __get_dsp_regs(child);
220 tmp = (unsigned long) (dregs[addr - DSP_BASE]);
221 } else {
222 tmp = -1; /* DSP registers yet used */
223 }
224 break;
225 case DSP_CONTROL:
226 if (!cpu_has_dsp) {
227 tmp = 0;
228 ret = -EIO;
229 goto out_tsk;
230 }
231 tmp = child->thread.dsp.dspcontrol;
232 break;
165 default: 233 default:
166 tmp = 0; 234 tmp = 0;
167 ret = -EIO; 235 ret = -EIO;
@@ -181,6 +249,31 @@ asmlinkage int sys32_ptrace(int request, int pid, int addr, int data)
181 ret = -EIO; 249 ret = -EIO;
182 break; 250 break;
183 251
252 /*
253 * Write 4 bytes into the other process' storage
254 * data is the 4 bytes that the user wants written
255 * addr is a pointer in the user's storage that contains an
256 * 8 byte address in the other process where the 4 bytes
257 * that is to be written
258 * (this is run in a 32-bit process looking at a 64-bit process)
259 * when I and D space are separate, these will need to be fixed.
260 */
261 case PTRACE_POKETEXT_3264:
262 case PTRACE_POKEDATA_3264: {
263 u32 __user * addrOthers;
264
265 /* Get the addr in the other process that we want to write into */
266 ret = -EIO;
267 if (get_user(addrOthers, (u32 __user * __user *) (unsigned long) addr) != 0)
268 break;
269 ret = 0;
270 if (access_process_vm(child, (u64)addrOthers, &data,
271 sizeof(data), 1) == sizeof(data))
272 break;
273 ret = -EIO;
274 break;
275 }
276
184 case PTRACE_POKEUSR: { 277 case PTRACE_POKEUSR: {
185 struct pt_regs *regs; 278 struct pt_regs *regs;
186 ret = 0; 279 ret = 0;
@@ -231,6 +324,22 @@ asmlinkage int sys32_ptrace(int request, int pid, int addr, int data)
231 else 324 else
232 child->thread.fpu.soft.fcr31 = data; 325 child->thread.fpu.soft.fcr31 = data;
233 break; 326 break;
327 case DSP_BASE ... DSP_BASE + 5:
328 if (!cpu_has_dsp) {
329 ret = -EIO;
330 break;
331 }
332
333 dspreg_t *dregs = __get_dsp_regs(child);
334 dregs[addr - DSP_BASE] = data;
335 break;
336 case DSP_CONTROL:
337 if (!cpu_has_dsp) {
338 ret = -EIO;
339 break;
340 }
341 child->thread.dsp.dspcontrol = data;
342 break;
234 default: 343 default:
235 /* The rest are not allowed. */ 344 /* The rest are not allowed. */
236 ret = -EIO; 345 ret = -EIO;
@@ -239,6 +348,22 @@ asmlinkage int sys32_ptrace(int request, int pid, int addr, int data)
239 break; 348 break;
240 } 349 }
241 350
351 case PTRACE_GETREGS:
352 ret = ptrace_getregs (child, (__u64 __user *) (__u64) data);
353 break;
354
355 case PTRACE_SETREGS:
356 ret = ptrace_setregs (child, (__u64 __user *) (__u64) data);
357 break;
358
359 case PTRACE_GETFPREGS:
360 ret = ptrace_getfpregs (child, (__u32 __user *) (__u64) data);
361 break;
362
363 case PTRACE_SETFPREGS:
364 ret = ptrace_setfpregs (child, (__u32 __user *) (__u64) data);
365 break;
366
242 case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ 367 case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
243 case PTRACE_CONT: { /* restart after signal. */ 368 case PTRACE_CONT: { /* restart after signal. */
244 ret = -EIO; 369 ret = -EIO;
@@ -269,10 +394,25 @@ asmlinkage int sys32_ptrace(int request, int pid, int addr, int data)
269 wake_up_process(child); 394 wake_up_process(child);
270 break; 395 break;
271 396
397 case PTRACE_GET_THREAD_AREA:
398 ret = put_user(child->thread_info->tp_value,
399 (unsigned int __user *) (unsigned long) data);
400 break;
401
272 case PTRACE_DETACH: /* detach a process that was attached. */ 402 case PTRACE_DETACH: /* detach a process that was attached. */
273 ret = ptrace_detach(child, data); 403 ret = ptrace_detach(child, data);
274 break; 404 break;
275 405
406 case PTRACE_GETEVENTMSG:
407 ret = put_user(child->ptrace_message,
408 (unsigned int __user *) (unsigned long) data);
409 break;
410
411 case PTRACE_GET_THREAD_AREA_3264:
412 ret = put_user(child->thread_info->tp_value,
413 (unsigned long __user *) (unsigned long) data);
414 break;
415
276 default: 416 default:
277 ret = ptrace_request(child, request, addr, data); 417 ret = ptrace_request(child, request, addr, data);
278 break; 418 break;
diff --git a/arch/mips/kernel/r4k_fpu.S b/arch/mips/kernel/r4k_fpu.S
index 1a14c6b18829..283a98508fc8 100644
--- a/arch/mips/kernel/r4k_fpu.S
+++ b/arch/mips/kernel/r4k_fpu.S
@@ -32,7 +32,7 @@
32 32
33 .set noreorder 33 .set noreorder
34 .set mips3 34 .set mips3
35 /* Save floating point context */ 35
36LEAF(_save_fp_context) 36LEAF(_save_fp_context)
37 cfc1 t1, fcr31 37 cfc1 t1, fcr31
38 38
@@ -74,9 +74,6 @@ LEAF(_save_fp_context)
74 EX sdc1 $f28, SC_FPREGS+224(a0) 74 EX sdc1 $f28, SC_FPREGS+224(a0)
75 EX sdc1 $f30, SC_FPREGS+240(a0) 75 EX sdc1 $f30, SC_FPREGS+240(a0)
76 EX sw t1, SC_FPC_CSR(a0) 76 EX sw t1, SC_FPC_CSR(a0)
77 cfc1 t0, $0 # implementation/version
78 EX sw t0, SC_FPC_EIR(a0)
79
80 jr ra 77 jr ra
81 li v0, 0 # success 78 li v0, 0 # success
82 END(_save_fp_context) 79 END(_save_fp_context)
diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c
new file mode 100644
index 000000000000..8c81f3cb4e2d
--- /dev/null
+++ b/arch/mips/kernel/rtlx.c
@@ -0,0 +1,341 @@
1/*
2 * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved.
3 *
4 * This program is free software; you can distribute it and/or modify it
5 * under the terms of the GNU General Public License (Version 2) as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
16 *
17 */
18
19#include <linux/kernel.h>
20#include <linux/module.h>
21#include <linux/fs.h>
22#include <linux/init.h>
23#include <asm/uaccess.h>
24#include <linux/slab.h>
25#include <linux/list.h>
26#include <linux/vmalloc.h>
27#include <linux/elf.h>
28#include <linux/seq_file.h>
29#include <linux/syscalls.h>
30#include <linux/moduleloader.h>
31#include <linux/interrupt.h>
32#include <linux/poll.h>
33#include <linux/sched.h>
34#include <linux/wait.h>
35#include <asm/mipsmtregs.h>
36#include <asm/cacheflush.h>
37#include <asm/atomic.h>
38#include <asm/cpu.h>
39#include <asm/processor.h>
40#include <asm/system.h>
41#include <asm/rtlx.h>
42
43#define RTLX_MAJOR 64
44#define RTLX_TARG_VPE 1
45
46struct rtlx_info *rtlx;
47static int major;
48static char module_name[] = "rtlx";
49static inline int spacefree(int read, int write, int size);
50
51static struct chan_waitqueues {
52 wait_queue_head_t rt_queue;
53 wait_queue_head_t lx_queue;
54} channel_wqs[RTLX_CHANNELS];
55
56static struct irqaction irq;
57static int irq_num;
58
59extern void *vpe_get_shared(int index);
60
61static void rtlx_dispatch(struct pt_regs *regs)
62{
63 do_IRQ(MIPSCPU_INT_BASE + MIPS_CPU_RTLX_IRQ, regs);
64}
65
66irqreturn_t rtlx_interrupt(int irq, void *dev_id, struct pt_regs *regs)
67{
68 irqreturn_t r = IRQ_HANDLED;
69 int i;
70
71 for (i = 0; i < RTLX_CHANNELS; i++) {
72 struct rtlx_channel *chan = &rtlx->channel[i];
73
74 if (chan->lx_read != chan->lx_write)
75 wake_up_interruptible(&channel_wqs[i].lx_queue);
76 }
77
78 return r;
79}
80
81void dump_rtlx(void)
82{
83 int i;
84
85 printk("id 0x%lx state %d\n", rtlx->id, rtlx->state);
86
87 for (i = 0; i < RTLX_CHANNELS; i++) {
88 struct rtlx_channel *chan = &rtlx->channel[i];
89
90 printk(" rt_state %d lx_state %d buffer_size %d\n",
91 chan->rt_state, chan->lx_state, chan->buffer_size);
92
93 printk(" rt_read %d rt_write %d\n",
94 chan->rt_read, chan->rt_write);
95
96 printk(" lx_read %d lx_write %d\n",
97 chan->lx_read, chan->lx_write);
98
99 printk(" rt_buffer <%s>\n", chan->rt_buffer);
100 printk(" lx_buffer <%s>\n", chan->lx_buffer);
101 }
102}
103
104/* call when we have the address of the shared structure from the SP side. */
105static int rtlx_init(struct rtlx_info *rtlxi)
106{
107 int i;
108
109 if (rtlxi->id != RTLX_ID) {
110 printk(KERN_WARNING "no valid RTLX id at 0x%p\n", rtlxi);
111 return (-ENOEXEC);
112 }
113
114 /* initialise the wait queues */
115 for (i = 0; i < RTLX_CHANNELS; i++) {
116 init_waitqueue_head(&channel_wqs[i].rt_queue);
117 init_waitqueue_head(&channel_wqs[i].lx_queue);
118 }
119
120 /* set up for interrupt handling */
121 memset(&irq, 0, sizeof(struct irqaction));
122
123 if (cpu_has_vint) {
124 set_vi_handler(MIPS_CPU_RTLX_IRQ, rtlx_dispatch);
125 }
126
127 irq_num = MIPSCPU_INT_BASE + MIPS_CPU_RTLX_IRQ;
128 irq.handler = rtlx_interrupt;
129 irq.flags = SA_INTERRUPT;
130 irq.name = "RTLX";
131 irq.dev_id = rtlx;
132 setup_irq(irq_num, &irq);
133
134 rtlx = rtlxi;
135 return (0);
136}
137
138/* only allow one open process at a time to open each channel */
139static int rtlx_open(struct inode *inode, struct file *filp)
140{
141 int minor, ret;
142 struct rtlx_channel *chan;
143
144 /* assume only 1 device at the mo. */
145 minor = MINOR(inode->i_rdev);
146
147 if (rtlx == NULL) {
148 struct rtlx_info **p;
149 if( (p = vpe_get_shared(RTLX_TARG_VPE)) == NULL) {
150 printk(" vpe_get_shared is NULL. Has an SP program been loaded?\n");
151 return (-EFAULT);
152 }
153
154 if (*p == NULL) {
155 printk(" vpe_shared %p %p\n", p, *p);
156 return (-EFAULT);
157 }
158
159 if ((ret = rtlx_init(*p)) < 0)
160 return (ret);
161 }
162
163 chan = &rtlx->channel[minor];
164
165 /* already open? */
166 if (chan->lx_state == RTLX_STATE_OPENED)
167 return (-EBUSY);
168
169 chan->lx_state = RTLX_STATE_OPENED;
170 return (0);
171}
172
173static int rtlx_release(struct inode *inode, struct file *filp)
174{
175 int minor;
176
177 minor = MINOR(inode->i_rdev);
178 rtlx->channel[minor].lx_state = RTLX_STATE_UNUSED;
179 return (0);
180}
181
182static unsigned int rtlx_poll(struct file *file, poll_table * wait)
183{
184 int minor;
185 unsigned int mask = 0;
186 struct rtlx_channel *chan;
187
188 minor = MINOR(file->f_dentry->d_inode->i_rdev);
189 chan = &rtlx->channel[minor];
190
191 poll_wait(file, &channel_wqs[minor].rt_queue, wait);
192 poll_wait(file, &channel_wqs[minor].lx_queue, wait);
193
194 /* data available to read? */
195 if (chan->lx_read != chan->lx_write)
196 mask |= POLLIN | POLLRDNORM;
197
198 /* space to write */
199 if (spacefree(chan->rt_read, chan->rt_write, chan->buffer_size))
200 mask |= POLLOUT | POLLWRNORM;
201
202 return (mask);
203}
204
205static ssize_t rtlx_read(struct file *file, char __user * buffer, size_t count,
206 loff_t * ppos)
207{
208 size_t fl = 0L;
209 int minor;
210 struct rtlx_channel *lx;
211 DECLARE_WAITQUEUE(wait, current);
212
213 minor = MINOR(file->f_dentry->d_inode->i_rdev);
214 lx = &rtlx->channel[minor];
215
216 /* data available? */
217 if (lx->lx_write == lx->lx_read) {
218 if (file->f_flags & O_NONBLOCK)
219 return (0); // -EAGAIN makes cat whinge
220
221 /* go to sleep */
222 add_wait_queue(&channel_wqs[minor].lx_queue, &wait);
223 set_current_state(TASK_INTERRUPTIBLE);
224
225 while (lx->lx_write == lx->lx_read)
226 schedule();
227
228 set_current_state(TASK_RUNNING);
229 remove_wait_queue(&channel_wqs[minor].lx_queue, &wait);
230
231 /* back running */
232 }
233
234 /* find out how much in total */
235 count = min( count,
236 (size_t)(lx->lx_write + lx->buffer_size - lx->lx_read) % lx->buffer_size);
237
238 /* then how much from the read pointer onwards */
239 fl = min( count, (size_t)lx->buffer_size - lx->lx_read);
240
241 copy_to_user (buffer, &lx->lx_buffer[lx->lx_read], fl);
242
243 /* and if there is anything left at the beginning of the buffer */
244 if ( count - fl )
245 copy_to_user (buffer + fl, lx->lx_buffer, count - fl);
246
247 /* update the index */
248 lx->lx_read += count;
249 lx->lx_read %= lx->buffer_size;
250
251 return (count);
252}
253
254static inline int spacefree(int read, int write, int size)
255{
256 if (read == write) {
257 /* never fill the buffer completely, so indexes are always equal if empty
258 and only empty, or !equal if data available */
259 return (size - 1);
260 }
261
262 return ((read + size - write) % size) - 1;
263}
264
265static ssize_t rtlx_write(struct file *file, const char __user * buffer,
266 size_t count, loff_t * ppos)
267{
268 int minor;
269 struct rtlx_channel *rt;
270 size_t fl;
271 DECLARE_WAITQUEUE(wait, current);
272
273 minor = MINOR(file->f_dentry->d_inode->i_rdev);
274 rt = &rtlx->channel[minor];
275
276 /* any space left... */
277 if (!spacefree(rt->rt_read, rt->rt_write, rt->buffer_size)) {
278
279 if (file->f_flags & O_NONBLOCK)
280 return (-EAGAIN);
281
282 add_wait_queue(&channel_wqs[minor].rt_queue, &wait);
283 set_current_state(TASK_INTERRUPTIBLE);
284
285 while (!spacefree(rt->rt_read, rt->rt_write, rt->buffer_size))
286 schedule();
287
288 set_current_state(TASK_RUNNING);
289 remove_wait_queue(&channel_wqs[minor].rt_queue, &wait);
290 }
291
292 /* total number of bytes to copy */
293 count = min( count, (size_t)spacefree(rt->rt_read, rt->rt_write, rt->buffer_size) );
294
295 /* first bit from write pointer to the end of the buffer, or count */
296 fl = min(count, (size_t) rt->buffer_size - rt->rt_write);
297
298 copy_from_user(&rt->rt_buffer[rt->rt_write], buffer, fl);
299
300 /* if there's any left copy to the beginning of the buffer */
301 if( count - fl )
302 copy_from_user(rt->rt_buffer, buffer + fl, count - fl);
303
304 rt->rt_write += count;
305 rt->rt_write %= rt->buffer_size;
306
307 return(count);
308}
309
310static struct file_operations rtlx_fops = {
311 .owner = THIS_MODULE,
312 .open = rtlx_open,
313 .release = rtlx_release,
314 .write = rtlx_write,
315 .read = rtlx_read,
316 .poll = rtlx_poll
317};
318
319static int rtlx_module_init(void)
320{
321 if ((major = register_chrdev(RTLX_MAJOR, module_name, &rtlx_fops)) < 0) {
322 printk("rtlx_module_init: unable to register device\n");
323 return (-EBUSY);
324 }
325
326 if (major == 0)
327 major = RTLX_MAJOR;
328
329 return (0);
330}
331
332static void rtlx_module_exit(void)
333{
334 unregister_chrdev(major, module_name);
335}
336
337module_init(rtlx_module_init);
338module_exit(rtlx_module_exit);
339MODULE_DESCRIPTION("MIPS RTLX");
340MODULE_AUTHOR("Elizabeth Clarke, MIPS Technologies, Inc");
341MODULE_LICENSE("GPL");
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S
index 17b5030fb6ea..4dd8e8b4fbc2 100644
--- a/arch/mips/kernel/scall32-o32.S
+++ b/arch/mips/kernel/scall32-o32.S
@@ -578,7 +578,7 @@ einval: li v0, -EINVAL
578 sys sys_fremovexattr 2 /* 4235 */ 578 sys sys_fremovexattr 2 /* 4235 */
579 sys sys_tkill 2 579 sys sys_tkill 2
580 sys sys_sendfile64 5 580 sys sys_sendfile64 5
581 sys sys_futex 2 581 sys sys_futex 6
582 sys sys_sched_setaffinity 3 582 sys sys_sched_setaffinity 3
583 sys sys_sched_getaffinity 3 /* 4240 */ 583 sys sys_sched_getaffinity 3 /* 4240 */
584 sys sys_io_setup 2 584 sys sys_io_setup 2
@@ -587,7 +587,7 @@ einval: li v0, -EINVAL
587 sys sys_io_submit 3 587 sys sys_io_submit 3
588 sys sys_io_cancel 3 /* 4245 */ 588 sys sys_io_cancel 3 /* 4245 */
589 sys sys_exit_group 1 589 sys sys_exit_group 1
590 sys sys_lookup_dcookie 3 590 sys sys_lookup_dcookie 4
591 sys sys_epoll_create 1 591 sys sys_epoll_create 1
592 sys sys_epoll_ctl 4 592 sys sys_epoll_ctl 4
593 sys sys_epoll_wait 3 /* 4250 */ 593 sys sys_epoll_wait 3 /* 4250 */
@@ -618,12 +618,15 @@ einval: li v0, -EINVAL
618 sys sys_mq_notify 2 /* 4275 */ 618 sys sys_mq_notify 2 /* 4275 */
619 sys sys_mq_getsetattr 3 619 sys sys_mq_getsetattr 3
620 sys sys_ni_syscall 0 /* sys_vserver */ 620 sys sys_ni_syscall 0 /* sys_vserver */
621 sys sys_waitid 4 621 sys sys_waitid 5
622 sys sys_ni_syscall 0 /* available, was setaltroot */ 622 sys sys_ni_syscall 0 /* available, was setaltroot */
623 sys sys_add_key 5 623 sys sys_add_key 5 /* 4280 */
624 sys sys_request_key 4 624 sys sys_request_key 4
625 sys sys_keyctl 5 625 sys sys_keyctl 5
626 626 sys sys_set_thread_area 1
627 sys sys_inotify_init 0
628 sys sys_inotify_add_watch 3 /* 4285 */
629 sys sys_inotify_rm_watch 2
627 .endm 630 .endm
628 631
629 /* We pre-compute the number of _instruction_ bytes needed to 632 /* We pre-compute the number of _instruction_ bytes needed to
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S
index ffb22a2068bf..9085838d6ce3 100644
--- a/arch/mips/kernel/scall64-64.S
+++ b/arch/mips/kernel/scall64-64.S
@@ -449,3 +449,7 @@ sys_call_table:
449 PTR sys_add_key 449 PTR sys_add_key
450 PTR sys_request_key /* 5240 */ 450 PTR sys_request_key /* 5240 */
451 PTR sys_keyctl 451 PTR sys_keyctl
452 PTR sys_set_thread_area
453 PTR sys_inotify_init
454 PTR sys_inotify_add_watch
455 PTR sys_inotify_rm_watch /* 5245 */
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S
index e52049c87bc3..7e66eb823bf6 100644
--- a/arch/mips/kernel/scall64-n32.S
+++ b/arch/mips/kernel/scall64-n32.S
@@ -176,7 +176,7 @@ EXPORT(sysn32_call_table)
176 PTR sys_fork 176 PTR sys_fork
177 PTR sys32_execve 177 PTR sys32_execve
178 PTR sys_exit 178 PTR sys_exit
179 PTR sys32_wait4 179 PTR compat_sys_wait4
180 PTR sys_kill /* 6060 */ 180 PTR sys_kill /* 6060 */
181 PTR sys32_newuname 181 PTR sys32_newuname
182 PTR sys_semget 182 PTR sys_semget
@@ -216,7 +216,7 @@ EXPORT(sysn32_call_table)
216 PTR compat_sys_getrusage 216 PTR compat_sys_getrusage
217 PTR sys32_sysinfo 217 PTR sys32_sysinfo
218 PTR compat_sys_times 218 PTR compat_sys_times
219 PTR sys_ptrace 219 PTR sys32_ptrace
220 PTR sys_getuid /* 6100 */ 220 PTR sys_getuid /* 6100 */
221 PTR sys_syslog 221 PTR sys_syslog
222 PTR sys_getgid 222 PTR sys_getgid
@@ -243,14 +243,14 @@ EXPORT(sysn32_call_table)
243 PTR sys_capget 243 PTR sys_capget
244 PTR sys_capset 244 PTR sys_capset
245 PTR sys32_rt_sigpending /* 6125 */ 245 PTR sys32_rt_sigpending /* 6125 */
246 PTR compat_sys_rt_sigtimedwait 246 PTR sysn32_rt_sigtimedwait
247 PTR sys32_rt_sigqueueinfo 247 PTR sys_rt_sigqueueinfo
248 PTR sys32_rt_sigsuspend 248 PTR sys32_rt_sigsuspend
249 PTR sys32_sigaltstack 249 PTR sys32_sigaltstack
250 PTR compat_sys_utime /* 6130 */ 250 PTR compat_sys_utime /* 6130 */
251 PTR sys_mknod 251 PTR sys_mknod
252 PTR sys32_personality 252 PTR sys32_personality
253 PTR sys_ustat 253 PTR sys32_ustat
254 PTR compat_sys_statfs 254 PTR compat_sys_statfs
255 PTR compat_sys_fstatfs /* 6135 */ 255 PTR compat_sys_fstatfs /* 6135 */
256 PTR sys_sysfs 256 PTR sys_sysfs
@@ -329,7 +329,7 @@ EXPORT(sysn32_call_table)
329 PTR sys_epoll_wait 329 PTR sys_epoll_wait
330 PTR sys_remap_file_pages /* 6210 */ 330 PTR sys_remap_file_pages /* 6210 */
331 PTR sysn32_rt_sigreturn 331 PTR sysn32_rt_sigreturn
332 PTR sys_fcntl 332 PTR compat_sys_fcntl64
333 PTR sys_set_tid_address 333 PTR sys_set_tid_address
334 PTR sys_restart_syscall 334 PTR sys_restart_syscall
335 PTR sys_semtimedop /* 6215 */ 335 PTR sys_semtimedop /* 6215 */
@@ -337,15 +337,15 @@ EXPORT(sysn32_call_table)
337 PTR compat_sys_statfs64 337 PTR compat_sys_statfs64
338 PTR compat_sys_fstatfs64 338 PTR compat_sys_fstatfs64
339 PTR sys_sendfile64 339 PTR sys_sendfile64
340 PTR sys_timer_create /* 6220 */ 340 PTR sys32_timer_create /* 6220 */
341 PTR sys_timer_settime 341 PTR compat_sys_timer_settime
342 PTR sys_timer_gettime 342 PTR compat_sys_timer_gettime
343 PTR sys_timer_getoverrun 343 PTR sys_timer_getoverrun
344 PTR sys_timer_delete 344 PTR sys_timer_delete
345 PTR sys_clock_settime /* 6225 */ 345 PTR compat_sys_clock_settime /* 6225 */
346 PTR sys_clock_gettime 346 PTR compat_sys_clock_gettime
347 PTR sys_clock_getres 347 PTR compat_sys_clock_getres
348 PTR sys_clock_nanosleep 348 PTR compat_sys_clock_nanosleep
349 PTR sys_tgkill 349 PTR sys_tgkill
350 PTR compat_sys_utimes /* 6230 */ 350 PTR compat_sys_utimes /* 6230 */
351 PTR sys_ni_syscall /* sys_mbind */ 351 PTR sys_ni_syscall /* sys_mbind */
@@ -358,8 +358,12 @@ EXPORT(sysn32_call_table)
358 PTR compat_sys_mq_notify 358 PTR compat_sys_mq_notify
359 PTR compat_sys_mq_getsetattr 359 PTR compat_sys_mq_getsetattr
360 PTR sys_ni_syscall /* 6240, sys_vserver */ 360 PTR sys_ni_syscall /* 6240, sys_vserver */
361 PTR sys_waitid 361 PTR sysn32_waitid
362 PTR sys_ni_syscall /* available, was setaltroot */ 362 PTR sys_ni_syscall /* available, was setaltroot */
363 PTR sys_add_key 363 PTR sys_add_key
364 PTR sys_request_key 364 PTR sys_request_key
365 PTR sys_keyctl /* 6245 */ 365 PTR sys_keyctl /* 6245 */
366 PTR sys_set_thread_area
367 PTR sys_inotify_init
368 PTR sys_inotify_add_watch
369 PTR sys_inotify_rm_watch
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S
index 739f3998d76b..5a16401e443a 100644
--- a/arch/mips/kernel/scall64-o32.S
+++ b/arch/mips/kernel/scall64-o32.S
@@ -316,13 +316,13 @@ sys_call_table:
316 PTR sys_vhangup 316 PTR sys_vhangup
317 PTR sys_ni_syscall /* was sys_idle */ 317 PTR sys_ni_syscall /* was sys_idle */
318 PTR sys_ni_syscall /* sys_vm86 */ 318 PTR sys_ni_syscall /* sys_vm86 */
319 PTR sys32_wait4 319 PTR compat_sys_wait4
320 PTR sys_swapoff /* 4115 */ 320 PTR sys_swapoff /* 4115 */
321 PTR sys32_sysinfo 321 PTR sys32_sysinfo
322 PTR sys32_ipc 322 PTR sys32_ipc
323 PTR sys_fsync 323 PTR sys_fsync
324 PTR sys32_sigreturn 324 PTR sys32_sigreturn
325 PTR sys_clone /* 4120 */ 325 PTR sys32_clone /* 4120 */
326 PTR sys_setdomainname 326 PTR sys_setdomainname
327 PTR sys32_newuname 327 PTR sys32_newuname
328 PTR sys_ni_syscall /* sys_modify_ldt */ 328 PTR sys_ni_syscall /* sys_modify_ldt */
@@ -391,7 +391,7 @@ sys_call_table:
391 PTR sys_getresuid 391 PTR sys_getresuid
392 PTR sys_ni_syscall /* was query_module */ 392 PTR sys_ni_syscall /* was query_module */
393 PTR sys_poll 393 PTR sys_poll
394 PTR sys_nfsservctl 394 PTR compat_sys_nfsservctl
395 PTR sys_setresgid /* 4190 */ 395 PTR sys_setresgid /* 4190 */
396 PTR sys_getresgid 396 PTR sys_getresgid
397 PTR sys_prctl 397 PTR sys_prctl
@@ -459,7 +459,7 @@ sys_call_table:
459 PTR sys_fadvise64_64 459 PTR sys_fadvise64_64
460 PTR compat_sys_statfs64 /* 4255 */ 460 PTR compat_sys_statfs64 /* 4255 */
461 PTR compat_sys_fstatfs64 461 PTR compat_sys_fstatfs64
462 PTR sys_timer_create 462 PTR sys32_timer_create
463 PTR compat_sys_timer_settime 463 PTR compat_sys_timer_settime
464 PTR compat_sys_timer_gettime 464 PTR compat_sys_timer_gettime
465 PTR sys_timer_getoverrun /* 4260 */ 465 PTR sys_timer_getoverrun /* 4260 */
@@ -480,9 +480,13 @@ sys_call_table:
480 PTR compat_sys_mq_notify /* 4275 */ 480 PTR compat_sys_mq_notify /* 4275 */
481 PTR compat_sys_mq_getsetattr 481 PTR compat_sys_mq_getsetattr
482 PTR sys_ni_syscall /* sys_vserver */ 482 PTR sys_ni_syscall /* sys_vserver */
483 PTR sys_waitid 483 PTR sys32_waitid
484 PTR sys_ni_syscall /* available, was setaltroot */ 484 PTR sys_ni_syscall /* available, was setaltroot */
485 PTR sys_add_key /* 4280 */ 485 PTR sys_add_key /* 4280 */
486 PTR sys_request_key 486 PTR sys_request_key
487 PTR sys_keyctl 487 PTR sys_keyctl
488 PTR sys_set_thread_area
489 PTR sys_inotify_init
490 PTR sys_inotify_add_watch /* 4285 */
491 PTR sys_inotify_rm_watch
488 .size sys_call_table,.-sys_call_table 492 .size sys_call_table,.-sys_call_table
diff --git a/arch/mips/kernel/semaphore.c b/arch/mips/kernel/semaphore.c
index 9c40fe5a8e8d..1265358cdca1 100644
--- a/arch/mips/kernel/semaphore.c
+++ b/arch/mips/kernel/semaphore.c
@@ -42,24 +42,28 @@ static inline int __sem_update_count(struct semaphore *sem, int incr)
42 42
43 if (cpu_has_llsc && R10000_LLSC_WAR) { 43 if (cpu_has_llsc && R10000_LLSC_WAR) {
44 __asm__ __volatile__( 44 __asm__ __volatile__(
45 "1: ll %0, %2 \n" 45 " .set mips3 \n"
46 "1: ll %0, %2 # __sem_update_count \n"
46 " sra %1, %0, 31 \n" 47 " sra %1, %0, 31 \n"
47 " not %1 \n" 48 " not %1 \n"
48 " and %1, %0, %1 \n" 49 " and %1, %0, %1 \n"
49 " add %1, %1, %3 \n" 50 " addu %1, %1, %3 \n"
50 " sc %1, %2 \n" 51 " sc %1, %2 \n"
51 " beqzl %1, 1b \n" 52 " beqzl %1, 1b \n"
53 " .set mips0 \n"
52 : "=&r" (old_count), "=&r" (tmp), "=m" (sem->count) 54 : "=&r" (old_count), "=&r" (tmp), "=m" (sem->count)
53 : "r" (incr), "m" (sem->count)); 55 : "r" (incr), "m" (sem->count));
54 } else if (cpu_has_llsc) { 56 } else if (cpu_has_llsc) {
55 __asm__ __volatile__( 57 __asm__ __volatile__(
56 "1: ll %0, %2 \n" 58 " .set mips3 \n"
59 "1: ll %0, %2 # __sem_update_count \n"
57 " sra %1, %0, 31 \n" 60 " sra %1, %0, 31 \n"
58 " not %1 \n" 61 " not %1 \n"
59 " and %1, %0, %1 \n" 62 " and %1, %0, %1 \n"
60 " add %1, %1, %3 \n" 63 " addu %1, %1, %3 \n"
61 " sc %1, %2 \n" 64 " sc %1, %2 \n"
62 " beqz %1, 1b \n" 65 " beqz %1, 1b \n"
66 " .set mips0 \n"
63 : "=&r" (old_count), "=&r" (tmp), "=m" (sem->count) 67 : "=&r" (old_count), "=&r" (tmp), "=m" (sem->count)
64 : "r" (incr), "m" (sem->count)); 68 : "r" (incr), "m" (sem->count));
65 } else { 69 } else {
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 12b531c295c4..d86affa21278 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -37,12 +37,13 @@
37 37
38#include <asm/addrspace.h> 38#include <asm/addrspace.h>
39#include <asm/bootinfo.h> 39#include <asm/bootinfo.h>
40#include <asm/cache.h>
40#include <asm/cpu.h> 41#include <asm/cpu.h>
41#include <asm/sections.h> 42#include <asm/sections.h>
42#include <asm/setup.h> 43#include <asm/setup.h>
43#include <asm/system.h> 44#include <asm/system.h>
44 45
45struct cpuinfo_mips cpu_data[NR_CPUS]; 46struct cpuinfo_mips cpu_data[NR_CPUS] __read_mostly;
46 47
47EXPORT_SYMBOL(cpu_data); 48EXPORT_SYMBOL(cpu_data);
48 49
@@ -62,8 +63,8 @@ EXPORT_SYMBOL(PCI_DMA_BUS_IS_PHYS);
62 * 63 *
63 * These are initialized so they are in the .data section 64 * These are initialized so they are in the .data section
64 */ 65 */
65unsigned long mips_machtype = MACH_UNKNOWN; 66unsigned long mips_machtype __read_mostly = MACH_UNKNOWN;
66unsigned long mips_machgroup = MACH_GROUP_UNKNOWN; 67unsigned long mips_machgroup __read_mostly = MACH_GROUP_UNKNOWN;
67 68
68EXPORT_SYMBOL(mips_machtype); 69EXPORT_SYMBOL(mips_machtype);
69EXPORT_SYMBOL(mips_machgroup); 70EXPORT_SYMBOL(mips_machgroup);
@@ -77,7 +78,7 @@ static char command_line[CL_SIZE];
77 * mips_io_port_base is the begin of the address space to which x86 style 78 * mips_io_port_base is the begin of the address space to which x86 style
78 * I/O ports are mapped. 79 * I/O ports are mapped.
79 */ 80 */
80const unsigned long mips_io_port_base = -1; 81const unsigned long mips_io_port_base __read_mostly = -1;
81EXPORT_SYMBOL(mips_io_port_base); 82EXPORT_SYMBOL(mips_io_port_base);
82 83
83/* 84/*
@@ -510,31 +511,7 @@ static inline void resource_init(void)
510#undef MAXMEM 511#undef MAXMEM
511#undef MAXMEM_PFN 512#undef MAXMEM_PFN
512 513
513static int __initdata earlyinit_debug; 514extern void plat_setup(void);
514
515static int __init earlyinit_debug_setup(char *str)
516{
517 earlyinit_debug = 1;
518 return 1;
519}
520__setup("earlyinit_debug", earlyinit_debug_setup);
521
522extern initcall_t __earlyinitcall_start, __earlyinitcall_end;
523
524static void __init do_earlyinitcalls(void)
525{
526 initcall_t *call, *start, *end;
527
528 start = &__earlyinitcall_start;
529 end = &__earlyinitcall_end;
530
531 for (call = start; call < end; call++) {
532 if (earlyinit_debug)
533 printk("calling earlyinitcall 0x%p\n", *call);
534
535 (*call)();
536 }
537}
538 515
539void __init setup_arch(char **cmdline_p) 516void __init setup_arch(char **cmdline_p)
540{ 517{
@@ -551,7 +528,7 @@ void __init setup_arch(char **cmdline_p)
551#endif 528#endif
552 529
553 /* call board setup routine */ 530 /* call board setup routine */
554 do_earlyinitcalls(); 531 plat_setup();
555 532
556 strlcpy(command_line, arcs_cmdline, sizeof(command_line)); 533 strlcpy(command_line, arcs_cmdline, sizeof(command_line));
557 strlcpy(saved_command_line, command_line, COMMAND_LINE_SIZE); 534 strlcpy(saved_command_line, command_line, COMMAND_LINE_SIZE);
@@ -573,3 +550,12 @@ int __init fpu_disable(char *s)
573} 550}
574 551
575__setup("nofpu", fpu_disable); 552__setup("nofpu", fpu_disable);
553
554int __init dsp_disable(char *s)
555{
556 cpu_data[0].ases &= ~MIPS_ASE_DSP;
557
558 return 1;
559}
560
561__setup("nodsp", dsp_disable);
diff --git a/arch/mips/kernel/signal-common.h b/arch/mips/kernel/signal-common.h
index f9234df53253..0f66ae5838b9 100644
--- a/arch/mips/kernel/signal-common.h
+++ b/arch/mips/kernel/signal-common.h
@@ -8,13 +8,14 @@
8 * Copyright (C) 1999, 2000 Silicon Graphics, Inc. 8 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
9 */ 9 */
10 10
11#include <linux/config.h>
12
11static inline int 13static inline int
12setup_sigcontext(struct pt_regs *regs, struct sigcontext *sc) 14setup_sigcontext(struct pt_regs *regs, struct sigcontext *sc)
13{ 15{
14 int err = 0; 16 int err = 0;
15 17
16 err |= __put_user(regs->cp0_epc, &sc->sc_pc); 18 err |= __put_user(regs->cp0_epc, &sc->sc_pc);
17 err |= __put_user(regs->cp0_status, &sc->sc_status);
18 19
19#define save_gp_reg(i) do { \ 20#define save_gp_reg(i) do { \
20 err |= __put_user(regs->regs[i], &sc->sc_regs[i]); \ 21 err |= __put_user(regs->regs[i], &sc->sc_regs[i]); \
@@ -30,10 +31,32 @@ setup_sigcontext(struct pt_regs *regs, struct sigcontext *sc)
30 save_gp_reg(31); 31 save_gp_reg(31);
31#undef save_gp_reg 32#undef save_gp_reg
32 33
34#ifdef CONFIG_32BIT
33 err |= __put_user(regs->hi, &sc->sc_mdhi); 35 err |= __put_user(regs->hi, &sc->sc_mdhi);
34 err |= __put_user(regs->lo, &sc->sc_mdlo); 36 err |= __put_user(regs->lo, &sc->sc_mdlo);
35 err |= __put_user(regs->cp0_cause, &sc->sc_cause); 37 if (cpu_has_dsp) {
36 err |= __put_user(regs->cp0_badvaddr, &sc->sc_badvaddr); 38 err |= __put_user(mfhi1(), &sc->sc_hi1);
39 err |= __put_user(mflo1(), &sc->sc_lo1);
40 err |= __put_user(mfhi2(), &sc->sc_hi2);
41 err |= __put_user(mflo2(), &sc->sc_lo2);
42 err |= __put_user(mfhi3(), &sc->sc_hi3);
43 err |= __put_user(mflo3(), &sc->sc_lo3);
44 err |= __put_user(rddsp(DSP_MASK), &sc->sc_dsp);
45 }
46#endif
47#ifdef CONFIG_64BIT
48 err |= __put_user(regs->hi, &sc->sc_hi[0]);
49 err |= __put_user(regs->lo, &sc->sc_lo[0]);
50 if (cpu_has_dsp) {
51 err |= __put_user(mfhi1(), &sc->sc_hi[1]);
52 err |= __put_user(mflo1(), &sc->sc_lo[1]);
53 err |= __put_user(mfhi2(), &sc->sc_hi[2]);
54 err |= __put_user(mflo2(), &sc->sc_lo[2]);
55 err |= __put_user(mfhi3(), &sc->sc_hi[3]);
56 err |= __put_user(mflo3(), &sc->sc_lo[3]);
57 err |= __put_user(rddsp(DSP_MASK), &sc->sc_dsp);
58 }
59#endif
37 60
38 err |= __put_user(!!used_math(), &sc->sc_used_math); 61 err |= __put_user(!!used_math(), &sc->sc_used_math);
39 62
@@ -61,15 +84,40 @@ out:
61static inline int 84static inline int
62restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc) 85restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc)
63{ 86{
64 int err = 0;
65 unsigned int used_math; 87 unsigned int used_math;
88 unsigned long treg;
89 int err = 0;
66 90
67 /* Always make any pending restarted system calls return -EINTR */ 91 /* Always make any pending restarted system calls return -EINTR */
68 current_thread_info()->restart_block.fn = do_no_restart_syscall; 92 current_thread_info()->restart_block.fn = do_no_restart_syscall;
69 93
70 err |= __get_user(regs->cp0_epc, &sc->sc_pc); 94 err |= __get_user(regs->cp0_epc, &sc->sc_pc);
95#ifdef CONFIG_32BIT
71 err |= __get_user(regs->hi, &sc->sc_mdhi); 96 err |= __get_user(regs->hi, &sc->sc_mdhi);
72 err |= __get_user(regs->lo, &sc->sc_mdlo); 97 err |= __get_user(regs->lo, &sc->sc_mdlo);
98 if (cpu_has_dsp) {
99 err |= __get_user(treg, &sc->sc_hi1); mthi1(treg);
100 err |= __get_user(treg, &sc->sc_lo1); mtlo1(treg);
101 err |= __get_user(treg, &sc->sc_hi2); mthi2(treg);
102 err |= __get_user(treg, &sc->sc_lo2); mtlo2(treg);
103 err |= __get_user(treg, &sc->sc_hi3); mthi3(treg);
104 err |= __get_user(treg, &sc->sc_lo3); mtlo3(treg);
105 err |= __get_user(treg, &sc->sc_dsp); wrdsp(treg, DSP_MASK);
106 }
107#endif
108#ifdef CONFIG_64BIT
109 err |= __get_user(regs->hi, &sc->sc_hi[0]);
110 err |= __get_user(regs->lo, &sc->sc_lo[0]);
111 if (cpu_has_dsp) {
112 err |= __get_user(treg, &sc->sc_hi[1]); mthi1(treg);
113 err |= __get_user(treg, &sc->sc_lo[1]); mthi1(treg);
114 err |= __get_user(treg, &sc->sc_hi[2]); mthi2(treg);
115 err |= __get_user(treg, &sc->sc_lo[2]); mthi2(treg);
116 err |= __get_user(treg, &sc->sc_hi[3]); mthi3(treg);
117 err |= __get_user(treg, &sc->sc_lo[3]); mthi3(treg);
118 err |= __get_user(treg, &sc->sc_dsp); wrdsp(treg, DSP_MASK);
119 }
120#endif
73 121
74#define restore_gp_reg(i) do { \ 122#define restore_gp_reg(i) do { \
75 err |= __get_user(regs->regs[i], &sc->sc_regs[i]); \ 123 err |= __get_user(regs->regs[i], &sc->sc_regs[i]); \
@@ -112,7 +160,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc)
112static inline void * 160static inline void *
113get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size) 161get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size)
114{ 162{
115 unsigned long sp, almask; 163 unsigned long sp;
116 164
117 /* Default to using normal stack */ 165 /* Default to using normal stack */
118 sp = regs->regs[29]; 166 sp = regs->regs[29];
@@ -128,10 +176,32 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size)
128 if ((ka->sa.sa_flags & SA_ONSTACK) && (sas_ss_flags (sp) == 0)) 176 if ((ka->sa.sa_flags & SA_ONSTACK) && (sas_ss_flags (sp) == 0))
129 sp = current->sas_ss_sp + current->sas_ss_size; 177 sp = current->sas_ss_sp + current->sas_ss_size;
130 178
131 if (PLAT_TRAMPOLINE_STUFF_LINE) 179 return (void *)((sp - frame_size) & (ICACHE_REFILLS_WORKAROUND_WAR ? 32 : ALMASK));
132 almask = ~(PLAT_TRAMPOLINE_STUFF_LINE - 1); 180}
133 else 181
134 almask = ALMASK; 182static inline int install_sigtramp(unsigned int __user *tramp,
183 unsigned int syscall)
184{
185 int err;
186
187 /*
188 * Set up the return code ...
189 *
190 * li v0, __NR__foo_sigreturn
191 * syscall
192 */
193
194 err = __put_user(0x24020000 + syscall, tramp + 0);
195 err |= __put_user(0x0000000c , tramp + 1);
196 if (ICACHE_REFILLS_WORKAROUND_WAR) {
197 err |= __put_user(0, tramp + 2);
198 err |= __put_user(0, tramp + 3);
199 err |= __put_user(0, tramp + 4);
200 err |= __put_user(0, tramp + 5);
201 err |= __put_user(0, tramp + 6);
202 err |= __put_user(0, tramp + 7);
203 }
204 flush_cache_sigtramp((unsigned long) tramp);
135 205
136 return (void *)((sp - frame_size) & almask); 206 return err;
137} 207}
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c
index 0209c1dd1429..9202a17db8f7 100644
--- a/arch/mips/kernel/signal.c
+++ b/arch/mips/kernel/signal.c
@@ -8,6 +8,7 @@
8 * Copyright (C) 1999, 2000 Silicon Graphics, Inc. 8 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
9 */ 9 */
10#include <linux/config.h> 10#include <linux/config.h>
11#include <linux/cache.h>
11#include <linux/sched.h> 12#include <linux/sched.h>
12#include <linux/mm.h> 13#include <linux/mm.h>
13#include <linux/personality.h> 14#include <linux/personality.h>
@@ -21,6 +22,7 @@
21#include <linux/unistd.h> 22#include <linux/unistd.h>
22#include <linux/compiler.h> 23#include <linux/compiler.h>
23 24
25#include <asm/abi.h>
24#include <asm/asm.h> 26#include <asm/asm.h>
25#include <linux/bitops.h> 27#include <linux/bitops.h>
26#include <asm/cacheflush.h> 28#include <asm/cacheflush.h>
@@ -29,6 +31,7 @@
29#include <asm/uaccess.h> 31#include <asm/uaccess.h>
30#include <asm/ucontext.h> 32#include <asm/ucontext.h>
31#include <asm/cpu-features.h> 33#include <asm/cpu-features.h>
34#include <asm/war.h>
32 35
33#include "signal-common.h" 36#include "signal-common.h"
34 37
@@ -36,7 +39,7 @@
36 39
37#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) 40#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
38 41
39static int do_signal(sigset_t *oldset, struct pt_regs *regs); 42int do_signal(sigset_t *oldset, struct pt_regs *regs);
40 43
41/* 44/*
42 * Atomically swap in the new signal mask, and wait for a signal. 45 * Atomically swap in the new signal mask, and wait for a signal.
@@ -47,9 +50,10 @@ save_static_function(sys_sigsuspend);
47__attribute_used__ noinline static int 50__attribute_used__ noinline static int
48_sys_sigsuspend(nabi_no_regargs struct pt_regs regs) 51_sys_sigsuspend(nabi_no_regargs struct pt_regs regs)
49{ 52{
50 sigset_t *uset, saveset, newset; 53 sigset_t saveset, newset;
54 sigset_t __user *uset;
51 55
52 uset = (sigset_t *) regs.regs[4]; 56 uset = (sigset_t __user *) regs.regs[4];
53 if (copy_from_user(&newset, uset, sizeof(sigset_t))) 57 if (copy_from_user(&newset, uset, sizeof(sigset_t)))
54 return -EFAULT; 58 return -EFAULT;
55 sigdelsetmask(&newset, ~_BLOCKABLE); 59 sigdelsetmask(&newset, ~_BLOCKABLE);
@@ -75,7 +79,8 @@ save_static_function(sys_rt_sigsuspend);
75__attribute_used__ noinline static int 79__attribute_used__ noinline static int
76_sys_rt_sigsuspend(nabi_no_regargs struct pt_regs regs) 80_sys_rt_sigsuspend(nabi_no_regargs struct pt_regs regs)
77{ 81{
78 sigset_t *unewset, saveset, newset; 82 sigset_t saveset, newset;
83 sigset_t __user *unewset;
79 size_t sigsetsize; 84 size_t sigsetsize;
80 85
81 /* XXX Don't preclude handling different sized sigset_t's. */ 86 /* XXX Don't preclude handling different sized sigset_t's. */
@@ -83,7 +88,7 @@ _sys_rt_sigsuspend(nabi_no_regargs struct pt_regs regs)
83 if (sigsetsize != sizeof(sigset_t)) 88 if (sigsetsize != sizeof(sigset_t))
84 return -EINVAL; 89 return -EINVAL;
85 90
86 unewset = (sigset_t *) regs.regs[4]; 91 unewset = (sigset_t __user *) regs.regs[4];
87 if (copy_from_user(&newset, unewset, sizeof(newset))) 92 if (copy_from_user(&newset, unewset, sizeof(newset)))
88 return -EFAULT; 93 return -EFAULT;
89 sigdelsetmask(&newset, ~_BLOCKABLE); 94 sigdelsetmask(&newset, ~_BLOCKABLE);
@@ -147,33 +152,46 @@ asmlinkage int sys_sigaction(int sig, const struct sigaction *act,
147 152
148asmlinkage int sys_sigaltstack(nabi_no_regargs struct pt_regs regs) 153asmlinkage int sys_sigaltstack(nabi_no_regargs struct pt_regs regs)
149{ 154{
150 const stack_t *uss = (const stack_t *) regs.regs[4]; 155 const stack_t __user *uss = (const stack_t __user *) regs.regs[4];
151 stack_t *uoss = (stack_t *) regs.regs[5]; 156 stack_t __user *uoss = (stack_t __user *) regs.regs[5];
152 unsigned long usp = regs.regs[29]; 157 unsigned long usp = regs.regs[29];
153 158
154 return do_sigaltstack(uss, uoss, usp); 159 return do_sigaltstack(uss, uoss, usp);
155} 160}
156 161
157#if PLAT_TRAMPOLINE_STUFF_LINE 162/*
158#define __tramp __attribute__((aligned(PLAT_TRAMPOLINE_STUFF_LINE))) 163 * Horribly complicated - with the bloody RM9000 workarounds enabled
159#else 164 * the signal trampolines is moving to the end of the structure so we can
160#define __tramp 165 * increase the alignment without breaking software compatibility.
161#endif 166 */
162
163#ifdef CONFIG_TRAD_SIGNALS 167#ifdef CONFIG_TRAD_SIGNALS
164struct sigframe { 168struct sigframe {
165 u32 sf_ass[4]; /* argument save space for o32 */ 169 u32 sf_ass[4]; /* argument save space for o32 */
166 u32 sf_code[2] __tramp; /* signal trampoline */ 170#if ICACHE_REFILLS_WORKAROUND_WAR
167 struct sigcontext sf_sc __tramp; 171 u32 sf_pad[2];
172#else
173 u32 sf_code[2]; /* signal trampoline */
174#endif
175 struct sigcontext sf_sc;
168 sigset_t sf_mask; 176 sigset_t sf_mask;
177#if ICACHE_REFILLS_WORKAROUND_WAR
178 u32 sf_code[8] ____cacheline_aligned; /* signal trampoline */
179#endif
169}; 180};
170#endif 181#endif
171 182
172struct rt_sigframe { 183struct rt_sigframe {
173 u32 rs_ass[4]; /* argument save space for o32 */ 184 u32 rs_ass[4]; /* argument save space for o32 */
174 u32 rs_code[2] __tramp; /* signal trampoline */ 185#if ICACHE_REFILLS_WORKAROUND_WAR
175 struct siginfo rs_info __tramp; 186 u32 rs_pad[2];
187#else
188 u32 rs_code[2]; /* signal trampoline */
189#endif
190 struct siginfo rs_info;
176 struct ucontext rs_uc; 191 struct ucontext rs_uc;
192#if ICACHE_REFILLS_WORKAROUND_WAR
193 u32 rs_code[8] ____cacheline_aligned; /* signal trampoline */
194#endif
177}; 195};
178 196
179#ifdef CONFIG_TRAD_SIGNALS 197#ifdef CONFIG_TRAD_SIGNALS
@@ -214,7 +232,7 @@ _sys_sigreturn(nabi_no_regargs struct pt_regs regs)
214badframe: 232badframe:
215 force_sig(SIGSEGV, current); 233 force_sig(SIGSEGV, current);
216} 234}
217#endif 235#endif /* CONFIG_TRAD_SIGNALS */
218 236
219save_static_function(sys_rt_sigreturn); 237save_static_function(sys_rt_sigreturn);
220__attribute_used__ noinline static void 238__attribute_used__ noinline static void
@@ -260,7 +278,7 @@ badframe:
260} 278}
261 279
262#ifdef CONFIG_TRAD_SIGNALS 280#ifdef CONFIG_TRAD_SIGNALS
263static void inline setup_frame(struct k_sigaction * ka, struct pt_regs *regs, 281int setup_frame(struct k_sigaction * ka, struct pt_regs *regs,
264 int signr, sigset_t *set) 282 int signr, sigset_t *set)
265{ 283{
266 struct sigframe *frame; 284 struct sigframe *frame;
@@ -270,17 +288,7 @@ static void inline setup_frame(struct k_sigaction * ka, struct pt_regs *regs,
270 if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame))) 288 if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame)))
271 goto give_sigsegv; 289 goto give_sigsegv;
272 290
273 /* 291 install_sigtramp(frame->sf_code, __NR_sigreturn);
274 * Set up the return code ...
275 *
276 * li v0, __NR_sigreturn
277 * syscall
278 */
279 if (PLAT_TRAMPOLINE_STUFF_LINE)
280 __clear_user(frame->sf_code, PLAT_TRAMPOLINE_STUFF_LINE);
281 err |= __put_user(0x24020000 + __NR_sigreturn, frame->sf_code + 0);
282 err |= __put_user(0x0000000c , frame->sf_code + 1);
283 flush_cache_sigtramp((unsigned long) frame->sf_code);
284 292
285 err |= setup_sigcontext(regs, &frame->sf_sc); 293 err |= setup_sigcontext(regs, &frame->sf_sc);
286 err |= __copy_to_user(&frame->sf_mask, set, sizeof(*set)); 294 err |= __copy_to_user(&frame->sf_mask, set, sizeof(*set));
@@ -309,14 +317,15 @@ static void inline setup_frame(struct k_sigaction * ka, struct pt_regs *regs,
309 current->comm, current->pid, 317 current->comm, current->pid,
310 frame, regs->cp0_epc, frame->regs[31]); 318 frame, regs->cp0_epc, frame->regs[31]);
311#endif 319#endif
312 return; 320 return 1;
313 321
314give_sigsegv: 322give_sigsegv:
315 force_sigsegv(signr, current); 323 force_sigsegv(signr, current);
324 return 0;
316} 325}
317#endif 326#endif
318 327
319static void inline setup_rt_frame(struct k_sigaction * ka, struct pt_regs *regs, 328int setup_rt_frame(struct k_sigaction * ka, struct pt_regs *regs,
320 int signr, sigset_t *set, siginfo_t *info) 329 int signr, sigset_t *set, siginfo_t *info)
321{ 330{
322 struct rt_sigframe *frame; 331 struct rt_sigframe *frame;
@@ -326,17 +335,7 @@ static void inline setup_rt_frame(struct k_sigaction * ka, struct pt_regs *regs,
326 if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame))) 335 if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame)))
327 goto give_sigsegv; 336 goto give_sigsegv;
328 337
329 /* 338 install_sigtramp(frame->rs_code, __NR_rt_sigreturn);
330 * Set up the return code ...
331 *
332 * li v0, __NR_rt_sigreturn
333 * syscall
334 */
335 if (PLAT_TRAMPOLINE_STUFF_LINE)
336 __clear_user(frame->rs_code, PLAT_TRAMPOLINE_STUFF_LINE);
337 err |= __put_user(0x24020000 + __NR_rt_sigreturn, frame->rs_code + 0);
338 err |= __put_user(0x0000000c , frame->rs_code + 1);
339 flush_cache_sigtramp((unsigned long) frame->rs_code);
340 339
341 /* Create siginfo. */ 340 /* Create siginfo. */
342 err |= copy_siginfo_to_user(&frame->rs_info, info); 341 err |= copy_siginfo_to_user(&frame->rs_info, info);
@@ -378,18 +377,21 @@ static void inline setup_rt_frame(struct k_sigaction * ka, struct pt_regs *regs,
378 current->comm, current->pid, 377 current->comm, current->pid,
379 frame, regs->cp0_epc, regs->regs[31]); 378 frame, regs->cp0_epc, regs->regs[31]);
380#endif 379#endif
381 return; 380 return 1;
382 381
383give_sigsegv: 382give_sigsegv:
384 force_sigsegv(signr, current); 383 force_sigsegv(signr, current);
384 return 0;
385} 385}
386 386
387extern void setup_rt_frame_n32(struct k_sigaction * ka, 387extern void setup_rt_frame_n32(struct k_sigaction * ka,
388 struct pt_regs *regs, int signr, sigset_t *set, siginfo_t *info); 388 struct pt_regs *regs, int signr, sigset_t *set, siginfo_t *info);
389 389
390static inline void handle_signal(unsigned long sig, siginfo_t *info, 390static inline int handle_signal(unsigned long sig, siginfo_t *info,
391 struct k_sigaction *ka, sigset_t *oldset, struct pt_regs *regs) 391 struct k_sigaction *ka, sigset_t *oldset, struct pt_regs *regs)
392{ 392{
393 int ret;
394
393 switch(regs->regs[0]) { 395 switch(regs->regs[0]) {
394 case ERESTART_RESTARTBLOCK: 396 case ERESTART_RESTARTBLOCK:
395 case ERESTARTNOHAND: 397 case ERESTARTNOHAND:
@@ -408,22 +410,10 @@ static inline void handle_signal(unsigned long sig, siginfo_t *info,
408 410
409 regs->regs[0] = 0; /* Don't deal with this again. */ 411 regs->regs[0] = 0; /* Don't deal with this again. */
410 412
411#ifdef CONFIG_TRAD_SIGNALS 413 if (sig_uses_siginfo(ka))
412 if (ka->sa.sa_flags & SA_SIGINFO) { 414 ret = current->thread.abi->setup_rt_frame(ka, regs, sig, oldset, info);
413#else
414 if (1) {
415#endif
416#ifdef CONFIG_MIPS32_N32
417 if ((current->thread.mflags & MF_ABI_MASK) == MF_N32)
418 setup_rt_frame_n32 (ka, regs, sig, oldset, info);
419 else
420#endif
421 setup_rt_frame(ka, regs, sig, oldset, info);
422 }
423#ifdef CONFIG_TRAD_SIGNALS
424 else 415 else
425 setup_frame(ka, regs, sig, oldset); 416 ret = current->thread.abi->setup_frame(ka, regs, sig, oldset);
426#endif
427 417
428 spin_lock_irq(&current->sighand->siglock); 418 spin_lock_irq(&current->sighand->siglock);
429 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 419 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
@@ -431,23 +421,16 @@ static inline void handle_signal(unsigned long sig, siginfo_t *info,
431 sigaddset(&current->blocked,sig); 421 sigaddset(&current->blocked,sig);
432 recalc_sigpending(); 422 recalc_sigpending();
433 spin_unlock_irq(&current->sighand->siglock); 423 spin_unlock_irq(&current->sighand->siglock);
434}
435 424
436extern int do_signal32(sigset_t *oldset, struct pt_regs *regs); 425 return ret;
437extern int do_irix_signal(sigset_t *oldset, struct pt_regs *regs); 426}
438 427
439static int do_signal(sigset_t *oldset, struct pt_regs *regs) 428int do_signal(sigset_t *oldset, struct pt_regs *regs)
440{ 429{
441 struct k_sigaction ka; 430 struct k_sigaction ka;
442 siginfo_t info; 431 siginfo_t info;
443 int signr; 432 int signr;
444 433
445#ifdef CONFIG_BINFMT_ELF32
446 if ((current->thread.mflags & MF_ABI_MASK) == MF_O32) {
447 return do_signal32(oldset, regs);
448 }
449#endif
450
451 /* 434 /*
452 * We want the common case to go fast, which is why we may in certain 435 * We want the common case to go fast, which is why we may in certain
453 * cases get here from kernel mode. Just return without doing anything 436 * cases get here from kernel mode. Just return without doing anything
@@ -463,10 +446,8 @@ static int do_signal(sigset_t *oldset, struct pt_regs *regs)
463 oldset = &current->blocked; 446 oldset = &current->blocked;
464 447
465 signr = get_signal_to_deliver(&info, &ka, regs, NULL); 448 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
466 if (signr > 0) { 449 if (signr > 0)
467 handle_signal(signr, &info, &ka, oldset, regs); 450 return handle_signal(signr, &info, &ka, oldset, regs);
468 return 1;
469 }
470 451
471no_signal: 452no_signal:
472 /* 453 /*
@@ -499,18 +480,6 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, sigset_t *oldset,
499{ 480{
500 /* deal with pending signal delivery */ 481 /* deal with pending signal delivery */
501 if (thread_info_flags & _TIF_SIGPENDING) { 482 if (thread_info_flags & _TIF_SIGPENDING) {
502#ifdef CONFIG_BINFMT_ELF32 483 current->thread.abi->do_signal(oldset, regs);
503 if (likely((current->thread.mflags & MF_ABI_MASK) == MF_O32)) {
504 do_signal32(oldset, regs);
505 return;
506 }
507#endif
508#ifdef CONFIG_BINFMT_IRIX
509 if (unlikely(current->personality != PER_LINUX)) {
510 do_irix_signal(oldset, regs);
511 return;
512 }
513#endif
514 do_signal(oldset, regs);
515 } 484 }
516} 485}
diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c
index 8ddfbd8d425a..dbe821303125 100644
--- a/arch/mips/kernel/signal32.c
+++ b/arch/mips/kernel/signal32.c
@@ -7,6 +7,7 @@
7 * Copyright (C) 1994 - 2000 Ralf Baechle 7 * Copyright (C) 1994 - 2000 Ralf Baechle
8 * Copyright (C) 1999, 2000 Silicon Graphics, Inc. 8 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
9 */ 9 */
10#include <linux/cache.h>
10#include <linux/sched.h> 11#include <linux/sched.h>
11#include <linux/mm.h> 12#include <linux/mm.h>
12#include <linux/smp.h> 13#include <linux/smp.h>
@@ -21,6 +22,7 @@
21#include <linux/suspend.h> 22#include <linux/suspend.h>
22#include <linux/compiler.h> 23#include <linux/compiler.h>
23 24
25#include <asm/abi.h>
24#include <asm/asm.h> 26#include <asm/asm.h>
25#include <linux/bitops.h> 27#include <linux/bitops.h>
26#include <asm/cacheflush.h> 28#include <asm/cacheflush.h>
@@ -29,6 +31,7 @@
29#include <asm/ucontext.h> 31#include <asm/ucontext.h>
30#include <asm/system.h> 32#include <asm/system.h>
31#include <asm/fpu.h> 33#include <asm/fpu.h>
34#include <asm/war.h>
32 35
33#define SI_PAD_SIZE32 ((SI_MAX_SIZE/sizeof(int)) - 3) 36#define SI_PAD_SIZE32 ((SI_MAX_SIZE/sizeof(int)) - 3)
34 37
@@ -76,8 +79,10 @@ typedef struct compat_siginfo {
76 79
77 /* POSIX.1b timers */ 80 /* POSIX.1b timers */
78 struct { 81 struct {
79 unsigned int _timer1; 82 timer_t _tid; /* timer id */
80 unsigned int _timer2; 83 int _overrun; /* overrun count */
84 compat_sigval_t _sigval;/* same as below */
85 int _sys_private; /* not to be passed to user */
81 } _timer; 86 } _timer;
82 87
83 /* POSIX.1b signals */ 88 /* POSIX.1b signals */
@@ -259,11 +264,12 @@ asmlinkage int sys32_sigaction(int sig, const struct sigaction32 *act,
259 264
260 if (act) { 265 if (act) {
261 old_sigset_t mask; 266 old_sigset_t mask;
267 s32 handler;
262 268
263 if (!access_ok(VERIFY_READ, act, sizeof(*act))) 269 if (!access_ok(VERIFY_READ, act, sizeof(*act)))
264 return -EFAULT; 270 return -EFAULT;
265 err |= __get_user((u32)(u64)new_ka.sa.sa_handler, 271 err |= __get_user(handler, &act->sa_handler);
266 &act->sa_handler); 272 new_ka.sa.sa_handler = (void*)(s64)handler;
267 err |= __get_user(new_ka.sa.sa_flags, &act->sa_flags); 273 err |= __get_user(new_ka.sa.sa_flags, &act->sa_flags);
268 err |= __get_user(mask, &act->sa_mask.sig[0]); 274 err |= __get_user(mask, &act->sa_mask.sig[0]);
269 if (err) 275 if (err)
@@ -331,8 +337,9 @@ asmlinkage int sys32_sigaltstack(nabi_no_regargs struct pt_regs regs)
331 337
332static int restore_sigcontext32(struct pt_regs *regs, struct sigcontext32 *sc) 338static int restore_sigcontext32(struct pt_regs *regs, struct sigcontext32 *sc)
333{ 339{
340 u32 used_math;
334 int err = 0; 341 int err = 0;
335 __u32 used_math; 342 s32 treg;
336 343
337 /* Always make any pending restarted system calls return -EINTR */ 344 /* Always make any pending restarted system calls return -EINTR */
338 current_thread_info()->restart_block.fn = do_no_restart_syscall; 345 current_thread_info()->restart_block.fn = do_no_restart_syscall;
@@ -340,6 +347,15 @@ static int restore_sigcontext32(struct pt_regs *regs, struct sigcontext32 *sc)
340 err |= __get_user(regs->cp0_epc, &sc->sc_pc); 347 err |= __get_user(regs->cp0_epc, &sc->sc_pc);
341 err |= __get_user(regs->hi, &sc->sc_mdhi); 348 err |= __get_user(regs->hi, &sc->sc_mdhi);
342 err |= __get_user(regs->lo, &sc->sc_mdlo); 349 err |= __get_user(regs->lo, &sc->sc_mdlo);
350 if (cpu_has_dsp) {
351 err |= __get_user(treg, &sc->sc_hi1); mthi1(treg);
352 err |= __get_user(treg, &sc->sc_lo1); mtlo1(treg);
353 err |= __get_user(treg, &sc->sc_hi2); mthi2(treg);
354 err |= __get_user(treg, &sc->sc_lo2); mtlo2(treg);
355 err |= __get_user(treg, &sc->sc_hi3); mthi3(treg);
356 err |= __get_user(treg, &sc->sc_lo3); mtlo3(treg);
357 err |= __get_user(treg, &sc->sc_dsp); wrdsp(treg, DSP_MASK);
358 }
343 359
344#define restore_gp_reg(i) do { \ 360#define restore_gp_reg(i) do { \
345 err |= __get_user(regs->regs[i], &sc->sc_regs[i]); \ 361 err |= __get_user(regs->regs[i], &sc->sc_regs[i]); \
@@ -378,16 +394,30 @@ static int restore_sigcontext32(struct pt_regs *regs, struct sigcontext32 *sc)
378 394
379struct sigframe { 395struct sigframe {
380 u32 sf_ass[4]; /* argument save space for o32 */ 396 u32 sf_ass[4]; /* argument save space for o32 */
397#if ICACHE_REFILLS_WORKAROUND_WAR
398 u32 sf_pad[2];
399#else
381 u32 sf_code[2]; /* signal trampoline */ 400 u32 sf_code[2]; /* signal trampoline */
401#endif
382 struct sigcontext32 sf_sc; 402 struct sigcontext32 sf_sc;
383 sigset_t sf_mask; 403 sigset_t sf_mask;
404#if ICACHE_REFILLS_WORKAROUND_WAR
405 u32 sf_code[8] ____cacheline_aligned; /* signal trampoline */
406#endif
384}; 407};
385 408
386struct rt_sigframe32 { 409struct rt_sigframe32 {
387 u32 rs_ass[4]; /* argument save space for o32 */ 410 u32 rs_ass[4]; /* argument save space for o32 */
411#if ICACHE_REFILLS_WORKAROUND_WAR
412 u32 rs_pad[2];
413#else
388 u32 rs_code[2]; /* signal trampoline */ 414 u32 rs_code[2]; /* signal trampoline */
415#endif
389 compat_siginfo_t rs_info; 416 compat_siginfo_t rs_info;
390 struct ucontext32 rs_uc; 417 struct ucontext32 rs_uc;
418#if ICACHE_REFILLS_WORKAROUND_WAR
419 u32 rs_code[8] __attribute__((aligned(32))); /* signal trampoline */
420#endif
391}; 421};
392 422
393int copy_siginfo_to_user32(compat_siginfo_t *to, siginfo_t *from) 423int copy_siginfo_to_user32(compat_siginfo_t *to, siginfo_t *from)
@@ -411,6 +441,11 @@ int copy_siginfo_to_user32(compat_siginfo_t *to, siginfo_t *from)
411 err |= __copy_to_user(&to->_sifields._pad, &from->_sifields._pad, SI_PAD_SIZE); 441 err |= __copy_to_user(&to->_sifields._pad, &from->_sifields._pad, SI_PAD_SIZE);
412 else { 442 else {
413 switch (from->si_code >> 16) { 443 switch (from->si_code >> 16) {
444 case __SI_TIMER >> 16:
445 err |= __put_user(from->si_tid, &to->si_tid);
446 err |= __put_user(from->si_overrun, &to->si_overrun);
447 err |= __put_user(from->si_int, &to->si_int);
448 break;
414 case __SI_CHLD >> 16: 449 case __SI_CHLD >> 16:
415 err |= __put_user(from->si_utime, &to->si_utime); 450 err |= __put_user(from->si_utime, &to->si_utime);
416 err |= __put_user(from->si_stime, &to->si_stime); 451 err |= __put_user(from->si_stime, &to->si_stime);
@@ -480,6 +515,7 @@ __attribute_used__ noinline static void
480_sys32_rt_sigreturn(nabi_no_regargs struct pt_regs regs) 515_sys32_rt_sigreturn(nabi_no_regargs struct pt_regs regs)
481{ 516{
482 struct rt_sigframe32 *frame; 517 struct rt_sigframe32 *frame;
518 mm_segment_t old_fs;
483 sigset_t set; 519 sigset_t set;
484 stack_t st; 520 stack_t st;
485 s32 sp; 521 s32 sp;
@@ -510,7 +546,10 @@ _sys32_rt_sigreturn(nabi_no_regargs struct pt_regs regs)
510 546
511 /* It is more difficult to avoid calling this function than to 547 /* It is more difficult to avoid calling this function than to
512 call it and ignore errors. */ 548 call it and ignore errors. */
549 old_fs = get_fs();
550 set_fs (KERNEL_DS);
513 do_sigaltstack(&st, NULL, regs.regs[29]); 551 do_sigaltstack(&st, NULL, regs.regs[29]);
552 set_fs (old_fs);
514 553
515 /* 554 /*
516 * Don't let your children do this ... 555 * Don't let your children do this ...
@@ -550,8 +589,15 @@ static inline int setup_sigcontext32(struct pt_regs *regs,
550 589
551 err |= __put_user(regs->hi, &sc->sc_mdhi); 590 err |= __put_user(regs->hi, &sc->sc_mdhi);
552 err |= __put_user(regs->lo, &sc->sc_mdlo); 591 err |= __put_user(regs->lo, &sc->sc_mdlo);
553 err |= __put_user(regs->cp0_cause, &sc->sc_cause); 592 if (cpu_has_dsp) {
554 err |= __put_user(regs->cp0_badvaddr, &sc->sc_badvaddr); 593 err |= __put_user(rddsp(DSP_MASK), &sc->sc_hi1);
594 err |= __put_user(mfhi1(), &sc->sc_hi1);
595 err |= __put_user(mflo1(), &sc->sc_lo1);
596 err |= __put_user(mfhi2(), &sc->sc_hi2);
597 err |= __put_user(mflo2(), &sc->sc_lo2);
598 err |= __put_user(mfhi3(), &sc->sc_hi3);
599 err |= __put_user(mflo3(), &sc->sc_lo3);
600 }
555 601
556 err |= __put_user(!!used_math(), &sc->sc_used_math); 602 err |= __put_user(!!used_math(), &sc->sc_used_math);
557 603
@@ -601,7 +647,7 @@ static inline void *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
601 return (void *)((sp - frame_size) & ALMASK); 647 return (void *)((sp - frame_size) & ALMASK);
602} 648}
603 649
604static inline void setup_frame(struct k_sigaction * ka, struct pt_regs *regs, 650void setup_frame_32(struct k_sigaction * ka, struct pt_regs *regs,
605 int signr, sigset_t *set) 651 int signr, sigset_t *set)
606{ 652{
607 struct sigframe *frame; 653 struct sigframe *frame;
@@ -654,9 +700,7 @@ give_sigsegv:
654 force_sigsegv(signr, current); 700 force_sigsegv(signr, current);
655} 701}
656 702
657static inline void setup_rt_frame(struct k_sigaction * ka, 703void setup_rt_frame_32(struct k_sigaction * ka, struct pt_regs *regs, int signr, sigset_t *set, siginfo_t *info)
658 struct pt_regs *regs, int signr,
659 sigset_t *set, siginfo_t *info)
660{ 704{
661 struct rt_sigframe32 *frame; 705 struct rt_sigframe32 *frame;
662 int err = 0; 706 int err = 0;
@@ -725,9 +769,11 @@ give_sigsegv:
725 force_sigsegv(signr, current); 769 force_sigsegv(signr, current);
726} 770}
727 771
728static inline void handle_signal(unsigned long sig, siginfo_t *info, 772static inline int handle_signal(unsigned long sig, siginfo_t *info,
729 struct k_sigaction *ka, sigset_t *oldset, struct pt_regs * regs) 773 struct k_sigaction *ka, sigset_t *oldset, struct pt_regs * regs)
730{ 774{
775 int ret;
776
731 switch (regs->regs[0]) { 777 switch (regs->regs[0]) {
732 case ERESTART_RESTARTBLOCK: 778 case ERESTART_RESTARTBLOCK:
733 case ERESTARTNOHAND: 779 case ERESTARTNOHAND:
@@ -747,9 +793,9 @@ static inline void handle_signal(unsigned long sig, siginfo_t *info,
747 regs->regs[0] = 0; /* Don't deal with this again. */ 793 regs->regs[0] = 0; /* Don't deal with this again. */
748 794
749 if (ka->sa.sa_flags & SA_SIGINFO) 795 if (ka->sa.sa_flags & SA_SIGINFO)
750 setup_rt_frame(ka, regs, sig, oldset, info); 796 ret = current->thread.abi->setup_rt_frame(ka, regs, sig, oldset, info);
751 else 797 else
752 setup_frame(ka, regs, sig, oldset); 798 ret = current->thread.abi->setup_frame(ka, regs, sig, oldset);
753 799
754 spin_lock_irq(&current->sighand->siglock); 800 spin_lock_irq(&current->sighand->siglock);
755 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 801 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
@@ -757,6 +803,8 @@ static inline void handle_signal(unsigned long sig, siginfo_t *info,
757 sigaddset(&current->blocked,sig); 803 sigaddset(&current->blocked,sig);
758 recalc_sigpending(); 804 recalc_sigpending();
759 spin_unlock_irq(&current->sighand->siglock); 805 spin_unlock_irq(&current->sighand->siglock);
806
807 return ret;
760} 808}
761 809
762int do_signal32(sigset_t *oldset, struct pt_regs *regs) 810int do_signal32(sigset_t *oldset, struct pt_regs *regs)
@@ -780,10 +828,8 @@ int do_signal32(sigset_t *oldset, struct pt_regs *regs)
780 oldset = &current->blocked; 828 oldset = &current->blocked;
781 829
782 signr = get_signal_to_deliver(&info, &ka, regs, NULL); 830 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
783 if (signr > 0) { 831 if (signr > 0)
784 handle_signal(signr, &info, &ka, oldset, regs); 832 return handle_signal(signr, &info, &ka, oldset, regs);
785 return 1;
786 }
787 833
788no_signal: 834no_signal:
789 /* 835 /*
@@ -819,12 +865,13 @@ asmlinkage int sys32_rt_sigaction(int sig, const struct sigaction32 *act,
819 goto out; 865 goto out;
820 866
821 if (act) { 867 if (act) {
868 s32 handler;
822 int err = 0; 869 int err = 0;
823 870
824 if (!access_ok(VERIFY_READ, act, sizeof(*act))) 871 if (!access_ok(VERIFY_READ, act, sizeof(*act)))
825 return -EFAULT; 872 return -EFAULT;
826 err |= __get_user((u32)(u64)new_sa.sa.sa_handler, 873 err |= __get_user(handler, &act->sa_handler);
827 &act->sa_handler); 874 new_sa.sa.sa_handler = (void*)(s64)handler;
828 err |= __get_user(new_sa.sa.sa_flags, &act->sa_flags); 875 err |= __get_user(new_sa.sa.sa_flags, &act->sa_flags);
829 err |= get_sigset(&new_sa.sa.sa_mask, &act->sa_mask); 876 err |= get_sigset(&new_sa.sa.sa_mask, &act->sa_mask);
830 if (err) 877 if (err)
@@ -902,3 +949,30 @@ asmlinkage int sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t *uinfo)
902 set_fs (old_fs); 949 set_fs (old_fs);
903 return ret; 950 return ret;
904} 951}
952
953asmlinkage long
954sys32_waitid(int which, compat_pid_t pid,
955 compat_siginfo_t __user *uinfo, int options,
956 struct compat_rusage __user *uru)
957{
958 siginfo_t info;
959 struct rusage ru;
960 long ret;
961 mm_segment_t old_fs = get_fs();
962
963 info.si_signo = 0;
964 set_fs (KERNEL_DS);
965 ret = sys_waitid(which, pid, (siginfo_t __user *) &info, options,
966 uru ? (struct rusage __user *) &ru : NULL);
967 set_fs (old_fs);
968
969 if (ret < 0 || info.si_signo == 0)
970 return ret;
971
972 if (uru && (ret = put_compat_rusage(&ru, uru)))
973 return ret;
974
975 BUG_ON(info.si_code & __SI_MASK);
976 info.si_code |= __SI_CHLD;
977 return copy_siginfo_to_user32(uinfo, &info);
978}
diff --git a/arch/mips/kernel/signal_n32.c b/arch/mips/kernel/signal_n32.c
index 3544208d4b4b..ec61b2670ba6 100644
--- a/arch/mips/kernel/signal_n32.c
+++ b/arch/mips/kernel/signal_n32.c
@@ -15,6 +15,8 @@
15 * along with this program; if not, write to the Free Software 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. 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */ 17 */
18#include <linux/cache.h>
19#include <linux/sched.h>
18#include <linux/sched.h> 20#include <linux/sched.h>
19#include <linux/mm.h> 21#include <linux/mm.h>
20#include <linux/smp.h> 22#include <linux/smp.h>
@@ -36,6 +38,7 @@
36#include <asm/system.h> 38#include <asm/system.h>
37#include <asm/fpu.h> 39#include <asm/fpu.h>
38#include <asm/cpu-features.h> 40#include <asm/cpu-features.h>
41#include <asm/war.h>
39 42
40#include "signal-common.h" 43#include "signal-common.h"
41 44
@@ -62,17 +65,18 @@ struct ucontextn32 {
62 sigset_t uc_sigmask; /* mask last for extensibility */ 65 sigset_t uc_sigmask; /* mask last for extensibility */
63}; 66};
64 67
65#if PLAT_TRAMPOLINE_STUFF_LINE
66#define __tramp __attribute__((aligned(PLAT_TRAMPOLINE_STUFF_LINE)))
67#else
68#define __tramp
69#endif
70
71struct rt_sigframe_n32 { 68struct rt_sigframe_n32 {
72 u32 rs_ass[4]; /* argument save space for o32 */ 69 u32 rs_ass[4]; /* argument save space for o32 */
73 u32 rs_code[2] __tramp; /* signal trampoline */ 70#if ICACHE_REFILLS_WORKAROUND_WAR
74 struct siginfo rs_info __tramp; 71 u32 rs_pad[2];
72#else
73 u32 rs_code[2]; /* signal trampoline */
74#endif
75 struct siginfo rs_info;
75 struct ucontextn32 rs_uc; 76 struct ucontextn32 rs_uc;
77#if ICACHE_REFILLS_WORKAROUND_WAR
78 u32 rs_code[8] ____cacheline_aligned; /* signal trampoline */
79#endif
76}; 80};
77 81
78save_static_function(sysn32_rt_sigreturn); 82save_static_function(sysn32_rt_sigreturn);
@@ -126,7 +130,7 @@ badframe:
126 force_sig(SIGSEGV, current); 130 force_sig(SIGSEGV, current);
127} 131}
128 132
129void setup_rt_frame_n32(struct k_sigaction * ka, 133int setup_rt_frame_n32(struct k_sigaction * ka,
130 struct pt_regs *regs, int signr, sigset_t *set, siginfo_t *info) 134 struct pt_regs *regs, int signr, sigset_t *set, siginfo_t *info)
131{ 135{
132 struct rt_sigframe_n32 *frame; 136 struct rt_sigframe_n32 *frame;
@@ -137,17 +141,7 @@ void setup_rt_frame_n32(struct k_sigaction * ka,
137 if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame))) 141 if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame)))
138 goto give_sigsegv; 142 goto give_sigsegv;
139 143
140 /* 144 install_sigtramp(frame->rs_code, __NR_N32_rt_sigreturn);
141 * Set up the return code ...
142 *
143 * li v0, __NR_rt_sigreturn
144 * syscall
145 */
146 if (PLAT_TRAMPOLINE_STUFF_LINE)
147 __clear_user(frame->rs_code, PLAT_TRAMPOLINE_STUFF_LINE);
148 err |= __put_user(0x24020000 + __NR_N32_rt_sigreturn, frame->rs_code + 0);
149 err |= __put_user(0x0000000c , frame->rs_code + 1);
150 flush_cache_sigtramp((unsigned long) frame->rs_code);
151 145
152 /* Create siginfo. */ 146 /* Create siginfo. */
153 err |= copy_siginfo_to_user(&frame->rs_info, info); 147 err |= copy_siginfo_to_user(&frame->rs_info, info);
@@ -190,8 +184,9 @@ void setup_rt_frame_n32(struct k_sigaction * ka,
190 current->comm, current->pid, 184 current->comm, current->pid,
191 frame, regs->cp0_epc, regs->regs[31]); 185 frame, regs->cp0_epc, regs->regs[31]);
192#endif 186#endif
193 return; 187 return 1;
194 188
195give_sigsegv: 189give_sigsegv:
196 force_sigsegv(signr, current); 190 force_sigsegv(signr, current);
191 return 0;
197} 192}
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
index af5cd3b8a396..fcacf1aae98a 100644
--- a/arch/mips/kernel/smp.c
+++ b/arch/mips/kernel/smp.c
@@ -50,7 +50,6 @@ static void smp_tune_scheduling (void)
50{ 50{
51 struct cache_desc *cd = &current_cpu_data.scache; 51 struct cache_desc *cd = &current_cpu_data.scache;
52 unsigned long cachesize; /* kB */ 52 unsigned long cachesize; /* kB */
53 unsigned long bandwidth = 350; /* MB/s */
54 unsigned long cpu_khz; 53 unsigned long cpu_khz;
55 54
56 /* 55 /*
@@ -121,7 +120,19 @@ struct call_data_struct *call_data;
121 * or are or have executed. 120 * or are or have executed.
122 * 121 *
123 * You must not call this function with disabled interrupts or from a 122 * You must not call this function with disabled interrupts or from a
124 * hardware interrupt handler or from a bottom half handler. 123 * hardware interrupt handler or from a bottom half handler:
124 *
125 * CPU A CPU B
126 * Disable interrupts
127 * smp_call_function()
128 * Take call_lock
129 * Send IPIs
130 * Wait for all cpus to acknowledge IPI
131 * CPU A has not responded, spin waiting
132 * for cpu A to respond, holding call_lock
133 * smp_call_function()
134 * Spin waiting for call_lock
135 * Deadlock Deadlock
125 */ 136 */
126int smp_call_function (void (*func) (void *info), void *info, int retry, 137int smp_call_function (void (*func) (void *info), void *info, int retry,
127 int wait) 138 int wait)
@@ -130,6 +141,11 @@ int smp_call_function (void (*func) (void *info), void *info, int retry,
130 int i, cpus = num_online_cpus() - 1; 141 int i, cpus = num_online_cpus() - 1;
131 int cpu = smp_processor_id(); 142 int cpu = smp_processor_id();
132 143
144 /*
145 * Can die spectacularly if this CPU isn't yet marked online
146 */
147 BUG_ON(!cpu_online(cpu));
148
133 if (!cpus) 149 if (!cpus)
134 return 0; 150 return 0;
135 151
@@ -214,7 +230,6 @@ void __init smp_cpus_done(unsigned int max_cpus)
214/* called from main before smp_init() */ 230/* called from main before smp_init() */
215void __init smp_prepare_cpus(unsigned int max_cpus) 231void __init smp_prepare_cpus(unsigned int max_cpus)
216{ 232{
217 cpu_data[0].udelay_val = loops_per_jiffy;
218 init_new_context(current, &init_mm); 233 init_new_context(current, &init_mm);
219 current_thread_info()->cpu = 0; 234 current_thread_info()->cpu = 0;
220 smp_tune_scheduling(); 235 smp_tune_scheduling();
@@ -236,23 +251,28 @@ void __devinit smp_prepare_boot_cpu(void)
236} 251}
237 252
238/* 253/*
239 * Startup the CPU with this logical number 254 * Called once for each "cpu_possible(cpu)". Needs to spin up the cpu
255 * and keep control until "cpu_online(cpu)" is set. Note: cpu is
256 * physical, not logical.
240 */ 257 */
241static int __init do_boot_cpu(int cpu) 258int __devinit __cpu_up(unsigned int cpu)
242{ 259{
243 struct task_struct *idle; 260 struct task_struct *idle;
244 261
245 /* 262 /*
263 * Processor goes to start_secondary(), sets online flag
246 * The following code is purely to make sure 264 * The following code is purely to make sure
247 * Linux can schedule processes on this slave. 265 * Linux can schedule processes on this slave.
248 */ 266 */
249 idle = fork_idle(cpu); 267 idle = fork_idle(cpu);
250 if (IS_ERR(idle)) 268 if (IS_ERR(idle))
251 panic("failed fork for CPU %d\n", cpu); 269 panic(KERN_ERR "Fork failed for CPU %d", cpu);
252 270
253 prom_boot_secondary(cpu, idle); 271 prom_boot_secondary(cpu, idle);
254 272
255 /* XXXKW timeout */ 273 /*
274 * Trust is futile. We should really have timeouts ...
275 */
256 while (!cpu_isset(cpu, cpu_callin_map)) 276 while (!cpu_isset(cpu, cpu_callin_map))
257 udelay(100); 277 udelay(100);
258 278
@@ -261,23 +281,6 @@ static int __init do_boot_cpu(int cpu)
261 return 0; 281 return 0;
262} 282}
263 283
264/*
265 * Called once for each "cpu_possible(cpu)". Needs to spin up the cpu
266 * and keep control until "cpu_online(cpu)" is set. Note: cpu is
267 * physical, not logical.
268 */
269int __devinit __cpu_up(unsigned int cpu)
270{
271 int ret;
272
273 /* Processor goes to start_secondary(), sets online flag */
274 ret = do_boot_cpu(cpu);
275 if (ret < 0)
276 return ret;
277
278 return 0;
279}
280
281/* Not really SMP stuff ... */ 284/* Not really SMP stuff ... */
282int setup_profiling_timer(unsigned int multiplier) 285int setup_profiling_timer(unsigned int multiplier)
283{ 286{
diff --git a/arch/mips/kernel/smp_mt.c b/arch/mips/kernel/smp_mt.c
new file mode 100644
index 000000000000..d429544ba4bc
--- /dev/null
+++ b/arch/mips/kernel/smp_mt.c
@@ -0,0 +1,366 @@
1/*
2 * Copyright (C) 2004, 2005 MIPS Technologies, Inc. All rights reserved.
3 *
4 * Elizabeth Clarke (beth@mips.com)
5 *
6 * This program is free software; you can distribute it and/or modify it
7 * under the terms of the GNU General Public License (Version 2) as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
18 *
19 */
20#include <linux/kernel.h>
21#include <linux/sched.h>
22#include <linux/cpumask.h>
23#include <linux/interrupt.h>
24#include <linux/compiler.h>
25
26#include <asm/atomic.h>
27#include <asm/cpu.h>
28#include <asm/processor.h>
29#include <asm/system.h>
30#include <asm/hardirq.h>
31#include <asm/mmu_context.h>
32#include <asm/smp.h>
33#include <asm/time.h>
34#include <asm/mipsregs.h>
35#include <asm/mipsmtregs.h>
36#include <asm/cacheflush.h>
37#include <asm/mips-boards/maltaint.h>
38
39#define MIPS_CPU_IPI_RESCHED_IRQ 0
40#define MIPS_CPU_IPI_CALL_IRQ 1
41
42static int cpu_ipi_resched_irq, cpu_ipi_call_irq;
43
44#if 0
45static void dump_mtregisters(int vpe, int tc)
46{
47 printk("vpe %d tc %d\n", vpe, tc);
48
49 settc(tc);
50
51 printk(" c0 status 0x%lx\n", read_vpe_c0_status());
52 printk(" vpecontrol 0x%lx\n", read_vpe_c0_vpecontrol());
53 printk(" vpeconf0 0x%lx\n", read_vpe_c0_vpeconf0());
54 printk(" tcstatus 0x%lx\n", read_tc_c0_tcstatus());
55 printk(" tcrestart 0x%lx\n", read_tc_c0_tcrestart());
56 printk(" tcbind 0x%lx\n", read_tc_c0_tcbind());
57 printk(" tchalt 0x%lx\n", read_tc_c0_tchalt());
58}
59#endif
60
61void __init sanitize_tlb_entries(void)
62{
63 int i, tlbsiz;
64 unsigned long mvpconf0, ncpu;
65
66 if (!cpu_has_mipsmt)
67 return;
68
69 set_c0_mvpcontrol(MVPCONTROL_VPC);
70
71 /* Disable TLB sharing */
72 clear_c0_mvpcontrol(MVPCONTROL_STLB);
73
74 mvpconf0 = read_c0_mvpconf0();
75
76 printk(KERN_INFO "MVPConf0 0x%lx TLBS %lx PTLBE %ld\n", mvpconf0,
77 (mvpconf0 & MVPCONF0_TLBS) >> MVPCONF0_TLBS_SHIFT,
78 (mvpconf0 & MVPCONF0_PTLBE) >> MVPCONF0_PTLBE_SHIFT);
79
80 tlbsiz = (mvpconf0 & MVPCONF0_PTLBE) >> MVPCONF0_PTLBE_SHIFT;
81 ncpu = ((mvpconf0 & MVPCONF0_PVPE) >> MVPCONF0_PVPE_SHIFT) + 1;
82
83 printk(" tlbsiz %d ncpu %ld\n", tlbsiz, ncpu);
84
85 if (tlbsiz > 0) {
86 /* share them out across the vpe's */
87 tlbsiz /= ncpu;
88
89 printk(KERN_INFO "setting Config1.MMU_size to %d\n", tlbsiz);
90
91 for (i = 0; i < ncpu; i++) {
92 settc(i);
93
94 if (i == 0)
95 write_c0_config1((read_c0_config1() & ~(0x3f << 25)) | (tlbsiz << 25));
96 else
97 write_vpe_c0_config1((read_vpe_c0_config1() & ~(0x3f << 25)) |
98 (tlbsiz << 25));
99 }
100 }
101
102 clear_c0_mvpcontrol(MVPCONTROL_VPC);
103}
104
105#if 0
106/*
107 * Use c0_MVPConf0 to find out how many CPUs are available, setting up
108 * phys_cpu_present_map and the logical/physical mappings.
109 */
110void __init prom_build_cpu_map(void)
111{
112 int i, num, ncpus;
113
114 cpus_clear(phys_cpu_present_map);
115
116 /* assume we boot on cpu 0.... */
117 cpu_set(0, phys_cpu_present_map);
118 __cpu_number_map[0] = 0;
119 __cpu_logical_map[0] = 0;
120
121 if (cpu_has_mipsmt) {
122 ncpus = ((read_c0_mvpconf0() & (MVPCONF0_PVPE)) >> MVPCONF0_PVPE_SHIFT) + 1;
123 for (i=1, num=0; i< NR_CPUS && i<ncpus; i++) {
124 cpu_set(i, phys_cpu_present_map);
125 __cpu_number_map[i] = ++num;
126 __cpu_logical_map[num] = i;
127 }
128
129 printk(KERN_INFO "%i available secondary CPU(s)\n", num);
130 }
131}
132#endif
133
134static void ipi_resched_dispatch (struct pt_regs *regs)
135{
136 do_IRQ(MIPS_CPU_IPI_RESCHED_IRQ, regs);
137}
138
139static void ipi_call_dispatch (struct pt_regs *regs)
140{
141 do_IRQ(MIPS_CPU_IPI_CALL_IRQ, regs);
142}
143
144irqreturn_t ipi_resched_interrupt(int irq, void *dev_id, struct pt_regs *regs)
145{
146 return IRQ_HANDLED;
147}
148
149irqreturn_t ipi_call_interrupt(int irq, void *dev_id, struct pt_regs *regs)
150{
151 smp_call_function_interrupt();
152
153 return IRQ_HANDLED;
154}
155
156static struct irqaction irq_resched = {
157 .handler = ipi_resched_interrupt,
158 .flags = SA_INTERRUPT,
159 .name = "IPI_resched"
160};
161
162static struct irqaction irq_call = {
163 .handler = ipi_call_interrupt,
164 .flags = SA_INTERRUPT,
165 .name = "IPI_call"
166};
167
168/*
169 * Common setup before any secondaries are started
170 * Make sure all CPU's are in a sensible state before we boot any of the
171 * secondarys
172 */
173void prom_prepare_cpus(unsigned int max_cpus)
174{
175 unsigned long val;
176 int i, num;
177
178 if (!cpu_has_mipsmt)
179 return;
180
181 /* disable MT so we can configure */
182 dvpe();
183 dmt();
184
185 /* Put MVPE's into 'configuration state' */
186 set_c0_mvpcontrol(MVPCONTROL_VPC);
187
188 val = read_c0_mvpconf0();
189
190 /* we'll always have more TC's than VPE's, so loop setting everything
191 to a sensible state */
192 for (i = 0, num = 0; i <= ((val & MVPCONF0_PTC) >> MVPCONF0_PTC_SHIFT); i++) {
193 settc(i);
194
195 /* VPE's */
196 if (i <= ((val & MVPCONF0_PVPE) >> MVPCONF0_PVPE_SHIFT)) {
197
198 /* deactivate all but vpe0 */
199 if (i != 0) {
200 unsigned long tmp = read_vpe_c0_vpeconf0();
201
202 tmp &= ~VPECONF0_VPA;
203
204 /* master VPE */
205 tmp |= VPECONF0_MVP;
206 write_vpe_c0_vpeconf0(tmp);
207
208 /* Record this as available CPU */
209 if (i < max_cpus) {
210 cpu_set(i, phys_cpu_present_map);
211 __cpu_number_map[i] = ++num;
212 __cpu_logical_map[num] = i;
213 }
214 }
215
216 /* disable multi-threading with TC's */
217 write_vpe_c0_vpecontrol(read_vpe_c0_vpecontrol() & ~VPECONTROL_TE);
218
219 if (i != 0) {
220 write_vpe_c0_status((read_c0_status() & ~(ST0_IM | ST0_IE | ST0_KSU)) | ST0_CU0);
221 write_vpe_c0_cause(read_vpe_c0_cause() & ~CAUSEF_IP);
222
223 /* set config to be the same as vpe0, particularly kseg0 coherency alg */
224 write_vpe_c0_config( read_c0_config());
225 }
226
227 }
228
229 /* TC's */
230
231 if (i != 0) {
232 unsigned long tmp;
233
234 /* bind a TC to each VPE, May as well put all excess TC's
235 on the last VPE */
236 if ( i >= (((val & MVPCONF0_PVPE) >> MVPCONF0_PVPE_SHIFT)+1) )
237 write_tc_c0_tcbind(read_tc_c0_tcbind() | ((val & MVPCONF0_PVPE) >> MVPCONF0_PVPE_SHIFT) );
238 else {
239 write_tc_c0_tcbind( read_tc_c0_tcbind() | i);
240
241 /* and set XTC */
242 write_vpe_c0_vpeconf0( read_vpe_c0_vpeconf0() | (i << VPECONF0_XTC_SHIFT));
243 }
244
245 tmp = read_tc_c0_tcstatus();
246
247 /* mark not allocated and not dynamically allocatable */
248 tmp &= ~(TCSTATUS_A | TCSTATUS_DA);
249 tmp |= TCSTATUS_IXMT; /* interrupt exempt */
250 write_tc_c0_tcstatus(tmp);
251
252 write_tc_c0_tchalt(TCHALT_H);
253 }
254 }
255
256 /* Release config state */
257 clear_c0_mvpcontrol(MVPCONTROL_VPC);
258
259 /* We'll wait until starting the secondaries before starting MVPE */
260
261 printk(KERN_INFO "Detected %i available secondary CPU(s)\n", num);
262
263 /* set up ipi interrupts */
264 if (cpu_has_vint) {
265 set_vi_handler (MIPS_CPU_IPI_RESCHED_IRQ, ipi_resched_dispatch);
266 set_vi_handler (MIPS_CPU_IPI_CALL_IRQ, ipi_call_dispatch);
267 }
268
269 cpu_ipi_resched_irq = MIPSCPU_INT_BASE + MIPS_CPU_IPI_RESCHED_IRQ;
270 cpu_ipi_call_irq = MIPSCPU_INT_BASE + MIPS_CPU_IPI_CALL_IRQ;
271
272 setup_irq(cpu_ipi_resched_irq, &irq_resched);
273 setup_irq(cpu_ipi_call_irq, &irq_call);
274
275 /* need to mark IPI's as IRQ_PER_CPU */
276 irq_desc[cpu_ipi_resched_irq].status |= IRQ_PER_CPU;
277 irq_desc[cpu_ipi_call_irq].status |= IRQ_PER_CPU;
278}
279
280/*
281 * Setup the PC, SP, and GP of a secondary processor and start it
282 * running!
283 * smp_bootstrap is the place to resume from
284 * __KSTK_TOS(idle) is apparently the stack pointer
285 * (unsigned long)idle->thread_info the gp
286 * assumes a 1:1 mapping of TC => VPE
287 */
288void prom_boot_secondary(int cpu, struct task_struct *idle)
289{
290 dvpe();
291 set_c0_mvpcontrol(MVPCONTROL_VPC);
292
293 settc(cpu);
294
295 /* restart */
296 write_tc_c0_tcrestart((unsigned long)&smp_bootstrap);
297
298 /* enable the tc this vpe/cpu will be running */
299 write_tc_c0_tcstatus((read_tc_c0_tcstatus() & ~TCSTATUS_IXMT) | TCSTATUS_A);
300
301 write_tc_c0_tchalt(0);
302
303 /* enable the VPE */
304 write_vpe_c0_vpeconf0(read_vpe_c0_vpeconf0() | VPECONF0_VPA);
305
306 /* stack pointer */
307 write_tc_gpr_sp( __KSTK_TOS(idle));
308
309 /* global pointer */
310 write_tc_gpr_gp((unsigned long)idle->thread_info);
311
312 flush_icache_range((unsigned long)idle->thread_info,
313 (unsigned long)idle->thread_info +
314 sizeof(struct thread_info));
315
316 /* finally out of configuration and into chaos */
317 clear_c0_mvpcontrol(MVPCONTROL_VPC);
318
319 evpe(EVPE_ENABLE);
320}
321
322void prom_init_secondary(void)
323{
324 write_c0_status((read_c0_status() & ~ST0_IM ) |
325 (STATUSF_IP0 | STATUSF_IP1 | STATUSF_IP7));
326}
327
328void prom_smp_finish(void)
329{
330 write_c0_compare(read_c0_count() + (8* mips_hpt_frequency/HZ));
331
332 local_irq_enable();
333}
334
335void prom_cpus_done(void)
336{
337}
338
339void core_send_ipi(int cpu, unsigned int action)
340{
341 int i;
342 unsigned long flags;
343 int vpflags;
344
345 local_irq_save (flags);
346
347 vpflags = dvpe(); /* cant access the other CPU's registers whilst MVPE enabled */
348
349 switch (action) {
350 case SMP_CALL_FUNCTION:
351 i = C_SW1;
352 break;
353
354 case SMP_RESCHEDULE_YOURSELF:
355 default:
356 i = C_SW0;
357 break;
358 }
359
360 /* 1:1 mapping of vpe and tc... */
361 settc(cpu);
362 write_vpe_c0_cause(read_vpe_c0_cause() | i);
363 evpe(vpflags);
364
365 local_irq_restore(flags);
366}
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c
index 21e3e13a4b44..ee98eeb65e85 100644
--- a/arch/mips/kernel/syscall.c
+++ b/arch/mips/kernel/syscall.c
@@ -7,6 +7,7 @@
7 * Copyright (C) 1999, 2000 Silicon Graphics, Inc. 7 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
8 * Copyright (C) 2001 MIPS Technologies, Inc. 8 * Copyright (C) 2001 MIPS Technologies, Inc.
9 */ 9 */
10#include <linux/config.h>
10#include <linux/a.out.h> 11#include <linux/a.out.h>
11#include <linux/errno.h> 12#include <linux/errno.h>
12#include <linux/linkage.h> 13#include <linux/linkage.h>
@@ -26,6 +27,7 @@
26#include <linux/msg.h> 27#include <linux/msg.h>
27#include <linux/shm.h> 28#include <linux/shm.h>
28#include <linux/compiler.h> 29#include <linux/compiler.h>
30#include <linux/module.h>
29 31
30#include <asm/branch.h> 32#include <asm/branch.h>
31#include <asm/cachectl.h> 33#include <asm/cachectl.h>
@@ -56,6 +58,8 @@ out:
56 58
57unsigned long shm_align_mask = PAGE_SIZE - 1; /* Sane caches */ 59unsigned long shm_align_mask = PAGE_SIZE - 1; /* Sane caches */
58 60
61EXPORT_SYMBOL(shm_align_mask);
62
59#define COLOUR_ALIGN(addr,pgoff) \ 63#define COLOUR_ALIGN(addr,pgoff) \
60 ((((addr) + shm_align_mask) & ~shm_align_mask) + \ 64 ((((addr) + shm_align_mask) & ~shm_align_mask) + \
61 (((pgoff) << PAGE_SHIFT) & shm_align_mask)) 65 (((pgoff) << PAGE_SHIFT) & shm_align_mask))
@@ -173,14 +177,28 @@ _sys_clone(nabi_no_regargs struct pt_regs regs)
173{ 177{
174 unsigned long clone_flags; 178 unsigned long clone_flags;
175 unsigned long newsp; 179 unsigned long newsp;
176 int *parent_tidptr, *child_tidptr; 180 int __user *parent_tidptr, *child_tidptr;
177 181
178 clone_flags = regs.regs[4]; 182 clone_flags = regs.regs[4];
179 newsp = regs.regs[5]; 183 newsp = regs.regs[5];
180 if (!newsp) 184 if (!newsp)
181 newsp = regs.regs[29]; 185 newsp = regs.regs[29];
182 parent_tidptr = (int *) regs.regs[6]; 186 parent_tidptr = (int __user *) regs.regs[6];
183 child_tidptr = (int *) regs.regs[7]; 187#ifdef CONFIG_32BIT
188 /* We need to fetch the fifth argument off the stack. */
189 child_tidptr = NULL;
190 if (clone_flags & (CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID)) {
191 int __user *__user *usp = (int __user *__user *) regs.regs[29];
192 if (regs.regs[2] == __NR_syscall) {
193 if (get_user (child_tidptr, &usp[5]))
194 return -EFAULT;
195 }
196 else if (get_user (child_tidptr, &usp[4]))
197 return -EFAULT;
198 }
199#else
200 child_tidptr = (int __user *) regs.regs[8];
201#endif
184 return do_fork(clone_flags, newsp, &regs, 0, 202 return do_fork(clone_flags, newsp, &regs, 0,
185 parent_tidptr, child_tidptr); 203 parent_tidptr, child_tidptr);
186} 204}
@@ -242,6 +260,16 @@ asmlinkage int sys_olduname(struct oldold_utsname * name)
242 return error; 260 return error;
243} 261}
244 262
263void sys_set_thread_area(unsigned long addr)
264{
265 struct thread_info *ti = current->thread_info;
266
267 ti->tp_value = addr;
268
269 /* If some future MIPS implementation has this register in hardware,
270 * we will need to update it here (and in context switches). */
271}
272
245asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3) 273asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3)
246{ 274{
247 int tmp, len; 275 int tmp, len;
diff --git a/arch/mips/kernel/sysirix.c b/arch/mips/kernel/sysirix.c
index 7ae4af476974..52924f8ce23c 100644
--- a/arch/mips/kernel/sysirix.c
+++ b/arch/mips/kernel/sysirix.c
@@ -73,32 +73,30 @@ asmlinkage int irix_sysmp(struct pt_regs *regs)
73} 73}
74 74
75/* The prctl commands. */ 75/* The prctl commands. */
76#define PR_MAXPROCS 1 /* Tasks/user. */ 76#define PR_MAXPROCS 1 /* Tasks/user. */
77#define PR_ISBLOCKED 2 /* If blocked, return 1. */ 77#define PR_ISBLOCKED 2 /* If blocked, return 1. */
78#define PR_SETSTACKSIZE 3 /* Set largest task stack size. */ 78#define PR_SETSTACKSIZE 3 /* Set largest task stack size. */
79#define PR_GETSTACKSIZE 4 /* Get largest task stack size. */ 79#define PR_GETSTACKSIZE 4 /* Get largest task stack size. */
80#define PR_MAXPPROCS 5 /* Num parallel tasks. */ 80#define PR_MAXPPROCS 5 /* Num parallel tasks. */
81#define PR_UNBLKONEXEC 6 /* When task exec/exit's, unblock. */ 81#define PR_UNBLKONEXEC 6 /* When task exec/exit's, unblock. */
82#define PR_SETEXITSIG 8 /* When task exit's, set signal. */ 82#define PR_SETEXITSIG 8 /* When task exit's, set signal. */
83#define PR_RESIDENT 9 /* Make task unswappable. */ 83#define PR_RESIDENT 9 /* Make task unswappable. */
84#define PR_ATTACHADDR 10 /* (Re-)Connect a vma to a task. */ 84#define PR_ATTACHADDR 10 /* (Re-)Connect a vma to a task. */
85#define PR_DETACHADDR 11 /* Disconnect a vma from a task. */ 85#define PR_DETACHADDR 11 /* Disconnect a vma from a task. */
86#define PR_TERMCHILD 12 /* When parent sleeps with fishes, kill child. */ 86#define PR_TERMCHILD 12 /* Kill child if the parent dies. */
87#define PR_GETSHMASK 13 /* Get the sproc() share mask. */ 87#define PR_GETSHMASK 13 /* Get the sproc() share mask. */
88#define PR_GETNSHARE 14 /* Number of share group members. */ 88#define PR_GETNSHARE 14 /* Number of share group members. */
89#define PR_COREPID 15 /* Add task pid to name when it core. */ 89#define PR_COREPID 15 /* Add task pid to name when it core. */
90#define PR_ATTACHADDRPERM 16 /* (Re-)Connect vma, with specified prot. */ 90#define PR_ATTACHADDRPERM 16 /* (Re-)Connect vma, with specified prot. */
91#define PR_PTHREADEXIT 17 /* Kill a pthread without prejudice. */ 91#define PR_PTHREADEXIT 17 /* Kill a pthread, only for IRIX 6.[234] */
92 92
93asmlinkage int irix_prctl(struct pt_regs *regs) 93asmlinkage int irix_prctl(unsigned option, ...)
94{ 94{
95 unsigned long cmd; 95 va_list args;
96 int error = 0, base = 0; 96 int error = 0;
97 97
98 if (regs->regs[2] == 1000) 98 va_start(args, option);
99 base = 1; 99 switch (option) {
100 cmd = regs->regs[base + 4];
101 switch (cmd) {
102 case PR_MAXPROCS: 100 case PR_MAXPROCS:
103 printk("irix_prctl[%s:%d]: Wants PR_MAXPROCS\n", 101 printk("irix_prctl[%s:%d]: Wants PR_MAXPROCS\n",
104 current->comm, current->pid); 102 current->comm, current->pid);
@@ -111,7 +109,7 @@ asmlinkage int irix_prctl(struct pt_regs *regs)
111 printk("irix_prctl[%s:%d]: Wants PR_ISBLOCKED\n", 109 printk("irix_prctl[%s:%d]: Wants PR_ISBLOCKED\n",
112 current->comm, current->pid); 110 current->comm, current->pid);
113 read_lock(&tasklist_lock); 111 read_lock(&tasklist_lock);
114 task = find_task_by_pid(regs->regs[base + 5]); 112 task = find_task_by_pid(va_arg(args, pid_t));
115 error = -ESRCH; 113 error = -ESRCH;
116 if (error) 114 if (error)
117 error = (task->run_list.next != NULL); 115 error = (task->run_list.next != NULL);
@@ -121,7 +119,7 @@ asmlinkage int irix_prctl(struct pt_regs *regs)
121 } 119 }
122 120
123 case PR_SETSTACKSIZE: { 121 case PR_SETSTACKSIZE: {
124 long value = regs->regs[base + 5]; 122 long value = va_arg(args, long);
125 123
126 printk("irix_prctl[%s:%d]: Wants PR_SETSTACKSIZE<%08lx>\n", 124 printk("irix_prctl[%s:%d]: Wants PR_SETSTACKSIZE<%08lx>\n",
127 current->comm, current->pid, (unsigned long) value); 125 current->comm, current->pid, (unsigned long) value);
@@ -222,24 +220,20 @@ asmlinkage int irix_prctl(struct pt_regs *regs)
222 error = -EINVAL; 220 error = -EINVAL;
223 break; 221 break;
224 222
225 case PR_PTHREADEXIT:
226 printk("irix_prctl[%s:%d]: Wants PR_PTHREADEXIT\n",
227 current->comm, current->pid);
228 do_exit(regs->regs[base + 5]);
229
230 default: 223 default:
231 printk("irix_prctl[%s:%d]: Non-existant opcode %d\n", 224 printk("irix_prctl[%s:%d]: Non-existant opcode %d\n",
232 current->comm, current->pid, (int)cmd); 225 current->comm, current->pid, option);
233 error = -EINVAL; 226 error = -EINVAL;
234 break; 227 break;
235 } 228 }
229 va_end(args);
236 230
237 return error; 231 return error;
238} 232}
239 233
240#undef DEBUG_PROCGRPS 234#undef DEBUG_PROCGRPS
241 235
242extern unsigned long irix_mapelf(int fd, struct elf_phdr *user_phdrp, int cnt); 236extern unsigned long irix_mapelf(int fd, struct elf_phdr __user *user_phdrp, int cnt);
243extern int getrusage(struct task_struct *p, int who, struct rusage __user *ru); 237extern int getrusage(struct task_struct *p, int who, struct rusage __user *ru);
244extern char *prom_getenv(char *name); 238extern char *prom_getenv(char *name);
245extern long prom_setenv(char *name, char *value); 239extern long prom_setenv(char *name, char *value);
@@ -276,23 +270,19 @@ asmlinkage int irix_syssgi(struct pt_regs *regs)
276 cmd = regs->regs[base + 4]; 270 cmd = regs->regs[base + 4];
277 switch(cmd) { 271 switch(cmd) {
278 case SGI_SYSID: { 272 case SGI_SYSID: {
279 char *buf = (char *) regs->regs[base + 5]; 273 char __user *buf = (char __user *) regs->regs[base + 5];
280 274
281 /* XXX Use ethernet addr.... */ 275 /* XXX Use ethernet addr.... */
282 retval = clear_user(buf, 64); 276 retval = clear_user(buf, 64) ? -EFAULT : 0;
283 break; 277 break;
284 } 278 }
285#if 0 279#if 0
286 case SGI_RDNAME: { 280 case SGI_RDNAME: {
287 int pid = (int) regs->regs[base + 5]; 281 int pid = (int) regs->regs[base + 5];
288 char *buf = (char *) regs->regs[base + 6]; 282 char __user *buf = (char __user *) regs->regs[base + 6];
289 struct task_struct *p; 283 struct task_struct *p;
290 char tcomm[sizeof(current->comm)]; 284 char tcomm[sizeof(current->comm)];
291 285
292 if (!access_ok(VERIFY_WRITE, buf, sizeof(tcomm))) {
293 retval = -EFAULT;
294 break;
295 }
296 read_lock(&tasklist_lock); 286 read_lock(&tasklist_lock);
297 p = find_task_by_pid(pid); 287 p = find_task_by_pid(pid);
298 if (!p) { 288 if (!p) {
@@ -304,34 +294,28 @@ asmlinkage int irix_syssgi(struct pt_regs *regs)
304 read_unlock(&tasklist_lock); 294 read_unlock(&tasklist_lock);
305 295
306 /* XXX Need to check sizes. */ 296 /* XXX Need to check sizes. */
307 copy_to_user(buf, tcomm, sizeof(tcomm)); 297 retval = copy_to_user(buf, tcomm, sizeof(tcomm)) ? -EFAULT : 0;
308 retval = 0;
309 break; 298 break;
310 } 299 }
311 300
312 case SGI_GETNVRAM: { 301 case SGI_GETNVRAM: {
313 char *name = (char *) regs->regs[base+5]; 302 char __user *name = (char __user *) regs->regs[base+5];
314 char *buf = (char *) regs->regs[base+6]; 303 char __user *buf = (char __user *) regs->regs[base+6];
315 char *value; 304 char *value;
316 return -EINVAL; /* til I fix it */ 305 return -EINVAL; /* til I fix it */
317 if (!access_ok(VERIFY_WRITE, buf, 128)) {
318 retval = -EFAULT;
319 break;
320 }
321 value = prom_getenv(name); /* PROM lock? */ 306 value = prom_getenv(name); /* PROM lock? */
322 if (!value) { 307 if (!value) {
323 retval = -EINVAL; 308 retval = -EINVAL;
324 break; 309 break;
325 } 310 }
326 /* Do I strlen() for the length? */ 311 /* Do I strlen() for the length? */
327 copy_to_user(buf, value, 128); 312 retval = copy_to_user(buf, value, 128) ? -EFAULT : 0;
328 retval = 0;
329 break; 313 break;
330 } 314 }
331 315
332 case SGI_SETNVRAM: { 316 case SGI_SETNVRAM: {
333 char *name = (char *) regs->regs[base+5]; 317 char __user *name = (char __user *) regs->regs[base+5];
334 char *value = (char *) regs->regs[base+6]; 318 char __user *value = (char __user *) regs->regs[base+6];
335 return -EINVAL; /* til I fix it */ 319 return -EINVAL; /* til I fix it */
336 retval = prom_setenv(name, value); 320 retval = prom_setenv(name, value);
337 /* XXX make sure retval conforms to syssgi(2) */ 321 /* XXX make sure retval conforms to syssgi(2) */
@@ -407,16 +391,16 @@ asmlinkage int irix_syssgi(struct pt_regs *regs)
407 391
408 case SGI_SETGROUPS: 392 case SGI_SETGROUPS:
409 retval = sys_setgroups((int) regs->regs[base + 5], 393 retval = sys_setgroups((int) regs->regs[base + 5],
410 (gid_t *) regs->regs[base + 6]); 394 (gid_t __user *) regs->regs[base + 6]);
411 break; 395 break;
412 396
413 case SGI_GETGROUPS: 397 case SGI_GETGROUPS:
414 retval = sys_getgroups((int) regs->regs[base + 5], 398 retval = sys_getgroups((int) regs->regs[base + 5],
415 (gid_t *) regs->regs[base + 6]); 399 (gid_t __user *) regs->regs[base + 6]);
416 break; 400 break;
417 401
418 case SGI_RUSAGE: { 402 case SGI_RUSAGE: {
419 struct rusage *ru = (struct rusage *) regs->regs[base + 6]; 403 struct rusage __user *ru = (struct rusage __user *) regs->regs[base + 6];
420 404
421 switch((int) regs->regs[base + 5]) { 405 switch((int) regs->regs[base + 5]) {
422 case 0: 406 case 0:
@@ -453,7 +437,7 @@ asmlinkage int irix_syssgi(struct pt_regs *regs)
453 437
454 case SGI_ELFMAP: 438 case SGI_ELFMAP:
455 retval = irix_mapelf((int) regs->regs[base + 5], 439 retval = irix_mapelf((int) regs->regs[base + 5],
456 (struct elf_phdr *) regs->regs[base + 6], 440 (struct elf_phdr __user *) regs->regs[base + 6],
457 (int) regs->regs[base + 7]); 441 (int) regs->regs[base + 7]);
458 break; 442 break;
459 443
@@ -468,24 +452,24 @@ asmlinkage int irix_syssgi(struct pt_regs *regs)
468 452
469 case SGI_PHYSP: { 453 case SGI_PHYSP: {
470 unsigned long addr = regs->regs[base + 5]; 454 unsigned long addr = regs->regs[base + 5];
471 int *pageno = (int *) (regs->regs[base + 6]); 455 int __user *pageno = (int __user *) (regs->regs[base + 6]);
472 struct mm_struct *mm = current->mm; 456 struct mm_struct *mm = current->mm;
473 pgd_t *pgdp; 457 pgd_t *pgdp;
458 pud_t *pudp;
474 pmd_t *pmdp; 459 pmd_t *pmdp;
475 pte_t *ptep; 460 pte_t *ptep;
476 461
477 if (!access_ok(VERIFY_WRITE, pageno, sizeof(int)))
478 return -EFAULT;
479
480 down_read(&mm->mmap_sem); 462 down_read(&mm->mmap_sem);
481 pgdp = pgd_offset(mm, addr); 463 pgdp = pgd_offset(mm, addr);
482 pmdp = pmd_offset(pgdp, addr); 464 pudp = pud_offset(pgdp, addr);
465 pmdp = pmd_offset(pudp, addr);
483 ptep = pte_offset(pmdp, addr); 466 ptep = pte_offset(pmdp, addr);
484 retval = -EINVAL; 467 retval = -EINVAL;
485 if (ptep) { 468 if (ptep) {
486 pte_t pte = *ptep; 469 pte_t pte = *ptep;
487 470
488 if (pte_val(pte) & (_PAGE_VALID | _PAGE_PRESENT)) { 471 if (pte_val(pte) & (_PAGE_VALID | _PAGE_PRESENT)) {
472 /* b0rked on 64-bit */
489 retval = put_user((pte_val(pte) & PAGE_MASK) >> 473 retval = put_user((pte_val(pte) & PAGE_MASK) >>
490 PAGE_SHIFT, pageno); 474 PAGE_SHIFT, pageno);
491 } 475 }
@@ -496,7 +480,7 @@ asmlinkage int irix_syssgi(struct pt_regs *regs)
496 480
497 case SGI_INVENT: { 481 case SGI_INVENT: {
498 int arg1 = (int) regs->regs [base + 5]; 482 int arg1 = (int) regs->regs [base + 5];
499 void *buffer = (void *) regs->regs [base + 6]; 483 void __user *buffer = (void __user *) regs->regs [base + 6];
500 int count = (int) regs->regs [base + 7]; 484 int count = (int) regs->regs [base + 7];
501 485
502 switch (arg1) { 486 switch (arg1) {
@@ -692,8 +676,8 @@ asmlinkage int irix_pause(void)
692} 676}
693 677
694/* XXX need more than this... */ 678/* XXX need more than this... */
695asmlinkage int irix_mount(char *dev_name, char *dir_name, unsigned long flags, 679asmlinkage int irix_mount(char __user *dev_name, char __user *dir_name,
696 char *type, void *data, int datalen) 680 unsigned long flags, char __user *type, void __user *data, int datalen)
697{ 681{
698 printk("[%s:%d] irix_mount(%p,%p,%08lx,%p,%p,%d)\n", 682 printk("[%s:%d] irix_mount(%p,%p,%08lx,%p,%p,%d)\n",
699 current->comm, current->pid, 683 current->comm, current->pid,
@@ -708,8 +692,8 @@ struct irix_statfs {
708 char f_fname[6], f_fpack[6]; 692 char f_fname[6], f_fpack[6];
709}; 693};
710 694
711asmlinkage int irix_statfs(const char *path, struct irix_statfs *buf, 695asmlinkage int irix_statfs(const char __user *path,
712 int len, int fs_type) 696 struct irix_statfs __user *buf, int len, int fs_type)
713{ 697{
714 struct nameidata nd; 698 struct nameidata nd;
715 struct kstatfs kbuf; 699 struct kstatfs kbuf;
@@ -724,6 +708,7 @@ asmlinkage int irix_statfs(const char *path, struct irix_statfs *buf,
724 error = -EFAULT; 708 error = -EFAULT;
725 goto out; 709 goto out;
726 } 710 }
711
727 error = user_path_walk(path, &nd); 712 error = user_path_walk(path, &nd);
728 if (error) 713 if (error)
729 goto out; 714 goto out;
@@ -732,18 +717,17 @@ asmlinkage int irix_statfs(const char *path, struct irix_statfs *buf,
732 if (error) 717 if (error)
733 goto dput_and_out; 718 goto dput_and_out;
734 719
735 __put_user(kbuf.f_type, &buf->f_type); 720 error = __put_user(kbuf.f_type, &buf->f_type);
736 __put_user(kbuf.f_bsize, &buf->f_bsize); 721 error |= __put_user(kbuf.f_bsize, &buf->f_bsize);
737 __put_user(kbuf.f_frsize, &buf->f_frsize); 722 error |= __put_user(kbuf.f_frsize, &buf->f_frsize);
738 __put_user(kbuf.f_blocks, &buf->f_blocks); 723 error |= __put_user(kbuf.f_blocks, &buf->f_blocks);
739 __put_user(kbuf.f_bfree, &buf->f_bfree); 724 error |= __put_user(kbuf.f_bfree, &buf->f_bfree);
740 __put_user(kbuf.f_files, &buf->f_files); 725 error |= __put_user(kbuf.f_files, &buf->f_files);
741 __put_user(kbuf.f_ffree, &buf->f_ffree); 726 error |= __put_user(kbuf.f_ffree, &buf->f_ffree);
742 for (i = 0; i < 6; i++) { 727 for (i = 0; i < 6; i++) {
743 __put_user(0, &buf->f_fname[i]); 728 error |= __put_user(0, &buf->f_fname[i]);
744 __put_user(0, &buf->f_fpack[i]); 729 error |= __put_user(0, &buf->f_fpack[i]);
745 } 730 }
746 error = 0;
747 731
748dput_and_out: 732dput_and_out:
749 path_release(&nd); 733 path_release(&nd);
@@ -751,7 +735,7 @@ out:
751 return error; 735 return error;
752} 736}
753 737
754asmlinkage int irix_fstatfs(unsigned int fd, struct irix_statfs *buf) 738asmlinkage int irix_fstatfs(unsigned int fd, struct irix_statfs __user *buf)
755{ 739{
756 struct kstatfs kbuf; 740 struct kstatfs kbuf;
757 struct file *file; 741 struct file *file;
@@ -761,6 +745,7 @@ asmlinkage int irix_fstatfs(unsigned int fd, struct irix_statfs *buf)
761 error = -EFAULT; 745 error = -EFAULT;
762 goto out; 746 goto out;
763 } 747 }
748
764 if (!(file = fget(fd))) { 749 if (!(file = fget(fd))) {
765 error = -EBADF; 750 error = -EBADF;
766 goto out; 751 goto out;
@@ -770,16 +755,17 @@ asmlinkage int irix_fstatfs(unsigned int fd, struct irix_statfs *buf)
770 if (error) 755 if (error)
771 goto out_f; 756 goto out_f;
772 757
773 __put_user(kbuf.f_type, &buf->f_type); 758 error = __put_user(kbuf.f_type, &buf->f_type);
774 __put_user(kbuf.f_bsize, &buf->f_bsize); 759 error |= __put_user(kbuf.f_bsize, &buf->f_bsize);
775 __put_user(kbuf.f_frsize, &buf->f_frsize); 760 error |= __put_user(kbuf.f_frsize, &buf->f_frsize);
776 __put_user(kbuf.f_blocks, &buf->f_blocks); 761 error |= __put_user(kbuf.f_blocks, &buf->f_blocks);
777 __put_user(kbuf.f_bfree, &buf->f_bfree); 762 error |= __put_user(kbuf.f_bfree, &buf->f_bfree);
778 __put_user(kbuf.f_files, &buf->f_files); 763 error |= __put_user(kbuf.f_files, &buf->f_files);
779 __put_user(kbuf.f_ffree, &buf->f_ffree); 764 error |= __put_user(kbuf.f_ffree, &buf->f_ffree);
780 for(i = 0; i < 6; i++) { 765
781 __put_user(0, &buf->f_fname[i]); 766 for (i = 0; i < 6; i++) {
782 __put_user(0, &buf->f_fpack[i]); 767 error |= __put_user(0, &buf->f_fname[i]);
768 error |= __put_user(0, &buf->f_fpack[i]);
783 } 769 }
784 770
785out_f: 771out_f:
@@ -806,14 +792,15 @@ asmlinkage int irix_setpgrp(int flags)
806 return error; 792 return error;
807} 793}
808 794
809asmlinkage int irix_times(struct tms * tbuf) 795asmlinkage int irix_times(struct tms __user *tbuf)
810{ 796{
811 int err = 0; 797 int err = 0;
812 798
813 if (tbuf) { 799 if (tbuf) {
814 if (!access_ok(VERIFY_WRITE,tbuf,sizeof *tbuf)) 800 if (!access_ok(VERIFY_WRITE,tbuf,sizeof *tbuf))
815 return -EFAULT; 801 return -EFAULT;
816 err |= __put_user(current->utime, &tbuf->tms_utime); 802
803 err = __put_user(current->utime, &tbuf->tms_utime);
817 err |= __put_user(current->stime, &tbuf->tms_stime); 804 err |= __put_user(current->stime, &tbuf->tms_stime);
818 err |= __put_user(current->signal->cutime, &tbuf->tms_cutime); 805 err |= __put_user(current->signal->cutime, &tbuf->tms_cutime);
819 err |= __put_user(current->signal->cstime, &tbuf->tms_cstime); 806 err |= __put_user(current->signal->cstime, &tbuf->tms_cstime);
@@ -829,13 +816,13 @@ asmlinkage int irix_exec(struct pt_regs *regs)
829 816
830 if(regs->regs[2] == 1000) 817 if(regs->regs[2] == 1000)
831 base = 1; 818 base = 1;
832 filename = getname((char *) (long)regs->regs[base + 4]); 819 filename = getname((char __user *) (long)regs->regs[base + 4]);
833 error = PTR_ERR(filename); 820 error = PTR_ERR(filename);
834 if (IS_ERR(filename)) 821 if (IS_ERR(filename))
835 return error; 822 return error;
836 823
837 error = do_execve(filename, (char **) (long)regs->regs[base + 5], 824 error = do_execve(filename, (char __user * __user *) (long)regs->regs[base + 5],
838 (char **) 0, regs); 825 NULL, regs);
839 putname(filename); 826 putname(filename);
840 827
841 return error; 828 return error;
@@ -848,12 +835,12 @@ asmlinkage int irix_exece(struct pt_regs *regs)
848 835
849 if (regs->regs[2] == 1000) 836 if (regs->regs[2] == 1000)
850 base = 1; 837 base = 1;
851 filename = getname((char *) (long)regs->regs[base + 4]); 838 filename = getname((char __user *) (long)regs->regs[base + 4]);
852 error = PTR_ERR(filename); 839 error = PTR_ERR(filename);
853 if (IS_ERR(filename)) 840 if (IS_ERR(filename))
854 return error; 841 return error;
855 error = do_execve(filename, (char **) (long)regs->regs[base + 5], 842 error = do_execve(filename, (char __user * __user *) (long)regs->regs[base + 5],
856 (char **) (long)regs->regs[base + 6], regs); 843 (char __user * __user *) (long)regs->regs[base + 6], regs);
857 putname(filename); 844 putname(filename);
858 845
859 return error; 846 return error;
@@ -909,22 +896,17 @@ asmlinkage int irix_socket(int family, int type, int protocol)
909 return sys_socket(family, type, protocol); 896 return sys_socket(family, type, protocol);
910} 897}
911 898
912asmlinkage int irix_getdomainname(char *name, int len) 899asmlinkage int irix_getdomainname(char __user *name, int len)
913{ 900{
914 int error; 901 int err;
915
916 if (!access_ok(VERIFY_WRITE, name, len))
917 return -EFAULT;
918 902
919 down_read(&uts_sem); 903 down_read(&uts_sem);
920 if (len > __NEW_UTS_LEN) 904 if (len > __NEW_UTS_LEN)
921 len = __NEW_UTS_LEN; 905 len = __NEW_UTS_LEN;
922 error = 0; 906 err = copy_to_user(name, system_utsname.domainname, len) ? -EFAULT : 0;
923 if (copy_to_user(name, system_utsname.domainname, len))
924 error = -EFAULT;
925 up_read(&uts_sem); 907 up_read(&uts_sem);
926 908
927 return error; 909 return err;
928} 910}
929 911
930asmlinkage unsigned long irix_getpagesize(void) 912asmlinkage unsigned long irix_getpagesize(void)
@@ -940,12 +922,13 @@ asmlinkage int irix_msgsys(int opcode, unsigned long arg0, unsigned long arg1,
940 case 0: 922 case 0:
941 return sys_msgget((key_t) arg0, (int) arg1); 923 return sys_msgget((key_t) arg0, (int) arg1);
942 case 1: 924 case 1:
943 return sys_msgctl((int) arg0, (int) arg1, (struct msqid_ds *)arg2); 925 return sys_msgctl((int) arg0, (int) arg1,
926 (struct msqid_ds __user *)arg2);
944 case 2: 927 case 2:
945 return sys_msgrcv((int) arg0, (struct msgbuf *) arg1, 928 return sys_msgrcv((int) arg0, (struct msgbuf __user *) arg1,
946 (size_t) arg2, (long) arg3, (int) arg4); 929 (size_t) arg2, (long) arg3, (int) arg4);
947 case 3: 930 case 3:
948 return sys_msgsnd((int) arg0, (struct msgbuf *) arg1, 931 return sys_msgsnd((int) arg0, (struct msgbuf __user *) arg1,
949 (size_t) arg2, (int) arg3); 932 (size_t) arg2, (int) arg3);
950 default: 933 default:
951 return -EINVAL; 934 return -EINVAL;
@@ -957,12 +940,13 @@ asmlinkage int irix_shmsys(int opcode, unsigned long arg0, unsigned long arg1,
957{ 940{
958 switch (opcode) { 941 switch (opcode) {
959 case 0: 942 case 0:
960 return do_shmat((int) arg0, (char *)arg1, (int) arg2, 943 return do_shmat((int) arg0, (char __user *) arg1, (int) arg2,
961 (unsigned long *) arg3); 944 (unsigned long *) arg3);
962 case 1: 945 case 1:
963 return sys_shmctl((int)arg0, (int)arg1, (struct shmid_ds *)arg2); 946 return sys_shmctl((int)arg0, (int)arg1,
947 (struct shmid_ds __user *)arg2);
964 case 2: 948 case 2:
965 return sys_shmdt((char *)arg0); 949 return sys_shmdt((char __user *)arg0);
966 case 3: 950 case 3:
967 return sys_shmget((key_t) arg0, (int) arg1, (int) arg2); 951 return sys_shmget((key_t) arg0, (int) arg1, (int) arg2);
968 default: 952 default:
@@ -980,7 +964,7 @@ asmlinkage int irix_semsys(int opcode, unsigned long arg0, unsigned long arg1,
980 case 1: 964 case 1:
981 return sys_semget((key_t) arg0, (int) arg1, (int) arg2); 965 return sys_semget((key_t) arg0, (int) arg1, (int) arg2);
982 case 2: 966 case 2:
983 return sys_semop((int) arg0, (struct sembuf *)arg1, 967 return sys_semop((int) arg0, (struct sembuf __user *)arg1,
984 (unsigned int) arg2); 968 (unsigned int) arg2);
985 default: 969 default:
986 return -EINVAL; 970 return -EINVAL;
@@ -998,15 +982,16 @@ static inline loff_t llseek(struct file *file, loff_t offset, int origin)
998 lock_kernel(); 982 lock_kernel();
999 retval = fn(file, offset, origin); 983 retval = fn(file, offset, origin);
1000 unlock_kernel(); 984 unlock_kernel();
985
1001 return retval; 986 return retval;
1002} 987}
1003 988
1004asmlinkage int irix_lseek64(int fd, int _unused, int offhi, int offlow, 989asmlinkage int irix_lseek64(int fd, int _unused, int offhi, int offlow,
1005 int origin) 990 int origin)
1006{ 991{
1007 int retval;
1008 struct file * file; 992 struct file * file;
1009 loff_t offset; 993 loff_t offset;
994 int retval;
1010 995
1011 retval = -EBADF; 996 retval = -EBADF;
1012 file = fget(fd); 997 file = fget(fd);
@@ -1031,12 +1016,12 @@ asmlinkage int irix_sginap(int ticks)
1031 return 0; 1016 return 0;
1032} 1017}
1033 1018
1034asmlinkage int irix_sgikopt(char *istring, char *ostring, int len) 1019asmlinkage int irix_sgikopt(char __user *istring, char __user *ostring, int len)
1035{ 1020{
1036 return -EINVAL; 1021 return -EINVAL;
1037} 1022}
1038 1023
1039asmlinkage int irix_gettimeofday(struct timeval *tv) 1024asmlinkage int irix_gettimeofday(struct timeval __user *tv)
1040{ 1025{
1041 time_t sec; 1026 time_t sec;
1042 long nsec, seq; 1027 long nsec, seq;
@@ -1077,7 +1062,7 @@ asmlinkage unsigned long irix_mmap32(unsigned long addr, size_t len, int prot,
1077 1062
1078 if (max_size > file->f_dentry->d_inode->i_size) { 1063 if (max_size > file->f_dentry->d_inode->i_size) {
1079 old_pos = sys_lseek (fd, max_size - 1, 0); 1064 old_pos = sys_lseek (fd, max_size - 1, 0);
1080 sys_write (fd, "", 1); 1065 sys_write (fd, (void __user *) "", 1);
1081 sys_lseek (fd, old_pos, 0); 1066 sys_lseek (fd, old_pos, 0);
1082 } 1067 }
1083 } 1068 }
@@ -1102,7 +1087,7 @@ asmlinkage int irix_madvise(unsigned long addr, int len, int behavior)
1102 return -EINVAL; 1087 return -EINVAL;
1103} 1088}
1104 1089
1105asmlinkage int irix_pagelock(char *addr, int len, int op) 1090asmlinkage int irix_pagelock(char __user *addr, int len, int op)
1106{ 1091{
1107 printk("[%s:%d] Wheee.. irix_pagelock(%p,%d,%d)\n", 1092 printk("[%s:%d] Wheee.. irix_pagelock(%p,%d,%d)\n",
1108 current->comm, current->pid, addr, len, op); 1093 current->comm, current->pid, addr, len, op);
@@ -1142,7 +1127,7 @@ asmlinkage int irix_BSDsetpgrp(int pid, int pgrp)
1142 return error; 1127 return error;
1143} 1128}
1144 1129
1145asmlinkage int irix_systeminfo(int cmd, char *buf, int cnt) 1130asmlinkage int irix_systeminfo(int cmd, char __user *buf, int cnt)
1146{ 1131{
1147 printk("[%s:%d] Wheee.. irix_systeminfo(%d,%p,%d)\n", 1132 printk("[%s:%d] Wheee.. irix_systeminfo(%d,%p,%d)\n",
1148 current->comm, current->pid, cmd, buf, cnt); 1133 current->comm, current->pid, cmd, buf, cnt);
@@ -1158,14 +1143,14 @@ struct iuname {
1158 char _unused3[257], _unused4[257], _unused5[257]; 1143 char _unused3[257], _unused4[257], _unused5[257];
1159}; 1144};
1160 1145
1161asmlinkage int irix_uname(struct iuname *buf) 1146asmlinkage int irix_uname(struct iuname __user *buf)
1162{ 1147{
1163 down_read(&uts_sem); 1148 down_read(&uts_sem);
1164 if (copy_to_user(system_utsname.sysname, buf->sysname, 65) 1149 if (copy_from_user(system_utsname.sysname, buf->sysname, 65)
1165 || copy_to_user(system_utsname.nodename, buf->nodename, 65) 1150 || copy_from_user(system_utsname.nodename, buf->nodename, 65)
1166 || copy_to_user(system_utsname.release, buf->release, 65) 1151 || copy_from_user(system_utsname.release, buf->release, 65)
1167 || copy_to_user(system_utsname.version, buf->version, 65) 1152 || copy_from_user(system_utsname.version, buf->version, 65)
1168 || copy_to_user(system_utsname.machine, buf->machine, 65)) { 1153 || copy_from_user(system_utsname.machine, buf->machine, 65)) {
1169 return -EFAULT; 1154 return -EFAULT;
1170 } 1155 }
1171 up_read(&uts_sem); 1156 up_read(&uts_sem);
@@ -1175,7 +1160,7 @@ asmlinkage int irix_uname(struct iuname *buf)
1175 1160
1176#undef DEBUG_XSTAT 1161#undef DEBUG_XSTAT
1177 1162
1178static int irix_xstat32_xlate(struct kstat *stat, void *ubuf) 1163static int irix_xstat32_xlate(struct kstat *stat, void __user *ubuf)
1179{ 1164{
1180 struct xstat32 { 1165 struct xstat32 {
1181 u32 st_dev, st_pad1[3], st_ino, st_mode, st_nlink, st_uid, st_gid; 1166 u32 st_dev, st_pad1[3], st_ino, st_mode, st_nlink, st_uid, st_gid;
@@ -1215,7 +1200,7 @@ static int irix_xstat32_xlate(struct kstat *stat, void *ubuf)
1215 return copy_to_user(ubuf, &ub, sizeof(ub)) ? -EFAULT : 0; 1200 return copy_to_user(ubuf, &ub, sizeof(ub)) ? -EFAULT : 0;
1216} 1201}
1217 1202
1218static int irix_xstat64_xlate(struct kstat *stat, void *ubuf) 1203static int irix_xstat64_xlate(struct kstat *stat, void __user *ubuf)
1219{ 1204{
1220 struct xstat64 { 1205 struct xstat64 {
1221 u32 st_dev; s32 st_pad1[3]; 1206 u32 st_dev; s32 st_pad1[3];
@@ -1265,7 +1250,7 @@ static int irix_xstat64_xlate(struct kstat *stat, void *ubuf)
1265 return copy_to_user(ubuf, &ks, sizeof(ks)) ? -EFAULT : 0; 1250 return copy_to_user(ubuf, &ks, sizeof(ks)) ? -EFAULT : 0;
1266} 1251}
1267 1252
1268asmlinkage int irix_xstat(int version, char *filename, struct stat *statbuf) 1253asmlinkage int irix_xstat(int version, char __user *filename, struct stat __user *statbuf)
1269{ 1254{
1270 int retval; 1255 int retval;
1271 struct kstat stat; 1256 struct kstat stat;
@@ -1291,7 +1276,7 @@ asmlinkage int irix_xstat(int version, char *filename, struct stat *statbuf)
1291 return retval; 1276 return retval;
1292} 1277}
1293 1278
1294asmlinkage int irix_lxstat(int version, char *filename, struct stat *statbuf) 1279asmlinkage int irix_lxstat(int version, char __user *filename, struct stat __user *statbuf)
1295{ 1280{
1296 int error; 1281 int error;
1297 struct kstat stat; 1282 struct kstat stat;
@@ -1318,7 +1303,7 @@ asmlinkage int irix_lxstat(int version, char *filename, struct stat *statbuf)
1318 return error; 1303 return error;
1319} 1304}
1320 1305
1321asmlinkage int irix_fxstat(int version, int fd, struct stat *statbuf) 1306asmlinkage int irix_fxstat(int version, int fd, struct stat __user *statbuf)
1322{ 1307{
1323 int error; 1308 int error;
1324 struct kstat stat; 1309 struct kstat stat;
@@ -1344,7 +1329,7 @@ asmlinkage int irix_fxstat(int version, int fd, struct stat *statbuf)
1344 return error; 1329 return error;
1345} 1330}
1346 1331
1347asmlinkage int irix_xmknod(int ver, char *filename, int mode, unsigned dev) 1332asmlinkage int irix_xmknod(int ver, char __user *filename, int mode, unsigned dev)
1348{ 1333{
1349 int retval; 1334 int retval;
1350 printk("[%s:%d] Wheee.. irix_xmknod(%d,%s,%x,%x)\n", 1335 printk("[%s:%d] Wheee.. irix_xmknod(%d,%s,%x,%x)\n",
@@ -1364,7 +1349,7 @@ asmlinkage int irix_xmknod(int ver, char *filename, int mode, unsigned dev)
1364 return retval; 1349 return retval;
1365} 1350}
1366 1351
1367asmlinkage int irix_swapctl(int cmd, char *arg) 1352asmlinkage int irix_swapctl(int cmd, char __user *arg)
1368{ 1353{
1369 printk("[%s:%d] Wheee.. irix_swapctl(%d,%p)\n", 1354 printk("[%s:%d] Wheee.. irix_swapctl(%d,%p)\n",
1370 current->comm, current->pid, cmd, arg); 1355 current->comm, current->pid, cmd, arg);
@@ -1380,7 +1365,7 @@ struct irix_statvfs {
1380 char f_fstr[32]; u32 f_filler[16]; 1365 char f_fstr[32]; u32 f_filler[16];
1381}; 1366};
1382 1367
1383asmlinkage int irix_statvfs(char *fname, struct irix_statvfs *buf) 1368asmlinkage int irix_statvfs(char __user *fname, struct irix_statvfs __user *buf)
1384{ 1369{
1385 struct nameidata nd; 1370 struct nameidata nd;
1386 struct kstatfs kbuf; 1371 struct kstatfs kbuf;
@@ -1388,10 +1373,9 @@ asmlinkage int irix_statvfs(char *fname, struct irix_statvfs *buf)
1388 1373
1389 printk("[%s:%d] Wheee.. irix_statvfs(%s,%p)\n", 1374 printk("[%s:%d] Wheee.. irix_statvfs(%s,%p)\n",
1390 current->comm, current->pid, fname, buf); 1375 current->comm, current->pid, fname, buf);
1391 if (!access_ok(VERIFY_WRITE, buf, sizeof(struct irix_statvfs))) { 1376 if (!access_ok(VERIFY_WRITE, buf, sizeof(struct irix_statvfs)))
1392 error = -EFAULT; 1377 return -EFAULT;
1393 goto out; 1378
1394 }
1395 error = user_path_walk(fname, &nd); 1379 error = user_path_walk(fname, &nd);
1396 if (error) 1380 if (error)
1397 goto out; 1381 goto out;
@@ -1399,27 +1383,25 @@ asmlinkage int irix_statvfs(char *fname, struct irix_statvfs *buf)
1399 if (error) 1383 if (error)
1400 goto dput_and_out; 1384 goto dput_and_out;
1401 1385
1402 __put_user(kbuf.f_bsize, &buf->f_bsize); 1386 error |= __put_user(kbuf.f_bsize, &buf->f_bsize);
1403 __put_user(kbuf.f_frsize, &buf->f_frsize); 1387 error |= __put_user(kbuf.f_frsize, &buf->f_frsize);
1404 __put_user(kbuf.f_blocks, &buf->f_blocks); 1388 error |= __put_user(kbuf.f_blocks, &buf->f_blocks);
1405 __put_user(kbuf.f_bfree, &buf->f_bfree); 1389 error |= __put_user(kbuf.f_bfree, &buf->f_bfree);
1406 __put_user(kbuf.f_bfree, &buf->f_bavail); /* XXX hackety hack... */ 1390 error |= __put_user(kbuf.f_bfree, &buf->f_bavail); /* XXX hackety hack... */
1407 __put_user(kbuf.f_files, &buf->f_files); 1391 error |= __put_user(kbuf.f_files, &buf->f_files);
1408 __put_user(kbuf.f_ffree, &buf->f_ffree); 1392 error |= __put_user(kbuf.f_ffree, &buf->f_ffree);
1409 __put_user(kbuf.f_ffree, &buf->f_favail); /* XXX hackety hack... */ 1393 error |= __put_user(kbuf.f_ffree, &buf->f_favail); /* XXX hackety hack... */
1410#ifdef __MIPSEB__ 1394#ifdef __MIPSEB__
1411 __put_user(kbuf.f_fsid.val[1], &buf->f_fsid); 1395 error |= __put_user(kbuf.f_fsid.val[1], &buf->f_fsid);
1412#else 1396#else
1413 __put_user(kbuf.f_fsid.val[0], &buf->f_fsid); 1397 error |= __put_user(kbuf.f_fsid.val[0], &buf->f_fsid);
1414#endif 1398#endif
1415 for (i = 0; i < 16; i++) 1399 for (i = 0; i < 16; i++)
1416 __put_user(0, &buf->f_basetype[i]); 1400 error |= __put_user(0, &buf->f_basetype[i]);
1417 __put_user(0, &buf->f_flag); 1401 error |= __put_user(0, &buf->f_flag);
1418 __put_user(kbuf.f_namelen, &buf->f_namemax); 1402 error |= __put_user(kbuf.f_namelen, &buf->f_namemax);
1419 for (i = 0; i < 32; i++) 1403 for (i = 0; i < 32; i++)
1420 __put_user(0, &buf->f_fstr[i]); 1404 error |= __put_user(0, &buf->f_fstr[i]);
1421
1422 error = 0;
1423 1405
1424dput_and_out: 1406dput_and_out:
1425 path_release(&nd); 1407 path_release(&nd);
@@ -1427,7 +1409,7 @@ out:
1427 return error; 1409 return error;
1428} 1410}
1429 1411
1430asmlinkage int irix_fstatvfs(int fd, struct irix_statvfs *buf) 1412asmlinkage int irix_fstatvfs(int fd, struct irix_statvfs __user *buf)
1431{ 1413{
1432 struct kstatfs kbuf; 1414 struct kstatfs kbuf;
1433 struct file *file; 1415 struct file *file;
@@ -1436,10 +1418,9 @@ asmlinkage int irix_fstatvfs(int fd, struct irix_statvfs *buf)
1436 printk("[%s:%d] Wheee.. irix_fstatvfs(%d,%p)\n", 1418 printk("[%s:%d] Wheee.. irix_fstatvfs(%d,%p)\n",
1437 current->comm, current->pid, fd, buf); 1419 current->comm, current->pid, fd, buf);
1438 1420
1439 if (!access_ok(VERIFY_WRITE, buf, sizeof(struct irix_statvfs))) { 1421 if (!access_ok(VERIFY_WRITE, buf, sizeof(struct irix_statvfs)))
1440 error = -EFAULT; 1422 return -EFAULT;
1441 goto out; 1423
1442 }
1443 if (!(file = fget(fd))) { 1424 if (!(file = fget(fd))) {
1444 error = -EBADF; 1425 error = -EBADF;
1445 goto out; 1426 goto out;
@@ -1448,24 +1429,24 @@ asmlinkage int irix_fstatvfs(int fd, struct irix_statvfs *buf)
1448 if (error) 1429 if (error)
1449 goto out_f; 1430 goto out_f;
1450 1431
1451 __put_user(kbuf.f_bsize, &buf->f_bsize); 1432 error = __put_user(kbuf.f_bsize, &buf->f_bsize);
1452 __put_user(kbuf.f_frsize, &buf->f_frsize); 1433 error |= __put_user(kbuf.f_frsize, &buf->f_frsize);
1453 __put_user(kbuf.f_blocks, &buf->f_blocks); 1434 error |= __put_user(kbuf.f_blocks, &buf->f_blocks);
1454 __put_user(kbuf.f_bfree, &buf->f_bfree); 1435 error |= __put_user(kbuf.f_bfree, &buf->f_bfree);
1455 __put_user(kbuf.f_bfree, &buf->f_bavail); /* XXX hackety hack... */ 1436 error |= __put_user(kbuf.f_bfree, &buf->f_bavail); /* XXX hackety hack... */
1456 __put_user(kbuf.f_files, &buf->f_files); 1437 error |= __put_user(kbuf.f_files, &buf->f_files);
1457 __put_user(kbuf.f_ffree, &buf->f_ffree); 1438 error |= __put_user(kbuf.f_ffree, &buf->f_ffree);
1458 __put_user(kbuf.f_ffree, &buf->f_favail); /* XXX hackety hack... */ 1439 error |= __put_user(kbuf.f_ffree, &buf->f_favail); /* XXX hackety hack... */
1459#ifdef __MIPSEB__ 1440#ifdef __MIPSEB__
1460 __put_user(kbuf.f_fsid.val[1], &buf->f_fsid); 1441 error |= __put_user(kbuf.f_fsid.val[1], &buf->f_fsid);
1461#else 1442#else
1462 __put_user(kbuf.f_fsid.val[0], &buf->f_fsid); 1443 error |= __put_user(kbuf.f_fsid.val[0], &buf->f_fsid);
1463#endif 1444#endif
1464 for(i = 0; i < 16; i++) 1445 for(i = 0; i < 16; i++)
1465 __put_user(0, &buf->f_basetype[i]); 1446 error |= __put_user(0, &buf->f_basetype[i]);
1466 __put_user(0, &buf->f_flag); 1447 error |= __put_user(0, &buf->f_flag);
1467 __put_user(kbuf.f_namelen, &buf->f_namemax); 1448 error |= __put_user(kbuf.f_namelen, &buf->f_namemax);
1468 __clear_user(&buf->f_fstr, sizeof(buf->f_fstr)); 1449 error |= __clear_user(&buf->f_fstr, sizeof(buf->f_fstr)) ? -EFAULT : 0;
1469 1450
1470out_f: 1451out_f:
1471 fput(file); 1452 fput(file);
@@ -1489,7 +1470,7 @@ asmlinkage int irix_sigqueue(int pid, int sig, int code, int val)
1489 return -EINVAL; 1470 return -EINVAL;
1490} 1471}
1491 1472
1492asmlinkage int irix_truncate64(char *name, int pad, int size1, int size2) 1473asmlinkage int irix_truncate64(char __user *name, int pad, int size1, int size2)
1493{ 1474{
1494 int retval; 1475 int retval;
1495 1476
@@ -1522,6 +1503,7 @@ asmlinkage int irix_mmap64(struct pt_regs *regs)
1522 int len, prot, flags, fd, off1, off2, error, base = 0; 1503 int len, prot, flags, fd, off1, off2, error, base = 0;
1523 unsigned long addr, pgoff, *sp; 1504 unsigned long addr, pgoff, *sp;
1524 struct file *file = NULL; 1505 struct file *file = NULL;
1506 int err;
1525 1507
1526 if (regs->regs[2] == 1000) 1508 if (regs->regs[2] == 1000)
1527 base = 1; 1509 base = 1;
@@ -1531,36 +1513,31 @@ asmlinkage int irix_mmap64(struct pt_regs *regs)
1531 prot = regs->regs[base + 6]; 1513 prot = regs->regs[base + 6];
1532 if (!base) { 1514 if (!base) {
1533 flags = regs->regs[base + 7]; 1515 flags = regs->regs[base + 7];
1534 if (!access_ok(VERIFY_READ, sp, (4 * sizeof(unsigned long)))) { 1516 if (!access_ok(VERIFY_READ, sp, (4 * sizeof(unsigned long))))
1535 error = -EFAULT; 1517 return -EFAULT;
1536 goto out;
1537 }
1538 fd = sp[0]; 1518 fd = sp[0];
1539 __get_user(off1, &sp[1]); 1519 err = __get_user(off1, &sp[1]);
1540 __get_user(off2, &sp[2]); 1520 err |= __get_user(off2, &sp[2]);
1541 } else { 1521 } else {
1542 if (!access_ok(VERIFY_READ, sp, (5 * sizeof(unsigned long)))) { 1522 if (!access_ok(VERIFY_READ, sp, (5 * sizeof(unsigned long))))
1543 error = -EFAULT; 1523 return -EFAULT;
1544 goto out; 1524 err = __get_user(flags, &sp[0]);
1545 } 1525 err |= __get_user(fd, &sp[1]);
1546 __get_user(flags, &sp[0]); 1526 err |= __get_user(off1, &sp[2]);
1547 __get_user(fd, &sp[1]); 1527 err |= __get_user(off2, &sp[3]);
1548 __get_user(off1, &sp[2]);
1549 __get_user(off2, &sp[3]);
1550 } 1528 }
1551 1529
1552 if (off1 & PAGE_MASK) { 1530 if (err)
1553 error = -EOVERFLOW; 1531 return err;
1554 goto out; 1532
1555 } 1533 if (off1 & PAGE_MASK)
1534 return -EOVERFLOW;
1556 1535
1557 pgoff = (off1 << (32 - PAGE_SHIFT)) | (off2 >> PAGE_SHIFT); 1536 pgoff = (off1 << (32 - PAGE_SHIFT)) | (off2 >> PAGE_SHIFT);
1558 1537
1559 if (!(flags & MAP_ANONYMOUS)) { 1538 if (!(flags & MAP_ANONYMOUS)) {
1560 if (!(file = fget(fd))) { 1539 if (!(file = fget(fd)))
1561 error = -EBADF; 1540 return -EBADF;
1562 goto out;
1563 }
1564 1541
1565 /* Ok, bad taste hack follows, try to think in something else 1542 /* Ok, bad taste hack follows, try to think in something else
1566 when reading this */ 1543 when reading this */
@@ -1570,7 +1547,7 @@ asmlinkage int irix_mmap64(struct pt_regs *regs)
1570 1547
1571 if (max_size > file->f_dentry->d_inode->i_size) { 1548 if (max_size > file->f_dentry->d_inode->i_size) {
1572 old_pos = sys_lseek (fd, max_size - 1, 0); 1549 old_pos = sys_lseek (fd, max_size - 1, 0);
1573 sys_write (fd, "", 1); 1550 sys_write (fd, (void __user *) "", 1);
1574 sys_lseek (fd, old_pos, 0); 1551 sys_lseek (fd, old_pos, 0);
1575 } 1552 }
1576 } 1553 }
@@ -1585,7 +1562,6 @@ asmlinkage int irix_mmap64(struct pt_regs *regs)
1585 if (file) 1562 if (file)
1586 fput(file); 1563 fput(file);
1587 1564
1588out:
1589 return error; 1565 return error;
1590} 1566}
1591 1567
@@ -1597,7 +1573,7 @@ asmlinkage int irix_dmi(struct pt_regs *regs)
1597 return -EINVAL; 1573 return -EINVAL;
1598} 1574}
1599 1575
1600asmlinkage int irix_pread(int fd, char *buf, int cnt, int off64, 1576asmlinkage int irix_pread(int fd, char __user *buf, int cnt, int off64,
1601 int off1, int off2) 1577 int off1, int off2)
1602{ 1578{
1603 printk("[%s:%d] Wheee.. irix_pread(%d,%p,%d,%d,%d,%d)\n", 1579 printk("[%s:%d] Wheee.. irix_pread(%d,%p,%d,%d,%d,%d)\n",
@@ -1606,7 +1582,7 @@ asmlinkage int irix_pread(int fd, char *buf, int cnt, int off64,
1606 return -EINVAL; 1582 return -EINVAL;
1607} 1583}
1608 1584
1609asmlinkage int irix_pwrite(int fd, char *buf, int cnt, int off64, 1585asmlinkage int irix_pwrite(int fd, char __user *buf, int cnt, int off64,
1610 int off1, int off2) 1586 int off1, int off2)
1611{ 1587{
1612 printk("[%s:%d] Wheee.. irix_pwrite(%d,%p,%d,%d,%d,%d)\n", 1588 printk("[%s:%d] Wheee.. irix_pwrite(%d,%p,%d,%d,%d,%d)\n",
@@ -1638,7 +1614,7 @@ struct irix_statvfs64 {
1638 u32 f_filler[16]; 1614 u32 f_filler[16];
1639}; 1615};
1640 1616
1641asmlinkage int irix_statvfs64(char *fname, struct irix_statvfs64 *buf) 1617asmlinkage int irix_statvfs64(char __user *fname, struct irix_statvfs64 __user *buf)
1642{ 1618{
1643 struct nameidata nd; 1619 struct nameidata nd;
1644 struct kstatfs kbuf; 1620 struct kstatfs kbuf;
@@ -1650,6 +1626,7 @@ asmlinkage int irix_statvfs64(char *fname, struct irix_statvfs64 *buf)
1650 error = -EFAULT; 1626 error = -EFAULT;
1651 goto out; 1627 goto out;
1652 } 1628 }
1629
1653 error = user_path_walk(fname, &nd); 1630 error = user_path_walk(fname, &nd);
1654 if (error) 1631 if (error)
1655 goto out; 1632 goto out;
@@ -1657,27 +1634,25 @@ asmlinkage int irix_statvfs64(char *fname, struct irix_statvfs64 *buf)
1657 if (error) 1634 if (error)
1658 goto dput_and_out; 1635 goto dput_and_out;
1659 1636
1660 __put_user(kbuf.f_bsize, &buf->f_bsize); 1637 error = __put_user(kbuf.f_bsize, &buf->f_bsize);
1661 __put_user(kbuf.f_frsize, &buf->f_frsize); 1638 error |= __put_user(kbuf.f_frsize, &buf->f_frsize);
1662 __put_user(kbuf.f_blocks, &buf->f_blocks); 1639 error |= __put_user(kbuf.f_blocks, &buf->f_blocks);
1663 __put_user(kbuf.f_bfree, &buf->f_bfree); 1640 error |= __put_user(kbuf.f_bfree, &buf->f_bfree);
1664 __put_user(kbuf.f_bfree, &buf->f_bavail); /* XXX hackety hack... */ 1641 error |= __put_user(kbuf.f_bfree, &buf->f_bavail); /* XXX hackety hack... */
1665 __put_user(kbuf.f_files, &buf->f_files); 1642 error |= __put_user(kbuf.f_files, &buf->f_files);
1666 __put_user(kbuf.f_ffree, &buf->f_ffree); 1643 error |= __put_user(kbuf.f_ffree, &buf->f_ffree);
1667 __put_user(kbuf.f_ffree, &buf->f_favail); /* XXX hackety hack... */ 1644 error |= __put_user(kbuf.f_ffree, &buf->f_favail); /* XXX hackety hack... */
1668#ifdef __MIPSEB__ 1645#ifdef __MIPSEB__
1669 __put_user(kbuf.f_fsid.val[1], &buf->f_fsid); 1646 error |= __put_user(kbuf.f_fsid.val[1], &buf->f_fsid);
1670#else 1647#else
1671 __put_user(kbuf.f_fsid.val[0], &buf->f_fsid); 1648 error |= __put_user(kbuf.f_fsid.val[0], &buf->f_fsid);
1672#endif 1649#endif
1673 for(i = 0; i < 16; i++) 1650 for(i = 0; i < 16; i++)
1674 __put_user(0, &buf->f_basetype[i]); 1651 error |= __put_user(0, &buf->f_basetype[i]);
1675 __put_user(0, &buf->f_flag); 1652 error |= __put_user(0, &buf->f_flag);
1676 __put_user(kbuf.f_namelen, &buf->f_namemax); 1653 error |= __put_user(kbuf.f_namelen, &buf->f_namemax);
1677 for(i = 0; i < 32; i++) 1654 for(i = 0; i < 32; i++)
1678 __put_user(0, &buf->f_fstr[i]); 1655 error |= __put_user(0, &buf->f_fstr[i]);
1679
1680 error = 0;
1681 1656
1682dput_and_out: 1657dput_and_out:
1683 path_release(&nd); 1658 path_release(&nd);
@@ -1685,7 +1660,7 @@ out:
1685 return error; 1660 return error;
1686} 1661}
1687 1662
1688asmlinkage int irix_fstatvfs64(int fd, struct irix_statvfs *buf) 1663asmlinkage int irix_fstatvfs64(int fd, struct irix_statvfs __user *buf)
1689{ 1664{
1690 struct kstatfs kbuf; 1665 struct kstatfs kbuf;
1691 struct file *file; 1666 struct file *file;
@@ -1706,24 +1681,24 @@ asmlinkage int irix_fstatvfs64(int fd, struct irix_statvfs *buf)
1706 if (error) 1681 if (error)
1707 goto out_f; 1682 goto out_f;
1708 1683
1709 __put_user(kbuf.f_bsize, &buf->f_bsize); 1684 error = __put_user(kbuf.f_bsize, &buf->f_bsize);
1710 __put_user(kbuf.f_frsize, &buf->f_frsize); 1685 error |= __put_user(kbuf.f_frsize, &buf->f_frsize);
1711 __put_user(kbuf.f_blocks, &buf->f_blocks); 1686 error |= __put_user(kbuf.f_blocks, &buf->f_blocks);
1712 __put_user(kbuf.f_bfree, &buf->f_bfree); 1687 error |= __put_user(kbuf.f_bfree, &buf->f_bfree);
1713 __put_user(kbuf.f_bfree, &buf->f_bavail); /* XXX hackety hack... */ 1688 error |= __put_user(kbuf.f_bfree, &buf->f_bavail); /* XXX hackety hack... */
1714 __put_user(kbuf.f_files, &buf->f_files); 1689 error |= __put_user(kbuf.f_files, &buf->f_files);
1715 __put_user(kbuf.f_ffree, &buf->f_ffree); 1690 error |= __put_user(kbuf.f_ffree, &buf->f_ffree);
1716 __put_user(kbuf.f_ffree, &buf->f_favail); /* XXX hackety hack... */ 1691 error |= __put_user(kbuf.f_ffree, &buf->f_favail); /* XXX hackety hack... */
1717#ifdef __MIPSEB__ 1692#ifdef __MIPSEB__
1718 __put_user(kbuf.f_fsid.val[1], &buf->f_fsid); 1693 error |= __put_user(kbuf.f_fsid.val[1], &buf->f_fsid);
1719#else 1694#else
1720 __put_user(kbuf.f_fsid.val[0], &buf->f_fsid); 1695 error |= __put_user(kbuf.f_fsid.val[0], &buf->f_fsid);
1721#endif 1696#endif
1722 for(i = 0; i < 16; i++) 1697 for(i = 0; i < 16; i++)
1723 __put_user(0, &buf->f_basetype[i]); 1698 error |= __put_user(0, &buf->f_basetype[i]);
1724 __put_user(0, &buf->f_flag); 1699 error |= __put_user(0, &buf->f_flag);
1725 __put_user(kbuf.f_namelen, &buf->f_namemax); 1700 error |= __put_user(kbuf.f_namelen, &buf->f_namemax);
1726 __clear_user(buf->f_fstr, sizeof(buf->f_fstr[i])); 1701 error |= __clear_user(buf->f_fstr, sizeof(buf->f_fstr[i])) ? -EFAULT : 0;
1727 1702
1728out_f: 1703out_f:
1729 fput(file); 1704 fput(file);
@@ -1731,9 +1706,9 @@ out:
1731 return error; 1706 return error;
1732} 1707}
1733 1708
1734asmlinkage int irix_getmountid(char *fname, unsigned long *midbuf) 1709asmlinkage int irix_getmountid(char __user *fname, unsigned long __user *midbuf)
1735{ 1710{
1736 int err = 0; 1711 int err;
1737 1712
1738 printk("[%s:%d] irix_getmountid(%s, %p)\n", 1713 printk("[%s:%d] irix_getmountid(%s, %p)\n",
1739 current->comm, current->pid, fname, midbuf); 1714 current->comm, current->pid, fname, midbuf);
@@ -1746,7 +1721,7 @@ asmlinkage int irix_getmountid(char *fname, unsigned long *midbuf)
1746 * fsid of the filesystem to try and make the right decision, but 1721 * fsid of the filesystem to try and make the right decision, but
1747 * we don't have this so for now. XXX 1722 * we don't have this so for now. XXX
1748 */ 1723 */
1749 err |= __put_user(0, &midbuf[0]); 1724 err = __put_user(0, &midbuf[0]);
1750 err |= __put_user(0, &midbuf[1]); 1725 err |= __put_user(0, &midbuf[1]);
1751 err |= __put_user(0, &midbuf[2]); 1726 err |= __put_user(0, &midbuf[2]);
1752 err |= __put_user(0, &midbuf[3]); 1727 err |= __put_user(0, &midbuf[3]);
@@ -1773,8 +1748,8 @@ struct irix_dirent32 {
1773}; 1748};
1774 1749
1775struct irix_dirent32_callback { 1750struct irix_dirent32_callback {
1776 struct irix_dirent32 *current_dir; 1751 struct irix_dirent32 __user *current_dir;
1777 struct irix_dirent32 *previous; 1752 struct irix_dirent32 __user *previous;
1778 int count; 1753 int count;
1779 int error; 1754 int error;
1780}; 1755};
@@ -1782,13 +1757,13 @@ struct irix_dirent32_callback {
1782#define NAME_OFFSET32(de) ((int) ((de)->d_name - (char *) (de))) 1757#define NAME_OFFSET32(de) ((int) ((de)->d_name - (char *) (de)))
1783#define ROUND_UP32(x) (((x)+sizeof(u32)-1) & ~(sizeof(u32)-1)) 1758#define ROUND_UP32(x) (((x)+sizeof(u32)-1) & ~(sizeof(u32)-1))
1784 1759
1785static int irix_filldir32(void *__buf, const char *name, int namlen, 1760static int irix_filldir32(void *__buf, const char *name,
1786 loff_t offset, ino_t ino, unsigned int d_type) 1761 int namlen, loff_t offset, ino_t ino, unsigned int d_type)
1787{ 1762{
1788 struct irix_dirent32 *dirent; 1763 struct irix_dirent32 __user *dirent;
1789 struct irix_dirent32_callback *buf = 1764 struct irix_dirent32_callback *buf = __buf;
1790 (struct irix_dirent32_callback *)__buf;
1791 unsigned short reclen = ROUND_UP32(NAME_OFFSET32(dirent) + namlen + 1); 1765 unsigned short reclen = ROUND_UP32(NAME_OFFSET32(dirent) + namlen + 1);
1766 int err = 0;
1792 1767
1793#ifdef DEBUG_GETDENTS 1768#ifdef DEBUG_GETDENTS
1794 printk("\nirix_filldir32[reclen<%d>namlen<%d>count<%d>]", 1769 printk("\nirix_filldir32[reclen<%d>namlen<%d>count<%d>]",
@@ -1799,25 +1774,26 @@ static int irix_filldir32(void *__buf, const char *name, int namlen,
1799 return -EINVAL; 1774 return -EINVAL;
1800 dirent = buf->previous; 1775 dirent = buf->previous;
1801 if (dirent) 1776 if (dirent)
1802 __put_user(offset, &dirent->d_off); 1777 err = __put_user(offset, &dirent->d_off);
1803 dirent = buf->current_dir; 1778 dirent = buf->current_dir;
1804 buf->previous = dirent; 1779 err |= __put_user(dirent, &buf->previous);
1805 __put_user(ino, &dirent->d_ino); 1780 err |= __put_user(ino, &dirent->d_ino);
1806 __put_user(reclen, &dirent->d_reclen); 1781 err |= __put_user(reclen, &dirent->d_reclen);
1807 copy_to_user(dirent->d_name, name, namlen); 1782 err |= copy_to_user((char __user *)dirent->d_name, name, namlen) ? -EFAULT : 0;
1808 __put_user(0, &dirent->d_name[namlen]); 1783 err |= __put_user(0, &dirent->d_name[namlen]);
1809 ((char *) dirent) += reclen; 1784 dirent = (struct irix_dirent32 __user *) ((char __user *) dirent + reclen);
1785
1810 buf->current_dir = dirent; 1786 buf->current_dir = dirent;
1811 buf->count -= reclen; 1787 buf->count -= reclen;
1812 1788
1813 return 0; 1789 return err;
1814} 1790}
1815 1791
1816asmlinkage int irix_ngetdents(unsigned int fd, void * dirent, 1792asmlinkage int irix_ngetdents(unsigned int fd, void __user * dirent,
1817 unsigned int count, int *eob) 1793 unsigned int count, int __user *eob)
1818{ 1794{
1819 struct file *file; 1795 struct file *file;
1820 struct irix_dirent32 *lastdirent; 1796 struct irix_dirent32 __user *lastdirent;
1821 struct irix_dirent32_callback buf; 1797 struct irix_dirent32_callback buf;
1822 int error; 1798 int error;
1823 1799
@@ -1830,7 +1806,7 @@ asmlinkage int irix_ngetdents(unsigned int fd, void * dirent,
1830 if (!file) 1806 if (!file)
1831 goto out; 1807 goto out;
1832 1808
1833 buf.current_dir = (struct irix_dirent32 *) dirent; 1809 buf.current_dir = (struct irix_dirent32 __user *) dirent;
1834 buf.previous = NULL; 1810 buf.previous = NULL;
1835 buf.count = count; 1811 buf.count = count;
1836 buf.error = 0; 1812 buf.error = 0;
@@ -1870,8 +1846,8 @@ struct irix_dirent64 {
1870}; 1846};
1871 1847
1872struct irix_dirent64_callback { 1848struct irix_dirent64_callback {
1873 struct irix_dirent64 *curr; 1849 struct irix_dirent64 __user *curr;
1874 struct irix_dirent64 *previous; 1850 struct irix_dirent64 __user *previous;
1875 int count; 1851 int count;
1876 int error; 1852 int error;
1877}; 1853};
@@ -1879,37 +1855,44 @@ struct irix_dirent64_callback {
1879#define NAME_OFFSET64(de) ((int) ((de)->d_name - (char *) (de))) 1855#define NAME_OFFSET64(de) ((int) ((de)->d_name - (char *) (de)))
1880#define ROUND_UP64(x) (((x)+sizeof(u64)-1) & ~(sizeof(u64)-1)) 1856#define ROUND_UP64(x) (((x)+sizeof(u64)-1) & ~(sizeof(u64)-1))
1881 1857
1882static int irix_filldir64(void * __buf, const char * name, int namlen, 1858static int irix_filldir64(void *__buf, const char *name,
1883 loff_t offset, ino_t ino, unsigned int d_type) 1859 int namlen, loff_t offset, ino_t ino, unsigned int d_type)
1884{ 1860{
1885 struct irix_dirent64 *dirent; 1861 struct irix_dirent64 __user *dirent;
1886 struct irix_dirent64_callback * buf = 1862 struct irix_dirent64_callback * buf = __buf;
1887 (struct irix_dirent64_callback *) __buf;
1888 unsigned short reclen = ROUND_UP64(NAME_OFFSET64(dirent) + namlen + 1); 1863 unsigned short reclen = ROUND_UP64(NAME_OFFSET64(dirent) + namlen + 1);
1864 int err = 0;
1889 1865
1890 buf->error = -EINVAL; /* only used if we fail.. */ 1866 if (!access_ok(VERIFY_WRITE, buf, sizeof(*buf)))
1867 return -EFAULT;
1868
1869 if (__put_user(-EINVAL, &buf->error)) /* only used if we fail.. */
1870 return -EFAULT;
1891 if (reclen > buf->count) 1871 if (reclen > buf->count)
1892 return -EINVAL; 1872 return -EINVAL;
1893 dirent = buf->previous; 1873 dirent = buf->previous;
1894 if (dirent) 1874 if (dirent)
1895 __put_user(offset, &dirent->d_off); 1875 err = __put_user(offset, &dirent->d_off);
1896 dirent = buf->curr; 1876 dirent = buf->curr;
1897 buf->previous = dirent; 1877 buf->previous = dirent;
1898 __put_user(ino, &dirent->d_ino); 1878 err |= __put_user(ino, &dirent->d_ino);
1899 __put_user(reclen, &dirent->d_reclen); 1879 err |= __put_user(reclen, &dirent->d_reclen);
1900 __copy_to_user(dirent->d_name, name, namlen); 1880 err |= __copy_to_user((char __user *)dirent->d_name, name, namlen)
1901 __put_user(0, &dirent->d_name[namlen]); 1881 ? -EFAULT : 0;
1902 ((char *) dirent) += reclen; 1882 err |= __put_user(0, &dirent->d_name[namlen]);
1883
1884 dirent = (struct irix_dirent64 __user *) ((char __user *) dirent + reclen);
1885
1903 buf->curr = dirent; 1886 buf->curr = dirent;
1904 buf->count -= reclen; 1887 buf->count -= reclen;
1905 1888
1906 return 0; 1889 return err;
1907} 1890}
1908 1891
1909asmlinkage int irix_getdents64(int fd, void *dirent, int cnt) 1892asmlinkage int irix_getdents64(int fd, void __user *dirent, int cnt)
1910{ 1893{
1911 struct file *file; 1894 struct file *file;
1912 struct irix_dirent64 *lastdirent; 1895 struct irix_dirent64 __user *lastdirent;
1913 struct irix_dirent64_callback buf; 1896 struct irix_dirent64_callback buf;
1914 int error; 1897 int error;
1915 1898
@@ -1929,7 +1912,7 @@ asmlinkage int irix_getdents64(int fd, void *dirent, int cnt)
1929 if (cnt < (sizeof(struct irix_dirent64) + 255)) 1912 if (cnt < (sizeof(struct irix_dirent64) + 255))
1930 goto out_f; 1913 goto out_f;
1931 1914
1932 buf.curr = (struct irix_dirent64 *) dirent; 1915 buf.curr = (struct irix_dirent64 __user *) dirent;
1933 buf.previous = NULL; 1916 buf.previous = NULL;
1934 buf.count = cnt; 1917 buf.count = cnt;
1935 buf.error = 0; 1918 buf.error = 0;
@@ -1941,7 +1924,8 @@ asmlinkage int irix_getdents64(int fd, void *dirent, int cnt)
1941 error = buf.error; 1924 error = buf.error;
1942 goto out_f; 1925 goto out_f;
1943 } 1926 }
1944 lastdirent->d_off = (u64) file->f_pos; 1927 if (put_user(file->f_pos, &lastdirent->d_off))
1928 return -EFAULT;
1945#ifdef DEBUG_GETDENTS 1929#ifdef DEBUG_GETDENTS
1946 printk("returning %d\n", cnt - buf.count); 1930 printk("returning %d\n", cnt - buf.count);
1947#endif 1931#endif
@@ -1953,10 +1937,10 @@ out:
1953 return error; 1937 return error;
1954} 1938}
1955 1939
1956asmlinkage int irix_ngetdents64(int fd, void *dirent, int cnt, int *eob) 1940asmlinkage int irix_ngetdents64(int fd, void __user *dirent, int cnt, int *eob)
1957{ 1941{
1958 struct file *file; 1942 struct file *file;
1959 struct irix_dirent64 *lastdirent; 1943 struct irix_dirent64 __user *lastdirent;
1960 struct irix_dirent64_callback buf; 1944 struct irix_dirent64_callback buf;
1961 int error; 1945 int error;
1962 1946
@@ -1978,7 +1962,7 @@ asmlinkage int irix_ngetdents64(int fd, void *dirent, int cnt, int *eob)
1978 goto out_f; 1962 goto out_f;
1979 1963
1980 *eob = 0; 1964 *eob = 0;
1981 buf.curr = (struct irix_dirent64 *) dirent; 1965 buf.curr = (struct irix_dirent64 __user *) dirent;
1982 buf.previous = NULL; 1966 buf.previous = NULL;
1983 buf.count = cnt; 1967 buf.count = cnt;
1984 buf.error = 0; 1968 buf.error = 0;
@@ -1990,7 +1974,8 @@ asmlinkage int irix_ngetdents64(int fd, void *dirent, int cnt, int *eob)
1990 error = buf.error; 1974 error = buf.error;
1991 goto out_f; 1975 goto out_f;
1992 } 1976 }
1993 lastdirent->d_off = (u64) file->f_pos; 1977 if (put_user(file->f_pos, &lastdirent->d_off))
1978 return -EFAULT;
1994#ifdef DEBUG_GETDENTS 1979#ifdef DEBUG_GETDENTS
1995 printk("eob=%d returning %d\n", *eob, cnt - buf.count); 1980 printk("eob=%d returning %d\n", *eob, cnt - buf.count);
1996#endif 1981#endif
@@ -2053,14 +2038,14 @@ out:
2053 return retval; 2038 return retval;
2054} 2039}
2055 2040
2056asmlinkage int irix_utssys(char *inbuf, int arg, int type, char *outbuf) 2041asmlinkage int irix_utssys(char __user *inbuf, int arg, int type, char __user *outbuf)
2057{ 2042{
2058 int retval; 2043 int retval;
2059 2044
2060 switch(type) { 2045 switch(type) {
2061 case 0: 2046 case 0:
2062 /* uname() */ 2047 /* uname() */
2063 retval = irix_uname((struct iuname *)inbuf); 2048 retval = irix_uname((struct iuname __user *)inbuf);
2064 goto out; 2049 goto out;
2065 2050
2066 case 2: 2051 case 2:
diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c
index 0dd0df7a3b04..787ed541d442 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/config.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>
@@ -25,6 +26,7 @@
25#include <linux/module.h> 26#include <linux/module.h>
26 27
27#include <asm/bootinfo.h> 28#include <asm/bootinfo.h>
29#include <asm/cache.h>
28#include <asm/compiler.h> 30#include <asm/compiler.h>
29#include <asm/cpu.h> 31#include <asm/cpu.h>
30#include <asm/cpu-features.h> 32#include <asm/cpu-features.h>
@@ -43,10 +45,6 @@
43 45
44#define TICK_SIZE (tick_nsec / 1000) 46#define TICK_SIZE (tick_nsec / 1000)
45 47
46u64 jiffies_64 = INITIAL_JIFFIES;
47
48EXPORT_SYMBOL(jiffies_64);
49
50/* 48/*
51 * forward reference 49 * forward reference
52 */ 50 */
@@ -76,7 +74,7 @@ int (*rtc_set_mmss)(unsigned long);
76static unsigned int sll32_usecs_per_cycle; 74static unsigned int sll32_usecs_per_cycle;
77 75
78/* how many counter cycles in a jiffy */ 76/* how many counter cycles in a jiffy */
79static unsigned long cycles_per_jiffy; 77static unsigned long cycles_per_jiffy __read_mostly;
80 78
81/* Cycle counter value at the previous timer interrupt.. */ 79/* Cycle counter value at the previous timer interrupt.. */
82static unsigned int timerhi, timerlo; 80static unsigned int timerhi, timerlo;
@@ -98,7 +96,10 @@ static unsigned int null_hpt_read(void)
98 return 0; 96 return 0;
99} 97}
100 98
101static void null_hpt_init(unsigned int count) { /* nothing */ } 99static void null_hpt_init(unsigned int count)
100{
101 /* nothing */
102}
102 103
103 104
104/* 105/*
@@ -108,8 +109,10 @@ static void c0_timer_ack(void)
108{ 109{
109 unsigned int count; 110 unsigned int count;
110 111
112#ifndef CONFIG_SOC_PNX8550 /* pnx8550 resets to zero */
111 /* Ack this timer interrupt and set the next one. */ 113 /* Ack this timer interrupt and set the next one. */
112 expirelo += cycles_per_jiffy; 114 expirelo += cycles_per_jiffy;
115#endif
113 write_c0_compare(expirelo); 116 write_c0_compare(expirelo);
114 117
115 /* Check to see if we have missed any timer interrupts. */ 118 /* Check to see if we have missed any timer interrupts. */
@@ -224,7 +227,6 @@ int do_settimeofday(struct timespec *tv)
224 set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec); 227 set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec);
225 228
226 ntp_clear(); 229 ntp_clear();
227
228 write_sequnlock_irq(&xtime_lock); 230 write_sequnlock_irq(&xtime_lock);
229 clock_was_set(); 231 clock_was_set();
230 return 0; 232 return 0;
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index a53b1ed7b386..6f3ff9690686 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -9,7 +9,7 @@
9 * Copyright (C) 1999 Silicon Graphics, Inc. 9 * Copyright (C) 1999 Silicon Graphics, Inc.
10 * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com 10 * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
11 * Copyright (C) 2000, 01 MIPS Technologies, Inc. 11 * Copyright (C) 2000, 01 MIPS Technologies, Inc.
12 * Copyright (C) 2002, 2003, 2004 Maciej W. Rozycki 12 * Copyright (C) 2002, 2003, 2004, 2005 Maciej W. Rozycki
13 */ 13 */
14#include <linux/config.h> 14#include <linux/config.h>
15#include <linux/init.h> 15#include <linux/init.h>
@@ -20,12 +20,16 @@
20#include <linux/smp_lock.h> 20#include <linux/smp_lock.h>
21#include <linux/spinlock.h> 21#include <linux/spinlock.h>
22#include <linux/kallsyms.h> 22#include <linux/kallsyms.h>
23#include <linux/bootmem.h>
23 24
24#include <asm/bootinfo.h> 25#include <asm/bootinfo.h>
25#include <asm/branch.h> 26#include <asm/branch.h>
26#include <asm/break.h> 27#include <asm/break.h>
27#include <asm/cpu.h> 28#include <asm/cpu.h>
29#include <asm/dsp.h>
28#include <asm/fpu.h> 30#include <asm/fpu.h>
31#include <asm/mipsregs.h>
32#include <asm/mipsmtregs.h>
29#include <asm/module.h> 33#include <asm/module.h>
30#include <asm/pgtable.h> 34#include <asm/pgtable.h>
31#include <asm/ptrace.h> 35#include <asm/ptrace.h>
@@ -54,14 +58,19 @@ extern asmlinkage void handle_tr(void);
54extern asmlinkage void handle_fpe(void); 58extern asmlinkage void handle_fpe(void);
55extern asmlinkage void handle_mdmx(void); 59extern asmlinkage void handle_mdmx(void);
56extern asmlinkage void handle_watch(void); 60extern asmlinkage void handle_watch(void);
61extern asmlinkage void handle_mt(void);
62extern asmlinkage void handle_dsp(void);
57extern asmlinkage void handle_mcheck(void); 63extern asmlinkage void handle_mcheck(void);
58extern asmlinkage void handle_reserved(void); 64extern asmlinkage void handle_reserved(void);
59 65
60extern int fpu_emulator_cop1Handler(int xcptno, struct pt_regs *xcp, 66extern int fpu_emulator_cop1Handler(struct pt_regs *xcp,
61 struct mips_fpu_soft_struct *ctx); 67 struct mips_fpu_soft_struct *ctx);
62 68
63void (*board_be_init)(void); 69void (*board_be_init)(void);
64int (*board_be_handler)(struct pt_regs *regs, int is_fixup); 70int (*board_be_handler)(struct pt_regs *regs, int is_fixup);
71void (*board_nmi_handler_setup)(void);
72void (*board_ejtag_handler_setup)(void);
73void (*board_bind_eic_interrupt)(int irq, int regset);
65 74
66/* 75/*
67 * These constant is for searching for possible module text segments. 76 * These constant is for searching for possible module text segments.
@@ -201,32 +210,47 @@ void show_regs(struct pt_regs *regs)
201 210
202 printk("Status: %08x ", (uint32_t) regs->cp0_status); 211 printk("Status: %08x ", (uint32_t) regs->cp0_status);
203 212
204 if (regs->cp0_status & ST0_KX) 213 if (current_cpu_data.isa_level == MIPS_CPU_ISA_I) {
205 printk("KX "); 214 if (regs->cp0_status & ST0_KUO)
206 if (regs->cp0_status & ST0_SX) 215 printk("KUo ");
207 printk("SX "); 216 if (regs->cp0_status & ST0_IEO)
208 if (regs->cp0_status & ST0_UX) 217 printk("IEo ");
209 printk("UX "); 218 if (regs->cp0_status & ST0_KUP)
210 switch (regs->cp0_status & ST0_KSU) { 219 printk("KUp ");
211 case KSU_USER: 220 if (regs->cp0_status & ST0_IEP)
212 printk("USER "); 221 printk("IEp ");
213 break; 222 if (regs->cp0_status & ST0_KUC)
214 case KSU_SUPERVISOR: 223 printk("KUc ");
215 printk("SUPERVISOR "); 224 if (regs->cp0_status & ST0_IEC)
216 break; 225 printk("IEc ");
217 case KSU_KERNEL: 226 } else {
218 printk("KERNEL "); 227 if (regs->cp0_status & ST0_KX)
219 break; 228 printk("KX ");
220 default: 229 if (regs->cp0_status & ST0_SX)
221 printk("BAD_MODE "); 230 printk("SX ");
222 break; 231 if (regs->cp0_status & ST0_UX)
232 printk("UX ");
233 switch (regs->cp0_status & ST0_KSU) {
234 case KSU_USER:
235 printk("USER ");
236 break;
237 case KSU_SUPERVISOR:
238 printk("SUPERVISOR ");
239 break;
240 case KSU_KERNEL:
241 printk("KERNEL ");
242 break;
243 default:
244 printk("BAD_MODE ");
245 break;
246 }
247 if (regs->cp0_status & ST0_ERL)
248 printk("ERL ");
249 if (regs->cp0_status & ST0_EXL)
250 printk("EXL ");
251 if (regs->cp0_status & ST0_IE)
252 printk("IE ");
223 } 253 }
224 if (regs->cp0_status & ST0_ERL)
225 printk("ERL ");
226 if (regs->cp0_status & ST0_EXL)
227 printk("EXL ");
228 if (regs->cp0_status & ST0_IE)
229 printk("IE ");
230 printk("\n"); 254 printk("\n");
231 255
232 printk("Cause : %08x\n", cause); 256 printk("Cause : %08x\n", cause);
@@ -252,29 +276,18 @@ void show_registers(struct pt_regs *regs)
252 276
253static DEFINE_SPINLOCK(die_lock); 277static DEFINE_SPINLOCK(die_lock);
254 278
255NORET_TYPE void __die(const char * str, struct pt_regs * regs, 279NORET_TYPE void ATTRIB_NORET die(const char * str, struct pt_regs * regs)
256 const char * file, const char * func, unsigned long line)
257{ 280{
258 static int die_counter; 281 static int die_counter;
259 282
260 console_verbose(); 283 console_verbose();
261 spin_lock_irq(&die_lock); 284 spin_lock_irq(&die_lock);
262 printk("%s", str); 285 printk("%s[#%d]:\n", str, ++die_counter);
263 if (file && func)
264 printk(" in %s:%s, line %ld", file, func, line);
265 printk("[#%d]:\n", ++die_counter);
266 show_registers(regs); 286 show_registers(regs);
267 spin_unlock_irq(&die_lock); 287 spin_unlock_irq(&die_lock);
268 do_exit(SIGSEGV); 288 do_exit(SIGSEGV);
269} 289}
270 290
271void __die_if_kernel(const char * str, struct pt_regs * regs,
272 const char * file, const char * func, unsigned long line)
273{
274 if (!user_mode(regs))
275 __die(str, regs, file, func, line);
276}
277
278extern const struct exception_table_entry __start___dbe_table[]; 291extern const struct exception_table_entry __start___dbe_table[];
279extern const struct exception_table_entry __stop___dbe_table[]; 292extern const struct exception_table_entry __stop___dbe_table[];
280 293
@@ -339,9 +352,9 @@ asmlinkage void do_be(struct pt_regs *regs)
339 352
340static inline int get_insn_opcode(struct pt_regs *regs, unsigned int *opcode) 353static inline int get_insn_opcode(struct pt_regs *regs, unsigned int *opcode)
341{ 354{
342 unsigned int *epc; 355 unsigned int __user *epc;
343 356
344 epc = (unsigned int *) regs->cp0_epc + 357 epc = (unsigned int __user *) regs->cp0_epc +
345 ((regs->cp0_cause & CAUSEF_BD) != 0); 358 ((regs->cp0_cause & CAUSEF_BD) != 0);
346 if (!get_user(*opcode, epc)) 359 if (!get_user(*opcode, epc))
347 return 0; 360 return 0;
@@ -360,6 +373,10 @@ static inline int get_insn_opcode(struct pt_regs *regs, unsigned int *opcode)
360#define OFFSET 0x0000ffff 373#define OFFSET 0x0000ffff
361#define LL 0xc0000000 374#define LL 0xc0000000
362#define SC 0xe0000000 375#define SC 0xe0000000
376#define SPEC3 0x7c000000
377#define RD 0x0000f800
378#define FUNC 0x0000003f
379#define RDHWR 0x0000003b
363 380
364/* 381/*
365 * The ll_bit is cleared by r*_switch.S 382 * The ll_bit is cleared by r*_switch.S
@@ -371,7 +388,7 @@ static struct task_struct *ll_task = NULL;
371 388
372static inline void simulate_ll(struct pt_regs *regs, unsigned int opcode) 389static inline void simulate_ll(struct pt_regs *regs, unsigned int opcode)
373{ 390{
374 unsigned long value, *vaddr; 391 unsigned long value, __user *vaddr;
375 long offset; 392 long offset;
376 int signal = 0; 393 int signal = 0;
377 394
@@ -385,7 +402,8 @@ static inline void simulate_ll(struct pt_regs *regs, unsigned int opcode)
385 offset <<= 16; 402 offset <<= 16;
386 offset >>= 16; 403 offset >>= 16;
387 404
388 vaddr = (unsigned long *)((long)(regs->regs[(opcode & BASE) >> 21]) + offset); 405 vaddr = (unsigned long __user *)
406 ((unsigned long)(regs->regs[(opcode & BASE) >> 21]) + offset);
389 407
390 if ((unsigned long)vaddr & 3) { 408 if ((unsigned long)vaddr & 3) {
391 signal = SIGBUS; 409 signal = SIGBUS;
@@ -407,9 +425,10 @@ static inline void simulate_ll(struct pt_regs *regs, unsigned int opcode)
407 425
408 preempt_enable(); 426 preempt_enable();
409 427
428 compute_return_epc(regs);
429
410 regs->regs[(opcode & RT) >> 16] = value; 430 regs->regs[(opcode & RT) >> 16] = value;
411 431
412 compute_return_epc(regs);
413 return; 432 return;
414 433
415sig: 434sig:
@@ -418,7 +437,8 @@ sig:
418 437
419static inline void simulate_sc(struct pt_regs *regs, unsigned int opcode) 438static inline void simulate_sc(struct pt_regs *regs, unsigned int opcode)
420{ 439{
421 unsigned long *vaddr, reg; 440 unsigned long __user *vaddr;
441 unsigned long reg;
422 long offset; 442 long offset;
423 int signal = 0; 443 int signal = 0;
424 444
@@ -432,7 +452,8 @@ static inline void simulate_sc(struct pt_regs *regs, unsigned int opcode)
432 offset <<= 16; 452 offset <<= 16;
433 offset >>= 16; 453 offset >>= 16;
434 454
435 vaddr = (unsigned long *)((long)(regs->regs[(opcode & BASE) >> 21]) + offset); 455 vaddr = (unsigned long __user *)
456 ((unsigned long)(regs->regs[(opcode & BASE) >> 21]) + offset);
436 reg = (opcode & RT) >> 16; 457 reg = (opcode & RT) >> 16;
437 458
438 if ((unsigned long)vaddr & 3) { 459 if ((unsigned long)vaddr & 3) {
@@ -443,9 +464,9 @@ static inline void simulate_sc(struct pt_regs *regs, unsigned int opcode)
443 preempt_disable(); 464 preempt_disable();
444 465
445 if (ll_bit == 0 || ll_task != current) { 466 if (ll_bit == 0 || ll_task != current) {
467 compute_return_epc(regs);
446 regs->regs[reg] = 0; 468 regs->regs[reg] = 0;
447 preempt_enable(); 469 preempt_enable();
448 compute_return_epc(regs);
449 return; 470 return;
450 } 471 }
451 472
@@ -456,9 +477,9 @@ static inline void simulate_sc(struct pt_regs *regs, unsigned int opcode)
456 goto sig; 477 goto sig;
457 } 478 }
458 479
480 compute_return_epc(regs);
459 regs->regs[reg] = 1; 481 regs->regs[reg] = 1;
460 482
461 compute_return_epc(regs);
462 return; 483 return;
463 484
464sig: 485sig:
@@ -491,6 +512,37 @@ static inline int simulate_llsc(struct pt_regs *regs)
491 return -EFAULT; /* Strange things going on ... */ 512 return -EFAULT; /* Strange things going on ... */
492} 513}
493 514
515/*
516 * Simulate trapping 'rdhwr' instructions to provide user accessible
517 * registers not implemented in hardware. The only current use of this
518 * is the thread area pointer.
519 */
520static inline int simulate_rdhwr(struct pt_regs *regs)
521{
522 struct thread_info *ti = current->thread_info;
523 unsigned int opcode;
524
525 if (unlikely(get_insn_opcode(regs, &opcode)))
526 return -EFAULT;
527
528 if (unlikely(compute_return_epc(regs)))
529 return -EFAULT;
530
531 if ((opcode & OPCODE) == SPEC3 && (opcode & FUNC) == RDHWR) {
532 int rd = (opcode & RD) >> 11;
533 int rt = (opcode & RT) >> 16;
534 switch (rd) {
535 case 29:
536 regs->regs[rt] = ti->tp_value;
537 break;
538 default:
539 return -EFAULT;
540 }
541 }
542
543 return 0;
544}
545
494asmlinkage void do_ov(struct pt_regs *regs) 546asmlinkage void do_ov(struct pt_regs *regs)
495{ 547{
496 siginfo_t info; 548 siginfo_t info;
@@ -498,7 +550,7 @@ asmlinkage void do_ov(struct pt_regs *regs)
498 info.si_code = FPE_INTOVF; 550 info.si_code = FPE_INTOVF;
499 info.si_signo = SIGFPE; 551 info.si_signo = SIGFPE;
500 info.si_errno = 0; 552 info.si_errno = 0;
501 info.si_addr = (void *)regs->cp0_epc; 553 info.si_addr = (void __user *) regs->cp0_epc;
502 force_sig_info(SIGFPE, &info, current); 554 force_sig_info(SIGFPE, &info, current);
503} 555}
504 556
@@ -512,6 +564,14 @@ asmlinkage void do_fpe(struct pt_regs *regs, unsigned long fcr31)
512 564
513 preempt_disable(); 565 preempt_disable();
514 566
567#ifdef CONFIG_PREEMPT
568 if (!is_fpu_owner()) {
569 /* We might lose fpu before disabling preempt... */
570 own_fpu();
571 BUG_ON(!used_math());
572 restore_fp(current);
573 }
574#endif
515 /* 575 /*
516 * Unimplemented operation exception. If we've got the full 576 * Unimplemented operation exception. If we've got the full
517 * software emulator on-board, let's use it... 577 * software emulator on-board, let's use it...
@@ -523,11 +583,18 @@ asmlinkage void do_fpe(struct pt_regs *regs, unsigned long fcr31)
523 * a bit extreme for what should be an infrequent event. 583 * a bit extreme for what should be an infrequent event.
524 */ 584 */
525 save_fp(current); 585 save_fp(current);
586 /* Ensure 'resume' not overwrite saved fp context again. */
587 lose_fpu();
588
589 preempt_enable();
526 590
527 /* Run the emulator */ 591 /* Run the emulator */
528 sig = fpu_emulator_cop1Handler (0, regs, 592 sig = fpu_emulator_cop1Handler (regs,
529 &current->thread.fpu.soft); 593 &current->thread.fpu.soft);
530 594
595 preempt_disable();
596
597 own_fpu(); /* Using the FPU again. */
531 /* 598 /*
532 * We can't allow the emulated instruction to leave any of 599 * We can't allow the emulated instruction to leave any of
533 * the cause bit set in $fcr31. 600 * the cause bit set in $fcr31.
@@ -584,7 +651,7 @@ asmlinkage void do_bp(struct pt_regs *regs)
584 info.si_code = FPE_INTOVF; 651 info.si_code = FPE_INTOVF;
585 info.si_signo = SIGFPE; 652 info.si_signo = SIGFPE;
586 info.si_errno = 0; 653 info.si_errno = 0;
587 info.si_addr = (void *)regs->cp0_epc; 654 info.si_addr = (void __user *) regs->cp0_epc;
588 force_sig_info(SIGFPE, &info, current); 655 force_sig_info(SIGFPE, &info, current);
589 break; 656 break;
590 default: 657 default:
@@ -621,7 +688,7 @@ asmlinkage void do_tr(struct pt_regs *regs)
621 info.si_code = FPE_INTOVF; 688 info.si_code = FPE_INTOVF;
622 info.si_signo = SIGFPE; 689 info.si_signo = SIGFPE;
623 info.si_errno = 0; 690 info.si_errno = 0;
624 info.si_addr = (void *)regs->cp0_epc; 691 info.si_addr = (void __user *) regs->cp0_epc;
625 force_sig_info(SIGFPE, &info, current); 692 force_sig_info(SIGFPE, &info, current);
626 break; 693 break;
627 default: 694 default:
@@ -637,6 +704,9 @@ asmlinkage void do_ri(struct pt_regs *regs)
637 if (!simulate_llsc(regs)) 704 if (!simulate_llsc(regs))
638 return; 705 return;
639 706
707 if (!simulate_rdhwr(regs))
708 return;
709
640 force_sig(SIGILL, current); 710 force_sig(SIGILL, current);
641} 711}
642 712
@@ -650,11 +720,13 @@ asmlinkage void do_cpu(struct pt_regs *regs)
650 720
651 switch (cpid) { 721 switch (cpid) {
652 case 0: 722 case 0:
653 if (cpu_has_llsc) 723 if (!cpu_has_llsc)
654 break; 724 if (!simulate_llsc(regs))
725 return;
655 726
656 if (!simulate_llsc(regs)) 727 if (!simulate_rdhwr(regs))
657 return; 728 return;
729
658 break; 730 break;
659 731
660 case 1: 732 case 1:
@@ -668,15 +740,15 @@ asmlinkage void do_cpu(struct pt_regs *regs)
668 set_used_math(); 740 set_used_math();
669 } 741 }
670 742
743 preempt_enable();
744
671 if (!cpu_has_fpu) { 745 if (!cpu_has_fpu) {
672 int sig = fpu_emulator_cop1Handler(0, regs, 746 int sig = fpu_emulator_cop1Handler(regs,
673 &current->thread.fpu.soft); 747 &current->thread.fpu.soft);
674 if (sig) 748 if (sig)
675 force_sig(sig, current); 749 force_sig(sig, current);
676 } 750 }
677 751
678 preempt_enable();
679
680 return; 752 return;
681 753
682 case 2: 754 case 2:
@@ -716,6 +788,22 @@ asmlinkage void do_mcheck(struct pt_regs *regs)
716 (regs->cp0_status & ST0_TS) ? "" : "not "); 788 (regs->cp0_status & ST0_TS) ? "" : "not ");
717} 789}
718 790
791asmlinkage void do_mt(struct pt_regs *regs)
792{
793 die_if_kernel("MIPS MT Thread exception in kernel", regs);
794
795 force_sig(SIGILL, current);
796}
797
798
799asmlinkage void do_dsp(struct pt_regs *regs)
800{
801 if (cpu_has_dsp)
802 panic("Unexpected DSP exception\n");
803
804 force_sig(SIGILL, current);
805}
806
719asmlinkage void do_reserved(struct pt_regs *regs) 807asmlinkage void do_reserved(struct pt_regs *regs)
720{ 808{
721 /* 809 /*
@@ -728,6 +816,12 @@ asmlinkage void do_reserved(struct pt_regs *regs)
728 (regs->cp0_cause & 0x7f) >> 2); 816 (regs->cp0_cause & 0x7f) >> 2);
729} 817}
730 818
819asmlinkage void do_default_vi(struct pt_regs *regs)
820{
821 show_regs(regs);
822 panic("Caught unexpected vectored interrupt.");
823}
824
731/* 825/*
732 * Some MIPS CPUs can enable/disable for cache parity detection, but do 826 * Some MIPS CPUs can enable/disable for cache parity detection, but do
733 * it different ways. 827 * it different ways.
@@ -736,16 +830,12 @@ static inline void parity_protection_init(void)
736{ 830{
737 switch (current_cpu_data.cputype) { 831 switch (current_cpu_data.cputype) {
738 case CPU_24K: 832 case CPU_24K:
739 /* 24K cache parity not currently implemented in FPGA */
740 printk(KERN_INFO "Disable cache parity protection for "
741 "MIPS 24K CPU.\n");
742 write_c0_ecc(read_c0_ecc() & ~0x80000000);
743 break;
744 case CPU_5KC: 833 case CPU_5KC:
745 /* Set the PE bit (bit 31) in the c0_ecc register. */ 834 write_c0_ecc(0x80000000);
746 printk(KERN_INFO "Enable cache parity protection for " 835 back_to_back_c0_hazard();
747 "MIPS 5KC/24K CPUs.\n"); 836 /* Set the PE bit (bit 31) in the c0_errctl register. */
748 write_c0_ecc(read_c0_ecc() | 0x80000000); 837 printk(KERN_INFO "Cache parity protection %sabled\n",
838 (read_c0_ecc() & 0x80000000) ? "en" : "dis");
749 break; 839 break;
750 case CPU_20KC: 840 case CPU_20KC:
751 case CPU_25KF: 841 case CPU_25KF:
@@ -783,7 +873,7 @@ asmlinkage void cache_parity_error(void)
783 reg_val & (1<<22) ? "E0 " : ""); 873 reg_val & (1<<22) ? "E0 " : "");
784 printk("IDX: 0x%08x\n", reg_val & ((1<<22)-1)); 874 printk("IDX: 0x%08x\n", reg_val & ((1<<22)-1));
785 875
786#if defined(CONFIG_CPU_MIPS32) || defined (CONFIG_CPU_MIPS64) 876#if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64)
787 if (reg_val & (1<<22)) 877 if (reg_val & (1<<22))
788 printk("DErrAddr0: 0x%0*lx\n", field, read_c0_derraddr0()); 878 printk("DErrAddr0: 0x%0*lx\n", field, read_c0_derraddr0());
789 879
@@ -840,7 +930,11 @@ void nmi_exception_handler(struct pt_regs *regs)
840 while(1) ; 930 while(1) ;
841} 931}
842 932
933#define VECTORSPACING 0x100 /* for EI/VI mode */
934
935unsigned long ebase;
843unsigned long exception_handlers[32]; 936unsigned long exception_handlers[32];
937unsigned long vi_handlers[64];
844 938
845/* 939/*
846 * As a side effect of the way this is implemented we're limited 940 * As a side effect of the way this is implemented we're limited
@@ -854,13 +948,156 @@ void *set_except_vector(int n, void *addr)
854 948
855 exception_handlers[n] = handler; 949 exception_handlers[n] = handler;
856 if (n == 0 && cpu_has_divec) { 950 if (n == 0 && cpu_has_divec) {
857 *(volatile u32 *)(CAC_BASE + 0x200) = 0x08000000 | 951 *(volatile u32 *)(ebase + 0x200) = 0x08000000 |
858 (0x03ffffff & (handler >> 2)); 952 (0x03ffffff & (handler >> 2));
859 flush_icache_range(CAC_BASE + 0x200, CAC_BASE + 0x204); 953 flush_icache_range(ebase + 0x200, ebase + 0x204);
860 } 954 }
861 return (void *)old_handler; 955 return (void *)old_handler;
862} 956}
863 957
958#ifdef CONFIG_CPU_MIPSR2
959/*
960 * Shadow register allocation
961 * FIXME: SMP...
962 */
963
964/* MIPSR2 shadow register sets */
965struct shadow_registers {
966 spinlock_t sr_lock; /* */
967 int sr_supported; /* Number of shadow register sets supported */
968 int sr_allocated; /* Bitmap of allocated shadow registers */
969} shadow_registers;
970
971void mips_srs_init(void)
972{
973#ifdef CONFIG_CPU_MIPSR2_SRS
974 shadow_registers.sr_supported = ((read_c0_srsctl() >> 26) & 0x0f) + 1;
975 printk ("%d MIPSR2 register sets available\n", shadow_registers.sr_supported);
976#else
977 shadow_registers.sr_supported = 1;
978#endif
979 shadow_registers.sr_allocated = 1; /* Set 0 used by kernel */
980 spin_lock_init(&shadow_registers.sr_lock);
981}
982
983int mips_srs_max(void)
984{
985 return shadow_registers.sr_supported;
986}
987
988int mips_srs_alloc (void)
989{
990 struct shadow_registers *sr = &shadow_registers;
991 unsigned long flags;
992 int set;
993
994 spin_lock_irqsave(&sr->sr_lock, flags);
995
996 for (set = 0; set < sr->sr_supported; set++) {
997 if ((sr->sr_allocated & (1 << set)) == 0) {
998 sr->sr_allocated |= 1 << set;
999 spin_unlock_irqrestore(&sr->sr_lock, flags);
1000 return set;
1001 }
1002 }
1003
1004 /* None available */
1005 spin_unlock_irqrestore(&sr->sr_lock, flags);
1006 return -1;
1007}
1008
1009void mips_srs_free (int set)
1010{
1011 struct shadow_registers *sr = &shadow_registers;
1012 unsigned long flags;
1013
1014 spin_lock_irqsave(&sr->sr_lock, flags);
1015 sr->sr_allocated &= ~(1 << set);
1016 spin_unlock_irqrestore(&sr->sr_lock, flags);
1017}
1018
1019void *set_vi_srs_handler (int n, void *addr, int srs)
1020{
1021 unsigned long handler;
1022 unsigned long old_handler = vi_handlers[n];
1023 u32 *w;
1024 unsigned char *b;
1025
1026 if (!cpu_has_veic && !cpu_has_vint)
1027 BUG();
1028
1029 if (addr == NULL) {
1030 handler = (unsigned long) do_default_vi;
1031 srs = 0;
1032 }
1033 else
1034 handler = (unsigned long) addr;
1035 vi_handlers[n] = (unsigned long) addr;
1036
1037 b = (unsigned char *)(ebase + 0x200 + n*VECTORSPACING);
1038
1039 if (srs >= mips_srs_max())
1040 panic("Shadow register set %d not supported", srs);
1041
1042 if (cpu_has_veic) {
1043 if (board_bind_eic_interrupt)
1044 board_bind_eic_interrupt (n, srs);
1045 }
1046 else if (cpu_has_vint) {
1047 /* SRSMap is only defined if shadow sets are implemented */
1048 if (mips_srs_max() > 1)
1049 change_c0_srsmap (0xf << n*4, srs << n*4);
1050 }
1051
1052 if (srs == 0) {
1053 /*
1054 * If no shadow set is selected then use the default handler
1055 * that does normal register saving and a standard interrupt exit
1056 */
1057
1058 extern char except_vec_vi, except_vec_vi_lui;
1059 extern char except_vec_vi_ori, except_vec_vi_end;
1060 const int handler_len = &except_vec_vi_end - &except_vec_vi;
1061 const int lui_offset = &except_vec_vi_lui - &except_vec_vi;
1062 const int ori_offset = &except_vec_vi_ori - &except_vec_vi;
1063
1064 if (handler_len > VECTORSPACING) {
1065 /*
1066 * Sigh... panicing won't help as the console
1067 * is probably not configured :(
1068 */
1069 panic ("VECTORSPACING too small");
1070 }
1071
1072 memcpy (b, &except_vec_vi, handler_len);
1073 w = (u32 *)(b + lui_offset);
1074 *w = (*w & 0xffff0000) | (((u32)handler >> 16) & 0xffff);
1075 w = (u32 *)(b + ori_offset);
1076 *w = (*w & 0xffff0000) | ((u32)handler & 0xffff);
1077 flush_icache_range((unsigned long)b, (unsigned long)(b+handler_len));
1078 }
1079 else {
1080 /*
1081 * In other cases jump directly to the interrupt handler
1082 *
1083 * It is the handlers responsibility to save registers if required
1084 * (eg hi/lo) and return from the exception using "eret"
1085 */
1086 w = (u32 *)b;
1087 *w++ = 0x08000000 | (((u32)handler >> 2) & 0x03fffff); /* j handler */
1088 *w = 0;
1089 flush_icache_range((unsigned long)b, (unsigned long)(b+8));
1090 }
1091
1092 return (void *)old_handler;
1093}
1094
1095void *set_vi_handler (int n, void *addr)
1096{
1097 return set_vi_srs_handler (n, addr, 0);
1098}
1099#endif
1100
864/* 1101/*
865 * This is used by native signal handling 1102 * This is used by native signal handling
866 */ 1103 */
@@ -912,6 +1149,7 @@ static inline void signal32_init(void)
912 1149
913extern void cpu_cache_init(void); 1150extern void cpu_cache_init(void);
914extern void tlb_init(void); 1151extern void tlb_init(void);
1152extern void flush_tlb_handlers(void);
915 1153
916void __init per_cpu_trap_init(void) 1154void __init per_cpu_trap_init(void)
917{ 1155{
@@ -929,15 +1167,32 @@ void __init per_cpu_trap_init(void)
929#endif 1167#endif
930 if (current_cpu_data.isa_level == MIPS_CPU_ISA_IV) 1168 if (current_cpu_data.isa_level == MIPS_CPU_ISA_IV)
931 status_set |= ST0_XX; 1169 status_set |= ST0_XX;
932 change_c0_status(ST0_CU|ST0_FR|ST0_BEV|ST0_TS|ST0_KX|ST0_SX|ST0_UX, 1170 change_c0_status(ST0_CU|ST0_MX|ST0_FR|ST0_BEV|ST0_TS|ST0_KX|ST0_SX|ST0_UX,
933 status_set); 1171 status_set);
934 1172
1173 if (cpu_has_dsp)
1174 set_c0_status(ST0_MX);
1175
1176#ifdef CONFIG_CPU_MIPSR2
1177 write_c0_hwrena (0x0000000f); /* Allow rdhwr to all registers */
1178#endif
1179
935 /* 1180 /*
936 * Some MIPS CPUs have a dedicated interrupt vector which reduces the 1181 * Interrupt handling.
937 * interrupt processing overhead. Use it where available.
938 */ 1182 */
939 if (cpu_has_divec) 1183 if (cpu_has_veic || cpu_has_vint) {
940 set_c0_cause(CAUSEF_IV); 1184 write_c0_ebase (ebase);
1185 /* Setting vector spacing enables EI/VI mode */
1186 change_c0_intctl (0x3e0, VECTORSPACING);
1187 }
1188 if (cpu_has_divec) {
1189 if (cpu_has_mipsmt) {
1190 unsigned int vpflags = dvpe();
1191 set_c0_cause(CAUSEF_IV);
1192 evpe(vpflags);
1193 } else
1194 set_c0_cause(CAUSEF_IV);
1195 }
941 1196
942 cpu_data[cpu].asid_cache = ASID_FIRST_VERSION; 1197 cpu_data[cpu].asid_cache = ASID_FIRST_VERSION;
943 TLBMISS_HANDLER_SETUP(); 1198 TLBMISS_HANDLER_SETUP();
@@ -951,13 +1206,41 @@ void __init per_cpu_trap_init(void)
951 tlb_init(); 1206 tlb_init();
952} 1207}
953 1208
1209/* Install CPU exception handler */
1210void __init set_handler (unsigned long offset, void *addr, unsigned long size)
1211{
1212 memcpy((void *)(ebase + offset), addr, size);
1213 flush_icache_range(ebase + offset, ebase + offset + size);
1214}
1215
1216/* Install uncached CPU exception handler */
1217void __init set_uncached_handler (unsigned long offset, void *addr, unsigned long size)
1218{
1219#ifdef CONFIG_32BIT
1220 unsigned long uncached_ebase = KSEG1ADDR(ebase);
1221#endif
1222#ifdef CONFIG_64BIT
1223 unsigned long uncached_ebase = TO_UNCAC(ebase);
1224#endif
1225
1226 memcpy((void *)(uncached_ebase + offset), addr, size);
1227}
1228
954void __init trap_init(void) 1229void __init trap_init(void)
955{ 1230{
956 extern char except_vec3_generic, except_vec3_r4000; 1231 extern char except_vec3_generic, except_vec3_r4000;
957 extern char except_vec_ejtag_debug;
958 extern char except_vec4; 1232 extern char except_vec4;
959 unsigned long i; 1233 unsigned long i;
960 1234
1235 if (cpu_has_veic || cpu_has_vint)
1236 ebase = (unsigned long) alloc_bootmem_low_pages (0x200 + VECTORSPACING*64);
1237 else
1238 ebase = CAC_BASE;
1239
1240#ifdef CONFIG_CPU_MIPSR2
1241 mips_srs_init();
1242#endif
1243
961 per_cpu_trap_init(); 1244 per_cpu_trap_init();
962 1245
963 /* 1246 /*
@@ -965,7 +1248,7 @@ void __init trap_init(void)
965 * This will be overriden later as suitable for a particular 1248 * This will be overriden later as suitable for a particular
966 * configuration. 1249 * configuration.
967 */ 1250 */
968 memcpy((void *)(CAC_BASE + 0x180), &except_vec3_generic, 0x80); 1251 set_handler(0x180, &except_vec3_generic, 0x80);
969 1252
970 /* 1253 /*
971 * Setup default vectors 1254 * Setup default vectors
@@ -977,8 +1260,8 @@ void __init trap_init(void)
977 * Copy the EJTAG debug exception vector handler code to it's final 1260 * Copy the EJTAG debug exception vector handler code to it's final
978 * destination. 1261 * destination.
979 */ 1262 */
980 if (cpu_has_ejtag) 1263 if (cpu_has_ejtag && board_ejtag_handler_setup)
981 memcpy((void *)(CAC_BASE + 0x300), &except_vec_ejtag_debug, 0x80); 1264 board_ejtag_handler_setup ();
982 1265
983 /* 1266 /*
984 * Only some CPUs have the watch exceptions. 1267 * Only some CPUs have the watch exceptions.
@@ -987,11 +1270,15 @@ void __init trap_init(void)
987 set_except_vector(23, handle_watch); 1270 set_except_vector(23, handle_watch);
988 1271
989 /* 1272 /*
990 * Some MIPS CPUs have a dedicated interrupt vector which reduces the 1273 * Initialise interrupt handlers
991 * interrupt processing overhead. Use it where available.
992 */ 1274 */
993 if (cpu_has_divec) 1275 if (cpu_has_veic || cpu_has_vint) {
994 memcpy((void *)(CAC_BASE + 0x200), &except_vec4, 0x8); 1276 int nvec = cpu_has_veic ? 64 : 8;
1277 for (i = 0; i < nvec; i++)
1278 set_vi_handler (i, NULL);
1279 }
1280 else if (cpu_has_divec)
1281 set_handler(0x200, &except_vec4, 0x8);
995 1282
996 /* 1283 /*
997 * Some CPUs can enable/disable for cache parity detection, but does 1284 * Some CPUs can enable/disable for cache parity detection, but does
@@ -1023,21 +1310,6 @@ void __init trap_init(void)
1023 set_except_vector(11, handle_cpu); 1310 set_except_vector(11, handle_cpu);
1024 set_except_vector(12, handle_ov); 1311 set_except_vector(12, handle_ov);
1025 set_except_vector(13, handle_tr); 1312 set_except_vector(13, handle_tr);
1026 set_except_vector(22, handle_mdmx);
1027
1028 if (cpu_has_fpu && !cpu_has_nofpuex)
1029 set_except_vector(15, handle_fpe);
1030
1031 if (cpu_has_mcheck)
1032 set_except_vector(24, handle_mcheck);
1033
1034 if (cpu_has_vce)
1035 /* Special exception: R4[04]00 uses also the divec space. */
1036 memcpy((void *)(CAC_BASE + 0x180), &except_vec3_r4000, 0x100);
1037 else if (cpu_has_4kex)
1038 memcpy((void *)(CAC_BASE + 0x180), &except_vec3_generic, 0x80);
1039 else
1040 memcpy((void *)(CAC_BASE + 0x080), &except_vec3_generic, 0x80);
1041 1313
1042 if (current_cpu_data.cputype == CPU_R6000 || 1314 if (current_cpu_data.cputype == CPU_R6000 ||
1043 current_cpu_data.cputype == CPU_R6000A) { 1315 current_cpu_data.cputype == CPU_R6000A) {
@@ -1053,10 +1325,37 @@ void __init trap_init(void)
1053 //set_except_vector(15, handle_ndc); 1325 //set_except_vector(15, handle_ndc);
1054 } 1326 }
1055 1327
1328
1329 if (board_nmi_handler_setup)
1330 board_nmi_handler_setup();
1331
1332 if (cpu_has_fpu && !cpu_has_nofpuex)
1333 set_except_vector(15, handle_fpe);
1334
1335 set_except_vector(22, handle_mdmx);
1336
1337 if (cpu_has_mcheck)
1338 set_except_vector(24, handle_mcheck);
1339
1340 if (cpu_has_mipsmt)
1341 set_except_vector(25, handle_mt);
1342
1343 if (cpu_has_dsp)
1344 set_except_vector(26, handle_dsp);
1345
1346 if (cpu_has_vce)
1347 /* Special exception: R4[04]00 uses also the divec space. */
1348 memcpy((void *)(CAC_BASE + 0x180), &except_vec3_r4000, 0x100);
1349 else if (cpu_has_4kex)
1350 memcpy((void *)(CAC_BASE + 0x180), &except_vec3_generic, 0x80);
1351 else
1352 memcpy((void *)(CAC_BASE + 0x080), &except_vec3_generic, 0x80);
1353
1056 signal_init(); 1354 signal_init();
1057#ifdef CONFIG_MIPS32_COMPAT 1355#ifdef CONFIG_MIPS32_COMPAT
1058 signal32_init(); 1356 signal32_init();
1059#endif 1357#endif
1060 1358
1061 flush_icache_range(CAC_BASE, CAC_BASE + 0x400); 1359 flush_icache_range(ebase, ebase + 0x400);
1360 flush_tlb_handlers();
1062} 1361}
diff --git a/arch/mips/kernel/unaligned.c b/arch/mips/kernel/unaligned.c
index 36c5212e0928..5b5a3736cbbc 100644
--- a/arch/mips/kernel/unaligned.c
+++ b/arch/mips/kernel/unaligned.c
@@ -94,7 +94,7 @@ unsigned long unaligned_instructions;
94#endif 94#endif
95 95
96static inline int emulate_load_store_insn(struct pt_regs *regs, 96static inline int emulate_load_store_insn(struct pt_regs *regs,
97 void *addr, unsigned long pc, 97 void __user *addr, unsigned int __user *pc,
98 unsigned long **regptr, unsigned long *newvalue) 98 unsigned long **regptr, unsigned long *newvalue)
99{ 99{
100 union mips_instruction insn; 100 union mips_instruction insn;
@@ -107,7 +107,7 @@ static inline int emulate_load_store_insn(struct pt_regs *regs,
107 /* 107 /*
108 * This load never faults. 108 * This load never faults.
109 */ 109 */
110 __get_user(insn.word, (unsigned int *)pc); 110 __get_user(insn.word, pc);
111 111
112 switch (insn.i_format.opcode) { 112 switch (insn.i_format.opcode) {
113 /* 113 /*
@@ -494,8 +494,8 @@ asmlinkage void do_ade(struct pt_regs *regs)
494{ 494{
495 unsigned long *regptr, newval; 495 unsigned long *regptr, newval;
496 extern int do_dsemulret(struct pt_regs *); 496 extern int do_dsemulret(struct pt_regs *);
497 unsigned int __user *pc;
497 mm_segment_t seg; 498 mm_segment_t seg;
498 unsigned long pc;
499 499
500 /* 500 /*
501 * Address errors may be deliberately induced by the FPU emulator to 501 * Address errors may be deliberately induced by the FPU emulator to
@@ -515,7 +515,7 @@ asmlinkage void do_ade(struct pt_regs *regs)
515 if ((regs->cp0_badvaddr == regs->cp0_epc) || (regs->cp0_epc & 0x1)) 515 if ((regs->cp0_badvaddr == regs->cp0_epc) || (regs->cp0_epc & 0x1))
516 goto sigbus; 516 goto sigbus;
517 517
518 pc = exception_epc(regs); 518 pc = (unsigned int __user *) exception_epc(regs);
519 if ((current->thread.mflags & MF_FIXADE) == 0) 519 if ((current->thread.mflags & MF_FIXADE) == 0)
520 goto sigbus; 520 goto sigbus;
521 521
@@ -526,7 +526,7 @@ asmlinkage void do_ade(struct pt_regs *regs)
526 seg = get_fs(); 526 seg = get_fs();
527 if (!user_mode(regs)) 527 if (!user_mode(regs))
528 set_fs(KERNEL_DS); 528 set_fs(KERNEL_DS);
529 if (!emulate_load_store_insn(regs, (void *)regs->cp0_badvaddr, pc, 529 if (!emulate_load_store_insn(regs, (void __user *)regs->cp0_badvaddr, pc,
530 &regptr, &newval)) { 530 &regptr, &newval)) {
531 compute_return_epc(regs); 531 compute_return_epc(regs);
532 /* 532 /*
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index 482ac310c937..25cc856d8e7e 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -54,13 +54,6 @@ SECTIONS
54 54
55 *(.data) 55 *(.data)
56 56
57 /* Align the initial ramdisk image (INITRD) on page boundaries. */
58 . = ALIGN(4096);
59 __rd_start = .;
60 *(.initrd)
61 . = ALIGN(4096);
62 __rd_end = .;
63
64 CONSTRUCTORS 57 CONSTRUCTORS
65 } 58 }
66 _gp = . + 0x8000; 59 _gp = . + 0x8000;
@@ -96,12 +89,6 @@ SECTIONS
96 .init.setup : { *(.init.setup) } 89 .init.setup : { *(.init.setup) }
97 __setup_end = .; 90 __setup_end = .;
98 91
99 .early_initcall.init : {
100 __earlyinitcall_start = .;
101 *(.initcall.early1.init)
102 }
103 __earlyinitcall_end = .;
104
105 __initcall_start = .; 92 __initcall_start = .;
106 .initcall.init : { 93 .initcall.init : {
107 *(.initcall1.init) 94 *(.initcall1.init)
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c
new file mode 100644
index 000000000000..97fefcc9dbe7
--- /dev/null
+++ b/arch/mips/kernel/vpe.c
@@ -0,0 +1,1296 @@
1/*
2 * Copyright (C) 2004, 2005 MIPS Technologies, Inc. All rights reserved.
3 *
4 * This program is free software; you can distribute it and/or modify it
5 * under the terms of the GNU General Public License (Version 2) as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
16 *
17 */
18
19/*
20 * VPE support module
21 *
22 * Provides support for loading a MIPS SP program on VPE1.
23 * The SP enviroment is rather simple, no tlb's. It needs to be relocatable
24 * (or partially linked). You should initialise your stack in the startup
25 * code. This loader looks for the symbol __start and sets up
26 * execution to resume from there. The MIPS SDE kit contains suitable examples.
27 *
28 * To load and run, simply cat a SP 'program file' to /dev/vpe1.
29 * i.e cat spapp >/dev/vpe1.
30 *
31 * You'll need to have the following device files.
32 * mknod /dev/vpe0 c 63 0
33 * mknod /dev/vpe1 c 63 1
34 */
35#include <linux/config.h>
36#include <linux/kernel.h>
37#include <linux/module.h>
38#include <linux/fs.h>
39#include <linux/init.h>
40#include <asm/uaccess.h>
41#include <linux/slab.h>
42#include <linux/list.h>
43#include <linux/vmalloc.h>
44#include <linux/elf.h>
45#include <linux/seq_file.h>
46#include <linux/syscalls.h>
47#include <linux/moduleloader.h>
48#include <linux/interrupt.h>
49#include <linux/poll.h>
50#include <linux/bootmem.h>
51#include <asm/mipsregs.h>
52#include <asm/mipsmtregs.h>
53#include <asm/cacheflush.h>
54#include <asm/atomic.h>
55#include <asm/cpu.h>
56#include <asm/processor.h>
57#include <asm/system.h>
58
59typedef void *vpe_handle;
60
61// defined here because the kernel module loader doesn't have
62// anything to do with it.
63#define SHN_MIPS_SCOMMON 0xff03
64
65#ifndef ARCH_SHF_SMALL
66#define ARCH_SHF_SMALL 0
67#endif
68
69/* If this is set, the section belongs in the init part of the module */
70#define INIT_OFFSET_MASK (1UL << (BITS_PER_LONG-1))
71
72// temp number,
73#define VPE_MAJOR 63
74
75static char module_name[] = "vpe";
76static int major = 0;
77
78/* grab the likely amount of memory we will need. */
79#ifdef CONFIG_MIPS_VPE_LOADER_TOM
80#define P_SIZE (2 * 1024 * 1024)
81#else
82/* add an overhead to the max kmalloc size for non-striped symbols/etc */
83#define P_SIZE (256 * 1024)
84#endif
85
86#define MAX_VPES 16
87
88enum vpe_state {
89 VPE_STATE_UNUSED = 0,
90 VPE_STATE_INUSE,
91 VPE_STATE_RUNNING
92};
93
94enum tc_state {
95 TC_STATE_UNUSED = 0,
96 TC_STATE_INUSE,
97 TC_STATE_RUNNING,
98 TC_STATE_DYNAMIC
99};
100
101struct vpe;
102typedef struct tc {
103 enum tc_state state;
104 int index;
105
106 /* parent VPE */
107 struct vpe *pvpe;
108
109 /* The list of TC's with this VPE */
110 struct list_head tc;
111
112 /* The global list of tc's */
113 struct list_head list;
114} tc_t;
115
116typedef struct vpe {
117 enum vpe_state state;
118
119 /* (device) minor associated with this vpe */
120 int minor;
121
122 /* elfloader stuff */
123 void *load_addr;
124 u32 len;
125 char *pbuffer;
126 u32 plen;
127
128 unsigned long __start;
129
130 /* tc's associated with this vpe */
131 struct list_head tc;
132
133 /* The list of vpe's */
134 struct list_head list;
135
136 /* shared symbol address */
137 void *shared_ptr;
138} vpe_t;
139
140struct vpecontrol_ {
141 /* Virtual processing elements */
142 struct list_head vpe_list;
143
144 /* Thread contexts */
145 struct list_head tc_list;
146} vpecontrol;
147
148static void release_progmem(void *ptr);
149static void dump_vpe(vpe_t * v);
150extern void save_gp_address(unsigned int secbase, unsigned int rel);
151
152/* get the vpe associated with this minor */
153struct vpe *get_vpe(int minor)
154{
155 struct vpe *v;
156
157 list_for_each_entry(v, &vpecontrol.vpe_list, list) {
158 if (v->minor == minor)
159 return v;
160 }
161
162 printk(KERN_DEBUG "VPE: get_vpe minor %d not found\n", minor);
163 return NULL;
164}
165
166/* get the vpe associated with this minor */
167struct tc *get_tc(int index)
168{
169 struct tc *t;
170
171 list_for_each_entry(t, &vpecontrol.tc_list, list) {
172 if (t->index == index)
173 return t;
174 }
175
176 printk(KERN_DEBUG "VPE: get_tc index %d not found\n", index);
177
178 return NULL;
179}
180
181struct tc *get_tc_unused(void)
182{
183 struct tc *t;
184
185 list_for_each_entry(t, &vpecontrol.tc_list, list) {
186 if (t->state == TC_STATE_UNUSED)
187 return t;
188 }
189
190 printk(KERN_DEBUG "VPE: All TC's are in use\n");
191
192 return NULL;
193}
194
195/* allocate a vpe and associate it with this minor (or index) */
196struct vpe *alloc_vpe(int minor)
197{
198 struct vpe *v;
199
200 if ((v = kmalloc(sizeof(struct vpe), GFP_KERNEL)) == NULL) {
201 printk(KERN_WARNING "VPE: alloc_vpe no mem\n");
202 return NULL;
203 }
204
205 memset(v, 0, sizeof(struct vpe));
206
207 INIT_LIST_HEAD(&v->tc);
208 list_add_tail(&v->list, &vpecontrol.vpe_list);
209
210 v->minor = minor;
211 return v;
212}
213
214/* allocate a tc. At startup only tc0 is running, all other can be halted. */
215struct tc *alloc_tc(int index)
216{
217 struct tc *t;
218
219 if ((t = kmalloc(sizeof(struct tc), GFP_KERNEL)) == NULL) {
220 printk(KERN_WARNING "VPE: alloc_tc no mem\n");
221 return NULL;
222 }
223
224 memset(t, 0, sizeof(struct tc));
225
226 INIT_LIST_HEAD(&t->tc);
227 list_add_tail(&t->list, &vpecontrol.tc_list);
228
229 t->index = index;
230
231 return t;
232}
233
234/* clean up and free everything */
235void release_vpe(struct vpe *v)
236{
237 list_del(&v->list);
238 if (v->load_addr)
239 release_progmem(v);
240 kfree(v);
241}
242
243void dump_mtregs(void)
244{
245 unsigned long val;
246
247 val = read_c0_config3();
248 printk("config3 0x%lx MT %ld\n", val,
249 (val & CONFIG3_MT) >> CONFIG3_MT_SHIFT);
250
251 val = read_c0_mvpconf0();
252 printk("mvpconf0 0x%lx, PVPE %ld PTC %ld M %ld\n", val,
253 (val & MVPCONF0_PVPE) >> MVPCONF0_PVPE_SHIFT,
254 val & MVPCONF0_PTC, (val & MVPCONF0_M) >> MVPCONF0_M_SHIFT);
255
256 val = read_c0_mvpcontrol();
257 printk("MVPControl 0x%lx, STLB %ld VPC %ld EVP %ld\n", val,
258 (val & MVPCONTROL_STLB) >> MVPCONTROL_STLB_SHIFT,
259 (val & MVPCONTROL_VPC) >> MVPCONTROL_VPC_SHIFT,
260 (val & MVPCONTROL_EVP));
261
262 val = read_c0_vpeconf0();
263 printk("VPEConf0 0x%lx MVP %ld\n", val,
264 (val & VPECONF0_MVP) >> VPECONF0_MVP_SHIFT);
265}
266
267/* Find some VPE program space */
268static void *alloc_progmem(u32 len)
269{
270#ifdef CONFIG_MIPS_VPE_LOADER_TOM
271 /* this means you must tell linux to use less memory than you physically have */
272 return (void *)((max_pfn * PAGE_SIZE) + KSEG0);
273#else
274 // simple grab some mem for now
275 return kmalloc(len, GFP_KERNEL);
276#endif
277}
278
279static void release_progmem(void *ptr)
280{
281#ifndef CONFIG_MIPS_VPE_LOADER_TOM
282 kfree(ptr);
283#endif
284}
285
286/* Update size with this section: return offset. */
287static long get_offset(unsigned long *size, Elf_Shdr * sechdr)
288{
289 long ret;
290
291 ret = ALIGN(*size, sechdr->sh_addralign ? : 1);
292 *size = ret + sechdr->sh_size;
293 return ret;
294}
295
296/* Lay out the SHF_ALLOC sections in a way not dissimilar to how ld
297 might -- code, read-only data, read-write data, small data. Tally
298 sizes, and place the offsets into sh_entsize fields: high bit means it
299 belongs in init. */
300static void layout_sections(struct module *mod, const Elf_Ehdr * hdr,
301 Elf_Shdr * sechdrs, const char *secstrings)
302{
303 static unsigned long const masks[][2] = {
304 /* NOTE: all executable code must be the first section
305 * in this array; otherwise modify the text_size
306 * finder in the two loops below */
307 {SHF_EXECINSTR | SHF_ALLOC, ARCH_SHF_SMALL},
308 {SHF_ALLOC, SHF_WRITE | ARCH_SHF_SMALL},
309 {SHF_WRITE | SHF_ALLOC, ARCH_SHF_SMALL},
310 {ARCH_SHF_SMALL | SHF_ALLOC, 0}
311 };
312 unsigned int m, i;
313
314 for (i = 0; i < hdr->e_shnum; i++)
315 sechdrs[i].sh_entsize = ~0UL;
316
317 for (m = 0; m < ARRAY_SIZE(masks); ++m) {
318 for (i = 0; i < hdr->e_shnum; ++i) {
319 Elf_Shdr *s = &sechdrs[i];
320
321 // || strncmp(secstrings + s->sh_name, ".init", 5) == 0)
322 if ((s->sh_flags & masks[m][0]) != masks[m][0]
323 || (s->sh_flags & masks[m][1])
324 || s->sh_entsize != ~0UL)
325 continue;
326 s->sh_entsize = get_offset(&mod->core_size, s);
327 }
328
329 if (m == 0)
330 mod->core_text_size = mod->core_size;
331
332 }
333}
334
335
336/* from module-elf32.c, but subverted a little */
337
338struct mips_hi16 {
339 struct mips_hi16 *next;
340 Elf32_Addr *addr;
341 Elf32_Addr value;
342};
343
344static struct mips_hi16 *mips_hi16_list;
345static unsigned int gp_offs, gp_addr;
346
347static int apply_r_mips_none(struct module *me, uint32_t *location,
348 Elf32_Addr v)
349{
350 return 0;
351}
352
353static int apply_r_mips_gprel16(struct module *me, uint32_t *location,
354 Elf32_Addr v)
355{
356 int rel;
357
358 if( !(*location & 0xffff) ) {
359 rel = (int)v - gp_addr;
360 }
361 else {
362 /* .sbss + gp(relative) + offset */
363 /* kludge! */
364 rel = (int)(short)((int)v + gp_offs +
365 (int)(short)(*location & 0xffff) - gp_addr);
366 }
367
368 if( (rel > 32768) || (rel < -32768) ) {
369 printk(KERN_ERR
370 "apply_r_mips_gprel16: relative address out of range 0x%x %d\n",
371 rel, rel);
372 return -ENOEXEC;
373 }
374
375 *location = (*location & 0xffff0000) | (rel & 0xffff);
376
377 return 0;
378}
379
380static int apply_r_mips_pc16(struct module *me, uint32_t *location,
381 Elf32_Addr v)
382{
383 int rel;
384 rel = (((unsigned int)v - (unsigned int)location));
385 rel >>= 2; // because the offset is in _instructions_ not bytes.
386 rel -= 1; // and one instruction less due to the branch delay slot.
387
388 if( (rel > 32768) || (rel < -32768) ) {
389 printk(KERN_ERR
390 "apply_r_mips_pc16: relative address out of range 0x%x\n", rel);
391 return -ENOEXEC;
392 }
393
394 *location = (*location & 0xffff0000) | (rel & 0xffff);
395
396 return 0;
397}
398
399static int apply_r_mips_32(struct module *me, uint32_t *location,
400 Elf32_Addr v)
401{
402 *location += v;
403
404 return 0;
405}
406
407static int apply_r_mips_26(struct module *me, uint32_t *location,
408 Elf32_Addr v)
409{
410 if (v % 4) {
411 printk(KERN_ERR "module %s: dangerous relocation mod4\n", me->name);
412 return -ENOEXEC;
413 }
414
415/* Not desperately convinced this is a good check of an overflow condition
416 anyway. But it gets in the way of handling undefined weak symbols which
417 we want to set to zero.
418 if ((v & 0xf0000000) != (((unsigned long)location + 4) & 0xf0000000)) {
419 printk(KERN_ERR
420 "module %s: relocation overflow\n",
421 me->name);
422 return -ENOEXEC;
423 }
424*/
425
426 *location = (*location & ~0x03ffffff) |
427 ((*location + (v >> 2)) & 0x03ffffff);
428 return 0;
429}
430
431static int apply_r_mips_hi16(struct module *me, uint32_t *location,
432 Elf32_Addr v)
433{
434 struct mips_hi16 *n;
435
436 /*
437 * We cannot relocate this one now because we don't know the value of
438 * the carry we need to add. Save the information, and let LO16 do the
439 * actual relocation.
440 */
441 n = kmalloc(sizeof *n, GFP_KERNEL);
442 if (!n)
443 return -ENOMEM;
444
445 n->addr = location;
446 n->value = v;
447 n->next = mips_hi16_list;
448 mips_hi16_list = n;
449
450 return 0;
451}
452
453static int apply_r_mips_lo16(struct module *me, uint32_t *location,
454 Elf32_Addr v)
455{
456 unsigned long insnlo = *location;
457 Elf32_Addr val, vallo;
458
459 /* Sign extend the addend we extract from the lo insn. */
460 vallo = ((insnlo & 0xffff) ^ 0x8000) - 0x8000;
461
462 if (mips_hi16_list != NULL) {
463 struct mips_hi16 *l;
464
465 l = mips_hi16_list;
466 while (l != NULL) {
467 struct mips_hi16 *next;
468 unsigned long insn;
469
470 /*
471 * The value for the HI16 had best be the same.
472 */
473 if (v != l->value) {
474 printk("%d != %d\n", v, l->value);
475 goto out_danger;
476 }
477
478
479 /*
480 * Do the HI16 relocation. Note that we actually don't
481 * need to know anything about the LO16 itself, except
482 * where to find the low 16 bits of the addend needed
483 * by the LO16.
484 */
485 insn = *l->addr;
486 val = ((insn & 0xffff) << 16) + vallo;
487 val += v;
488
489 /*
490 * Account for the sign extension that will happen in
491 * the low bits.
492 */
493 val = ((val >> 16) + ((val & 0x8000) != 0)) & 0xffff;
494
495 insn = (insn & ~0xffff) | val;
496 *l->addr = insn;
497
498 next = l->next;
499 kfree(l);
500 l = next;
501 }
502
503 mips_hi16_list = NULL;
504 }
505
506 /*
507 * Ok, we're done with the HI16 relocs. Now deal with the LO16.
508 */
509 val = v + vallo;
510 insnlo = (insnlo & ~0xffff) | (val & 0xffff);
511 *location = insnlo;
512
513 return 0;
514
515out_danger:
516 printk(KERN_ERR "module %s: dangerous " "relocation\n", me->name);
517
518 return -ENOEXEC;
519}
520
521static int (*reloc_handlers[]) (struct module *me, uint32_t *location,
522 Elf32_Addr v) = {
523 [R_MIPS_NONE] = apply_r_mips_none,
524 [R_MIPS_32] = apply_r_mips_32,
525 [R_MIPS_26] = apply_r_mips_26,
526 [R_MIPS_HI16] = apply_r_mips_hi16,
527 [R_MIPS_LO16] = apply_r_mips_lo16,
528 [R_MIPS_GPREL16] = apply_r_mips_gprel16,
529 [R_MIPS_PC16] = apply_r_mips_pc16
530};
531
532
533int apply_relocations(Elf32_Shdr *sechdrs,
534 const char *strtab,
535 unsigned int symindex,
536 unsigned int relsec,
537 struct module *me)
538{
539 Elf32_Rel *rel = (void *) sechdrs[relsec].sh_addr;
540 Elf32_Sym *sym;
541 uint32_t *location;
542 unsigned int i;
543 Elf32_Addr v;
544 int res;
545
546 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {
547 Elf32_Word r_info = rel[i].r_info;
548
549 /* This is where to make the change */
550 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr
551 + rel[i].r_offset;
552 /* This is the symbol it is referring to */
553 sym = (Elf32_Sym *)sechdrs[symindex].sh_addr
554 + ELF32_R_SYM(r_info);
555
556 if (!sym->st_value) {
557 printk(KERN_DEBUG "%s: undefined weak symbol %s\n",
558 me->name, strtab + sym->st_name);
559 /* just print the warning, dont barf */
560 }
561
562 v = sym->st_value;
563
564 res = reloc_handlers[ELF32_R_TYPE(r_info)](me, location, v);
565 if( res ) {
566 printk(KERN_DEBUG
567 "relocation error 0x%x sym refer <%s> value 0x%x "
568 "type 0x%x r_info 0x%x\n",
569 (unsigned int)location, strtab + sym->st_name, v,
570 r_info, ELF32_R_TYPE(r_info));
571 }
572
573 if (res)
574 return res;
575 }
576
577 return 0;
578}
579
580void save_gp_address(unsigned int secbase, unsigned int rel)
581{
582 gp_addr = secbase + rel;
583 gp_offs = gp_addr - (secbase & 0xffff0000);
584}
585/* end module-elf32.c */
586
587
588
589/* Change all symbols so that sh_value encodes the pointer directly. */
590static int simplify_symbols(Elf_Shdr * sechdrs,
591 unsigned int symindex,
592 const char *strtab,
593 const char *secstrings,
594 unsigned int nsecs, struct module *mod)
595{
596 Elf_Sym *sym = (void *)sechdrs[symindex].sh_addr;
597 unsigned long secbase, bssbase = 0;
598 unsigned int i, n = sechdrs[symindex].sh_size / sizeof(Elf_Sym);
599 int ret = 0, size;
600
601 /* find the .bss section for COMMON symbols */
602 for (i = 0; i < nsecs; i++) {
603 if (strncmp(secstrings + sechdrs[i].sh_name, ".bss", 4) == 0)
604 bssbase = sechdrs[i].sh_addr;
605 }
606
607 for (i = 1; i < n; i++) {
608 switch (sym[i].st_shndx) {
609 case SHN_COMMON:
610 /* Allocate space for the symbol in the .bss section. st_value is currently size.
611 We want it to have the address of the symbol. */
612
613 size = sym[i].st_value;
614 sym[i].st_value = bssbase;
615
616 bssbase += size;
617 break;
618
619 case SHN_ABS:
620 /* Don't need to do anything */
621 break;
622
623 case SHN_UNDEF:
624 /* ret = -ENOENT; */
625 break;
626
627 case SHN_MIPS_SCOMMON:
628
629 printk(KERN_DEBUG
630 "simplify_symbols: ignoring SHN_MIPS_SCOMMON symbol <%s> st_shndx %d\n",
631 strtab + sym[i].st_name, sym[i].st_shndx);
632
633 // .sbss section
634 break;
635
636 default:
637 secbase = sechdrs[sym[i].st_shndx].sh_addr;
638
639 if (strncmp(strtab + sym[i].st_name, "_gp", 3) == 0) {
640 save_gp_address(secbase, sym[i].st_value);
641 }
642
643 sym[i].st_value += secbase;
644 break;
645 }
646
647 }
648
649 return ret;
650}
651
652#ifdef DEBUG_ELFLOADER
653static void dump_elfsymbols(Elf_Shdr * sechdrs, unsigned int symindex,
654 const char *strtab, struct module *mod)
655{
656 Elf_Sym *sym = (void *)sechdrs[symindex].sh_addr;
657 unsigned int i, n = sechdrs[symindex].sh_size / sizeof(Elf_Sym);
658
659 printk(KERN_DEBUG "dump_elfsymbols: n %d\n", n);
660 for (i = 1; i < n; i++) {
661 printk(KERN_DEBUG " i %d name <%s> 0x%x\n", i,
662 strtab + sym[i].st_name, sym[i].st_value);
663 }
664}
665#endif
666
667static void dump_tc(struct tc *t)
668{
669 printk(KERN_WARNING "VPE: TC index %d TCStatus 0x%lx halt 0x%lx\n",
670 t->index, read_tc_c0_tcstatus(), read_tc_c0_tchalt());
671 printk(KERN_WARNING "VPE: tcrestart 0x%lx\n", read_tc_c0_tcrestart());
672}
673
674static void dump_tclist(void)
675{
676 struct tc *t;
677
678 list_for_each_entry(t, &vpecontrol.tc_list, list) {
679 dump_tc(t);
680 }
681}
682
683/* We are prepared so configure and start the VPE... */
684int vpe_run(vpe_t * v)
685{
686 unsigned long val;
687 struct tc *t;
688
689 /* check we are the Master VPE */
690 val = read_c0_vpeconf0();
691 if (!(val & VPECONF0_MVP)) {
692 printk(KERN_WARNING
693 "VPE: only Master VPE's are allowed to configure MT\n");
694 return -1;
695 }
696
697 /* disable MT (using dvpe) */
698 dvpe();
699
700 /* Put MVPE's into 'configuration state' */
701 set_c0_mvpcontrol(MVPCONTROL_VPC);
702
703 if (!list_empty(&v->tc)) {
704 if ((t = list_entry(v->tc.next, struct tc, tc)) == NULL) {
705 printk(KERN_WARNING "VPE: TC %d is already in use.\n",
706 t->index);
707 return -ENOEXEC;
708 }
709 } else {
710 printk(KERN_WARNING "VPE: No TC's associated with VPE %d\n",
711 v->minor);
712 return -ENOEXEC;
713 }
714
715 settc(t->index);
716
717 val = read_vpe_c0_vpeconf0();
718
719 /* should check it is halted, and not activated */
720 if ((read_tc_c0_tcstatus() & TCSTATUS_A) || !(read_tc_c0_tchalt() & TCHALT_H)) {
721 printk(KERN_WARNING "VPE: TC %d is already doing something!\n",
722 t->index);
723
724 dump_tclist();
725 return -ENOEXEC;
726 }
727
728 /* Write the address we want it to start running from in the TCPC register. */
729 write_tc_c0_tcrestart((unsigned long)v->__start);
730
731 /* write the sivc_info address to tccontext */
732 write_tc_c0_tccontext((unsigned long)0);
733
734 /* Set up the XTC bit in vpeconf0 to point at our tc */
735 write_vpe_c0_vpeconf0(read_vpe_c0_vpeconf0() | (t->index << VPECONF0_XTC_SHIFT));
736
737 /* mark the TC as activated, not interrupt exempt and not dynamically allocatable */
738 val = read_tc_c0_tcstatus();
739 val = (val & ~(TCSTATUS_DA | TCSTATUS_IXMT)) | TCSTATUS_A;
740 write_tc_c0_tcstatus(val);
741
742 write_tc_c0_tchalt(read_tc_c0_tchalt() & ~TCHALT_H);
743
744 /* set up VPE1 */
745 write_vpe_c0_vpecontrol(read_vpe_c0_vpecontrol() & ~VPECONTROL_TE); // no multiple TC's
746 write_vpe_c0_vpeconf0(read_vpe_c0_vpeconf0() | VPECONF0_VPA); // enable this VPE
747
748 /*
749 * The sde-kit passes 'memsize' to __start in $a3, so set something
750 * here...
751 * Or set $a3 (register 7) to zero and define DFLT_STACK_SIZE and
752 * DFLT_HEAP_SIZE when you compile your program
753 */
754
755 mttgpr(7, 0);
756
757 /* set config to be the same as vpe0, particularly kseg0 coherency alg */
758 write_vpe_c0_config(read_c0_config());
759
760 /* clear out any left overs from a previous program */
761 write_vpe_c0_cause(0);
762
763 /* take system out of configuration state */
764 clear_c0_mvpcontrol(MVPCONTROL_VPC);
765
766 /* clear interrupts enabled IE, ERL, EXL, and KSU from c0 status */
767 write_vpe_c0_status(read_vpe_c0_status() & ~(ST0_ERL | ST0_KSU | ST0_IE | ST0_EXL));
768
769 /* set it running */
770 evpe(EVPE_ENABLE);
771
772 return 0;
773}
774
775static unsigned long find_vpe_symbols(vpe_t * v, Elf_Shdr * sechdrs,
776 unsigned int symindex, const char *strtab,
777 struct module *mod)
778{
779 Elf_Sym *sym = (void *)sechdrs[symindex].sh_addr;
780 unsigned int i, n = sechdrs[symindex].sh_size / sizeof(Elf_Sym);
781
782 for (i = 1; i < n; i++) {
783 if (strcmp(strtab + sym[i].st_name, "__start") == 0) {
784 v->__start = sym[i].st_value;
785 }
786
787 if (strcmp(strtab + sym[i].st_name, "vpe_shared") == 0) {
788 v->shared_ptr = (void *)sym[i].st_value;
789 }
790 }
791
792 return 0;
793}
794
795/* Allocates a VPE with some program code space(the load address), copies the contents
796 of the program (p)buffer performing relocatations/etc, free's it when finished.
797*/
798int vpe_elfload(vpe_t * v)
799{
800 Elf_Ehdr *hdr;
801 Elf_Shdr *sechdrs;
802 long err = 0;
803 char *secstrings, *strtab = NULL;
804 unsigned int len, i, symindex = 0, strindex = 0;
805
806 struct module mod; // so we can re-use the relocations code
807
808 memset(&mod, 0, sizeof(struct module));
809 strcpy(mod.name, "VPE dummy prog module");
810
811 hdr = (Elf_Ehdr *) v->pbuffer;
812 len = v->plen;
813
814 /* Sanity checks against insmoding binaries or wrong arch,
815 weird elf version */
816 if (memcmp(hdr->e_ident, ELFMAG, 4) != 0
817 || hdr->e_type != ET_REL || !elf_check_arch(hdr)
818 || hdr->e_shentsize != sizeof(*sechdrs)) {
819 printk(KERN_WARNING
820 "VPE program, wrong arch or weird elf version\n");
821
822 return -ENOEXEC;
823 }
824
825 if (len < hdr->e_shoff + hdr->e_shnum * sizeof(Elf_Shdr)) {
826 printk(KERN_ERR "VPE program length %u truncated\n", len);
827 return -ENOEXEC;
828 }
829
830 /* Convenience variables */
831 sechdrs = (void *)hdr + hdr->e_shoff;
832 secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
833 sechdrs[0].sh_addr = 0;
834
835 /* And these should exist, but gcc whinges if we don't init them */
836 symindex = strindex = 0;
837
838 for (i = 1; i < hdr->e_shnum; i++) {
839
840 if (sechdrs[i].sh_type != SHT_NOBITS
841 && len < sechdrs[i].sh_offset + sechdrs[i].sh_size) {
842 printk(KERN_ERR "VPE program length %u truncated\n",
843 len);
844 return -ENOEXEC;
845 }
846
847 /* Mark all sections sh_addr with their address in the
848 temporary image. */
849 sechdrs[i].sh_addr = (size_t) hdr + sechdrs[i].sh_offset;
850
851 /* Internal symbols and strings. */
852 if (sechdrs[i].sh_type == SHT_SYMTAB) {
853 symindex = i;
854 strindex = sechdrs[i].sh_link;
855 strtab = (char *)hdr + sechdrs[strindex].sh_offset;
856 }
857 }
858
859 layout_sections(&mod, hdr, sechdrs, secstrings);
860
861 v->load_addr = alloc_progmem(mod.core_size);
862 memset(v->load_addr, 0, mod.core_size);
863
864 printk("VPE elf_loader: loading to %p\n", v->load_addr);
865
866 for (i = 0; i < hdr->e_shnum; i++) {
867 void *dest;
868
869 if (!(sechdrs[i].sh_flags & SHF_ALLOC))
870 continue;
871
872 dest = v->load_addr + sechdrs[i].sh_entsize;
873
874 if (sechdrs[i].sh_type != SHT_NOBITS)
875 memcpy(dest, (void *)sechdrs[i].sh_addr,
876 sechdrs[i].sh_size);
877 /* Update sh_addr to point to copy in image. */
878 sechdrs[i].sh_addr = (unsigned long)dest;
879 }
880
881 /* Fix up syms, so that st_value is a pointer to location. */
882 err =
883 simplify_symbols(sechdrs, symindex, strtab, secstrings,
884 hdr->e_shnum, &mod);
885 if (err < 0) {
886 printk(KERN_WARNING "VPE: unable to simplify symbols\n");
887 goto cleanup;
888 }
889
890 /* Now do relocations. */
891 for (i = 1; i < hdr->e_shnum; i++) {
892 const char *strtab = (char *)sechdrs[strindex].sh_addr;
893 unsigned int info = sechdrs[i].sh_info;
894
895 /* Not a valid relocation section? */
896 if (info >= hdr->e_shnum)
897 continue;
898
899 /* Don't bother with non-allocated sections */
900 if (!(sechdrs[info].sh_flags & SHF_ALLOC))
901 continue;
902
903 if (sechdrs[i].sh_type == SHT_REL)
904 err =
905 apply_relocations(sechdrs, strtab, symindex, i, &mod);
906 else if (sechdrs[i].sh_type == SHT_RELA)
907 err = apply_relocate_add(sechdrs, strtab, symindex, i,
908 &mod);
909 if (err < 0) {
910 printk(KERN_WARNING
911 "vpe_elfload: error in relocations err %ld\n",
912 err);
913 goto cleanup;
914 }
915 }
916
917 /* make sure it's physically written out */
918 flush_icache_range((unsigned long)v->load_addr,
919 (unsigned long)v->load_addr + v->len);
920
921 if ((find_vpe_symbols(v, sechdrs, symindex, strtab, &mod)) < 0) {
922
923 printk(KERN_WARNING
924 "VPE: program doesn't contain __start or vpe_shared symbols\n");
925 err = -ENOEXEC;
926 }
927
928 printk(" elf loaded\n");
929
930cleanup:
931 return err;
932}
933
934static void dump_vpe(vpe_t * v)
935{
936 struct tc *t;
937
938 printk(KERN_DEBUG "VPEControl 0x%lx\n", read_vpe_c0_vpecontrol());
939 printk(KERN_DEBUG "VPEConf0 0x%lx\n", read_vpe_c0_vpeconf0());
940
941 list_for_each_entry(t, &vpecontrol.tc_list, list) {
942 dump_tc(t);
943 }
944}
945
946/* checks for VPE is unused and gets ready to load program */
947static int vpe_open(struct inode *inode, struct file *filp)
948{
949 int minor;
950 vpe_t *v;
951
952 /* assume only 1 device at the mo. */
953 if ((minor = MINOR(inode->i_rdev)) != 1) {
954 printk(KERN_WARNING "VPE: only vpe1 is supported\n");
955 return -ENODEV;
956 }
957
958 if ((v = get_vpe(minor)) == NULL) {
959 printk(KERN_WARNING "VPE: unable to get vpe\n");
960 return -ENODEV;
961 }
962
963 if (v->state != VPE_STATE_UNUSED) {
964 unsigned long tmp;
965 struct tc *t;
966
967 printk(KERN_WARNING "VPE: device %d already in use\n", minor);
968
969 dvpe();
970 dump_vpe(v);
971
972 printk(KERN_WARNING "VPE: re-initialising %d\n", minor);
973
974 release_progmem(v->load_addr);
975
976 t = get_tc(minor);
977 settc(minor);
978 tmp = read_tc_c0_tcstatus();
979
980 /* mark not allocated and not dynamically allocatable */
981 tmp &= ~(TCSTATUS_A | TCSTATUS_DA);
982 tmp |= TCSTATUS_IXMT; /* interrupt exempt */
983 write_tc_c0_tcstatus(tmp);
984
985 write_tc_c0_tchalt(TCHALT_H);
986
987 }
988
989 // allocate it so when we get write ops we know it's expected.
990 v->state = VPE_STATE_INUSE;
991
992 /* this of-course trashes what was there before... */
993 v->pbuffer = vmalloc(P_SIZE);
994 v->plen = P_SIZE;
995 v->load_addr = NULL;
996 v->len = 0;
997
998 return 0;
999}
1000
1001static int vpe_release(struct inode *inode, struct file *filp)
1002{
1003 int minor, ret = 0;
1004 vpe_t *v;
1005 Elf_Ehdr *hdr;
1006
1007 minor = MINOR(inode->i_rdev);
1008 if ((v = get_vpe(minor)) == NULL)
1009 return -ENODEV;
1010
1011 // simple case of fire and forget, so tell the VPE to run...
1012
1013 hdr = (Elf_Ehdr *) v->pbuffer;
1014 if (memcmp(hdr->e_ident, ELFMAG, 4) == 0) {
1015 if (vpe_elfload(v) >= 0)
1016 vpe_run(v);
1017 else {
1018 printk(KERN_WARNING "VPE: ELF load failed.\n");
1019 ret = -ENOEXEC;
1020 }
1021 } else {
1022 printk(KERN_WARNING "VPE: only elf files are supported\n");
1023 ret = -ENOEXEC;
1024 }
1025
1026 // cleanup any temp buffers
1027 if (v->pbuffer)
1028 vfree(v->pbuffer);
1029 v->plen = 0;
1030 return ret;
1031}
1032
1033static ssize_t vpe_write(struct file *file, const char __user * buffer,
1034 size_t count, loff_t * ppos)
1035{
1036 int minor;
1037 size_t ret = count;
1038 vpe_t *v;
1039
1040 minor = MINOR(file->f_dentry->d_inode->i_rdev);
1041 if ((v = get_vpe(minor)) == NULL)
1042 return -ENODEV;
1043
1044 if (v->pbuffer == NULL) {
1045 printk(KERN_ERR "vpe_write: no pbuffer\n");
1046 return -ENOMEM;
1047 }
1048
1049 if ((count + v->len) > v->plen) {
1050 printk(KERN_WARNING
1051 "VPE Loader: elf size too big. Perhaps strip uneeded symbols\n");
1052 return -ENOMEM;
1053 }
1054
1055 count -= copy_from_user(v->pbuffer + v->len, buffer, count);
1056 if (!count) {
1057 printk("vpe_write: copy_to_user failed\n");
1058 return -EFAULT;
1059 }
1060
1061 v->len += count;
1062 return ret;
1063}
1064
1065static struct file_operations vpe_fops = {
1066 .owner = THIS_MODULE,
1067 .open = vpe_open,
1068 .release = vpe_release,
1069 .write = vpe_write
1070};
1071
1072/* module wrapper entry points */
1073/* give me a vpe */
1074vpe_handle vpe_alloc(void)
1075{
1076 int i;
1077 struct vpe *v;
1078
1079 /* find a vpe */
1080 for (i = 1; i < MAX_VPES; i++) {
1081 if ((v = get_vpe(i)) != NULL) {
1082 v->state = VPE_STATE_INUSE;
1083 return v;
1084 }
1085 }
1086 return NULL;
1087}
1088
1089EXPORT_SYMBOL(vpe_alloc);
1090
1091/* start running from here */
1092int vpe_start(vpe_handle vpe, unsigned long start)
1093{
1094 struct vpe *v = vpe;
1095
1096 v->__start = start;
1097 return vpe_run(v);
1098}
1099
1100EXPORT_SYMBOL(vpe_start);
1101
1102/* halt it for now */
1103int vpe_stop(vpe_handle vpe)
1104{
1105 struct vpe *v = vpe;
1106 struct tc *t;
1107 unsigned int evpe_flags;
1108
1109 evpe_flags = dvpe();
1110
1111 if ((t = list_entry(v->tc.next, struct tc, tc)) != NULL) {
1112
1113 settc(t->index);
1114 write_vpe_c0_vpeconf0(read_vpe_c0_vpeconf0() & ~VPECONF0_VPA);
1115 }
1116
1117 evpe(evpe_flags);
1118
1119 return 0;
1120}
1121
1122EXPORT_SYMBOL(vpe_stop);
1123
1124/* I've done with it thank you */
1125int vpe_free(vpe_handle vpe)
1126{
1127 struct vpe *v = vpe;
1128 struct tc *t;
1129 unsigned int evpe_flags;
1130
1131 if ((t = list_entry(v->tc.next, struct tc, tc)) == NULL) {
1132 return -ENOEXEC;
1133 }
1134
1135 evpe_flags = dvpe();
1136
1137 /* Put MVPE's into 'configuration state' */
1138 set_c0_mvpcontrol(MVPCONTROL_VPC);
1139
1140 settc(t->index);
1141 write_vpe_c0_vpeconf0(read_vpe_c0_vpeconf0() & ~VPECONF0_VPA);
1142
1143 /* mark the TC unallocated and halt'ed */
1144 write_tc_c0_tcstatus(read_tc_c0_tcstatus() & ~TCSTATUS_A);
1145 write_tc_c0_tchalt(TCHALT_H);
1146
1147 v->state = VPE_STATE_UNUSED;
1148
1149 clear_c0_mvpcontrol(MVPCONTROL_VPC);
1150 evpe(evpe_flags);
1151
1152 return 0;
1153}
1154
1155EXPORT_SYMBOL(vpe_free);
1156
1157void *vpe_get_shared(int index)
1158{
1159 struct vpe *v;
1160
1161 if ((v = get_vpe(index)) == NULL) {
1162 printk(KERN_WARNING "vpe: invalid vpe index %d\n", index);
1163 return NULL;
1164 }
1165
1166 return v->shared_ptr;
1167}
1168
1169EXPORT_SYMBOL(vpe_get_shared);
1170
1171static int __init vpe_module_init(void)
1172{
1173 struct vpe *v = NULL;
1174 struct tc *t;
1175 unsigned long val;
1176 int i;
1177
1178 if (!cpu_has_mipsmt) {
1179 printk("VPE loader: not a MIPS MT capable processor\n");
1180 return -ENODEV;
1181 }
1182
1183 if ((major = register_chrdev(VPE_MAJOR, module_name, &vpe_fops) < 0)) {
1184 printk("VPE loader: unable to register character device\n");
1185 return -EBUSY;
1186 }
1187
1188 if (major == 0)
1189 major = VPE_MAJOR;
1190
1191 dmt();
1192 dvpe();
1193
1194 /* Put MVPE's into 'configuration state' */
1195 set_c0_mvpcontrol(MVPCONTROL_VPC);
1196
1197 /* dump_mtregs(); */
1198
1199 INIT_LIST_HEAD(&vpecontrol.vpe_list);
1200 INIT_LIST_HEAD(&vpecontrol.tc_list);
1201
1202 val = read_c0_mvpconf0();
1203 for (i = 0; i < ((val & MVPCONF0_PTC) + 1); i++) {
1204 t = alloc_tc(i);
1205
1206 /* VPE's */
1207 if (i < ((val & MVPCONF0_PVPE) >> MVPCONF0_PVPE_SHIFT) + 1) {
1208 settc(i);
1209
1210 if ((v = alloc_vpe(i)) == NULL) {
1211 printk(KERN_WARNING "VPE: unable to allocate VPE\n");
1212 return -ENODEV;
1213 }
1214
1215 list_add(&t->tc, &v->tc); /* add the tc to the list of this vpe's tc's. */
1216
1217 /* deactivate all but vpe0 */
1218 if (i != 0) {
1219 unsigned long tmp = read_vpe_c0_vpeconf0();
1220
1221 tmp &= ~VPECONF0_VPA;
1222
1223 /* master VPE */
1224 tmp |= VPECONF0_MVP;
1225 write_vpe_c0_vpeconf0(tmp);
1226 }
1227
1228 /* disable multi-threading with TC's */
1229 write_vpe_c0_vpecontrol(read_vpe_c0_vpecontrol() & ~VPECONTROL_TE);
1230
1231 if (i != 0) {
1232 write_vpe_c0_status((read_c0_status() &
1233 ~(ST0_IM | ST0_IE | ST0_KSU))
1234 | ST0_CU0);
1235
1236 /* set config to be the same as vpe0, particularly kseg0 coherency alg */
1237 write_vpe_c0_config(read_c0_config());
1238 }
1239
1240 }
1241
1242 /* TC's */
1243 t->pvpe = v; /* set the parent vpe */
1244
1245 if (i != 0) {
1246 unsigned long tmp;
1247
1248 /* tc 0 will of course be running.... */
1249 if (i == 0)
1250 t->state = TC_STATE_RUNNING;
1251
1252 settc(i);
1253
1254 /* bind a TC to each VPE, May as well put all excess TC's
1255 on the last VPE */
1256 if (i >= (((val & MVPCONF0_PVPE) >> MVPCONF0_PVPE_SHIFT) + 1))
1257 write_tc_c0_tcbind(read_tc_c0_tcbind() |
1258 ((val & MVPCONF0_PVPE) >> MVPCONF0_PVPE_SHIFT));
1259 else
1260 write_tc_c0_tcbind(read_tc_c0_tcbind() | i);
1261
1262 tmp = read_tc_c0_tcstatus();
1263
1264 /* mark not allocated and not dynamically allocatable */
1265 tmp &= ~(TCSTATUS_A | TCSTATUS_DA);
1266 tmp |= TCSTATUS_IXMT; /* interrupt exempt */
1267 write_tc_c0_tcstatus(tmp);
1268
1269 write_tc_c0_tchalt(TCHALT_H);
1270 }
1271 }
1272
1273 /* release config state */
1274 clear_c0_mvpcontrol(MVPCONTROL_VPC);
1275
1276 return 0;
1277}
1278
1279static void __exit vpe_module_exit(void)
1280{
1281 struct vpe *v, *n;
1282
1283 list_for_each_entry_safe(v, n, &vpecontrol.vpe_list, list) {
1284 if (v->state != VPE_STATE_UNUSED) {
1285 release_vpe(v);
1286 }
1287 }
1288
1289 unregister_chrdev(major, module_name);
1290}
1291
1292module_init(vpe_module_init);
1293module_exit(vpe_module_exit);
1294MODULE_DESCRIPTION("MIPS VPE Loader");
1295MODULE_AUTHOR("Elizabeth Clarke, MIPS Technologies, Inc");
1296MODULE_LICENSE("GPL");
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/interrupt.c b/arch/mips/lasat/interrupt.c
index c90da1639440..852a41901a5e 100644
--- a/arch/mips/lasat/interrupt.c
+++ b/arch/mips/lasat/interrupt.c
@@ -71,14 +71,13 @@ static void end_lasat_irq(unsigned int irq)
71} 71}
72 72
73static struct hw_interrupt_type lasat_irq_type = { 73static struct hw_interrupt_type lasat_irq_type = {
74 "Lasat", 74 .typename = "Lasat",
75 startup_lasat_irq, 75 .startup = startup_lasat_irq,
76 shutdown_lasat_irq, 76 .shutdown = shutdown_lasat_irq,
77 enable_lasat_irq, 77 .enable = enable_lasat_irq,
78 disable_lasat_irq, 78 .disable = disable_lasat_irq,
79 mask_and_ack_lasat_irq, 79 .ack = mask_and_ack_lasat_irq,
80 end_lasat_irq, 80 .end = end_lasat_irq,
81 NULL
82}; 81};
83 82
84static inline int ls1bit32(unsigned int x) 83static inline int ls1bit32(unsigned int x)
diff --git a/arch/mips/lasat/setup.c b/arch/mips/lasat/setup.c
index f2604fab9a99..dcd819d57dae 100644
--- a/arch/mips/lasat/setup.c
+++ b/arch/mips/lasat/setup.c
@@ -155,7 +155,7 @@ void __init serial_init(void)
155} 155}
156#endif 156#endif
157 157
158static int __init lasat_setup(void) 158void __init plat_setup(void)
159{ 159{
160 int i; 160 int i;
161 lasat_misc = &lasat_misc_info[mips_machtype]; 161 lasat_misc = &lasat_misc_info[mips_machtype];
@@ -185,8 +185,4 @@ static int __init lasat_setup(void)
185 change_c0_status(ST0_BEV,0); 185 change_c0_status(ST0_BEV,0);
186 186
187 prom_printf("Lasat specific initialization complete\n"); 187 prom_printf("Lasat specific initialization complete\n");
188
189 return 0;
190} 188}
191
192early_initcall(lasat_setup);
diff --git a/arch/mips/lib-32/dump_tlb.c b/arch/mips/lib-32/dump_tlb.c
index 019ac8f005d7..46519f4331eb 100644
--- a/arch/mips/lib-32/dump_tlb.c
+++ b/arch/mips/lib-32/dump_tlb.c
@@ -20,16 +20,25 @@
20static inline const char *msk2str(unsigned int mask) 20static inline const char *msk2str(unsigned int mask)
21{ 21{
22 switch (mask) { 22 switch (mask) {
23 case PM_4K: return "4kb"; 23 case PM_4K:
24 case PM_16K: return "16kb"; 24 return "4kb";
25 case PM_64K: return "64kb"; 25 case PM_16K:
26 case PM_256K: return "256kb"; 26 return "16kb";
27 case PM_64K:
28 return "64kb";
29 case PM_256K:
30 return "256kb";
27#ifndef CONFIG_CPU_VR41XX 31#ifndef CONFIG_CPU_VR41XX
28 case PM_1M: return "1Mb"; 32 case PM_1M:
29 case PM_4M: return "4Mb"; 33 return "1Mb";
30 case PM_16M: return "16Mb"; 34 case PM_4M:
31 case PM_64M: return "64Mb"; 35 return "4Mb";
32 case PM_256M: return "256Mb"; 36 case PM_16M:
37 return "16Mb";
38 case PM_64M:
39 return "64Mb";
40 case PM_256M:
41 return "256Mb";
33#endif 42#endif
34 } 43 }
35 44
@@ -47,7 +56,7 @@ void dump_tlb(int first, int last)
47 unsigned int pagemask, c0, c1, asid; 56 unsigned int pagemask, c0, c1, asid;
48 unsigned long long entrylo0, entrylo1; 57 unsigned long long entrylo0, entrylo1;
49 unsigned long entryhi; 58 unsigned long entryhi;
50 int i; 59 int i;
51 60
52 asid = read_c0_entryhi() & 0xff; 61 asid = read_c0_entryhi() & 0xff;
53 62
@@ -58,7 +67,7 @@ void dump_tlb(int first, int last)
58 tlb_read(); 67 tlb_read();
59 BARRIER(); 68 BARRIER();
60 pagemask = read_c0_pagemask(); 69 pagemask = read_c0_pagemask();
61 entryhi = read_c0_entryhi(); 70 entryhi = read_c0_entryhi();
62 entrylo0 = read_c0_entrylo0(); 71 entrylo0 = read_c0_entrylo0();
63 entrylo1 = read_c0_entrylo1(); 72 entrylo1 = read_c0_entrylo1();
64 73
@@ -78,13 +87,11 @@ void dump_tlb(int first, int last)
78 printk("\t\t\t[pa=%08Lx c=%d d=%d v=%d g=%Ld]\n", 87 printk("\t\t\t[pa=%08Lx c=%d d=%d v=%d g=%Ld]\n",
79 (entrylo0 << 6) & PAGE_MASK, c0, 88 (entrylo0 << 6) & PAGE_MASK, c0,
80 (entrylo0 & 4) ? 1 : 0, 89 (entrylo0 & 4) ? 1 : 0,
81 (entrylo0 & 2) ? 1 : 0, 90 (entrylo0 & 2) ? 1 : 0, (entrylo0 & 1));
82 (entrylo0 & 1));
83 printk("\t\t\t[pa=%08Lx c=%d d=%d v=%d g=%Ld]\n", 91 printk("\t\t\t[pa=%08Lx c=%d d=%d v=%d g=%Ld]\n",
84 (entrylo1 << 6) & PAGE_MASK, c1, 92 (entrylo1 << 6) & PAGE_MASK, c1,
85 (entrylo1 & 4) ? 1 : 0, 93 (entrylo1 & 4) ? 1 : 0,
86 (entrylo1 & 2) ? 1 : 0, 94 (entrylo1 & 2) ? 1 : 0, (entrylo1 & 1));
87 (entrylo1 & 1));
88 printk("\n"); 95 printk("\n");
89 } 96 }
90 } 97 }
@@ -99,7 +106,7 @@ void dump_tlb_all(void)
99 106
100void dump_tlb_wired(void) 107void dump_tlb_wired(void)
101{ 108{
102 int wired; 109 int wired;
103 110
104 wired = read_c0_wired(); 111 wired = read_c0_wired();
105 printk("Wired: %d", wired); 112 printk("Wired: %d", wired);
@@ -138,9 +145,10 @@ void dump_tlb_nonwired(void)
138 145
139void dump_list_process(struct task_struct *t, void *address) 146void dump_list_process(struct task_struct *t, void *address)
140{ 147{
141 pgd_t *page_dir, *pgd; 148 pgd_t *page_dir, *pgd;
142 pmd_t *pmd; 149 pud_t *pud;
143 pte_t *pte, page; 150 pmd_t *pmd;
151 pte_t *pte, page;
144 unsigned long addr, val; 152 unsigned long addr, val;
145 153
146 addr = (unsigned long) address; 154 addr = (unsigned long) address;
@@ -152,21 +160,27 @@ void dump_list_process(struct task_struct *t, void *address)
152 160
153 if (addr > KSEG0) 161 if (addr > KSEG0)
154 page_dir = pgd_offset_k(0); 162 page_dir = pgd_offset_k(0);
155 else 163 else if (t->mm) {
156 page_dir = pgd_offset(t->mm, 0); 164 page_dir = pgd_offset(t->mm, 0);
157 printk("page_dir == %08x\n", (unsigned int) page_dir); 165 printk("page_dir == %08x\n", (unsigned int) page_dir);
166 } else
167 printk("Current thread has no mm\n");
158 168
159 if (addr > KSEG0) 169 if (addr > KSEG0)
160 pgd = pgd_offset_k(addr); 170 pgd = pgd_offset_k(addr);
161 else 171 else if (t->mm) {
162 pgd = pgd_offset(t->mm, addr); 172 pgd = pgd_offset(t->mm, addr);
163 printk("pgd == %08x, ", (unsigned int) pgd); 173 printk("pgd == %08x, ", (unsigned int) pgd);
174 pud = pud_offset(pgd, addr);
175 printk("pud == %08x, ", (unsigned int) pud);
164 176
165 pmd = pmd_offset(pgd, addr); 177 pmd = pmd_offset(pud, addr);
166 printk("pmd == %08x, ", (unsigned int) pmd); 178 printk("pmd == %08x, ", (unsigned int) pmd);
167 179
168 pte = pte_offset(pmd, addr); 180 pte = pte_offset(pmd, addr);
169 printk("pte == %08x, ", (unsigned int) pte); 181 printk("pte == %08x, ", (unsigned int) pte);
182 } else
183 printk("Current thread has no mm\n");
170 184
171 page = *pte; 185 page = *pte;
172#ifdef CONFIG_64BIT_PHYS_ADDR 186#ifdef CONFIG_64BIT_PHYS_ADDR
@@ -176,14 +190,22 @@ void dump_list_process(struct task_struct *t, void *address)
176#endif 190#endif
177 191
178 val = pte_val(page); 192 val = pte_val(page);
179 if (val & _PAGE_PRESENT) printk("present "); 193 if (val & _PAGE_PRESENT)
180 if (val & _PAGE_READ) printk("read "); 194 printk("present ");
181 if (val & _PAGE_WRITE) printk("write "); 195 if (val & _PAGE_READ)
182 if (val & _PAGE_ACCESSED) printk("accessed "); 196 printk("read ");
183 if (val & _PAGE_MODIFIED) printk("modified "); 197 if (val & _PAGE_WRITE)
184 if (val & _PAGE_R4KBUG) printk("r4kbug "); 198 printk("write ");
185 if (val & _PAGE_GLOBAL) printk("global "); 199 if (val & _PAGE_ACCESSED)
186 if (val & _PAGE_VALID) printk("valid "); 200 printk("accessed ");
201 if (val & _PAGE_MODIFIED)
202 printk("modified ");
203 if (val & _PAGE_R4KBUG)
204 printk("r4kbug ");
205 if (val & _PAGE_GLOBAL)
206 printk("global ");
207 if (val & _PAGE_VALID)
208 printk("valid ");
187 printk("\n"); 209 printk("\n");
188} 210}
189 211
@@ -194,14 +216,16 @@ void dump_list_current(void *address)
194 216
195unsigned int vtop(void *address) 217unsigned int vtop(void *address)
196{ 218{
197 pgd_t *pgd; 219 pgd_t *pgd;
198 pmd_t *pmd; 220 pud_t *pud;
199 pte_t *pte; 221 pmd_t *pmd;
222 pte_t *pte;
200 unsigned int addr, paddr; 223 unsigned int addr, paddr;
201 224
202 addr = (unsigned long) address; 225 addr = (unsigned long) address;
203 pgd = pgd_offset(current->mm, addr); 226 pgd = pgd_offset(current->mm, addr);
204 pmd = pmd_offset(pgd, addr); 227 pud = pud_offset(pgd, addr);
228 pmd = pmd_offset(pud, addr);
205 pte = pte_offset(pmd, addr); 229 pte = pte_offset(pmd, addr);
206 paddr = (KSEG1 | (unsigned int) pte_val(*pte)) & PAGE_MASK; 230 paddr = (KSEG1 | (unsigned int) pte_val(*pte)) & PAGE_MASK;
207 paddr |= (addr & ~PAGE_MASK); 231 paddr |= (addr & ~PAGE_MASK);
@@ -214,9 +238,9 @@ void dump16(unsigned long *p)
214 int i; 238 int i;
215 239
216 for (i = 0; i < 8; i++) { 240 for (i = 0; i < 8; i++) {
217 printk("*%08lx == %08lx, ", (unsigned long)p, *p); 241 printk("*%08lx == %08lx, ", (unsigned long) p, *p);
218 p++; 242 p++;
219 printk("*%08lx == %08lx\n", (unsigned long)p, *p); 243 printk("*%08lx == %08lx\n", (unsigned long) p, *p);
220 p++; 244 p++;
221 } 245 }
222} 246}
diff --git a/arch/mips/lib-32/r3k_dump_tlb.c b/arch/mips/lib-32/r3k_dump_tlb.c
index a878224004e5..4f2cb74f0766 100644
--- a/arch/mips/lib-32/r3k_dump_tlb.c
+++ b/arch/mips/lib-32/r3k_dump_tlb.c
@@ -105,6 +105,7 @@ void dump_tlb_nonwired(void)
105void dump_list_process(struct task_struct *t, void *address) 105void dump_list_process(struct task_struct *t, void *address)
106{ 106{
107 pgd_t *page_dir, *pgd; 107 pgd_t *page_dir, *pgd;
108 pud_t *pud;
108 pmd_t *pmd; 109 pmd_t *pmd;
109 pte_t *pte, page; 110 pte_t *pte, page;
110 unsigned int addr; 111 unsigned int addr;
@@ -121,7 +122,10 @@ void dump_list_process(struct task_struct *t, void *address)
121 pgd = pgd_offset(t->mm, addr); 122 pgd = pgd_offset(t->mm, addr);
122 printk("pgd == %08x, ", (unsigned int) pgd); 123 printk("pgd == %08x, ", (unsigned int) pgd);
123 124
124 pmd = pmd_offset(pgd, addr); 125 pud = pud_offset(pgd, addr);
126 printk("pud == %08x, ", (unsigned int) pud);
127
128 pmd = pmd_offset(pud, addr);
125 printk("pmd == %08x, ", (unsigned int) pmd); 129 printk("pmd == %08x, ", (unsigned int) pmd);
126 130
127 pte = pte_offset(pmd, addr); 131 pte = pte_offset(pmd, addr);
@@ -149,13 +153,15 @@ void dump_list_current(void *address)
149unsigned int vtop(void *address) 153unsigned int vtop(void *address)
150{ 154{
151 pgd_t *pgd; 155 pgd_t *pgd;
156 pud_t *pud;
152 pmd_t *pmd; 157 pmd_t *pmd;
153 pte_t *pte; 158 pte_t *pte;
154 unsigned int addr, paddr; 159 unsigned int addr, paddr;
155 160
156 addr = (unsigned long) address; 161 addr = (unsigned long) address;
157 pgd = pgd_offset(current->mm, addr); 162 pgd = pgd_offset(current->mm, addr);
158 pmd = pmd_offset(pgd, addr); 163 pud = pud_offset(pgd, addr);
164 pmd = pmd_offset(pud, addr);
159 pte = pte_offset(pmd, addr); 165 pte = pte_offset(pmd, addr);
160 paddr = (KSEG1 | (unsigned int) pte_val(*pte)) & PAGE_MASK; 166 paddr = (KSEG1 | (unsigned int) pte_val(*pte)) & PAGE_MASK;
161 paddr |= (addr & ~PAGE_MASK); 167 paddr |= (addr & ~PAGE_MASK);
diff --git a/arch/mips/lib-64/dump_tlb.c b/arch/mips/lib-64/dump_tlb.c
index 42f88e055b4c..11a5f015f040 100644
--- a/arch/mips/lib-64/dump_tlb.c
+++ b/arch/mips/lib-64/dump_tlb.c
@@ -140,6 +140,7 @@ void dump_tlb_nonwired(void)
140void dump_list_process(struct task_struct *t, void *address) 140void dump_list_process(struct task_struct *t, void *address)
141{ 141{
142 pgd_t *page_dir, *pgd; 142 pgd_t *page_dir, *pgd;
143 pud_t *pud;
143 pmd_t *pmd; 144 pmd_t *pmd;
144 pte_t *pte, page; 145 pte_t *pte, page;
145 unsigned long addr, val; 146 unsigned long addr, val;
@@ -155,7 +156,10 @@ void dump_list_process(struct task_struct *t, void *address)
155 pgd = pgd_offset(t->mm, addr); 156 pgd = pgd_offset(t->mm, addr);
156 printk("pgd == %016lx\n", (unsigned long) pgd); 157 printk("pgd == %016lx\n", (unsigned long) pgd);
157 158
158 pmd = pmd_offset(pgd, addr); 159 pud = pud_offset(pgd, addr);
160 printk("pud == %016lx\n", (unsigned long) pud);
161
162 pmd = pmd_offset(pud, addr);
159 printk("pmd == %016lx\n", (unsigned long) pmd); 163 printk("pmd == %016lx\n", (unsigned long) pmd);
160 164
161 pte = pte_offset(pmd, addr); 165 pte = pte_offset(pmd, addr);
@@ -184,13 +188,15 @@ void dump_list_current(void *address)
184unsigned int vtop(void *address) 188unsigned int vtop(void *address)
185{ 189{
186 pgd_t *pgd; 190 pgd_t *pgd;
191 pud_t *pud;
187 pmd_t *pmd; 192 pmd_t *pmd;
188 pte_t *pte; 193 pte_t *pte;
189 unsigned int addr, paddr; 194 unsigned int addr, paddr;
190 195
191 addr = (unsigned long) address; 196 addr = (unsigned long) address;
192 pgd = pgd_offset(current->mm, addr); 197 pgd = pgd_offset(current->mm, addr);
193 pmd = pmd_offset(pgd, addr); 198 pud = pud_offset(pgd, addr);
199 pmd = pmd_offset(pud, addr);
194 pte = pte_offset(pmd, addr); 200 pte = pte_offset(pmd, addr);
195 paddr = (CKSEG1 | (unsigned int) pte_val(*pte)) & PAGE_MASK; 201 paddr = (CKSEG1 | (unsigned int) pte_val(*pte)) & PAGE_MASK;
196 paddr |= (addr & ~PAGE_MASK); 202 paddr |= (addr & ~PAGE_MASK);
diff --git a/arch/mips/lib/Makefile b/arch/mips/lib/Makefile
index 037303412909..cf12caf80774 100644
--- a/arch/mips/lib/Makefile
+++ b/arch/mips/lib/Makefile
@@ -2,8 +2,8 @@
2# Makefile for MIPS-specific library files.. 2# Makefile for MIPS-specific library files..
3# 3#
4 4
5lib-y += csum_partial_copy.o memcpy.o promlib.o \ 5lib-y += csum_partial_copy.o memcpy.o promlib.o strlen_user.o strncpy_user.o \
6 strlen_user.o strncpy_user.o strnlen_user.o 6 strnlen_user.o uncached.o
7 7
8obj-y += iomap.o 8obj-y += iomap.o
9 9
diff --git a/arch/mips/lib/csum_partial_copy.c b/arch/mips/lib/csum_partial_copy.c
index ffed0a6a1c16..6e9f366f961d 100644
--- a/arch/mips/lib/csum_partial_copy.c
+++ b/arch/mips/lib/csum_partial_copy.c
@@ -16,8 +16,8 @@
16/* 16/*
17 * copy while checksumming, otherwise like csum_partial 17 * copy while checksumming, otherwise like csum_partial
18 */ 18 */
19unsigned int csum_partial_copy_nocheck(const unsigned char *src, unsigned char *dst, 19unsigned int csum_partial_copy_nocheck(const unsigned char *src,
20 int len, unsigned int sum) 20 unsigned char *dst, int len, unsigned int sum)
21{ 21{
22 /* 22 /*
23 * It's 2:30 am and I don't feel like doing it real ... 23 * It's 2:30 am and I don't feel like doing it real ...
@@ -33,8 +33,8 @@ unsigned int csum_partial_copy_nocheck(const unsigned char *src, unsigned char *
33 * Copy from userspace and compute checksum. If we catch an exception 33 * Copy from userspace and compute checksum. If we catch an exception
34 * then zero the rest of the buffer. 34 * then zero the rest of the buffer.
35 */ 35 */
36unsigned int csum_partial_copy_from_user (const unsigned char *src, unsigned char *dst, 36unsigned int csum_partial_copy_from_user (const unsigned char __user *src,
37 int len, unsigned int sum, int *err_ptr) 37 unsigned char *dst, int len, unsigned int sum, int *err_ptr)
38{ 38{
39 int missing; 39 int missing;
40 40
diff --git a/arch/mips/lib/memcpy.S b/arch/mips/lib/memcpy.S
index a78865f76547..7f9aafa4d80e 100644
--- a/arch/mips/lib/memcpy.S
+++ b/arch/mips/lib/memcpy.S
@@ -13,6 +13,21 @@
13 * Mnemonic names for arguments to memcpy/__copy_user 13 * Mnemonic names for arguments to memcpy/__copy_user
14 */ 14 */
15#include <linux/config.h> 15#include <linux/config.h>
16
17/*
18 * Hack to resolve longstanding prefetch issue
19 *
20 * Prefetching may be fatal on some systems if we're prefetching beyond the
21 * end of memory on some systems. It's also a seriously bad idea on non
22 * dma-coherent systems.
23 */
24#if !defined(CONFIG_DMA_COHERENT) || !defined(CONFIG_DMA_IP27)
25#undef CONFIG_CPU_HAS_PREFETCH
26#endif
27#ifdef CONFIG_MIPS_MALTA
28#undef CONFIG_CPU_HAS_PREFETCH
29#endif
30
16#include <asm/asm.h> 31#include <asm/asm.h>
17#include <asm/asm-offsets.h> 32#include <asm/asm-offsets.h>
18#include <asm/regdef.h> 33#include <asm/regdef.h>
diff --git a/arch/mips/lib/uncached.c b/arch/mips/lib/uncached.c
new file mode 100644
index 000000000000..98ce89f8068b
--- /dev/null
+++ b/arch/mips/lib/uncached.c
@@ -0,0 +1,76 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2005 Thiemo Seufer
7 * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved.
8 * Author: Maciej W. Rozycki <macro@mips.com>
9 */
10
11#include <linux/init.h>
12
13#include <asm/addrspace.h>
14#include <asm/bug.h>
15
16#ifndef CKSEG2
17#define CKSEG2 CKSSEG
18#endif
19#ifndef TO_PHYS_MASK
20#define TO_PHYS_MASK -1
21#endif
22
23/*
24 * FUNC is executed in one of the uncached segments, depending on its
25 * original address as follows:
26 *
27 * 1. If the original address is in CKSEG0 or CKSEG1, then the uncached
28 * segment used is CKSEG1.
29 * 2. If the original address is in XKPHYS, then the uncached segment
30 * used is XKPHYS(2).
31 * 3. Otherwise it's a bug.
32 *
33 * The same remapping is done with the stack pointer. Stack handling
34 * works because we don't handle stack arguments or more complex return
35 * values, so we can avoid sharing the same stack area between a cached
36 * and the uncached mode.
37 */
38unsigned long __init run_uncached(void *func)
39{
40 register long sp __asm__("$sp");
41 register long ret __asm__("$2");
42 long lfunc = (long)func, ufunc;
43 long usp;
44
45 if (sp >= (long)CKSEG0 && sp < (long)CKSEG2)
46 usp = CKSEG1ADDR(sp);
47 else if ((long long)sp >= (long long)PHYS_TO_XKPHYS(0LL, 0) &&
48 (long long)sp < (long long)PHYS_TO_XKPHYS(8LL, 0))
49 usp = PHYS_TO_XKPHYS((long long)K_CALG_UNCACHED,
50 XKPHYS_TO_PHYS((long long)sp));
51 else {
52 BUG();
53 usp = sp;
54 }
55 if (lfunc >= (long)CKSEG0 && lfunc < (long)CKSEG2)
56 ufunc = CKSEG1ADDR(lfunc);
57 else if ((long long)lfunc >= (long long)PHYS_TO_XKPHYS(0LL, 0) &&
58 (long long)lfunc < (long long)PHYS_TO_XKPHYS(8LL, 0))
59 ufunc = PHYS_TO_XKPHYS((long long)K_CALG_UNCACHED,
60 XKPHYS_TO_PHYS((long long)lfunc));
61 else {
62 BUG();
63 ufunc = lfunc;
64 }
65
66 __asm__ __volatile__ (
67 " move $16, $sp\n"
68 " move $sp, %1\n"
69 " jalr %2\n"
70 " move $sp, $16"
71 : "=r" (ret)
72 : "r" (usp), "r" (ufunc)
73 : "$16", "$31");
74
75 return ret;
76}
diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c
index 99c550632d44..aa5818a0d884 100644
--- a/arch/mips/math-emu/cp1emu.c
+++ b/arch/mips/math-emu/cp1emu.c
@@ -70,7 +70,7 @@ static int fpux_emu(struct pt_regs *,
70 70
71/* Further private data for which no space exists in mips_fpu_soft_struct */ 71/* Further private data for which no space exists in mips_fpu_soft_struct */
72 72
73struct mips_fpu_emulator_private fpuemuprivate; 73struct mips_fpu_emulator_stats fpuemustats;
74 74
75/* Control registers */ 75/* Control registers */
76 76
@@ -79,7 +79,17 @@ struct mips_fpu_emulator_private fpuemuprivate;
79 79
80/* Convert Mips rounding mode (0..3) to IEEE library modes. */ 80/* Convert Mips rounding mode (0..3) to IEEE library modes. */
81static const unsigned char ieee_rm[4] = { 81static const unsigned char ieee_rm[4] = {
82 IEEE754_RN, IEEE754_RZ, IEEE754_RU, IEEE754_RD 82 [FPU_CSR_RN] = IEEE754_RN,
83 [FPU_CSR_RZ] = IEEE754_RZ,
84 [FPU_CSR_RU] = IEEE754_RU,
85 [FPU_CSR_RD] = IEEE754_RD,
86};
87/* Convert IEEE library modes to Mips rounding mode (0..3). */
88static const unsigned char mips_rm[4] = {
89 [IEEE754_RN] = FPU_CSR_RN,
90 [IEEE754_RZ] = FPU_CSR_RZ,
91 [IEEE754_RD] = FPU_CSR_RD,
92 [IEEE754_RU] = FPU_CSR_RU,
83}; 93};
84 94
85#if __mips >= 4 95#if __mips >= 4
@@ -196,11 +206,11 @@ static int isBranchInstr(mips_instruction * i)
196static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx) 206static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx)
197{ 207{
198 mips_instruction ir; 208 mips_instruction ir;
199 vaddr_t emulpc, contpc; 209 void * emulpc, *contpc;
200 unsigned int cond; 210 unsigned int cond;
201 211
202 if (get_user(ir, (mips_instruction *) xcp->cp0_epc)) { 212 if (get_user(ir, (mips_instruction __user *) xcp->cp0_epc)) {
203 fpuemuprivate.stats.errors++; 213 fpuemustats.errors++;
204 return SIGBUS; 214 return SIGBUS;
205 } 215 }
206 216
@@ -221,41 +231,39 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx)
221 * Linux MIPS branch emulator operates on context, updating the 231 * Linux MIPS branch emulator operates on context, updating the
222 * cp0_epc. 232 * cp0_epc.
223 */ 233 */
224 emulpc = REG_TO_VA(xcp->cp0_epc + 4); /* Snapshot emulation target */ 234 emulpc = (void *) (xcp->cp0_epc + 4); /* Snapshot emulation target */
225 235
226 if (__compute_return_epc(xcp)) { 236 if (__compute_return_epc(xcp)) {
227#ifdef CP1DBG 237#ifdef CP1DBG
228 printk("failed to emulate branch at %p\n", 238 printk("failed to emulate branch at %p\n",
229 REG_TO_VA(xcp->cp0_epc)); 239 (void *) (xcp->cp0_epc));
230#endif 240#endif
231 return SIGILL; 241 return SIGILL;
232 } 242 }
233 if (get_user(ir, (mips_instruction *) emulpc)) { 243 if (get_user(ir, (mips_instruction __user *) emulpc)) {
234 fpuemuprivate.stats.errors++; 244 fpuemustats.errors++;
235 return SIGBUS; 245 return SIGBUS;
236 } 246 }
237 /* __compute_return_epc() will have updated cp0_epc */ 247 /* __compute_return_epc() will have updated cp0_epc */
238 contpc = REG_TO_VA xcp->cp0_epc; 248 contpc = (void *) xcp->cp0_epc;
239 /* In order not to confuse ptrace() et al, tweak context */ 249 /* In order not to confuse ptrace() et al, tweak context */
240 xcp->cp0_epc = VA_TO_REG emulpc - 4; 250 xcp->cp0_epc = (unsigned long) emulpc - 4;
241 } 251 } else {
242 else { 252 emulpc = (void *) xcp->cp0_epc;
243 emulpc = REG_TO_VA xcp->cp0_epc; 253 contpc = (void *) (xcp->cp0_epc + 4);
244 contpc = REG_TO_VA(xcp->cp0_epc + 4);
245 } 254 }
246 255
247 emul: 256 emul:
248 fpuemuprivate.stats.emulated++; 257 fpuemustats.emulated++;
249 switch (MIPSInst_OPCODE(ir)) { 258 switch (MIPSInst_OPCODE(ir)) {
250#ifndef SINGLE_ONLY_FPU
251 case ldc1_op:{ 259 case ldc1_op:{
252 u64 *va = REG_TO_VA(xcp->regs[MIPSInst_RS(ir)] + 260 u64 __user *va = (u64 __user *) (xcp->regs[MIPSInst_RS(ir)] +
253 MIPSInst_SIMM(ir)); 261 MIPSInst_SIMM(ir));
254 u64 val; 262 u64 val;
255 263
256 fpuemuprivate.stats.loads++; 264 fpuemustats.loads++;
257 if (get_user(val, va)) { 265 if (get_user(val, va)) {
258 fpuemuprivate.stats.errors++; 266 fpuemustats.errors++;
259 return SIGBUS; 267 return SIGBUS;
260 } 268 }
261 DITOREG(val, MIPSInst_RT(ir)); 269 DITOREG(val, MIPSInst_RT(ir));
@@ -263,55 +271,42 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx)
263 } 271 }
264 272
265 case sdc1_op:{ 273 case sdc1_op:{
266 u64 *va = REG_TO_VA(xcp->regs[MIPSInst_RS(ir)] + 274 u64 __user *va = (u64 __user *) (xcp->regs[MIPSInst_RS(ir)] +
267 MIPSInst_SIMM(ir)); 275 MIPSInst_SIMM(ir));
268 u64 val; 276 u64 val;
269 277
270 fpuemuprivate.stats.stores++; 278 fpuemustats.stores++;
271 DIFROMREG(val, MIPSInst_RT(ir)); 279 DIFROMREG(val, MIPSInst_RT(ir));
272 if (put_user(val, va)) { 280 if (put_user(val, va)) {
273 fpuemuprivate.stats.errors++; 281 fpuemustats.errors++;
274 return SIGBUS; 282 return SIGBUS;
275 } 283 }
276 break; 284 break;
277 } 285 }
278#endif
279 286
280 case lwc1_op:{ 287 case lwc1_op:{
281 u32 *va = REG_TO_VA(xcp->regs[MIPSInst_RS(ir)] + 288 u32 __user *va = (u32 __user *) (xcp->regs[MIPSInst_RS(ir)] +
282 MIPSInst_SIMM(ir)); 289 MIPSInst_SIMM(ir));
283 u32 val; 290 u32 val;
284 291
285 fpuemuprivate.stats.loads++; 292 fpuemustats.loads++;
286 if (get_user(val, va)) { 293 if (get_user(val, va)) {
287 fpuemuprivate.stats.errors++; 294 fpuemustats.errors++;
288 return SIGBUS; 295 return SIGBUS;
289 } 296 }
290#ifdef SINGLE_ONLY_FPU
291 if (MIPSInst_RT(ir) & 1) {
292 /* illegal register in single-float mode */
293 return SIGILL;
294 }
295#endif
296 SITOREG(val, MIPSInst_RT(ir)); 297 SITOREG(val, MIPSInst_RT(ir));
297 break; 298 break;
298 } 299 }
299 300
300 case swc1_op:{ 301 case swc1_op:{
301 u32 *va = REG_TO_VA(xcp->regs[MIPSInst_RS(ir)] + 302 u32 __user *va = (u32 __user *) (xcp->regs[MIPSInst_RS(ir)] +
302 MIPSInst_SIMM(ir)); 303 MIPSInst_SIMM(ir));
303 u32 val; 304 u32 val;
304 305
305 fpuemuprivate.stats.stores++; 306 fpuemustats.stores++;
306#ifdef SINGLE_ONLY_FPU
307 if (MIPSInst_RT(ir) & 1) {
308 /* illegal register in single-float mode */
309 return SIGILL;
310 }
311#endif
312 SIFROMREG(val, MIPSInst_RT(ir)); 307 SIFROMREG(val, MIPSInst_RT(ir));
313 if (put_user(val, va)) { 308 if (put_user(val, va)) {
314 fpuemuprivate.stats.errors++; 309 fpuemustats.errors++;
315 return SIGBUS; 310 return SIGBUS;
316 } 311 }
317 break; 312 break;
@@ -320,7 +315,7 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx)
320 case cop1_op: 315 case cop1_op:
321 switch (MIPSInst_RS(ir)) { 316 switch (MIPSInst_RS(ir)) {
322 317
323#if defined(__mips64) && !defined(SINGLE_ONLY_FPU) 318#if defined(__mips64)
324 case dmfc_op: 319 case dmfc_op:
325 /* copregister fs -> gpr[rt] */ 320 /* copregister fs -> gpr[rt] */
326 if (MIPSInst_RT(ir) != 0) { 321 if (MIPSInst_RT(ir) != 0) {
@@ -337,12 +332,6 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx)
337 332
338 case mfc_op: 333 case mfc_op:
339 /* copregister rd -> gpr[rt] */ 334 /* copregister rd -> gpr[rt] */
340#ifdef SINGLE_ONLY_FPU
341 if (MIPSInst_RD(ir) & 1) {
342 /* illegal register in single-float mode */
343 return SIGILL;
344 }
345#endif
346 if (MIPSInst_RT(ir) != 0) { 335 if (MIPSInst_RT(ir) != 0) {
347 SIFROMREG(xcp->regs[MIPSInst_RT(ir)], 336 SIFROMREG(xcp->regs[MIPSInst_RT(ir)],
348 MIPSInst_RD(ir)); 337 MIPSInst_RD(ir));
@@ -351,12 +340,6 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx)
351 340
352 case mtc_op: 341 case mtc_op:
353 /* copregister rd <- rt */ 342 /* copregister rd <- rt */
354#ifdef SINGLE_ONLY_FPU
355 if (MIPSInst_RD(ir) & 1) {
356 /* illegal register in single-float mode */
357 return SIGILL;
358 }
359#endif
360 SITOREG(xcp->regs[MIPSInst_RT(ir)], MIPSInst_RD(ir)); 343 SITOREG(xcp->regs[MIPSInst_RT(ir)], MIPSInst_RD(ir));
361 break; 344 break;
362 345
@@ -369,9 +352,10 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx)
369 } 352 }
370 if (MIPSInst_RD(ir) == FPCREG_CSR) { 353 if (MIPSInst_RD(ir) == FPCREG_CSR) {
371 value = ctx->fcr31; 354 value = ctx->fcr31;
355 value = (value & ~0x3) | mips_rm[value & 0x3];
372#ifdef CSRTRACE 356#ifdef CSRTRACE
373 printk("%p gpr[%d]<-csr=%08x\n", 357 printk("%p gpr[%d]<-csr=%08x\n",
374 REG_TO_VA(xcp->cp0_epc), 358 (void *) (xcp->cp0_epc),
375 MIPSInst_RT(ir), value); 359 MIPSInst_RT(ir), value);
376#endif 360#endif
377 } 361 }
@@ -398,14 +382,13 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx)
398 if (MIPSInst_RD(ir) == FPCREG_CSR) { 382 if (MIPSInst_RD(ir) == FPCREG_CSR) {
399#ifdef CSRTRACE 383#ifdef CSRTRACE
400 printk("%p gpr[%d]->csr=%08x\n", 384 printk("%p gpr[%d]->csr=%08x\n",
401 REG_TO_VA(xcp->cp0_epc), 385 (void *) (xcp->cp0_epc),
402 MIPSInst_RT(ir), value); 386 MIPSInst_RT(ir), value);
403#endif 387#endif
404 ctx->fcr31 = value; 388 value &= (FPU_CSR_FLUSH | FPU_CSR_ALL_E | FPU_CSR_ALL_S | 0x03);
405 /* copy new rounding mode and 389 ctx->fcr31 &= ~(FPU_CSR_FLUSH | FPU_CSR_ALL_E | FPU_CSR_ALL_S | 0x03);
406 flush bit to ieee library state! */ 390 /* convert to ieee library modes */
407 ieee754_csr.nod = (ctx->fcr31 & 0x1000000) != 0; 391 ctx->fcr31 |= (value & ~0x3) | ieee_rm[value & 0x3];
408 ieee754_csr.rm = ieee_rm[value & 0x3];
409 } 392 }
410 if ((ctx->fcr31 >> 5) & ctx->fcr31 & FPU_CSR_ALL_E) { 393 if ((ctx->fcr31 >> 5) & ctx->fcr31 & FPU_CSR_ALL_E) {
411 return SIGFPE; 394 return SIGFPE;
@@ -445,20 +428,20 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx)
445 * instruction 428 * instruction
446 */ 429 */
447 xcp->cp0_epc += 4; 430 xcp->cp0_epc += 4;
448 contpc = REG_TO_VA 431 contpc = (void *)
449 (xcp->cp0_epc + 432 (xcp->cp0_epc +
450 (MIPSInst_SIMM(ir) << 2)); 433 (MIPSInst_SIMM(ir) << 2));
451 434
452 if (get_user(ir, (mips_instruction *) 435 if (get_user(ir,
453 REG_TO_VA xcp->cp0_epc)) { 436 (mips_instruction __user *) xcp->cp0_epc)) {
454 fpuemuprivate.stats.errors++; 437 fpuemustats.errors++;
455 return SIGBUS; 438 return SIGBUS;
456 } 439 }
457 440
458 switch (MIPSInst_OPCODE(ir)) { 441 switch (MIPSInst_OPCODE(ir)) {
459 case lwc1_op: 442 case lwc1_op:
460 case swc1_op: 443 case swc1_op:
461#if (__mips >= 2 || __mips64) && !defined(SINGLE_ONLY_FPU) 444#if (__mips >= 2 || defined(__mips64))
462 case ldc1_op: 445 case ldc1_op:
463 case sdc1_op: 446 case sdc1_op:
464#endif 447#endif
@@ -480,7 +463,7 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx)
480 * Single step the non-cp1 463 * Single step the non-cp1
481 * instruction in the dslot 464 * instruction in the dslot
482 */ 465 */
483 return mips_dsemul(xcp, ir, VA_TO_REG contpc); 466 return mips_dsemul(xcp, ir, (unsigned long) contpc);
484 } 467 }
485 else { 468 else {
486 /* branch not taken */ 469 /* branch not taken */
@@ -539,8 +522,9 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx)
539 } 522 }
540 523
541 /* we did it !! */ 524 /* we did it !! */
542 xcp->cp0_epc = VA_TO_REG(contpc); 525 xcp->cp0_epc = (unsigned long) contpc;
543 xcp->cp0_cause &= ~CAUSEF_BD; 526 xcp->cp0_cause &= ~CAUSEF_BD;
527
544 return 0; 528 return 0;
545} 529}
546 530
@@ -570,7 +554,7 @@ static const unsigned char cmptab[8] = {
570static ieee754##p fpemu_##p##_##name (ieee754##p r, ieee754##p s, \ 554static ieee754##p fpemu_##p##_##name (ieee754##p r, ieee754##p s, \
571 ieee754##p t) \ 555 ieee754##p t) \
572{ \ 556{ \
573 struct ieee754_csr ieee754_csr_save; \ 557 struct _ieee754_csr ieee754_csr_save; \
574 s = f1 (s, t); \ 558 s = f1 (s, t); \
575 ieee754_csr_save = ieee754_csr; \ 559 ieee754_csr_save = ieee754_csr; \
576 s = f2 (s, r); \ 560 s = f2 (s, r); \
@@ -616,54 +600,38 @@ static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
616{ 600{
617 unsigned rcsr = 0; /* resulting csr */ 601 unsigned rcsr = 0; /* resulting csr */
618 602
619 fpuemuprivate.stats.cp1xops++; 603 fpuemustats.cp1xops++;
620 604
621 switch (MIPSInst_FMA_FFMT(ir)) { 605 switch (MIPSInst_FMA_FFMT(ir)) {
622 case s_fmt:{ /* 0 */ 606 case s_fmt:{ /* 0 */
623 607
624 ieee754sp(*handler) (ieee754sp, ieee754sp, ieee754sp); 608 ieee754sp(*handler) (ieee754sp, ieee754sp, ieee754sp);
625 ieee754sp fd, fr, fs, ft; 609 ieee754sp fd, fr, fs, ft;
626 u32 *va; 610 u32 __user *va;
627 u32 val; 611 u32 val;
628 612
629 switch (MIPSInst_FUNC(ir)) { 613 switch (MIPSInst_FUNC(ir)) {
630 case lwxc1_op: 614 case lwxc1_op:
631 va = REG_TO_VA(xcp->regs[MIPSInst_FR(ir)] + 615 va = (void __user *) (xcp->regs[MIPSInst_FR(ir)] +
632 xcp->regs[MIPSInst_FT(ir)]); 616 xcp->regs[MIPSInst_FT(ir)]);
633 617
634 fpuemuprivate.stats.loads++; 618 fpuemustats.loads++;
635 if (get_user(val, va)) { 619 if (get_user(val, va)) {
636 fpuemuprivate.stats.errors++; 620 fpuemustats.errors++;
637 return SIGBUS; 621 return SIGBUS;
638 } 622 }
639#ifdef SINGLE_ONLY_FPU
640 if (MIPSInst_FD(ir) & 1) {
641 /* illegal register in single-float
642 * mode
643 */
644 return SIGILL;
645 }
646#endif
647 SITOREG(val, MIPSInst_FD(ir)); 623 SITOREG(val, MIPSInst_FD(ir));
648 break; 624 break;
649 625
650 case swxc1_op: 626 case swxc1_op:
651 va = REG_TO_VA(xcp->regs[MIPSInst_FR(ir)] + 627 va = (void __user *) (xcp->regs[MIPSInst_FR(ir)] +
652 xcp->regs[MIPSInst_FT(ir)]); 628 xcp->regs[MIPSInst_FT(ir)]);
653 629
654 fpuemuprivate.stats.stores++; 630 fpuemustats.stores++;
655#ifdef SINGLE_ONLY_FPU
656 if (MIPSInst_FS(ir) & 1) {
657 /* illegal register in single-float
658 * mode
659 */
660 return SIGILL;
661 }
662#endif
663 631
664 SIFROMREG(val, MIPSInst_FS(ir)); 632 SIFROMREG(val, MIPSInst_FS(ir));
665 if (put_user(val, va)) { 633 if (put_user(val, va)) {
666 fpuemuprivate.stats.errors++; 634 fpuemustats.errors++;
667 return SIGBUS; 635 return SIGBUS;
668 } 636 }
669 break; 637 break;
@@ -699,8 +667,6 @@ static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
699 rcsr |= FPU_CSR_INV_X | FPU_CSR_INV_S; 667 rcsr |= FPU_CSR_INV_X | FPU_CSR_INV_S;
700 668
701 ctx->fcr31 = (ctx->fcr31 & ~FPU_CSR_ALL_X) | rcsr; 669 ctx->fcr31 = (ctx->fcr31 & ~FPU_CSR_ALL_X) | rcsr;
702 if (ieee754_csr.nod)
703 ctx->fcr31 |= 0x1000000;
704 if ((ctx->fcr31 >> 5) & ctx->fcr31 & FPU_CSR_ALL_E) { 670 if ((ctx->fcr31 >> 5) & ctx->fcr31 & FPU_CSR_ALL_E) {
705 /*printk ("SIGFPE: fpu csr = %08x\n", 671 /*printk ("SIGFPE: fpu csr = %08x\n",
706 ctx->fcr31); */ 672 ctx->fcr31); */
@@ -715,34 +681,33 @@ static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
715 break; 681 break;
716 } 682 }
717 683
718#ifndef SINGLE_ONLY_FPU
719 case d_fmt:{ /* 1 */ 684 case d_fmt:{ /* 1 */
720 ieee754dp(*handler) (ieee754dp, ieee754dp, ieee754dp); 685 ieee754dp(*handler) (ieee754dp, ieee754dp, ieee754dp);
721 ieee754dp fd, fr, fs, ft; 686 ieee754dp fd, fr, fs, ft;
722 u64 *va; 687 u64 __user *va;
723 u64 val; 688 u64 val;
724 689
725 switch (MIPSInst_FUNC(ir)) { 690 switch (MIPSInst_FUNC(ir)) {
726 case ldxc1_op: 691 case ldxc1_op:
727 va = REG_TO_VA(xcp->regs[MIPSInst_FR(ir)] + 692 va = (void __user *) (xcp->regs[MIPSInst_FR(ir)] +
728 xcp->regs[MIPSInst_FT(ir)]); 693 xcp->regs[MIPSInst_FT(ir)]);
729 694
730 fpuemuprivate.stats.loads++; 695 fpuemustats.loads++;
731 if (get_user(val, va)) { 696 if (get_user(val, va)) {
732 fpuemuprivate.stats.errors++; 697 fpuemustats.errors++;
733 return SIGBUS; 698 return SIGBUS;
734 } 699 }
735 DITOREG(val, MIPSInst_FD(ir)); 700 DITOREG(val, MIPSInst_FD(ir));
736 break; 701 break;
737 702
738 case sdxc1_op: 703 case sdxc1_op:
739 va = REG_TO_VA(xcp->regs[MIPSInst_FR(ir)] + 704 va = (void __user *) (xcp->regs[MIPSInst_FR(ir)] +
740 xcp->regs[MIPSInst_FT(ir)]); 705 xcp->regs[MIPSInst_FT(ir)]);
741 706
742 fpuemuprivate.stats.stores++; 707 fpuemustats.stores++;
743 DIFROMREG(val, MIPSInst_FS(ir)); 708 DIFROMREG(val, MIPSInst_FS(ir));
744 if (put_user(val, va)) { 709 if (put_user(val, va)) {
745 fpuemuprivate.stats.errors++; 710 fpuemustats.errors++;
746 return SIGBUS; 711 return SIGBUS;
747 } 712 }
748 break; 713 break;
@@ -773,7 +738,6 @@ static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
773 } 738 }
774 break; 739 break;
775 } 740 }
776#endif
777 741
778 case 0x7: /* 7 */ 742 case 0x7: /* 7 */
779 if (MIPSInst_FUNC(ir) != pfetch_op) { 743 if (MIPSInst_FUNC(ir) != pfetch_op) {
@@ -810,7 +774,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
810#endif 774#endif
811 } rv; /* resulting value */ 775 } rv; /* resulting value */
812 776
813 fpuemuprivate.stats.cp1ops++; 777 fpuemustats.cp1ops++;
814 switch (rfmt = (MIPSInst_FFMT(ir) & 0xf)) { 778 switch (rfmt = (MIPSInst_FFMT(ir) & 0xf)) {
815 case s_fmt:{ /* 0 */ 779 case s_fmt:{ /* 0 */
816 union { 780 union {
@@ -834,7 +798,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
834 goto scopbop; 798 goto scopbop;
835 799
836 /* unary ops */ 800 /* unary ops */
837#if __mips >= 2 || __mips64 801#if __mips >= 2 || defined(__mips64)
838 case fsqrt_op: 802 case fsqrt_op:
839 handler.u = ieee754sp_sqrt; 803 handler.u = ieee754sp_sqrt;
840 goto scopuop; 804 goto scopuop;
@@ -913,9 +877,6 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
913 case fcvts_op: 877 case fcvts_op:
914 return SIGILL; /* not defined */ 878 return SIGILL; /* not defined */
915 case fcvtd_op:{ 879 case fcvtd_op:{
916#ifdef SINGLE_ONLY_FPU
917 return SIGILL; /* not defined */
918#else
919 ieee754sp fs; 880 ieee754sp fs;
920 881
921 SPFROMREG(fs, MIPSInst_FS(ir)); 882 SPFROMREG(fs, MIPSInst_FS(ir));
@@ -923,7 +884,6 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
923 rfmt = d_fmt; 884 rfmt = d_fmt;
924 goto copcsr; 885 goto copcsr;
925 } 886 }
926#endif
927 case fcvtw_op:{ 887 case fcvtw_op:{
928 ieee754sp fs; 888 ieee754sp fs;
929 889
@@ -933,7 +893,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
933 goto copcsr; 893 goto copcsr;
934 } 894 }
935 895
936#if __mips >= 2 || __mips64 896#if __mips >= 2 || defined(__mips64)
937 case fround_op: 897 case fround_op:
938 case ftrunc_op: 898 case ftrunc_op:
939 case fceil_op: 899 case fceil_op:
@@ -950,7 +910,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
950 } 910 }
951#endif /* __mips >= 2 */ 911#endif /* __mips >= 2 */
952 912
953#if defined(__mips64) && !defined(SINGLE_ONLY_FPU) 913#if defined(__mips64)
954 case fcvtl_op:{ 914 case fcvtl_op:{
955 ieee754sp fs; 915 ieee754sp fs;
956 916
@@ -974,7 +934,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
974 rfmt = l_fmt; 934 rfmt = l_fmt;
975 goto copcsr; 935 goto copcsr;
976 } 936 }
977#endif /* __mips64 && !fpu(single) */ 937#endif /* defined(__mips64) */
978 938
979 default: 939 default:
980 if (MIPSInst_FUNC(ir) >= fcmp_op) { 940 if (MIPSInst_FUNC(ir) >= fcmp_op) {
@@ -1001,7 +961,6 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
1001 break; 961 break;
1002 } 962 }
1003 963
1004#ifndef SINGLE_ONLY_FPU
1005 case d_fmt:{ 964 case d_fmt:{
1006 union { 965 union {
1007 ieee754dp(*b) (ieee754dp, ieee754dp); 966 ieee754dp(*b) (ieee754dp, ieee754dp);
@@ -1024,7 +983,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
1024 goto dcopbop; 983 goto dcopbop;
1025 984
1026 /* unary ops */ 985 /* unary ops */
1027#if __mips >= 2 || __mips64 986#if __mips >= 2 || defined(__mips64)
1028 case fsqrt_op: 987 case fsqrt_op:
1029 handler.u = ieee754dp_sqrt; 988 handler.u = ieee754dp_sqrt;
1030 goto dcopuop; 989 goto dcopuop;
@@ -1108,7 +1067,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
1108 goto copcsr; 1067 goto copcsr;
1109 } 1068 }
1110 1069
1111#if __mips >= 2 || __mips64 1070#if __mips >= 2 || defined(__mips64)
1112 case fround_op: 1071 case fround_op:
1113 case ftrunc_op: 1072 case ftrunc_op:
1114 case fceil_op: 1073 case fceil_op:
@@ -1125,7 +1084,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
1125 } 1084 }
1126#endif 1085#endif
1127 1086
1128#if defined(__mips64) && !defined(SINGLE_ONLY_FPU) 1087#if defined(__mips64)
1129 case fcvtl_op:{ 1088 case fcvtl_op:{
1130 ieee754dp fs; 1089 ieee754dp fs;
1131 1090
@@ -1149,7 +1108,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
1149 rfmt = l_fmt; 1108 rfmt = l_fmt;
1150 goto copcsr; 1109 goto copcsr;
1151 } 1110 }
1152#endif /* __mips >= 3 && !fpu(single) */ 1111#endif /* __mips >= 3 */
1153 1112
1154 default: 1113 default:
1155 if (MIPSInst_FUNC(ir) >= fcmp_op) { 1114 if (MIPSInst_FUNC(ir) >= fcmp_op) {
@@ -1177,7 +1136,6 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
1177 } 1136 }
1178 break; 1137 break;
1179 } 1138 }
1180#endif /* ifndef SINGLE_ONLY_FPU */
1181 1139
1182 case w_fmt:{ 1140 case w_fmt:{
1183 ieee754sp fs; 1141 ieee754sp fs;
@@ -1189,21 +1147,19 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
1189 rv.s = ieee754sp_fint(fs.bits); 1147 rv.s = ieee754sp_fint(fs.bits);
1190 rfmt = s_fmt; 1148 rfmt = s_fmt;
1191 goto copcsr; 1149 goto copcsr;
1192#ifndef SINGLE_ONLY_FPU
1193 case fcvtd_op: 1150 case fcvtd_op:
1194 /* convert word to double precision real */ 1151 /* convert word to double precision real */
1195 SPFROMREG(fs, MIPSInst_FS(ir)); 1152 SPFROMREG(fs, MIPSInst_FS(ir));
1196 rv.d = ieee754dp_fint(fs.bits); 1153 rv.d = ieee754dp_fint(fs.bits);
1197 rfmt = d_fmt; 1154 rfmt = d_fmt;
1198 goto copcsr; 1155 goto copcsr;
1199#endif
1200 default: 1156 default:
1201 return SIGILL; 1157 return SIGILL;
1202 } 1158 }
1203 break; 1159 break;
1204 } 1160 }
1205 1161
1206#if defined(__mips64) && !defined(SINGLE_ONLY_FPU) 1162#if defined(__mips64)
1207 case l_fmt:{ 1163 case l_fmt:{
1208 switch (MIPSInst_FUNC(ir)) { 1164 switch (MIPSInst_FUNC(ir)) {
1209 case fcvts_op: 1165 case fcvts_op:
@@ -1256,18 +1212,16 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
1256 ctx->fcr31 &= ~cond; 1212 ctx->fcr31 &= ~cond;
1257 break; 1213 break;
1258 } 1214 }
1259#ifndef SINGLE_ONLY_FPU
1260 case d_fmt: 1215 case d_fmt:
1261 DPTOREG(rv.d, MIPSInst_FD(ir)); 1216 DPTOREG(rv.d, MIPSInst_FD(ir));
1262 break; 1217 break;
1263#endif
1264 case s_fmt: 1218 case s_fmt:
1265 SPTOREG(rv.s, MIPSInst_FD(ir)); 1219 SPTOREG(rv.s, MIPSInst_FD(ir));
1266 break; 1220 break;
1267 case w_fmt: 1221 case w_fmt:
1268 SITOREG(rv.w, MIPSInst_FD(ir)); 1222 SITOREG(rv.w, MIPSInst_FD(ir));
1269 break; 1223 break;
1270#if defined(__mips64) && !defined(SINGLE_ONLY_FPU) 1224#if defined(__mips64)
1271 case l_fmt: 1225 case l_fmt:
1272 DITOREG(rv.l, MIPSInst_FD(ir)); 1226 DITOREG(rv.l, MIPSInst_FD(ir));
1273 break; 1227 break;
@@ -1279,10 +1233,10 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
1279 return 0; 1233 return 0;
1280} 1234}
1281 1235
1282int fpu_emulator_cop1Handler(int xcptno, struct pt_regs *xcp, 1236int fpu_emulator_cop1Handler(struct pt_regs *xcp,
1283 struct mips_fpu_soft_struct *ctx) 1237 struct mips_fpu_soft_struct *ctx)
1284{ 1238{
1285 gpreg_t oldepc, prevepc; 1239 unsigned long oldepc, prevepc;
1286 mips_instruction insn; 1240 mips_instruction insn;
1287 int sig = 0; 1241 int sig = 0;
1288 1242
@@ -1290,19 +1244,24 @@ int fpu_emulator_cop1Handler(int xcptno, struct pt_regs *xcp,
1290 do { 1244 do {
1291 prevepc = xcp->cp0_epc; 1245 prevepc = xcp->cp0_epc;
1292 1246
1293 if (get_user(insn, (mips_instruction *) xcp->cp0_epc)) { 1247 if (get_user(insn, (mips_instruction __user *) xcp->cp0_epc)) {
1294 fpuemuprivate.stats.errors++; 1248 fpuemustats.errors++;
1295 return SIGBUS; 1249 return SIGBUS;
1296 } 1250 }
1297 if (insn == 0) 1251 if (insn == 0)
1298 xcp->cp0_epc += 4; /* skip nops */ 1252 xcp->cp0_epc += 4; /* skip nops */
1299 else { 1253 else {
1300 /* Update ieee754_csr. Only relevant if we have a 1254 /*
1301 h/w FPU */ 1255 * The 'ieee754_csr' is an alias of
1302 ieee754_csr.nod = (ctx->fcr31 & 0x1000000) != 0; 1256 * ctx->fcr31. No need to copy ctx->fcr31 to
1303 ieee754_csr.rm = ieee_rm[ctx->fcr31 & 0x3]; 1257 * ieee754_csr. But ieee754_csr.rm is ieee
1304 ieee754_csr.cx = (ctx->fcr31 >> 12) & 0x1f; 1258 * library modes. (not mips rounding mode)
1259 */
1260 /* convert to ieee library modes */
1261 ieee754_csr.rm = ieee_rm[ieee754_csr.rm];
1305 sig = cop1Emulate(xcp, ctx); 1262 sig = cop1Emulate(xcp, ctx);
1263 /* revert to mips rounding mode */
1264 ieee754_csr.rm = mips_rm[ieee754_csr.rm];
1306 } 1265 }
1307 1266
1308 if (cpu_has_fpu) 1267 if (cpu_has_fpu)
diff --git a/arch/mips/math-emu/dp_sqrt.c b/arch/mips/math-emu/dp_sqrt.c
index c35e871ae975..032328c49888 100644
--- a/arch/mips/math-emu/dp_sqrt.c
+++ b/arch/mips/math-emu/dp_sqrt.c
@@ -37,7 +37,7 @@ static const unsigned table[] = {
37 37
38ieee754dp ieee754dp_sqrt(ieee754dp x) 38ieee754dp ieee754dp_sqrt(ieee754dp x)
39{ 39{
40 struct ieee754_csr oldcsr; 40 struct _ieee754_csr oldcsr;
41 ieee754dp y, z, t; 41 ieee754dp y, z, t;
42 unsigned scalx, yh; 42 unsigned scalx, yh;
43 COMPXDP; 43 COMPXDP;
diff --git a/arch/mips/math-emu/dsemul.c b/arch/mips/math-emu/dsemul.c
index aa989c2246da..8079f3d1eca0 100644
--- a/arch/mips/math-emu/dsemul.c
+++ b/arch/mips/math-emu/dsemul.c
@@ -28,9 +28,6 @@
28#endif 28#endif
29#define __mips 4 29#define __mips 4
30 30
31extern struct mips_fpu_emulator_private fpuemuprivate;
32
33
34/* 31/*
35 * Emulate the arbritrary instruction ir at xcp->cp0_epc. Required when 32 * Emulate the arbritrary instruction ir at xcp->cp0_epc. Required when
36 * we have to emulate the instruction in a COP1 branch delay slot. Do 33 * we have to emulate the instruction in a COP1 branch delay slot. Do
@@ -52,10 +49,10 @@ struct emuframe {
52 mips_instruction emul; 49 mips_instruction emul;
53 mips_instruction badinst; 50 mips_instruction badinst;
54 mips_instruction cookie; 51 mips_instruction cookie;
55 gpreg_t epc; 52 unsigned long epc;
56}; 53};
57 54
58int mips_dsemul(struct pt_regs *regs, mips_instruction ir, gpreg_t cpc) 55int mips_dsemul(struct pt_regs *regs, mips_instruction ir, unsigned long cpc)
59{ 56{
60 extern asmlinkage void handle_dsemulret(void); 57 extern asmlinkage void handle_dsemulret(void);
61 mips_instruction *dsemul_insns; 58 mips_instruction *dsemul_insns;
@@ -91,7 +88,7 @@ int mips_dsemul(struct pt_regs *regs, mips_instruction ir, gpreg_t cpc)
91 */ 88 */
92 89
93 /* Ensure that the two instructions are in the same cache line */ 90 /* Ensure that the two instructions are in the same cache line */
94 dsemul_insns = (mips_instruction *) REG_TO_VA ((regs->regs[29] - sizeof(struct emuframe)) & ~0x7); 91 dsemul_insns = (mips_instruction *) ((regs->regs[29] - sizeof(struct emuframe)) & ~0x7);
95 fr = (struct emuframe *) dsemul_insns; 92 fr = (struct emuframe *) dsemul_insns;
96 93
97 /* Verify that the stack pointer is not competely insane */ 94 /* Verify that the stack pointer is not competely insane */
@@ -104,11 +101,11 @@ int mips_dsemul(struct pt_regs *regs, mips_instruction ir, gpreg_t cpc)
104 err |= __put_user(cpc, &fr->epc); 101 err |= __put_user(cpc, &fr->epc);
105 102
106 if (unlikely(err)) { 103 if (unlikely(err)) {
107 fpuemuprivate.stats.errors++; 104 fpuemustats.errors++;
108 return SIGBUS; 105 return SIGBUS;
109 } 106 }
110 107
111 regs->cp0_epc = VA_TO_REG & fr->emul; 108 regs->cp0_epc = (unsigned long) &fr->emul;
112 109
113 flush_cache_sigtramp((unsigned long)&fr->badinst); 110 flush_cache_sigtramp((unsigned long)&fr->badinst);
114 111
@@ -118,7 +115,7 @@ int mips_dsemul(struct pt_regs *regs, mips_instruction ir, gpreg_t cpc)
118int do_dsemulret(struct pt_regs *xcp) 115int do_dsemulret(struct pt_regs *xcp)
119{ 116{
120 struct emuframe *fr; 117 struct emuframe *fr;
121 gpreg_t epc; 118 unsigned long epc;
122 u32 insn, cookie; 119 u32 insn, cookie;
123 int err = 0; 120 int err = 0;
124 121
@@ -141,7 +138,7 @@ int do_dsemulret(struct pt_regs *xcp)
141 err |= __get_user(cookie, &fr->cookie); 138 err |= __get_user(cookie, &fr->cookie);
142 139
143 if (unlikely(err || (insn != BADINST) || (cookie != BD_COOKIE))) { 140 if (unlikely(err || (insn != BADINST) || (cookie != BD_COOKIE))) {
144 fpuemuprivate.stats.errors++; 141 fpuemustats.errors++;
145 return 0; 142 return 0;
146 } 143 }
147 144
diff --git a/arch/mips/math-emu/dsemul.h b/arch/mips/math-emu/dsemul.h
index dbd85f95268d..091f0e76730f 100644
--- a/arch/mips/math-emu/dsemul.h
+++ b/arch/mips/math-emu/dsemul.h
@@ -1,11 +1,5 @@
1typedef long gpreg_t; 1extern int mips_dsemul(struct pt_regs *regs, mips_instruction ir, unsigned long cpc);
2typedef void *vaddr_t; 2extern int do_dsemulret(struct pt_regs *xcp);
3
4#define REG_TO_VA (vaddr_t)
5#define VA_TO_REG (gpreg_t)
6
7int mips_dsemul(struct pt_regs *regs, mips_instruction ir, gpreg_t cpc);
8int do_dsemulret(struct pt_regs *xcp);
9 3
10/* Instruction which will always cause an address error */ 4/* Instruction which will always cause an address error */
11#define AdELOAD 0x8c000001 /* lw $0,1($0) */ 5#define AdELOAD 0x8c000001 /* lw $0,1($0) */
diff --git a/arch/mips/math-emu/ieee754.c b/arch/mips/math-emu/ieee754.c
index f0a364adbf34..a93c45dbdefd 100644
--- a/arch/mips/math-emu/ieee754.c
+++ b/arch/mips/math-emu/ieee754.c
@@ -31,6 +31,8 @@
31 31
32 32
33#include "ieee754int.h" 33#include "ieee754int.h"
34#include "ieee754sp.h"
35#include "ieee754dp.h"
34 36
35#define DP_EBIAS 1023 37#define DP_EBIAS 1023
36#define DP_EMIN (-1022) 38#define DP_EMIN (-1022)
@@ -40,20 +42,6 @@
40#define SP_EMIN (-126) 42#define SP_EMIN (-126)
41#define SP_EMAX 127 43#define SP_EMAX 127
42 44
43/* indexed by class */
44const char *const ieee754_cname[] = {
45 "Normal",
46 "Zero",
47 "Denormal",
48 "Infinity",
49 "QNaN",
50 "SNaN",
51};
52
53/* the control status register
54*/
55struct ieee754_csr ieee754_csr;
56
57/* special constants 45/* special constants
58*/ 46*/
59 47
diff --git a/arch/mips/math-emu/ieee754.h b/arch/mips/math-emu/ieee754.h
index b8772f46972d..171f177c0f88 100644
--- a/arch/mips/math-emu/ieee754.h
+++ b/arch/mips/math-emu/ieee754.h
@@ -1,13 +1,8 @@
1/* single and double precision fp ops
2 * missing extended precision.
3*/
4/* 1/*
5 * MIPS floating point support 2 * MIPS floating point support
6 * Copyright (C) 1994-2000 Algorithmics Ltd. 3 * Copyright (C) 1994-2000 Algorithmics Ltd.
7 * http://www.algor.co.uk 4 * http://www.algor.co.uk
8 * 5 *
9 * ########################################################################
10 *
11 * This program is free software; you can distribute it and/or modify it 6 * This program is free software; you can distribute it and/or modify it
12 * under the terms of the GNU General Public License (Version 2) as 7 * under the terms of the GNU General Public License (Version 2) as
13 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
@@ -21,20 +16,18 @@
21 * with this program; if not, write to the Free Software Foundation, Inc., 16 * with this program; if not, write to the Free Software Foundation, Inc.,
22 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. 17 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
23 * 18 *
24 * ########################################################################
25 */
26
27/**************************************************************************
28 * Nov 7, 2000 19 * Nov 7, 2000
29 * Modification to allow integration with Linux kernel 20 * Modification to allow integration with Linux kernel
30 * 21 *
31 * Kevin D. Kissell, kevink@mips.com and Carsten Langgard, carstenl@mips.com 22 * Kevin D. Kissell, kevink@mips.com and Carsten Langgard, carstenl@mips.com
32 * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. 23 * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved.
33 *************************************************************************/ 24 */
25#ifndef __ARCH_MIPS_MATH_EMU_IEEE754_H
26#define __ARCH_MIPS_MATH_EMU_IEEE754_H
34 27
35#ifdef __KERNEL__ 28#include <asm/byteorder.h>
36/* Going from Algorithmics to Linux native environment, add this */
37#include <linux/types.h> 29#include <linux/types.h>
30#include <linux/sched.h>
38 31
39/* 32/*
40 * Not very pretty, but the Linux kernel's normal va_list definition 33 * Not very pretty, but the Linux kernel's normal va_list definition
@@ -44,18 +37,7 @@
44#include <stdarg.h> 37#include <stdarg.h>
45#endif 38#endif
46 39
47#else 40#ifdef __LITTLE_ENDIAN
48
49/* Note that __KERNEL__ is taken to mean Linux kernel */
50
51#if #system(OpenBSD)
52#include <machine/types.h>
53#endif
54#include <machine/endian.h>
55
56#endif /* __KERNEL__ */
57
58#if (defined(BYTE_ORDER) && BYTE_ORDER == LITTLE_ENDIAN) || defined(__MIPSEL__)
59struct ieee754dp_konst { 41struct ieee754dp_konst {
60 unsigned mantlo:32; 42 unsigned mantlo:32;
61 unsigned manthi:20; 43 unsigned manthi:20;
@@ -86,13 +68,14 @@ typedef union _ieee754sp {
86} ieee754sp; 68} ieee754sp;
87#endif 69#endif
88 70
89#if (defined(BYTE_ORDER) && BYTE_ORDER == BIG_ENDIAN) || defined(__MIPSEB__) 71#ifdef __BIG_ENDIAN
90struct ieee754dp_konst { 72struct ieee754dp_konst {
91 unsigned sign:1; 73 unsigned sign:1;
92 unsigned bexp:11; 74 unsigned bexp:11;
93 unsigned manthi:20; 75 unsigned manthi:20;
94 unsigned mantlo:32; 76 unsigned mantlo:32;
95}; 77};
78
96typedef union _ieee754dp { 79typedef union _ieee754dp {
97 struct ieee754dp_konst oparts; 80 struct ieee754dp_konst oparts;
98 struct { 81 struct {
@@ -222,7 +205,6 @@ ieee754dp ieee754dp_sqrt(ieee754dp x);
222#define IEEE754_CLASS_INF 0x03 205#define IEEE754_CLASS_INF 0x03
223#define IEEE754_CLASS_SNAN 0x04 206#define IEEE754_CLASS_SNAN 0x04
224#define IEEE754_CLASS_QNAN 0x05 207#define IEEE754_CLASS_QNAN 0x05
225extern const char *const ieee754_cname[];
226 208
227/* exception numbers */ 209/* exception numbers */
228#define IEEE754_INEXACT 0x01 210#define IEEE754_INEXACT 0x01
@@ -251,93 +233,109 @@ extern const char *const ieee754_cname[];
251 233
252/* "normal" comparisons 234/* "normal" comparisons
253*/ 235*/
254static __inline int ieee754sp_eq(ieee754sp x, ieee754sp y) 236static inline int ieee754sp_eq(ieee754sp x, ieee754sp y)
255{ 237{
256 return ieee754sp_cmp(x, y, IEEE754_CEQ, 0); 238 return ieee754sp_cmp(x, y, IEEE754_CEQ, 0);
257} 239}
258 240
259static __inline int ieee754sp_ne(ieee754sp x, ieee754sp y) 241static inline int ieee754sp_ne(ieee754sp x, ieee754sp y)
260{ 242{
261 return ieee754sp_cmp(x, y, 243 return ieee754sp_cmp(x, y,
262 IEEE754_CLT | IEEE754_CGT | IEEE754_CUN, 0); 244 IEEE754_CLT | IEEE754_CGT | IEEE754_CUN, 0);
263} 245}
264 246
265static __inline int ieee754sp_lt(ieee754sp x, ieee754sp y) 247static inline int ieee754sp_lt(ieee754sp x, ieee754sp y)
266{ 248{
267 return ieee754sp_cmp(x, y, IEEE754_CLT, 0); 249 return ieee754sp_cmp(x, y, IEEE754_CLT, 0);
268} 250}
269 251
270static __inline int ieee754sp_le(ieee754sp x, ieee754sp y) 252static inline int ieee754sp_le(ieee754sp x, ieee754sp y)
271{ 253{
272 return ieee754sp_cmp(x, y, IEEE754_CLT | IEEE754_CEQ, 0); 254 return ieee754sp_cmp(x, y, IEEE754_CLT | IEEE754_CEQ, 0);
273} 255}
274 256
275static __inline int ieee754sp_gt(ieee754sp x, ieee754sp y) 257static inline int ieee754sp_gt(ieee754sp x, ieee754sp y)
276{ 258{
277 return ieee754sp_cmp(x, y, IEEE754_CGT, 0); 259 return ieee754sp_cmp(x, y, IEEE754_CGT, 0);
278} 260}
279 261
280 262
281static __inline int ieee754sp_ge(ieee754sp x, ieee754sp y) 263static inline int ieee754sp_ge(ieee754sp x, ieee754sp y)
282{ 264{
283 return ieee754sp_cmp(x, y, IEEE754_CGT | IEEE754_CEQ, 0); 265 return ieee754sp_cmp(x, y, IEEE754_CGT | IEEE754_CEQ, 0);
284} 266}
285 267
286static __inline int ieee754dp_eq(ieee754dp x, ieee754dp y) 268static inline int ieee754dp_eq(ieee754dp x, ieee754dp y)
287{ 269{
288 return ieee754dp_cmp(x, y, IEEE754_CEQ, 0); 270 return ieee754dp_cmp(x, y, IEEE754_CEQ, 0);
289} 271}
290 272
291static __inline int ieee754dp_ne(ieee754dp x, ieee754dp y) 273static inline int ieee754dp_ne(ieee754dp x, ieee754dp y)
292{ 274{
293 return ieee754dp_cmp(x, y, 275 return ieee754dp_cmp(x, y,
294 IEEE754_CLT | IEEE754_CGT | IEEE754_CUN, 0); 276 IEEE754_CLT | IEEE754_CGT | IEEE754_CUN, 0);
295} 277}
296 278
297static __inline int ieee754dp_lt(ieee754dp x, ieee754dp y) 279static inline int ieee754dp_lt(ieee754dp x, ieee754dp y)
298{ 280{
299 return ieee754dp_cmp(x, y, IEEE754_CLT, 0); 281 return ieee754dp_cmp(x, y, IEEE754_CLT, 0);
300} 282}
301 283
302static __inline int ieee754dp_le(ieee754dp x, ieee754dp y) 284static inline int ieee754dp_le(ieee754dp x, ieee754dp y)
303{ 285{
304 return ieee754dp_cmp(x, y, IEEE754_CLT | IEEE754_CEQ, 0); 286 return ieee754dp_cmp(x, y, IEEE754_CLT | IEEE754_CEQ, 0);
305} 287}
306 288
307static __inline int ieee754dp_gt(ieee754dp x, ieee754dp y) 289static inline int ieee754dp_gt(ieee754dp x, ieee754dp y)
308{ 290{
309 return ieee754dp_cmp(x, y, IEEE754_CGT, 0); 291 return ieee754dp_cmp(x, y, IEEE754_CGT, 0);
310} 292}
311 293
312static __inline int ieee754dp_ge(ieee754dp x, ieee754dp y) 294static inline int ieee754dp_ge(ieee754dp x, ieee754dp y)
313{ 295{
314 return ieee754dp_cmp(x, y, IEEE754_CGT | IEEE754_CEQ, 0); 296 return ieee754dp_cmp(x, y, IEEE754_CGT | IEEE754_CEQ, 0);
315} 297}
316 298
317 299
318/* like strtod 300/*
319*/ 301 * Like strtod
302 */
320ieee754dp ieee754dp_fstr(const char *s, char **endp); 303ieee754dp ieee754dp_fstr(const char *s, char **endp);
321char *ieee754dp_tstr(ieee754dp x, int prec, int fmt, int af); 304char *ieee754dp_tstr(ieee754dp x, int prec, int fmt, int af);
322 305
323 306
324/* the control status register 307/*
325*/ 308 * The control status register
326struct ieee754_csr { 309 */
327 unsigned pad:13; 310struct _ieee754_csr {
311#ifdef __BIG_ENDIAN
312 unsigned pad0:7;
328 unsigned nod:1; /* set 1 for no denormalised numbers */ 313 unsigned nod:1; /* set 1 for no denormalised numbers */
329 unsigned cx:5; /* exceptions this operation */ 314 unsigned c:1; /* condition */
315 unsigned pad1:5;
316 unsigned cx:6; /* exceptions this operation */
330 unsigned mx:5; /* exception enable mask */ 317 unsigned mx:5; /* exception enable mask */
331 unsigned sx:5; /* exceptions total */ 318 unsigned sx:5; /* exceptions total */
332 unsigned rm:2; /* current rounding mode */ 319 unsigned rm:2; /* current rounding mode */
320#endif
321#ifdef __LITTLE_ENDIAN
322 unsigned rm:2; /* current rounding mode */
323 unsigned sx:5; /* exceptions total */
324 unsigned mx:5; /* exception enable mask */
325 unsigned cx:6; /* exceptions this operation */
326 unsigned pad1:5;
327 unsigned c:1; /* condition */
328 unsigned nod:1; /* set 1 for no denormalised numbers */
329 unsigned pad0:7;
330#endif
333}; 331};
334extern struct ieee754_csr ieee754_csr; 332#define ieee754_csr (*(struct _ieee754_csr *)(&current->thread.fpu.soft.fcr31))
335 333
336static __inline unsigned ieee754_getrm(void) 334static inline unsigned ieee754_getrm(void)
337{ 335{
338 return (ieee754_csr.rm); 336 return (ieee754_csr.rm);
339} 337}
340static __inline unsigned ieee754_setrm(unsigned rm) 338static inline unsigned ieee754_setrm(unsigned rm)
341{ 339{
342 return (ieee754_csr.rm = rm); 340 return (ieee754_csr.rm = rm);
343} 341}
@@ -345,14 +343,14 @@ static __inline unsigned ieee754_setrm(unsigned rm)
345/* 343/*
346 * get current exceptions 344 * get current exceptions
347 */ 345 */
348static __inline unsigned ieee754_getcx(void) 346static inline unsigned ieee754_getcx(void)
349{ 347{
350 return (ieee754_csr.cx); 348 return (ieee754_csr.cx);
351} 349}
352 350
353/* test for current exception condition 351/* test for current exception condition
354 */ 352 */
355static __inline int ieee754_cxtest(unsigned n) 353static inline int ieee754_cxtest(unsigned n)
356{ 354{
357 return (ieee754_csr.cx & n); 355 return (ieee754_csr.cx & n);
358} 356}
@@ -360,21 +358,21 @@ static __inline int ieee754_cxtest(unsigned n)
360/* 358/*
361 * get sticky exceptions 359 * get sticky exceptions
362 */ 360 */
363static __inline unsigned ieee754_getsx(void) 361static inline unsigned ieee754_getsx(void)
364{ 362{
365 return (ieee754_csr.sx); 363 return (ieee754_csr.sx);
366} 364}
367 365
368/* clear sticky conditions 366/* clear sticky conditions
369*/ 367*/
370static __inline unsigned ieee754_clrsx(void) 368static inline unsigned ieee754_clrsx(void)
371{ 369{
372 return (ieee754_csr.sx = 0); 370 return (ieee754_csr.sx = 0);
373} 371}
374 372
375/* test for sticky exception condition 373/* test for sticky exception condition
376 */ 374 */
377static __inline int ieee754_sxtest(unsigned n) 375static inline int ieee754_sxtest(unsigned n)
378{ 376{
379 return (ieee754_csr.sx & n); 377 return (ieee754_csr.sx & n);
380} 378}
@@ -406,52 +404,34 @@ extern const struct ieee754sp_konst __ieee754sp_spcvals[];
406#define ieee754dp_spcvals ((const ieee754dp *)__ieee754dp_spcvals) 404#define ieee754dp_spcvals ((const ieee754dp *)__ieee754dp_spcvals)
407#define ieee754sp_spcvals ((const ieee754sp *)__ieee754sp_spcvals) 405#define ieee754sp_spcvals ((const ieee754sp *)__ieee754sp_spcvals)
408 406
409/* return infinity with given sign 407/*
410*/ 408 * Return infinity with given sign
411#define ieee754dp_inf(sn) \ 409 */
412 (ieee754dp_spcvals[IEEE754_SPCVAL_PINFINITY+(sn)]) 410#define ieee754dp_inf(sn) (ieee754dp_spcvals[IEEE754_SPCVAL_PINFINITY+(sn)])
413#define ieee754dp_zero(sn) \ 411#define ieee754dp_zero(sn) (ieee754dp_spcvals[IEEE754_SPCVAL_PZERO+(sn)])
414 (ieee754dp_spcvals[IEEE754_SPCVAL_PZERO+(sn)]) 412#define ieee754dp_one(sn) (ieee754dp_spcvals[IEEE754_SPCVAL_PONE+(sn)])
415#define ieee754dp_one(sn) \ 413#define ieee754dp_ten(sn) (ieee754dp_spcvals[IEEE754_SPCVAL_PTEN+(sn)])
416 (ieee754dp_spcvals[IEEE754_SPCVAL_PONE+(sn)]) 414#define ieee754dp_indef() (ieee754dp_spcvals[IEEE754_SPCVAL_INDEF])
417#define ieee754dp_ten(sn) \ 415#define ieee754dp_max(sn) (ieee754dp_spcvals[IEEE754_SPCVAL_PMAX+(sn)])
418 (ieee754dp_spcvals[IEEE754_SPCVAL_PTEN+(sn)]) 416#define ieee754dp_min(sn) (ieee754dp_spcvals[IEEE754_SPCVAL_PMIN+(sn)])
419#define ieee754dp_indef() \ 417#define ieee754dp_mind(sn) (ieee754dp_spcvals[IEEE754_SPCVAL_PMIND+(sn)])
420 (ieee754dp_spcvals[IEEE754_SPCVAL_INDEF]) 418#define ieee754dp_1e31() (ieee754dp_spcvals[IEEE754_SPCVAL_P1E31])
421#define ieee754dp_max(sn) \ 419#define ieee754dp_1e63() (ieee754dp_spcvals[IEEE754_SPCVAL_P1E63])
422 (ieee754dp_spcvals[IEEE754_SPCVAL_PMAX+(sn)]) 420
423#define ieee754dp_min(sn) \ 421#define ieee754sp_inf(sn) (ieee754sp_spcvals[IEEE754_SPCVAL_PINFINITY+(sn)])
424 (ieee754dp_spcvals[IEEE754_SPCVAL_PMIN+(sn)]) 422#define ieee754sp_zero(sn) (ieee754sp_spcvals[IEEE754_SPCVAL_PZERO+(sn)])
425#define ieee754dp_mind(sn) \ 423#define ieee754sp_one(sn) (ieee754sp_spcvals[IEEE754_SPCVAL_PONE+(sn)])
426 (ieee754dp_spcvals[IEEE754_SPCVAL_PMIND+(sn)]) 424#define ieee754sp_ten(sn) (ieee754sp_spcvals[IEEE754_SPCVAL_PTEN+(sn)])
427#define ieee754dp_1e31() \ 425#define ieee754sp_indef() (ieee754sp_spcvals[IEEE754_SPCVAL_INDEF])
428 (ieee754dp_spcvals[IEEE754_SPCVAL_P1E31]) 426#define ieee754sp_max(sn) (ieee754sp_spcvals[IEEE754_SPCVAL_PMAX+(sn)])
429#define ieee754dp_1e63() \ 427#define ieee754sp_min(sn) (ieee754sp_spcvals[IEEE754_SPCVAL_PMIN+(sn)])
430 (ieee754dp_spcvals[IEEE754_SPCVAL_P1E63]) 428#define ieee754sp_mind(sn) (ieee754sp_spcvals[IEEE754_SPCVAL_PMIND+(sn)])
431 429#define ieee754sp_1e31() (ieee754sp_spcvals[IEEE754_SPCVAL_P1E31])
432#define ieee754sp_inf(sn) \ 430#define ieee754sp_1e63() (ieee754sp_spcvals[IEEE754_SPCVAL_P1E63])
433 (ieee754sp_spcvals[IEEE754_SPCVAL_PINFINITY+(sn)]) 431
434#define ieee754sp_zero(sn) \ 432/*
435 (ieee754sp_spcvals[IEEE754_SPCVAL_PZERO+(sn)]) 433 * Indefinite integer value
436#define ieee754sp_one(sn) \ 434 */
437 (ieee754sp_spcvals[IEEE754_SPCVAL_PONE+(sn)])
438#define ieee754sp_ten(sn) \
439 (ieee754sp_spcvals[IEEE754_SPCVAL_PTEN+(sn)])
440#define ieee754sp_indef() \
441 (ieee754sp_spcvals[IEEE754_SPCVAL_INDEF])
442#define ieee754sp_max(sn) \
443 (ieee754sp_spcvals[IEEE754_SPCVAL_PMAX+(sn)])
444#define ieee754sp_min(sn) \
445 (ieee754sp_spcvals[IEEE754_SPCVAL_PMIN+(sn)])
446#define ieee754sp_mind(sn) \
447 (ieee754sp_spcvals[IEEE754_SPCVAL_PMIND+(sn)])
448#define ieee754sp_1e31() \
449 (ieee754sp_spcvals[IEEE754_SPCVAL_P1E31])
450#define ieee754sp_1e63() \
451 (ieee754sp_spcvals[IEEE754_SPCVAL_P1E63])
452
453/* indefinite integer value
454*/
455#define ieee754si_indef() INT_MAX 435#define ieee754si_indef() INT_MAX
456#ifdef LONG_LONG_MAX 436#ifdef LONG_LONG_MAX
457#define ieee754di_indef() LONG_LONG_MAX 437#define ieee754di_indef() LONG_LONG_MAX
@@ -487,3 +467,5 @@ extern void ieee754_xcpt(struct ieee754xctx *xcp);
487/* compat */ 467/* compat */
488#define ieee754dp_fix(x) ieee754dp_tint(x) 468#define ieee754dp_fix(x) ieee754dp_tint(x)
489#define ieee754sp_fix(x) ieee754sp_tint(x) 469#define ieee754sp_fix(x) ieee754sp_tint(x)
470
471#endif /* __ARCH_MIPS_MATH_EMU_IEEE754_H */
diff --git a/arch/mips/math-emu/kernel_linkage.c b/arch/mips/math-emu/kernel_linkage.c
index 4002f0cf79f3..d187ab71c2ff 100644
--- a/arch/mips/math-emu/kernel_linkage.c
+++ b/arch/mips/math-emu/kernel_linkage.c
@@ -27,8 +27,6 @@
27 27
28#include <asm/fpu_emulator.h> 28#include <asm/fpu_emulator.h>
29 29
30extern struct mips_fpu_emulator_private fpuemuprivate;
31
32#define SIGNALLING_NAN 0x7ff800007ff80000LL 30#define SIGNALLING_NAN 0x7ff800007ff80000LL
33 31
34void fpu_emulator_init_fpu(void) 32void fpu_emulator_init_fpu(void)
@@ -65,7 +63,6 @@ int fpu_emulator_save_context(struct sigcontext *sc)
65 &sc->sc_fpregs[i]); 63 &sc->sc_fpregs[i]);
66 } 64 }
67 err |= __put_user(current->thread.fpu.soft.fcr31, &sc->sc_fpc_csr); 65 err |= __put_user(current->thread.fpu.soft.fcr31, &sc->sc_fpc_csr);
68 err |= __put_user(fpuemuprivate.eir, &sc->sc_fpc_eir);
69 66
70 return err; 67 return err;
71} 68}
@@ -81,7 +78,6 @@ int fpu_emulator_restore_context(struct sigcontext *sc)
81 &sc->sc_fpregs[i]); 78 &sc->sc_fpregs[i]);
82 } 79 }
83 err |= __get_user(current->thread.fpu.soft.fcr31, &sc->sc_fpc_csr); 80 err |= __get_user(current->thread.fpu.soft.fcr31, &sc->sc_fpc_csr);
84 err |= __get_user(fpuemuprivate.eir, &sc->sc_fpc_eir);
85 81
86 return err; 82 return err;
87} 83}
@@ -102,7 +98,6 @@ int fpu_emulator_save_context32(struct sigcontext32 *sc)
102 &sc->sc_fpregs[i]); 98 &sc->sc_fpregs[i]);
103 } 99 }
104 err |= __put_user(current->thread.fpu.soft.fcr31, &sc->sc_fpc_csr); 100 err |= __put_user(current->thread.fpu.soft.fcr31, &sc->sc_fpc_csr);
105 err |= __put_user(fpuemuprivate.eir, &sc->sc_fpc_eir);
106 101
107 return err; 102 return err;
108} 103}
@@ -118,7 +113,6 @@ int fpu_emulator_restore_context32(struct sigcontext32 *sc)
118 &sc->sc_fpregs[i]); 113 &sc->sc_fpregs[i]);
119 } 114 }
120 err |= __get_user(current->thread.fpu.soft.fcr31, &sc->sc_fpc_csr); 115 err |= __get_user(current->thread.fpu.soft.fcr31, &sc->sc_fpc_csr);
121 err |= __get_user(fpuemuprivate.eir, &sc->sc_fpc_eir);
122 116
123 return err; 117 return err;
124} 118}
diff --git a/arch/mips/mips-boards/atlas/atlas_int.c b/arch/mips/mips-boards/atlas/atlas_int.c
index 19d4b0792460..bc0ebc69bfb3 100644
--- a/arch/mips/mips-boards/atlas/atlas_int.c
+++ b/arch/mips/mips-boards/atlas/atlas_int.c
@@ -76,14 +76,13 @@ static void end_atlas_irq(unsigned int irq)
76} 76}
77 77
78static struct hw_interrupt_type atlas_irq_type = { 78static struct hw_interrupt_type atlas_irq_type = {
79 "Atlas", 79 .typename = "Atlas",
80 startup_atlas_irq, 80 .startup = startup_atlas_irq,
81 shutdown_atlas_irq, 81 .shutdown = shutdown_atlas_irq,
82 enable_atlas_irq, 82 .enable = enable_atlas_irq,
83 disable_atlas_irq, 83 .disable = disable_atlas_irq,
84 mask_and_ack_atlas_irq, 84 .ack = mask_and_ack_atlas_irq,
85 end_atlas_irq, 85 .end = end_atlas_irq,
86 NULL
87}; 86};
88 87
89static inline int ls1bit32(unsigned int x) 88static inline int ls1bit32(unsigned int x)
diff --git a/arch/mips/mips-boards/atlas/atlas_setup.c b/arch/mips/mips-boards/atlas/atlas_setup.c
index 0a1dd9bbc02e..625843b30bed 100644
--- a/arch/mips/mips-boards/atlas/atlas_setup.c
+++ b/arch/mips/mips-boards/atlas/atlas_setup.c
@@ -50,8 +50,10 @@ const char *get_system_type(void)
50 return "MIPS Atlas"; 50 return "MIPS Atlas";
51} 51}
52 52
53static int __init atlas_setup(void) 53void __init plat_setup(void)
54{ 54{
55 mips_pcibios_init();
56
55 ioport_resource.end = 0x7fffffff; 57 ioport_resource.end = 0x7fffffff;
56 58
57 serial_init (); 59 serial_init ();
@@ -64,12 +66,8 @@ static int __init atlas_setup(void)
64 board_time_init = mips_time_init; 66 board_time_init = mips_time_init;
65 board_timer_setup = mips_timer_setup; 67 board_timer_setup = mips_timer_setup;
66 rtc_get_time = mips_rtc_get_time; 68 rtc_get_time = mips_rtc_get_time;
67
68 return 0;
69} 69}
70 70
71early_initcall(atlas_setup);
72
73static void __init serial_init(void) 71static void __init serial_init(void)
74{ 72{
75#ifdef CONFIG_SERIAL_8250 73#ifdef CONFIG_SERIAL_8250
diff --git a/arch/mips/mips-boards/generic/init.c b/arch/mips/mips-boards/generic/init.c
index 311155d1d3ed..eab5a705e989 100644
--- a/arch/mips/mips-boards/generic/init.c
+++ b/arch/mips/mips-boards/generic/init.c
@@ -1,6 +1,8 @@
1/* 1/*
2 * Carsten Langgaard, carstenl@mips.com 2 * Copyright (C) 1999, 2000, 2004, 2005 MIPS Technologies, Inc.
3 * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved. 3 * All rights reserved.
4 * Authors: Carsten Langgaard <carstenl@mips.com>
5 * Maciej W. Rozycki <macro@mips.com>
4 * 6 *
5 * This program is free software; you can distribute it and/or modify it 7 * 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 8 * under the terms of the GNU General Public License (Version 2) as
@@ -22,18 +24,19 @@
22#include <linux/string.h> 24#include <linux/string.h>
23#include <linux/kernel.h> 25#include <linux/kernel.h>
24 26
25#include <asm/io.h>
26#include <asm/bootinfo.h> 27#include <asm/bootinfo.h>
28#include <asm/gt64120.h>
29#include <asm/io.h>
30#include <asm/system.h>
31#include <asm/cacheflush.h>
32#include <asm/traps.h>
33
27#include <asm/mips-boards/prom.h> 34#include <asm/mips-boards/prom.h>
28#include <asm/mips-boards/generic.h> 35#include <asm/mips-boards/generic.h>
29#ifdef CONFIG_MIPS_GT64120
30#include <asm/gt64120.h>
31#endif
32#include <asm/mips-boards/msc01_pci.h>
33#include <asm/mips-boards/bonito64.h> 36#include <asm/mips-boards/bonito64.h>
34#ifdef CONFIG_MIPS_MALTA 37#include <asm/mips-boards/msc01_pci.h>
38
35#include <asm/mips-boards/malta.h> 39#include <asm/mips-boards/malta.h>
36#endif
37 40
38#ifdef CONFIG_KGDB 41#ifdef CONFIG_KGDB
39extern int rs_kgdb_hook(int, int); 42extern int rs_kgdb_hook(int, int);
@@ -223,8 +226,34 @@ void __init kgdb_config (void)
223} 226}
224#endif 227#endif
225 228
229void __init mips_nmi_setup (void)
230{
231 void *base;
232 extern char except_vec_nmi;
233
234 base = cpu_has_veic ?
235 (void *)(CAC_BASE + 0xa80) :
236 (void *)(CAC_BASE + 0x380);
237 memcpy(base, &except_vec_nmi, 0x80);
238 flush_icache_range((unsigned long)base, (unsigned long)base + 0x80);
239}
240
241void __init mips_ejtag_setup (void)
242{
243 void *base;
244 extern char except_vec_ejtag_debug;
245
246 base = cpu_has_veic ?
247 (void *)(CAC_BASE + 0xa00) :
248 (void *)(CAC_BASE + 0x300);
249 memcpy(base, &except_vec_ejtag_debug, 0x80);
250 flush_icache_range((unsigned long)base, (unsigned long)base + 0x80);
251}
252
226void __init prom_init(void) 253void __init prom_init(void)
227{ 254{
255 u32 start, map, mask, data;
256
228 prom_argc = fw_arg0; 257 prom_argc = fw_arg0;
229 _prom_argv = (int *) fw_arg1; 258 _prom_argv = (int *) fw_arg1;
230 _prom_envp = (int *) fw_arg2; 259 _prom_envp = (int *) fw_arg2;
@@ -266,12 +295,15 @@ void __init prom_init(void)
266#else 295#else
267 GT_WRITE(GT_PCI0_CMD_OFS, 0); 296 GT_WRITE(GT_PCI0_CMD_OFS, 0);
268#endif 297#endif
298 /* Fix up PCI I/O mapping if necessary (for Atlas). */
299 start = GT_READ(GT_PCI0IOLD_OFS);
300 map = GT_READ(GT_PCI0IOREMAP_OFS);
301 if ((start & map) != 0) {
302 map &= ~start;
303 GT_WRITE(GT_PCI0IOREMAP_OFS, map);
304 }
269 305
270#ifdef CONFIG_MIPS_MALTA
271 set_io_port_base(MALTA_GT_PORT_BASE); 306 set_io_port_base(MALTA_GT_PORT_BASE);
272#else
273 set_io_port_base((unsigned long)ioremap(0, 0x20000000));
274#endif
275 break; 307 break;
276 308
277 case MIPS_REVISION_CORID_CORE_EMUL_BON: 309 case MIPS_REVISION_CORID_CORE_EMUL_BON:
@@ -300,18 +332,21 @@ void __init prom_init(void)
300 BONITO_BONGENCFG_BYTESWAP; 332 BONITO_BONGENCFG_BYTESWAP;
301#endif 333#endif
302 334
303#ifdef CONFIG_MIPS_MALTA
304 set_io_port_base(MALTA_BONITO_PORT_BASE); 335 set_io_port_base(MALTA_BONITO_PORT_BASE);
305#else
306 set_io_port_base((unsigned long)ioremap(0, 0x20000000));
307#endif
308 break; 336 break;
309 337
310 case MIPS_REVISION_CORID_CORE_MSC: 338 case MIPS_REVISION_CORID_CORE_MSC:
311 case MIPS_REVISION_CORID_CORE_FPGA2: 339 case MIPS_REVISION_CORID_CORE_FPGA2:
340 case MIPS_REVISION_CORID_CORE_FPGA3:
312 case MIPS_REVISION_CORID_CORE_EMUL_MSC: 341 case MIPS_REVISION_CORID_CORE_EMUL_MSC:
313 _pcictrl_msc = (unsigned long)ioremap(MIPS_MSC01_PCI_REG_BASE, 0x2000); 342 _pcictrl_msc = (unsigned long)ioremap(MIPS_MSC01_PCI_REG_BASE, 0x2000);
314 343
344 mb();
345 MSC_READ(MSC01_PCI_CFG, data);
346 MSC_WRITE(MSC01_PCI_CFG, data & ~MSC01_PCI_CFG_EN_BIT);
347 wmb();
348
349 /* Fix up lane swapping. */
315#ifdef CONFIG_CPU_LITTLE_ENDIAN 350#ifdef CONFIG_CPU_LITTLE_ENDIAN
316 MSC_WRITE(MSC01_PCI_SWAP, MSC01_PCI_SWAP_NOSWAP); 351 MSC_WRITE(MSC01_PCI_SWAP, MSC01_PCI_SWAP_NOSWAP);
317#else 352#else
@@ -320,12 +355,23 @@ void __init prom_init(void)
320 MSC01_PCI_SWAP_BYTESWAP << MSC01_PCI_SWAP_MEM_SHF | 355 MSC01_PCI_SWAP_BYTESWAP << MSC01_PCI_SWAP_MEM_SHF |
321 MSC01_PCI_SWAP_BYTESWAP << MSC01_PCI_SWAP_BAR0_SHF); 356 MSC01_PCI_SWAP_BYTESWAP << MSC01_PCI_SWAP_BAR0_SHF);
322#endif 357#endif
358 /* Fix up target memory mapping. */
359 MSC_READ(MSC01_PCI_BAR0, mask);
360 MSC_WRITE(MSC01_PCI_P2SCMSKL, mask & MSC01_PCI_BAR0_SIZE_MSK);
361
362 /* Don't handle target retries indefinitely. */
363 if ((data & MSC01_PCI_CFG_MAXRTRY_MSK) ==
364 MSC01_PCI_CFG_MAXRTRY_MSK)
365 data = (data & ~(MSC01_PCI_CFG_MAXRTRY_MSK <<
366 MSC01_PCI_CFG_MAXRTRY_SHF)) |
367 ((MSC01_PCI_CFG_MAXRTRY_MSK - 1) <<
368 MSC01_PCI_CFG_MAXRTRY_SHF);
369
370 wmb();
371 MSC_WRITE(MSC01_PCI_CFG, data);
372 mb();
323 373
324#ifdef CONFIG_MIPS_MALTA
325 set_io_port_base(MALTA_MSC_PORT_BASE); 374 set_io_port_base(MALTA_MSC_PORT_BASE);
326#else
327 set_io_port_base((unsigned long)ioremap(0, 0x20000000));
328#endif
329 break; 375 break;
330 376
331 default: 377 default:
@@ -334,6 +380,9 @@ void __init prom_init(void)
334 while(1); /* We die here... */ 380 while(1); /* We die here... */
335 } 381 }
336#endif 382#endif
383 board_nmi_handler_setup = mips_nmi_setup;
384 board_ejtag_handler_setup = mips_ejtag_setup;
385
337 prom_printf("\nLINUX started...\n"); 386 prom_printf("\nLINUX started...\n");
338 prom_init_cmdline(); 387 prom_init_cmdline();
339 prom_meminit(); 388 prom_meminit();
diff --git a/arch/mips/mips-boards/generic/memory.c b/arch/mips/mips-boards/generic/memory.c
index 5ae2b43e4c2e..2c8afd77a20b 100644
--- a/arch/mips/mips-boards/generic/memory.c
+++ b/arch/mips/mips-boards/generic/memory.c
@@ -22,6 +22,7 @@
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/mm.h> 23#include <linux/mm.h>
24#include <linux/bootmem.h> 24#include <linux/bootmem.h>
25#include <linux/string.h>
25 26
26#include <asm/bootinfo.h> 27#include <asm/bootinfo.h>
27#include <asm/page.h> 28#include <asm/page.h>
@@ -55,18 +56,30 @@ struct prom_pmemblock * __init prom_getmdesc(void)
55{ 56{
56 char *memsize_str; 57 char *memsize_str;
57 unsigned int memsize; 58 unsigned int memsize;
59 char cmdline[CL_SIZE], *ptr;
58 60
59 memsize_str = prom_getenv("memsize"); 61 /* Check the command line first for a memsize directive */
60 if (!memsize_str) { 62 strcpy(cmdline, arcs_cmdline);
61 prom_printf("memsize not set in boot prom, set to default (32Mb)\n"); 63 ptr = strstr(cmdline, "memsize=");
62 memsize = 0x02000000; 64 if (ptr && (ptr != cmdline) && (*(ptr - 1) != ' '))
63 } else { 65 ptr = strstr(ptr, " memsize=");
66
67 if (ptr) {
68 memsize = memparse(ptr + 8, &ptr);
69 }
70 else {
71 /* otherwise look in the environment */
72 memsize_str = prom_getenv("memsize");
73 if (!memsize_str) {
74 prom_printf("memsize not set in boot prom, set to default (32Mb)\n");
75 memsize = 0x02000000;
76 } else {
64#ifdef DEBUG 77#ifdef DEBUG
65 prom_printf("prom_memsize = %s\n", memsize_str); 78 prom_printf("prom_memsize = %s\n", memsize_str);
66#endif 79#endif
67 memsize = simple_strtol(memsize_str, NULL, 0); 80 memsize = simple_strtol(memsize_str, NULL, 0);
81 }
68 } 82 }
69
70 memset(mdesc, 0, sizeof(mdesc)); 83 memset(mdesc, 0, sizeof(mdesc));
71 84
72 mdesc[0].type = yamon_dontuse; 85 mdesc[0].type = yamon_dontuse;
diff --git a/arch/mips/mips-boards/generic/mipsIRQ.S b/arch/mips/mips-boards/generic/mipsIRQ.S
index 131f49bccb20..a397ecb872d6 100644
--- a/arch/mips/mips-boards/generic/mipsIRQ.S
+++ b/arch/mips/mips-boards/generic/mipsIRQ.S
@@ -29,6 +29,20 @@
29#include <asm/regdef.h> 29#include <asm/regdef.h>
30#include <asm/stackframe.h> 30#include <asm/stackframe.h>
31 31
32#ifdef CONFIG_MIPS_ATLAS
33#include <asm/mips-boards/atlasint.h>
34#define CASCADE_IRQ MIPSCPU_INT_ATLAS
35#define CASCADE_DISPATCH atlas_hw0_irqdispatch
36#endif
37#ifdef CONFIG_MIPS_MALTA
38#include <asm/mips-boards/maltaint.h>
39#define CASCADE_IRQ MIPSCPU_INT_I8259A
40#define CASCADE_DISPATCH malta_hw0_irqdispatch
41#endif
42#ifdef CONFIG_MIPS_SEAD
43#include <asm/mips-boards/seadint.h>
44#endif
45
32/* A lot of complication here is taken away because: 46/* A lot of complication here is taken away because:
33 * 47 *
34 * 1) We handle one interrupt and return, sitting in a loop and moving across 48 * 1) We handle one interrupt and return, sitting in a loop and moving across
@@ -80,74 +94,62 @@
80 94
81 mfc0 s0, CP0_CAUSE # get irq bits 95 mfc0 s0, CP0_CAUSE # get irq bits
82 mfc0 s1, CP0_STATUS # get irq mask 96 mfc0 s1, CP0_STATUS # get irq mask
97 andi s0, ST0_IM # CAUSE.CE may be non-zero!
83 and s0, s1 98 and s0, s1
84 99
85 /* First we check for r4k counter/timer IRQ. */ 100#if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64)
86 andi a0, s0, CAUSEF_IP7 101 .set mips32
87 beq a0, zero, 1f 102 clz a0, s0
88 andi a0, s0, CAUSEF_IP2 # delay slot, check hw0 interrupt 103 .set mips0
104 negu a0
105 addu a0, 31-CAUSEB_IP
106 bltz a0, spurious
107#else
108 beqz s0, spurious
109 li a0, 7
89 110
90 /* Wheee, a timer interrupt. */ 111 and t0, s0, 0xf000
91 move a0, sp 112 sltiu t0, t0, 1
92 jal mips_timer_interrupt 113 sll t0, 2
93 nop 114 subu a0, t0
115 sll s0, t0
94 116
95 j ret_from_irq 117 and t0, s0, 0xc000
96 nop 118 sltiu t0, t0, 1
119 sll t0, 1
120 subu a0, t0
121 sll s0, t0
97 122
981: 123 and t0, s0, 0x8000
99#if defined(CONFIG_MIPS_SEAD) 124 sltiu t0, t0, 1
100 beq a0, zero, 1f 125 # sll t0, 0
101 andi a0, s0, CAUSEF_IP3 # delay slot, check hw1 interrupt 126 subu a0, t0
102#else 127 # sll s0, t0
103 beq a0, zero, 1f # delay slot, check hw3 interrupt
104 andi a0, s0, CAUSEF_IP5
105#endif 128#endif
106 129
107 /* Wheee, combined hardware level zero interrupt. */ 130#ifdef CASCADE_IRQ
108#if defined(CONFIG_MIPS_ATLAS) 131 li a1, CASCADE_IRQ
109 jal atlas_hw0_irqdispatch 132 bne a0, a1, 1f
110#elif defined(CONFIG_MIPS_MALTA) 133 addu a0, MIPSCPU_INT_BASE
111 jal malta_hw0_irqdispatch
112#elif defined(CONFIG_MIPS_SEAD)
113 jal sead_hw0_irqdispatch
114#else
115#error "MIPS board not supported\n"
116#endif
117 move a0, sp # delay slot
118 134
119 j ret_from_irq 135 jal CASCADE_DISPATCH
120 nop # delay slot 136 move a0, sp
121 137
1221:
123#if defined(CONFIG_MIPS_SEAD)
124 beq a0, zero, 1f
125 andi a0, s0, CAUSEF_IP5 # delay slot, check hw3 interrupt
126 jal sead_hw1_irqdispatch
127 move a0, sp # delay slot
128 j ret_from_irq
129 nop # delay slot
1301:
131#endif
132#if defined(CONFIG_MIPS_MALTA)
133 beq a0, zero, 1f # check hw3 (coreHI) interrupt
134 nop
135 jal corehi_irqdispatch
136 move a0, sp
137 j ret_from_irq 138 j ret_from_irq
138 nop 139 nop
1391: 1401:
141#else
142 addu a0, MIPSCPU_INT_BASE
140#endif 143#endif
141 /* 144
142 * Here by mistake? This is possible, what can happen is that by the 145 jal do_IRQ
143 * time we take the exception the IRQ pin goes low, so just leave if 146 move a1, sp
144 * this is the case.
145 */
146 move a1,s0
147 PRINT("Got interrupt: c0_cause = %08x\n")
148 mfc0 a1, CP0_EPC
149 PRINT("c0_epc = %08x\n")
150 147
151 j ret_from_irq 148 j ret_from_irq
152 nop 149 nop
150
151
152spurious:
153 j spurious_interrupt
154 nop
153 END(mipsIRQ) 155 END(mipsIRQ)
diff --git a/arch/mips/mips-boards/generic/pci.c b/arch/mips/mips-boards/generic/pci.c
index 92c34bda02ae..1f6f9df74ab2 100644
--- a/arch/mips/mips-boards/generic/pci.c
+++ b/arch/mips/mips-boards/generic/pci.c
@@ -1,6 +1,8 @@
1/* 1/*
2 * Carsten Langgaard, carstenl@mips.com 2 * Copyright (C) 1999, 2000, 2004, 2005 MIPS Technologies, Inc.
3 * Copyright (C) 1999, 2000 MIPS Technologies, Inc. All rights reserved. 3 * All rights reserved.
4 * Authors: Carsten Langgaard <carstenl@mips.com>
5 * Maciej W. Rozycki <macro@mips.com>
4 * 6 *
5 * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org) 7 * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org)
6 * 8 *
@@ -19,65 +21,46 @@
19 * 21 *
20 * MIPS boards specific PCI support. 22 * MIPS boards specific PCI support.
21 */ 23 */
22#include <linux/config.h>
23#include <linux/types.h> 24#include <linux/types.h>
24#include <linux/pci.h> 25#include <linux/pci.h>
25#include <linux/kernel.h> 26#include <linux/kernel.h>
26#include <linux/init.h> 27#include <linux/init.h>
27 28
28#include <asm/mips-boards/generic.h>
29#include <asm/gt64120.h> 29#include <asm/gt64120.h>
30
31#include <asm/mips-boards/generic.h>
30#include <asm/mips-boards/bonito64.h> 32#include <asm/mips-boards/bonito64.h>
31#include <asm/mips-boards/msc01_pci.h> 33#include <asm/mips-boards/msc01_pci.h>
32#ifdef CONFIG_MIPS_MALTA
33#include <asm/mips-boards/malta.h>
34#endif
35 34
36static struct resource bonito64_mem_resource = { 35static struct resource bonito64_mem_resource = {
37 .name = "Bonito PCI MEM", 36 .name = "Bonito PCI MEM",
38 .start = 0x10000000UL,
39 .end = 0x1bffffffUL,
40 .flags = IORESOURCE_MEM, 37 .flags = IORESOURCE_MEM,
41}; 38};
42 39
43static struct resource bonito64_io_resource = { 40static struct resource bonito64_io_resource = {
44 .name = "Bonito IO MEM", 41 .name = "Bonito PCI I/O",
45 .start = 0x00002000UL, /* avoid conflicts with YAMON allocated I/O addresses */ 42 .start = 0x00000000UL,
46 .end = 0x000fffffUL, 43 .end = 0x000fffffUL,
47 .flags = IORESOURCE_IO, 44 .flags = IORESOURCE_IO,
48}; 45};
49 46
50static struct resource gt64120_mem_resource = { 47static struct resource gt64120_mem_resource = {
51 .name = "GT64120 PCI MEM", 48 .name = "GT-64120 PCI MEM",
52 .start = 0x10000000UL,
53 .end = 0x1bdfffffUL,
54 .flags = IORESOURCE_MEM, 49 .flags = IORESOURCE_MEM,
55}; 50};
56 51
57static struct resource gt64120_io_resource = { 52static struct resource gt64120_io_resource = {
58 .name = "GT64120 IO MEM", 53 .name = "GT-64120 PCI I/O",
59#ifdef CONFIG_MIPS_ATLAS
60 .start = 0x18000000UL,
61 .end = 0x181fffffUL,
62#endif
63#ifdef CONFIG_MIPS_MALTA
64 .start = 0x00002000UL,
65 .end = 0x001fffffUL,
66#endif
67 .flags = IORESOURCE_IO, 54 .flags = IORESOURCE_IO,
68}; 55};
69 56
70static struct resource msc_mem_resource = { 57static struct resource msc_mem_resource = {
71 .name = "MSC PCI MEM", 58 .name = "MSC PCI MEM",
72 .start = 0x10000000UL,
73 .end = 0x1fffffffUL,
74 .flags = IORESOURCE_MEM, 59 .flags = IORESOURCE_MEM,
75}; 60};
76 61
77static struct resource msc_io_resource = { 62static struct resource msc_io_resource = {
78 .name = "MSC IO MEM", 63 .name = "MSC PCI I/O",
79 .start = 0x00002000UL,
80 .end = 0x007fffffUL,
81 .flags = IORESOURCE_IO, 64 .flags = IORESOURCE_IO,
82}; 65};
83 66
@@ -89,7 +72,6 @@ static struct pci_controller bonito64_controller = {
89 .pci_ops = &bonito64_pci_ops, 72 .pci_ops = &bonito64_pci_ops,
90 .io_resource = &bonito64_io_resource, 73 .io_resource = &bonito64_io_resource,
91 .mem_resource = &bonito64_mem_resource, 74 .mem_resource = &bonito64_mem_resource,
92 .mem_offset = 0x10000000UL,
93 .io_offset = 0x00000000UL, 75 .io_offset = 0x00000000UL,
94}; 76};
95 77
@@ -97,21 +79,18 @@ static struct pci_controller gt64120_controller = {
97 .pci_ops = &gt64120_pci_ops, 79 .pci_ops = &gt64120_pci_ops,
98 .io_resource = &gt64120_io_resource, 80 .io_resource = &gt64120_io_resource,
99 .mem_resource = &gt64120_mem_resource, 81 .mem_resource = &gt64120_mem_resource,
100 .mem_offset = 0x00000000UL,
101 .io_offset = 0x00000000UL,
102}; 82};
103 83
104static struct pci_controller msc_controller = { 84static struct pci_controller msc_controller = {
105 .pci_ops = &msc_pci_ops, 85 .pci_ops = &msc_pci_ops,
106 .io_resource = &msc_io_resource, 86 .io_resource = &msc_io_resource,
107 .mem_resource = &msc_mem_resource, 87 .mem_resource = &msc_mem_resource,
108 .mem_offset = 0x10000000UL,
109 .io_offset = 0x00000000UL,
110}; 88};
111 89
112static int __init pcibios_init(void) 90void __init mips_pcibios_init(void)
113{ 91{
114 struct pci_controller *controller; 92 struct pci_controller *controller;
93 unsigned long start, end, map, start1, end1, map1, map2, map3, mask;
115 94
116 switch (mips_revision_corid) { 95 switch (mips_revision_corid) {
117 case MIPS_REVISION_CORID_QED_RM5261: 96 case MIPS_REVISION_CORID_QED_RM5261:
@@ -130,34 +109,140 @@ static int __init pcibios_init(void)
130 (0 << GT_PCI0_CFGADDR_DEVNUM_SHF) | /* GT64120 dev */ 109 (0 << GT_PCI0_CFGADDR_DEVNUM_SHF) | /* GT64120 dev */
131 (0 << GT_PCI0_CFGADDR_FUNCTNUM_SHF) | /* Function 0*/ 110 (0 << GT_PCI0_CFGADDR_FUNCTNUM_SHF) | /* Function 0*/
132 ((0x20/4) << GT_PCI0_CFGADDR_REGNUM_SHF) | /* BAR 4*/ 111 ((0x20/4) << GT_PCI0_CFGADDR_REGNUM_SHF) | /* BAR 4*/
133 GT_PCI0_CFGADDR_CONFIGEN_BIT ); 112 GT_PCI0_CFGADDR_CONFIGEN_BIT);
134 113
135 /* Perform the write */ 114 /* Perform the write */
136 GT_WRITE(GT_PCI0_CFGDATA_OFS, CPHYSADDR(MIPS_GT_BASE)); 115 GT_WRITE(GT_PCI0_CFGDATA_OFS, CPHYSADDR(MIPS_GT_BASE));
137 116
117 /* Set up resource ranges from the controller's registers. */
118 start = GT_READ(GT_PCI0M0LD_OFS);
119 end = GT_READ(GT_PCI0M0HD_OFS);
120 map = GT_READ(GT_PCI0M0REMAP_OFS);
121 end = (end & GT_PCI_HD_MSK) | (start & ~GT_PCI_HD_MSK);
122 start1 = GT_READ(GT_PCI0M1LD_OFS);
123 end1 = GT_READ(GT_PCI0M1HD_OFS);
124 map1 = GT_READ(GT_PCI0M1REMAP_OFS);
125 end1 = (end1 & GT_PCI_HD_MSK) | (start1 & ~GT_PCI_HD_MSK);
126 /* Cannot support multiple windows, use the wider. */
127 if (end1 - start1 > end - start) {
128 start = start1;
129 end = end1;
130 map = map1;
131 }
132 mask = ~(start ^ end);
133 /* We don't support remapping with a discontiguous mask. */
134 BUG_ON((start & GT_PCI_HD_MSK) != (map & GT_PCI_HD_MSK) &&
135 mask != ~((mask & -mask) - 1));
136 gt64120_mem_resource.start = start;
137 gt64120_mem_resource.end = end;
138 gt64120_controller.mem_offset = (start & mask) - (map & mask);
139 /* Addresses are 36-bit, so do shifts in the destinations. */
140 gt64120_mem_resource.start <<= GT_PCI_DCRM_SHF;
141 gt64120_mem_resource.end <<= GT_PCI_DCRM_SHF;
142 gt64120_mem_resource.end |= (1 << GT_PCI_DCRM_SHF) - 1;
143 gt64120_controller.mem_offset <<= GT_PCI_DCRM_SHF;
144
145 start = GT_READ(GT_PCI0IOLD_OFS);
146 end = GT_READ(GT_PCI0IOHD_OFS);
147 map = GT_READ(GT_PCI0IOREMAP_OFS);
148 end = (end & GT_PCI_HD_MSK) | (start & ~GT_PCI_HD_MSK);
149 mask = ~(start ^ end);
150 /* We don't support remapping with a discontiguous mask. */
151 BUG_ON((start & GT_PCI_HD_MSK) != (map & GT_PCI_HD_MSK) &&
152 mask != ~((mask & -mask) - 1));
153 gt64120_io_resource.start = map & mask;
154 gt64120_io_resource.end = (map & mask) | ~mask;
155 gt64120_controller.io_offset = 0;
156 /* Addresses are 36-bit, so do shifts in the destinations. */
157 gt64120_io_resource.start <<= GT_PCI_DCRM_SHF;
158 gt64120_io_resource.end <<= GT_PCI_DCRM_SHF;
159 gt64120_io_resource.end |= (1 << GT_PCI_DCRM_SHF) - 1;
160
138 controller = &gt64120_controller; 161 controller = &gt64120_controller;
139 break; 162 break;
140 163
141 case MIPS_REVISION_CORID_BONITO64: 164 case MIPS_REVISION_CORID_BONITO64:
142 case MIPS_REVISION_CORID_CORE_20K: 165 case MIPS_REVISION_CORID_CORE_20K:
143 case MIPS_REVISION_CORID_CORE_EMUL_BON: 166 case MIPS_REVISION_CORID_CORE_EMUL_BON:
167 /* Set up resource ranges from the controller's registers. */
168 map = BONITO_PCIMAP;
169 map1 = (BONITO_PCIMAP & BONITO_PCIMAP_PCIMAP_LO0) >>
170 BONITO_PCIMAP_PCIMAP_LO0_SHIFT;
171 map2 = (BONITO_PCIMAP & BONITO_PCIMAP_PCIMAP_LO1) >>
172 BONITO_PCIMAP_PCIMAP_LO1_SHIFT;
173 map3 = (BONITO_PCIMAP & BONITO_PCIMAP_PCIMAP_LO2) >>
174 BONITO_PCIMAP_PCIMAP_LO2_SHIFT;
175 /* Combine as many adjacent windows as possible. */
176 map = map1;
177 start = BONITO_PCILO0_BASE;
178 end = 1;
179 if (map3 == map2 + 1) {
180 map = map2;
181 start = BONITO_PCILO1_BASE;
182 end++;
183 }
184 if (map2 == map1 + 1) {
185 map = map1;
186 start = BONITO_PCILO0_BASE;
187 end++;
188 }
189 bonito64_mem_resource.start = start;
190 bonito64_mem_resource.end = start +
191 BONITO_PCIMAP_WINBASE(end) - 1;
192 bonito64_controller.mem_offset = start -
193 BONITO_PCIMAP_WINBASE(map);
194
144 controller = &bonito64_controller; 195 controller = &bonito64_controller;
145 break; 196 break;
146 197
147 case MIPS_REVISION_CORID_CORE_MSC: 198 case MIPS_REVISION_CORID_CORE_MSC:
148 case MIPS_REVISION_CORID_CORE_FPGA2: 199 case MIPS_REVISION_CORID_CORE_FPGA2:
200 case MIPS_REVISION_CORID_CORE_FPGA3:
149 case MIPS_REVISION_CORID_CORE_EMUL_MSC: 201 case MIPS_REVISION_CORID_CORE_EMUL_MSC:
202 /* Set up resource ranges from the controller's registers. */
203 MSC_READ(MSC01_PCI_SC2PMBASL, start);
204 MSC_READ(MSC01_PCI_SC2PMMSKL, mask);
205 MSC_READ(MSC01_PCI_SC2PMMAPL, map);
206 msc_mem_resource.start = start & mask;
207 msc_mem_resource.end = (start & mask) | ~mask;
208 msc_controller.mem_offset = (start & mask) - (map & mask);
209
210 MSC_READ(MSC01_PCI_SC2PIOBASL, start);
211 MSC_READ(MSC01_PCI_SC2PIOMSKL, mask);
212 MSC_READ(MSC01_PCI_SC2PIOMAPL, map);
213 msc_io_resource.start = map & mask;
214 msc_io_resource.end = (map & mask) | ~mask;
215 msc_controller.io_offset = 0;
216 ioport_resource.end = ~mask;
217
218 /* If ranges overlap I/O takes precedence. */
219 start = start & mask;
220 end = start | ~mask;
221 if ((start >= msc_mem_resource.start &&
222 start <= msc_mem_resource.end) ||
223 (end >= msc_mem_resource.start &&
224 end <= msc_mem_resource.end)) {
225 /* Use the larger space. */
226 start = max(start, msc_mem_resource.start);
227 end = min(end, msc_mem_resource.end);
228 if (start - msc_mem_resource.start >=
229 msc_mem_resource.end - end)
230 msc_mem_resource.end = start - 1;
231 else
232 msc_mem_resource.start = end + 1;
233 }
234
150 controller = &msc_controller; 235 controller = &msc_controller;
151 break; 236 break;
152 default: 237 default:
153 return 1; 238 return;
154 } 239 }
155 240
241 if (controller->io_resource->start < 0x00001000UL) /* FIXME */
242 controller->io_resource->start = 0x00001000UL;
243
244 iomem_resource.end &= 0xfffffffffULL; /* 64 GB */
156 ioport_resource.end = controller->io_resource->end; 245 ioport_resource.end = controller->io_resource->end;
157 246
158 register_pci_controller (controller); 247 register_pci_controller (controller);
159
160 return 0;
161} 248}
162
163early_initcall(pcibios_init);
diff --git a/arch/mips/mips-boards/generic/time.c b/arch/mips/mips-boards/generic/time.c
index 16315444dd5a..72a12d931cba 100644
--- a/arch/mips/mips-boards/generic/time.c
+++ b/arch/mips/mips-boards/generic/time.c
@@ -31,22 +31,21 @@
31 31
32#include <asm/mipsregs.h> 32#include <asm/mipsregs.h>
33#include <asm/ptrace.h> 33#include <asm/ptrace.h>
34#include <asm/hardirq.h>
35#include <asm/irq.h>
34#include <asm/div64.h> 36#include <asm/div64.h>
35#include <asm/cpu.h> 37#include <asm/cpu.h>
36#include <asm/time.h> 38#include <asm/time.h>
37#include <asm/mc146818-time.h> 39#include <asm/mc146818-time.h>
40#include <asm/msc01_ic.h>
38 41
39#include <asm/mips-boards/generic.h> 42#include <asm/mips-boards/generic.h>
40#include <asm/mips-boards/prom.h> 43#include <asm/mips-boards/prom.h>
44#include <asm/mips-boards/maltaint.h>
45#include <asm/mc146818-time.h>
41 46
42unsigned long cpu_khz; 47unsigned long cpu_khz;
43 48
44#if defined(CONFIG_MIPS_SEAD)
45#define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ5)
46#else
47#define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5)
48#endif
49
50#if defined(CONFIG_MIPS_ATLAS) 49#if defined(CONFIG_MIPS_ATLAS)
51static char display_string[] = " LINUX ON ATLAS "; 50static char display_string[] = " LINUX ON ATLAS ";
52#endif 51#endif
@@ -59,20 +58,61 @@ static char display_string[] = " LINUX ON SEAD ";
59static unsigned int display_count = 0; 58static unsigned int display_count = 0;
60#define MAX_DISPLAY_COUNT (sizeof(display_string) - 8) 59#define MAX_DISPLAY_COUNT (sizeof(display_string) - 8)
61 60
62#define MIPS_CPU_TIMER_IRQ (NR_IRQS-1)
63
64static unsigned int timer_tick_count=0; 61static unsigned int timer_tick_count=0;
62static int mips_cpu_timer_irq;
65 63
66void mips_timer_interrupt(struct pt_regs *regs) 64static inline void scroll_display_message(void)
67{ 65{
68 if ((timer_tick_count++ % HZ) == 0) { 66 if ((timer_tick_count++ % HZ) == 0) {
69 mips_display_message(&display_string[display_count++]); 67 mips_display_message(&display_string[display_count++]);
70 if (display_count == MAX_DISPLAY_COUNT) 68 if (display_count == MAX_DISPLAY_COUNT)
71 display_count = 0; 69 display_count = 0;
70 }
71}
72
73static void mips_timer_dispatch (struct pt_regs *regs)
74{
75 do_IRQ (mips_cpu_timer_irq, regs);
76}
72 77
78irqreturn_t mips_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
79{
80#ifdef CONFIG_SMP
81 int cpu = smp_processor_id();
82
83 if (cpu == 0) {
84 /*
85 * CPU 0 handles the global timer interrupt job and process accounting
86 * resets count/compare registers to trigger next timer int.
87 */
88 (void) timer_interrupt(irq, dev_id, regs);
89 scroll_display_message();
90 }
91 else {
92 /* Everyone else needs to reset the timer int here as
93 ll_local_timer_interrupt doesn't */
94 /*
95 * FIXME: need to cope with counter underflow.
96 * More support needs to be added to kernel/time for
97 * counter/timer interrupts on multiple CPU's
98 */
99 write_c0_compare (read_c0_count() + (mips_hpt_frequency/HZ));
100 /*
101 * other CPUs should do profiling and process accounting
102 */
103 local_timer_interrupt (irq, dev_id, regs);
73 } 104 }
74 105
75 ll_timer_interrupt(MIPS_CPU_TIMER_IRQ, regs); 106 return IRQ_HANDLED;
107#else
108 irqreturn_t r;
109
110 r = timer_interrupt(irq, dev_id, regs);
111
112 scroll_display_message();
113
114 return r;
115#endif
76} 116}
77 117
78/* 118/*
@@ -140,10 +180,8 @@ void __init mips_time_init(void)
140 180
141 local_irq_save(flags); 181 local_irq_save(flags);
142 182
143#if defined(CONFIG_MIPS_ATLAS) || defined(CONFIG_MIPS_MALTA)
144 /* Set Data mode - binary. */ 183 /* Set Data mode - binary. */
145 CMOS_WRITE(CMOS_READ(RTC_CONTROL) | RTC_DM_BINARY, RTC_CONTROL); 184 CMOS_WRITE(CMOS_READ(RTC_CONTROL) | RTC_DM_BINARY, RTC_CONTROL);
146#endif
147 185
148 est_freq = estimate_cpu_frequency (); 186 est_freq = estimate_cpu_frequency ();
149 187
@@ -157,11 +195,29 @@ void __init mips_time_init(void)
157 195
158void __init mips_timer_setup(struct irqaction *irq) 196void __init mips_timer_setup(struct irqaction *irq)
159{ 197{
198 if (cpu_has_veic) {
199 set_vi_handler (MSC01E_INT_CPUCTR, mips_timer_dispatch);
200 mips_cpu_timer_irq = MSC01E_INT_BASE + MSC01E_INT_CPUCTR;
201 }
202 else {
203 if (cpu_has_vint)
204 set_vi_handler (MIPSCPU_INT_CPUCTR, mips_timer_dispatch);
205 mips_cpu_timer_irq = MIPSCPU_INT_BASE + MIPSCPU_INT_CPUCTR;
206 }
207
208
160 /* we are using the cpu counter for timer interrupts */ 209 /* we are using the cpu counter for timer interrupts */
161 irq->handler = no_action; /* we use our own handler */ 210 irq->handler = mips_timer_interrupt; /* we use our own handler */
162 setup_irq(MIPS_CPU_TIMER_IRQ, irq); 211 setup_irq(mips_cpu_timer_irq, irq);
212
213#ifdef CONFIG_SMP
214 /* irq_desc(riptor) is a global resource, when the interrupt overlaps
215 on seperate cpu's the first one tries to handle the second interrupt.
216 The effect is that the int remains disabled on the second cpu.
217 Mark the interrupt with IRQ_PER_CPU to avoid any confusion */
218 irq_desc[mips_cpu_timer_irq].status |= IRQ_PER_CPU;
219#endif
163 220
164 /* to generate the first timer interrupt */ 221 /* to generate the first timer interrupt */
165 write_c0_compare (read_c0_count() + mips_hpt_frequency/HZ); 222 write_c0_compare (read_c0_count() + mips_hpt_frequency/HZ);
166 set_c0_status(ALLINTS);
167} 223}
diff --git a/arch/mips/mips-boards/malta/malta_int.c b/arch/mips/mips-boards/malta/malta_int.c
index dd2db35966bc..d06dc5ad6c9e 100644
--- a/arch/mips/mips-boards/malta/malta_int.c
+++ b/arch/mips/mips-boards/malta/malta_int.c
@@ -30,6 +30,7 @@
30#include <linux/random.h> 30#include <linux/random.h>
31 31
32#include <asm/i8259.h> 32#include <asm/i8259.h>
33#include <asm/irq_cpu.h>
33#include <asm/io.h> 34#include <asm/io.h>
34#include <asm/mips-boards/malta.h> 35#include <asm/mips-boards/malta.h>
35#include <asm/mips-boards/maltaint.h> 36#include <asm/mips-boards/maltaint.h>
@@ -37,8 +38,10 @@
37#include <asm/gt64120.h> 38#include <asm/gt64120.h>
38#include <asm/mips-boards/generic.h> 39#include <asm/mips-boards/generic.h>
39#include <asm/mips-boards/msc01_pci.h> 40#include <asm/mips-boards/msc01_pci.h>
41#include <asm/msc01_ic.h>
40 42
41extern asmlinkage void mipsIRQ(void); 43extern asmlinkage void mipsIRQ(void);
44extern void mips_timer_interrupt(void);
42 45
43static DEFINE_SPINLOCK(mips_irq_lock); 46static DEFINE_SPINLOCK(mips_irq_lock);
44 47
@@ -54,6 +57,7 @@ static inline int mips_pcibios_iack(void)
54 switch(mips_revision_corid) { 57 switch(mips_revision_corid) {
55 case MIPS_REVISION_CORID_CORE_MSC: 58 case MIPS_REVISION_CORID_CORE_MSC:
56 case MIPS_REVISION_CORID_CORE_FPGA2: 59 case MIPS_REVISION_CORID_CORE_FPGA2:
60 case MIPS_REVISION_CORID_CORE_FPGA3:
57 case MIPS_REVISION_CORID_CORE_EMUL_MSC: 61 case MIPS_REVISION_CORID_CORE_EMUL_MSC:
58 MSC_READ(MSC01_PCI_IACK, irq); 62 MSC_READ(MSC01_PCI_IACK, irq);
59 irq &= 0xff; 63 irq &= 0xff;
@@ -91,88 +95,86 @@ static inline int mips_pcibios_iack(void)
91 return irq; 95 return irq;
92} 96}
93 97
94static inline int get_int(int *irq) 98static inline int get_int(void)
95{ 99{
96 unsigned long flags; 100 unsigned long flags;
97 101 int irq;
98 spin_lock_irqsave(&mips_irq_lock, flags); 102 spin_lock_irqsave(&mips_irq_lock, flags);
99 103
100 *irq = mips_pcibios_iack(); 104 irq = mips_pcibios_iack();
101 105
102 /* 106 /*
103 * IRQ7 is used to detect spurious interrupts. 107 * The only way we can decide if an interrupt is spurious
104 * The interrupt acknowledge cycle returns IRQ7, if no 108 * is by checking the 8259 registers. This needs a spinlock
105 * interrupts is requested. 109 * on an SMP system, so leave it up to the generic code...
106 * We can differentiate between this situation and a
107 * "Normal" IRQ7 by reading the ISR.
108 */ 110 */
109 if (*irq == 7)
110 {
111 outb(PIIX4_OCW3_SEL | PIIX4_OCW3_ISR,
112 PIIX4_ICTLR1_OCW3);
113 if (!(inb(PIIX4_ICTLR1_OCW3) & (1 << 7))) {
114 spin_unlock_irqrestore(&mips_irq_lock, flags);
115 printk("We got a spurious interrupt from PIIX4.\n");
116 atomic_inc(&irq_err_count);
117 return -1; /* Spurious interrupt. */
118 }
119 }
120 111
121 spin_unlock_irqrestore(&mips_irq_lock, flags); 112 spin_unlock_irqrestore(&mips_irq_lock, flags);
122 113
123 return 0; 114 return irq;
124} 115}
125 116
126void malta_hw0_irqdispatch(struct pt_regs *regs) 117void malta_hw0_irqdispatch(struct pt_regs *regs)
127{ 118{
128 int irq; 119 int irq;
129 120
130 if (get_int(&irq)) 121 irq = get_int();
131 return; /* interrupt has already been cleared */ 122 if (irq < 0)
123 return; /* interrupt has already been cleared */
132 124
133 do_IRQ(irq, regs); 125 do_IRQ(MALTA_INT_BASE+irq, regs);
134} 126}
135 127
136void corehi_irqdispatch(struct pt_regs *regs) 128void corehi_irqdispatch(struct pt_regs *regs)
137{ 129{
138 unsigned int data,datahi; 130 unsigned int intrcause,datalo,datahi;
139 131 unsigned int pcimstat, intisr, inten, intpol, intedge, intsteer, pcicmd, pcibadaddr;
140 /* Mask out corehi interrupt. */
141 clear_c0_status(IE_IRQ3);
142 132
143 printk("CoreHI interrupt, shouldn't happen, so we die here!!!\n"); 133 printk("CoreHI interrupt, shouldn't happen, so we die here!!!\n");
144 printk("epc : %08lx\nStatus: %08lx\nCause : %08lx\nbadVaddr : %08lx\n" 134 printk("epc : %08lx\nStatus: %08lx\nCause : %08lx\nbadVaddr : %08lx\n"
145, regs->cp0_epc, regs->cp0_status, regs->cp0_cause, regs->cp0_badvaddr); 135, regs->cp0_epc, regs->cp0_status, regs->cp0_cause, regs->cp0_badvaddr);
136
137 /* Read all the registers and then print them as there is a
138 problem with interspersed printk's upsetting the Bonito controller.
139 Do it for the others too.
140 */
141
146 switch(mips_revision_corid) { 142 switch(mips_revision_corid) {
147 case MIPS_REVISION_CORID_CORE_MSC: 143 case MIPS_REVISION_CORID_CORE_MSC:
148 case MIPS_REVISION_CORID_CORE_FPGA2: 144 case MIPS_REVISION_CORID_CORE_FPGA2:
149 case MIPS_REVISION_CORID_CORE_EMUL_MSC: 145 case MIPS_REVISION_CORID_CORE_FPGA3:
146 case MIPS_REVISION_CORID_CORE_EMUL_MSC:
147 ll_msc_irq(regs);
150 break; 148 break;
151 case MIPS_REVISION_CORID_QED_RM5261: 149 case MIPS_REVISION_CORID_QED_RM5261:
152 case MIPS_REVISION_CORID_CORE_LV: 150 case MIPS_REVISION_CORID_CORE_LV:
153 case MIPS_REVISION_CORID_CORE_FPGA: 151 case MIPS_REVISION_CORID_CORE_FPGA:
154 case MIPS_REVISION_CORID_CORE_FPGAR2: 152 case MIPS_REVISION_CORID_CORE_FPGAR2:
155 data = GT_READ(GT_INTRCAUSE_OFS); 153 intrcause = GT_READ(GT_INTRCAUSE_OFS);
156 printk("GT_INTRCAUSE = %08x\n", data); 154 datalo = GT_READ(GT_CPUERR_ADDRLO_OFS);
157 data = GT_READ(GT_CPUERR_ADDRLO_OFS);
158 datahi = GT_READ(GT_CPUERR_ADDRHI_OFS); 155 datahi = GT_READ(GT_CPUERR_ADDRHI_OFS);
159 printk("GT_CPUERR_ADDR = %02x%08x\n", datahi, data); 156 printk("GT_INTRCAUSE = %08x\n", intrcause);
157 printk("GT_CPUERR_ADDR = %02x%08x\n", datahi, datalo);
160 break; 158 break;
161 case MIPS_REVISION_CORID_BONITO64: 159 case MIPS_REVISION_CORID_BONITO64:
162 case MIPS_REVISION_CORID_CORE_20K: 160 case MIPS_REVISION_CORID_CORE_20K:
163 case MIPS_REVISION_CORID_CORE_EMUL_BON: 161 case MIPS_REVISION_CORID_CORE_EMUL_BON:
164 data = BONITO_INTISR; 162 pcibadaddr = BONITO_PCIBADADDR;
165 printk("BONITO_INTISR = %08x\n", data); 163 pcimstat = BONITO_PCIMSTAT;
166 data = BONITO_INTEN; 164 intisr = BONITO_INTISR;
167 printk("BONITO_INTEN = %08x\n", data); 165 inten = BONITO_INTEN;
168 data = BONITO_INTPOL; 166 intpol = BONITO_INTPOL;
169 printk("BONITO_INTPOL = %08x\n", data); 167 intedge = BONITO_INTEDGE;
170 data = BONITO_INTEDGE; 168 intsteer = BONITO_INTSTEER;
171 printk("BONITO_INTEDGE = %08x\n", data); 169 pcicmd = BONITO_PCICMD;
172 data = BONITO_INTSTEER; 170 printk("BONITO_INTISR = %08x\n", intisr);
173 printk("BONITO_INTSTEER = %08x\n", data); 171 printk("BONITO_INTEN = %08x\n", inten);
174 data = BONITO_PCICMD; 172 printk("BONITO_INTPOL = %08x\n", intpol);
175 printk("BONITO_PCICMD = %08x\n", data); 173 printk("BONITO_INTEDGE = %08x\n", intedge);
174 printk("BONITO_INTSTEER = %08x\n", intsteer);
175 printk("BONITO_PCICMD = %08x\n", pcicmd);
176 printk("BONITO_PCIBADADDR = %08x\n", pcibadaddr);
177 printk("BONITO_PCIMSTAT = %08x\n", pcimstat);
176 break; 178 break;
177 } 179 }
178 180
@@ -180,8 +182,71 @@ void corehi_irqdispatch(struct pt_regs *regs)
180 die("CoreHi interrupt", regs); 182 die("CoreHi interrupt", regs);
181} 183}
182 184
185static struct irqaction i8259irq = {
186 .handler = no_action,
187 .name = "XT-PIC cascade"
188};
189
190static struct irqaction corehi_irqaction = {
191 .handler = no_action,
192 .name = "CoreHi"
193};
194
195msc_irqmap_t __initdata msc_irqmap[] = {
196 {MSC01C_INT_TMR, MSC01_IRQ_EDGE, 0},
197 {MSC01C_INT_PCI, MSC01_IRQ_LEVEL, 0},
198};
199int __initdata msc_nr_irqs = sizeof(msc_irqmap)/sizeof(msc_irqmap_t);
200
201msc_irqmap_t __initdata msc_eicirqmap[] = {
202 {MSC01E_INT_SW0, MSC01_IRQ_LEVEL, 0},
203 {MSC01E_INT_SW1, MSC01_IRQ_LEVEL, 0},
204 {MSC01E_INT_I8259A, MSC01_IRQ_LEVEL, 0},
205 {MSC01E_INT_SMI, MSC01_IRQ_LEVEL, 0},
206 {MSC01E_INT_COREHI, MSC01_IRQ_LEVEL, 0},
207 {MSC01E_INT_CORELO, MSC01_IRQ_LEVEL, 0},
208 {MSC01E_INT_TMR, MSC01_IRQ_EDGE, 0},
209 {MSC01E_INT_PCI, MSC01_IRQ_LEVEL, 0},
210 {MSC01E_INT_PERFCTR, MSC01_IRQ_LEVEL, 0},
211 {MSC01E_INT_CPUCTR, MSC01_IRQ_LEVEL, 0}
212};
213int __initdata msc_nr_eicirqs = sizeof(msc_eicirqmap)/sizeof(msc_irqmap_t);
214
183void __init arch_init_irq(void) 215void __init arch_init_irq(void)
184{ 216{
185 set_except_vector(0, mipsIRQ); 217 set_except_vector(0, mipsIRQ);
186 init_i8259_irqs(); 218 init_i8259_irqs();
219
220 if (!cpu_has_veic)
221 mips_cpu_irq_init (MIPSCPU_INT_BASE);
222
223 switch(mips_revision_corid) {
224 case MIPS_REVISION_CORID_CORE_MSC:
225 case MIPS_REVISION_CORID_CORE_FPGA2:
226 case MIPS_REVISION_CORID_CORE_FPGA3:
227 case MIPS_REVISION_CORID_CORE_EMUL_MSC:
228 if (cpu_has_veic)
229 init_msc_irqs (MSC01E_INT_BASE, msc_eicirqmap, msc_nr_eicirqs);
230 else
231 init_msc_irqs (MSC01C_INT_BASE, msc_irqmap, msc_nr_irqs);
232 }
233
234 if (cpu_has_veic) {
235 set_vi_handler (MSC01E_INT_I8259A, malta_hw0_irqdispatch);
236 set_vi_handler (MSC01E_INT_COREHI, corehi_irqdispatch);
237 setup_irq (MSC01E_INT_BASE+MSC01E_INT_I8259A, &i8259irq);
238 setup_irq (MSC01E_INT_BASE+MSC01E_INT_COREHI, &corehi_irqaction);
239 }
240 else if (cpu_has_vint) {
241 set_vi_handler (MIPSCPU_INT_I8259A, malta_hw0_irqdispatch);
242 set_vi_handler (MIPSCPU_INT_COREHI, corehi_irqdispatch);
243
244 setup_irq (MIPSCPU_INT_BASE+MIPSCPU_INT_I8259A, &i8259irq);
245 setup_irq (MIPSCPU_INT_BASE+MIPSCPU_INT_COREHI, &corehi_irqaction);
246 }
247 else {
248 set_except_vector(0, mipsIRQ);
249 setup_irq (MIPSCPU_INT_BASE+MIPSCPU_INT_I8259A, &i8259irq);
250 setup_irq (MIPSCPU_INT_BASE+MIPSCPU_INT_COREHI, &corehi_irqaction);
251 }
187} 252}
diff --git a/arch/mips/mips-boards/malta/malta_setup.c b/arch/mips/mips-boards/malta/malta_setup.c
index df6db6419ae9..2209e8a9de34 100644
--- a/arch/mips/mips-boards/malta/malta_setup.c
+++ b/arch/mips/mips-boards/malta/malta_setup.c
@@ -111,10 +111,12 @@ void __init fd_activate(void)
111} 111}
112#endif 112#endif
113 113
114static int __init malta_setup(void) 114void __init plat_setup(void)
115{ 115{
116 unsigned int i; 116 unsigned int i;
117 117
118 mips_pcibios_init();
119
118 /* Request I/O space for devices used on the Malta board. */ 120 /* Request I/O space for devices used on the Malta board. */
119 for (i = 0; i < ARRAY_SIZE(standard_io_resources); i++) 121 for (i = 0; i < ARRAY_SIZE(standard_io_resources); i++)
120 request_resource(&ioport_resource, standard_io_resources+i); 122 request_resource(&ioport_resource, standard_io_resources+i);
@@ -224,8 +226,4 @@ static int __init malta_setup(void)
224 board_time_init = mips_time_init; 226 board_time_init = mips_time_init;
225 board_timer_setup = mips_timer_setup; 227 board_timer_setup = mips_timer_setup;
226 rtc_get_time = mips_rtc_get_time; 228 rtc_get_time = mips_rtc_get_time;
227
228 return 0;
229} 229}
230
231early_initcall(malta_setup);
diff --git a/arch/mips/mips-boards/sead/sead_int.c b/arch/mips/mips-boards/sead/sead_int.c
index e5109657ed5a..e1dd7e009750 100644
--- a/arch/mips/mips-boards/sead/sead_int.c
+++ b/arch/mips/mips-boards/sead/sead_int.c
@@ -2,6 +2,7 @@
2 * Carsten Langgaard, carstenl@mips.com 2 * Carsten Langgaard, carstenl@mips.com
3 * Copyright (C) 2002 MIPS Technologies, Inc. All rights reserved. 3 * Copyright (C) 2002 MIPS Technologies, Inc. All rights reserved.
4 * Copyright (C) 2003 Ralf Baechle (ralf@linux-mips.org) 4 * Copyright (C) 2003 Ralf Baechle (ralf@linux-mips.org)
5 * Copyright (C) 2004 Maciej W. Rozycki
5 * 6 *
6 * This program is free software; you can distribute it and/or modify it 7 * This program is free software; you can distribute it and/or modify it
7 * under the terms of the GNU General Public License (Version 2) as 8 * under the terms of the GNU General Public License (Version 2) as
@@ -21,7 +22,9 @@
21 */ 22 */
22#include <linux/init.h> 23#include <linux/init.h>
23#include <linux/irq.h> 24#include <linux/irq.h>
24#include <linux/interrupt.h> 25
26#include <asm/irq_cpu.h>
27#include <asm/system.h>
25 28
26#include <asm/mips-boards/seadint.h> 29#include <asm/mips-boards/seadint.h>
27 30
@@ -39,13 +42,8 @@ asmlinkage void sead_hw1_irqdispatch(struct pt_regs *regs)
39 42
40void __init arch_init_irq(void) 43void __init arch_init_irq(void)
41{ 44{
42 /* 45 mips_cpu_irq_init(0);
43 * Mask out all interrupt
44 */
45 clear_c0_status(0x0000ff00);
46 46
47 /* Now safe to set the exception vector. */ 47 /* Now safe to set the exception vector. */
48 set_except_vector(0, mipsIRQ); 48 set_except_vector(0, mipsIRQ);
49
50 mips_cpu_irq_init(0);
51} 49}
diff --git a/arch/mips/mips-boards/sead/sead_setup.c b/arch/mips/mips-boards/sead/sead_setup.c
index 29892b88a4fc..de90bec5505e 100644
--- a/arch/mips/mips-boards/sead/sead_setup.c
+++ b/arch/mips/mips-boards/sead/sead_setup.c
@@ -57,8 +57,6 @@ static void __init sead_setup(void)
57 mips_reboot_setup(); 57 mips_reboot_setup();
58} 58}
59 59
60early_initcall(sead_setup);
61
62static void __init serial_init(void) 60static void __init serial_init(void)
63{ 61{
64#ifdef CONFIG_SERIAL_8250 62#ifdef CONFIG_SERIAL_8250
diff --git a/arch/mips/mips-boards/sim/Makefile b/arch/mips/mips-boards/sim/Makefile
new file mode 100644
index 000000000000..5b977de4ecff
--- /dev/null
+++ b/arch/mips/mips-boards/sim/Makefile
@@ -0,0 +1,20 @@
1#
2# Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved.
3#
4# This program is free software; you can distribute it and/or modify it
5# under the terms of the GNU General Public License (Version 2) as
6# published by the Free Software Foundation.
7#
8# This program is distributed in the hope it will be useful, but WITHOUT
9# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11# for more details.
12#
13# You should have received a copy of the GNU General Public License along
14# with this program; if not, write to the Free Software Foundation, Inc.,
15# 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
16#
17
18obj-y := sim_setup.o sim_mem.o sim_time.o sim_printf.o sim_int.o sim_irq.o \
19 sim_cmdline.o
20obj-$(CONFIG_SMP) += sim_smp.o
diff --git a/arch/mips/mips-boards/sim/cmdline.c b/arch/mips/mips-boards/sim/cmdline.c
new file mode 100644
index 000000000000..fef9fbd8e710
--- /dev/null
+++ b/arch/mips/mips-boards/sim/cmdline.c
@@ -0,0 +1,59 @@
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 * Kernel command line creation using the prom monitor (YAMON) argc/argv.
19 */
20#include <linux/init.h>
21#include <linux/string.h>
22
23#include <asm/bootinfo.h>
24
25extern int prom_argc;
26extern int *_prom_argv;
27
28/*
29 * YAMON (32-bit PROM) pass arguments and environment as 32-bit pointer.
30 * This macro take care of sign extension.
31 */
32#define prom_argv(index) ((char *)(((int *)(int)_prom_argv)[(index)]))
33
34char arcs_cmdline[CL_SIZE];
35
36char * __init prom_getcmdline(void)
37{
38 return &(arcs_cmdline[0]);
39}
40
41
42void __init prom_init_cmdline(void)
43{
44 char *cp;
45 int actr;
46
47 actr = 1; /* Always ignore argv[0] */
48
49 cp = &(arcs_cmdline[0]);
50 while(actr < prom_argc) {
51 strcpy(cp, prom_argv(actr));
52 cp += strlen(prom_argv(actr));
53 *cp++ = ' ';
54 actr++;
55 }
56 if (cp != &(arcs_cmdline[0])) /* get rid of trailing space */
57 --cp;
58 *cp = '\0';
59}
diff --git a/arch/mips/mips-boards/sim/sim_IRQ.c b/arch/mips/mips-boards/sim/sim_IRQ.c
new file mode 100644
index 000000000000..9987a85aabeb
--- /dev/null
+++ b/arch/mips/mips-boards/sim/sim_IRQ.c
@@ -0,0 +1,148 @@
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 * Interrupt exception dispatch code.
19 */
20#include <linux/config.h>
21
22#include <asm/asm.h>
23#include <asm/mipsregs.h>
24#include <asm/regdef.h>
25#include <asm/stackframe.h>
26
27/* A lot of complication here is taken away because:
28 *
29 * 1) We handle one interrupt and return, sitting in a loop and moving across
30 * all the pending IRQ bits in the cause register is _NOT_ the answer, the
31 * common case is one pending IRQ so optimize in that direction.
32 *
33 * 2) We need not check against bits in the status register IRQ mask, that
34 * would make this routine slow as hell.
35 *
36 * 3) Linux only thinks in terms of all IRQs on or all IRQs off, nothing in
37 * between like BSD spl() brain-damage.
38 *
39 * Furthermore, the IRQs on the MIPS board look basically (barring software
40 * IRQs which we don't use at all and all external interrupt sources are
41 * combined together on hardware interrupt 0 (MIPS IRQ 2)) like:
42 *
43 * MIPS IRQ Source
44 * -------- ------
45 * 0 Software (ignored)
46 * 1 Software (ignored)
47 * 2 Combined hardware interrupt (hw0)
48 * 3 Hardware (ignored)
49 * 4 Hardware (ignored)
50 * 5 Hardware (ignored)
51 * 6 Hardware (ignored)
52 * 7 R4k timer (what we use)
53 *
54 * Note: On the SEAD board thing are a little bit different.
55 * Here IRQ 2 (hw0) is wired to the UART0 and IRQ 3 (hw1) is wired
56 * wired to UART1.
57 *
58 * We handle the IRQ according to _our_ priority which is:
59 *
60 * Highest ---- R4k Timer
61 * Lowest ---- Combined hardware interrupt
62 *
63 * then we just return, if multiple IRQs are pending then we will just take
64 * another exception, big deal.
65 */
66
67 .text
68 .set noreorder
69 .set noat
70 .align 5
71 NESTED(mipsIRQ, PT_SIZE, sp)
72 SAVE_ALL
73 CLI
74 .set at
75
76 mfc0 s0, CP0_CAUSE # get irq bits
77 mfc0 s1, CP0_STATUS # get irq mask
78 and s0, s1
79
80 /* First we check for r4k counter/timer IRQ. */
81 andi a0, s0, CAUSEF_IP7
82 beq a0, zero, 1f
83 andi a0, s0, CAUSEF_IP2 # delay slot, check hw0 interrupt
84
85 /* Wheee, a timer interrupt. */
86 move a0, sp
87 jal mips_timer_interrupt
88 nop
89
90 j ret_from_irq
91 nop
92
931:
94#if defined(CONFIG_MIPS_SEAD)
95 beq a0, zero, 1f
96 andi a0, s0, CAUSEF_IP3 # delay slot, check hw1 interrupt
97#else
98 beq a0, zero, 1f # delay slot, check hw3 interrupt
99 andi a0, s0, CAUSEF_IP5
100#endif
101
102 /* Wheee, combined hardware level zero interrupt. */
103#if defined(CONFIG_MIPS_ATLAS)
104 jal atlas_hw0_irqdispatch
105#elif defined(CONFIG_MIPS_MALTA)
106 jal malta_hw0_irqdispatch
107#elif defined(CONFIG_MIPS_SEAD)
108 jal sead_hw0_irqdispatch
109#else
110#error "MIPS board not supported\n"
111#endif
112 move a0, sp # delay slot
113
114 j ret_from_irq
115 nop # delay slot
116
1171:
118#if defined(CONFIG_MIPS_SEAD)
119 beq a0, zero, 1f
120 andi a0, s0, CAUSEF_IP5 # delay slot, check hw3 interrupt
121 jal sead_hw1_irqdispatch
122 move a0, sp # delay slot
123 j ret_from_irq
124 nop # delay slot
1251:
126#endif
127#if defined(CONFIG_MIPS_MALTA)
128 beq a0, zero, 1f # check hw3 (coreHI) interrupt
129 nop
130 jal corehi_irqdispatch
131 move a0, sp
132 j ret_from_irq
133 nop
1341:
135#endif
136 /*
137 * Here by mistake? This is possible, what can happen is that by the
138 * time we take the exception the IRQ pin goes low, so just leave if
139 * this is the case.
140 */
141 move a1,s0
142 PRINT("Got interrupt: c0_cause = %08x\n")
143 mfc0 a1, CP0_EPC
144 PRINT("c0_epc = %08x\n")
145
146 j ret_from_irq
147 nop
148 END(mipsIRQ)
diff --git a/arch/mips/mips-boards/sim/sim_cmdline.c b/arch/mips/mips-boards/sim/sim_cmdline.c
new file mode 100644
index 000000000000..9df37c6fca36
--- /dev/null
+++ b/arch/mips/mips-boards/sim/sim_cmdline.c
@@ -0,0 +1,33 @@
1/*
2 * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved.
3 *
4 * This program is free software; you can distribute it and/or modify it
5 * under the terms of the GNU General Public License (Version 2) as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
16 *
17 */
18#include <linux/init.h>
19#include <linux/string.h>
20#include <asm/bootinfo.h>
21
22extern char arcs_cmdline[];
23
24char * __init prom_getcmdline(void)
25{
26 return arcs_cmdline;
27}
28
29
30void __init prom_init_cmdline(void)
31{
32 /* nothing to do */
33}
diff --git a/arch/mips/mips-boards/sim/sim_int.c b/arch/mips/mips-boards/sim/sim_int.c
new file mode 100644
index 000000000000..a4d0a2c05031
--- /dev/null
+++ b/arch/mips/mips-boards/sim/sim_int.c
@@ -0,0 +1,41 @@
1/*
2 * Copyright (C) 1999, 2005 MIPS Technologies, Inc. All rights reserved.
3 *
4 * This program is free software; you can distribute it and/or modify it
5 * under the terms of the GNU General Public License (Version 2) as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
16 *
17 */
18#include <linux/init.h>
19#include <linux/sched.h>
20#include <linux/slab.h>
21#include <linux/interrupt.h>
22#include <linux/kernel_stat.h>
23#include <asm/mips-boards/simint.h>
24
25
26extern void mips_cpu_irq_init(int);
27
28extern asmlinkage void simIRQ(void);
29
30asmlinkage void sim_hw0_irqdispatch(struct pt_regs *regs)
31{
32 do_IRQ(2, regs);
33}
34
35void __init arch_init_irq(void)
36{
37 /* Now safe to set the exception vector. */
38 set_except_vector(0, simIRQ);
39
40 mips_cpu_irq_init(MIPSCPU_INT_BASE);
41}
diff --git a/arch/mips/mips-boards/sim/sim_irq.S b/arch/mips/mips-boards/sim/sim_irq.S
new file mode 100644
index 000000000000..835f0387fcd4
--- /dev/null
+++ b/arch/mips/mips-boards/sim/sim_irq.S
@@ -0,0 +1,99 @@
1/*
2 * Copyright (C) 1999, 2005 MIPS Technologies, Inc. All rights reserved.
3 *
4 * This program is free software; you can distribute it and/or modify it
5 * under the terms of the GNU General Public License (Version 2) as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
16 *
17 * Interrupt exception dispatch code.
18 *
19 */
20#include <linux/config.h>
21
22#include <asm/asm.h>
23#include <asm/mipsregs.h>
24#include <asm/regdef.h>
25#include <asm/stackframe.h>
26
27#include <asm/mips-boards/simint.h>
28
29
30 .text
31 .set noreorder
32 .set noat
33 .align 5
34 NESTED(simIRQ, PT_SIZE, sp)
35 SAVE_ALL
36 CLI
37 .set at
38
39 mfc0 s0, CP0_CAUSE # get irq bits
40 mfc0 s1, CP0_STATUS # get irq mask
41 andi s0, ST0_IM # CAUSE.CE may be non-zero!
42 and s0, s1
43
44#if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64)
45 .set mips32
46 clz a0, s0
47 .set mips0
48 negu a0
49 addu a0, 31-CAUSEB_IP
50 bltz a0, spurious
51#else
52 beqz s0, spurious
53 li a0, 7
54
55 and t0, s0, 0xf000
56 sltiu t0, t0, 1
57 sll t0, 2
58 subu a0, t0
59 sll s0, t0
60
61 and t0, s0, 0xc000
62 sltiu t0, t0, 1
63 sll t0, 1
64 subu a0, t0
65 sll s0, t0
66
67 and t0, s0, 0x8000
68 sltiu t0, t0, 1
69 # sll t0, 0
70 subu a0, t0
71 # sll s0, t0
72#endif
73
74#ifdef CASCADE_IRQ
75 li a1, CASCADE_IRQ
76 bne a0, a1, 1f
77 addu a0, MIPSCPU_INT_BASE
78
79 jal CASCADE_DISPATCH
80 move a0, sp
81
82 j ret_from_irq
83 nop
841:
85#else
86 addu a0, MIPSCPU_INT_BASE
87#endif
88
89 jal do_IRQ
90 move a1, sp
91
92 j ret_from_irq
93 nop
94
95
96spurious:
97 j spurious_interrupt
98 nop
99 END(simIRQ)
diff --git a/arch/mips/mips-boards/sim/sim_mem.c b/arch/mips/mips-boards/sim/sim_mem.c
new file mode 100644
index 000000000000..0dbd7435bb2a
--- /dev/null
+++ b/arch/mips/mips-boards/sim/sim_mem.c
@@ -0,0 +1,129 @@
1/*
2 * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved.
3 *
4 * This program is free software; you can distribute it and/or modify it
5 * under the terms of the GNU General Public License (Version 2) as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
16 *
17 */
18#include <linux/init.h>
19#include <linux/mm.h>
20#include <linux/bootmem.h>
21
22#include <asm/bootinfo.h>
23#include <asm/page.h>
24
25#include <asm/mips-boards/prom.h>
26
27/*#define DEBUG*/
28
29enum simmem_memtypes {
30 simmem_reserved = 0,
31 simmem_free,
32};
33struct prom_pmemblock mdesc[PROM_MAX_PMEMBLOCKS];
34
35#ifdef DEBUG
36static char *mtypes[3] = {
37 "SIM reserved memory",
38 "SIM free memory",
39};
40#endif
41
42/* References to section boundaries */
43extern char _end;
44
45#define PFN_ALIGN(x) (((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK)
46
47
48struct prom_pmemblock * __init prom_getmdesc(void)
49{
50 unsigned int memsize;
51
52 memsize = 0x02000000;
53 prom_printf("Setting default memory size 0x%08x\n", memsize);
54
55 memset(mdesc, 0, sizeof(mdesc));
56
57 mdesc[0].type = simmem_reserved;
58 mdesc[0].base = 0x00000000;
59 mdesc[0].size = 0x00001000;
60
61 mdesc[1].type = simmem_free;
62 mdesc[1].base = 0x00001000;
63 mdesc[1].size = 0x000ff000;
64
65 mdesc[2].type = simmem_reserved;
66 mdesc[2].base = 0x00100000;
67 mdesc[2].size = CPHYSADDR(PFN_ALIGN(&_end)) - mdesc[2].base;
68
69 mdesc[3].type = simmem_free;
70 mdesc[3].base = CPHYSADDR(PFN_ALIGN(&_end));
71 mdesc[3].size = memsize - mdesc[3].base;
72
73 return &mdesc[0];
74}
75
76static int __init prom_memtype_classify (unsigned int type)
77{
78 switch (type) {
79 case simmem_free:
80 return BOOT_MEM_RAM;
81 case simmem_reserved:
82 default:
83 return BOOT_MEM_RESERVED;
84 }
85}
86
87void __init prom_meminit(void)
88{
89 struct prom_pmemblock *p;
90
91 p = prom_getmdesc();
92
93 while (p->size) {
94 long type;
95 unsigned long base, size;
96
97 type = prom_memtype_classify (p->type);
98 base = p->base;
99 size = p->size;
100
101 add_memory_region(base, size, type);
102 p++;
103 }
104}
105
106unsigned long __init prom_free_prom_memory(void)
107{
108 int i;
109 unsigned long freed = 0;
110 unsigned long addr;
111
112 for (i = 0; i < boot_mem_map.nr_map; i++) {
113 if (boot_mem_map.map[i].type != BOOT_MEM_ROM_DATA)
114 continue;
115
116 addr = boot_mem_map.map[i].addr;
117 while (addr < boot_mem_map.map[i].addr
118 + boot_mem_map.map[i].size) {
119 ClearPageReserved(virt_to_page(__va(addr)));
120 set_page_count(virt_to_page(__va(addr)), 1);
121 free_page((unsigned long)__va(addr));
122 addr += PAGE_SIZE;
123 freed += PAGE_SIZE;
124 }
125 }
126 printk("Freeing prom memory: %ldkb freed\n", freed >> 10);
127
128 return freed;
129}
diff --git a/arch/mips/mips-boards/sim/sim_printf.c b/arch/mips/mips-boards/sim/sim_printf.c
new file mode 100644
index 000000000000..3ee5a0b501a6
--- /dev/null
+++ b/arch/mips/mips-boards/sim/sim_printf.c
@@ -0,0 +1,74 @@
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 * Putting things on the screen/serial line using YAMONs facilities.
19 */
20#include <linux/init.h>
21#include <linux/kernel.h>
22#include <linux/serial_reg.h>
23#include <linux/spinlock.h>
24#include <asm/io.h>
25#include <asm/system.h>
26
27static inline unsigned int serial_in(int offset)
28{
29 return inb(0x3f8 + offset);
30}
31
32static inline void serial_out(int offset, int value)
33{
34 outb(value, 0x3f8 + offset);
35}
36
37int putPromChar(char c)
38{
39 while ((serial_in(UART_LSR) & UART_LSR_THRE) == 0)
40 ;
41
42 serial_out(UART_TX, c);
43
44 return 1;
45}
46
47char getPromChar(void)
48{
49 while (!(serial_in(UART_LSR) & 1))
50 ;
51
52 return serial_in(UART_RX);
53}
54
55void prom_printf(char *fmt, ...)
56{
57 va_list args;
58 int l;
59 char *p, *buf_end;
60 char buf[1024];
61
62 va_start(args, fmt);
63 l = vsprintf(buf, fmt, args); /* hopefully i < sizeof(buf) */
64 va_end(args);
65
66 buf_end = buf + l;
67
68 for (p = buf; p < buf_end; p++) {
69 /* Crude cr/nl handling is better than none */
70 if (*p == '\n')
71 putPromChar('\r');
72 putPromChar(*p);
73 }
74}
diff --git a/arch/mips/mips-boards/sim/sim_setup.c b/arch/mips/mips-boards/sim/sim_setup.c
new file mode 100644
index 000000000000..485d5a58d9cf
--- /dev/null
+++ b/arch/mips/mips-boards/sim/sim_setup.c
@@ -0,0 +1,101 @@
1/*
2 * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved.
3 *
4 * This program is free software; you can distribute it and/or modify it
5 * under the terms of the GNU General Public License (Version 2) as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
16 *
17 */
18
19#include <linux/config.h>
20#include <linux/init.h>
21#include <linux/string.h>
22#include <linux/kernel.h>
23#include <linux/ioport.h>
24#include <linux/tty.h>
25#include <linux/serial.h>
26#include <linux/serial_core.h>
27
28#include <asm/cpu.h>
29#include <asm/bootinfo.h>
30#include <asm/irq.h>
31#include <asm/mips-boards/generic.h>
32#include <asm/mips-boards/prom.h>
33#include <asm/serial.h>
34#include <asm/io.h>
35#include <asm/time.h>
36#include <asm/mips-boards/sim.h>
37#include <asm/mips-boards/simint.h>
38
39
40extern void sim_time_init(void);
41extern void sim_timer_setup(struct irqaction *irq);
42static void __init serial_init(void);
43unsigned int _isbonito = 0;
44
45extern void __init sanitize_tlb_entries(void);
46
47
48const char *get_system_type(void)
49{
50 return "MIPSsim";
51}
52
53void __init plat_setup(void)
54{
55 set_io_port_base(0xbfd00000);
56
57 serial_init();
58
59 board_time_init = sim_time_init;
60 board_timer_setup = sim_timer_setup;
61 prom_printf("Linux started...\n");
62
63#ifdef CONFIG_MT_SMP
64 sanitize_tlb_entries();
65#endif
66}
67
68void prom_init(void)
69{
70 set_io_port_base(0xbfd00000);
71
72 prom_printf("\nLINUX started...\n");
73 prom_init_cmdline();
74 prom_meminit();
75}
76
77
78static void __init serial_init(void)
79{
80#ifdef CONFIG_SERIAL_8250
81 struct uart_port s;
82
83 memset(&s, 0, sizeof(s));
84
85 s.iobase = 0x3f8;
86
87 /* hardware int 4 - the serial int, is CPU int 6
88 but poll for now */
89 s.irq = 0;
90 s.uartclk = BASE_BAUD * 16;
91 s.flags = ASYNC_BOOT_AUTOCONF | UPF_SKIP_TEST;
92 s.iotype = SERIAL_IO_PORT | ASYNC_SKIP_TEST;
93 s.regshift = 0;
94 s.timeout = 4;
95
96 if (early_serial_setup(&s) != 0) {
97 prom_printf(KERN_ERR "Serial setup failed!\n");
98 }
99
100#endif
101}
diff --git a/arch/mips/mips-boards/sim/sim_smp.c b/arch/mips/mips-boards/sim/sim_smp.c
new file mode 100644
index 000000000000..19824359f5de
--- /dev/null
+++ b/arch/mips/mips-boards/sim/sim_smp.c
@@ -0,0 +1,151 @@
1/*
2 * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved.
3 *
4 * This program is free software; you can distribute it and/or modify it
5 * under the terms of the GNU General Public License (Version 2) as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
16 *
17 */
18/*
19 * Simulator Platform-specific hooks for SMP operation
20 */
21#include <linux/config.h>
22#include <linux/kernel.h>
23#include <linux/sched.h>
24#include <linux/cpumask.h>
25#include <linux/interrupt.h>
26#include <asm/atomic.h>
27#include <asm/cpu.h>
28#include <asm/processor.h>
29#include <asm/system.h>
30#include <asm/hardirq.h>
31#include <asm/mmu_context.h>
32#include <asm/smp.h>
33#ifdef CONFIG_MIPS_MT_SMTC
34#include <asm/smtc_ipi.h>
35#endif /* CONFIG_MIPS_MT_SMTC */
36
37/* VPE/SMP Prototype implements platform interfaces directly */
38#if !defined(CONFIG_MIPS_MT_SMP)
39
40/*
41 * Cause the specified action to be performed on a targeted "CPU"
42 */
43
44void core_send_ipi(int cpu, unsigned int action)
45{
46#ifdef CONFIG_MIPS_MT_SMTC
47 void smtc_send_ipi(int, int, unsigned int);
48
49 smtc_send_ipi(cpu, LINUX_SMP_IPI, action);
50#endif /* CONFIG_MIPS_MT_SMTC */
51/* "CPU" may be TC of same VPE, VPE of same CPU, or different CPU */
52
53}
54
55/*
56 * Detect available CPUs/VPEs/TCs and populate phys_cpu_present_map
57 */
58
59void __init prom_build_cpu_map(void)
60{
61#ifdef CONFIG_MIPS_MT_SMTC
62 extern int mipsmt_build_cpu_map(int startslot);
63 int nextslot;
64
65 cpus_clear(phys_cpu_present_map);
66
67 /* Register the boot CPU */
68
69 smp_prepare_boot_cpu();
70
71 /*
72 * As of November, 2004, MIPSsim only simulates one core
73 * at a time. However, that core may be a MIPS MT core
74 * with multiple virtual processors and thread contexts.
75 */
76
77 if (read_c0_config3() & (1<<2)) {
78 nextslot = mipsmt_build_cpu_map(1);
79 }
80#endif /* CONFIG_MIPS_MT_SMTC */
81}
82
83/*
84 * Platform "CPU" startup hook
85 */
86
87void prom_boot_secondary(int cpu, struct task_struct *idle)
88{
89#ifdef CONFIG_MIPS_MT_SMTC
90 extern void smtc_boot_secondary(int cpu, struct task_struct *t);
91
92 smtc_boot_secondary(cpu, idle);
93#endif /* CONFIG_MIPS_MT_SMTC */
94}
95
96/*
97 * Post-config but pre-boot cleanup entry point
98 */
99
100void prom_init_secondary(void)
101{
102#ifdef CONFIG_MIPS_MT_SMTC
103 void smtc_init_secondary(void);
104
105 smtc_init_secondary();
106#endif /* CONFIG_MIPS_MT_SMTC */
107}
108
109/*
110 * Platform SMP pre-initialization
111 */
112
113void prom_prepare_cpus(unsigned int max_cpus)
114{
115#ifdef CONFIG_MIPS_MT_SMTC
116 void mipsmt_prepare_cpus(int c);
117 /*
118 * As noted above, we can assume a single CPU for now
119 * but it may be multithreaded.
120 */
121
122 if (read_c0_config3() & (1<<2)) {
123 mipsmt_prepare_cpus(max_cpus);
124 }
125#endif /* CONFIG_MIPS_MT_SMTC */
126}
127
128/*
129 * SMP initialization finalization entry point
130 */
131
132void prom_smp_finish(void)
133{
134#ifdef CONFIG_MIPS_MT_SMTC
135 void smtc_smp_finish(void);
136
137 smtc_smp_finish();
138#endif /* CONFIG_MIPS_MT_SMTC */
139}
140
141/*
142 * Hook for after all CPUs are online
143 */
144
145void prom_cpus_done(void)
146{
147#ifdef CONFIG_MIPS_MT_SMTC
148
149#endif /* CONFIG_MIPS_MT_SMTC */
150}
151#endif /* CONFIG_MIPS32R2_MT_SMP */
diff --git a/arch/mips/mips-boards/sim/sim_time.c b/arch/mips/mips-boards/sim/sim_time.c
new file mode 100644
index 000000000000..18b968c696d1
--- /dev/null
+++ b/arch/mips/mips-boards/sim/sim_time.c
@@ -0,0 +1,215 @@
1#include <linux/types.h>
2#include <linux/config.h>
3#include <linux/init.h>
4#include <linux/kernel_stat.h>
5#include <linux/sched.h>
6#include <linux/spinlock.h>
7
8#include <asm/mipsregs.h>
9#include <asm/ptrace.h>
10#include <asm/hardirq.h>
11#include <asm/div64.h>
12#include <asm/cpu.h>
13#include <asm/time.h>
14
15#include <linux/interrupt.h>
16#include <linux/mc146818rtc.h>
17#include <linux/timex.h>
18#include <asm/mipsregs.h>
19#include <asm/ptrace.h>
20#include <asm/hardirq.h>
21#include <asm/irq.h>
22#include <asm/div64.h>
23#include <asm/cpu.h>
24#include <asm/time.h>
25#include <asm/mc146818-time.h>
26#include <asm/msc01_ic.h>
27
28#include <asm/mips-boards/generic.h>
29#include <asm/mips-boards/prom.h>
30#include <asm/mips-boards/simint.h>
31#include <asm/mc146818-time.h>
32#include <asm/smp.h>
33
34
35unsigned long cpu_khz;
36
37extern asmlinkage void ll_local_timer_interrupt(int irq, struct pt_regs *regs);
38
39irqreturn_t sim_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
40{
41#ifdef CONFIG_SMP
42 int cpu = smp_processor_id();
43
44 /*
45 * CPU 0 handles the global timer interrupt job
46 * resets count/compare registers to trigger next timer int.
47 */
48#ifndef CONFIG_MIPS_MT_SMTC
49 if (cpu == 0) {
50 timer_interrupt(irq, dev_id, regs);
51 }
52 else {
53 /* Everyone else needs to reset the timer int here as
54 ll_local_timer_interrupt doesn't */
55 /*
56 * FIXME: need to cope with counter underflow.
57 * More support needs to be added to kernel/time for
58 * counter/timer interrupts on multiple CPU's
59 */
60 write_c0_compare (read_c0_count() + ( mips_hpt_frequency/HZ));
61 }
62#else /* SMTC */
63 /*
64 * In SMTC system, one Count/Compare set exists per VPE.
65 * Which TC within a VPE gets the interrupt is essentially
66 * random - we only know that it shouldn't be one with
67 * IXMT set. Whichever TC gets the interrupt needs to
68 * send special interprocessor interrupts to the other
69 * TCs to make sure that they schedule, etc.
70 *
71 * That code is specific to the SMTC kernel, not to
72 * the simulation platform, so it's invoked from
73 * the general MIPS timer_interrupt routine.
74 *
75 * We have a problem in that the interrupt vector code
76 * had to turn off the timer IM bit to avoid redundant
77 * entries, but we may never get to mips_cpu_irq_end
78 * to turn it back on again if the scheduler gets
79 * involved. So we clear the pending timer here,
80 * and re-enable the mask...
81 */
82
83 int vpflags = dvpe();
84 write_c0_compare (read_c0_count() - 1);
85 clear_c0_cause(0x100 << MIPSCPU_INT_CPUCTR);
86 set_c0_status(0x100 << MIPSCPU_INT_CPUCTR);
87 irq_enable_hazard();
88 evpe(vpflags);
89
90 if(cpu_data[cpu].vpe_id == 0) timer_interrupt(irq, dev_id, regs);
91 else write_c0_compare (read_c0_count() + ( mips_hpt_frequency/HZ));
92 smtc_timer_broadcast(cpu_data[cpu].vpe_id);
93
94#endif /* CONFIG_MIPS_MT_SMTC */
95
96 /*
97 * every CPU should do profiling and process accounting
98 */
99 local_timer_interrupt (irq, dev_id, regs);
100 return IRQ_HANDLED;
101#else
102 return timer_interrupt (irq, dev_id, regs);
103#endif
104}
105
106
107
108/*
109 * Estimate CPU frequency. Sets mips_counter_frequency as a side-effect
110 */
111static unsigned int __init estimate_cpu_frequency(void)
112{
113 unsigned int prid = read_c0_prid() & 0xffff00;
114 unsigned int count;
115
116#if 1
117 /*
118 * hardwire the board frequency to 12MHz.
119 */
120
121 if ((prid == (PRID_COMP_MIPS | PRID_IMP_20KC)) ||
122 (prid == (PRID_COMP_MIPS | PRID_IMP_25KF)))
123 count = 12000000;
124 else
125 count = 6000000;
126#else
127 unsigned int flags;
128
129 local_irq_save(flags);
130
131 /* Start counter exactly on falling edge of update flag */
132 while (CMOS_READ(RTC_REG_A) & RTC_UIP);
133 while (!(CMOS_READ(RTC_REG_A) & RTC_UIP));
134
135 /* Start r4k counter. */
136 write_c0_count(0);
137
138 /* Read counter exactly on falling edge of update flag */
139 while (CMOS_READ(RTC_REG_A) & RTC_UIP);
140 while (!(CMOS_READ(RTC_REG_A) & RTC_UIP));
141
142 count = read_c0_count();
143
144 /* restore interrupts */
145 local_irq_restore(flags);
146#endif
147
148 mips_hpt_frequency = count;
149
150 if ((prid != (PRID_COMP_MIPS | PRID_IMP_20KC)) &&
151 (prid != (PRID_COMP_MIPS | PRID_IMP_25KF)))
152 count *= 2;
153
154 count += 5000; /* round */
155 count -= count%10000;
156
157 return count;
158}
159
160void __init sim_time_init(void)
161{
162 unsigned int est_freq, flags;
163
164 local_irq_save(flags);
165
166
167 /* Set Data mode - binary. */
168 CMOS_WRITE(CMOS_READ(RTC_CONTROL) | RTC_DM_BINARY, RTC_CONTROL);
169
170
171 est_freq = estimate_cpu_frequency ();
172
173 printk("CPU frequency %d.%02d MHz\n", est_freq/1000000,
174 (est_freq%1000000)*100/1000000);
175
176 cpu_khz = est_freq / 1000;
177
178 local_irq_restore(flags);
179}
180
181static int mips_cpu_timer_irq;
182
183static void mips_timer_dispatch (struct pt_regs *regs)
184{
185 do_IRQ (mips_cpu_timer_irq, regs);
186}
187
188
189void __init sim_timer_setup(struct irqaction *irq)
190{
191 if (cpu_has_veic) {
192 set_vi_handler(MSC01E_INT_CPUCTR, mips_timer_dispatch);
193 mips_cpu_timer_irq = MSC01E_INT_BASE + MSC01E_INT_CPUCTR;
194 }
195 else {
196 if (cpu_has_vint)
197 set_vi_handler(MIPSCPU_INT_CPUCTR, mips_timer_dispatch);
198 mips_cpu_timer_irq = MIPSCPU_INT_BASE + MIPSCPU_INT_CPUCTR;
199 }
200
201 /* we are using the cpu counter for timer interrupts */
202 irq->handler = sim_timer_interrupt;
203 setup_irq(mips_cpu_timer_irq, irq);
204
205#ifdef CONFIG_SMP
206 /* irq_desc(riptor) is a global resource, when the interrupt overlaps
207 on seperate cpu's the first one tries to handle the second interrupt.
208 The effect is that the int remains disabled on the second cpu.
209 Mark the interrupt with IRQ_PER_CPU to avoid any confusion */
210 irq_desc[mips_cpu_timer_irq].status |= IRQ_PER_CPU;
211#endif
212
213 /* to generate the first timer interrupt */
214 write_c0_compare(read_c0_count() + (mips_hpt_frequency/HZ));
215}
diff --git a/arch/mips/mm/Makefile b/arch/mips/mm/Makefile
index b56a0abdc3d4..b0178da019f0 100644
--- a/arch/mips/mm/Makefile
+++ b/arch/mips/mm/Makefile
@@ -22,7 +22,7 @@ obj-$(CONFIG_CPU_R8000) += c-r4k.o cex-gen.o pg-r4k.o tlb-r8k.o
22obj-$(CONFIG_CPU_RM7000) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o 22obj-$(CONFIG_CPU_RM7000) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o
23obj-$(CONFIG_CPU_RM9000) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o 23obj-$(CONFIG_CPU_RM9000) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o
24obj-$(CONFIG_CPU_SB1) += c-sb1.o cerr-sb1.o cex-sb1.o pg-sb1.o \ 24obj-$(CONFIG_CPU_SB1) += c-sb1.o cerr-sb1.o cex-sb1.o pg-sb1.o \
25 tlb-sb1.o 25 tlb-r4k.o
26obj-$(CONFIG_CPU_TX39XX) += c-tx39.o pg-r4k.o tlb-r3k.o 26obj-$(CONFIG_CPU_TX39XX) += c-tx39.o pg-r4k.o tlb-r3k.o
27obj-$(CONFIG_CPU_TX49XX) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o 27obj-$(CONFIG_CPU_TX49XX) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o
28obj-$(CONFIG_CPU_VR41XX) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o 28obj-$(CONFIG_CPU_VR41XX) += 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 c659f99eb39a..27f4fa25e8c9 100644
--- a/arch/mips/mm/c-r3k.c
+++ b/arch/mips/mm/c-r3k.c
@@ -221,12 +221,14 @@ static 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 pmd_t *pmd; 225 pmd_t *pmd;
225 pte_t *pte; 226 pte_t *pte;
226 unsigned long physpage; 227 unsigned long physpage;
227 228
228 pgd = pgd_offset(mm, addr); 229 pgd = pgd_offset(mm, addr);
229 pmd = pmd_offset(pgd, addr); 230 pud = pud_offset(pgd, addr);
231 pmd = pmd_offset(pud, addr);
230 pte = pte_offset(pmd, addr); 232 pte = pte_offset(pmd, addr);
231 233
232 if ((physpage = pte_val(*pte)) & _PAGE_VALID) 234 if ((physpage = pte_val(*pte)) & _PAGE_VALID)
@@ -317,7 +319,7 @@ static void r3k_dma_cache_wback_inv(unsigned long start, unsigned long size)
317 r3k_flush_dcache_range(start, start + size); 319 r3k_flush_dcache_range(start, start + size);
318} 320}
319 321
320void __init ld_mmu_r23000(void) 322void __init r3k_cache_init(void)
321{ 323{
322 extern void build_clear_page(void); 324 extern void build_clear_page(void);
323 extern void build_copy_page(void); 325 extern void build_copy_page(void);
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index 5ea84bc98c6a..38223b44d962 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -16,6 +16,7 @@
16 16
17#include <asm/bcache.h> 17#include <asm/bcache.h>
18#include <asm/bootinfo.h> 18#include <asm/bootinfo.h>
19#include <asm/cache.h>
19#include <asm/cacheops.h> 20#include <asm/cacheops.h>
20#include <asm/cpu.h> 21#include <asm/cpu.h>
21#include <asm/cpu-features.h> 22#include <asm/cpu-features.h>
@@ -26,8 +27,14 @@
26#include <asm/system.h> 27#include <asm/system.h>
27#include <asm/mmu_context.h> 28#include <asm/mmu_context.h>
28#include <asm/war.h> 29#include <asm/war.h>
30#include <asm/cacheflush.h> /* for run_uncached() */
29 31
30static unsigned long icache_size, dcache_size, scache_size; 32/*
33 * Must die.
34 */
35static unsigned long icache_size __read_mostly;
36static unsigned long dcache_size __read_mostly;
37static unsigned long scache_size __read_mostly;
31 38
32/* 39/*
33 * Dummy cache handling routines for machines without boardcaches 40 * Dummy cache handling routines for machines without boardcaches
@@ -43,8 +50,8 @@ static struct bcache_ops no_sc_ops = {
43 50
44struct bcache_ops *bcops = &no_sc_ops; 51struct bcache_ops *bcops = &no_sc_ops;
45 52
46#define cpu_is_r4600_v1_x() ((read_c0_prid() & 0xfffffff0) == 0x2010) 53#define cpu_is_r4600_v1_x() ((read_c0_prid() & 0xfffffff0) == 0x00002010)
47#define cpu_is_r4600_v2_x() ((read_c0_prid() & 0xfffffff0) == 0x2020) 54#define cpu_is_r4600_v2_x() ((read_c0_prid() & 0xfffffff0) == 0x00002020)
48 55
49#define R4600_HIT_CACHEOP_WAR_IMPL \ 56#define R4600_HIT_CACHEOP_WAR_IMPL \
50do { \ 57do { \
@@ -190,12 +197,12 @@ static inline void r4k_blast_icache_page_indexed_setup(void)
190 if (ic_lsize == 16) 197 if (ic_lsize == 16)
191 r4k_blast_icache_page_indexed = blast_icache16_page_indexed; 198 r4k_blast_icache_page_indexed = blast_icache16_page_indexed;
192 else if (ic_lsize == 32) { 199 else if (ic_lsize == 32) {
193 if (TX49XX_ICACHE_INDEX_INV_WAR) 200 if (R4600_V1_INDEX_ICACHEOP_WAR && cpu_is_r4600_v1_x())
194 r4k_blast_icache_page_indexed =
195 tx49_blast_icache32_page_indexed;
196 else if (R4600_V1_INDEX_ICACHEOP_WAR && cpu_is_r4600_v1_x())
197 r4k_blast_icache_page_indexed = 201 r4k_blast_icache_page_indexed =
198 blast_icache32_r4600_v1_page_indexed; 202 blast_icache32_r4600_v1_page_indexed;
203 else if (TX49XX_ICACHE_INDEX_INV_WAR)
204 r4k_blast_icache_page_indexed =
205 tx49_blast_icache32_page_indexed;
199 else 206 else
200 r4k_blast_icache_page_indexed = 207 r4k_blast_icache_page_indexed =
201 blast_icache32_page_indexed; 208 blast_icache32_page_indexed;
@@ -361,24 +368,33 @@ static void r4k_flush_cache_mm(struct mm_struct *mm)
361 368
362struct flush_cache_page_args { 369struct flush_cache_page_args {
363 struct vm_area_struct *vma; 370 struct vm_area_struct *vma;
364 unsigned long page; 371 unsigned long addr;
365}; 372};
366 373
367static inline void local_r4k_flush_cache_page(void *args) 374static inline void local_r4k_flush_cache_page(void *args)
368{ 375{
369 struct flush_cache_page_args *fcp_args = args; 376 struct flush_cache_page_args *fcp_args = args;
370 struct vm_area_struct *vma = fcp_args->vma; 377 struct vm_area_struct *vma = fcp_args->vma;
371 unsigned long page = fcp_args->page; 378 unsigned long addr = fcp_args->addr;
372 int exec = vma->vm_flags & VM_EXEC; 379 int exec = vma->vm_flags & VM_EXEC;
373 struct mm_struct *mm = vma->vm_mm; 380 struct mm_struct *mm = vma->vm_mm;
374 pgd_t *pgdp; 381 pgd_t *pgdp;
382 pud_t *pudp;
375 pmd_t *pmdp; 383 pmd_t *pmdp;
376 pte_t *ptep; 384 pte_t *ptep;
377 385
378 page &= PAGE_MASK; 386 /*
379 pgdp = pgd_offset(mm, page); 387 * If ownes no valid ASID yet, cannot possibly have gotten
380 pmdp = pmd_offset(pgdp, page); 388 * this page into the cache.
381 ptep = pte_offset(pmdp, page); 389 */
390 if (cpu_context(smp_processor_id(), mm) == 0)
391 return;
392
393 addr &= PAGE_MASK;
394 pgdp = pgd_offset(mm, addr);
395 pudp = pud_offset(pgdp, addr);
396 pmdp = pmd_offset(pudp, addr);
397 ptep = pte_offset(pmdp, addr);
382 398
383 /* 399 /*
384 * If the page isn't marked valid, the page cannot possibly be 400 * If the page isn't marked valid, the page cannot possibly be
@@ -395,12 +411,12 @@ static inline void local_r4k_flush_cache_page(void *args)
395 */ 411 */
396 if ((mm == current->active_mm) && (pte_val(*ptep) & _PAGE_VALID)) { 412 if ((mm == current->active_mm) && (pte_val(*ptep) & _PAGE_VALID)) {
397 if (cpu_has_dc_aliases || (exec && !cpu_has_ic_fills_f_dc)) { 413 if (cpu_has_dc_aliases || (exec && !cpu_has_ic_fills_f_dc)) {
398 r4k_blast_dcache_page(page); 414 r4k_blast_dcache_page(addr);
399 if (exec && !cpu_icache_snoops_remote_store) 415 if (exec && !cpu_icache_snoops_remote_store)
400 r4k_blast_scache_page(page); 416 r4k_blast_scache_page(addr);
401 } 417 }
402 if (exec) 418 if (exec)
403 r4k_blast_icache_page(page); 419 r4k_blast_icache_page(addr);
404 420
405 return; 421 return;
406 } 422 }
@@ -409,36 +425,30 @@ static inline void local_r4k_flush_cache_page(void *args)
409 * Do indexed flush, too much work to get the (possible) TLB refills 425 * Do indexed flush, too much work to get the (possible) TLB refills
410 * to work correctly. 426 * to work correctly.
411 */ 427 */
412 page = INDEX_BASE + (page & (dcache_size - 1)); 428 addr = INDEX_BASE + (addr & (dcache_size - 1));
413 if (cpu_has_dc_aliases || (exec && !cpu_has_ic_fills_f_dc)) { 429 if (cpu_has_dc_aliases || (exec && !cpu_has_ic_fills_f_dc)) {
414 r4k_blast_dcache_page_indexed(page); 430 r4k_blast_dcache_page_indexed(addr);
415 if (exec && !cpu_icache_snoops_remote_store) 431 if (exec && !cpu_icache_snoops_remote_store)
416 r4k_blast_scache_page_indexed(page); 432 r4k_blast_scache_page_indexed(addr);
417 } 433 }
418 if (exec) { 434 if (exec) {
419 if (cpu_has_vtag_icache) { 435 if (cpu_has_vtag_icache) {
420 int cpu = smp_processor_id(); 436 int cpu = smp_processor_id();
421 437
422 if (cpu_context(cpu, vma->vm_mm) != 0) 438 if (cpu_context(cpu, mm) != 0)
423 drop_mmu_context(vma->vm_mm, cpu); 439 drop_mmu_context(mm, cpu);
424 } else 440 } else
425 r4k_blast_icache_page_indexed(page); 441 r4k_blast_icache_page_indexed(addr);
426 } 442 }
427} 443}
428 444
429static void r4k_flush_cache_page(struct vm_area_struct *vma, unsigned long page, unsigned long pfn) 445static void r4k_flush_cache_page(struct vm_area_struct *vma,
446 unsigned long addr, unsigned long pfn)
430{ 447{
431 struct flush_cache_page_args args; 448 struct flush_cache_page_args args;
432 449
433 /*
434 * If ownes no valid ASID yet, cannot possibly have gotten
435 * this page into the cache.
436 */
437 if (cpu_context(smp_processor_id(), vma->vm_mm) == 0)
438 return;
439
440 args.vma = vma; 450 args.vma = vma;
441 args.page = page; 451 args.addr = addr;
442 452
443 on_each_cpu(local_r4k_flush_cache_page, &args, 1, 1); 453 on_each_cpu(local_r4k_flush_cache_page, &args, 1, 1);
444} 454}
@@ -454,16 +464,16 @@ static void r4k_flush_data_cache_page(unsigned long addr)
454} 464}
455 465
456struct flush_icache_range_args { 466struct flush_icache_range_args {
457 unsigned long start; 467 unsigned long __user start;
458 unsigned long end; 468 unsigned long __user end;
459}; 469};
460 470
461static inline void local_r4k_flush_icache_range(void *args) 471static inline void local_r4k_flush_icache_range(void *args)
462{ 472{
463 struct flush_icache_range_args *fir_args = args; 473 struct flush_icache_range_args *fir_args = args;
464 unsigned long dc_lsize = current_cpu_data.dcache.linesz; 474 unsigned long dc_lsize = cpu_dcache_line_size();
465 unsigned long ic_lsize = current_cpu_data.icache.linesz; 475 unsigned long ic_lsize = cpu_icache_line_size();
466 unsigned long sc_lsize = current_cpu_data.scache.linesz; 476 unsigned long sc_lsize = cpu_scache_line_size();
467 unsigned long start = fir_args->start; 477 unsigned long start = fir_args->start;
468 unsigned long end = fir_args->end; 478 unsigned long end = fir_args->end;
469 unsigned long addr, aend; 479 unsigned long addr, aend;
@@ -472,6 +482,7 @@ static inline void local_r4k_flush_icache_range(void *args)
472 if (end - start > dcache_size) { 482 if (end - start > dcache_size) {
473 r4k_blast_dcache(); 483 r4k_blast_dcache();
474 } else { 484 } else {
485 R4600_HIT_CACHEOP_WAR_IMPL;
475 addr = start & ~(dc_lsize - 1); 486 addr = start & ~(dc_lsize - 1);
476 aend = (end - 1) & ~(dc_lsize - 1); 487 aend = (end - 1) & ~(dc_lsize - 1);
477 488
@@ -492,7 +503,7 @@ static inline void local_r4k_flush_icache_range(void *args)
492 aend = (end - 1) & ~(sc_lsize - 1); 503 aend = (end - 1) & ~(sc_lsize - 1);
493 504
494 while (1) { 505 while (1) {
495 /* Hit_Writeback_Inv_D */ 506 /* Hit_Writeback_Inv_SD */
496 protected_writeback_scache_line(addr); 507 protected_writeback_scache_line(addr);
497 if (addr == aend) 508 if (addr == aend)
498 break; 509 break;
@@ -517,7 +528,8 @@ static inline void local_r4k_flush_icache_range(void *args)
517 } 528 }
518} 529}
519 530
520static void r4k_flush_icache_range(unsigned long start, unsigned long end) 531static void r4k_flush_icache_range(unsigned long __user start,
532 unsigned long __user end)
521{ 533{
522 struct flush_icache_range_args args; 534 struct flush_icache_range_args args;
523 535
@@ -525,6 +537,7 @@ static void r4k_flush_icache_range(unsigned long start, unsigned long end)
525 args.end = end; 537 args.end = end;
526 538
527 on_each_cpu(local_r4k_flush_icache_range, &args, 1, 1); 539 on_each_cpu(local_r4k_flush_icache_range, &args, 1, 1);
540 instruction_hazard();
528} 541}
529 542
530/* 543/*
@@ -613,7 +626,7 @@ static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size)
613 BUG_ON(size == 0); 626 BUG_ON(size == 0);
614 627
615 if (cpu_has_subset_pcaches) { 628 if (cpu_has_subset_pcaches) {
616 unsigned long sc_lsize = current_cpu_data.scache.linesz; 629 unsigned long sc_lsize = cpu_scache_line_size();
617 630
618 if (size >= scache_size) { 631 if (size >= scache_size) {
619 r4k_blast_scache(); 632 r4k_blast_scache();
@@ -639,7 +652,7 @@ static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size)
639 if (size >= dcache_size) { 652 if (size >= dcache_size) {
640 r4k_blast_dcache(); 653 r4k_blast_dcache();
641 } else { 654 } else {
642 unsigned long dc_lsize = current_cpu_data.dcache.linesz; 655 unsigned long dc_lsize = cpu_dcache_line_size();
643 656
644 R4600_HIT_CACHEOP_WAR_IMPL; 657 R4600_HIT_CACHEOP_WAR_IMPL;
645 a = addr & ~(dc_lsize - 1); 658 a = addr & ~(dc_lsize - 1);
@@ -663,7 +676,7 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned long size)
663 BUG_ON(size == 0); 676 BUG_ON(size == 0);
664 677
665 if (cpu_has_subset_pcaches) { 678 if (cpu_has_subset_pcaches) {
666 unsigned long sc_lsize = current_cpu_data.scache.linesz; 679 unsigned long sc_lsize = cpu_scache_line_size();
667 680
668 if (size >= scache_size) { 681 if (size >= scache_size) {
669 r4k_blast_scache(); 682 r4k_blast_scache();
@@ -684,7 +697,7 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned long size)
684 if (size >= dcache_size) { 697 if (size >= dcache_size) {
685 r4k_blast_dcache(); 698 r4k_blast_dcache();
686 } else { 699 } else {
687 unsigned long dc_lsize = current_cpu_data.dcache.linesz; 700 unsigned long dc_lsize = cpu_dcache_line_size();
688 701
689 R4600_HIT_CACHEOP_WAR_IMPL; 702 R4600_HIT_CACHEOP_WAR_IMPL;
690 a = addr & ~(dc_lsize - 1); 703 a = addr & ~(dc_lsize - 1);
@@ -708,9 +721,9 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned long size)
708 */ 721 */
709static void local_r4k_flush_cache_sigtramp(void * arg) 722static void local_r4k_flush_cache_sigtramp(void * arg)
710{ 723{
711 unsigned long ic_lsize = current_cpu_data.icache.linesz; 724 unsigned long ic_lsize = cpu_icache_line_size();
712 unsigned long dc_lsize = current_cpu_data.dcache.linesz; 725 unsigned long dc_lsize = cpu_dcache_line_size();
713 unsigned long sc_lsize = current_cpu_data.scache.linesz; 726 unsigned long sc_lsize = cpu_scache_line_size();
714 unsigned long addr = (unsigned long) arg; 727 unsigned long addr = (unsigned long) arg;
715 728
716 R4600_HIT_CACHEOP_WAR_IMPL; 729 R4600_HIT_CACHEOP_WAR_IMPL;
@@ -762,6 +775,7 @@ static inline void rm7k_erratum31(void)
762 775
763 for (addr = INDEX_BASE; addr <= INDEX_BASE + 4096; addr += ic_lsize) { 776 for (addr = INDEX_BASE; addr <= INDEX_BASE + 4096; addr += ic_lsize) {
764 __asm__ __volatile__ ( 777 __asm__ __volatile__ (
778 ".set push\n\t"
765 ".set noreorder\n\t" 779 ".set noreorder\n\t"
766 ".set mips3\n\t" 780 ".set mips3\n\t"
767 "cache\t%1, 0(%0)\n\t" 781 "cache\t%1, 0(%0)\n\t"
@@ -776,8 +790,7 @@ static inline void rm7k_erratum31(void)
776 "cache\t%1, 0x1000(%0)\n\t" 790 "cache\t%1, 0x1000(%0)\n\t"
777 "cache\t%1, 0x2000(%0)\n\t" 791 "cache\t%1, 0x2000(%0)\n\t"
778 "cache\t%1, 0x3000(%0)\n\t" 792 "cache\t%1, 0x3000(%0)\n\t"
779 ".set\tmips0\n\t" 793 ".set pop\n"
780 ".set\treorder\n\t"
781 : 794 :
782 : "r" (addr), "i" (Index_Store_Tag_I), "i" (Fill)); 795 : "r" (addr), "i" (Index_Store_Tag_I), "i" (Fill));
783 } 796 }
@@ -1011,9 +1024,19 @@ static void __init probe_pcache(void)
1011 * normally they'd suffer from aliases but magic in the hardware deals 1024 * normally they'd suffer from aliases but magic in the hardware deals
1012 * with that for us so we don't need to take care ourselves. 1025 * with that for us so we don't need to take care ourselves.
1013 */ 1026 */
1014 if (c->cputype != CPU_R10000 && c->cputype != CPU_R12000) 1027 switch (c->cputype) {
1015 if (c->dcache.waysize > PAGE_SIZE) 1028 case CPU_20KC:
1016 c->dcache.flags |= MIPS_CACHE_ALIASES; 1029 case CPU_25KF:
1030 case CPU_R10000:
1031 case CPU_R12000:
1032 case CPU_SB1:
1033 break;
1034 case CPU_24K:
1035 if (!(read_c0_config7() & (1 << 16)))
1036 default:
1037 if (c->dcache.waysize > PAGE_SIZE)
1038 c->dcache.flags |= MIPS_CACHE_ALIASES;
1039 }
1017 1040
1018 switch (c->cputype) { 1041 switch (c->cputype) {
1019 case CPU_20KC: 1042 case CPU_20KC:
@@ -1024,7 +1047,11 @@ static void __init probe_pcache(void)
1024 c->icache.flags |= MIPS_CACHE_VTAG; 1047 c->icache.flags |= MIPS_CACHE_VTAG;
1025 break; 1048 break;
1026 1049
1050 case CPU_AU1000:
1027 case CPU_AU1500: 1051 case CPU_AU1500:
1052 case CPU_AU1100:
1053 case CPU_AU1550:
1054 case CPU_AU1200:
1028 c->icache.flags |= MIPS_CACHE_IC_F_DC; 1055 c->icache.flags |= MIPS_CACHE_IC_F_DC;
1029 break; 1056 break;
1030 } 1057 }
@@ -1102,7 +1129,6 @@ static int __init probe_scache(void)
1102 return 1; 1129 return 1;
1103} 1130}
1104 1131
1105typedef int (*probe_func_t)(unsigned long);
1106extern int r5k_sc_init(void); 1132extern int r5k_sc_init(void);
1107extern int rm7k_sc_init(void); 1133extern int rm7k_sc_init(void);
1108 1134
@@ -1110,7 +1136,6 @@ static void __init setup_scache(void)
1110{ 1136{
1111 struct cpuinfo_mips *c = &current_cpu_data; 1137 struct cpuinfo_mips *c = &current_cpu_data;
1112 unsigned int config = read_c0_config(); 1138 unsigned int config = read_c0_config();
1113 probe_func_t probe_scache_kseg1;
1114 int sc_present = 0; 1139 int sc_present = 0;
1115 1140
1116 /* 1141 /*
@@ -1123,8 +1148,7 @@ static void __init setup_scache(void)
1123 case CPU_R4000MC: 1148 case CPU_R4000MC:
1124 case CPU_R4400SC: 1149 case CPU_R4400SC:
1125 case CPU_R4400MC: 1150 case CPU_R4400MC:
1126 probe_scache_kseg1 = (probe_func_t) (CKSEG1ADDR(&probe_scache)); 1151 sc_present = run_uncached(probe_scache);
1127 sc_present = probe_scache_kseg1(config);
1128 if (sc_present) 1152 if (sc_present)
1129 c->options |= MIPS_CPU_CACHE_CDEX_S; 1153 c->options |= MIPS_CPU_CACHE_CDEX_S;
1130 break; 1154 break;
@@ -1198,7 +1222,7 @@ static inline void coherency_setup(void)
1198 } 1222 }
1199} 1223}
1200 1224
1201void __init ld_mmu_r4xx0(void) 1225void __init r4k_cache_init(void)
1202{ 1226{
1203 extern void build_clear_page(void); 1227 extern void build_clear_page(void);
1204 extern void build_copy_page(void); 1228 extern void build_copy_page(void);
@@ -1206,15 +1230,11 @@ void __init ld_mmu_r4xx0(void)
1206 struct cpuinfo_mips *c = &current_cpu_data; 1230 struct cpuinfo_mips *c = &current_cpu_data;
1207 1231
1208 /* Default cache error handler for R4000 and R5000 family */ 1232 /* Default cache error handler for R4000 and R5000 family */
1209 memcpy((void *)(CAC_BASE + 0x100), &except_vec2_generic, 0x80); 1233 set_uncached_handler (0x100, &except_vec2_generic, 0x80);
1210 memcpy((void *)(UNCAC_BASE + 0x100), &except_vec2_generic, 0x80);
1211 1234
1212 probe_pcache(); 1235 probe_pcache();
1213 setup_scache(); 1236 setup_scache();
1214 1237
1215 if (c->dcache.sets * c->dcache.ways > PAGE_SIZE)
1216 c->dcache.flags |= MIPS_CACHE_ALIASES;
1217
1218 r4k_blast_dcache_page_setup(); 1238 r4k_blast_dcache_page_setup();
1219 r4k_blast_dcache_page_indexed_setup(); 1239 r4k_blast_dcache_page_indexed_setup();
1220 r4k_blast_dcache_setup(); 1240 r4k_blast_dcache_setup();
@@ -1252,9 +1272,8 @@ void __init ld_mmu_r4xx0(void)
1252 _dma_cache_inv = r4k_dma_cache_inv; 1272 _dma_cache_inv = r4k_dma_cache_inv;
1253#endif 1273#endif
1254 1274
1255 __flush_cache_all();
1256 coherency_setup();
1257
1258 build_clear_page(); 1275 build_clear_page();
1259 build_copy_page(); 1276 build_copy_page();
1277 local_r4k___flush_cache_all(NULL);
1278 coherency_setup();
1260} 1279}
diff --git a/arch/mips/mm/c-sb1.c b/arch/mips/mm/c-sb1.c
index 502f68c664b2..2f08b535f20e 100644
--- a/arch/mips/mm/c-sb1.c
+++ b/arch/mips/mm/c-sb1.c
@@ -235,7 +235,7 @@ static inline void __sb1_flush_icache_range(unsigned long start,
235/* 235/*
236 * Invalidate all caches on this CPU 236 * Invalidate all caches on this CPU
237 */ 237 */
238static void local_sb1___flush_cache_all(void) 238static void __attribute_used__ local_sb1___flush_cache_all(void)
239{ 239{
240 __sb1_writeback_inv_dcache_all(); 240 __sb1_writeback_inv_dcache_all();
241 __sb1_flush_icache_all(); 241 __sb1_flush_icache_all();
@@ -492,19 +492,17 @@ static __init void probe_cache_sizes(void)
492} 492}
493 493
494/* 494/*
495 * This is called from loadmmu.c. We have to set up all the 495 * This is called from cache.c. We have to set up all the
496 * memory management function pointers, as well as initialize 496 * memory management function pointers, as well as initialize
497 * the caches and tlbs 497 * the caches and tlbs
498 */ 498 */
499void ld_mmu_sb1(void) 499void sb1_cache_init(void)
500{ 500{
501 extern char except_vec2_sb1; 501 extern char except_vec2_sb1;
502 extern char handle_vec2_sb1; 502 extern char handle_vec2_sb1;
503 503
504 /* Special cache error handler for SB1 */ 504 /* Special cache error handler for SB1 */
505 memcpy((void *)(CAC_BASE + 0x100), &except_vec2_sb1, 0x80); 505 set_uncached_handler (0x100, &except_vec2_sb1, 0x80);
506 memcpy((void *)(UNCAC_BASE + 0x100), &except_vec2_sb1, 0x80);
507 memcpy((void *)CKSEG1ADDR(&handle_vec2_sb1), &handle_vec2_sb1, 0x80);
508 506
509 probe_cache_sizes(); 507 probe_cache_sizes();
510 508
diff --git a/arch/mips/mm/c-tx39.c b/arch/mips/mm/c-tx39.c
index ff5afab64b2f..0a97a9434eba 100644
--- a/arch/mips/mm/c-tx39.c
+++ b/arch/mips/mm/c-tx39.c
@@ -167,15 +167,16 @@ static void tx39_flush_cache_mm(struct mm_struct *mm)
167static void tx39_flush_cache_range(struct vm_area_struct *vma, 167static void tx39_flush_cache_range(struct vm_area_struct *vma,
168 unsigned long start, unsigned long end) 168 unsigned long start, unsigned long end)
169{ 169{
170 struct mm_struct *mm = vma->vm_mm; 170 int exec;
171 171
172 if (!cpu_has_dc_aliases) 172 if (!(cpu_context(smp_processor_id(), vma->vm_mm)))
173 return; 173 return;
174 174
175 if (cpu_context(smp_processor_id(), mm) != 0) { 175 exec = vma->vm_flags & VM_EXEC;
176 if (cpu_has_dc_aliases || exec)
176 tx39_blast_dcache(); 177 tx39_blast_dcache();
178 if (exec)
177 tx39_blast_icache(); 179 tx39_blast_icache();
178 }
179} 180}
180 181
181static void tx39_flush_cache_page(struct vm_area_struct *vma, unsigned long page, unsigned long pfn) 182static void tx39_flush_cache_page(struct vm_area_struct *vma, unsigned long page, unsigned long pfn)
@@ -183,6 +184,7 @@ static void tx39_flush_cache_page(struct vm_area_struct *vma, unsigned long page
183 int exec = vma->vm_flags & VM_EXEC; 184 int exec = vma->vm_flags & VM_EXEC;
184 struct mm_struct *mm = vma->vm_mm; 185 struct mm_struct *mm = vma->vm_mm;
185 pgd_t *pgdp; 186 pgd_t *pgdp;
187 pud_t *pudp;
186 pmd_t *pmdp; 188 pmd_t *pmdp;
187 pte_t *ptep; 189 pte_t *ptep;
188 190
@@ -195,7 +197,8 @@ static void tx39_flush_cache_page(struct vm_area_struct *vma, unsigned long page
195 197
196 page &= PAGE_MASK; 198 page &= PAGE_MASK;
197 pgdp = pgd_offset(mm, page); 199 pgdp = pgd_offset(mm, page);
198 pmdp = pmd_offset(pgdp, page); 200 pudp = pud_offset(pgdp, page);
201 pmdp = pmd_offset(pudp, page);
199 ptep = pte_offset(pmdp, page); 202 ptep = pte_offset(pmdp, page);
200 203
201 /* 204 /*
@@ -407,7 +410,7 @@ static __init void tx39_probe_cache(void)
407 } 410 }
408} 411}
409 412
410void __init ld_mmu_tx39(void) 413void __init tx39_cache_init(void)
411{ 414{
412 extern void build_clear_page(void); 415 extern void build_clear_page(void);
413 extern void build_copy_page(void); 416 extern void build_copy_page(void);
@@ -490,4 +493,5 @@ void __init ld_mmu_tx39(void)
490 493
491 build_clear_page(); 494 build_clear_page();
492 build_copy_page(); 495 build_copy_page();
496 tx39h_flush_icache_all();
493} 497}
diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c
index 1d95cdb77bed..314701a66b13 100644
--- a/arch/mips/mm/cache.c
+++ b/arch/mips/mm/cache.c
@@ -23,8 +23,10 @@ void (*__flush_cache_all)(void);
23void (*flush_cache_mm)(struct mm_struct *mm); 23void (*flush_cache_mm)(struct mm_struct *mm);
24void (*flush_cache_range)(struct vm_area_struct *vma, unsigned long start, 24void (*flush_cache_range)(struct vm_area_struct *vma, unsigned long start,
25 unsigned long end); 25 unsigned long end);
26void (*flush_cache_page)(struct vm_area_struct *vma, unsigned long page, unsigned long pfn); 26void (*flush_cache_page)(struct vm_area_struct *vma, unsigned long page,
27void (*flush_icache_range)(unsigned long start, unsigned long end); 27 unsigned long pfn);
28void (*flush_icache_range)(unsigned long __user start,
29 unsigned long __user end);
28void (*flush_icache_page)(struct vm_area_struct *vma, struct page *page); 30void (*flush_icache_page)(struct vm_area_struct *vma, struct page *page);
29 31
30/* MIPS specific cache operations */ 32/* MIPS specific cache operations */
@@ -32,6 +34,8 @@ void (*flush_cache_sigtramp)(unsigned long addr);
32void (*flush_data_cache_page)(unsigned long addr); 34void (*flush_data_cache_page)(unsigned long addr);
33void (*flush_icache_all)(void); 35void (*flush_icache_all)(void);
34 36
37EXPORT_SYMBOL(flush_data_cache_page);
38
35#ifdef CONFIG_DMA_NONCOHERENT 39#ifdef CONFIG_DMA_NONCOHERENT
36 40
37/* DMA cache operations. */ 41/* DMA cache operations. */
@@ -49,10 +53,12 @@ EXPORT_SYMBOL(_dma_cache_inv);
49 * We could optimize the case where the cache argument is not BCACHE but 53 * We could optimize the case where the cache argument is not BCACHE but
50 * that seems very atypical use ... 54 * that seems very atypical use ...
51 */ 55 */
52asmlinkage int sys_cacheflush(unsigned long addr, unsigned long int bytes, 56asmlinkage int sys_cacheflush(unsigned long __user addr,
53 unsigned int cache) 57 unsigned long bytes, unsigned int cache)
54{ 58{
55 if (!access_ok(VERIFY_WRITE, (void *) addr, bytes)) 59 if (bytes == 0)
60 return 0;
61 if (!access_ok(VERIFY_WRITE, (void __user *) addr, bytes))
56 return -EFAULT; 62 return -EFAULT;
57 63
58 flush_icache_range(addr, addr + bytes); 64 flush_icache_range(addr, addr + bytes);
@@ -100,58 +106,48 @@ void __update_cache(struct vm_area_struct *vma, unsigned long address,
100 } 106 }
101} 107}
102 108
103extern void ld_mmu_r23000(void); 109#define __weak __attribute__((weak))
104extern void ld_mmu_r4xx0(void); 110
105extern void ld_mmu_tx39(void); 111static char cache_panic[] __initdata = "Yeee, unsupported cache architecture.";
106extern void ld_mmu_r6000(void);
107extern void ld_mmu_tfp(void);
108extern void ld_mmu_andes(void);
109extern void ld_mmu_sb1(void);
110 112
111void __init cpu_cache_init(void) 113void __init cpu_cache_init(void)
112{ 114{
113 if (cpu_has_4ktlb) { 115 if (cpu_has_3k_cache) {
114#if defined(CONFIG_CPU_R4X00) || defined(CONFIG_CPU_VR41XX) || \ 116 extern void __weak r3k_cache_init(void);
115 defined(CONFIG_CPU_R4300) || defined(CONFIG_CPU_R5000) || \ 117
116 defined(CONFIG_CPU_NEVADA) || defined(CONFIG_CPU_R5432) || \ 118 r3k_cache_init();
117 defined(CONFIG_CPU_R5500) || defined(CONFIG_CPU_MIPS32) || \ 119 return;
118 defined(CONFIG_CPU_MIPS64) || defined(CONFIG_CPU_TX49XX) || \ 120 }
119 defined(CONFIG_CPU_RM7000) || defined(CONFIG_CPU_RM9000) 121 if (cpu_has_6k_cache) {
120 ld_mmu_r4xx0(); 122 extern void __weak r6k_cache_init(void);
121#endif 123
122 } else switch (current_cpu_data.cputype) { 124 r6k_cache_init();
123#ifdef CONFIG_CPU_R3000 125 return;
124 case CPU_R2000: 126 }
125 case CPU_R3000: 127 if (cpu_has_4k_cache) {
126 case CPU_R3000A: 128 extern void __weak r4k_cache_init(void);
127 case CPU_R3081E: 129
128 ld_mmu_r23000(); 130 r4k_cache_init();
129 break; 131 return;
130#endif
131#ifdef CONFIG_CPU_TX39XX
132 case CPU_TX3912:
133 case CPU_TX3922:
134 case CPU_TX3927:
135 ld_mmu_tx39();
136 break;
137#endif
138#ifdef CONFIG_CPU_R10000
139 case CPU_R10000:
140 case CPU_R12000:
141 ld_mmu_r4xx0();
142 break;
143#endif
144#ifdef CONFIG_CPU_SB1
145 case CPU_SB1:
146 ld_mmu_sb1();
147 break;
148#endif
149
150 case CPU_R8000:
151 panic("R8000 is unsupported");
152 break;
153
154 default:
155 panic("Yeee, unsupported cache architecture.");
156 } 132 }
133 if (cpu_has_8k_cache) {
134 extern void __weak r8k_cache_init(void);
135
136 r8k_cache_init();
137 return;
138 }
139 if (cpu_has_tx39_cache) {
140 extern void __weak tx39_cache_init(void);
141
142 tx39_cache_init();
143 return;
144 }
145 if (cpu_has_sb1_cache) {
146 extern void __weak sb1_cache_init(void);
147
148 sb1_cache_init();
149 return;
150 }
151
152 panic(cache_panic);
157} 153}
diff --git a/arch/mips/mm/cerr-sb1.c b/arch/mips/mm/cerr-sb1.c
index 7166ffe63502..1cf3c6006ccd 100644
--- a/arch/mips/mm/cerr-sb1.c
+++ b/arch/mips/mm/cerr-sb1.c
@@ -19,13 +19,19 @@
19#include <linux/sched.h> 19#include <linux/sched.h>
20#include <asm/mipsregs.h> 20#include <asm/mipsregs.h>
21#include <asm/sibyte/sb1250.h> 21#include <asm/sibyte/sb1250.h>
22#include <asm/sibyte/sb1250_regs.h>
22 23
23#ifndef CONFIG_SIBYTE_BUS_WATCHER 24#if !defined(CONFIG_SIBYTE_BUS_WATCHER) || defined(CONFIG_SIBYTE_BW_TRACE)
24#include <asm/io.h> 25#include <asm/io.h>
25#include <asm/sibyte/sb1250_regs.h>
26#include <asm/sibyte/sb1250_scd.h> 26#include <asm/sibyte/sb1250_scd.h>
27#endif 27#endif
28 28
29/*
30 * We'd like to dump the L2_ECC_TAG register on errors, but errata make
31 * that unsafe... So for now we don't. (BCM1250/BCM112x erratum SOC-48.)
32 */
33#undef DUMP_L2_ECC_TAG_ON_ERROR
34
29/* SB1 definitions */ 35/* SB1 definitions */
30 36
31/* XXX should come from config1 XXX */ 37/* XXX should come from config1 XXX */
@@ -139,12 +145,18 @@ static inline void breakout_cerrd(unsigned int val)
139static void check_bus_watcher(void) 145static void check_bus_watcher(void)
140{ 146{
141 uint32_t status, l2_err, memio_err; 147 uint32_t status, l2_err, memio_err;
148#ifdef DUMP_L2_ECC_TAG_ON_ERROR
149 uint64_t l2_tag;
150#endif
142 151
143 /* Destructive read, clears register and interrupt */ 152 /* Destructive read, clears register and interrupt */
144 status = csr_in32(IOADDR(A_SCD_BUS_ERR_STATUS)); 153 status = csr_in32(IOADDR(A_SCD_BUS_ERR_STATUS));
145 /* Bit 31 is always on, but there's no #define for that */ 154 /* Bit 31 is always on, but there's no #define for that */
146 if (status & ~(1UL << 31)) { 155 if (status & ~(1UL << 31)) {
147 l2_err = csr_in32(IOADDR(A_BUS_L2_ERRORS)); 156 l2_err = csr_in32(IOADDR(A_BUS_L2_ERRORS));
157#ifdef DUMP_L2_ECC_TAG_ON_ERROR
158 l2_tag = in64(IO_SPACE_BASE | A_L2_ECC_TAG);
159#endif
148 memio_err = csr_in32(IOADDR(A_BUS_MEM_IO_ERRORS)); 160 memio_err = csr_in32(IOADDR(A_BUS_MEM_IO_ERRORS));
149 prom_printf("Bus watcher error counters: %08x %08x\n", l2_err, memio_err); 161 prom_printf("Bus watcher error counters: %08x %08x\n", l2_err, memio_err);
150 prom_printf("\nLast recorded signature:\n"); 162 prom_printf("\nLast recorded signature:\n");
@@ -153,6 +165,9 @@ static void check_bus_watcher(void)
153 (int)(G_SCD_BERR_TID(status) >> 6), 165 (int)(G_SCD_BERR_TID(status) >> 6),
154 (int)G_SCD_BERR_RID(status), 166 (int)G_SCD_BERR_RID(status),
155 (int)G_SCD_BERR_DCODE(status)); 167 (int)G_SCD_BERR_DCODE(status));
168#ifdef DUMP_L2_ECC_TAG_ON_ERROR
169 prom_printf("Last L2 tag w/ bad ECC: %016llx\n", l2_tag);
170#endif
156 } else { 171 } else {
157 prom_printf("Bus watcher indicates no error\n"); 172 prom_printf("Bus watcher indicates no error\n");
158 } 173 }
@@ -166,6 +181,16 @@ asmlinkage void sb1_cache_error(void)
166 uint64_t cerr_dpa; 181 uint64_t cerr_dpa;
167 uint32_t errctl, cerr_i, cerr_d, dpalo, dpahi, eepc, res; 182 uint32_t errctl, cerr_i, cerr_d, dpalo, dpahi, eepc, res;
168 183
184#ifdef CONFIG_SIBYTE_BW_TRACE
185 /* Freeze the trace buffer now */
186#if defined(CONFIG_SIBYTE_BCM1x55) || defined(CONFIG_SIBYTE_BCM1x80)
187 csr_out32(M_BCM1480_SCD_TRACE_CFG_FREEZE, IO_SPACE_BASE | A_SCD_TRACE_CFG);
188#else
189 csr_out32(M_SCD_TRACE_CFG_FREEZE, IO_SPACE_BASE | A_SCD_TRACE_CFG);
190#endif
191 prom_printf("Trace buffer frozen\n");
192#endif
193
169 prom_printf("Cache error exception on CPU %x:\n", 194 prom_printf("Cache error exception on CPU %x:\n",
170 (read_c0_prid() >> 25) & 0x7); 195 (read_c0_prid() >> 25) & 0x7);
171 196
@@ -229,11 +254,19 @@ asmlinkage void sb1_cache_error(void)
229 254
230 check_bus_watcher(); 255 check_bus_watcher();
231 256
232 while (1);
233 /* 257 /*
234 * This tends to make things get really ugly; let's just stall instead. 258 * Calling panic() when a fatal cache error occurs scrambles the
235 * panic("Can't handle the cache error!"); 259 * state of the system (and the cache), making it difficult to
260 * investigate after the fact. However, if you just stall the CPU,
261 * the other CPU may keep on running, which is typically very
262 * undesirable.
236 */ 263 */
264#ifdef CONFIG_SB1_CERR_STALL
265 while (1)
266 ;
267#else
268 panic("unhandled cache error");
269#endif
237} 270}
238 271
239 272
@@ -434,7 +467,8 @@ static struct dc_state dc_states[] = {
434}; 467};
435 468
436#define DC_TAG_VALID(state) \ 469#define DC_TAG_VALID(state) \
437 (((state) == 0xf) || ((state) == 0x13) || ((state) == 0x19) || ((state == 0x16)) || ((state) == 0x1c)) 470 (((state) == 0x0) || ((state) == 0xf) || ((state) == 0x13) || \
471 ((state) == 0x19) || ((state) == 0x16) || ((state) == 0x1c))
438 472
439static char *dc_state_str(unsigned char state) 473static char *dc_state_str(unsigned char state)
440{ 474{
@@ -505,6 +539,7 @@ static uint32_t extract_dc(unsigned short addr, int data)
505 uint64_t datalo; 539 uint64_t datalo;
506 uint32_t datalohi, datalolo, datahi; 540 uint32_t datalohi, datalolo, datahi;
507 int offset; 541 int offset;
542 char bad_ecc = 0;
508 543
509 for (offset = 0; offset < 4; offset++) { 544 for (offset = 0; offset < 4; offset++) {
510 /* Index-load-data-D */ 545 /* Index-load-data-D */
@@ -525,8 +560,7 @@ static uint32_t extract_dc(unsigned short addr, int data)
525 ecc = dc_ecc(datalo); 560 ecc = dc_ecc(datalo);
526 if (ecc != datahi) { 561 if (ecc != datahi) {
527 int bits = 0; 562 int bits = 0;
528 prom_printf(" ** bad ECC (%02x %02x) ->", 563 bad_ecc |= 1 << (3-offset);
529 datahi, ecc);
530 ecc ^= datahi; 564 ecc ^= datahi;
531 while (ecc) { 565 while (ecc) {
532 if (ecc & 1) bits++; 566 if (ecc & 1) bits++;
@@ -537,6 +571,10 @@ static uint32_t extract_dc(unsigned short addr, int data)
537 prom_printf(" %02X-%016llX", datahi, datalo); 571 prom_printf(" %02X-%016llX", datahi, datalo);
538 } 572 }
539 prom_printf("\n"); 573 prom_printf("\n");
574 if (bad_ecc)
575 prom_printf(" dwords w/ bad ECC: %d %d %d %d\n",
576 !!(bad_ecc & 8), !!(bad_ecc & 4),
577 !!(bad_ecc & 2), !!(bad_ecc & 1));
540 } 578 }
541 } 579 }
542 return res; 580 return res;
diff --git a/arch/mips/mm/cex-sb1.S b/arch/mips/mm/cex-sb1.S
index 2c3a23aa88c3..0e71580774ff 100644
--- a/arch/mips/mm/cex-sb1.S
+++ b/arch/mips/mm/cex-sb1.S
@@ -64,6 +64,10 @@ LEAF(except_vec2_sb1)
64 sd k0,0x170($0) 64 sd k0,0x170($0)
65 sd k1,0x178($0) 65 sd k1,0x178($0)
66 66
67#if CONFIG_SB1_CEX_ALWAYS_FATAL
68 j handle_vec2_sb1
69 nop
70#else
67 /* 71 /*
68 * M_ERRCTL_RECOVERABLE is bit 31, which makes it easy to tell 72 * M_ERRCTL_RECOVERABLE is bit 31, which makes it easy to tell
69 * if we can fast-path out of here for a h/w-recovered error. 73 * if we can fast-path out of here for a h/w-recovered error.
@@ -134,6 +138,7 @@ unrecoverable:
134 /* Unrecoverable Icache or Dcache error; log it and/or fail */ 138 /* Unrecoverable Icache or Dcache error; log it and/or fail */
135 j handle_vec2_sb1 139 j handle_vec2_sb1
136 nop 140 nop
141#endif
137 142
138END(except_vec2_sb1) 143END(except_vec2_sb1)
139 144
diff --git a/arch/mips/mm/dma-coherent.c b/arch/mips/mm/dma-coherent.c
index a617f8c327e8..f6b3c722230c 100644
--- a/arch/mips/mm/dma-coherent.c
+++ b/arch/mips/mm/dma-coherent.c
@@ -9,10 +9,10 @@
9 */ 9 */
10#include <linux/config.h> 10#include <linux/config.h>
11#include <linux/types.h> 11#include <linux/types.h>
12#include <linux/dma-mapping.h>
12#include <linux/mm.h> 13#include <linux/mm.h>
13#include <linux/module.h> 14#include <linux/module.h>
14#include <linux/string.h> 15#include <linux/string.h>
15#include <linux/pci.h>
16 16
17#include <asm/cache.h> 17#include <asm/cache.h>
18#include <asm/io.h> 18#include <asm/io.h>
diff --git a/arch/mips/mm/dma-noncoherent.c b/arch/mips/mm/dma-noncoherent.c
index 4ce02028a292..cd4ea8474f89 100644
--- a/arch/mips/mm/dma-noncoherent.c
+++ b/arch/mips/mm/dma-noncoherent.c
@@ -105,22 +105,7 @@ dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,
105{ 105{
106 unsigned long addr = (unsigned long) ptr; 106 unsigned long addr = (unsigned long) ptr;
107 107
108 switch (direction) { 108 __dma_sync(addr, size, direction);
109 case DMA_TO_DEVICE:
110 dma_cache_wback(addr, size);
111 break;
112
113 case DMA_FROM_DEVICE:
114 dma_cache_inv(addr, size);
115 break;
116
117 case DMA_BIDIRECTIONAL:
118 dma_cache_wback_inv(addr, size);
119 break;
120
121 default:
122 BUG();
123 }
124 109
125 return virt_to_phys(ptr); 110 return virt_to_phys(ptr);
126} 111}
@@ -133,22 +118,7 @@ void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
133 unsigned long addr; 118 unsigned long addr;
134 addr = dma_addr + PAGE_OFFSET; 119 addr = dma_addr + PAGE_OFFSET;
135 120
136 switch (direction) { 121 //__dma_sync(addr, size, direction);
137 case DMA_TO_DEVICE:
138 //dma_cache_wback(addr, size);
139 break;
140
141 case DMA_FROM_DEVICE:
142 //dma_cache_inv(addr, size);
143 break;
144
145 case DMA_BIDIRECTIONAL:
146 //dma_cache_wback_inv(addr, size);
147 break;
148
149 default:
150 BUG();
151 }
152} 122}
153 123
154EXPORT_SYMBOL(dma_unmap_single); 124EXPORT_SYMBOL(dma_unmap_single);
@@ -164,10 +134,11 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
164 unsigned long addr; 134 unsigned long addr;
165 135
166 addr = (unsigned long) page_address(sg->page); 136 addr = (unsigned long) page_address(sg->page);
167 if (addr) 137 if (addr) {
168 __dma_sync(addr + sg->offset, sg->length, direction); 138 __dma_sync(addr + sg->offset, sg->length, direction);
169 sg->dma_address = (dma_addr_t) 139 sg->dma_address = (dma_addr_t)page_to_phys(sg->page)
170 (page_to_phys(sg->page) + sg->offset); 140 + sg->offset;
141 }
171 } 142 }
172 143
173 return nents; 144 return nents;
@@ -218,9 +189,8 @@ void dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
218 189
219 for (i = 0; i < nhwentries; i++, sg++) { 190 for (i = 0; i < nhwentries; i++, sg++) {
220 addr = (unsigned long) page_address(sg->page); 191 addr = (unsigned long) page_address(sg->page);
221 if (!addr) 192 if (addr)
222 continue; 193 __dma_sync(addr + sg->offset, sg->length, direction);
223 dma_cache_wback_inv(addr + sg->offset, sg->length);
224 } 194 }
225} 195}
226 196
diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c
index ec8077c74e9c..2d9624fd10ec 100644
--- a/arch/mips/mm/fault.c
+++ b/arch/mips/mm/fault.c
@@ -25,6 +25,7 @@
25#include <asm/system.h> 25#include <asm/system.h>
26#include <asm/uaccess.h> 26#include <asm/uaccess.h>
27#include <asm/ptrace.h> 27#include <asm/ptrace.h>
28#include <asm/highmem.h> /* For VMALLOC_END */
28 29
29/* 30/*
30 * This routine handles page faults. It determines the address, 31 * This routine handles page faults. It determines the address,
@@ -57,7 +58,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long write,
57 * only copy the information from the master page table, 58 * only copy the information from the master page table,
58 * nothing more. 59 * nothing more.
59 */ 60 */
60 if (unlikely(address >= VMALLOC_START)) 61 if (unlikely(address >= VMALLOC_START && address <= VMALLOC_END))
61 goto vmalloc_fault; 62 goto vmalloc_fault;
62 63
63 /* 64 /*
@@ -140,7 +141,7 @@ bad_area_nosemaphore:
140 info.si_signo = SIGSEGV; 141 info.si_signo = SIGSEGV;
141 info.si_errno = 0; 142 info.si_errno = 0;
142 /* info.si_code has been set above */ 143 /* info.si_code has been set above */
143 info.si_addr = (void *) address; 144 info.si_addr = (void __user *) address;
144 force_sig_info(SIGSEGV, &info, tsk); 145 force_sig_info(SIGSEGV, &info, tsk);
145 return; 146 return;
146 } 147 }
@@ -196,7 +197,7 @@ do_sigbus:
196 info.si_signo = SIGBUS; 197 info.si_signo = SIGBUS;
197 info.si_errno = 0; 198 info.si_errno = 0;
198 info.si_code = BUS_ADRERR; 199 info.si_code = BUS_ADRERR;
199 info.si_addr = (void *) address; 200 info.si_addr = (void __user *) address;
200 force_sig_info(SIGBUS, &info, tsk); 201 force_sig_info(SIGBUS, &info, tsk);
201 202
202 return; 203 return;
@@ -212,6 +213,7 @@ vmalloc_fault:
212 */ 213 */
213 int offset = __pgd_offset(address); 214 int offset = __pgd_offset(address);
214 pgd_t *pgd, *pgd_k; 215 pgd_t *pgd, *pgd_k;
216 pud_t *pud, *pud_k;
215 pmd_t *pmd, *pmd_k; 217 pmd_t *pmd, *pmd_k;
216 pte_t *pte_k; 218 pte_t *pte_k;
217 219
@@ -222,8 +224,13 @@ vmalloc_fault:
222 goto no_context; 224 goto no_context;
223 set_pgd(pgd, *pgd_k); 225 set_pgd(pgd, *pgd_k);
224 226
225 pmd = pmd_offset(pgd, address); 227 pud = pud_offset(pgd, address);
226 pmd_k = pmd_offset(pgd_k, address); 228 pud_k = pud_offset(pgd_k, address);
229 if (!pud_present(*pud_k))
230 goto no_context;
231
232 pmd = pmd_offset(pud, address);
233 pmd_k = pmd_offset(pud_k, address);
227 if (!pmd_present(*pmd_k)) 234 if (!pmd_present(*pmd_k))
228 goto no_context; 235 goto no_context;
229 set_pmd(pmd, *pmd_k); 236 set_pmd(pmd, *pmd_k);
diff --git a/arch/mips/mm/highmem.c b/arch/mips/mm/highmem.c
index dd5e2e31885b..1f7b37b38f5c 100644
--- a/arch/mips/mm/highmem.c
+++ b/arch/mips/mm/highmem.c
@@ -83,6 +83,25 @@ void __kunmap_atomic(void *kvaddr, enum km_type type)
83 preempt_check_resched(); 83 preempt_check_resched();
84} 84}
85 85
86/*
87 * This is the same as kmap_atomic() but can map memory that doesn't
88 * have a struct page associated with it.
89 */
90void *kmap_atomic_pfn(unsigned long pfn, enum km_type type)
91{
92 enum fixed_addresses idx;
93 unsigned long vaddr;
94
95 inc_preempt_count();
96
97 idx = type + KM_TYPE_NR*smp_processor_id();
98 vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
99 set_pte(kmap_pte-idx, pfn_pte(pfn, kmap_prot));
100 flush_tlb_one(vaddr);
101
102 return (void*) vaddr;
103}
104
86struct page *__kmap_atomic_to_page(void *ptr) 105struct page *__kmap_atomic_to_page(void *ptr)
87{ 106{
88 unsigned long idx, vaddr = (unsigned long)ptr; 107 unsigned long idx, vaddr = (unsigned long)ptr;
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index dc6830b10fab..f75ab748e8cd 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -83,7 +83,7 @@ pte_t *kmap_pte;
83pgprot_t kmap_prot; 83pgprot_t kmap_prot;
84 84
85#define kmap_get_fixmap_pte(vaddr) \ 85#define kmap_get_fixmap_pte(vaddr) \
86 pte_offset_kernel(pmd_offset(pgd_offset_k(vaddr), (vaddr)), (vaddr)) 86 pte_offset_kernel(pmd_offset(pud_offset(pgd_offset_k(vaddr), (vaddr)), (vaddr)), (vaddr))
87 87
88static void __init kmap_init(void) 88static void __init kmap_init(void)
89{ 89{
@@ -96,36 +96,42 @@ static void __init kmap_init(void)
96 kmap_prot = PAGE_KERNEL; 96 kmap_prot = PAGE_KERNEL;
97} 97}
98 98
99#ifdef CONFIG_64BIT 99#ifdef CONFIG_32BIT
100static void __init fixrange_init(unsigned long start, unsigned long end, 100void __init fixrange_init(unsigned long start, unsigned long end,
101 pgd_t *pgd_base) 101 pgd_t *pgd_base)
102{ 102{
103 pgd_t *pgd; 103 pgd_t *pgd;
104 pud_t *pud;
104 pmd_t *pmd; 105 pmd_t *pmd;
105 pte_t *pte; 106 pte_t *pte;
106 int i, j; 107 int i, j, k;
107 unsigned long vaddr; 108 unsigned long vaddr;
108 109
109 vaddr = start; 110 vaddr = start;
110 i = __pgd_offset(vaddr); 111 i = __pgd_offset(vaddr);
111 j = __pmd_offset(vaddr); 112 j = __pud_offset(vaddr);
113 k = __pmd_offset(vaddr);
112 pgd = pgd_base + i; 114 pgd = pgd_base + i;
113 115
114 for ( ; (i < PTRS_PER_PGD) && (vaddr != end); pgd++, i++) { 116 for ( ; (i < PTRS_PER_PGD) && (vaddr != end); pgd++, i++) {
115 pmd = (pmd_t *)pgd; 117 pud = (pud_t *)pgd;
116 for (; (j < PTRS_PER_PMD) && (vaddr != end); pmd++, j++) { 118 for ( ; (j < PTRS_PER_PUD) && (vaddr != end); pud++, j++) {
117 if (pmd_none(*pmd)) { 119 pmd = (pmd_t *)pud;
118 pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE); 120 for (; (k < PTRS_PER_PMD) && (vaddr != end); pmd++, k++) {
119 set_pmd(pmd, __pmd(pte)); 121 if (pmd_none(*pmd)) {
120 if (pte != pte_offset_kernel(pmd, 0)) 122 pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE);
121 BUG(); 123 set_pmd(pmd, __pmd(pte));
124 if (pte != pte_offset_kernel(pmd, 0))
125 BUG();
126 }
127 vaddr += PMD_SIZE;
122 } 128 }
123 vaddr += PMD_SIZE; 129 k = 0;
124 } 130 }
125 j = 0; 131 j = 0;
126 } 132 }
127} 133}
128#endif /* CONFIG_64BIT */ 134#endif /* CONFIG_32BIT */
129#endif /* CONFIG_HIGHMEM */ 135#endif /* CONFIG_HIGHMEM */
130 136
131#ifndef CONFIG_NEED_MULTIPLE_NODES 137#ifndef CONFIG_NEED_MULTIPLE_NODES
diff --git a/arch/mips/mm/ioremap.c b/arch/mips/mm/ioremap.c
index adf352273f63..3101d1db5592 100644
--- a/arch/mips/mm/ioremap.c
+++ b/arch/mips/mm/ioremap.c
@@ -55,7 +55,7 @@ static inline int remap_area_pmd(pmd_t * pmd, unsigned long address,
55 if (address >= end) 55 if (address >= end)
56 BUG(); 56 BUG();
57 do { 57 do {
58 pte_t * pte = pte_alloc_kernel(&init_mm, pmd, address); 58 pte_t * pte = pte_alloc_kernel(pmd, address);
59 if (!pte) 59 if (!pte)
60 return -ENOMEM; 60 return -ENOMEM;
61 remap_area_pte(pte, address, end - address, address + phys_addr, flags); 61 remap_area_pte(pte, address, end - address, address + phys_addr, flags);
@@ -77,11 +77,15 @@ static int remap_area_pages(unsigned long address, phys_t phys_addr,
77 flush_cache_all(); 77 flush_cache_all();
78 if (address >= end) 78 if (address >= end)
79 BUG(); 79 BUG();
80 spin_lock(&init_mm.page_table_lock);
81 do { 80 do {
81 pud_t *pud;
82 pmd_t *pmd; 82 pmd_t *pmd;
83 pmd = pmd_alloc(&init_mm, dir, address); 83
84 error = -ENOMEM; 84 error = -ENOMEM;
85 pud = pud_alloc(&init_mm, dir, address);
86 if (!pud)
87 break;
88 pmd = pmd_alloc(&init_mm, pud, address);
85 if (!pmd) 89 if (!pmd)
86 break; 90 break;
87 if (remap_area_pmd(pmd, address, end - address, 91 if (remap_area_pmd(pmd, address, end - address,
@@ -91,21 +95,11 @@ static int remap_area_pages(unsigned long address, phys_t phys_addr,
91 address = (address + PGDIR_SIZE) & PGDIR_MASK; 95 address = (address + PGDIR_SIZE) & PGDIR_MASK;
92 dir++; 96 dir++;
93 } while (address && (address < end)); 97 } while (address && (address < end));
94 spin_unlock(&init_mm.page_table_lock);
95 flush_tlb_all(); 98 flush_tlb_all();
96 return error; 99 return error;
97} 100}
98 101
99/* 102/*
100 * Allow physical addresses to be fixed up to help 36 bit peripherals.
101 */
102phys_t __attribute__ ((weak))
103fixup_bigphys_addr(phys_t phys_addr, phys_t size)
104{
105 return phys_addr;
106}
107
108/*
109 * Generic mapping function (not visible outside): 103 * Generic mapping function (not visible outside):
110 */ 104 */
111 105
@@ -121,7 +115,7 @@ fixup_bigphys_addr(phys_t phys_addr, phys_t size)
121 115
122#define IS_LOW512(addr) (!((phys_t)(addr) & (phys_t) ~0x1fffffffULL)) 116#define IS_LOW512(addr) (!((phys_t)(addr) & (phys_t) ~0x1fffffffULL))
123 117
124void * __ioremap(phys_t phys_addr, phys_t size, unsigned long flags) 118void __iomem * __ioremap(phys_t phys_addr, phys_t size, unsigned long flags)
125{ 119{
126 struct vm_struct * area; 120 struct vm_struct * area;
127 unsigned long offset; 121 unsigned long offset;
@@ -141,7 +135,7 @@ void * __ioremap(phys_t phys_addr, phys_t size, unsigned long flags)
141 */ 135 */
142 if (IS_LOW512(phys_addr) && IS_LOW512(last_addr) && 136 if (IS_LOW512(phys_addr) && IS_LOW512(last_addr) &&
143 flags == _CACHE_UNCACHED) 137 flags == _CACHE_UNCACHED)
144 return (void *) KSEG1ADDR(phys_addr); 138 return (void __iomem *) CKSEG1ADDR(phys_addr);
145 139
146 /* 140 /*
147 * Don't allow anybody to remap normal RAM that we're using.. 141 * Don't allow anybody to remap normal RAM that we're using..
@@ -177,10 +171,10 @@ void * __ioremap(phys_t phys_addr, phys_t size, unsigned long flags)
177 return NULL; 171 return NULL;
178 } 172 }
179 173
180 return (void *) (offset + (char *)addr); 174 return (void __iomem *) (offset + (char *)addr);
181} 175}
182 176
183#define IS_KSEG1(addr) (((unsigned long)(addr) & ~0x1fffffffUL) == KSEG1) 177#define IS_KSEG1(addr) (((unsigned long)(addr) & ~0x1fffffffUL) == CKSEG1)
184 178
185void __iounmap(volatile void __iomem *addr) 179void __iounmap(volatile void __iomem *addr)
186{ 180{
@@ -190,10 +184,8 @@ void __iounmap(volatile void __iomem *addr)
190 return; 184 return;
191 185
192 p = remove_vm_area((void *) (PAGE_MASK & (unsigned long __force) addr)); 186 p = remove_vm_area((void *) (PAGE_MASK & (unsigned long __force) addr));
193 if (!p) { 187 if (!p)
194 printk(KERN_ERR "iounmap: bad address %p\n", addr); 188 printk(KERN_ERR "iounmap: bad address %p\n", addr);
195 return;
196 }
197 189
198 kfree(p); 190 kfree(p);
199} 191}
diff --git a/arch/mips/mm/pg-r4k.c b/arch/mips/mm/pg-r4k.c
index 9f8b16541577..f51e180072e3 100644
--- a/arch/mips/mm/pg-r4k.c
+++ b/arch/mips/mm/pg-r4k.c
@@ -25,7 +25,10 @@
25#include <asm/cpu.h> 25#include <asm/cpu.h>
26#include <asm/war.h> 26#include <asm/war.h>
27 27
28#define half_scache_line_size() (cpu_scache_line_size() >> 1) 28#define half_scache_line_size() (cpu_scache_line_size() >> 1)
29#define cpu_is_r4600_v1_x() ((read_c0_prid() & 0xfffffff0) == 0x00002010)
30#define cpu_is_r4600_v2_x() ((read_c0_prid() & 0xfffffff0) == 0x00002020)
31
29 32
30/* 33/*
31 * Maximum sizes: 34 * Maximum sizes:
@@ -198,15 +201,15 @@ static inline void build_cdex_p(void)
198 if (store_offset & (cpu_dcache_line_size() - 1)) 201 if (store_offset & (cpu_dcache_line_size() - 1))
199 return; 202 return;
200 203
201 if (R4600_V1_HIT_CACHEOP_WAR && ((read_c0_prid() & 0xfff0) == 0x2010)) { 204 if (R4600_V1_HIT_CACHEOP_WAR && cpu_is_r4600_v1_x()) {
202 build_nop(); 205 build_nop();
203 build_nop(); 206 build_nop();
204 build_nop(); 207 build_nop();
205 build_nop(); 208 build_nop();
206 } 209 }
207 210
208 if (R4600_V2_HIT_CACHEOP_WAR && ((read_c0_prid() & 0xfff0) == 0x2020)) 211 if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x())
209 build_insn_word(0x8c200000); /* lw $zero, ($at) */ 212 build_insn_word(0x3c01a000); /* lui $at, 0xa000 */
210 213
211 mi.c_format.opcode = cache_op; 214 mi.c_format.opcode = cache_op;
212 mi.c_format.rs = 4; /* $a0 */ 215 mi.c_format.rs = 4; /* $a0 */
@@ -361,7 +364,7 @@ void __init build_clear_page(void)
361 364
362 build_addiu_a2_a0(PAGE_SIZE - (cpu_has_prefetch ? pref_offset_clear : 0)); 365 build_addiu_a2_a0(PAGE_SIZE - (cpu_has_prefetch ? pref_offset_clear : 0));
363 366
364 if (R4600_V2_HIT_CACHEOP_WAR && ((read_c0_prid() & 0xfff0) == 0x2020)) 367 if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x())
365 build_insn_word(0x3c01a000); /* lui $at, 0xa000 */ 368 build_insn_word(0x3c01a000); /* lui $at, 0xa000 */
366 369
367dest = label(); 370dest = label();
@@ -404,9 +407,6 @@ dest = label();
404 407
405 build_jr_ra(); 408 build_jr_ra();
406 409
407 flush_icache_range((unsigned long)&clear_page_array,
408 (unsigned long) epc);
409
410 BUG_ON(epc > clear_page_array + ARRAY_SIZE(clear_page_array)); 410 BUG_ON(epc > clear_page_array + ARRAY_SIZE(clear_page_array));
411} 411}
412 412
@@ -420,7 +420,7 @@ void __init build_copy_page(void)
420 420
421 build_addiu_a2_a0(PAGE_SIZE - (cpu_has_prefetch ? pref_offset_copy : 0)); 421 build_addiu_a2_a0(PAGE_SIZE - (cpu_has_prefetch ? pref_offset_copy : 0));
422 422
423 if (R4600_V2_HIT_CACHEOP_WAR && ((read_c0_prid() & 0xfff0) == 0x2020)) 423 if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x())
424 build_insn_word(0x3c01a000); /* lui $at, 0xa000 */ 424 build_insn_word(0x3c01a000); /* lui $at, 0xa000 */
425 425
426dest = label(); 426dest = label();
@@ -482,8 +482,5 @@ dest = label();
482 482
483 build_jr_ra(); 483 build_jr_ra();
484 484
485 flush_icache_range((unsigned long)&copy_page_array,
486 (unsigned long) epc);
487
488 BUG_ON(epc > copy_page_array + ARRAY_SIZE(copy_page_array)); 485 BUG_ON(epc > copy_page_array + ARRAY_SIZE(copy_page_array));
489} 486}
diff --git a/arch/mips/mm/pg-sb1.c b/arch/mips/mm/pg-sb1.c
index 1b6df7133c1e..148c65b9cd8b 100644
--- a/arch/mips/mm/pg-sb1.c
+++ b/arch/mips/mm/pg-sb1.c
@@ -60,7 +60,8 @@ static inline void clear_page_cpu(void *page)
60 " .set noreorder \n" 60 " .set noreorder \n"
61#ifdef CONFIG_CPU_HAS_PREFETCH 61#ifdef CONFIG_CPU_HAS_PREFETCH
62 " daddiu %0, %0, 128 \n" 62 " daddiu %0, %0, 128 \n"
63 " pref " SB1_PREF_STORE_STREAMED_HINT ", -128(%0) \n" /* Prefetch the first 4 lines */ 63 " pref " SB1_PREF_STORE_STREAMED_HINT ", -128(%0) \n"
64 /* Prefetch the first 4 lines */
64 " pref " SB1_PREF_STORE_STREAMED_HINT ", -96(%0) \n" 65 " pref " SB1_PREF_STORE_STREAMED_HINT ", -96(%0) \n"
65 " pref " SB1_PREF_STORE_STREAMED_HINT ", -64(%0) \n" 66 " pref " SB1_PREF_STORE_STREAMED_HINT ", -64(%0) \n"
66 " pref " SB1_PREF_STORE_STREAMED_HINT ", -32(%0) \n" 67 " pref " SB1_PREF_STORE_STREAMED_HINT ", -32(%0) \n"
@@ -106,7 +107,8 @@ static inline void copy_page_cpu(void *to, void *from)
106#ifdef CONFIG_CPU_HAS_PREFETCH 107#ifdef CONFIG_CPU_HAS_PREFETCH
107 " daddiu %0, %0, 128 \n" 108 " daddiu %0, %0, 128 \n"
108 " daddiu %1, %1, 128 \n" 109 " daddiu %1, %1, 128 \n"
109 " pref " SB1_PREF_LOAD_STREAMED_HINT ", -128(%0)\n" /* Prefetch the first 4 lines */ 110 " pref " SB1_PREF_LOAD_STREAMED_HINT ", -128(%0)\n"
111 /* Prefetch the first 4 lines */
110 " pref " SB1_PREF_STORE_STREAMED_HINT ", -128(%1)\n" 112 " pref " SB1_PREF_STORE_STREAMED_HINT ", -128(%1)\n"
111 " pref " SB1_PREF_LOAD_STREAMED_HINT ", -96(%0)\n" 113 " pref " SB1_PREF_LOAD_STREAMED_HINT ", -96(%0)\n"
112 " pref " SB1_PREF_STORE_STREAMED_HINT ", -96(%1)\n" 114 " pref " SB1_PREF_STORE_STREAMED_HINT ", -96(%1)\n"
@@ -207,66 +209,73 @@ typedef struct dmadscr_s {
207 u64 pad_b; 209 u64 pad_b;
208} dmadscr_t; 210} dmadscr_t;
209 211
210static dmadscr_t page_descr[NR_CPUS] __attribute__((aligned(SMP_CACHE_BYTES))); 212static dmadscr_t page_descr[DM_NUM_CHANNELS]
213 __attribute__((aligned(SMP_CACHE_BYTES)));
211 214
212void sb1_dma_init(void) 215void sb1_dma_init(void)
213{ 216{
214 int cpu = smp_processor_id(); 217 int i;
215 u64 base_val = CPHYSADDR(&page_descr[cpu]) | V_DM_DSCR_BASE_RINGSZ(1);
216 218
217 bus_writeq(base_val, 219 for (i = 0; i < DM_NUM_CHANNELS; i++) {
218 (void *)IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_BASE))); 220 const u64 base_val = CPHYSADDR(&page_descr[i]) |
219 bus_writeq(base_val | M_DM_DSCR_BASE_RESET, 221 V_DM_DSCR_BASE_RINGSZ(1);
220 (void *)IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_BASE))); 222 volatile void *base_reg =
221 bus_writeq(base_val | M_DM_DSCR_BASE_ENABL, 223 IOADDR(A_DM_REGISTER(i, R_DM_DSCR_BASE));
222 (void *)IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_BASE))); 224
225 __raw_writeq(base_val, base_reg);
226 __raw_writeq(base_val | M_DM_DSCR_BASE_RESET, base_reg);
227 __raw_writeq(base_val | M_DM_DSCR_BASE_ENABL, base_reg);
228 }
223} 229}
224 230
225void clear_page(void *page) 231void clear_page(void *page)
226{ 232{
227 int cpu = smp_processor_id(); 233 u64 to_phys = CPHYSADDR(page);
234 unsigned int cpu = smp_processor_id();
228 235
229 /* if the page is above Kseg0, use old way */ 236 /* if the page is not in KSEG0, use old way */
230 if ((long)KSEGX(page) != (long)CKSEG0) 237 if ((long)KSEGX(page) != (long)CKSEG0)
231 return clear_page_cpu(page); 238 return clear_page_cpu(page);
232 239
233 page_descr[cpu].dscr_a = CPHYSADDR(page) | M_DM_DSCRA_ZERO_MEM | M_DM_DSCRA_L2C_DEST | M_DM_DSCRA_INTERRUPT; 240 page_descr[cpu].dscr_a = to_phys | M_DM_DSCRA_ZERO_MEM |
241 M_DM_DSCRA_L2C_DEST | M_DM_DSCRA_INTERRUPT;
234 page_descr[cpu].dscr_b = V_DM_DSCRB_SRC_LENGTH(PAGE_SIZE); 242 page_descr[cpu].dscr_b = V_DM_DSCRB_SRC_LENGTH(PAGE_SIZE);
235 bus_writeq(1, (void *)IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_COUNT))); 243 __raw_writeq(1, IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_COUNT)));
236 244
237 /* 245 /*
238 * Don't really want to do it this way, but there's no 246 * Don't really want to do it this way, but there's no
239 * reliable way to delay completion detection. 247 * reliable way to delay completion detection.
240 */ 248 */
241 while (!(bus_readq((void *)(IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_BASE_DEBUG)) & 249 while (!(__raw_readq(IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_BASE_DEBUG)))
242 M_DM_DSCR_BASE_INTERRUPT)))) 250 & M_DM_DSCR_BASE_INTERRUPT))
243 ; 251 ;
244 bus_readq((void *)IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_BASE))); 252 __raw_readq(IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_BASE)));
245} 253}
246 254
247void copy_page(void *to, void *from) 255void copy_page(void *to, void *from)
248{ 256{
249 unsigned long from_phys = CPHYSADDR(from); 257 u64 from_phys = CPHYSADDR(from);
250 unsigned long to_phys = CPHYSADDR(to); 258 u64 to_phys = CPHYSADDR(to);
251 int cpu = smp_processor_id(); 259 unsigned int cpu = smp_processor_id();
252 260
253 /* if either page is above Kseg0, use old way */ 261 /* if any page is not in KSEG0, use old way */
254 if ((long)KSEGX(to) != (long)CKSEG0 262 if ((long)KSEGX(to) != (long)CKSEG0
255 || (long)KSEGX(from) != (long)CKSEG0) 263 || (long)KSEGX(from) != (long)CKSEG0)
256 return copy_page_cpu(to, from); 264 return copy_page_cpu(to, from);
257 265
258 page_descr[cpu].dscr_a = CPHYSADDR(to_phys) | M_DM_DSCRA_L2C_DEST | M_DM_DSCRA_INTERRUPT; 266 page_descr[cpu].dscr_a = to_phys | M_DM_DSCRA_L2C_DEST |
259 page_descr[cpu].dscr_b = CPHYSADDR(from_phys) | V_DM_DSCRB_SRC_LENGTH(PAGE_SIZE); 267 M_DM_DSCRA_INTERRUPT;
260 bus_writeq(1, (void *)IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_COUNT))); 268 page_descr[cpu].dscr_b = from_phys | V_DM_DSCRB_SRC_LENGTH(PAGE_SIZE);
269 __raw_writeq(1, IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_COUNT)));
261 270
262 /* 271 /*
263 * Don't really want to do it this way, but there's no 272 * Don't really want to do it this way, but there's no
264 * reliable way to delay completion detection. 273 * reliable way to delay completion detection.
265 */ 274 */
266 while (!(bus_readq((void *)(IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_BASE_DEBUG)) & 275 while (!(__raw_readq(IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_BASE_DEBUG)))
267 M_DM_DSCR_BASE_INTERRUPT)))) 276 & M_DM_DSCR_BASE_INTERRUPT))
268 ; 277 ;
269 bus_readq((void *)IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_BASE))); 278 __raw_readq(IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_BASE)));
270} 279}
271 280
272#else /* !CONFIG_SIBYTE_DMA_PAGEOPS */ 281#else /* !CONFIG_SIBYTE_DMA_PAGEOPS */
diff --git a/arch/mips/mm/pgtable-32.c b/arch/mips/mm/pgtable-32.c
index 4f07f81e8500..4a3c4919e314 100644
--- a/arch/mips/mm/pgtable-32.c
+++ b/arch/mips/mm/pgtable-32.c
@@ -10,6 +10,7 @@
10#include <linux/mm.h> 10#include <linux/mm.h>
11#include <linux/bootmem.h> 11#include <linux/bootmem.h>
12#include <linux/highmem.h> 12#include <linux/highmem.h>
13#include <asm/fixmap.h>
13#include <asm/pgtable.h> 14#include <asm/pgtable.h>
14 15
15void pgd_init(unsigned long page) 16void pgd_init(unsigned long page)
@@ -29,42 +30,12 @@ void pgd_init(unsigned long page)
29 } 30 }
30} 31}
31 32
32#ifdef CONFIG_HIGHMEM
33static void __init fixrange_init (unsigned long start, unsigned long end,
34 pgd_t *pgd_base)
35{
36 pgd_t *pgd;
37 pmd_t *pmd;
38 pte_t *pte;
39 int i, j;
40 unsigned long vaddr;
41
42 vaddr = start;
43 i = __pgd_offset(vaddr);
44 j = __pmd_offset(vaddr);
45 pgd = pgd_base + i;
46
47 for ( ; (i < PTRS_PER_PGD) && (vaddr != end); pgd++, i++) {
48 pmd = (pmd_t *)pgd;
49 for (; (j < PTRS_PER_PMD) && (vaddr != end); pmd++, j++) {
50 if (pmd_none(*pmd)) {
51 pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE);
52 set_pmd(pmd, __pmd((unsigned long)pte));
53 if (pte != pte_offset_kernel(pmd, 0))
54 BUG();
55 }
56 vaddr += PMD_SIZE;
57 }
58 j = 0;
59 }
60}
61#endif
62
63void __init pagetable_init(void) 33void __init pagetable_init(void)
64{ 34{
65#ifdef CONFIG_HIGHMEM 35#ifdef CONFIG_HIGHMEM
66 unsigned long vaddr; 36 unsigned long vaddr;
67 pgd_t *pgd, *pgd_base; 37 pgd_t *pgd, *pgd_base;
38 pud_t *pud;
68 pmd_t *pmd; 39 pmd_t *pmd;
69 pte_t *pte; 40 pte_t *pte;
70#endif 41#endif
@@ -90,7 +61,8 @@ void __init pagetable_init(void)
90 fixrange_init(vaddr, vaddr + PAGE_SIZE*LAST_PKMAP, pgd_base); 61 fixrange_init(vaddr, vaddr + PAGE_SIZE*LAST_PKMAP, pgd_base);
91 62
92 pgd = swapper_pg_dir + __pgd_offset(vaddr); 63 pgd = swapper_pg_dir + __pgd_offset(vaddr);
93 pmd = pmd_offset(pgd, vaddr); 64 pud = pud_offset(pgd, vaddr);
65 pmd = pmd_offset(pud, vaddr);
94 pte = pte_offset_kernel(pmd, vaddr); 66 pte = pte_offset_kernel(pmd, vaddr);
95 pkmap_page_table = pte; 67 pkmap_page_table = pte;
96#endif 68#endif
diff --git a/arch/mips/mm/sc-rm7k.c b/arch/mips/mm/sc-rm7k.c
index 4e92f931aaba..9e8ff8badb19 100644
--- a/arch/mips/mm/sc-rm7k.c
+++ b/arch/mips/mm/sc-rm7k.c
@@ -15,6 +15,7 @@
15#include <asm/cacheops.h> 15#include <asm/cacheops.h>
16#include <asm/mipsregs.h> 16#include <asm/mipsregs.h>
17#include <asm/processor.h> 17#include <asm/processor.h>
18#include <asm/cacheflush.h> /* for run_uncached() */
18 19
19/* Primary cache parameters. */ 20/* Primary cache parameters. */
20#define sc_lsize 32 21#define sc_lsize 32
@@ -96,25 +97,13 @@ static void rm7k_sc_inv(unsigned long addr, unsigned long size)
96} 97}
97 98
98/* 99/*
99 * This function is executed in the uncached segment CKSEG1. 100 * This function is executed in uncached address space.
100 * It must not touch the stack, because the stack pointer still points
101 * into CKSEG0.
102 *
103 * Three options:
104 * - Write it in assembly and guarantee that we don't use the stack.
105 * - Disable caching for CKSEG0 before calling it.
106 * - Pray that GCC doesn't randomly start using the stack.
107 *
108 * This being Linux, we obviously take the least sane of those options -
109 * following DaveM's lead in c-r4k.c
110 *
111 * It seems we get our kicks from relying on unguaranteed behaviour in GCC
112 */ 101 */
113static __init void __rm7k_sc_enable(void) 102static __init void __rm7k_sc_enable(void)
114{ 103{
115 int i; 104 int i;
116 105
117 set_c0_config(1 << 3); /* CONF_SE */ 106 set_c0_config(RM7K_CONF_SE);
118 107
119 write_c0_taglo(0); 108 write_c0_taglo(0);
120 write_c0_taghi(0); 109 write_c0_taghi(0);
@@ -127,24 +116,22 @@ static __init void __rm7k_sc_enable(void)
127 ".set mips0\n\t" 116 ".set mips0\n\t"
128 ".set reorder" 117 ".set reorder"
129 : 118 :
130 : "r" (KSEG0ADDR(i)), "i" (Index_Store_Tag_SD)); 119 : "r" (CKSEG0ADDR(i)), "i" (Index_Store_Tag_SD));
131 } 120 }
132} 121}
133 122
134static __init void rm7k_sc_enable(void) 123static __init void rm7k_sc_enable(void)
135{ 124{
136 void (*func)(void) = (void *) KSEG1ADDR(&__rm7k_sc_enable); 125 if (read_c0_config() & RM7K_CONF_SE)
137
138 if (read_c0_config() & 0x08) /* CONF_SE */
139 return; 126 return;
140 127
141 printk(KERN_INFO "Enabling secondary cache..."); 128 printk(KERN_INFO "Enabling secondary cache...\n");
142 func(); 129 run_uncached(__rm7k_sc_enable);
143} 130}
144 131
145static void rm7k_sc_disable(void) 132static void rm7k_sc_disable(void)
146{ 133{
147 clear_c0_config(1<<3); /* CONF_SE */ 134 clear_c0_config(RM7K_CONF_SE);
148} 135}
149 136
150struct bcache_ops rm7k_sc_ops = { 137struct bcache_ops rm7k_sc_ops = {
@@ -158,19 +145,19 @@ void __init rm7k_sc_init(void)
158{ 145{
159 unsigned int config = read_c0_config(); 146 unsigned int config = read_c0_config();
160 147
161 if ((config >> 31) & 1) /* Bit 31 set -> no S-Cache */ 148 if ((config & RM7K_CONF_SC))
162 return; 149 return;
163 150
164 printk(KERN_INFO "Secondary cache size %dK, linesize %d bytes.\n", 151 printk(KERN_INFO "Secondary cache size %dK, linesize %d bytes.\n",
165 (scache_size >> 10), sc_lsize); 152 (scache_size >> 10), sc_lsize);
166 153
167 if (!((config >> 3) & 1)) /* CONF_SE */ 154 if (!(config & RM7K_CONF_SE))
168 rm7k_sc_enable(); 155 rm7k_sc_enable();
169 156
170 /* 157 /*
171 * While we're at it let's deal with the tertiary cache. 158 * While we're at it let's deal with the tertiary cache.
172 */ 159 */
173 if (!((config >> 17) & 1)) { 160 if (!(config & RM7K_CONF_TC)) {
174 161
175 /* 162 /*
176 * We can't enable the L3 cache yet. There may be board-specific 163 * We can't enable the L3 cache yet. There may be board-specific
@@ -183,9 +170,9 @@ void __init rm7k_sc_init(void)
183 * to probe it. 170 * to probe it.
184 */ 171 */
185 printk(KERN_INFO "Tertiary cache present, %s enabled\n", 172 printk(KERN_INFO "Tertiary cache present, %s enabled\n",
186 config&(1<<12) ? "already" : "not (yet)"); 173 (config & RM7K_CONF_TE) ? "already" : "not (yet)");
187 174
188 if ((config >> 12) & 1) 175 if ((config & RM7K_CONF_TE))
189 rm7k_tcache_enabled = 1; 176 rm7k_tcache_enabled = 1;
190 } 177 }
191 178
diff --git a/arch/mips/mm/tlb-andes.c b/arch/mips/mm/tlb-andes.c
index 167e08e9661a..3f422a849c41 100644
--- a/arch/mips/mm/tlb-andes.c
+++ b/arch/mips/mm/tlb-andes.c
@@ -195,6 +195,7 @@ void __update_tlb(struct vm_area_struct * vma, unsigned long address, pte_t pte)
195{ 195{
196 unsigned long flags; 196 unsigned long flags;
197 pgd_t *pgdp; 197 pgd_t *pgdp;
198 pud_t *pudp;
198 pmd_t *pmdp; 199 pmd_t *pmdp;
199 pte_t *ptep; 200 pte_t *ptep;
200 int idx, pid; 201 int idx, pid;
@@ -220,7 +221,8 @@ void __update_tlb(struct vm_area_struct * vma, unsigned long address, pte_t pte)
220 write_c0_entryhi(address | (pid)); 221 write_c0_entryhi(address | (pid));
221 pgdp = pgd_offset(vma->vm_mm, address); 222 pgdp = pgd_offset(vma->vm_mm, address);
222 tlb_probe(); 223 tlb_probe();
223 pmdp = pmd_offset(pgdp, address); 224 pudp = pud_offset(pgdp, address);
225 pmdp = pmd_offset(pudp, address);
224 idx = read_c0_index(); 226 idx = read_c0_index();
225 ptep = pte_offset_map(pmdp, address); 227 ptep = pte_offset_map(pmdp, address);
226 write_c0_entrylo0(pte_val(*ptep++) >> 6); 228 write_c0_entrylo0(pte_val(*ptep++) >> 6);
diff --git a/arch/mips/mm/tlb-r4k.c b/arch/mips/mm/tlb-r4k.c
index 59d38bc05b69..8297970f0bb1 100644
--- a/arch/mips/mm/tlb-r4k.c
+++ b/arch/mips/mm/tlb-r4k.c
@@ -21,6 +21,12 @@
21 21
22extern void build_tlb_refill_handler(void); 22extern void build_tlb_refill_handler(void);
23 23
24/*
25 * Make sure all entries differ. If they're not different
26 * MIPS32 will take revenge ...
27 */
28#define UNIQUE_ENTRYHI(idx) (CKSEG0 + ((idx) << (PAGE_SHIFT + 1)))
29
24/* CP0 hazard avoidance. */ 30/* CP0 hazard avoidance. */
25#define BARRIER __asm__ __volatile__(".set noreorder\n\t" \ 31#define BARRIER __asm__ __volatile__(".set noreorder\n\t" \
26 "nop; nop; nop; nop; nop; nop;\n\t" \ 32 "nop; nop; nop; nop; nop; nop;\n\t" \
@@ -42,11 +48,8 @@ void local_flush_tlb_all(void)
42 48
43 /* Blast 'em all away. */ 49 /* Blast 'em all away. */
44 while (entry < current_cpu_data.tlbsize) { 50 while (entry < current_cpu_data.tlbsize) {
45 /* 51 /* Make sure all entries differ. */
46 * Make sure all entries differ. If they're not different 52 write_c0_entryhi(UNIQUE_ENTRYHI(entry));
47 * MIPS32 will take revenge ...
48 */
49 write_c0_entryhi(CKSEG0 + (entry << (PAGE_SHIFT + 1)));
50 write_c0_index(entry); 53 write_c0_index(entry);
51 mtc0_tlbw_hazard(); 54 mtc0_tlbw_hazard();
52 tlb_write_indexed(); 55 tlb_write_indexed();
@@ -57,12 +60,21 @@ void local_flush_tlb_all(void)
57 local_irq_restore(flags); 60 local_irq_restore(flags);
58} 61}
59 62
63/* All entries common to a mm share an asid. To effectively flush
64 these entries, we just bump the asid. */
60void local_flush_tlb_mm(struct mm_struct *mm) 65void local_flush_tlb_mm(struct mm_struct *mm)
61{ 66{
62 int cpu = smp_processor_id(); 67 int cpu;
68
69 preempt_disable();
63 70
64 if (cpu_context(cpu, mm) != 0) 71 cpu = smp_processor_id();
65 drop_mmu_context(mm,cpu); 72
73 if (cpu_context(cpu, mm) != 0) {
74 drop_mmu_context(mm, cpu);
75 }
76
77 preempt_enable();
66} 78}
67 79
68void local_flush_tlb_range(struct vm_area_struct *vma, unsigned long start, 80void local_flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
@@ -75,9 +87,9 @@ void local_flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
75 unsigned long flags; 87 unsigned long flags;
76 int size; 88 int size;
77 89
78 local_irq_save(flags);
79 size = (end - start + (PAGE_SIZE - 1)) >> PAGE_SHIFT; 90 size = (end - start + (PAGE_SIZE - 1)) >> PAGE_SHIFT;
80 size = (size + 1) >> 1; 91 size = (size + 1) >> 1;
92 local_irq_save(flags);
81 if (size <= current_cpu_data.tlbsize/2) { 93 if (size <= current_cpu_data.tlbsize/2) {
82 int oldpid = read_c0_entryhi(); 94 int oldpid = read_c0_entryhi();
83 int newpid = cpu_asid(cpu, mm); 95 int newpid = cpu_asid(cpu, mm);
@@ -99,8 +111,7 @@ void local_flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
99 if (idx < 0) 111 if (idx < 0)
100 continue; 112 continue;
101 /* Make sure all entries differ. */ 113 /* Make sure all entries differ. */
102 write_c0_entryhi(CKSEG0 + 114 write_c0_entryhi(UNIQUE_ENTRYHI(idx));
103 (idx << (PAGE_SHIFT + 1)));
104 mtc0_tlbw_hazard(); 115 mtc0_tlbw_hazard();
105 tlb_write_indexed(); 116 tlb_write_indexed();
106 } 117 }
@@ -118,9 +129,9 @@ void local_flush_tlb_kernel_range(unsigned long start, unsigned long end)
118 unsigned long flags; 129 unsigned long flags;
119 int size; 130 int size;
120 131
121 local_irq_save(flags);
122 size = (end - start + (PAGE_SIZE - 1)) >> PAGE_SHIFT; 132 size = (end - start + (PAGE_SIZE - 1)) >> PAGE_SHIFT;
123 size = (size + 1) >> 1; 133 size = (size + 1) >> 1;
134 local_irq_save(flags);
124 if (size <= current_cpu_data.tlbsize / 2) { 135 if (size <= current_cpu_data.tlbsize / 2) {
125 int pid = read_c0_entryhi(); 136 int pid = read_c0_entryhi();
126 137
@@ -142,7 +153,7 @@ void local_flush_tlb_kernel_range(unsigned long start, unsigned long end)
142 if (idx < 0) 153 if (idx < 0)
143 continue; 154 continue;
144 /* Make sure all entries differ. */ 155 /* Make sure all entries differ. */
145 write_c0_entryhi(CKSEG0 + (idx << (PAGE_SHIFT + 1))); 156 write_c0_entryhi(UNIQUE_ENTRYHI(idx));
146 mtc0_tlbw_hazard(); 157 mtc0_tlbw_hazard();
147 tlb_write_indexed(); 158 tlb_write_indexed();
148 } 159 }
@@ -176,7 +187,7 @@ void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long page)
176 if (idx < 0) 187 if (idx < 0)
177 goto finish; 188 goto finish;
178 /* Make sure all entries differ. */ 189 /* Make sure all entries differ. */
179 write_c0_entryhi(CKSEG0 + (idx << (PAGE_SHIFT + 1))); 190 write_c0_entryhi(UNIQUE_ENTRYHI(idx));
180 mtc0_tlbw_hazard(); 191 mtc0_tlbw_hazard();
181 tlb_write_indexed(); 192 tlb_write_indexed();
182 tlbw_use_hazard(); 193 tlbw_use_hazard();
@@ -197,8 +208,8 @@ void local_flush_tlb_one(unsigned long page)
197 int oldpid, idx; 208 int oldpid, idx;
198 209
199 local_irq_save(flags); 210 local_irq_save(flags);
200 page &= (PAGE_MASK << 1);
201 oldpid = read_c0_entryhi(); 211 oldpid = read_c0_entryhi();
212 page &= (PAGE_MASK << 1);
202 write_c0_entryhi(page); 213 write_c0_entryhi(page);
203 mtc0_tlbw_hazard(); 214 mtc0_tlbw_hazard();
204 tlb_probe(); 215 tlb_probe();
@@ -208,7 +219,7 @@ void local_flush_tlb_one(unsigned long page)
208 write_c0_entrylo1(0); 219 write_c0_entrylo1(0);
209 if (idx >= 0) { 220 if (idx >= 0) {
210 /* Make sure all entries differ. */ 221 /* Make sure all entries differ. */
211 write_c0_entryhi(CKSEG0 + (idx << (PAGE_SHIFT + 1))); 222 write_c0_entryhi(UNIQUE_ENTRYHI(idx));
212 mtc0_tlbw_hazard(); 223 mtc0_tlbw_hazard();
213 tlb_write_indexed(); 224 tlb_write_indexed();
214 tlbw_use_hazard(); 225 tlbw_use_hazard();
@@ -227,6 +238,7 @@ void __update_tlb(struct vm_area_struct * vma, unsigned long address, pte_t pte)
227{ 238{
228 unsigned long flags; 239 unsigned long flags;
229 pgd_t *pgdp; 240 pgd_t *pgdp;
241 pud_t *pudp;
230 pmd_t *pmdp; 242 pmd_t *pmdp;
231 pte_t *ptep; 243 pte_t *ptep;
232 int idx, pid; 244 int idx, pid;
@@ -237,35 +249,34 @@ void __update_tlb(struct vm_area_struct * vma, unsigned long address, pte_t pte)
237 if (current->active_mm != vma->vm_mm) 249 if (current->active_mm != vma->vm_mm)
238 return; 250 return;
239 251
240 pid = read_c0_entryhi() & ASID_MASK;
241
242 local_irq_save(flags); 252 local_irq_save(flags);
253
254 pid = read_c0_entryhi() & ASID_MASK;
243 address &= (PAGE_MASK << 1); 255 address &= (PAGE_MASK << 1);
244 write_c0_entryhi(address | pid); 256 write_c0_entryhi(address | pid);
245 pgdp = pgd_offset(vma->vm_mm, address); 257 pgdp = pgd_offset(vma->vm_mm, address);
246 mtc0_tlbw_hazard(); 258 mtc0_tlbw_hazard();
247 tlb_probe(); 259 tlb_probe();
248 BARRIER; 260 BARRIER;
249 pmdp = pmd_offset(pgdp, address); 261 pudp = pud_offset(pgdp, address);
262 pmdp = pmd_offset(pudp, address);
250 idx = read_c0_index(); 263 idx = read_c0_index();
251 ptep = pte_offset_map(pmdp, address); 264 ptep = pte_offset_map(pmdp, address);
252 265
253 #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) 266#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1)
254 write_c0_entrylo0(ptep->pte_high); 267 write_c0_entrylo0(ptep->pte_high);
255 ptep++; 268 ptep++;
256 write_c0_entrylo1(ptep->pte_high); 269 write_c0_entrylo1(ptep->pte_high);
257#else 270#else
258 write_c0_entrylo0(pte_val(*ptep++) >> 6); 271 write_c0_entrylo0(pte_val(*ptep++) >> 6);
259 write_c0_entrylo1(pte_val(*ptep) >> 6); 272 write_c0_entrylo1(pte_val(*ptep) >> 6);
260#endif 273#endif
261 write_c0_entryhi(address | pid);
262 mtc0_tlbw_hazard(); 274 mtc0_tlbw_hazard();
263 if (idx < 0) 275 if (idx < 0)
264 tlb_write_random(); 276 tlb_write_random();
265 else 277 else
266 tlb_write_indexed(); 278 tlb_write_indexed();
267 tlbw_use_hazard(); 279 tlbw_use_hazard();
268 write_c0_entryhi(pid);
269 local_irq_restore(flags); 280 local_irq_restore(flags);
270} 281}
271 282
@@ -357,7 +368,8 @@ __init int add_temporary_entry(unsigned long entrylo0, unsigned long entrylo1,
357 old_pagemask = read_c0_pagemask(); 368 old_pagemask = read_c0_pagemask();
358 wired = read_c0_wired(); 369 wired = read_c0_wired();
359 if (--temp_tlb_entry < wired) { 370 if (--temp_tlb_entry < wired) {
360 printk(KERN_WARNING "No TLB space left for add_temporary_entry\n"); 371 printk(KERN_WARNING
372 "No TLB space left for add_temporary_entry\n");
361 ret = -ENOSPC; 373 ret = -ENOSPC;
362 goto out; 374 goto out;
363 } 375 }
@@ -388,7 +400,7 @@ static void __init probe_tlb(unsigned long config)
388 * is not supported, we assume R4k style. Cpu probing already figured 400 * is not supported, we assume R4k style. Cpu probing already figured
389 * out the number of tlb entries. 401 * out the number of tlb entries.
390 */ 402 */
391 if ((c->processor_id & 0xff0000) == PRID_COMP_LEGACY) 403 if ((c->processor_id & 0xff0000) == PRID_COMP_LEGACY)
392 return; 404 return;
393 405
394 reg = read_c0_config1(); 406 reg = read_c0_config1();
diff --git a/arch/mips/mm/tlb-sb1.c b/arch/mips/mm/tlb-sb1.c
deleted file mode 100644
index 6256cafcf3a2..000000000000
--- a/arch/mips/mm/tlb-sb1.c
+++ /dev/null
@@ -1,376 +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 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 */
20#include <linux/init.h>
21#include <asm/mmu_context.h>
22#include <asm/bootinfo.h>
23#include <asm/cpu.h>
24
25extern void build_tlb_refill_handler(void);
26
27#define UNIQUE_ENTRYHI(idx) (CKSEG0 + ((idx) << (PAGE_SHIFT + 1)))
28
29/* Dump the current entry* and pagemask registers */
30static inline void dump_cur_tlb_regs(void)
31{
32 unsigned int entryhihi, entryhilo, entrylo0hi, entrylo0lo, entrylo1hi;
33 unsigned int entrylo1lo, pagemask;
34
35 __asm__ __volatile__ (
36 ".set push \n"
37 ".set noreorder \n"
38 ".set mips64 \n"
39 ".set noat \n"
40 " tlbr \n"
41 " dmfc0 $1, $10 \n"
42 " dsrl32 %0, $1, 0 \n"
43 " sll %1, $1, 0 \n"
44 " dmfc0 $1, $2 \n"
45 " dsrl32 %2, $1, 0 \n"
46 " sll %3, $1, 0 \n"
47 " dmfc0 $1, $3 \n"
48 " dsrl32 %4, $1, 0 \n"
49 " sll %5, $1, 0 \n"
50 " mfc0 %6, $5 \n"
51 ".set pop \n"
52 : "=r" (entryhihi), "=r" (entryhilo),
53 "=r" (entrylo0hi), "=r" (entrylo0lo),
54 "=r" (entrylo1hi), "=r" (entrylo1lo),
55 "=r" (pagemask));
56
57 printk("%08X%08X %08X%08X %08X%08X %08X",
58 entryhihi, entryhilo,
59 entrylo0hi, entrylo0lo,
60 entrylo1hi, entrylo1lo,
61 pagemask);
62}
63
64void sb1_dump_tlb(void)
65{
66 unsigned long old_ctx;
67 unsigned long flags;
68 int entry;
69 local_irq_save(flags);
70 old_ctx = read_c0_entryhi();
71 printk("Current TLB registers state:\n"
72 " EntryHi EntryLo0 EntryLo1 PageMask Index\n"
73 "--------------------------------------------------------------------\n");
74 dump_cur_tlb_regs();
75 printk(" %08X\n", read_c0_index());
76 printk("\n\nFull TLB Dump:\n"
77 "Idx EntryHi EntryLo0 EntryLo1 PageMask\n"
78 "--------------------------------------------------------------\n");
79 for (entry = 0; entry < current_cpu_data.tlbsize; entry++) {
80 write_c0_index(entry);
81 printk("\n%02i ", entry);
82 dump_cur_tlb_regs();
83 }
84 printk("\n");
85 write_c0_entryhi(old_ctx);
86 local_irq_restore(flags);
87}
88
89void local_flush_tlb_all(void)
90{
91 unsigned long flags;
92 unsigned long old_ctx;
93 int entry;
94
95 local_irq_save(flags);
96 /* Save old context and create impossible VPN2 value */
97 old_ctx = read_c0_entryhi() & ASID_MASK;
98 write_c0_entrylo0(0);
99 write_c0_entrylo1(0);
100
101 entry = read_c0_wired();
102 while (entry < current_cpu_data.tlbsize) {
103 write_c0_entryhi(UNIQUE_ENTRYHI(entry));
104 write_c0_index(entry);
105 tlb_write_indexed();
106 entry++;
107 }
108 write_c0_entryhi(old_ctx);
109 local_irq_restore(flags);
110}
111
112
113/*
114 * Use a bogus region of memory (starting at 0) to sanitize the TLB's.
115 * Use increments of the maximum page size (16MB), and check for duplicate
116 * entries before doing a given write. Then, when we're safe from collisions
117 * with the firmware, go back and give all the entries invalid addresses with
118 * the normal flush routine. Wired entries will be killed as well!
119 */
120static void __init sb1_sanitize_tlb(void)
121{
122 int entry;
123 long addr = 0;
124
125 long inc = 1<<24; /* 16MB */
126 /* Save old context and create impossible VPN2 value */
127 write_c0_entrylo0(0);
128 write_c0_entrylo1(0);
129 for (entry = 0; entry < current_cpu_data.tlbsize; entry++) {
130 do {
131 addr += inc;
132 write_c0_entryhi(addr);
133 tlb_probe();
134 } while ((int)(read_c0_index()) >= 0);
135 write_c0_index(entry);
136 tlb_write_indexed();
137 }
138 /* Now that we know we're safe from collisions, we can safely flush
139 the TLB with the "normal" routine. */
140 local_flush_tlb_all();
141}
142
143void local_flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
144 unsigned long end)
145{
146 struct mm_struct *mm = vma->vm_mm;
147 unsigned long flags;
148 int cpu;
149
150 local_irq_save(flags);
151 cpu = smp_processor_id();
152 if (cpu_context(cpu, mm) != 0) {
153 int size;
154 size = (end - start + (PAGE_SIZE - 1)) >> PAGE_SHIFT;
155 size = (size + 1) >> 1;
156 if (size <= (current_cpu_data.tlbsize/2)) {
157 int oldpid = read_c0_entryhi() & ASID_MASK;
158 int newpid = cpu_asid(cpu, mm);
159
160 start &= (PAGE_MASK << 1);
161 end += ((PAGE_SIZE << 1) - 1);
162 end &= (PAGE_MASK << 1);
163 while (start < end) {
164 int idx;
165
166 write_c0_entryhi(start | newpid);
167 start += (PAGE_SIZE << 1);
168 tlb_probe();
169 idx = read_c0_index();
170 write_c0_entrylo0(0);
171 write_c0_entrylo1(0);
172 write_c0_entryhi(UNIQUE_ENTRYHI(idx));
173 if (idx < 0)
174 continue;
175 tlb_write_indexed();
176 }
177 write_c0_entryhi(oldpid);
178 } else {
179 drop_mmu_context(mm, cpu);
180 }
181 }
182 local_irq_restore(flags);
183}
184
185void local_flush_tlb_kernel_range(unsigned long start, unsigned long end)
186{
187 unsigned long flags;
188 int size;
189
190 size = (end - start + (PAGE_SIZE - 1)) >> PAGE_SHIFT;
191 size = (size + 1) >> 1;
192
193 local_irq_save(flags);
194 if (size <= (current_cpu_data.tlbsize/2)) {
195 int pid = read_c0_entryhi();
196
197 start &= (PAGE_MASK << 1);
198 end += ((PAGE_SIZE << 1) - 1);
199 end &= (PAGE_MASK << 1);
200
201 while (start < end) {
202 int idx;
203
204 write_c0_entryhi(start);
205 start += (PAGE_SIZE << 1);
206 tlb_probe();
207 idx = read_c0_index();
208 write_c0_entrylo0(0);
209 write_c0_entrylo1(0);
210 write_c0_entryhi(UNIQUE_ENTRYHI(idx));
211 if (idx < 0)
212 continue;
213 tlb_write_indexed();
214 }
215 write_c0_entryhi(pid);
216 } else {
217 local_flush_tlb_all();
218 }
219 local_irq_restore(flags);
220}
221
222void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long page)
223{
224 unsigned long flags;
225 int cpu = smp_processor_id();
226
227 local_irq_save(flags);
228 if (cpu_context(cpu, vma->vm_mm) != 0) {
229 int oldpid, newpid, idx;
230 newpid = cpu_asid(cpu, vma->vm_mm);
231 page &= (PAGE_MASK << 1);
232 oldpid = read_c0_entryhi() & ASID_MASK;
233 write_c0_entryhi(page | newpid);
234 tlb_probe();
235 idx = read_c0_index();
236 write_c0_entrylo0(0);
237 write_c0_entrylo1(0);
238 if (idx < 0)
239 goto finish;
240 /* Make sure all entries differ. */
241 write_c0_entryhi(UNIQUE_ENTRYHI(idx));
242 tlb_write_indexed();
243 finish:
244 write_c0_entryhi(oldpid);
245 }
246 local_irq_restore(flags);
247}
248
249/*
250 * Remove one kernel space TLB entry. This entry is assumed to be marked
251 * global so we don't do the ASID thing.
252 */
253void local_flush_tlb_one(unsigned long page)
254{
255 unsigned long flags;
256 int oldpid, idx;
257
258 page &= (PAGE_MASK << 1);
259 oldpid = read_c0_entryhi() & ASID_MASK;
260
261 local_irq_save(flags);
262 write_c0_entryhi(page);
263 tlb_probe();
264 idx = read_c0_index();
265 if (idx >= 0) {
266 /* Make sure all entries differ. */
267 write_c0_entryhi(UNIQUE_ENTRYHI(idx));
268 write_c0_entrylo0(0);
269 write_c0_entrylo1(0);
270 tlb_write_indexed();
271 }
272
273 write_c0_entryhi(oldpid);
274 local_irq_restore(flags);
275}
276
277/* All entries common to a mm share an asid. To effectively flush
278 these entries, we just bump the asid. */
279void local_flush_tlb_mm(struct mm_struct *mm)
280{
281 int cpu;
282
283 preempt_disable();
284
285 cpu = smp_processor_id();
286
287 if (cpu_context(cpu, mm) != 0) {
288 drop_mmu_context(mm, cpu);
289 }
290
291 preempt_enable();
292}
293
294/* Stolen from mips32 routines */
295
296void __update_tlb(struct vm_area_struct *vma, unsigned long address, pte_t pte)
297{
298 unsigned long flags;
299 pgd_t *pgdp;
300 pmd_t *pmdp;
301 pte_t *ptep;
302 int idx, pid;
303
304 /*
305 * Handle debugger faulting in for debugee.
306 */
307 if (current->active_mm != vma->vm_mm)
308 return;
309
310 local_irq_save(flags);
311
312 pid = read_c0_entryhi() & ASID_MASK;
313 address &= (PAGE_MASK << 1);
314 write_c0_entryhi(address | (pid));
315 pgdp = pgd_offset(vma->vm_mm, address);
316 tlb_probe();
317 pmdp = pmd_offset(pgdp, address);
318 idx = read_c0_index();
319 ptep = pte_offset_map(pmdp, address);
320 write_c0_entrylo0(pte_val(*ptep++) >> 6);
321 write_c0_entrylo1(pte_val(*ptep) >> 6);
322 if (idx < 0) {
323 tlb_write_random();
324 } else {
325 tlb_write_indexed();
326 }
327 local_irq_restore(flags);
328}
329
330void __init add_wired_entry(unsigned long entrylo0, unsigned long entrylo1,
331 unsigned long entryhi, unsigned long pagemask)
332{
333 unsigned long flags;
334 unsigned long wired;
335 unsigned long old_pagemask;
336 unsigned long old_ctx;
337
338 local_irq_save(flags);
339 old_ctx = read_c0_entryhi() & 0xff;
340 old_pagemask = read_c0_pagemask();
341 wired = read_c0_wired();
342 write_c0_wired(wired + 1);
343 write_c0_index(wired);
344
345 write_c0_pagemask(pagemask);
346 write_c0_entryhi(entryhi);
347 write_c0_entrylo0(entrylo0);
348 write_c0_entrylo1(entrylo1);
349 tlb_write_indexed();
350
351 write_c0_entryhi(old_ctx);
352 write_c0_pagemask(old_pagemask);
353
354 local_flush_tlb_all();
355 local_irq_restore(flags);
356}
357
358/*
359 * This is called from loadmmu.c. We have to set up all the
360 * memory management function pointers, as well as initialize
361 * the caches and tlbs
362 */
363void tlb_init(void)
364{
365 write_c0_pagemask(PM_DEFAULT_MASK);
366 write_c0_wired(0);
367
368 /*
369 * We don't know what state the firmware left the TLB's in, so this is
370 * the ultra-conservative way to flush the TLB's and avoid machine
371 * check exceptions due to duplicate TLB entries
372 */
373 sb1_sanitize_tlb();
374
375 build_tlb_refill_handler();
376}
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index 6569be3983c7..0f9485806bac 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -6,6 +6,7 @@
6 * Synthesize TLB refill handlers at runtime. 6 * Synthesize TLB refill handlers at runtime.
7 * 7 *
8 * Copyright (C) 2004,2005 by Thiemo Seufer 8 * Copyright (C) 2004,2005 by Thiemo Seufer
9 * Copyright (C) 2005 Maciej W. Rozycki
9 */ 10 */
10 11
11#include <stdarg.h> 12#include <stdarg.h>
@@ -91,7 +92,7 @@ enum opcode {
91 insn_addu, insn_addiu, insn_and, insn_andi, insn_beq, 92 insn_addu, insn_addiu, insn_and, insn_andi, insn_beq,
92 insn_beql, insn_bgez, insn_bgezl, insn_bltz, insn_bltzl, 93 insn_beql, insn_bgez, insn_bgezl, insn_bltz, insn_bltzl,
93 insn_bne, insn_daddu, insn_daddiu, insn_dmfc0, insn_dmtc0, 94 insn_bne, insn_daddu, insn_daddiu, insn_dmfc0, insn_dmtc0,
94 insn_dsll, insn_dsll32, insn_dsra, insn_dsrl, insn_dsrl32, 95 insn_dsll, insn_dsll32, insn_dsra, insn_dsrl,
95 insn_dsubu, insn_eret, insn_j, insn_jal, insn_jr, insn_ld, 96 insn_dsubu, insn_eret, insn_j, insn_jal, insn_jr, insn_ld,
96 insn_ll, insn_lld, insn_lui, insn_lw, insn_mfc0, insn_mtc0, 97 insn_ll, insn_lld, insn_lui, insn_lw, insn_mfc0, insn_mtc0,
97 insn_ori, insn_rfe, insn_sc, insn_scd, insn_sd, insn_sll, 98 insn_ori, insn_rfe, insn_sc, insn_scd, insn_sd, insn_sll,
@@ -134,7 +135,6 @@ static __initdata struct insn insn_table[] = {
134 { insn_dsll32, M(spec_op,0,0,0,0,dsll32_op), RT | RD | RE }, 135 { insn_dsll32, M(spec_op,0,0,0,0,dsll32_op), RT | RD | RE },
135 { insn_dsra, M(spec_op,0,0,0,0,dsra_op), RT | RD | RE }, 136 { insn_dsra, M(spec_op,0,0,0,0,dsra_op), RT | RD | RE },
136 { insn_dsrl, M(spec_op,0,0,0,0,dsrl_op), RT | RD | RE }, 137 { insn_dsrl, M(spec_op,0,0,0,0,dsrl_op), RT | RD | RE },
137 { insn_dsrl32, M(spec_op,0,0,0,0,dsrl32_op), RT | RD | RE },
138 { insn_dsubu, M(spec_op,0,0,0,0,dsubu_op), RS | RT | RD }, 138 { insn_dsubu, M(spec_op,0,0,0,0,dsubu_op), RS | RT | RD },
139 { insn_eret, M(cop0_op,cop_op,0,0,0,eret_op), 0 }, 139 { insn_eret, M(cop0_op,cop_op,0,0,0,eret_op), 0 },
140 { insn_j, M(j_op,0,0,0,0,0), JIMM }, 140 { insn_j, M(j_op,0,0,0,0,0), JIMM },
@@ -366,7 +366,6 @@ I_u2u1u3(_dsll);
366I_u2u1u3(_dsll32); 366I_u2u1u3(_dsll32);
367I_u2u1u3(_dsra); 367I_u2u1u3(_dsra);
368I_u2u1u3(_dsrl); 368I_u2u1u3(_dsrl);
369I_u2u1u3(_dsrl32);
370I_u3u1u2(_dsubu); 369I_u3u1u2(_dsubu);
371I_0(_eret); 370I_0(_eret);
372I_u1(_j); 371I_u1(_j);
@@ -412,7 +411,6 @@ enum label_id {
412 label_nopage_tlbm, 411 label_nopage_tlbm,
413 label_smp_pgtable_change, 412 label_smp_pgtable_change,
414 label_r3000_write_probe_fail, 413 label_r3000_write_probe_fail,
415 label_r3000_write_probe_ok
416}; 414};
417 415
418struct label { 416struct label {
@@ -445,7 +443,6 @@ L_LA(_nopage_tlbs)
445L_LA(_nopage_tlbm) 443L_LA(_nopage_tlbm)
446L_LA(_smp_pgtable_change) 444L_LA(_smp_pgtable_change)
447L_LA(_r3000_write_probe_fail) 445L_LA(_r3000_write_probe_fail)
448L_LA(_r3000_write_probe_ok)
449 446
450/* convenience macros for instructions */ 447/* convenience macros for instructions */
451#ifdef CONFIG_64BIT 448#ifdef CONFIG_64BIT
@@ -490,7 +487,7 @@ L_LA(_r3000_write_probe_ok)
490static __init int __attribute__((unused)) in_compat_space_p(long addr) 487static __init int __attribute__((unused)) in_compat_space_p(long addr)
491{ 488{
492 /* Is this address in 32bit compat space? */ 489 /* Is this address in 32bit compat space? */
493 return (((addr) & 0xffffffff00000000) == 0xffffffff00000000); 490 return (((addr) & 0xffffffff00000000L) == 0xffffffff00000000L);
494} 491}
495 492
496static __init int __attribute__((unused)) rel_highest(long val) 493static __init int __attribute__((unused)) rel_highest(long val)
@@ -734,7 +731,7 @@ static void __init build_r3000_tlb_refill_handler(void)
734 if (p > tlb_handler + 32) 731 if (p > tlb_handler + 32)
735 panic("TLB refill handler space exceeded"); 732 panic("TLB refill handler space exceeded");
736 733
737 printk("Synthesized TLB handler (%u instructions).\n", 734 printk("Synthesized TLB refill handler (%u instructions).\n",
738 (unsigned int)(p - tlb_handler)); 735 (unsigned int)(p - tlb_handler));
739#ifdef DEBUG_TLB 736#ifdef DEBUG_TLB
740 { 737 {
@@ -746,7 +743,6 @@ static void __init build_r3000_tlb_refill_handler(void)
746#endif 743#endif
747 744
748 memcpy((void *)CAC_BASE, tlb_handler, 0x80); 745 memcpy((void *)CAC_BASE, tlb_handler, 0x80);
749 flush_icache_range(CAC_BASE, CAC_BASE + 0x80);
750} 746}
751 747
752/* 748/*
@@ -783,6 +779,8 @@ static __initdata u32 final_handler[64];
783static __init void __attribute__((unused)) build_tlb_probe_entry(u32 **p) 779static __init void __attribute__((unused)) build_tlb_probe_entry(u32 **p)
784{ 780{
785 switch (current_cpu_data.cputype) { 781 switch (current_cpu_data.cputype) {
782 /* Found by experiment: R4600 v2.0 needs this, too. */
783 case CPU_R4600:
786 case CPU_R5000: 784 case CPU_R5000:
787 case CPU_R5000A: 785 case CPU_R5000A:
788 case CPU_NEVADA: 786 case CPU_NEVADA:
@@ -834,12 +832,20 @@ static __init void build_tlb_write_entry(u32 **p, struct label **l,
834 case CPU_R4700: 832 case CPU_R4700:
835 case CPU_R5000: 833 case CPU_R5000:
836 case CPU_R5000A: 834 case CPU_R5000A:
835 i_nop(p);
836 tlbw(p);
837 i_nop(p);
838 break;
839
840 case CPU_R4300:
837 case CPU_5KC: 841 case CPU_5KC:
838 case CPU_TX49XX: 842 case CPU_TX49XX:
839 case CPU_AU1000: 843 case CPU_AU1000:
840 case CPU_AU1100: 844 case CPU_AU1100:
841 case CPU_AU1500: 845 case CPU_AU1500:
842 case CPU_AU1550: 846 case CPU_AU1550:
847 case CPU_AU1200:
848 case CPU_PR4450:
843 i_nop(p); 849 i_nop(p);
844 tlbw(p); 850 tlbw(p);
845 break; 851 break;
@@ -848,6 +854,7 @@ static __init void build_tlb_write_entry(u32 **p, struct label **l,
848 case CPU_R12000: 854 case CPU_R12000:
849 case CPU_4KC: 855 case CPU_4KC:
850 case CPU_SB1: 856 case CPU_SB1:
857 case CPU_SB1A:
851 case CPU_4KSC: 858 case CPU_4KSC:
852 case CPU_20KC: 859 case CPU_20KC:
853 case CPU_25KF: 860 case CPU_25KF:
@@ -875,6 +882,7 @@ static __init void build_tlb_write_entry(u32 **p, struct label **l,
875 882
876 case CPU_4KEC: 883 case CPU_4KEC:
877 case CPU_24K: 884 case CPU_24K:
885 case CPU_34K:
878 i_ehb(p); 886 i_ehb(p);
879 tlbw(p); 887 tlbw(p);
880 break; 888 break;
@@ -911,6 +919,7 @@ static __init void build_tlb_write_entry(u32 **p, struct label **l,
911 919
912 case CPU_VR4131: 920 case CPU_VR4131:
913 case CPU_VR4133: 921 case CPU_VR4133:
922 case CPU_R5432:
914 i_nop(p); 923 i_nop(p);
915 i_nop(p); 924 i_nop(p);
916 tlbw(p); 925 tlbw(p);
@@ -942,34 +951,29 @@ build_get_pmde64(u32 **p, struct label **l, struct reloc **r,
942 /* No i_nop needed here, since the next insn doesn't touch TMP. */ 951 /* No i_nop needed here, since the next insn doesn't touch TMP. */
943 952
944#ifdef CONFIG_SMP 953#ifdef CONFIG_SMP
954# ifdef CONFIG_BUILD_ELF64
945 /* 955 /*
946 * 64 bit SMP has the lower part of &pgd_current[smp_processor_id()] 956 * 64 bit SMP running in XKPHYS has smp_processor_id() << 3
947 * stored in CONTEXT. 957 * stored in CONTEXT.
948 */ 958 */
949 if (in_compat_space_p(pgdc)) { 959 i_dmfc0(p, ptr, C0_CONTEXT);
950 i_dmfc0(p, ptr, C0_CONTEXT); 960 i_dsrl(p, ptr, ptr, 23);
951 i_dsra(p, ptr, ptr, 23); 961 i_LA_mostly(p, tmp, pgdc);
952 i_ld(p, ptr, 0, ptr); 962 i_daddu(p, ptr, ptr, tmp);
953 } else { 963 i_dmfc0(p, tmp, C0_BADVADDR);
954#ifdef CONFIG_BUILD_ELF64 964 i_ld(p, ptr, rel_lo(pgdc), ptr);
955 i_dmfc0(p, ptr, C0_CONTEXT); 965# else
956 i_dsrl(p, ptr, ptr, 23); 966 /*
957 i_dsll(p, ptr, ptr, 3); 967 * 64 bit SMP running in compat space has the lower part of
958 i_LA_mostly(p, tmp, pgdc); 968 * &pgd_current[smp_processor_id()] stored in CONTEXT.
959 i_daddu(p, ptr, ptr, tmp); 969 */
960 i_dmfc0(p, tmp, C0_BADVADDR); 970 if (!in_compat_space_p(pgdc))
961 i_ld(p, ptr, rel_lo(pgdc), ptr); 971 panic("Invalid page directory address!");
962#else 972
963 i_dmfc0(p, ptr, C0_CONTEXT); 973 i_dmfc0(p, ptr, C0_CONTEXT);
964 i_lui(p, tmp, rel_highest(pgdc)); 974 i_dsra(p, ptr, ptr, 23);
965 i_dsll(p, ptr, ptr, 9); 975 i_ld(p, ptr, 0, ptr);
966 i_daddiu(p, tmp, tmp, rel_higher(pgdc)); 976# endif
967 i_dsrl32(p, ptr, ptr, 0);
968 i_and(p, ptr, ptr, tmp);
969 i_dmfc0(p, tmp, C0_BADVADDR);
970 i_ld(p, ptr, 0, ptr);
971#endif
972 }
973#else 977#else
974 i_LA_mostly(p, ptr, pgdc); 978 i_LA_mostly(p, ptr, pgdc);
975 i_ld(p, ptr, rel_lo(pgdc), ptr); 979 i_ld(p, ptr, rel_lo(pgdc), ptr);
@@ -1026,7 +1030,6 @@ build_get_pgde32(u32 **p, unsigned int tmp, unsigned int ptr)
1026 i_mfc0(p, ptr, C0_CONTEXT); 1030 i_mfc0(p, ptr, C0_CONTEXT);
1027 i_LA_mostly(p, tmp, pgdc); 1031 i_LA_mostly(p, tmp, pgdc);
1028 i_srl(p, ptr, ptr, 23); 1032 i_srl(p, ptr, ptr, 23);
1029 i_sll(p, ptr, ptr, 2);
1030 i_addu(p, ptr, tmp, ptr); 1033 i_addu(p, ptr, tmp, ptr);
1031#else 1034#else
1032 i_LA_mostly(p, ptr, pgdc); 1035 i_LA_mostly(p, ptr, pgdc);
@@ -1245,13 +1248,19 @@ static void __init build_r4000_tlb_refill_handler(void)
1245 { 1248 {
1246 int i; 1249 int i;
1247 1250
1248 for (i = 0; i < 64; i++) 1251 f = final_handler;
1249 printk("%08x\n", final_handler[i]); 1252#ifdef CONFIG_64BIT
1253 if (final_len > 32)
1254 final_len = 64;
1255 else
1256 f = final_handler + 32;
1257#endif /* CONFIG_64BIT */
1258 for (i = 0; i < final_len; i++)
1259 printk("%08x\n", f[i]);
1250 } 1260 }
1251#endif 1261#endif
1252 1262
1253 memcpy((void *)CAC_BASE, final_handler, 0x100); 1263 memcpy((void *)CAC_BASE, final_handler, 0x100);
1254 flush_icache_range(CAC_BASE, CAC_BASE + 0x100);
1255} 1264}
1256 1265
1257/* 1266/*
@@ -1277,37 +1286,41 @@ u32 __tlb_handler_align handle_tlbs[FASTPATH_SIZE];
1277u32 __tlb_handler_align handle_tlbm[FASTPATH_SIZE]; 1286u32 __tlb_handler_align handle_tlbm[FASTPATH_SIZE];
1278 1287
1279static void __init 1288static void __init
1280iPTE_LW(u32 **p, struct label **l, unsigned int pte, int offset, 1289iPTE_LW(u32 **p, struct label **l, unsigned int pte, unsigned int ptr)
1281 unsigned int ptr)
1282{ 1290{
1283#ifdef CONFIG_SMP 1291#ifdef CONFIG_SMP
1284# ifdef CONFIG_64BIT_PHYS_ADDR 1292# ifdef CONFIG_64BIT_PHYS_ADDR
1285 if (cpu_has_64bits) 1293 if (cpu_has_64bits)
1286 i_lld(p, pte, offset, ptr); 1294 i_lld(p, pte, 0, ptr);
1287 else 1295 else
1288# endif 1296# endif
1289 i_LL(p, pte, offset, ptr); 1297 i_LL(p, pte, 0, ptr);
1290#else 1298#else
1291# ifdef CONFIG_64BIT_PHYS_ADDR 1299# ifdef CONFIG_64BIT_PHYS_ADDR
1292 if (cpu_has_64bits) 1300 if (cpu_has_64bits)
1293 i_ld(p, pte, offset, ptr); 1301 i_ld(p, pte, 0, ptr);
1294 else 1302 else
1295# endif 1303# endif
1296 i_LW(p, pte, offset, ptr); 1304 i_LW(p, pte, 0, ptr);
1297#endif 1305#endif
1298} 1306}
1299 1307
1300static void __init 1308static void __init
1301iPTE_SW(u32 **p, struct reloc **r, unsigned int pte, int offset, 1309iPTE_SW(u32 **p, struct reloc **r, unsigned int pte, unsigned int ptr,
1302 unsigned int ptr) 1310 unsigned int mode)
1303{ 1311{
1312#ifdef CONFIG_64BIT_PHYS_ADDR
1313 unsigned int hwmode = mode & (_PAGE_VALID | _PAGE_DIRTY);
1314#endif
1315
1316 i_ori(p, pte, pte, mode);
1304#ifdef CONFIG_SMP 1317#ifdef CONFIG_SMP
1305# ifdef CONFIG_64BIT_PHYS_ADDR 1318# ifdef CONFIG_64BIT_PHYS_ADDR
1306 if (cpu_has_64bits) 1319 if (cpu_has_64bits)
1307 i_scd(p, pte, offset, ptr); 1320 i_scd(p, pte, 0, ptr);
1308 else 1321 else
1309# endif 1322# endif
1310 i_SC(p, pte, offset, ptr); 1323 i_SC(p, pte, 0, ptr);
1311 1324
1312 if (r10000_llsc_war()) 1325 if (r10000_llsc_war())
1313 il_beqzl(p, r, pte, label_smp_pgtable_change); 1326 il_beqzl(p, r, pte, label_smp_pgtable_change);
@@ -1318,7 +1331,7 @@ iPTE_SW(u32 **p, struct reloc **r, unsigned int pte, int offset,
1318 if (!cpu_has_64bits) { 1331 if (!cpu_has_64bits) {
1319 /* no i_nop needed */ 1332 /* no i_nop needed */
1320 i_ll(p, pte, sizeof(pte_t) / 2, ptr); 1333 i_ll(p, pte, sizeof(pte_t) / 2, ptr);
1321 i_ori(p, pte, pte, _PAGE_VALID); 1334 i_ori(p, pte, pte, hwmode);
1322 i_sc(p, pte, sizeof(pte_t) / 2, ptr); 1335 i_sc(p, pte, sizeof(pte_t) / 2, ptr);
1323 il_beqz(p, r, pte, label_smp_pgtable_change); 1336 il_beqz(p, r, pte, label_smp_pgtable_change);
1324 /* no i_nop needed */ 1337 /* no i_nop needed */
@@ -1331,15 +1344,15 @@ iPTE_SW(u32 **p, struct reloc **r, unsigned int pte, int offset,
1331#else 1344#else
1332# ifdef CONFIG_64BIT_PHYS_ADDR 1345# ifdef CONFIG_64BIT_PHYS_ADDR
1333 if (cpu_has_64bits) 1346 if (cpu_has_64bits)
1334 i_sd(p, pte, offset, ptr); 1347 i_sd(p, pte, 0, ptr);
1335 else 1348 else
1336# endif 1349# endif
1337 i_SW(p, pte, offset, ptr); 1350 i_SW(p, pte, 0, ptr);
1338 1351
1339# ifdef CONFIG_64BIT_PHYS_ADDR 1352# ifdef CONFIG_64BIT_PHYS_ADDR
1340 if (!cpu_has_64bits) { 1353 if (!cpu_has_64bits) {
1341 i_lw(p, pte, sizeof(pte_t) / 2, ptr); 1354 i_lw(p, pte, sizeof(pte_t) / 2, ptr);
1342 i_ori(p, pte, pte, _PAGE_VALID); 1355 i_ori(p, pte, pte, hwmode);
1343 i_sw(p, pte, sizeof(pte_t) / 2, ptr); 1356 i_sw(p, pte, sizeof(pte_t) / 2, ptr);
1344 i_lw(p, pte, 0, ptr); 1357 i_lw(p, pte, 0, ptr);
1345 } 1358 }
@@ -1359,7 +1372,7 @@ build_pte_present(u32 **p, struct label **l, struct reloc **r,
1359 i_andi(p, pte, pte, _PAGE_PRESENT | _PAGE_READ); 1372 i_andi(p, pte, pte, _PAGE_PRESENT | _PAGE_READ);
1360 i_xori(p, pte, pte, _PAGE_PRESENT | _PAGE_READ); 1373 i_xori(p, pte, pte, _PAGE_PRESENT | _PAGE_READ);
1361 il_bnez(p, r, pte, lid); 1374 il_bnez(p, r, pte, lid);
1362 iPTE_LW(p, l, pte, 0, ptr); 1375 iPTE_LW(p, l, pte, ptr);
1363} 1376}
1364 1377
1365/* Make PTE valid, store result in PTR. */ 1378/* Make PTE valid, store result in PTR. */
@@ -1367,8 +1380,9 @@ static void __init
1367build_make_valid(u32 **p, struct reloc **r, unsigned int pte, 1380build_make_valid(u32 **p, struct reloc **r, unsigned int pte,
1368 unsigned int ptr) 1381 unsigned int ptr)
1369{ 1382{
1370 i_ori(p, pte, pte, _PAGE_VALID | _PAGE_ACCESSED); 1383 unsigned int mode = _PAGE_VALID | _PAGE_ACCESSED;
1371 iPTE_SW(p, r, pte, 0, ptr); 1384
1385 iPTE_SW(p, r, pte, ptr, mode);
1372} 1386}
1373 1387
1374/* 1388/*
@@ -1382,7 +1396,7 @@ build_pte_writable(u32 **p, struct label **l, struct reloc **r,
1382 i_andi(p, pte, pte, _PAGE_PRESENT | _PAGE_WRITE); 1396 i_andi(p, pte, pte, _PAGE_PRESENT | _PAGE_WRITE);
1383 i_xori(p, pte, pte, _PAGE_PRESENT | _PAGE_WRITE); 1397 i_xori(p, pte, pte, _PAGE_PRESENT | _PAGE_WRITE);
1384 il_bnez(p, r, pte, lid); 1398 il_bnez(p, r, pte, lid);
1385 iPTE_LW(p, l, pte, 0, ptr); 1399 iPTE_LW(p, l, pte, ptr);
1386} 1400}
1387 1401
1388/* Make PTE writable, update software status bits as well, then store 1402/* Make PTE writable, update software status bits as well, then store
@@ -1392,9 +1406,10 @@ static void __init
1392build_make_write(u32 **p, struct reloc **r, unsigned int pte, 1406build_make_write(u32 **p, struct reloc **r, unsigned int pte,
1393 unsigned int ptr) 1407 unsigned int ptr)
1394{ 1408{
1395 i_ori(p, pte, pte, 1409 unsigned int mode = (_PAGE_ACCESSED | _PAGE_MODIFIED | _PAGE_VALID
1396 _PAGE_ACCESSED | _PAGE_MODIFIED | _PAGE_VALID | _PAGE_DIRTY); 1410 | _PAGE_DIRTY);
1397 iPTE_SW(p, r, pte, 0, ptr); 1411
1412 iPTE_SW(p, r, pte, ptr, mode);
1398} 1413}
1399 1414
1400/* 1415/*
@@ -1407,41 +1422,48 @@ build_pte_modifiable(u32 **p, struct label **l, struct reloc **r,
1407{ 1422{
1408 i_andi(p, pte, pte, _PAGE_WRITE); 1423 i_andi(p, pte, pte, _PAGE_WRITE);
1409 il_beqz(p, r, pte, lid); 1424 il_beqz(p, r, pte, lid);
1410 iPTE_LW(p, l, pte, 0, ptr); 1425 iPTE_LW(p, l, pte, ptr);
1411} 1426}
1412 1427
1413/* 1428/*
1414 * R3000 style TLB load/store/modify handlers. 1429 * R3000 style TLB load/store/modify handlers.
1415 */ 1430 */
1416 1431
1417/* This places the pte in the page table at PTR into ENTRYLO0. */ 1432/*
1433 * This places the pte into ENTRYLO0 and writes it with tlbwi.
1434 * Then it returns.
1435 */
1418static void __init 1436static void __init
1419build_r3000_pte_reload(u32 **p, unsigned int ptr) 1437build_r3000_pte_reload_tlbwi(u32 **p, unsigned int pte, unsigned int tmp)
1420{ 1438{
1421 i_lw(p, ptr, 0, ptr); 1439 i_mtc0(p, pte, C0_ENTRYLO0); /* cp0 delay */
1422 i_nop(p); /* load delay */ 1440 i_mfc0(p, tmp, C0_EPC); /* cp0 delay */
1423 i_mtc0(p, ptr, C0_ENTRYLO0); 1441 i_tlbwi(p);
1424 i_nop(p); /* cp0 delay */ 1442 i_jr(p, tmp);
1443 i_rfe(p); /* branch delay */
1425} 1444}
1426 1445
1427/* 1446/*
1428 * The index register may have the probe fail bit set, 1447 * This places the pte into ENTRYLO0 and writes it with tlbwi
1429 * because we would trap on access kseg2, i.e. without refill. 1448 * or tlbwr as appropriate. This is because the index register
1449 * may have the probe fail bit set as a result of a trap on a
1450 * kseg2 access, i.e. without refill. Then it returns.
1430 */ 1451 */
1431static void __init 1452static void __init
1432build_r3000_tlb_write(u32 **p, struct label **l, struct reloc **r, 1453build_r3000_tlb_reload_write(u32 **p, struct label **l, struct reloc **r,
1433 unsigned int tmp) 1454 unsigned int pte, unsigned int tmp)
1434{ 1455{
1435 i_mfc0(p, tmp, C0_INDEX); 1456 i_mfc0(p, tmp, C0_INDEX);
1436 i_nop(p); /* cp0 delay */ 1457 i_mtc0(p, pte, C0_ENTRYLO0); /* cp0 delay */
1437 il_bltz(p, r, tmp, label_r3000_write_probe_fail); 1458 il_bltz(p, r, tmp, label_r3000_write_probe_fail); /* cp0 delay */
1438 i_nop(p); /* branch delay */ 1459 i_mfc0(p, tmp, C0_EPC); /* branch delay */
1439 i_tlbwi(p); 1460 i_tlbwi(p); /* cp0 delay */
1440 il_b(p, r, label_r3000_write_probe_ok); 1461 i_jr(p, tmp);
1441 i_nop(p); /* branch delay */ 1462 i_rfe(p); /* branch delay */
1442 l_r3000_write_probe_fail(l, *p); 1463 l_r3000_write_probe_fail(l, *p);
1443 i_tlbwr(p); 1464 i_tlbwr(p); /* cp0 delay */
1444 l_r3000_write_probe_ok(l, *p); 1465 i_jr(p, tmp);
1466 i_rfe(p); /* branch delay */
1445} 1467}
1446 1468
1447static void __init 1469static void __init
@@ -1461,17 +1483,7 @@ build_r3000_tlbchange_handler_head(u32 **p, unsigned int pte,
1461 i_andi(p, pte, pte, 0xffc); /* load delay */ 1483 i_andi(p, pte, pte, 0xffc); /* load delay */
1462 i_addu(p, ptr, ptr, pte); 1484 i_addu(p, ptr, ptr, pte);
1463 i_lw(p, pte, 0, ptr); 1485 i_lw(p, pte, 0, ptr);
1464 i_nop(p); /* load delay */ 1486 i_tlbp(p); /* load delay */
1465 i_tlbp(p);
1466}
1467
1468static void __init
1469build_r3000_tlbchange_handler_tail(u32 **p, unsigned int tmp)
1470{
1471 i_mfc0(p, tmp, C0_EPC);
1472 i_nop(p); /* cp0 delay */
1473 i_jr(p, tmp);
1474 i_rfe(p); /* branch delay */
1475} 1487}
1476 1488
1477static void __init build_r3000_tlb_load_handler(void) 1489static void __init build_r3000_tlb_load_handler(void)
@@ -1486,10 +1498,9 @@ static void __init build_r3000_tlb_load_handler(void)
1486 1498
1487 build_r3000_tlbchange_handler_head(&p, K0, K1); 1499 build_r3000_tlbchange_handler_head(&p, K0, K1);
1488 build_pte_present(&p, &l, &r, K0, K1, label_nopage_tlbl); 1500 build_pte_present(&p, &l, &r, K0, K1, label_nopage_tlbl);
1501 i_nop(&p); /* load delay */
1489 build_make_valid(&p, &r, K0, K1); 1502 build_make_valid(&p, &r, K0, K1);
1490 build_r3000_pte_reload(&p, K1); 1503 build_r3000_tlb_reload_write(&p, &l, &r, K0, K1);
1491 build_r3000_tlb_write(&p, &l, &r, K0);
1492 build_r3000_tlbchange_handler_tail(&p, K0);
1493 1504
1494 l_nopage_tlbl(&l, p); 1505 l_nopage_tlbl(&l, p);
1495 i_j(&p, (unsigned long)tlb_do_page_fault_0 & 0x0fffffff); 1506 i_j(&p, (unsigned long)tlb_do_page_fault_0 & 0x0fffffff);
@@ -1506,13 +1517,10 @@ static void __init build_r3000_tlb_load_handler(void)
1506 { 1517 {
1507 int i; 1518 int i;
1508 1519
1509 for (i = 0; i < FASTPATH_SIZE; i++) 1520 for (i = 0; i < (p - handle_tlbl); i++)
1510 printk("%08x\n", handle_tlbl[i]); 1521 printk("%08x\n", handle_tlbl[i]);
1511 } 1522 }
1512#endif 1523#endif
1513
1514 flush_icache_range((unsigned long)handle_tlbl,
1515 (unsigned long)handle_tlbl + FASTPATH_SIZE * sizeof(u32));
1516} 1524}
1517 1525
1518static void __init build_r3000_tlb_store_handler(void) 1526static void __init build_r3000_tlb_store_handler(void)
@@ -1527,10 +1535,9 @@ static void __init build_r3000_tlb_store_handler(void)
1527 1535
1528 build_r3000_tlbchange_handler_head(&p, K0, K1); 1536 build_r3000_tlbchange_handler_head(&p, K0, K1);
1529 build_pte_writable(&p, &l, &r, K0, K1, label_nopage_tlbs); 1537 build_pte_writable(&p, &l, &r, K0, K1, label_nopage_tlbs);
1538 i_nop(&p); /* load delay */
1530 build_make_write(&p, &r, K0, K1); 1539 build_make_write(&p, &r, K0, K1);
1531 build_r3000_pte_reload(&p, K1); 1540 build_r3000_tlb_reload_write(&p, &l, &r, K0, K1);
1532 build_r3000_tlb_write(&p, &l, &r, K0);
1533 build_r3000_tlbchange_handler_tail(&p, K0);
1534 1541
1535 l_nopage_tlbs(&l, p); 1542 l_nopage_tlbs(&l, p);
1536 i_j(&p, (unsigned long)tlb_do_page_fault_1 & 0x0fffffff); 1543 i_j(&p, (unsigned long)tlb_do_page_fault_1 & 0x0fffffff);
@@ -1547,13 +1554,10 @@ static void __init build_r3000_tlb_store_handler(void)
1547 { 1554 {
1548 int i; 1555 int i;
1549 1556
1550 for (i = 0; i < FASTPATH_SIZE; i++) 1557 for (i = 0; i < (p - handle_tlbs); i++)
1551 printk("%08x\n", handle_tlbs[i]); 1558 printk("%08x\n", handle_tlbs[i]);
1552 } 1559 }
1553#endif 1560#endif
1554
1555 flush_icache_range((unsigned long)handle_tlbs,
1556 (unsigned long)handle_tlbs + FASTPATH_SIZE * sizeof(u32));
1557} 1561}
1558 1562
1559static void __init build_r3000_tlb_modify_handler(void) 1563static void __init build_r3000_tlb_modify_handler(void)
@@ -1568,10 +1572,9 @@ static void __init build_r3000_tlb_modify_handler(void)
1568 1572
1569 build_r3000_tlbchange_handler_head(&p, K0, K1); 1573 build_r3000_tlbchange_handler_head(&p, K0, K1);
1570 build_pte_modifiable(&p, &l, &r, K0, K1, label_nopage_tlbm); 1574 build_pte_modifiable(&p, &l, &r, K0, K1, label_nopage_tlbm);
1575 i_nop(&p); /* load delay */
1571 build_make_write(&p, &r, K0, K1); 1576 build_make_write(&p, &r, K0, K1);
1572 build_r3000_pte_reload(&p, K1); 1577 build_r3000_pte_reload_tlbwi(&p, K0, K1);
1573 i_tlbwi(&p);
1574 build_r3000_tlbchange_handler_tail(&p, K0);
1575 1578
1576 l_nopage_tlbm(&l, p); 1579 l_nopage_tlbm(&l, p);
1577 i_j(&p, (unsigned long)tlb_do_page_fault_1 & 0x0fffffff); 1580 i_j(&p, (unsigned long)tlb_do_page_fault_1 & 0x0fffffff);
@@ -1588,13 +1591,10 @@ static void __init build_r3000_tlb_modify_handler(void)
1588 { 1591 {
1589 int i; 1592 int i;
1590 1593
1591 for (i = 0; i < FASTPATH_SIZE; i++) 1594 for (i = 0; i < (p - handle_tlbm); i++)
1592 printk("%08x\n", handle_tlbm[i]); 1595 printk("%08x\n", handle_tlbm[i]);
1593 } 1596 }
1594#endif 1597#endif
1595
1596 flush_icache_range((unsigned long)handle_tlbm,
1597 (unsigned long)handle_tlbm + FASTPATH_SIZE * sizeof(u32));
1598} 1598}
1599 1599
1600/* 1600/*
@@ -1620,7 +1620,7 @@ build_r4000_tlbchange_handler_head(u32 **p, struct label **l,
1620#ifdef CONFIG_SMP 1620#ifdef CONFIG_SMP
1621 l_smp_pgtable_change(l, *p); 1621 l_smp_pgtable_change(l, *p);
1622# endif 1622# endif
1623 iPTE_LW(p, l, pte, 0, ptr); /* get even pte */ 1623 iPTE_LW(p, l, pte, ptr); /* get even pte */
1624 build_tlb_probe_entry(p); 1624 build_tlb_probe_entry(p);
1625} 1625}
1626 1626
@@ -1680,13 +1680,10 @@ static void __init build_r4000_tlb_load_handler(void)
1680 { 1680 {
1681 int i; 1681 int i;
1682 1682
1683 for (i = 0; i < FASTPATH_SIZE; i++) 1683 for (i = 0; i < (p - handle_tlbl); i++)
1684 printk("%08x\n", handle_tlbl[i]); 1684 printk("%08x\n", handle_tlbl[i]);
1685 } 1685 }
1686#endif 1686#endif
1687
1688 flush_icache_range((unsigned long)handle_tlbl,
1689 (unsigned long)handle_tlbl + FASTPATH_SIZE * sizeof(u32));
1690} 1687}
1691 1688
1692static void __init build_r4000_tlb_store_handler(void) 1689static void __init build_r4000_tlb_store_handler(void)
@@ -1719,13 +1716,10 @@ static void __init build_r4000_tlb_store_handler(void)
1719 { 1716 {
1720 int i; 1717 int i;
1721 1718
1722 for (i = 0; i < FASTPATH_SIZE; i++) 1719 for (i = 0; i < (p - handle_tlbs); i++)
1723 printk("%08x\n", handle_tlbs[i]); 1720 printk("%08x\n", handle_tlbs[i]);
1724 } 1721 }
1725#endif 1722#endif
1726
1727 flush_icache_range((unsigned long)handle_tlbs,
1728 (unsigned long)handle_tlbs + FASTPATH_SIZE * sizeof(u32));
1729} 1723}
1730 1724
1731static void __init build_r4000_tlb_modify_handler(void) 1725static void __init build_r4000_tlb_modify_handler(void)
@@ -1759,13 +1753,10 @@ static void __init build_r4000_tlb_modify_handler(void)
1759 { 1753 {
1760 int i; 1754 int i;
1761 1755
1762 for (i = 0; i < FASTPATH_SIZE; i++) 1756 for (i = 0; i < (p - handle_tlbm); i++)
1763 printk("%08x\n", handle_tlbm[i]); 1757 printk("%08x\n", handle_tlbm[i]);
1764 } 1758 }
1765#endif 1759#endif
1766
1767 flush_icache_range((unsigned long)handle_tlbm,
1768 (unsigned long)handle_tlbm + FASTPATH_SIZE * sizeof(u32));
1769} 1760}
1770 1761
1771void __init build_tlb_refill_handler(void) 1762void __init build_tlb_refill_handler(void)
@@ -1813,3 +1804,13 @@ void __init build_tlb_refill_handler(void)
1813 } 1804 }
1814 } 1805 }
1815} 1806}
1807
1808void __init flush_tlb_handlers(void)
1809{
1810 flush_icache_range((unsigned long)handle_tlbl,
1811 (unsigned long)handle_tlbl + sizeof(handle_tlbl));
1812 flush_icache_range((unsigned long)handle_tlbs,
1813 (unsigned long)handle_tlbs + sizeof(handle_tlbs));
1814 flush_icache_range((unsigned long)handle_tlbm,
1815 (unsigned long)handle_tlbm + sizeof(handle_tlbm));
1816}
diff --git a/arch/mips/momentum/Kconfig b/arch/mips/momentum/Kconfig
new file mode 100644
index 000000000000..70a61cf7174d
--- /dev/null
+++ b/arch/mips/momentum/Kconfig
@@ -0,0 +1,6 @@
1config JAGUAR_DMALOW
2 bool "Low DMA Mode"
3 depends on MOMENCO_JAGUAR_ATX
4 help
5 Select to Y if jump JP5 is set on your board, N otherwise. Normally
6 the jumper is set, so if you feel unsafe, just say Y.
diff --git a/arch/mips/momentum/jaguar_atx/prom.c b/arch/mips/momentum/jaguar_atx/prom.c
index 14ae2e713585..aae7a802767a 100644
--- a/arch/mips/momentum/jaguar_atx/prom.c
+++ b/arch/mips/momentum/jaguar_atx/prom.c
@@ -236,8 +236,9 @@ void __init prom_init(void)
236#endif 236#endif
237} 237}
238 238
239void __init prom_free_prom_memory(void) 239unsigned long __init prom_free_prom_memory(void)
240{ 240{
241 return 0;
241} 242}
242 243
243void __init prom_fixup_mem_map(unsigned long start, unsigned long end) 244void __init prom_fixup_mem_map(unsigned long start, unsigned long end)
diff --git a/arch/mips/momentum/jaguar_atx/setup.c b/arch/mips/momentum/jaguar_atx/setup.c
index 90288cf2b1e0..768bf4406452 100644
--- a/arch/mips/momentum/jaguar_atx/setup.c
+++ b/arch/mips/momentum/jaguar_atx/setup.c
@@ -351,7 +351,7 @@ static __init int __init ja_pci_init(void)
351 351
352arch_initcall(ja_pci_init); 352arch_initcall(ja_pci_init);
353 353
354static int __init momenco_jaguar_atx_setup(void) 354void __init plat_setup(void)
355{ 355{
356 unsigned int tmpword; 356 unsigned int tmpword;
357 357
@@ -467,8 +467,4 @@ static int __init momenco_jaguar_atx_setup(void)
467 467
468 } 468 }
469#endif 469#endif
470
471 return 0;
472} 470}
473
474early_initcall(momenco_jaguar_atx_setup);
diff --git a/arch/mips/momentum/ocelot_3/prom.c b/arch/mips/momentum/ocelot_3/prom.c
index c4fa9c525faa..9803daa2a792 100644
--- a/arch/mips/momentum/ocelot_3/prom.c
+++ b/arch/mips/momentum/ocelot_3/prom.c
@@ -239,8 +239,9 @@ void __init prom_init(void)
239#endif 239#endif
240} 240}
241 241
242void __init prom_free_prom_memory(void) 242unsigned long __init prom_free_prom_memory(void)
243{ 243{
244 return 0;
244} 245}
245 246
246void __init prom_fixup_mem_map(unsigned long start, unsigned long end) 247void __init prom_fixup_mem_map(unsigned long start, unsigned long end)
diff --git a/arch/mips/momentum/ocelot_3/setup.c b/arch/mips/momentum/ocelot_3/setup.c
index ce2efcbab7aa..a7803e08f9db 100644
--- a/arch/mips/momentum/ocelot_3/setup.c
+++ b/arch/mips/momentum/ocelot_3/setup.c
@@ -307,7 +307,7 @@ static __init int __init ja_pci_init(void)
307 307
308arch_initcall(ja_pci_init); 308arch_initcall(ja_pci_init);
309 309
310static int __init momenco_ocelot_3_setup(void) 310void __init plat_setup(void)
311{ 311{
312 unsigned int tmpword; 312 unsigned int tmpword;
313 313
@@ -391,8 +391,4 @@ static int __init momenco_ocelot_3_setup(void)
391 391
392 /* Support for 128 MB memory */ 392 /* Support for 128 MB memory */
393 add_memory_region(0x0, 0x08000000, BOOT_MEM_RAM); 393 add_memory_region(0x0, 0x08000000, BOOT_MEM_RAM);
394
395 return 0;
396} 394}
397
398early_initcall(momenco_ocelot_3_setup);
diff --git a/arch/mips/momentum/ocelot_c/cpci-irq.c b/arch/mips/momentum/ocelot_c/cpci-irq.c
index dea48b3ad687..bd885785e2f9 100644
--- a/arch/mips/momentum/ocelot_c/cpci-irq.c
+++ b/arch/mips/momentum/ocelot_c/cpci-irq.c
@@ -129,14 +129,13 @@ void ll_cpci_irq(struct pt_regs *regs)
129#define shutdown_cpci_irq disable_cpci_irq 129#define shutdown_cpci_irq disable_cpci_irq
130 130
131struct hw_interrupt_type cpci_irq_type = { 131struct hw_interrupt_type cpci_irq_type = {
132 "CPCI/FPGA", 132 .typename = "CPCI/FPGA",
133 startup_cpci_irq, 133 .startup = startup_cpci_irq,
134 shutdown_cpci_irq, 134 .shutdown = shutdown_cpci_irq,
135 enable_cpci_irq, 135 .enable = enable_cpci_irq,
136 disable_cpci_irq, 136 .disable = disable_cpci_irq,
137 mask_and_ack_cpci_irq, 137 .ack = mask_and_ack_cpci_irq,
138 end_cpci_irq, 138 .end = end_cpci_irq,
139 NULL
140}; 139};
141 140
142void cpci_irq_init(void) 141void cpci_irq_init(void)
diff --git a/arch/mips/momentum/ocelot_c/setup.c b/arch/mips/momentum/ocelot_c/setup.c
index 844ddd06349b..ce70fc96f160 100644
--- a/arch/mips/momentum/ocelot_c/setup.c
+++ b/arch/mips/momentum/ocelot_c/setup.c
@@ -222,7 +222,7 @@ void momenco_time_init(void)
222 rtc_set_time = m48t37y_set_time; 222 rtc_set_time = m48t37y_set_time;
223} 223}
224 224
225static void __init momenco_ocelot_c_setup(void) 225void __init plat_setup(void)
226{ 226{
227 unsigned int tmpword; 227 unsigned int tmpword;
228 228
@@ -340,8 +340,6 @@ static void __init momenco_ocelot_c_setup(void)
340 } 340 }
341} 341}
342 342
343early_initcall(momenco_ocelot_c_setup);
344
345#ifndef CONFIG_64BIT 343#ifndef CONFIG_64BIT
346/* This needs to be one of the first initcalls, because no I/O port access 344/* This needs to be one of the first initcalls, because no I/O port access
347 can work before this */ 345 can work before this */
diff --git a/arch/mips/momentum/ocelot_c/uart-irq.c b/arch/mips/momentum/ocelot_c/uart-irq.c
index ebe1507b17df..755bde5146be 100644
--- a/arch/mips/momentum/ocelot_c/uart-irq.c
+++ b/arch/mips/momentum/ocelot_c/uart-irq.c
@@ -122,14 +122,13 @@ void ll_uart_irq(struct pt_regs *regs)
122#define shutdown_uart_irq disable_uart_irq 122#define shutdown_uart_irq disable_uart_irq
123 123
124struct hw_interrupt_type uart_irq_type = { 124struct hw_interrupt_type uart_irq_type = {
125 "UART/FPGA", 125 .typename = "UART/FPGA",
126 startup_uart_irq, 126 .startup = startup_uart_irq,
127 shutdown_uart_irq, 127 .shutdown = shutdown_uart_irq,
128 enable_uart_irq, 128 .enable = enable_uart_irq,
129 disable_uart_irq, 129 .disable = disable_uart_irq,
130 mask_and_ack_uart_irq, 130 .ack = mask_and_ack_uart_irq,
131 end_uart_irq, 131 .end = end_uart_irq,
132 NULL
133}; 132};
134 133
135void uart_irq_init(void) 134void uart_irq_init(void)
diff --git a/arch/mips/momentum/ocelot_g/setup.c b/arch/mips/momentum/ocelot_g/setup.c
index 38a78ab8c830..6336751391c3 100644
--- a/arch/mips/momentum/ocelot_g/setup.c
+++ b/arch/mips/momentum/ocelot_g/setup.c
@@ -160,7 +160,7 @@ static void __init setup_l3cache(unsigned long size)
160 printk("Done\n"); 160 printk("Done\n");
161} 161}
162 162
163static int __init momenco_ocelot_g_setup(void) 163void __init plat_setup(void)
164{ 164{
165 void (*l3func)(unsigned long) = (void *) KSEG1ADDR(setup_l3cache); 165 void (*l3func)(unsigned long) = (void *) KSEG1ADDR(setup_l3cache);
166 unsigned int tmpword; 166 unsigned int tmpword;
@@ -240,12 +240,8 @@ static int __init momenco_ocelot_g_setup(void)
240 240
241 /* FIXME: Fix up the DiskOnChip mapping */ 241 /* FIXME: Fix up the DiskOnChip mapping */
242 MV_WRITE(0x468, 0xfef73); 242 MV_WRITE(0x468, 0xfef73);
243
244 return 0;
245} 243}
246 244
247early_initcall(momenco_ocelot_g_setup);
248
249/* This needs to be one of the first initcalls, because no I/O port access 245/* This needs to be one of the first initcalls, because no I/O port access
250 can work before this */ 246 can work before this */
251 247
diff --git a/arch/mips/oprofile/Kconfig b/arch/mips/oprofile/Kconfig
index 19d37730b664..55feaf798596 100644
--- a/arch/mips/oprofile/Kconfig
+++ b/arch/mips/oprofile/Kconfig
@@ -11,7 +11,7 @@ config PROFILING
11 11
12config OPROFILE 12config OPROFILE
13 tristate "OProfile system profiling (EXPERIMENTAL)" 13 tristate "OProfile system profiling (EXPERIMENTAL)"
14 depends on PROFILING 14 depends on PROFILING && EXPERIMENTAL
15 help 15 help
16 OProfile is a profiling system capable of profiling the 16 OProfile is a profiling system capable of profiling the
17 whole system, include the kernel, kernel modules, libraries, 17 whole system, include the kernel, kernel modules, libraries,
diff --git a/arch/mips/oprofile/common.c b/arch/mips/oprofile/common.c
index ab65ce3d471a..dd2cc42f1b6d 100644
--- a/arch/mips/oprofile/common.c
+++ b/arch/mips/oprofile/common.c
@@ -3,7 +3,8 @@
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) 2004 by Ralf Baechle 6 * Copyright (C) 2004, 2005 Ralf Baechle
7 * Copyright (C) 2005 MIPS Technologies, Inc.
7 */ 8 */
8#include <linux/errno.h> 9#include <linux/errno.h>
9#include <linux/init.h> 10#include <linux/init.h>
@@ -45,10 +46,10 @@ static int op_mips_create_files(struct super_block * sb, struct dentry * root)
45 oprofilefs_create_ulong(sb, dir, "enabled", &ctr[i].enabled); 46 oprofilefs_create_ulong(sb, dir, "enabled", &ctr[i].enabled);
46 oprofilefs_create_ulong(sb, dir, "event", &ctr[i].event); 47 oprofilefs_create_ulong(sb, dir, "event", &ctr[i].event);
47 oprofilefs_create_ulong(sb, dir, "count", &ctr[i].count); 48 oprofilefs_create_ulong(sb, dir, "count", &ctr[i].count);
48 /* Dummies. */
49 oprofilefs_create_ulong(sb, dir, "kernel", &ctr[i].kernel); 49 oprofilefs_create_ulong(sb, dir, "kernel", &ctr[i].kernel);
50 oprofilefs_create_ulong(sb, dir, "user", &ctr[i].user); 50 oprofilefs_create_ulong(sb, dir, "user", &ctr[i].user);
51 oprofilefs_create_ulong(sb, dir, "exl", &ctr[i].exl); 51 oprofilefs_create_ulong(sb, dir, "exl", &ctr[i].exl);
52 /* Dummy. */
52 oprofilefs_create_ulong(sb, dir, "unit_mask", &ctr[i].unit_mask); 53 oprofilefs_create_ulong(sb, dir, "unit_mask", &ctr[i].unit_mask);
53 } 54 }
54 55
@@ -68,9 +69,10 @@ static void op_mips_stop(void)
68 on_each_cpu(model->cpu_stop, NULL, 0, 1); 69 on_each_cpu(model->cpu_stop, NULL, 0, 1);
69} 70}
70 71
71void __init oprofile_arch_init(struct oprofile_operations *ops) 72int __init oprofile_arch_init(struct oprofile_operations *ops)
72{ 73{
73 struct op_mips_model *lmodel = NULL; 74 struct op_mips_model *lmodel = NULL;
75 int res;
74 76
75 switch (current_cpu_data.cputype) { 77 switch (current_cpu_data.cputype) {
76 case CPU_24K: 78 case CPU_24K:
@@ -83,21 +85,25 @@ void __init oprofile_arch_init(struct oprofile_operations *ops)
83 }; 85 };
84 86
85 if (!lmodel) 87 if (!lmodel)
86 return; 88 return -ENODEV;
87 89
88 if (lmodel->init()) 90 res = lmodel->init();
89 return; 91 if (res)
92 return res;
90 93
91 model = lmodel; 94 model = lmodel;
92 95
93 ops->create_files = op_mips_create_files; 96 ops->create_files = op_mips_create_files;
94 ops->setup = op_mips_setup; 97 ops->setup = op_mips_setup;
95 ops->start = op_mips_start; 98 //ops->shutdown = op_mips_shutdown;
96 ops->stop = op_mips_stop; 99 ops->start = op_mips_start;
97 ops->cpu_type = lmodel->cpu_type; 100 ops->stop = op_mips_stop;
101 ops->cpu_type = lmodel->cpu_type;
98 102
99 printk(KERN_INFO "oprofile: using %s performance monitoring.\n", 103 printk(KERN_INFO "oprofile: using %s performance monitoring.\n",
100 lmodel->cpu_type); 104 lmodel->cpu_type);
105
106 return 0;
101} 107}
102 108
103void oprofile_arch_exit(void) 109void oprofile_arch_exit(void)
diff --git a/arch/mips/oprofile/op_impl.h b/arch/mips/oprofile/op_impl.h
index 9f5cdff041be..f0121557047d 100644
--- a/arch/mips/oprofile/op_impl.h
+++ b/arch/mips/oprofile/op_impl.h
@@ -10,6 +10,11 @@
10#ifndef OP_IMPL_H 10#ifndef OP_IMPL_H
11#define OP_IMPL_H 1 11#define OP_IMPL_H 1
12 12
13struct pt_regs;
14
15extern void null_perf_irq(struct pt_regs *regs);
16extern void (*perf_irq)(struct pt_regs *regs);
17
13/* Per-counter configuration as set via oprofilefs. */ 18/* Per-counter configuration as set via oprofilefs. */
14struct op_counter_config { 19struct op_counter_config {
15 unsigned long enabled; 20 unsigned long enabled;
diff --git a/arch/mips/oprofile/op_model_mipsxx.c b/arch/mips/oprofile/op_model_mipsxx.c
new file mode 100644
index 000000000000..d36b64dfcb2f
--- /dev/null
+++ b/arch/mips/oprofile/op_model_mipsxx.c
@@ -0,0 +1,215 @@
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) 2004, 2005 by Ralf Baechle
7 * Copyright (C) 2005 by MIPS Technologies, Inc.
8 */
9#include <linux/oprofile.h>
10#include <linux/interrupt.h>
11#include <linux/smp.h>
12
13#include "op_impl.h"
14
15#define M_PERFCTL_EXL (1UL << 0)
16#define M_PERFCTL_KERNEL (1UL << 1)
17#define M_PERFCTL_SUPERVISOR (1UL << 2)
18#define M_PERFCTL_USER (1UL << 3)
19#define M_PERFCTL_INTERRUPT_ENABLE (1UL << 4)
20#define M_PERFCTL_EVENT(event) ((event) << 5)
21#define M_PERFCTL_WIDE (1UL << 30)
22#define M_PERFCTL_MORE (1UL << 31)
23
24#define M_COUNTER_OVERFLOW (1UL << 31)
25
26struct op_mips_model op_model_mipsxx;
27
28static struct mipsxx_register_config {
29 unsigned int control[4];
30 unsigned int counter[4];
31} reg;
32
33/* Compute all of the registers in preparation for enabling profiling. */
34
35static void mipsxx_reg_setup(struct op_counter_config *ctr)
36{
37 unsigned int counters = op_model_mipsxx.num_counters;
38 int i;
39
40 /* Compute the performance counter control word. */
41 /* For now count kernel and user mode */
42 for (i = 0; i < counters; i++) {
43 reg.control[i] = 0;
44 reg.counter[i] = 0;
45
46 if (!ctr[i].enabled)
47 continue;
48
49 reg.control[i] = M_PERFCTL_EVENT(ctr[i].event) |
50 M_PERFCTL_INTERRUPT_ENABLE;
51 if (ctr[i].kernel)
52 reg.control[i] |= M_PERFCTL_KERNEL;
53 if (ctr[i].user)
54 reg.control[i] |= M_PERFCTL_USER;
55 if (ctr[i].exl)
56 reg.control[i] |= M_PERFCTL_EXL;
57 reg.counter[i] = 0x80000000 - ctr[i].count;
58 }
59}
60
61/* Program all of the registers in preparation for enabling profiling. */
62
63static void mipsxx_cpu_setup (void *args)
64{
65 unsigned int counters = op_model_mipsxx.num_counters;
66
67 switch (counters) {
68 case 4:
69 write_c0_perfctrl3(0);
70 write_c0_perfcntr3(reg.counter[3]);
71 case 3:
72 write_c0_perfctrl2(0);
73 write_c0_perfcntr2(reg.counter[2]);
74 case 2:
75 write_c0_perfctrl1(0);
76 write_c0_perfcntr1(reg.counter[1]);
77 case 1:
78 write_c0_perfctrl0(0);
79 write_c0_perfcntr0(reg.counter[0]);
80 }
81}
82
83/* Start all counters on current CPU */
84static void mipsxx_cpu_start(void *args)
85{
86 unsigned int counters = op_model_mipsxx.num_counters;
87
88 switch (counters) {
89 case 4:
90 write_c0_perfctrl3(reg.control[3]);
91 case 3:
92 write_c0_perfctrl2(reg.control[2]);
93 case 2:
94 write_c0_perfctrl1(reg.control[1]);
95 case 1:
96 write_c0_perfctrl0(reg.control[0]);
97 }
98}
99
100/* Stop all counters on current CPU */
101static void mipsxx_cpu_stop(void *args)
102{
103 unsigned int counters = op_model_mipsxx.num_counters;
104
105 switch (counters) {
106 case 4:
107 write_c0_perfctrl3(0);
108 case 3:
109 write_c0_perfctrl2(0);
110 case 2:
111 write_c0_perfctrl1(0);
112 case 1:
113 write_c0_perfctrl0(0);
114 }
115}
116
117static void mipsxx_perfcount_handler(struct pt_regs *regs)
118{
119 unsigned int counters = op_model_mipsxx.num_counters;
120 unsigned int control;
121 unsigned int counter;
122
123 switch (counters) {
124#define HANDLE_COUNTER(n) \
125 case n + 1: \
126 control = read_c0_perfctrl ## n(); \
127 counter = read_c0_perfcntr ## n(); \
128 if ((control & M_PERFCTL_INTERRUPT_ENABLE) && \
129 (counter & M_COUNTER_OVERFLOW)) { \
130 oprofile_add_sample(regs, n); \
131 write_c0_perfcntr ## n(reg.counter[n]); \
132 }
133 HANDLE_COUNTER(3)
134 HANDLE_COUNTER(2)
135 HANDLE_COUNTER(1)
136 HANDLE_COUNTER(0)
137 }
138}
139
140#define M_CONFIG1_PC (1 << 4)
141
142static inline int n_counters(void)
143{
144 if (!(read_c0_config1() & M_CONFIG1_PC))
145 return 0;
146 if (!(read_c0_perfctrl0() & M_PERFCTL_MORE))
147 return 1;
148 if (!(read_c0_perfctrl1() & M_PERFCTL_MORE))
149 return 2;
150 if (!(read_c0_perfctrl2() & M_PERFCTL_MORE))
151 return 3;
152
153 return 4;
154}
155
156static inline void reset_counters(int counters)
157{
158 switch (counters) {
159 case 4:
160 write_c0_perfctrl3(0);
161 write_c0_perfcntr3(0);
162 case 3:
163 write_c0_perfctrl2(0);
164 write_c0_perfcntr2(0);
165 case 2:
166 write_c0_perfctrl1(0);
167 write_c0_perfcntr1(0);
168 case 1:
169 write_c0_perfctrl0(0);
170 write_c0_perfcntr0(0);
171 }
172}
173
174static int __init mipsxx_init(void)
175{
176 int counters;
177
178 counters = n_counters();
179 if (counters == 0)
180 return -ENODEV;
181
182 reset_counters(counters);
183
184 op_model_mipsxx.num_counters = counters;
185 switch (current_cpu_data.cputype) {
186 case CPU_24K:
187 op_model_mipsxx.cpu_type = "mips/24K";
188 break;
189
190 default:
191 printk(KERN_ERR "Profiling unsupported for this CPU\n");
192
193 return -ENODEV;
194 }
195
196 perf_irq = mipsxx_perfcount_handler;
197
198 return 0;
199}
200
201static void mipsxx_exit(void)
202{
203 reset_counters(op_model_mipsxx.num_counters);
204
205 perf_irq = null_perf_irq;
206}
207
208struct op_mips_model op_model_mipsxx = {
209 .reg_setup = mipsxx_reg_setup,
210 .cpu_setup = mipsxx_cpu_setup,
211 .init = mipsxx_init,
212 .exit = mipsxx_exit,
213 .cpu_start = mipsxx_cpu_start,
214 .cpu_stop = mipsxx_cpu_stop,
215};
diff --git a/arch/mips/oprofile/op_model_rm9000.c b/arch/mips/oprofile/op_model_rm9000.c
index bee47793cb1a..9b75e41c78ef 100644
--- a/arch/mips/oprofile/op_model_rm9000.c
+++ b/arch/mips/oprofile/op_model_rm9000.c
@@ -5,6 +5,7 @@
5 * 5 *
6 * Copyright (C) 2004 by Ralf Baechle 6 * Copyright (C) 2004 by Ralf Baechle
7 */ 7 */
8#include <linux/init.h>
8#include <linux/oprofile.h> 9#include <linux/oprofile.h>
9#include <linux/interrupt.h> 10#include <linux/interrupt.h>
10#include <linux/smp.h> 11#include <linux/smp.h>
@@ -114,7 +115,7 @@ static irqreturn_t rm9000_perfcount_handler(int irq, void * dev_id,
114 return IRQ_HANDLED; 115 return IRQ_HANDLED;
115} 116}
116 117
117static int rm9000_init(void) 118static int __init rm9000_init(void)
118{ 119{
119 return request_irq(rm9000_perfcount_irq, rm9000_perfcount_handler, 120 return request_irq(rm9000_perfcount_irq, rm9000_perfcount_handler,
120 0, "Perfcounter", NULL); 121 0, "Perfcounter", NULL);
diff --git a/arch/mips/pci/Makefile b/arch/mips/pci/Makefile
index 83d81c9cdc2b..7b7468304022 100644
--- a/arch/mips/pci/Makefile
+++ b/arch/mips/pci/Makefile
@@ -34,6 +34,7 @@ obj-$(CONFIG_MIPS_ITE8172) += fixup-ite8172g.o
34obj-$(CONFIG_MIPS_IVR) += fixup-ivr.o 34obj-$(CONFIG_MIPS_IVR) += fixup-ivr.o
35obj-$(CONFIG_SOC_AU1500) += fixup-au1000.o ops-au1000.o 35obj-$(CONFIG_SOC_AU1500) += fixup-au1000.o ops-au1000.o
36obj-$(CONFIG_SOC_AU1550) += fixup-au1000.o ops-au1000.o 36obj-$(CONFIG_SOC_AU1550) += fixup-au1000.o ops-au1000.o
37obj-$(CONFIG_SOC_PNX8550) += fixup-pnx8550.o ops-pnx8550.o
37obj-$(CONFIG_MIPS_MALTA) += fixup-malta.o 38obj-$(CONFIG_MIPS_MALTA) += fixup-malta.o
38obj-$(CONFIG_MOMENCO_JAGUAR_ATX)+= fixup-jaguar.o 39obj-$(CONFIG_MOMENCO_JAGUAR_ATX)+= fixup-jaguar.o
39obj-$(CONFIG_MOMENCO_OCELOT) += fixup-ocelot.o pci-ocelot.o 40obj-$(CONFIG_MOMENCO_OCELOT) += fixup-ocelot.o pci-ocelot.o
@@ -45,11 +46,13 @@ obj-$(CONFIG_PMC_YOSEMITE) += fixup-yosemite.o ops-titan.o ops-titan-ht.o \
45obj-$(CONFIG_SGI_IP27) += pci-ip27.o 46obj-$(CONFIG_SGI_IP27) += pci-ip27.o
46obj-$(CONFIG_SGI_IP32) += fixup-ip32.o ops-mace.o pci-ip32.o 47obj-$(CONFIG_SGI_IP32) += fixup-ip32.o ops-mace.o pci-ip32.o
47obj-$(CONFIG_SIBYTE_SB1250) += fixup-sb1250.o pci-sb1250.o 48obj-$(CONFIG_SIBYTE_SB1250) += fixup-sb1250.o pci-sb1250.o
49obj-$(CONFIG_SIBYTE_BCM1x80) += pci-bcm1480.o pci-bcm1480ht.o
48obj-$(CONFIG_SNI_RM200_PCI) += fixup-sni.o ops-sni.o 50obj-$(CONFIG_SNI_RM200_PCI) += fixup-sni.o ops-sni.o
49obj-$(CONFIG_TANBAC_TB0219) += fixup-tb0219.o 51obj-$(CONFIG_TANBAC_TB0219) += fixup-tb0219.o
50obj-$(CONFIG_TANBAC_TB0226) += fixup-tb0226.o 52obj-$(CONFIG_TANBAC_TB0226) += fixup-tb0226.o
51obj-$(CONFIG_TANBAC_TB0287) += fixup-tb0287.o 53obj-$(CONFIG_TANBAC_TB0287) += fixup-tb0287.o
52obj-$(CONFIG_TOSHIBA_JMR3927) += fixup-jmr3927.o pci-jmr3927.o 54obj-$(CONFIG_TOSHIBA_JMR3927) += fixup-jmr3927.o pci-jmr3927.o
53obj-$(CONFIG_TOSHIBA_RBTX4927) += fixup-rbtx4927.o ops-tx4927.o 55obj-$(CONFIG_TOSHIBA_RBTX4927) += fixup-rbtx4927.o ops-tx4927.o
56obj-$(CONFIG_TOSHIBA_RBTX4938) += fixup-tx4938.o ops-tx4938.o
54obj-$(CONFIG_VICTOR_MPC30X) += fixup-mpc30x.o 57obj-$(CONFIG_VICTOR_MPC30X) += fixup-mpc30x.o
55obj-$(CONFIG_ZAO_CAPCELLA) += fixup-capcella.o 58obj-$(CONFIG_ZAO_CAPCELLA) += fixup-capcella.o
diff --git a/arch/mips/pci/fixup-atlas.c b/arch/mips/pci/fixup-atlas.c
index 2406835833d6..87920b245931 100644
--- a/arch/mips/pci/fixup-atlas.c
+++ b/arch/mips/pci/fixup-atlas.c
@@ -1,14 +1,37 @@
1/*
2 * Copyright (C) 2003, 2004 Ralf Baechle (ralf@linux-mips.org)
3 * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved.
4 * Author: Maciej W. Rozycki <macro@mips.com>
5 *
6 * This program is free software; you can distribute it and/or modify it
7 * under the terms of the GNU General Public License (Version 2) as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
18 */
1#include <linux/config.h> 19#include <linux/config.h>
2#include <linux/init.h> 20#include <linux/init.h>
3#include <linux/pci.h> 21#include <linux/pci.h>
22
4#include <asm/mips-boards/atlasint.h> 23#include <asm/mips-boards/atlasint.h>
5 24
6#define INTD ATLASINT_INTD 25#define PCIA ATLASINT_PCIA
7#define INTC ATLASINT_INTC 26#define PCIB ATLASINT_PCIB
8#define INTB ATLASINT_INTB 27#define PCIC ATLASINT_PCIC
28#define PCID ATLASINT_PCID
9#define INTA ATLASINT_INTA 29#define INTA ATLASINT_INTA
10#define SCSI ATLASINT_SCSI 30#define INTB ATLASINT_INTB
11#define ETH ATLASINT_ETH 31#define ETH ATLASINT_ETH
32#define INTC ATLASINT_INTC
33#define SCSI ATLASINT_SCSI
34#define INTD ATLASINT_INTD
12 35
13static char irq_tab[][5] __initdata = { 36static char irq_tab[][5] __initdata = {
14 /* INTA INTB INTC INTD */ 37 /* INTA INTB INTC INTD */
@@ -27,13 +50,13 @@ static char irq_tab[][5] __initdata = {
27 {0, 0, 0, 0, 0 }, /* 12: Unused */ 50 {0, 0, 0, 0, 0 }, /* 12: Unused */
28 {0, 0, 0, 0, 0 }, /* 13: Unused */ 51 {0, 0, 0, 0, 0 }, /* 13: Unused */
29 {0, 0, 0, 0, 0 }, /* 14: Unused */ 52 {0, 0, 0, 0, 0 }, /* 14: Unused */
30 {0, 0, 0, 0, 0 }, /* 15: Unused */ 53 {0, PCIA, PCIB, PCIC, PCID }, /* 15: cPCI (behind 21150) */
31 {0, SCSI, 0, 0, 0 }, /* 16: SYM53C810A SCSI */ 54 {0, SCSI, 0, 0, 0 }, /* 16: SYM53C810A SCSI */
32 {0, 0, 0, 0, 0 }, /* 17: Core */ 55 {0, 0, 0, 0, 0 }, /* 17: Core */
33 {0, INTA, INTB, INTC, INTD }, /* 18: PCI Slot 1 */ 56 {0, INTA, INTB, INTC, INTD }, /* 18: PCI Slot */
34 {0, ETH, 0, 0, 0 }, /* 19: SAA9730 Ethernet */ 57 {0, ETH, 0, 0, 0 }, /* 19: SAA9730 Eth. et al. */
35 {0, 0, 0, 0, 0 }, /* 20: PCI Slot 3 */ 58 {0, 0, 0, 0, 0 }, /* 20: Unused */
36 {0, 0, 0, 0, 0 } /* 21: PCI Slot 4 */ 59 {0, 0, 0, 0, 0 } /* 21: Unused */
37}; 60};
38 61
39int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 62int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
diff --git a/arch/mips/pci/fixup-au1000.c b/arch/mips/pci/fixup-au1000.c
index 39fe2b16fcec..c2f8304fe55b 100644
--- a/arch/mips/pci/fixup-au1000.c
+++ b/arch/mips/pci/fixup-au1000.c
@@ -26,7 +26,6 @@
26 * with this program; if not, write to the Free Software Foundation, Inc., 26 * with this program; if not, write to the Free Software Foundation, Inc.,
27 * 675 Mass Ave, Cambridge, MA 02139, USA. 27 * 675 Mass Ave, Cambridge, MA 02139, USA.
28 */ 28 */
29#include <linux/config.h>
30#include <linux/types.h> 29#include <linux/types.h>
31#include <linux/pci.h> 30#include <linux/pci.h>
32#include <linux/kernel.h> 31#include <linux/kernel.h>
@@ -34,82 +33,7 @@
34 33
35#include <asm/mach-au1x00/au1000.h> 34#include <asm/mach-au1x00/au1000.h>
36 35
37/* 36extern char irq_tab_alchemy[][5];
38 * Shortcut
39 */
40#ifdef CONFIG_SOC_AU1500
41#define INTA AU1000_PCI_INTA
42#define INTB AU1000_PCI_INTB
43#define INTC AU1000_PCI_INTC
44#define INTD AU1000_PCI_INTD
45#endif
46
47#ifdef CONFIG_SOC_AU1550
48#define INTA AU1550_PCI_INTA
49#define INTB AU1550_PCI_INTB
50#define INTC AU1550_PCI_INTC
51#define INTD AU1550_PCI_INTD
52#endif
53
54#define INTX 0xFF /* not valid */
55
56#ifdef CONFIG_MIPS_DB1500
57static char irq_tab_alchemy[][5] __initdata = {
58 [12] = { -1, INTA, INTX, INTX, INTX}, /* IDSEL 12 - HPT371 */
59 [13] = { -1, INTA, INTB, INTC, INTD}, /* IDSEL 13 - PCI slot */
60};
61#endif
62
63#ifdef CONFIG_MIPS_BOSPORUS
64static char irq_tab_alchemy[][5] __initdata = {
65 [11] = { -1, INTA, INTB, INTX, INTX}, /* IDSEL 11 - miniPCI */
66 [12] = { -1, INTA, INTX, INTX, INTX}, /* IDSEL 12 - SN1741 */
67 [13] = { -1, INTA, INTB, INTC, INTD}, /* IDSEL 13 - PCI slot */
68};
69#endif
70
71#ifdef CONFIG_MIPS_MIRAGE
72static char irq_tab_alchemy[][5] __initdata = {
73 [11] = { -1, INTD, INTX, INTX, INTX}, /* IDSEL 11 - SMI VGX */
74 [12] = { -1, INTX, INTX, INTC, INTX}, /* IDSEL 12 - PNX1300 */
75 [13] = { -1, INTA, INTB, INTX, INTX}, /* IDSEL 13 - miniPCI */
76};
77#endif
78
79#ifdef CONFIG_MIPS_DB1550
80static char irq_tab_alchemy[][5] __initdata = {
81 [11] = { -1, INTC, INTX, INTX, INTX}, /* IDSEL 11 - on-board HPT371 */
82 [12] = { -1, INTB, INTC, INTD, INTA}, /* IDSEL 12 - PCI slot 2 (left) */
83 [13] = { -1, INTA, INTB, INTC, INTD}, /* IDSEL 13 - PCI slot 1 (right) */
84};
85#endif
86
87#ifdef CONFIG_MIPS_PB1500
88static char irq_tab_alchemy[][5] __initdata = {
89 [12] = { -1, INTA, INTX, INTX, INTX}, /* IDSEL 12 - HPT370 */
90 [13] = { -1, INTA, INTB, INTC, INTD}, /* IDSEL 13 - PCI slot */
91};
92#endif
93
94#ifdef CONFIG_MIPS_PB1550
95static char irq_tab_alchemy[][5] __initdata = {
96 [12] = { -1, INTB, INTC, INTD, INTA}, /* IDSEL 12 - PCI slot 2 (left) */
97 [13] = { -1, INTA, INTB, INTC, INTD}, /* IDSEL 13 - PCI slot 1 (right) */
98};
99#endif
100
101#ifdef CONFIG_MIPS_MTX1
102static char irq_tab_alchemy[][5] __initdata = {
103 [0] = { -1, INTA, INTB, INTX, INTX}, /* IDSEL 00 - AdapterA-Slot0 (top) */
104 [1] = { -1, INTB, INTA, INTX, INTX}, /* IDSEL 01 - AdapterA-Slot1 (bottom) */
105 [2] = { -1, INTC, INTD, INTX, INTX}, /* IDSEL 02 - AdapterB-Slot0 (top) */
106 [3] = { -1, INTD, INTC, INTX, INTX}, /* IDSEL 03 - AdapterB-Slot1 (bottom) */
107 [4] = { -1, INTA, INTB, INTX, INTX}, /* IDSEL 04 - AdapterC-Slot0 (top) */
108 [5] = { -1, INTB, INTA, INTX, INTX}, /* IDSEL 05 - AdapterC-Slot1 (bottom) */
109 [6] = { -1, INTC, INTD, INTX, INTX}, /* IDSEL 06 - AdapterD-Slot0 (top) */
110 [7] = { -1, INTD, INTC, INTX, INTX}, /* IDSEL 07 - AdapterD-Slot1 (bottom) */
111};
112#endif
113 37
114int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 38int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
115{ 39{
diff --git a/arch/mips/pci/fixup-cobalt.c b/arch/mips/pci/fixup-cobalt.c
index 57e1ca2116bb..909292f50d06 100644
--- a/arch/mips/pci/fixup-cobalt.c
+++ b/arch/mips/pci/fixup-cobalt.c
@@ -21,6 +21,20 @@
21 21
22extern int cobalt_board_id; 22extern int cobalt_board_id;
23 23
24static void qube_raq_galileo_early_fixup(struct pci_dev *dev)
25{
26 if (dev->devfn == PCI_DEVFN(0, 0) &&
27 (dev->class >> 8) == PCI_CLASS_MEMORY_OTHER) {
28
29 dev->class = (PCI_CLASS_BRIDGE_HOST << 8) | (dev->class & 0xff);
30
31 printk(KERN_INFO "Galileo: fixed bridge class\n");
32 }
33}
34
35DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_MARVELL, PCI_DEVICE_ID_MARVELL_GT64111,
36 qube_raq_galileo_early_fixup);
37
24static void qube_raq_via_bmIDE_fixup(struct pci_dev *dev) 38static void qube_raq_via_bmIDE_fixup(struct pci_dev *dev)
25{ 39{
26 unsigned short cfgword; 40 unsigned short cfgword;
@@ -48,6 +62,9 @@ static void qube_raq_galileo_fixup(struct pci_dev *dev)
48{ 62{
49 unsigned short galileo_id; 63 unsigned short galileo_id;
50 64
65 if (dev->devfn != PCI_DEVFN(0, 0))
66 return;
67
51 /* Fix PCI latency-timer and cache-line-size values in Galileo 68 /* Fix PCI latency-timer and cache-line-size values in Galileo
52 * host bridge. 69 * host bridge.
53 */ 70 */
@@ -55,6 +72,13 @@ static void qube_raq_galileo_fixup(struct pci_dev *dev)
55 pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, 7); 72 pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, 7);
56 73
57 /* 74 /*
75 * The code described by the comment below has been removed
76 * as it causes bus mastering by the Ethernet controllers
77 * to break under any kind of network load. We always set
78 * the retry timeouts to their maximum.
79 *
80 * --x--x--x--x--x--x--x--x--x--x--x--x--x--x--x--x--x--x--x--x--
81 *
58 * On all machines prior to Q2, we had the STOP line disconnected 82 * On all machines prior to Q2, we had the STOP line disconnected
59 * from Galileo to VIA on PCI. The new Galileo does not function 83 * from Galileo to VIA on PCI. The new Galileo does not function
60 * correctly unless we have it connected. 84 * correctly unless we have it connected.
@@ -64,21 +88,43 @@ static void qube_raq_galileo_fixup(struct pci_dev *dev)
64 */ 88 */
65 pci_read_config_word(dev, PCI_REVISION_ID, &galileo_id); 89 pci_read_config_word(dev, PCI_REVISION_ID, &galileo_id);
66 galileo_id &= 0xff; /* mask off class info */ 90 galileo_id &= 0xff; /* mask off class info */
91
92 printk(KERN_INFO "Galileo: revision %u\n", galileo_id);
93
94#if 0
67 if (galileo_id >= 0x10) { 95 if (galileo_id >= 0x10) {
68 /* New Galileo, assumes PCI stop line to VIA is connected. */ 96 /* New Galileo, assumes PCI stop line to VIA is connected. */
69 GALILEO_OUTL(0x4020, GT_PCI0_TOR_OFS); 97 GALILEO_OUTL(0x4020, GT_PCI0_TOR_OFS);
70 } else if (galileo_id == 0x1 || galileo_id == 0x2) { 98 } else if (galileo_id == 0x1 || galileo_id == 0x2)
99#endif
100 {
71 signed int timeo; 101 signed int timeo;
72 /* XXX WE MUST DO THIS ELSE GALILEO LOCKS UP! -DaveM */ 102 /* XXX WE MUST DO THIS ELSE GALILEO LOCKS UP! -DaveM */
73 timeo = GALILEO_INL(GT_PCI0_TOR_OFS); 103 timeo = GALILEO_INL(GT_PCI0_TOR_OFS);
74 /* Old Galileo, assumes PCI STOP line to VIA is disconnected. */ 104 /* Old Galileo, assumes PCI STOP line to VIA is disconnected. */
75 GALILEO_OUTL(0xffff, GT_PCI0_TOR_OFS); 105 GALILEO_OUTL(
106 (0xff << 16) | /* retry count */
107 (0xff << 8) | /* timeout 1 */
108 0xff, /* timeout 0 */
109 GT_PCI0_TOR_OFS);
110
111 /* enable PCI retry exceeded interrupt */
112 GALILEO_OUTL(GALILEO_INTR_RETRY_CTR | GALILEO_INL(GT_INTRMASK_OFS), GT_INTRMASK_OFS);
76 } 113 }
77} 114}
78 115
79DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_GALILEO, PCI_ANY_ID, 116DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL, PCI_DEVICE_ID_MARVELL_GT64111,
80 qube_raq_galileo_fixup); 117 qube_raq_galileo_fixup);
81 118
119static char irq_tab_qube1[] __initdata = {
120 [COBALT_PCICONF_CPU] = 0,
121 [COBALT_PCICONF_ETH0] = COBALT_QUBE1_ETH0_IRQ,
122 [COBALT_PCICONF_RAQSCSI] = COBALT_SCSI_IRQ,
123 [COBALT_PCICONF_VIA] = 0,
124 [COBALT_PCICONF_PCISLOT] = COBALT_QUBE_SLOT_IRQ,
125 [COBALT_PCICONF_ETH1] = 0
126};
127
82static char irq_tab_cobalt[] __initdata = { 128static char irq_tab_cobalt[] __initdata = {
83 [COBALT_PCICONF_CPU] = 0, 129 [COBALT_PCICONF_CPU] = 0,
84 [COBALT_PCICONF_ETH0] = COBALT_ETH0_IRQ, 130 [COBALT_PCICONF_ETH0] = COBALT_ETH0_IRQ,
@@ -99,6 +145,9 @@ static char irq_tab_raq2[] __initdata = {
99 145
100int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 146int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
101{ 147{
148 if (cobalt_board_id < COBALT_BRD_ID_QUBE2)
149 return irq_tab_qube1[slot];
150
102 if (cobalt_board_id == COBALT_BRD_ID_RAQ2) 151 if (cobalt_board_id == COBALT_BRD_ID_RAQ2)
103 return irq_tab_raq2[slot]; 152 return irq_tab_raq2[slot];
104 153
diff --git a/arch/mips/pci/fixup-pnx8550.c b/arch/mips/pci/fixup-pnx8550.c
new file mode 100644
index 000000000000..4256b3b30b77
--- /dev/null
+++ b/arch/mips/pci/fixup-pnx8550.c
@@ -0,0 +1,57 @@
1/*
2 * Philips PNX8550 pci fixups.
3 *
4 * Copyright 2005 Embedded Alley Solutions, Inc
5 * source@embeddealley.com
6 *
7 * This program is free software; you can distribute it and/or modify it
8 * under the terms of the GNU General Public License (Version 2) as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
19 */
20#include <linux/types.h>
21#include <linux/pci.h>
22#include <linux/kernel.h>
23#include <linux/init.h>
24
25#include <asm/mach-pnx8550/pci.h>
26#include <asm/mach-pnx8550/int.h>
27
28
29#undef DEBUG
30#ifdef DEBUG
31#define DBG(x...) printk(x)
32#else
33#define DBG(x...)
34#endif
35
36extern char irq_tab_jbs[][5];
37
38void __init pcibios_fixup_resources(struct pci_dev *dev)
39{
40 /* no need to fixup IO resources */
41}
42
43void __init pcibios_fixup(void)
44{
45 /* nothing to do here */
46}
47
48int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
49{
50 return irq_tab_jbs[slot][pin];
51}
52
53/* Do platform specific device initialization at pci_enable_device() time */
54int pcibios_plat_dev_init(struct pci_dev *dev)
55{
56 return 0;
57}
diff --git a/arch/mips/pci/fixup-tx4938.c b/arch/mips/pci/fixup-tx4938.c
new file mode 100644
index 000000000000..f455520ada88
--- /dev/null
+++ b/arch/mips/pci/fixup-tx4938.c
@@ -0,0 +1,92 @@
1/*
2 * Toshiba rbtx4938 pci routines
3 * Copyright (C) 2000-2001 Toshiba Corporation
4 *
5 * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
6 * terms of the GNU General Public License version 2. This program is
7 * licensed "as is" without any warranty of any kind, whether express
8 * or implied.
9 *
10 * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
11 */
12#include <linux/types.h>
13#include <linux/pci.h>
14#include <linux/kernel.h>
15#include <linux/init.h>
16
17#include <asm/tx4938/rbtx4938.h>
18
19extern struct pci_controller tx4938_pci_controller[];
20
21int pci_get_irq(struct pci_dev *dev, int pin)
22{
23 int irq = pin;
24 u8 slot = PCI_SLOT(dev->devfn);
25 struct pci_controller *controller = (struct pci_controller *)dev->sysdata;
26
27 if (controller == &tx4938_pci_controller[1]) {
28 /* TX4938 PCIC1 */
29 switch (slot) {
30 case TX4938_PCIC_IDSEL_AD_TO_SLOT(31):
31 if (tx4938_ccfgptr->pcfg & TX4938_PCFG_ETH0_SEL)
32 return RBTX4938_IRQ_IRC + TX4938_IR_ETH0;
33 break;
34 case TX4938_PCIC_IDSEL_AD_TO_SLOT(30):
35 if (tx4938_ccfgptr->pcfg & TX4938_PCFG_ETH1_SEL)
36 return RBTX4938_IRQ_IRC + TX4938_IR_ETH1;
37 break;
38 }
39 return 0;
40 }
41
42 /* IRQ rotation */
43 irq--; /* 0-3 */
44 if (dev->bus->parent == NULL &&
45 (slot == TX4938_PCIC_IDSEL_AD_TO_SLOT(23))) {
46 /* PCI CardSlot (IDSEL=A23) */
47 /* PCIA => PCIA (IDSEL=A23) */
48 irq = (irq + 0 + slot) % 4;
49 } else {
50 /* PCI Backplane */
51 irq = (irq + 33 - slot) % 4;
52 }
53 irq++; /* 1-4 */
54
55 switch (irq) {
56 case 1:
57 irq = RBTX4938_IRQ_IOC_PCIA;
58 break;
59 case 2:
60 irq = RBTX4938_IRQ_IOC_PCIB;
61 break;
62 case 3:
63 irq = RBTX4938_IRQ_IOC_PCIC;
64 break;
65 case 4:
66 irq = RBTX4938_IRQ_IOC_PCID;
67 break;
68 }
69 return irq;
70}
71
72int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
73{
74 unsigned char irq = 0;
75
76 irq = pci_get_irq(dev, pin);
77
78 printk(KERN_INFO "PCI: 0x%02x:0x%02x(0x%02x,0x%02x) IRQ=%d\n",
79 dev->bus->number, dev->devfn, PCI_SLOT(dev->devfn),
80 PCI_FUNC(dev->devfn), irq);
81
82 return irq;
83}
84
85/*
86 * Do platform specific device initialization at pci_enable_device() time
87 */
88int pcibios_plat_dev_init(struct pci_dev *dev)
89{
90 return 0;
91}
92
diff --git a/arch/mips/pci/ops-au1000.c b/arch/mips/pci/ops-au1000.c
index c1c91ca0f9c2..be1420126c42 100644
--- a/arch/mips/pci/ops-au1000.c
+++ b/arch/mips/pci/ops-au1000.c
@@ -50,11 +50,6 @@
50 50
51int (*board_pci_idsel)(unsigned int devsel, int assert); 51int (*board_pci_idsel)(unsigned int devsel, int assert);
52 52
53/* CP0 hazard avoidance. */
54#define BARRIER __asm__ __volatile__(".set noreorder\n\t" \
55 "nop; nop; nop; nop;\t" \
56 ".set reorder\n\t")
57
58void mod_wired_entry(int entry, unsigned long entrylo0, 53void mod_wired_entry(int entry, unsigned long entrylo0,
59 unsigned long entrylo1, unsigned long entryhi, 54 unsigned long entrylo1, unsigned long entryhi,
60 unsigned long pagemask) 55 unsigned long pagemask)
@@ -66,16 +61,12 @@ void mod_wired_entry(int entry, unsigned long entrylo0,
66 old_ctx = read_c0_entryhi() & 0xff; 61 old_ctx = read_c0_entryhi() & 0xff;
67 old_pagemask = read_c0_pagemask(); 62 old_pagemask = read_c0_pagemask();
68 write_c0_index(entry); 63 write_c0_index(entry);
69 BARRIER;
70 write_c0_pagemask(pagemask); 64 write_c0_pagemask(pagemask);
71 write_c0_entryhi(entryhi); 65 write_c0_entryhi(entryhi);
72 write_c0_entrylo0(entrylo0); 66 write_c0_entrylo0(entrylo0);
73 write_c0_entrylo1(entrylo1); 67 write_c0_entrylo1(entrylo1);
74 BARRIER;
75 tlb_write_indexed(); 68 tlb_write_indexed();
76 BARRIER;
77 write_c0_entryhi(old_ctx); 69 write_c0_entryhi(old_ctx);
78 BARRIER;
79 write_c0_pagemask(old_pagemask); 70 write_c0_pagemask(old_pagemask);
80} 71}
81 72
@@ -128,9 +119,8 @@ static int config_access(unsigned char access_type, struct pci_bus *bus,
128 last_entryLo0 = last_entryLo1 = 0xffffffff; 119 last_entryLo0 = last_entryLo1 = 0xffffffff;
129 } 120 }
130 121
131 /* Since the Au1xxx doesn't do the idsel timing exactly to spec, 122 /* Allow board vendors to implement their own off-chip idsel.
132 * many board vendors implement their own off-chip idsel, so call 123 * If it doesn't succeed, may as well bail out at this point.
133 * it now. If it doesn't succeed, may as well bail out at this point.
134 */ 124 */
135 if (board_pci_idsel) { 125 if (board_pci_idsel) {
136 if (board_pci_idsel(device, 1) == 0) { 126 if (board_pci_idsel(device, 1) == 0) {
diff --git a/arch/mips/pci/ops-bonito64.c b/arch/mips/pci/ops-bonito64.c
index 4b4e086a7eb1..dc35270b65a2 100644
--- a/arch/mips/pci/ops-bonito64.c
+++ b/arch/mips/pci/ops-bonito64.c
@@ -1,6 +1,8 @@
1/* 1/*
2 * Carsten Langgaard, carstenl@mips.com 2 * Copyright (C) 1999, 2000, 2004 MIPS Technologies, Inc.
3 * Copyright (C) 1999, 2000 MIPS Technologies, Inc. All rights reserved. 3 * All rights reserved.
4 * Authors: Carsten Langgaard <carstenl@mips.com>
5 * Maciej W. Rozycki <macro@mips.com>
4 * 6 *
5 * This program is free software; you can distribute it and/or modify it 7 * 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 8 * under the terms of the GNU General Public License (Version 2) as
@@ -17,7 +19,6 @@
17 * 19 *
18 * MIPS boards specific PCI support. 20 * MIPS boards specific PCI support.
19 */ 21 */
20#include <linux/config.h>
21#include <linux/types.h> 22#include <linux/types.h>
22#include <linux/pci.h> 23#include <linux/pci.h>
23#include <linux/kernel.h> 24#include <linux/kernel.h>
@@ -57,13 +58,6 @@ static int bonito64_pcibios_config_access(unsigned char access_type,
57 return -1; 58 return -1;
58 } 59 }
59 60
60#ifdef CONFIG_MIPS_BOARDS_GEN
61 if ((busnum == 0) && (PCI_SLOT(devfn) == 17)) {
62 /* MIPS Core boards have Bonito connected as device 17 */
63 return -1;
64 }
65#endif
66
67 /* Clear cause register bits */ 61 /* Clear cause register bits */
68 BONITO_PCICMD |= (BONITO_PCICMD_MABORT_CLR | 62 BONITO_PCICMD |= (BONITO_PCICMD_MABORT_CLR |
69 BONITO_PCICMD_MTABORT_CLR); 63 BONITO_PCICMD_MTABORT_CLR);
diff --git a/arch/mips/pci/ops-gt64111.c b/arch/mips/pci/ops-gt64111.c
index c5b0fc184c2a..c1807934768d 100644
--- a/arch/mips/pci/ops-gt64111.c
+++ b/arch/mips/pci/ops-gt64111.c
@@ -18,15 +18,15 @@
18#include <asm/cobalt/cobalt.h> 18#include <asm/cobalt/cobalt.h>
19 19
20/* 20/*
21 * Accessing device 31 hangs the GT64120. Not sure if this will also hang 21 * Device 31 on the GT64111 is used to generate PCI special
22 * the GT64111, let's be paranoid for now. 22 * cycles, so we shouldn't expected to find a device there ...
23 */ 23 */
24static inline int pci_range_ck(struct pci_bus *bus, unsigned int devfn) 24static inline int pci_range_ck(struct pci_bus *bus, unsigned int devfn)
25{ 25{
26 if (bus->number == 0 && devfn == PCI_DEVFN(31, 0)) 26 if (bus->number == 0 && PCI_SLOT(devfn) < 31)
27 return -1; 27 return 0;
28 28
29 return 0; 29 return -1;
30} 30}
31 31
32static int gt64111_pci_read_config(struct pci_bus *bus, unsigned int devfn, 32static int gt64111_pci_read_config(struct pci_bus *bus, unsigned int devfn,
diff --git a/arch/mips/pci/ops-gt64120.c b/arch/mips/pci/ops-gt64120.c
index 7b99dfa33dfc..6335844d607a 100644
--- a/arch/mips/pci/ops-gt64120.c
+++ b/arch/mips/pci/ops-gt64120.c
@@ -1,6 +1,8 @@
1/* 1/*
2 * Carsten Langgaard, carstenl@mips.com 2 * Copyright (C) 1999, 2000, 2004 MIPS Technologies, Inc.
3 * Copyright (C) 1999, 2000 MIPS Technologies, Inc. All rights reserved. 3 * All rights reserved.
4 * Authors: Carsten Langgaard <carstenl@mips.com>
5 * Maciej W. Rozycki <macro@mips.com>
4 * 6 *
5 * This program is free software; you can distribute it and/or modify it 7 * 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 8 * under the terms of the GNU General Public License (Version 2) as
@@ -43,10 +45,6 @@ static int gt64120_pcibios_config_access(unsigned char access_type,
43 unsigned char busnum = bus->number; 45 unsigned char busnum = bus->number;
44 u32 intr; 46 u32 intr;
45 47
46 if ((busnum == 0) && (PCI_SLOT(devfn) == 0))
47 /* Galileo itself is devfn 0, don't move it around */
48 return -1;
49
50 if ((busnum == 0) && (devfn >= PCI_DEVFN(31, 0))) 48 if ((busnum == 0) && (devfn >= PCI_DEVFN(31, 0)))
51 return -1; /* Because of a bug in the galileo (for slot 31). */ 49 return -1; /* Because of a bug in the galileo (for slot 31). */
52 50
diff --git a/arch/mips/pci/ops-msc.c b/arch/mips/pci/ops-msc.c
index 7bc099643a9d..5d9fbb0f4670 100644
--- a/arch/mips/pci/ops-msc.c
+++ b/arch/mips/pci/ops-msc.c
@@ -21,7 +21,6 @@
21 * MIPS boards specific PCI support. 21 * MIPS boards specific PCI support.
22 * 22 *
23 */ 23 */
24#include <linux/config.h>
25#include <linux/types.h> 24#include <linux/types.h>
26#include <linux/pci.h> 25#include <linux/pci.h>
27#include <linux/kernel.h> 26#include <linux/kernel.h>
@@ -49,34 +48,17 @@ static int msc_pcibios_config_access(unsigned char access_type,
49 struct pci_bus *bus, unsigned int devfn, int where, u32 * data) 48 struct pci_bus *bus, unsigned int devfn, int where, u32 * data)
50{ 49{
51 unsigned char busnum = bus->number; 50 unsigned char busnum = bus->number;
52 unsigned char type;
53 u32 intr; 51 u32 intr;
54 52
55#ifdef CONFIG_MIPS_BOARDS_GEN
56 if ((busnum == 0) && (PCI_SLOT(devfn) == 17)) {
57 /* MIPS Core boards have SOCit connected as device 17 */
58 return -1;
59 }
60#endif
61
62 /* Clear status register bits. */ 53 /* Clear status register bits. */
63 MSC_WRITE(MSC01_PCI_INTSTAT, 54 MSC_WRITE(MSC01_PCI_INTSTAT,
64 (MSC01_PCI_INTCFG_MA_BIT | MSC01_PCI_INTCFG_TA_BIT)); 55 (MSC01_PCI_INTCFG_MA_BIT | MSC01_PCI_INTCFG_TA_BIT));
65 56
66 /* Setup address */
67 if (busnum == 0)
68 type = 0; /* Type 0 */
69 else
70 type = 1; /* Type 1 */
71
72 MSC_WRITE(MSC01_PCI_CFGADDR, 57 MSC_WRITE(MSC01_PCI_CFGADDR,
73 ((busnum << MSC01_PCI_CFGADDR_BNUM_SHF) | 58 ((busnum << MSC01_PCI_CFGADDR_BNUM_SHF) |
74 (PCI_SLOT(devfn) << MSC01_PCI_CFGADDR_DNUM_SHF) 59 (PCI_SLOT(devfn) << MSC01_PCI_CFGADDR_DNUM_SHF) |
75 | (PCI_FUNC(devfn) << 60 (PCI_FUNC(devfn) << MSC01_PCI_CFGADDR_FNUM_SHF) |
76 MSC01_PCI_CFGADDR_FNUM_SHF) | ((where / 61 ((where / 4) << MSC01_PCI_CFGADDR_RNUM_SHF)));
77 4) <<
78 MSC01_PCI_CFGADDR_RNUM_SHF)
79 | (type)));
80 62
81 /* Perform access */ 63 /* Perform access */
82 if (access_type == PCI_ACCESS_WRITE) 64 if (access_type == PCI_ACCESS_WRITE)
@@ -86,15 +68,12 @@ static int msc_pcibios_config_access(unsigned char access_type,
86 68
87 /* Detect Master/Target abort */ 69 /* Detect Master/Target abort */
88 MSC_READ(MSC01_PCI_INTSTAT, intr); 70 MSC_READ(MSC01_PCI_INTSTAT, intr);
89 if (intr & (MSC01_PCI_INTCFG_MA_BIT | 71 if (intr & (MSC01_PCI_INTCFG_MA_BIT | MSC01_PCI_INTCFG_TA_BIT)) {
90 MSC01_PCI_INTCFG_TA_BIT)) {
91 /* Error occurred */ 72 /* Error occurred */
92 73
93 /* Clear bits */ 74 /* Clear bits */
94 MSC_READ(MSC01_PCI_INTSTAT, intr);
95 MSC_WRITE(MSC01_PCI_INTSTAT, 75 MSC_WRITE(MSC01_PCI_INTSTAT,
96 (MSC01_PCI_INTCFG_MA_BIT | 76 (MSC01_PCI_INTCFG_MA_BIT | MSC01_PCI_INTCFG_TA_BIT));
97 MSC01_PCI_INTCFG_TA_BIT));
98 77
99 return -1; 78 return -1;
100 } 79 }
diff --git a/arch/mips/pci/ops-nile4.c b/arch/mips/pci/ops-nile4.c
index a7169928b351..a8d38dc8c504 100644
--- a/arch/mips/pci/ops-nile4.c
+++ b/arch/mips/pci/ops-nile4.c
@@ -15,7 +15,7 @@
15 15
16volatile unsigned long *const vrc_pciregs = (void *) Vrc5074_BASE; 16volatile unsigned long *const vrc_pciregs = (void *) Vrc5074_BASE;
17 17
18static spinlock_t nile4_pci_lock; 18static DEFINE_SPINLOCK(nile4_pci_lock);
19 19
20static int nile4_pcibios_config_access(unsigned char access_type, 20static int nile4_pcibios_config_access(unsigned char access_type,
21 struct pci_bus *bus, unsigned int devfn, int where, u32 * val) 21 struct pci_bus *bus, unsigned int devfn, int where, u32 * val)
diff --git a/arch/mips/pci/ops-pnx8550.c b/arch/mips/pci/ops-pnx8550.c
new file mode 100644
index 000000000000..454b65cc3354
--- /dev/null
+++ b/arch/mips/pci/ops-pnx8550.c
@@ -0,0 +1,284 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 *
5 * 2.6 port, Embedded Alley Solutions, Inc
6 *
7 * Based on:
8 * Author: source@mvista.com
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#include <linux/types.h>
24#include <linux/pci.h>
25#include <linux/kernel.h>
26#include <linux/init.h>
27#include <linux/vmalloc.h>
28#include <linux/delay.h>
29
30#include <asm/mach-pnx8550/pci.h>
31#include <asm/mach-pnx8550/glb.h>
32#include <asm/debug.h>
33
34
35static inline void clear_status(void)
36{
37 unsigned long pci_stat;
38
39 pci_stat = inl(PCI_BASE | PCI_GPPM_STATUS);
40 outl(pci_stat, PCI_BASE | PCI_GPPM_ICLR);
41}
42
43static inline unsigned int
44calc_cfg_addr(struct pci_bus *bus, unsigned int devfn, int where)
45{
46 unsigned int addr;
47
48 addr = ((bus->number > 0) ? (((bus->number & 0xff) << PCI_CFG_BUS_SHIFT) | 1) : 0);
49 addr |= ((devfn & 0xff) << PCI_CFG_FUNC_SHIFT) | (where & 0xfc);
50
51 return addr;
52}
53
54static int
55config_access(unsigned int pci_cmd, struct pci_bus *bus, unsigned int devfn, int where, unsigned int pci_mode, unsigned int *val)
56{
57 unsigned int flags;
58 unsigned long loops = 0;
59 unsigned long ioaddr = calc_cfg_addr(bus, devfn, where);
60
61 local_irq_save(flags);
62 /*Clear pending interrupt status */
63 if (inl(PCI_BASE | PCI_GPPM_STATUS)) {
64 clear_status();
65 while (!(inl(PCI_BASE | PCI_GPPM_STATUS) == 0)) ;
66 }
67
68 outl(ioaddr, PCI_BASE | PCI_GPPM_ADDR);
69
70 if ((pci_cmd == PCI_CMD_IOW) || (pci_cmd == PCI_CMD_CONFIG_WRITE))
71 outl(*val, PCI_BASE | PCI_GPPM_WDAT);
72
73 outl(INIT_PCI_CYCLE | pci_cmd | (pci_mode & PCI_BYTE_ENABLE_MASK),
74 PCI_BASE | PCI_GPPM_CTRL);
75
76 loops =
77 ((loops_per_jiffy *
78 PCI_IO_JIFFIES_TIMEOUT) >> (PCI_IO_JIFFIES_SHIFT));
79 while (1) {
80 if (inl(PCI_BASE | PCI_GPPM_STATUS) & GPPM_DONE) {
81 if ((pci_cmd == PCI_CMD_IOR) ||
82 (pci_cmd == PCI_CMD_CONFIG_READ))
83 *val = inl(PCI_BASE | PCI_GPPM_RDAT);
84 clear_status();
85 local_irq_restore(flags);
86 return PCIBIOS_SUCCESSFUL;
87 } else if (inl(PCI_BASE | PCI_GPPM_STATUS) & GPPM_R_MABORT) {
88 break;
89 }
90
91 loops--;
92 if (loops == 0) {
93 printk("%s : Arbiter Locked.\n", __FUNCTION__);
94 }
95 }
96
97 clear_status();
98 if ((pci_cmd == PCI_CMD_IOR) || (pci_cmd == PCI_CMD_IOW)) {
99 printk("%s timeout (GPPM_CTRL=%X) ioaddr %lX pci_cmd %X\n",
100 __FUNCTION__, inl(PCI_BASE | PCI_GPPM_CTRL), ioaddr,
101 pci_cmd);
102 }
103
104 if ((pci_cmd == PCI_CMD_IOR) || (pci_cmd == PCI_CMD_CONFIG_READ))
105 *val = 0xffffffff;
106 local_irq_restore(flags);
107 return PCIBIOS_DEVICE_NOT_FOUND;
108}
109
110/*
111 * We can't address 8 and 16 bit words directly. Instead we have to
112 * read/write a 32bit word and mask/modify the data we actually want.
113 */
114static int
115read_config_byte(struct pci_bus *bus, unsigned int devfn, int where, u8 * val)
116{
117 unsigned int data = 0;
118 int err;
119
120 if (bus == 0)
121 return -1;
122
123 err = config_access(PCI_CMD_CONFIG_READ, bus, devfn, where, ~(1 << (where & 3)), &data);
124 switch (where & 0x03) {
125 case 0:
126 *val = (unsigned char)(data & 0x000000ff);
127 break;
128 case 1:
129 *val = (unsigned char)((data & 0x0000ff00) >> 8);
130 break;
131 case 2:
132 *val = (unsigned char)((data & 0x00ff0000) >> 16);
133 break;
134 case 3:
135 *val = (unsigned char)((data & 0xff000000) >> 24);
136 break;
137 }
138
139 return err;
140}
141
142static int
143read_config_word(struct pci_bus *bus, unsigned int devfn, int where, u16 * val)
144{
145 unsigned int data = 0;
146 int err;
147
148 if (bus == 0)
149 return -1;
150
151 if (where & 0x01)
152 return PCIBIOS_BAD_REGISTER_NUMBER;
153
154 err = config_access(PCI_CMD_CONFIG_READ, bus, devfn, where, ~(3 << (where & 3)), &data);
155 switch (where & 0x02) {
156 case 0:
157 *val = (unsigned short)(data & 0x0000ffff);
158 break;
159 case 2:
160 *val = (unsigned short)((data & 0xffff0000) >> 16);
161 break;
162 }
163
164 return err;
165}
166
167static int
168read_config_dword(struct pci_bus *bus, unsigned int devfn, int where, u32 * val)
169{
170 int err;
171 if (bus == 0)
172 return -1;
173
174 if (where & 0x03)
175 return PCIBIOS_BAD_REGISTER_NUMBER;
176
177 err = config_access(PCI_CMD_CONFIG_READ, bus, devfn, where, 0, val);
178
179 return err;
180}
181
182static int
183write_config_byte(struct pci_bus *bus, unsigned int devfn, int where, u8 val)
184{
185 unsigned int data = (unsigned int)val;
186 int err;
187
188 if (bus == 0)
189 return -1;
190
191 switch (where & 0x03) {
192 case 1:
193 data = (data << 8);
194 break;
195 case 2:
196 data = (data << 16);
197 break;
198 case 3:
199 data = (data << 24);
200 break;
201 default:
202 break;
203 }
204
205 err = config_access(PCI_CMD_CONFIG_READ, bus, devfn, where, ~(1 << (where & 3)), &data);
206
207 return err;
208}
209
210static int
211write_config_word(struct pci_bus *bus, unsigned int devfn, int where, u16 val)
212{
213 unsigned int data = (unsigned int)val;
214 int err;
215
216 if (bus == 0)
217 return -1;
218
219 if (where & 0x01)
220 return PCIBIOS_BAD_REGISTER_NUMBER;
221
222 switch (where & 0x02) {
223 case 2:
224 data = (data << 16);
225 break;
226 default:
227 break;
228 }
229 err = config_access(PCI_CMD_CONFIG_WRITE, bus, devfn, where, ~(3 << (where & 3)), &data);
230
231 return err;
232}
233
234static int
235write_config_dword(struct pci_bus *bus, unsigned int devfn, int where, u32 val)
236{
237 int err;
238 if (bus == 0)
239 return -1;
240
241 if (where & 0x03)
242 return PCIBIOS_BAD_REGISTER_NUMBER;
243
244 err = config_access(PCI_CMD_CONFIG_WRITE, bus, devfn, where, 0, &val);
245
246 return err;
247}
248
249static int config_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 * val)
250{
251 switch (size) {
252 case 1: {
253 u8 _val;
254 int rc = read_config_byte(bus, devfn, where, &_val);
255 *val = _val;
256 return rc;
257 }
258 case 2: {
259 u16 _val;
260 int rc = read_config_word(bus, devfn, where, &_val);
261 *val = _val;
262 return rc;
263 }
264 default:
265 return read_config_dword(bus, devfn, where, val);
266 }
267}
268
269static int config_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val)
270{
271 switch (size) {
272 case 1:
273 return write_config_byte(bus, devfn, where, (u8) val);
274 case 2:
275 return write_config_word(bus, devfn, where, (u16) val);
276 default:
277 return write_config_dword(bus, devfn, where, val);
278 }
279}
280
281struct pci_ops pnx8550_pci_ops = {
282 config_read,
283 config_write
284};
diff --git a/arch/mips/pci/ops-tx4938.c b/arch/mips/pci/ops-tx4938.c
new file mode 100644
index 000000000000..4c0dcfce5297
--- /dev/null
+++ b/arch/mips/pci/ops-tx4938.c
@@ -0,0 +1,198 @@
1/*
2 * Define the pci_ops for the Toshiba rbtx4938
3 * Copyright (C) 2000-2001 Toshiba Corporation
4 *
5 * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
6 * terms of the GNU General Public License version 2. This program is
7 * licensed "as is" without any warranty of any kind, whether express
8 * or implied.
9 *
10 * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
11 */
12#include <linux/types.h>
13#include <linux/pci.h>
14#include <linux/kernel.h>
15#include <linux/init.h>
16
17#include <asm/addrspace.h>
18#include <asm/tx4938/rbtx4938.h>
19
20/* initialize in setup */
21struct resource pci_io_resource = {
22 .name = "pci IO space",
23 .start = 0,
24 .end = 0,
25 .flags = IORESOURCE_IO
26};
27
28/* initialize in setup */
29struct resource pci_mem_resource = {
30 .name = "pci memory space",
31 .start = 0,
32 .end = 0,
33 .flags = IORESOURCE_MEM
34};
35
36struct resource tx4938_pcic1_pci_io_resource = {
37 .name = "PCI1 IO",
38 .start = 0,
39 .end = 0,
40 .flags = IORESOURCE_IO
41};
42struct resource tx4938_pcic1_pci_mem_resource = {
43 .name = "PCI1 mem",
44 .start = 0,
45 .end = 0,
46 .flags = IORESOURCE_MEM
47};
48
49static int mkaddr(int bus, int dev_fn, int where, int *flagsp)
50{
51 if (bus > 0) {
52 /* Type 1 configuration */
53 tx4938_pcicptr->g2pcfgadrs = ((bus & 0xff) << 0x10) |
54 ((dev_fn & 0xff) << 0x08) | (where & 0xfc) | 1;
55 } else {
56 if (dev_fn >= PCI_DEVFN(TX4938_PCIC_MAX_DEVNU, 0))
57 return -1;
58
59 /* Type 0 configuration */
60 tx4938_pcicptr->g2pcfgadrs = ((bus & 0xff) << 0x10) |
61 ((dev_fn & 0xff) << 0x08) | (where & 0xfc);
62 }
63 /* clear M_ABORT and Disable M_ABORT Int. */
64 tx4938_pcicptr->pcistatus =
65 (tx4938_pcicptr->pcistatus & 0x0000ffff) |
66 (PCI_STATUS_REC_MASTER_ABORT << 16);
67 tx4938_pcicptr->pcimask &= ~PCI_STATUS_REC_MASTER_ABORT;
68
69 return 0;
70}
71
72static int check_abort(int flags)
73{
74 int code = PCIBIOS_SUCCESSFUL;
75 /* wait write cycle completion before checking error status */
76 while (tx4938_pcicptr->pcicstatus & TX4938_PCIC_PCICSTATUS_IWB)
77 ;
78 if (tx4938_pcicptr->pcistatus & (PCI_STATUS_REC_MASTER_ABORT << 16)) {
79 tx4938_pcicptr->pcistatus =
80 (tx4938_pcicptr->
81 pcistatus & 0x0000ffff) | (PCI_STATUS_REC_MASTER_ABORT
82 << 16);
83 tx4938_pcicptr->pcimask |= PCI_STATUS_REC_MASTER_ABORT;
84 code = PCIBIOS_DEVICE_NOT_FOUND;
85 }
86 return code;
87}
88
89static int tx4938_pcibios_read_config(struct pci_bus *bus, unsigned int devfn,
90 int where, int size, u32 * val)
91{
92 int flags, retval, dev, busno, func;
93
94 dev = PCI_SLOT(devfn);
95 func = PCI_FUNC(devfn);
96
97 /* check if the bus is top-level */
98 if (bus->parent != NULL)
99 busno = bus->number;
100 else {
101 busno = 0;
102 }
103
104 if (mkaddr(busno, devfn, where, &flags))
105 return -1;
106
107 switch (size) {
108 case 1:
109 *val = *(volatile u8 *) ((ulong) & tx4938_pcicptr->g2pcfgdata |
110#ifdef __BIG_ENDIAN
111 ((where & 3) ^ 3));
112#else
113 (where & 3));
114#endif
115 break;
116 case 2:
117 *val = *(volatile u16 *) ((ulong) & tx4938_pcicptr->g2pcfgdata |
118#ifdef __BIG_ENDIAN
119 ((where & 3) ^ 2));
120#else
121 (where & 3));
122#endif
123 break;
124 case 4:
125 *val = tx4938_pcicptr->g2pcfgdata;
126 break;
127 }
128
129 retval = check_abort(flags);
130 if (retval == PCIBIOS_DEVICE_NOT_FOUND)
131 *val = 0xffffffff;
132
133 return retval;
134}
135
136static int tx4938_pcibios_write_config(struct pci_bus *bus, unsigned int devfn, int where,
137 int size, u32 val)
138{
139 int flags, dev, busno, func;
140
141 busno = bus->number;
142 dev = PCI_SLOT(devfn);
143 func = PCI_FUNC(devfn);
144
145 /* check if the bus is top-level */
146 if (bus->parent != NULL) {
147 busno = bus->number;
148 } else {
149 busno = 0;
150 }
151
152 if (mkaddr(busno, devfn, where, &flags))
153 return -1;
154
155 switch (size) {
156 case 1:
157 *(volatile u8 *) ((ulong) & tx4938_pcicptr->g2pcfgdata |
158#ifdef __BIG_ENDIAN
159 ((where & 3) ^ 3)) = val;
160#else
161 (where & 3)) = val;
162#endif
163 break;
164 case 2:
165 *(volatile u16 *) ((ulong) & tx4938_pcicptr->g2pcfgdata |
166#ifdef __BIG_ENDIAN
167 ((where & 0x3) ^ 0x2)) = val;
168#else
169 (where & 3)) = val;
170#endif
171 break;
172 case 4:
173 tx4938_pcicptr->g2pcfgdata = val;
174 break;
175 }
176
177 return check_abort(flags);
178}
179
180struct pci_ops tx4938_pci_ops = {
181 tx4938_pcibios_read_config,
182 tx4938_pcibios_write_config
183};
184
185struct pci_controller tx4938_pci_controller[] = {
186 /* h/w only supports devices 0x00 to 0x14 */
187 {
188 .pci_ops = &tx4938_pci_ops,
189 .io_resource = &pci_io_resource,
190 .mem_resource = &pci_mem_resource,
191 },
192 /* h/w only supports devices 0x00 to 0x14 */
193 {
194 .pci_ops = &tx4938_pci_ops,
195 .io_resource = &tx4938_pcic1_pci_io_resource,
196 .mem_resource = &tx4938_pcic1_pci_mem_resource,
197 }
198};
diff --git a/arch/mips/pci/pci-bcm1480.c b/arch/mips/pci/pci-bcm1480.c
new file mode 100644
index 000000000000..f194b4e4f86a
--- /dev/null
+++ b/arch/mips/pci/pci-bcm1480.c
@@ -0,0 +1,265 @@
1/*
2 * Copyright (C) 2001,2002,2005 Broadcom Corporation
3 * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org)
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 */
19
20/*
21 * BCM1x80/1x55-specific PCI support
22 *
23 * This module provides the glue between Linux's PCI subsystem
24 * and the hardware. We basically provide glue for accessing
25 * configuration space, and set up the translation for I/O
26 * space accesses.
27 *
28 * To access configuration space, we use ioremap. In the 32-bit
29 * kernel, this consumes either 4 or 8 page table pages, and 16MB of
30 * kernel mapped memory. Hopefully neither of these should be a huge
31 * problem.
32 *
33 * XXX: AT THIS TIME, ONLY the NATIVE PCI-X INTERFACE IS SUPPORTED.
34 */
35#include <linux/config.h>
36#include <linux/types.h>
37#include <linux/pci.h>
38#include <linux/kernel.h>
39#include <linux/init.h>
40#include <linux/mm.h>
41#include <linux/console.h>
42#include <linux/tty.h>
43
44#include <asm/sibyte/bcm1480_regs.h>
45#include <asm/sibyte/bcm1480_scd.h>
46#include <asm/sibyte/board.h>
47#include <asm/io.h>
48
49/*
50 * Macros for calculating offsets into config space given a device
51 * structure or dev/fun/reg
52 */
53#define CFGOFFSET(bus,devfn,where) (((bus)<<16)+((devfn)<<8)+(where))
54#define CFGADDR(bus,devfn,where) CFGOFFSET((bus)->number,(devfn),where)
55
56static void *cfg_space;
57
58#define PCI_BUS_ENABLED 1
59#define PCI_DEVICE_MODE 2
60
61static int bcm1480_bus_status = 0;
62
63#define PCI_BRIDGE_DEVICE 0
64
65/*
66 * Read/write 32-bit values in config space.
67 */
68static inline u32 READCFG32(u32 addr)
69{
70 return *(u32 *)(cfg_space + (addr&~3));
71}
72
73static inline void WRITECFG32(u32 addr, u32 data)
74{
75 *(u32 *)(cfg_space + (addr & ~3)) = data;
76}
77
78int pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
79{
80 return dev->irq;
81}
82
83/* Do platform specific device initialization at pci_enable_device() time */
84int pcibios_plat_dev_init(struct pci_dev *dev)
85{
86 return 0;
87}
88
89/*
90 * Some checks before doing config cycles:
91 * In PCI Device Mode, hide everything on bus 0 except the LDT host
92 * bridge. Otherwise, access is controlled by bridge MasterEn bits.
93 */
94static int bcm1480_pci_can_access(struct pci_bus *bus, int devfn)
95{
96 u32 devno;
97
98 if (!(bcm1480_bus_status & (PCI_BUS_ENABLED | PCI_DEVICE_MODE)))
99 return 0;
100
101 if (bus->number == 0) {
102 devno = PCI_SLOT(devfn);
103 if (bcm1480_bus_status & PCI_DEVICE_MODE)
104 return 0;
105 else
106 return 1;
107 } else
108 return 1;
109}
110
111/*
112 * Read/write access functions for various sizes of values
113 * in config space. Return all 1's for disallowed accesses
114 * for a kludgy but adequate simulation of master aborts.
115 */
116
117static int bcm1480_pcibios_read(struct pci_bus *bus, unsigned int devfn,
118 int where, int size, u32 * val)
119{
120 u32 data = 0;
121
122 if ((size == 2) && (where & 1))
123 return PCIBIOS_BAD_REGISTER_NUMBER;
124 else if ((size == 4) && (where & 3))
125 return PCIBIOS_BAD_REGISTER_NUMBER;
126
127 if (bcm1480_pci_can_access(bus, devfn))
128 data = READCFG32(CFGADDR(bus, devfn, where));
129 else
130 data = 0xFFFFFFFF;
131
132 if (size == 1)
133 *val = (data >> ((where & 3) << 3)) & 0xff;
134 else if (size == 2)
135 *val = (data >> ((where & 3) << 3)) & 0xffff;
136 else
137 *val = data;
138
139 return PCIBIOS_SUCCESSFUL;
140}
141
142static int bcm1480_pcibios_write(struct pci_bus *bus, unsigned int devfn,
143 int where, int size, u32 val)
144{
145 u32 cfgaddr = CFGADDR(bus, devfn, where);
146 u32 data = 0;
147
148 if ((size == 2) && (where & 1))
149 return PCIBIOS_BAD_REGISTER_NUMBER;
150 else if ((size == 4) && (where & 3))
151 return PCIBIOS_BAD_REGISTER_NUMBER;
152
153 if (!bcm1480_pci_can_access(bus, devfn))
154 return PCIBIOS_BAD_REGISTER_NUMBER;
155
156 data = READCFG32(cfgaddr);
157
158 if (size == 1)
159 data = (data & ~(0xff << ((where & 3) << 3))) |
160 (val << ((where & 3) << 3));
161 else if (size == 2)
162 data = (data & ~(0xffff << ((where & 3) << 3))) |
163 (val << ((where & 3) << 3));
164 else
165 data = val;
166
167 WRITECFG32(cfgaddr, data);
168
169 return PCIBIOS_SUCCESSFUL;
170}
171
172struct pci_ops bcm1480_pci_ops = {
173 bcm1480_pcibios_read,
174 bcm1480_pcibios_write,
175};
176
177static struct resource bcm1480_mem_resource = {
178 .name = "BCM1480 PCI MEM",
179 .start = 0x30000000UL,
180 .end = 0x3fffffffUL,
181 .flags = IORESOURCE_MEM,
182};
183
184static struct resource bcm1480_io_resource = {
185 .name = "BCM1480 PCI I/O",
186 .start = 0x2c000000UL,
187 .end = 0x2dffffffUL,
188 .flags = IORESOURCE_IO,
189};
190
191struct pci_controller bcm1480_controller = {
192 .pci_ops = &bcm1480_pci_ops,
193 .mem_resource = &bcm1480_mem_resource,
194 .io_resource = &bcm1480_io_resource,
195};
196
197
198static int __init bcm1480_pcibios_init(void)
199{
200 uint32_t cmdreg;
201 uint64_t reg;
202 extern int pci_probe_only;
203
204 /* CFE will assign PCI resources */
205 pci_probe_only = 1;
206
207 /* Avoid ISA compat ranges. */
208 PCIBIOS_MIN_IO = 0x00008000UL;
209 PCIBIOS_MIN_MEM = 0x01000000UL;
210
211 /* Set I/O resource limits. - unlimited for now to accomodate HT */
212 ioport_resource.end = 0xffffffffUL;
213 iomem_resource.end = 0xffffffffUL;
214
215 cfg_space = ioremap(A_BCM1480_PHYS_PCI_CFG_MATCH_BITS, 16*1024*1024);
216
217 /*
218 * See if the PCI bus has been configured by the firmware.
219 */
220 reg = *((volatile uint64_t *) IOADDR(A_SCD_SYSTEM_CFG));
221 if (!(reg & M_BCM1480_SYS_PCI_HOST)) {
222 bcm1480_bus_status |= PCI_DEVICE_MODE;
223 } else {
224 cmdreg = READCFG32(CFGOFFSET(0, PCI_DEVFN(PCI_BRIDGE_DEVICE, 0),
225 PCI_COMMAND));
226 if (!(cmdreg & PCI_COMMAND_MASTER)) {
227 printk
228 ("PCI: Skipping PCI probe. Bus is not initialized.\n");
229 iounmap(cfg_space);
230 return 1; /* XXX */
231 }
232 bcm1480_bus_status |= PCI_BUS_ENABLED;
233 }
234
235 /* turn on ExpMemEn */
236 cmdreg = READCFG32(CFGOFFSET(0, PCI_DEVFN(PCI_BRIDGE_DEVICE, 0), 0x40));
237 printk("PCIFeatureCtrl = %x\n", cmdreg);
238 WRITECFG32(CFGOFFSET(0, PCI_DEVFN(PCI_BRIDGE_DEVICE, 0), 0x40),
239 cmdreg | 0x10);
240 cmdreg = READCFG32(CFGOFFSET(0, PCI_DEVFN(PCI_BRIDGE_DEVICE, 0), 0x40));
241 printk("PCIFeatureCtrl = %x\n", cmdreg);
242
243 /*
244 * Establish mappings in KSEG2 (kernel virtual) to PCI I/O
245 * space. Use "match bytes" policy to make everything look
246 * little-endian. So, you need to also set
247 * CONFIG_SWAP_IO_SPACE, but this is the combination that
248 * works correctly with most of Linux's drivers.
249 * XXX ehs: Should this happen in PCI Device mode?
250 */
251
252 set_io_port_base((unsigned long)
253 ioremap(A_BCM1480_PHYS_PCI_IO_MATCH_BYTES, 65536));
254 isa_slot_offset = (unsigned long)
255 ioremap(A_BCM1480_PHYS_PCI_MEM_MATCH_BYTES, 1024*1024);
256
257 register_pci_controller(&bcm1480_controller);
258
259#ifdef CONFIG_VGA_CONSOLE
260 take_over_console(&vga_con,0,MAX_NR_CONSOLES-1,1);
261#endif
262 return 0;
263}
264
265arch_initcall(bcm1480_pcibios_init);
diff --git a/arch/mips/pci/pci-bcm1480ht.c b/arch/mips/pci/pci-bcm1480ht.c
new file mode 100644
index 000000000000..aca4a2e7a1c6
--- /dev/null
+++ b/arch/mips/pci/pci-bcm1480ht.c
@@ -0,0 +1,224 @@
1/*
2 * Copyright (C) 2001,2002,2005 Broadcom Corporation
3 * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org)
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 */
19
20/*
21 * BCM1480/1455-specific HT support (looking like PCI)
22 *
23 * This module provides the glue between Linux's PCI subsystem
24 * and the hardware. We basically provide glue for accessing
25 * configuration space, and set up the translation for I/O
26 * space accesses.
27 *
28 * To access configuration space, we use ioremap. In the 32-bit
29 * kernel, this consumes either 4 or 8 page table pages, and 16MB of
30 * kernel mapped memory. Hopefully neither of these should be a huge
31 * problem.
32 *
33 */
34#include <linux/config.h>
35#include <linux/types.h>
36#include <linux/pci.h>
37#include <linux/kernel.h>
38#include <linux/init.h>
39#include <linux/mm.h>
40#include <linux/console.h>
41#include <linux/tty.h>
42
43#include <asm/sibyte/bcm1480_regs.h>
44#include <asm/sibyte/bcm1480_scd.h>
45#include <asm/sibyte/board.h>
46#include <asm/io.h>
47
48/*
49 * Macros for calculating offsets into config space given a device
50 * structure or dev/fun/reg
51 */
52#define CFGOFFSET(bus,devfn,where) (((bus)<<16)+((devfn)<<8)+(where))
53#define CFGADDR(bus,devfn,where) CFGOFFSET((bus)->number,(devfn),where)
54
55static void *ht_cfg_space;
56
57#define PCI_BUS_ENABLED 1
58#define PCI_DEVICE_MODE 2
59
60static int bcm1480ht_bus_status = 0;
61
62#define PCI_BRIDGE_DEVICE 0
63#define HT_BRIDGE_DEVICE 1
64
65/*
66 * HT's level-sensitive interrupts require EOI, which is generated
67 * through a 4MB memory-mapped region
68 */
69unsigned long ht_eoi_space;
70
71/*
72 * Read/write 32-bit values in config space.
73 */
74static inline u32 READCFG32(u32 addr)
75{
76 return *(u32 *)(ht_cfg_space + (addr&~3));
77}
78
79static inline void WRITECFG32(u32 addr, u32 data)
80{
81 *(u32 *)(ht_cfg_space + (addr & ~3)) = data;
82}
83
84/*
85 * Some checks before doing config cycles:
86 * In PCI Device Mode, hide everything on bus 0 except the LDT host
87 * bridge. Otherwise, access is controlled by bridge MasterEn bits.
88 */
89static int bcm1480ht_can_access(struct pci_bus *bus, int devfn)
90{
91 u32 devno;
92
93 if (!(bcm1480ht_bus_status & (PCI_BUS_ENABLED | PCI_DEVICE_MODE)))
94 return 0;
95
96 if (bus->number == 0) {
97 devno = PCI_SLOT(devfn);
98 if (bcm1480ht_bus_status & PCI_DEVICE_MODE)
99 return 0;
100 }
101 return 1;
102}
103
104/*
105 * Read/write access functions for various sizes of values
106 * in config space. Return all 1's for disallowed accesses
107 * for a kludgy but adequate simulation of master aborts.
108 */
109
110static int bcm1480ht_pcibios_read(struct pci_bus *bus, unsigned int devfn,
111 int where, int size, u32 * val)
112{
113 u32 data = 0;
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 if (bcm1480ht_can_access(bus, devfn))
121 data = READCFG32(CFGADDR(bus, devfn, where));
122 else
123 data = 0xFFFFFFFF;
124
125 if (size == 1)
126 *val = (data >> ((where & 3) << 3)) & 0xff;
127 else if (size == 2)
128 *val = (data >> ((where & 3) << 3)) & 0xffff;
129 else
130 *val = data;
131
132 return PCIBIOS_SUCCESSFUL;
133}
134
135static int bcm1480ht_pcibios_write(struct pci_bus *bus, unsigned int devfn,
136 int where, int size, u32 val)
137{
138 u32 cfgaddr = CFGADDR(bus, devfn, where);
139 u32 data = 0;
140
141 if ((size == 2) && (where & 1))
142 return PCIBIOS_BAD_REGISTER_NUMBER;
143 else if ((size == 4) && (where & 3))
144 return PCIBIOS_BAD_REGISTER_NUMBER;
145
146 if (!bcm1480ht_can_access(bus, devfn))
147 return PCIBIOS_BAD_REGISTER_NUMBER;
148
149 data = READCFG32(cfgaddr);
150
151 if (size == 1)
152 data = (data & ~(0xff << ((where & 3) << 3))) |
153 (val << ((where & 3) << 3));
154 else if (size == 2)
155 data = (data & ~(0xffff << ((where & 3) << 3))) |
156 (val << ((where & 3) << 3));
157 else
158 data = val;
159
160 WRITECFG32(cfgaddr, data);
161
162 return PCIBIOS_SUCCESSFUL;
163}
164
165static int bcm1480ht_pcibios_get_busno(void)
166{
167 return 0;
168}
169
170struct pci_ops bcm1480ht_pci_ops = {
171 .read = bcm1480ht_pcibios_read,
172 .write = bcm1480ht_pcibios_write,
173};
174
175static struct resource bcm1480ht_mem_resource = {
176 .name = "BCM1480 HT MEM",
177 .start = 0x40000000UL,
178 .end = 0x5fffffffUL,
179 .flags = IORESOURCE_MEM,
180};
181
182static struct resource bcm1480ht_io_resource = {
183 .name = "BCM1480 HT I/O",
184 .start = 0x00000000UL,
185 .end = 0x01ffffffUL,
186 .flags = IORESOURCE_IO,
187};
188
189struct pci_controller bcm1480ht_controller = {
190 .pci_ops = &bcm1480ht_pci_ops,
191 .mem_resource = &bcm1480ht_mem_resource,
192 .io_resource = &bcm1480ht_io_resource,
193 .index = 1,
194 .get_busno = bcm1480ht_pcibios_get_busno,
195};
196
197static int __init bcm1480ht_pcibios_init(void)
198{
199 uint32_t cmdreg;
200
201 ht_cfg_space = ioremap(A_BCM1480_PHYS_HT_CFG_MATCH_BITS, 16*1024*1024);
202
203 /*
204 * See if the PCI bus has been configured by the firmware.
205 */
206 cmdreg = READCFG32(CFGOFFSET(0, PCI_DEVFN(PCI_BRIDGE_DEVICE, 0),
207 PCI_COMMAND));
208 if (!(cmdreg & PCI_COMMAND_MASTER)) {
209 printk("HT: Skipping HT probe. Bus is not initialized.\n");
210 iounmap(ht_cfg_space);
211 return 1; /* XXX */
212 }
213 bcm1480ht_bus_status |= PCI_BUS_ENABLED;
214
215 ht_eoi_space = (unsigned long)
216 ioremap(A_BCM1480_PHYS_HT_SPECIAL_MATCH_BYTES,
217 4 * 1024 * 1024);
218
219 register_pci_controller(&bcm1480ht_controller);
220
221 return 0;
222}
223
224arch_initcall(bcm1480ht_pcibios_init);
diff --git a/arch/mips/pci/pci-ip27.c b/arch/mips/pci/pci-ip27.c
index 068e0e508e15..efc96ce99eeb 100644
--- a/arch/mips/pci/pci-ip27.c
+++ b/arch/mips/pci/pci-ip27.c
@@ -485,5 +485,12 @@ static void __init pci_fixup_ioc3(struct pci_dev *d)
485 pci_disable_swapping(d); 485 pci_disable_swapping(d);
486} 486}
487 487
488int pcibus_to_node(struct pci_bus *bus)
489{
490 struct bridge_controller *bc = BRIDGE_CONTROLLER(bus);
491
492 return bc->nasid;
493}
494
488DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC3, 495DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC3,
489 pci_fixup_ioc3); 496 pci_fixup_ioc3);
diff --git a/arch/mips/pci/pci-ip32.c b/arch/mips/pci/pci-ip32.c
index 000dc6af6cd3..180af89bcb1e 100644
--- a/arch/mips/pci/pci-ip32.c
+++ b/arch/mips/pci/pci-ip32.c
@@ -136,7 +136,9 @@ static int __init mace_init(void)
136 BUG_ON(request_irq(MACE_PCI_BRIDGE_IRQ, macepci_error, 0, 136 BUG_ON(request_irq(MACE_PCI_BRIDGE_IRQ, macepci_error, 0,
137 "MACE PCI error", NULL)); 137 "MACE PCI error", NULL));
138 138
139 ioport_resource.end = mace_pci_io_resource.end; 139 iomem_resource = mace_pci_mem_resource;
140 ioport_resource = mace_pci_io_resource;
141
140 register_pci_controller(&mace_pci_controller); 142 register_pci_controller(&mace_pci_controller);
141 143
142 return 0; 144 return 0;
diff --git a/arch/mips/pci/pci-lasat.c b/arch/mips/pci/pci-lasat.c
index ae3cc4b254b5..88fb191ad2eb 100644
--- a/arch/mips/pci/pci-lasat.c
+++ b/arch/mips/pci/pci-lasat.c
@@ -7,12 +7,8 @@
7 */ 7 */
8#include <linux/kernel.h> 8#include <linux/kernel.h>
9#include <linux/init.h> 9#include <linux/init.h>
10#include <linux/interrupt.h>
11#include <linux/pci.h> 10#include <linux/pci.h>
12#include <linux/types.h> 11#include <linux/types.h>
13#include <linux/interrupt.h>
14#include <linux/pci.h>
15#include <linux/delay.h>
16#include <asm/bootinfo.h> 12#include <asm/bootinfo.h>
17 13
18extern struct pci_ops nile4_pci_ops; 14extern struct pci_ops nile4_pci_ops;
@@ -20,14 +16,14 @@ extern struct pci_ops gt64120_pci_ops;
20static struct resource lasat_pci_mem_resource = { 16static struct resource lasat_pci_mem_resource = {
21 .name = "LASAT PCI MEM", 17 .name = "LASAT PCI MEM",
22 .start = 0x18000000, 18 .start = 0x18000000,
23 .end = 0x19FFFFFF, 19 .end = 0x19ffffff,
24 .flags = IORESOURCE_MEM, 20 .flags = IORESOURCE_MEM,
25}; 21};
26 22
27static struct resource lasat_pci_io_resource = { 23static struct resource lasat_pci_io_resource = {
28 .name = "LASAT PCI IO", 24 .name = "LASAT PCI IO",
29 .start = 0x1a000000, 25 .start = 0x1a000000,
30 .end = 0x1bFFFFFF, 26 .end = 0x1bffffff,
31 .flags = IORESOURCE_IO, 27 .flags = IORESOURCE_IO,
32}; 28};
33 29
@@ -38,23 +34,25 @@ static struct pci_controller lasat_pci_controller = {
38 34
39static int __init lasat_pci_setup(void) 35static int __init lasat_pci_setup(void)
40{ 36{
41 printk("PCI: starting\n"); 37 printk("PCI: starting\n");
42 38
43 switch (mips_machtype) { 39 switch (mips_machtype) {
44 case MACH_LASAT_100: 40 case MACH_LASAT_100:
45 lasat_pci_controller.pci_ops = &gt64120_pci_ops; 41 lasat_pci_controller.pci_ops = &gt64120_pci_ops;
46 break; 42 break;
47 case MACH_LASAT_200: 43 case MACH_LASAT_200:
48 lasat_pci_controller.pci_ops = &nile4_pci_ops; 44 lasat_pci_controller.pci_ops = &nile4_pci_ops;
49 break; 45 break;
50 default: 46 default:
51 panic("pcibios_init: mips_machtype incorrect"); 47 panic("pcibios_init: mips_machtype incorrect");
52 } 48 }
53 49
54 register_pci_controller(&lasat_pci_controller); 50 register_pci_controller(&lasat_pci_controller);
55 return 0; 51
52 return 0;
56} 53}
57early_initcall(lasat_pci_setup); 54
55arch_initcall(lasat_pci_setup);
58 56
59#define LASATINT_ETH1 0 57#define LASATINT_ETH1 0
60#define LASATINT_ETH0 1 58#define LASATINT_ETH0 1
@@ -68,24 +66,22 @@ early_initcall(lasat_pci_setup);
68 66
69int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 67int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
70{ 68{
71 switch (slot) { 69 switch (slot) {
72 case 1: 70 case 1:
73 return LASATINT_PCIA; /* Expansion Module 0 */ 71 case 2:
74 case 2: 72 case 3:
75 return LASATINT_PCIB; /* Expansion Module 1 */ 73 return LASATINT_PCIA + (((slot-1) + (pin-1)) % 4);
76 case 3: 74 case 4:
77 return LASATINT_PCIC; /* Expansion Module 2 */ 75 return LASATINT_ETH1; /* Ethernet 1 (LAN 2) */
78 case 4: 76 case 5:
79 return LASATINT_ETH1; /* Ethernet 1 (LAN 2) */ 77 return LASATINT_ETH0; /* Ethernet 0 (LAN 1) */
80 case 5: 78 case 6:
81 return LASATINT_ETH0; /* Ethernet 0 (LAN 1) */ 79 return LASATINT_HDC; /* IDE controller */
82 case 6: 80 default:
83 return LASATINT_HDC; /* IDE controller */ 81 return 0xff; /* Illegal */
84 default: 82 }
85 return 0xff; /* Illegal */
86 }
87 83
88 return -1; 84 return -1;
89} 85}
90 86
91/* Do platform specific device initialization at pci_enable_device() time */ 87/* Do platform specific device initialization at pci_enable_device() time */
diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
index a8d499b0a36f..21402ffd7c98 100644
--- a/arch/mips/pci/pci.c
+++ b/arch/mips/pci/pci.c
@@ -127,15 +127,20 @@ static int __init pcibios_init(void)
127 if (!hose->iommu) 127 if (!hose->iommu)
128 PCI_DMA_BUS_IS_PHYS = 1; 128 PCI_DMA_BUS_IS_PHYS = 1;
129 129
130 if (hose->get_busno && pci_probe_only)
131 next_busno = (*hose->get_busno)();
132
130 bus = pci_scan_bus(next_busno, hose->pci_ops, hose); 133 bus = pci_scan_bus(next_busno, hose->pci_ops, hose);
131 hose->bus = bus; 134 hose->bus = bus;
132 hose->need_domain_info = need_domain_info; 135 hose->need_domain_info = need_domain_info;
133 next_busno = bus->subordinate + 1; 136 if (bus) {
134 /* Don't allow 8-bit bus number overflow inside the hose - 137 next_busno = bus->subordinate + 1;
135 reserve some space for bridges. */ 138 /* Don't allow 8-bit bus number overflow inside the hose -
136 if (next_busno > 224) { 139 reserve some space for bridges. */
137 next_busno = 0; 140 if (next_busno > 224) {
138 need_domain_info = 1; 141 next_busno = 0;
142 need_domain_info = 1;
143 }
139 } 144 }
140 continue; 145 continue;
141 146
@@ -164,7 +169,7 @@ static int pcibios_enable_resources(struct pci_dev *dev, int mask)
164 169
165 pci_read_config_word(dev, PCI_COMMAND, &cmd); 170 pci_read_config_word(dev, PCI_COMMAND, &cmd);
166 old_cmd = cmd; 171 old_cmd = cmd;
167 for(idx=0; idx<6; idx++) { 172 for (idx=0; idx < PCI_NUM_RESOURCES; idx++) {
168 /* Only set up the requested stuff */ 173 /* Only set up the requested stuff */
169 if (!(mask & (1<<idx))) 174 if (!(mask & (1<<idx)))
170 continue; 175 continue;
diff --git a/arch/mips/philips/pnx8550/common/Kconfig b/arch/mips/philips/pnx8550/common/Kconfig
new file mode 100644
index 000000000000..072572d173cc
--- /dev/null
+++ b/arch/mips/philips/pnx8550/common/Kconfig
@@ -0,0 +1 @@
# Place holder
diff --git a/arch/mips/philips/pnx8550/common/Makefile b/arch/mips/philips/pnx8550/common/Makefile
new file mode 100644
index 000000000000..6e38f3bc443c
--- /dev/null
+++ b/arch/mips/philips/pnx8550/common/Makefile
@@ -0,0 +1,27 @@
1#
2# Per Hallsmark, per.hallsmark@mvista.com
3#
4# ########################################################################
5#
6# This program is free software; you can distribute it and/or modify it
7# under the terms of the GNU General Public License (Version 2) as
8# published by the Free Software Foundation.
9#
10# This program is distributed in the hope it will be useful, but WITHOUT
11# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13# for more details.
14#
15# You should have received a copy of the GNU General Public License along
16# with this program; if not, write to the Free Software Foundation, Inc.,
17# 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
18#
19# #######################################################################
20#
21# Makefile for the PNX8550 specific kernel interface routines
22# under Linux.
23#
24
25obj-y := setup.o prom.o mipsIRQ.o int.o reset.o time.o proc.o platform.o
26obj-$(CONFIG_PCI) += pci.o
27obj-$(CONFIG_KGDB) += gdb_hook.o
diff --git a/arch/mips/philips/pnx8550/common/gdb_hook.c b/arch/mips/philips/pnx8550/common/gdb_hook.c
new file mode 100644
index 000000000000..ad4624f6d9bc
--- /dev/null
+++ b/arch/mips/philips/pnx8550/common/gdb_hook.c
@@ -0,0 +1,109 @@
1/*
2 * Carsten Langgaard, carstenl@mips.com
3 * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved.
4 *
5 * ########################################################################
6 *
7 * This program is free software; you can distribute it and/or modify it
8 * under the terms of the GNU General Public License (Version 2) as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
19 *
20 * ########################################################################
21 *
22 * This is the interface to the remote debugger stub.
23 *
24 */
25#include <linux/types.h>
26#include <linux/serial.h>
27#include <linux/serialP.h>
28#include <linux/serial_reg.h>
29#include <linux/serial_ip3106.h>
30
31#include <asm/serial.h>
32#include <asm/io.h>
33
34#include <uart.h>
35
36static struct serial_state rs_table[IP3106_NR_PORTS] = {
37};
38static struct async_struct kdb_port_info = {0};
39
40void rs_kgdb_hook(int tty_no)
41{
42 struct serial_state *ser = &rs_table[tty_no];
43
44 kdb_port_info.state = ser;
45 kdb_port_info.magic = SERIAL_MAGIC;
46 kdb_port_info.port = tty_no;
47 kdb_port_info.flags = ser->flags;
48
49 /*
50 * Clear all interrupts
51 */
52 /* Clear all the transmitter FIFO counters (pointer and status) */
53 ip3106_lcr(UART_BASE, tty_no) |= IP3106_UART_LCR_TX_RST;
54 /* Clear all the receiver FIFO counters (pointer and status) */
55 ip3106_lcr(UART_BASE, tty_no) |= IP3106_UART_LCR_RX_RST;
56 /* Clear all interrupts */
57 ip3106_iclr(UART_BASE, tty_no) = IP3106_UART_INT_ALLRX |
58 IP3106_UART_INT_ALLTX;
59
60 /*
61 * Now, initialize the UART
62 */
63 ip3106_lcr(UART_BASE, tty_no) = IP3106_UART_LCR_8BIT;
64 ip3106_baud(UART_BASE, tty_no) = 5; // 38400 Baud
65}
66
67int putDebugChar(char c)
68{
69 /* Wait until FIFO not full */
70 while (((ip3106_fifo(UART_BASE, kdb_port_info.port) & IP3106_UART_FIFO_TXFIFO) >> 16) >= 16)
71 ;
72 /* Send one char */
73 ip3106_fifo(UART_BASE, kdb_port_info.port) = c;
74
75 return 1;
76}
77
78char getDebugChar(void)
79{
80 char ch;
81
82 /* Wait until there is a char in the FIFO */
83 while (!((ip3106_fifo(UART_BASE, kdb_port_info.port) &
84 IP3106_UART_FIFO_RXFIFO) >> 8))
85 ;
86 /* Read one char */
87 ch = ip3106_fifo(UART_BASE, kdb_port_info.port) &
88 IP3106_UART_FIFO_RBRTHR;
89 /* Advance the RX FIFO read pointer */
90 ip3106_lcr(UART_BASE, kdb_port_info.port) |= IP3106_UART_LCR_RX_NEXT;
91 return (ch);
92}
93
94void rs_disable_debug_interrupts(void)
95{
96 ip3106_ien(UART_BASE, kdb_port_info.port) = 0; /* Disable all interrupts */
97}
98
99void rs_enable_debug_interrupts(void)
100{
101 /* Clear all the transmitter FIFO counters (pointer and status) */
102 ip3106_lcr(UART_BASE, kdb_port_info.port) |= IP3106_UART_LCR_TX_RST;
103 /* Clear all the receiver FIFO counters (pointer and status) */
104 ip3106_lcr(UART_BASE, kdb_port_info.port) |= IP3106_UART_LCR_RX_RST;
105 /* Clear all interrupts */
106 ip3106_iclr(UART_BASE, kdb_port_info.port) = IP3106_UART_INT_ALLRX |
107 IP3106_UART_INT_ALLTX;
108 ip3106_ien(UART_BASE, kdb_port_info.port) = IP3106_UART_INT_ALLRX; /* Enable RX interrupts */
109}
diff --git a/arch/mips/philips/pnx8550/common/int.c b/arch/mips/philips/pnx8550/common/int.c
new file mode 100644
index 000000000000..546144988bf5
--- /dev/null
+++ b/arch/mips/philips/pnx8550/common/int.c
@@ -0,0 +1,293 @@
1/*
2 *
3 * Copyright (C) 2005 Embedded Alley Solutions, Inc
4 * Ported to 2.6.
5 *
6 * Per Hallsmark, per.hallsmark@mvista.com
7 * Copyright (C) 2000, 2001 MIPS Technologies, Inc.
8 * Copyright (C) 2001 Ralf Baechle
9 *
10 * Cleaned up and bug fixing: Pete Popov, ppopov@embeddedalley.com
11 *
12 * This program is free software; you can distribute it and/or modify it
13 * under the terms of the GNU General Public License (Version 2) as
14 * published by the Free Software Foundation.
15 *
16 * This program is distributed in the hope it will be useful, but WITHOUT
17 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 * for more details.
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 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
24 *
25 */
26#include <linux/config.h>
27#include <linux/init.h>
28#include <linux/irq.h>
29#include <linux/sched.h>
30#include <linux/slab.h>
31#include <linux/interrupt.h>
32#include <linux/kernel_stat.h>
33#include <linux/random.h>
34#include <linux/module.h>
35
36#include <asm/io.h>
37#include <asm/gdb-stub.h>
38#include <int.h>
39#include <uart.h>
40
41extern asmlinkage void cp0_irqdispatch(void);
42
43static DEFINE_SPINLOCK(irq_lock);
44
45/* default prio for interrupts */
46/* first one is a no-no so therefore always prio 0 (disabled) */
47static char gic_prio[PNX8550_INT_GIC_TOTINT] = {
48 0, 1, 1, 1, 1, 15, 1, 1, 1, 1, // 0 - 9
49 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 10 - 19
50 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 20 - 29
51 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 30 - 39
52 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 40 - 49
53 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, // 50 - 59
54 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 60 - 69
55 1 // 70
56};
57
58void hw0_irqdispatch(int irq, struct pt_regs *regs)
59{
60 /* find out which interrupt */
61 irq = PNX8550_GIC_VECTOR_0 >> 3;
62
63 if (irq == 0) {
64 printk("hw0_irqdispatch: irq 0, spurious interrupt?\n");
65 return;
66 }
67 do_IRQ(PNX8550_INT_GIC_MIN + irq, regs);
68}
69
70
71void timer_irqdispatch(int irq, struct pt_regs *regs)
72{
73 irq = (0x01c0 & read_c0_config7()) >> 6;
74
75 if (irq == 0) {
76 printk("timer_irqdispatch: irq 0, spurious interrupt?\n");
77 return;
78 }
79
80 if (irq & 0x1) {
81 do_IRQ(PNX8550_INT_TIMER1, regs);
82 }
83 if (irq & 0x2) {
84 do_IRQ(PNX8550_INT_TIMER2, regs);
85 }
86 if (irq & 0x4) {
87 do_IRQ(PNX8550_INT_TIMER3, regs);
88 }
89}
90
91static inline void modify_cp0_intmask(unsigned clr_mask, unsigned set_mask)
92{
93 unsigned long status = read_c0_status();
94
95 status &= ~((clr_mask & 0xFF) << 8);
96 status |= (set_mask & 0xFF) << 8;
97
98 write_c0_status(status);
99}
100
101static inline void mask_gic_int(unsigned int irq_nr)
102{
103 /* interrupt disabled, bit 26(WE_ENABLE)=1 and bit 16(enable)=0 */
104 PNX8550_GIC_REQ(irq_nr) = 1<<28; /* set priority to 0 */
105}
106
107static inline void unmask_gic_int(unsigned int irq_nr)
108{
109 /* set prio mask to lower four bits and enable interrupt */
110 PNX8550_GIC_REQ(irq_nr) = (1<<26 | 1<<16) | (1<<28) | gic_prio[irq_nr];
111}
112
113static inline void mask_irq(unsigned int irq_nr)
114{
115 if ((PNX8550_INT_CP0_MIN <= irq_nr) && (irq_nr <= PNX8550_INT_CP0_MAX)) {
116 modify_cp0_intmask(1 << irq_nr, 0);
117 } else if ((PNX8550_INT_GIC_MIN <= irq_nr) &&
118 (irq_nr <= PNX8550_INT_GIC_MAX)) {
119 mask_gic_int(irq_nr - PNX8550_INT_GIC_MIN);
120 } else if ((PNX8550_INT_TIMER_MIN <= irq_nr) &&
121 (irq_nr <= PNX8550_INT_TIMER_MAX)) {
122 modify_cp0_intmask(1 << 7, 0);
123 } else {
124 printk("mask_irq: irq %d doesn't exist!\n", irq_nr);
125 }
126}
127
128static inline void unmask_irq(unsigned int irq_nr)
129{
130 if ((PNX8550_INT_CP0_MIN <= irq_nr) && (irq_nr <= PNX8550_INT_CP0_MAX)) {
131 modify_cp0_intmask(0, 1 << irq_nr);
132 } else if ((PNX8550_INT_GIC_MIN <= irq_nr) &&
133 (irq_nr <= PNX8550_INT_GIC_MAX)) {
134 unmask_gic_int(irq_nr - PNX8550_INT_GIC_MIN);
135 } else if ((PNX8550_INT_TIMER_MIN <= irq_nr) &&
136 (irq_nr <= PNX8550_INT_TIMER_MAX)) {
137 modify_cp0_intmask(0, 1 << 7);
138 } else {
139 printk("mask_irq: irq %d doesn't exist!\n", irq_nr);
140 }
141}
142
143#define pnx8550_disable pnx8550_ack
144static void pnx8550_ack(unsigned int irq)
145{
146 unsigned long flags;
147
148 spin_lock_irqsave(&irq_lock, flags);
149 mask_irq(irq);
150 spin_unlock_irqrestore(&irq_lock, flags);
151}
152
153#define pnx8550_enable pnx8550_unmask
154static void pnx8550_unmask(unsigned int irq)
155{
156 unsigned long flags;
157
158 spin_lock_irqsave(&irq_lock, flags);
159 unmask_irq(irq);
160 spin_unlock_irqrestore(&irq_lock, flags);
161}
162
163static unsigned int startup_irq(unsigned int irq_nr)
164{
165 pnx8550_unmask(irq_nr);
166 return 0;
167}
168
169static void shutdown_irq(unsigned int irq_nr)
170{
171 pnx8550_ack(irq_nr);
172 return;
173}
174
175int pnx8550_set_gic_priority(int irq, int priority)
176{
177 int gic_irq = irq-PNX8550_INT_GIC_MIN;
178 int prev_priority = PNX8550_GIC_REQ(gic_irq) & 0xf;
179
180 gic_prio[gic_irq] = priority;
181 PNX8550_GIC_REQ(gic_irq) |= (0x10000000 | gic_prio[gic_irq]);
182
183 return prev_priority;
184}
185
186static inline void mask_and_ack_level_irq(unsigned int irq)
187{
188 pnx8550_disable(irq);
189 return;
190}
191
192static void end_irq(unsigned int irq)
193{
194 if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) {
195 pnx8550_enable(irq);
196 }
197}
198
199static struct hw_interrupt_type level_irq_type = {
200 .typename = "PNX Level IRQ",
201 .startup = startup_irq,
202 .shutdown = shutdown_irq,
203 .enable = pnx8550_enable,
204 .disable = pnx8550_disable,
205 .ack = mask_and_ack_level_irq,
206 .end = end_irq,
207};
208
209static struct irqaction gic_action = {
210 .handler = no_action,
211 .flags = SA_INTERRUPT,
212 .name = "GIC",
213};
214
215static struct irqaction timer_action = {
216 .handler = no_action,
217 .flags = SA_INTERRUPT,
218 .name = "Timer",
219};
220
221void __init arch_init_irq(void)
222{
223 int i;
224 int configPR;
225
226 /* init of cp0 interrupts */
227 set_except_vector(0, cp0_irqdispatch);
228
229 for (i = 0; i < PNX8550_INT_CP0_TOTINT; i++) {
230 irq_desc[i].handler = &level_irq_type;
231 pnx8550_ack(i); /* mask the irq just in case */
232 }
233
234 /* init of GIC/IPC interrupts */
235 /* should be done before cp0 since cp0 init enables the GIC int */
236 for (i = PNX8550_INT_GIC_MIN; i <= PNX8550_INT_GIC_MAX; i++) {
237 int gic_int_line = i - PNX8550_INT_GIC_MIN;
238 if (gic_int_line == 0 )
239 continue; // don't fiddle with int 0
240 /*
241 * enable change of TARGET, ENABLE and ACTIVE_LOW bits
242 * set TARGET 0 to route through hw0 interrupt
243 * set ACTIVE_LOW 0 active high (correct?)
244 *
245 * We really should setup an interrupt description table
246 * to do this nicely.
247 * Note, PCI INTA is active low on the bus, but inverted
248 * in the GIC, so to us it's active high.
249 */
250#ifdef CONFIG_PNX8550_V2PCI
251 if (gic_int_line == (PNX8550_INT_GPIO0 - PNX8550_INT_GIC_MIN)) {
252 /* PCI INT through gpio 8, which is setup in
253 * pnx8550_setup.c and routed to GPIO
254 * Interrupt Level 0 (GPIO Connection 58).
255 * Set it active low. */
256
257 PNX8550_GIC_REQ(gic_int_line) = 0x1E020000;
258 } else
259#endif
260 {
261 PNX8550_GIC_REQ(i - PNX8550_INT_GIC_MIN) = 0x1E000000;
262 }
263
264 /* mask/priority is still 0 so we will not get any
265 * interrupts until it is unmasked */
266
267 irq_desc[i].handler = &level_irq_type;
268 }
269
270 /* Priority level 0 */
271 PNX8550_GIC_PRIMASK_0 = PNX8550_GIC_PRIMASK_1 = 0;
272
273 /* Set int vector table address */
274 PNX8550_GIC_VECTOR_0 = PNX8550_GIC_VECTOR_1 = 0;
275
276 irq_desc[MIPS_CPU_GIC_IRQ].handler = &level_irq_type;
277 setup_irq(MIPS_CPU_GIC_IRQ, &gic_action);
278
279 /* init of Timer interrupts */
280 for (i = PNX8550_INT_TIMER_MIN; i <= PNX8550_INT_TIMER_MAX; i++) {
281 irq_desc[i].handler = &level_irq_type;
282 }
283
284 /* Stop Timer 1-3 */
285 configPR = read_c0_config7();
286 configPR |= 0x00000038;
287 write_c0_config7(configPR);
288
289 irq_desc[MIPS_CPU_TIMER_IRQ].handler = &level_irq_type;
290 setup_irq(MIPS_CPU_TIMER_IRQ, &timer_action);
291}
292
293EXPORT_SYMBOL(pnx8550_set_gic_priority);
diff --git a/arch/mips/philips/pnx8550/common/mipsIRQ.S b/arch/mips/philips/pnx8550/common/mipsIRQ.S
new file mode 100644
index 000000000000..338bffda3fab
--- /dev/null
+++ b/arch/mips/philips/pnx8550/common/mipsIRQ.S
@@ -0,0 +1,76 @@
1/*
2 * Copyright (c) 2002 Philips, Inc. All rights.
3 * Copyright (c) 2002 Red Hat, Inc. All rights.
4 *
5 * This software may be freely redistributed under the terms of the
6 * GNU General Public License.
7 *
8 * You should have received a copy of the GNU General Public License
9 * along with this program; if not, write to the Free Software
10 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
11 *
12 * Based upon arch/mips/galileo-boards/ev64240/int-handler.S
13 *
14 */
15#include <asm/asm.h>
16#include <asm/mipsregs.h>
17#include <asm/addrspace.h>
18#include <asm/regdef.h>
19#include <asm/stackframe.h>
20
21/*
22 * cp0_irqdispatch
23 *
24 * Code to handle in-core interrupt exception.
25 */
26
27 .align 5
28 .set reorder
29 .set noat
30 NESTED(cp0_irqdispatch, PT_SIZE, sp)
31 SAVE_ALL
32 CLI
33 .set at
34 mfc0 t0,CP0_CAUSE
35 mfc0 t2,CP0_STATUS
36
37 and t0,t2
38
39 andi t1,t0,STATUSF_IP2 /* int0 hardware line */
40 bnez t1,ll_hw0_irq
41 nop
42
43 andi t1,t0,STATUSF_IP7 /* int5 hardware line */
44 bnez t1,ll_timer_irq
45 nop
46
47 /* wrong alarm or masked ... */
48
49 j spurious_interrupt
50 nop
51 END(cp0_irqdispatch)
52
53 .align 5
54 .set reorder
55ll_hw0_irq:
56 li a0,2
57 move a1,sp
58 jal hw0_irqdispatch
59 nop
60 j ret_from_irq
61 nop
62
63 .align 5
64 .set reorder
65ll_timer_irq:
66 mfc0 t3,CP0_CONFIG,7
67 andi t4,t3,0x01c0
68 beqz t4,ll_timer_out
69 nop
70 li a0,7
71 move a1,sp
72 jal timer_irqdispatch
73 nop
74
75ll_timer_out: j ret_from_irq
76 nop
diff --git a/arch/mips/philips/pnx8550/common/pci.c b/arch/mips/philips/pnx8550/common/pci.c
new file mode 100644
index 000000000000..baa6905f649f
--- /dev/null
+++ b/arch/mips/philips/pnx8550/common/pci.c
@@ -0,0 +1,133 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 *
5 * Author: source@mvista.com
6 *
7 * This program is free software; you can distribute it and/or modify it
8 * under the terms of the GNU General Public License (Version 2) as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
19 */
20#include <linux/types.h>
21#include <linux/pci.h>
22#include <linux/kernel.h>
23#include <linux/init.h>
24
25#include <pci.h>
26#include <glb.h>
27#include <nand.h>
28
29static struct resource pci_io_resource = {
30 "pci IO space",
31 (u32)(PNX8550_PCIIO + 0x1000), /* reserve regacy I/O space */
32 (u32)(PNX8550_PCIIO + PNX8550_PCIIO_SIZE),
33 IORESOURCE_IO
34};
35
36static struct resource pci_mem_resource = {
37 "pci memory space",
38 (u32)(PNX8550_PCIMEM),
39 (u32)(PNX8550_PCIMEM + PNX8550_PCIMEM_SIZE - 1),
40 IORESOURCE_MEM
41};
42
43extern struct pci_ops pnx8550_pci_ops;
44
45static struct pci_controller pnx8550_controller = {
46 .pci_ops = &pnx8550_pci_ops,
47 .io_resource = &pci_io_resource,
48 .mem_resource = &pci_mem_resource,
49};
50
51/* Return the total size of DRAM-memory, (RANK0 + RANK1) */
52static inline unsigned long get_system_mem_size(void)
53{
54 /* Read IP2031_RANK0_ADDR_LO */
55 unsigned long dram_r0_lo = inl(PCI_BASE | 0x65010);
56 /* Read IP2031_RANK1_ADDR_HI */
57 unsigned long dram_r1_hi = inl(PCI_BASE | 0x65018);
58
59 return dram_r1_hi - dram_r0_lo + 1;
60}
61
62static int __init pnx8550_pci_setup(void)
63{
64 int pci_mem_code;
65 int mem_size = get_system_mem_size() >> 20;
66
67 /* Clear the Global 2 Register, PCI Inta Output Enable Registers
68 Bit 1:Enable DAC Powerdown
69 -> 0:DACs are enabled and are working normally
70 1:DACs are powerdown
71 Bit 0:Enable of PCI inta output
72 -> 0 = Disable PCI inta output
73 1 = Enable PCI inta output
74 */
75 PNX8550_GLB2_ENAB_INTA_O = 0;
76
77 /* Calc the PCI mem size code */
78 if (mem_size >= 128)
79 pci_mem_code = SIZE_128M;
80 else if (mem_size >= 64)
81 pci_mem_code = SIZE_64M;
82 else if (mem_size >= 32)
83 pci_mem_code = SIZE_32M;
84 else
85 pci_mem_code = SIZE_16M;
86
87 /* Set PCI_XIO registers */
88 outl(pci_mem_resource.start, PCI_BASE | PCI_BASE1_LO);
89 outl(pci_mem_resource.end + 1, PCI_BASE | PCI_BASE1_HI);
90 outl(pci_io_resource.start, PCI_BASE | PCI_BASE2_LO);
91 outl(pci_io_resource.end, PCI_BASE | PCI_BASE2_HI);
92
93 /* Send memory transaction via PCI_BASE2 */
94 outl(0x00000001, PCI_BASE | PCI_IO);
95
96 /* Unlock the setup register */
97 outl(0xca, PCI_BASE | PCI_UNLOCKREG);
98
99 /*
100 * BAR0 of PNX8550 (pci base 10) must be zero in order for ide
101 * to work, and in order for bus_to_baddr to work without any
102 * hacks.
103 */
104 outl(0x00000000, PCI_BASE | PCI_BASE10);
105
106 /*
107 *These two bars are set by default or the boot code.
108 * However, it's safer to set them here so we're not boot
109 * code dependent.
110 */
111 outl(0x1be00000, PCI_BASE | PCI_BASE14); /* PNX MMIO */
112 outl(PNX8550_NAND_BASE_ADDR, PCI_BASE | PCI_BASE18); /* XIO */
113
114 outl(PCI_EN_TA |
115 PCI_EN_PCI2MMI |
116 PCI_EN_XIO |
117 PCI_SETUP_BASE18_SIZE(SIZE_32M) |
118 PCI_SETUP_BASE18_EN |
119 PCI_SETUP_BASE14_EN |
120 PCI_SETUP_BASE10_PREF |
121 PCI_SETUP_BASE10_SIZE(pci_mem_code) |
122 PCI_SETUP_CFGMANAGE_EN |
123 PCI_SETUP_PCIARB_EN,
124 PCI_BASE |
125 PCI_SETUP); /* PCI_SETUP */
126 outl(0x00000000, PCI_BASE | PCI_CTRL); /* PCI_CONTROL */
127
128 register_pci_controller(&pnx8550_controller);
129
130 return 0;
131}
132
133arch_initcall(pnx8550_pci_setup);
diff --git a/arch/mips/philips/pnx8550/common/platform.c b/arch/mips/philips/pnx8550/common/platform.c
new file mode 100644
index 000000000000..8aa9bd65b45e
--- /dev/null
+++ b/arch/mips/philips/pnx8550/common/platform.c
@@ -0,0 +1,135 @@
1/*
2 * Platform device support for Philips PNX8550 SoCs
3 *
4 * Copyright 2005, Embedded Alley Solutions, Inc
5 *
6 * Based on arch/mips/au1000/common/platform.c
7 * Platform device support for Au1x00 SoCs.
8 *
9 * Copyright 2004, Matt Porter <mporter@kernel.crashing.org>
10 *
11 * This file is licensed under the terms of the GNU General Public
12 * License version 2. This program is licensed "as is" without any
13 * warranty of any kind, whether express or implied.
14 */
15#include <linux/device.h>
16#include <linux/kernel.h>
17#include <linux/init.h>
18#include <linux/resource.h>
19#include <linux/serial.h>
20#include <linux/serial_ip3106.h>
21
22#include <int.h>
23#include <usb.h>
24#include <uart.h>
25
26extern struct uart_ops ip3106_pops;
27
28static struct resource pnx8550_usb_ohci_resources[] = {
29 [0] = {
30 .start = PNX8550_USB_OHCI_OP_BASE,
31 .end = PNX8550_USB_OHCI_OP_BASE +
32 PNX8550_USB_OHCI_OP_LEN,
33 .flags = IORESOURCE_MEM,
34 },
35 [1] = {
36 .start = PNX8550_INT_USB,
37 .end = PNX8550_INT_USB,
38 .flags = IORESOURCE_IRQ,
39 },
40};
41
42static struct resource pnx8550_uart_resources[] = {
43 [0] = {
44 .start = PNX8550_UART_PORT0,
45 .end = PNX8550_UART_PORT0 + 0xfff,
46 .flags = IORESOURCE_MEM,
47 },
48 [1] = {
49 .start = PNX8550_UART_INT(0),
50 .end = PNX8550_UART_INT(0),
51 .flags = IORESOURCE_IRQ,
52 },
53 [2] = {
54 .start = PNX8550_UART_PORT1,
55 .end = PNX8550_UART_PORT1 + 0xfff,
56 .flags = IORESOURCE_MEM,
57 },
58 [3] = {
59 .start = PNX8550_UART_INT(1),
60 .end = PNX8550_UART_INT(1),
61 .flags = IORESOURCE_IRQ,
62 },
63};
64
65struct ip3106_port ip3106_ports[] = {
66 [0] = {
67 .port = {
68 .type = PORT_IP3106,
69 .iotype = SERIAL_IO_MEM,
70 .membase = (void __iomem *)PNX8550_UART_PORT0,
71 .mapbase = PNX8550_UART_PORT0,
72 .irq = PNX8550_UART_INT(0),
73 .uartclk = 3692300,
74 .fifosize = 16,
75 .ops = &ip3106_pops,
76 .flags = ASYNC_BOOT_AUTOCONF,
77 .line = 0,
78 },
79 },
80 [1] = {
81 .port = {
82 .type = PORT_IP3106,
83 .iotype = SERIAL_IO_MEM,
84 .membase = (void __iomem *)PNX8550_UART_PORT1,
85 .mapbase = PNX8550_UART_PORT1,
86 .irq = PNX8550_UART_INT(1),
87 .uartclk = 3692300,
88 .fifosize = 16,
89 .ops = &ip3106_pops,
90 .flags = ASYNC_BOOT_AUTOCONF,
91 .line = 1,
92 },
93 },
94};
95
96/* The dmamask must be set for OHCI to work */
97static u64 ohci_dmamask = ~(u32)0;
98
99static u64 uart_dmamask = ~(u32)0;
100
101static struct platform_device pnx8550_usb_ohci_device = {
102 .name = "pnx8550-ohci",
103 .id = -1,
104 .dev = {
105 .dma_mask = &ohci_dmamask,
106 .coherent_dma_mask = 0xffffffff,
107 },
108 .num_resources = ARRAY_SIZE(pnx8550_usb_ohci_resources),
109 .resource = pnx8550_usb_ohci_resources,
110};
111
112static struct platform_device pnx8550_uart_device = {
113 .name = "ip3106-uart",
114 .id = -1,
115 .dev = {
116 .dma_mask = &uart_dmamask,
117 .coherent_dma_mask = 0xffffffff,
118 .platform_data = ip3106_ports,
119 },
120 .num_resources = ARRAY_SIZE(pnx8550_uart_resources),
121 .resource = pnx8550_uart_resources,
122};
123
124static struct platform_device *pnx8550_platform_devices[] __initdata = {
125 &pnx8550_usb_ohci_device,
126 &pnx8550_uart_device,
127};
128
129int pnx8550_platform_init(void)
130{
131 return platform_add_devices(pnx8550_platform_devices,
132 ARRAY_SIZE(pnx8550_platform_devices));
133}
134
135arch_initcall(pnx8550_platform_init);
diff --git a/arch/mips/philips/pnx8550/common/proc.c b/arch/mips/philips/pnx8550/common/proc.c
new file mode 100644
index 000000000000..72a016767e09
--- /dev/null
+++ b/arch/mips/philips/pnx8550/common/proc.c
@@ -0,0 +1,113 @@
1/*
2 * This program is free software; you can distribute it and/or modify it
3 * under the terms of the GNU General Public License (Version 2) as
4 * published by the Free Software Foundation.
5 *
6 * This program is distributed in the hope it will be useful, but WITHOUT
7 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
9 * for more details.
10 *
11 * You should have received a copy of the GNU General Public License along
12 * with this program; if not, write to the Free Software Foundation, Inc.,
13 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
14 */
15#include <linux/init.h>
16#include <linux/proc_fs.h>
17#include <linux/irq.h>
18#include <linux/sched.h>
19#include <linux/slab.h>
20#include <linux/interrupt.h>
21#include <linux/kernel_stat.h>
22#include <linux/random.h>
23
24#include <asm/io.h>
25#include <asm/gdb-stub.h>
26#include <int.h>
27#include <uart.h>
28
29
30static int pnx8550_timers_read (char* page, char** start, off_t offset, int count, int* eof, void* data)
31{
32 int len = 0;
33 int configPR = read_c0_config7();
34
35 if (offset==0) {
36 len += sprintf(&page[len],"Timer: count, compare, tc, status\n");
37 len += sprintf(&page[len]," 1: %11i, %8i, %1i, %s\n",
38 read_c0_count(), read_c0_compare(),
39 (configPR>>6)&0x1, ((configPR>>3)&0x1)? "off":"on");
40 len += sprintf(&page[len]," 2: %11i, %8i, %1i, %s\n",
41 read_c0_count2(), read_c0_compare2(),
42 (configPR>>7)&0x1, ((configPR>>4)&0x1)? "off":"on");
43 len += sprintf(&page[len]," 3: %11i, %8i, %1i, %s\n",
44 read_c0_count3(), read_c0_compare3(),
45 (configPR>>8)&0x1, ((configPR>>5)&0x1)? "off":"on");
46 }
47
48 return len;
49}
50
51static int pnx8550_registers_read (char* page, char** start, off_t offset, int count, int* eof, void* data)
52{
53 int len = 0;
54
55 if (offset==0) {
56 len += sprintf(&page[len],"config1: %#10.8x\n",read_c0_config1());
57 len += sprintf(&page[len],"config2: %#10.8x\n",read_c0_config2());
58 len += sprintf(&page[len],"config3: %#10.8x\n",read_c0_config3());
59 len += sprintf(&page[len],"configPR: %#10.8x\n",read_c0_config7());
60 len += sprintf(&page[len],"status: %#10.8x\n",read_c0_status());
61 len += sprintf(&page[len],"cause: %#10.8x\n",read_c0_cause());
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());
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());
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());
68 }
69
70 return len;
71}
72
73static struct proc_dir_entry* pnx8550_dir = NULL;
74static struct proc_dir_entry* pnx8550_timers = NULL;
75static struct proc_dir_entry* pnx8550_registers = NULL;
76
77static int pnx8550_proc_init( void )
78{
79
80 // Create /proc/pnx8550
81 pnx8550_dir = create_proc_entry("pnx8550", S_IFDIR|S_IRUGO, NULL);
82 if (pnx8550_dir){
83 pnx8550_dir->nlink = 1;
84 }
85 else {
86 printk(KERN_ERR "Can't create pnx8550 proc dir\n");
87 return -1;
88 }
89
90 // Create /proc/pnx8550/timers
91 pnx8550_timers = create_proc_entry("timers", S_IFREG|S_IRUGO, pnx8550_dir );
92 if (pnx8550_timers){
93 pnx8550_timers->nlink = 1;
94 pnx8550_timers->read_proc = pnx8550_timers_read;
95 }
96 else {
97 printk(KERN_ERR "Can't create pnx8550 timers proc file\n");
98 }
99
100 // Create /proc/pnx8550/registers
101 pnx8550_registers = create_proc_entry("registers", S_IFREG|S_IRUGO, pnx8550_dir );
102 if (pnx8550_registers){
103 pnx8550_registers->nlink = 1;
104 pnx8550_registers->read_proc = pnx8550_registers_read;
105 }
106 else {
107 printk(KERN_ERR "Can't create pnx8550 registers proc file\n");
108 }
109
110 return 0;
111}
112
113__initcall(pnx8550_proc_init);
diff --git a/arch/mips/philips/pnx8550/common/prom.c b/arch/mips/philips/pnx8550/common/prom.c
new file mode 100644
index 000000000000..70aac9759412
--- /dev/null
+++ b/arch/mips/philips/pnx8550/common/prom.c
@@ -0,0 +1,138 @@
1/*
2 *
3 * Per Hallsmark, per.hallsmark@mvista.com
4 *
5 * Based on jmr3927/common/prom.c
6 *
7 * 2004 (c) MontaVista Software, Inc. This file is licensed under the
8 * terms of the GNU General Public License version 2. This program is
9 * licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 */
12#include <linux/module.h>
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/string.h>
16#include <linux/serial_ip3106.h>
17
18#include <asm/bootinfo.h>
19#include <uart.h>
20
21/* #define DEBUG_CMDLINE */
22
23extern int prom_argc;
24extern char **prom_argv, **prom_envp;
25
26typedef struct
27{
28 char *name;
29/* char *val; */
30}t_env_var;
31
32
33char * prom_getcmdline(void)
34{
35 return &(arcs_cmdline[0]);
36}
37
38void prom_init_cmdline(void)
39{
40 char *cp;
41 int actr;
42
43 actr = 1; /* Always ignore argv[0] */
44
45 cp = &(arcs_cmdline[0]);
46 while(actr < prom_argc) {
47 strcpy(cp, prom_argv[actr]);
48 cp += strlen(prom_argv[actr]);
49 *cp++ = ' ';
50 actr++;
51 }
52 if (cp != &(arcs_cmdline[0])) /* get rid of trailing space */
53 --cp;
54 *cp = '\0';
55}
56
57char *prom_getenv(char *envname)
58{
59 /*
60 * Return a pointer to the given environment variable.
61 * Environment variables are stored in the form of "memsize=64".
62 */
63
64 t_env_var *env = (t_env_var *)prom_envp;
65 int i;
66
67 i = strlen(envname);
68
69 while(env->name) {
70 if(strncmp(envname, env->name, i) == 0) {
71 return(env->name + strlen(envname) + 1);
72 }
73 env++;
74 }
75 return(NULL);
76}
77
78inline unsigned char str2hexnum(unsigned char c)
79{
80 if(c >= '0' && c <= '9')
81 return c - '0';
82 if(c >= 'a' && c <= 'f')
83 return c - 'a' + 10;
84 if(c >= 'A' && c <= 'F')
85 return c - 'A' + 10;
86 return 0; /* foo */
87}
88
89inline void str2eaddr(unsigned char *ea, unsigned char *str)
90{
91 int i;
92
93 for(i = 0; i < 6; i++) {
94 unsigned char num;
95
96 if((*str == '.') || (*str == ':'))
97 str++;
98 num = str2hexnum(*str++) << 4;
99 num |= (str2hexnum(*str++));
100 ea[i] = num;
101 }
102}
103
104int get_ethernet_addr(char *ethernet_addr)
105{
106 char *ethaddr_str;
107
108 ethaddr_str = prom_getenv("ethaddr");
109 if (!ethaddr_str) {
110 printk("ethaddr not set in boot prom\n");
111 return -1;
112 }
113 str2eaddr(ethernet_addr, ethaddr_str);
114 return 0;
115}
116
117unsigned long __init prom_free_prom_memory(void)
118{
119 return 0;
120}
121
122extern int pnx8550_console_port;
123
124/* used by prom_printf */
125void prom_putchar(char c)
126{
127 if (pnx8550_console_port != -1) {
128 /* Wait until FIFO not full */
129 while( ((ip3106_fifo(UART_BASE, pnx8550_console_port) & IP3106_UART_FIFO_TXFIFO) >> 16) >= 16)
130 ;
131 /* Send one char */
132 ip3106_fifo(UART_BASE, pnx8550_console_port) = c;
133 }
134}
135
136EXPORT_SYMBOL(prom_getcmdline);
137EXPORT_SYMBOL(get_ethernet_addr);
138EXPORT_SYMBOL(str2eaddr);
diff --git a/arch/mips/philips/pnx8550/common/reset.c b/arch/mips/philips/pnx8550/common/reset.c
new file mode 100644
index 000000000000..7b2cbc5b2c7c
--- /dev/null
+++ b/arch/mips/philips/pnx8550/common/reset.c
@@ -0,0 +1,49 @@
1/*.
2 *
3 * ########################################################################
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 * ########################################################################
19 *
20 * Reset the PNX8550 board.
21 *
22 */
23#include <linux/slab.h>
24#include <asm/reboot.h>
25#include <glb.h>
26
27void pnx8550_machine_restart(char *command)
28{
29 char head[] = "************* Machine restart *************";
30 char foot[] = "*******************************************";
31
32 printk("\n\n");
33 printk("%s\n", head);
34 if (command != NULL)
35 printk("* %s\n", command);
36 printk("%s\n", foot);
37
38 PNX8550_RST_CTL = PNX8550_RST_DO_SW_RST;
39}
40
41void pnx8550_machine_halt(void)
42{
43 printk("*** Machine halt. (Not implemented) ***\n");
44}
45
46void pnx8550_machine_power_off(void)
47{
48 printk("*** Machine power off. (Not implemented) ***\n");
49}
diff --git a/arch/mips/philips/pnx8550/common/setup.c b/arch/mips/philips/pnx8550/common/setup.c
new file mode 100644
index 000000000000..ee6bf72094f6
--- /dev/null
+++ b/arch/mips/philips/pnx8550/common/setup.c
@@ -0,0 +1,149 @@
1/*
2 *
3 * 2.6 port, Embedded Alley Solutions, Inc
4 *
5 * Based on Per Hallsmark, per.hallsmark@mvista.com
6 *
7 * This program is free software; you can distribute it and/or modify it
8 * under the terms of the GNU General Public License (Version 2) as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
19 */
20#include <linux/config.h>
21#include <linux/init.h>
22#include <linux/sched.h>
23#include <linux/ioport.h>
24#include <linux/mm.h>
25#include <linux/delay.h>
26#include <linux/interrupt.h>
27#include <linux/serial_ip3106.h>
28
29#include <asm/cpu.h>
30#include <asm/bootinfo.h>
31#include <asm/irq.h>
32#include <asm/mipsregs.h>
33#include <asm/reboot.h>
34#include <asm/pgtable.h>
35#include <asm/time.h>
36
37#include <glb.h>
38#include <int.h>
39#include <pci.h>
40#include <uart.h>
41#include <nand.h>
42
43extern void prom_printf(char *fmt, ...);
44
45extern void __init board_setup(void);
46extern void pnx8550_machine_restart(char *);
47extern void pnx8550_machine_halt(void);
48extern void pnx8550_machine_power_off(void);
49extern struct resource ioport_resource;
50extern struct resource iomem_resource;
51extern void (*board_time_init)(void);
52extern void pnx8550_time_init(void);
53extern void (*board_timer_setup)(struct irqaction *irq);
54extern void pnx8550_timer_setup(struct irqaction *irq);
55extern void rs_kgdb_hook(int tty_no);
56extern void prom_printf(char *fmt, ...);
57extern char *prom_getcmdline(void);
58
59struct resource standard_io_resources[] = {
60 {"dma1", 0x00, 0x1f, IORESOURCE_BUSY},
61 {"timer", 0x40, 0x5f, IORESOURCE_BUSY},
62 {"dma page reg", 0x80, 0x8f, IORESOURCE_BUSY},
63 {"dma2", 0xc0, 0xdf, IORESOURCE_BUSY},
64};
65
66#define STANDARD_IO_RESOURCES (sizeof(standard_io_resources)/sizeof(struct resource))
67
68extern struct resource pci_io_resource;
69extern struct resource pci_mem_resource;
70
71/* Return the total size of DRAM-memory, (RANK0 + RANK1) */
72unsigned long get_system_mem_size(void)
73{
74 /* Read IP2031_RANK0_ADDR_LO */
75 unsigned long dram_r0_lo = inl(PCI_BASE | 0x65010);
76 /* Read IP2031_RANK1_ADDR_HI */
77 unsigned long dram_r1_hi = inl(PCI_BASE | 0x65018);
78
79 return dram_r1_hi - dram_r0_lo + 1;
80}
81
82int pnx8550_console_port = -1;
83
84void __init plat_setup(void)
85{
86 int i;
87 char* argptr;
88
89 board_setup(); /* board specific setup */
90
91 _machine_restart = pnx8550_machine_restart;
92 _machine_halt = pnx8550_machine_halt;
93 _machine_power_off = pnx8550_machine_power_off;
94
95 board_time_init = pnx8550_time_init;
96 board_timer_setup = pnx8550_timer_setup;
97
98 /* Clear the Global 2 Register, PCI Inta Output Enable Registers
99 Bit 1:Enable DAC Powerdown
100 -> 0:DACs are enabled and are working normally
101 1:DACs are powerdown
102 Bit 0:Enable of PCI inta output
103 -> 0 = Disable PCI inta output
104 1 = Enable PCI inta output
105 */
106 PNX8550_GLB2_ENAB_INTA_O = 0;
107
108 /* IO/MEM resources. */
109 set_io_port_base(KSEG1);
110 ioport_resource.start = 0;
111 ioport_resource.end = ~0;
112 iomem_resource.start = 0;
113 iomem_resource.end = ~0;
114
115 /* Request I/O space for devices on this board */
116 for (i = 0; i < STANDARD_IO_RESOURCES; i++)
117 request_resource(&ioport_resource, standard_io_resources + i);
118
119 /* Place the Mode Control bit for GPIO pin 16 in primary function */
120 /* Pin 16 is used by UART1, UA1_TX */
121 outl((PNX8550_GPIO_MODE_PRIMOP << PNX8550_GPIO_MC_16_BIT) |
122 (PNX8550_GPIO_MODE_PRIMOP << PNX8550_GPIO_MC_17_BIT),
123 PNX8550_GPIO_MC1);
124
125 argptr = prom_getcmdline();
126 if ((argptr = strstr(argptr, "console=ttyS")) != NULL) {
127 argptr += strlen("console=ttyS");
128 pnx8550_console_port = *argptr == '0' ? 0 : 1;
129
130 /* We must initialize the UART (console) before prom_printf */
131 /* Set LCR to 8-bit and BAUD to 38400 (no 5) */
132 ip3106_lcr(UART_BASE, pnx8550_console_port) =
133 IP3106_UART_LCR_8BIT;
134 ip3106_baud(UART_BASE, pnx8550_console_port) = 5;
135 }
136
137#ifdef CONFIG_KGDB
138 argptr = prom_getcmdline();
139 if ((argptr = strstr(argptr, "kgdb=ttyS")) != NULL) {
140 int line;
141 argptr += strlen("kgdb=ttyS");
142 line = *argptr == '0' ? 0 : 1;
143 rs_kgdb_hook(line);
144 prom_printf("KGDB: Using ttyS%i for session, "
145 "please connect your debugger\n", line ? 1 : 0);
146 }
147#endif
148 return;
149}
diff --git a/arch/mips/philips/pnx8550/common/time.c b/arch/mips/philips/pnx8550/common/time.c
new file mode 100644
index 000000000000..70664ea96b92
--- /dev/null
+++ b/arch/mips/philips/pnx8550/common/time.c
@@ -0,0 +1,105 @@
1/*
2 * Copyright 2001, 2002, 2003 MontaVista Software Inc.
3 * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
4 *
5 * Common time service routines for MIPS machines. See
6 * Documents/MIPS/README.txt.
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/types.h>
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/sched.h>
17#include <linux/param.h>
18#include <linux/time.h>
19#include <linux/timer.h>
20#include <linux/smp.h>
21#include <linux/kernel_stat.h>
22#include <linux/spinlock.h>
23#include <linux/interrupt.h>
24#include <linux/module.h>
25
26#include <asm/bootinfo.h>
27#include <asm/cpu.h>
28#include <asm/time.h>
29#include <asm/hardirq.h>
30#include <asm/div64.h>
31#include <asm/debug.h>
32
33#include <int.h>
34#include <cm.h>
35
36extern unsigned int mips_hpt_frequency;
37
38/*
39 * pnx8550_time_init() - it does the following things:
40 *
41 * 1) board_time_init() -
42 * a) (optional) set up RTC routines,
43 * b) (optional) calibrate and set the mips_hpt_frequency
44 * (only needed if you intended to use fixed_rate_gettimeoffset
45 * or use cpu counter as timer interrupt source)
46 */
47
48void pnx8550_time_init(void)
49{
50 unsigned int n;
51 unsigned int m;
52 unsigned int p;
53 unsigned int pow2p;
54
55 /* PLL0 sets MIPS clock (PLL1 <=> TM1, PLL6 <=> TM2, PLL5 <=> mem) */
56 /* (but only if CLK_MIPS_CTL select value [bits 3:1] is 1: FIXME) */
57
58 n = (PNX8550_CM_PLL0_CTL & PNX8550_CM_PLL_N_MASK) >> 16;
59 m = (PNX8550_CM_PLL0_CTL & PNX8550_CM_PLL_M_MASK) >> 8;
60 p = (PNX8550_CM_PLL0_CTL & PNX8550_CM_PLL_P_MASK) >> 2;
61 pow2p = (1 << p);
62
63 db_assert(m != 0 && pow2p != 0);
64
65 /*
66 * Compute the frequency as in the PNX8550 User Manual 1.0, p.186
67 * (a.k.a. 8-10). Divide by HZ for a timer offset that results in
68 * HZ timer interrupts per second.
69 */
70 mips_hpt_frequency = 27UL * ((1000000UL * n)/(m * pow2p));
71}
72
73/*
74 * pnx8550_timer_setup() - it does the following things:
75 *
76 * 5) board_timer_setup() -
77 * a) (optional) over-write any choices made above by time_init().
78 * b) machine specific code should setup the timer irqaction.
79 * c) enable the timer interrupt
80 */
81
82void __init pnx8550_timer_setup(struct irqaction *irq)
83{
84 int configPR;
85
86 setup_irq(PNX8550_INT_TIMER1, irq);
87
88 /* Start timer1 */
89 configPR = read_c0_config7();
90 configPR &= ~0x00000008;
91 write_c0_config7(configPR);
92
93 /* Timer 2 stop */
94 configPR = read_c0_config7();
95 configPR |= 0x00000010;
96 write_c0_config7(configPR);
97
98 write_c0_count2(0);
99 write_c0_compare2(0xffffffff);
100
101 /* Timer 3 stop */
102 configPR = read_c0_config7();
103 configPR |= 0x00000020;
104 write_c0_config7(configPR);
105}
diff --git a/arch/mips/philips/pnx8550/jbs/Makefile b/arch/mips/philips/pnx8550/jbs/Makefile
new file mode 100644
index 000000000000..e8228dbca8f6
--- /dev/null
+++ b/arch/mips/philips/pnx8550/jbs/Makefile
@@ -0,0 +1,4 @@
1
2# Makefile for the Philips JBS Board.
3
4lib-y := init.o board_setup.o irqmap.o
diff --git a/arch/mips/philips/pnx8550/jbs/board_setup.c b/arch/mips/philips/pnx8550/jbs/board_setup.c
new file mode 100644
index 000000000000..f92826e0096d
--- /dev/null
+++ b/arch/mips/philips/pnx8550/jbs/board_setup.c
@@ -0,0 +1,65 @@
1/*
2 * JBS Specific board startup routines.
3 *
4 * Copyright 2005, Embedded Alley Solutions, 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 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
12 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
14 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
15 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
16 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
17 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
18 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
19 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
20 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21 *
22 * You should have received a copy of the GNU General Public License along
23 * with this program; if not, write to the Free Software Foundation, Inc.,
24 * 675 Mass Ave, Cambridge, MA 02139, USA.
25 */
26#include <linux/init.h>
27#include <linux/sched.h>
28#include <linux/ioport.h>
29#include <linux/mm.h>
30#include <linux/console.h>
31#include <linux/mc146818rtc.h>
32#include <linux/delay.h>
33
34#include <asm/cpu.h>
35#include <asm/bootinfo.h>
36#include <asm/irq.h>
37#include <asm/mipsregs.h>
38#include <asm/reboot.h>
39#include <asm/pgtable.h>
40
41#include <glb.h>
42
43/* CP0 hazard avoidance. */
44#define BARRIER __asm__ __volatile__(".set noreorder\n\t" \
45 "nop; nop; nop; nop; nop; nop;\n\t" \
46 ".set reorder\n\t")
47
48void __init board_setup(void)
49{
50 unsigned long config0, configpr;
51
52 config0 = read_c0_config();
53
54 /* clear all three cache coherency fields */
55 config0 &= ~(0x7 | (7<<25) | (7<<28));
56 config0 |= (CONF_CM_DEFAULT | (CONF_CM_DEFAULT<<25) |
57 (CONF_CM_DEFAULT<<28));
58 write_c0_config(config0);
59 BARRIER;
60
61 configpr = read_c0_config7();
62 configpr |= (1<<19); /* enable tlb */
63 write_c0_config7(configpr);
64 BARRIER;
65}
diff --git a/arch/mips/philips/pnx8550/jbs/init.c b/arch/mips/philips/pnx8550/jbs/init.c
new file mode 100644
index 000000000000..85f449174bc3
--- /dev/null
+++ b/arch/mips/philips/pnx8550/jbs/init.c
@@ -0,0 +1,57 @@
1/*
2 *
3 * Copyright 2005 Embedded Alley Solutions, Inc
4 * source@embeddedalley.com
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 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
12 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
14 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
15 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
16 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
17 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
18 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
19 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
20 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21 *
22 * You should have received a copy of the GNU General Public License along
23 * with this program; if not, write to the Free Software Foundation, Inc.,
24 * 675 Mass Ave, Cambridge, MA 02139, USA.
25 */
26
27#include <linux/init.h>
28#include <linux/mm.h>
29#include <linux/sched.h>
30#include <linux/bootmem.h>
31#include <asm/addrspace.h>
32#include <asm/bootinfo.h>
33#include <linux/string.h>
34#include <linux/kernel.h>
35
36int prom_argc;
37char **prom_argv, **prom_envp;
38extern void __init prom_init_cmdline(void);
39extern char *prom_getenv(char *envname);
40
41const char *get_system_type(void)
42{
43 return "Philips PNX8550/JBS";
44}
45
46void __init prom_init(void)
47{
48
49 unsigned long memsize;
50
51 mips_machgroup = MACH_GROUP_PHILIPS;
52 mips_machtype = MACH_PHILIPS_JBS;
53
54 //memsize = 0x02800000; /* Trimedia uses memory above */
55 memsize = 0x08000000; /* Trimedia uses memory above */
56 add_memory_region(0, memsize, BOOT_MEM_RAM);
57}
diff --git a/arch/mips/philips/pnx8550/jbs/irqmap.c b/arch/mips/philips/pnx8550/jbs/irqmap.c
new file mode 100644
index 000000000000..f78e0423dc98
--- /dev/null
+++ b/arch/mips/philips/pnx8550/jbs/irqmap.c
@@ -0,0 +1,36 @@
1/*
2 * Philips JBS board irqmap.
3 *
4 * Copyright 2005 Embedded Alley Solutions, Inc
5 * source@embeddealley.com
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/init.h>
29#include <int.h>
30
31char irq_tab_jbs[][5] __initdata = {
32 [8] = { -1, PNX8550_INT_PCI_INTA, 0xff, 0xff, 0xff},
33 [9] = { -1, PNX8550_INT_PCI_INTA, 0xff, 0xff, 0xff},
34 [17] = { -1, PNX8550_INT_PCI_INTA, 0xff, 0xff, 0xff},
35};
36
diff --git a/arch/mips/pmc-sierra/Kconfig b/arch/mips/pmc-sierra/Kconfig
new file mode 100644
index 000000000000..24d514c9dff9
--- /dev/null
+++ b/arch/mips/pmc-sierra/Kconfig
@@ -0,0 +1,3 @@
1config HYPERTRANSPORT
2 bool "Hypertransport Support for PMC-Sierra Yosemite"
3 depends on PMC_YOSEMITE
diff --git a/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.h b/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.h
index c19f01a32045..a31288335fba 100644
--- a/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.h
+++ b/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.h
@@ -34,7 +34,6 @@
34#include <linux/pci.h> 34#include <linux/pci.h>
35#include <linux/kernel.h> 35#include <linux/kernel.h>
36#include <linux/slab.h> 36#include <linux/slab.h>
37#include <linux/version.h>
38#include <asm/pci.h> 37#include <asm/pci.h>
39#include <asm/io.h> 38#include <asm/io.h>
40#include <linux/init.h> 39#include <linux/init.h>
diff --git a/arch/mips/pmc-sierra/yosemite/ht-irq.c b/arch/mips/pmc-sierra/yosemite/ht-irq.c
index d22c9ffe4914..5aec4057314e 100644
--- a/arch/mips/pmc-sierra/yosemite/ht-irq.c
+++ b/arch/mips/pmc-sierra/yosemite/ht-irq.c
@@ -26,7 +26,6 @@
26#include <linux/types.h> 26#include <linux/types.h>
27#include <linux/pci.h> 27#include <linux/pci.h>
28#include <linux/kernel.h> 28#include <linux/kernel.h>
29#include <linux/version.h>
30#include <linux/init.h> 29#include <linux/init.h>
31#include <asm/pci.h> 30#include <asm/pci.h>
32 31
diff --git a/arch/mips/pmc-sierra/yosemite/ht.c b/arch/mips/pmc-sierra/yosemite/ht.c
index dad228d3a220..54b65a80abf5 100644
--- a/arch/mips/pmc-sierra/yosemite/ht.c
+++ b/arch/mips/pmc-sierra/yosemite/ht.c
@@ -28,7 +28,6 @@
28#include <linux/pci.h> 28#include <linux/pci.h>
29#include <linux/kernel.h> 29#include <linux/kernel.h>
30#include <linux/slab.h> 30#include <linux/slab.h>
31#include <linux/version.h>
32#include <asm/pci.h> 31#include <asm/pci.h>
33#include <asm/io.h> 32#include <asm/io.h>
34 33
diff --git a/arch/mips/pmc-sierra/yosemite/prom.c b/arch/mips/pmc-sierra/yosemite/prom.c
index 1fb3e697948d..555bfacf7647 100644
--- a/arch/mips/pmc-sierra/yosemite/prom.c
+++ b/arch/mips/pmc-sierra/yosemite/prom.c
@@ -132,8 +132,9 @@ void __init prom_init(void)
132 prom_grab_secondary(); 132 prom_grab_secondary();
133} 133}
134 134
135void __init prom_free_prom_memory(void) 135unsigned long __init prom_free_prom_memory(void)
136{ 136{
137 return 0;
137} 138}
138 139
139void __init prom_fixup_mem_map(unsigned long start, unsigned long end) 140void __init prom_fixup_mem_map(unsigned long start, unsigned long end)
diff --git a/arch/mips/pmc-sierra/yosemite/setup.c b/arch/mips/pmc-sierra/yosemite/setup.c
index 7225bbf20ce4..bdc2ab55bed6 100644
--- a/arch/mips/pmc-sierra/yosemite/setup.c
+++ b/arch/mips/pmc-sierra/yosemite/setup.c
@@ -212,7 +212,7 @@ static void __init py_late_time_init(void)
212 py_rtc_setup(); 212 py_rtc_setup();
213} 213}
214 214
215static int __init pmc_yosemite_setup(void) 215void __init plat_setup(void)
216{ 216{
217 board_time_init = yosemite_time_init; 217 board_time_init = yosemite_time_init;
218 late_time_init = py_late_time_init; 218 late_time_init = py_late_time_init;
@@ -228,8 +228,4 @@ static int __init pmc_yosemite_setup(void)
228 OCD_WRITE(RM9000x2_OCD_HTBAR0, HYPERTRANSPORT_BAR0_ADDR); 228 OCD_WRITE(RM9000x2_OCD_HTBAR0, HYPERTRANSPORT_BAR0_ADDR);
229 OCD_WRITE(RM9000x2_OCD_HTMASK0, HYPERTRANSPORT_SIZE0); 229 OCD_WRITE(RM9000x2_OCD_HTMASK0, HYPERTRANSPORT_SIZE0);
230#endif 230#endif
231
232 return 0;
233} 231}
234
235early_initcall(pmc_yosemite_setup);
diff --git a/arch/mips/pmc-sierra/yosemite/smp.c b/arch/mips/pmc-sierra/yosemite/smp.c
index 1d3b0734c78c..0527170d6adb 100644
--- a/arch/mips/pmc-sierra/yosemite/smp.c
+++ b/arch/mips/pmc-sierra/yosemite/smp.c
@@ -9,7 +9,7 @@ extern void (*mips_hpt_init)(unsigned int);
9 9
10#define LAUNCHSTACK_SIZE 256 10#define LAUNCHSTACK_SIZE 256
11 11
12static spinlock_t launch_lock __initdata; 12static __initdata DEFINE_SPINLOCK(launch_lock);
13 13
14static unsigned long secondary_sp __initdata; 14static unsigned long secondary_sp __initdata;
15static unsigned long secondary_gp __initdata; 15static unsigned long secondary_gp __initdata;
diff --git a/arch/mips/qemu/q-setup.c b/arch/mips/qemu/q-setup.c
index 1a80eee8cd35..022eb1af6db1 100644
--- a/arch/mips/qemu/q-setup.c
+++ b/arch/mips/qemu/q-setup.c
@@ -4,6 +4,11 @@
4 4
5#define QEMU_PORT_BASE 0xb4000000 5#define QEMU_PORT_BASE 0xb4000000
6 6
7const char *get_system_type(void)
8{
9 return "Qemu";
10}
11
7static void __init qemu_timer_setup(struct irqaction *irq) 12static void __init qemu_timer_setup(struct irqaction *irq)
8{ 13{
9 /* set the clock to 100 Hz */ 14 /* set the clock to 100 Hz */
diff --git a/arch/mips/sgi-ip22/ip22-eisa.c b/arch/mips/sgi-ip22/ip22-eisa.c
index fa0e719c5bd1..b19820110aa3 100644
--- a/arch/mips/sgi-ip22/ip22-eisa.c
+++ b/arch/mips/sgi-ip22/ip22-eisa.c
@@ -29,6 +29,7 @@
29#include <linux/sched.h> 29#include <linux/sched.h>
30#include <linux/interrupt.h> 30#include <linux/interrupt.h>
31#include <linux/delay.h> 31#include <linux/delay.h>
32#include <asm/io.h>
32#include <asm/irq.h> 33#include <asm/irq.h>
33#include <asm/mipsregs.h> 34#include <asm/mipsregs.h>
34#include <asm/addrspace.h> 35#include <asm/addrspace.h>
@@ -37,42 +38,29 @@
37#include <asm/sgi/mc.h> 38#include <asm/sgi/mc.h>
38#include <asm/sgi/ip22.h> 39#include <asm/sgi/ip22.h>
39 40
40#define EISA_MAX_SLOTS 4 41/* I2 has four EISA slots. */
42#define IP22_EISA_MAX_SLOTS 4
41#define EISA_MAX_IRQ 16 43#define EISA_MAX_IRQ 16
42 44
43#define EISA_TO_PHYS(x) (0x00080000 | (x)) 45#define EIU_MODE_REG 0x0001ffc0
44#define EISA_TO_KSEG1(x) ((void *) KSEG1ADDR(EISA_TO_PHYS((x)))) 46#define EIU_STAT_REG 0x0001ffc4
45 47#define EIU_PREMPT_REG 0x0001ffc8
46#define EIU_MODE_REG 0x0009ffc0 48#define EIU_QUIET_REG 0x0001ffcc
47#define EIU_STAT_REG 0x0009ffc4 49#define EIU_INTRPT_ACK 0x00010004
48#define EIU_PREMPT_REG 0x0009ffc8 50
49#define EIU_QUIET_REG 0x0009ffcc 51static char __init *decode_eisa_sig(unsigned long addr)
50#define EIU_INTRPT_ACK 0x00090004
51
52#define EISA_DMA1_STATUS 8
53#define EISA_INT1_CTRL 0x20
54#define EISA_INT1_MASK 0x21
55#define EISA_INT2_CTRL 0xA0
56#define EISA_INT2_MASK 0xA1
57#define EISA_DMA2_STATUS 0xD0
58#define EISA_DMA2_WRITE_SINGLE 0xD4
59#define EISA_EXT_NMI_RESET_CTRL 0x461
60#define EISA_INT1_EDGE_LEVEL 0x4D0
61#define EISA_INT2_EDGE_LEVEL 0x4D1
62#define EISA_VENDOR_ID_OFFSET 0xC80
63
64#define EIU_WRITE_32(x,y) { *((u32 *) KSEG1ADDR(x)) = (u32) (y); mb(); }
65#define EIU_READ_8(x) *((u8 *) KSEG1ADDR(x))
66#define EISA_WRITE_8(x,y) { *((u8 *) EISA_TO_KSEG1(x)) = (u8) (y); mb(); }
67#define EISA_READ_8(x) *((u8 *) EISA_TO_KSEG1(x))
68
69static char *decode_eisa_sig(u8 * sig)
70{ 52{
71 static char sig_str[8]; 53 static char sig_str[EISA_SIG_LEN];
72 u16 rev; 54 u8 sig[4];
55 u16 rev;
56 int i;
57
58 for (i = 0; i < 4; i++) {
59 sig[i] = inb (addr + i);
73 60
74 if (sig[0] & 0x80) 61 if (!i && (sig[0] & 0x80))
75 return NULL; 62 return NULL;
63 }
76 64
77 sig_str[0] = ((sig[0] >> 2) & 0x1f) + ('A' - 1); 65 sig_str[0] = ((sig[0] >> 2) & 0x1f) + ('A' - 1);
78 sig_str[1] = (((sig[0] & 3) << 3) | (sig[1] >> 5)) + ('A' - 1); 66 sig_str[1] = (((sig[0] & 3) << 3) | (sig[1] >> 5)) + ('A' - 1);
@@ -83,23 +71,26 @@ static char *decode_eisa_sig(u8 * sig)
83 return sig_str; 71 return sig_str;
84} 72}
85 73
86static void ip22_eisa_intr(int irq, void *dev_id, struct pt_regs *regs) 74static irqreturn_t ip22_eisa_intr(int irq, void *dev_id, struct pt_regs *regs)
87{ 75{
88 u8 eisa_irq; 76 u8 eisa_irq;
89 u8 dma1, dma2; 77 u8 dma1, dma2;
90 78
91 eisa_irq = EIU_READ_8(EIU_INTRPT_ACK); 79 eisa_irq = inb(EIU_INTRPT_ACK);
92 dma1 = EISA_READ_8(EISA_DMA1_STATUS); 80 dma1 = inb(EISA_DMA1_STATUS);
93 dma2 = EISA_READ_8(EISA_DMA2_STATUS); 81 dma2 = inb(EISA_DMA2_STATUS);
94
95 if (eisa_irq >= EISA_MAX_IRQ) {
96 /* Oops, Bad Stuff Happened... */
97 printk(KERN_ERR "eisa_irq %d out of bound\n", eisa_irq);
98 82
99 EISA_WRITE_8(EISA_INT2_CTRL, 0x20); 83 if (eisa_irq < EISA_MAX_IRQ) {
100 EISA_WRITE_8(EISA_INT1_CTRL, 0x20);
101 } else
102 do_IRQ(eisa_irq, regs); 84 do_IRQ(eisa_irq, regs);
85 return IRQ_HANDLED;
86 }
87
88 /* Oops, Bad Stuff Happened... */
89 printk(KERN_ERR "eisa_irq %d out of bound\n", eisa_irq);
90
91 outb(0x20, EISA_INT2_CTRL);
92 outb(0x20, EISA_INT1_CTRL);
93 return IRQ_NONE;
103} 94}
104 95
105static void enable_eisa1_irq(unsigned int irq) 96static void enable_eisa1_irq(unsigned int irq)
@@ -109,9 +100,9 @@ static void enable_eisa1_irq(unsigned int irq)
109 100
110 local_irq_save(flags); 101 local_irq_save(flags);
111 102
112 mask = EISA_READ_8(EISA_INT1_MASK); 103 mask = inb(EISA_INT1_MASK);
113 mask &= ~((u8) (1 << irq)); 104 mask &= ~((u8) (1 << irq));
114 EISA_WRITE_8(EISA_INT1_MASK, mask); 105 outb(mask, EISA_INT1_MASK);
115 106
116 local_irq_restore(flags); 107 local_irq_restore(flags);
117} 108}
@@ -122,9 +113,9 @@ static unsigned int startup_eisa1_irq(unsigned int irq)
122 113
123 /* Only use edge interrupts for EISA */ 114 /* Only use edge interrupts for EISA */
124 115
125 edge = EISA_READ_8(EISA_INT1_EDGE_LEVEL); 116 edge = inb(EISA_INT1_EDGE_LEVEL);
126 edge &= ~((u8) (1 << irq)); 117 edge &= ~((u8) (1 << irq));
127 EISA_WRITE_8(EISA_INT1_EDGE_LEVEL, edge); 118 outb(edge, EISA_INT1_EDGE_LEVEL);
128 119
129 enable_eisa1_irq(irq); 120 enable_eisa1_irq(irq);
130 return 0; 121 return 0;
@@ -134,9 +125,9 @@ static void disable_eisa1_irq(unsigned int irq)
134{ 125{
135 u8 mask; 126 u8 mask;
136 127
137 mask = EISA_READ_8(EISA_INT1_MASK); 128 mask = inb(EISA_INT1_MASK);
138 mask |= ((u8) (1 << irq)); 129 mask |= ((u8) (1 << irq));
139 EISA_WRITE_8(EISA_INT1_MASK, mask); 130 outb(mask, EISA_INT1_MASK);
140} 131}
141 132
142#define shutdown_eisa1_irq disable_eisa1_irq 133#define shutdown_eisa1_irq disable_eisa1_irq
@@ -145,7 +136,7 @@ static void mask_and_ack_eisa1_irq(unsigned int irq)
145{ 136{
146 disable_eisa1_irq(irq); 137 disable_eisa1_irq(irq);
147 138
148 EISA_WRITE_8(EISA_INT1_CTRL, 0x20); 139 outb(0x20, EISA_INT1_CTRL);
149} 140}
150 141
151static void end_eisa1_irq(unsigned int irq) 142static void end_eisa1_irq(unsigned int irq)
@@ -171,9 +162,9 @@ static void enable_eisa2_irq(unsigned int irq)
171 162
172 local_irq_save(flags); 163 local_irq_save(flags);
173 164
174 mask = EISA_READ_8(EISA_INT2_MASK); 165 mask = inb(EISA_INT2_MASK);
175 mask &= ~((u8) (1 << (irq - 8))); 166 mask &= ~((u8) (1 << (irq - 8)));
176 EISA_WRITE_8(EISA_INT2_MASK, mask); 167 outb(mask, EISA_INT2_MASK);
177 168
178 local_irq_restore(flags); 169 local_irq_restore(flags);
179} 170}
@@ -184,9 +175,9 @@ static unsigned int startup_eisa2_irq(unsigned int irq)
184 175
185 /* Only use edge interrupts for EISA */ 176 /* Only use edge interrupts for EISA */
186 177
187 edge = EISA_READ_8(EISA_INT2_EDGE_LEVEL); 178 edge = inb(EISA_INT2_EDGE_LEVEL);
188 edge &= ~((u8) (1 << (irq - 8))); 179 edge &= ~((u8) (1 << (irq - 8)));
189 EISA_WRITE_8(EISA_INT2_EDGE_LEVEL, edge); 180 outb(edge, EISA_INT2_EDGE_LEVEL);
190 181
191 enable_eisa2_irq(irq); 182 enable_eisa2_irq(irq);
192 return 0; 183 return 0;
@@ -196,9 +187,9 @@ static void disable_eisa2_irq(unsigned int irq)
196{ 187{
197 u8 mask; 188 u8 mask;
198 189
199 mask = EISA_READ_8(EISA_INT2_MASK); 190 mask = inb(EISA_INT2_MASK);
200 mask |= ((u8) (1 << (irq - 8))); 191 mask |= ((u8) (1 << (irq - 8)));
201 EISA_WRITE_8(EISA_INT2_MASK, mask); 192 outb(mask, EISA_INT2_MASK);
202} 193}
203 194
204#define shutdown_eisa2_irq disable_eisa2_irq 195#define shutdown_eisa2_irq disable_eisa2_irq
@@ -207,8 +198,7 @@ static void mask_and_ack_eisa2_irq(unsigned int irq)
207{ 198{
208 disable_eisa2_irq(irq); 199 disable_eisa2_irq(irq);
209 200
210 EISA_WRITE_8(EISA_INT2_CTRL, 0x20); 201 outb(0x20, EISA_INT2_CTRL);
211 EISA_WRITE_8(EISA_INT1_CTRL, 0x20);
212} 202}
213 203
214static void end_eisa2_irq(unsigned int irq) 204static void end_eisa2_irq(unsigned int irq)
@@ -241,7 +231,6 @@ int __init ip22_eisa_init(void)
241{ 231{
242 int i, c; 232 int i, c;
243 char *str; 233 char *str;
244 u8 *slot_addr;
245 234
246 if (!(sgimc->systemid & SGIMC_SYSID_EPRESENT)) { 235 if (!(sgimc->systemid & SGIMC_SYSID_EPRESENT)) {
247 printk(KERN_INFO "EISA: bus not present.\n"); 236 printk(KERN_INFO "EISA: bus not present.\n");
@@ -249,11 +238,8 @@ int __init ip22_eisa_init(void)
249 } 238 }
250 239
251 printk(KERN_INFO "EISA: Probing bus...\n"); 240 printk(KERN_INFO "EISA: Probing bus...\n");
252 for (c = 0, i = 1; i <= EISA_MAX_SLOTS; i++) { 241 for (c = 0, i = 1; i <= IP22_EISA_MAX_SLOTS; i++) {
253 slot_addr = 242 if ((str = decode_eisa_sig(0x1000 * i + EISA_VENDOR_ID_OFFSET))) {
254 (u8 *) EISA_TO_KSEG1((0x1000 * i) +
255 EISA_VENDOR_ID_OFFSET);
256 if ((str = decode_eisa_sig(slot_addr))) {
257 printk(KERN_INFO "EISA: slot %d : %s detected.\n", 243 printk(KERN_INFO "EISA: slot %d : %s detected.\n",
258 i, str); 244 i, str);
259 c++; 245 c++;
@@ -268,25 +254,25 @@ int __init ip22_eisa_init(void)
268 Please wave your favorite dead chicken over the busses */ 254 Please wave your favorite dead chicken over the busses */
269 255
270 /* First say hello to the EIU */ 256 /* First say hello to the EIU */
271 EIU_WRITE_32(EIU_PREMPT_REG, 0x0000FFFF); 257 outl(0x0000FFFF, EIU_PREMPT_REG);
272 EIU_WRITE_32(EIU_QUIET_REG, 1); 258 outl(1, EIU_QUIET_REG);
273 EIU_WRITE_32(EIU_MODE_REG, 0x40f3c07F); 259 outl(0x40f3c07F, EIU_MODE_REG);
274 260
275 /* Now be nice to the EISA chipset */ 261 /* Now be nice to the EISA chipset */
276 EISA_WRITE_8(EISA_EXT_NMI_RESET_CTRL, 1); 262 outb(1, EISA_EXT_NMI_RESET_CTRL);
277 for (i = 0; i < 10000; i++); /* Wait long enough for the dust to settle */ 263 udelay(50); /* Wait long enough for the dust to settle */
278 EISA_WRITE_8(EISA_EXT_NMI_RESET_CTRL, 0); 264 outb(0, EISA_EXT_NMI_RESET_CTRL);
279 EISA_WRITE_8(EISA_INT1_CTRL, 0x11); 265 outb(0x11, EISA_INT1_CTRL);
280 EISA_WRITE_8(EISA_INT2_CTRL, 0x11); 266 outb(0x11, EISA_INT2_CTRL);
281 EISA_WRITE_8(EISA_INT1_MASK, 0); 267 outb(0, EISA_INT1_MASK);
282 EISA_WRITE_8(EISA_INT2_MASK, 8); 268 outb(8, EISA_INT2_MASK);
283 EISA_WRITE_8(EISA_INT1_MASK, 4); 269 outb(4, EISA_INT1_MASK);
284 EISA_WRITE_8(EISA_INT2_MASK, 2); 270 outb(2, EISA_INT2_MASK);
285 EISA_WRITE_8(EISA_INT1_MASK, 1); 271 outb(1, EISA_INT1_MASK);
286 EISA_WRITE_8(EISA_INT2_MASK, 1); 272 outb(1, EISA_INT2_MASK);
287 EISA_WRITE_8(EISA_INT1_MASK, 0xfb); 273 outb(0xfb, EISA_INT1_MASK);
288 EISA_WRITE_8(EISA_INT2_MASK, 0xff); 274 outb(0xff, EISA_INT2_MASK);
289 EISA_WRITE_8(EISA_DMA2_WRITE_SINGLE, 0); 275 outb(0, EISA_DMA2_WRITE_SINGLE);
290 276
291 for (i = SGINT_EISA; i < (SGINT_EISA + EISA_MAX_IRQ); i++) { 277 for (i = SGINT_EISA; i < (SGINT_EISA + EISA_MAX_IRQ); i++) {
292 irq_desc[i].status = IRQ_DISABLED; 278 irq_desc[i].status = IRQ_DISABLED;
diff --git a/arch/mips/sgi-ip22/ip22-setup.c b/arch/mips/sgi-ip22/ip22-setup.c
index 0e96a5d67993..5e59b4c8876b 100644
--- a/arch/mips/sgi-ip22/ip22-setup.c
+++ b/arch/mips/sgi-ip22/ip22-setup.c
@@ -53,7 +53,7 @@ EXPORT_SYMBOL(ip22_do_break);
53extern void ip22_be_init(void) __init; 53extern void ip22_be_init(void) __init;
54extern void ip22_time_init(void) __init; 54extern void ip22_time_init(void) __init;
55 55
56static int __init ip22_setup(void) 56void __init plat_setup(void)
57{ 57{
58 char *ctype; 58 char *ctype;
59 59
@@ -137,8 +137,4 @@ static int __init ip22_setup(void)
137 } 137 }
138 } 138 }
139#endif 139#endif
140
141 return 0;
142} 140}
143
144early_initcall(ip22_setup);
diff --git a/arch/mips/sgi-ip27/Kconfig b/arch/mips/sgi-ip27/Kconfig
new file mode 100644
index 000000000000..7b0bc4437243
--- /dev/null
+++ b/arch/mips/sgi-ip27/Kconfig
@@ -0,0 +1,54 @@
1#config SGI_SN0_XXL
2# bool "IP27 XXL"
3# depends on SGI_IP27
4# This options adds support for userspace processes upto 16TB size.
5# Normally the limit is just .5TB.
6
7config SGI_SN0_N_MODE
8 bool "IP27 N-Mode"
9 depends on SGI_IP27
10 help
11 The nodes of Origin 200, Origin 2000 and Onyx 2 systems can be
12 configured in either N-Modes which allows for more nodes or M-Mode
13 which allows for more memory. Your system is most probably
14 running in M-Mode, so you should say N here.
15
16config ARCH_DISCONTIGMEM_ENABLE
17 bool
18 default y if SGI_IP27
19 help
20 Say Y to upport efficient handling of discontiguous physical memory,
21 for architectures which are either NUMA (Non-Uniform Memory Access)
22 or have huge holes in the physical address space for other reasons.
23 See <file:Documentation/vm/numa> for more.
24
25config NUMA
26 bool "NUMA Support"
27 depends on SGI_IP27
28 help
29 Say Y to compile the kernel to support NUMA (Non-Uniform Memory
30 Access). This option is for configuring high-end multiprocessor
31 server machines. If in doubt, say N.
32
33config MAPPED_KERNEL
34 bool "Mapped kernel support"
35 depends on SGI_IP27
36 help
37 Change the way a Linux kernel is loaded into memory on a MIPS64
38 machine. This is required in order to support text replication and
39 NUMA. If you need to understand it, read the source code.
40
41config REPLICATE_KTEXT
42 bool "Kernel text replication support"
43 depends on SGI_IP27
44 help
45 Say Y here to enable replicating the kernel text across multiple
46 nodes in a NUMA cluster. This trades memory for speed.
47
48config REPLICATE_EXHANDLERS
49 bool "Exception handler replication support"
50 depends on SGI_IP27
51 help
52 Say Y here to enable replicating the kernel exception handlers
53 across multiple nodes in a NUMA cluster. This trades memory for
54 speed.
diff --git a/arch/mips/sgi-ip27/ip27-berr.c b/arch/mips/sgi-ip27/ip27-berr.c
index e1829a5d3b19..07631a97670b 100644
--- a/arch/mips/sgi-ip27/ip27-berr.c
+++ b/arch/mips/sgi-ip27/ip27-berr.c
@@ -10,6 +10,7 @@
10#include <linux/init.h> 10#include <linux/init.h>
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/module.h> 12#include <linux/module.h>
13#include <linux/signal.h> /* for SIGBUS */
13 14
14#include <asm/module.h> 15#include <asm/module.h>
15#include <asm/sn/addrs.h> 16#include <asm/sn/addrs.h>
diff --git a/arch/mips/sgi-ip27/ip27-console.c b/arch/mips/sgi-ip27/ip27-console.c
index d97f5b5ef844..3e1ac299b804 100644
--- a/arch/mips/sgi-ip27/ip27-console.c
+++ b/arch/mips/sgi-ip27/ip27-console.c
@@ -30,8 +30,10 @@
30static inline struct ioc3_uartregs *console_uart(void) 30static inline struct ioc3_uartregs *console_uart(void)
31{ 31{
32 struct ioc3 *ioc3; 32 struct ioc3 *ioc3;
33 nasid_t nasid;
33 34
34 ioc3 = (struct ioc3 *)KL_CONFIG_CH_CONS_INFO(get_nasid())->memory_base; 35 nasid = (master_nasid == INVALID_NASID) ? get_nasid() : master_nasid;
36 ioc3 = (struct ioc3 *)KL_CONFIG_CH_CONS_INFO(nasid)->memory_base;
35 37
36 return &ioc3->sregs.uarta; 38 return &ioc3->sregs.uarta;
37} 39}
diff --git a/arch/mips/sgi-ip27/ip27-init.c b/arch/mips/sgi-ip27/ip27-init.c
index 6dcee5c46c74..8651a0e75404 100644
--- a/arch/mips/sgi-ip27/ip27-init.c
+++ b/arch/mips/sgi-ip27/ip27-init.c
@@ -56,12 +56,12 @@ static void __init per_hub_init(cnodeid_t cnode)
56{ 56{
57 struct hub_data *hub = hub_data(cnode); 57 struct hub_data *hub = hub_data(cnode);
58 nasid_t nasid = COMPACT_TO_NASID_NODEID(cnode); 58 nasid_t nasid = COMPACT_TO_NASID_NODEID(cnode);
59 int i;
59 60
60 cpu_set(smp_processor_id(), hub->h_cpus); 61 cpu_set(smp_processor_id(), hub->h_cpus);
61 62
62 if (test_and_set_bit(cnode, hub_init_mask)) 63 if (test_and_set_bit(cnode, hub_init_mask))
63 return; 64 return;
64
65 /* 65 /*
66 * Set CRB timeout at 5ms, (< PI timeout of 10ms) 66 * Set CRB timeout at 5ms, (< PI timeout of 10ms)
67 */ 67 */
@@ -88,6 +88,24 @@ static void __init per_hub_init(cnodeid_t cnode)
88 __flush_cache_all(); 88 __flush_cache_all();
89 } 89 }
90#endif 90#endif
91
92 /*
93 * Some interrupts are reserved by hardware or by software convention.
94 * Mark these as reserved right away so they won't be used accidently
95 * later.
96 */
97 for (i = 0; i <= BASE_PCI_IRQ; i++) {
98 __set_bit(i, hub->irq_alloc_mask);
99 LOCAL_HUB_CLR_INTR(INT_PEND0_BASELVL + i);
100 }
101
102 __set_bit(IP_PEND0_6_63, hub->irq_alloc_mask);
103 LOCAL_HUB_S(PI_INT_PEND_MOD, IP_PEND0_6_63);
104
105 for (i = NI_BRDCAST_ERR_A; i <= MSC_PANIC_INTR; i++) {
106 __set_bit(i, hub->irq_alloc_mask);
107 LOCAL_HUB_CLR_INTR(INT_PEND1_BASELVL + i);
108 }
91} 109}
92 110
93void __init per_cpu_init(void) 111void __init per_cpu_init(void)
@@ -104,30 +122,12 @@ void __init per_cpu_init(void)
104 122
105 clear_c0_status(ST0_IM); 123 clear_c0_status(ST0_IM);
106 124
125 per_hub_init(cnode);
126
107 for (i = 0; i < LEVELS_PER_SLICE; i++) 127 for (i = 0; i < LEVELS_PER_SLICE; i++)
108 si->level_to_irq[i] = -1; 128 si->level_to_irq[i] = -1;
109 129
110 /* 130 /*
111 * Some interrupts are reserved by hardware or by software convention.
112 * Mark these as reserved right away so they won't be used accidently
113 * later.
114 */
115 for (i = 0; i <= BASE_PCI_IRQ; i++) {
116 __set_bit(i, si->irq_alloc_mask);
117 LOCAL_HUB_S(PI_INT_PEND_MOD, i);
118 }
119
120 __set_bit(IP_PEND0_6_63, si->irq_alloc_mask);
121 LOCAL_HUB_S(PI_INT_PEND_MOD, IP_PEND0_6_63);
122
123 for (i = NI_BRDCAST_ERR_A; i <= MSC_PANIC_INTR; i++) {
124 __set_bit(i, si->irq_alloc_mask + 1);
125 LOCAL_HUB_S(PI_INT_PEND_MOD, i);
126 }
127
128 LOCAL_HUB_L(PI_INT_PEND0);
129
130 /*
131 * We use this so we can find the local hub's data as fast as only 131 * We use this so we can find the local hub's data as fast as only
132 * possible. 132 * possible.
133 */ 133 */
@@ -140,8 +140,6 @@ void __init per_cpu_init(void)
140 install_cpu_nmi_handler(cputoslice(cpu)); 140 install_cpu_nmi_handler(cputoslice(cpu));
141 141
142 set_c0_status(SRB_DEV0 | SRB_DEV1); 142 set_c0_status(SRB_DEV0 | SRB_DEV1);
143
144 per_hub_init(cnode);
145} 143}
146 144
147/* 145/*
@@ -198,7 +196,7 @@ extern void ip27_setup_console(void);
198extern void ip27_time_init(void); 196extern void ip27_time_init(void);
199extern void ip27_reboot_setup(void); 197extern void ip27_reboot_setup(void);
200 198
201static int __init ip27_setup(void) 199void __init plat_setup(void)
202{ 200{
203 hubreg_t p, e, n_mode; 201 hubreg_t p, e, n_mode;
204 nasid_t nid; 202 nasid_t nid;
@@ -245,8 +243,4 @@ static int __init ip27_setup(void)
245 set_io_port_base(IO_BASE); 243 set_io_port_base(IO_BASE);
246 244
247 board_time_init = ip27_time_init; 245 board_time_init = ip27_time_init;
248
249 return 0;
250} 246}
251
252early_initcall(ip27_setup);
diff --git a/arch/mips/sgi-ip27/ip27-irq.c b/arch/mips/sgi-ip27/ip27-irq.c
index 61817a18aed2..73e5e52781d8 100644
--- a/arch/mips/sgi-ip27/ip27-irq.c
+++ b/arch/mips/sgi-ip27/ip27-irq.c
@@ -5,6 +5,9 @@
5 * Copyright (C) 1999, 2000 Silicon Graphics, Inc. 5 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
6 * Copyright (C) 1999 - 2001 Kanoj Sarcar 6 * Copyright (C) 1999 - 2001 Kanoj Sarcar
7 */ 7 */
8
9#undef DEBUG
10
8#include <linux/config.h> 11#include <linux/config.h>
9#include <linux/init.h> 12#include <linux/init.h>
10#include <linux/irq.h> 13#include <linux/irq.h>
@@ -14,11 +17,11 @@
14#include <linux/types.h> 17#include <linux/types.h>
15#include <linux/interrupt.h> 18#include <linux/interrupt.h>
16#include <linux/ioport.h> 19#include <linux/ioport.h>
17#include <linux/irq.h>
18#include <linux/timex.h> 20#include <linux/timex.h>
19#include <linux/slab.h> 21#include <linux/slab.h>
20#include <linux/random.h> 22#include <linux/random.h>
21#include <linux/smp_lock.h> 23#include <linux/smp_lock.h>
24#include <linux/kernel.h>
22#include <linux/kernel_stat.h> 25#include <linux/kernel_stat.h>
23#include <linux/delay.h> 26#include <linux/delay.h>
24#include <linux/bitops.h> 27#include <linux/bitops.h>
@@ -37,13 +40,6 @@
37#include <asm/sn/hub.h> 40#include <asm/sn/hub.h>
38#include <asm/sn/intr.h> 41#include <asm/sn/intr.h>
39 42
40#undef DEBUG_IRQ
41#ifdef DEBUG_IRQ
42#define DBG(x...) printk(x)
43#else
44#define DBG(x...)
45#endif
46
47/* 43/*
48 * Linux has a controller-independent x86 interrupt architecture. 44 * Linux has a controller-independent x86 interrupt architecture.
49 * every controller has a 'controller-template', that is used 45 * every controller has a 'controller-template', that is used
@@ -74,14 +70,15 @@ extern int irq_to_slot[];
74 70
75static inline int alloc_level(int cpu, int irq) 71static inline int alloc_level(int cpu, int irq)
76{ 72{
73 struct hub_data *hub = hub_data(cpu_to_node(cpu));
77 struct slice_data *si = cpu_data[cpu].data; 74 struct slice_data *si = cpu_data[cpu].data;
78 int level; /* pre-allocated entries */ 75 int level;
79 76
80 level = find_first_zero_bit(si->irq_alloc_mask, LEVELS_PER_SLICE); 77 level = find_first_zero_bit(hub->irq_alloc_mask, LEVELS_PER_SLICE);
81 if (level >= LEVELS_PER_SLICE) 78 if (level >= LEVELS_PER_SLICE)
82 panic("Cpu %d flooded with devices\n", cpu); 79 panic("Cpu %d flooded with devices\n", cpu);
83 80
84 __set_bit(level, si->irq_alloc_mask); 81 __set_bit(level, hub->irq_alloc_mask);
85 si->level_to_irq[level] = irq; 82 si->level_to_irq[level] = irq;
86 83
87 return level; 84 return level;
@@ -216,9 +213,11 @@ static int intr_connect_level(int cpu, int bit)
216{ 213{
217 nasid_t nasid = COMPACT_TO_NASID_NODEID(cpu_to_node(cpu)); 214 nasid_t nasid = COMPACT_TO_NASID_NODEID(cpu_to_node(cpu));
218 struct slice_data *si = cpu_data[cpu].data; 215 struct slice_data *si = cpu_data[cpu].data;
216 unsigned long flags;
219 217
220 __set_bit(bit, si->irq_enable_mask); 218 set_bit(bit, si->irq_enable_mask);
221 219
220 local_irq_save(flags);
222 if (!cputoslice(cpu)) { 221 if (!cputoslice(cpu)) {
223 REMOTE_HUB_S(nasid, PI_INT_MASK0_A, si->irq_enable_mask[0]); 222 REMOTE_HUB_S(nasid, PI_INT_MASK0_A, si->irq_enable_mask[0]);
224 REMOTE_HUB_S(nasid, PI_INT_MASK1_A, si->irq_enable_mask[1]); 223 REMOTE_HUB_S(nasid, PI_INT_MASK1_A, si->irq_enable_mask[1]);
@@ -226,6 +225,7 @@ static int intr_connect_level(int cpu, int bit)
226 REMOTE_HUB_S(nasid, PI_INT_MASK0_B, si->irq_enable_mask[0]); 225 REMOTE_HUB_S(nasid, PI_INT_MASK0_B, si->irq_enable_mask[0]);
227 REMOTE_HUB_S(nasid, PI_INT_MASK1_B, si->irq_enable_mask[1]); 226 REMOTE_HUB_S(nasid, PI_INT_MASK1_B, si->irq_enable_mask[1]);
228 } 227 }
228 local_irq_restore(flags);
229 229
230 return 0; 230 return 0;
231} 231}
@@ -235,7 +235,7 @@ static int intr_disconnect_level(int cpu, int bit)
235 nasid_t nasid = COMPACT_TO_NASID_NODEID(cpu_to_node(cpu)); 235 nasid_t nasid = COMPACT_TO_NASID_NODEID(cpu_to_node(cpu));
236 struct slice_data *si = cpu_data[cpu].data; 236 struct slice_data *si = cpu_data[cpu].data;
237 237
238 __clear_bit(bit, si->irq_enable_mask); 238 clear_bit(bit, si->irq_enable_mask);
239 239
240 if (!cputoslice(cpu)) { 240 if (!cputoslice(cpu)) {
241 REMOTE_HUB_S(nasid, PI_INT_MASK0_A, si->irq_enable_mask[0]); 241 REMOTE_HUB_S(nasid, PI_INT_MASK0_A, si->irq_enable_mask[0]);
@@ -261,7 +261,7 @@ static unsigned int startup_bridge_irq(unsigned int irq)
261 bc = IRQ_TO_BRIDGE(irq); 261 bc = IRQ_TO_BRIDGE(irq);
262 bridge = bc->base; 262 bridge = bc->base;
263 263
264 DBG("bridge_startup(): irq= 0x%x pin=%d\n", irq, pin); 264 pr_debug("bridge_startup(): irq= 0x%x pin=%d\n", irq, pin);
265 /* 265 /*
266 * "map" irq to a swlevel greater than 6 since the first 6 bits 266 * "map" irq to a swlevel greater than 6 since the first 6 bits
267 * of INT_PEND0 are taken 267 * of INT_PEND0 are taken
@@ -298,12 +298,13 @@ static unsigned int startup_bridge_irq(unsigned int irq)
298static void shutdown_bridge_irq(unsigned int irq) 298static void shutdown_bridge_irq(unsigned int irq)
299{ 299{
300 struct bridge_controller *bc = IRQ_TO_BRIDGE(irq); 300 struct bridge_controller *bc = IRQ_TO_BRIDGE(irq);
301 struct hub_data *hub = hub_data(cpu_to_node(bc->irq_cpu));
301 bridge_t *bridge = bc->base; 302 bridge_t *bridge = bc->base;
302 struct slice_data *si = cpu_data[bc->irq_cpu].data; 303 struct slice_data *si = cpu_data[bc->irq_cpu].data;
303 int pin, swlevel; 304 int pin, swlevel;
304 cpuid_t cpu; 305 cpuid_t cpu;
305 306
306 DBG("bridge_shutdown: irq 0x%x\n", irq); 307 pr_debug("bridge_shutdown: irq 0x%x\n", irq);
307 pin = SLOT_FROM_PCI_IRQ(irq); 308 pin = SLOT_FROM_PCI_IRQ(irq);
308 309
309 /* 310 /*
@@ -313,7 +314,7 @@ static void shutdown_bridge_irq(unsigned int irq)
313 swlevel = find_level(&cpu, irq); 314 swlevel = find_level(&cpu, irq);
314 intr_disconnect_level(cpu, swlevel); 315 intr_disconnect_level(cpu, swlevel);
315 316
316 __clear_bit(swlevel, si->irq_alloc_mask); 317 __clear_bit(swlevel, hub->irq_alloc_mask);
317 si->level_to_irq[swlevel] = -1; 318 si->level_to_irq[swlevel] = -1;
318 319
319 bridge->b_int_enable &= ~(1 << pin); 320 bridge->b_int_enable &= ~(1 << pin);
@@ -433,25 +434,24 @@ void install_ipi(void)
433 int slice = LOCAL_HUB_L(PI_CPU_NUM); 434 int slice = LOCAL_HUB_L(PI_CPU_NUM);
434 int cpu = smp_processor_id(); 435 int cpu = smp_processor_id();
435 struct slice_data *si = cpu_data[cpu].data; 436 struct slice_data *si = cpu_data[cpu].data;
436 hubreg_t mask, set; 437 struct hub_data *hub = hub_data(cpu_to_node(cpu));
438 int resched, call;
439
440 resched = CPU_RESCHED_A_IRQ + slice;
441 __set_bit(resched, hub->irq_alloc_mask);
442 __set_bit(resched, si->irq_enable_mask);
443 LOCAL_HUB_CLR_INTR(resched);
444
445 call = CPU_CALL_A_IRQ + slice;
446 __set_bit(call, hub->irq_alloc_mask);
447 __set_bit(call, si->irq_enable_mask);
448 LOCAL_HUB_CLR_INTR(call);
437 449
438 if (slice == 0) { 450 if (slice == 0) {
439 LOCAL_HUB_CLR_INTR(CPU_RESCHED_A_IRQ); 451 LOCAL_HUB_S(PI_INT_MASK0_A, si->irq_enable_mask[0]);
440 LOCAL_HUB_CLR_INTR(CPU_CALL_A_IRQ); 452 LOCAL_HUB_S(PI_INT_MASK1_A, si->irq_enable_mask[1]);
441 mask = LOCAL_HUB_L(PI_INT_MASK0_A); /* Slice A */
442 set = (1UL << CPU_RESCHED_A_IRQ) | (1UL << CPU_CALL_A_IRQ);
443 mask |= set;
444 si->irq_enable_mask[0] |= set;
445 si->irq_alloc_mask[0] |= set;
446 LOCAL_HUB_S(PI_INT_MASK0_A, mask);
447 } else { 453 } else {
448 LOCAL_HUB_CLR_INTR(CPU_RESCHED_B_IRQ); 454 LOCAL_HUB_S(PI_INT_MASK0_B, si->irq_enable_mask[0]);
449 LOCAL_HUB_CLR_INTR(CPU_CALL_B_IRQ); 455 LOCAL_HUB_S(PI_INT_MASK1_B, si->irq_enable_mask[1]);
450 mask = LOCAL_HUB_L(PI_INT_MASK0_B); /* Slice B */
451 set = (1UL << CPU_RESCHED_B_IRQ) | (1UL << CPU_CALL_B_IRQ);
452 mask |= set;
453 si->irq_enable_mask[1] |= set;
454 si->irq_alloc_mask[1] |= set;
455 LOCAL_HUB_S(PI_INT_MASK0_B, mask);
456 } 456 }
457} 457}
diff --git a/arch/mips/sgi-ip27/ip27-smp.c b/arch/mips/sgi-ip27/ip27-smp.c
index 17f768cba94f..3a8291b7d26d 100644
--- a/arch/mips/sgi-ip27/ip27-smp.c
+++ b/arch/mips/sgi-ip27/ip27-smp.c
@@ -127,37 +127,28 @@ void cpu_node_probe(void)
127 printk("Discovered %d cpus on %d nodes\n", highest + 1, num_online_nodes()); 127 printk("Discovered %d cpus on %d nodes\n", highest + 1, num_online_nodes());
128} 128}
129 129
130static void intr_clear_bits(nasid_t nasid, volatile hubreg_t *pend, 130static __init void intr_clear_all(nasid_t nasid)
131 int base_level)
132{ 131{
133 volatile hubreg_t bits;
134 int i; 132 int i;
135 133
136 /* Check pending interrupts */
137 if ((bits = HUB_L(pend)) != 0)
138 for (i = 0; i < N_INTPEND_BITS; i++)
139 if (bits & (1 << i))
140 LOCAL_HUB_CLR_INTR(base_level + i);
141}
142
143static void intr_clear_all(nasid_t nasid)
144{
145 REMOTE_HUB_S(nasid, PI_INT_MASK0_A, 0); 134 REMOTE_HUB_S(nasid, PI_INT_MASK0_A, 0);
146 REMOTE_HUB_S(nasid, PI_INT_MASK0_B, 0); 135 REMOTE_HUB_S(nasid, PI_INT_MASK0_B, 0);
147 REMOTE_HUB_S(nasid, PI_INT_MASK1_A, 0); 136 REMOTE_HUB_S(nasid, PI_INT_MASK1_A, 0);
148 REMOTE_HUB_S(nasid, PI_INT_MASK1_B, 0); 137 REMOTE_HUB_S(nasid, PI_INT_MASK1_B, 0);
149 intr_clear_bits(nasid, REMOTE_HUB_ADDR(nasid, PI_INT_PEND0), 138
150 INT_PEND0_BASELVL); 139 for (i = 0; i < 128; i++)
151 intr_clear_bits(nasid, REMOTE_HUB_ADDR(nasid, PI_INT_PEND1), 140 REMOTE_HUB_CLR_INTR(nasid, i);
152 INT_PEND1_BASELVL);
153} 141}
154 142
155void __init prom_prepare_cpus(unsigned int max_cpus) 143void __init prom_prepare_cpus(unsigned int max_cpus)
156{ 144{
157 cnodeid_t cnode; 145 cnodeid_t cnode;
158 146
159 for_each_online_node(cnode) 147 for_each_online_node(cnode) {
148 if (cnode == 0)
149 continue;
160 intr_clear_all(COMPACT_TO_NASID_NODEID(cnode)); 150 intr_clear_all(COMPACT_TO_NASID_NODEID(cnode));
151 }
161 152
162 replicate_kernel_text(); 153 replicate_kernel_text();
163 154
diff --git a/arch/mips/sgi-ip32/ip32-irq.c b/arch/mips/sgi-ip32/ip32-irq.c
index fc3a8e90d763..2eb22d692ed9 100644
--- a/arch/mips/sgi-ip32/ip32-irq.c
+++ b/arch/mips/sgi-ip32/ip32-irq.c
@@ -163,14 +163,13 @@ static void end_cpu_irq(unsigned int irq)
163#define mask_and_ack_cpu_irq disable_cpu_irq 163#define mask_and_ack_cpu_irq disable_cpu_irq
164 164
165static struct hw_interrupt_type ip32_cpu_interrupt = { 165static struct hw_interrupt_type ip32_cpu_interrupt = {
166 "IP32 CPU", 166 .typename = "IP32 CPU",
167 startup_cpu_irq, 167 .startup = startup_cpu_irq,
168 shutdown_cpu_irq, 168 .shutdown = shutdown_cpu_irq,
169 enable_cpu_irq, 169 .enable = enable_cpu_irq,
170 disable_cpu_irq, 170 .disable = disable_cpu_irq,
171 mask_and_ack_cpu_irq, 171 .ack = mask_and_ack_cpu_irq,
172 end_cpu_irq, 172 .end = end_cpu_irq,
173 NULL
174}; 173};
175 174
176/* 175/*
@@ -234,14 +233,13 @@ static void end_crime_irq(unsigned int irq)
234#define shutdown_crime_irq disable_crime_irq 233#define shutdown_crime_irq disable_crime_irq
235 234
236static struct hw_interrupt_type ip32_crime_interrupt = { 235static struct hw_interrupt_type ip32_crime_interrupt = {
237 "IP32 CRIME", 236 .typename = "IP32 CRIME",
238 startup_crime_irq, 237 .startup = startup_crime_irq,
239 shutdown_crime_irq, 238 .shutdown = shutdown_crime_irq,
240 enable_crime_irq, 239 .enable = enable_crime_irq,
241 disable_crime_irq, 240 .disable = disable_crime_irq,
242 mask_and_ack_crime_irq, 241 .ack = mask_and_ack_crime_irq,
243 end_crime_irq, 242 .end = end_crime_irq,
244 NULL
245}; 243};
246 244
247/* 245/*
@@ -294,14 +292,13 @@ static void end_macepci_irq(unsigned int irq)
294#define mask_and_ack_macepci_irq disable_macepci_irq 292#define mask_and_ack_macepci_irq disable_macepci_irq
295 293
296static struct hw_interrupt_type ip32_macepci_interrupt = { 294static struct hw_interrupt_type ip32_macepci_interrupt = {
297 "IP32 MACE PCI", 295 .typename = "IP32 MACE PCI",
298 startup_macepci_irq, 296 .startup = startup_macepci_irq,
299 shutdown_macepci_irq, 297 .shutdown = shutdown_macepci_irq,
300 enable_macepci_irq, 298 .enable = enable_macepci_irq,
301 disable_macepci_irq, 299 .disable = disable_macepci_irq,
302 mask_and_ack_macepci_irq, 300 .ack = mask_and_ack_macepci_irq,
303 end_macepci_irq, 301 .end = end_macepci_irq,
304 NULL
305}; 302};
306 303
307/* This is used for MACE ISA interrupts. That means bits 4-6 in the 304/* This is used for MACE ISA interrupts. That means bits 4-6 in the
@@ -425,14 +422,13 @@ static void end_maceisa_irq(unsigned irq)
425#define shutdown_maceisa_irq disable_maceisa_irq 422#define shutdown_maceisa_irq disable_maceisa_irq
426 423
427static struct hw_interrupt_type ip32_maceisa_interrupt = { 424static struct hw_interrupt_type ip32_maceisa_interrupt = {
428 "IP32 MACE ISA", 425 .typename = "IP32 MACE ISA",
429 startup_maceisa_irq, 426 .startup = startup_maceisa_irq,
430 shutdown_maceisa_irq, 427 .shutdown = shutdown_maceisa_irq,
431 enable_maceisa_irq, 428 .enable = enable_maceisa_irq,
432 disable_maceisa_irq, 429 .disable = disable_maceisa_irq,
433 mask_and_ack_maceisa_irq, 430 .ack = mask_and_ack_maceisa_irq,
434 end_maceisa_irq, 431 .end = end_maceisa_irq,
435 NULL
436}; 432};
437 433
438/* This is used for regular non-ISA, non-PCI MACE interrupts. That means 434/* This is used for regular non-ISA, non-PCI MACE interrupts. That means
@@ -476,14 +472,13 @@ static void end_mace_irq(unsigned int irq)
476#define mask_and_ack_mace_irq disable_mace_irq 472#define mask_and_ack_mace_irq disable_mace_irq
477 473
478static struct hw_interrupt_type ip32_mace_interrupt = { 474static struct hw_interrupt_type ip32_mace_interrupt = {
479 "IP32 MACE", 475 .typename = "IP32 MACE",
480 startup_mace_irq, 476 .startup = startup_mace_irq,
481 shutdown_mace_irq, 477 .shutdown = shutdown_mace_irq,
482 enable_mace_irq, 478 .enable = enable_mace_irq,
483 disable_mace_irq, 479 .disable = disable_mace_irq,
484 mask_and_ack_mace_irq, 480 .ack = mask_and_ack_mace_irq,
485 end_mace_irq, 481 .end = end_mace_irq,
486 NULL
487}; 482};
488 483
489static void ip32_unknown_interrupt(struct pt_regs *regs) 484static void ip32_unknown_interrupt(struct pt_regs *regs)
diff --git a/arch/mips/sgi-ip32/ip32-memory.c b/arch/mips/sgi-ip32/ip32-memory.c
index fc76ca92bab9..d37d40a3cdae 100644
--- a/arch/mips/sgi-ip32/ip32-memory.c
+++ b/arch/mips/sgi-ip32/ip32-memory.c
@@ -36,8 +36,8 @@ void __init prom_meminit (void)
36 if (base + size > (256 << 20)) 36 if (base + size > (256 << 20))
37 base += CRIME_HI_MEM_BASE; 37 base += CRIME_HI_MEM_BASE;
38 38
39 printk("CRIME MC: bank %u base 0x%016lx size %luMB\n", 39 printk("CRIME MC: bank %u base 0x%016lx size %luMiB\n",
40 bank, base, size); 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}
diff --git a/arch/mips/sgi-ip32/ip32-setup.c b/arch/mips/sgi-ip32/ip32-setup.c
index 8d270be58224..d10a269aeae1 100644
--- a/arch/mips/sgi-ip32/ip32-setup.c
+++ b/arch/mips/sgi-ip32/ip32-setup.c
@@ -92,7 +92,7 @@ void __init ip32_timer_setup(struct irqaction *irq)
92 setup_irq(IP32_R4K_TIMER_IRQ, irq); 92 setup_irq(IP32_R4K_TIMER_IRQ, irq);
93} 93}
94 94
95static int __init ip32_setup(void) 95void __init plat_setup(void)
96{ 96{
97 board_be_init = ip32_be_init; 97 board_be_init = ip32_be_init;
98 98
@@ -152,8 +152,4 @@ static int __init ip32_setup(void)
152 } 152 }
153 } 153 }
154#endif 154#endif
155
156 return 0;
157} 155}
158
159early_initcall(ip32_setup);
diff --git a/arch/mips/sibyte/Kconfig b/arch/mips/sibyte/Kconfig
new file mode 100644
index 000000000000..de46f62ac462
--- /dev/null
+++ b/arch/mips/sibyte/Kconfig
@@ -0,0 +1,161 @@
1config SIBYTE_SB1250
2 bool
3 select HW_HAS_PCI
4 select SIBYTE_HAS_LDT
5 select SIBYTE_SB1xxx_SOC
6
7config SIBYTE_BCM1120
8 bool
9 select SIBYTE_BCM112X
10 select SIBYTE_SB1xxx_SOC
11
12config SIBYTE_BCM1125
13 bool
14 select HW_HAS_PCI
15 select SIBYTE_BCM112X
16 select SIBYTE_SB1xxx_SOC
17
18config SIBYTE_BCM1125H
19 bool
20 select HW_HAS_PCI
21 select SIBYTE_BCM112X
22 select SIBYTE_HAS_LDT
23 select SIBYTE_SB1xxx_SOC
24
25config SIBYTE_BCM112X
26 bool
27 select SIBYTE_SB1xxx_SOC
28
29config SIBYTE_BCM1x80
30 bool
31 select HW_HAS_PCI
32 select SIBYTE_SB1xxx_SOC
33
34config SIBYTE_BCM1x55
35 bool
36 select HW_HAS_PCI
37 select SIBYTE_SB1xxx_SOC
38
39config SIBYTE_SB1xxx_SOC
40 bool
41 depends on EXPERIMENTAL
42 select DMA_COHERENT
43 select SIBYTE_CFE
44 select SWAP_IO_SPACE
45 select SYS_SUPPORTS_32BIT_KERNEL
46 select SYS_SUPPORTS_64BIT_KERNEL
47
48choice
49 prompt "SiByte SOC Stepping"
50 depends on SIBYTE_SB1xxx_SOC
51
52config CPU_SB1_PASS_1
53 bool "1250 Pass1"
54 depends on SIBYTE_SB1250
55 select CPU_HAS_PREFETCH
56
57config CPU_SB1_PASS_2_1250
58 bool "1250 An"
59 depends on SIBYTE_SB1250
60 select CPU_SB1_PASS_2
61 help
62 Also called BCM1250 Pass 2
63
64config CPU_SB1_PASS_2_2
65 bool "1250 Bn"
66 depends on SIBYTE_SB1250
67 select CPU_HAS_PREFETCH
68 help
69 Also called BCM1250 Pass 2.2
70
71config CPU_SB1_PASS_4
72 bool "1250 Cn"
73 depends on SIBYTE_SB1250
74 select CPU_HAS_PREFETCH
75 help
76 Also called BCM1250 Pass 3
77
78config CPU_SB1_PASS_2_112x
79 bool "112x Hybrid"
80 depends on SIBYTE_BCM112X
81 select CPU_SB1_PASS_2
82
83config CPU_SB1_PASS_3
84 bool "112x An"
85 depends on SIBYTE_BCM112X
86 select CPU_HAS_PREFETCH
87
88endchoice
89
90config CPU_SB1_PASS_2
91 bool
92
93config SIBYTE_HAS_LDT
94 bool
95 depends on PCI && (SIBYTE_SB1250 || SIBYTE_BCM1125H)
96 default y
97
98config SIMULATION
99 bool "Running under simulation"
100 depends on SIBYTE_SB1xxx_SOC
101 help
102 Build a kernel suitable for running under the GDB simulator.
103 Primarily adjusts the kernel's notion of time.
104
105config CONFIG_SB1_CEX_ALWAYS_FATAL
106 bool "All cache exceptions considered fatal (no recovery attempted)"
107 depends on SIBYTE_SB1xxx_SOC
108
109config CONFIG_SB1_CERR_STALL
110 bool "Stall (rather than panic) on fatal cache error"
111 depends on SIBYTE_SB1xxx_SOC
112
113config SIBYTE_CFE
114 bool "Booting from CFE"
115 depends on SIBYTE_SB1xxx_SOC
116 help
117 Make use of the CFE API for enumerating available memory,
118 controlling secondary CPUs, and possibly console output.
119
120config SIBYTE_CFE_CONSOLE
121 bool "Use firmware console"
122 depends on SIBYTE_CFE
123 help
124 Use the CFE API's console write routines during boot. Other console
125 options (VT console, sb1250 duart console, etc.) should not be
126 configured.
127
128config SIBYTE_STANDALONE
129 bool
130 depends on SIBYTE_SB1xxx_SOC && !SIBYTE_CFE
131 default y
132
133config SIBYTE_STANDALONE_RAM_SIZE
134 int "Memory size (in megabytes)"
135 depends on SIBYTE_STANDALONE
136 default "32"
137
138config SIBYTE_BUS_WATCHER
139 bool "Support for Bus Watcher statistics"
140 depends on SIBYTE_SB1xxx_SOC
141 help
142 Handle and keep statistics on the bus error interrupts (COR_ECC,
143 BAD_ECC, IO_BUS).
144
145config SIBYTE_BW_TRACE
146 bool "Capture bus trace before bus error"
147 depends on SIBYTE_BUS_WATCHER
148 help
149 Run a continuous bus trace, dumping the raw data as soon as
150 a ZBbus error is detected. Cannot work if ZBbus profiling
151 is turned on, and also will interfere with JTAG-based trace
152 buffer activity. Raw buffer data is dumped to console, and
153 must be processed off-line.
154
155config SIBYTE_SB1250_PROF
156 bool "Support for SB1/SOC profiling - SB1/SCD perf counters"
157 depends on SIBYTE_SB1xxx_SOC
158
159config SIBYTE_TBPROF
160 bool "Support for ZBbus profiling"
161 depends on SIBYTE_SB1xxx_SOC
diff --git a/arch/mips/sibyte/bcm1480/Makefile b/arch/mips/sibyte/bcm1480/Makefile
new file mode 100644
index 000000000000..538d5a51ae94
--- /dev/null
+++ b/arch/mips/sibyte/bcm1480/Makefile
@@ -0,0 +1,5 @@
1obj-y := setup.o irq.o irq_handler.o time.o
2
3obj-$(CONFIG_SMP) += smp.o
4
5EXTRA_AFLAGS := $(CFLAGS)
diff --git a/arch/mips/sibyte/bcm1480/irq.c b/arch/mips/sibyte/bcm1480/irq.c
new file mode 100644
index 000000000000..b2a1ba5d23df
--- /dev/null
+++ b/arch/mips/sibyte/bcm1480/irq.c
@@ -0,0 +1,476 @@
1/*
2 * Copyright (C) 2000,2001,2002,2003,2004 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#include <linux/config.h>
19#include <linux/kernel.h>
20#include <linux/init.h>
21#include <linux/linkage.h>
22#include <linux/interrupt.h>
23#include <linux/spinlock.h>
24#include <linux/mm.h>
25#include <linux/slab.h>
26#include <linux/kernel_stat.h>
27
28#include <asm/errno.h>
29#include <asm/signal.h>
30#include <asm/system.h>
31#include <asm/ptrace.h>
32#include <asm/io.h>
33
34#include <asm/sibyte/bcm1480_regs.h>
35#include <asm/sibyte/bcm1480_int.h>
36#include <asm/sibyte/bcm1480_scd.h>
37
38#include <asm/sibyte/sb1250_uart.h>
39#include <asm/sibyte/sb1250.h>
40
41/*
42 * These are the routines that handle all the low level interrupt stuff.
43 * Actions handled here are: initialization of the interrupt map, requesting of
44 * interrupt lines by handlers, dispatching if interrupts to handlers, probing
45 * for interrupt lines
46 */
47
48
49#define shutdown_bcm1480_irq disable_bcm1480_irq
50static void end_bcm1480_irq(unsigned int irq);
51static void enable_bcm1480_irq(unsigned int irq);
52static void disable_bcm1480_irq(unsigned int irq);
53static unsigned int startup_bcm1480_irq(unsigned int irq);
54static void ack_bcm1480_irq(unsigned int irq);
55#ifdef CONFIG_SMP
56static void bcm1480_set_affinity(unsigned int irq, cpumask_t mask);
57#endif
58
59#ifdef CONFIG_PCI
60extern unsigned long ht_eoi_space;
61#endif
62
63#ifdef CONFIG_KGDB
64#include <asm/gdb-stub.h>
65extern void breakpoint(void);
66static int kgdb_irq;
67#ifdef CONFIG_GDB_CONSOLE
68extern void register_gdb_console(void);
69#endif
70
71/* kgdb is on when configured. Pass "nokgdb" kernel arg to turn it off */
72static int kgdb_flag = 1;
73static int __init nokgdb(char *str)
74{
75 kgdb_flag = 0;
76 return 1;
77}
78__setup("nokgdb", nokgdb);
79
80/* Default to UART1 */
81int kgdb_port = 1;
82#ifdef CONFIG_SIBYTE_SB1250_DUART
83extern char sb1250_duart_present[];
84#endif
85#endif
86
87static struct hw_interrupt_type bcm1480_irq_type = {
88 .typename = "BCM1480-IMR",
89 .startup = startup_bcm1480_irq,
90 .shutdown = shutdown_bcm1480_irq,
91 .enable = enable_bcm1480_irq,
92 .disable = disable_bcm1480_irq,
93 .ack = ack_bcm1480_irq,
94 .end = end_bcm1480_irq,
95#ifdef CONFIG_SMP
96 .set_affinity = bcm1480_set_affinity
97#endif
98};
99
100/* Store the CPU id (not the logical number) */
101int bcm1480_irq_owner[BCM1480_NR_IRQS];
102
103DEFINE_SPINLOCK(bcm1480_imr_lock);
104
105void bcm1480_mask_irq(int cpu, int irq)
106{
107 unsigned long flags;
108 u64 cur_ints,hl_spacing;
109
110 spin_lock_irqsave(&bcm1480_imr_lock, flags);
111 hl_spacing = 0;
112 if ((irq >= BCM1480_NR_IRQS_HALF) && (irq <= BCM1480_NR_IRQS)) {
113 hl_spacing = BCM1480_IMR_HL_SPACING;
114 irq -= BCM1480_NR_IRQS_HALF;
115 }
116 cur_ints = ____raw_readq(IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + hl_spacing));
117 cur_ints |= (((u64) 1) << irq);
118 ____raw_writeq(cur_ints, IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + hl_spacing));
119 spin_unlock_irqrestore(&bcm1480_imr_lock, flags);
120}
121
122void bcm1480_unmask_irq(int cpu, int irq)
123{
124 unsigned long flags;
125 u64 cur_ints,hl_spacing;
126
127 spin_lock_irqsave(&bcm1480_imr_lock, flags);
128 hl_spacing = 0;
129 if ((irq >= BCM1480_NR_IRQS_HALF) && (irq <= BCM1480_NR_IRQS)) {
130 hl_spacing = BCM1480_IMR_HL_SPACING;
131 irq -= BCM1480_NR_IRQS_HALF;
132 }
133 cur_ints = ____raw_readq(IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + hl_spacing));
134 cur_ints &= ~(((u64) 1) << irq);
135 ____raw_writeq(cur_ints, IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + hl_spacing));
136 spin_unlock_irqrestore(&bcm1480_imr_lock, flags);
137}
138
139#ifdef CONFIG_SMP
140static void bcm1480_set_affinity(unsigned int irq, cpumask_t mask)
141{
142 int i = 0, old_cpu, cpu, int_on;
143 u64 cur_ints;
144 irq_desc_t *desc = irq_desc + irq;
145 unsigned long flags;
146 unsigned int irq_dirty;
147
148 i = first_cpu(mask);
149 if (next_cpu(i, mask) <= NR_CPUS) {
150 printk("attempted to set irq affinity for irq %d to multiple CPUs\n", irq);
151 return;
152 }
153
154 /* Convert logical CPU to physical CPU */
155 cpu = cpu_logical_map(i);
156
157 /* Protect against other affinity changers and IMR manipulation */
158 spin_lock_irqsave(&desc->lock, flags);
159 spin_lock(&bcm1480_imr_lock);
160
161 /* Swizzle each CPU's IMR (but leave the IP selection alone) */
162 old_cpu = bcm1480_irq_owner[irq];
163 irq_dirty = irq;
164 if ((irq_dirty >= BCM1480_NR_IRQS_HALF) && (irq_dirty <= BCM1480_NR_IRQS)) {
165 irq_dirty -= BCM1480_NR_IRQS_HALF;
166 }
167
168 int k;
169 for (k=0; k<2; k++) { /* Loop through high and low interrupt mask register */
170 cur_ints = ____raw_readq(IOADDR(A_BCM1480_IMR_MAPPER(old_cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + (k*BCM1480_IMR_HL_SPACING)));
171 int_on = !(cur_ints & (((u64) 1) << irq_dirty));
172 if (int_on) {
173 /* If it was on, mask it */
174 cur_ints |= (((u64) 1) << irq_dirty);
175 ____raw_writeq(cur_ints, IOADDR(A_BCM1480_IMR_MAPPER(old_cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + (k*BCM1480_IMR_HL_SPACING)));
176 }
177 bcm1480_irq_owner[irq] = cpu;
178 if (int_on) {
179 /* unmask for the new CPU */
180 cur_ints = ____raw_readq(IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + (k*BCM1480_IMR_HL_SPACING)));
181 cur_ints &= ~(((u64) 1) << irq_dirty);
182 ____raw_writeq(cur_ints, IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + (k*BCM1480_IMR_HL_SPACING)));
183 }
184 }
185 spin_unlock(&bcm1480_imr_lock);
186 spin_unlock_irqrestore(&desc->lock, flags);
187}
188#endif
189
190
191/* Defined in arch/mips/sibyte/bcm1480/irq_handler.S */
192extern void bcm1480_irq_handler(void);
193
194/*****************************************************************************/
195
196static unsigned int startup_bcm1480_irq(unsigned int irq)
197{
198 bcm1480_unmask_irq(bcm1480_irq_owner[irq], irq);
199
200 return 0; /* never anything pending */
201}
202
203
204static void disable_bcm1480_irq(unsigned int irq)
205{
206 bcm1480_mask_irq(bcm1480_irq_owner[irq], irq);
207}
208
209static void enable_bcm1480_irq(unsigned int irq)
210{
211 bcm1480_unmask_irq(bcm1480_irq_owner[irq], irq);
212}
213
214
215static void ack_bcm1480_irq(unsigned int irq)
216{
217 u64 pending;
218 unsigned int irq_dirty;
219
220 /*
221 * If the interrupt was an HT interrupt, now is the time to
222 * clear it. NOTE: we assume the HT bridge was set up to
223 * deliver the interrupts to all CPUs (which makes affinity
224 * changing easier for us)
225 */
226 irq_dirty = irq;
227 if ((irq_dirty >= BCM1480_NR_IRQS_HALF) && (irq_dirty <= BCM1480_NR_IRQS)) {
228 irq_dirty -= BCM1480_NR_IRQS_HALF;
229 }
230 int k;
231 for (k=0; k<2; k++) { /* Loop through high and low LDT interrupts */
232 pending = __raw_readq(IOADDR(A_BCM1480_IMR_REGISTER(bcm1480_irq_owner[irq],
233 R_BCM1480_IMR_LDT_INTERRUPT_H + (k*BCM1480_IMR_HL_SPACING))));
234 pending &= ((u64)1 << (irq_dirty));
235 if (pending) {
236#ifdef CONFIG_SMP
237 int i;
238 for (i=0; i<NR_CPUS; i++) {
239 /*
240 * Clear for all CPUs so an affinity switch
241 * doesn't find an old status
242 */
243 __raw_writeq(pending, IOADDR(A_BCM1480_IMR_REGISTER(cpu_logical_map(i),
244 R_BCM1480_IMR_LDT_INTERRUPT_CLR_H + (k*BCM1480_IMR_HL_SPACING))));
245 }
246#else
247 __raw_writeq(pending, IOADDR(A_BCM1480_IMR_REGISTER(0, R_BCM1480_IMR_LDT_INTERRUPT_CLR_H + (k*BCM1480_IMR_HL_SPACING))));
248#endif
249
250 /*
251 * Generate EOI. For Pass 1 parts, EOI is a nop. For
252 * Pass 2, the LDT world may be edge-triggered, but
253 * this EOI shouldn't hurt. If they are
254 * level-sensitive, the EOI is required.
255 */
256#ifdef CONFIG_PCI
257 if (ht_eoi_space)
258 *(uint32_t *)(ht_eoi_space+(irq<<16)+(7<<2)) = 0;
259#endif
260 }
261 }
262 bcm1480_mask_irq(bcm1480_irq_owner[irq], irq);
263}
264
265
266static void end_bcm1480_irq(unsigned int irq)
267{
268 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) {
269 bcm1480_unmask_irq(bcm1480_irq_owner[irq], irq);
270 }
271}
272
273
274void __init init_bcm1480_irqs(void)
275{
276 int i;
277
278 for (i = 0; i < NR_IRQS; i++) {
279 irq_desc[i].status = IRQ_DISABLED;
280 irq_desc[i].action = 0;
281 irq_desc[i].depth = 1;
282 if (i < BCM1480_NR_IRQS) {
283 irq_desc[i].handler = &bcm1480_irq_type;
284 bcm1480_irq_owner[i] = 0;
285 } else {
286 irq_desc[i].handler = &no_irq_type;
287 }
288 }
289}
290
291
292static irqreturn_t bcm1480_dummy_handler(int irq, void *dev_id,
293 struct pt_regs *regs)
294{
295 return IRQ_NONE;
296}
297
298static struct irqaction bcm1480_dummy_action = {
299 .handler = bcm1480_dummy_handler,
300 .flags = 0,
301 .mask = CPU_MASK_NONE,
302 .name = "bcm1480-private",
303 .next = NULL,
304 .dev_id = 0
305};
306
307int bcm1480_steal_irq(int irq)
308{
309 irq_desc_t *desc = irq_desc + irq;
310 unsigned long flags;
311 int retval = 0;
312
313 if (irq >= BCM1480_NR_IRQS)
314 return -EINVAL;
315
316 spin_lock_irqsave(&desc->lock,flags);
317 /* Don't allow sharing at all for these */
318 if (desc->action != NULL)
319 retval = -EBUSY;
320 else {
321 desc->action = &bcm1480_dummy_action;
322 desc->depth = 0;
323 }
324 spin_unlock_irqrestore(&desc->lock,flags);
325 return 0;
326}
327
328/*
329 * init_IRQ is called early in the boot sequence from init/main.c. It
330 * is responsible for setting up the interrupt mapper and installing the
331 * handler that will be responsible for dispatching interrupts to the
332 * "right" place.
333 */
334/*
335 * For now, map all interrupts to IP[2]. We could save
336 * some cycles by parceling out system interrupts to different
337 * IP lines, but keep it simple for bringup. We'll also direct
338 * all interrupts to a single CPU; we should probably route
339 * PCI and LDT to one cpu and everything else to the other
340 * to balance the load a bit.
341 *
342 * On the second cpu, everything is set to IP5, which is
343 * ignored, EXCEPT the mailbox interrupt. That one is
344 * set to IP[2] so it is handled. This is needed so we
345 * can do cross-cpu function calls, as requred by SMP
346 */
347
348#define IMR_IP2_VAL K_BCM1480_INT_MAP_I0
349#define IMR_IP3_VAL K_BCM1480_INT_MAP_I1
350#define IMR_IP4_VAL K_BCM1480_INT_MAP_I2
351#define IMR_IP5_VAL K_BCM1480_INT_MAP_I3
352#define IMR_IP6_VAL K_BCM1480_INT_MAP_I4
353
354void __init arch_init_irq(void)
355{
356
357 unsigned int i, cpu;
358 u64 tmp;
359 unsigned int imask = STATUSF_IP4 | STATUSF_IP3 | STATUSF_IP2 |
360 STATUSF_IP1 | STATUSF_IP0;
361
362 /* Default everything to IP2 */
363 /* Start with _high registers which has no bit 0 interrupt source */
364 for (i = 1; i < BCM1480_NR_IRQS_HALF; i++) { /* was I0 */
365 for (cpu = 0; cpu < 4; cpu++) {
366 __raw_writeq(IMR_IP2_VAL,
367 IOADDR(A_BCM1480_IMR_REGISTER(cpu,
368 R_BCM1480_IMR_INTERRUPT_MAP_BASE_H) + (i << 3)));
369 }
370 }
371
372 /* Now do _low registers */
373 for (i = 0; i < BCM1480_NR_IRQS_HALF; i++) {
374 for (cpu = 0; cpu < 4; cpu++) {
375 __raw_writeq(IMR_IP2_VAL,
376 IOADDR(A_BCM1480_IMR_REGISTER(cpu,
377 R_BCM1480_IMR_INTERRUPT_MAP_BASE_L) + (i << 3)));
378 }
379 }
380
381 init_bcm1480_irqs();
382
383 /*
384 * Map the high 16 bits of mailbox_0 registers to IP[3], for
385 * inter-cpu messages
386 */
387 /* Was I1 */
388 for (cpu = 0; cpu < 4; cpu++) {
389 __raw_writeq(IMR_IP3_VAL, IOADDR(A_BCM1480_IMR_REGISTER(cpu, R_BCM1480_IMR_INTERRUPT_MAP_BASE_H) +
390 (K_BCM1480_INT_MBOX_0_0 << 3)));
391 }
392
393
394 /* Clear the mailboxes. The firmware may leave them dirty */
395 for (cpu = 0; cpu < 4; cpu++) {
396 __raw_writeq(0xffffffffffffffffULL,
397 IOADDR(A_BCM1480_IMR_REGISTER(cpu, R_BCM1480_IMR_MAILBOX_0_CLR_CPU)));
398 __raw_writeq(0xffffffffffffffffULL,
399 IOADDR(A_BCM1480_IMR_REGISTER(cpu, R_BCM1480_IMR_MAILBOX_1_CLR_CPU)));
400 }
401
402
403 /* Mask everything except the high 16 bit of mailbox_0 registers for all cpus */
404 tmp = ~((u64) 0) ^ ( (((u64) 1) << K_BCM1480_INT_MBOX_0_0));
405 for (cpu = 0; cpu < 4; cpu++) {
406 __raw_writeq(tmp, IOADDR(A_BCM1480_IMR_REGISTER(cpu, R_BCM1480_IMR_INTERRUPT_MASK_H)));
407 }
408 tmp = ~((u64) 0);
409 for (cpu = 0; cpu < 4; cpu++) {
410 __raw_writeq(tmp, IOADDR(A_BCM1480_IMR_REGISTER(cpu, R_BCM1480_IMR_INTERRUPT_MASK_L)));
411 }
412
413 bcm1480_steal_irq(K_BCM1480_INT_MBOX_0_0);
414
415 /*
416 * Note that the timer interrupts are also mapped, but this is
417 * done in bcm1480_time_init(). Also, the profiling driver
418 * does its own management of IP7.
419 */
420
421#ifdef CONFIG_KGDB
422 imask |= STATUSF_IP6;
423#endif
424 /* Enable necessary IPs, disable the rest */
425 change_c0_status(ST0_IM, imask);
426 set_except_vector(0, bcm1480_irq_handler);
427
428#ifdef CONFIG_KGDB
429 if (kgdb_flag) {
430 kgdb_irq = K_BCM1480_INT_UART_0 + kgdb_port;
431
432#ifdef CONFIG_SIBYTE_SB1250_DUART
433 sb1250_duart_present[kgdb_port] = 0;
434#endif
435 /* Setup uart 1 settings, mapper */
436 /* QQQ FIXME */
437 __raw_writeq(M_DUART_IMR_BRK, IO_SPACE_BASE + A_DUART_IMRREG(kgdb_port));
438
439 bcm1480_steal_irq(kgdb_irq);
440 __raw_writeq(IMR_IP6_VAL,
441 IO_SPACE_BASE + A_BCM1480_IMR_REGISTER(0, R_BCM1480_IMR_INTERRUPT_MAP_BASE_H) +
442 (kgdb_irq<<3));
443 bcm1480_unmask_irq(0, kgdb_irq);
444
445#ifdef CONFIG_GDB_CONSOLE
446 register_gdb_console();
447#endif
448 prom_printf("Waiting for GDB on UART port %d\n", kgdb_port);
449 set_debug_traps();
450 breakpoint();
451 }
452#endif
453}
454
455#ifdef CONFIG_KGDB
456
457#include <linux/delay.h>
458
459#define duart_out(reg, val) csr_out32(val, IOADDR(A_DUART_CHANREG(kgdb_port,reg)))
460#define duart_in(reg) csr_in32(IOADDR(A_DUART_CHANREG(kgdb_port,reg)))
461
462void bcm1480_kgdb_interrupt(struct pt_regs *regs)
463{
464 /*
465 * Clear break-change status (allow some time for the remote
466 * host to stop the break, since we would see another
467 * interrupt on the end-of-break too)
468 */
469 kstat.irqs[smp_processor_id()][kgdb_irq]++;
470 mdelay(500);
471 duart_out(R_DUART_CMD, V_DUART_MISC_CMD_RESET_BREAK_INT |
472 M_DUART_RX_EN | M_DUART_TX_EN);
473 set_async_breakpoint(&regs->cp0_epc);
474}
475
476#endif /* CONFIG_KGDB */
diff --git a/arch/mips/sibyte/bcm1480/irq_handler.S b/arch/mips/sibyte/bcm1480/irq_handler.S
new file mode 100644
index 000000000000..408db88d050f
--- /dev/null
+++ b/arch/mips/sibyte/bcm1480/irq_handler.S
@@ -0,0 +1,165 @@
1/*
2 * Copyright (C) 2000,2001,2002,2003,2004 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 * bcm1480_irq_handler() is the routine that is actually called when an
21 * interrupt occurs. It is installed as the exception vector handler in
22 * init_IRQ() in arch/mips/sibyte/bcm1480/irq.c
23 *
24 * In the handle we figure out which interrupts need handling, and use that
25 * to call the dispatcher, which will take care of actually calling
26 * registered handlers
27 *
28 * Note that we take care of all raised interrupts in one go at the handler.
29 * This is more BSDish than the Indy code, and also, IMHO, more sane.
30 */
31#include <linux/config.h>
32
33#include <asm/addrspace.h>
34#include <asm/asm.h>
35#include <asm/mipsregs.h>
36#include <asm/regdef.h>
37#include <asm/stackframe.h>
38#include <asm/sibyte/sb1250_defs.h>
39#include <asm/sibyte/bcm1480_regs.h>
40#include <asm/sibyte/bcm1480_int.h>
41
42/*
43 * What a pain. We have to be really careful saving the upper 32 bits of any
44 * register across function calls if we don't want them trashed--since were
45 * running in -o32, the calling routing never saves the full 64 bits of a
46 * register across a function call. Being the interrupt handler, we're
47 * guaranteed that interrupts are disabled during this code so we don't have
48 * to worry about random interrupts blasting the high 32 bits.
49 */
50
51 .text
52 .set push
53 .set noreorder
54 .set noat
55 .set mips64
56 #.set mips4
57 .align 5
58 NESTED(bcm1480_irq_handler, PT_SIZE, sp)
59 SAVE_ALL
60 CLI
61
62#ifdef CONFIG_SIBYTE_BCM1480_PROF
63 /* Set compare to count to silence count/compare timer interrupts */
64 mfc0 t1, CP0_COUNT
65 mtc0 t1, CP0_COMPARE /* pause to clear IP[7] bit of cause ? */
66#endif
67 /* Read cause */
68 mfc0 s0, CP0_CAUSE
69
70#ifdef CONFIG_SIBYTE_BCM1480_PROF
71 /* Cpu performance counter interrupt is routed to IP[7] */
72 andi t1, s0, CAUSEF_IP7
73 beqz t1, 0f
74 srl t1, s0, (CAUSEB_BD-2) /* Shift BD bit to bit 2 */
75 and t1, t1, 0x4 /* mask to get just BD bit */
76#ifdef CONFIG_MIPS64
77 dmfc0 a0, CP0_EPC
78 daddu a0, a0, t1 /* a0 = EPC + (BD ? 4 : 0) */
79#else
80 mfc0 a0, CP0_EPC
81 addu a0, a0, t1 /* a0 = EPC + (BD ? 4 : 0) */
82#endif
83 jal sbprof_cpu_intr
84 nop
85 j ret_from_irq
86 nop
870:
88#endif
89
90 /* Timer interrupt is routed to IP[4] */
91 andi t1, s0, CAUSEF_IP4
92 beqz t1, 1f
93 nop
94 jal bcm1480_timer_interrupt
95 move a0, sp /* Pass the registers along */
96 j ret_from_irq
97 nop /* delay slot */
981:
99
100#ifdef CONFIG_SMP
101 /* Mailbox interrupt is routed to IP[3] */
102 andi t1, s0, CAUSEF_IP3
103 beqz t1, 2f
104 nop
105 jal bcm1480_mailbox_interrupt
106 move a0, sp
107 j ret_from_irq
108 nop /* delay slot */
1092:
110#endif
111
112#ifdef CONFIG_KGDB
113 /* KGDB (uart 1) interrupt is routed to IP[6] */
114 andi t1, s0, CAUSEF_IP6
115 beqz t1, 3f
116 nop /* delay slot */
117 jal bcm1480_kgdb_interrupt
118 move a0, sp
119 j ret_from_irq
120 nop /* delay slot */
1213:
122#endif
123
124 and t1, s0, CAUSEF_IP2
125 beqz t1, 9f
126 nop
127
128 /*
129 * Default...we've hit an IP[2] interrupt, which means we've got
130 * to check the 1480 interrupt registers to figure out what to do
131 * Need to detect which CPU we're on, now that smp_affinity is
132 * supported.
133 */
134 PTR_LA v0, CKSEG1 + A_BCM1480_IMR_CPU0_BASE
135#ifdef CONFIG_SMP
136 lw t1, TI_CPU($28)
137 sll t1, t1, BCM1480_IMR_REGISTER_SPACING_SHIFT
138 addu v0, v0, t1
139#endif
140
141 /* Read IP[2] status (get both high and low halves of status) */
142 ld s0, R_BCM1480_IMR_INTERRUPT_STATUS_BASE_H(v0)
143 ld s1, R_BCM1480_IMR_INTERRUPT_STATUS_BASE_L(v0)
144
145 move s2, zero /* intr number */
146 li s3, 64
147
148 beqz s0, 9f /* No interrupts. Return. */
149 move a1, sp
150
151 xori s4, s0, 1 /* if s0 (_H) == 1, it's a low intr, so... */
152 movz s2, s3, s4 /* start the intr number at 64, and */
153 movz s0, s1, s4 /* look at the low status value. */
154
155 dclz s1, s0 /* Find the next interrupt. */
156 dsubu a0, zero, s1
157 daddiu a0, a0, 63
158 jal do_IRQ
159 daddu a0, a0, s2
160
1619: j ret_from_irq
162 nop
163
164 .set pop
165 END(bcm1480_irq_handler)
diff --git a/arch/mips/sibyte/bcm1480/setup.c b/arch/mips/sibyte/bcm1480/setup.c
new file mode 100644
index 000000000000..d90a0b87874c
--- /dev/null
+++ b/arch/mips/sibyte/bcm1480/setup.c
@@ -0,0 +1,136 @@
1/*
2 * Copyright (C) 2000,2001,2002,2003,2004 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#include <linux/config.h>
19#include <linux/kernel.h>
20#include <linux/reboot.h>
21#include <linux/string.h>
22
23#include <asm/bootinfo.h>
24#include <asm/mipsregs.h>
25#include <asm/io.h>
26#include <asm/sibyte/sb1250.h>
27
28#include <asm/sibyte/bcm1480_regs.h>
29#include <asm/sibyte/bcm1480_scd.h>
30#include <asm/sibyte/sb1250_scd.h>
31
32unsigned int sb1_pass;
33unsigned int soc_pass;
34unsigned int soc_type;
35unsigned int periph_rev;
36unsigned int zbbus_mhz;
37
38static unsigned int part_type;
39
40static char *soc_str;
41static char *pass_str;
42
43static inline int setup_bcm1x80_bcm1x55(void);
44
45/* Setup code likely to be common to all SiByte platforms */
46
47static inline int sys_rev_decode(void)
48{
49 int ret = 0;
50
51 switch (soc_type) {
52 case K_SYS_SOC_TYPE_BCM1x80:
53 if (part_type == K_SYS_PART_BCM1480)
54 soc_str = "BCM1480";
55 else if (part_type == K_SYS_PART_BCM1280)
56 soc_str = "BCM1280";
57 else
58 soc_str = "BCM1x80";
59 ret = setup_bcm1x80_bcm1x55();
60 break;
61
62 case K_SYS_SOC_TYPE_BCM1x55:
63 if (part_type == K_SYS_PART_BCM1455)
64 soc_str = "BCM1455";
65 else if (part_type == K_SYS_PART_BCM1255)
66 soc_str = "BCM1255";
67 else
68 soc_str = "BCM1x55";
69 ret = setup_bcm1x80_bcm1x55();
70 break;
71
72 default:
73 prom_printf("Unknown part type %x\n", part_type);
74 ret = 1;
75 break;
76 }
77 return ret;
78}
79
80static inline int setup_bcm1x80_bcm1x55(void)
81{
82 int ret = 0;
83
84 switch (soc_pass) {
85 case K_SYS_REVISION_BCM1480_S0:
86 periph_rev = 1;
87 pass_str = "S0 (pass1)";
88 break;
89 case K_SYS_REVISION_BCM1480_A1:
90 periph_rev = 1;
91 pass_str = "A1 (pass1)";
92 break;
93 case K_SYS_REVISION_BCM1480_A2:
94 periph_rev = 1;
95 pass_str = "A2 (pass1)";
96 break;
97 case K_SYS_REVISION_BCM1480_A3:
98 periph_rev = 1;
99 pass_str = "A3 (pass1)";
100 break;
101 case K_SYS_REVISION_BCM1480_B0:
102 periph_rev = 1;
103 pass_str = "B0 (pass2)";
104 break;
105 default:
106 prom_printf("Unknown %s rev %x\n", soc_str, soc_pass);
107 periph_rev = 1;
108 pass_str = "Unknown Revision";
109 break;
110 }
111 return ret;
112}
113
114void bcm1480_setup(void)
115{
116 uint64_t sys_rev;
117 int plldiv;
118
119 sb1_pass = read_c0_prid() & 0xff;
120 sys_rev = __raw_readq(IOADDR(A_SCD_SYSTEM_REVISION));
121 soc_type = SYS_SOC_TYPE(sys_rev);
122 part_type = G_SYS_PART(sys_rev);
123 soc_pass = G_SYS_REVISION(sys_rev);
124
125 if (sys_rev_decode()) {
126 prom_printf("Restart after failure to identify SiByte chip\n");
127 machine_restart(NULL);
128 }
129
130 plldiv = G_BCM1480_SYS_PLL_DIV(__raw_readq(IOADDR(A_SCD_SYSTEM_CFG)));
131 zbbus_mhz = ((plldiv >> 1) * 50) + ((plldiv & 1) * 25);
132
133 prom_printf("Broadcom SiByte %s %s @ %d MHz (SB-1A rev %d)\n",
134 soc_str, pass_str, zbbus_mhz * 2, sb1_pass);
135 prom_printf("Board type: %s\n", get_system_type());
136}
diff --git a/arch/mips/sibyte/bcm1480/smp.c b/arch/mips/sibyte/bcm1480/smp.c
new file mode 100644
index 000000000000..584a4b33faac
--- /dev/null
+++ b/arch/mips/sibyte/bcm1480/smp.c
@@ -0,0 +1,110 @@
1/*
2 * Copyright (C) 2001,2002,2004 Broadcom Corporation
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18
19#include <linux/init.h>
20#include <linux/delay.h>
21#include <linux/smp.h>
22#include <linux/kernel_stat.h>
23
24#include <asm/mmu_context.h>
25#include <asm/io.h>
26#include <asm/sibyte/sb1250.h>
27#include <asm/sibyte/bcm1480_regs.h>
28#include <asm/sibyte/bcm1480_int.h>
29
30extern void smp_call_function_interrupt(void);
31
32/*
33 * These are routines for dealing with the bcm1480 smp capabilities
34 * independent of board/firmware
35 */
36
37static void *mailbox_0_set_regs[] = {
38 IOADDR(A_BCM1480_IMR_CPU0_BASE + R_BCM1480_IMR_MAILBOX_0_SET_CPU),
39 IOADDR(A_BCM1480_IMR_CPU1_BASE + R_BCM1480_IMR_MAILBOX_0_SET_CPU),
40 IOADDR(A_BCM1480_IMR_CPU2_BASE + R_BCM1480_IMR_MAILBOX_0_SET_CPU),
41 IOADDR(A_BCM1480_IMR_CPU3_BASE + R_BCM1480_IMR_MAILBOX_0_SET_CPU),
42};
43
44static void *mailbox_0_clear_regs[] = {
45 IOADDR(A_BCM1480_IMR_CPU0_BASE + R_BCM1480_IMR_MAILBOX_0_CLR_CPU),
46 IOADDR(A_BCM1480_IMR_CPU1_BASE + R_BCM1480_IMR_MAILBOX_0_CLR_CPU),
47 IOADDR(A_BCM1480_IMR_CPU2_BASE + R_BCM1480_IMR_MAILBOX_0_CLR_CPU),
48 IOADDR(A_BCM1480_IMR_CPU3_BASE + R_BCM1480_IMR_MAILBOX_0_CLR_CPU),
49};
50
51static void *mailbox_0_regs[] = {
52 IOADDR(A_BCM1480_IMR_CPU0_BASE + R_BCM1480_IMR_MAILBOX_0_CPU),
53 IOADDR(A_BCM1480_IMR_CPU1_BASE + R_BCM1480_IMR_MAILBOX_0_CPU),
54 IOADDR(A_BCM1480_IMR_CPU2_BASE + R_BCM1480_IMR_MAILBOX_0_CPU),
55 IOADDR(A_BCM1480_IMR_CPU3_BASE + R_BCM1480_IMR_MAILBOX_0_CPU),
56};
57
58/*
59 * SMP init and finish on secondary CPUs
60 */
61void bcm1480_smp_init(void)
62{
63 unsigned int imask = STATUSF_IP4 | STATUSF_IP3 | STATUSF_IP2 |
64 STATUSF_IP1 | STATUSF_IP0;
65
66 /* Set interrupt mask, but don't enable */
67 change_c0_status(ST0_IM, imask);
68}
69
70void bcm1480_smp_finish(void)
71{
72 extern void bcm1480_time_init(void);
73 bcm1480_time_init();
74 local_irq_enable();
75}
76
77/*
78 * These are routines for dealing with the sb1250 smp capabilities
79 * independent of board/firmware
80 */
81
82/*
83 * Simple enough; everything is set up, so just poke the appropriate mailbox
84 * register, and we should be set
85 */
86void core_send_ipi(int cpu, unsigned int action)
87{
88 __raw_writeq((((u64)action)<< 48), mailbox_0_set_regs[cpu]);
89}
90
91void bcm1480_mailbox_interrupt(struct pt_regs *regs)
92{
93 int cpu = smp_processor_id();
94 unsigned int action;
95
96 kstat_this_cpu.irqs[K_BCM1480_INT_MBOX_0_0]++;
97 /* Load the mailbox register to figure out what we're supposed to do */
98 action = (__raw_readq(mailbox_0_regs[cpu]) >> 48) & 0xffff;
99
100 /* Clear the mailbox to clear the interrupt */
101 __raw_writeq(((u64)action)<<48, mailbox_0_clear_regs[cpu]);
102
103 /*
104 * Nothing to do for SMP_RESCHEDULE_YOURSELF; returning from the
105 * interrupt will do the reschedule for us
106 */
107
108 if (action & SMP_CALL_FUNCTION)
109 smp_call_function_interrupt();
110}
diff --git a/arch/mips/sibyte/bcm1480/time.c b/arch/mips/sibyte/bcm1480/time.c
new file mode 100644
index 000000000000..e545752695a1
--- /dev/null
+++ b/arch/mips/sibyte/bcm1480/time.c
@@ -0,0 +1,138 @@
1/*
2 * Copyright (C) 2000,2001,2004 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 * These are routines to set up and handle interrupts from the
21 * bcm1480 general purpose timer 0. We're using the timer as a
22 * system clock, so we set it up to run at 100 Hz. On every
23 * interrupt, we update our idea of what the time of day is,
24 * then call do_timer() in the architecture-independent kernel
25 * code to do general bookkeeping (e.g. update jiffies, run
26 * bottom halves, etc.)
27 */
28#include <linux/config.h>
29#include <linux/interrupt.h>
30#include <linux/sched.h>
31#include <linux/spinlock.h>
32#include <linux/kernel_stat.h>
33
34#include <asm/irq.h>
35#include <asm/ptrace.h>
36#include <asm/addrspace.h>
37#include <asm/time.h>
38#include <asm/io.h>
39
40#include <asm/sibyte/bcm1480_regs.h>
41#include <asm/sibyte/sb1250_regs.h>
42#include <asm/sibyte/bcm1480_int.h>
43#include <asm/sibyte/bcm1480_scd.h>
44
45#include <asm/sibyte/sb1250.h>
46
47
48#define IMR_IP2_VAL K_BCM1480_INT_MAP_I0
49#define IMR_IP3_VAL K_BCM1480_INT_MAP_I1
50#define IMR_IP4_VAL K_BCM1480_INT_MAP_I2
51
52extern int bcm1480_steal_irq(int irq);
53
54void bcm1480_time_init(void)
55{
56 int cpu = smp_processor_id();
57 int irq = K_BCM1480_INT_TIMER_0+cpu;
58
59 /* Only have 4 general purpose timers */
60 if (cpu > 3) {
61 BUG();
62 }
63
64 if (!cpu) {
65 /* Use our own gettimeoffset() routine */
66 do_gettimeoffset = bcm1480_gettimeoffset;
67 }
68
69 bcm1480_mask_irq(cpu, irq);
70
71 /* Map the timer interrupt to ip[4] of this cpu */
72 __raw_writeq(IMR_IP4_VAL, IOADDR(A_BCM1480_IMR_REGISTER(cpu, R_BCM1480_IMR_INTERRUPT_MAP_BASE_H)
73 + (irq<<3)));
74
75 /* the general purpose timer ticks at 1 Mhz independent of the rest of the system */
76 /* Disable the timer and set up the count */
77 __raw_writeq(0, IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG)));
78 __raw_writeq(
79#ifndef CONFIG_SIMULATION
80 1000000/HZ
81#else
82 50000/HZ
83#endif
84 , IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT)));
85
86 /* Set the timer running */
87 __raw_writeq(M_SCD_TIMER_ENABLE|M_SCD_TIMER_MODE_CONTINUOUS,
88 IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG)));
89
90 bcm1480_unmask_irq(cpu, irq);
91 bcm1480_steal_irq(irq);
92 /*
93 * This interrupt is "special" in that it doesn't use the request_irq
94 * way to hook the irq line. The timer interrupt is initialized early
95 * enough to make this a major pain, and it's also firing enough to
96 * warrant a bit of special case code. bcm1480_timer_interrupt is
97 * called directly from irq_handler.S when IP[4] is set during an
98 * interrupt
99 */
100}
101
102#include <asm/sibyte/sb1250.h>
103
104void bcm1480_timer_interrupt(struct pt_regs *regs)
105{
106 int cpu = smp_processor_id();
107 int irq = K_BCM1480_INT_TIMER_0+cpu;
108
109 /* Reset the timer */
110 __raw_writeq(M_SCD_TIMER_ENABLE|M_SCD_TIMER_MODE_CONTINUOUS,
111 IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG)));
112
113 /*
114 * CPU 0 handles the global timer interrupt job
115 */
116 if (cpu == 0) {
117 ll_timer_interrupt(irq, regs);
118 }
119
120 /*
121 * every CPU should do profiling and process accouting
122 */
123 ll_local_timer_interrupt(irq, regs);
124}
125
126/*
127 * We use our own do_gettimeoffset() instead of the generic one,
128 * because the generic one does not work for SMP case.
129 * In addition, since we use general timer 0 for system time,
130 * we can get accurate intra-jiffy offset without calibration.
131 */
132unsigned long bcm1480_gettimeoffset(void)
133{
134 unsigned long count =
135 __raw_readq(IOADDR(A_SCD_TIMER_REGISTER(0, R_SCD_TIMER_CNT)));
136
137 return 1000000/HZ - count;
138}
diff --git a/arch/mips/sibyte/cfe/smp.c b/arch/mips/sibyte/cfe/smp.c
index e44ce1a9eea9..e8485124b8fc 100644
--- a/arch/mips/sibyte/cfe/smp.c
+++ b/arch/mips/sibyte/cfe/smp.c
@@ -70,8 +70,15 @@ void prom_boot_secondary(int cpu, struct task_struct *idle)
70 */ 70 */
71void prom_init_secondary(void) 71void prom_init_secondary(void)
72{ 72{
73#if defined(CONFIG_SIBYTE_BCM1x55) || defined(CONFIG_SIBYTE_BCM1x80)
74 extern void bcm1480_smp_init(void);
75 bcm1480_smp_init();
76#elif defined(CONFIG_SIBYTE_SB1250)
73 extern void sb1250_smp_init(void); 77 extern void sb1250_smp_init(void);
74 sb1250_smp_init(); 78 sb1250_smp_init();
79#else
80#error invalid SMP configuration
81#endif
75} 82}
76 83
77/* 84/*
@@ -80,8 +87,15 @@ void prom_init_secondary(void)
80 */ 87 */
81void prom_smp_finish(void) 88void prom_smp_finish(void)
82{ 89{
90#if defined(CONFIG_SIBYTE_BCM1x55) || defined(CONFIG_SIBYTE_BCM1x80)
91 extern void bcm1480_smp_finish(void);
92 bcm1480_smp_finish();
93#elif defined(CONFIG_SIBYTE_SB1250)
83 extern void sb1250_smp_finish(void); 94 extern void sb1250_smp_finish(void);
84 sb1250_smp_finish(); 95 sb1250_smp_finish();
96#else
97#error invalid SMP configuration
98#endif
85} 99}
86 100
87/* 101/*
diff --git a/arch/mips/sibyte/sb1250/bcm1250_tbprof.c b/arch/mips/sibyte/sb1250/bcm1250_tbprof.c
index 7f813ae9eaff..992e0d8dbb67 100644
--- a/arch/mips/sibyte/sb1250/bcm1250_tbprof.c
+++ b/arch/mips/sibyte/sb1250/bcm1250_tbprof.c
@@ -28,6 +28,8 @@
28#include <linux/fs.h> 28#include <linux/fs.h>
29#include <linux/errno.h> 29#include <linux/errno.h>
30#include <linux/reboot.h> 30#include <linux/reboot.h>
31#include <linux/smp_lock.h>
32#include <linux/wait.h>
31#include <asm/uaccess.h> 33#include <asm/uaccess.h>
32#include <asm/io.h> 34#include <asm/io.h>
33#include <asm/sibyte/sb1250.h> 35#include <asm/sibyte/sb1250.h>
@@ -64,24 +66,25 @@ static void arm_tb(void)
64 u_int64_t tb_options = M_SCD_TRACE_CFG_FREEZE_FULL; 66 u_int64_t tb_options = M_SCD_TRACE_CFG_FREEZE_FULL;
65 /* Generate an SCD_PERFCNT interrupt in TB_PERIOD Zclks to 67 /* Generate an SCD_PERFCNT interrupt in TB_PERIOD Zclks to
66 trigger start of trace. XXX vary sampling period */ 68 trigger start of trace. XXX vary sampling period */
67 bus_writeq(0, IOADDR(A_SCD_PERF_CNT_1)); 69 __raw_writeq(0, IOADDR(A_SCD_PERF_CNT_1));
68 scdperfcnt = bus_readq(IOADDR(A_SCD_PERF_CNT_CFG)); 70 scdperfcnt = __raw_readq(IOADDR(A_SCD_PERF_CNT_CFG));
69 /* Unfortunately, in Pass 2 we must clear all counters to knock down 71 /* Unfortunately, in Pass 2 we must clear all counters to knock down
70 a previous interrupt request. This means that bus profiling 72 a previous interrupt request. This means that bus profiling
71 requires ALL of the SCD perf counters. */ 73 requires ALL of the SCD perf counters. */
72 bus_writeq((scdperfcnt & ~M_SPC_CFG_SRC1) | // keep counters 0,2,3 as is 74 __raw_writeq((scdperfcnt & ~M_SPC_CFG_SRC1) |
73 M_SPC_CFG_ENABLE | // enable counting 75 // keep counters 0,2,3 as is
74 M_SPC_CFG_CLEAR | // clear all counters 76 M_SPC_CFG_ENABLE | // enable counting
75 V_SPC_CFG_SRC1(1), // counter 1 counts cycles 77 M_SPC_CFG_CLEAR | // clear all counters
76 IOADDR(A_SCD_PERF_CNT_CFG)); 78 V_SPC_CFG_SRC1(1), // counter 1 counts cycles
77 bus_writeq(next, IOADDR(A_SCD_PERF_CNT_1)); 79 IOADDR(A_SCD_PERF_CNT_CFG));
80 __raw_writeq(next, IOADDR(A_SCD_PERF_CNT_1));
78 /* Reset the trace buffer */ 81 /* Reset the trace buffer */
79 bus_writeq(M_SCD_TRACE_CFG_RESET, IOADDR(A_SCD_TRACE_CFG)); 82 __raw_writeq(M_SCD_TRACE_CFG_RESET, IOADDR(A_SCD_TRACE_CFG));
80#if 0 && defined(M_SCD_TRACE_CFG_FORCECNT) 83#if 0 && defined(M_SCD_TRACE_CFG_FORCECNT)
81 /* XXXKW may want to expose control to the data-collector */ 84 /* XXXKW may want to expose control to the data-collector */
82 tb_options |= M_SCD_TRACE_CFG_FORCECNT; 85 tb_options |= M_SCD_TRACE_CFG_FORCECNT;
83#endif 86#endif
84 bus_writeq(tb_options, IOADDR(A_SCD_TRACE_CFG)); 87 __raw_writeq(tb_options, IOADDR(A_SCD_TRACE_CFG));
85 sbp.tb_armed = 1; 88 sbp.tb_armed = 1;
86} 89}
87 90
@@ -93,23 +96,30 @@ static irqreturn_t sbprof_tb_intr(int irq, void *dev_id, struct pt_regs *regs)
93 /* XXX should use XKPHYS to make writes bypass L2 */ 96 /* XXX should use XKPHYS to make writes bypass L2 */
94 u_int64_t *p = sbp.sbprof_tbbuf[sbp.next_tb_sample++]; 97 u_int64_t *p = sbp.sbprof_tbbuf[sbp.next_tb_sample++];
95 /* Read out trace */ 98 /* Read out trace */
96 bus_writeq(M_SCD_TRACE_CFG_START_READ, IOADDR(A_SCD_TRACE_CFG)); 99 __raw_writeq(M_SCD_TRACE_CFG_START_READ,
100 IOADDR(A_SCD_TRACE_CFG));
97 __asm__ __volatile__ ("sync" : : : "memory"); 101 __asm__ __volatile__ ("sync" : : : "memory");
98 /* Loop runs backwards because bundles are read out in reverse order */ 102 /* Loop runs backwards because bundles are read out in reverse order */
99 for (i = 256 * 6; i > 0; i -= 6) { 103 for (i = 256 * 6; i > 0; i -= 6) {
100 // Subscripts decrease to put bundle in the order 104 // Subscripts decrease to put bundle in the order
101 // t0 lo, t0 hi, t1 lo, t1 hi, t2 lo, t2 hi 105 // t0 lo, t0 hi, t1 lo, t1 hi, t2 lo, t2 hi
102 p[i-1] = bus_readq(IOADDR(A_SCD_TRACE_READ)); // read t2 hi 106 p[i - 1] = __raw_readq(IOADDR(A_SCD_TRACE_READ));
103 p[i-2] = bus_readq(IOADDR(A_SCD_TRACE_READ)); // read t2 lo 107 // read t2 hi
104 p[i-3] = bus_readq(IOADDR(A_SCD_TRACE_READ)); // read t1 hi 108 p[i - 2] = __raw_readq(IOADDR(A_SCD_TRACE_READ));
105 p[i-4] = bus_readq(IOADDR(A_SCD_TRACE_READ)); // read t1 lo 109 // read t2 lo
106 p[i-5] = bus_readq(IOADDR(A_SCD_TRACE_READ)); // read t0 hi 110 p[i - 3] = __raw_readq(IOADDR(A_SCD_TRACE_READ));
107 p[i-6] = bus_readq(IOADDR(A_SCD_TRACE_READ)); // read t0 lo 111 // read t1 hi
112 p[i - 4] = __raw_readq(IOADDR(A_SCD_TRACE_READ));
113 // read t1 lo
114 p[i - 5] = __raw_readq(IOADDR(A_SCD_TRACE_READ));
115 // read t0 hi
116 p[i - 6] = __raw_readq(IOADDR(A_SCD_TRACE_READ));
117 // read t0 lo
108 } 118 }
109 if (!sbp.tb_enable) { 119 if (!sbp.tb_enable) {
110 DBG(printk(DEVNAME ": tb_intr shutdown\n")); 120 DBG(printk(DEVNAME ": tb_intr shutdown\n"));
111 bus_writeq(M_SCD_TRACE_CFG_RESET, 121 __raw_writeq(M_SCD_TRACE_CFG_RESET,
112 IOADDR(A_SCD_TRACE_CFG)); 122 IOADDR(A_SCD_TRACE_CFG));
113 sbp.tb_armed = 0; 123 sbp.tb_armed = 0;
114 wake_up(&sbp.tb_sync); 124 wake_up(&sbp.tb_sync);
115 } else { 125 } else {
@@ -118,7 +128,7 @@ static irqreturn_t sbprof_tb_intr(int irq, void *dev_id, struct pt_regs *regs)
118 } else { 128 } else {
119 /* No more trace buffer samples */ 129 /* No more trace buffer samples */
120 DBG(printk(DEVNAME ": tb_intr full\n")); 130 DBG(printk(DEVNAME ": tb_intr full\n"));
121 bus_writeq(M_SCD_TRACE_CFG_RESET, IOADDR(A_SCD_TRACE_CFG)); 131 __raw_writeq(M_SCD_TRACE_CFG_RESET, IOADDR(A_SCD_TRACE_CFG));
122 sbp.tb_armed = 0; 132 sbp.tb_armed = 0;
123 if (!sbp.tb_enable) { 133 if (!sbp.tb_enable) {
124 wake_up(&sbp.tb_sync); 134 wake_up(&sbp.tb_sync);
@@ -152,13 +162,11 @@ int sbprof_zbprof_start(struct file *filp)
152 return -EBUSY; 162 return -EBUSY;
153 } 163 }
154 /* Make sure there isn't a perf-cnt interrupt waiting */ 164 /* Make sure there isn't a perf-cnt interrupt waiting */
155 scdperfcnt = bus_readq(IOADDR(A_SCD_PERF_CNT_CFG)); 165 scdperfcnt = __raw_readq(IOADDR(A_SCD_PERF_CNT_CFG));
156 /* Disable and clear counters, override SRC_1 */ 166 /* Disable and clear counters, override SRC_1 */
157 bus_writeq((scdperfcnt & ~(M_SPC_CFG_SRC1 | M_SPC_CFG_ENABLE)) | 167 __raw_writeq((scdperfcnt & ~(M_SPC_CFG_SRC1 | M_SPC_CFG_ENABLE)) |
158 M_SPC_CFG_ENABLE | 168 M_SPC_CFG_ENABLE | M_SPC_CFG_CLEAR | V_SPC_CFG_SRC1(1),
159 M_SPC_CFG_CLEAR | 169 IOADDR(A_SCD_PERF_CNT_CFG));
160 V_SPC_CFG_SRC1(1),
161 IOADDR(A_SCD_PERF_CNT_CFG));
162 170
163 /* We grab this interrupt to prevent others from trying to use 171 /* We grab this interrupt to prevent others from trying to use
164 it, even though we don't want to service the interrupts 172 it, even though we don't want to service the interrupts
@@ -172,55 +180,55 @@ int sbprof_zbprof_start(struct file *filp)
172 /* I need the core to mask these, but the interrupt mapper to 180 /* I need the core to mask these, but the interrupt mapper to
173 pass them through. I am exploiting my knowledge that 181 pass them through. I am exploiting my knowledge that
174 cp0_status masks out IP[5]. krw */ 182 cp0_status masks out IP[5]. krw */
175 bus_writeq(K_INT_MAP_I3, 183 __raw_writeq(K_INT_MAP_I3,
176 IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_MAP_BASE) + 184 IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_MAP_BASE) +
177 (K_INT_PERF_CNT << 3))); 185 (K_INT_PERF_CNT << 3)));
178 186
179 /* Initialize address traps */ 187 /* Initialize address traps */
180 bus_writeq(0, IOADDR(A_ADDR_TRAP_UP_0)); 188 __raw_writeq(0, IOADDR(A_ADDR_TRAP_UP_0));
181 bus_writeq(0, IOADDR(A_ADDR_TRAP_UP_1)); 189 __raw_writeq(0, IOADDR(A_ADDR_TRAP_UP_1));
182 bus_writeq(0, IOADDR(A_ADDR_TRAP_UP_2)); 190 __raw_writeq(0, IOADDR(A_ADDR_TRAP_UP_2));
183 bus_writeq(0, IOADDR(A_ADDR_TRAP_UP_3)); 191 __raw_writeq(0, IOADDR(A_ADDR_TRAP_UP_3));
184 192
185 bus_writeq(0, IOADDR(A_ADDR_TRAP_DOWN_0)); 193 __raw_writeq(0, IOADDR(A_ADDR_TRAP_DOWN_0));
186 bus_writeq(0, IOADDR(A_ADDR_TRAP_DOWN_1)); 194 __raw_writeq(0, IOADDR(A_ADDR_TRAP_DOWN_1));
187 bus_writeq(0, IOADDR(A_ADDR_TRAP_DOWN_2)); 195 __raw_writeq(0, IOADDR(A_ADDR_TRAP_DOWN_2));
188 bus_writeq(0, IOADDR(A_ADDR_TRAP_DOWN_3)); 196 __raw_writeq(0, IOADDR(A_ADDR_TRAP_DOWN_3));
189 197
190 bus_writeq(0, IOADDR(A_ADDR_TRAP_CFG_0)); 198 __raw_writeq(0, IOADDR(A_ADDR_TRAP_CFG_0));
191 bus_writeq(0, IOADDR(A_ADDR_TRAP_CFG_1)); 199 __raw_writeq(0, IOADDR(A_ADDR_TRAP_CFG_1));
192 bus_writeq(0, IOADDR(A_ADDR_TRAP_CFG_2)); 200 __raw_writeq(0, IOADDR(A_ADDR_TRAP_CFG_2));
193 bus_writeq(0, IOADDR(A_ADDR_TRAP_CFG_3)); 201 __raw_writeq(0, IOADDR(A_ADDR_TRAP_CFG_3));
194 202
195 /* Initialize Trace Event 0-7 */ 203 /* Initialize Trace Event 0-7 */
196 // when interrupt 204 // when interrupt
197 bus_writeq(M_SCD_TREVT_INTERRUPT, IOADDR(A_SCD_TRACE_EVENT_0)); 205 __raw_writeq(M_SCD_TREVT_INTERRUPT, IOADDR(A_SCD_TRACE_EVENT_0));
198 bus_writeq(0, IOADDR(A_SCD_TRACE_EVENT_1)); 206 __raw_writeq(0, IOADDR(A_SCD_TRACE_EVENT_1));
199 bus_writeq(0, IOADDR(A_SCD_TRACE_EVENT_2)); 207 __raw_writeq(0, IOADDR(A_SCD_TRACE_EVENT_2));
200 bus_writeq(0, IOADDR(A_SCD_TRACE_EVENT_3)); 208 __raw_writeq(0, IOADDR(A_SCD_TRACE_EVENT_3));
201 bus_writeq(0, IOADDR(A_SCD_TRACE_EVENT_4)); 209 __raw_writeq(0, IOADDR(A_SCD_TRACE_EVENT_4));
202 bus_writeq(0, IOADDR(A_SCD_TRACE_EVENT_5)); 210 __raw_writeq(0, IOADDR(A_SCD_TRACE_EVENT_5));
203 bus_writeq(0, IOADDR(A_SCD_TRACE_EVENT_6)); 211 __raw_writeq(0, IOADDR(A_SCD_TRACE_EVENT_6));
204 bus_writeq(0, IOADDR(A_SCD_TRACE_EVENT_7)); 212 __raw_writeq(0, IOADDR(A_SCD_TRACE_EVENT_7));
205 213
206 /* Initialize Trace Sequence 0-7 */ 214 /* Initialize Trace Sequence 0-7 */
207 // Start on event 0 (interrupt) 215 // Start on event 0 (interrupt)
208 bus_writeq(V_SCD_TRSEQ_FUNC_START | 0x0fff, 216 __raw_writeq(V_SCD_TRSEQ_FUNC_START | 0x0fff,
209 IOADDR(A_SCD_TRACE_SEQUENCE_0)); 217 IOADDR(A_SCD_TRACE_SEQUENCE_0));
210 // dsamp when d used | asamp when a used 218 // dsamp when d used | asamp when a used
211 bus_writeq(M_SCD_TRSEQ_ASAMPLE | M_SCD_TRSEQ_DSAMPLE | 219 __raw_writeq(M_SCD_TRSEQ_ASAMPLE | M_SCD_TRSEQ_DSAMPLE |
212 K_SCD_TRSEQ_TRIGGER_ALL, 220 K_SCD_TRSEQ_TRIGGER_ALL,
213 IOADDR(A_SCD_TRACE_SEQUENCE_1)); 221 IOADDR(A_SCD_TRACE_SEQUENCE_1));
214 bus_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_2)); 222 __raw_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_2));
215 bus_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_3)); 223 __raw_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_3));
216 bus_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_4)); 224 __raw_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_4));
217 bus_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_5)); 225 __raw_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_5));
218 bus_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_6)); 226 __raw_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_6));
219 bus_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_7)); 227 __raw_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_7));
220 228
221 /* Now indicate the PERF_CNT interrupt as a trace-relevant interrupt */ 229 /* Now indicate the PERF_CNT interrupt as a trace-relevant interrupt */
222 bus_writeq((1ULL << K_INT_PERF_CNT), 230 __raw_writeq(1ULL << K_INT_PERF_CNT,
223 IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_TRACE))); 231 IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_TRACE)));
224 232
225 arm_tb(); 233 arm_tb();
226 234
@@ -231,6 +239,7 @@ int sbprof_zbprof_start(struct file *filp)
231 239
232int sbprof_zbprof_stop(void) 240int sbprof_zbprof_stop(void)
233{ 241{
242 DEFINE_WAIT(wait);
234 DBG(printk(DEVNAME ": stopping\n")); 243 DBG(printk(DEVNAME ": stopping\n"));
235 244
236 if (sbp.tb_enable) { 245 if (sbp.tb_enable) {
@@ -240,7 +249,9 @@ int sbprof_zbprof_stop(void)
240 this sleep happens. */ 249 this sleep happens. */
241 if (sbp.tb_armed) { 250 if (sbp.tb_armed) {
242 DBG(printk(DEVNAME ": wait for disarm\n")); 251 DBG(printk(DEVNAME ": wait for disarm\n"));
243 interruptible_sleep_on(&sbp.tb_sync); 252 prepare_to_wait(&sbp.tb_sync, &wait, TASK_INTERRUPTIBLE);
253 schedule();
254 finish_wait(&sbp.tb_sync, &wait);
244 DBG(printk(DEVNAME ": disarm complete\n")); 255 DBG(printk(DEVNAME ": disarm complete\n"));
245 } 256 }
246 free_irq(K_INT_TRACE_FREEZE, &sbp); 257 free_irq(K_INT_TRACE_FREEZE, &sbp);
@@ -333,13 +344,13 @@ static ssize_t sbprof_tb_read(struct file *filp, char *buf,
333 return count; 344 return count;
334} 345}
335 346
336static int sbprof_tb_ioctl(struct inode *inode, 347static long sbprof_tb_ioctl(struct file *filp,
337 struct file *filp, 348 unsigned int command,
338 unsigned int command, 349 unsigned long arg)
339 unsigned long arg)
340{ 350{
341 int error = 0; 351 int error = 0;
342 352
353 lock_kernel();
343 switch (command) { 354 switch (command) {
344 case SBPROF_ZBSTART: 355 case SBPROF_ZBSTART:
345 error = sbprof_zbprof_start(filp); 356 error = sbprof_zbprof_start(filp);
@@ -348,13 +359,17 @@ static int sbprof_tb_ioctl(struct inode *inode,
348 error = sbprof_zbprof_stop(); 359 error = sbprof_zbprof_stop();
349 break; 360 break;
350 case SBPROF_ZBWAITFULL: 361 case SBPROF_ZBWAITFULL:
351 interruptible_sleep_on(&sbp.tb_read); 362 DEFINE_WAIT(wait);
363 prepare_to_wait(&sbp.tb_read, &wait, TASK_INTERRUPTIBLE);
364 schedule();
365 finish_wait(&sbp.tb_read, &wait);
352 /* XXXKW check if interrupted? */ 366 /* XXXKW check if interrupted? */
353 return put_user(TB_FULL, (int *) arg); 367 return put_user(TB_FULL, (int *) arg);
354 default: 368 default:
355 error = -EINVAL; 369 error = -EINVAL;
356 break; 370 break;
357 } 371 }
372 unlock_kernel();
358 373
359 return error; 374 return error;
360} 375}
@@ -364,7 +379,8 @@ static struct file_operations sbprof_tb_fops = {
364 .open = sbprof_tb_open, 379 .open = sbprof_tb_open,
365 .release = sbprof_tb_release, 380 .release = sbprof_tb_release,
366 .read = sbprof_tb_read, 381 .read = sbprof_tb_read,
367 .ioctl = sbprof_tb_ioctl, 382 .unlocked_ioctl = sbprof_tb_ioctl,
383 .compat_ioctl = sbprof_tb_ioctl,
368 .mmap = NULL, 384 .mmap = NULL,
369}; 385};
370 386
diff --git a/arch/mips/sibyte/sb1250/bus_watcher.c b/arch/mips/sibyte/sb1250/bus_watcher.c
index 1a97e3127aeb..482dee054e68 100644
--- a/arch/mips/sibyte/sb1250/bus_watcher.c
+++ b/arch/mips/sibyte/sb1250/bus_watcher.c
@@ -189,7 +189,7 @@ static irqreturn_t sibyte_bw_int(int irq, void *data, struct pt_regs *regs)
189 189
190 for (i=0; i<256*6; i++) 190 for (i=0; i<256*6; i++)
191 printk("%016llx\n", 191 printk("%016llx\n",
192 (unsigned long long)bus_readq(IOADDR(A_SCD_TRACE_READ))); 192 (long long)__raw_readq(IOADDR(A_SCD_TRACE_READ)));
193 193
194 csr_out32(M_SCD_TRACE_CFG_RESET, IOADDR(A_SCD_TRACE_CFG)); 194 csr_out32(M_SCD_TRACE_CFG_RESET, IOADDR(A_SCD_TRACE_CFG));
195 csr_out32(M_SCD_TRACE_CFG_START, IOADDR(A_SCD_TRACE_CFG)); 195 csr_out32(M_SCD_TRACE_CFG_START, IOADDR(A_SCD_TRACE_CFG));
diff --git a/arch/mips/sibyte/sb1250/irq.c b/arch/mips/sibyte/sb1250/irq.c
index 2725b263cced..589537bfcc3d 100644
--- a/arch/mips/sibyte/sb1250/irq.c
+++ b/arch/mips/sibyte/sb1250/irq.c
@@ -53,7 +53,7 @@ static void disable_sb1250_irq(unsigned int irq);
53static unsigned int startup_sb1250_irq(unsigned int irq); 53static unsigned int startup_sb1250_irq(unsigned int irq);
54static void ack_sb1250_irq(unsigned int irq); 54static void ack_sb1250_irq(unsigned int irq);
55#ifdef CONFIG_SMP 55#ifdef CONFIG_SMP
56static void sb1250_set_affinity(unsigned int irq, unsigned long mask); 56static void sb1250_set_affinity(unsigned int irq, cpumask_t mask);
57#endif 57#endif
58 58
59#ifdef CONFIG_SIBYTE_HAS_LDT 59#ifdef CONFIG_SIBYTE_HAS_LDT
@@ -71,17 +71,15 @@ extern char sb1250_duart_present[];
71#endif 71#endif
72 72
73static struct hw_interrupt_type sb1250_irq_type = { 73static struct hw_interrupt_type sb1250_irq_type = {
74 "SB1250-IMR", 74 .typename = "SB1250-IMR",
75 startup_sb1250_irq, 75 .startup = startup_sb1250_irq,
76 shutdown_sb1250_irq, 76 .shutdown = shutdown_sb1250_irq,
77 enable_sb1250_irq, 77 .enable = enable_sb1250_irq,
78 disable_sb1250_irq, 78 .disable = disable_sb1250_irq,
79 ack_sb1250_irq, 79 .ack = ack_sb1250_irq,
80 end_sb1250_irq, 80 .end = end_sb1250_irq,
81#ifdef CONFIG_SMP 81#ifdef CONFIG_SMP
82 sb1250_set_affinity 82 .set_affinity = sb1250_set_affinity
83#else
84 NULL
85#endif 83#endif
86}; 84};
87 85
@@ -96,11 +94,11 @@ void sb1250_mask_irq(int cpu, int irq)
96 u64 cur_ints; 94 u64 cur_ints;
97 95
98 spin_lock_irqsave(&sb1250_imr_lock, flags); 96 spin_lock_irqsave(&sb1250_imr_lock, flags);
99 cur_ints = __bus_readq(IOADDR(A_IMR_MAPPER(cpu) + 97 cur_ints = ____raw_readq(IOADDR(A_IMR_MAPPER(cpu) +
100 R_IMR_INTERRUPT_MASK)); 98 R_IMR_INTERRUPT_MASK));
101 cur_ints |= (((u64) 1) << irq); 99 cur_ints |= (((u64) 1) << irq);
102 __bus_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) + 100 ____raw_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) +
103 R_IMR_INTERRUPT_MASK)); 101 R_IMR_INTERRUPT_MASK));
104 spin_unlock_irqrestore(&sb1250_imr_lock, flags); 102 spin_unlock_irqrestore(&sb1250_imr_lock, flags);
105} 103}
106 104
@@ -110,32 +108,25 @@ void sb1250_unmask_irq(int cpu, int irq)
110 u64 cur_ints; 108 u64 cur_ints;
111 109
112 spin_lock_irqsave(&sb1250_imr_lock, flags); 110 spin_lock_irqsave(&sb1250_imr_lock, flags);
113 cur_ints = __bus_readq(IOADDR(A_IMR_MAPPER(cpu) + 111 cur_ints = ____raw_readq(IOADDR(A_IMR_MAPPER(cpu) +
114 R_IMR_INTERRUPT_MASK)); 112 R_IMR_INTERRUPT_MASK));
115 cur_ints &= ~(((u64) 1) << irq); 113 cur_ints &= ~(((u64) 1) << irq);
116 __bus_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) + 114 ____raw_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) +
117 R_IMR_INTERRUPT_MASK)); 115 R_IMR_INTERRUPT_MASK));
118 spin_unlock_irqrestore(&sb1250_imr_lock, flags); 116 spin_unlock_irqrestore(&sb1250_imr_lock, flags);
119} 117}
120 118
121#ifdef CONFIG_SMP 119#ifdef CONFIG_SMP
122static void sb1250_set_affinity(unsigned int irq, unsigned long mask) 120static void sb1250_set_affinity(unsigned int irq, cpumask_t mask)
123{ 121{
124 int i = 0, old_cpu, cpu, int_on; 122 int i = 0, old_cpu, cpu, int_on;
125 u64 cur_ints; 123 u64 cur_ints;
126 irq_desc_t *desc = irq_desc + irq; 124 irq_desc_t *desc = irq_desc + irq;
127 unsigned long flags; 125 unsigned long flags;
128 126
129 while (mask) { 127 i = first_cpu(mask);
130 if (mask & 1) {
131 mask >>= 1;
132 break;
133 }
134 mask >>= 1;
135 i++;
136 }
137 128
138 if (mask) { 129 if (cpus_weight(mask) > 1) {
139 printk("attempted to set irq affinity for irq %d to multiple CPUs\n", irq); 130 printk("attempted to set irq affinity for irq %d to multiple CPUs\n", irq);
140 return; 131 return;
141 } 132 }
@@ -149,23 +140,23 @@ static void sb1250_set_affinity(unsigned int irq, unsigned long mask)
149 140
150 /* Swizzle each CPU's IMR (but leave the IP selection alone) */ 141 /* Swizzle each CPU's IMR (but leave the IP selection alone) */
151 old_cpu = sb1250_irq_owner[irq]; 142 old_cpu = sb1250_irq_owner[irq];
152 cur_ints = __bus_readq(IOADDR(A_IMR_MAPPER(old_cpu) + 143 cur_ints = ____raw_readq(IOADDR(A_IMR_MAPPER(old_cpu) +
153 R_IMR_INTERRUPT_MASK)); 144 R_IMR_INTERRUPT_MASK));
154 int_on = !(cur_ints & (((u64) 1) << irq)); 145 int_on = !(cur_ints & (((u64) 1) << irq));
155 if (int_on) { 146 if (int_on) {
156 /* If it was on, mask it */ 147 /* If it was on, mask it */
157 cur_ints |= (((u64) 1) << irq); 148 cur_ints |= (((u64) 1) << irq);
158 __bus_writeq(cur_ints, IOADDR(A_IMR_MAPPER(old_cpu) + 149 ____raw_writeq(cur_ints, IOADDR(A_IMR_MAPPER(old_cpu) +
159 R_IMR_INTERRUPT_MASK)); 150 R_IMR_INTERRUPT_MASK));
160 } 151 }
161 sb1250_irq_owner[irq] = cpu; 152 sb1250_irq_owner[irq] = cpu;
162 if (int_on) { 153 if (int_on) {
163 /* unmask for the new CPU */ 154 /* unmask for the new CPU */
164 cur_ints = __bus_readq(IOADDR(A_IMR_MAPPER(cpu) + 155 cur_ints = ____raw_readq(IOADDR(A_IMR_MAPPER(cpu) +
165 R_IMR_INTERRUPT_MASK)); 156 R_IMR_INTERRUPT_MASK));
166 cur_ints &= ~(((u64) 1) << irq); 157 cur_ints &= ~(((u64) 1) << irq);
167 __bus_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) + 158 ____raw_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) +
168 R_IMR_INTERRUPT_MASK)); 159 R_IMR_INTERRUPT_MASK));
169 } 160 }
170 spin_unlock(&sb1250_imr_lock); 161 spin_unlock(&sb1250_imr_lock);
171 spin_unlock_irqrestore(&desc->lock, flags); 162 spin_unlock_irqrestore(&desc->lock, flags);
@@ -208,8 +199,8 @@ static void ack_sb1250_irq(unsigned int irq)
208 * deliver the interrupts to all CPUs (which makes affinity 199 * deliver the interrupts to all CPUs (which makes affinity
209 * changing easier for us) 200 * changing easier for us)
210 */ 201 */
211 pending = bus_readq(IOADDR(A_IMR_REGISTER(sb1250_irq_owner[irq], 202 pending = __raw_readq(IOADDR(A_IMR_REGISTER(sb1250_irq_owner[irq],
212 R_IMR_LDT_INTERRUPT))); 203 R_IMR_LDT_INTERRUPT)));
213 pending &= ((u64)1 << (irq)); 204 pending &= ((u64)1 << (irq));
214 if (pending) { 205 if (pending) {
215 int i; 206 int i;
@@ -224,8 +215,8 @@ static void ack_sb1250_irq(unsigned int irq)
224 * Clear for all CPUs so an affinity switch 215 * Clear for all CPUs so an affinity switch
225 * doesn't find an old status 216 * doesn't find an old status
226 */ 217 */
227 bus_writeq(pending, 218 __raw_writeq(pending,
228 IOADDR(A_IMR_REGISTER(cpu, 219 IOADDR(A_IMR_REGISTER(cpu,
229 R_IMR_LDT_INTERRUPT_CLR))); 220 R_IMR_LDT_INTERRUPT_CLR)));
230 } 221 }
231 222
@@ -340,12 +331,14 @@ void __init arch_init_irq(void)
340 331
341 /* Default everything to IP2 */ 332 /* Default everything to IP2 */
342 for (i = 0; i < SB1250_NR_IRQS; i++) { /* was I0 */ 333 for (i = 0; i < SB1250_NR_IRQS; i++) { /* was I0 */
343 bus_writeq(IMR_IP2_VAL, 334 __raw_writeq(IMR_IP2_VAL,
344 IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_MAP_BASE) + 335 IOADDR(A_IMR_REGISTER(0,
345 (i << 3))); 336 R_IMR_INTERRUPT_MAP_BASE) +
346 bus_writeq(IMR_IP2_VAL, 337 (i << 3)));
347 IOADDR(A_IMR_REGISTER(1, R_IMR_INTERRUPT_MAP_BASE) + 338 __raw_writeq(IMR_IP2_VAL,
348 (i << 3))); 339 IOADDR(A_IMR_REGISTER(1,
340 R_IMR_INTERRUPT_MAP_BASE) +
341 (i << 3)));
349 } 342 }
350 343
351 init_sb1250_irqs(); 344 init_sb1250_irqs();
@@ -355,23 +348,23 @@ void __init arch_init_irq(void)
355 * inter-cpu messages 348 * inter-cpu messages
356 */ 349 */
357 /* Was I1 */ 350 /* Was I1 */
358 bus_writeq(IMR_IP3_VAL, 351 __raw_writeq(IMR_IP3_VAL,
359 IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_MAP_BASE) + 352 IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_MAP_BASE) +
360 (K_INT_MBOX_0 << 3))); 353 (K_INT_MBOX_0 << 3)));
361 bus_writeq(IMR_IP3_VAL, 354 __raw_writeq(IMR_IP3_VAL,
362 IOADDR(A_IMR_REGISTER(1, R_IMR_INTERRUPT_MAP_BASE) + 355 IOADDR(A_IMR_REGISTER(1, R_IMR_INTERRUPT_MAP_BASE) +
363 (K_INT_MBOX_0 << 3))); 356 (K_INT_MBOX_0 << 3)));
364 357
365 /* Clear the mailboxes. The firmware may leave them dirty */ 358 /* Clear the mailboxes. The firmware may leave them dirty */
366 bus_writeq(0xffffffffffffffffULL, 359 __raw_writeq(0xffffffffffffffffULL,
367 IOADDR(A_IMR_REGISTER(0, R_IMR_MAILBOX_CLR_CPU))); 360 IOADDR(A_IMR_REGISTER(0, R_IMR_MAILBOX_CLR_CPU)));
368 bus_writeq(0xffffffffffffffffULL, 361 __raw_writeq(0xffffffffffffffffULL,
369 IOADDR(A_IMR_REGISTER(1, R_IMR_MAILBOX_CLR_CPU))); 362 IOADDR(A_IMR_REGISTER(1, R_IMR_MAILBOX_CLR_CPU)));
370 363
371 /* Mask everything except the mailbox registers for both cpus */ 364 /* Mask everything except the mailbox registers for both cpus */
372 tmp = ~((u64) 0) ^ (((u64) 1) << K_INT_MBOX_0); 365 tmp = ~((u64) 0) ^ (((u64) 1) << K_INT_MBOX_0);
373 bus_writeq(tmp, IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_MASK))); 366 __raw_writeq(tmp, IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_MASK)));
374 bus_writeq(tmp, IOADDR(A_IMR_REGISTER(1, R_IMR_INTERRUPT_MASK))); 367 __raw_writeq(tmp, IOADDR(A_IMR_REGISTER(1, R_IMR_INTERRUPT_MASK)));
375 368
376 sb1250_steal_irq(K_INT_MBOX_0); 369 sb1250_steal_irq(K_INT_MBOX_0);
377 370
@@ -396,12 +389,14 @@ void __init arch_init_irq(void)
396 sb1250_duart_present[kgdb_port] = 0; 389 sb1250_duart_present[kgdb_port] = 0;
397#endif 390#endif
398 /* Setup uart 1 settings, mapper */ 391 /* Setup uart 1 settings, mapper */
399 bus_writeq(M_DUART_IMR_BRK, IOADDR(A_DUART_IMRREG(kgdb_port))); 392 __raw_writeq(M_DUART_IMR_BRK,
393 IOADDR(A_DUART_IMRREG(kgdb_port)));
400 394
401 sb1250_steal_irq(kgdb_irq); 395 sb1250_steal_irq(kgdb_irq);
402 bus_writeq(IMR_IP6_VAL, 396 __raw_writeq(IMR_IP6_VAL,
403 IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_MAP_BASE) + 397 IOADDR(A_IMR_REGISTER(0,
404 (kgdb_irq<<3))); 398 R_IMR_INTERRUPT_MAP_BASE) +
399 (kgdb_irq << 3)));
405 sb1250_unmask_irq(0, kgdb_irq); 400 sb1250_unmask_irq(0, kgdb_irq);
406 } 401 }
407#endif 402#endif
diff --git a/arch/mips/sibyte/sb1250/setup.c b/arch/mips/sibyte/sb1250/setup.c
index f8c605be96c7..df2e266c700c 100644
--- a/arch/mips/sibyte/sb1250/setup.c
+++ b/arch/mips/sibyte/sb1250/setup.c
@@ -153,7 +153,7 @@ void sb1250_setup(void)
153 int bad_config = 0; 153 int bad_config = 0;
154 154
155 sb1_pass = read_c0_prid() & 0xff; 155 sb1_pass = read_c0_prid() & 0xff;
156 sys_rev = bus_readq(IOADDR(A_SCD_SYSTEM_REVISION)); 156 sys_rev = __raw_readq(IOADDR(A_SCD_SYSTEM_REVISION));
157 soc_type = SYS_SOC_TYPE(sys_rev); 157 soc_type = SYS_SOC_TYPE(sys_rev);
158 soc_pass = G_SYS_REVISION(sys_rev); 158 soc_pass = G_SYS_REVISION(sys_rev);
159 159
@@ -162,7 +162,7 @@ void sb1250_setup(void)
162 machine_restart(NULL); 162 machine_restart(NULL);
163 } 163 }
164 164
165 plldiv = G_SYS_PLL_DIV(bus_readq(IOADDR(A_SCD_SYSTEM_CFG))); 165 plldiv = G_SYS_PLL_DIV(__raw_readq(IOADDR(A_SCD_SYSTEM_CFG)));
166 zbbus_mhz = ((plldiv >> 1) * 50) + ((plldiv & 1) * 25); 166 zbbus_mhz = ((plldiv >> 1) * 50) + ((plldiv & 1) * 25);
167 167
168 prom_printf("Broadcom SiByte %s %s @ %d MHz (SB1 rev %d)\n", 168 prom_printf("Broadcom SiByte %s %s @ %d MHz (SB1 rev %d)\n",
diff --git a/arch/mips/sibyte/sb1250/smp.c b/arch/mips/sibyte/sb1250/smp.c
index be91b3990952..f859db02d3c9 100644
--- a/arch/mips/sibyte/sb1250/smp.c
+++ b/arch/mips/sibyte/sb1250/smp.c
@@ -29,18 +29,18 @@
29#include <asm/sibyte/sb1250_int.h> 29#include <asm/sibyte/sb1250_int.h>
30 30
31static void *mailbox_set_regs[] = { 31static void *mailbox_set_regs[] = {
32 (void *)IOADDR(A_IMR_CPU0_BASE + R_IMR_MAILBOX_SET_CPU), 32 IOADDR(A_IMR_CPU0_BASE + R_IMR_MAILBOX_SET_CPU),
33 (void *)IOADDR(A_IMR_CPU1_BASE + R_IMR_MAILBOX_SET_CPU) 33 IOADDR(A_IMR_CPU1_BASE + R_IMR_MAILBOX_SET_CPU)
34}; 34};
35 35
36static void *mailbox_clear_regs[] = { 36static void *mailbox_clear_regs[] = {
37 (void *)IOADDR(A_IMR_CPU0_BASE + R_IMR_MAILBOX_CLR_CPU), 37 IOADDR(A_IMR_CPU0_BASE + R_IMR_MAILBOX_CLR_CPU),
38 (void *)IOADDR(A_IMR_CPU1_BASE + R_IMR_MAILBOX_CLR_CPU) 38 IOADDR(A_IMR_CPU1_BASE + R_IMR_MAILBOX_CLR_CPU)
39}; 39};
40 40
41static void *mailbox_regs[] = { 41static void *mailbox_regs[] = {
42 (void *)IOADDR(A_IMR_CPU0_BASE + R_IMR_MAILBOX_CPU), 42 IOADDR(A_IMR_CPU0_BASE + R_IMR_MAILBOX_CPU),
43 (void *)IOADDR(A_IMR_CPU1_BASE + R_IMR_MAILBOX_CPU) 43 IOADDR(A_IMR_CPU1_BASE + R_IMR_MAILBOX_CPU)
44}; 44};
45 45
46/* 46/*
@@ -73,7 +73,7 @@ void sb1250_smp_finish(void)
73 */ 73 */
74void core_send_ipi(int cpu, unsigned int action) 74void core_send_ipi(int cpu, unsigned int action)
75{ 75{
76 bus_writeq((((u64)action) << 48), mailbox_set_regs[cpu]); 76 __raw_writeq((((u64)action) << 48), mailbox_set_regs[cpu]);
77} 77}
78 78
79void sb1250_mailbox_interrupt(struct pt_regs *regs) 79void sb1250_mailbox_interrupt(struct pt_regs *regs)
@@ -83,10 +83,10 @@ void sb1250_mailbox_interrupt(struct pt_regs *regs)
83 83
84 kstat_this_cpu.irqs[K_INT_MBOX_0]++; 84 kstat_this_cpu.irqs[K_INT_MBOX_0]++;
85 /* Load the mailbox register to figure out what we're supposed to do */ 85 /* Load the mailbox register to figure out what we're supposed to do */
86 action = (__bus_readq(mailbox_regs[cpu]) >> 48) & 0xffff; 86 action = (____raw_readq(mailbox_regs[cpu]) >> 48) & 0xffff;
87 87
88 /* Clear the mailbox to clear the interrupt */ 88 /* Clear the mailbox to clear the interrupt */
89 __bus_writeq(((u64)action) << 48, mailbox_clear_regs[cpu]); 89 ____raw_writeq(((u64)action) << 48, mailbox_clear_regs[cpu]);
90 90
91 /* 91 /*
92 * Nothing to do for SMP_RESCHEDULE_YOURSELF; returning from the 92 * Nothing to do for SMP_RESCHEDULE_YOURSELF; returning from the
diff --git a/arch/mips/sibyte/sb1250/time.c b/arch/mips/sibyte/sb1250/time.c
index 8b4c848c907b..511c89d65f38 100644
--- a/arch/mips/sibyte/sb1250/time.c
+++ b/arch/mips/sibyte/sb1250/time.c
@@ -67,24 +67,24 @@ void sb1250_time_init(void)
67 sb1250_mask_irq(cpu, irq); 67 sb1250_mask_irq(cpu, irq);
68 68
69 /* Map the timer interrupt to ip[4] of this cpu */ 69 /* Map the timer interrupt to ip[4] of this cpu */
70 bus_writeq(IMR_IP4_VAL, 70 __raw_writeq(IMR_IP4_VAL,
71 IOADDR(A_IMR_REGISTER(cpu, R_IMR_INTERRUPT_MAP_BASE) + 71 IOADDR(A_IMR_REGISTER(cpu, R_IMR_INTERRUPT_MAP_BASE) +
72 (irq << 3))); 72 (irq << 3)));
73 73
74 /* the general purpose timer ticks at 1 Mhz independent if the rest of the system */ 74 /* the general purpose timer ticks at 1 Mhz independent if the rest of the system */
75 /* Disable the timer and set up the count */ 75 /* Disable the timer and set up the count */
76 bus_writeq(0, IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG))); 76 __raw_writeq(0, IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG)));
77#ifdef CONFIG_SIMULATION 77#ifdef CONFIG_SIMULATION
78 bus_writeq(50000 / HZ, 78 __raw_writeq(50000 / HZ,
79 IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT))); 79 IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT)));
80#else 80#else
81 bus_writeq(1000000/HZ, 81 __raw_writeq(1000000 / HZ,
82 IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT))); 82 IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT)));
83#endif 83#endif
84 84
85 /* Set the timer running */ 85 /* Set the timer running */
86 bus_writeq(M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS, 86 __raw_writeq(M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS,
87 IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG))); 87 IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG)));
88 88
89 sb1250_unmask_irq(cpu, irq); 89 sb1250_unmask_irq(cpu, irq);
90 sb1250_steal_irq(irq); 90 sb1250_steal_irq(irq);
@@ -100,25 +100,25 @@ void sb1250_time_init(void)
100 100
101void sb1250_timer_interrupt(struct pt_regs *regs) 101void sb1250_timer_interrupt(struct pt_regs *regs)
102{ 102{
103 extern asmlinkage void ll_local_timer_interrupt(int irq, struct pt_regs *regs);
104 int cpu = smp_processor_id(); 103 int cpu = smp_processor_id();
105 int irq = K_INT_TIMER_0 + cpu; 104 int irq = K_INT_TIMER_0 + cpu;
106 105
107 /* Reset the timer */ 106 /* Reset the timer */
108 __bus_writeq(M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS, 107 ____raw_writeq(M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS,
109 IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG))); 108 IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG)));
110 109
111 /*
112 * CPU 0 handles the global timer interrupt job
113 */
114 if (cpu == 0) { 110 if (cpu == 0) {
111 /*
112 * CPU 0 handles the global timer interrupt job
113 */
115 ll_timer_interrupt(irq, regs); 114 ll_timer_interrupt(irq, regs);
116 } 115 }
117 116 else {
118 /* 117 /*
119 * every CPU should do profiling and process accouting 118 * other CPUs should just do profiling and process accounting
120 */ 119 */
121 ll_local_timer_interrupt(irq, regs); 120 ll_local_timer_interrupt(irq, regs);
121 }
122} 122}
123 123
124/* 124/*
@@ -130,7 +130,7 @@ void sb1250_timer_interrupt(struct pt_regs *regs)
130unsigned long sb1250_gettimeoffset(void) 130unsigned long sb1250_gettimeoffset(void)
131{ 131{
132 unsigned long count = 132 unsigned long count =
133 bus_readq(IOADDR(A_SCD_TIMER_REGISTER(0, R_SCD_TIMER_CNT))); 133 __raw_readq(IOADDR(A_SCD_TIMER_REGISTER(0, R_SCD_TIMER_CNT)));
134 134
135 return 1000000/HZ - count; 135 return 1000000/HZ - count;
136 } 136 }
diff --git a/arch/mips/sibyte/swarm/rtc_m41t81.c b/arch/mips/sibyte/swarm/rtc_m41t81.c
index a686bb716ec6..5b4fc26c1b36 100644
--- a/arch/mips/sibyte/swarm/rtc_m41t81.c
+++ b/arch/mips/sibyte/swarm/rtc_m41t81.c
@@ -82,59 +82,60 @@
82#define M41T81REG_SQW 0x13 /* square wave register */ 82#define M41T81REG_SQW 0x13 /* square wave register */
83 83
84#define M41T81_CCR_ADDRESS 0x68 84#define M41T81_CCR_ADDRESS 0x68
85#define SMB_CSR(reg) ((u8 *) (IOADDR(A_SMB_REGISTER(1, reg)))) 85
86#define SMB_CSR(reg) IOADDR(A_SMB_REGISTER(1, reg))
86 87
87static int m41t81_read(uint8_t addr) 88static int m41t81_read(uint8_t addr)
88{ 89{
89 while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) 90 while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY)
90 ; 91 ;
91 92
92 bus_writeq(addr & 0xff, SMB_CSR(R_SMB_CMD)); 93 __raw_writeq(addr & 0xff, SMB_CSR(R_SMB_CMD));
93 bus_writeq((V_SMB_ADDR(M41T81_CCR_ADDRESS) | V_SMB_TT_WR1BYTE), 94 __raw_writeq(V_SMB_ADDR(M41T81_CCR_ADDRESS) | V_SMB_TT_WR1BYTE,
94 SMB_CSR(R_SMB_START)); 95 SMB_CSR(R_SMB_START));
95 96
96 while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) 97 while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY)
97 ; 98 ;
98 99
99 bus_writeq((V_SMB_ADDR(M41T81_CCR_ADDRESS) | V_SMB_TT_RD1BYTE), 100 __raw_writeq(V_SMB_ADDR(M41T81_CCR_ADDRESS) | V_SMB_TT_RD1BYTE,
100 SMB_CSR(R_SMB_START)); 101 SMB_CSR(R_SMB_START));
101 102
102 while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) 103 while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY)
103 ; 104 ;
104 105
105 if (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_ERROR) { 106 if (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_ERROR) {
106 /* Clear error bit by writing a 1 */ 107 /* Clear error bit by writing a 1 */
107 bus_writeq(M_SMB_ERROR, SMB_CSR(R_SMB_STATUS)); 108 __raw_writeq(M_SMB_ERROR, SMB_CSR(R_SMB_STATUS));
108 return -1; 109 return -1;
109 } 110 }
110 111
111 return (bus_readq(SMB_CSR(R_SMB_DATA)) & 0xff); 112 return (__raw_readq(SMB_CSR(R_SMB_DATA)) & 0xff);
112} 113}
113 114
114static int m41t81_write(uint8_t addr, int b) 115static int m41t81_write(uint8_t addr, int b)
115{ 116{
116 while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) 117 while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY)
117 ; 118 ;
118 119
119 bus_writeq((addr & 0xFF), SMB_CSR(R_SMB_CMD)); 120 __raw_writeq(addr & 0xff, SMB_CSR(R_SMB_CMD));
120 bus_writeq((b & 0xff), SMB_CSR(R_SMB_DATA)); 121 __raw_writeq(b & 0xff, SMB_CSR(R_SMB_DATA));
121 bus_writeq(V_SMB_ADDR(M41T81_CCR_ADDRESS) | V_SMB_TT_WR2BYTE, 122 __raw_writeq(V_SMB_ADDR(M41T81_CCR_ADDRESS) | V_SMB_TT_WR2BYTE,
122 SMB_CSR(R_SMB_START)); 123 SMB_CSR(R_SMB_START));
123 124
124 while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) 125 while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY)
125 ; 126 ;
126 127
127 if (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_ERROR) { 128 if (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_ERROR) {
128 /* Clear error bit by writing a 1 */ 129 /* Clear error bit by writing a 1 */
129 bus_writeq(M_SMB_ERROR, SMB_CSR(R_SMB_STATUS)); 130 __raw_writeq(M_SMB_ERROR, SMB_CSR(R_SMB_STATUS));
130 return -1; 131 return -1;
131 } 132 }
132 133
133 /* read the same byte again to make sure it is written */ 134 /* read the same byte again to make sure it is written */
134 bus_writeq(V_SMB_ADDR(M41T81_CCR_ADDRESS) | V_SMB_TT_RD1BYTE, 135 __raw_writeq(V_SMB_ADDR(M41T81_CCR_ADDRESS) | V_SMB_TT_RD1BYTE,
135 SMB_CSR(R_SMB_START)); 136 SMB_CSR(R_SMB_START));
136 137
137 while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) 138 while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY)
138 ; 139 ;
139 140
140 return 0; 141 return 0;
diff --git a/arch/mips/sibyte/swarm/rtc_xicor1241.c b/arch/mips/sibyte/swarm/rtc_xicor1241.c
index 981d21f16e64..d9ff9323f24e 100644
--- a/arch/mips/sibyte/swarm/rtc_xicor1241.c
+++ b/arch/mips/sibyte/swarm/rtc_xicor1241.c
@@ -57,52 +57,52 @@
57 57
58#define X1241_CCR_ADDRESS 0x6F 58#define X1241_CCR_ADDRESS 0x6F
59 59
60#define SMB_CSR(reg) ((u8 *) (IOADDR(A_SMB_REGISTER(1, reg)))) 60#define SMB_CSR(reg) IOADDR(A_SMB_REGISTER(1, reg))
61 61
62static int xicor_read(uint8_t addr) 62static int xicor_read(uint8_t addr)
63{ 63{
64 while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) 64 while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY)
65 ; 65 ;
66 66
67 bus_writeq((addr >> 8) & 0x7, SMB_CSR(R_SMB_CMD)); 67 __raw_writeq((addr >> 8) & 0x7, SMB_CSR(R_SMB_CMD));
68 bus_writeq((addr & 0xff), SMB_CSR(R_SMB_DATA)); 68 __raw_writeq(addr & 0xff, SMB_CSR(R_SMB_DATA));
69 bus_writeq((V_SMB_ADDR(X1241_CCR_ADDRESS) | V_SMB_TT_WR2BYTE), 69 __raw_writeq(V_SMB_ADDR(X1241_CCR_ADDRESS) | V_SMB_TT_WR2BYTE,
70 SMB_CSR(R_SMB_START)); 70 SMB_CSR(R_SMB_START));
71 71
72 while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) 72 while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY)
73 ; 73 ;
74 74
75 bus_writeq((V_SMB_ADDR(X1241_CCR_ADDRESS) | V_SMB_TT_RD1BYTE), 75 __raw_writeq(V_SMB_ADDR(X1241_CCR_ADDRESS) | V_SMB_TT_RD1BYTE,
76 SMB_CSR(R_SMB_START)); 76 SMB_CSR(R_SMB_START));
77 77
78 while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) 78 while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY)
79 ; 79 ;
80 80
81 if (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_ERROR) { 81 if (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_ERROR) {
82 /* Clear error bit by writing a 1 */ 82 /* Clear error bit by writing a 1 */
83 bus_writeq(M_SMB_ERROR, SMB_CSR(R_SMB_STATUS)); 83 __raw_writeq(M_SMB_ERROR, SMB_CSR(R_SMB_STATUS));
84 return -1; 84 return -1;
85 } 85 }
86 86
87 return (bus_readq(SMB_CSR(R_SMB_DATA)) & 0xff); 87 return (__raw_readq(SMB_CSR(R_SMB_DATA)) & 0xff);
88} 88}
89 89
90static int xicor_write(uint8_t addr, int b) 90static int xicor_write(uint8_t addr, int b)
91{ 91{
92 while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) 92 while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY)
93 ; 93 ;
94 94
95 bus_writeq(addr, SMB_CSR(R_SMB_CMD)); 95 __raw_writeq(addr, SMB_CSR(R_SMB_CMD));
96 bus_writeq((addr & 0xff) | ((b & 0xff) << 8), SMB_CSR(R_SMB_DATA)); 96 __raw_writeq((addr & 0xff) | ((b & 0xff) << 8), SMB_CSR(R_SMB_DATA));
97 bus_writeq(V_SMB_ADDR(X1241_CCR_ADDRESS) | V_SMB_TT_WR3BYTE, 97 __raw_writeq(V_SMB_ADDR(X1241_CCR_ADDRESS) | V_SMB_TT_WR3BYTE,
98 SMB_CSR(R_SMB_START)); 98 SMB_CSR(R_SMB_START));
99 99
100 while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) 100 while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY)
101 ; 101 ;
102 102
103 if (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_ERROR) { 103 if (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_ERROR) {
104 /* Clear error bit by writing a 1 */ 104 /* Clear error bit by writing a 1 */
105 bus_writeq(M_SMB_ERROR, SMB_CSR(R_SMB_STATUS)); 105 __raw_writeq(M_SMB_ERROR, SMB_CSR(R_SMB_STATUS));
106 return -1; 106 return -1;
107 } else { 107 } else {
108 return 0; 108 return 0;
diff --git a/arch/mips/sibyte/swarm/setup.c b/arch/mips/sibyte/swarm/setup.c
index 4daeaa413def..b614ca0ddb69 100644
--- a/arch/mips/sibyte/swarm/setup.c
+++ b/arch/mips/sibyte/swarm/setup.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2000, 2001, 2002, 2003 Broadcom Corporation 2 * Copyright (C) 2000, 2001, 2002, 2003, 2004 Broadcom Corporation
3 * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org) 3 * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org)
4 * 4 *
5 * This program is free software; you can redistribute it and/or 5 * This program is free software; you can redistribute it and/or
@@ -39,11 +39,23 @@
39#include <asm/time.h> 39#include <asm/time.h>
40#include <asm/traps.h> 40#include <asm/traps.h>
41#include <asm/sibyte/sb1250.h> 41#include <asm/sibyte/sb1250.h>
42#if defined(CONFIG_SIBYTE_BCM1x55) || defined(CONFIG_SIBYTE_BCM1x80)
43#include <asm/sibyte/bcm1480_regs.h>
44#elif defined(CONFIG_SIBYTE_SB1250) || defined(CONFIG_SIBYTE_BCM112X)
42#include <asm/sibyte/sb1250_regs.h> 45#include <asm/sibyte/sb1250_regs.h>
46#else
47#error invalid SiByte board configuation
48#endif
43#include <asm/sibyte/sb1250_genbus.h> 49#include <asm/sibyte/sb1250_genbus.h>
44#include <asm/sibyte/board.h> 50#include <asm/sibyte/board.h>
45 51
52#if defined(CONFIG_SIBYTE_BCM1x55) || defined(CONFIG_SIBYTE_BCM1x80)
53extern void bcm1480_setup(void);
54#elif defined(CONFIG_SIBYTE_SB1250) || defined(CONFIG_SIBYTE_BCM112X)
46extern void sb1250_setup(void); 55extern void sb1250_setup(void);
56#else
57#error invalid SiByte board configuation
58#endif
47 59
48extern int xicor_probe(void); 60extern int xicor_probe(void);
49extern int xicor_set_time(unsigned long); 61extern int xicor_set_time(unsigned long);
@@ -66,27 +78,34 @@ void __init swarm_timer_setup(struct irqaction *irq)
66 */ 78 */
67 79
68 /* We only need to setup the generic timer */ 80 /* We only need to setup the generic timer */
69 sb1250_time_init(); 81#if defined(CONFIG_SIBYTE_BCM1x55) || defined(CONFIG_SIBYTE_BCM1x80)
82 bcm1480_time_init();
83#elif defined(CONFIG_SIBYTE_SB1250) || defined(CONFIG_SIBYTE_BCM112X)
84 sb1250_time_init();
85#else
86#error invalid SiByte board configuation
87#endif
70} 88}
71 89
72int swarm_be_handler(struct pt_regs *regs, int is_fixup) 90int swarm_be_handler(struct pt_regs *regs, int is_fixup)
73{ 91{
74 if (!is_fixup && (regs->cp0_cause & 4)) { 92 if (!is_fixup && (regs->cp0_cause & 4)) {
75 /* Data bus error - print PA */ 93 /* Data bus error - print PA */
76#ifdef CONFIG_64BIT 94 printk("DBE physical address: %010Lx\n",
77 printk("DBE physical address: %010lx\n",
78 __read_64bit_c0_register($26, 1)); 95 __read_64bit_c0_register($26, 1));
79#else
80 printk("DBE physical address: %010llx\n",
81 __read_64bit_c0_split($26, 1));
82#endif
83 } 96 }
84 return (is_fixup ? MIPS_BE_FIXUP : MIPS_BE_FATAL); 97 return (is_fixup ? MIPS_BE_FIXUP : MIPS_BE_FATAL);
85} 98}
86 99
87static int __init swarm_setup(void) 100void __init plat_setup(void)
88{ 101{
102#if defined(CONFIG_SIBYTE_BCM1x55) || defined(CONFIG_SIBYTE_BCM1x80)
103 bcm1480_setup();
104#elif defined(CONFIG_SIBYTE_SB1250) || defined(CONFIG_SIBYTE_BCM112X)
89 sb1250_setup(); 105 sb1250_setup();
106#else
107#error invalid SiByte board configuation
108#endif
90 109
91 panic_timeout = 5; /* For debug. */ 110 panic_timeout = 5; /* For debug. */
92 111
@@ -133,12 +152,8 @@ static int __init swarm_setup(void)
133 }; 152 };
134 /* XXXKW for CFE, get lines/cols from environment */ 153 /* XXXKW for CFE, get lines/cols from environment */
135#endif 154#endif
136
137 return 0;
138} 155}
139 156
140early_initcall(swarm_setup);
141
142#ifdef LEDS_PHYS 157#ifdef LEDS_PHYS
143 158
144#ifdef CONFIG_SIBYTE_CARMEL 159#ifdef CONFIG_SIBYTE_CARMEL
diff --git a/arch/mips/sibyte/swarm/time.c b/arch/mips/sibyte/swarm/time.c
index c1f1a9defeeb..97c73c793c35 100644
--- a/arch/mips/sibyte/swarm/time.c
+++ b/arch/mips/sibyte/swarm/time.c
@@ -79,48 +79,48 @@ static unsigned int usec_bias = 0;
79 79
80static int xicor_read(uint8_t addr) 80static int xicor_read(uint8_t addr)
81{ 81{
82 while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) 82 while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY)
83 ; 83 ;
84 84
85 bus_writeq((addr >> 8) & 0x7, SMB_CSR(R_SMB_CMD)); 85 __raw_writeq((addr >> 8) & 0x7, SMB_CSR(R_SMB_CMD));
86 bus_writeq((addr & 0xff), SMB_CSR(R_SMB_DATA)); 86 __raw_writeq(addr & 0xff, SMB_CSR(R_SMB_DATA));
87 bus_writeq((V_SMB_ADDR(X1241_CCR_ADDRESS) | V_SMB_TT_WR2BYTE), 87 __raw_writeq(V_SMB_ADDR(X1241_CCR_ADDRESS) | V_SMB_TT_WR2BYTE,
88 SMB_CSR(R_SMB_START)); 88 SMB_CSR(R_SMB_START));
89 89
90 while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) 90 while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY)
91 ; 91 ;
92 92
93 bus_writeq((V_SMB_ADDR(X1241_CCR_ADDRESS) | V_SMB_TT_RD1BYTE), 93 __raw_writeq(V_SMB_ADDR(X1241_CCR_ADDRESS) | V_SMB_TT_RD1BYTE,
94 SMB_CSR(R_SMB_START)); 94 SMB_CSR(R_SMB_START));
95 95
96 while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) 96 while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY)
97 ; 97 ;
98 98
99 if (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_ERROR) { 99 if (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_ERROR) {
100 /* Clear error bit by writing a 1 */ 100 /* Clear error bit by writing a 1 */
101 bus_writeq(M_SMB_ERROR, SMB_CSR(R_SMB_STATUS)); 101 __raw_writeq(M_SMB_ERROR, SMB_CSR(R_SMB_STATUS));
102 return -1; 102 return -1;
103 } 103 }
104 104
105 return (bus_readq(SMB_CSR(R_SMB_DATA)) & 0xff); 105 return (__raw_readq(SMB_CSR(R_SMB_DATA)) & 0xff);
106} 106}
107 107
108static int xicor_write(uint8_t addr, int b) 108static int xicor_write(uint8_t addr, int b)
109{ 109{
110 while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) 110 while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY)
111 ; 111 ;
112 112
113 bus_writeq(addr, SMB_CSR(R_SMB_CMD)); 113 __raw_writeq(addr, SMB_CSR(R_SMB_CMD));
114 bus_writeq((addr & 0xff) | ((b & 0xff) << 8), SMB_CSR(R_SMB_DATA)); 114 __raw_writeq((addr & 0xff) | ((b & 0xff) << 8), SMB_CSR(R_SMB_DATA));
115 bus_writeq(V_SMB_ADDR(X1241_CCR_ADDRESS) | V_SMB_TT_WR3BYTE, 115 __raw_writeq(V_SMB_ADDR(X1241_CCR_ADDRESS) | V_SMB_TT_WR3BYTE,
116 SMB_CSR(R_SMB_START)); 116 SMB_CSR(R_SMB_START));
117 117
118 while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) 118 while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY)
119 ; 119 ;
120 120
121 if (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_ERROR) { 121 if (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_ERROR) {
122 /* Clear error bit by writing a 1 */ 122 /* Clear error bit by writing a 1 */
123 bus_writeq(M_SMB_ERROR, SMB_CSR(R_SMB_STATUS)); 123 __raw_writeq(M_SMB_ERROR, SMB_CSR(R_SMB_STATUS));
124 return -1; 124 return -1;
125 } else { 125 } else {
126 return 0; 126 return 0;
@@ -228,8 +228,8 @@ void __init swarm_time_init(void)
228 /* Establish communication with the Xicor 1241 RTC */ 228 /* Establish communication with the Xicor 1241 RTC */
229 /* XXXKW how do I share the SMBus with the I2C subsystem? */ 229 /* XXXKW how do I share the SMBus with the I2C subsystem? */
230 230
231 bus_writeq(K_SMB_FREQ_400KHZ, SMB_CSR(R_SMB_FREQ)); 231 __raw_writeq(K_SMB_FREQ_400KHZ, SMB_CSR(R_SMB_FREQ));
232 bus_writeq(0, SMB_CSR(R_SMB_CONTROL)); 232 __raw_writeq(0, SMB_CSR(R_SMB_CONTROL));
233 233
234 if ((status = xicor_read(X1241REG_SR_RTCF)) < 0) { 234 if ((status = xicor_read(X1241REG_SR_RTCF)) < 0) {
235 printk("x1241: couldn't detect on SWARM SMBus 1\n"); 235 printk("x1241: couldn't detect on SWARM SMBus 1\n");
diff --git a/arch/mips/sni/irq.c b/arch/mips/sni/irq.c
index 141a310d74d8..952038aa4b90 100644
--- a/arch/mips/sni/irq.c
+++ b/arch/mips/sni/irq.c
@@ -58,14 +58,13 @@ static void end_pciasic_irq(unsigned int irq)
58} 58}
59 59
60static struct hw_interrupt_type pciasic_irq_type = { 60static struct hw_interrupt_type pciasic_irq_type = {
61 "ASIC-PCI", 61 .typename = "ASIC-PCI",
62 startup_pciasic_irq, 62 .startup = startup_pciasic_irq,
63 shutdown_pciasic_irq, 63 .shutdown = shutdown_pciasic_irq,
64 enable_pciasic_irq, 64 .enable = enable_pciasic_irq,
65 disable_pciasic_irq, 65 .disable = disable_pciasic_irq,
66 mask_and_ack_pciasic_irq, 66 .ack = mask_and_ack_pciasic_irq,
67 end_pciasic_irq, 67 .end = end_pciasic_irq,
68 NULL
69}; 68};
70 69
71/* 70/*
diff --git a/arch/mips/sni/setup.c b/arch/mips/sni/setup.c
index 1b3f8a0903e1..262c85680709 100644
--- a/arch/mips/sni/setup.c
+++ b/arch/mips/sni/setup.c
@@ -167,7 +167,7 @@ static inline void sni_pcimt_time_init(void)
167 rtc_set_time = mc146818_set_rtc_mmss; 167 rtc_set_time = mc146818_set_rtc_mmss;
168} 168}
169 169
170static int __init sni_rm200_pci_setup(void) 170void __init plat_setup(void)
171{ 171{
172 sni_pcimt_detect(); 172 sni_pcimt_detect();
173 sni_pcimt_sc_init(); 173 sni_pcimt_sc_init();
@@ -196,8 +196,4 @@ static int __init sni_rm200_pci_setup(void)
196#ifdef CONFIG_PCI 196#ifdef CONFIG_PCI
197 register_pci_controller(&sni_controller); 197 register_pci_controller(&sni_controller);
198#endif 198#endif
199
200 return 0;
201} 199}
202
203early_initcall(sni_rm200_pci_setup);
diff --git a/arch/mips/tx4927/Kconfig b/arch/mips/tx4927/Kconfig
new file mode 100644
index 000000000000..5fbbe12e0fc1
--- /dev/null
+++ b/arch/mips/tx4927/Kconfig
@@ -0,0 +1,3 @@
1config TOSHIBA_FPCIB0
2 bool "FPCIB0 Backplane Support"
3 depends on TOSHIBA_RBTX4927
diff --git a/arch/mips/tx4927/common/tx4927_setup.c b/arch/mips/tx4927/common/tx4927_setup.c
index 26d7c53612a8..77c3b66fb959 100644
--- a/arch/mips/tx4927/common/tx4927_setup.c
+++ b/arch/mips/tx4927/common/tx4927_setup.c
@@ -64,7 +64,7 @@ static void tx4927_write_buffer_flush(void)
64} 64}
65 65
66 66
67static void __init tx4927_setup(void) 67void __init plat_setup(void)
68{ 68{
69 board_time_init = tx4927_time_init; 69 board_time_init = tx4927_time_init;
70 board_timer_setup = tx4927_timer_setup; 70 board_timer_setup = tx4927_timer_setup;
@@ -76,12 +76,8 @@ static void __init tx4927_setup(void)
76 toshiba_rbtx4927_setup(); 76 toshiba_rbtx4927_setup();
77 } 77 }
78#endif 78#endif
79
80 return;
81} 79}
82 80
83early_initcall(tx4927_setup);
84
85void __init tx4927_time_init(void) 81void __init tx4927_time_init(void)
86{ 82{
87 83
diff --git a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c
index fc0720599fd9..990fcb294bab 100644
--- a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c
+++ b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c
@@ -77,6 +77,11 @@
77#include <linux/hdreg.h> 77#include <linux/hdreg.h>
78#include <linux/ide.h> 78#include <linux/ide.h>
79#endif 79#endif
80#ifdef CONFIG_SERIAL_TXX9
81#include <linux/tty.h>
82#include <linux/serial.h>
83#include <linux/serial_core.h>
84#endif
80 85
81#undef TOSHIBA_RBTX4927_SETUP_DEBUG 86#undef TOSHIBA_RBTX4927_SETUP_DEBUG
82 87
@@ -920,12 +925,30 @@ void __init toshiba_rbtx4927_setup(void)
920 925
921#endif /* CONFIG_PCI */ 926#endif /* CONFIG_PCI */
922 927
928#ifdef CONFIG_SERIAL_TXX9
929 {
930 extern int early_serial_txx9_setup(struct uart_port *port);
931 int i;
932 struct uart_port req;
933 for(i = 0; i < 2; i++) {
934 memset(&req, 0, sizeof(req));
935 req.line = i;
936 req.iotype = UPIO_MEM;
937 req.membase = (char *)(0xff1ff300 + i * 0x100);
938 req.mapbase = 0xff1ff300 + i * 0x100;
939 req.irq = 32 + i;
940 req.flags |= UPF_BUGGY_UART /*HAVE_CTS_LINE*/;
941 req.uartclk = 50000000;
942 early_serial_txx9_setup(&req);
943 }
944 }
923#ifdef CONFIG_SERIAL_TXX9_CONSOLE 945#ifdef CONFIG_SERIAL_TXX9_CONSOLE
924 argptr = prom_getcmdline(); 946 argptr = prom_getcmdline();
925 if (strstr(argptr, "console=") == NULL) { 947 if (strstr(argptr, "console=") == NULL) {
926 strcat(argptr, " console=ttyS0,38400"); 948 strcat(argptr, " console=ttyS0,38400");
927 } 949 }
928#endif 950#endif
951#endif
929 952
930#ifdef CONFIG_ROOT_NFS 953#ifdef CONFIG_ROOT_NFS
931 argptr = prom_getcmdline(); 954 argptr = prom_getcmdline();
diff --git a/arch/mips/tx4938/Kconfig b/arch/mips/tx4938/Kconfig
new file mode 100644
index 000000000000..d90e9cd85138
--- /dev/null
+++ b/arch/mips/tx4938/Kconfig
@@ -0,0 +1,24 @@
1if TOSHIBA_RBTX4938
2
3comment "Multiplex Pin Select"
4choice
5 prompt "PIO[58:61]"
6 default TOSHIBA_RBTX4938_MPLEX_PIO58_61
7
8config TOSHIBA_RBTX4938_MPLEX_PIO58_61
9 bool "PIO"
10config TOSHIBA_RBTX4938_MPLEX_NAND
11 bool "NAND"
12config TOSHIBA_RBTX4938_MPLEX_ATA
13 bool "ATA"
14
15endchoice
16
17config TX4938_NAND_BOOT
18 depends on EXPERIMENTAL && TOSHIBA_RBTX4938_MPLEX_NAND
19 bool "NAND Boot Support (EXPERIMENTAL)"
20 help
21 This is only for Toshiba RBTX4938 reference board, which has NAND IPL.
22 Select this option if you need to use NAND boot.
23
24endif
diff --git a/arch/mips/tx4938/common/Makefile b/arch/mips/tx4938/common/Makefile
new file mode 100644
index 000000000000..74c95c5bcdbf
--- /dev/null
+++ b/arch/mips/tx4938/common/Makefile
@@ -0,0 +1,11 @@
1#
2# Makefile for common code for Toshiba TX4927 based systems
3#
4# Note! Dependencies are done automagically by 'make dep', which also
5# removes any old dependencies. DON'T put your own dependencies here
6# unless it's something special (ie not a .c file).
7#
8
9obj-y += prom.o setup.o irq.o irq_handler.o rtc_rx5c348.o
10obj-$(CONFIG_KGDB) += dbgio.o
11
diff --git a/arch/mips/tx4938/common/dbgio.c b/arch/mips/tx4938/common/dbgio.c
new file mode 100644
index 000000000000..bea59ff1842a
--- /dev/null
+++ b/arch/mips/tx4938/common/dbgio.c
@@ -0,0 +1,50 @@
1/*
2 * linux/arch/mips/tx4938/common/dbgio.c
3 *
4 * kgdb interface for gdb
5 *
6 * Author: MontaVista Software, Inc.
7 * source@mvista.com
8 *
9 * Copyright 2005 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 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
22 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
24 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
25 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 *
27 * You should have received a copy of the GNU General Public License along
28 * with this program; if not, write to the Free Software Foundation, Inc.,
29 * 675 Mass Ave, Cambridge, MA 02139, USA.
30 *
31 * Support for TX4938 in 2.6 - Hiroshi DOYU <Hiroshi_DOYU@montavista.co.jp>
32 */
33
34#include <asm/mipsregs.h>
35#include <asm/system.h>
36#include <asm/tx4938/tx4938_mips.h>
37
38extern u8 txx9_sio_kdbg_rd(void);
39extern int txx9_sio_kdbg_wr( u8 ch );
40
41u8 getDebugChar(void)
42{
43 return (txx9_sio_kdbg_rd());
44}
45
46int putDebugChar(u8 byte)
47{
48 return (txx9_sio_kdbg_wr(byte));
49}
50
diff --git a/arch/mips/tx4938/common/irq.c b/arch/mips/tx4938/common/irq.c
new file mode 100644
index 000000000000..4f90d7faf634
--- /dev/null
+++ b/arch/mips/tx4938/common/irq.c
@@ -0,0 +1,424 @@
1/*
2 * linux/arch/mps/tx4938/common/irq.c
3 *
4 * Common tx4938 irq handler
5 * Copyright (C) 2000-2001 Toshiba Corporation
6 *
7 * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
8 * terms of the GNU General Public License version 2. This program is
9 * licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 *
12 * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
13 */
14#include <linux/errno.h>
15#include <linux/init.h>
16#include <linux/kernel_stat.h>
17#include <linux/module.h>
18#include <linux/signal.h>
19#include <linux/sched.h>
20#include <linux/types.h>
21#include <linux/interrupt.h>
22#include <linux/ioport.h>
23#include <linux/timex.h>
24#include <linux/slab.h>
25#include <linux/random.h>
26#include <linux/irq.h>
27#include <asm/bitops.h>
28#include <asm/bootinfo.h>
29#include <asm/io.h>
30#include <asm/irq.h>
31#include <asm/mipsregs.h>
32#include <asm/system.h>
33#include <asm/tx4938/rbtx4938.h>
34
35/**********************************************************************************/
36/* Forwad definitions for all pic's */
37/**********************************************************************************/
38
39static unsigned int tx4938_irq_cp0_startup(unsigned int irq);
40static void tx4938_irq_cp0_shutdown(unsigned int irq);
41static void tx4938_irq_cp0_enable(unsigned int irq);
42static void tx4938_irq_cp0_disable(unsigned int irq);
43static void tx4938_irq_cp0_mask_and_ack(unsigned int irq);
44static void tx4938_irq_cp0_end(unsigned int irq);
45
46static unsigned int tx4938_irq_pic_startup(unsigned int irq);
47static void tx4938_irq_pic_shutdown(unsigned int irq);
48static void tx4938_irq_pic_enable(unsigned int irq);
49static void tx4938_irq_pic_disable(unsigned int irq);
50static void tx4938_irq_pic_mask_and_ack(unsigned int irq);
51static void tx4938_irq_pic_end(unsigned int irq);
52
53/**********************************************************************************/
54/* Kernel structs for all pic's */
55/**********************************************************************************/
56DEFINE_SPINLOCK(tx4938_cp0_lock);
57DEFINE_SPINLOCK(tx4938_pic_lock);
58
59#define TX4938_CP0_NAME "TX4938-CP0"
60static struct hw_interrupt_type tx4938_irq_cp0_type = {
61 .typename = TX4938_CP0_NAME,
62 .startup = tx4938_irq_cp0_startup,
63 .shutdown = tx4938_irq_cp0_shutdown,
64 .enable = tx4938_irq_cp0_enable,
65 .disable = tx4938_irq_cp0_disable,
66 .ack = tx4938_irq_cp0_mask_and_ack,
67 .end = tx4938_irq_cp0_end,
68 .set_affinity = NULL
69};
70
71#define TX4938_PIC_NAME "TX4938-PIC"
72static struct hw_interrupt_type tx4938_irq_pic_type = {
73 .typename = TX4938_PIC_NAME,
74 .startup = tx4938_irq_pic_startup,
75 .shutdown = tx4938_irq_pic_shutdown,
76 .enable = tx4938_irq_pic_enable,
77 .disable = tx4938_irq_pic_disable,
78 .ack = tx4938_irq_pic_mask_and_ack,
79 .end = tx4938_irq_pic_end,
80 .set_affinity = NULL
81};
82
83static struct irqaction tx4938_irq_pic_action = {
84 .handler = no_action,
85 .flags = 0,
86 .mask = CPU_MASK_NONE,
87 .name = TX4938_PIC_NAME
88};
89
90/**********************************************************************************/
91/* Functions for cp0 */
92/**********************************************************************************/
93
94#define tx4938_irq_cp0_mask(irq) ( 1 << ( irq-TX4938_IRQ_CP0_BEG+8 ) )
95
96static void __init
97tx4938_irq_cp0_init(void)
98{
99 int i;
100
101 for (i = TX4938_IRQ_CP0_BEG; i <= TX4938_IRQ_CP0_END; i++) {
102 irq_desc[i].status = IRQ_DISABLED;
103 irq_desc[i].action = 0;
104 irq_desc[i].depth = 1;
105 irq_desc[i].handler = &tx4938_irq_cp0_type;
106 }
107
108 return;
109}
110
111static unsigned int
112tx4938_irq_cp0_startup(unsigned int irq)
113{
114 tx4938_irq_cp0_enable(irq);
115
116 return (0);
117}
118
119static void
120tx4938_irq_cp0_shutdown(unsigned int irq)
121{
122 tx4938_irq_cp0_disable(irq);
123}
124
125static void
126tx4938_irq_cp0_enable(unsigned int irq)
127{
128 unsigned long flags;
129
130 spin_lock_irqsave(&tx4938_cp0_lock, flags);
131
132 set_c0_status(tx4938_irq_cp0_mask(irq));
133
134 spin_unlock_irqrestore(&tx4938_cp0_lock, flags);
135}
136
137static void
138tx4938_irq_cp0_disable(unsigned int irq)
139{
140 unsigned long flags;
141
142 spin_lock_irqsave(&tx4938_cp0_lock, flags);
143
144 clear_c0_status(tx4938_irq_cp0_mask(irq));
145
146 spin_unlock_irqrestore(&tx4938_cp0_lock, flags);
147
148 return;
149}
150
151static void
152tx4938_irq_cp0_mask_and_ack(unsigned int irq)
153{
154 tx4938_irq_cp0_disable(irq);
155
156 return;
157}
158
159static void
160tx4938_irq_cp0_end(unsigned int irq)
161{
162 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) {
163 tx4938_irq_cp0_enable(irq);
164 }
165
166 return;
167}
168
169/**********************************************************************************/
170/* Functions for pic */
171/**********************************************************************************/
172
173u32
174tx4938_irq_pic_addr(int irq)
175{
176 /* MVMCP -- need to formulize this */
177 irq -= TX4938_IRQ_PIC_BEG;
178
179 switch (irq) {
180 case 17:
181 case 16:
182 case 1:
183 case 0:{
184 return (TX4938_MKA(TX4938_IRC_IRLVL0));
185 }
186 case 19:
187 case 18:
188 case 3:
189 case 2:{
190 return (TX4938_MKA(TX4938_IRC_IRLVL1));
191 }
192 case 21:
193 case 20:
194 case 5:
195 case 4:{
196 return (TX4938_MKA(TX4938_IRC_IRLVL2));
197 }
198 case 23:
199 case 22:
200 case 7:
201 case 6:{
202 return (TX4938_MKA(TX4938_IRC_IRLVL3));
203 }
204 case 25:
205 case 24:
206 case 9:
207 case 8:{
208 return (TX4938_MKA(TX4938_IRC_IRLVL4));
209 }
210 case 27:
211 case 26:
212 case 11:
213 case 10:{
214 return (TX4938_MKA(TX4938_IRC_IRLVL5));
215 }
216 case 29:
217 case 28:
218 case 13:
219 case 12:{
220 return (TX4938_MKA(TX4938_IRC_IRLVL6));
221 }
222 case 31:
223 case 30:
224 case 15:
225 case 14:{
226 return (TX4938_MKA(TX4938_IRC_IRLVL7));
227 }
228 }
229
230 return (0);
231}
232
233u32
234tx4938_irq_pic_mask(int irq)
235{
236 /* MVMCP -- need to formulize this */
237 irq -= TX4938_IRQ_PIC_BEG;
238
239 switch (irq) {
240 case 31:
241 case 29:
242 case 27:
243 case 25:
244 case 23:
245 case 21:
246 case 19:
247 case 17:{
248 return (0x07000000);
249 }
250 case 30:
251 case 28:
252 case 26:
253 case 24:
254 case 22:
255 case 20:
256 case 18:
257 case 16:{
258 return (0x00070000);
259 }
260 case 15:
261 case 13:
262 case 11:
263 case 9:
264 case 7:
265 case 5:
266 case 3:
267 case 1:{
268 return (0x00000700);
269 }
270 case 14:
271 case 12:
272 case 10:
273 case 8:
274 case 6:
275 case 4:
276 case 2:
277 case 0:{
278 return (0x00000007);
279 }
280 }
281 return (0x00000000);
282}
283
284static void
285tx4938_irq_pic_modify(unsigned pic_reg, unsigned clr_bits, unsigned set_bits)
286{
287 unsigned long val = 0;
288
289 val = TX4938_RD(pic_reg);
290 val &= (~clr_bits);
291 val |= (set_bits);
292 TX4938_WR(pic_reg, val);
293 mmiowb();
294 TX4938_RD(pic_reg);
295
296 return;
297}
298
299static void __init
300tx4938_irq_pic_init(void)
301{
302 unsigned long flags;
303 int i;
304
305 for (i = TX4938_IRQ_PIC_BEG; i <= TX4938_IRQ_PIC_END; i++) {
306 irq_desc[i].status = IRQ_DISABLED;
307 irq_desc[i].action = 0;
308 irq_desc[i].depth = 2;
309 irq_desc[i].handler = &tx4938_irq_pic_type;
310 }
311
312 setup_irq(TX4938_IRQ_NEST_PIC_ON_CP0, &tx4938_irq_pic_action);
313
314 spin_lock_irqsave(&tx4938_pic_lock, flags);
315
316 TX4938_WR(0xff1ff640, 0x6); /* irq level mask -- only accept hightest */
317 TX4938_WR(0xff1ff600, TX4938_RD(0xff1ff600) | 0x1); /* irq enable */
318
319 spin_unlock_irqrestore(&tx4938_pic_lock, flags);
320
321 return;
322}
323
324static unsigned int
325tx4938_irq_pic_startup(unsigned int irq)
326{
327 tx4938_irq_pic_enable(irq);
328
329 return (0);
330}
331
332static void
333tx4938_irq_pic_shutdown(unsigned int irq)
334{
335 tx4938_irq_pic_disable(irq);
336
337 return;
338}
339
340static void
341tx4938_irq_pic_enable(unsigned int irq)
342{
343 unsigned long flags;
344
345 spin_lock_irqsave(&tx4938_pic_lock, flags);
346
347 tx4938_irq_pic_modify(tx4938_irq_pic_addr(irq), 0,
348 tx4938_irq_pic_mask(irq));
349
350 spin_unlock_irqrestore(&tx4938_pic_lock, flags);
351
352 return;
353}
354
355static void
356tx4938_irq_pic_disable(unsigned int irq)
357{
358 unsigned long flags;
359
360 spin_lock_irqsave(&tx4938_pic_lock, flags);
361
362 tx4938_irq_pic_modify(tx4938_irq_pic_addr(irq),
363 tx4938_irq_pic_mask(irq), 0);
364
365 spin_unlock_irqrestore(&tx4938_pic_lock, flags);
366
367 return;
368}
369
370static void
371tx4938_irq_pic_mask_and_ack(unsigned int irq)
372{
373 tx4938_irq_pic_disable(irq);
374
375 return;
376}
377
378static void
379tx4938_irq_pic_end(unsigned int irq)
380{
381 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) {
382 tx4938_irq_pic_enable(irq);
383 }
384
385 return;
386}
387
388/**********************************************************************************/
389/* Main init functions */
390/**********************************************************************************/
391
392void __init
393tx4938_irq_init(void)
394{
395 extern asmlinkage void tx4938_irq_handler(void);
396
397 tx4938_irq_cp0_init();
398 tx4938_irq_pic_init();
399 set_except_vector(0, tx4938_irq_handler);
400
401 return;
402}
403
404int
405tx4938_irq_nested(void)
406{
407 int sw_irq = 0;
408 u32 level2;
409
410 level2 = TX4938_RD(0xff1ff6a0);
411 if ((level2 & 0x10000) == 0) {
412 level2 &= 0x1f;
413 sw_irq = TX4938_IRQ_PIC_BEG + level2;
414 if (sw_irq == 26) {
415 {
416 extern int toshiba_rbtx4938_irq_nested(int sw_irq);
417 sw_irq = toshiba_rbtx4938_irq_nested(sw_irq);
418 }
419 }
420 }
421
422 wbflush();
423 return (sw_irq);
424}
diff --git a/arch/mips/tx4938/common/irq_handler.S b/arch/mips/tx4938/common/irq_handler.S
new file mode 100644
index 000000000000..1b2f72bac42d
--- /dev/null
+++ b/arch/mips/tx4938/common/irq_handler.S
@@ -0,0 +1,84 @@
1/*
2 * linux/arch/mips/tx4938/common/handler.S
3 *
4 * Primary interrupt handler for tx4938 based systems
5 * Copyright (C) 2000-2001 Toshiba Corporation
6 *
7 * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
8 * terms of the GNU General Public License version 2. This program is
9 * licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 *
12 * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
13 */
14#include <asm/asm.h>
15#include <asm/mipsregs.h>
16#include <asm/addrspace.h>
17#include <asm/regdef.h>
18#include <asm/stackframe.h>
19#include <asm/tx4938/rbtx4938.h>
20
21
22 .align 5
23 NESTED(tx4938_irq_handler, PT_SIZE, sp)
24 SAVE_ALL
25 CLI
26 .set at
27
28 mfc0 t0, CP0_CAUSE
29 mfc0 t1, CP0_STATUS
30 and t0, t1
31
32 andi t1, t0, STATUSF_IP7 /* cpu timer */
33 bnez t1, ll_ip7
34
35 /* IP6..IP3 multiplexed -- do not use */
36
37 andi t1, t0, STATUSF_IP2 /* tx4938 pic */
38 bnez t1, ll_ip2
39
40 andi t1, t0, STATUSF_IP1 /* user line 1 */
41 bnez t1, ll_ip1
42
43 andi t1, t0, STATUSF_IP0 /* user line 0 */
44 bnez t1, ll_ip0
45
46 .set reorder
47
48 nop
49 END(tx4938_irq_handler)
50
51 .align 5
52
53
54ll_ip7:
55 li a0, TX4938_IRQ_CPU_TIMER
56 move a1, sp
57 jal do_IRQ
58 j ret_from_irq
59
60
61ll_ip2:
62 jal tx4938_irq_nested
63 nop
64 beqz v0, goto_spurious_interrupt
65 nop
66 move a0, v0
67 move a1, sp
68 jal do_IRQ
69 j ret_from_irq
70
71goto_spurious_interrupt:
72 j ret_from_irq
73
74ll_ip1:
75 li a0, TX4938_IRQ_USER1
76 move a1, sp
77 jal do_IRQ
78 j ret_from_irq
79
80ll_ip0:
81 li a0, TX4938_IRQ_USER0
82 move a1, sp
83 jal do_IRQ
84 j ret_from_irq
diff --git a/arch/mips/tx4938/common/prom.c b/arch/mips/tx4938/common/prom.c
new file mode 100644
index 000000000000..3189a65f7d7e
--- /dev/null
+++ b/arch/mips/tx4938/common/prom.c
@@ -0,0 +1,129 @@
1/*
2 * linux/arch/mips/tx4938/common/prom.c
3 *
4 * common tx4938 memory interface
5 * Copyright (C) 2000-2001 Toshiba Corporation
6 *
7 * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
8 * terms of the GNU General Public License version 2. This program is
9 * licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 *
12 * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
13 */
14
15#include <linux/init.h>
16#include <linux/mm.h>
17#include <linux/sched.h>
18#include <linux/bootmem.h>
19
20#include <asm/addrspace.h>
21#include <asm/bootinfo.h>
22#include <asm/tx4938/tx4938.h>
23
24static unsigned int __init
25tx4938_process_sdccr(u64 * addr)
26{
27 u64 val;
28 unsigned int sdccr_ce;
29 unsigned int sdccr_rs;
30 unsigned int sdccr_cs;
31 unsigned int sdccr_mw;
32 unsigned int rs = 0;
33 unsigned int cs = 0;
34 unsigned int mw = 0;
35 unsigned int bc = 4;
36 unsigned int msize = 0;
37
38 val = (*((vu64 *) (addr)));
39
40 /* MVMCP -- need #defs for these bits masks */
41 sdccr_ce = ((val & (1 << 10)) >> 10);
42 sdccr_rs = ((val & (3 << 5)) >> 5);
43 sdccr_cs = ((val & (7 << 2)) >> 2);
44 sdccr_mw = ((val & (1 << 0)) >> 0);
45
46 if (sdccr_ce) {
47 switch (sdccr_rs) {
48 case 0:{
49 rs = 2048;
50 break;
51 }
52 case 1:{
53 rs = 4096;
54 break;
55 }
56 case 2:{
57 rs = 8192;
58 break;
59 }
60 default:{
61 rs = 0;
62 break;
63 }
64 }
65 switch (sdccr_cs) {
66 case 0:{
67 cs = 256;
68 break;
69 }
70 case 1:{
71 cs = 512;
72 break;
73 }
74 case 2:{
75 cs = 1024;
76 break;
77 }
78 case 3:{
79 cs = 2048;
80 break;
81 }
82 case 4:{
83 cs = 4096;
84 break;
85 }
86 default:{
87 cs = 0;
88 break;
89 }
90 }
91 switch (sdccr_mw) {
92 case 0:{
93 mw = 8;
94 break;
95 } /* 8 bytes = 64 bits */
96 case 1:{
97 mw = 4;
98 break;
99 } /* 4 bytes = 32 bits */
100 }
101 }
102
103 /* bytes per chip MB per chip bank count */
104 msize = (((rs * cs * mw) / (1024 * 1024)) * (bc));
105
106 /* MVMCP -- bc hard coded to 4 from table 9.3.1 */
107 /* boad supports bc=2 but no way to detect */
108
109 return (msize);
110}
111
112unsigned int __init
113tx4938_get_mem_size(void)
114{
115 unsigned int c0;
116 unsigned int c1;
117 unsigned int c2;
118 unsigned int c3;
119 unsigned int total;
120
121 /* MVMCP -- need #defs for these registers */
122 c0 = tx4938_process_sdccr((u64 *) 0xff1f8000);
123 c1 = tx4938_process_sdccr((u64 *) 0xff1f8008);
124 c2 = tx4938_process_sdccr((u64 *) 0xff1f8010);
125 c3 = tx4938_process_sdccr((u64 *) 0xff1f8018);
126 total = c0 + c1 + c2 + c3;
127
128 return (total);
129}
diff --git a/arch/mips/tx4938/common/rtc_rx5c348.c b/arch/mips/tx4938/common/rtc_rx5c348.c
new file mode 100644
index 000000000000..d249edbb6af4
--- /dev/null
+++ b/arch/mips/tx4938/common/rtc_rx5c348.c
@@ -0,0 +1,202 @@
1/*
2 * RTC routines for RICOH Rx5C348 SPI chip.
3 * Copyright (C) 2000-2001 Toshiba Corporation
4 *
5 * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
6 * terms of the GNU General Public License version 2. This program is
7 * licensed "as is" without any warranty of any kind, whether express
8 * or implied.
9 *
10 * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
11 */
12#include <linux/init.h>
13#include <linux/kernel.h>
14#include <linux/string.h>
15#include <linux/rtc.h>
16#include <linux/time.h>
17#include <asm/time.h>
18#include <asm/tx4938/spi.h>
19
20#define EPOCH 2000
21
22/* registers */
23#define Rx5C348_REG_SECOND 0
24#define Rx5C348_REG_MINUTE 1
25#define Rx5C348_REG_HOUR 2
26#define Rx5C348_REG_WEEK 3
27#define Rx5C348_REG_DAY 4
28#define Rx5C348_REG_MONTH 5
29#define Rx5C348_REG_YEAR 6
30#define Rx5C348_REG_ADJUST 7
31#define Rx5C348_REG_ALARM_W_MIN 8
32#define Rx5C348_REG_ALARM_W_HOUR 9
33#define Rx5C348_REG_ALARM_W_WEEK 10
34#define Rx5C348_REG_ALARM_D_MIN 11
35#define Rx5C348_REG_ALARM_D_HOUR 12
36#define Rx5C348_REG_CTL1 14
37#define Rx5C348_REG_CTL2 15
38
39/* register bits */
40#define Rx5C348_BIT_PM 0x20 /* REG_HOUR */
41#define Rx5C348_BIT_Y2K 0x80 /* REG_MONTH */
42#define Rx5C348_BIT_24H 0x20 /* REG_CTL1 */
43#define Rx5C348_BIT_XSTP 0x10 /* REG_CTL2 */
44
45/* commands */
46#define Rx5C348_CMD_W(addr) (((addr) << 4) | 0x08) /* single write */
47#define Rx5C348_CMD_R(addr) (((addr) << 4) | 0x0c) /* single read */
48#define Rx5C348_CMD_MW(addr) (((addr) << 4) | 0x00) /* burst write */
49#define Rx5C348_CMD_MR(addr) (((addr) << 4) | 0x04) /* burst read */
50
51static struct spi_dev_desc srtc_dev_desc = {
52 .baud = 1000000, /* 1.0Mbps @ Vdd 2.0V */
53 .tcss = 31,
54 .tcsh = 1,
55 .tcsr = 62,
56 /* 31us for Tcss (62us for Tcsr) is required for carry operation) */
57 .byteorder = 1, /* MSB-First */
58 .polarity = 0, /* High-Active */
59 .phase = 1, /* Shift-Then-Sample */
60
61};
62static int srtc_chipid;
63static int srtc_24h;
64
65static inline int
66spi_rtc_io(unsigned char *inbuf, unsigned char *outbuf, unsigned int count)
67{
68 unsigned char *inbufs[1], *outbufs[1];
69 unsigned int incounts[2], outcounts[2];
70 inbufs[0] = inbuf;
71 incounts[0] = count;
72 incounts[1] = 0;
73 outbufs[0] = outbuf;
74 outcounts[0] = count;
75 outcounts[1] = 0;
76 return txx9_spi_io(srtc_chipid, &srtc_dev_desc,
77 inbufs, incounts, outbufs, outcounts, 0);
78}
79
80/*
81 * Conversion between binary and BCD.
82 */
83#ifndef BCD_TO_BIN
84#define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10)
85#endif
86
87#ifndef BIN_TO_BCD
88#define BIN_TO_BCD(val) ((val)=(((val)/10)<<4) + (val)%10)
89#endif
90
91/* RTC-dependent code for time.c */
92
93static int
94rtc_rx5c348_set_time(unsigned long t)
95{
96 unsigned char inbuf[8];
97 struct rtc_time tm;
98 u8 year, month, day, hour, minute, second, century;
99
100 /* convert */
101 to_tm(t, &tm);
102
103 year = tm.tm_year % 100;
104 month = tm.tm_mon+1; /* tm_mon starts from 0 to 11 */
105 day = tm.tm_mday;
106 hour = tm.tm_hour;
107 minute = tm.tm_min;
108 second = tm.tm_sec;
109 century = tm.tm_year / 100;
110
111 inbuf[0] = Rx5C348_CMD_MW(Rx5C348_REG_SECOND);
112 BIN_TO_BCD(second);
113 inbuf[1] = second;
114 BIN_TO_BCD(minute);
115 inbuf[2] = minute;
116
117 if (srtc_24h) {
118 BIN_TO_BCD(hour);
119 inbuf[3] = hour;
120 } else {
121 /* hour 0 is AM12, noon is PM12 */
122 inbuf[3] = 0;
123 if (hour >= 12)
124 inbuf[3] = Rx5C348_BIT_PM;
125 hour = (hour + 11) % 12 + 1;
126 BIN_TO_BCD(hour);
127 inbuf[3] |= hour;
128 }
129 inbuf[4] = 0; /* ignore week */
130 BIN_TO_BCD(day);
131 inbuf[5] = day;
132 BIN_TO_BCD(month);
133 inbuf[6] = month;
134 if (century >= 20)
135 inbuf[6] |= Rx5C348_BIT_Y2K;
136 BIN_TO_BCD(year);
137 inbuf[7] = year;
138 /* write in one transfer to avoid data inconsistency */
139 return spi_rtc_io(inbuf, NULL, 8);
140}
141
142static unsigned long
143rtc_rx5c348_get_time(void)
144{
145 unsigned char inbuf[8], outbuf[8];
146 unsigned int year, month, day, hour, minute, second;
147
148 inbuf[0] = Rx5C348_CMD_MR(Rx5C348_REG_SECOND);
149 memset(inbuf + 1, 0, 7);
150 /* read in one transfer to avoid data inconsistency */
151 if (spi_rtc_io(inbuf, outbuf, 8))
152 return 0;
153 second = outbuf[1];
154 BCD_TO_BIN(second);
155 minute = outbuf[2];
156 BCD_TO_BIN(minute);
157 if (srtc_24h) {
158 hour = outbuf[3];
159 BCD_TO_BIN(hour);
160 } else {
161 hour = outbuf[3] & ~Rx5C348_BIT_PM;
162 BCD_TO_BIN(hour);
163 hour %= 12;
164 if (outbuf[3] & Rx5C348_BIT_PM)
165 hour += 12;
166 }
167 day = outbuf[5];
168 BCD_TO_BIN(day);
169 month = outbuf[6] & ~Rx5C348_BIT_Y2K;
170 BCD_TO_BIN(month);
171 year = outbuf[7];
172 BCD_TO_BIN(year);
173 year += EPOCH;
174
175 return mktime(year, month, day, hour, minute, second);
176}
177
178void __init
179rtc_rx5c348_init(int chipid)
180{
181 unsigned char inbuf[2], outbuf[2];
182 srtc_chipid = chipid;
183 /* turn on RTC if it is not on */
184 inbuf[0] = Rx5C348_CMD_R(Rx5C348_REG_CTL2);
185 inbuf[1] = 0;
186 spi_rtc_io(inbuf, outbuf, 2);
187 if (outbuf[1] & Rx5C348_BIT_XSTP) {
188 inbuf[0] = Rx5C348_CMD_W(Rx5C348_REG_CTL2);
189 inbuf[1] = 0;
190 spi_rtc_io(inbuf, NULL, 2);
191 }
192
193 inbuf[0] = Rx5C348_CMD_R(Rx5C348_REG_CTL1);
194 inbuf[1] = 0;
195 spi_rtc_io(inbuf, outbuf, 2);
196 if (outbuf[1] & Rx5C348_BIT_24H)
197 srtc_24h = 1;
198
199 /* set the function pointers */
200 rtc_get_time = rtc_rx5c348_get_time;
201 rtc_set_time = rtc_rx5c348_set_time;
202}
diff --git a/arch/mips/tx4938/common/setup.c b/arch/mips/tx4938/common/setup.c
new file mode 100644
index 000000000000..fc992953bf95
--- /dev/null
+++ b/arch/mips/tx4938/common/setup.c
@@ -0,0 +1,91 @@
1/*
2 * linux/arch/mips/tx4938/common/setup.c
3 *
4 * common tx4938 setup routines
5 *
6 * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
7 * terms of the GNU General Public License version 2. This program is
8 * licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 *
11 * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
12 */
13
14#include <linux/errno.h>
15#include <linux/init.h>
16#include <linux/kernel_stat.h>
17#include <linux/module.h>
18#include <linux/signal.h>
19#include <linux/sched.h>
20#include <linux/types.h>
21#include <linux/interrupt.h>
22#include <linux/ioport.h>
23#include <linux/timex.h>
24#include <linux/slab.h>
25#include <linux/random.h>
26#include <linux/irq.h>
27#include <asm/bitops.h>
28#include <asm/bootinfo.h>
29#include <asm/io.h>
30#include <asm/irq.h>
31#include <asm/mipsregs.h>
32#include <asm/system.h>
33#include <asm/time.h>
34#include <asm/time.h>
35#include <asm/tx4938/rbtx4938.h>
36
37extern void toshiba_rbtx4938_setup(void);
38extern void rbtx4938_time_init(void);
39
40void __init tx4938_setup(void);
41void __init tx4938_time_init(void);
42void __init tx4938_timer_setup(struct irqaction *irq);
43void dump_cp0(char *key);
44
45void (*__wbflush) (void);
46
47static void
48tx4938_write_buffer_flush(void)
49{
50 mmiowb();
51
52 __asm__ __volatile__(
53 ".set push\n\t"
54 ".set noreorder\n\t"
55 "lw $0,%0\n\t"
56 "nop\n\t"
57 ".set pop"
58 : /* no output */
59 : "m" (*(int *)KSEG1)
60 : "memory");
61}
62
63void __init
64plat_setup(void)
65{
66 board_time_init = tx4938_time_init;
67 board_timer_setup = tx4938_timer_setup;
68 __wbflush = tx4938_write_buffer_flush;
69 toshiba_rbtx4938_setup();
70}
71
72void __init
73tx4938_time_init(void)
74{
75 rbtx4938_time_init();
76}
77
78void __init
79tx4938_timer_setup(struct irqaction *irq)
80{
81 u32 count;
82 u32 c1;
83 u32 c2;
84
85 setup_irq(TX4938_IRQ_CPU_TIMER, irq);
86
87 c1 = read_c0_count();
88 count = c1 + (mips_hpt_frequency / HZ);
89 write_c0_compare(count);
90 c2 = read_c0_count();
91}
diff --git a/arch/mips/tx4938/toshiba_rbtx4938/Makefile b/arch/mips/tx4938/toshiba_rbtx4938/Makefile
new file mode 100644
index 000000000000..226941279d75
--- /dev/null
+++ b/arch/mips/tx4938/toshiba_rbtx4938/Makefile
@@ -0,0 +1,9 @@
1#
2# Makefile for common code for Toshiba TX4927 based systems
3#
4# Note! Dependencies are done automagically by 'make dep', which also
5# removes any old dependencies. DON'T put your own dependencies here
6# unless it's something special (ie not a .c file).
7#
8
9obj-y += prom.o setup.o irq.o spi_eeprom.o spi_txx9.o
diff --git a/arch/mips/tx4938/toshiba_rbtx4938/irq.c b/arch/mips/tx4938/toshiba_rbtx4938/irq.c
new file mode 100644
index 000000000000..230f5a93c2e6
--- /dev/null
+++ b/arch/mips/tx4938/toshiba_rbtx4938/irq.c
@@ -0,0 +1,244 @@
1/*
2 * linux/arch/mips/tx4938/toshiba_rbtx4938/irq.c
3 *
4 * Toshiba RBTX4938 specific interrupt handlers
5 * Copyright (C) 2000-2001 Toshiba Corporation
6 *
7 * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
8 * terms of the GNU General Public License version 2. This program is
9 * licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 *
12 * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
13 */
14
15/*
16IRQ Device
17
1816 TX4938-CP0/00 Software 0
1917 TX4938-CP0/01 Software 1
2018 TX4938-CP0/02 Cascade TX4938-CP0
2119 TX4938-CP0/03 Multiplexed -- do not use
2220 TX4938-CP0/04 Multiplexed -- do not use
2321 TX4938-CP0/05 Multiplexed -- do not use
2422 TX4938-CP0/06 Multiplexed -- do not use
2523 TX4938-CP0/07 CPU TIMER
26
2724 TX4938-PIC/00
2825 TX4938-PIC/01
2926 TX4938-PIC/02 Cascade RBTX4938-IOC
3027 TX4938-PIC/03 RBTX4938 RTL-8019AS Ethernet
3128 TX4938-PIC/04
3229 TX4938-PIC/05 TX4938 ETH1
3330 TX4938-PIC/06 TX4938 ETH0
3431 TX4938-PIC/07
3532 TX4938-PIC/08 TX4938 SIO 0
3633 TX4938-PIC/09 TX4938 SIO 1
3734 TX4938-PIC/10 TX4938 DMA0
3835 TX4938-PIC/11 TX4938 DMA1
3936 TX4938-PIC/12 TX4938 DMA2
4037 TX4938-PIC/13 TX4938 DMA3
4138 TX4938-PIC/14
4239 TX4938-PIC/15
4340 TX4938-PIC/16 TX4938 PCIC
4441 TX4938-PIC/17 TX4938 TMR0
4542 TX4938-PIC/18 TX4938 TMR1
4643 TX4938-PIC/19 TX4938 TMR2
4744 TX4938-PIC/20
4845 TX4938-PIC/21
4946 TX4938-PIC/22 TX4938 PCIERR
5047 TX4938-PIC/23
5148 TX4938-PIC/24
5249 TX4938-PIC/25
5350 TX4938-PIC/26
5451 TX4938-PIC/27
5552 TX4938-PIC/28
5653 TX4938-PIC/29
5754 TX4938-PIC/30
5855 TX4938-PIC/31 TX4938 SPI
59
6056 RBTX4938-IOC/00 PCI-D
6157 RBTX4938-IOC/01 PCI-C
6258 RBTX4938-IOC/02 PCI-B
6359 RBTX4938-IOC/03 PCI-A
6460 RBTX4938-IOC/04 RTC
6561 RBTX4938-IOC/05 ATA
6662 RBTX4938-IOC/06 MODEM
6763 RBTX4938-IOC/07 SWINT
68*/
69#include <linux/init.h>
70#include <linux/kernel.h>
71#include <linux/types.h>
72#include <linux/mm.h>
73#include <linux/swap.h>
74#include <linux/ioport.h>
75#include <linux/sched.h>
76#include <linux/interrupt.h>
77#include <linux/pci.h>
78#include <linux/timex.h>
79#include <asm/bootinfo.h>
80#include <asm/page.h>
81#include <asm/io.h>
82#include <asm/irq.h>
83#include <asm/processor.h>
84#include <asm/ptrace.h>
85#include <asm/reboot.h>
86#include <asm/time.h>
87#include <linux/version.h>
88#include <linux/bootmem.h>
89#include <asm/tx4938/rbtx4938.h>
90
91static unsigned int toshiba_rbtx4938_irq_ioc_startup(unsigned int irq);
92static void toshiba_rbtx4938_irq_ioc_shutdown(unsigned int irq);
93static void toshiba_rbtx4938_irq_ioc_enable(unsigned int irq);
94static void toshiba_rbtx4938_irq_ioc_disable(unsigned int irq);
95static void toshiba_rbtx4938_irq_ioc_mask_and_ack(unsigned int irq);
96static void toshiba_rbtx4938_irq_ioc_end(unsigned int irq);
97
98DEFINE_SPINLOCK(toshiba_rbtx4938_ioc_lock);
99
100#define TOSHIBA_RBTX4938_IOC_NAME "RBTX4938-IOC"
101static struct hw_interrupt_type toshiba_rbtx4938_irq_ioc_type = {
102 .typename = TOSHIBA_RBTX4938_IOC_NAME,
103 .startup = toshiba_rbtx4938_irq_ioc_startup,
104 .shutdown = toshiba_rbtx4938_irq_ioc_shutdown,
105 .enable = toshiba_rbtx4938_irq_ioc_enable,
106 .disable = toshiba_rbtx4938_irq_ioc_disable,
107 .ack = toshiba_rbtx4938_irq_ioc_mask_and_ack,
108 .end = toshiba_rbtx4938_irq_ioc_end,
109 .set_affinity = NULL
110};
111
112#define TOSHIBA_RBTX4938_IOC_INTR_ENAB 0xb7f02000
113#define TOSHIBA_RBTX4938_IOC_INTR_STAT 0xb7f0200a
114
115int
116toshiba_rbtx4938_irq_nested(int sw_irq)
117{
118 u8 level3;
119
120 level3 = reg_rd08(TOSHIBA_RBTX4938_IOC_INTR_STAT) & 0xff;
121 if (level3) {
122 /* must use fls so onboard ATA has priority */
123 sw_irq = TOSHIBA_RBTX4938_IRQ_IOC_BEG + fls(level3) - 1;
124 }
125
126 wbflush();
127 return sw_irq;
128}
129
130static struct irqaction toshiba_rbtx4938_irq_ioc_action = {
131 .handler = no_action,
132 .flags = 0,
133 .mask = CPU_MASK_NONE,
134 .name = TOSHIBA_RBTX4938_IOC_NAME,
135};
136
137/**********************************************************************************/
138/* Functions for ioc */
139/**********************************************************************************/
140static void __init
141toshiba_rbtx4938_irq_ioc_init(void)
142{
143 int i;
144
145 for (i = TOSHIBA_RBTX4938_IRQ_IOC_BEG;
146 i <= TOSHIBA_RBTX4938_IRQ_IOC_END; i++) {
147 irq_desc[i].status = IRQ_DISABLED;
148 irq_desc[i].action = 0;
149 irq_desc[i].depth = 3;
150 irq_desc[i].handler = &toshiba_rbtx4938_irq_ioc_type;
151 }
152
153 setup_irq(RBTX4938_IRQ_IOCINT,
154 &toshiba_rbtx4938_irq_ioc_action);
155}
156
157static unsigned int
158toshiba_rbtx4938_irq_ioc_startup(unsigned int irq)
159{
160 toshiba_rbtx4938_irq_ioc_enable(irq);
161
162 return 0;
163}
164
165static void
166toshiba_rbtx4938_irq_ioc_shutdown(unsigned int irq)
167{
168 toshiba_rbtx4938_irq_ioc_disable(irq);
169}
170
171static void
172toshiba_rbtx4938_irq_ioc_enable(unsigned int irq)
173{
174 unsigned long flags;
175 volatile unsigned char v;
176
177 spin_lock_irqsave(&toshiba_rbtx4938_ioc_lock, flags);
178
179 v = TX4938_RD08(TOSHIBA_RBTX4938_IOC_INTR_ENAB);
180 v |= (1 << (irq - TOSHIBA_RBTX4938_IRQ_IOC_BEG));
181 TX4938_WR08(TOSHIBA_RBTX4938_IOC_INTR_ENAB, v);
182 mmiowb();
183 TX4938_RD08(TOSHIBA_RBTX4938_IOC_INTR_ENAB);
184
185 spin_unlock_irqrestore(&toshiba_rbtx4938_ioc_lock, flags);
186}
187
188static void
189toshiba_rbtx4938_irq_ioc_disable(unsigned int irq)
190{
191 unsigned long flags;
192 volatile unsigned char v;
193
194 spin_lock_irqsave(&toshiba_rbtx4938_ioc_lock, flags);
195
196 v = TX4938_RD08(TOSHIBA_RBTX4938_IOC_INTR_ENAB);
197 v &= ~(1 << (irq - TOSHIBA_RBTX4938_IRQ_IOC_BEG));
198 TX4938_WR08(TOSHIBA_RBTX4938_IOC_INTR_ENAB, v);
199 mmiowb();
200 TX4938_RD08(TOSHIBA_RBTX4938_IOC_INTR_ENAB);
201
202 spin_unlock_irqrestore(&toshiba_rbtx4938_ioc_lock, flags);
203}
204
205static void
206toshiba_rbtx4938_irq_ioc_mask_and_ack(unsigned int irq)
207{
208 toshiba_rbtx4938_irq_ioc_disable(irq);
209}
210
211static void
212toshiba_rbtx4938_irq_ioc_end(unsigned int irq)
213{
214 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) {
215 toshiba_rbtx4938_irq_ioc_enable(irq);
216 }
217}
218
219extern void __init txx9_spi_irqinit(int irc_irq);
220
221void __init arch_init_irq(void)
222{
223 extern void tx4938_irq_init(void);
224
225 /* Now, interrupt control disabled, */
226 /* all IRC interrupts are masked, */
227 /* all IRC interrupt mode are Low Active. */
228
229 /* mask all IOC interrupts */
230 *rbtx4938_imask_ptr = 0;
231
232 /* clear SoftInt interrupts */
233 *rbtx4938_softint_ptr = 0;
234 tx4938_irq_init();
235 toshiba_rbtx4938_irq_ioc_init();
236 /* Onboard 10M Ether: High Active */
237 TX4938_WR(TX4938_MKA(TX4938_IRC_IRDM0), 0x00000040);
238
239 if (tx4938_ccfgptr->pcfg & TX4938_PCFG_SPI_SEL) {
240 txx9_spi_irqinit(RBTX4938_IRQ_IRC_SPI);
241 }
242
243 wbflush();
244}
diff --git a/arch/mips/tx4938/toshiba_rbtx4938/prom.c b/arch/mips/tx4938/toshiba_rbtx4938/prom.c
new file mode 100644
index 000000000000..7df8b32ba265
--- /dev/null
+++ b/arch/mips/tx4938/toshiba_rbtx4938/prom.c
@@ -0,0 +1,78 @@
1/*
2 * linux/arch/mips/tx4938/toshiba_rbtx4938/prom.c
3 *
4 * rbtx4938 specific prom routines
5 * Copyright (C) 2000-2001 Toshiba Corporation
6 *
7 * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
8 * terms of the GNU General Public License version 2. This program is
9 * licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 *
12 * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
13 */
14
15#include <linux/config.h>
16#include <linux/init.h>
17#include <linux/mm.h>
18#include <linux/sched.h>
19#include <linux/bootmem.h>
20
21#include <asm/addrspace.h>
22#include <asm/bootinfo.h>
23#include <asm/tx4938/tx4938.h>
24
25void __init prom_init_cmdline(void)
26{
27 int argc = (int) fw_arg0;
28 char **argv = (char **) fw_arg1;
29 int i;
30
31 /* ignore all built-in args if any f/w args given */
32 if (argc > 1) {
33 *arcs_cmdline = '\0';
34 }
35
36 for (i = 1; i < argc; i++) {
37 if (i != 1) {
38 strcat(arcs_cmdline, " ");
39 }
40 strcat(arcs_cmdline, argv[i]);
41 }
42}
43
44void __init prom_init(void)
45{
46 extern int tx4938_get_mem_size(void);
47 int msize;
48#ifndef CONFIG_TX4938_NAND_BOOT
49 prom_init_cmdline();
50#endif
51 mips_machgroup = MACH_GROUP_TOSHIBA;
52 mips_machtype = MACH_TOSHIBA_RBTX4938;
53
54 msize = tx4938_get_mem_size();
55 add_memory_region(0, msize << 20, BOOT_MEM_RAM);
56
57 return;
58}
59
60unsigned long __init prom_free_prom_memory(void)
61{
62 return 0;
63}
64
65void __init prom_fixup_mem_map(unsigned long start, unsigned long end)
66{
67 return;
68}
69
70const char *get_system_type(void)
71{
72 return "Toshiba RBTX4938";
73}
74
75char * __init prom_getcmdline(void)
76{
77 return &(arcs_cmdline[0]);
78}
diff --git a/arch/mips/tx4938/toshiba_rbtx4938/setup.c b/arch/mips/tx4938/toshiba_rbtx4938/setup.c
new file mode 100644
index 000000000000..9f1dcc8ca5a3
--- /dev/null
+++ b/arch/mips/tx4938/toshiba_rbtx4938/setup.c
@@ -0,0 +1,1035 @@
1/*
2 * linux/arch/mips/tx4938/toshiba_rbtx4938/setup.c
3 *
4 * Setup pointers to hardware-dependent routines.
5 * Copyright (C) 2000-2001 Toshiba Corporation
6 *
7 * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
8 * terms of the GNU General Public License version 2. This program is
9 * licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 *
12 * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
13 */
14#include <linux/config.h>
15#include <linux/init.h>
16#include <linux/types.h>
17#include <linux/ioport.h>
18#include <linux/proc_fs.h>
19#include <linux/delay.h>
20#include <linux/interrupt.h>
21#include <linux/console.h>
22#include <linux/pci.h>
23#include <asm/wbflush.h>
24#include <asm/reboot.h>
25#include <asm/irq.h>
26#include <asm/time.h>
27#include <asm/uaccess.h>
28#include <asm/io.h>
29#include <asm/bootinfo.h>
30#include <asm/tx4938/rbtx4938.h>
31#ifdef CONFIG_SERIAL_TXX9
32#include <linux/tty.h>
33#include <linux/serial.h>
34#include <linux/serial_core.h>
35#endif
36
37extern void rbtx4938_time_init(void) __init;
38extern char * __init prom_getcmdline(void);
39static inline void tx4938_report_pcic_status1(struct tx4938_pcic_reg *pcicptr);
40
41/* These functions are used for rebooting or halting the machine*/
42extern void rbtx4938_machine_restart(char *command);
43extern void rbtx4938_machine_halt(void);
44extern void rbtx4938_machine_power_off(void);
45
46/* clocks */
47unsigned int txx9_master_clock;
48unsigned int txx9_cpu_clock;
49unsigned int txx9_gbus_clock;
50
51unsigned long rbtx4938_ce_base[8];
52unsigned long rbtx4938_ce_size[8];
53int txboard_pci66_mode;
54static int tx4938_pcic_trdyto; /* default: disabled */
55static int tx4938_pcic_retryto; /* default: disabled */
56static int tx4938_ccfg_toeon = 1;
57
58struct tx4938_pcic_reg *pcicptrs[4] = {
59 tx4938_pcicptr /* default setting for TX4938 */
60};
61
62static struct {
63 unsigned long base;
64 unsigned long size;
65} phys_regions[16] __initdata;
66static int num_phys_regions __initdata;
67
68#define PHYS_REGION_MINSIZE 0x10000
69
70void rbtx4938_machine_halt(void)
71{
72 printk(KERN_NOTICE "System Halted\n");
73 local_irq_disable();
74
75 while (1)
76 __asm__(".set\tmips3\n\t"
77 "wait\n\t"
78 ".set\tmips0");
79}
80
81void rbtx4938_machine_power_off(void)
82{
83 rbtx4938_machine_halt();
84 /* no return */
85}
86
87void rbtx4938_machine_restart(char *command)
88{
89 local_irq_disable();
90
91 printk("Rebooting...");
92 *rbtx4938_softresetlock_ptr = 1;
93 *rbtx4938_sfvol_ptr = 1;
94 *rbtx4938_softreset_ptr = 1;
95 wbflush();
96
97 while(1);
98}
99
100void __init
101txboard_add_phys_region(unsigned long base, unsigned long size)
102{
103 if (num_phys_regions >= ARRAY_SIZE(phys_regions)) {
104 printk("phys_region overflow\n");
105 return;
106 }
107 phys_regions[num_phys_regions].base = base;
108 phys_regions[num_phys_regions].size = size;
109 num_phys_regions++;
110}
111unsigned long __init
112txboard_find_free_phys_region(unsigned long begin, unsigned long end,
113 unsigned long size)
114{
115 unsigned long base;
116 int i;
117
118 for (base = begin / size * size; base < end; base += size) {
119 for (i = 0; i < num_phys_regions; i++) {
120 if (phys_regions[i].size &&
121 base <= phys_regions[i].base + (phys_regions[i].size - 1) &&
122 base + (size - 1) >= phys_regions[i].base)
123 break;
124 }
125 if (i == num_phys_regions)
126 return base;
127 }
128 return 0;
129}
130unsigned long __init
131txboard_find_free_phys_region_shrink(unsigned long begin, unsigned long end,
132 unsigned long *size)
133{
134 unsigned long sz, base;
135 for (sz = *size; sz >= PHYS_REGION_MINSIZE; sz /= 2) {
136 base = txboard_find_free_phys_region(begin, end, sz);
137 if (base) {
138 *size = sz;
139 return base;
140 }
141 }
142 return 0;
143}
144unsigned long __init
145txboard_request_phys_region_range(unsigned long begin, unsigned long end,
146 unsigned long size)
147{
148 unsigned long base;
149 base = txboard_find_free_phys_region(begin, end, size);
150 if (base)
151 txboard_add_phys_region(base, size);
152 return base;
153}
154unsigned long __init
155txboard_request_phys_region(unsigned long size)
156{
157 unsigned long base;
158 unsigned long begin = 0, end = 0x20000000; /* search low 512MB */
159 base = txboard_find_free_phys_region(begin, end, size);
160 if (base)
161 txboard_add_phys_region(base, size);
162 return base;
163}
164unsigned long __init
165txboard_request_phys_region_shrink(unsigned long *size)
166{
167 unsigned long base;
168 unsigned long begin = 0, end = 0x20000000; /* search low 512MB */
169 base = txboard_find_free_phys_region_shrink(begin, end, size);
170 if (base)
171 txboard_add_phys_region(base, *size);
172 return base;
173}
174
175#ifdef CONFIG_PCI
176void __init
177tx4938_pcic_setup(struct tx4938_pcic_reg *pcicptr,
178 struct pci_controller *channel,
179 unsigned long pci_io_base,
180 int extarb)
181{
182 int i;
183
184 /* Disable All Initiator Space */
185 pcicptr->pciccfg &= ~(TX4938_PCIC_PCICCFG_G2PMEN(0)|
186 TX4938_PCIC_PCICCFG_G2PMEN(1)|
187 TX4938_PCIC_PCICCFG_G2PMEN(2)|
188 TX4938_PCIC_PCICCFG_G2PIOEN);
189
190 /* GB->PCI mappings */
191 pcicptr->g2piomask = (channel->io_resource->end - channel->io_resource->start) >> 4;
192 pcicptr->g2piogbase = pci_io_base |
193#ifdef __BIG_ENDIAN
194 TX4938_PCIC_G2PIOGBASE_ECHG
195#else
196 TX4938_PCIC_G2PIOGBASE_BSDIS
197#endif
198 ;
199 pcicptr->g2piopbase = 0;
200 for (i = 0; i < 3; i++) {
201 pcicptr->g2pmmask[i] = 0;
202 pcicptr->g2pmgbase[i] = 0;
203 pcicptr->g2pmpbase[i] = 0;
204 }
205 if (channel->mem_resource->end) {
206 pcicptr->g2pmmask[0] = (channel->mem_resource->end - channel->mem_resource->start) >> 4;
207 pcicptr->g2pmgbase[0] = channel->mem_resource->start |
208#ifdef __BIG_ENDIAN
209 TX4938_PCIC_G2PMnGBASE_ECHG
210#else
211 TX4938_PCIC_G2PMnGBASE_BSDIS
212#endif
213 ;
214 pcicptr->g2pmpbase[0] = channel->mem_resource->start;
215 }
216 /* PCI->GB mappings (I/O 256B) */
217 pcicptr->p2giopbase = 0; /* 256B */
218 pcicptr->p2giogbase = 0;
219 /* PCI->GB mappings (MEM 512MB (64MB on R1.x)) */
220 pcicptr->p2gm0plbase = 0;
221 pcicptr->p2gm0pubase = 0;
222 pcicptr->p2gmgbase[0] = 0 |
223 TX4938_PCIC_P2GMnGBASE_TMEMEN |
224#ifdef __BIG_ENDIAN
225 TX4938_PCIC_P2GMnGBASE_TECHG
226#else
227 TX4938_PCIC_P2GMnGBASE_TBSDIS
228#endif
229 ;
230 /* PCI->GB mappings (MEM 16MB) */
231 pcicptr->p2gm1plbase = 0xffffffff;
232 pcicptr->p2gm1pubase = 0xffffffff;
233 pcicptr->p2gmgbase[1] = 0;
234 /* PCI->GB mappings (MEM 1MB) */
235 pcicptr->p2gm2pbase = 0xffffffff; /* 1MB */
236 pcicptr->p2gmgbase[2] = 0;
237
238 pcicptr->pciccfg &= TX4938_PCIC_PCICCFG_GBWC_MASK;
239 /* Enable Initiator Memory Space */
240 if (channel->mem_resource->end)
241 pcicptr->pciccfg |= TX4938_PCIC_PCICCFG_G2PMEN(0);
242 /* Enable Initiator I/O Space */
243 if (channel->io_resource->end)
244 pcicptr->pciccfg |= TX4938_PCIC_PCICCFG_G2PIOEN;
245 /* Enable Initiator Config */
246 pcicptr->pciccfg |=
247 TX4938_PCIC_PCICCFG_ICAEN |
248 TX4938_PCIC_PCICCFG_TCAR;
249
250 /* Do not use MEMMUL, MEMINF: YMFPCI card causes M_ABORT. */
251 pcicptr->pcicfg1 = 0;
252
253 pcicptr->g2ptocnt &= ~0xffff;
254
255 if (tx4938_pcic_trdyto >= 0) {
256 pcicptr->g2ptocnt &= ~0xff;
257 pcicptr->g2ptocnt |= (tx4938_pcic_trdyto & 0xff);
258 }
259
260 if (tx4938_pcic_retryto >= 0) {
261 pcicptr->g2ptocnt &= ~0xff00;
262 pcicptr->g2ptocnt |= ((tx4938_pcic_retryto<<8) & 0xff00);
263 }
264
265 /* Clear All Local Bus Status */
266 pcicptr->pcicstatus = TX4938_PCIC_PCICSTATUS_ALL;
267 /* Enable All Local Bus Interrupts */
268 pcicptr->pcicmask = TX4938_PCIC_PCICSTATUS_ALL;
269 /* Clear All Initiator Status */
270 pcicptr->g2pstatus = TX4938_PCIC_G2PSTATUS_ALL;
271 /* Enable All Initiator Interrupts */
272 pcicptr->g2pmask = TX4938_PCIC_G2PSTATUS_ALL;
273 /* Clear All PCI Status Error */
274 pcicptr->pcistatus =
275 (pcicptr->pcistatus & 0x0000ffff) |
276 (TX4938_PCIC_PCISTATUS_ALL << 16);
277 /* Enable All PCI Status Error Interrupts */
278 pcicptr->pcimask = TX4938_PCIC_PCISTATUS_ALL;
279
280 if (!extarb) {
281 /* Reset Bus Arbiter */
282 pcicptr->pbacfg = TX4938_PCIC_PBACFG_RPBA;
283 pcicptr->pbabm = 0;
284 /* Enable Bus Arbiter */
285 pcicptr->pbacfg = TX4938_PCIC_PBACFG_PBAEN;
286 }
287
288 /* PCIC Int => IRC IRQ16 */
289 pcicptr->pcicfg2 =
290 (pcicptr->pcicfg2 & 0xffffff00) | TX4938_IR_PCIC;
291
292 pcicptr->pcistatus = PCI_COMMAND_MASTER |
293 PCI_COMMAND_MEMORY |
294 PCI_COMMAND_PARITY | PCI_COMMAND_SERR;
295}
296
297int __init
298tx4938_report_pciclk(void)
299{
300 unsigned long pcode = TX4938_REV_PCODE();
301 int pciclk = 0;
302 printk("TX%lx PCIC --%s PCICLK:",
303 pcode,
304 (tx4938_ccfgptr->ccfg & TX4938_CCFG_PCI66) ? " PCI66" : "");
305 if (tx4938_ccfgptr->pcfg & TX4938_PCFG_PCICLKEN_ALL) {
306
307 switch ((unsigned long)tx4938_ccfgptr->ccfg & TX4938_CCFG_PCIDIVMODE_MASK) {
308 case TX4938_CCFG_PCIDIVMODE_4:
309 pciclk = txx9_cpu_clock / 4; break;
310 case TX4938_CCFG_PCIDIVMODE_4_5:
311 pciclk = txx9_cpu_clock * 2 / 9; break;
312 case TX4938_CCFG_PCIDIVMODE_5:
313 pciclk = txx9_cpu_clock / 5; break;
314 case TX4938_CCFG_PCIDIVMODE_5_5:
315 pciclk = txx9_cpu_clock * 2 / 11; break;
316 case TX4938_CCFG_PCIDIVMODE_8:
317 pciclk = txx9_cpu_clock / 8; break;
318 case TX4938_CCFG_PCIDIVMODE_9:
319 pciclk = txx9_cpu_clock / 9; break;
320 case TX4938_CCFG_PCIDIVMODE_10:
321 pciclk = txx9_cpu_clock / 10; break;
322 case TX4938_CCFG_PCIDIVMODE_11:
323 pciclk = txx9_cpu_clock / 11; break;
324 }
325 printk("Internal(%dMHz)", pciclk / 1000000);
326 } else {
327 printk("External");
328 pciclk = -1;
329 }
330 printk("\n");
331 return pciclk;
332}
333
334void __init set_tx4938_pcicptr(int ch, struct tx4938_pcic_reg *pcicptr)
335{
336 pcicptrs[ch] = pcicptr;
337}
338
339struct tx4938_pcic_reg *get_tx4938_pcicptr(int ch)
340{
341 return pcicptrs[ch];
342}
343
344static struct pci_dev *fake_pci_dev(struct pci_controller *hose,
345 int top_bus, int busnr, int devfn)
346{
347 static struct pci_dev dev;
348 static struct pci_bus bus;
349
350 dev.sysdata = (void *)hose;
351 dev.devfn = devfn;
352 bus.number = busnr;
353 bus.ops = hose->pci_ops;
354 bus.parent = NULL;
355 dev.bus = &bus;
356
357 return &dev;
358}
359
360#define EARLY_PCI_OP(rw, size, type) \
361static int early_##rw##_config_##size(struct pci_controller *hose, \
362 int top_bus, int bus, int devfn, int offset, type value) \
363{ \
364 return pci_##rw##_config_##size( \
365 fake_pci_dev(hose, top_bus, bus, devfn), \
366 offset, value); \
367}
368
369EARLY_PCI_OP(read, word, u16 *)
370
371int txboard_pci66_check(struct pci_controller *hose, int top_bus, int current_bus)
372{
373 u32 pci_devfn;
374 unsigned short vid;
375 int devfn_start = 0;
376 int devfn_stop = 0xff;
377 int cap66 = -1;
378 u16 stat;
379
380 printk("PCI: Checking 66MHz capabilities...\n");
381
382 for (pci_devfn=devfn_start; pci_devfn<devfn_stop; pci_devfn++) {
383 early_read_config_word(hose, top_bus, current_bus, pci_devfn,
384 PCI_VENDOR_ID, &vid);
385
386 if (vid == 0xffff) continue;
387
388 /* check 66MHz capability */
389 if (cap66 < 0)
390 cap66 = 1;
391 if (cap66) {
392 early_read_config_word(hose, top_bus, current_bus, pci_devfn,
393 PCI_STATUS, &stat);
394 if (!(stat & PCI_STATUS_66MHZ)) {
395 printk(KERN_DEBUG "PCI: %02x:%02x not 66MHz capable.\n",
396 current_bus, pci_devfn);
397 cap66 = 0;
398 break;
399 }
400 }
401 }
402 return cap66 > 0;
403}
404
405int __init
406tx4938_pciclk66_setup(void)
407{
408 int pciclk;
409
410 /* Assert M66EN */
411 tx4938_ccfgptr->ccfg |= TX4938_CCFG_PCI66;
412 /* Double PCICLK (if possible) */
413 if (tx4938_ccfgptr->pcfg & TX4938_PCFG_PCICLKEN_ALL) {
414 unsigned int pcidivmode =
415 tx4938_ccfgptr->ccfg & TX4938_CCFG_PCIDIVMODE_MASK;
416 switch (pcidivmode) {
417 case TX4938_CCFG_PCIDIVMODE_8:
418 case TX4938_CCFG_PCIDIVMODE_4:
419 pcidivmode = TX4938_CCFG_PCIDIVMODE_4;
420 pciclk = txx9_cpu_clock / 4;
421 break;
422 case TX4938_CCFG_PCIDIVMODE_9:
423 case TX4938_CCFG_PCIDIVMODE_4_5:
424 pcidivmode = TX4938_CCFG_PCIDIVMODE_4_5;
425 pciclk = txx9_cpu_clock * 2 / 9;
426 break;
427 case TX4938_CCFG_PCIDIVMODE_10:
428 case TX4938_CCFG_PCIDIVMODE_5:
429 pcidivmode = TX4938_CCFG_PCIDIVMODE_5;
430 pciclk = txx9_cpu_clock / 5;
431 break;
432 case TX4938_CCFG_PCIDIVMODE_11:
433 case TX4938_CCFG_PCIDIVMODE_5_5:
434 default:
435 pcidivmode = TX4938_CCFG_PCIDIVMODE_5_5;
436 pciclk = txx9_cpu_clock * 2 / 11;
437 break;
438 }
439 tx4938_ccfgptr->ccfg =
440 (tx4938_ccfgptr->ccfg & ~TX4938_CCFG_PCIDIVMODE_MASK)
441 | pcidivmode;
442 printk(KERN_DEBUG "PCICLK: ccfg:%08lx\n",
443 (unsigned long)tx4938_ccfgptr->ccfg);
444 } else {
445 pciclk = -1;
446 }
447 return pciclk;
448}
449
450extern struct pci_controller tx4938_pci_controller[];
451static int __init tx4938_pcibios_init(void)
452{
453 unsigned long mem_base[2];
454 unsigned long mem_size[2] = {TX4938_PCIMEM_SIZE_0,TX4938_PCIMEM_SIZE_1}; /* MAX 128M,64K */
455 unsigned long io_base[2];
456 unsigned long io_size[2] = {TX4938_PCIIO_SIZE_0,TX4938_PCIIO_SIZE_1}; /* MAX 16M,64K */
457 /* TX4938 PCIC1: 64K MEM/IO is enough for ETH0,ETH1 */
458 int extarb = !(tx4938_ccfgptr->ccfg & TX4938_CCFG_PCIXARB);
459
460 PCIBIOS_MIN_IO = 0x00001000UL;
461 PCIBIOS_MIN_MEM = 0x01000000UL;
462
463 mem_base[0] = txboard_request_phys_region_shrink(&mem_size[0]);
464 io_base[0] = txboard_request_phys_region_shrink(&io_size[0]);
465
466 printk("TX4938 PCIC -- DID:%04x VID:%04x RID:%02x Arbiter:%s\n",
467 (unsigned short)(tx4938_pcicptr->pciid >> 16),
468 (unsigned short)(tx4938_pcicptr->pciid & 0xffff),
469 (unsigned short)(tx4938_pcicptr->pciccrev & 0xff),
470 extarb ? "External" : "Internal");
471
472 /* setup PCI area */
473 tx4938_pci_controller[0].io_resource->start = io_base[0];
474 tx4938_pci_controller[0].io_resource->end = (io_base[0] + io_size[0]) - 1;
475 tx4938_pci_controller[0].mem_resource->start = mem_base[0];
476 tx4938_pci_controller[0].mem_resource->end = mem_base[0] + mem_size[0] - 1;
477
478 set_tx4938_pcicptr(0, tx4938_pcicptr);
479
480 register_pci_controller(&tx4938_pci_controller[0]);
481
482 if (tx4938_ccfgptr->ccfg & TX4938_CCFG_PCI66) {
483 printk("TX4938_CCFG_PCI66 already configured\n");
484 txboard_pci66_mode = -1; /* already configured */
485 }
486
487 /* Reset PCI Bus */
488 *rbtx4938_pcireset_ptr = 0;
489 /* Reset PCIC */
490 tx4938_ccfgptr->clkctr |= TX4938_CLKCTR_PCIRST;
491 if (txboard_pci66_mode > 0)
492 tx4938_pciclk66_setup();
493 mdelay(10);
494 /* clear PCIC reset */
495 tx4938_ccfgptr->clkctr &= ~TX4938_CLKCTR_PCIRST;
496 *rbtx4938_pcireset_ptr = 1;
497 wbflush();
498 tx4938_report_pcic_status1(tx4938_pcicptr);
499
500 tx4938_report_pciclk();
501 tx4938_pcic_setup(tx4938_pcicptr, &tx4938_pci_controller[0], io_base[0], extarb);
502 if (txboard_pci66_mode == 0 &&
503 txboard_pci66_check(&tx4938_pci_controller[0], 0, 0)) {
504 /* Reset PCI Bus */
505 *rbtx4938_pcireset_ptr = 0;
506 /* Reset PCIC */
507 tx4938_ccfgptr->clkctr |= TX4938_CLKCTR_PCIRST;
508 tx4938_pciclk66_setup();
509 mdelay(10);
510 /* clear PCIC reset */
511 tx4938_ccfgptr->clkctr &= ~TX4938_CLKCTR_PCIRST;
512 *rbtx4938_pcireset_ptr = 1;
513 wbflush();
514 /* Reinitialize PCIC */
515 tx4938_report_pciclk();
516 tx4938_pcic_setup(tx4938_pcicptr, &tx4938_pci_controller[0], io_base[0], extarb);
517 }
518
519 mem_base[1] = txboard_request_phys_region_shrink(&mem_size[1]);
520 io_base[1] = txboard_request_phys_region_shrink(&io_size[1]);
521 /* Reset PCIC1 */
522 tx4938_ccfgptr->clkctr |= TX4938_CLKCTR_PCIC1RST;
523 /* PCI1DMD==0 => PCI1CLK==GBUSCLK/2 => PCI66 */
524 if (!(tx4938_ccfgptr->ccfg & TX4938_CCFG_PCI1DMD))
525 tx4938_ccfgptr->ccfg |= TX4938_CCFG_PCI1_66;
526 else
527 tx4938_ccfgptr->ccfg &= ~TX4938_CCFG_PCI1_66;
528 mdelay(10);
529 /* clear PCIC1 reset */
530 tx4938_ccfgptr->clkctr &= ~TX4938_CLKCTR_PCIC1RST;
531 tx4938_report_pcic_status1(tx4938_pcic1ptr);
532
533 printk("TX4938 PCIC1 -- DID:%04x VID:%04x RID:%02x",
534 (unsigned short)(tx4938_pcic1ptr->pciid >> 16),
535 (unsigned short)(tx4938_pcic1ptr->pciid & 0xffff),
536 (unsigned short)(tx4938_pcic1ptr->pciccrev & 0xff));
537 printk("%s PCICLK:%dMHz\n",
538 (tx4938_ccfgptr->ccfg & TX4938_CCFG_PCI1_66) ? " PCI66" : "",
539 txx9_gbus_clock /
540 ((tx4938_ccfgptr->ccfg & TX4938_CCFG_PCI1DMD) ? 4 : 2) /
541 1000000);
542
543 /* assumption: CPHYSADDR(mips_io_port_base) == io_base[0] */
544 tx4938_pci_controller[1].io_resource->start =
545 io_base[1] - io_base[0];
546 tx4938_pci_controller[1].io_resource->end =
547 io_base[1] - io_base[0] + io_size[1] - 1;
548 tx4938_pci_controller[1].mem_resource->start = mem_base[1];
549 tx4938_pci_controller[1].mem_resource->end =
550 mem_base[1] + mem_size[1] - 1;
551 set_tx4938_pcicptr(1, tx4938_pcic1ptr);
552
553 register_pci_controller(&tx4938_pci_controller[1]);
554
555 tx4938_pcic_setup(tx4938_pcic1ptr, &tx4938_pci_controller[1], io_base[1], extarb);
556
557 /* map ioport 0 to PCI I/O space address 0 */
558 set_io_port_base(KSEG1 + io_base[0]);
559
560 return 0;
561}
562
563arch_initcall(tx4938_pcibios_init);
564
565#endif /* CONFIG_PCI */
566
567/* SPI support */
568
569/* chip select for SPI devices */
570#define SEEPROM1_CS 7 /* PIO7 */
571#define SEEPROM2_CS 0 /* IOC */
572#define SEEPROM3_CS 1 /* IOC */
573#define SRTC_CS 2 /* IOC */
574
575static int rbtx4938_spi_cs_func(int chipid, int on)
576{
577 unsigned char bit;
578 switch (chipid) {
579 case RBTX4938_SEEPROM1_CHIPID:
580 if (on)
581 tx4938_pioptr->dout &= ~(1 << SEEPROM1_CS);
582 else
583 tx4938_pioptr->dout |= (1 << SEEPROM1_CS);
584 return 0;
585 break;
586 case RBTX4938_SEEPROM2_CHIPID:
587 bit = (1 << SEEPROM2_CS);
588 break;
589 case RBTX4938_SEEPROM3_CHIPID:
590 bit = (1 << SEEPROM3_CS);
591 break;
592 case RBTX4938_SRTC_CHIPID:
593 bit = (1 << SRTC_CS);
594 break;
595 default:
596 return -ENODEV;
597 }
598 /* bit1,2,4 are low active, bit3 is high active */
599 *rbtx4938_spics_ptr =
600 (*rbtx4938_spics_ptr & ~bit) |
601 ((on ? (bit ^ 0x0b) : ~(bit ^ 0x0b)) & bit);
602 return 0;
603}
604
605#ifdef CONFIG_PCI
606extern int spi_eeprom_read(int chipid, int address, unsigned char *buf, int len);
607
608int rbtx4938_get_tx4938_ethaddr(struct pci_dev *dev, unsigned char *addr)
609{
610 struct pci_controller *channel = (struct pci_controller *)dev->bus->sysdata;
611 static unsigned char dat[17];
612 static int read_dat = 0;
613 int ch = 0;
614
615 if (channel != &tx4938_pci_controller[1])
616 return -ENODEV;
617 /* TX4938 PCIC1 */
618 switch (PCI_SLOT(dev->devfn)) {
619 case TX4938_PCIC_IDSEL_AD_TO_SLOT(31):
620 ch = 0;
621 break;
622 case TX4938_PCIC_IDSEL_AD_TO_SLOT(30):
623 ch = 1;
624 break;
625 default:
626 return -ENODEV;
627 }
628 if (!read_dat) {
629 unsigned char sum;
630 int i;
631 read_dat = 1;
632 /* 0-3: "MAC\0", 4-9:eth0, 10-15:eth1, 16:sum */
633 if (spi_eeprom_read(RBTX4938_SEEPROM1_CHIPID,
634 0, dat, sizeof(dat))) {
635 printk(KERN_ERR "seeprom: read error.\n");
636 } else {
637 if (strcmp(dat, "MAC") != 0)
638 printk(KERN_WARNING "seeprom: bad signature.\n");
639 for (i = 0, sum = 0; i < sizeof(dat); i++)
640 sum += dat[i];
641 if (sum)
642 printk(KERN_WARNING "seeprom: bad checksum.\n");
643 }
644 }
645 memcpy(addr, &dat[4 + 6 * ch], 6);
646 return 0;
647}
648#endif /* CONFIG_PCI */
649
650extern void __init txx9_spi_init(unsigned long base, int (*cs_func)(int chipid, int on));
651static void __init rbtx4938_spi_setup(void)
652{
653 /* set SPI_SEL */
654 tx4938_ccfgptr->pcfg |= TX4938_PCFG_SPI_SEL;
655 /* chip selects for SPI devices */
656 tx4938_pioptr->dout |= (1 << SEEPROM1_CS);
657 tx4938_pioptr->dir |= (1 << SEEPROM1_CS);
658 txx9_spi_init(TX4938_SPI_REG, rbtx4938_spi_cs_func);
659}
660
661static struct resource rbtx4938_fpga_resource;
662
663static char pcode_str[8];
664static struct resource tx4938_reg_resource = {
665 pcode_str, TX4938_REG_BASE, TX4938_REG_BASE+TX4938_REG_SIZE, IORESOURCE_MEM
666};
667
668void __init tx4938_board_setup(void)
669{
670 int i;
671 unsigned long divmode;
672 int cpuclk = 0;
673 unsigned long pcode = TX4938_REV_PCODE();
674
675 ioport_resource.start = 0x1000;
676 ioport_resource.end = 0xffffffff;
677 iomem_resource.start = 0x1000;
678 iomem_resource.end = 0xffffffff; /* expand to 4GB */
679
680 sprintf(pcode_str, "TX%lx", pcode);
681 /* SDRAMC,EBUSC are configured by PROM */
682 for (i = 0; i < 8; i++) {
683 if (!(tx4938_ebuscptr->cr[i] & 0x8))
684 continue; /* disabled */
685 rbtx4938_ce_base[i] = (unsigned long)TX4938_EBUSC_BA(i);
686 txboard_add_phys_region(rbtx4938_ce_base[i], TX4938_EBUSC_SIZE(i));
687 }
688
689 /* clocks */
690 if (txx9_master_clock) {
691 /* calculate gbus_clock and cpu_clock from master_clock */
692 divmode = (unsigned long)tx4938_ccfgptr->ccfg & TX4938_CCFG_DIVMODE_MASK;
693 switch (divmode) {
694 case TX4938_CCFG_DIVMODE_8:
695 case TX4938_CCFG_DIVMODE_10:
696 case TX4938_CCFG_DIVMODE_12:
697 case TX4938_CCFG_DIVMODE_16:
698 case TX4938_CCFG_DIVMODE_18:
699 txx9_gbus_clock = txx9_master_clock * 4; break;
700 default:
701 txx9_gbus_clock = txx9_master_clock;
702 }
703 switch (divmode) {
704 case TX4938_CCFG_DIVMODE_2:
705 case TX4938_CCFG_DIVMODE_8:
706 cpuclk = txx9_gbus_clock * 2; break;
707 case TX4938_CCFG_DIVMODE_2_5:
708 case TX4938_CCFG_DIVMODE_10:
709 cpuclk = txx9_gbus_clock * 5 / 2; break;
710 case TX4938_CCFG_DIVMODE_3:
711 case TX4938_CCFG_DIVMODE_12:
712 cpuclk = txx9_gbus_clock * 3; break;
713 case TX4938_CCFG_DIVMODE_4:
714 case TX4938_CCFG_DIVMODE_16:
715 cpuclk = txx9_gbus_clock * 4; break;
716 case TX4938_CCFG_DIVMODE_4_5:
717 case TX4938_CCFG_DIVMODE_18:
718 cpuclk = txx9_gbus_clock * 9 / 2; break;
719 }
720 txx9_cpu_clock = cpuclk;
721 } else {
722 if (txx9_cpu_clock == 0) {
723 txx9_cpu_clock = 300000000; /* 300MHz */
724 }
725 /* calculate gbus_clock and master_clock from cpu_clock */
726 cpuclk = txx9_cpu_clock;
727 divmode = (unsigned long)tx4938_ccfgptr->ccfg & TX4938_CCFG_DIVMODE_MASK;
728 switch (divmode) {
729 case TX4938_CCFG_DIVMODE_2:
730 case TX4938_CCFG_DIVMODE_8:
731 txx9_gbus_clock = cpuclk / 2; break;
732 case TX4938_CCFG_DIVMODE_2_5:
733 case TX4938_CCFG_DIVMODE_10:
734 txx9_gbus_clock = cpuclk * 2 / 5; break;
735 case TX4938_CCFG_DIVMODE_3:
736 case TX4938_CCFG_DIVMODE_12:
737 txx9_gbus_clock = cpuclk / 3; break;
738 case TX4938_CCFG_DIVMODE_4:
739 case TX4938_CCFG_DIVMODE_16:
740 txx9_gbus_clock = cpuclk / 4; break;
741 case TX4938_CCFG_DIVMODE_4_5:
742 case TX4938_CCFG_DIVMODE_18:
743 txx9_gbus_clock = cpuclk * 2 / 9; break;
744 }
745 switch (divmode) {
746 case TX4938_CCFG_DIVMODE_8:
747 case TX4938_CCFG_DIVMODE_10:
748 case TX4938_CCFG_DIVMODE_12:
749 case TX4938_CCFG_DIVMODE_16:
750 case TX4938_CCFG_DIVMODE_18:
751 txx9_master_clock = txx9_gbus_clock / 4; break;
752 default:
753 txx9_master_clock = txx9_gbus_clock;
754 }
755 }
756 /* change default value to udelay/mdelay take reasonable time */
757 loops_per_jiffy = txx9_cpu_clock / HZ / 2;
758
759 /* CCFG */
760 /* clear WatchDogReset,BusErrorOnWrite flag (W1C) */
761 tx4938_ccfgptr->ccfg |= TX4938_CCFG_WDRST | TX4938_CCFG_BEOW;
762 /* clear PCIC1 reset */
763 if (tx4938_ccfgptr->clkctr & TX4938_CLKCTR_PCIC1RST)
764 tx4938_ccfgptr->clkctr &= ~TX4938_CLKCTR_PCIC1RST;
765
766 /* enable Timeout BusError */
767 if (tx4938_ccfg_toeon)
768 tx4938_ccfgptr->ccfg |= TX4938_CCFG_TOE;
769
770 /* DMA selection */
771 tx4938_ccfgptr->pcfg &= ~TX4938_PCFG_DMASEL_ALL;
772
773 /* Use external clock for external arbiter */
774 if (!(tx4938_ccfgptr->ccfg & TX4938_CCFG_PCIXARB))
775 tx4938_ccfgptr->pcfg &= ~TX4938_PCFG_PCICLKEN_ALL;
776
777 printk("%s -- %dMHz(M%dMHz) CRIR:%08lx CCFG:%Lx PCFG:%Lx\n",
778 pcode_str,
779 cpuclk / 1000000, txx9_master_clock / 1000000,
780 (unsigned long)tx4938_ccfgptr->crir,
781 tx4938_ccfgptr->ccfg,
782 tx4938_ccfgptr->pcfg);
783
784 printk("%s SDRAMC --", pcode_str);
785 for (i = 0; i < 4; i++) {
786 unsigned long long cr = tx4938_sdramcptr->cr[i];
787 unsigned long ram_base, ram_size;
788 if (!((unsigned long)cr & 0x00000400))
789 continue; /* disabled */
790 ram_base = (unsigned long)(cr >> 49) << 21;
791 ram_size = ((unsigned long)(cr >> 33) + 1) << 21;
792 if (ram_base >= 0x20000000)
793 continue; /* high memory (ignore) */
794 printk(" CR%d:%016Lx", i, cr);
795 txboard_add_phys_region(ram_base, ram_size);
796 }
797 printk(" TR:%09Lx\n", tx4938_sdramcptr->tr);
798
799 /* SRAM */
800 if (pcode == 0x4938 && tx4938_sramcptr->cr & 1) {
801 unsigned int size = 0x800;
802 unsigned long base =
803 (tx4938_sramcptr->cr >> (39-11)) & ~(size - 1);
804 txboard_add_phys_region(base, size);
805 }
806
807 /* IRC */
808 /* disable interrupt control */
809 tx4938_ircptr->cer = 0;
810
811 /* TMR */
812 /* disable all timers */
813 for (i = 0; i < TX4938_NR_TMR; i++) {
814 tx4938_tmrptr(i)->tcr = 0x00000020;
815 tx4938_tmrptr(i)->tisr = 0;
816 tx4938_tmrptr(i)->cpra = 0xffffffff;
817 tx4938_tmrptr(i)->itmr = 0;
818 tx4938_tmrptr(i)->ccdr = 0;
819 tx4938_tmrptr(i)->pgmr = 0;
820 }
821
822 /* enable DMA */
823 TX4938_WR64(0xff1fb150, TX4938_DMA_MCR_MSTEN);
824 TX4938_WR64(0xff1fb950, TX4938_DMA_MCR_MSTEN);
825
826 /* PIO */
827 tx4938_pioptr->maskcpu = 0;
828 tx4938_pioptr->maskext = 0;
829
830 /* TX4938 internal registers */
831 if (request_resource(&iomem_resource, &tx4938_reg_resource))
832 printk("request resource for internal registers failed\n");
833}
834
835#ifdef CONFIG_PCI
836static inline void tx4938_report_pcic_status1(struct tx4938_pcic_reg *pcicptr)
837{
838 unsigned short pcistatus = (unsigned short)(pcicptr->pcistatus >> 16);
839 unsigned long g2pstatus = pcicptr->g2pstatus;
840 unsigned long pcicstatus = pcicptr->pcicstatus;
841 static struct {
842 unsigned long flag;
843 const char *str;
844 } pcistat_tbl[] = {
845 { PCI_STATUS_DETECTED_PARITY, "DetectedParityError" },
846 { PCI_STATUS_SIG_SYSTEM_ERROR, "SignaledSystemError" },
847 { PCI_STATUS_REC_MASTER_ABORT, "ReceivedMasterAbort" },
848 { PCI_STATUS_REC_TARGET_ABORT, "ReceivedTargetAbort" },
849 { PCI_STATUS_SIG_TARGET_ABORT, "SignaledTargetAbort" },
850 { PCI_STATUS_PARITY, "MasterParityError" },
851 }, g2pstat_tbl[] = {
852 { TX4938_PCIC_G2PSTATUS_TTOE, "TIOE" },
853 { TX4938_PCIC_G2PSTATUS_RTOE, "RTOE" },
854 }, pcicstat_tbl[] = {
855 { TX4938_PCIC_PCICSTATUS_PME, "PME" },
856 { TX4938_PCIC_PCICSTATUS_TLB, "TLB" },
857 { TX4938_PCIC_PCICSTATUS_NIB, "NIB" },
858 { TX4938_PCIC_PCICSTATUS_ZIB, "ZIB" },
859 { TX4938_PCIC_PCICSTATUS_PERR, "PERR" },
860 { TX4938_PCIC_PCICSTATUS_SERR, "SERR" },
861 { TX4938_PCIC_PCICSTATUS_GBE, "GBE" },
862 { TX4938_PCIC_PCICSTATUS_IWB, "IWB" },
863 };
864 int i;
865
866 printk("pcistat:%04x(", pcistatus);
867 for (i = 0; i < ARRAY_SIZE(pcistat_tbl); i++)
868 if (pcistatus & pcistat_tbl[i].flag)
869 printk("%s ", pcistat_tbl[i].str);
870 printk("), g2pstatus:%08lx(", g2pstatus);
871 for (i = 0; i < ARRAY_SIZE(g2pstat_tbl); i++)
872 if (g2pstatus & g2pstat_tbl[i].flag)
873 printk("%s ", g2pstat_tbl[i].str);
874 printk("), pcicstatus:%08lx(", pcicstatus);
875 for (i = 0; i < ARRAY_SIZE(pcicstat_tbl); i++)
876 if (pcicstatus & pcicstat_tbl[i].flag)
877 printk("%s ", pcicstat_tbl[i].str);
878 printk(")\n");
879}
880
881void tx4938_report_pcic_status(void)
882{
883 int i;
884 struct tx4938_pcic_reg *pcicptr;
885 for (i = 0; (pcicptr = get_tx4938_pcicptr(i)) != NULL; i++)
886 tx4938_report_pcic_status1(pcicptr);
887}
888
889#endif /* CONFIG_PCI */
890
891/* We use onchip r4k counter or TMR timer as our system wide timer
892 * interrupt running at 100HZ. */
893
894extern void __init rtc_rx5c348_init(int chipid);
895void __init rbtx4938_time_init(void)
896{
897 rtc_rx5c348_init(RBTX4938_SRTC_CHIPID);
898 mips_hpt_frequency = txx9_cpu_clock / 2;
899}
900
901void __init toshiba_rbtx4938_setup(void)
902{
903 unsigned long long pcfg;
904 char *argptr;
905
906 iomem_resource.end = 0xffffffff; /* 4GB */
907
908 if (txx9_master_clock == 0)
909 txx9_master_clock = 25000000; /* 25MHz */
910 tx4938_board_setup();
911 /* setup irq stuff */
912 TX4938_WR(TX4938_MKA(TX4938_IRC_IRDM0), 0x00000000); /* irq trigger */
913 TX4938_WR(TX4938_MKA(TX4938_IRC_IRDM1), 0x00000000); /* irq trigger */
914 /* setup serial stuff */
915 TX4938_WR(0xff1ff314, 0x00000000); /* h/w flow control off */
916 TX4938_WR(0xff1ff414, 0x00000000); /* h/w flow control off */
917
918#ifndef CONFIG_PCI
919 set_io_port_base(RBTX4938_ETHER_BASE);
920#endif
921
922#ifdef CONFIG_SERIAL_TXX9
923 {
924 extern int early_serial_txx9_setup(struct uart_port *port);
925 int i;
926 struct uart_port req;
927 for(i = 0; i < 2; i++) {
928 memset(&req, 0, sizeof(req));
929 req.line = i;
930 req.iotype = UPIO_MEM;
931 req.membase = (char *)(0xff1ff300 + i * 0x100);
932 req.mapbase = 0xff1ff300 + i * 0x100;
933 req.irq = 32 + i;
934 req.flags |= UPF_BUGGY_UART /*HAVE_CTS_LINE*/;
935 req.uartclk = 50000000;
936 early_serial_txx9_setup(&req);
937 }
938 }
939#ifdef CONFIG_SERIAL_TXX9_CONSOLE
940 argptr = prom_getcmdline();
941 if (strstr(argptr, "console=") == NULL) {
942 strcat(argptr, " console=ttyS0,38400");
943 }
944#endif
945#endif
946
947#ifdef CONFIG_TOSHIBA_RBTX4938_MPLEX_PIO58_61
948 printk("PIOSEL: disabling both ata and nand selection\n");
949 local_irq_disable();
950 tx4938_ccfgptr->pcfg &= ~(TX4938_PCFG_NDF_SEL | TX4938_PCFG_ATA_SEL);
951#endif
952
953#ifdef CONFIG_TOSHIBA_RBTX4938_MPLEX_NAND
954 printk("PIOSEL: enabling nand selection\n");
955 tx4938_ccfgptr->pcfg |= TX4938_PCFG_NDF_SEL;
956 tx4938_ccfgptr->pcfg &= ~TX4938_PCFG_ATA_SEL;
957#endif
958
959#ifdef CONFIG_TOSHIBA_RBTX4938_MPLEX_ATA
960 printk("PIOSEL: enabling ata selection\n");
961 tx4938_ccfgptr->pcfg |= TX4938_PCFG_ATA_SEL;
962 tx4938_ccfgptr->pcfg &= ~TX4938_PCFG_NDF_SEL;
963#endif
964
965#ifdef CONFIG_IP_PNP
966 argptr = prom_getcmdline();
967 if (strstr(argptr, "ip=") == NULL) {
968 strcat(argptr, " ip=any");
969 }
970#endif
971
972
973#ifdef CONFIG_FB
974 {
975 conswitchp = &dummy_con;
976 }
977#endif
978
979 rbtx4938_spi_setup();
980 pcfg = tx4938_ccfgptr->pcfg; /* updated */
981 /* fixup piosel */
982 if ((pcfg & (TX4938_PCFG_ATA_SEL | TX4938_PCFG_NDF_SEL)) ==
983 TX4938_PCFG_ATA_SEL) {
984 *rbtx4938_piosel_ptr = (*rbtx4938_piosel_ptr & 0x03) | 0x04;
985 }
986 else if ((pcfg & (TX4938_PCFG_ATA_SEL | TX4938_PCFG_NDF_SEL)) ==
987 TX4938_PCFG_NDF_SEL) {
988 *rbtx4938_piosel_ptr = (*rbtx4938_piosel_ptr & 0x03) | 0x08;
989 }
990 else {
991 *rbtx4938_piosel_ptr &= ~(0x08 | 0x04);
992 }
993
994 rbtx4938_fpga_resource.name = "FPGA Registers";
995 rbtx4938_fpga_resource.start = CPHYSADDR(RBTX4938_FPGA_REG_ADDR);
996 rbtx4938_fpga_resource.end = CPHYSADDR(RBTX4938_FPGA_REG_ADDR) + 0xffff;
997 rbtx4938_fpga_resource.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
998 if (request_resource(&iomem_resource, &rbtx4938_fpga_resource))
999 printk("request resource for fpga failed\n");
1000
1001 /* disable all OnBoard I/O interrupts */
1002 *rbtx4938_imask_ptr = 0;
1003
1004 _machine_restart = rbtx4938_machine_restart;
1005 _machine_halt = rbtx4938_machine_halt;
1006 _machine_power_off = rbtx4938_machine_power_off;
1007
1008 *rbtx4938_led_ptr = 0xff;
1009 printk("RBTX4938 --- FPGA(Rev %02x)", *rbtx4938_fpga_rev_ptr);
1010 printk(" DIPSW:%02x,%02x\n",
1011 *rbtx4938_dipsw_ptr, *rbtx4938_bdipsw_ptr);
1012}
1013
1014#ifdef CONFIG_PROC_FS
1015extern void spi_eeprom_proc_create(struct proc_dir_entry *dir, int chipid);
1016static int __init tx4938_spi_proc_setup(void)
1017{
1018 struct proc_dir_entry *tx4938_spi_eeprom_dir;
1019
1020 tx4938_spi_eeprom_dir = proc_mkdir("spi_eeprom", 0);
1021
1022 if (!tx4938_spi_eeprom_dir)
1023 return -ENOMEM;
1024
1025 /* don't allow user access to RBTX4938_SEEPROM1_CHIPID
1026 * as it contains eth0 and eth1 MAC addresses
1027 */
1028 spi_eeprom_proc_create(tx4938_spi_eeprom_dir, RBTX4938_SEEPROM2_CHIPID);
1029 spi_eeprom_proc_create(tx4938_spi_eeprom_dir, RBTX4938_SEEPROM3_CHIPID);
1030
1031 return 0;
1032}
1033
1034__initcall(tx4938_spi_proc_setup);
1035#endif
diff --git a/arch/mips/tx4938/toshiba_rbtx4938/spi_eeprom.c b/arch/mips/tx4938/toshiba_rbtx4938/spi_eeprom.c
new file mode 100644
index 000000000000..951a208ee9b3
--- /dev/null
+++ b/arch/mips/tx4938/toshiba_rbtx4938/spi_eeprom.c
@@ -0,0 +1,219 @@
1/*
2 * linux/arch/mips/tx4938/toshiba_rbtx4938/spi_eeprom.c
3 * Copyright (C) 2000-2001 Toshiba Corporation
4 *
5 * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
6 * terms of the GNU General Public License version 2. This program is
7 * licensed "as is" without any warranty of any kind, whether express
8 * or implied.
9 *
10 * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
11 */
12#include <linux/config.h>
13#include <linux/init.h>
14#include <linux/delay.h>
15#include <linux/proc_fs.h>
16#include <linux/spinlock.h>
17#include <asm/tx4938/spi.h>
18#include <asm/tx4938/tx4938.h>
19
20/* ATMEL 250x0 instructions */
21#define ATMEL_WREN 0x06
22#define ATMEL_WRDI 0x04
23#define ATMEL_RDSR 0x05
24#define ATMEL_WRSR 0x01
25#define ATMEL_READ 0x03
26#define ATMEL_WRITE 0x02
27
28#define ATMEL_SR_BSY 0x01
29#define ATMEL_SR_WEN 0x02
30#define ATMEL_SR_BP0 0x04
31#define ATMEL_SR_BP1 0x08
32
33DEFINE_SPINLOCK(spi_eeprom_lock);
34
35static struct spi_dev_desc seeprom_dev_desc = {
36 .baud = 1500000, /* 1.5Mbps */
37 .tcss = 1,
38 .tcsh = 1,
39 .tcsr = 1,
40 .byteorder = 1, /* MSB-First */
41 .polarity = 0, /* High-Active */
42 .phase = 0, /* Sample-Then-Shift */
43
44};
45static inline int
46spi_eeprom_io(int chipid,
47 unsigned char **inbufs, unsigned int *incounts,
48 unsigned char **outbufs, unsigned int *outcounts)
49{
50 return txx9_spi_io(chipid, &seeprom_dev_desc,
51 inbufs, incounts, outbufs, outcounts, 0);
52}
53
54int spi_eeprom_write_enable(int chipid, int enable)
55{
56 unsigned char inbuf[1];
57 unsigned char *inbufs[1];
58 unsigned int incounts[2];
59 unsigned long flags;
60 int stat;
61 inbuf[0] = enable ? ATMEL_WREN : ATMEL_WRDI;
62 inbufs[0] = inbuf;
63 incounts[0] = sizeof(inbuf);
64 incounts[1] = 0;
65 spin_lock_irqsave(&spi_eeprom_lock, flags);
66 stat = spi_eeprom_io(chipid, inbufs, incounts, NULL, NULL);
67 spin_unlock_irqrestore(&spi_eeprom_lock, flags);
68 return stat;
69}
70
71static int spi_eeprom_read_status_nolock(int chipid)
72{
73 unsigned char inbuf[2], outbuf[2];
74 unsigned char *inbufs[1], *outbufs[1];
75 unsigned int incounts[2], outcounts[2];
76 int stat;
77 inbuf[0] = ATMEL_RDSR;
78 inbuf[1] = 0;
79 inbufs[0] = inbuf;
80 incounts[0] = sizeof(inbuf);
81 incounts[1] = 0;
82 outbufs[0] = outbuf;
83 outcounts[0] = sizeof(outbuf);
84 outcounts[1] = 0;
85 stat = spi_eeprom_io(chipid, inbufs, incounts, outbufs, outcounts);
86 if (stat < 0)
87 return stat;
88 return outbuf[1];
89}
90
91int spi_eeprom_read_status(int chipid)
92{
93 unsigned long flags;
94 int stat;
95 spin_lock_irqsave(&spi_eeprom_lock, flags);
96 stat = spi_eeprom_read_status_nolock(chipid);
97 spin_unlock_irqrestore(&spi_eeprom_lock, flags);
98 return stat;
99}
100
101int spi_eeprom_read(int chipid, int address, unsigned char *buf, int len)
102{
103 unsigned char inbuf[2];
104 unsigned char *inbufs[2], *outbufs[2];
105 unsigned int incounts[2], outcounts[3];
106 unsigned long flags;
107 int stat;
108 inbuf[0] = ATMEL_READ;
109 inbuf[1] = address;
110 inbufs[0] = inbuf;
111 inbufs[1] = NULL;
112 incounts[0] = sizeof(inbuf);
113 incounts[1] = 0;
114 outbufs[0] = NULL;
115 outbufs[1] = buf;
116 outcounts[0] = 2;
117 outcounts[1] = len;
118 outcounts[2] = 0;
119 spin_lock_irqsave(&spi_eeprom_lock, flags);
120 stat = spi_eeprom_io(chipid, inbufs, incounts, outbufs, outcounts);
121 spin_unlock_irqrestore(&spi_eeprom_lock, flags);
122 return stat;
123}
124
125int spi_eeprom_write(int chipid, int address, unsigned char *buf, int len)
126{
127 unsigned char inbuf[2];
128 unsigned char *inbufs[2];
129 unsigned int incounts[3];
130 unsigned long flags;
131 int i, stat;
132
133 if (address / 8 != (address + len - 1) / 8)
134 return -EINVAL;
135 stat = spi_eeprom_write_enable(chipid, 1);
136 if (stat < 0)
137 return stat;
138 stat = spi_eeprom_read_status(chipid);
139 if (stat < 0)
140 return stat;
141 if (!(stat & ATMEL_SR_WEN))
142 return -EPERM;
143
144 inbuf[0] = ATMEL_WRITE;
145 inbuf[1] = address;
146 inbufs[0] = inbuf;
147 inbufs[1] = buf;
148 incounts[0] = sizeof(inbuf);
149 incounts[1] = len;
150 incounts[2] = 0;
151 spin_lock_irqsave(&spi_eeprom_lock, flags);
152 stat = spi_eeprom_io(chipid, inbufs, incounts, NULL, NULL);
153 if (stat < 0)
154 goto unlock_return;
155
156 /* write start. max 10ms */
157 for (i = 10; i > 0; i--) {
158 int stat = spi_eeprom_read_status_nolock(chipid);
159 if (stat < 0)
160 goto unlock_return;
161 if (!(stat & ATMEL_SR_BSY))
162 break;
163 mdelay(1);
164 }
165 spin_unlock_irqrestore(&spi_eeprom_lock, flags);
166 if (i == 0)
167 return -EIO;
168 return len;
169 unlock_return:
170 spin_unlock_irqrestore(&spi_eeprom_lock, flags);
171 return stat;
172}
173
174#ifdef CONFIG_PROC_FS
175#define MAX_SIZE 0x80 /* for ATMEL 25010 */
176static int spi_eeprom_read_proc(char *page, char **start, off_t off,
177 int count, int *eof, void *data)
178{
179 unsigned int size = MAX_SIZE;
180 if (spi_eeprom_read((int)data, 0, (unsigned char *)page, size) < 0)
181 size = 0;
182 return size;
183}
184
185static int spi_eeprom_write_proc(struct file *file, const char *buffer,
186 unsigned long count, void *data)
187{
188 unsigned int size = MAX_SIZE;
189 int i;
190 if (file->f_pos >= size)
191 return -EIO;
192 if (file->f_pos + count > size)
193 count = size - file->f_pos;
194 for (i = 0; i < count; i += 8) {
195 int len = count - i < 8 ? count - i : 8;
196 if (spi_eeprom_write((int)data, file->f_pos,
197 (unsigned char *)buffer, len) < 0) {
198 count = -EIO;
199 break;
200 }
201 buffer += len;
202 file->f_pos += len;
203 }
204 return count;
205}
206
207__init void spi_eeprom_proc_create(struct proc_dir_entry *dir, int chipid)
208{
209 struct proc_dir_entry *entry;
210 char name[128];
211 sprintf(name, "seeprom-%d", chipid);
212 entry = create_proc_entry(name, 0600, dir);
213 if (entry) {
214 entry->read_proc = spi_eeprom_read_proc;
215 entry->write_proc = spi_eeprom_write_proc;
216 entry->data = (void *)chipid;
217 }
218}
219#endif /* CONFIG_PROC_FS */
diff --git a/arch/mips/tx4938/toshiba_rbtx4938/spi_txx9.c b/arch/mips/tx4938/toshiba_rbtx4938/spi_txx9.c
new file mode 100644
index 000000000000..fae3136f462d
--- /dev/null
+++ b/arch/mips/tx4938/toshiba_rbtx4938/spi_txx9.c
@@ -0,0 +1,159 @@
1/*
2 * linux/arch/mips/tx4938/toshiba_rbtx4938/spi_txx9.c
3 * Copyright (C) 2000-2001 Toshiba Corporation
4 *
5 * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
6 * terms of the GNU General Public License version 2. This program is
7 * licensed "as is" without any warranty of any kind, whether express
8 * or implied.
9 *
10 * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
11 */
12#include <linux/init.h>
13#include <linux/delay.h>
14#include <linux/errno.h>
15#include <linux/interrupt.h>
16#include <linux/module.h>
17#include <linux/sched.h>
18#include <linux/spinlock.h>
19#include <linux/wait.h>
20#include <asm/tx4938/spi.h>
21#include <asm/tx4938/tx4938.h>
22
23static int (*txx9_spi_cs_func)(int chipid, int on);
24static DEFINE_SPINLOCK(txx9_spi_lock);
25
26extern unsigned int txx9_gbus_clock;
27
28#define SPI_FIFO_SIZE 4
29
30void __init txx9_spi_init(unsigned long base, int (*cs_func)(int chipid, int on))
31{
32 txx9_spi_cs_func = cs_func;
33 /* enter config mode */
34 tx4938_spiptr->mcr = TXx9_SPMCR_CONFIG | TXx9_SPMCR_BCLR;
35}
36
37static DECLARE_WAIT_QUEUE_HEAD(txx9_spi_wait);
38static void txx9_spi_interrupt(int irq, void *dev_id, struct pt_regs *regs)
39{
40 /* disable rx intr */
41 tx4938_spiptr->cr0 &= ~TXx9_SPCR0_RBSIE;
42 wake_up(&txx9_spi_wait);
43}
44static struct irqaction txx9_spi_action = {
45 txx9_spi_interrupt, 0, 0, "spi", NULL, NULL,
46};
47
48void __init txx9_spi_irqinit(int irc_irq)
49{
50 setup_irq(irc_irq, &txx9_spi_action);
51}
52
53int txx9_spi_io(int chipid, struct spi_dev_desc *desc,
54 unsigned char **inbufs, unsigned int *incounts,
55 unsigned char **outbufs, unsigned int *outcounts,
56 int cansleep)
57{
58 unsigned int incount, outcount;
59 unsigned char *inp, *outp;
60 int ret;
61 unsigned long flags;
62
63 spin_lock_irqsave(&txx9_spi_lock, flags);
64 if ((tx4938_spiptr->mcr & TXx9_SPMCR_OPMODE) == TXx9_SPMCR_ACTIVE) {
65 spin_unlock_irqrestore(&txx9_spi_lock, flags);
66 return -EBUSY;
67 }
68 /* enter config mode */
69 tx4938_spiptr->mcr = TXx9_SPMCR_CONFIG | TXx9_SPMCR_BCLR;
70 tx4938_spiptr->cr0 =
71 (desc->byteorder ? TXx9_SPCR0_SBOS : 0) |
72 (desc->polarity ? TXx9_SPCR0_SPOL : 0) |
73 (desc->phase ? TXx9_SPCR0_SPHA : 0) |
74 0x08;
75 tx4938_spiptr->cr1 =
76 (((TXX9_IMCLK + desc->baud) / (2 * desc->baud) - 1) << 8) |
77 0x08 /* 8 bit only */;
78 /* enter active mode */
79 tx4938_spiptr->mcr = TXx9_SPMCR_ACTIVE;
80 spin_unlock_irqrestore(&txx9_spi_lock, flags);
81
82 /* CS ON */
83 if ((ret = txx9_spi_cs_func(chipid, 1)) < 0) {
84 spin_unlock_irqrestore(&txx9_spi_lock, flags);
85 return ret;
86 }
87 udelay(desc->tcss);
88
89 /* do scatter IO */
90 inp = inbufs ? *inbufs : NULL;
91 outp = outbufs ? *outbufs : NULL;
92 incount = 0;
93 outcount = 0;
94 while (1) {
95 unsigned char data;
96 unsigned int count;
97 int i;
98 if (!incount) {
99 incount = incounts ? *incounts++ : 0;
100 inp = (incount && inbufs) ? *inbufs++ : NULL;
101 }
102 if (!outcount) {
103 outcount = outcounts ? *outcounts++ : 0;
104 outp = (outcount && outbufs) ? *outbufs++ : NULL;
105 }
106 if (!inp && !outp)
107 break;
108 count = SPI_FIFO_SIZE;
109 if (incount)
110 count = min(count, incount);
111 if (outcount)
112 count = min(count, outcount);
113
114 /* now tx must be idle... */
115 while (!(tx4938_spiptr->sr & TXx9_SPSR_SIDLE))
116 ;
117
118 tx4938_spiptr->cr0 =
119 (tx4938_spiptr->cr0 & ~TXx9_SPCR0_RXIFL_MASK) |
120 ((count - 1) << 12);
121 if (cansleep) {
122 /* enable rx intr */
123 tx4938_spiptr->cr0 |= TXx9_SPCR0_RBSIE;
124 }
125 /* send */
126 for (i = 0; i < count; i++)
127 tx4938_spiptr->dr = inp ? *inp++ : 0;
128 /* wait all rx data */
129 if (cansleep) {
130 wait_event(txx9_spi_wait,
131 tx4938_spiptr->sr & TXx9_SPSR_SRRDY);
132 } else {
133 while (!(tx4938_spiptr->sr & TXx9_SPSR_RBSI))
134 ;
135 }
136 /* receive */
137 for (i = 0; i < count; i++) {
138 data = tx4938_spiptr->dr;
139 if (outp)
140 *outp++ = data;
141 }
142 if (incount)
143 incount -= count;
144 if (outcount)
145 outcount -= count;
146 }
147
148 /* CS OFF */
149 udelay(desc->tcsh);
150 txx9_spi_cs_func(chipid, 0);
151 udelay(desc->tcsr);
152
153 spin_lock_irqsave(&txx9_spi_lock, flags);
154 /* enter config mode */
155 tx4938_spiptr->mcr = TXx9_SPMCR_CONFIG | TXx9_SPMCR_BCLR;
156 spin_unlock_irqrestore(&txx9_spi_lock, flags);
157
158 return 0;
159}
diff --git a/arch/mips/vr41xx/Kconfig b/arch/mips/vr41xx/Kconfig
new file mode 100644
index 000000000000..a7add16c9aa4
--- /dev/null
+++ b/arch/mips/vr41xx/Kconfig
@@ -0,0 +1,88 @@
1config CASIO_E55
2 bool "Support for CASIO CASSIOPEIA E-10/15/55/65"
3 depends on MACH_VR41XX
4 select DMA_NONCOHERENT
5 select IRQ_CPU
6 select ISA
7 select SYS_SUPPORTS_LITTLE_ENDIAN
8
9config IBM_WORKPAD
10 bool "Support for IBM WorkPad z50"
11 depends on MACH_VR41XX
12 select DMA_NONCOHERENT
13 select IRQ_CPU
14 select ISA
15 select SYS_SUPPORTS_LITTLE_ENDIAN
16
17config NEC_CMBVR4133
18 bool "Support for NEC CMB-VR4133"
19 depends on MACH_VR41XX
20 select CPU_VR41XX
21 select DMA_NONCOHERENT
22 select IRQ_CPU
23 select HW_HAS_PCI
24
25config ROCKHOPPER
26 bool "Support for Rockhopper baseboard"
27 depends on NEC_CMBVR4133
28 select I8259
29 select HAVE_STD_PC_SERIAL_PORT
30
31config TANBAC_TB022X
32 bool "Support for TANBAC VR4131 multichip module and TANBAC VR4131DIMM"
33 depends on MACH_VR41XX
34 select DMA_NONCOHERENT
35 select HW_HAS_PCI
36 select IRQ_CPU
37 select SYS_SUPPORTS_LITTLE_ENDIAN
38 help
39 The TANBAC VR4131 multichip module(TB0225) and
40 the TANBAC VR4131DIMM(TB0229) are MIPS-based platforms
41 manufactured by TANBAC.
42 Please refer to <http://www.tanbac.co.jp/>
43 about VR4131 multichip module and VR4131DIMM.
44
45config TANBAC_TB0226
46 bool "Support for TANBAC Mbase(TB0226)"
47 depends on TANBAC_TB022X
48 select GPIO_VR41XX
49 help
50 The TANBAC Mbase(TB0226) is a MIPS-based platform
51 manufactured by TANBAC.
52 Please refer to <http://www.tanbac.co.jp/> about Mbase.
53
54config TANBAC_TB0287
55 bool "Support for TANBAC Mini-ITX DIMM base(TB0287)"
56 depends on TANBAC_TB022X
57 help
58 The TANBAC Mini-ITX DIMM base(TB0287) is a MIPS-based platform
59 manufactured by TANBAC.
60 Please refer to <http://www.tanbac.co.jp/> about Mini-ITX DIMM base.
61
62config VICTOR_MPC30X
63 bool "Support for Victor MP-C303/304"
64 depends on MACH_VR41XX
65 select DMA_NONCOHERENT
66 select HW_HAS_PCI
67 select IRQ_CPU
68 select SYS_SUPPORTS_LITTLE_ENDIAN
69
70config ZAO_CAPCELLA
71 bool "Support for ZAO Networks Capcella"
72 depends on MACH_VR41XX
73 select DMA_NONCOHERENT
74 select HW_HAS_PCI
75 select IRQ_CPU
76 select SYS_SUPPORTS_LITTLE_ENDIAN
77
78config PCI_VR41XX
79 bool "Add PCI control unit support of NEC VR4100 series"
80 depends on MACH_VR41XX && HW_HAS_PCI
81 default y
82 select PCI
83
84config VRC4173
85 tristate "Add NEC VRC4173 companion chip support"
86 depends on MACH_VR41XX && PCI_VR41XX
87 help
88 The NEC VRC4173 is a companion chip for NEC VR4122/VR4131.
diff --git a/arch/mips/vr41xx/common/cmu.c b/arch/mips/vr41xx/common/cmu.c
index fcd3cb8cdd9d..d758e432961b 100644
--- a/arch/mips/vr41xx/common/cmu.c
+++ b/arch/mips/vr41xx/common/cmu.c
@@ -69,7 +69,7 @@
69 69
70static void __iomem *cmu_base; 70static void __iomem *cmu_base;
71static uint16_t cmuclkmsk, cmuclkmsk2; 71static uint16_t cmuclkmsk, cmuclkmsk2;
72static spinlock_t cmu_lock; 72static DEFINE_SPINLOCK(cmu_lock);
73 73
74#define cmu_read(offset) readw(cmu_base + (offset)) 74#define cmu_read(offset) readw(cmu_base + (offset))
75#define cmu_write(offset, value) writew((value), cmu_base + (offset)) 75#define cmu_write(offset, value) writew((value), cmu_base + (offset))
diff --git a/arch/mips/vr41xx/common/init.c b/arch/mips/vr41xx/common/init.c
index e03be896cbc4..578f6496ffd4 100644
--- a/arch/mips/vr41xx/common/init.c
+++ b/arch/mips/vr41xx/common/init.c
@@ -58,6 +58,14 @@ static void __init timer_init(void)
58 board_timer_setup = setup_timer_irq; 58 board_timer_setup = setup_timer_irq;
59} 59}
60 60
61void __init plat_setup(void)
62{
63 vr41xx_calculate_clock_frequency();
64
65 timer_init();
66 iomem_resource_init();
67}
68
61void __init prom_init(void) 69void __init prom_init(void)
62{ 70{
63 int argc, i; 71 int argc, i;
@@ -71,12 +79,6 @@ void __init prom_init(void)
71 if (i < (argc - 1)) 79 if (i < (argc - 1))
72 strcat(arcs_cmdline, " "); 80 strcat(arcs_cmdline, " ");
73 } 81 }
74
75 vr41xx_calculate_clock_frequency();
76
77 timer_init();
78
79 iomem_resource_init();
80} 82}
81 83
82unsigned long __init prom_free_prom_memory (void) 84unsigned long __init prom_free_prom_memory (void)
diff --git a/arch/mips/vr41xx/common/vrc4173.c b/arch/mips/vr41xx/common/vrc4173.c
index ba58764ef8ea..462a9af30eef 100644
--- a/arch/mips/vr41xx/common/vrc4173.c
+++ b/arch/mips/vr41xx/common/vrc4173.c
@@ -81,8 +81,8 @@ EXPORT_SYMBOL(vrc4173_io_offset);
81static int vrc4173_initialized; 81static int vrc4173_initialized;
82static uint16_t vrc4173_cmuclkmsk; 82static uint16_t vrc4173_cmuclkmsk;
83static uint16_t vrc4173_selectreg; 83static uint16_t vrc4173_selectreg;
84static spinlock_t vrc4173_cmu_lock; 84static DEFINE_SPINLOCK(vrc4173_cmu_lock);
85static spinlock_t vrc4173_giu_lock; 85static DEFINE_SPINLOCK(vrc4173_giu_lock);
86 86
87static inline void set_cmusrst(uint16_t val) 87static inline void set_cmusrst(uint16_t val)
88{ 88{
diff --git a/arch/mips/vr41xx/nec-cmbvr4133/setup.c b/arch/mips/vr41xx/nec-cmbvr4133/setup.c
index db686ce42e85..53272a5c3cbe 100644
--- a/arch/mips/vr41xx/nec-cmbvr4133/setup.c
+++ b/arch/mips/vr41xx/nec-cmbvr4133/setup.c
@@ -56,7 +56,7 @@ static struct mtd_partition cmbvr4133_mtd_parts[] = {
56 56
57extern void i8259_init(void); 57extern void i8259_init(void);
58 58
59static int __init nec_cmbvr4133_setup(void) 59static void __init nec_cmbvr4133_setup(void)
60{ 60{
61#ifdef CONFIG_ROCKHOPPER 61#ifdef CONFIG_ROCKHOPPER
62 extern void disable_pcnet(void); 62 extern void disable_pcnet(void);
@@ -90,7 +90,4 @@ static int __init nec_cmbvr4133_setup(void)
90#ifdef CONFIG_ROCKHOPPER 90#ifdef CONFIG_ROCKHOPPER
91 i8259_init(); 91 i8259_init();
92#endif 92#endif
93 return 0;
94} 93}
95
96early_initcall(nec_cmbvr4133_setup);
diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c
index e15f09eaed12..a065349aee37 100644
--- a/arch/parisc/kernel/cache.c
+++ b/arch/parisc/kernel/cache.c
@@ -270,7 +270,6 @@ void flush_dcache_page(struct page *page)
270 unsigned long offset; 270 unsigned long offset;
271 unsigned long addr; 271 unsigned long addr;
272 pgoff_t pgoff; 272 pgoff_t pgoff;
273 pte_t *pte;
274 unsigned long pfn = page_to_pfn(page); 273 unsigned long pfn = page_to_pfn(page);
275 274
276 275
@@ -301,21 +300,16 @@ void flush_dcache_page(struct page *page)
301 * taking a page fault if the pte doesn't exist. 300 * taking a page fault if the pte doesn't exist.
302 * This is just for speed. If the page translation 301 * This is just for speed. If the page translation
303 * isn't there, there's no point exciting the 302 * isn't there, there's no point exciting the
304 * nadtlb handler into a nullification frenzy */ 303 * nadtlb handler into a nullification frenzy.
305 304 *
306 305 * Make sure we really have this page: the private
307 if(!(pte = translation_exists(mpnt, addr)))
308 continue;
309
310 /* make sure we really have this page: the private
311 * mappings may cover this area but have COW'd this 306 * mappings may cover this area but have COW'd this
312 * particular page */ 307 * particular page.
313 if(pte_pfn(*pte) != pfn) 308 */
314 continue; 309 if (translation_exists(mpnt, addr, pfn)) {
315 310 __flush_cache_page(mpnt, addr);
316 __flush_cache_page(mpnt, addr); 311 break;
317 312 }
318 break;
319 } 313 }
320 flush_dcache_mmap_unlock(mapping); 314 flush_dcache_mmap_unlock(mapping);
321} 315}
diff --git a/arch/parisc/kernel/ioctl32.c b/arch/parisc/kernel/ioctl32.c
index 8cad8f004f00..0a331104ad56 100644
--- a/arch/parisc/kernel/ioctl32.c
+++ b/arch/parisc/kernel/ioctl32.c
@@ -561,11 +561,6 @@ IOCTL_TABLE_START
561#define DECLARES 561#define DECLARES
562#include "compat_ioctl.c" 562#include "compat_ioctl.c"
563 563
564/* Might be moved to compat_ioctl.h with some ifdefs... */
565COMPATIBLE_IOCTL(TIOCSTART)
566COMPATIBLE_IOCTL(TIOCSTOP)
567COMPATIBLE_IOCTL(TIOCSLTC)
568
569/* PA-specific ioctls */ 564/* PA-specific ioctls */
570COMPATIBLE_IOCTL(PA_PERF_ON) 565COMPATIBLE_IOCTL(PA_PERF_ON)
571COMPATIBLE_IOCTL(PA_PERF_OFF) 566COMPATIBLE_IOCTL(PA_PERF_OFF)
diff --git a/arch/parisc/kernel/pci-dma.c b/arch/parisc/kernel/pci-dma.c
index ae6213d71670..f94a02ef3d95 100644
--- a/arch/parisc/kernel/pci-dma.c
+++ b/arch/parisc/kernel/pci-dma.c
@@ -114,7 +114,7 @@ static inline int map_pmd_uncached(pmd_t * pmd, unsigned long vaddr,
114 if (end > PGDIR_SIZE) 114 if (end > PGDIR_SIZE)
115 end = PGDIR_SIZE; 115 end = PGDIR_SIZE;
116 do { 116 do {
117 pte_t * pte = pte_alloc_kernel(&init_mm, pmd, vaddr); 117 pte_t * pte = pte_alloc_kernel(pmd, vaddr);
118 if (!pte) 118 if (!pte)
119 return -ENOMEM; 119 return -ENOMEM;
120 if (map_pte_uncached(pte, orig_vaddr, end - vaddr, paddr_ptr)) 120 if (map_pte_uncached(pte, orig_vaddr, end - vaddr, paddr_ptr))
diff --git a/arch/parisc/kernel/ptrace.c b/arch/parisc/kernel/ptrace.c
index f3428e5e86fb..18130c3748f3 100644
--- a/arch/parisc/kernel/ptrace.c
+++ b/arch/parisc/kernel/ptrace.c
@@ -78,7 +78,7 @@ void ptrace_disable(struct task_struct *child)
78 pa_psw(child)->l = 0; 78 pa_psw(child)->l = 0;
79} 79}
80 80
81long sys_ptrace(long request, pid_t pid, long addr, long data) 81long sys_ptrace(long request, long pid, long addr, long data)
82{ 82{
83 struct task_struct *child; 83 struct task_struct *child;
84 long ret; 84 long ret;
diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c
index bc979e1abdec..cded25680787 100644
--- a/arch/parisc/kernel/time.c
+++ b/arch/parisc/kernel/time.c
@@ -33,10 +33,6 @@
33 33
34#include <linux/timex.h> 34#include <linux/timex.h>
35 35
36u64 jiffies_64 = INITIAL_JIFFIES;
37
38EXPORT_SYMBOL(jiffies_64);
39
40/* xtime and wall_jiffies keep wall-clock time */ 36/* xtime and wall_jiffies keep wall-clock time */
41extern unsigned long wall_jiffies; 37extern unsigned long wall_jiffies;
42 38
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index 2886ad70db48..29b998e430e6 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -505,7 +505,9 @@ void show_mem(void)
505 505
506 for (j = node_start_pfn(i); j < node_end_pfn(i); j++) { 506 for (j = node_start_pfn(i); j < node_end_pfn(i); j++) {
507 struct page *p; 507 struct page *p;
508 unsigned long flags;
508 509
510 pgdat_resize_lock(NODE_DATA(i), &flags);
509 p = nid_page_nr(i, j) - node_start_pfn(i); 511 p = nid_page_nr(i, j) - node_start_pfn(i);
510 512
511 total++; 513 total++;
@@ -517,6 +519,7 @@ void show_mem(void)
517 free++; 519 free++;
518 else 520 else
519 shared += page_count(p) - 1; 521 shared += page_count(p) - 1;
522 pgdat_resize_unlock(NODE_DATA(i), &flags);
520 } 523 }
521 } 524 }
522#endif 525#endif
diff --git a/arch/parisc/mm/ioremap.c b/arch/parisc/mm/ioremap.c
index f2df502cdae3..5c7a1b3b9326 100644
--- a/arch/parisc/mm/ioremap.c
+++ b/arch/parisc/mm/ioremap.c
@@ -52,7 +52,7 @@ static inline int remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned lo
52 if (address >= end) 52 if (address >= end)
53 BUG(); 53 BUG();
54 do { 54 do {
55 pte_t * pte = pte_alloc_kernel(NULL, pmd, address); 55 pte_t * pte = pte_alloc_kernel(pmd, address);
56 if (!pte) 56 if (!pte)
57 return -ENOMEM; 57 return -ENOMEM;
58 remap_area_pte(pte, address, end - address, address + phys_addr, flags); 58 remap_area_pte(pte, address, end - address, address + phys_addr, flags);
@@ -75,10 +75,9 @@ static int remap_area_pages(unsigned long address, unsigned long phys_addr,
75 flush_cache_all(); 75 flush_cache_all();
76 if (address >= end) 76 if (address >= end)
77 BUG(); 77 BUG();
78 spin_lock(&init_mm.page_table_lock);
79 do { 78 do {
80 pmd_t *pmd; 79 pmd_t *pmd;
81 pmd = pmd_alloc(dir, address); 80 pmd = pmd_alloc(&init_mm, dir, address);
82 error = -ENOMEM; 81 error = -ENOMEM;
83 if (!pmd) 82 if (!pmd)
84 break; 83 break;
@@ -89,7 +88,6 @@ static int remap_area_pages(unsigned long address, unsigned long phys_addr,
89 address = (address + PGDIR_SIZE) & PGDIR_MASK; 88 address = (address + PGDIR_SIZE) & PGDIR_MASK;
90 dir++; 89 dir++;
91 } while (address && (address < end)); 90 } while (address && (address < end));
92 spin_unlock(&init_mm.page_table_lock);
93 flush_tlb_all(); 91 flush_tlb_all();
94 return error; 92 return error;
95} 93}
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
new file mode 100644
index 000000000000..967ecf92d6a7
--- /dev/null
+++ b/arch/powerpc/Kconfig
@@ -0,0 +1,900 @@
1# For a description of the syntax of this configuration file,
2# see Documentation/kbuild/kconfig-language.txt.
3#
4
5mainmenu "Linux/PowerPC Kernel Configuration"
6
7config PPC64
8 bool "64-bit kernel"
9 default n
10 help
11 This option selects whether a 32-bit or a 64-bit kernel
12 will be built.
13
14config PPC32
15 bool
16 default y if !PPC64
17
18config 64BIT
19 bool
20 default y if PPC64
21
22config PPC_MERGE
23 def_bool y
24
25config MMU
26 bool
27 default y
28
29config UID16
30 bool
31
32config GENERIC_HARDIRQS
33 bool
34 default y
35
36config RWSEM_GENERIC_SPINLOCK
37 bool
38
39config RWSEM_XCHGADD_ALGORITHM
40 bool
41 default y
42
43config GENERIC_CALIBRATE_DELAY
44 bool
45 default y
46
47config PPC
48 bool
49 default y
50
51config EARLY_PRINTK
52 bool
53 default y if PPC64
54
55config COMPAT
56 bool
57 default y if PPC64
58
59config SYSVIPC_COMPAT
60 bool
61 depends on COMPAT && SYSVIPC
62 default y
63
64# All PPC32s use generic nvram driver through ppc_md
65config GENERIC_NVRAM
66 bool
67 default y if PPC32
68
69config SCHED_NO_NO_OMIT_FRAME_POINTER
70 bool
71 default y
72
73config ARCH_MAY_HAVE_PC_FDC
74 bool
75 default y
76
77menu "Processor support"
78choice
79 prompt "Processor Type"
80 depends on PPC32
81 default 6xx
82
83config 6xx
84 bool "6xx/7xx/74xx"
85 select PPC_FPU
86 help
87 There are four families of PowerPC chips supported. The more common
88 types (601, 603, 604, 740, 750, 7400), the Motorola embedded
89 versions (821, 823, 850, 855, 860, 52xx, 82xx, 83xx), the AMCC
90 embedded versions (403 and 405) and the high end 64 bit Power
91 processors (POWER 3, POWER4, and IBM PPC970 also known as G5).
92
93 Unless you are building a kernel for one of the embedded processor
94 systems, 64 bit IBM RS/6000 or an Apple G5, choose 6xx.
95 Note that the kernel runs in 32-bit mode even on 64-bit chips.
96
97config PPC_52xx
98 bool "Freescale 52xx"
99
100config PPC_82xx
101 bool "Freescale 82xx"
102
103config PPC_83xx
104 bool "Freescale 83xx"
105
106config 40x
107 bool "AMCC 40x"
108
109config 44x
110 bool "AMCC 44x"
111
112config 8xx
113 bool "Freescale 8xx"
114
115config E200
116 bool "Freescale e200"
117
118config E500
119 bool "Freescale e500"
120endchoice
121
122config POWER4_ONLY
123 bool "Optimize for POWER4"
124 depends on PPC64
125 default n
126 ---help---
127 Cause the compiler to optimize for POWER4/POWER5/PPC970 processors.
128 The resulting binary will not work on POWER3 or RS64 processors
129 when compiled with binutils 2.15 or later.
130
131config POWER3
132 bool
133 depends on PPC64
134 default y if !POWER4_ONLY
135
136config POWER4
137 depends on PPC64
138 def_bool y
139
140config PPC_FPU
141 bool
142 default y if PPC64
143
144config BOOKE
145 bool
146 depends on E200 || E500
147 default y
148
149config FSL_BOOKE
150 bool
151 depends on E200 || E500
152 default y
153
154config PTE_64BIT
155 bool
156 depends on 44x || E500
157 default y if 44x
158 default y if E500 && PHYS_64BIT
159
160config PHYS_64BIT
161 bool 'Large physical address support' if E500
162 depends on 44x || E500
163 default y if 44x
164 ---help---
165 This option enables kernel support for larger than 32-bit physical
166 addresses. This features is not be available on all e500 cores.
167
168 If in doubt, say N here.
169
170config ALTIVEC
171 bool "AltiVec Support"
172 depends on 6xx || POWER4
173 ---help---
174 This option enables kernel support for the Altivec extensions to the
175 PowerPC processor. The kernel currently supports saving and restoring
176 altivec registers, and turning on the 'altivec enable' bit so user
177 processes can execute altivec instructions.
178
179 This option is only usefully if you have a processor that supports
180 altivec (G4, otherwise known as 74xx series), but does not have
181 any affect on a non-altivec cpu (it does, however add code to the
182 kernel).
183
184 If in doubt, say Y here.
185
186config SPE
187 bool "SPE Support"
188 depends on E200 || E500
189 ---help---
190 This option enables kernel support for the Signal Processing
191 Extensions (SPE) to the PowerPC processor. The kernel currently
192 supports saving and restoring SPE registers, and turning on the
193 'spe enable' bit so user processes can execute SPE instructions.
194
195 This option is only useful if you have a processor that supports
196 SPE (e500, otherwise known as 85xx series), but does not have any
197 effect on a non-spe cpu (it does, however add code to the kernel).
198
199 If in doubt, say Y here.
200
201config PPC_STD_MMU
202 bool
203 depends on 6xx || POWER3 || POWER4 || PPC64
204 default y
205
206config PPC_STD_MMU_32
207 def_bool y
208 depends on PPC_STD_MMU && PPC32
209
210config SMP
211 depends on PPC_STD_MMU
212 bool "Symmetric multi-processing support"
213 ---help---
214 This enables support for systems with more than one CPU. If you have
215 a system with only one CPU, say N. If you have a system with more
216 than one CPU, say Y. Note that the kernel does not currently
217 support SMP machines with 603/603e/603ev or PPC750 ("G3") processors
218 since they have inadequate hardware support for multiprocessor
219 operation.
220
221 If you say N here, the kernel will run on single and multiprocessor
222 machines, but will use only one CPU of a multiprocessor machine. If
223 you say Y here, the kernel will run on single-processor machines.
224 On a single-processor machine, the kernel will run faster if you say
225 N here.
226
227 If you don't know what to do here, say N.
228
229config NR_CPUS
230 int "Maximum number of CPUs (2-32)"
231 range 2 128
232 depends on SMP
233 default "32" if PPC64
234 default "4"
235
236config NOT_COHERENT_CACHE
237 bool
238 depends on 4xx || 8xx || E200
239 default y
240endmenu
241
242source "init/Kconfig"
243
244menu "Platform support"
245 depends on PPC64 || 6xx
246
247choice
248 prompt "Machine type"
249 default PPC_MULTIPLATFORM
250
251config PPC_MULTIPLATFORM
252 bool "Generic desktop/server/laptop"
253 help
254 Select this option if configuring for an IBM pSeries or
255 RS/6000 machine, an Apple machine, or a PReP, CHRP,
256 Maple or Cell-based machine.
257
258config PPC_ISERIES
259 bool "IBM Legacy iSeries"
260 depends on PPC64
261
262config EMBEDDED6xx
263 bool "Embedded 6xx/7xx/7xxx-based board"
264 depends on PPC32
265
266config APUS
267 bool "Amiga-APUS"
268 depends on PPC32 && BROKEN
269 help
270 Select APUS if configuring for a PowerUP Amiga.
271 More information is available at:
272 <http://linux-apus.sourceforge.net/>.
273endchoice
274
275config PPC_PSERIES
276 depends on PPC_MULTIPLATFORM && PPC64
277 bool " IBM pSeries & new (POWER5-based) iSeries"
278 select PPC_I8259
279 select PPC_RTAS
280 select RTAS_ERROR_LOGGING
281 default y
282
283config PPC_CHRP
284 bool " Common Hardware Reference Platform (CHRP) based machines"
285 depends on PPC_MULTIPLATFORM && PPC32
286 select PPC_I8259
287 select PPC_INDIRECT_PCI
288 select PPC_RTAS
289 select PPC_MPC106
290 default y
291
292config PPC_PMAC
293 bool " Apple PowerMac based machines"
294 depends on PPC_MULTIPLATFORM
295 select PPC_INDIRECT_PCI if PPC32
296 select PPC_MPC106 if PPC32
297 default y
298
299config PPC_PMAC64
300 bool
301 depends on PPC_PMAC && POWER4
302 select U3_DART
303 default y
304
305config PPC_PREP
306 bool " PowerPC Reference Platform (PReP) based machines"
307 depends on PPC_MULTIPLATFORM && PPC32
308 select PPC_I8259
309 select PPC_INDIRECT_PCI
310 default y
311
312config PPC_MAPLE
313 depends on PPC_MULTIPLATFORM && PPC64
314 bool " Maple 970FX Evaluation Board"
315 select U3_DART
316 select MPIC_BROKEN_U3
317 default n
318 help
319 This option enables support for the Maple 970FX Evaluation Board.
320 For more informations, refer to <http://www.970eval.com>
321
322config PPC_BPA
323 bool " Broadband Processor Architecture"
324 depends on PPC_MULTIPLATFORM && PPC64
325 select PPC_RTAS
326
327config PPC_OF
328 bool
329 depends on PPC_MULTIPLATFORM # for now
330 default y
331
332config XICS
333 depends on PPC_PSERIES
334 bool
335 default y
336
337config U3_DART
338 bool
339 depends on PPC_MULTIPLATFORM && PPC64
340 default n
341
342config MPIC
343 depends on PPC_PSERIES || PPC_PMAC || PPC_MAPLE || PPC_CHRP
344 bool
345 default y
346
347config PPC_RTAS
348 bool
349 default n
350
351config RTAS_ERROR_LOGGING
352 bool
353 depends on PPC_RTAS
354 default n
355
356config MPIC_BROKEN_U3
357 bool
358 depends on PPC_MAPLE
359 default y
360
361config BPA_IIC
362 depends on PPC_BPA
363 bool
364 default y
365
366config IBMVIO
367 depends on PPC_PSERIES || PPC_ISERIES
368 bool
369 default y
370
371config PPC_MPC106
372 bool
373 default n
374
375source "drivers/cpufreq/Kconfig"
376
377config CPU_FREQ_PMAC
378 bool "Support for Apple PowerBooks"
379 depends on CPU_FREQ && ADB_PMU && PPC32
380 select CPU_FREQ_TABLE
381 help
382 This adds support for frequency switching on Apple PowerBooks,
383 this currently includes some models of iBook & Titanium
384 PowerBook.
385
386config PPC601_SYNC_FIX
387 bool "Workarounds for PPC601 bugs"
388 depends on 6xx && (PPC_PREP || PPC_PMAC)
389 help
390 Some versions of the PPC601 (the first PowerPC chip) have bugs which
391 mean that extra synchronization instructions are required near
392 certain instructions, typically those that make major changes to the
393 CPU state. These extra instructions reduce performance slightly.
394 If you say N here, these extra instructions will not be included,
395 resulting in a kernel which will run faster but may not run at all
396 on some systems with the PPC601 chip.
397
398 If in doubt, say Y here.
399
400config TAU
401 bool "Thermal Management Support"
402 depends on 6xx
403 help
404 G3 and G4 processors have an on-chip temperature sensor called the
405 'Thermal Assist Unit (TAU)', which, in theory, can measure the on-die
406 temperature within 2-4 degrees Celsius. This option shows the current
407 on-die temperature in /proc/cpuinfo if the cpu supports it.
408
409 Unfortunately, on some chip revisions, this sensor is very inaccurate
410 and in some cases, does not work at all, so don't assume the cpu
411 temp is actually what /proc/cpuinfo says it is.
412
413config TAU_INT
414 bool "Interrupt driven TAU driver (DANGEROUS)"
415 depends on TAU
416 ---help---
417 The TAU supports an interrupt driven mode which causes an interrupt
418 whenever the temperature goes out of range. This is the fastest way
419 to get notified the temp has exceeded a range. With this option off,
420 a timer is used to re-check the temperature periodically.
421
422 However, on some cpus it appears that the TAU interrupt hardware
423 is buggy and can cause a situation which would lead unexplained hard
424 lockups.
425
426 Unless you are extending the TAU driver, or enjoy kernel/hardware
427 debugging, leave this option off.
428
429config TAU_AVERAGE
430 bool "Average high and low temp"
431 depends on TAU
432 ---help---
433 The TAU hardware can compare the temperature to an upper and lower
434 bound. The default behavior is to show both the upper and lower
435 bound in /proc/cpuinfo. If the range is large, the temperature is
436 either changing a lot, or the TAU hardware is broken (likely on some
437 G4's). If the range is small (around 4 degrees), the temperature is
438 relatively stable. If you say Y here, a single temperature value,
439 halfway between the upper and lower bounds, will be reported in
440 /proc/cpuinfo.
441
442 If in doubt, say N here.
443endmenu
444
445source arch/powerpc/platforms/embedded6xx/Kconfig
446source arch/powerpc/platforms/4xx/Kconfig
447source arch/powerpc/platforms/85xx/Kconfig
448source arch/powerpc/platforms/8xx/Kconfig
449
450menu "Kernel options"
451
452config HIGHMEM
453 bool "High memory support"
454 depends on PPC32
455
456source kernel/Kconfig.hz
457source kernel/Kconfig.preempt
458source "fs/Kconfig.binfmt"
459
460# We optimistically allocate largepages from the VM, so make the limit
461# large enough (16MB). This badly named config option is actually
462# max order + 1
463config FORCE_MAX_ZONEORDER
464 int
465 depends on PPC64
466 default "13"
467
468config MATH_EMULATION
469 bool "Math emulation"
470 depends on 4xx || 8xx || E200 || E500
471 ---help---
472 Some PowerPC chips designed for embedded applications do not have
473 a floating-point unit and therefore do not implement the
474 floating-point instructions in the PowerPC instruction set. If you
475 say Y here, the kernel will include code to emulate a floating-point
476 unit, which will allow programs that use floating-point
477 instructions to run.
478
479config IOMMU_VMERGE
480 bool "Enable IOMMU virtual merging (EXPERIMENTAL)"
481 depends on EXPERIMENTAL && PPC64
482 default n
483 help
484 Cause IO segments sent to a device for DMA to be merged virtually
485 by the IOMMU when they happen to have been allocated contiguously.
486 This doesn't add pressure to the IOMMU allocator. However, some
487 drivers don't support getting large merged segments coming back
488 from *_map_sg(). Say Y if you know the drivers you are using are
489 properly handling this case.
490
491config HOTPLUG_CPU
492 bool "Support for enabling/disabling CPUs"
493 depends on SMP && HOTPLUG && EXPERIMENTAL && (PPC_PSERIES || PPC_PMAC)
494 ---help---
495 Say Y here to be able to disable and re-enable individual
496 CPUs at runtime on SMP machines.
497
498 Say N if you are unsure.
499
500config KEXEC
501 bool "kexec system call (EXPERIMENTAL)"
502 depends on PPC_MULTIPLATFORM && EXPERIMENTAL
503 help
504 kexec is a system call that implements the ability to shutdown your
505 current kernel, and to start another kernel. It is like a reboot
506 but it is indepedent of the system firmware. And like a reboot
507 you can start any kernel with it, not just Linux.
508
509 The name comes from the similiarity to the exec system call.
510
511 It is an ongoing process to be certain the hardware in a machine
512 is properly shutdown, so do not be surprised if this code does not
513 initially work for you. It may help to enable device hotplugging
514 support. As of this writing the exact hardware interface is
515 strongly in flux, so no good recommendation can be made.
516
517config EMBEDDEDBOOT
518 bool
519 depends on 8xx || 8260
520 default y
521
522config PC_KEYBOARD
523 bool "PC PS/2 style Keyboard"
524 depends on 4xx || CPM2
525
526config PPCBUG_NVRAM
527 bool "Enable reading PPCBUG NVRAM during boot" if PPLUS || LOPEC
528 default y if PPC_PREP
529
530config IRQ_ALL_CPUS
531 bool "Distribute interrupts on all CPUs by default"
532 depends on SMP && !MV64360
533 help
534 This option gives the kernel permission to distribute IRQs across
535 multiple CPUs. Saying N here will route all IRQs to the first
536 CPU. Generally saying Y is safe, although some problems have been
537 reported with SMP Power Macintoshes with this option enabled.
538
539source "arch/powerpc/platforms/pseries/Kconfig"
540
541config NUMA
542 bool "NUMA support"
543 depends on PPC64
544 default y if SMP && PPC_PSERIES
545
546config ARCH_SELECT_MEMORY_MODEL
547 def_bool y
548 depends on PPC64
549
550config ARCH_FLATMEM_ENABLE
551 def_bool y
552 depends on PPC64 && !NUMA
553
554config ARCH_DISCONTIGMEM_ENABLE
555 def_bool y
556 depends on SMP && PPC_PSERIES
557
558config ARCH_DISCONTIGMEM_DEFAULT
559 def_bool y
560 depends on ARCH_DISCONTIGMEM_ENABLE
561
562config ARCH_SPARSEMEM_ENABLE
563 def_bool y
564 depends on ARCH_DISCONTIGMEM_ENABLE
565
566source "mm/Kconfig"
567
568config HAVE_ARCH_EARLY_PFN_TO_NID
569 def_bool y
570 depends on NEED_MULTIPLE_NODES
571
572# Some NUMA nodes have memory ranges that span
573# other nodes. Even though a pfn is valid and
574# between a node's start and end pfns, it may not
575# reside on that node.
576#
577# This is a relatively temporary hack that should
578# be able to go away when sparsemem is fully in
579# place
580
581config NODES_SPAN_OTHER_NODES
582 def_bool y
583 depends on NEED_MULTIPLE_NODES
584
585config SCHED_SMT
586 bool "SMT (Hyperthreading) scheduler support"
587 depends on PPC64 && SMP
588 default off
589 help
590 SMT scheduler support improves the CPU scheduler's decision making
591 when dealing with POWER5 cpus at a cost of slightly increased
592 overhead in some places. If unsure say N here.
593
594config PROC_DEVICETREE
595 bool "Support for device tree in /proc"
596 depends on PROC_FS
597 help
598 This option adds a device-tree directory under /proc which contains
599 an image of the device tree that the kernel copies from Open
600 Firmware or other boot firmware. If unsure, say Y here.
601
602source "arch/powerpc/platforms/prep/Kconfig"
603
604config CMDLINE_BOOL
605 bool "Default bootloader kernel arguments"
606 depends on !PPC_ISERIES
607
608config CMDLINE
609 string "Initial kernel command string"
610 depends on CMDLINE_BOOL
611 default "console=ttyS0,9600 console=tty0 root=/dev/sda2"
612 help
613 On some platforms, there is currently no way for the boot loader to
614 pass arguments to the kernel. For these platforms, you can supply
615 some command-line options at build time by entering them here. In
616 most cases you will need to specify the root device here.
617
618if !44x || BROKEN
619source kernel/power/Kconfig
620endif
621
622config SECCOMP
623 bool "Enable seccomp to safely compute untrusted bytecode"
624 depends on PROC_FS
625 default y
626 help
627 This kernel feature is useful for number crunching applications
628 that may need to compute untrusted bytecode during their
629 execution. By using pipes or other transports made available to
630 the process as file descriptors supporting the read/write
631 syscalls, it's possible to isolate those applications in
632 their own address space using seccomp. Once seccomp is
633 enabled via /proc/<pid>/seccomp, it cannot be disabled
634 and the task is only allowed to execute a few safe syscalls
635 defined by each seccomp mode.
636
637 If unsure, say Y. Only embedded should say N here.
638
639endmenu
640
641config ISA_DMA_API
642 bool
643 default y
644
645menu "Bus options"
646
647config ISA
648 bool "Support for ISA-bus hardware"
649 depends on PPC_PREP || PPC_CHRP
650 select PPC_I8259
651 help
652 Find out whether you have ISA slots on your motherboard. ISA is the
653 name of a bus system, i.e. the way the CPU talks to the other stuff
654 inside your box. If you have an Apple machine, say N here; if you
655 have an IBM RS/6000 or pSeries machine or a PReP machine, say Y. If
656 you have an embedded board, consult your board documentation.
657
658config GENERIC_ISA_DMA
659 bool
660 depends on PPC64 || POWER4 || 6xx && !CPM2
661 default y
662
663config PPC_I8259
664 bool
665 default y if 85xx
666 default n
667
668config PPC_INDIRECT_PCI
669 bool
670 depends on PCI
671 default y if 40x || 44x || 85xx || 83xx
672 default n
673
674config EISA
675 bool
676
677config SBUS
678 bool
679
680# Yes MCA RS/6000s exist but Linux-PPC does not currently support any
681config MCA
682 bool
683
684config PCI
685 bool "PCI support" if 40x || CPM2 || 83xx || 85xx || PPC_MPC52xx || (EMBEDDED && PPC_ISERIES)
686 default y if !40x && !CPM2 && !8xx && !APUS && !83xx && !85xx
687 default PCI_PERMEDIA if !4xx && !CPM2 && !8xx && APUS
688 default PCI_QSPAN if !4xx && !CPM2 && 8xx
689 help
690 Find out whether your system includes a PCI bus. PCI is the name of
691 a bus system, i.e. the way the CPU talks to the other stuff inside
692 your box. If you say Y here, the kernel will include drivers and
693 infrastructure code to support PCI bus devices.
694
695config PCI_DOMAINS
696 bool
697 default PCI
698
699config MPC83xx_PCI2
700 bool " Supprt for 2nd PCI host controller"
701 depends on PCI && MPC834x
702 default y if MPC834x_SYS
703
704config PCI_QSPAN
705 bool "QSpan PCI"
706 depends on !4xx && !CPM2 && 8xx
707 select PPC_I8259
708 help
709 Say Y here if you have a system based on a Motorola 8xx-series
710 embedded processor with a QSPAN PCI interface, otherwise say N.
711
712config PCI_8260
713 bool
714 depends on PCI && 8260
715 select PPC_INDIRECT_PCI
716 default y
717
718config 8260_PCI9
719 bool " Enable workaround for MPC826x erratum PCI 9"
720 depends on PCI_8260 && !ADS8272
721 default y
722
723choice
724 prompt " IDMA channel for PCI 9 workaround"
725 depends on 8260_PCI9
726
727config 8260_PCI9_IDMA1
728 bool "IDMA1"
729
730config 8260_PCI9_IDMA2
731 bool "IDMA2"
732
733config 8260_PCI9_IDMA3
734 bool "IDMA3"
735
736config 8260_PCI9_IDMA4
737 bool "IDMA4"
738
739endchoice
740
741source "drivers/pci/Kconfig"
742
743source "drivers/pcmcia/Kconfig"
744
745source "drivers/pci/hotplug/Kconfig"
746
747endmenu
748
749menu "Advanced setup"
750 depends on PPC32
751
752config ADVANCED_OPTIONS
753 bool "Prompt for advanced kernel configuration options"
754 help
755 This option will enable prompting for a variety of advanced kernel
756 configuration options. These options can cause the kernel to not
757 work if they are set incorrectly, but can be used to optimize certain
758 aspects of kernel memory management.
759
760 Unless you know what you are doing, say N here.
761
762comment "Default settings for advanced configuration options are used"
763 depends on !ADVANCED_OPTIONS
764
765config HIGHMEM_START_BOOL
766 bool "Set high memory pool address"
767 depends on ADVANCED_OPTIONS && HIGHMEM
768 help
769 This option allows you to set the base address of the kernel virtual
770 area used to map high memory pages. This can be useful in
771 optimizing the layout of kernel virtual memory.
772
773 Say N here unless you know what you are doing.
774
775config HIGHMEM_START
776 hex "Virtual start address of high memory pool" if HIGHMEM_START_BOOL
777 default "0xfe000000"
778
779config LOWMEM_SIZE_BOOL
780 bool "Set maximum low memory"
781 depends on ADVANCED_OPTIONS
782 help
783 This option allows you to set the maximum amount of memory which
784 will be used as "low memory", that is, memory which the kernel can
785 access directly, without having to set up a kernel virtual mapping.
786 This can be useful in optimizing the layout of kernel virtual
787 memory.
788
789 Say N here unless you know what you are doing.
790
791config LOWMEM_SIZE
792 hex "Maximum low memory size (in bytes)" if LOWMEM_SIZE_BOOL
793 default "0x30000000"
794
795config KERNEL_START_BOOL
796 bool "Set custom kernel base address"
797 depends on ADVANCED_OPTIONS
798 help
799 This option allows you to set the kernel virtual address at which
800 the kernel will map low memory (the kernel image will be linked at
801 this address). This can be useful in optimizing the virtual memory
802 layout of the system.
803
804 Say N here unless you know what you are doing.
805
806config KERNEL_START
807 hex "Virtual address of kernel base" if KERNEL_START_BOOL
808 default "0xc0000000"
809
810config TASK_SIZE_BOOL
811 bool "Set custom user task size"
812 depends on ADVANCED_OPTIONS
813 help
814 This option allows you to set the amount of virtual address space
815 allocated to user tasks. This can be useful in optimizing the
816 virtual memory layout of the system.
817
818 Say N here unless you know what you are doing.
819
820config TASK_SIZE
821 hex "Size of user task space" if TASK_SIZE_BOOL
822 default "0x80000000"
823
824config CONSISTENT_START_BOOL
825 bool "Set custom consistent memory pool address"
826 depends on ADVANCED_OPTIONS && NOT_COHERENT_CACHE
827 help
828 This option allows you to set the base virtual address
829 of the the consistent memory pool. This pool of virtual
830 memory is used to make consistent memory allocations.
831
832config CONSISTENT_START
833 hex "Base virtual address of consistent memory pool" if CONSISTENT_START_BOOL
834 default "0xff100000" if NOT_COHERENT_CACHE
835
836config CONSISTENT_SIZE_BOOL
837 bool "Set custom consistent memory pool size"
838 depends on ADVANCED_OPTIONS && NOT_COHERENT_CACHE
839 help
840 This option allows you to set the size of the the
841 consistent memory pool. This pool of virtual memory
842 is used to make consistent memory allocations.
843
844config CONSISTENT_SIZE
845 hex "Size of consistent memory pool" if CONSISTENT_SIZE_BOOL
846 default "0x00200000" if NOT_COHERENT_CACHE
847
848config BOOT_LOAD_BOOL
849 bool "Set the boot link/load address"
850 depends on ADVANCED_OPTIONS && !PPC_MULTIPLATFORM
851 help
852 This option allows you to set the initial load address of the zImage
853 or zImage.initrd file. This can be useful if you are on a board
854 which has a small amount of memory.
855
856 Say N here unless you know what you are doing.
857
858config BOOT_LOAD
859 hex "Link/load address for booting" if BOOT_LOAD_BOOL
860 default "0x00400000" if 40x || 8xx || 8260
861 default "0x01000000" if 44x
862 default "0x00800000"
863
864config PIN_TLB
865 bool "Pinned Kernel TLBs (860 ONLY)"
866 depends on ADVANCED_OPTIONS && 8xx
867endmenu
868
869if PPC64
870config KERNEL_START
871 hex
872 default "0xc000000000000000"
873endif
874
875source "net/Kconfig"
876
877source "drivers/Kconfig"
878
879source "fs/Kconfig"
880
881# XXX source "arch/ppc/8xx_io/Kconfig"
882
883# XXX source "arch/ppc/8260_io/Kconfig"
884
885source "arch/powerpc/platforms/iseries/Kconfig"
886
887source "lib/Kconfig"
888
889source "arch/powerpc/oprofile/Kconfig"
890
891source "arch/powerpc/Kconfig.debug"
892
893source "security/Kconfig"
894
895config KEYS_COMPAT
896 bool
897 depends on COMPAT && KEYS
898 default y
899
900source "crypto/Kconfig"
diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
new file mode 100644
index 000000000000..0baf64ec80d0
--- /dev/null
+++ b/arch/powerpc/Kconfig.debug
@@ -0,0 +1,128 @@
1menu "Kernel hacking"
2
3source "lib/Kconfig.debug"
4
5config DEBUG_STACKOVERFLOW
6 bool "Check for stack overflows"
7 depends on DEBUG_KERNEL && PPC64
8 help
9 This option will cause messages to be printed if free stack space
10 drops below a certain limit.
11
12config KPROBES
13 bool "Kprobes"
14 depends on DEBUG_KERNEL && PPC64
15 help
16 Kprobes allows you to trap at almost any kernel address and
17 execute a callback function. register_kprobe() establishes
18 a probepoint and specifies the callback. Kprobes is useful
19 for kernel debugging, non-intrusive instrumentation and testing.
20 If in doubt, say "N".
21
22config DEBUG_STACK_USAGE
23 bool "Stack utilization instrumentation"
24 depends on DEBUG_KERNEL && PPC64
25 help
26 Enables the display of the minimum amount of free stack which each
27 task has ever had available in the sysrq-T and sysrq-P debug output.
28
29 This option will slow down process creation somewhat.
30
31config DEBUGGER
32 bool "Enable debugger hooks"
33 depends on DEBUG_KERNEL
34 help
35 Include in-kernel hooks for kernel debuggers. Unless you are
36 intending to debug the kernel, say N here.
37
38config KGDB
39 bool "Include kgdb kernel debugger"
40 depends on DEBUGGER && (BROKEN || PPC_GEN550 || 4xx)
41 select DEBUG_INFO
42 help
43 Include in-kernel hooks for kgdb, the Linux kernel source level
44 debugger. See <http://kgdb.sourceforge.net/> for more information.
45 Unless you are intending to debug the kernel, say N here.
46
47choice
48 prompt "Serial Port"
49 depends on KGDB
50 default KGDB_TTYS1
51
52config KGDB_TTYS0
53 bool "ttyS0"
54
55config KGDB_TTYS1
56 bool "ttyS1"
57
58config KGDB_TTYS2
59 bool "ttyS2"
60
61config KGDB_TTYS3
62 bool "ttyS3"
63
64endchoice
65
66config KGDB_CONSOLE
67 bool "Enable serial console thru kgdb port"
68 depends on KGDB && 8xx || CPM2
69 help
70 If you enable this, all serial console messages will be sent
71 over the gdb stub.
72 If unsure, say N.
73
74config XMON
75 bool "Include xmon kernel debugger"
76 depends on DEBUGGER && !PPC_ISERIES
77 help
78 Include in-kernel hooks for the xmon kernel monitor/debugger.
79 Unless you are intending to debug the kernel, say N here.
80 Make sure to enable also CONFIG_BOOTX_TEXT on Macs. Otherwise
81 nothing will appear on the screen (xmon writes directly to the
82 framebuffer memory).
83 The cmdline option 'xmon' or 'xmon=early' will drop into xmon
84 very early during boot. 'xmon=on' will just enable the xmon
85 debugger hooks. 'xmon=off' will disable the debugger hooks
86 if CONFIG_XMON_DEFAULT is set.
87
88config XMON_DEFAULT
89 bool "Enable xmon by default"
90 depends on XMON
91 help
92 xmon is normally disabled unless booted with 'xmon=on'.
93 Use 'xmon=off' to disable xmon init during runtime.
94
95config IRQSTACKS
96 bool "Use separate kernel stacks when processing interrupts"
97 depends on PPC64
98 help
99 If you say Y here the kernel will use separate kernel stacks
100 for handling hard and soft interrupts. This can help avoid
101 overflowing the process kernel stacks.
102
103config BDI_SWITCH
104 bool "Include BDI-2000 user context switcher"
105 depends on DEBUG_KERNEL && PPC32
106 help
107 Include in-kernel support for the Abatron BDI2000 debugger.
108 Unless you are intending to debug the kernel with one of these
109 machines, say N here.
110
111config BOOTX_TEXT
112 bool "Support for early boot text console (BootX or OpenFirmware only)"
113 depends PPC_OF && !PPC_ISERIES
114 help
115 Say Y here to see progress messages from the boot firmware in text
116 mode. Requires either BootX or Open Firmware.
117
118config SERIAL_TEXT_DEBUG
119 bool "Support for early boot texts over serial port"
120 depends on 4xx || LOPEC || MV64X60 || PPLUS || PRPMC800 || \
121 PPC_GEN550 || PPC_MPC52xx
122
123config PPC_OCP
124 bool
125 depends on IBM_OCP || XILINX_OCP
126 default y
127
128endmenu
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
new file mode 100644
index 000000000000..2f4cce06a7e5
--- /dev/null
+++ b/arch/powerpc/Makefile
@@ -0,0 +1,222 @@
1# This file is included by the global makefile so that you can add your own
2# architecture-specific flags and dependencies. Remember to do have actions
3# for "archclean" and "archdep" for cleaning up and making dependencies for
4# this architecture.
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# Copyright (C) 1994 by Linus Torvalds
11# Changes for PPC by Gary Thomas
12# Rewritten by Cort Dougan and Paul Mackerras
13#
14
15# This must match PAGE_OFFSET in include/asm-powerpc/page.h.
16KERNELLOAD := $(CONFIG_KERNEL_START)
17
18HAS_BIARCH := $(call cc-option-yn, -m32)
19
20ifeq ($(CONFIG_PPC64),y)
21OLDARCH := ppc64
22SZ := 64
23
24# Set default 32 bits cross compilers for vdso and boot wrapper
25CROSS32_COMPILE ?=
26
27CROSS32CC := $(CROSS32_COMPILE)gcc
28CROSS32AS := $(CROSS32_COMPILE)as
29CROSS32LD := $(CROSS32_COMPILE)ld
30CROSS32OBJCOPY := $(CROSS32_COMPILE)objcopy
31
32ifeq ($(HAS_BIARCH),y)
33ifeq ($(CROSS32_COMPILE),)
34CROSS32CC := $(CC) -m32
35CROSS32AS := $(AS) -a32
36CROSS32LD := $(LD) -m elf32ppc
37CROSS32OBJCOPY := $(OBJCOPY)
38endif
39endif
40
41export CROSS32CC CROSS32AS CROSS32LD CROSS32OBJCOPY
42
43new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi)
44
45ifeq ($(new_nm),y)
46NM := $(NM) --synthetic
47endif
48
49else
50OLDARCH := ppc
51SZ := 32
52endif
53
54UTS_MACHINE := $(OLDARCH)
55
56ifeq ($(HAS_BIARCH),y)
57override AS += -a$(SZ)
58override LD += -m elf$(SZ)ppc
59override CC += -m$(SZ)
60endif
61
62LDFLAGS_vmlinux := -Ttext $(KERNELLOAD) -Bstatic -e $(KERNELLOAD)
63
64# The -Iarch/$(ARCH)/include is temporary while we are merging
65CPPFLAGS += -Iarch/$(ARCH) -Iarch/$(ARCH)/include
66AFLAGS += -Iarch/$(ARCH)
67CFLAGS += -Iarch/$(ARCH) -msoft-float -pipe
68CFLAGS-$(CONFIG_PPC64) := -mminimal-toc -mtraceback=none -mcall-aixdesc
69CFLAGS-$(CONFIG_PPC32) := -ffixed-r2 -mmultiple
70CFLAGS += $(CFLAGS-y)
71CPP = $(CC) -E $(CFLAGS)
72# Temporary hack until we have migrated to asm-powerpc
73LINUXINCLUDE += -Iarch/$(ARCH)/include
74
75CHECKFLAGS += -m$(SZ) -D__powerpc__ -D__powerpc$(SZ)__
76
77ifeq ($(CONFIG_PPC64),y)
78GCC_VERSION := $(call cc-version)
79GCC_BROKEN_VEC := $(shell if [ $(GCC_VERSION) -lt 0400 ] ; then echo "y"; fi)
80
81ifeq ($(CONFIG_POWER4_ONLY),y)
82ifeq ($(CONFIG_ALTIVEC),y)
83ifeq ($(GCC_BROKEN_VEC),y)
84 CFLAGS += $(call cc-option,-mcpu=970)
85else
86 CFLAGS += $(call cc-option,-mcpu=power4)
87endif
88else
89 CFLAGS += $(call cc-option,-mcpu=power4)
90endif
91else
92 CFLAGS += $(call cc-option,-mtune=power4)
93endif
94endif
95
96# No AltiVec instruction when building kernel
97CFLAGS += $(call cc-option,-mno-altivec)
98
99# Enable unit-at-a-time mode when possible. It shrinks the
100# kernel considerably.
101CFLAGS += $(call cc-option,-funit-at-a-time)
102
103ifndef CONFIG_FSL_BOOKE
104CFLAGS += -mstring
105endif
106
107cpu-as-$(CONFIG_PPC64BRIDGE) += -Wa,-mppc64bridge
108cpu-as-$(CONFIG_4xx) += -Wa,-m405
109cpu-as-$(CONFIG_6xx) += -Wa,-maltivec
110cpu-as-$(CONFIG_POWER4) += -Wa,-maltivec
111cpu-as-$(CONFIG_E500) += -Wa,-me500
112cpu-as-$(CONFIG_E200) += -Wa,-me200
113
114AFLAGS += $(cpu-as-y)
115CFLAGS += $(cpu-as-y)
116
117# Default to the common case.
118KBUILD_DEFCONFIG := common_defconfig
119
120head-y := arch/powerpc/kernel/head_32.o
121head-$(CONFIG_PPC64) := arch/powerpc/kernel/head_64.o
122head-$(CONFIG_8xx) := arch/powerpc/kernel/head_8xx.o
123head-$(CONFIG_4xx) := arch/powerpc/kernel/head_4xx.o
124head-$(CONFIG_44x) := arch/powerpc/kernel/head_44x.o
125head-$(CONFIG_FSL_BOOKE) := arch/powerpc/kernel/head_fsl_booke.o
126
127head-$(CONFIG_PPC64) += arch/powerpc/kernel/entry_64.o
128head-$(CONFIG_PPC_FPU) += arch/powerpc/kernel/fpu.o
129
130core-y += arch/powerpc/kernel/ \
131 arch/$(OLDARCH)/kernel/ \
132 arch/powerpc/mm/ \
133 arch/powerpc/lib/ \
134 arch/powerpc/sysdev/ \
135 arch/powerpc/platforms/
136core-$(CONFIG_MATH_EMULATION) += arch/ppc/math-emu/
137core-$(CONFIG_XMON) += arch/powerpc/xmon/
138core-$(CONFIG_APUS) += arch/ppc/amiga/
139drivers-$(CONFIG_8xx) += arch/ppc/8xx_io/
140drivers-$(CONFIG_4xx) += arch/ppc/4xx_io/
141drivers-$(CONFIG_CPM2) += arch/ppc/8260_io/
142
143drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/
144
145defaultimage-$(CONFIG_PPC32) := uImage zImage
146defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux
147defaultimage-$(CONFIG_PPC_PSERIES) := zImage
148KBUILD_IMAGE := $(defaultimage-y)
149all: $(KBUILD_IMAGE)
150
151CPPFLAGS_vmlinux.lds := -Upowerpc
152
153# All the instructions talk about "make bzImage".
154bzImage: zImage
155
156BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm
157
158.PHONY: $(BOOT_TARGETS)
159
160boot := arch/$(OLDARCH)/boot
161
162# urk
163ifeq ($(CONFIG_PPC64),y)
164$(BOOT_TARGETS): vmlinux
165 $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
166else
167$(BOOT_TARGETS): vmlinux
168 $(Q)$(MAKE) ARCH=ppc $(build)=$(boot) $@
169endif
170
171uImage: vmlinux
172 $(Q)$(MAKE) ARCH=$(OLDARCH) $(build)=$(boot)/images $(boot)/images/$@
173
174define archhelp
175 @echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/images/zImage.*)'
176 @echo ' uImage - Create a bootable image for U-Boot / PPCBoot'
177 @echo ' install - Install kernel using'
178 @echo ' (your) ~/bin/installkernel or'
179 @echo ' (distribution) /sbin/installkernel or'
180 @echo ' install to $$(INSTALL_PATH) and run lilo'
181 @echo ' *_defconfig - Select default config from arch/$(ARCH)/ppc/configs'
182endef
183
184archclean:
185 $(Q)$(MAKE) $(clean)=$(boot)
186 # Temporary hack until we have migrated to asm-powerpc
187 $(Q)rm -rf arch/$(ARCH)/include
188
189archprepare: checkbin
190
191# Temporary hack until we have migrated to asm-powerpc
192include/asm: arch/$(ARCH)/include/asm
193arch/$(ARCH)/include/asm:
194 $(Q)if [ ! -d arch/$(ARCH)/include ]; then mkdir -p arch/$(ARCH)/include; fi
195 $(Q)ln -fsn $(srctree)/include/asm-$(OLDARCH) arch/$(ARCH)/include/asm
196
197# Use the file '.tmp_gas_check' for binutils tests, as gas won't output
198# to stdout and these checks are run even on install targets.
199TOUT := .tmp_gas_check
200# Ensure this is binutils 2.12.1 (or 2.12.90.0.7) or later for altivec
201# instructions.
202# gcc-3.4 and binutils-2.14 are a fatal combination.
203GCC_VERSION := $(call cc-version)
204
205checkbin:
206 @if test "$(GCC_VERSION)" = "0304" ; then \
207 if ! /bin/echo mftb 5 | $(AS) -v -mppc -many -o $(TOUT) >/dev/null 2>&1 ; then \
208 echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '; \
209 echo 'correctly with gcc-3.4 and your version of binutils.'; \
210 echo '*** Please upgrade your binutils or downgrade your gcc'; \
211 false; \
212 fi ; \
213 fi
214 @if ! /bin/echo dssall | $(AS) -many -o $(TOUT) >/dev/null 2>&1 ; then \
215 echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build ' ; \
216 echo 'correctly with old versions of binutils.' ; \
217 echo '*** Please upgrade your binutils to 2.12.1 or newer' ; \
218 false ; \
219 fi
220
221CLEAN_FILES += $(TOUT)
222
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
new file mode 100644
index 000000000000..572d4f5eaacb
--- /dev/null
+++ b/arch/powerpc/kernel/Makefile
@@ -0,0 +1,56 @@
1#
2# Makefile for the linux kernel.
3#
4
5ifeq ($(CONFIG_PPC64),y)
6EXTRA_CFLAGS += -mno-minimal-toc
7endif
8ifeq ($(CONFIG_PPC32),y)
9CFLAGS_prom_init.o += -fPIC
10CFLAGS_btext.o += -fPIC
11endif
12
13obj-y := semaphore.o cputable.o ptrace.o syscalls.o \
14 signal_32.o pmc.o
15obj-$(CONFIG_PPC64) += setup_64.o binfmt_elf32.o sys_ppc32.o \
16 ptrace32.o systbl.o
17obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o
18obj-$(CONFIG_POWER4) += idle_power4.o
19obj-$(CONFIG_PPC_OF) += of_device.o
20obj-$(CONFIG_PPC_RTAS) += rtas.o
21obj-$(CONFIG_IBMVIO) += vio.o
22
23ifeq ($(CONFIG_PPC_MERGE),y)
24
25extra-$(CONFIG_PPC_STD_MMU) := head_32.o
26extra-$(CONFIG_PPC64) := head_64.o
27extra-$(CONFIG_40x) := head_4xx.o
28extra-$(CONFIG_44x) := head_44x.o
29extra-$(CONFIG_FSL_BOOKE) := head_fsl_booke.o
30extra-$(CONFIG_8xx) := head_8xx.o
31extra-y += vmlinux.lds
32
33obj-y += process.o init_task.o time.o \
34 prom.o traps.o setup-common.o
35obj-$(CONFIG_PPC32) += entry_32.o setup_32.o misc_32.o systbl.o
36obj-$(CONFIG_PPC64) += misc_64.o
37obj-$(CONFIG_PPC_OF) += prom_init.o
38obj-$(CONFIG_MODULES) += ppc_ksyms.o
39obj-$(CONFIG_BOOTX_TEXT) += btext.o
40obj-$(CONFIG_6xx) += idle_6xx.o
41
42ifeq ($(CONFIG_PPC_ISERIES),y)
43$(obj)/head_64.o: $(obj)/lparmap.s
44AFLAGS_head_64.o += -I$(obj)
45endif
46
47else
48# stuff used from here for ARCH=ppc or ARCH=ppc64
49obj-$(CONFIG_PPC64) += traps.o process.o init_task.o time.o \
50 setup-common.o
51
52
53endif
54
55extra-$(CONFIG_PPC_FPU) += fpu.o
56extra-$(CONFIG_PPC64) += entry_64.o
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
new file mode 100644
index 000000000000..330cd783206f
--- /dev/null
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -0,0 +1,273 @@
1/*
2 * This program is used to generate definitions needed by
3 * assembly language modules.
4 *
5 * We use the technique used in the OSF Mach kernel code:
6 * generate asm statements containing #defines,
7 * compile this file to assembler, and then extract the
8 * #defines from the assembly-language output.
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
14 */
15
16#include <linux/config.h>
17#include <linux/signal.h>
18#include <linux/sched.h>
19#include <linux/kernel.h>
20#include <linux/errno.h>
21#include <linux/string.h>
22#include <linux/types.h>
23#include <linux/mman.h>
24#include <linux/mm.h>
25#ifdef CONFIG_PPC64
26#include <linux/time.h>
27#include <linux/hardirq.h>
28#else
29#include <linux/ptrace.h>
30#include <linux/suspend.h>
31#endif
32
33#include <asm/io.h>
34#include <asm/page.h>
35#include <asm/pgtable.h>
36#include <asm/processor.h>
37#include <asm/cputable.h>
38#include <asm/thread_info.h>
39#include <asm/rtas.h>
40#ifdef CONFIG_PPC64
41#include <asm/paca.h>
42#include <asm/lppaca.h>
43#include <asm/iSeries/HvLpEvent.h>
44#include <asm/cache.h>
45#include <asm/systemcfg.h>
46#include <asm/compat.h>
47#endif
48
49#define DEFINE(sym, val) \
50 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
51
52#define BLANK() asm volatile("\n->" : : )
53
54int main(void)
55{
56 DEFINE(THREAD, offsetof(struct task_struct, thread));
57 DEFINE(MM, offsetof(struct task_struct, mm));
58#ifdef CONFIG_PPC64
59 DEFINE(AUDITCONTEXT, offsetof(struct task_struct, audit_context));
60#else
61 DEFINE(THREAD_INFO, offsetof(struct task_struct, thread_info));
62 DEFINE(PTRACE, offsetof(struct task_struct, ptrace));
63#endif /* CONFIG_PPC64 */
64
65 DEFINE(KSP, offsetof(struct thread_struct, ksp));
66 DEFINE(PT_REGS, offsetof(struct thread_struct, regs));
67 DEFINE(THREAD_FPEXC_MODE, offsetof(struct thread_struct, fpexc_mode));
68 DEFINE(THREAD_FPR0, offsetof(struct thread_struct, fpr[0]));
69 DEFINE(THREAD_FPSCR, offsetof(struct thread_struct, fpscr));
70#ifdef CONFIG_ALTIVEC
71 DEFINE(THREAD_VR0, offsetof(struct thread_struct, vr[0]));
72 DEFINE(THREAD_VRSAVE, offsetof(struct thread_struct, vrsave));
73 DEFINE(THREAD_VSCR, offsetof(struct thread_struct, vscr));
74 DEFINE(THREAD_USED_VR, offsetof(struct thread_struct, used_vr));
75#endif /* CONFIG_ALTIVEC */
76#ifdef CONFIG_PPC64
77 DEFINE(KSP_VSID, offsetof(struct thread_struct, ksp_vsid));
78#else /* CONFIG_PPC64 */
79 DEFINE(PGDIR, offsetof(struct thread_struct, pgdir));
80 DEFINE(LAST_SYSCALL, offsetof(struct thread_struct, last_syscall));
81#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
82 DEFINE(THREAD_DBCR0, offsetof(struct thread_struct, dbcr0));
83 DEFINE(PT_PTRACED, PT_PTRACED);
84#endif
85#ifdef CONFIG_SPE
86 DEFINE(THREAD_EVR0, offsetof(struct thread_struct, evr[0]));
87 DEFINE(THREAD_ACC, offsetof(struct thread_struct, acc));
88 DEFINE(THREAD_SPEFSCR, offsetof(struct thread_struct, spefscr));
89 DEFINE(THREAD_USED_SPE, offsetof(struct thread_struct, used_spe));
90#endif /* CONFIG_SPE */
91#endif /* CONFIG_PPC64 */
92
93 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
94 DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
95 DEFINE(TI_SC_NOERR, offsetof(struct thread_info, syscall_noerror));
96#ifdef CONFIG_PPC32
97 DEFINE(TI_TASK, offsetof(struct thread_info, task));
98 DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain));
99 DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
100#endif /* CONFIG_PPC32 */
101
102#ifdef CONFIG_PPC64
103 DEFINE(DCACHEL1LINESIZE, offsetof(struct ppc64_caches, dline_size));
104 DEFINE(DCACHEL1LOGLINESIZE, offsetof(struct ppc64_caches, log_dline_size));
105 DEFINE(DCACHEL1LINESPERPAGE, offsetof(struct ppc64_caches, dlines_per_page));
106 DEFINE(ICACHEL1LINESIZE, offsetof(struct ppc64_caches, iline_size));
107 DEFINE(ICACHEL1LOGLINESIZE, offsetof(struct ppc64_caches, log_iline_size));
108 DEFINE(ICACHEL1LINESPERPAGE, offsetof(struct ppc64_caches, ilines_per_page));
109 DEFINE(PLATFORM, offsetof(struct systemcfg, platform));
110 DEFINE(PLATFORM_LPAR, PLATFORM_LPAR);
111
112 /* paca */
113 DEFINE(PACA_SIZE, sizeof(struct paca_struct));
114 DEFINE(PACAPACAINDEX, offsetof(struct paca_struct, paca_index));
115 DEFINE(PACAPROCSTART, offsetof(struct paca_struct, cpu_start));
116 DEFINE(PACAKSAVE, offsetof(struct paca_struct, kstack));
117 DEFINE(PACACURRENT, offsetof(struct paca_struct, __current));
118 DEFINE(PACASAVEDMSR, offsetof(struct paca_struct, saved_msr));
119 DEFINE(PACASTABREAL, offsetof(struct paca_struct, stab_real));
120 DEFINE(PACASTABVIRT, offsetof(struct paca_struct, stab_addr));
121 DEFINE(PACASTABRR, offsetof(struct paca_struct, stab_rr));
122 DEFINE(PACAR1, offsetof(struct paca_struct, saved_r1));
123 DEFINE(PACATOC, offsetof(struct paca_struct, kernel_toc));
124 DEFINE(PACAPROCENABLED, offsetof(struct paca_struct, proc_enabled));
125 DEFINE(PACASLBCACHE, offsetof(struct paca_struct, slb_cache));
126 DEFINE(PACASLBCACHEPTR, offsetof(struct paca_struct, slb_cache_ptr));
127 DEFINE(PACACONTEXTID, offsetof(struct paca_struct, context.id));
128#ifdef CONFIG_HUGETLB_PAGE
129 DEFINE(PACALOWHTLBAREAS, offsetof(struct paca_struct, context.low_htlb_areas));
130 DEFINE(PACAHIGHHTLBAREAS, offsetof(struct paca_struct, context.high_htlb_areas));
131#endif /* CONFIG_HUGETLB_PAGE */
132 DEFINE(PACADEFAULTDECR, offsetof(struct paca_struct, default_decr));
133 DEFINE(PACA_EXGEN, offsetof(struct paca_struct, exgen));
134 DEFINE(PACA_EXMC, offsetof(struct paca_struct, exmc));
135 DEFINE(PACA_EXSLB, offsetof(struct paca_struct, exslb));
136 DEFINE(PACA_EXDSI, offsetof(struct paca_struct, exdsi));
137 DEFINE(PACAEMERGSP, offsetof(struct paca_struct, emergency_sp));
138 DEFINE(PACALPPACA, offsetof(struct paca_struct, lppaca));
139 DEFINE(PACAHWCPUID, offsetof(struct paca_struct, hw_cpu_id));
140
141 DEFINE(LPPACASRR0, offsetof(struct lppaca, saved_srr0));
142 DEFINE(LPPACASRR1, offsetof(struct lppaca, saved_srr1));
143 DEFINE(LPPACAANYINT, offsetof(struct lppaca, int_dword.any_int));
144 DEFINE(LPPACADECRINT, offsetof(struct lppaca, int_dword.fields.decr_int));
145#endif /* CONFIG_PPC64 */
146
147 /* RTAS */
148 DEFINE(RTASBASE, offsetof(struct rtas_t, base));
149 DEFINE(RTASENTRY, offsetof(struct rtas_t, entry));
150
151 /* Interrupt register frame */
152 DEFINE(STACK_FRAME_OVERHEAD, STACK_FRAME_OVERHEAD);
153#ifndef CONFIG_PPC64
154 DEFINE(INT_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs));
155#else /* CONFIG_PPC64 */
156 DEFINE(SWITCH_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs));
157 /* 288 = # of volatile regs, int & fp, for leaf routines */
158 /* which do not stack a frame. See the PPC64 ABI. */
159 DEFINE(INT_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 288);
160 /* Create extra stack space for SRR0 and SRR1 when calling prom/rtas. */
161 DEFINE(PROM_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 16);
162 DEFINE(RTAS_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 16);
163#endif /* CONFIG_PPC64 */
164 DEFINE(GPR0, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[0]));
165 DEFINE(GPR1, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[1]));
166 DEFINE(GPR2, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[2]));
167 DEFINE(GPR3, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[3]));
168 DEFINE(GPR4, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[4]));
169 DEFINE(GPR5, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[5]));
170 DEFINE(GPR6, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[6]));
171 DEFINE(GPR7, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[7]));
172 DEFINE(GPR8, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[8]));
173 DEFINE(GPR9, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[9]));
174 DEFINE(GPR10, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[10]));
175 DEFINE(GPR11, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[11]));
176 DEFINE(GPR12, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[12]));
177 DEFINE(GPR13, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[13]));
178#ifndef CONFIG_PPC64
179 DEFINE(GPR14, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[14]));
180 DEFINE(GPR15, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[15]));
181 DEFINE(GPR16, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[16]));
182 DEFINE(GPR17, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[17]));
183 DEFINE(GPR18, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[18]));
184 DEFINE(GPR19, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[19]));
185 DEFINE(GPR20, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[20]));
186 DEFINE(GPR21, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[21]));
187 DEFINE(GPR22, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[22]));
188 DEFINE(GPR23, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[23]));
189 DEFINE(GPR24, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[24]));
190 DEFINE(GPR25, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[25]));
191 DEFINE(GPR26, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[26]));
192 DEFINE(GPR27, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[27]));
193 DEFINE(GPR28, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[28]));
194 DEFINE(GPR29, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[29]));
195 DEFINE(GPR30, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[30]));
196 DEFINE(GPR31, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[31]));
197#endif /* CONFIG_PPC64 */
198 /*
199 * Note: these symbols include _ because they overlap with special
200 * register names
201 */
202 DEFINE(_NIP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, nip));
203 DEFINE(_MSR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, msr));
204 DEFINE(_CTR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, ctr));
205 DEFINE(_LINK, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, link));
206 DEFINE(_CCR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, ccr));
207 DEFINE(_XER, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, xer));
208 DEFINE(_DAR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dar));
209 DEFINE(_DSISR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dsisr));
210 DEFINE(ORIG_GPR3, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, orig_gpr3));
211 DEFINE(RESULT, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, result));
212 DEFINE(_TRAP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, trap));
213#ifndef CONFIG_PPC64
214 DEFINE(_MQ, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, mq));
215 /*
216 * The PowerPC 400-class & Book-E processors have neither the DAR
217 * nor the DSISR SPRs. Hence, we overload them to hold the similar
218 * DEAR and ESR SPRs for such processors. For critical interrupts
219 * we use them to hold SRR0 and SRR1.
220 */
221 DEFINE(_DEAR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dar));
222 DEFINE(_ESR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dsisr));
223#else /* CONFIG_PPC64 */
224 DEFINE(SOFTE, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, softe));
225
226 /* These _only_ to be used with {PROM,RTAS}_FRAME_SIZE!!! */
227 DEFINE(_SRR0, STACK_FRAME_OVERHEAD+sizeof(struct pt_regs));
228 DEFINE(_SRR1, STACK_FRAME_OVERHEAD+sizeof(struct pt_regs)+8);
229#endif /* CONFIG_PPC64 */
230
231 DEFINE(CLONE_VM, CLONE_VM);
232 DEFINE(CLONE_UNTRACED, CLONE_UNTRACED);
233
234#ifndef CONFIG_PPC64
235 DEFINE(MM_PGD, offsetof(struct mm_struct, pgd));
236#endif /* ! CONFIG_PPC64 */
237
238 /* About the CPU features table */
239 DEFINE(CPU_SPEC_ENTRY_SIZE, sizeof(struct cpu_spec));
240 DEFINE(CPU_SPEC_PVR_MASK, offsetof(struct cpu_spec, pvr_mask));
241 DEFINE(CPU_SPEC_PVR_VALUE, offsetof(struct cpu_spec, pvr_value));
242 DEFINE(CPU_SPEC_FEATURES, offsetof(struct cpu_spec, cpu_features));
243 DEFINE(CPU_SPEC_SETUP, offsetof(struct cpu_spec, cpu_setup));
244
245#ifndef CONFIG_PPC64
246 DEFINE(pbe_address, offsetof(struct pbe, address));
247 DEFINE(pbe_orig_address, offsetof(struct pbe, orig_address));
248 DEFINE(pbe_next, offsetof(struct pbe, next));
249
250 DEFINE(TASK_SIZE, TASK_SIZE);
251 DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28);
252#else /* CONFIG_PPC64 */
253 /* systemcfg offsets for use by vdso */
254 DEFINE(CFG_TB_ORIG_STAMP, offsetof(struct systemcfg, tb_orig_stamp));
255 DEFINE(CFG_TB_TICKS_PER_SEC, offsetof(struct systemcfg, tb_ticks_per_sec));
256 DEFINE(CFG_TB_TO_XS, offsetof(struct systemcfg, tb_to_xs));
257 DEFINE(CFG_STAMP_XSEC, offsetof(struct systemcfg, stamp_xsec));
258 DEFINE(CFG_TB_UPDATE_COUNT, offsetof(struct systemcfg, tb_update_count));
259 DEFINE(CFG_TZ_MINUTEWEST, offsetof(struct systemcfg, tz_minuteswest));
260 DEFINE(CFG_TZ_DSTTIME, offsetof(struct systemcfg, tz_dsttime));
261 DEFINE(CFG_SYSCALL_MAP32, offsetof(struct systemcfg, syscall_map_32));
262 DEFINE(CFG_SYSCALL_MAP64, offsetof(struct systemcfg, syscall_map_64));
263
264 /* timeval/timezone offsets for use by vdso */
265 DEFINE(TVAL64_TV_SEC, offsetof(struct timeval, tv_sec));
266 DEFINE(TVAL64_TV_USEC, offsetof(struct timeval, tv_usec));
267 DEFINE(TVAL32_TV_SEC, offsetof(struct compat_timeval, tv_sec));
268 DEFINE(TVAL32_TV_USEC, offsetof(struct compat_timeval, tv_usec));
269 DEFINE(TZONE_TZ_MINWEST, offsetof(struct timezone, tz_minuteswest));
270 DEFINE(TZONE_TZ_DSTTIME, offsetof(struct timezone, tz_dsttime));
271#endif /* CONFIG_PPC64 */
272 return 0;
273}
diff --git a/arch/ppc64/kernel/binfmt_elf32.c b/arch/powerpc/kernel/binfmt_elf32.c
index fadc699a0497..8ad6b0f33651 100644
--- a/arch/ppc64/kernel/binfmt_elf32.c
+++ b/arch/powerpc/kernel/binfmt_elf32.c
@@ -70,9 +70,6 @@ cputime_to_compat_timeval(const cputime_t cputime, struct compat_timeval *value)
70 value->tv_sec = jiffies / HZ; 70 value->tv_sec = jiffies / HZ;
71} 71}
72 72
73extern void start_thread32(struct pt_regs *, unsigned long, unsigned long);
74#undef start_thread
75#define start_thread start_thread32
76#define init_elf_binfmt init_elf32_binfmt 73#define init_elf_binfmt init_elf32_binfmt
77 74
78#include "../../../fs/binfmt_elf.c" 75#include "../../../fs/binfmt_elf.c"
diff --git a/arch/powerpc/kernel/btext.c b/arch/powerpc/kernel/btext.c
new file mode 100644
index 000000000000..bdfba92b2b38
--- /dev/null
+++ b/arch/powerpc/kernel/btext.c
@@ -0,0 +1,853 @@
1/*
2 * Procedures for drawing on the screen early on in the boot process.
3 *
4 * Benjamin Herrenschmidt <benh@kernel.crashing.org>
5 */
6#include <linux/config.h>
7#include <linux/kernel.h>
8#include <linux/string.h>
9#include <linux/init.h>
10#include <linux/module.h>
11
12#include <asm/sections.h>
13#include <asm/prom.h>
14#include <asm/btext.h>
15#include <asm/prom.h>
16#include <asm/page.h>
17#include <asm/mmu.h>
18#include <asm/pgtable.h>
19#include <asm/io.h>
20#include <asm/lmb.h>
21#include <asm/processor.h>
22
23#define NO_SCROLL
24
25#ifndef NO_SCROLL
26static void scrollscreen(void);
27#endif
28
29static void draw_byte(unsigned char c, long locX, long locY);
30static void draw_byte_32(unsigned char *bits, unsigned int *base, int rb);
31static void draw_byte_16(unsigned char *bits, unsigned int *base, int rb);
32static void draw_byte_8(unsigned char *bits, unsigned int *base, int rb);
33
34static int g_loc_X;
35static int g_loc_Y;
36static int g_max_loc_X;
37static int g_max_loc_Y;
38
39static int dispDeviceRowBytes;
40static int dispDeviceDepth;
41static int dispDeviceRect[4];
42static unsigned char *dispDeviceBase, *logicalDisplayBase;
43
44unsigned long disp_BAT[2] __initdata = {0, 0};
45
46#define cmapsz (16*256)
47
48static unsigned char vga_font[cmapsz];
49
50int boot_text_mapped;
51int force_printk_to_btext = 0;
52
53#ifdef CONFIG_PPC32
54/* Calc BAT values for mapping the display and store them
55 * in disp_BAT. Those values are then used from head.S to map
56 * the display during identify_machine() and MMU_Init()
57 *
58 * The display is mapped to virtual address 0xD0000000, rather
59 * than 1:1, because some some CHRP machines put the frame buffer
60 * in the region starting at 0xC0000000 (KERNELBASE).
61 * This mapping is temporary and will disappear as soon as the
62 * setup done by MMU_Init() is applied.
63 *
64 * For now, we align the BAT and then map 8Mb on 601 and 16Mb
65 * on other PPCs. This may cause trouble if the framebuffer
66 * is really badly aligned, but I didn't encounter this case
67 * yet.
68 */
69void __init
70btext_prepare_BAT(void)
71{
72 unsigned long vaddr = KERNELBASE + 0x10000000;
73 unsigned long addr;
74 unsigned long lowbits;
75
76 addr = (unsigned long)dispDeviceBase;
77 if (!addr) {
78 boot_text_mapped = 0;
79 return;
80 }
81 if (PVR_VER(mfspr(SPRN_PVR)) != 1) {
82 /* 603, 604, G3, G4, ... */
83 lowbits = addr & ~0xFF000000UL;
84 addr &= 0xFF000000UL;
85 disp_BAT[0] = vaddr | (BL_16M<<2) | 2;
86 disp_BAT[1] = addr | (_PAGE_NO_CACHE | _PAGE_GUARDED | BPP_RW);
87 } else {
88 /* 601 */
89 lowbits = addr & ~0xFF800000UL;
90 addr &= 0xFF800000UL;
91 disp_BAT[0] = vaddr | (_PAGE_NO_CACHE | PP_RWXX) | 4;
92 disp_BAT[1] = addr | BL_8M | 0x40;
93 }
94 logicalDisplayBase = (void *) (vaddr + lowbits);
95}
96#endif
97
98/* This function will enable the early boot text when doing OF booting. This
99 * way, xmon output should work too
100 */
101void __init
102btext_setup_display(int width, int height, int depth, int pitch,
103 unsigned long address)
104{
105 g_loc_X = 0;
106 g_loc_Y = 0;
107 g_max_loc_X = width / 8;
108 g_max_loc_Y = height / 16;
109 logicalDisplayBase = (unsigned char *)address;
110 dispDeviceBase = (unsigned char *)address;
111 dispDeviceRowBytes = pitch;
112 dispDeviceDepth = depth;
113 dispDeviceRect[0] = dispDeviceRect[1] = 0;
114 dispDeviceRect[2] = width;
115 dispDeviceRect[3] = height;
116 boot_text_mapped = 1;
117}
118
119/* Here's a small text engine to use during early boot
120 * or for debugging purposes
121 *
122 * todo:
123 *
124 * - build some kind of vgacon with it to enable early printk
125 * - move to a separate file
126 * - add a few video driver hooks to keep in sync with display
127 * changes.
128 */
129
130void map_boot_text(void)
131{
132 unsigned long base, offset, size;
133 unsigned char *vbase;
134
135 /* By default, we are no longer mapped */
136 boot_text_mapped = 0;
137 if (dispDeviceBase == 0)
138 return;
139 base = ((unsigned long) dispDeviceBase) & 0xFFFFF000UL;
140 offset = ((unsigned long) dispDeviceBase) - base;
141 size = dispDeviceRowBytes * dispDeviceRect[3] + offset
142 + dispDeviceRect[0];
143 vbase = __ioremap(base, size, _PAGE_NO_CACHE);
144 if (vbase == 0)
145 return;
146 logicalDisplayBase = vbase + offset;
147 boot_text_mapped = 1;
148}
149
150int btext_initialize(struct device_node *np)
151{
152 unsigned int width, height, depth, pitch;
153 unsigned long address = 0;
154 u32 *prop;
155
156 prop = (u32 *)get_property(np, "width", NULL);
157 if (prop == NULL)
158 return -EINVAL;
159 width = *prop;
160 prop = (u32 *)get_property(np, "height", NULL);
161 if (prop == NULL)
162 return -EINVAL;
163 height = *prop;
164 prop = (u32 *)get_property(np, "depth", NULL);
165 if (prop == NULL)
166 return -EINVAL;
167 depth = *prop;
168 pitch = width * ((depth + 7) / 8);
169 prop = (u32 *)get_property(np, "linebytes", NULL);
170 if (prop)
171 pitch = *prop;
172 if (pitch == 1)
173 pitch = 0x1000;
174 prop = (u32 *)get_property(np, "address", NULL);
175 if (prop)
176 address = *prop;
177
178 /* FIXME: Add support for PCI reg properties */
179
180 if (address == 0)
181 return -EINVAL;
182
183 g_loc_X = 0;
184 g_loc_Y = 0;
185 g_max_loc_X = width / 8;
186 g_max_loc_Y = height / 16;
187 logicalDisplayBase = (unsigned char *)address;
188 dispDeviceBase = (unsigned char *)address;
189 dispDeviceRowBytes = pitch;
190 dispDeviceDepth = depth;
191 dispDeviceRect[0] = dispDeviceRect[1] = 0;
192 dispDeviceRect[2] = width;
193 dispDeviceRect[3] = height;
194
195 map_boot_text();
196
197 return 0;
198}
199
200void __init init_boot_display(void)
201{
202 char *name;
203 struct device_node *np = NULL;
204 int rc = -ENODEV;
205
206 printk("trying to initialize btext ...\n");
207
208 name = (char *)get_property(of_chosen, "linux,stdout-path", NULL);
209 if (name != NULL) {
210 np = of_find_node_by_path(name);
211 if (np != NULL) {
212 if (strcmp(np->type, "display") != 0) {
213 printk("boot stdout isn't a display !\n");
214 of_node_put(np);
215 np = NULL;
216 }
217 }
218 }
219 if (np)
220 rc = btext_initialize(np);
221 if (rc == 0)
222 return;
223
224 for (np = NULL; (np = of_find_node_by_type(np, "display"));) {
225 if (get_property(np, "linux,opened", NULL)) {
226 printk("trying %s ...\n", np->full_name);
227 rc = btext_initialize(np);
228 printk("result: %d\n", rc);
229 }
230 if (rc == 0)
231 return;
232 }
233}
234
235/* Calc the base address of a given point (x,y) */
236static unsigned char * calc_base(int x, int y)
237{
238 unsigned char *base;
239
240 base = logicalDisplayBase;
241 if (base == 0)
242 base = dispDeviceBase;
243 base += (x + dispDeviceRect[0]) * (dispDeviceDepth >> 3);
244 base += (y + dispDeviceRect[1]) * dispDeviceRowBytes;
245 return base;
246}
247
248/* Adjust the display to a new resolution */
249void btext_update_display(unsigned long phys, int width, int height,
250 int depth, int pitch)
251{
252 if (dispDeviceBase == 0)
253 return;
254
255 /* check it's the same frame buffer (within 256MB) */
256 if ((phys ^ (unsigned long)dispDeviceBase) & 0xf0000000)
257 return;
258
259 dispDeviceBase = (__u8 *) phys;
260 dispDeviceRect[0] = 0;
261 dispDeviceRect[1] = 0;
262 dispDeviceRect[2] = width;
263 dispDeviceRect[3] = height;
264 dispDeviceDepth = depth;
265 dispDeviceRowBytes = pitch;
266 if (boot_text_mapped) {
267 iounmap(logicalDisplayBase);
268 boot_text_mapped = 0;
269 }
270 map_boot_text();
271 g_loc_X = 0;
272 g_loc_Y = 0;
273 g_max_loc_X = width / 8;
274 g_max_loc_Y = height / 16;
275}
276EXPORT_SYMBOL(btext_update_display);
277
278void btext_clearscreen(void)
279{
280 unsigned long *base = (unsigned long *)calc_base(0, 0);
281 unsigned long width = ((dispDeviceRect[2] - dispDeviceRect[0]) *
282 (dispDeviceDepth >> 3)) >> 3;
283 int i,j;
284
285 for (i=0; i<(dispDeviceRect[3] - dispDeviceRect[1]); i++)
286 {
287 unsigned long *ptr = base;
288 for(j=width; j; --j)
289 *(ptr++) = 0;
290 base += (dispDeviceRowBytes >> 3);
291 }
292}
293
294#ifndef NO_SCROLL
295static void scrollscreen(void)
296{
297 unsigned long *src = (unsigned long *)calc_base(0,16);
298 unsigned long *dst = (unsigned long *)calc_base(0,0);
299 unsigned long width = ((dispDeviceRect[2] - dispDeviceRect[0]) *
300 (dispDeviceDepth >> 3)) >> 3;
301 int i,j;
302
303 for (i=0; i<(dispDeviceRect[3] - dispDeviceRect[1] - 16); i++)
304 {
305 unsigned long *src_ptr = src;
306 unsigned long *dst_ptr = dst;
307 for(j=width; j; --j)
308 *(dst_ptr++) = *(src_ptr++);
309 src += (dispDeviceRowBytes >> 3);
310 dst += (dispDeviceRowBytes >> 3);
311 }
312 for (i=0; i<16; i++)
313 {
314 unsigned long *dst_ptr = dst;
315 for(j=width; j; --j)
316 *(dst_ptr++) = 0;
317 dst += (dispDeviceRowBytes >> 3);
318 }
319}
320#endif /* ndef NO_SCROLL */
321
322void btext_drawchar(char c)
323{
324 int cline = 0;
325#ifdef NO_SCROLL
326 int x;
327#endif
328 if (!boot_text_mapped)
329 return;
330
331 switch (c) {
332 case '\b':
333 if (g_loc_X > 0)
334 --g_loc_X;
335 break;
336 case '\t':
337 g_loc_X = (g_loc_X & -8) + 8;
338 break;
339 case '\r':
340 g_loc_X = 0;
341 break;
342 case '\n':
343 g_loc_X = 0;
344 g_loc_Y++;
345 cline = 1;
346 break;
347 default:
348 draw_byte(c, g_loc_X++, g_loc_Y);
349 }
350 if (g_loc_X >= g_max_loc_X) {
351 g_loc_X = 0;
352 g_loc_Y++;
353 cline = 1;
354 }
355#ifndef NO_SCROLL
356 while (g_loc_Y >= g_max_loc_Y) {
357 scrollscreen();
358 g_loc_Y--;
359 }
360#else
361 /* wrap around from bottom to top of screen so we don't
362 waste time scrolling each line. -- paulus. */
363 if (g_loc_Y >= g_max_loc_Y)
364 g_loc_Y = 0;
365 if (cline) {
366 for (x = 0; x < g_max_loc_X; ++x)
367 draw_byte(' ', x, g_loc_Y);
368 }
369#endif
370}
371
372void btext_drawstring(const char *c)
373{
374 if (!boot_text_mapped)
375 return;
376 while (*c)
377 btext_drawchar(*c++);
378}
379
380void btext_drawhex(unsigned long v)
381{
382 char *hex_table = "0123456789abcdef";
383
384 if (!boot_text_mapped)
385 return;
386#ifdef CONFIG_PPC64
387 btext_drawchar(hex_table[(v >> 60) & 0x0000000FUL]);
388 btext_drawchar(hex_table[(v >> 56) & 0x0000000FUL]);
389 btext_drawchar(hex_table[(v >> 52) & 0x0000000FUL]);
390 btext_drawchar(hex_table[(v >> 48) & 0x0000000FUL]);
391 btext_drawchar(hex_table[(v >> 44) & 0x0000000FUL]);
392 btext_drawchar(hex_table[(v >> 40) & 0x0000000FUL]);
393 btext_drawchar(hex_table[(v >> 36) & 0x0000000FUL]);
394 btext_drawchar(hex_table[(v >> 32) & 0x0000000FUL]);
395#endif
396 btext_drawchar(hex_table[(v >> 28) & 0x0000000FUL]);
397 btext_drawchar(hex_table[(v >> 24) & 0x0000000FUL]);
398 btext_drawchar(hex_table[(v >> 20) & 0x0000000FUL]);
399 btext_drawchar(hex_table[(v >> 16) & 0x0000000FUL]);
400 btext_drawchar(hex_table[(v >> 12) & 0x0000000FUL]);
401 btext_drawchar(hex_table[(v >> 8) & 0x0000000FUL]);
402 btext_drawchar(hex_table[(v >> 4) & 0x0000000FUL]);
403 btext_drawchar(hex_table[(v >> 0) & 0x0000000FUL]);
404 btext_drawchar(' ');
405}
406
407static void draw_byte(unsigned char c, long locX, long locY)
408{
409 unsigned char *base = calc_base(locX << 3, locY << 4);
410 unsigned char *font = &vga_font[((unsigned int)c) * 16];
411 int rb = dispDeviceRowBytes;
412
413 switch(dispDeviceDepth) {
414 case 24:
415 case 32:
416 draw_byte_32(font, (unsigned int *)base, rb);
417 break;
418 case 15:
419 case 16:
420 draw_byte_16(font, (unsigned int *)base, rb);
421 break;
422 case 8:
423 draw_byte_8(font, (unsigned int *)base, rb);
424 break;
425 }
426}
427
428static unsigned int expand_bits_8[16] = {
429 0x00000000,
430 0x000000ff,
431 0x0000ff00,
432 0x0000ffff,
433 0x00ff0000,
434 0x00ff00ff,
435 0x00ffff00,
436 0x00ffffff,
437 0xff000000,
438 0xff0000ff,
439 0xff00ff00,
440 0xff00ffff,
441 0xffff0000,
442 0xffff00ff,
443 0xffffff00,
444 0xffffffff
445};
446
447static unsigned int expand_bits_16[4] = {
448 0x00000000,
449 0x0000ffff,
450 0xffff0000,
451 0xffffffff
452};
453
454
455static void draw_byte_32(unsigned char *font, unsigned int *base, int rb)
456{
457 int l, bits;
458 int fg = 0xFFFFFFFFUL;
459 int bg = 0x00000000UL;
460
461 for (l = 0; l < 16; ++l)
462 {
463 bits = *font++;
464 base[0] = (-(bits >> 7) & fg) ^ bg;
465 base[1] = (-((bits >> 6) & 1) & fg) ^ bg;
466 base[2] = (-((bits >> 5) & 1) & fg) ^ bg;
467 base[3] = (-((bits >> 4) & 1) & fg) ^ bg;
468 base[4] = (-((bits >> 3) & 1) & fg) ^ bg;
469 base[5] = (-((bits >> 2) & 1) & fg) ^ bg;
470 base[6] = (-((bits >> 1) & 1) & fg) ^ bg;
471 base[7] = (-(bits & 1) & fg) ^ bg;
472 base = (unsigned int *) ((char *)base + rb);
473 }
474}
475
476static void draw_byte_16(unsigned char *font, unsigned int *base, int rb)
477{
478 int l, bits;
479 int fg = 0xFFFFFFFFUL;
480 int bg = 0x00000000UL;
481 unsigned int *eb = (int *)expand_bits_16;
482
483 for (l = 0; l < 16; ++l)
484 {
485 bits = *font++;
486 base[0] = (eb[bits >> 6] & fg) ^ bg;
487 base[1] = (eb[(bits >> 4) & 3] & fg) ^ bg;
488 base[2] = (eb[(bits >> 2) & 3] & fg) ^ bg;
489 base[3] = (eb[bits & 3] & fg) ^ bg;
490 base = (unsigned int *) ((char *)base + rb);
491 }
492}
493
494static void draw_byte_8(unsigned char *font, unsigned int *base, int rb)
495{
496 int l, bits;
497 int fg = 0x0F0F0F0FUL;
498 int bg = 0x00000000UL;
499 unsigned int *eb = (int *)expand_bits_8;
500
501 for (l = 0; l < 16; ++l)
502 {
503 bits = *font++;
504 base[0] = (eb[bits >> 4] & fg) ^ bg;
505 base[1] = (eb[bits & 0xf] & fg) ^ bg;
506 base = (unsigned int *) ((char *)base + rb);
507 }
508}
509
510static unsigned char vga_font[cmapsz] = {
5110x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5120x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81, 0x81, 0xbd,
5130x99, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xff,
5140xdb, 0xff, 0xff, 0xc3, 0xe7, 0xff, 0xff, 0x7e, 0x00, 0x00, 0x00, 0x00,
5150x00, 0x00, 0x00, 0x00, 0x6c, 0xfe, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10,
5160x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x7c, 0xfe,
5170x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
5180x3c, 0x3c, 0xe7, 0xe7, 0xe7, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
5190x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x7e, 0x18, 0x18, 0x3c,
5200x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c,
5210x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
5220xff, 0xff, 0xe7, 0xc3, 0xc3, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
5230x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x42, 0x42, 0x66, 0x3c, 0x00,
5240x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0x99, 0xbd,
5250xbd, 0x99, 0xc3, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x1e, 0x0e,
5260x1a, 0x32, 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00,
5270x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x7e, 0x18, 0x18,
5280x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x33, 0x3f, 0x30, 0x30, 0x30,
5290x30, 0x70, 0xf0, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x63,
5300x7f, 0x63, 0x63, 0x63, 0x63, 0x67, 0xe7, 0xe6, 0xc0, 0x00, 0x00, 0x00,
5310x00, 0x00, 0x00, 0x18, 0x18, 0xdb, 0x3c, 0xe7, 0x3c, 0xdb, 0x18, 0x18,
5320x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfe, 0xf8,
5330xf0, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x0e,
5340x1e, 0x3e, 0xfe, 0x3e, 0x1e, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00,
5350x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x00,
5360x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
5370x66, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xdb,
5380xdb, 0xdb, 0x7b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x00, 0x00, 0x00, 0x00,
5390x00, 0x7c, 0xc6, 0x60, 0x38, 0x6c, 0xc6, 0xc6, 0x6c, 0x38, 0x0c, 0xc6,
5400x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5410xfe, 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c,
5420x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00,
5430x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
5440x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
5450x18, 0x7e, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5460x00, 0x18, 0x0c, 0xfe, 0x0c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5470x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0xfe, 0x60, 0x30, 0x00, 0x00,
5480x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0,
5490xc0, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5500x00, 0x24, 0x66, 0xff, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5510x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x38, 0x7c, 0x7c, 0xfe, 0xfe, 0x00,
5520x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x7c, 0x7c,
5530x38, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5540x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5550x00, 0x00, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18,
5560x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x24, 0x00, 0x00, 0x00,
5570x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c,
5580x6c, 0xfe, 0x6c, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00,
5590x18, 0x18, 0x7c, 0xc6, 0xc2, 0xc0, 0x7c, 0x06, 0x06, 0x86, 0xc6, 0x7c,
5600x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0xc6, 0x0c, 0x18,
5610x30, 0x60, 0xc6, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c,
5620x6c, 0x38, 0x76, 0xdc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
5630x00, 0x30, 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5640x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30,
5650x30, 0x30, 0x18, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x18,
5660x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00,
5670x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x3c, 0xff, 0x3c, 0x66, 0x00, 0x00,
5680x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e,
5690x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5700x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00,
5710x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00,
5720x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5730x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5740x02, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00,
5750x00, 0x00, 0x7c, 0xc6, 0xc6, 0xce, 0xde, 0xf6, 0xe6, 0xc6, 0xc6, 0x7c,
5760x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38, 0x78, 0x18, 0x18, 0x18,
5770x18, 0x18, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6,
5780x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00,
5790x00, 0x00, 0x7c, 0xc6, 0x06, 0x06, 0x3c, 0x06, 0x06, 0x06, 0xc6, 0x7c,
5800x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x1c, 0x3c, 0x6c, 0xcc, 0xfe,
5810x0c, 0x0c, 0x0c, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0,
5820xc0, 0xc0, 0xfc, 0x06, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
5830x00, 0x00, 0x38, 0x60, 0xc0, 0xc0, 0xfc, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c,
5840x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc6, 0x06, 0x06, 0x0c, 0x18,
5850x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6,
5860xc6, 0xc6, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
5870x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x06, 0x06, 0x0c, 0x78,
5880x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00,
5890x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5900x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00,
5910x00, 0x00, 0x00, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x06,
5920x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00,
5930x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60,
5940x30, 0x18, 0x0c, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00,
5950x00, 0x00, 0x7c, 0xc6, 0xc6, 0x0c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18,
5960x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xde, 0xde,
5970xde, 0xdc, 0xc0, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38,
5980x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
5990x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x66, 0x66, 0x66, 0x66, 0xfc,
6000x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0,
6010xc0, 0xc2, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x6c,
6020x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x6c, 0xf8, 0x00, 0x00, 0x00, 0x00,
6030x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x62, 0x66, 0xfe,
6040x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68,
6050x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66,
6060xc2, 0xc0, 0xc0, 0xde, 0xc6, 0xc6, 0x66, 0x3a, 0x00, 0x00, 0x00, 0x00,
6070x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
6080x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18,
6090x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x0c,
6100x0c, 0x0c, 0x0c, 0x0c, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00,
6110x00, 0x00, 0xe6, 0x66, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0x66, 0xe6,
6120x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x60, 0x60, 0x60, 0x60, 0x60,
6130x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xe7,
6140xff, 0xff, 0xdb, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00,
6150x00, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0xc6,
6160x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
6170xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x66,
6180x66, 0x66, 0x7c, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00,
6190x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xd6, 0xde, 0x7c,
6200x0c, 0x0e, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x6c,
6210x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6,
6220xc6, 0x60, 0x38, 0x0c, 0x06, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
6230x00, 0x00, 0xff, 0xdb, 0x99, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
6240x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
6250xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3,
6260xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00,
6270x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xdb, 0xdb, 0xff, 0x66, 0x66,
6280x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0x66, 0x3c, 0x18, 0x18,
6290x3c, 0x66, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3,
6300xc3, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
6310x00, 0x00, 0xff, 0xc3, 0x86, 0x0c, 0x18, 0x30, 0x60, 0xc1, 0xc3, 0xff,
6320x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x30, 0x30, 0x30, 0x30, 0x30,
6330x30, 0x30, 0x30, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
6340xc0, 0xe0, 0x70, 0x38, 0x1c, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00,
6350x00, 0x00, 0x3c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x3c,
6360x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00,
6370x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6380x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
6390x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6400x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0c, 0x7c,
6410xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x60,
6420x60, 0x78, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x00, 0x00, 0x00, 0x00,
6430x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c,
6440x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x0c, 0x0c, 0x3c, 0x6c, 0xcc,
6450xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6460x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
6470x00, 0x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60, 0x60, 0x60, 0xf0,
6480x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc,
6490xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0xcc, 0x78, 0x00, 0x00, 0x00, 0xe0, 0x60,
6500x60, 0x6c, 0x76, 0x66, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00,
6510x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
6520x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x00, 0x0e, 0x06, 0x06,
6530x06, 0x06, 0x06, 0x06, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0xe0, 0x60,
6540x60, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00,
6550x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
6560x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0xff, 0xdb,
6570xdb, 0xdb, 0xdb, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6580x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00,
6590x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c,
6600x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66,
6610x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00,
6620x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0x0c, 0x1e, 0x00,
6630x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x76, 0x66, 0x60, 0x60, 0x60, 0xf0,
6640x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x60,
6650x38, 0x0c, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x30,
6660x30, 0xfc, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1c, 0x00, 0x00, 0x00, 0x00,
6670x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76,
6680x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0xc3,
6690xc3, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6700x00, 0xc3, 0xc3, 0xc3, 0xdb, 0xdb, 0xff, 0x66, 0x00, 0x00, 0x00, 0x00,
6710x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0xc3,
6720x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6,
6730xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00,
6740x00, 0xfe, 0xcc, 0x18, 0x30, 0x60, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00,
6750x00, 0x00, 0x0e, 0x18, 0x18, 0x18, 0x70, 0x18, 0x18, 0x18, 0x18, 0x0e,
6760x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18,
6770x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x18,
6780x18, 0x18, 0x0e, 0x18, 0x18, 0x18, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00,
6790x00, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6800x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6,
6810xc6, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66,
6820xc2, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, 0x3c, 0x0c, 0x06, 0x7c, 0x00, 0x00,
6830x00, 0x00, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76,
6840x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x00, 0x7c, 0xc6, 0xfe,
6850xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c,
6860x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
6870x00, 0x00, 0xcc, 0x00, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76,
6880x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0x78, 0x0c, 0x7c,
6890xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x38,
6900x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
6910x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x60, 0x60, 0x66, 0x3c, 0x0c, 0x06,
6920x3c, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xfe,
6930xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00,
6940x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
6950x00, 0x60, 0x30, 0x18, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c,
6960x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x38, 0x18, 0x18,
6970x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x66,
6980x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
6990x00, 0x60, 0x30, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
7000x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6,
7010xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x38, 0x00,
7020x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
7030x18, 0x30, 0x60, 0x00, 0xfe, 0x66, 0x60, 0x7c, 0x60, 0x60, 0x66, 0xfe,
7040x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x3b, 0x1b,
7050x7e, 0xd8, 0xdc, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x6c,
7060xcc, 0xcc, 0xfe, 0xcc, 0xcc, 0xcc, 0xcc, 0xce, 0x00, 0x00, 0x00, 0x00,
7070x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c,
7080x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x7c, 0xc6, 0xc6,
7090xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18,
7100x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
7110x00, 0x30, 0x78, 0xcc, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76,
7120x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0xcc, 0xcc, 0xcc,
7130xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00,
7140x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0x78, 0x00,
7150x00, 0xc6, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c,
7160x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
7170xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e,
7180xc3, 0xc0, 0xc0, 0xc0, 0xc3, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
7190x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60, 0x60, 0x60, 0xe6, 0xfc,
7200x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0xff, 0x18,
7210xff, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x66, 0x66,
7220x7c, 0x62, 0x66, 0x6f, 0x66, 0x66, 0x66, 0xf3, 0x00, 0x00, 0x00, 0x00,
7230x00, 0x0e, 0x1b, 0x18, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18,
7240xd8, 0x70, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0x78, 0x0c, 0x7c,
7250xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30,
7260x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
7270x00, 0x18, 0x30, 0x60, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c,
7280x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0xcc, 0xcc, 0xcc,
7290xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc,
7300x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00,
7310x76, 0xdc, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6,
7320x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x6c, 0x6c, 0x3e, 0x00, 0x7e, 0x00,
7330x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x6c,
7340x38, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7350x00, 0x00, 0x30, 0x30, 0x00, 0x30, 0x30, 0x60, 0xc0, 0xc6, 0xc6, 0x7c,
7360x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0,
7370xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7380x00, 0x00, 0xfe, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
7390x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30, 0x60, 0xce, 0x9b, 0x06,
7400x0c, 0x1f, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30,
7410x66, 0xce, 0x96, 0x3e, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18,
7420x00, 0x18, 0x18, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00,
7430x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x6c, 0xd8, 0x6c, 0x36, 0x00, 0x00,
7440x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x6c, 0x36,
7450x6c, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x44, 0x11, 0x44,
7460x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44,
7470x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa,
7480x55, 0xaa, 0x55, 0xaa, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77,
7490xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0x18, 0x18, 0x18, 0x18,
7500x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
7510x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0x18, 0x18, 0x18,
7520x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0xf8,
7530x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36,
7540x36, 0x36, 0x36, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
7550x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x36, 0x36, 0x36, 0x36,
7560x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x18, 0xf8,
7570x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36,
7580x36, 0xf6, 0x06, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
7590x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
7600x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, 0xf6,
7610x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
7620x36, 0xf6, 0x06, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7630x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xfe, 0x00, 0x00, 0x00, 0x00,
7640x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0xf8,
7650x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7660x00, 0x00, 0x00, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
7670x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00,
7680x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff,
7690x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7700x00, 0x00, 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
7710x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18,
7720x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
7730x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18,
7740x18, 0x18, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
7750x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18,
7760x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37,
7770x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
7780x36, 0x37, 0x30, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7790x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36,
7800x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf7, 0x00, 0xff,
7810x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7820x00, 0xff, 0x00, 0xf7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
7830x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36,
7840x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff,
7850x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36,
7860x36, 0xf7, 0x00, 0xf7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
7870x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00,
7880x00, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xff,
7890x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7900x00, 0xff, 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
7910x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x36, 0x36, 0x36, 0x36,
7920x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x3f,
7930x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18,
7940x18, 0x1f, 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7950x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18,
7960x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f,
7970x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
7980x36, 0x36, 0x36, 0xff, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
7990x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18,
8000x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8,
8010x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
8020x00, 0x00, 0x00, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
8030xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
8040xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
8050xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0,
8060xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,
8070x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,
8080x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
8090x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
8100x00, 0x76, 0xdc, 0xd8, 0xd8, 0xd8, 0xdc, 0x76, 0x00, 0x00, 0x00, 0x00,
8110x00, 0x00, 0x78, 0xcc, 0xcc, 0xcc, 0xd8, 0xcc, 0xc6, 0xc6, 0xc6, 0xcc,
8120x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc6, 0xc6, 0xc0, 0xc0, 0xc0,
8130xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
8140xfe, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00,
8150x00, 0x00, 0x00, 0xfe, 0xc6, 0x60, 0x30, 0x18, 0x30, 0x60, 0xc6, 0xfe,
8160x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xd8, 0xd8,
8170xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
8180x66, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xc0, 0x00, 0x00, 0x00,
8190x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
8200x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x18, 0x3c, 0x66, 0x66,
8210x66, 0x3c, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38,
8220x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00,
8230x00, 0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xc6, 0x6c, 0x6c, 0x6c, 0x6c, 0xee,
8240x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x30, 0x18, 0x0c, 0x3e, 0x66,
8250x66, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
8260x00, 0x7e, 0xdb, 0xdb, 0xdb, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
8270x00, 0x00, 0x00, 0x03, 0x06, 0x7e, 0xdb, 0xdb, 0xf3, 0x7e, 0x60, 0xc0,
8280x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x30, 0x60, 0x60, 0x7c, 0x60,
8290x60, 0x60, 0x30, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c,
8300xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
8310x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00,
8320x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18,
8330x18, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
8340x18, 0x0c, 0x06, 0x0c, 0x18, 0x30, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00,
8350x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x00, 0x7e,
8360x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x1b, 0x1b, 0x1b, 0x18, 0x18,
8370x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
8380x18, 0x18, 0x18, 0x18, 0xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00,
8390x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x7e, 0x00, 0x18, 0x18, 0x00,
8400x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x00,
8410x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x6c,
8420x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
8430x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00,
8440x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
8450x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0c, 0x0c,
8460x0c, 0x0c, 0x0c, 0xec, 0x6c, 0x6c, 0x3c, 0x1c, 0x00, 0x00, 0x00, 0x00,
8470x00, 0xd8, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00,
8480x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xd8, 0x30, 0x60, 0xc8, 0xf8, 0x00,
8490x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
8500x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00,
8510x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
8520x00, 0x00, 0x00, 0x00,
853};
diff --git a/arch/ppc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 6b76cf58d9e0..b91345fa0805 100644
--- a/arch/ppc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -1,8 +1,9 @@
1/* 1/*
2 * arch/ppc/kernel/cputable.c
3 *
4 * Copyright (C) 2001 Ben. Herrenschmidt (benh@kernel.crashing.org) 2 * Copyright (C) 2001 Ben. Herrenschmidt (benh@kernel.crashing.org)
5 * 3 *
4 * Modifications for ppc64:
5 * Copyright (C) 2003 Dave Engebretsen <engebret@us.ibm.com>
6 *
6 * This program is free software; you can redistribute it and/or 7 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License 8 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 9 * as published by the Free Software Foundation; either version
@@ -14,96 +15,302 @@
14#include <linux/sched.h> 15#include <linux/sched.h>
15#include <linux/threads.h> 16#include <linux/threads.h>
16#include <linux/init.h> 17#include <linux/init.h>
17#include <asm/cputable.h> 18#include <linux/module.h>
18 19
19struct cpu_spec* cur_cpu_spec[NR_CPUS]; 20#include <asm/oprofile_impl.h>
21#include <asm/cputable.h>
20 22
21extern void __setup_cpu_601(unsigned long offset, int cpu_nr, struct cpu_spec* spec); 23struct cpu_spec* cur_cpu_spec = NULL;
22extern void __setup_cpu_603(unsigned long offset, int cpu_nr, struct cpu_spec* spec); 24EXPORT_SYMBOL(cur_cpu_spec);
23extern void __setup_cpu_604(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
24extern void __setup_cpu_750(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
25extern void __setup_cpu_750cx(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
26extern void __setup_cpu_750fx(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
27extern void __setup_cpu_7400(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
28extern void __setup_cpu_7410(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
29extern void __setup_cpu_745x(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
30extern void __setup_cpu_power3(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
31extern void __setup_cpu_power4(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
32extern void __setup_cpu_ppc970(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
33extern void __setup_cpu_generic(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
34 25
35#define CLASSIC_PPC (!defined(CONFIG_8xx) && !defined(CONFIG_4xx) && \ 26/* NOTE:
36 !defined(CONFIG_POWER3) && !defined(CONFIG_POWER4) && \ 27 * Unlike ppc32, ppc64 will only call this once for the boot CPU, it's
37 !defined(CONFIG_BOOKE)) 28 * the responsibility of the appropriate CPU save/restore functions to
29 * eventually copy these settings over. Those save/restore aren't yet
30 * part of the cputable though. That has to be fixed for both ppc32
31 * and ppc64
32 */
33#ifdef CONFIG_PPC64
34extern void __setup_cpu_power3(unsigned long offset, struct cpu_spec* spec);
35extern void __setup_cpu_power4(unsigned long offset, struct cpu_spec* spec);
36extern void __setup_cpu_be(unsigned long offset, struct cpu_spec* spec);
37#else
38extern void __setup_cpu_603(unsigned long offset, struct cpu_spec* spec);
39extern void __setup_cpu_604(unsigned long offset, struct cpu_spec* spec);
40extern void __setup_cpu_750(unsigned long offset, struct cpu_spec* spec);
41extern void __setup_cpu_750cx(unsigned long offset, struct cpu_spec* spec);
42extern void __setup_cpu_750fx(unsigned long offset, struct cpu_spec* spec);
43extern void __setup_cpu_7400(unsigned long offset, struct cpu_spec* spec);
44extern void __setup_cpu_7410(unsigned long offset, struct cpu_spec* spec);
45extern void __setup_cpu_745x(unsigned long offset, struct cpu_spec* spec);
46#endif /* CONFIG_PPC32 */
47extern void __setup_cpu_ppc970(unsigned long offset, struct cpu_spec* spec);
38 48
39/* This table only contains "desktop" CPUs, it need to be filled with embedded 49/* This table only contains "desktop" CPUs, it need to be filled with embedded
40 * ones as well... 50 * ones as well...
41 */ 51 */
42#define COMMON_PPC (PPC_FEATURE_32 | PPC_FEATURE_HAS_FPU | \ 52#define COMMON_USER (PPC_FEATURE_32 | PPC_FEATURE_HAS_FPU | \
43 PPC_FEATURE_HAS_MMU) 53 PPC_FEATURE_HAS_MMU)
54#define COMMON_USER_PPC64 (COMMON_USER | PPC_FEATURE_64)
44 55
45/* We only set the altivec features if the kernel was compiled with altivec
46 * support
47 */
48#ifdef CONFIG_ALTIVEC
49#define CPU_FTR_ALTIVEC_COMP CPU_FTR_ALTIVEC
50#define PPC_FEATURE_ALTIVEC_COMP PPC_FEATURE_HAS_ALTIVEC
51#else
52#define CPU_FTR_ALTIVEC_COMP 0
53#define PPC_FEATURE_ALTIVEC_COMP 0
54#endif
55 56
56/* We only set the spe features if the kernel was compiled with 57/* We only set the spe features if the kernel was compiled with
57 * spe support 58 * spe support
58 */ 59 */
59#ifdef CONFIG_SPE 60#ifdef CONFIG_SPE
60#define PPC_FEATURE_SPE_COMP PPC_FEATURE_HAS_SPE 61#define PPC_FEATURE_SPE_COMP PPC_FEATURE_HAS_SPE
61#else 62#else
62#define PPC_FEATURE_SPE_COMP 0 63#define PPC_FEATURE_SPE_COMP 0
63#endif 64#endif
64 65
65/* We need to mark all pages as being coherent if we're SMP or we 66struct cpu_spec cpu_specs[] = {
66 * have a 74[45]x and an MPC107 host bridge. 67#ifdef CONFIG_PPC64
67 */ 68 { /* Power3 */
68#if defined(CONFIG_SMP) || defined(CONFIG_MPC10X_BRIDGE) 69 .pvr_mask = 0xffff0000,
69#define CPU_FTR_COMMON CPU_FTR_NEED_COHERENT 70 .pvr_value = 0x00400000,
70#else 71 .cpu_name = "POWER3 (630)",
71#define CPU_FTR_COMMON 0 72 .cpu_features = CPU_FTRS_POWER3,
73 .cpu_user_features = COMMON_USER_PPC64,
74 .icache_bsize = 128,
75 .dcache_bsize = 128,
76 .num_pmcs = 8,
77 .cpu_setup = __setup_cpu_power3,
78#ifdef CONFIG_OPROFILE
79 .oprofile_cpu_type = "ppc64/power3",
80 .oprofile_model = &op_model_rs64,
72#endif 81#endif
73 82 },
74/* The powersave features NAP & DOZE seems to confuse BDI when 83 { /* Power3+ */
75 debugging. So if a BDI is used, disable theses 84 .pvr_mask = 0xffff0000,
76 */ 85 .pvr_value = 0x00410000,
77#ifndef CONFIG_BDI_SWITCH 86 .cpu_name = "POWER3 (630+)",
78#define CPU_FTR_MAYBE_CAN_DOZE CPU_FTR_CAN_DOZE 87 .cpu_features = CPU_FTRS_POWER3,
79#define CPU_FTR_MAYBE_CAN_NAP CPU_FTR_CAN_NAP 88 .cpu_user_features = COMMON_USER_PPC64,
89 .icache_bsize = 128,
90 .dcache_bsize = 128,
91 .num_pmcs = 8,
92 .cpu_setup = __setup_cpu_power3,
93#ifdef CONFIG_OPROFILE
94 .oprofile_cpu_type = "ppc64/power3",
95 .oprofile_model = &op_model_rs64,
96#endif
97 },
98 { /* Northstar */
99 .pvr_mask = 0xffff0000,
100 .pvr_value = 0x00330000,
101 .cpu_name = "RS64-II (northstar)",
102 .cpu_features = CPU_FTRS_RS64,
103 .cpu_user_features = COMMON_USER_PPC64,
104 .icache_bsize = 128,
105 .dcache_bsize = 128,
106 .num_pmcs = 8,
107 .cpu_setup = __setup_cpu_power3,
108#ifdef CONFIG_OPROFILE
109 .oprofile_cpu_type = "ppc64/rs64",
110 .oprofile_model = &op_model_rs64,
111#endif
112 },
113 { /* Pulsar */
114 .pvr_mask = 0xffff0000,
115 .pvr_value = 0x00340000,
116 .cpu_name = "RS64-III (pulsar)",
117 .cpu_features = CPU_FTRS_RS64,
118 .cpu_user_features = COMMON_USER_PPC64,
119 .icache_bsize = 128,
120 .dcache_bsize = 128,
121 .num_pmcs = 8,
122 .cpu_setup = __setup_cpu_power3,
123#ifdef CONFIG_OPROFILE
124 .oprofile_cpu_type = "ppc64/rs64",
125 .oprofile_model = &op_model_rs64,
126#endif
127 },
128 { /* I-star */
129 .pvr_mask = 0xffff0000,
130 .pvr_value = 0x00360000,
131 .cpu_name = "RS64-III (icestar)",
132 .cpu_features = CPU_FTRS_RS64,
133 .cpu_user_features = COMMON_USER_PPC64,
134 .icache_bsize = 128,
135 .dcache_bsize = 128,
136 .num_pmcs = 8,
137 .cpu_setup = __setup_cpu_power3,
138#ifdef CONFIG_OPROFILE
139 .oprofile_cpu_type = "ppc64/rs64",
140 .oprofile_model = &op_model_rs64,
141#endif
142 },
143 { /* S-star */
144 .pvr_mask = 0xffff0000,
145 .pvr_value = 0x00370000,
146 .cpu_name = "RS64-IV (sstar)",
147 .cpu_features = CPU_FTRS_RS64,
148 .cpu_user_features = COMMON_USER_PPC64,
149 .icache_bsize = 128,
150 .dcache_bsize = 128,
151 .num_pmcs = 8,
152 .cpu_setup = __setup_cpu_power3,
153#ifdef CONFIG_OPROFILE
154 .oprofile_cpu_type = "ppc64/rs64",
155 .oprofile_model = &op_model_rs64,
156#endif
157 },
158 { /* Power4 */
159 .pvr_mask = 0xffff0000,
160 .pvr_value = 0x00350000,
161 .cpu_name = "POWER4 (gp)",
162 .cpu_features = CPU_FTRS_POWER4,
163 .cpu_user_features = COMMON_USER_PPC64,
164 .icache_bsize = 128,
165 .dcache_bsize = 128,
166 .num_pmcs = 8,
167 .cpu_setup = __setup_cpu_power4,
168#ifdef CONFIG_OPROFILE
169 .oprofile_cpu_type = "ppc64/power4",
170 .oprofile_model = &op_model_rs64,
171#endif
172 },
173 { /* Power4+ */
174 .pvr_mask = 0xffff0000,
175 .pvr_value = 0x00380000,
176 .cpu_name = "POWER4+ (gq)",
177 .cpu_features = CPU_FTRS_POWER4,
178 .cpu_user_features = COMMON_USER_PPC64,
179 .icache_bsize = 128,
180 .dcache_bsize = 128,
181 .num_pmcs = 8,
182 .cpu_setup = __setup_cpu_power4,
183#ifdef CONFIG_OPROFILE
184 .oprofile_cpu_type = "ppc64/power4",
185 .oprofile_model = &op_model_power4,
186#endif
187 },
188 { /* PPC970 */
189 .pvr_mask = 0xffff0000,
190 .pvr_value = 0x00390000,
191 .cpu_name = "PPC970",
192 .cpu_features = CPU_FTRS_PPC970,
193 .cpu_user_features = COMMON_USER_PPC64 |
194 PPC_FEATURE_HAS_ALTIVEC_COMP,
195 .icache_bsize = 128,
196 .dcache_bsize = 128,
197 .num_pmcs = 8,
198 .cpu_setup = __setup_cpu_ppc970,
199#ifdef CONFIG_OPROFILE
200 .oprofile_cpu_type = "ppc64/970",
201 .oprofile_model = &op_model_power4,
202#endif
203 },
204#endif /* CONFIG_PPC64 */
205#if defined(CONFIG_PPC64) || defined(CONFIG_POWER4)
206 { /* PPC970FX */
207 .pvr_mask = 0xffff0000,
208 .pvr_value = 0x003c0000,
209 .cpu_name = "PPC970FX",
210#ifdef CONFIG_PPC32
211 .cpu_features = CPU_FTRS_970_32,
80#else 212#else
81#define CPU_FTR_MAYBE_CAN_DOZE 0 213 .cpu_features = CPU_FTRS_PPC970,
82#define CPU_FTR_MAYBE_CAN_NAP 0
83#endif 214#endif
84 215 .cpu_user_features = COMMON_USER_PPC64 |
85struct cpu_spec cpu_specs[] = { 216 PPC_FEATURE_HAS_ALTIVEC_COMP,
217 .icache_bsize = 128,
218 .dcache_bsize = 128,
219 .num_pmcs = 8,
220 .cpu_setup = __setup_cpu_ppc970,
221#ifdef CONFIG_OPROFILE
222 .oprofile_cpu_type = "ppc64/970",
223 .oprofile_model = &op_model_power4,
224#endif
225 },
226#endif /* defined(CONFIG_PPC64) || defined(CONFIG_POWER4) */
227#ifdef CONFIG_PPC64
228 { /* PPC970MP */
229 .pvr_mask = 0xffff0000,
230 .pvr_value = 0x00440000,
231 .cpu_name = "PPC970MP",
232 .cpu_features = CPU_FTRS_PPC970,
233 .cpu_user_features = COMMON_USER_PPC64 |
234 PPC_FEATURE_HAS_ALTIVEC_COMP,
235 .icache_bsize = 128,
236 .dcache_bsize = 128,
237 .cpu_setup = __setup_cpu_ppc970,
238#ifdef CONFIG_OPROFILE
239 .oprofile_cpu_type = "ppc64/970",
240 .oprofile_model = &op_model_power4,
241#endif
242 },
243 { /* Power5 */
244 .pvr_mask = 0xffff0000,
245 .pvr_value = 0x003a0000,
246 .cpu_name = "POWER5 (gr)",
247 .cpu_features = CPU_FTRS_POWER5,
248 .cpu_user_features = COMMON_USER_PPC64,
249 .icache_bsize = 128,
250 .dcache_bsize = 128,
251 .num_pmcs = 6,
252 .cpu_setup = __setup_cpu_power4,
253#ifdef CONFIG_OPROFILE
254 .oprofile_cpu_type = "ppc64/power5",
255 .oprofile_model = &op_model_power4,
256#endif
257 },
258 { /* Power5 */
259 .pvr_mask = 0xffff0000,
260 .pvr_value = 0x003b0000,
261 .cpu_name = "POWER5 (gs)",
262 .cpu_features = CPU_FTRS_POWER5,
263 .cpu_user_features = COMMON_USER_PPC64,
264 .icache_bsize = 128,
265 .dcache_bsize = 128,
266 .num_pmcs = 6,
267 .cpu_setup = __setup_cpu_power4,
268#ifdef CONFIG_OPROFILE
269 .oprofile_cpu_type = "ppc64/power5",
270 .oprofile_model = &op_model_power4,
271#endif
272 },
273 { /* BE DD1.x */
274 .pvr_mask = 0xffff0000,
275 .pvr_value = 0x00700000,
276 .cpu_name = "Cell Broadband Engine",
277 .cpu_features = CPU_FTRS_CELL,
278 .cpu_user_features = COMMON_USER_PPC64 |
279 PPC_FEATURE_HAS_ALTIVEC_COMP,
280 .icache_bsize = 128,
281 .dcache_bsize = 128,
282 .cpu_setup = __setup_cpu_be,
283 },
284 { /* default match */
285 .pvr_mask = 0x00000000,
286 .pvr_value = 0x00000000,
287 .cpu_name = "POWER4 (compatible)",
288 .cpu_features = CPU_FTRS_COMPATIBLE,
289 .cpu_user_features = COMMON_USER_PPC64,
290 .icache_bsize = 128,
291 .dcache_bsize = 128,
292 .num_pmcs = 6,
293 .cpu_setup = __setup_cpu_power4,
294 }
295#endif /* CONFIG_PPC64 */
296#ifdef CONFIG_PPC32
86#if CLASSIC_PPC 297#if CLASSIC_PPC
87 { /* 601 */ 298 { /* 601 */
88 .pvr_mask = 0xffff0000, 299 .pvr_mask = 0xffff0000,
89 .pvr_value = 0x00010000, 300 .pvr_value = 0x00010000,
90 .cpu_name = "601", 301 .cpu_name = "601",
91 .cpu_features = CPU_FTR_COMMON | CPU_FTR_601 | 302 .cpu_features = CPU_FTRS_PPC601,
92 CPU_FTR_HPTE_TABLE, 303 .cpu_user_features = COMMON_USER | PPC_FEATURE_601_INSTR |
93 .cpu_user_features = COMMON_PPC | PPC_FEATURE_601_INSTR |
94 PPC_FEATURE_UNIFIED_CACHE | PPC_FEATURE_NO_TB, 304 PPC_FEATURE_UNIFIED_CACHE | PPC_FEATURE_NO_TB,
95 .icache_bsize = 32, 305 .icache_bsize = 32,
96 .dcache_bsize = 32, 306 .dcache_bsize = 32,
97 .cpu_setup = __setup_cpu_601
98 }, 307 },
99 { /* 603 */ 308 { /* 603 */
100 .pvr_mask = 0xffff0000, 309 .pvr_mask = 0xffff0000,
101 .pvr_value = 0x00030000, 310 .pvr_value = 0x00030000,
102 .cpu_name = "603", 311 .cpu_name = "603",
103 .cpu_features = CPU_FTR_COMMON | 312 .cpu_features = CPU_FTRS_603,
104 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | 313 .cpu_user_features = COMMON_USER,
105 CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP,
106 .cpu_user_features = COMMON_PPC,
107 .icache_bsize = 32, 314 .icache_bsize = 32,
108 .dcache_bsize = 32, 315 .dcache_bsize = 32,
109 .cpu_setup = __setup_cpu_603 316 .cpu_setup = __setup_cpu_603
@@ -112,10 +319,8 @@ struct cpu_spec cpu_specs[] = {
112 .pvr_mask = 0xffff0000, 319 .pvr_mask = 0xffff0000,
113 .pvr_value = 0x00060000, 320 .pvr_value = 0x00060000,
114 .cpu_name = "603e", 321 .cpu_name = "603e",
115 .cpu_features = CPU_FTR_COMMON | 322 .cpu_features = CPU_FTRS_603,
116 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | 323 .cpu_user_features = COMMON_USER,
117 CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP,
118 .cpu_user_features = COMMON_PPC,
119 .icache_bsize = 32, 324 .icache_bsize = 32,
120 .dcache_bsize = 32, 325 .dcache_bsize = 32,
121 .cpu_setup = __setup_cpu_603 326 .cpu_setup = __setup_cpu_603
@@ -124,10 +329,8 @@ struct cpu_spec cpu_specs[] = {
124 .pvr_mask = 0xffff0000, 329 .pvr_mask = 0xffff0000,
125 .pvr_value = 0x00070000, 330 .pvr_value = 0x00070000,
126 .cpu_name = "603ev", 331 .cpu_name = "603ev",
127 .cpu_features = CPU_FTR_COMMON | 332 .cpu_features = CPU_FTRS_603,
128 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | 333 .cpu_user_features = COMMON_USER,
129 CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP,
130 .cpu_user_features = COMMON_PPC,
131 .icache_bsize = 32, 334 .icache_bsize = 32,
132 .dcache_bsize = 32, 335 .dcache_bsize = 32,
133 .cpu_setup = __setup_cpu_603 336 .cpu_setup = __setup_cpu_603
@@ -136,10 +339,8 @@ struct cpu_spec cpu_specs[] = {
136 .pvr_mask = 0xffff0000, 339 .pvr_mask = 0xffff0000,
137 .pvr_value = 0x00040000, 340 .pvr_value = 0x00040000,
138 .cpu_name = "604", 341 .cpu_name = "604",
139 .cpu_features = CPU_FTR_COMMON | 342 .cpu_features = CPU_FTRS_604,
140 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | 343 .cpu_user_features = COMMON_USER,
141 CPU_FTR_604_PERF_MON | CPU_FTR_HPTE_TABLE,
142 .cpu_user_features = COMMON_PPC,
143 .icache_bsize = 32, 344 .icache_bsize = 32,
144 .dcache_bsize = 32, 345 .dcache_bsize = 32,
145 .num_pmcs = 2, 346 .num_pmcs = 2,
@@ -149,10 +350,8 @@ struct cpu_spec cpu_specs[] = {
149 .pvr_mask = 0xfffff000, 350 .pvr_mask = 0xfffff000,
150 .pvr_value = 0x00090000, 351 .pvr_value = 0x00090000,
151 .cpu_name = "604e", 352 .cpu_name = "604e",
152 .cpu_features = CPU_FTR_COMMON | 353 .cpu_features = CPU_FTRS_604,
153 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | 354 .cpu_user_features = COMMON_USER,
154 CPU_FTR_604_PERF_MON | CPU_FTR_HPTE_TABLE,
155 .cpu_user_features = COMMON_PPC,
156 .icache_bsize = 32, 355 .icache_bsize = 32,
157 .dcache_bsize = 32, 356 .dcache_bsize = 32,
158 .num_pmcs = 4, 357 .num_pmcs = 4,
@@ -162,10 +361,8 @@ struct cpu_spec cpu_specs[] = {
162 .pvr_mask = 0xffff0000, 361 .pvr_mask = 0xffff0000,
163 .pvr_value = 0x00090000, 362 .pvr_value = 0x00090000,
164 .cpu_name = "604r", 363 .cpu_name = "604r",
165 .cpu_features = CPU_FTR_COMMON | 364 .cpu_features = CPU_FTRS_604,
166 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | 365 .cpu_user_features = COMMON_USER,
167 CPU_FTR_604_PERF_MON | CPU_FTR_HPTE_TABLE,
168 .cpu_user_features = COMMON_PPC,
169 .icache_bsize = 32, 366 .icache_bsize = 32,
170 .dcache_bsize = 32, 367 .dcache_bsize = 32,
171 .num_pmcs = 4, 368 .num_pmcs = 4,
@@ -175,10 +372,8 @@ struct cpu_spec cpu_specs[] = {
175 .pvr_mask = 0xffff0000, 372 .pvr_mask = 0xffff0000,
176 .pvr_value = 0x000a0000, 373 .pvr_value = 0x000a0000,
177 .cpu_name = "604ev", 374 .cpu_name = "604ev",
178 .cpu_features = CPU_FTR_COMMON | 375 .cpu_features = CPU_FTRS_604,
179 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | 376 .cpu_user_features = COMMON_USER,
180 CPU_FTR_604_PERF_MON | CPU_FTR_HPTE_TABLE,
181 .cpu_user_features = COMMON_PPC,
182 .icache_bsize = 32, 377 .icache_bsize = 32,
183 .dcache_bsize = 32, 378 .dcache_bsize = 32,
184 .num_pmcs = 4, 379 .num_pmcs = 4,
@@ -188,11 +383,8 @@ struct cpu_spec cpu_specs[] = {
188 .pvr_mask = 0xffffffff, 383 .pvr_mask = 0xffffffff,
189 .pvr_value = 0x00084202, 384 .pvr_value = 0x00084202,
190 .cpu_name = "740/750", 385 .cpu_name = "740/750",
191 .cpu_features = CPU_FTR_COMMON | 386 .cpu_features = CPU_FTRS_740_NOTAU,
192 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | 387 .cpu_user_features = COMMON_USER,
193 CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_HPTE_TABLE |
194 CPU_FTR_MAYBE_CAN_NAP,
195 .cpu_user_features = COMMON_PPC,
196 .icache_bsize = 32, 388 .icache_bsize = 32,
197 .dcache_bsize = 32, 389 .dcache_bsize = 32,
198 .num_pmcs = 4, 390 .num_pmcs = 4,
@@ -202,11 +394,8 @@ struct cpu_spec cpu_specs[] = {
202 .pvr_mask = 0xfffffff0, 394 .pvr_mask = 0xfffffff0,
203 .pvr_value = 0x00080100, 395 .pvr_value = 0x00080100,
204 .cpu_name = "750CX", 396 .cpu_name = "750CX",
205 .cpu_features = CPU_FTR_COMMON | 397 .cpu_features = CPU_FTRS_750,
206 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | 398 .cpu_user_features = COMMON_USER,
207 CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU |
208 CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP,
209 .cpu_user_features = COMMON_PPC,
210 .icache_bsize = 32, 399 .icache_bsize = 32,
211 .dcache_bsize = 32, 400 .dcache_bsize = 32,
212 .num_pmcs = 4, 401 .num_pmcs = 4,
@@ -216,11 +405,8 @@ struct cpu_spec cpu_specs[] = {
216 .pvr_mask = 0xfffffff0, 405 .pvr_mask = 0xfffffff0,
217 .pvr_value = 0x00082200, 406 .pvr_value = 0x00082200,
218 .cpu_name = "750CX", 407 .cpu_name = "750CX",
219 .cpu_features = CPU_FTR_COMMON | 408 .cpu_features = CPU_FTRS_750,
220 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | 409 .cpu_user_features = COMMON_USER,
221 CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU |
222 CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP,
223 .cpu_user_features = COMMON_PPC,
224 .icache_bsize = 32, 410 .icache_bsize = 32,
225 .dcache_bsize = 32, 411 .dcache_bsize = 32,
226 .num_pmcs = 4, 412 .num_pmcs = 4,
@@ -230,11 +416,8 @@ struct cpu_spec cpu_specs[] = {
230 .pvr_mask = 0xfffffff0, 416 .pvr_mask = 0xfffffff0,
231 .pvr_value = 0x00082210, 417 .pvr_value = 0x00082210,
232 .cpu_name = "750CXe", 418 .cpu_name = "750CXe",
233 .cpu_features = CPU_FTR_COMMON | 419 .cpu_features = CPU_FTRS_750,
234 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | 420 .cpu_user_features = COMMON_USER,
235 CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU |
236 CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP,
237 .cpu_user_features = COMMON_PPC,
238 .icache_bsize = 32, 421 .icache_bsize = 32,
239 .dcache_bsize = 32, 422 .dcache_bsize = 32,
240 .num_pmcs = 4, 423 .num_pmcs = 4,
@@ -244,11 +427,8 @@ struct cpu_spec cpu_specs[] = {
244 .pvr_mask = 0xffffffff, 427 .pvr_mask = 0xffffffff,
245 .pvr_value = 0x00083214, 428 .pvr_value = 0x00083214,
246 .cpu_name = "750CXe", 429 .cpu_name = "750CXe",
247 .cpu_features = CPU_FTR_COMMON | 430 .cpu_features = CPU_FTRS_750,
248 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | 431 .cpu_user_features = COMMON_USER,
249 CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU |
250 CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP,
251 .cpu_user_features = COMMON_PPC,
252 .icache_bsize = 32, 432 .icache_bsize = 32,
253 .dcache_bsize = 32, 433 .dcache_bsize = 32,
254 .num_pmcs = 4, 434 .num_pmcs = 4,
@@ -258,11 +438,8 @@ struct cpu_spec cpu_specs[] = {
258 .pvr_mask = 0xfffff000, 438 .pvr_mask = 0xfffff000,
259 .pvr_value = 0x00083000, 439 .pvr_value = 0x00083000,
260 .cpu_name = "745/755", 440 .cpu_name = "745/755",
261 .cpu_features = CPU_FTR_COMMON | 441 .cpu_features = CPU_FTRS_750,
262 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | 442 .cpu_user_features = COMMON_USER,
263 CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU |
264 CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP,
265 .cpu_user_features = COMMON_PPC,
266 .icache_bsize = 32, 443 .icache_bsize = 32,
267 .dcache_bsize = 32, 444 .dcache_bsize = 32,
268 .num_pmcs = 4, 445 .num_pmcs = 4,
@@ -272,12 +449,8 @@ struct cpu_spec cpu_specs[] = {
272 .pvr_mask = 0xffffff00, 449 .pvr_mask = 0xffffff00,
273 .pvr_value = 0x70000100, 450 .pvr_value = 0x70000100,
274 .cpu_name = "750FX", 451 .cpu_name = "750FX",
275 .cpu_features = CPU_FTR_COMMON | 452 .cpu_features = CPU_FTRS_750FX1,
276 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | 453 .cpu_user_features = COMMON_USER,
277 CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU |
278 CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP |
279 CPU_FTR_DUAL_PLL_750FX | CPU_FTR_NO_DPM,
280 .cpu_user_features = COMMON_PPC,
281 .icache_bsize = 32, 454 .icache_bsize = 32,
282 .dcache_bsize = 32, 455 .dcache_bsize = 32,
283 .num_pmcs = 4, 456 .num_pmcs = 4,
@@ -287,12 +460,8 @@ struct cpu_spec cpu_specs[] = {
287 .pvr_mask = 0xffffffff, 460 .pvr_mask = 0xffffffff,
288 .pvr_value = 0x70000200, 461 .pvr_value = 0x70000200,
289 .cpu_name = "750FX", 462 .cpu_name = "750FX",
290 .cpu_features = CPU_FTR_COMMON | 463 .cpu_features = CPU_FTRS_750FX2,
291 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | 464 .cpu_user_features = COMMON_USER,
292 CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU |
293 CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP |
294 CPU_FTR_NO_DPM,
295 .cpu_user_features = COMMON_PPC,
296 .icache_bsize = 32, 465 .icache_bsize = 32,
297 .dcache_bsize = 32, 466 .dcache_bsize = 32,
298 .num_pmcs = 4, 467 .num_pmcs = 4,
@@ -302,12 +471,8 @@ struct cpu_spec cpu_specs[] = {
302 .pvr_mask = 0xffff0000, 471 .pvr_mask = 0xffff0000,
303 .pvr_value = 0x70000000, 472 .pvr_value = 0x70000000,
304 .cpu_name = "750FX", 473 .cpu_name = "750FX",
305 .cpu_features = CPU_FTR_COMMON | 474 .cpu_features = CPU_FTRS_750FX,
306 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | 475 .cpu_user_features = COMMON_USER,
307 CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU |
308 CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP |
309 CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS,
310 .cpu_user_features = COMMON_PPC,
311 .icache_bsize = 32, 476 .icache_bsize = 32,
312 .dcache_bsize = 32, 477 .dcache_bsize = 32,
313 .num_pmcs = 4, 478 .num_pmcs = 4,
@@ -317,12 +482,8 @@ struct cpu_spec cpu_specs[] = {
317 .pvr_mask = 0xffff0000, 482 .pvr_mask = 0xffff0000,
318 .pvr_value = 0x70020000, 483 .pvr_value = 0x70020000,
319 .cpu_name = "750GX", 484 .cpu_name = "750GX",
320 .cpu_features = CPU_FTR_SPLIT_ID_CACHE | 485 .cpu_features = CPU_FTRS_750GX,
321 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | 486 .cpu_user_features = COMMON_USER,
322 CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE |
323 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_DUAL_PLL_750FX |
324 CPU_FTR_HAS_HIGH_BATS,
325 .cpu_user_features = COMMON_PPC,
326 .icache_bsize = 32, 487 .icache_bsize = 32,
327 .dcache_bsize = 32, 488 .dcache_bsize = 32,
328 .num_pmcs = 4, 489 .num_pmcs = 4,
@@ -332,11 +493,8 @@ struct cpu_spec cpu_specs[] = {
332 .pvr_mask = 0xffff0000, 493 .pvr_mask = 0xffff0000,
333 .pvr_value = 0x00080000, 494 .pvr_value = 0x00080000,
334 .cpu_name = "740/750", 495 .cpu_name = "740/750",
335 .cpu_features = CPU_FTR_COMMON | 496 .cpu_features = CPU_FTRS_740,
336 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | 497 .cpu_user_features = COMMON_USER,
337 CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU |
338 CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP,
339 .cpu_user_features = COMMON_PPC,
340 .icache_bsize = 32, 498 .icache_bsize = 32,
341 .dcache_bsize = 32, 499 .dcache_bsize = 32,
342 .num_pmcs = 4, 500 .num_pmcs = 4,
@@ -346,11 +504,8 @@ struct cpu_spec cpu_specs[] = {
346 .pvr_mask = 0xffffffff, 504 .pvr_mask = 0xffffffff,
347 .pvr_value = 0x000c1101, 505 .pvr_value = 0x000c1101,
348 .cpu_name = "7400 (1.1)", 506 .cpu_name = "7400 (1.1)",
349 .cpu_features = CPU_FTR_COMMON | 507 .cpu_features = CPU_FTRS_7400_NOTAU,
350 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | 508 .cpu_user_features = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP,
351 CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP |
352 CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP,
353 .cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
354 .icache_bsize = 32, 509 .icache_bsize = 32,
355 .dcache_bsize = 32, 510 .dcache_bsize = 32,
356 .num_pmcs = 4, 511 .num_pmcs = 4,
@@ -360,12 +515,8 @@ struct cpu_spec cpu_specs[] = {
360 .pvr_mask = 0xffff0000, 515 .pvr_mask = 0xffff0000,
361 .pvr_value = 0x000c0000, 516 .pvr_value = 0x000c0000,
362 .cpu_name = "7400", 517 .cpu_name = "7400",
363 .cpu_features = CPU_FTR_COMMON | 518 .cpu_features = CPU_FTRS_7400,
364 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | 519 .cpu_user_features = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP,
365 CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU |
366 CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE |
367 CPU_FTR_MAYBE_CAN_NAP,
368 .cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
369 .icache_bsize = 32, 520 .icache_bsize = 32,
370 .dcache_bsize = 32, 521 .dcache_bsize = 32,
371 .num_pmcs = 4, 522 .num_pmcs = 4,
@@ -375,12 +526,8 @@ struct cpu_spec cpu_specs[] = {
375 .pvr_mask = 0xffff0000, 526 .pvr_mask = 0xffff0000,
376 .pvr_value = 0x800c0000, 527 .pvr_value = 0x800c0000,
377 .cpu_name = "7410", 528 .cpu_name = "7410",
378 .cpu_features = CPU_FTR_COMMON | 529 .cpu_features = CPU_FTRS_7400,
379 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | 530 .cpu_user_features = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP,
380 CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU |
381 CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE |
382 CPU_FTR_MAYBE_CAN_NAP,
383 .cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
384 .icache_bsize = 32, 531 .icache_bsize = 32,
385 .dcache_bsize = 32, 532 .dcache_bsize = 32,
386 .num_pmcs = 4, 533 .num_pmcs = 4,
@@ -390,12 +537,8 @@ struct cpu_spec cpu_specs[] = {
390 .pvr_mask = 0xffffffff, 537 .pvr_mask = 0xffffffff,
391 .pvr_value = 0x80000200, 538 .pvr_value = 0x80000200,
392 .cpu_name = "7450", 539 .cpu_name = "7450",
393 .cpu_features = CPU_FTR_COMMON | 540 .cpu_features = CPU_FTRS_7450_20,
394 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | 541 .cpu_user_features = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP,
395 CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
396 CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
397 CPU_FTR_NEED_COHERENT,
398 .cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
399 .icache_bsize = 32, 542 .icache_bsize = 32,
400 .dcache_bsize = 32, 543 .dcache_bsize = 32,
401 .num_pmcs = 6, 544 .num_pmcs = 6,
@@ -405,14 +548,8 @@ struct cpu_spec cpu_specs[] = {
405 .pvr_mask = 0xffffffff, 548 .pvr_mask = 0xffffffff,
406 .pvr_value = 0x80000201, 549 .pvr_value = 0x80000201,
407 .cpu_name = "7450", 550 .cpu_name = "7450",
408 .cpu_features = CPU_FTR_COMMON | 551 .cpu_features = CPU_FTRS_7450_21,
409 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | 552 .cpu_user_features = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP,
410 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR |
411 CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
412 CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
413 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP |
414 CPU_FTR_NEED_COHERENT,
415 .cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
416 .icache_bsize = 32, 553 .icache_bsize = 32,
417 .dcache_bsize = 32, 554 .dcache_bsize = 32,
418 .num_pmcs = 6, 555 .num_pmcs = 6,
@@ -422,13 +559,8 @@ struct cpu_spec cpu_specs[] = {
422 .pvr_mask = 0xffff0000, 559 .pvr_mask = 0xffff0000,
423 .pvr_value = 0x80000000, 560 .pvr_value = 0x80000000,
424 .cpu_name = "7450", 561 .cpu_name = "7450",
425 .cpu_features = CPU_FTR_COMMON | 562 .cpu_features = CPU_FTRS_7450_23,
426 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | 563 .cpu_user_features = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP,
427 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR |
428 CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
429 CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
430 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_NEED_COHERENT,
431 .cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
432 .icache_bsize = 32, 564 .icache_bsize = 32,
433 .dcache_bsize = 32, 565 .dcache_bsize = 32,
434 .num_pmcs = 6, 566 .num_pmcs = 6,
@@ -438,12 +570,8 @@ struct cpu_spec cpu_specs[] = {
438 .pvr_mask = 0xffffff00, 570 .pvr_mask = 0xffffff00,
439 .pvr_value = 0x80010100, 571 .pvr_value = 0x80010100,
440 .cpu_name = "7455", 572 .cpu_name = "7455",
441 .cpu_features = CPU_FTR_COMMON | 573 .cpu_features = CPU_FTRS_7455_1,
442 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | 574 .cpu_user_features = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP,
443 CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
444 CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
445 CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT,
446 .cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
447 .icache_bsize = 32, 575 .icache_bsize = 32,
448 .dcache_bsize = 32, 576 .dcache_bsize = 32,
449 .num_pmcs = 6, 577 .num_pmcs = 6,
@@ -453,14 +581,8 @@ struct cpu_spec cpu_specs[] = {
453 .pvr_mask = 0xffffffff, 581 .pvr_mask = 0xffffffff,
454 .pvr_value = 0x80010200, 582 .pvr_value = 0x80010200,
455 .cpu_name = "7455", 583 .cpu_name = "7455",
456 .cpu_features = CPU_FTR_COMMON | 584 .cpu_features = CPU_FTRS_7455_20,
457 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | 585 .cpu_user_features = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP,
458 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR |
459 CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
460 CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
461 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP |
462 CPU_FTR_NEED_COHERENT | CPU_FTR_HAS_HIGH_BATS,
463 .cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
464 .icache_bsize = 32, 586 .icache_bsize = 32,
465 .dcache_bsize = 32, 587 .dcache_bsize = 32,
466 .num_pmcs = 6, 588 .num_pmcs = 6,
@@ -470,14 +592,8 @@ struct cpu_spec cpu_specs[] = {
470 .pvr_mask = 0xffff0000, 592 .pvr_mask = 0xffff0000,
471 .pvr_value = 0x80010000, 593 .pvr_value = 0x80010000,
472 .cpu_name = "7455", 594 .cpu_name = "7455",
473 .cpu_features = CPU_FTR_COMMON | 595 .cpu_features = CPU_FTRS_7455,
474 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | 596 .cpu_user_features = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP,
475 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR |
476 CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
477 CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
478 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS |
479 CPU_FTR_NEED_COHERENT,
480 .cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
481 .icache_bsize = 32, 597 .icache_bsize = 32,
482 .dcache_bsize = 32, 598 .dcache_bsize = 32,
483 .num_pmcs = 6, 599 .num_pmcs = 6,
@@ -487,14 +603,8 @@ struct cpu_spec cpu_specs[] = {
487 .pvr_mask = 0xffffffff, 603 .pvr_mask = 0xffffffff,
488 .pvr_value = 0x80020100, 604 .pvr_value = 0x80020100,
489 .cpu_name = "7447/7457", 605 .cpu_name = "7447/7457",
490 .cpu_features = CPU_FTR_COMMON | 606 .cpu_features = CPU_FTRS_7447_10,
491 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | 607 .cpu_user_features = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP,
492 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR |
493 CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
494 CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
495 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS |
496 CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC,
497 .cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
498 .icache_bsize = 32, 608 .icache_bsize = 32,
499 .dcache_bsize = 32, 609 .dcache_bsize = 32,
500 .num_pmcs = 6, 610 .num_pmcs = 6,
@@ -504,14 +614,8 @@ struct cpu_spec cpu_specs[] = {
504 .pvr_mask = 0xffffffff, 614 .pvr_mask = 0xffffffff,
505 .pvr_value = 0x80020101, 615 .pvr_value = 0x80020101,
506 .cpu_name = "7447/7457", 616 .cpu_name = "7447/7457",
507 .cpu_features = CPU_FTR_COMMON | 617 .cpu_features = CPU_FTRS_7447_10,
508 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | 618 .cpu_user_features = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP,
509 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR |
510 CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
511 CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
512 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS |
513 CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC,
514 .cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
515 .icache_bsize = 32, 619 .icache_bsize = 32,
516 .dcache_bsize = 32, 620 .dcache_bsize = 32,
517 .num_pmcs = 6, 621 .num_pmcs = 6,
@@ -521,14 +625,8 @@ struct cpu_spec cpu_specs[] = {
521 .pvr_mask = 0xffff0000, 625 .pvr_mask = 0xffff0000,
522 .pvr_value = 0x80020000, 626 .pvr_value = 0x80020000,
523 .cpu_name = "7447/7457", 627 .cpu_name = "7447/7457",
524 .cpu_features = CPU_FTR_COMMON | 628 .cpu_features = CPU_FTRS_7447,
525 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | 629 .cpu_user_features = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP,
526 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR |
527 CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
528 CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
529 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS |
530 CPU_FTR_NEED_COHERENT,
531 .cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
532 .icache_bsize = 32, 630 .icache_bsize = 32,
533 .dcache_bsize = 32, 631 .dcache_bsize = 32,
534 .num_pmcs = 6, 632 .num_pmcs = 6,
@@ -538,13 +636,8 @@ struct cpu_spec cpu_specs[] = {
538 .pvr_mask = 0xffff0000, 636 .pvr_mask = 0xffff0000,
539 .pvr_value = 0x80030000, 637 .pvr_value = 0x80030000,
540 .cpu_name = "7447A", 638 .cpu_name = "7447A",
541 .cpu_features = CPU_FTR_COMMON | 639 .cpu_features = CPU_FTRS_7447A,
542 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | 640 .cpu_user_features = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP,
543 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR |
544 CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE |
545 CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR |
546 CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT,
547 .cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
548 .icache_bsize = 32, 641 .icache_bsize = 32,
549 .dcache_bsize = 32, 642 .dcache_bsize = 32,
550 .num_pmcs = 6, 643 .num_pmcs = 6,
@@ -554,13 +647,8 @@ struct cpu_spec cpu_specs[] = {
554 .pvr_mask = 0xffff0000, 647 .pvr_mask = 0xffff0000,
555 .pvr_value = 0x80040000, 648 .pvr_value = 0x80040000,
556 .cpu_name = "7448", 649 .cpu_name = "7448",
557 .cpu_features = CPU_FTR_COMMON | 650 .cpu_features = CPU_FTRS_7447A,
558 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | 651 .cpu_user_features = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP,
559 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR |
560 CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE |
561 CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR |
562 CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT,
563 .cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
564 .icache_bsize = 32, 652 .icache_bsize = 32,
565 .dcache_bsize = 32, 653 .dcache_bsize = 32,
566 .num_pmcs = 6, 654 .num_pmcs = 6,
@@ -570,10 +658,8 @@ struct cpu_spec cpu_specs[] = {
570 .pvr_mask = 0x7fff0000, 658 .pvr_mask = 0x7fff0000,
571 .pvr_value = 0x00810000, 659 .pvr_value = 0x00810000,
572 .cpu_name = "82xx", 660 .cpu_name = "82xx",
573 .cpu_features = CPU_FTR_COMMON | 661 .cpu_features = CPU_FTRS_82XX,
574 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | 662 .cpu_user_features = COMMON_USER,
575 CPU_FTR_USE_TB,
576 .cpu_user_features = COMMON_PPC,
577 .icache_bsize = 32, 663 .icache_bsize = 32,
578 .dcache_bsize = 32, 664 .dcache_bsize = 32,
579 .cpu_setup = __setup_cpu_603 665 .cpu_setup = __setup_cpu_603
@@ -582,10 +668,8 @@ struct cpu_spec cpu_specs[] = {
582 .pvr_mask = 0x7fff0000, 668 .pvr_mask = 0x7fff0000,
583 .pvr_value = 0x00820000, 669 .pvr_value = 0x00820000,
584 .cpu_name = "G2_LE", 670 .cpu_name = "G2_LE",
585 .cpu_features = CPU_FTR_SPLIT_ID_CACHE | 671 .cpu_features = CPU_FTRS_G2_LE,
586 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | 672 .cpu_user_features = COMMON_USER,
587 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS,
588 .cpu_user_features = COMMON_PPC,
589 .icache_bsize = 32, 673 .icache_bsize = 32,
590 .dcache_bsize = 32, 674 .dcache_bsize = 32,
591 .cpu_setup = __setup_cpu_603 675 .cpu_setup = __setup_cpu_603
@@ -594,10 +678,8 @@ struct cpu_spec cpu_specs[] = {
594 .pvr_mask = 0x7fff0000, 678 .pvr_mask = 0x7fff0000,
595 .pvr_value = 0x00830000, 679 .pvr_value = 0x00830000,
596 .cpu_name = "e300", 680 .cpu_name = "e300",
597 .cpu_features = CPU_FTR_SPLIT_ID_CACHE | 681 .cpu_features = CPU_FTRS_E300,
598 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | 682 .cpu_user_features = COMMON_USER,
599 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS,
600 .cpu_user_features = COMMON_PPC,
601 .icache_bsize = 32, 683 .icache_bsize = 32,
602 .dcache_bsize = 32, 684 .dcache_bsize = 32,
603 .cpu_setup = __setup_cpu_603 685 .cpu_setup = __setup_cpu_603
@@ -606,114 +688,12 @@ struct cpu_spec cpu_specs[] = {
606 .pvr_mask = 0x00000000, 688 .pvr_mask = 0x00000000,
607 .pvr_value = 0x00000000, 689 .pvr_value = 0x00000000,
608 .cpu_name = "(generic PPC)", 690 .cpu_name = "(generic PPC)",
609 .cpu_features = CPU_FTR_COMMON | 691 .cpu_features = CPU_FTRS_CLASSIC32,
610 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | 692 .cpu_user_features = COMMON_USER,
611 CPU_FTR_HPTE_TABLE,
612 .cpu_user_features = COMMON_PPC,
613 .icache_bsize = 32, 693 .icache_bsize = 32,
614 .dcache_bsize = 32, 694 .dcache_bsize = 32,
615 .cpu_setup = __setup_cpu_generic
616 }, 695 },
617#endif /* CLASSIC_PPC */ 696#endif /* CLASSIC_PPC */
618#ifdef CONFIG_PPC64BRIDGE
619 { /* Power3 */
620 .pvr_mask = 0xffff0000,
621 .pvr_value = 0x00400000,
622 .cpu_name = "Power3 (630)",
623 .cpu_features = CPU_FTR_COMMON |
624 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB |
625 CPU_FTR_HPTE_TABLE,
626 .cpu_user_features = COMMON_PPC | PPC_FEATURE_64,
627 .icache_bsize = 128,
628 .dcache_bsize = 128,
629 .num_pmcs = 8,
630 .cpu_setup = __setup_cpu_power3
631 },
632 { /* Power3+ */
633 .pvr_mask = 0xffff0000,
634 .pvr_value = 0x00410000,
635 .cpu_name = "Power3 (630+)",
636 .cpu_features = CPU_FTR_COMMON |
637 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB |
638 CPU_FTR_HPTE_TABLE,
639 .cpu_user_features = COMMON_PPC | PPC_FEATURE_64,
640 .icache_bsize = 128,
641 .dcache_bsize = 128,
642 .num_pmcs = 8,
643 .cpu_setup = __setup_cpu_power3
644 },
645 { /* I-star */
646 .pvr_mask = 0xffff0000,
647 .pvr_value = 0x00360000,
648 .cpu_name = "I-star",
649 .cpu_features = CPU_FTR_COMMON |
650 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB |
651 CPU_FTR_HPTE_TABLE,
652 .cpu_user_features = COMMON_PPC | PPC_FEATURE_64,
653 .icache_bsize = 128,
654 .dcache_bsize = 128,
655 .num_pmcs = 8,
656 .cpu_setup = __setup_cpu_power3
657 },
658 { /* S-star */
659 .pvr_mask = 0xffff0000,
660 .pvr_value = 0x00370000,
661 .cpu_name = "S-star",
662 .cpu_features = CPU_FTR_COMMON |
663 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB |
664 CPU_FTR_HPTE_TABLE,
665 .cpu_user_features = COMMON_PPC | PPC_FEATURE_64,
666 .icache_bsize = 128,
667 .dcache_bsize = 128,
668 .num_pmcs = 8,
669 .cpu_setup = __setup_cpu_power3
670 },
671#endif /* CONFIG_PPC64BRIDGE */
672#ifdef CONFIG_POWER4
673 { /* Power4 */
674 .pvr_mask = 0xffff0000,
675 .pvr_value = 0x00350000,
676 .cpu_name = "Power4",
677 .cpu_features = CPU_FTR_COMMON |
678 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB |
679 CPU_FTR_HPTE_TABLE,
680 .cpu_user_features = COMMON_PPC | PPC_FEATURE_64,
681 .icache_bsize = 128,
682 .dcache_bsize = 128,
683 .num_pmcs = 8,
684 .cpu_setup = __setup_cpu_power4
685 },
686 { /* PPC970 */
687 .pvr_mask = 0xffff0000,
688 .pvr_value = 0x00390000,
689 .cpu_name = "PPC970",
690 .cpu_features = CPU_FTR_COMMON |
691 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB |
692 CPU_FTR_HPTE_TABLE |
693 CPU_FTR_ALTIVEC_COMP | CPU_FTR_MAYBE_CAN_NAP,
694 .cpu_user_features = COMMON_PPC | PPC_FEATURE_64 |
695 PPC_FEATURE_ALTIVEC_COMP,
696 .icache_bsize = 128,
697 .dcache_bsize = 128,
698 .num_pmcs = 8,
699 .cpu_setup = __setup_cpu_ppc970
700 },
701 { /* PPC970FX */
702 .pvr_mask = 0xffff0000,
703 .pvr_value = 0x003c0000,
704 .cpu_name = "PPC970FX",
705 .cpu_features = CPU_FTR_COMMON |
706 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB |
707 CPU_FTR_HPTE_TABLE |
708 CPU_FTR_ALTIVEC_COMP | CPU_FTR_MAYBE_CAN_NAP,
709 .cpu_user_features = COMMON_PPC | PPC_FEATURE_64 |
710 PPC_FEATURE_ALTIVEC_COMP,
711 .icache_bsize = 128,
712 .dcache_bsize = 128,
713 .num_pmcs = 8,
714 .cpu_setup = __setup_cpu_ppc970
715 },
716#endif /* CONFIG_POWER4 */
717#ifdef CONFIG_8xx 697#ifdef CONFIG_8xx
718 { /* 8xx */ 698 { /* 8xx */
719 .pvr_mask = 0xffff0000, 699 .pvr_mask = 0xffff0000,
@@ -721,8 +701,7 @@ struct cpu_spec cpu_specs[] = {
721 .cpu_name = "8xx", 701 .cpu_name = "8xx",
722 /* CPU_FTR_MAYBE_CAN_DOZE is possible, 702 /* CPU_FTR_MAYBE_CAN_DOZE is possible,
723 * if the 8xx code is there.... */ 703 * if the 8xx code is there.... */
724 .cpu_features = CPU_FTR_SPLIT_ID_CACHE | 704 .cpu_features = CPU_FTRS_8XX,
725 CPU_FTR_USE_TB,
726 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, 705 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
727 .icache_bsize = 16, 706 .icache_bsize = 16,
728 .dcache_bsize = 16, 707 .dcache_bsize = 16,
@@ -733,8 +712,7 @@ struct cpu_spec cpu_specs[] = {
733 .pvr_mask = 0xffffff00, 712 .pvr_mask = 0xffffff00,
734 .pvr_value = 0x00200200, 713 .pvr_value = 0x00200200,
735 .cpu_name = "403GC", 714 .cpu_name = "403GC",
736 .cpu_features = CPU_FTR_SPLIT_ID_CACHE | 715 .cpu_features = CPU_FTRS_40X,
737 CPU_FTR_USE_TB,
738 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, 716 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
739 .icache_bsize = 16, 717 .icache_bsize = 16,
740 .dcache_bsize = 16, 718 .dcache_bsize = 16,
@@ -743,8 +721,7 @@ struct cpu_spec cpu_specs[] = {
743 .pvr_mask = 0xffffff00, 721 .pvr_mask = 0xffffff00,
744 .pvr_value = 0x00201400, 722 .pvr_value = 0x00201400,
745 .cpu_name = "403GCX", 723 .cpu_name = "403GCX",
746 .cpu_features = CPU_FTR_SPLIT_ID_CACHE | 724 .cpu_features = CPU_FTRS_40X,
747 CPU_FTR_USE_TB,
748 .cpu_user_features = PPC_FEATURE_32 | 725 .cpu_user_features = PPC_FEATURE_32 |
749 PPC_FEATURE_HAS_MMU | PPC_FEATURE_NO_TB, 726 PPC_FEATURE_HAS_MMU | PPC_FEATURE_NO_TB,
750 .icache_bsize = 16, 727 .icache_bsize = 16,
@@ -754,8 +731,7 @@ struct cpu_spec cpu_specs[] = {
754 .pvr_mask = 0xffff0000, 731 .pvr_mask = 0xffff0000,
755 .pvr_value = 0x00200000, 732 .pvr_value = 0x00200000,
756 .cpu_name = "403G ??", 733 .cpu_name = "403G ??",
757 .cpu_features = CPU_FTR_SPLIT_ID_CACHE | 734 .cpu_features = CPU_FTRS_40X,
758 CPU_FTR_USE_TB,
759 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, 735 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
760 .icache_bsize = 16, 736 .icache_bsize = 16,
761 .dcache_bsize = 16, 737 .dcache_bsize = 16,
@@ -764,8 +740,7 @@ struct cpu_spec cpu_specs[] = {
764 .pvr_mask = 0xffff0000, 740 .pvr_mask = 0xffff0000,
765 .pvr_value = 0x40110000, 741 .pvr_value = 0x40110000,
766 .cpu_name = "405GP", 742 .cpu_name = "405GP",
767 .cpu_features = CPU_FTR_SPLIT_ID_CACHE | 743 .cpu_features = CPU_FTRS_40X,
768 CPU_FTR_USE_TB,
769 .cpu_user_features = PPC_FEATURE_32 | 744 .cpu_user_features = PPC_FEATURE_32 |
770 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, 745 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
771 .icache_bsize = 32, 746 .icache_bsize = 32,
@@ -775,8 +750,7 @@ struct cpu_spec cpu_specs[] = {
775 .pvr_mask = 0xffff0000, 750 .pvr_mask = 0xffff0000,
776 .pvr_value = 0x40130000, 751 .pvr_value = 0x40130000,
777 .cpu_name = "STB03xxx", 752 .cpu_name = "STB03xxx",
778 .cpu_features = CPU_FTR_SPLIT_ID_CACHE | 753 .cpu_features = CPU_FTRS_40X,
779 CPU_FTR_USE_TB,
780 .cpu_user_features = PPC_FEATURE_32 | 754 .cpu_user_features = PPC_FEATURE_32 |
781 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, 755 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
782 .icache_bsize = 32, 756 .icache_bsize = 32,
@@ -786,8 +760,7 @@ struct cpu_spec cpu_specs[] = {
786 .pvr_mask = 0xffff0000, 760 .pvr_mask = 0xffff0000,
787 .pvr_value = 0x41810000, 761 .pvr_value = 0x41810000,
788 .cpu_name = "STB04xxx", 762 .cpu_name = "STB04xxx",
789 .cpu_features = CPU_FTR_SPLIT_ID_CACHE | 763 .cpu_features = CPU_FTRS_40X,
790 CPU_FTR_USE_TB,
791 .cpu_user_features = PPC_FEATURE_32 | 764 .cpu_user_features = PPC_FEATURE_32 |
792 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, 765 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
793 .icache_bsize = 32, 766 .icache_bsize = 32,
@@ -797,8 +770,7 @@ struct cpu_spec cpu_specs[] = {
797 .pvr_mask = 0xffff0000, 770 .pvr_mask = 0xffff0000,
798 .pvr_value = 0x41610000, 771 .pvr_value = 0x41610000,
799 .cpu_name = "NP405L", 772 .cpu_name = "NP405L",
800 .cpu_features = CPU_FTR_SPLIT_ID_CACHE | 773 .cpu_features = CPU_FTRS_40X,
801 CPU_FTR_USE_TB,
802 .cpu_user_features = PPC_FEATURE_32 | 774 .cpu_user_features = PPC_FEATURE_32 |
803 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, 775 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
804 .icache_bsize = 32, 776 .icache_bsize = 32,
@@ -808,8 +780,7 @@ struct cpu_spec cpu_specs[] = {
808 .pvr_mask = 0xffff0000, 780 .pvr_mask = 0xffff0000,
809 .pvr_value = 0x40B10000, 781 .pvr_value = 0x40B10000,
810 .cpu_name = "NP4GS3", 782 .cpu_name = "NP4GS3",
811 .cpu_features = CPU_FTR_SPLIT_ID_CACHE | 783 .cpu_features = CPU_FTRS_40X,
812 CPU_FTR_USE_TB,
813 .cpu_user_features = PPC_FEATURE_32 | 784 .cpu_user_features = PPC_FEATURE_32 |
814 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, 785 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
815 .icache_bsize = 32, 786 .icache_bsize = 32,
@@ -819,8 +790,7 @@ struct cpu_spec cpu_specs[] = {
819 .pvr_mask = 0xffff0000, 790 .pvr_mask = 0xffff0000,
820 .pvr_value = 0x41410000, 791 .pvr_value = 0x41410000,
821 .cpu_name = "NP405H", 792 .cpu_name = "NP405H",
822 .cpu_features = CPU_FTR_SPLIT_ID_CACHE | 793 .cpu_features = CPU_FTRS_40X,
823 CPU_FTR_USE_TB,
824 .cpu_user_features = PPC_FEATURE_32 | 794 .cpu_user_features = PPC_FEATURE_32 |
825 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, 795 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
826 .icache_bsize = 32, 796 .icache_bsize = 32,
@@ -830,8 +800,7 @@ struct cpu_spec cpu_specs[] = {
830 .pvr_mask = 0xffff0000, 800 .pvr_mask = 0xffff0000,
831 .pvr_value = 0x50910000, 801 .pvr_value = 0x50910000,
832 .cpu_name = "405GPr", 802 .cpu_name = "405GPr",
833 .cpu_features = CPU_FTR_SPLIT_ID_CACHE | 803 .cpu_features = CPU_FTRS_40X,
834 CPU_FTR_USE_TB,
835 .cpu_user_features = PPC_FEATURE_32 | 804 .cpu_user_features = PPC_FEATURE_32 |
836 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, 805 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
837 .icache_bsize = 32, 806 .icache_bsize = 32,
@@ -841,8 +810,7 @@ struct cpu_spec cpu_specs[] = {
841 .pvr_mask = 0xffff0000, 810 .pvr_mask = 0xffff0000,
842 .pvr_value = 0x51510000, 811 .pvr_value = 0x51510000,
843 .cpu_name = "STBx25xx", 812 .cpu_name = "STBx25xx",
844 .cpu_features = CPU_FTR_SPLIT_ID_CACHE | 813 .cpu_features = CPU_FTRS_40X,
845 CPU_FTR_USE_TB,
846 .cpu_user_features = PPC_FEATURE_32 | 814 .cpu_user_features = PPC_FEATURE_32 |
847 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, 815 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
848 .icache_bsize = 32, 816 .icache_bsize = 32,
@@ -852,8 +820,7 @@ struct cpu_spec cpu_specs[] = {
852 .pvr_mask = 0xffff0000, 820 .pvr_mask = 0xffff0000,
853 .pvr_value = 0x41F10000, 821 .pvr_value = 0x41F10000,
854 .cpu_name = "405LP", 822 .cpu_name = "405LP",
855 .cpu_features = CPU_FTR_SPLIT_ID_CACHE | 823 .cpu_features = CPU_FTRS_40X,
856 CPU_FTR_USE_TB,
857 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, 824 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
858 .icache_bsize = 32, 825 .icache_bsize = 32,
859 .dcache_bsize = 32, 826 .dcache_bsize = 32,
@@ -862,8 +829,7 @@ struct cpu_spec cpu_specs[] = {
862 .pvr_mask = 0xffff0000, 829 .pvr_mask = 0xffff0000,
863 .pvr_value = 0x20010000, 830 .pvr_value = 0x20010000,
864 .cpu_name = "Virtex-II Pro", 831 .cpu_name = "Virtex-II Pro",
865 .cpu_features = CPU_FTR_SPLIT_ID_CACHE | 832 .cpu_features = CPU_FTRS_40X,
866 CPU_FTR_USE_TB,
867 .cpu_user_features = PPC_FEATURE_32 | 833 .cpu_user_features = PPC_FEATURE_32 |
868 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, 834 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
869 .icache_bsize = 32, 835 .icache_bsize = 32,
@@ -873,8 +839,7 @@ struct cpu_spec cpu_specs[] = {
873 .pvr_mask = 0xffff0000, 839 .pvr_mask = 0xffff0000,
874 .pvr_value = 0x51210000, 840 .pvr_value = 0x51210000,
875 .cpu_name = "405EP", 841 .cpu_name = "405EP",
876 .cpu_features = CPU_FTR_SPLIT_ID_CACHE | 842 .cpu_features = CPU_FTRS_40X,
877 CPU_FTR_USE_TB,
878 .cpu_user_features = PPC_FEATURE_32 | 843 .cpu_user_features = PPC_FEATURE_32 |
879 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, 844 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
880 .icache_bsize = 32, 845 .icache_bsize = 32,
@@ -887,9 +852,8 @@ struct cpu_spec cpu_specs[] = {
887 .pvr_mask = 0xf0000fff, 852 .pvr_mask = 0xf0000fff,
888 .pvr_value = 0x40000850, 853 .pvr_value = 0x40000850,
889 .cpu_name = "440EP Rev. A", 854 .cpu_name = "440EP Rev. A",
890 .cpu_features = CPU_FTR_SPLIT_ID_CACHE | 855 .cpu_features = CPU_FTRS_44X,
891 CPU_FTR_USE_TB, 856 .cpu_user_features = COMMON_USER, /* 440EP has an FPU */
892 .cpu_user_features = COMMON_PPC, /* 440EP has an FPU */
893 .icache_bsize = 32, 857 .icache_bsize = 32,
894 .dcache_bsize = 32, 858 .dcache_bsize = 32,
895 }, 859 },
@@ -897,28 +861,25 @@ struct cpu_spec cpu_specs[] = {
897 .pvr_mask = 0xf0000fff, 861 .pvr_mask = 0xf0000fff,
898 .pvr_value = 0x400008d3, 862 .pvr_value = 0x400008d3,
899 .cpu_name = "440EP Rev. B", 863 .cpu_name = "440EP Rev. B",
900 .cpu_features = CPU_FTR_SPLIT_ID_CACHE | 864 .cpu_features = CPU_FTRS_44X,
901 CPU_FTR_USE_TB, 865 .cpu_user_features = COMMON_USER, /* 440EP has an FPU */
902 .cpu_user_features = COMMON_PPC, /* 440EP has an FPU */
903 .icache_bsize = 32, 866 .icache_bsize = 32,
904 .dcache_bsize = 32, 867 .dcache_bsize = 32,
905 }, 868 },
906 { /* 440GP Rev. B */ 869 { /* 440GP Rev. B */
907 .pvr_mask = 0xf0000fff, 870 .pvr_mask = 0xf0000fff,
908 .pvr_value = 0x40000440, 871 .pvr_value = 0x40000440,
909 .cpu_name = "440GP Rev. B", 872 .cpu_name = "440GP Rev. B",
910 .cpu_features = CPU_FTR_SPLIT_ID_CACHE | 873 .cpu_features = CPU_FTRS_44X,
911 CPU_FTR_USE_TB,
912 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, 874 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
913 .icache_bsize = 32, 875 .icache_bsize = 32,
914 .dcache_bsize = 32, 876 .dcache_bsize = 32,
915 }, 877 },
916 { /* 440GP Rev. C */ 878 { /* 440GP Rev. C */
917 .pvr_mask = 0xf0000fff, 879 .pvr_mask = 0xf0000fff,
918 .pvr_value = 0x40000481, 880 .pvr_value = 0x40000481,
919 .cpu_name = "440GP Rev. C", 881 .cpu_name = "440GP Rev. C",
920 .cpu_features = CPU_FTR_SPLIT_ID_CACHE | 882 .cpu_features = CPU_FTRS_44X,
921 CPU_FTR_USE_TB,
922 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, 883 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
923 .icache_bsize = 32, 884 .icache_bsize = 32,
924 .dcache_bsize = 32, 885 .dcache_bsize = 32,
@@ -927,8 +888,7 @@ struct cpu_spec cpu_specs[] = {
927 .pvr_mask = 0xf0000fff, 888 .pvr_mask = 0xf0000fff,
928 .pvr_value = 0x50000850, 889 .pvr_value = 0x50000850,
929 .cpu_name = "440GX Rev. A", 890 .cpu_name = "440GX Rev. A",
930 .cpu_features = CPU_FTR_SPLIT_ID_CACHE | 891 .cpu_features = CPU_FTRS_44X,
931 CPU_FTR_USE_TB,
932 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, 892 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
933 .icache_bsize = 32, 893 .icache_bsize = 32,
934 .dcache_bsize = 32, 894 .dcache_bsize = 32,
@@ -937,8 +897,7 @@ struct cpu_spec cpu_specs[] = {
937 .pvr_mask = 0xf0000fff, 897 .pvr_mask = 0xf0000fff,
938 .pvr_value = 0x50000851, 898 .pvr_value = 0x50000851,
939 .cpu_name = "440GX Rev. B", 899 .cpu_name = "440GX Rev. B",
940 .cpu_features = CPU_FTR_SPLIT_ID_CACHE | 900 .cpu_features = CPU_FTRS_44X,
941 CPU_FTR_USE_TB,
942 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, 901 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
943 .icache_bsize = 32, 902 .icache_bsize = 32,
944 .dcache_bsize = 32, 903 .dcache_bsize = 32,
@@ -947,8 +906,7 @@ struct cpu_spec cpu_specs[] = {
947 .pvr_mask = 0xf0000fff, 906 .pvr_mask = 0xf0000fff,
948 .pvr_value = 0x50000892, 907 .pvr_value = 0x50000892,
949 .cpu_name = "440GX Rev. C", 908 .cpu_name = "440GX Rev. C",
950 .cpu_features = CPU_FTR_SPLIT_ID_CACHE | 909 .cpu_features = CPU_FTRS_44X,
951 CPU_FTR_USE_TB,
952 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, 910 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
953 .icache_bsize = 32, 911 .icache_bsize = 32,
954 .dcache_bsize = 32, 912 .dcache_bsize = 32,
@@ -957,8 +915,7 @@ struct cpu_spec cpu_specs[] = {
957 .pvr_mask = 0xf0000fff, 915 .pvr_mask = 0xf0000fff,
958 .pvr_value = 0x50000894, 916 .pvr_value = 0x50000894,
959 .cpu_name = "440GX Rev. F", 917 .cpu_name = "440GX Rev. F",
960 .cpu_features = CPU_FTR_SPLIT_ID_CACHE | 918 .cpu_features = CPU_FTRS_44X,
961 CPU_FTR_USE_TB,
962 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, 919 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
963 .icache_bsize = 32, 920 .icache_bsize = 32,
964 .dcache_bsize = 32, 921 .dcache_bsize = 32,
@@ -967,44 +924,42 @@ struct cpu_spec cpu_specs[] = {
967 .pvr_mask = 0xff000fff, 924 .pvr_mask = 0xff000fff,
968 .pvr_value = 0x53000891, 925 .pvr_value = 0x53000891,
969 .cpu_name = "440SP Rev. A", 926 .cpu_name = "440SP Rev. A",
970 .cpu_features = CPU_FTR_SPLIT_ID_CACHE | 927 .cpu_features = CPU_FTRS_44X,
971 CPU_FTR_USE_TB,
972 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, 928 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
973 .icache_bsize = 32, 929 .icache_bsize = 32,
974 .dcache_bsize = 32, 930 .dcache_bsize = 32,
975 }, 931 },
976#endif /* CONFIG_44x */ 932#endif /* CONFIG_44x */
977#ifdef CONFIG_FSL_BOOKE 933#ifdef CONFIG_FSL_BOOKE
978 { /* e200z5 */ 934 { /* e200z5 */
979 .pvr_mask = 0xfff00000, 935 .pvr_mask = 0xfff00000,
980 .pvr_value = 0x81000000, 936 .pvr_value = 0x81000000,
981 .cpu_name = "e200z5", 937 .cpu_name = "e200z5",
982 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */ 938 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
983 .cpu_features = CPU_FTR_USE_TB, 939 .cpu_features = CPU_FTRS_E200,
984 .cpu_user_features = PPC_FEATURE_32 | 940 .cpu_user_features = PPC_FEATURE_32 |
985 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_EFP_SINGLE | 941 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_EFP_SINGLE |
986 PPC_FEATURE_UNIFIED_CACHE, 942 PPC_FEATURE_UNIFIED_CACHE,
987 .dcache_bsize = 32, 943 .dcache_bsize = 32,
988 }, 944 },
989 { /* e200z6 */ 945 { /* e200z6 */
990 .pvr_mask = 0xfff00000, 946 .pvr_mask = 0xfff00000,
991 .pvr_value = 0x81100000, 947 .pvr_value = 0x81100000,
992 .cpu_name = "e200z6", 948 .cpu_name = "e200z6",
993 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */ 949 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
994 .cpu_features = CPU_FTR_USE_TB, 950 .cpu_features = CPU_FTRS_E200,
995 .cpu_user_features = PPC_FEATURE_32 | 951 .cpu_user_features = PPC_FEATURE_32 |
996 PPC_FEATURE_HAS_MMU | PPC_FEATURE_SPE_COMP | 952 PPC_FEATURE_HAS_MMU | PPC_FEATURE_SPE_COMP |
997 PPC_FEATURE_HAS_EFP_SINGLE | 953 PPC_FEATURE_HAS_EFP_SINGLE |
998 PPC_FEATURE_UNIFIED_CACHE, 954 PPC_FEATURE_UNIFIED_CACHE,
999 .dcache_bsize = 32, 955 .dcache_bsize = 32,
1000 }, 956 },
1001 { /* e500 */ 957 { /* e500 */
1002 .pvr_mask = 0xffff0000, 958 .pvr_mask = 0xffff0000,
1003 .pvr_value = 0x80200000, 959 .pvr_value = 0x80200000,
1004 .cpu_name = "e500", 960 .cpu_name = "e500",
1005 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */ 961 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
1006 .cpu_features = CPU_FTR_SPLIT_ID_CACHE | 962 .cpu_features = CPU_FTRS_E500,
1007 CPU_FTR_USE_TB,
1008 .cpu_user_features = PPC_FEATURE_32 | 963 .cpu_user_features = PPC_FEATURE_32 |
1009 PPC_FEATURE_HAS_MMU | PPC_FEATURE_SPE_COMP | 964 PPC_FEATURE_HAS_MMU | PPC_FEATURE_SPE_COMP |
1010 PPC_FEATURE_HAS_EFP_SINGLE, 965 PPC_FEATURE_HAS_EFP_SINGLE,
@@ -1012,13 +967,12 @@ struct cpu_spec cpu_specs[] = {
1012 .dcache_bsize = 32, 967 .dcache_bsize = 32,
1013 .num_pmcs = 4, 968 .num_pmcs = 4,
1014 }, 969 },
1015 { /* e500v2 */ 970 { /* e500v2 */
1016 .pvr_mask = 0xffff0000, 971 .pvr_mask = 0xffff0000,
1017 .pvr_value = 0x80210000, 972 .pvr_value = 0x80210000,
1018 .cpu_name = "e500v2", 973 .cpu_name = "e500v2",
1019 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */ 974 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
1020 .cpu_features = CPU_FTR_SPLIT_ID_CACHE | 975 .cpu_features = CPU_FTRS_E500_2,
1021 CPU_FTR_USE_TB | CPU_FTR_BIG_PHYS,
1022 .cpu_user_features = PPC_FEATURE_32 | 976 .cpu_user_features = PPC_FEATURE_32 |
1023 PPC_FEATURE_HAS_MMU | PPC_FEATURE_SPE_COMP | 977 PPC_FEATURE_HAS_MMU | PPC_FEATURE_SPE_COMP |
1024 PPC_FEATURE_HAS_EFP_SINGLE | PPC_FEATURE_HAS_EFP_DOUBLE, 978 PPC_FEATURE_HAS_EFP_SINGLE | PPC_FEATURE_HAS_EFP_DOUBLE,
@@ -1032,10 +986,11 @@ struct cpu_spec cpu_specs[] = {
1032 .pvr_mask = 0x00000000, 986 .pvr_mask = 0x00000000,
1033 .pvr_value = 0x00000000, 987 .pvr_value = 0x00000000,
1034 .cpu_name = "(generic PPC)", 988 .cpu_name = "(generic PPC)",
1035 .cpu_features = CPU_FTR_COMMON, 989 .cpu_features = CPU_FTRS_GENERIC_32,
1036 .cpu_user_features = PPC_FEATURE_32, 990 .cpu_user_features = PPC_FEATURE_32,
1037 .icache_bsize = 32, 991 .icache_bsize = 32,
1038 .dcache_bsize = 32, 992 .dcache_bsize = 32,
1039 } 993 }
1040#endif /* !CLASSIC_PPC */ 994#endif /* !CLASSIC_PPC */
995#endif /* CONFIG_PPC32 */
1041}; 996};
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
new file mode 100644
index 000000000000..2e99ae41723c
--- /dev/null
+++ b/arch/powerpc/kernel/entry_32.S
@@ -0,0 +1,1000 @@
1/*
2 * PowerPC version
3 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
4 * Rewritten by Cort Dougan (cort@fsmlabs.com) for PReP
5 * Copyright (C) 1996 Cort Dougan <cort@fsmlabs.com>
6 * Adapted for Power Macintosh by Paul Mackerras.
7 * Low-level exception handlers and MMU support
8 * rewritten by Paul Mackerras.
9 * Copyright (C) 1996 Paul Mackerras.
10 * MPC8xx modifications Copyright (C) 1997 Dan Malek (dmalek@jlc.net).
11 *
12 * This file contains the system call entry code, context switch
13 * code, and exception/interrupt return code for PowerPC.
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version
18 * 2 of the License, or (at your option) any later version.
19 *
20 */
21
22#include <linux/config.h>
23#include <linux/errno.h>
24#include <linux/sys.h>
25#include <linux/threads.h>
26#include <asm/reg.h>
27#include <asm/page.h>
28#include <asm/mmu.h>
29#include <asm/cputable.h>
30#include <asm/thread_info.h>
31#include <asm/ppc_asm.h>
32#include <asm/asm-offsets.h>
33#include <asm/unistd.h>
34
35#undef SHOW_SYSCALLS
36#undef SHOW_SYSCALLS_TASK
37
38/*
39 * MSR_KERNEL is > 0x10000 on 4xx/Book-E since it include MSR_CE.
40 */
41#if MSR_KERNEL >= 0x10000
42#define LOAD_MSR_KERNEL(r, x) lis r,(x)@h; ori r,r,(x)@l
43#else
44#define LOAD_MSR_KERNEL(r, x) li r,(x)
45#endif
46
47#ifdef CONFIG_BOOKE
48#include "head_booke.h"
49#define TRANSFER_TO_HANDLER_EXC_LEVEL(exc_level) \
50 mtspr exc_level##_SPRG,r8; \
51 BOOKE_LOAD_EXC_LEVEL_STACK(exc_level); \
52 lwz r0,GPR10-INT_FRAME_SIZE(r8); \
53 stw r0,GPR10(r11); \
54 lwz r0,GPR11-INT_FRAME_SIZE(r8); \
55 stw r0,GPR11(r11); \
56 mfspr r8,exc_level##_SPRG
57
58 .globl mcheck_transfer_to_handler
59mcheck_transfer_to_handler:
60 TRANSFER_TO_HANDLER_EXC_LEVEL(MCHECK)
61 b transfer_to_handler_full
62
63 .globl debug_transfer_to_handler
64debug_transfer_to_handler:
65 TRANSFER_TO_HANDLER_EXC_LEVEL(DEBUG)
66 b transfer_to_handler_full
67
68 .globl crit_transfer_to_handler
69crit_transfer_to_handler:
70 TRANSFER_TO_HANDLER_EXC_LEVEL(CRIT)
71 /* fall through */
72#endif
73
74#ifdef CONFIG_40x
75 .globl crit_transfer_to_handler
76crit_transfer_to_handler:
77 lwz r0,crit_r10@l(0)
78 stw r0,GPR10(r11)
79 lwz r0,crit_r11@l(0)
80 stw r0,GPR11(r11)
81 /* fall through */
82#endif
83
84/*
85 * This code finishes saving the registers to the exception frame
86 * and jumps to the appropriate handler for the exception, turning
87 * on address translation.
88 * Note that we rely on the caller having set cr0.eq iff the exception
89 * occurred in kernel mode (i.e. MSR:PR = 0).
90 */
91 .globl transfer_to_handler_full
92transfer_to_handler_full:
93 SAVE_NVGPRS(r11)
94 /* fall through */
95
96 .globl transfer_to_handler
97transfer_to_handler:
98 stw r2,GPR2(r11)
99 stw r12,_NIP(r11)
100 stw r9,_MSR(r11)
101 andi. r2,r9,MSR_PR
102 mfctr r12
103 mfspr r2,SPRN_XER
104 stw r12,_CTR(r11)
105 stw r2,_XER(r11)
106 mfspr r12,SPRN_SPRG3
107 addi r2,r12,-THREAD
108 tovirt(r2,r2) /* set r2 to current */
109 beq 2f /* if from user, fix up THREAD.regs */
110 addi r11,r1,STACK_FRAME_OVERHEAD
111 stw r11,PT_REGS(r12)
112#if defined(CONFIG_40x) || defined(CONFIG_BOOKE)
113 /* Check to see if the dbcr0 register is set up to debug. Use the
114 single-step bit to do this. */
115 lwz r12,THREAD_DBCR0(r12)
116 andis. r12,r12,DBCR0_IC@h
117 beq+ 3f
118 /* From user and task is ptraced - load up global dbcr0 */
119 li r12,-1 /* clear all pending debug events */
120 mtspr SPRN_DBSR,r12
121 lis r11,global_dbcr0@ha
122 tophys(r11,r11)
123 addi r11,r11,global_dbcr0@l
124 lwz r12,0(r11)
125 mtspr SPRN_DBCR0,r12
126 lwz r12,4(r11)
127 addi r12,r12,-1
128 stw r12,4(r11)
129#endif
130 b 3f
1312: /* if from kernel, check interrupted DOZE/NAP mode and
132 * check for stack overflow
133 */
134#ifdef CONFIG_6xx
135 mfspr r11,SPRN_HID0
136 mtcr r11
137BEGIN_FTR_SECTION
138 bt- 8,power_save_6xx_restore /* Check DOZE */
139END_FTR_SECTION_IFSET(CPU_FTR_CAN_DOZE)
140BEGIN_FTR_SECTION
141 bt- 9,power_save_6xx_restore /* Check NAP */
142END_FTR_SECTION_IFSET(CPU_FTR_CAN_NAP)
143#endif /* CONFIG_6xx */
144 .globl transfer_to_handler_cont
145transfer_to_handler_cont:
146 lwz r11,THREAD_INFO-THREAD(r12)
147 cmplw r1,r11 /* if r1 <= current->thread_info */
148 ble- stack_ovf /* then the kernel stack overflowed */
1493:
150 mflr r9
151 lwz r11,0(r9) /* virtual address of handler */
152 lwz r9,4(r9) /* where to go when done */
153 FIX_SRR1(r10,r12)
154 mtspr SPRN_SRR0,r11
155 mtspr SPRN_SRR1,r10
156 mtlr r9
157 SYNC
158 RFI /* jump to handler, enable MMU */
159
160/*
161 * On kernel stack overflow, load up an initial stack pointer
162 * and call StackOverflow(regs), which should not return.
163 */
164stack_ovf:
165 /* sometimes we use a statically-allocated stack, which is OK. */
166 lis r11,_end@h
167 ori r11,r11,_end@l
168 cmplw r1,r11
169 ble 3b /* r1 <= &_end is OK */
170 SAVE_NVGPRS(r11)
171 addi r3,r1,STACK_FRAME_OVERHEAD
172 lis r1,init_thread_union@ha
173 addi r1,r1,init_thread_union@l
174 addi r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD
175 lis r9,StackOverflow@ha
176 addi r9,r9,StackOverflow@l
177 LOAD_MSR_KERNEL(r10,MSR_KERNEL)
178 FIX_SRR1(r10,r12)
179 mtspr SPRN_SRR0,r9
180 mtspr SPRN_SRR1,r10
181 SYNC
182 RFI
183
184/*
185 * Handle a system call.
186 */
187 .stabs "arch/powerpc/kernel/",N_SO,0,0,0f
188 .stabs "entry_32.S",N_SO,0,0,0f
1890:
190
191_GLOBAL(DoSyscall)
192 stw r0,THREAD+LAST_SYSCALL(r2)
193 stw r3,ORIG_GPR3(r1)
194 li r12,0
195 stw r12,RESULT(r1)
196 lwz r11,_CCR(r1) /* Clear SO bit in CR */
197 rlwinm r11,r11,0,4,2
198 stw r11,_CCR(r1)
199#ifdef SHOW_SYSCALLS
200 bl do_show_syscall
201#endif /* SHOW_SYSCALLS */
202 rlwinm r10,r1,0,0,(31-THREAD_SHIFT) /* current_thread_info() */
203 li r11,0
204 stb r11,TI_SC_NOERR(r10)
205 lwz r11,TI_FLAGS(r10)
206 andi. r11,r11,_TIF_SYSCALL_T_OR_A
207 bne- syscall_dotrace
208syscall_dotrace_cont:
209 cmplwi 0,r0,NR_syscalls
210 lis r10,sys_call_table@h
211 ori r10,r10,sys_call_table@l
212 slwi r0,r0,2
213 bge- 66f
214 lwzx r10,r10,r0 /* Fetch system call handler [ptr] */
215 mtlr r10
216 addi r9,r1,STACK_FRAME_OVERHEAD
217 PPC440EP_ERR42
218 blrl /* Call handler */
219 .globl ret_from_syscall
220ret_from_syscall:
221#ifdef SHOW_SYSCALLS
222 bl do_show_syscall_exit
223#endif
224 mr r6,r3
225 li r11,-_LAST_ERRNO
226 cmplw 0,r3,r11
227 rlwinm r12,r1,0,0,(31-THREAD_SHIFT) /* current_thread_info() */
228 blt+ 30f
229 lbz r11,TI_SC_NOERR(r12)
230 cmpwi r11,0
231 bne 30f
232 neg r3,r3
233 lwz r10,_CCR(r1) /* Set SO bit in CR */
234 oris r10,r10,0x1000
235 stw r10,_CCR(r1)
236
237 /* disable interrupts so current_thread_info()->flags can't change */
23830: LOAD_MSR_KERNEL(r10,MSR_KERNEL) /* doesn't include MSR_EE */
239 SYNC
240 MTMSRD(r10)
241 lwz r9,TI_FLAGS(r12)
242 andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SIGPENDING|_TIF_NEED_RESCHED)
243 bne- syscall_exit_work
244syscall_exit_cont:
245#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
246 /* If the process has its own DBCR0 value, load it up. The single
247 step bit tells us that dbcr0 should be loaded. */
248 lwz r0,THREAD+THREAD_DBCR0(r2)
249 andis. r10,r0,DBCR0_IC@h
250 bnel- load_dbcr0
251#endif
252 stwcx. r0,0,r1 /* to clear the reservation */
253 lwz r4,_LINK(r1)
254 lwz r5,_CCR(r1)
255 mtlr r4
256 mtcr r5
257 lwz r7,_NIP(r1)
258 lwz r8,_MSR(r1)
259 FIX_SRR1(r8, r0)
260 lwz r2,GPR2(r1)
261 lwz r1,GPR1(r1)
262 mtspr SPRN_SRR0,r7
263 mtspr SPRN_SRR1,r8
264 SYNC
265 RFI
266
26766: li r3,-ENOSYS
268 b ret_from_syscall
269
270 .globl ret_from_fork
271ret_from_fork:
272 REST_NVGPRS(r1)
273 bl schedule_tail
274 li r3,0
275 b ret_from_syscall
276
277/* Traced system call support */
278syscall_dotrace:
279 SAVE_NVGPRS(r1)
280 li r0,0xc00
281 stw r0,_TRAP(r1)
282 addi r3,r1,STACK_FRAME_OVERHEAD
283 bl do_syscall_trace_enter
284 lwz r0,GPR0(r1) /* Restore original registers */
285 lwz r3,GPR3(r1)
286 lwz r4,GPR4(r1)
287 lwz r5,GPR5(r1)
288 lwz r6,GPR6(r1)
289 lwz r7,GPR7(r1)
290 lwz r8,GPR8(r1)
291 REST_NVGPRS(r1)
292 b syscall_dotrace_cont
293
294syscall_exit_work:
295 stw r6,RESULT(r1) /* Save result */
296 stw r3,GPR3(r1) /* Update return value */
297 andi. r0,r9,_TIF_SYSCALL_T_OR_A
298 beq 5f
299 ori r10,r10,MSR_EE
300 SYNC
301 MTMSRD(r10) /* re-enable interrupts */
302 lwz r4,_TRAP(r1)
303 andi. r4,r4,1
304 beq 4f
305 SAVE_NVGPRS(r1)
306 li r4,0xc00
307 stw r4,_TRAP(r1)
3084:
309 addi r3,r1,STACK_FRAME_OVERHEAD
310 bl do_syscall_trace_leave
311 REST_NVGPRS(r1)
3122:
313 lwz r3,GPR3(r1)
314 LOAD_MSR_KERNEL(r10,MSR_KERNEL) /* doesn't include MSR_EE */
315 SYNC
316 MTMSRD(r10) /* disable interrupts again */
317 rlwinm r12,r1,0,0,(31-THREAD_SHIFT) /* current_thread_info() */
318 lwz r9,TI_FLAGS(r12)
3195:
320 andi. r0,r9,_TIF_NEED_RESCHED
321 bne 1f
322 lwz r5,_MSR(r1)
323 andi. r5,r5,MSR_PR
324 beq syscall_exit_cont
325 andi. r0,r9,_TIF_SIGPENDING
326 beq syscall_exit_cont
327 b do_user_signal
3281:
329 ori r10,r10,MSR_EE
330 SYNC
331 MTMSRD(r10) /* re-enable interrupts */
332 bl schedule
333 b 2b
334
335#ifdef SHOW_SYSCALLS
336do_show_syscall:
337#ifdef SHOW_SYSCALLS_TASK
338 lis r11,show_syscalls_task@ha
339 lwz r11,show_syscalls_task@l(r11)
340 cmp 0,r2,r11
341 bnelr
342#endif
343 stw r31,GPR31(r1)
344 mflr r31
345 lis r3,7f@ha
346 addi r3,r3,7f@l
347 lwz r4,GPR0(r1)
348 lwz r5,GPR3(r1)
349 lwz r6,GPR4(r1)
350 lwz r7,GPR5(r1)
351 lwz r8,GPR6(r1)
352 lwz r9,GPR7(r1)
353 bl printk
354 lis r3,77f@ha
355 addi r3,r3,77f@l
356 lwz r4,GPR8(r1)
357 mr r5,r2
358 bl printk
359 lwz r0,GPR0(r1)
360 lwz r3,GPR3(r1)
361 lwz r4,GPR4(r1)
362 lwz r5,GPR5(r1)
363 lwz r6,GPR6(r1)
364 lwz r7,GPR7(r1)
365 lwz r8,GPR8(r1)
366 mtlr r31
367 lwz r31,GPR31(r1)
368 blr
369
370do_show_syscall_exit:
371#ifdef SHOW_SYSCALLS_TASK
372 lis r11,show_syscalls_task@ha
373 lwz r11,show_syscalls_task@l(r11)
374 cmp 0,r2,r11
375 bnelr
376#endif
377 stw r31,GPR31(r1)
378 mflr r31
379 stw r3,RESULT(r1) /* Save result */
380 mr r4,r3
381 lis r3,79f@ha
382 addi r3,r3,79f@l
383 bl printk
384 lwz r3,RESULT(r1)
385 mtlr r31
386 lwz r31,GPR31(r1)
387 blr
388
3897: .string "syscall %d(%x, %x, %x, %x, %x, "
39077: .string "%x), current=%p\n"
39179: .string " -> %x\n"
392 .align 2,0
393
394#ifdef SHOW_SYSCALLS_TASK
395 .data
396 .globl show_syscalls_task
397show_syscalls_task:
398 .long -1
399 .text
400#endif
401#endif /* SHOW_SYSCALLS */
402
403/*
404 * The sigsuspend and rt_sigsuspend system calls can call do_signal
405 * and thus put the process into the stopped state where we might
406 * want to examine its user state with ptrace. Therefore we need
407 * to save all the nonvolatile registers (r13 - r31) before calling
408 * the C code.
409 */
410 .globl ppc_sigsuspend
411ppc_sigsuspend:
412 SAVE_NVGPRS(r1)
413 lwz r0,_TRAP(r1)
414 rlwinm r0,r0,0,0,30 /* clear LSB to indicate full */
415 stw r0,_TRAP(r1) /* register set saved */
416 b sys_sigsuspend
417
418 .globl ppc_rt_sigsuspend
419ppc_rt_sigsuspend:
420 SAVE_NVGPRS(r1)
421 lwz r0,_TRAP(r1)
422 rlwinm r0,r0,0,0,30
423 stw r0,_TRAP(r1)
424 b sys_rt_sigsuspend
425
426 .globl ppc_fork
427ppc_fork:
428 SAVE_NVGPRS(r1)
429 lwz r0,_TRAP(r1)
430 rlwinm r0,r0,0,0,30 /* clear LSB to indicate full */
431 stw r0,_TRAP(r1) /* register set saved */
432 b sys_fork
433
434 .globl ppc_vfork
435ppc_vfork:
436 SAVE_NVGPRS(r1)
437 lwz r0,_TRAP(r1)
438 rlwinm r0,r0,0,0,30 /* clear LSB to indicate full */
439 stw r0,_TRAP(r1) /* register set saved */
440 b sys_vfork
441
442 .globl ppc_clone
443ppc_clone:
444 SAVE_NVGPRS(r1)
445 lwz r0,_TRAP(r1)
446 rlwinm r0,r0,0,0,30 /* clear LSB to indicate full */
447 stw r0,_TRAP(r1) /* register set saved */
448 b sys_clone
449
450 .globl ppc_swapcontext
451ppc_swapcontext:
452 SAVE_NVGPRS(r1)
453 lwz r0,_TRAP(r1)
454 rlwinm r0,r0,0,0,30 /* clear LSB to indicate full */
455 stw r0,_TRAP(r1) /* register set saved */
456 b sys_swapcontext
457
458/*
459 * Top-level page fault handling.
460 * This is in assembler because if do_page_fault tells us that
461 * it is a bad kernel page fault, we want to save the non-volatile
462 * registers before calling bad_page_fault.
463 */
464 .globl handle_page_fault
465handle_page_fault:
466 stw r4,_DAR(r1)
467 addi r3,r1,STACK_FRAME_OVERHEAD
468 bl do_page_fault
469 cmpwi r3,0
470 beq+ ret_from_except
471 SAVE_NVGPRS(r1)
472 lwz r0,_TRAP(r1)
473 clrrwi r0,r0,1
474 stw r0,_TRAP(r1)
475 mr r5,r3
476 addi r3,r1,STACK_FRAME_OVERHEAD
477 lwz r4,_DAR(r1)
478 bl bad_page_fault
479 b ret_from_except_full
480
481/*
482 * This routine switches between two different tasks. The process
483 * state of one is saved on its kernel stack. Then the state
484 * of the other is restored from its kernel stack. The memory
485 * management hardware is updated to the second process's state.
486 * Finally, we can return to the second process.
487 * On entry, r3 points to the THREAD for the current task, r4
488 * points to the THREAD for the new task.
489 *
490 * This routine is always called with interrupts disabled.
491 *
492 * Note: there are two ways to get to the "going out" portion
493 * of this code; either by coming in via the entry (_switch)
494 * or via "fork" which must set up an environment equivalent
495 * to the "_switch" path. If you change this , you'll have to
496 * change the fork code also.
497 *
498 * The code which creates the new task context is in 'copy_thread'
499 * in arch/ppc/kernel/process.c
500 */
501_GLOBAL(_switch)
502 stwu r1,-INT_FRAME_SIZE(r1)
503 mflr r0
504 stw r0,INT_FRAME_SIZE+4(r1)
505 /* r3-r12 are caller saved -- Cort */
506 SAVE_NVGPRS(r1)
507 stw r0,_NIP(r1) /* Return to switch caller */
508 mfmsr r11
509 li r0,MSR_FP /* Disable floating-point */
510#ifdef CONFIG_ALTIVEC
511BEGIN_FTR_SECTION
512 oris r0,r0,MSR_VEC@h /* Disable altivec */
513 mfspr r12,SPRN_VRSAVE /* save vrsave register value */
514 stw r12,THREAD+THREAD_VRSAVE(r2)
515END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
516#endif /* CONFIG_ALTIVEC */
517#ifdef CONFIG_SPE
518 oris r0,r0,MSR_SPE@h /* Disable SPE */
519 mfspr r12,SPRN_SPEFSCR /* save spefscr register value */
520 stw r12,THREAD+THREAD_SPEFSCR(r2)
521#endif /* CONFIG_SPE */
522 and. r0,r0,r11 /* FP or altivec or SPE enabled? */
523 beq+ 1f
524 andc r11,r11,r0
525 MTMSRD(r11)
526 isync
5271: stw r11,_MSR(r1)
528 mfcr r10
529 stw r10,_CCR(r1)
530 stw r1,KSP(r3) /* Set old stack pointer */
531
532#ifdef CONFIG_SMP
533 /* We need a sync somewhere here to make sure that if the
534 * previous task gets rescheduled on another CPU, it sees all
535 * stores it has performed on this one.
536 */
537 sync
538#endif /* CONFIG_SMP */
539
540 tophys(r0,r4)
541 CLR_TOP32(r0)
542 mtspr SPRN_SPRG3,r0 /* Update current THREAD phys addr */
543 lwz r1,KSP(r4) /* Load new stack pointer */
544
545 /* save the old current 'last' for return value */
546 mr r3,r2
547 addi r2,r4,-THREAD /* Update current */
548
549#ifdef CONFIG_ALTIVEC
550BEGIN_FTR_SECTION
551 lwz r0,THREAD+THREAD_VRSAVE(r2)
552 mtspr SPRN_VRSAVE,r0 /* if G4, restore VRSAVE reg */
553END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
554#endif /* CONFIG_ALTIVEC */
555#ifdef CONFIG_SPE
556 lwz r0,THREAD+THREAD_SPEFSCR(r2)
557 mtspr SPRN_SPEFSCR,r0 /* restore SPEFSCR reg */
558#endif /* CONFIG_SPE */
559
560 lwz r0,_CCR(r1)
561 mtcrf 0xFF,r0
562 /* r3-r12 are destroyed -- Cort */
563 REST_NVGPRS(r1)
564
565 lwz r4,_NIP(r1) /* Return to _switch caller in new task */
566 mtlr r4
567 addi r1,r1,INT_FRAME_SIZE
568 blr
569
570 .globl fast_exception_return
571fast_exception_return:
572#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE))
573 andi. r10,r9,MSR_RI /* check for recoverable interrupt */
574 beq 1f /* if not, we've got problems */
575#endif
576
5772: REST_4GPRS(3, r11)
578 lwz r10,_CCR(r11)
579 REST_GPR(1, r11)
580 mtcr r10
581 lwz r10,_LINK(r11)
582 mtlr r10
583 REST_GPR(10, r11)
584 mtspr SPRN_SRR1,r9
585 mtspr SPRN_SRR0,r12
586 REST_GPR(9, r11)
587 REST_GPR(12, r11)
588 lwz r11,GPR11(r11)
589 SYNC
590 RFI
591
592#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE))
593/* check if the exception happened in a restartable section */
5941: lis r3,exc_exit_restart_end@ha
595 addi r3,r3,exc_exit_restart_end@l
596 cmplw r12,r3
597 bge 3f
598 lis r4,exc_exit_restart@ha
599 addi r4,r4,exc_exit_restart@l
600 cmplw r12,r4
601 blt 3f
602 lis r3,fee_restarts@ha
603 tophys(r3,r3)
604 lwz r5,fee_restarts@l(r3)
605 addi r5,r5,1
606 stw r5,fee_restarts@l(r3)
607 mr r12,r4 /* restart at exc_exit_restart */
608 b 2b
609
610 .comm fee_restarts,4
611
612/* aargh, a nonrecoverable interrupt, panic */
613/* aargh, we don't know which trap this is */
614/* but the 601 doesn't implement the RI bit, so assume it's OK */
6153:
616BEGIN_FTR_SECTION
617 b 2b
618END_FTR_SECTION_IFSET(CPU_FTR_601)
619 li r10,-1
620 stw r10,_TRAP(r11)
621 addi r3,r1,STACK_FRAME_OVERHEAD
622 lis r10,MSR_KERNEL@h
623 ori r10,r10,MSR_KERNEL@l
624 bl transfer_to_handler_full
625 .long nonrecoverable_exception
626 .long ret_from_except
627#endif
628
629 .globl sigreturn_exit
630sigreturn_exit:
631 subi r1,r3,STACK_FRAME_OVERHEAD
632 rlwinm r12,r1,0,0,(31-THREAD_SHIFT) /* current_thread_info() */
633 lwz r9,TI_FLAGS(r12)
634 andi. r0,r9,_TIF_SYSCALL_T_OR_A
635 beq+ ret_from_except_full
636 bl do_syscall_trace_leave
637 /* fall through */
638
639 .globl ret_from_except_full
640ret_from_except_full:
641 REST_NVGPRS(r1)
642 /* fall through */
643
644 .globl ret_from_except
645ret_from_except:
646 /* Hard-disable interrupts so that current_thread_info()->flags
647 * can't change between when we test it and when we return
648 * from the interrupt. */
649 LOAD_MSR_KERNEL(r10,MSR_KERNEL)
650 SYNC /* Some chip revs have problems here... */
651 MTMSRD(r10) /* disable interrupts */
652
653 lwz r3,_MSR(r1) /* Returning to user mode? */
654 andi. r0,r3,MSR_PR
655 beq resume_kernel
656
657user_exc_return: /* r10 contains MSR_KERNEL here */
658 /* Check current_thread_info()->flags */
659 rlwinm r9,r1,0,0,(31-THREAD_SHIFT)
660 lwz r9,TI_FLAGS(r9)
661 andi. r0,r9,(_TIF_SIGPENDING|_TIF_NEED_RESCHED)
662 bne do_work
663
664restore_user:
665#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
666 /* Check whether this process has its own DBCR0 value. The single
667 step bit tells us that dbcr0 should be loaded. */
668 lwz r0,THREAD+THREAD_DBCR0(r2)
669 andis. r10,r0,DBCR0_IC@h
670 bnel- load_dbcr0
671#endif
672
673#ifdef CONFIG_PREEMPT
674 b restore
675
676/* N.B. the only way to get here is from the beq following ret_from_except. */
677resume_kernel:
678 /* check current_thread_info->preempt_count */
679 rlwinm r9,r1,0,0,(31-THREAD_SHIFT)
680 lwz r0,TI_PREEMPT(r9)
681 cmpwi 0,r0,0 /* if non-zero, just restore regs and return */
682 bne restore
683 lwz r0,TI_FLAGS(r9)
684 andi. r0,r0,_TIF_NEED_RESCHED
685 beq+ restore
686 andi. r0,r3,MSR_EE /* interrupts off? */
687 beq restore /* don't schedule if so */
6881: bl preempt_schedule_irq
689 rlwinm r9,r1,0,0,(31-THREAD_SHIFT)
690 lwz r3,TI_FLAGS(r9)
691 andi. r0,r3,_TIF_NEED_RESCHED
692 bne- 1b
693#else
694resume_kernel:
695#endif /* CONFIG_PREEMPT */
696
697 /* interrupts are hard-disabled at this point */
698restore:
699 lwz r0,GPR0(r1)
700 lwz r2,GPR2(r1)
701 REST_4GPRS(3, r1)
702 REST_2GPRS(7, r1)
703
704 lwz r10,_XER(r1)
705 lwz r11,_CTR(r1)
706 mtspr SPRN_XER,r10
707 mtctr r11
708
709 PPC405_ERR77(0,r1)
710 stwcx. r0,0,r1 /* to clear the reservation */
711
712#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE))
713 lwz r9,_MSR(r1)
714 andi. r10,r9,MSR_RI /* check if this exception occurred */
715 beql nonrecoverable /* at a bad place (MSR:RI = 0) */
716
717 lwz r10,_CCR(r1)
718 lwz r11,_LINK(r1)
719 mtcrf 0xFF,r10
720 mtlr r11
721
722 /*
723 * Once we put values in SRR0 and SRR1, we are in a state
724 * where exceptions are not recoverable, since taking an
725 * exception will trash SRR0 and SRR1. Therefore we clear the
726 * MSR:RI bit to indicate this. If we do take an exception,
727 * we can't return to the point of the exception but we
728 * can restart the exception exit path at the label
729 * exc_exit_restart below. -- paulus
730 */
731 LOAD_MSR_KERNEL(r10,MSR_KERNEL & ~MSR_RI)
732 SYNC
733 MTMSRD(r10) /* clear the RI bit */
734 .globl exc_exit_restart
735exc_exit_restart:
736 lwz r9,_MSR(r1)
737 lwz r12,_NIP(r1)
738 FIX_SRR1(r9,r10)
739 mtspr SPRN_SRR0,r12
740 mtspr SPRN_SRR1,r9
741 REST_4GPRS(9, r1)
742 lwz r1,GPR1(r1)
743 .globl exc_exit_restart_end
744exc_exit_restart_end:
745 SYNC
746 RFI
747
748#else /* !(CONFIG_4xx || CONFIG_BOOKE) */
749 /*
750 * This is a bit different on 4xx/Book-E because it doesn't have
751 * the RI bit in the MSR.
752 * The TLB miss handler checks if we have interrupted
753 * the exception exit path and restarts it if so
754 * (well maybe one day it will... :).
755 */
756 lwz r11,_LINK(r1)
757 mtlr r11
758 lwz r10,_CCR(r1)
759 mtcrf 0xff,r10
760 REST_2GPRS(9, r1)
761 .globl exc_exit_restart
762exc_exit_restart:
763 lwz r11,_NIP(r1)
764 lwz r12,_MSR(r1)
765exc_exit_start:
766 mtspr SPRN_SRR0,r11
767 mtspr SPRN_SRR1,r12
768 REST_2GPRS(11, r1)
769 lwz r1,GPR1(r1)
770 .globl exc_exit_restart_end
771exc_exit_restart_end:
772 PPC405_ERR77_SYNC
773 rfi
774 b . /* prevent prefetch past rfi */
775
776/*
777 * Returning from a critical interrupt in user mode doesn't need
778 * to be any different from a normal exception. For a critical
779 * interrupt in the kernel, we just return (without checking for
780 * preemption) since the interrupt may have happened at some crucial
781 * place (e.g. inside the TLB miss handler), and because we will be
782 * running with r1 pointing into critical_stack, not the current
783 * process's kernel stack (and therefore current_thread_info() will
784 * give the wrong answer).
785 * We have to restore various SPRs that may have been in use at the
786 * time of the critical interrupt.
787 *
788 */
789#ifdef CONFIG_40x
790#define PPC_40x_TURN_OFF_MSR_DR \
791 /* avoid any possible TLB misses here by turning off MSR.DR, we \
792 * assume the instructions here are mapped by a pinned TLB entry */ \
793 li r10,MSR_IR; \
794 mtmsr r10; \
795 isync; \
796 tophys(r1, r1);
797#else
798#define PPC_40x_TURN_OFF_MSR_DR
799#endif
800
801#define RET_FROM_EXC_LEVEL(exc_lvl_srr0, exc_lvl_srr1, exc_lvl_rfi) \
802 REST_NVGPRS(r1); \
803 lwz r3,_MSR(r1); \
804 andi. r3,r3,MSR_PR; \
805 LOAD_MSR_KERNEL(r10,MSR_KERNEL); \
806 bne user_exc_return; \
807 lwz r0,GPR0(r1); \
808 lwz r2,GPR2(r1); \
809 REST_4GPRS(3, r1); \
810 REST_2GPRS(7, r1); \
811 lwz r10,_XER(r1); \
812 lwz r11,_CTR(r1); \
813 mtspr SPRN_XER,r10; \
814 mtctr r11; \
815 PPC405_ERR77(0,r1); \
816 stwcx. r0,0,r1; /* to clear the reservation */ \
817 lwz r11,_LINK(r1); \
818 mtlr r11; \
819 lwz r10,_CCR(r1); \
820 mtcrf 0xff,r10; \
821 PPC_40x_TURN_OFF_MSR_DR; \
822 lwz r9,_DEAR(r1); \
823 lwz r10,_ESR(r1); \
824 mtspr SPRN_DEAR,r9; \
825 mtspr SPRN_ESR,r10; \
826 lwz r11,_NIP(r1); \
827 lwz r12,_MSR(r1); \
828 mtspr exc_lvl_srr0,r11; \
829 mtspr exc_lvl_srr1,r12; \
830 lwz r9,GPR9(r1); \
831 lwz r12,GPR12(r1); \
832 lwz r10,GPR10(r1); \
833 lwz r11,GPR11(r1); \
834 lwz r1,GPR1(r1); \
835 PPC405_ERR77_SYNC; \
836 exc_lvl_rfi; \
837 b .; /* prevent prefetch past exc_lvl_rfi */
838
839 .globl ret_from_crit_exc
840ret_from_crit_exc:
841 RET_FROM_EXC_LEVEL(SPRN_CSRR0, SPRN_CSRR1, RFCI)
842
843#ifdef CONFIG_BOOKE
844 .globl ret_from_debug_exc
845ret_from_debug_exc:
846 RET_FROM_EXC_LEVEL(SPRN_DSRR0, SPRN_DSRR1, RFDI)
847
848 .globl ret_from_mcheck_exc
849ret_from_mcheck_exc:
850 RET_FROM_EXC_LEVEL(SPRN_MCSRR0, SPRN_MCSRR1, RFMCI)
851#endif /* CONFIG_BOOKE */
852
853/*
854 * Load the DBCR0 value for a task that is being ptraced,
855 * having first saved away the global DBCR0. Note that r0
856 * has the dbcr0 value to set upon entry to this.
857 */
858load_dbcr0:
859 mfmsr r10 /* first disable debug exceptions */
860 rlwinm r10,r10,0,~MSR_DE
861 mtmsr r10
862 isync
863 mfspr r10,SPRN_DBCR0
864 lis r11,global_dbcr0@ha
865 addi r11,r11,global_dbcr0@l
866 stw r10,0(r11)
867 mtspr SPRN_DBCR0,r0
868 lwz r10,4(r11)
869 addi r10,r10,1
870 stw r10,4(r11)
871 li r11,-1
872 mtspr SPRN_DBSR,r11 /* clear all pending debug events */
873 blr
874
875 .comm global_dbcr0,8
876#endif /* !(CONFIG_4xx || CONFIG_BOOKE) */
877
878do_work: /* r10 contains MSR_KERNEL here */
879 andi. r0,r9,_TIF_NEED_RESCHED
880 beq do_user_signal
881
882do_resched: /* r10 contains MSR_KERNEL here */
883 ori r10,r10,MSR_EE
884 SYNC
885 MTMSRD(r10) /* hard-enable interrupts */
886 bl schedule
887recheck:
888 LOAD_MSR_KERNEL(r10,MSR_KERNEL)
889 SYNC
890 MTMSRD(r10) /* disable interrupts */
891 rlwinm r9,r1,0,0,(31-THREAD_SHIFT)
892 lwz r9,TI_FLAGS(r9)
893 andi. r0,r9,_TIF_NEED_RESCHED
894 bne- do_resched
895 andi. r0,r9,_TIF_SIGPENDING
896 beq restore_user
897do_user_signal: /* r10 contains MSR_KERNEL here */
898 ori r10,r10,MSR_EE
899 SYNC
900 MTMSRD(r10) /* hard-enable interrupts */
901 /* save r13-r31 in the exception frame, if not already done */
902 lwz r3,_TRAP(r1)
903 andi. r0,r3,1
904 beq 2f
905 SAVE_NVGPRS(r1)
906 rlwinm r3,r3,0,0,30
907 stw r3,_TRAP(r1)
9082: li r3,0
909 addi r4,r1,STACK_FRAME_OVERHEAD
910 bl do_signal
911 REST_NVGPRS(r1)
912 b recheck
913
914/*
915 * We come here when we are at the end of handling an exception
916 * that occurred at a place where taking an exception will lose
917 * state information, such as the contents of SRR0 and SRR1.
918 */
919nonrecoverable:
920 lis r10,exc_exit_restart_end@ha
921 addi r10,r10,exc_exit_restart_end@l
922 cmplw r12,r10
923 bge 3f
924 lis r11,exc_exit_restart@ha
925 addi r11,r11,exc_exit_restart@l
926 cmplw r12,r11
927 blt 3f
928 lis r10,ee_restarts@ha
929 lwz r12,ee_restarts@l(r10)
930 addi r12,r12,1
931 stw r12,ee_restarts@l(r10)
932 mr r12,r11 /* restart at exc_exit_restart */
933 blr
9343: /* OK, we can't recover, kill this process */
935 /* but the 601 doesn't implement the RI bit, so assume it's OK */
936BEGIN_FTR_SECTION
937 blr
938END_FTR_SECTION_IFSET(CPU_FTR_601)
939 lwz r3,_TRAP(r1)
940 andi. r0,r3,1
941 beq 4f
942 SAVE_NVGPRS(r1)
943 rlwinm r3,r3,0,0,30
944 stw r3,_TRAP(r1)
9454: addi r3,r1,STACK_FRAME_OVERHEAD
946 bl nonrecoverable_exception
947 /* shouldn't return */
948 b 4b
949
950 .comm ee_restarts,4
951
952/*
953 * PROM code for specific machines follows. Put it
954 * here so it's easy to add arch-specific sections later.
955 * -- Cort
956 */
957#ifdef CONFIG_PPC_RTAS
958/*
959 * On CHRP, the Run-Time Abstraction Services (RTAS) have to be
960 * called with the MMU off.
961 */
962_GLOBAL(enter_rtas)
963 stwu r1,-INT_FRAME_SIZE(r1)
964 mflr r0
965 stw r0,INT_FRAME_SIZE+4(r1)
966 LOADADDR(r4, rtas)
967 lis r6,1f@ha /* physical return address for rtas */
968 addi r6,r6,1f@l
969 tophys(r6,r6)
970 tophys(r7,r1)
971 lwz r8,RTASENTRY(r4)
972 lwz r4,RTASBASE(r4)
973 mfmsr r9
974 stw r9,8(r1)
975 LOAD_MSR_KERNEL(r0,MSR_KERNEL)
976 SYNC /* disable interrupts so SRR0/1 */
977 MTMSRD(r0) /* don't get trashed */
978 li r9,MSR_KERNEL & ~(MSR_IR|MSR_DR)
979 mtlr r6
980 mtspr SPRN_SPRG2,r7
981 mtspr SPRN_SRR0,r8
982 mtspr SPRN_SRR1,r9
983 RFI
9841: tophys(r9,r1)
985 lwz r8,INT_FRAME_SIZE+4(r9) /* get return address */
986 lwz r9,8(r9) /* original msr value */
987 FIX_SRR1(r9,r0)
988 addi r1,r1,INT_FRAME_SIZE
989 li r0,0
990 mtspr SPRN_SPRG2,r0
991 mtspr SPRN_SRR0,r8
992 mtspr SPRN_SRR1,r9
993 RFI /* return to caller */
994
995 .globl machine_check_in_rtas
996machine_check_in_rtas:
997 twi 31,0,0
998 /* XXX load up BATs and panic */
999
1000#endif /* CONFIG_PPC_RTAS */
diff --git a/arch/ppc64/kernel/entry.S b/arch/powerpc/kernel/entry_64.S
index e8c0bbf4d000..984a10630714 100644
--- a/arch/ppc64/kernel/entry.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -42,9 +42,6 @@
42.SYS_CALL_TABLE: 42.SYS_CALL_TABLE:
43 .tc .sys_call_table[TC],.sys_call_table 43 .tc .sys_call_table[TC],.sys_call_table
44 44
45.SYS_CALL_TABLE32:
46 .tc .sys_call_table32[TC],.sys_call_table32
47
48/* This value is used to mark exception frames on the stack. */ 45/* This value is used to mark exception frames on the stack. */
49exception_marker: 46exception_marker:
50 .tc ID_72656773_68657265[TC],0x7265677368657265 47 .tc ID_72656773_68657265[TC],0x7265677368657265
@@ -133,7 +130,7 @@ system_call: /* label this so stack traces look sane */
133 ld r11,.SYS_CALL_TABLE@toc(2) 130 ld r11,.SYS_CALL_TABLE@toc(2)
134 andi. r10,r10,_TIF_32BIT 131 andi. r10,r10,_TIF_32BIT
135 beq 15f 132 beq 15f
136 ld r11,.SYS_CALL_TABLE32@toc(2) 133 addi r11,r11,8 /* use 32-bit syscall entries */
137 clrldi r3,r3,32 134 clrldi r3,r3,32
138 clrldi r4,r4,32 135 clrldi r4,r4,32
139 clrldi r5,r5,32 136 clrldi r5,r5,32
@@ -141,7 +138,7 @@ system_call: /* label this so stack traces look sane */
141 clrldi r7,r7,32 138 clrldi r7,r7,32
142 clrldi r8,r8,32 139 clrldi r8,r8,32
14315: 14015:
144 slwi r0,r0,3 141 slwi r0,r0,4
145 ldx r10,r11,r0 /* Fetch system call handler [ptr] */ 142 ldx r10,r11,r0 /* Fetch system call handler [ptr] */
146 mtctr r10 143 mtctr r10
147 bctrl /* Call handler */ 144 bctrl /* Call handler */
@@ -191,8 +188,8 @@ syscall_exit_trace_cont:
191 ld r1,GPR1(r1) 188 ld r1,GPR1(r1)
192 mtlr r4 189 mtlr r4
193 mtcr r5 190 mtcr r5
194 mtspr SRR0,r7 191 mtspr SPRN_SRR0,r7
195 mtspr SRR1,r8 192 mtspr SPRN_SRR1,r8
196 rfid 193 rfid
197 b . /* prevent speculative execution */ 194 b . /* prevent speculative execution */
198 195
@@ -265,7 +262,7 @@ _GLOBAL(save_nvgprs)
265 */ 262 */
266_GLOBAL(ppc32_sigsuspend) 263_GLOBAL(ppc32_sigsuspend)
267 bl .save_nvgprs 264 bl .save_nvgprs
268 bl .sys32_sigsuspend 265 bl .compat_sys_sigsuspend
269 b 70f 266 b 70f
270 267
271_GLOBAL(ppc64_rt_sigsuspend) 268_GLOBAL(ppc64_rt_sigsuspend)
@@ -275,7 +272,7 @@ _GLOBAL(ppc64_rt_sigsuspend)
275 272
276_GLOBAL(ppc32_rt_sigsuspend) 273_GLOBAL(ppc32_rt_sigsuspend)
277 bl .save_nvgprs 274 bl .save_nvgprs
278 bl .sys32_rt_sigsuspend 275 bl .compat_sys_rt_sigsuspend
27970: cmpdi 0,r3,0 27670: cmpdi 0,r3,0
280 /* If it returned an error, we need to return via syscall_exit to set 277 /* If it returned an error, we need to return via syscall_exit to set
281 the SO bit in cr0 and potentially stop for ptrace. */ 278 the SO bit in cr0 and potentially stop for ptrace. */
@@ -310,7 +307,7 @@ _GLOBAL(ppc_clone)
310 307
311_GLOBAL(ppc32_swapcontext) 308_GLOBAL(ppc32_swapcontext)
312 bl .save_nvgprs 309 bl .save_nvgprs
313 bl .sys32_swapcontext 310 bl .compat_sys_swapcontext
314 b 80f 311 b 80f
315 312
316_GLOBAL(ppc64_swapcontext) 313_GLOBAL(ppc64_swapcontext)
@@ -319,11 +316,11 @@ _GLOBAL(ppc64_swapcontext)
319 b 80f 316 b 80f
320 317
321_GLOBAL(ppc32_sigreturn) 318_GLOBAL(ppc32_sigreturn)
322 bl .sys32_sigreturn 319 bl .compat_sys_sigreturn
323 b 80f 320 b 80f
324 321
325_GLOBAL(ppc32_rt_sigreturn) 322_GLOBAL(ppc32_rt_sigreturn)
326 bl .sys32_rt_sigreturn 323 bl .compat_sys_rt_sigreturn
327 b 80f 324 b 80f
328 325
329_GLOBAL(ppc64_rt_sigreturn) 326_GLOBAL(ppc64_rt_sigreturn)
@@ -531,7 +528,7 @@ restore:
531 mtctr r3 528 mtctr r3
532 mtlr r0 529 mtlr r0
533 ld r3,_XER(r1) 530 ld r3,_XER(r1)
534 mtspr XER,r3 531 mtspr SPRN_XER,r3
535 532
536 REST_8GPRS(5, r1) 533 REST_8GPRS(5, r1)
537 534
@@ -543,12 +540,12 @@ restore:
543 mtmsrd r0,1 540 mtmsrd r0,1
544 541
545 ld r0,_MSR(r1) 542 ld r0,_MSR(r1)
546 mtspr SRR1,r0 543 mtspr SPRN_SRR1,r0
547 544
548 ld r2,_CCR(r1) 545 ld r2,_CCR(r1)
549 mtcrf 0xFF,r2 546 mtcrf 0xFF,r2
550 ld r2,_NIP(r1) 547 ld r2,_NIP(r1)
551 mtspr SRR0,r2 548 mtspr SPRN_SRR0,r2
552 549
553 ld r0,GPR0(r1) 550 ld r0,GPR0(r1)
554 ld r2,GPR2(r1) 551 ld r2,GPR2(r1)
@@ -643,7 +640,7 @@ _GLOBAL(enter_rtas)
643 std r4,_CCR(r1) 640 std r4,_CCR(r1)
644 mfctr r5 641 mfctr r5
645 std r5,_CTR(r1) 642 std r5,_CTR(r1)
646 mfspr r6,XER 643 mfspr r6,SPRN_XER
647 std r6,_XER(r1) 644 std r6,_XER(r1)
648 mfdar r7 645 mfdar r7
649 std r7,_DAR(r1) 646 std r7,_DAR(r1)
@@ -697,14 +694,14 @@ _GLOBAL(enter_rtas)
697 ld r5,RTASENTRY(r4) /* get the rtas->entry value */ 694 ld r5,RTASENTRY(r4) /* get the rtas->entry value */
698 ld r4,RTASBASE(r4) /* get the rtas->base value */ 695 ld r4,RTASBASE(r4) /* get the rtas->base value */
699 696
700 mtspr SRR0,r5 697 mtspr SPRN_SRR0,r5
701 mtspr SRR1,r6 698 mtspr SPRN_SRR1,r6
702 rfid 699 rfid
703 b . /* prevent speculative execution */ 700 b . /* prevent speculative execution */
704 701
705_STATIC(rtas_return_loc) 702_STATIC(rtas_return_loc)
706 /* relocation is off at this point */ 703 /* relocation is off at this point */
707 mfspr r4,SPRG3 /* Get PACA */ 704 mfspr r4,SPRN_SPRG3 /* Get PACA */
708 SET_REG_TO_CONST(r5, KERNELBASE) 705 SET_REG_TO_CONST(r5, KERNELBASE)
709 sub r4,r4,r5 /* RELOC the PACA base pointer */ 706 sub r4,r4,r5 /* RELOC the PACA base pointer */
710 707
@@ -718,8 +715,8 @@ _STATIC(rtas_return_loc)
718 LOADADDR(r3,.rtas_restore_regs) 715 LOADADDR(r3,.rtas_restore_regs)
719 ld r4,PACASAVEDMSR(r4) /* Restore our MSR */ 716 ld r4,PACASAVEDMSR(r4) /* Restore our MSR */
720 717
721 mtspr SRR0,r3 718 mtspr SPRN_SRR0,r3
722 mtspr SRR1,r4 719 mtspr SPRN_SRR1,r4
723 rfid 720 rfid
724 b . /* prevent speculative execution */ 721 b . /* prevent speculative execution */
725 722
@@ -730,14 +727,14 @@ _STATIC(rtas_restore_regs)
730 REST_8GPRS(14, r1) /* Restore the non-volatiles */ 727 REST_8GPRS(14, r1) /* Restore the non-volatiles */
731 REST_10GPRS(22, r1) /* ditto */ 728 REST_10GPRS(22, r1) /* ditto */
732 729
733 mfspr r13,SPRG3 730 mfspr r13,SPRN_SPRG3
734 731
735 ld r4,_CCR(r1) 732 ld r4,_CCR(r1)
736 mtcr r4 733 mtcr r4
737 ld r5,_CTR(r1) 734 ld r5,_CTR(r1)
738 mtctr r5 735 mtctr r5
739 ld r6,_XER(r1) 736 ld r6,_XER(r1)
740 mtspr XER,r6 737 mtspr SPRN_XER,r6
741 ld r7,_DAR(r1) 738 ld r7,_DAR(r1)
742 mtdar r7 739 mtdar r7
743 ld r8,_DSISR(r1) 740 ld r8,_DSISR(r1)
@@ -774,7 +771,7 @@ _GLOBAL(enter_prom)
774 std r4,_CCR(r1) 771 std r4,_CCR(r1)
775 mfctr r5 772 mfctr r5
776 std r5,_CTR(r1) 773 std r5,_CTR(r1)
777 mfspr r6,XER 774 mfspr r6,SPRN_XER
778 std r6,_XER(r1) 775 std r6,_XER(r1)
779 mfdar r7 776 mfdar r7
780 std r7,_DAR(r1) 777 std r7,_DAR(r1)
@@ -827,7 +824,7 @@ _GLOBAL(enter_prom)
827 ld r5,_CTR(r1) 824 ld r5,_CTR(r1)
828 mtctr r5 825 mtctr r5
829 ld r6,_XER(r1) 826 ld r6,_XER(r1)
830 mtspr XER,r6 827 mtspr SPRN_XER,r6
831 ld r7,_DAR(r1) 828 ld r7,_DAR(r1)
832 mtdar r7 829 mtdar r7
833 ld r8,_DSISR(r1) 830 ld r8,_DSISR(r1)
diff --git a/arch/ppc/kernel/fpu.S b/arch/powerpc/kernel/fpu.S
index 665d7d34304c..4d6001fa1cf2 100644
--- a/arch/ppc/kernel/fpu.S
+++ b/arch/powerpc/kernel/fpu.S
@@ -10,7 +10,7 @@
10 */ 10 */
11 11
12#include <linux/config.h> 12#include <linux/config.h>
13#include <asm/processor.h> 13#include <asm/reg.h>
14#include <asm/page.h> 14#include <asm/page.h>
15#include <asm/mmu.h> 15#include <asm/mmu.h>
16#include <asm/pgtable.h> 16#include <asm/pgtable.h>
@@ -27,13 +27,9 @@
27 * Load up this task's FP registers from its thread_struct, 27 * Load up this task's FP registers from its thread_struct,
28 * enable the FPU for the current task and return to the task. 28 * enable the FPU for the current task and return to the task.
29 */ 29 */
30 .globl load_up_fpu 30_GLOBAL(load_up_fpu)
31load_up_fpu:
32 mfmsr r5 31 mfmsr r5
33 ori r5,r5,MSR_FP 32 ori r5,r5,MSR_FP
34#ifdef CONFIG_PPC64BRIDGE
35 clrldi r5,r5,1 /* turn off 64-bit mode */
36#endif /* CONFIG_PPC64BRIDGE */
37 SYNC 33 SYNC
38 MTMSRD(r5) /* enable use of fpu now */ 34 MTMSRD(r5) /* enable use of fpu now */
39 isync 35 isync
@@ -43,67 +39,57 @@ load_up_fpu:
43 * to another. Instead we call giveup_fpu in switch_to. 39 * to another. Instead we call giveup_fpu in switch_to.
44 */ 40 */
45#ifndef CONFIG_SMP 41#ifndef CONFIG_SMP
46 tophys(r6,0) /* get __pa constant */ 42 LOADBASE(r3, last_task_used_math)
47 addis r3,r6,last_task_used_math@ha 43 toreal(r3)
48 lwz r4,last_task_used_math@l(r3) 44 LDL r4,OFF(last_task_used_math)(r3)
49 cmpwi 0,r4,0 45 CMPI 0,r4,0
50 beq 1f 46 beq 1f
51 add r4,r4,r6 47 toreal(r4)
52 addi r4,r4,THREAD /* want last_task_used_math->thread */ 48 addi r4,r4,THREAD /* want last_task_used_math->thread */
53 SAVE_32FPRS(0, r4) 49 SAVE_32FPRS(0, r4)
54 mffs fr0 50 mffs fr0
55 stfd fr0,THREAD_FPSCR-4(r4) 51 stfd fr0,THREAD_FPSCR(r4)
56 lwz r5,PT_REGS(r4) 52 LDL r5,PT_REGS(r4)
57 add r5,r5,r6 53 toreal(r5)
58 lwz r4,_MSR-STACK_FRAME_OVERHEAD(r5) 54 LDL r4,_MSR-STACK_FRAME_OVERHEAD(r5)
59 li r10,MSR_FP|MSR_FE0|MSR_FE1 55 li r10,MSR_FP|MSR_FE0|MSR_FE1
60 andc r4,r4,r10 /* disable FP for previous task */ 56 andc r4,r4,r10 /* disable FP for previous task */
61 stw r4,_MSR-STACK_FRAME_OVERHEAD(r5) 57 STL r4,_MSR-STACK_FRAME_OVERHEAD(r5)
621: 581:
63#endif /* CONFIG_SMP */ 59#endif /* CONFIG_SMP */
64 /* enable use of FP after return */ 60 /* enable use of FP after return */
61#ifdef CONFIG_PPC32
65 mfspr r5,SPRN_SPRG3 /* current task's THREAD (phys) */ 62 mfspr r5,SPRN_SPRG3 /* current task's THREAD (phys) */
66 lwz r4,THREAD_FPEXC_MODE(r5) 63 lwz r4,THREAD_FPEXC_MODE(r5)
67 ori r9,r9,MSR_FP /* enable FP for current */ 64 ori r9,r9,MSR_FP /* enable FP for current */
68 or r9,r9,r4 65 or r9,r9,r4
69 lfd fr0,THREAD_FPSCR-4(r5) 66#else
67 ld r4,PACACURRENT(r13)
68 addi r5,r4,THREAD /* Get THREAD */
69 ld r4,THREAD_FPEXC_MODE(r5)
70 ori r12,r12,MSR_FP
71 or r12,r12,r4
72 std r12,_MSR(r1)
73#endif
74 lfd fr0,THREAD_FPSCR(r5)
70 mtfsf 0xff,fr0 75 mtfsf 0xff,fr0
71 REST_32FPRS(0, r5) 76 REST_32FPRS(0, r5)
72#ifndef CONFIG_SMP 77#ifndef CONFIG_SMP
73 subi r4,r5,THREAD 78 subi r4,r5,THREAD
74 sub r4,r4,r6 79 fromreal(r4)
75 stw r4,last_task_used_math@l(r3) 80 STL r4,OFF(last_task_used_math)(r3)
76#endif /* CONFIG_SMP */ 81#endif /* CONFIG_SMP */
77 /* restore registers and return */ 82 /* restore registers and return */
78 /* we haven't used ctr or xer or lr */ 83 /* we haven't used ctr or xer or lr */
79 b fast_exception_return 84 b fast_exception_return
80 85
81/* 86/*
82 * FP unavailable trap from kernel - print a message, but let
83 * the task use FP in the kernel until it returns to user mode.
84 */
85 .globl KernelFP
86KernelFP:
87 lwz r3,_MSR(r1)
88 ori r3,r3,MSR_FP
89 stw r3,_MSR(r1) /* enable use of FP after return */
90 lis r3,86f@h
91 ori r3,r3,86f@l
92 mr r4,r2 /* current */
93 lwz r5,_NIP(r1)
94 bl printk
95 b ret_from_except
9686: .string "floating point used in kernel (task=%p, pc=%x)\n"
97 .align 4,0
98
99/*
100 * giveup_fpu(tsk) 87 * giveup_fpu(tsk)
101 * Disable FP for the task given as the argument, 88 * Disable FP for the task given as the argument,
102 * and save the floating-point registers in its thread_struct. 89 * and save the floating-point registers in its thread_struct.
103 * Enables the FPU for use in the kernel on return. 90 * Enables the FPU for use in the kernel on return.
104 */ 91 */
105 .globl giveup_fpu 92_GLOBAL(giveup_fpu)
106giveup_fpu:
107 mfmsr r5 93 mfmsr r5
108 ori r5,r5,MSR_FP 94 ori r5,r5,MSR_FP
109 SYNC_601 95 SYNC_601
@@ -111,23 +97,48 @@ giveup_fpu:
111 MTMSRD(r5) /* enable use of fpu now */ 97 MTMSRD(r5) /* enable use of fpu now */
112 SYNC_601 98 SYNC_601
113 isync 99 isync
114 cmpwi 0,r3,0 100 CMPI 0,r3,0
115 beqlr- /* if no previous owner, done */ 101 beqlr- /* if no previous owner, done */
116 addi r3,r3,THREAD /* want THREAD of task */ 102 addi r3,r3,THREAD /* want THREAD of task */
117 lwz r5,PT_REGS(r3) 103 LDL r5,PT_REGS(r3)
118 cmpwi 0,r5,0 104 CMPI 0,r5,0
119 SAVE_32FPRS(0, r3) 105 SAVE_32FPRS(0, r3)
120 mffs fr0 106 mffs fr0
121 stfd fr0,THREAD_FPSCR-4(r3) 107 stfd fr0,THREAD_FPSCR(r3)
122 beq 1f 108 beq 1f
123 lwz r4,_MSR-STACK_FRAME_OVERHEAD(r5) 109 LDL r4,_MSR-STACK_FRAME_OVERHEAD(r5)
124 li r3,MSR_FP|MSR_FE0|MSR_FE1 110 li r3,MSR_FP|MSR_FE0|MSR_FE1
125 andc r4,r4,r3 /* disable FP for previous task */ 111 andc r4,r4,r3 /* disable FP for previous task */
126 stw r4,_MSR-STACK_FRAME_OVERHEAD(r5) 112 STL r4,_MSR-STACK_FRAME_OVERHEAD(r5)
1271: 1131:
128#ifndef CONFIG_SMP 114#ifndef CONFIG_SMP
129 li r5,0 115 li r5,0
130 lis r4,last_task_used_math@ha 116 LOADBASE(r4,last_task_used_math)
131 stw r5,last_task_used_math@l(r4) 117 STL r5,OFF(last_task_used_math)(r4)
132#endif /* CONFIG_SMP */ 118#endif /* CONFIG_SMP */
133 blr 119 blr
120
121/*
122 * These are used in the alignment trap handler when emulating
123 * single-precision loads and stores.
124 * We restore and save the fpscr so the task gets the same result
125 * and exceptions as if the cpu had performed the load or store.
126 */
127
128_GLOBAL(cvt_fd)
129 lfd 0,THREAD_FPSCR(r5) /* load up fpscr value */
130 mtfsf 0xff,0
131 lfs 0,0(r3)
132 stfd 0,0(r4)
133 mffs 0
134 stfd 0,THREAD_FPSCR(r5) /* save new fpscr value */
135 blr
136
137_GLOBAL(cvt_df)
138 lfd 0,THREAD_FPSCR(r5) /* load up fpscr value */
139 mtfsf 0xff,0
140 lfd 0,0(r3)
141 stfs 0,0(r4)
142 mffs 0
143 stfd 0,THREAD_FPSCR(r5) /* save new fpscr value */
144 blr
diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S
new file mode 100644
index 000000000000..b102e3a2415e
--- /dev/null
+++ b/arch/powerpc/kernel/head_32.S
@@ -0,0 +1,1381 @@
1/*
2 * PowerPC version
3 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
4 *
5 * Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP
6 * Copyright (C) 1996 Cort Dougan <cort@cs.nmt.edu>
7 * Adapted for Power Macintosh by Paul Mackerras.
8 * Low-level exception handlers and MMU support
9 * rewritten by Paul Mackerras.
10 * Copyright (C) 1996 Paul Mackerras.
11 * MPC8xx modifications Copyright (C) 1997 Dan Malek (dmalek@jlc.net).
12 * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk).
13 *
14 * This file contains the low-level support and setup for the
15 * PowerPC platform, including trap and interrupt dispatch.
16 * (The PPC 8xx embedded CPUs use head_8xx.S instead.)
17 *
18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License
20 * as published by the Free Software Foundation; either version
21 * 2 of the License, or (at your option) any later version.
22 *
23 */
24
25#include <linux/config.h>
26#include <asm/reg.h>
27#include <asm/page.h>
28#include <asm/mmu.h>
29#include <asm/pgtable.h>
30#include <asm/cputable.h>
31#include <asm/cache.h>
32#include <asm/thread_info.h>
33#include <asm/ppc_asm.h>
34#include <asm/asm-offsets.h>
35
36#ifdef CONFIG_APUS
37#include <asm/amigappc.h>
38#endif
39
40/* 601 only have IBAT; cr0.eq is set on 601 when using this macro */
41#define LOAD_BAT(n, reg, RA, RB) \
42 /* see the comment for clear_bats() -- Cort */ \
43 li RA,0; \
44 mtspr SPRN_IBAT##n##U,RA; \
45 mtspr SPRN_DBAT##n##U,RA; \
46 lwz RA,(n*16)+0(reg); \
47 lwz RB,(n*16)+4(reg); \
48 mtspr SPRN_IBAT##n##U,RA; \
49 mtspr SPRN_IBAT##n##L,RB; \
50 beq 1f; \
51 lwz RA,(n*16)+8(reg); \
52 lwz RB,(n*16)+12(reg); \
53 mtspr SPRN_DBAT##n##U,RA; \
54 mtspr SPRN_DBAT##n##L,RB; \
551:
56
57 .text
58 .stabs "arch/powerpc/kernel/",N_SO,0,0,0f
59 .stabs "head_32.S",N_SO,0,0,0f
600:
61 .globl _stext
62_stext:
63
64/*
65 * _start is defined this way because the XCOFF loader in the OpenFirmware
66 * on the powermac expects the entry point to be a procedure descriptor.
67 */
68 .text
69 .globl _start
70_start:
71 /*
72 * These are here for legacy reasons, the kernel used to
73 * need to look like a coff function entry for the pmac
74 * but we're always started by some kind of bootloader now.
75 * -- Cort
76 */
77 nop /* used by __secondary_hold on prep (mtx) and chrp smp */
78 nop /* used by __secondary_hold on prep (mtx) and chrp smp */
79 nop
80
81/* PMAC
82 * Enter here with the kernel text, data and bss loaded starting at
83 * 0, running with virtual == physical mapping.
84 * r5 points to the prom entry point (the client interface handler
85 * address). Address translation is turned on, with the prom
86 * managing the hash table. Interrupts are disabled. The stack
87 * pointer (r1) points to just below the end of the half-meg region
88 * from 0x380000 - 0x400000, which is mapped in already.
89 *
90 * If we are booted from MacOS via BootX, we enter with the kernel
91 * image loaded somewhere, and the following values in registers:
92 * r3: 'BooX' (0x426f6f58)
93 * r4: virtual address of boot_infos_t
94 * r5: 0
95 *
96 * APUS
97 * r3: 'APUS'
98 * r4: physical address of memory base
99 * Linux/m68k style BootInfo structure at &_end.
100 *
101 * PREP
102 * This is jumped to on prep systems right after the kernel is relocated
103 * to its proper place in memory by the boot loader. The expected layout
104 * of the regs is:
105 * r3: ptr to residual data
106 * r4: initrd_start or if no initrd then 0
107 * r5: initrd_end - unused if r4 is 0
108 * r6: Start of command line string
109 * r7: End of command line string
110 *
111 * This just gets a minimal mmu environment setup so we can call
112 * start_here() to do the real work.
113 * -- Cort
114 */
115
116 .globl __start
117__start:
118/*
119 * We have to do any OF calls before we map ourselves to KERNELBASE,
120 * because OF may have I/O devices mapped into that area
121 * (particularly on CHRP).
122 */
123 cmpwi 0,r5,0
124 beq 1f
125 bl prom_init
126 trap
127
1281: mr r31,r3 /* save parameters */
129 mr r30,r4
130 li r24,0 /* cpu # */
131
132/*
133 * early_init() does the early machine identification and does
134 * the necessary low-level setup and clears the BSS
135 * -- Cort <cort@fsmlabs.com>
136 */
137 bl early_init
138
139#ifdef CONFIG_APUS
140/* On APUS the __va/__pa constants need to be set to the correct
141 * values before continuing.
142 */
143 mr r4,r30
144 bl fix_mem_constants
145#endif /* CONFIG_APUS */
146
147/* Switch MMU off, clear BATs and flush TLB. At this point, r3 contains
148 * the physical address we are running at, returned by early_init()
149 */
150 bl mmu_off
151__after_mmu_off:
152 bl clear_bats
153 bl flush_tlbs
154
155 bl initial_bats
156
157/*
158 * Call setup_cpu for CPU 0 and initialize 6xx Idle
159 */
160 bl reloc_offset
161 li r24,0 /* cpu# */
162 bl call_setup_cpu /* Call setup_cpu for this CPU */
163#ifdef CONFIG_6xx
164 bl reloc_offset
165 bl init_idle_6xx
166#endif /* CONFIG_6xx */
167
168
169#ifndef CONFIG_APUS
170/*
171 * We need to run with _start at physical address 0.
172 * On CHRP, we are loaded at 0x10000 since OF on CHRP uses
173 * the exception vectors at 0 (and therefore this copy
174 * overwrites OF's exception vectors with our own).
175 * The MMU is off at this point.
176 */
177 bl reloc_offset
178 mr r26,r3
179 addis r4,r3,KERNELBASE@h /* current address of _start */
180 cmpwi 0,r4,0 /* are we already running at 0? */
181 bne relocate_kernel
182#endif /* CONFIG_APUS */
183/*
184 * we now have the 1st 16M of ram mapped with the bats.
185 * prep needs the mmu to be turned on here, but pmac already has it on.
186 * this shouldn't bother the pmac since it just gets turned on again
187 * as we jump to our code at KERNELBASE. -- Cort
188 * Actually no, pmac doesn't have it on any more. BootX enters with MMU
189 * off, and in other cases, we now turn it off before changing BATs above.
190 */
191turn_on_mmu:
192 mfmsr r0
193 ori r0,r0,MSR_DR|MSR_IR
194 mtspr SPRN_SRR1,r0
195 lis r0,start_here@h
196 ori r0,r0,start_here@l
197 mtspr SPRN_SRR0,r0
198 SYNC
199 RFI /* enables MMU */
200
201/*
202 * We need __secondary_hold as a place to hold the other cpus on
203 * an SMP machine, even when we are running a UP kernel.
204 */
205 . = 0xc0 /* for prep bootloader */
206 li r3,1 /* MTX only has 1 cpu */
207 .globl __secondary_hold
208__secondary_hold:
209 /* tell the master we're here */
210 stw r3,__secondary_hold_acknowledge@l(0)
211#ifdef CONFIG_SMP
212100: lwz r4,0(0)
213 /* wait until we're told to start */
214 cmpw 0,r4,r3
215 bne 100b
216 /* our cpu # was at addr 0 - go */
217 mr r24,r3 /* cpu # */
218 b __secondary_start
219#else
220 b .
221#endif /* CONFIG_SMP */
222
223 .globl __secondary_hold_spinloop
224__secondary_hold_spinloop:
225 .long 0
226 .globl __secondary_hold_acknowledge
227__secondary_hold_acknowledge:
228 .long -1
229
230/*
231 * Exception entry code. This code runs with address translation
232 * turned off, i.e. using physical addresses.
233 * We assume sprg3 has the physical address of the current
234 * task's thread_struct.
235 */
236#define EXCEPTION_PROLOG \
237 mtspr SPRN_SPRG0,r10; \
238 mtspr SPRN_SPRG1,r11; \
239 mfcr r10; \
240 EXCEPTION_PROLOG_1; \
241 EXCEPTION_PROLOG_2
242
243#define EXCEPTION_PROLOG_1 \
244 mfspr r11,SPRN_SRR1; /* check whether user or kernel */ \
245 andi. r11,r11,MSR_PR; \
246 tophys(r11,r1); /* use tophys(r1) if kernel */ \
247 beq 1f; \
248 mfspr r11,SPRN_SPRG3; \
249 lwz r11,THREAD_INFO-THREAD(r11); \
250 addi r11,r11,THREAD_SIZE; \
251 tophys(r11,r11); \
2521: subi r11,r11,INT_FRAME_SIZE /* alloc exc. frame */
253
254
255#define EXCEPTION_PROLOG_2 \
256 CLR_TOP32(r11); \
257 stw r10,_CCR(r11); /* save registers */ \
258 stw r12,GPR12(r11); \
259 stw r9,GPR9(r11); \
260 mfspr r10,SPRN_SPRG0; \
261 stw r10,GPR10(r11); \
262 mfspr r12,SPRN_SPRG1; \
263 stw r12,GPR11(r11); \
264 mflr r10; \
265 stw r10,_LINK(r11); \
266 mfspr r12,SPRN_SRR0; \
267 mfspr r9,SPRN_SRR1; \
268 stw r1,GPR1(r11); \
269 stw r1,0(r11); \
270 tovirt(r1,r11); /* set new kernel sp */ \
271 li r10,MSR_KERNEL & ~(MSR_IR|MSR_DR); /* can take exceptions */ \
272 MTMSRD(r10); /* (except for mach check in rtas) */ \
273 stw r0,GPR0(r11); \
274 lis r10,0x7265; /* put exception frame marker */ \
275 addi r10,r10,0x6773; \
276 stw r10,8(r11); \
277 SAVE_4GPRS(3, r11); \
278 SAVE_2GPRS(7, r11)
279
280/*
281 * Note: code which follows this uses cr0.eq (set if from kernel),
282 * r11, r12 (SRR0), and r9 (SRR1).
283 *
284 * Note2: once we have set r1 we are in a position to take exceptions
285 * again, and we could thus set MSR:RI at that point.
286 */
287
288/*
289 * Exception vectors.
290 */
291#define EXCEPTION(n, label, hdlr, xfer) \
292 . = n; \
293label: \
294 EXCEPTION_PROLOG; \
295 addi r3,r1,STACK_FRAME_OVERHEAD; \
296 xfer(n, hdlr)
297
298#define EXC_XFER_TEMPLATE(n, hdlr, trap, copyee, tfer, ret) \
299 li r10,trap; \
300 stw r10,_TRAP(r11); \
301 li r10,MSR_KERNEL; \
302 copyee(r10, r9); \
303 bl tfer; \
304i##n: \
305 .long hdlr; \
306 .long ret
307
308#define COPY_EE(d, s) rlwimi d,s,0,16,16
309#define NOCOPY(d, s)
310
311#define EXC_XFER_STD(n, hdlr) \
312 EXC_XFER_TEMPLATE(n, hdlr, n, NOCOPY, transfer_to_handler_full, \
313 ret_from_except_full)
314
315#define EXC_XFER_LITE(n, hdlr) \
316 EXC_XFER_TEMPLATE(n, hdlr, n+1, NOCOPY, transfer_to_handler, \
317 ret_from_except)
318
319#define EXC_XFER_EE(n, hdlr) \
320 EXC_XFER_TEMPLATE(n, hdlr, n, COPY_EE, transfer_to_handler_full, \
321 ret_from_except_full)
322
323#define EXC_XFER_EE_LITE(n, hdlr) \
324 EXC_XFER_TEMPLATE(n, hdlr, n+1, COPY_EE, transfer_to_handler, \
325 ret_from_except)
326
327/* System reset */
328/* core99 pmac starts the seconary here by changing the vector, and
329 putting it back to what it was (unknown_exception) when done. */
330#if defined(CONFIG_GEMINI) && defined(CONFIG_SMP)
331 . = 0x100
332 b __secondary_start_gemini
333#else
334 EXCEPTION(0x100, Reset, unknown_exception, EXC_XFER_STD)
335#endif
336
337/* Machine check */
338/*
339 * On CHRP, this is complicated by the fact that we could get a
340 * machine check inside RTAS, and we have no guarantee that certain
341 * critical registers will have the values we expect. The set of
342 * registers that might have bad values includes all the GPRs
343 * and all the BATs. We indicate that we are in RTAS by putting
344 * a non-zero value, the address of the exception frame to use,
345 * in SPRG2. The machine check handler checks SPRG2 and uses its
346 * value if it is non-zero. If we ever needed to free up SPRG2,
347 * we could use a field in the thread_info or thread_struct instead.
348 * (Other exception handlers assume that r1 is a valid kernel stack
349 * pointer when we take an exception from supervisor mode.)
350 * -- paulus.
351 */
352 . = 0x200
353 mtspr SPRN_SPRG0,r10
354 mtspr SPRN_SPRG1,r11
355 mfcr r10
356#ifdef CONFIG_PPC_CHRP
357 mfspr r11,SPRN_SPRG2
358 cmpwi 0,r11,0
359 bne 7f
360#endif /* CONFIG_PPC_CHRP */
361 EXCEPTION_PROLOG_1
3627: EXCEPTION_PROLOG_2
363 addi r3,r1,STACK_FRAME_OVERHEAD
364#ifdef CONFIG_PPC_CHRP
365 mfspr r4,SPRN_SPRG2
366 cmpwi cr1,r4,0
367 bne cr1,1f
368#endif
369 EXC_XFER_STD(0x200, machine_check_exception)
370#ifdef CONFIG_PPC_CHRP
3711: b machine_check_in_rtas
372#endif
373
374/* Data access exception. */
375 . = 0x300
376DataAccess:
377 EXCEPTION_PROLOG
378 mfspr r10,SPRN_DSISR
379 andis. r0,r10,0xa470 /* weird error? */
380 bne 1f /* if not, try to put a PTE */
381 mfspr r4,SPRN_DAR /* into the hash table */
382 rlwinm r3,r10,32-15,21,21 /* DSISR_STORE -> _PAGE_RW */
383 bl hash_page
3841: stw r10,_DSISR(r11)
385 mr r5,r10
386 mfspr r4,SPRN_DAR
387 EXC_XFER_EE_LITE(0x300, handle_page_fault)
388
389
390/* Instruction access exception. */
391 . = 0x400
392InstructionAccess:
393 EXCEPTION_PROLOG
394 andis. r0,r9,0x4000 /* no pte found? */
395 beq 1f /* if so, try to put a PTE */
396 li r3,0 /* into the hash table */
397 mr r4,r12 /* SRR0 is fault address */
398 bl hash_page
3991: mr r4,r12
400 mr r5,r9
401 EXC_XFER_EE_LITE(0x400, handle_page_fault)
402
403/* External interrupt */
404 EXCEPTION(0x500, HardwareInterrupt, do_IRQ, EXC_XFER_LITE)
405
406/* Alignment exception */
407 . = 0x600
408Alignment:
409 EXCEPTION_PROLOG
410 mfspr r4,SPRN_DAR
411 stw r4,_DAR(r11)
412 mfspr r5,SPRN_DSISR
413 stw r5,_DSISR(r11)
414 addi r3,r1,STACK_FRAME_OVERHEAD
415 EXC_XFER_EE(0x600, alignment_exception)
416
417/* Program check exception */
418 EXCEPTION(0x700, ProgramCheck, program_check_exception, EXC_XFER_STD)
419
420/* Floating-point unavailable */
421 . = 0x800
422FPUnavailable:
423 EXCEPTION_PROLOG
424 bne load_up_fpu /* if from user, just load it up */
425 addi r3,r1,STACK_FRAME_OVERHEAD
426 EXC_XFER_EE_LITE(0x800, kernel_fp_unavailable_exception)
427
428/* Decrementer */
429 EXCEPTION(0x900, Decrementer, timer_interrupt, EXC_XFER_LITE)
430
431 EXCEPTION(0xa00, Trap_0a, unknown_exception, EXC_XFER_EE)
432 EXCEPTION(0xb00, Trap_0b, unknown_exception, EXC_XFER_EE)
433
434/* System call */
435 . = 0xc00
436SystemCall:
437 EXCEPTION_PROLOG
438 EXC_XFER_EE_LITE(0xc00, DoSyscall)
439
440/* Single step - not used on 601 */
441 EXCEPTION(0xd00, SingleStep, single_step_exception, EXC_XFER_STD)
442 EXCEPTION(0xe00, Trap_0e, unknown_exception, EXC_XFER_EE)
443
444/*
445 * The Altivec unavailable trap is at 0x0f20. Foo.
446 * We effectively remap it to 0x3000.
447 * We include an altivec unavailable exception vector even if
448 * not configured for Altivec, so that you can't panic a
449 * non-altivec kernel running on a machine with altivec just
450 * by executing an altivec instruction.
451 */
452 . = 0xf00
453 b Trap_0f
454
455 . = 0xf20
456 b AltiVecUnavailable
457
458Trap_0f:
459 EXCEPTION_PROLOG
460 addi r3,r1,STACK_FRAME_OVERHEAD
461 EXC_XFER_EE(0xf00, unknown_exception)
462
463/*
464 * Handle TLB miss for instruction on 603/603e.
465 * Note: we get an alternate set of r0 - r3 to use automatically.
466 */
467 . = 0x1000
468InstructionTLBMiss:
469/*
470 * r0: stored ctr
471 * r1: linux style pte ( later becomes ppc hardware pte )
472 * r2: ptr to linux-style pte
473 * r3: scratch
474 */
475 mfctr r0
476 /* Get PTE (linux-style) and check access */
477 mfspr r3,SPRN_IMISS
478 lis r1,KERNELBASE@h /* check if kernel address */
479 cmplw 0,r3,r1
480 mfspr r2,SPRN_SPRG3
481 li r1,_PAGE_USER|_PAGE_PRESENT /* low addresses tested as user */
482 lwz r2,PGDIR(r2)
483 blt+ 112f
484 lis r2,swapper_pg_dir@ha /* if kernel address, use */
485 addi r2,r2,swapper_pg_dir@l /* kernel page table */
486 mfspr r1,SPRN_SRR1 /* and MSR_PR bit from SRR1 */
487 rlwinm r1,r1,32-12,29,29 /* shift MSR_PR to _PAGE_USER posn */
488112: tophys(r2,r2)
489 rlwimi r2,r3,12,20,29 /* insert top 10 bits of address */
490 lwz r2,0(r2) /* get pmd entry */
491 rlwinm. r2,r2,0,0,19 /* extract address of pte page */
492 beq- InstructionAddressInvalid /* return if no mapping */
493 rlwimi r2,r3,22,20,29 /* insert next 10 bits of address */
494 lwz r3,0(r2) /* get linux-style pte */
495 andc. r1,r1,r3 /* check access & ~permission */
496 bne- InstructionAddressInvalid /* return if access not permitted */
497 ori r3,r3,_PAGE_ACCESSED /* set _PAGE_ACCESSED in pte */
498 /*
499 * NOTE! We are assuming this is not an SMP system, otherwise
500 * we would need to update the pte atomically with lwarx/stwcx.
501 */
502 stw r3,0(r2) /* update PTE (accessed bit) */
503 /* Convert linux-style PTE to low word of PPC-style PTE */
504 rlwinm r1,r3,32-10,31,31 /* _PAGE_RW -> PP lsb */
505 rlwinm r2,r3,32-7,31,31 /* _PAGE_DIRTY -> PP lsb */
506 and r1,r1,r2 /* writable if _RW and _DIRTY */
507 rlwimi r3,r3,32-1,30,30 /* _PAGE_USER -> PP msb */
508 rlwimi r3,r3,32-1,31,31 /* _PAGE_USER -> PP lsb */
509 ori r1,r1,0xe14 /* clear out reserved bits and M */
510 andc r1,r3,r1 /* PP = user? (rw&dirty? 2: 3): 0 */
511 mtspr SPRN_RPA,r1
512 mfspr r3,SPRN_IMISS
513 tlbli r3
514 mfspr r3,SPRN_SRR1 /* Need to restore CR0 */
515 mtcrf 0x80,r3
516 rfi
517InstructionAddressInvalid:
518 mfspr r3,SPRN_SRR1
519 rlwinm r1,r3,9,6,6 /* Get load/store bit */
520
521 addis r1,r1,0x2000
522 mtspr SPRN_DSISR,r1 /* (shouldn't be needed) */
523 mtctr r0 /* Restore CTR */
524 andi. r2,r3,0xFFFF /* Clear upper bits of SRR1 */
525 or r2,r2,r1
526 mtspr SPRN_SRR1,r2
527 mfspr r1,SPRN_IMISS /* Get failing address */
528 rlwinm. r2,r2,0,31,31 /* Check for little endian access */
529 rlwimi r2,r2,1,30,30 /* change 1 -> 3 */
530 xor r1,r1,r2
531 mtspr SPRN_DAR,r1 /* Set fault address */
532 mfmsr r0 /* Restore "normal" registers */
533 xoris r0,r0,MSR_TGPR>>16
534 mtcrf 0x80,r3 /* Restore CR0 */
535 mtmsr r0
536 b InstructionAccess
537
538/*
539 * Handle TLB miss for DATA Load operation on 603/603e
540 */
541 . = 0x1100
542DataLoadTLBMiss:
543/*
544 * r0: stored ctr
545 * r1: linux style pte ( later becomes ppc hardware pte )
546 * r2: ptr to linux-style pte
547 * r3: scratch
548 */
549 mfctr r0
550 /* Get PTE (linux-style) and check access */
551 mfspr r3,SPRN_DMISS
552 lis r1,KERNELBASE@h /* check if kernel address */
553 cmplw 0,r3,r1
554 mfspr r2,SPRN_SPRG3
555 li r1,_PAGE_USER|_PAGE_PRESENT /* low addresses tested as user */
556 lwz r2,PGDIR(r2)
557 blt+ 112f
558 lis r2,swapper_pg_dir@ha /* if kernel address, use */
559 addi r2,r2,swapper_pg_dir@l /* kernel page table */
560 mfspr r1,SPRN_SRR1 /* and MSR_PR bit from SRR1 */
561 rlwinm r1,r1,32-12,29,29 /* shift MSR_PR to _PAGE_USER posn */
562112: tophys(r2,r2)
563 rlwimi r2,r3,12,20,29 /* insert top 10 bits of address */
564 lwz r2,0(r2) /* get pmd entry */
565 rlwinm. r2,r2,0,0,19 /* extract address of pte page */
566 beq- DataAddressInvalid /* return if no mapping */
567 rlwimi r2,r3,22,20,29 /* insert next 10 bits of address */
568 lwz r3,0(r2) /* get linux-style pte */
569 andc. r1,r1,r3 /* check access & ~permission */
570 bne- DataAddressInvalid /* return if access not permitted */
571 ori r3,r3,_PAGE_ACCESSED /* set _PAGE_ACCESSED in pte */
572 /*
573 * NOTE! We are assuming this is not an SMP system, otherwise
574 * we would need to update the pte atomically with lwarx/stwcx.
575 */
576 stw r3,0(r2) /* update PTE (accessed bit) */
577 /* Convert linux-style PTE to low word of PPC-style PTE */
578 rlwinm r1,r3,32-10,31,31 /* _PAGE_RW -> PP lsb */
579 rlwinm r2,r3,32-7,31,31 /* _PAGE_DIRTY -> PP lsb */
580 and r1,r1,r2 /* writable if _RW and _DIRTY */
581 rlwimi r3,r3,32-1,30,30 /* _PAGE_USER -> PP msb */
582 rlwimi r3,r3,32-1,31,31 /* _PAGE_USER -> PP lsb */
583 ori r1,r1,0xe14 /* clear out reserved bits and M */
584 andc r1,r3,r1 /* PP = user? (rw&dirty? 2: 3): 0 */
585 mtspr SPRN_RPA,r1
586 mfspr r3,SPRN_DMISS
587 tlbld r3
588 mfspr r3,SPRN_SRR1 /* Need to restore CR0 */
589 mtcrf 0x80,r3
590 rfi
591DataAddressInvalid:
592 mfspr r3,SPRN_SRR1
593 rlwinm r1,r3,9,6,6 /* Get load/store bit */
594 addis r1,r1,0x2000
595 mtspr SPRN_DSISR,r1
596 mtctr r0 /* Restore CTR */
597 andi. r2,r3,0xFFFF /* Clear upper bits of SRR1 */
598 mtspr SPRN_SRR1,r2
599 mfspr r1,SPRN_DMISS /* Get failing address */
600 rlwinm. r2,r2,0,31,31 /* Check for little endian access */
601 beq 20f /* Jump if big endian */
602 xori r1,r1,3
60320: mtspr SPRN_DAR,r1 /* Set fault address */
604 mfmsr r0 /* Restore "normal" registers */
605 xoris r0,r0,MSR_TGPR>>16
606 mtcrf 0x80,r3 /* Restore CR0 */
607 mtmsr r0
608 b DataAccess
609
610/*
611 * Handle TLB miss for DATA Store on 603/603e
612 */
613 . = 0x1200
614DataStoreTLBMiss:
615/*
616 * r0: stored ctr
617 * r1: linux style pte ( later becomes ppc hardware pte )
618 * r2: ptr to linux-style pte
619 * r3: scratch
620 */
621 mfctr r0
622 /* Get PTE (linux-style) and check access */
623 mfspr r3,SPRN_DMISS
624 lis r1,KERNELBASE@h /* check if kernel address */
625 cmplw 0,r3,r1
626 mfspr r2,SPRN_SPRG3
627 li r1,_PAGE_RW|_PAGE_USER|_PAGE_PRESENT /* access flags */
628 lwz r2,PGDIR(r2)
629 blt+ 112f
630 lis r2,swapper_pg_dir@ha /* if kernel address, use */
631 addi r2,r2,swapper_pg_dir@l /* kernel page table */
632 mfspr r1,SPRN_SRR1 /* and MSR_PR bit from SRR1 */
633 rlwinm r1,r1,32-12,29,29 /* shift MSR_PR to _PAGE_USER posn */
634112: tophys(r2,r2)
635 rlwimi r2,r3,12,20,29 /* insert top 10 bits of address */
636 lwz r2,0(r2) /* get pmd entry */
637 rlwinm. r2,r2,0,0,19 /* extract address of pte page */
638 beq- DataAddressInvalid /* return if no mapping */
639 rlwimi r2,r3,22,20,29 /* insert next 10 bits of address */
640 lwz r3,0(r2) /* get linux-style pte */
641 andc. r1,r1,r3 /* check access & ~permission */
642 bne- DataAddressInvalid /* return if access not permitted */
643 ori r3,r3,_PAGE_ACCESSED|_PAGE_DIRTY
644 /*
645 * NOTE! We are assuming this is not an SMP system, otherwise
646 * we would need to update the pte atomically with lwarx/stwcx.
647 */
648 stw r3,0(r2) /* update PTE (accessed/dirty bits) */
649 /* Convert linux-style PTE to low word of PPC-style PTE */
650 rlwimi r3,r3,32-1,30,30 /* _PAGE_USER -> PP msb */
651 li r1,0xe15 /* clear out reserved bits and M */
652 andc r1,r3,r1 /* PP = user? 2: 0 */
653 mtspr SPRN_RPA,r1
654 mfspr r3,SPRN_DMISS
655 tlbld r3
656 mfspr r3,SPRN_SRR1 /* Need to restore CR0 */
657 mtcrf 0x80,r3
658 rfi
659
660#ifndef CONFIG_ALTIVEC
661#define altivec_assist_exception unknown_exception
662#endif
663
664 EXCEPTION(0x1300, Trap_13, instruction_breakpoint_exception, EXC_XFER_EE)
665 EXCEPTION(0x1400, SMI, SMIException, EXC_XFER_EE)
666 EXCEPTION(0x1500, Trap_15, unknown_exception, EXC_XFER_EE)
667 EXCEPTION(0x1600, Trap_16, altivec_assist_exception, EXC_XFER_EE)
668 EXCEPTION(0x1700, Trap_17, TAUException, EXC_XFER_STD)
669 EXCEPTION(0x1800, Trap_18, unknown_exception, EXC_XFER_EE)
670 EXCEPTION(0x1900, Trap_19, unknown_exception, EXC_XFER_EE)
671 EXCEPTION(0x1a00, Trap_1a, unknown_exception, EXC_XFER_EE)
672 EXCEPTION(0x1b00, Trap_1b, unknown_exception, EXC_XFER_EE)
673 EXCEPTION(0x1c00, Trap_1c, unknown_exception, EXC_XFER_EE)
674 EXCEPTION(0x1d00, Trap_1d, unknown_exception, EXC_XFER_EE)
675 EXCEPTION(0x1e00, Trap_1e, unknown_exception, EXC_XFER_EE)
676 EXCEPTION(0x1f00, Trap_1f, unknown_exception, EXC_XFER_EE)
677 EXCEPTION(0x2000, RunMode, RunModeException, EXC_XFER_EE)
678 EXCEPTION(0x2100, Trap_21, unknown_exception, EXC_XFER_EE)
679 EXCEPTION(0x2200, Trap_22, unknown_exception, EXC_XFER_EE)
680 EXCEPTION(0x2300, Trap_23, unknown_exception, EXC_XFER_EE)
681 EXCEPTION(0x2400, Trap_24, unknown_exception, EXC_XFER_EE)
682 EXCEPTION(0x2500, Trap_25, unknown_exception, EXC_XFER_EE)
683 EXCEPTION(0x2600, Trap_26, unknown_exception, EXC_XFER_EE)
684 EXCEPTION(0x2700, Trap_27, unknown_exception, EXC_XFER_EE)
685 EXCEPTION(0x2800, Trap_28, unknown_exception, EXC_XFER_EE)
686 EXCEPTION(0x2900, Trap_29, unknown_exception, EXC_XFER_EE)
687 EXCEPTION(0x2a00, Trap_2a, unknown_exception, EXC_XFER_EE)
688 EXCEPTION(0x2b00, Trap_2b, unknown_exception, EXC_XFER_EE)
689 EXCEPTION(0x2c00, Trap_2c, unknown_exception, EXC_XFER_EE)
690 EXCEPTION(0x2d00, Trap_2d, unknown_exception, EXC_XFER_EE)
691 EXCEPTION(0x2e00, Trap_2e, unknown_exception, EXC_XFER_EE)
692 EXCEPTION(0x2f00, MOLTrampoline, unknown_exception, EXC_XFER_EE_LITE)
693
694 .globl mol_trampoline
695 .set mol_trampoline, i0x2f00
696
697 . = 0x3000
698
699AltiVecUnavailable:
700 EXCEPTION_PROLOG
701#ifdef CONFIG_ALTIVEC
702 bne load_up_altivec /* if from user, just load it up */
703#endif /* CONFIG_ALTIVEC */
704 EXC_XFER_EE_LITE(0xf20, altivec_unavailable_exception)
705
706#ifdef CONFIG_ALTIVEC
707/* Note that the AltiVec support is closely modeled after the FP
708 * support. Changes to one are likely to be applicable to the
709 * other! */
710load_up_altivec:
711/*
712 * Disable AltiVec for the task which had AltiVec previously,
713 * and save its AltiVec registers in its thread_struct.
714 * Enables AltiVec for use in the kernel on return.
715 * On SMP we know the AltiVec units are free, since we give it up every
716 * switch. -- Kumar
717 */
718 mfmsr r5
719 oris r5,r5,MSR_VEC@h
720 MTMSRD(r5) /* enable use of AltiVec now */
721 isync
722/*
723 * For SMP, we don't do lazy AltiVec switching because it just gets too
724 * horrendously complex, especially when a task switches from one CPU
725 * to another. Instead we call giveup_altivec in switch_to.
726 */
727#ifndef CONFIG_SMP
728 tophys(r6,0)
729 addis r3,r6,last_task_used_altivec@ha
730 lwz r4,last_task_used_altivec@l(r3)
731 cmpwi 0,r4,0
732 beq 1f
733 add r4,r4,r6
734 addi r4,r4,THREAD /* want THREAD of last_task_used_altivec */
735 SAVE_32VRS(0,r10,r4)
736 mfvscr vr0
737 li r10,THREAD_VSCR
738 stvx vr0,r10,r4
739 lwz r5,PT_REGS(r4)
740 add r5,r5,r6
741 lwz r4,_MSR-STACK_FRAME_OVERHEAD(r5)
742 lis r10,MSR_VEC@h
743 andc r4,r4,r10 /* disable altivec for previous task */
744 stw r4,_MSR-STACK_FRAME_OVERHEAD(r5)
7451:
746#endif /* CONFIG_SMP */
747 /* enable use of AltiVec after return */
748 oris r9,r9,MSR_VEC@h
749 mfspr r5,SPRN_SPRG3 /* current task's THREAD (phys) */
750 li r4,1
751 li r10,THREAD_VSCR
752 stw r4,THREAD_USED_VR(r5)
753 lvx vr0,r10,r5
754 mtvscr vr0
755 REST_32VRS(0,r10,r5)
756#ifndef CONFIG_SMP
757 subi r4,r5,THREAD
758 sub r4,r4,r6
759 stw r4,last_task_used_altivec@l(r3)
760#endif /* CONFIG_SMP */
761 /* restore registers and return */
762 /* we haven't used ctr or xer or lr */
763 b fast_exception_return
764
765/*
766 * AltiVec unavailable trap from kernel - print a message, but let
767 * the task use AltiVec in the kernel until it returns to user mode.
768 */
769KernelAltiVec:
770 lwz r3,_MSR(r1)
771 oris r3,r3,MSR_VEC@h
772 stw r3,_MSR(r1) /* enable use of AltiVec after return */
773 lis r3,87f@h
774 ori r3,r3,87f@l
775 mr r4,r2 /* current */
776 lwz r5,_NIP(r1)
777 bl printk
778 b ret_from_except
77987: .string "AltiVec used in kernel (task=%p, pc=%x) \n"
780 .align 4,0
781
782/*
783 * giveup_altivec(tsk)
784 * Disable AltiVec for the task given as the argument,
785 * and save the AltiVec registers in its thread_struct.
786 * Enables AltiVec for use in the kernel on return.
787 */
788
789 .globl giveup_altivec
790giveup_altivec:
791 mfmsr r5
792 oris r5,r5,MSR_VEC@h
793 SYNC
794 MTMSRD(r5) /* enable use of AltiVec now */
795 isync
796 cmpwi 0,r3,0
797 beqlr- /* if no previous owner, done */
798 addi r3,r3,THREAD /* want THREAD of task */
799 lwz r5,PT_REGS(r3)
800 cmpwi 0,r5,0
801 SAVE_32VRS(0, r4, r3)
802 mfvscr vr0
803 li r4,THREAD_VSCR
804 stvx vr0,r4,r3
805 beq 1f
806 lwz r4,_MSR-STACK_FRAME_OVERHEAD(r5)
807 lis r3,MSR_VEC@h
808 andc r4,r4,r3 /* disable AltiVec for previous task */
809 stw r4,_MSR-STACK_FRAME_OVERHEAD(r5)
8101:
811#ifndef CONFIG_SMP
812 li r5,0
813 lis r4,last_task_used_altivec@ha
814 stw r5,last_task_used_altivec@l(r4)
815#endif /* CONFIG_SMP */
816 blr
817#endif /* CONFIG_ALTIVEC */
818
819/*
820 * This code is jumped to from the startup code to copy
821 * the kernel image to physical address 0.
822 */
823relocate_kernel:
824 addis r9,r26,klimit@ha /* fetch klimit */
825 lwz r25,klimit@l(r9)
826 addis r25,r25,-KERNELBASE@h
827 li r3,0 /* Destination base address */
828 li r6,0 /* Destination offset */
829 li r5,0x4000 /* # bytes of memory to copy */
830 bl copy_and_flush /* copy the first 0x4000 bytes */
831 addi r0,r3,4f@l /* jump to the address of 4f */
832 mtctr r0 /* in copy and do the rest. */
833 bctr /* jump to the copy */
8344: mr r5,r25
835 bl copy_and_flush /* copy the rest */
836 b turn_on_mmu
837
838/*
839 * Copy routine used to copy the kernel to start at physical address 0
840 * and flush and invalidate the caches as needed.
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.
843 */
844_GLOBAL(copy_and_flush)
845 addi r5,r5,-4
846 addi r6,r6,-4
8474: li r0,L1_CACHE_BYTES/4
848 mtctr r0
8493: addi r6,r6,4 /* copy a cache line */
850 lwzx r0,r6,r4
851 stwx r0,r6,r3
852 bdnz 3b
853 dcbst r6,r3 /* write it to memory */
854 sync
855 icbi r6,r3 /* flush the icache line */
856 cmplw 0,r6,r5
857 blt 4b
858 sync /* additional sync needed on g4 */
859 isync
860 addi r5,r5,4
861 addi r6,r6,4
862 blr
863
864#ifdef CONFIG_APUS
865/*
866 * On APUS the physical base address of the kernel is not known at compile
867 * time, which means the __pa/__va constants used are incorrect. In the
868 * __init section is recorded the virtual addresses of instructions using
869 * these constants, so all that has to be done is fix these before
870 * continuing the kernel boot.
871 *
872 * r4 = The physical address of the kernel base.
873 */
874fix_mem_constants:
875 mr r10,r4
876 addis r10,r10,-KERNELBASE@h /* virt_to_phys constant */
877 neg r11,r10 /* phys_to_virt constant */
878
879 lis r12,__vtop_table_begin@h
880 ori r12,r12,__vtop_table_begin@l
881 add r12,r12,r10 /* table begin phys address */
882 lis r13,__vtop_table_end@h
883 ori r13,r13,__vtop_table_end@l
884 add r13,r13,r10 /* table end phys address */
885 subi r12,r12,4
886 subi r13,r13,4
8871: lwzu r14,4(r12) /* virt address of instruction */
888 add r14,r14,r10 /* phys address of instruction */
889 lwz r15,0(r14) /* instruction, now insert top */
890 rlwimi r15,r10,16,16,31 /* half of vp const in low half */
891 stw r15,0(r14) /* of instruction and restore. */
892 dcbst r0,r14 /* write it to memory */
893 sync
894 icbi r0,r14 /* flush the icache line */
895 cmpw r12,r13
896 bne 1b
897 sync /* additional sync needed on g4 */
898 isync
899
900/*
901 * Map the memory where the exception handlers will
902 * be copied to when hash constants have been patched.
903 */
904#ifdef CONFIG_APUS_FAST_EXCEPT
905 lis r8,0xfff0
906#else
907 lis r8,0
908#endif
909 ori r8,r8,0x2 /* 128KB, supervisor */
910 mtspr SPRN_DBAT3U,r8
911 mtspr SPRN_DBAT3L,r8
912
913 lis r12,__ptov_table_begin@h
914 ori r12,r12,__ptov_table_begin@l
915 add r12,r12,r10 /* table begin phys address */
916 lis r13,__ptov_table_end@h
917 ori r13,r13,__ptov_table_end@l
918 add r13,r13,r10 /* table end phys address */
919 subi r12,r12,4
920 subi r13,r13,4
9211: lwzu r14,4(r12) /* virt address of instruction */
922 add r14,r14,r10 /* phys address of instruction */
923 lwz r15,0(r14) /* instruction, now insert top */
924 rlwimi r15,r11,16,16,31 /* half of pv const in low half*/
925 stw r15,0(r14) /* of instruction and restore. */
926 dcbst r0,r14 /* write it to memory */
927 sync
928 icbi r0,r14 /* flush the icache line */
929 cmpw r12,r13
930 bne 1b
931
932 sync /* additional sync needed on g4 */
933 isync /* No speculative loading until now */
934 blr
935
936/***********************************************************************
937 * Please note that on APUS the exception handlers are located at the
938 * physical address 0xfff0000. For this reason, the exception handlers
939 * cannot use relative branches to access the code below.
940 ***********************************************************************/
941#endif /* CONFIG_APUS */
942
943#ifdef CONFIG_SMP
944#ifdef CONFIG_GEMINI
945 .globl __secondary_start_gemini
946__secondary_start_gemini:
947 mfspr r4,SPRN_HID0
948 ori r4,r4,HID0_ICFI
949 li r3,0
950 ori r3,r3,HID0_ICE
951 andc r4,r4,r3
952 mtspr SPRN_HID0,r4
953 sync
954 b __secondary_start
955#endif /* CONFIG_GEMINI */
956
957 .globl __secondary_start_pmac_0
958__secondary_start_pmac_0:
959 /* NB the entries for cpus 0, 1, 2 must each occupy 8 bytes. */
960 li r24,0
961 b 1f
962 li r24,1
963 b 1f
964 li r24,2
965 b 1f
966 li r24,3
9671:
968 /* on powersurge, we come in here with IR=0 and DR=1, and DBAT 0
969 set to map the 0xf0000000 - 0xffffffff region */
970 mfmsr r0
971 rlwinm r0,r0,0,28,26 /* clear DR (0x10) */
972 SYNC
973 mtmsr r0
974 isync
975
976 .globl __secondary_start
977__secondary_start:
978 /* Copy some CPU settings from CPU 0 */
979 bl __restore_cpu_setup
980
981 lis r3,-KERNELBASE@h
982 mr r4,r24
983 bl call_setup_cpu /* Call setup_cpu for this CPU */
984#ifdef CONFIG_6xx
985 lis r3,-KERNELBASE@h
986 bl init_idle_6xx
987#endif /* CONFIG_6xx */
988
989 /* get current_thread_info and current */
990 lis r1,secondary_ti@ha
991 tophys(r1,r1)
992 lwz r1,secondary_ti@l(r1)
993 tophys(r2,r1)
994 lwz r2,TI_TASK(r2)
995
996 /* stack */
997 addi r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD
998 li r0,0
999 tophys(r3,r1)
1000 stw r0,0(r3)
1001
1002 /* load up the MMU */
1003 bl load_up_mmu
1004
1005 /* ptr to phys current thread */
1006 tophys(r4,r2)
1007 addi r4,r4,THREAD /* phys address of our thread_struct */
1008 CLR_TOP32(r4)
1009 mtspr SPRN_SPRG3,r4
1010 li r3,0
1011 mtspr SPRN_SPRG2,r3 /* 0 => not in RTAS */
1012
1013 /* enable MMU and jump to start_secondary */
1014 li r4,MSR_KERNEL
1015 FIX_SRR1(r4,r5)
1016 lis r3,start_secondary@h
1017 ori r3,r3,start_secondary@l
1018 mtspr SPRN_SRR0,r3
1019 mtspr SPRN_SRR1,r4
1020 SYNC
1021 RFI
1022#endif /* CONFIG_SMP */
1023
1024/*
1025 * Those generic dummy functions are kept for CPUs not
1026 * included in CONFIG_6xx
1027 */
1028#if !defined(CONFIG_6xx)
1029_GLOBAL(__save_cpu_setup)
1030 blr
1031_GLOBAL(__restore_cpu_setup)
1032 blr
1033#endif /* !defined(CONFIG_6xx) */
1034
1035
1036/*
1037 * Load stuff into the MMU. Intended to be called with
1038 * IR=0 and DR=0.
1039 */
1040load_up_mmu:
1041 sync /* Force all PTE updates to finish */
1042 isync
1043 tlbia /* Clear all TLB entries */
1044 sync /* wait for tlbia/tlbie to finish */
1045 TLBSYNC /* ... on all CPUs */
1046 /* Load the SDR1 register (hash table base & size) */
1047 lis r6,_SDR1@ha
1048 tophys(r6,r6)
1049 lwz r6,_SDR1@l(r6)
1050 mtspr SPRN_SDR1,r6
1051 li r0,16 /* load up segment register values */
1052 mtctr r0 /* for context 0 */
1053 lis r3,0x2000 /* Ku = 1, VSID = 0 */
1054 li r4,0
10553: mtsrin r3,r4
1056 addi r3,r3,0x111 /* increment VSID */
1057 addis r4,r4,0x1000 /* address of next segment */
1058 bdnz 3b
1059
1060/* Load the BAT registers with the values set up by MMU_init.
1061 MMU_init takes care of whether we're on a 601 or not. */
1062 mfpvr r3
1063 srwi r3,r3,16
1064 cmpwi r3,1
1065 lis r3,BATS@ha
1066 addi r3,r3,BATS@l
1067 tophys(r3,r3)
1068 LOAD_BAT(0,r3,r4,r5)
1069 LOAD_BAT(1,r3,r4,r5)
1070 LOAD_BAT(2,r3,r4,r5)
1071 LOAD_BAT(3,r3,r4,r5)
1072
1073 blr
1074
1075/*
1076 * This is where the main kernel code starts.
1077 */
1078start_here:
1079 /* ptr to current */
1080 lis r2,init_task@h
1081 ori r2,r2,init_task@l
1082 /* Set up for using our exception vectors */
1083 /* ptr to phys current thread */
1084 tophys(r4,r2)
1085 addi r4,r4,THREAD /* init task's THREAD */
1086 CLR_TOP32(r4)
1087 mtspr SPRN_SPRG3,r4
1088 li r3,0
1089 mtspr SPRN_SPRG2,r3 /* 0 => not in RTAS */
1090
1091 /* stack */
1092 lis r1,init_thread_union@ha
1093 addi r1,r1,init_thread_union@l
1094 li r0,0
1095 stwu r0,THREAD_SIZE-STACK_FRAME_OVERHEAD(r1)
1096/*
1097 * Do early platform-specific initialization,
1098 * and set up the MMU.
1099 */
1100 mr r3,r31
1101 mr r4,r30
1102 bl machine_init
1103 bl MMU_init
1104
1105#ifdef CONFIG_APUS
1106 /* Copy exception code to exception vector base on APUS. */
1107 lis r4,KERNELBASE@h
1108#ifdef CONFIG_APUS_FAST_EXCEPT
1109 lis r3,0xfff0 /* Copy to 0xfff00000 */
1110#else
1111 lis r3,0 /* Copy to 0x00000000 */
1112#endif
1113 li r5,0x4000 /* # bytes of memory to copy */
1114 li r6,0
1115 bl copy_and_flush /* copy the first 0x4000 bytes */
1116#endif /* CONFIG_APUS */
1117
1118/*
1119 * Go back to running unmapped so we can load up new values
1120 * for SDR1 (hash table pointer) and the segment registers
1121 * and change to using our exception vectors.
1122 */
1123 lis r4,2f@h
1124 ori r4,r4,2f@l
1125 tophys(r4,r4)
1126 li r3,MSR_KERNEL & ~(MSR_IR|MSR_DR)
1127 FIX_SRR1(r3,r5)
1128 mtspr SPRN_SRR0,r4
1129 mtspr SPRN_SRR1,r3
1130 SYNC
1131 RFI
1132/* Load up the kernel context */
11332: bl load_up_mmu
1134
1135#ifdef CONFIG_BDI_SWITCH
1136 /* Add helper information for the Abatron bdiGDB debugger.
1137 * We do this here because we know the mmu is disabled, and
1138 * will be enabled for real in just a few instructions.
1139 */
1140 lis r5, abatron_pteptrs@h
1141 ori r5, r5, abatron_pteptrs@l
1142 stw r5, 0xf0(r0) /* This much match your Abatron config */
1143 lis r6, swapper_pg_dir@h
1144 ori r6, r6, swapper_pg_dir@l
1145 tophys(r5, r5)
1146 stw r6, 0(r5)
1147#endif /* CONFIG_BDI_SWITCH */
1148
1149/* Now turn on the MMU for real! */
1150 li r4,MSR_KERNEL
1151 FIX_SRR1(r4,r5)
1152 lis r3,start_kernel@h
1153 ori r3,r3,start_kernel@l
1154 mtspr SPRN_SRR0,r3
1155 mtspr SPRN_SRR1,r4
1156 SYNC
1157 RFI
1158
1159/*
1160 * Set up the segment registers for a new context.
1161 */
1162_GLOBAL(set_context)
1163 mulli r3,r3,897 /* multiply context by skew factor */
1164 rlwinm r3,r3,4,8,27 /* VSID = (context & 0xfffff) << 4 */
1165 addis r3,r3,0x6000 /* Set Ks, Ku bits */
1166 li r0,NUM_USER_SEGMENTS
1167 mtctr r0
1168
1169#ifdef CONFIG_BDI_SWITCH
1170 /* Context switch the PTE pointer for the Abatron BDI2000.
1171 * The PGDIR is passed as second argument.
1172 */
1173 lis r5, KERNELBASE@h
1174 lwz r5, 0xf0(r5)
1175 stw r4, 0x4(r5)
1176#endif
1177 li r4,0
1178 isync
11793:
1180 mtsrin r3,r4
1181 addi r3,r3,0x111 /* next VSID */
1182 rlwinm r3,r3,0,8,3 /* clear out any overflow from VSID field */
1183 addis r4,r4,0x1000 /* address of next segment */
1184 bdnz 3b
1185 sync
1186 isync
1187 blr
1188
1189/*
1190 * An undocumented "feature" of 604e requires that the v bit
1191 * be cleared before changing BAT values.
1192 *
1193 * Also, newer IBM firmware does not clear bat3 and 4 so
1194 * this makes sure it's done.
1195 * -- Cort
1196 */
1197clear_bats:
1198 li r10,0
1199 mfspr r9,SPRN_PVR
1200 rlwinm r9,r9,16,16,31 /* r9 = 1 for 601, 4 for 604 */
1201 cmpwi r9, 1
1202 beq 1f
1203
1204 mtspr SPRN_DBAT0U,r10
1205 mtspr SPRN_DBAT0L,r10
1206 mtspr SPRN_DBAT1U,r10
1207 mtspr SPRN_DBAT1L,r10
1208 mtspr SPRN_DBAT2U,r10
1209 mtspr SPRN_DBAT2L,r10
1210 mtspr SPRN_DBAT3U,r10
1211 mtspr SPRN_DBAT3L,r10
12121:
1213 mtspr SPRN_IBAT0U,r10
1214 mtspr SPRN_IBAT0L,r10
1215 mtspr SPRN_IBAT1U,r10
1216 mtspr SPRN_IBAT1L,r10
1217 mtspr SPRN_IBAT2U,r10
1218 mtspr SPRN_IBAT2L,r10
1219 mtspr SPRN_IBAT3U,r10
1220 mtspr SPRN_IBAT3L,r10
1221BEGIN_FTR_SECTION
1222 /* Here's a tweak: at this point, CPU setup have
1223 * not been called yet, so HIGH_BAT_EN may not be
1224 * set in HID0 for the 745x processors. However, it
1225 * seems that doesn't affect our ability to actually
1226 * write to these SPRs.
1227 */
1228 mtspr SPRN_DBAT4U,r10
1229 mtspr SPRN_DBAT4L,r10
1230 mtspr SPRN_DBAT5U,r10
1231 mtspr SPRN_DBAT5L,r10
1232 mtspr SPRN_DBAT6U,r10
1233 mtspr SPRN_DBAT6L,r10
1234 mtspr SPRN_DBAT7U,r10
1235 mtspr SPRN_DBAT7L,r10
1236 mtspr SPRN_IBAT4U,r10
1237 mtspr SPRN_IBAT4L,r10
1238 mtspr SPRN_IBAT5U,r10
1239 mtspr SPRN_IBAT5L,r10
1240 mtspr SPRN_IBAT6U,r10
1241 mtspr SPRN_IBAT6L,r10
1242 mtspr SPRN_IBAT7U,r10
1243 mtspr SPRN_IBAT7L,r10
1244END_FTR_SECTION_IFSET(CPU_FTR_HAS_HIGH_BATS)
1245 blr
1246
1247flush_tlbs:
1248 lis r10, 0x40
12491: addic. r10, r10, -0x1000
1250 tlbie r10
1251 blt 1b
1252 sync
1253 blr
1254
1255mmu_off:
1256 addi r4, r3, __after_mmu_off - _start
1257 mfmsr r3
1258 andi. r0,r3,MSR_DR|MSR_IR /* MMU enabled? */
1259 beqlr
1260 andc r3,r3,r0
1261 mtspr SPRN_SRR0,r4
1262 mtspr SPRN_SRR1,r3
1263 sync
1264 RFI
1265
1266/*
1267 * Use the first pair of BAT registers to map the 1st 16MB
1268 * of RAM to KERNELBASE. From this point on we can't safely
1269 * call OF any more.
1270 */
1271initial_bats:
1272 lis r11,KERNELBASE@h
1273 mfspr r9,SPRN_PVR
1274 rlwinm r9,r9,16,16,31 /* r9 = 1 for 601, 4 for 604 */
1275 cmpwi 0,r9,1
1276 bne 4f
1277 ori r11,r11,4 /* set up BAT registers for 601 */
1278 li r8,0x7f /* valid, block length = 8MB */
1279 oris r9,r11,0x800000@h /* set up BAT reg for 2nd 8M */
1280 oris r10,r8,0x800000@h /* set up BAT reg for 2nd 8M */
1281 mtspr SPRN_IBAT0U,r11 /* N.B. 601 has valid bit in */
1282 mtspr SPRN_IBAT0L,r8 /* lower BAT register */
1283 mtspr SPRN_IBAT1U,r9
1284 mtspr SPRN_IBAT1L,r10
1285 isync
1286 blr
1287
12884: tophys(r8,r11)
1289#ifdef CONFIG_SMP
1290 ori r8,r8,0x12 /* R/W access, M=1 */
1291#else
1292 ori r8,r8,2 /* R/W access */
1293#endif /* CONFIG_SMP */
1294#ifdef CONFIG_APUS
1295 ori r11,r11,BL_8M<<2|0x2 /* set up 8MB BAT registers for 604 */
1296#else
1297 ori r11,r11,BL_256M<<2|0x2 /* set up BAT registers for 604 */
1298#endif /* CONFIG_APUS */
1299
1300 mtspr SPRN_DBAT0L,r8 /* N.B. 6xx (not 601) have valid */
1301 mtspr SPRN_DBAT0U,r11 /* bit in upper BAT register */
1302 mtspr SPRN_IBAT0L,r8
1303 mtspr SPRN_IBAT0U,r11
1304 isync
1305 blr
1306
1307
1308#ifdef CONFIG_8260
1309/* Jump into the system reset for the rom.
1310 * We first disable the MMU, and then jump to the ROM reset address.
1311 *
1312 * r3 is the board info structure, r4 is the location for starting.
1313 * I use this for building a small kernel that can load other kernels,
1314 * rather than trying to write or rely on a rom monitor that can tftp load.
1315 */
1316 .globl m8260_gorom
1317m8260_gorom:
1318 mfmsr r0
1319 rlwinm r0,r0,0,17,15 /* clear MSR_EE in r0 */
1320 sync
1321 mtmsr r0
1322 sync
1323 mfspr r11, SPRN_HID0
1324 lis r10, 0
1325 ori r10,r10,HID0_ICE|HID0_DCE
1326 andc r11, r11, r10
1327 mtspr SPRN_HID0, r11
1328 isync
1329 li r5, MSR_ME|MSR_RI
1330 lis r6,2f@h
1331 addis r6,r6,-KERNELBASE@h
1332 ori r6,r6,2f@l
1333 mtspr SPRN_SRR0,r6
1334 mtspr SPRN_SRR1,r5
1335 isync
1336 sync
1337 rfi
13382:
1339 mtlr r4
1340 blr
1341#endif
1342
1343
1344/*
1345 * We put a few things here that have to be page-aligned.
1346 * This stuff goes at the beginning of the data segment,
1347 * which is page-aligned.
1348 */
1349 .data
1350 .globl sdata
1351sdata:
1352 .globl empty_zero_page
1353empty_zero_page:
1354 .space 4096
1355
1356 .globl swapper_pg_dir
1357swapper_pg_dir:
1358 .space 4096
1359
1360/*
1361 * This space gets a copy of optional info passed to us by the bootstrap
1362 * Used to pass parameters into the kernel like root=/dev/sda1, etc.
1363 */
1364 .globl cmd_line
1365cmd_line:
1366 .space 512
1367
1368 .globl intercept_table
1369intercept_table:
1370 .long 0, 0, i0x200, i0x300, i0x400, 0, i0x600, i0x700
1371 .long i0x800, 0, 0, 0, 0, i0xd00, 0, 0
1372 .long 0, 0, 0, i0x1300, 0, 0, 0, 0
1373 .long 0, 0, 0, 0, 0, 0, 0, 0
1374 .long 0, 0, 0, 0, 0, 0, 0, 0
1375 .long 0, 0, 0, 0, 0, 0, 0, 0
1376
1377/* Room for two PTE pointers, usually the kernel and current user pointers
1378 * to their respective root page table.
1379 */
1380abatron_pteptrs:
1381 .space 8
diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S
new file mode 100644
index 000000000000..8b49679fad54
--- /dev/null
+++ b/arch/powerpc/kernel/head_44x.S
@@ -0,0 +1,782 @@
1/*
2 * arch/ppc/kernel/head_44x.S
3 *
4 * Kernel execution entry point code.
5 *
6 * Copyright (c) 1995-1996 Gary Thomas <gdt@linuxppc.org>
7 * Initial PowerPC version.
8 * Copyright (c) 1996 Cort Dougan <cort@cs.nmt.edu>
9 * Rewritten for PReP
10 * Copyright (c) 1996 Paul Mackerras <paulus@cs.anu.edu.au>
11 * Low-level exception handers, MMU support, and rewrite.
12 * Copyright (c) 1997 Dan Malek <dmalek@jlc.net>
13 * PowerPC 8xx modifications.
14 * Copyright (c) 1998-1999 TiVo, Inc.
15 * PowerPC 403GCX modifications.
16 * Copyright (c) 1999 Grant Erickson <grant@lcse.umn.edu>
17 * PowerPC 403GCX/405GP modifications.
18 * Copyright 2000 MontaVista Software Inc.
19 * PPC405 modifications
20 * PowerPC 403GCX/405GP modifications.
21 * Author: MontaVista Software, Inc.
22 * frank_rowand@mvista.com or source@mvista.com
23 * debbie_chu@mvista.com
24 * Copyright 2002-2005 MontaVista Software, Inc.
25 * PowerPC 44x support, Matt Porter <mporter@kernel.crashing.org>
26 *
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
29 * Free Software Foundation; either version 2 of the License, or (at your
30 * option) any later version.
31 */
32
33#include <linux/config.h>
34#include <asm/processor.h>
35#include <asm/page.h>
36#include <asm/mmu.h>
37#include <asm/pgtable.h>
38#include <asm/ibm4xx.h>
39#include <asm/ibm44x.h>
40#include <asm/cputable.h>
41#include <asm/thread_info.h>
42#include <asm/ppc_asm.h>
43#include <asm/asm-offsets.h>
44#include "head_booke.h"
45
46
47/* As with the other PowerPC ports, it is expected that when code
48 * execution begins here, the following registers contain valid, yet
49 * optional, information:
50 *
51 * r3 - Board info structure pointer (DRAM, frequency, MAC address, etc.)
52 * r4 - Starting address of the init RAM disk
53 * r5 - Ending address of the init RAM disk
54 * r6 - Start of kernel command line string (e.g. "mem=128")
55 * r7 - End of kernel command line string
56 *
57 */
58 .text
59_GLOBAL(_stext)
60_GLOBAL(_start)
61 /*
62 * Reserve a word at a fixed location to store the address
63 * of abatron_pteptrs
64 */
65 nop
66/*
67 * Save parameters we are passed
68 */
69 mr r31,r3
70 mr r30,r4
71 mr r29,r5
72 mr r28,r6
73 mr r27,r7
74 li r24,0 /* CPU number */
75
76/*
77 * Set up the initial MMU state
78 *
79 * We are still executing code at the virtual address
80 * mappings set by the firmware for the base of RAM.
81 *
82 * We first invalidate all TLB entries but the one
83 * we are running from. We then load the KERNELBASE
84 * mappings so we can begin to use kernel addresses
85 * natively and so the interrupt vector locations are
86 * permanently pinned (necessary since Book E
87 * implementations always have translation enabled).
88 *
89 * TODO: Use the known TLB entry we are running from to
90 * determine which physical region we are located
91 * in. This can be used to determine where in RAM
92 * (on a shared CPU system) or PCI memory space
93 * (on a DRAMless system) we are located.
94 * For now, we assume a perfect world which means
95 * we are located at the base of DRAM (physical 0).
96 */
97
98/*
99 * Search TLB for entry that we are currently using.
100 * Invalidate all entries but the one we are using.
101 */
102 /* Load our current PID->MMUCR TID and MSR IS->MMUCR STS */
103 mfspr r3,SPRN_PID /* Get PID */
104 mfmsr r4 /* Get MSR */
105 andi. r4,r4,MSR_IS@l /* TS=1? */
106 beq wmmucr /* If not, leave STS=0 */
107 oris r3,r3,PPC44x_MMUCR_STS@h /* Set STS=1 */
108wmmucr: mtspr SPRN_MMUCR,r3 /* Put MMUCR */
109 sync
110
111 bl invstr /* Find our address */
112invstr: mflr r5 /* Make it accessible */
113 tlbsx r23,0,r5 /* Find entry we are in */
114 li r4,0 /* Start at TLB entry 0 */
115 li r3,0 /* Set PAGEID inval value */
1161: cmpw r23,r4 /* Is this our entry? */
117 beq skpinv /* If so, skip the inval */
118 tlbwe r3,r4,PPC44x_TLB_PAGEID /* If not, inval the entry */
119skpinv: addi r4,r4,1 /* Increment */
120 cmpwi r4,64 /* Are we done? */
121 bne 1b /* If not, repeat */
122 isync /* If so, context change */
123
124/*
125 * Configure and load pinned entry into TLB slot 63.
126 */
127
128 lis r3,KERNELBASE@h /* Load the kernel virtual address */
129 ori r3,r3,KERNELBASE@l
130
131 /* Kernel is at the base of RAM */
132 li r4, 0 /* Load the kernel physical address */
133
134 /* Load the kernel PID = 0 */
135 li r0,0
136 mtspr SPRN_PID,r0
137 sync
138
139 /* Initialize MMUCR */
140 li r5,0
141 mtspr SPRN_MMUCR,r5
142 sync
143
144 /* pageid fields */
145 clrrwi r3,r3,10 /* Mask off the effective page number */
146 ori r3,r3,PPC44x_TLB_VALID | PPC44x_TLB_256M
147
148 /* xlat fields */
149 clrrwi r4,r4,10 /* Mask off the real page number */
150 /* ERPN is 0 for first 4GB page */
151
152 /* attrib fields */
153 /* Added guarded bit to protect against speculative loads/stores */
154 li r5,0
155 ori r5,r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_G)
156
157 li r0,63 /* TLB slot 63 */
158
159 tlbwe r3,r0,PPC44x_TLB_PAGEID /* Load the pageid fields */
160 tlbwe r4,r0,PPC44x_TLB_XLAT /* Load the translation fields */
161 tlbwe r5,r0,PPC44x_TLB_ATTRIB /* Load the attrib/access fields */
162
163 /* Force context change */
164 mfmsr r0
165 mtspr SPRN_SRR1, r0
166 lis r0,3f@h
167 ori r0,r0,3f@l
168 mtspr SPRN_SRR0,r0
169 sync
170 rfi
171
172 /* If necessary, invalidate original entry we used */
1733: cmpwi r23,63
174 beq 4f
175 li r6,0
176 tlbwe r6,r23,PPC44x_TLB_PAGEID
177 isync
178
1794:
180#ifdef CONFIG_SERIAL_TEXT_DEBUG
181 /*
182 * Add temporary UART mapping for early debug.
183 * We can map UART registers wherever we want as long as they don't
184 * interfere with other system mappings (e.g. with pinned entries).
185 * For an example of how we handle this - see ocotea.h. --ebs
186 */
187 /* pageid fields */
188 lis r3,UART0_IO_BASE@h
189 ori r3,r3,PPC44x_TLB_VALID | PPC44x_TLB_4K
190
191 /* xlat fields */
192 lis r4,UART0_PHYS_IO_BASE@h /* RPN depends on SoC */
193#ifndef CONFIG_440EP
194 ori r4,r4,0x0001 /* ERPN is 1 for second 4GB page */
195#endif
196
197 /* attrib fields */
198 li r5,0
199 ori r5,r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_I | PPC44x_TLB_G)
200
201 li r0,0 /* TLB slot 0 */
202
203 tlbwe r3,r0,PPC44x_TLB_PAGEID /* Load the pageid fields */
204 tlbwe r4,r0,PPC44x_TLB_XLAT /* Load the translation fields */
205 tlbwe r5,r0,PPC44x_TLB_ATTRIB /* Load the attrib/access fields */
206
207 /* Force context change */
208 isync
209#endif /* CONFIG_SERIAL_TEXT_DEBUG */
210
211 /* Establish the interrupt vector offsets */
212 SET_IVOR(0, CriticalInput);
213 SET_IVOR(1, MachineCheck);
214 SET_IVOR(2, DataStorage);
215 SET_IVOR(3, InstructionStorage);
216 SET_IVOR(4, ExternalInput);
217 SET_IVOR(5, Alignment);
218 SET_IVOR(6, Program);
219 SET_IVOR(7, FloatingPointUnavailable);
220 SET_IVOR(8, SystemCall);
221 SET_IVOR(9, AuxillaryProcessorUnavailable);
222 SET_IVOR(10, Decrementer);
223 SET_IVOR(11, FixedIntervalTimer);
224 SET_IVOR(12, WatchdogTimer);
225 SET_IVOR(13, DataTLBError);
226 SET_IVOR(14, InstructionTLBError);
227 SET_IVOR(15, Debug);
228
229 /* Establish the interrupt vector base */
230 lis r4,interrupt_base@h /* IVPR only uses the high 16-bits */
231 mtspr SPRN_IVPR,r4
232
233#ifdef CONFIG_440EP
234 /* Clear DAPUIB flag in CCR0 (enable APU between CPU and FPU) */
235 mfspr r2,SPRN_CCR0
236 lis r3,0xffef
237 ori r3,r3,0xffff
238 and r2,r2,r3
239 mtspr SPRN_CCR0,r2
240 isync
241#endif
242
243 /*
244 * This is where the main kernel code starts.
245 */
246
247 /* ptr to current */
248 lis r2,init_task@h
249 ori r2,r2,init_task@l
250
251 /* ptr to current thread */
252 addi r4,r2,THREAD /* init task's THREAD */
253 mtspr SPRN_SPRG3,r4
254
255 /* stack */
256 lis r1,init_thread_union@h
257 ori r1,r1,init_thread_union@l
258 li r0,0
259 stwu r0,THREAD_SIZE-STACK_FRAME_OVERHEAD(r1)
260
261 bl early_init
262
263/*
264 * Decide what sort of machine this is and initialize the MMU.
265 */
266 mr r3,r31
267 mr r4,r30
268 mr r5,r29
269 mr r6,r28
270 mr r7,r27
271 bl machine_init
272 bl MMU_init
273
274 /* Setup PTE pointers for the Abatron bdiGDB */
275 lis r6, swapper_pg_dir@h
276 ori r6, r6, swapper_pg_dir@l
277 lis r5, abatron_pteptrs@h
278 ori r5, r5, abatron_pteptrs@l
279 lis r4, KERNELBASE@h
280 ori r4, r4, KERNELBASE@l
281 stw r5, 0(r4) /* Save abatron_pteptrs at a fixed location */
282 stw r6, 0(r5)
283
284 /* Let's move on */
285 lis r4,start_kernel@h
286 ori r4,r4,start_kernel@l
287 lis r3,MSR_KERNEL@h
288 ori r3,r3,MSR_KERNEL@l
289 mtspr SPRN_SRR0,r4
290 mtspr SPRN_SRR1,r3
291 rfi /* change context and jump to start_kernel */
292
293/*
294 * Interrupt vector entry code
295 *
296 * The Book E MMUs are always on so we don't need to handle
297 * interrupts in real mode as with previous PPC processors. In
298 * this case we handle interrupts in the kernel virtual address
299 * space.
300 *
301 * Interrupt vectors are dynamically placed relative to the
302 * interrupt prefix as determined by the address of interrupt_base.
303 * The interrupt vectors offsets are programmed using the labels
304 * for each interrupt vector entry.
305 *
306 * Interrupt vectors must be aligned on a 16 byte boundary.
307 * We align on a 32 byte cache line boundary for good measure.
308 */
309
310interrupt_base:
311 /* Critical Input Interrupt */
312 CRITICAL_EXCEPTION(0x0100, CriticalInput, unknown_exception)
313
314 /* Machine Check Interrupt */
315#ifdef CONFIG_440A
316 MCHECK_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
317#else
318 CRITICAL_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
319#endif
320
321 /* Data Storage Interrupt */
322 START_EXCEPTION(DataStorage)
323 mtspr SPRN_SPRG0, r10 /* Save some working registers */
324 mtspr SPRN_SPRG1, r11
325 mtspr SPRN_SPRG4W, r12
326 mtspr SPRN_SPRG5W, r13
327 mfcr r11
328 mtspr SPRN_SPRG7W, r11
329
330 /*
331 * Check if it was a store fault, if not then bail
332 * because a user tried to access a kernel or
333 * read-protected page. Otherwise, get the
334 * offending address and handle it.
335 */
336 mfspr r10, SPRN_ESR
337 andis. r10, r10, ESR_ST@h
338 beq 2f
339
340 mfspr r10, SPRN_DEAR /* Get faulting address */
341
342 /* If we are faulting a kernel address, we have to use the
343 * kernel page tables.
344 */
345 lis r11, TASK_SIZE@h
346 cmplw r10, r11
347 blt+ 3f
348 lis r11, swapper_pg_dir@h
349 ori r11, r11, swapper_pg_dir@l
350
351 mfspr r12,SPRN_MMUCR
352 rlwinm r12,r12,0,0,23 /* Clear TID */
353
354 b 4f
355
356 /* Get the PGD for the current thread */
3573:
358 mfspr r11,SPRN_SPRG3
359 lwz r11,PGDIR(r11)
360
361 /* Load PID into MMUCR TID */
362 mfspr r12,SPRN_MMUCR /* Get MMUCR */
363 mfspr r13,SPRN_PID /* Get PID */
364 rlwimi r12,r13,0,24,31 /* Set TID */
365
3664:
367 mtspr SPRN_MMUCR,r12
368
369 rlwinm r12, r10, 13, 19, 29 /* Compute pgdir/pmd offset */
370 lwzx r11, r12, r11 /* Get pgd/pmd entry */
371 rlwinm. r12, r11, 0, 0, 20 /* Extract pt base address */
372 beq 2f /* Bail if no table */
373
374 rlwimi r12, r10, 23, 20, 28 /* Compute pte address */
375 lwz r11, 4(r12) /* Get pte entry */
376
377 andi. r13, r11, _PAGE_RW /* Is it writeable? */
378 beq 2f /* Bail if not */
379
380 /* Update 'changed'.
381 */
382 ori r11, r11, _PAGE_DIRTY|_PAGE_ACCESSED|_PAGE_HWWRITE
383 stw r11, 4(r12) /* Update Linux page table */
384
385 li r13, PPC44x_TLB_SR@l /* Set SR */
386 rlwimi r13, r11, 29, 29, 29 /* SX = _PAGE_HWEXEC */
387 rlwimi r13, r11, 0, 30, 30 /* SW = _PAGE_RW */
388 rlwimi r13, r11, 29, 28, 28 /* UR = _PAGE_USER */
389 rlwimi r12, r11, 31, 26, 26 /* (_PAGE_USER>>1)->r12 */
390 rlwimi r12, r11, 29, 30, 30 /* (_PAGE_USER>>3)->r12 */
391 and r12, r12, r11 /* HWEXEC/RW & USER */
392 rlwimi r13, r12, 0, 26, 26 /* UX = HWEXEC & USER */
393 rlwimi r13, r12, 3, 27, 27 /* UW = RW & USER */
394
395 rlwimi r11,r13,0,26,31 /* Insert static perms */
396
397 rlwinm r11,r11,0,20,15 /* Clear U0-U3 */
398
399 /* find the TLB index that caused the fault. It has to be here. */
400 tlbsx r10, 0, r10
401
402 tlbwe r11, r10, PPC44x_TLB_ATTRIB /* Write ATTRIB */
403
404 /* Done...restore registers and get out of here.
405 */
406 mfspr r11, SPRN_SPRG7R
407 mtcr r11
408 mfspr r13, SPRN_SPRG5R
409 mfspr r12, SPRN_SPRG4R
410
411 mfspr r11, SPRN_SPRG1
412 mfspr r10, SPRN_SPRG0
413 rfi /* Force context change */
414
4152:
416 /*
417 * The bailout. Restore registers to pre-exception conditions
418 * and call the heavyweights to help us out.
419 */
420 mfspr r11, SPRN_SPRG7R
421 mtcr r11
422 mfspr r13, SPRN_SPRG5R
423 mfspr r12, SPRN_SPRG4R
424
425 mfspr r11, SPRN_SPRG1
426 mfspr r10, SPRN_SPRG0
427 b data_access
428
429 /* Instruction Storage Interrupt */
430 INSTRUCTION_STORAGE_EXCEPTION
431
432 /* External Input Interrupt */
433 EXCEPTION(0x0500, ExternalInput, do_IRQ, EXC_XFER_LITE)
434
435 /* Alignment Interrupt */
436 ALIGNMENT_EXCEPTION
437
438 /* Program Interrupt */
439 PROGRAM_EXCEPTION
440
441 /* Floating Point Unavailable Interrupt */
442#ifdef CONFIG_PPC_FPU
443 FP_UNAVAILABLE_EXCEPTION
444#else
445 EXCEPTION(0x2010, FloatingPointUnavailable, unknown_exception, EXC_XFER_EE)
446#endif
447
448 /* System Call Interrupt */
449 START_EXCEPTION(SystemCall)
450 NORMAL_EXCEPTION_PROLOG
451 EXC_XFER_EE_LITE(0x0c00, DoSyscall)
452
453 /* Auxillary Processor Unavailable Interrupt */
454 EXCEPTION(0x2020, AuxillaryProcessorUnavailable, unknown_exception, EXC_XFER_EE)
455
456 /* Decrementer Interrupt */
457 DECREMENTER_EXCEPTION
458
459 /* Fixed Internal Timer Interrupt */
460 /* TODO: Add FIT support */
461 EXCEPTION(0x1010, FixedIntervalTimer, unknown_exception, EXC_XFER_EE)
462
463 /* Watchdog Timer Interrupt */
464 /* TODO: Add watchdog support */
465#ifdef CONFIG_BOOKE_WDT
466 CRITICAL_EXCEPTION(0x1020, WatchdogTimer, WatchdogException)
467#else
468 CRITICAL_EXCEPTION(0x1020, WatchdogTimer, unknown_exception)
469#endif
470
471 /* Data TLB Error Interrupt */
472 START_EXCEPTION(DataTLBError)
473 mtspr SPRN_SPRG0, r10 /* Save some working registers */
474 mtspr SPRN_SPRG1, r11
475 mtspr SPRN_SPRG4W, r12
476 mtspr SPRN_SPRG5W, r13
477 mfcr r11
478 mtspr SPRN_SPRG7W, r11
479 mfspr r10, SPRN_DEAR /* Get faulting address */
480
481 /* If we are faulting a kernel address, we have to use the
482 * kernel page tables.
483 */
484 lis r11, TASK_SIZE@h
485 cmplw r10, r11
486 blt+ 3f
487 lis r11, swapper_pg_dir@h
488 ori r11, r11, swapper_pg_dir@l
489
490 mfspr r12,SPRN_MMUCR
491 rlwinm r12,r12,0,0,23 /* Clear TID */
492
493 b 4f
494
495 /* Get the PGD for the current thread */
4963:
497 mfspr r11,SPRN_SPRG3
498 lwz r11,PGDIR(r11)
499
500 /* Load PID into MMUCR TID */
501 mfspr r12,SPRN_MMUCR
502 mfspr r13,SPRN_PID /* Get PID */
503 rlwimi r12,r13,0,24,31 /* Set TID */
504
5054:
506 mtspr SPRN_MMUCR,r12
507
508 rlwinm r12, r10, 13, 19, 29 /* Compute pgdir/pmd offset */
509 lwzx r11, r12, r11 /* Get pgd/pmd entry */
510 rlwinm. r12, r11, 0, 0, 20 /* Extract pt base address */
511 beq 2f /* Bail if no table */
512
513 rlwimi r12, r10, 23, 20, 28 /* Compute pte address */
514 lwz r11, 4(r12) /* Get pte entry */
515 andi. r13, r11, _PAGE_PRESENT /* Is the page present? */
516 beq 2f /* Bail if not present */
517
518 ori r11, r11, _PAGE_ACCESSED
519 stw r11, 4(r12)
520
521 /* Jump to common tlb load */
522 b finish_tlb_load
523
5242:
525 /* The bailout. Restore registers to pre-exception conditions
526 * and call the heavyweights to help us out.
527 */
528 mfspr r11, SPRN_SPRG7R
529 mtcr r11
530 mfspr r13, SPRN_SPRG5R
531 mfspr r12, SPRN_SPRG4R
532 mfspr r11, SPRN_SPRG1
533 mfspr r10, SPRN_SPRG0
534 b data_access
535
536 /* Instruction TLB Error Interrupt */
537 /*
538 * Nearly the same as above, except we get our
539 * information from different registers and bailout
540 * to a different point.
541 */
542 START_EXCEPTION(InstructionTLBError)
543 mtspr SPRN_SPRG0, r10 /* Save some working registers */
544 mtspr SPRN_SPRG1, r11
545 mtspr SPRN_SPRG4W, r12
546 mtspr SPRN_SPRG5W, r13
547 mfcr r11
548 mtspr SPRN_SPRG7W, r11
549 mfspr r10, SPRN_SRR0 /* Get faulting address */
550
551 /* If we are faulting a kernel address, we have to use the
552 * kernel page tables.
553 */
554 lis r11, TASK_SIZE@h
555 cmplw r10, r11
556 blt+ 3f
557 lis r11, swapper_pg_dir@h
558 ori r11, r11, swapper_pg_dir@l
559
560 mfspr r12,SPRN_MMUCR
561 rlwinm r12,r12,0,0,23 /* Clear TID */
562
563 b 4f
564
565 /* Get the PGD for the current thread */
5663:
567 mfspr r11,SPRN_SPRG3
568 lwz r11,PGDIR(r11)
569
570 /* Load PID into MMUCR TID */
571 mfspr r12,SPRN_MMUCR
572 mfspr r13,SPRN_PID /* Get PID */
573 rlwimi r12,r13,0,24,31 /* Set TID */
574
5754:
576 mtspr SPRN_MMUCR,r12
577
578 rlwinm r12, r10, 13, 19, 29 /* Compute pgdir/pmd offset */
579 lwzx r11, r12, r11 /* Get pgd/pmd entry */
580 rlwinm. r12, r11, 0, 0, 20 /* Extract pt base address */
581 beq 2f /* Bail if no table */
582
583 rlwimi r12, r10, 23, 20, 28 /* Compute pte address */
584 lwz r11, 4(r12) /* Get pte entry */
585 andi. r13, r11, _PAGE_PRESENT /* Is the page present? */
586 beq 2f /* Bail if not present */
587
588 ori r11, r11, _PAGE_ACCESSED
589 stw r11, 4(r12)
590
591 /* Jump to common TLB load point */
592 b finish_tlb_load
593
5942:
595 /* The bailout. Restore registers to pre-exception conditions
596 * and call the heavyweights to help us out.
597 */
598 mfspr r11, SPRN_SPRG7R
599 mtcr r11
600 mfspr r13, SPRN_SPRG5R
601 mfspr r12, SPRN_SPRG4R
602 mfspr r11, SPRN_SPRG1
603 mfspr r10, SPRN_SPRG0
604 b InstructionStorage
605
606 /* Debug Interrupt */
607 DEBUG_EXCEPTION
608
609/*
610 * Local functions
611 */
612 /*
613 * Data TLB exceptions will bail out to this point
614 * if they can't resolve the lightweight TLB fault.
615 */
616data_access:
617 NORMAL_EXCEPTION_PROLOG
618 mfspr r5,SPRN_ESR /* Grab the ESR, save it, pass arg3 */
619 stw r5,_ESR(r11)
620 mfspr r4,SPRN_DEAR /* Grab the DEAR, save it, pass arg2 */
621 EXC_XFER_EE_LITE(0x0300, handle_page_fault)
622
623/*
624
625 * Both the instruction and data TLB miss get to this
626 * point to load the TLB.
627 * r10 - EA of fault
628 * r11 - available to use
629 * r12 - Pointer to the 64-bit PTE
630 * r13 - available to use
631 * MMUCR - loaded with proper value when we get here
632 * Upon exit, we reload everything and RFI.
633 */
634finish_tlb_load:
635 /*
636 * We set execute, because we don't have the granularity to
637 * properly set this at the page level (Linux problem).
638 * If shared is set, we cause a zero PID->TID load.
639 * Many of these bits are software only. Bits we don't set
640 * here we (properly should) assume have the appropriate value.
641 */
642
643 /* Load the next available TLB index */
644 lis r13, tlb_44x_index@ha
645 lwz r13, tlb_44x_index@l(r13)
646 /* Load the TLB high watermark */
647 lis r11, tlb_44x_hwater@ha
648 lwz r11, tlb_44x_hwater@l(r11)
649
650 /* Increment, rollover, and store TLB index */
651 addi r13, r13, 1
652 cmpw 0, r13, r11 /* reserve entries */
653 ble 7f
654 li r13, 0
6557:
656 /* Store the next available TLB index */
657 lis r11, tlb_44x_index@ha
658 stw r13, tlb_44x_index@l(r11)
659
660 lwz r11, 0(r12) /* Get MS word of PTE */
661 lwz r12, 4(r12) /* Get LS word of PTE */
662 rlwimi r11, r12, 0, 0 , 19 /* Insert RPN */
663 tlbwe r11, r13, PPC44x_TLB_XLAT /* Write XLAT */
664
665 /*
666 * Create PAGEID. This is the faulting address,
667 * page size, and valid flag.
668 */
669 li r11, PPC44x_TLB_VALID | PPC44x_TLB_4K
670 rlwimi r10, r11, 0, 20, 31 /* Insert valid and page size */
671 tlbwe r10, r13, PPC44x_TLB_PAGEID /* Write PAGEID */
672
673 li r10, PPC44x_TLB_SR@l /* Set SR */
674 rlwimi r10, r12, 0, 30, 30 /* Set SW = _PAGE_RW */
675 rlwimi r10, r12, 29, 29, 29 /* SX = _PAGE_HWEXEC */
676 rlwimi r10, r12, 29, 28, 28 /* UR = _PAGE_USER */
677 rlwimi r11, r12, 31, 26, 26 /* (_PAGE_USER>>1)->r12 */
678 and r11, r12, r11 /* HWEXEC & USER */
679 rlwimi r10, r11, 0, 26, 26 /* UX = HWEXEC & USER */
680
681 rlwimi r12, r10, 0, 26, 31 /* Insert static perms */
682 rlwinm r12, r12, 0, 20, 15 /* Clear U0-U3 */
683 tlbwe r12, r13, PPC44x_TLB_ATTRIB /* Write ATTRIB */
684
685 /* Done...restore registers and get out of here.
686 */
687 mfspr r11, SPRN_SPRG7R
688 mtcr r11
689 mfspr r13, SPRN_SPRG5R
690 mfspr r12, SPRN_SPRG4R
691 mfspr r11, SPRN_SPRG1
692 mfspr r10, SPRN_SPRG0
693 rfi /* Force context change */
694
695/*
696 * Global functions
697 */
698
699/*
700 * extern void giveup_altivec(struct task_struct *prev)
701 *
702 * The 44x core does not have an AltiVec unit.
703 */
704_GLOBAL(giveup_altivec)
705 blr
706
707/*
708 * extern void giveup_fpu(struct task_struct *prev)
709 *
710 * The 44x core does not have an FPU.
711 */
712#ifndef CONFIG_PPC_FPU
713_GLOBAL(giveup_fpu)
714 blr
715#endif
716
717/*
718 * extern void abort(void)
719 *
720 * At present, this routine just applies a system reset.
721 */
722_GLOBAL(abort)
723 mfspr r13,SPRN_DBCR0
724 oris r13,r13,DBCR0_RST_SYSTEM@h
725 mtspr SPRN_DBCR0,r13
726
727_GLOBAL(set_context)
728
729#ifdef CONFIG_BDI_SWITCH
730 /* Context switch the PTE pointer for the Abatron BDI2000.
731 * The PGDIR is the second parameter.
732 */
733 lis r5, abatron_pteptrs@h
734 ori r5, r5, abatron_pteptrs@l
735 stw r4, 0x4(r5)
736#endif
737 mtspr SPRN_PID,r3
738 isync /* Force context change */
739 blr
740
741/*
742 * We put a few things here that have to be page-aligned. This stuff
743 * goes at the beginning of the data segment, which is page-aligned.
744 */
745 .data
746 .align 12
747 .globl sdata
748sdata:
749 .globl empty_zero_page
750empty_zero_page:
751 .space 4096
752
753/*
754 * To support >32-bit physical addresses, we use an 8KB pgdir.
755 */
756 .globl swapper_pg_dir
757swapper_pg_dir:
758 .space 8192
759
760/* Reserved 4k for the critical exception stack & 4k for the machine
761 * check stack per CPU for kernel mode exceptions */
762 .section .bss
763 .align 12
764exception_stack_bottom:
765 .space BOOKE_EXCEPTION_STACK_SIZE
766 .globl exception_stack_top
767exception_stack_top:
768
769/*
770 * This space gets a copy of optional info passed to us by the bootstrap
771 * which is used to pass parameters into the kernel like root=/dev/sda1, etc.
772 */
773 .globl cmd_line
774cmd_line:
775 .space 512
776
777/*
778 * Room for two PTE pointers, usually the kernel and current user pointers
779 * to their respective root page table.
780 */
781abatron_pteptrs:
782 .space 8
diff --git a/arch/powerpc/kernel/head_4xx.S b/arch/powerpc/kernel/head_4xx.S
new file mode 100644
index 000000000000..2590e97f5539
--- /dev/null
+++ b/arch/powerpc/kernel/head_4xx.S
@@ -0,0 +1,1022 @@
1/*
2 * Copyright (c) 1995-1996 Gary Thomas <gdt@linuxppc.org>
3 * Initial PowerPC version.
4 * Copyright (c) 1996 Cort Dougan <cort@cs.nmt.edu>
5 * Rewritten for PReP
6 * Copyright (c) 1996 Paul Mackerras <paulus@cs.anu.edu.au>
7 * Low-level exception handers, MMU support, and rewrite.
8 * Copyright (c) 1997 Dan Malek <dmalek@jlc.net>
9 * PowerPC 8xx modifications.
10 * Copyright (c) 1998-1999 TiVo, Inc.
11 * PowerPC 403GCX modifications.
12 * Copyright (c) 1999 Grant Erickson <grant@lcse.umn.edu>
13 * PowerPC 403GCX/405GP modifications.
14 * Copyright 2000 MontaVista Software Inc.
15 * PPC405 modifications
16 * PowerPC 403GCX/405GP modifications.
17 * Author: MontaVista Software, Inc.
18 * frank_rowand@mvista.com or source@mvista.com
19 * debbie_chu@mvista.com
20 *
21 *
22 * Module name: head_4xx.S
23 *
24 * Description:
25 * Kernel execution entry point code.
26 *
27 * This program is free software; you can redistribute it and/or
28 * modify it under the terms of the GNU General Public License
29 * as published by the Free Software Foundation; either version
30 * 2 of the License, or (at your option) any later version.
31 *
32 */
33
34#include <linux/config.h>
35#include <asm/processor.h>
36#include <asm/page.h>
37#include <asm/mmu.h>
38#include <asm/pgtable.h>
39#include <asm/ibm4xx.h>
40#include <asm/cputable.h>
41#include <asm/thread_info.h>
42#include <asm/ppc_asm.h>
43#include <asm/asm-offsets.h>
44
45/* As with the other PowerPC ports, it is expected that when code
46 * execution begins here, the following registers contain valid, yet
47 * optional, information:
48 *
49 * r3 - Board info structure pointer (DRAM, frequency, MAC address, etc.)
50 * r4 - Starting address of the init RAM disk
51 * r5 - Ending address of the init RAM disk
52 * r6 - Start of kernel command line string (e.g. "mem=96m")
53 * r7 - End of kernel command line string
54 *
55 * This is all going to change RSN when we add bi_recs....... -- Dan
56 */
57 .text
58_GLOBAL(_stext)
59_GLOBAL(_start)
60
61 /* Save parameters we are passed.
62 */
63 mr r31,r3
64 mr r30,r4
65 mr r29,r5
66 mr r28,r6
67 mr r27,r7
68
69 /* We have to turn on the MMU right away so we get cache modes
70 * set correctly.
71 */
72 bl initial_mmu
73
74/* We now have the lower 16 Meg mapped into TLB entries, and the caches
75 * ready to work.
76 */
77turn_on_mmu:
78 lis r0,MSR_KERNEL@h
79 ori r0,r0,MSR_KERNEL@l
80 mtspr SPRN_SRR1,r0
81 lis r0,start_here@h
82 ori r0,r0,start_here@l
83 mtspr SPRN_SRR0,r0
84 SYNC
85 rfi /* enables MMU */
86 b . /* prevent prefetch past rfi */
87
88/*
89 * This area is used for temporarily saving registers during the
90 * critical exception prolog.
91 */
92 . = 0xc0
93crit_save:
94_GLOBAL(crit_r10)
95 .space 4
96_GLOBAL(crit_r11)
97 .space 4
98
99/*
100 * Exception vector entry code. This code runs with address translation
101 * turned off (i.e. using physical addresses). We assume SPRG3 has the
102 * physical address of the current task thread_struct.
103 * Note that we have to have decremented r1 before we write to any fields
104 * of the exception frame, since a critical interrupt could occur at any
105 * time, and it will write to the area immediately below the current r1.
106 */
107#define NORMAL_EXCEPTION_PROLOG \
108 mtspr SPRN_SPRG0,r10; /* save two registers to work with */\
109 mtspr SPRN_SPRG1,r11; \
110 mtspr SPRN_SPRG2,r1; \
111 mfcr r10; /* save CR in r10 for now */\
112 mfspr r11,SPRN_SRR1; /* check whether user or kernel */\
113 andi. r11,r11,MSR_PR; \
114 beq 1f; \
115 mfspr r1,SPRN_SPRG3; /* if from user, start at top of */\
116 lwz r1,THREAD_INFO-THREAD(r1); /* this thread's kernel stack */\
117 addi r1,r1,THREAD_SIZE; \
1181: subi r1,r1,INT_FRAME_SIZE; /* Allocate an exception frame */\
119 tophys(r11,r1); \
120 stw r10,_CCR(r11); /* save various registers */\
121 stw r12,GPR12(r11); \
122 stw r9,GPR9(r11); \
123 mfspr r10,SPRN_SPRG0; \
124 stw r10,GPR10(r11); \
125 mfspr r12,SPRN_SPRG1; \
126 stw r12,GPR11(r11); \
127 mflr r10; \
128 stw r10,_LINK(r11); \
129 mfspr r10,SPRN_SPRG2; \
130 mfspr r12,SPRN_SRR0; \
131 stw r10,GPR1(r11); \
132 mfspr r9,SPRN_SRR1; \
133 stw r10,0(r11); \
134 rlwinm r9,r9,0,14,12; /* clear MSR_WE (necessary?) */\
135 stw r0,GPR0(r11); \
136 SAVE_4GPRS(3, r11); \
137 SAVE_2GPRS(7, r11)
138
139/*
140 * Exception prolog for critical exceptions. This is a little different
141 * from the normal exception prolog above since a critical exception
142 * can potentially occur at any point during normal exception processing.
143 * Thus we cannot use the same SPRG registers as the normal prolog above.
144 * Instead we use a couple of words of memory at low physical addresses.
145 * This is OK since we don't support SMP on these processors.
146 */
147#define CRITICAL_EXCEPTION_PROLOG \
148 stw r10,crit_r10@l(0); /* save two registers to work with */\
149 stw r11,crit_r11@l(0); \
150 mfcr r10; /* save CR in r10 for now */\
151 mfspr r11,SPRN_SRR3; /* check whether user or kernel */\
152 andi. r11,r11,MSR_PR; \
153 lis r11,critical_stack_top@h; \
154 ori r11,r11,critical_stack_top@l; \
155 beq 1f; \
156 /* COMING FROM USER MODE */ \
157 mfspr r11,SPRN_SPRG3; /* if from user, start at top of */\
158 lwz r11,THREAD_INFO-THREAD(r11); /* this thread's kernel stack */\
159 addi r11,r11,THREAD_SIZE; \
1601: subi r11,r11,INT_FRAME_SIZE; /* Allocate an exception frame */\
161 tophys(r11,r11); \
162 stw r10,_CCR(r11); /* save various registers */\
163 stw r12,GPR12(r11); \
164 stw r9,GPR9(r11); \
165 mflr r10; \
166 stw r10,_LINK(r11); \
167 mfspr r12,SPRN_DEAR; /* save DEAR and ESR in the frame */\
168 stw r12,_DEAR(r11); /* since they may have had stuff */\
169 mfspr r9,SPRN_ESR; /* in them at the point where the */\
170 stw r9,_ESR(r11); /* exception was taken */\
171 mfspr r12,SPRN_SRR2; \
172 stw r1,GPR1(r11); \
173 mfspr r9,SPRN_SRR3; \
174 stw r1,0(r11); \
175 tovirt(r1,r11); \
176 rlwinm r9,r9,0,14,12; /* clear MSR_WE (necessary?) */\
177 stw r0,GPR0(r11); \
178 SAVE_4GPRS(3, r11); \
179 SAVE_2GPRS(7, r11)
180
181 /*
182 * State at this point:
183 * r9 saved in stack frame, now saved SRR3 & ~MSR_WE
184 * r10 saved in crit_r10 and in stack frame, trashed
185 * r11 saved in crit_r11 and in stack frame,
186 * now phys stack/exception frame pointer
187 * r12 saved in stack frame, now saved SRR2
188 * CR saved in stack frame, CR0.EQ = !SRR3.PR
189 * LR, DEAR, ESR in stack frame
190 * r1 saved in stack frame, now virt stack/excframe pointer
191 * r0, r3-r8 saved in stack frame
192 */
193
194/*
195 * Exception vectors.
196 */
197#define START_EXCEPTION(n, label) \
198 . = n; \
199label:
200
201#define EXCEPTION(n, label, hdlr, xfer) \
202 START_EXCEPTION(n, label); \
203 NORMAL_EXCEPTION_PROLOG; \
204 addi r3,r1,STACK_FRAME_OVERHEAD; \
205 xfer(n, hdlr)
206
207#define CRITICAL_EXCEPTION(n, label, hdlr) \
208 START_EXCEPTION(n, label); \
209 CRITICAL_EXCEPTION_PROLOG; \
210 addi r3,r1,STACK_FRAME_OVERHEAD; \
211 EXC_XFER_TEMPLATE(hdlr, n+2, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \
212 NOCOPY, crit_transfer_to_handler, \
213 ret_from_crit_exc)
214
215#define EXC_XFER_TEMPLATE(hdlr, trap, msr, copyee, tfer, ret) \
216 li r10,trap; \
217 stw r10,_TRAP(r11); \
218 lis r10,msr@h; \
219 ori r10,r10,msr@l; \
220 copyee(r10, r9); \
221 bl tfer; \
222 .long hdlr; \
223 .long ret
224
225#define COPY_EE(d, s) rlwimi d,s,0,16,16
226#define NOCOPY(d, s)
227
228#define EXC_XFER_STD(n, hdlr) \
229 EXC_XFER_TEMPLATE(hdlr, n, MSR_KERNEL, NOCOPY, transfer_to_handler_full, \
230 ret_from_except_full)
231
232#define EXC_XFER_LITE(n, hdlr) \
233 EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, NOCOPY, transfer_to_handler, \
234 ret_from_except)
235
236#define EXC_XFER_EE(n, hdlr) \
237 EXC_XFER_TEMPLATE(hdlr, n, MSR_KERNEL, COPY_EE, transfer_to_handler_full, \
238 ret_from_except_full)
239
240#define EXC_XFER_EE_LITE(n, hdlr) \
241 EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, COPY_EE, transfer_to_handler, \
242 ret_from_except)
243
244
245/*
246 * 0x0100 - Critical Interrupt Exception
247 */
248 CRITICAL_EXCEPTION(0x0100, CriticalInterrupt, unknown_exception)
249
250/*
251 * 0x0200 - Machine Check Exception
252 */
253 CRITICAL_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
254
255/*
256 * 0x0300 - Data Storage Exception
257 * This happens for just a few reasons. U0 set (but we don't do that),
258 * or zone protection fault (user violation, write to protected page).
259 * If this is just an update of modified status, we do that quickly
260 * and exit. Otherwise, we call heavywight functions to do the work.
261 */
262 START_EXCEPTION(0x0300, DataStorage)
263 mtspr SPRN_SPRG0, r10 /* Save some working registers */
264 mtspr SPRN_SPRG1, r11
265#ifdef CONFIG_403GCX
266 stw r12, 0(r0)
267 stw r9, 4(r0)
268 mfcr r11
269 mfspr r12, SPRN_PID
270 stw r11, 8(r0)
271 stw r12, 12(r0)
272#else
273 mtspr SPRN_SPRG4, r12
274 mtspr SPRN_SPRG5, r9
275 mfcr r11
276 mfspr r12, SPRN_PID
277 mtspr SPRN_SPRG7, r11
278 mtspr SPRN_SPRG6, r12
279#endif
280
281 /* First, check if it was a zone fault (which means a user
282 * tried to access a kernel or read-protected page - always
283 * a SEGV). All other faults here must be stores, so no
284 * need to check ESR_DST as well. */
285 mfspr r10, SPRN_ESR
286 andis. r10, r10, ESR_DIZ@h
287 bne 2f
288
289 mfspr r10, SPRN_DEAR /* Get faulting address */
290
291 /* If we are faulting a kernel address, we have to use the
292 * kernel page tables.
293 */
294 lis r11, TASK_SIZE@h
295 cmplw r10, r11
296 blt+ 3f
297 lis r11, swapper_pg_dir@h
298 ori r11, r11, swapper_pg_dir@l
299 li r9, 0
300 mtspr SPRN_PID, r9 /* TLB will have 0 TID */
301 b 4f
302
303 /* Get the PGD for the current thread.
304 */
3053:
306 mfspr r11,SPRN_SPRG3
307 lwz r11,PGDIR(r11)
3084:
309 tophys(r11, r11)
310 rlwimi r11, r10, 12, 20, 29 /* Create L1 (pgdir/pmd) address */
311 lwz r11, 0(r11) /* Get L1 entry */
312 rlwinm. r12, r11, 0, 0, 19 /* Extract L2 (pte) base address */
313 beq 2f /* Bail if no table */
314
315 rlwimi r12, r10, 22, 20, 29 /* Compute PTE address */
316 lwz r11, 0(r12) /* Get Linux PTE */
317
318 andi. r9, r11, _PAGE_RW /* Is it writeable? */
319 beq 2f /* Bail if not */
320
321 /* Update 'changed'.
322 */
323 ori r11, r11, _PAGE_DIRTY|_PAGE_ACCESSED|_PAGE_HWWRITE
324 stw r11, 0(r12) /* Update Linux page table */
325
326 /* Most of the Linux PTE is ready to load into the TLB LO.
327 * We set ZSEL, where only the LS-bit determines user access.
328 * We set execute, because we don't have the granularity to
329 * properly set this at the page level (Linux problem).
330 * If shared is set, we cause a zero PID->TID load.
331 * Many of these bits are software only. Bits we don't set
332 * here we (properly should) assume have the appropriate value.
333 */
334 li r12, 0x0ce2
335 andc r11, r11, r12 /* Make sure 20, 21 are zero */
336
337 /* find the TLB index that caused the fault. It has to be here.
338 */
339 tlbsx r9, 0, r10
340
341 tlbwe r11, r9, TLB_DATA /* Load TLB LO */
342
343 /* Done...restore registers and get out of here.
344 */
345#ifdef CONFIG_403GCX
346 lwz r12, 12(r0)
347 lwz r11, 8(r0)
348 mtspr SPRN_PID, r12
349 mtcr r11
350 lwz r9, 4(r0)
351 lwz r12, 0(r0)
352#else
353 mfspr r12, SPRN_SPRG6
354 mfspr r11, SPRN_SPRG7
355 mtspr SPRN_PID, r12
356 mtcr r11
357 mfspr r9, SPRN_SPRG5
358 mfspr r12, SPRN_SPRG4
359#endif
360 mfspr r11, SPRN_SPRG1
361 mfspr r10, SPRN_SPRG0
362 PPC405_ERR77_SYNC
363 rfi /* Should sync shadow TLBs */
364 b . /* prevent prefetch past rfi */
365
3662:
367 /* The bailout. Restore registers to pre-exception conditions
368 * and call the heavyweights to help us out.
369 */
370#ifdef CONFIG_403GCX
371 lwz r12, 12(r0)
372 lwz r11, 8(r0)
373 mtspr SPRN_PID, r12
374 mtcr r11
375 lwz r9, 4(r0)
376 lwz r12, 0(r0)
377#else
378 mfspr r12, SPRN_SPRG6
379 mfspr r11, SPRN_SPRG7
380 mtspr SPRN_PID, r12
381 mtcr r11
382 mfspr r9, SPRN_SPRG5
383 mfspr r12, SPRN_SPRG4
384#endif
385 mfspr r11, SPRN_SPRG1
386 mfspr r10, SPRN_SPRG0
387 b DataAccess
388
389/*
390 * 0x0400 - Instruction Storage Exception
391 * This is caused by a fetch from non-execute or guarded pages.
392 */
393 START_EXCEPTION(0x0400, InstructionAccess)
394 NORMAL_EXCEPTION_PROLOG
395 mr r4,r12 /* Pass SRR0 as arg2 */
396 li r5,0 /* Pass zero as arg3 */
397 EXC_XFER_EE_LITE(0x400, handle_page_fault)
398
399/* 0x0500 - External Interrupt Exception */
400 EXCEPTION(0x0500, HardwareInterrupt, do_IRQ, EXC_XFER_LITE)
401
402/* 0x0600 - Alignment Exception */
403 START_EXCEPTION(0x0600, Alignment)
404 NORMAL_EXCEPTION_PROLOG
405 mfspr r4,SPRN_DEAR /* Grab the DEAR and save it */
406 stw r4,_DEAR(r11)
407 addi r3,r1,STACK_FRAME_OVERHEAD
408 EXC_XFER_EE(0x600, alignment_exception)
409
410/* 0x0700 - Program Exception */
411 START_EXCEPTION(0x0700, ProgramCheck)
412 NORMAL_EXCEPTION_PROLOG
413 mfspr r4,SPRN_ESR /* Grab the ESR and save it */
414 stw r4,_ESR(r11)
415 addi r3,r1,STACK_FRAME_OVERHEAD
416 EXC_XFER_STD(0x700, program_check_exception)
417
418 EXCEPTION(0x0800, Trap_08, unknown_exception, EXC_XFER_EE)
419 EXCEPTION(0x0900, Trap_09, unknown_exception, EXC_XFER_EE)
420 EXCEPTION(0x0A00, Trap_0A, unknown_exception, EXC_XFER_EE)
421 EXCEPTION(0x0B00, Trap_0B, unknown_exception, EXC_XFER_EE)
422
423/* 0x0C00 - System Call Exception */
424 START_EXCEPTION(0x0C00, SystemCall)
425 NORMAL_EXCEPTION_PROLOG
426 EXC_XFER_EE_LITE(0xc00, DoSyscall)
427
428 EXCEPTION(0x0D00, Trap_0D, unknown_exception, EXC_XFER_EE)
429 EXCEPTION(0x0E00, Trap_0E, unknown_exception, EXC_XFER_EE)
430 EXCEPTION(0x0F00, Trap_0F, unknown_exception, EXC_XFER_EE)
431
432/* 0x1000 - Programmable Interval Timer (PIT) Exception */
433 START_EXCEPTION(0x1000, Decrementer)
434 NORMAL_EXCEPTION_PROLOG
435 lis r0,TSR_PIS@h
436 mtspr SPRN_TSR,r0 /* Clear the PIT exception */
437 addi r3,r1,STACK_FRAME_OVERHEAD
438 EXC_XFER_LITE(0x1000, timer_interrupt)
439
440#if 0
441/* NOTE:
442 * FIT and WDT handlers are not implemented yet.
443 */
444
445/* 0x1010 - Fixed Interval Timer (FIT) Exception
446*/
447 STND_EXCEPTION(0x1010, FITException, unknown_exception)
448
449/* 0x1020 - Watchdog Timer (WDT) Exception
450*/
451#ifdef CONFIG_BOOKE_WDT
452 CRITICAL_EXCEPTION(0x1020, WDTException, WatchdogException)
453#else
454 CRITICAL_EXCEPTION(0x1020, WDTException, unknown_exception)
455#endif
456#endif
457
458/* 0x1100 - Data TLB Miss Exception
459 * As the name implies, translation is not in the MMU, so search the
460 * page tables and fix it. The only purpose of this function is to
461 * load TLB entries from the page table if they exist.
462 */
463 START_EXCEPTION(0x1100, DTLBMiss)
464 mtspr SPRN_SPRG0, r10 /* Save some working registers */
465 mtspr SPRN_SPRG1, r11
466#ifdef CONFIG_403GCX
467 stw r12, 0(r0)
468 stw r9, 4(r0)
469 mfcr r11
470 mfspr r12, SPRN_PID
471 stw r11, 8(r0)
472 stw r12, 12(r0)
473#else
474 mtspr SPRN_SPRG4, r12
475 mtspr SPRN_SPRG5, r9
476 mfcr r11
477 mfspr r12, SPRN_PID
478 mtspr SPRN_SPRG7, r11
479 mtspr SPRN_SPRG6, r12
480#endif
481 mfspr r10, SPRN_DEAR /* Get faulting address */
482
483 /* If we are faulting a kernel address, we have to use the
484 * kernel page tables.
485 */
486 lis r11, TASK_SIZE@h
487 cmplw r10, r11
488 blt+ 3f
489 lis r11, swapper_pg_dir@h
490 ori r11, r11, swapper_pg_dir@l
491 li r9, 0
492 mtspr SPRN_PID, r9 /* TLB will have 0 TID */
493 b 4f
494
495 /* Get the PGD for the current thread.
496 */
4973:
498 mfspr r11,SPRN_SPRG3
499 lwz r11,PGDIR(r11)
5004:
501 tophys(r11, r11)
502 rlwimi r11, r10, 12, 20, 29 /* Create L1 (pgdir/pmd) address */
503 lwz r12, 0(r11) /* Get L1 entry */
504 andi. r9, r12, _PMD_PRESENT /* Check if it points to a PTE page */
505 beq 2f /* Bail if no table */
506
507 rlwimi r12, r10, 22, 20, 29 /* Compute PTE address */
508 lwz r11, 0(r12) /* Get Linux PTE */
509 andi. r9, r11, _PAGE_PRESENT
510 beq 5f
511
512 ori r11, r11, _PAGE_ACCESSED
513 stw r11, 0(r12)
514
515 /* Create TLB tag. This is the faulting address plus a static
516 * set of bits. These are size, valid, E, U0.
517 */
518 li r12, 0x00c0
519 rlwimi r10, r12, 0, 20, 31
520
521 b finish_tlb_load
522
5232: /* Check for possible large-page pmd entry */
524 rlwinm. r9, r12, 2, 22, 24
525 beq 5f
526
527 /* Create TLB tag. This is the faulting address, plus a static
528 * set of bits (valid, E, U0) plus the size from the PMD.
529 */
530 ori r9, r9, 0x40
531 rlwimi r10, r9, 0, 20, 31
532 mr r11, r12
533
534 b finish_tlb_load
535
5365:
537 /* The bailout. Restore registers to pre-exception conditions
538 * and call the heavyweights to help us out.
539 */
540#ifdef CONFIG_403GCX
541 lwz r12, 12(r0)
542 lwz r11, 8(r0)
543 mtspr SPRN_PID, r12
544 mtcr r11
545 lwz r9, 4(r0)
546 lwz r12, 0(r0)
547#else
548 mfspr r12, SPRN_SPRG6
549 mfspr r11, SPRN_SPRG7
550 mtspr SPRN_PID, r12
551 mtcr r11
552 mfspr r9, SPRN_SPRG5
553 mfspr r12, SPRN_SPRG4
554#endif
555 mfspr r11, SPRN_SPRG1
556 mfspr r10, SPRN_SPRG0
557 b DataAccess
558
559/* 0x1200 - Instruction TLB Miss Exception
560 * Nearly the same as above, except we get our information from different
561 * registers and bailout to a different point.
562 */
563 START_EXCEPTION(0x1200, ITLBMiss)
564 mtspr SPRN_SPRG0, r10 /* Save some working registers */
565 mtspr SPRN_SPRG1, r11
566#ifdef CONFIG_403GCX
567 stw r12, 0(r0)
568 stw r9, 4(r0)
569 mfcr r11
570 mfspr r12, SPRN_PID
571 stw r11, 8(r0)
572 stw r12, 12(r0)
573#else
574 mtspr SPRN_SPRG4, r12
575 mtspr SPRN_SPRG5, r9
576 mfcr r11
577 mfspr r12, SPRN_PID
578 mtspr SPRN_SPRG7, r11
579 mtspr SPRN_SPRG6, r12
580#endif
581 mfspr r10, SPRN_SRR0 /* Get faulting address */
582
583 /* If we are faulting a kernel address, we have to use the
584 * kernel page tables.
585 */
586 lis r11, TASK_SIZE@h
587 cmplw r10, r11
588 blt+ 3f
589 lis r11, swapper_pg_dir@h
590 ori r11, r11, swapper_pg_dir@l
591 li r9, 0
592 mtspr SPRN_PID, r9 /* TLB will have 0 TID */
593 b 4f
594
595 /* Get the PGD for the current thread.
596 */
5973:
598 mfspr r11,SPRN_SPRG3
599 lwz r11,PGDIR(r11)
6004:
601 tophys(r11, r11)
602 rlwimi r11, r10, 12, 20, 29 /* Create L1 (pgdir/pmd) address */
603 lwz r12, 0(r11) /* Get L1 entry */
604 andi. r9, r12, _PMD_PRESENT /* Check if it points to a PTE page */
605 beq 2f /* Bail if no table */
606
607 rlwimi r12, r10, 22, 20, 29 /* Compute PTE address */
608 lwz r11, 0(r12) /* Get Linux PTE */
609 andi. r9, r11, _PAGE_PRESENT
610 beq 5f
611
612 ori r11, r11, _PAGE_ACCESSED
613 stw r11, 0(r12)
614
615 /* Create TLB tag. This is the faulting address plus a static
616 * set of bits. These are size, valid, E, U0.
617 */
618 li r12, 0x00c0
619 rlwimi r10, r12, 0, 20, 31
620
621 b finish_tlb_load
622
6232: /* Check for possible large-page pmd entry */
624 rlwinm. r9, r12, 2, 22, 24
625 beq 5f
626
627 /* Create TLB tag. This is the faulting address, plus a static
628 * set of bits (valid, E, U0) plus the size from the PMD.
629 */
630 ori r9, r9, 0x40
631 rlwimi r10, r9, 0, 20, 31
632 mr r11, r12
633
634 b finish_tlb_load
635
6365:
637 /* The bailout. Restore registers to pre-exception conditions
638 * and call the heavyweights to help us out.
639 */
640#ifdef CONFIG_403GCX
641 lwz r12, 12(r0)
642 lwz r11, 8(r0)
643 mtspr SPRN_PID, r12
644 mtcr r11
645 lwz r9, 4(r0)
646 lwz r12, 0(r0)
647#else
648 mfspr r12, SPRN_SPRG6
649 mfspr r11, SPRN_SPRG7
650 mtspr SPRN_PID, r12
651 mtcr r11
652 mfspr r9, SPRN_SPRG5
653 mfspr r12, SPRN_SPRG4
654#endif
655 mfspr r11, SPRN_SPRG1
656 mfspr r10, SPRN_SPRG0
657 b InstructionAccess
658
659 EXCEPTION(0x1300, Trap_13, unknown_exception, EXC_XFER_EE)
660 EXCEPTION(0x1400, Trap_14, unknown_exception, EXC_XFER_EE)
661 EXCEPTION(0x1500, Trap_15, unknown_exception, EXC_XFER_EE)
662 EXCEPTION(0x1600, Trap_16, unknown_exception, EXC_XFER_EE)
663#ifdef CONFIG_IBM405_ERR51
664 /* 405GP errata 51 */
665 START_EXCEPTION(0x1700, Trap_17)
666 b DTLBMiss
667#else
668 EXCEPTION(0x1700, Trap_17, unknown_exception, EXC_XFER_EE)
669#endif
670 EXCEPTION(0x1800, Trap_18, unknown_exception, EXC_XFER_EE)
671 EXCEPTION(0x1900, Trap_19, unknown_exception, EXC_XFER_EE)
672 EXCEPTION(0x1A00, Trap_1A, unknown_exception, EXC_XFER_EE)
673 EXCEPTION(0x1B00, Trap_1B, unknown_exception, EXC_XFER_EE)
674 EXCEPTION(0x1C00, Trap_1C, unknown_exception, EXC_XFER_EE)
675 EXCEPTION(0x1D00, Trap_1D, unknown_exception, EXC_XFER_EE)
676 EXCEPTION(0x1E00, Trap_1E, unknown_exception, EXC_XFER_EE)
677 EXCEPTION(0x1F00, Trap_1F, unknown_exception, EXC_XFER_EE)
678
679/* Check for a single step debug exception while in an exception
680 * handler before state has been saved. This is to catch the case
681 * where an instruction that we are trying to single step causes
682 * an exception (eg ITLB/DTLB miss) and thus the first instruction of
683 * the exception handler generates a single step debug exception.
684 *
685 * If we get a debug trap on the first instruction of an exception handler,
686 * we reset the MSR_DE in the _exception handler's_ MSR (the debug trap is
687 * a critical exception, so we are using SPRN_CSRR1 to manipulate the MSR).
688 * The exception handler was handling a non-critical interrupt, so it will
689 * save (and later restore) the MSR via SPRN_SRR1, which will still have
690 * the MSR_DE bit set.
691 */
692 /* 0x2000 - Debug Exception */
693 START_EXCEPTION(0x2000, DebugTrap)
694 CRITICAL_EXCEPTION_PROLOG
695
696 /*
697 * If this is a single step or branch-taken exception in an
698 * exception entry sequence, it was probably meant to apply to
699 * the code where the exception occurred (since exception entry
700 * doesn't turn off DE automatically). We simulate the effect
701 * of turning off DE on entry to an exception handler by turning
702 * off DE in the SRR3 value and clearing the debug status.
703 */
704 mfspr r10,SPRN_DBSR /* check single-step/branch taken */
705 andis. r10,r10,DBSR_IC@h
706 beq+ 2f
707
708 andi. r10,r9,MSR_IR|MSR_PR /* check supervisor + MMU off */
709 beq 1f /* branch and fix it up */
710
711 mfspr r10,SPRN_SRR2 /* Faulting instruction address */
712 cmplwi r10,0x2100
713 bgt+ 2f /* address above exception vectors */
714
715 /* here it looks like we got an inappropriate debug exception. */
7161: rlwinm r9,r9,0,~MSR_DE /* clear DE in the SRR3 value */
717 lis r10,DBSR_IC@h /* clear the IC event */
718 mtspr SPRN_DBSR,r10
719 /* restore state and get out */
720 lwz r10,_CCR(r11)
721 lwz r0,GPR0(r11)
722 lwz r1,GPR1(r11)
723 mtcrf 0x80,r10
724 mtspr SPRN_SRR2,r12
725 mtspr SPRN_SRR3,r9
726 lwz r9,GPR9(r11)
727 lwz r12,GPR12(r11)
728 lwz r10,crit_r10@l(0)
729 lwz r11,crit_r11@l(0)
730 PPC405_ERR77_SYNC
731 rfci
732 b .
733
734 /* continue normal handling for a critical exception... */
7352: mfspr r4,SPRN_DBSR
736 addi r3,r1,STACK_FRAME_OVERHEAD
737 EXC_XFER_TEMPLATE(DebugException, 0x2002, \
738 (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \
739 NOCOPY, crit_transfer_to_handler, ret_from_crit_exc)
740
741/*
742 * The other Data TLB exceptions bail out to this point
743 * if they can't resolve the lightweight TLB fault.
744 */
745DataAccess:
746 NORMAL_EXCEPTION_PROLOG
747 mfspr r5,SPRN_ESR /* Grab the ESR, save it, pass arg3 */
748 stw r5,_ESR(r11)
749 mfspr r4,SPRN_DEAR /* Grab the DEAR, save it, pass arg2 */
750 EXC_XFER_EE_LITE(0x300, handle_page_fault)
751
752/* Other PowerPC processors, namely those derived from the 6xx-series
753 * have vectors from 0x2100 through 0x2F00 defined, but marked as reserved.
754 * However, for the 4xx-series processors these are neither defined nor
755 * reserved.
756 */
757
758 /* Damn, I came up one instruction too many to fit into the
759 * exception space :-). Both the instruction and data TLB
760 * miss get to this point to load the TLB.
761 * r10 - TLB_TAG value
762 * r11 - Linux PTE
763 * r12, r9 - avilable to use
764 * PID - loaded with proper value when we get here
765 * Upon exit, we reload everything and RFI.
766 * Actually, it will fit now, but oh well.....a common place
767 * to load the TLB.
768 */
769tlb_4xx_index:
770 .long 0
771finish_tlb_load:
772 /* load the next available TLB index.
773 */
774 lwz r9, tlb_4xx_index@l(0)
775 addi r9, r9, 1
776 andi. r9, r9, (PPC4XX_TLB_SIZE-1)
777 stw r9, tlb_4xx_index@l(0)
778
7796:
780 /*
781 * Clear out the software-only bits in the PTE to generate the
782 * TLB_DATA value. These are the bottom 2 bits of the RPM, the
783 * top 3 bits of the zone field, and M.
784 */
785 li r12, 0x0ce2
786 andc r11, r11, r12
787
788 tlbwe r11, r9, TLB_DATA /* Load TLB LO */
789 tlbwe r10, r9, TLB_TAG /* Load TLB HI */
790
791 /* Done...restore registers and get out of here.
792 */
793#ifdef CONFIG_403GCX
794 lwz r12, 12(r0)
795 lwz r11, 8(r0)
796 mtspr SPRN_PID, r12
797 mtcr r11
798 lwz r9, 4(r0)
799 lwz r12, 0(r0)
800#else
801 mfspr r12, SPRN_SPRG6
802 mfspr r11, SPRN_SPRG7
803 mtspr SPRN_PID, r12
804 mtcr r11
805 mfspr r9, SPRN_SPRG5
806 mfspr r12, SPRN_SPRG4
807#endif
808 mfspr r11, SPRN_SPRG1
809 mfspr r10, SPRN_SPRG0
810 PPC405_ERR77_SYNC
811 rfi /* Should sync shadow TLBs */
812 b . /* prevent prefetch past rfi */
813
814/* extern void giveup_fpu(struct task_struct *prev)
815 *
816 * The PowerPC 4xx family of processors do not have an FPU, so this just
817 * returns.
818 */
819_GLOBAL(giveup_fpu)
820 blr
821
822/* This is where the main kernel code starts.
823 */
824start_here:
825
826 /* ptr to current */
827 lis r2,init_task@h
828 ori r2,r2,init_task@l
829
830 /* ptr to phys current thread */
831 tophys(r4,r2)
832 addi r4,r4,THREAD /* init task's THREAD */
833 mtspr SPRN_SPRG3,r4
834
835 /* stack */
836 lis r1,init_thread_union@ha
837 addi r1,r1,init_thread_union@l
838 li r0,0
839 stwu r0,THREAD_SIZE-STACK_FRAME_OVERHEAD(r1)
840
841 bl early_init /* We have to do this with MMU on */
842
843/*
844 * Decide what sort of machine this is and initialize the MMU.
845 */
846 mr r3,r31
847 mr r4,r30
848 mr r5,r29
849 mr r6,r28
850 mr r7,r27
851 bl machine_init
852 bl MMU_init
853
854/* Go back to running unmapped so we can load up new values
855 * and change to using our exception vectors.
856 * On the 4xx, all we have to do is invalidate the TLB to clear
857 * the old 16M byte TLB mappings.
858 */
859 lis r4,2f@h
860 ori r4,r4,2f@l
861 tophys(r4,r4)
862 lis r3,(MSR_KERNEL & ~(MSR_IR|MSR_DR))@h
863 ori r3,r3,(MSR_KERNEL & ~(MSR_IR|MSR_DR))@l
864 mtspr SPRN_SRR0,r4
865 mtspr SPRN_SRR1,r3
866 rfi
867 b . /* prevent prefetch past rfi */
868
869/* Load up the kernel context */
8702:
871 sync /* Flush to memory before changing TLB */
872 tlbia
873 isync /* Flush shadow TLBs */
874
875 /* set up the PTE pointers for the Abatron bdiGDB.
876 */
877 lis r6, swapper_pg_dir@h
878 ori r6, r6, swapper_pg_dir@l
879 lis r5, abatron_pteptrs@h
880 ori r5, r5, abatron_pteptrs@l
881 stw r5, 0xf0(r0) /* Must match your Abatron config file */
882 tophys(r5,r5)
883 stw r6, 0(r5)
884
885/* Now turn on the MMU for real! */
886 lis r4,MSR_KERNEL@h
887 ori r4,r4,MSR_KERNEL@l
888 lis r3,start_kernel@h
889 ori r3,r3,start_kernel@l
890 mtspr SPRN_SRR0,r3
891 mtspr SPRN_SRR1,r4
892 rfi /* enable MMU and jump to start_kernel */
893 b . /* prevent prefetch past rfi */
894
895/* Set up the initial MMU state so we can do the first level of
896 * kernel initialization. This maps the first 16 MBytes of memory 1:1
897 * virtual to physical and more importantly sets the cache mode.
898 */
899initial_mmu:
900 tlbia /* Invalidate all TLB entries */
901 isync
902
903 /* We should still be executing code at physical address 0x0000xxxx
904 * at this point. However, start_here is at virtual address
905 * 0xC000xxxx. So, set up a TLB mapping to cover this once
906 * translation is enabled.
907 */
908
909 lis r3,KERNELBASE@h /* Load the kernel virtual address */
910 ori r3,r3,KERNELBASE@l
911 tophys(r4,r3) /* Load the kernel physical address */
912
913 iccci r0,r3 /* Invalidate the i-cache before use */
914
915 /* Load the kernel PID.
916 */
917 li r0,0
918 mtspr SPRN_PID,r0
919 sync
920
921 /* Configure and load two entries into TLB slots 62 and 63.
922 * In case we are pinning TLBs, these are reserved in by the
923 * other TLB functions. If not reserving, then it doesn't
924 * matter where they are loaded.
925 */
926 clrrwi r4,r4,10 /* Mask off the real page number */
927 ori r4,r4,(TLB_WR | TLB_EX) /* Set the write and execute bits */
928
929 clrrwi r3,r3,10 /* Mask off the effective page number */
930 ori r3,r3,(TLB_VALID | TLB_PAGESZ(PAGESZ_16M))
931
932 li r0,63 /* TLB slot 63 */
933
934 tlbwe r4,r0,TLB_DATA /* Load the data portion of the entry */
935 tlbwe r3,r0,TLB_TAG /* Load the tag portion of the entry */
936
937#if defined(CONFIG_SERIAL_TEXT_DEBUG) && defined(SERIAL_DEBUG_IO_BASE)
938
939 /* Load a TLB entry for the UART, so that ppc4xx_progress() can use
940 * the UARTs nice and early. We use a 4k real==virtual mapping. */
941
942 lis r3,SERIAL_DEBUG_IO_BASE@h
943 ori r3,r3,SERIAL_DEBUG_IO_BASE@l
944 mr r4,r3
945 clrrwi r4,r4,12
946 ori r4,r4,(TLB_WR|TLB_I|TLB_M|TLB_G)
947
948 clrrwi r3,r3,12
949 ori r3,r3,(TLB_VALID | TLB_PAGESZ(PAGESZ_4K))
950
951 li r0,0 /* TLB slot 0 */
952 tlbwe r4,r0,TLB_DATA
953 tlbwe r3,r0,TLB_TAG
954#endif /* CONFIG_SERIAL_DEBUG_TEXT && SERIAL_DEBUG_IO_BASE */
955
956 isync
957
958 /* Establish the exception vector base
959 */
960 lis r4,KERNELBASE@h /* EVPR only uses the high 16-bits */
961 tophys(r0,r4) /* Use the physical address */
962 mtspr SPRN_EVPR,r0
963
964 blr
965
966_GLOBAL(abort)
967 mfspr r13,SPRN_DBCR0
968 oris r13,r13,DBCR0_RST_SYSTEM@h
969 mtspr SPRN_DBCR0,r13
970
971_GLOBAL(set_context)
972
973#ifdef CONFIG_BDI_SWITCH
974 /* Context switch the PTE pointer for the Abatron BDI2000.
975 * The PGDIR is the second parameter.
976 */
977 lis r5, KERNELBASE@h
978 lwz r5, 0xf0(r5)
979 stw r4, 0x4(r5)
980#endif
981 sync
982 mtspr SPRN_PID,r3
983 isync /* Need an isync to flush shadow */
984 /* TLBs after changing PID */
985 blr
986
987/* We put a few things here that have to be page-aligned. This stuff
988 * goes at the beginning of the data segment, which is page-aligned.
989 */
990 .data
991 .align 12
992 .globl sdata
993sdata:
994 .globl empty_zero_page
995empty_zero_page:
996 .space 4096
997 .globl swapper_pg_dir
998swapper_pg_dir:
999 .space 4096
1000
1001
1002/* Stack for handling critical exceptions from kernel mode */
1003 .section .bss
1004 .align 12
1005exception_stack_bottom:
1006 .space 4096
1007critical_stack_top:
1008 .globl exception_stack_top
1009exception_stack_top:
1010
1011/* This space gets a copy of optional info passed to us by the bootstrap
1012 * which is used to pass parameters into the kernel like root=/dev/sda1, etc.
1013 */
1014 .globl cmd_line
1015cmd_line:
1016 .space 512
1017
1018/* Room for two PTE pointers, usually the kernel and current user pointers
1019 * to their respective root page table.
1020 */
1021abatron_pteptrs:
1022 .space 8
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
new file mode 100644
index 000000000000..147215a0d6c0
--- /dev/null
+++ b/arch/powerpc/kernel/head_64.S
@@ -0,0 +1,1957 @@
1/*
2 * arch/ppc64/kernel/head.S
3 *
4 * PowerPC version
5 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
6 *
7 * Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP
8 * Copyright (C) 1996 Cort Dougan <cort@cs.nmt.edu>
9 * Adapted for Power Macintosh by Paul Mackerras.
10 * Low-level exception handlers and MMU support
11 * rewritten by Paul Mackerras.
12 * Copyright (C) 1996 Paul Mackerras.
13 *
14 * Adapted for 64bit PowerPC by Dave Engebretsen, Peter Bergner, and
15 * Mike Corrigan {engebret|bergner|mikejc}@us.ibm.com
16 *
17 * This file contains the low-level support and setup for the
18 * PowerPC-64 platform, including trap and interrupt dispatch.
19 *
20 * This program is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU General Public License
22 * as published by the Free Software Foundation; either version
23 * 2 of the License, or (at your option) any later version.
24 */
25
26#include <linux/config.h>
27#include <linux/threads.h>
28#include <asm/reg.h>
29#include <asm/page.h>
30#include <asm/mmu.h>
31#include <asm/systemcfg.h>
32#include <asm/ppc_asm.h>
33#include <asm/asm-offsets.h>
34#include <asm/bug.h>
35#include <asm/cputable.h>
36#include <asm/setup.h>
37#include <asm/hvcall.h>
38#include <asm/iSeries/LparMap.h>
39#include <asm/thread_info.h>
40
41#ifdef CONFIG_PPC_ISERIES
42#define DO_SOFT_DISABLE
43#endif
44
45/*
46 * We layout physical memory as follows:
47 * 0x0000 - 0x00ff : Secondary processor spin code
48 * 0x0100 - 0x2fff : pSeries Interrupt prologs
49 * 0x3000 - 0x5fff : interrupt support, iSeries and common interrupt prologs
50 * 0x6000 - 0x6fff : Initial (CPU0) segment table
51 * 0x7000 - 0x7fff : FWNMI data area
52 * 0x8000 - : Early init and support code
53 */
54
55/*
56 * SPRG Usage
57 *
58 * Register Definition
59 *
60 * SPRG0 reserved for hypervisor
61 * SPRG1 temp - used to save gpr
62 * SPRG2 temp - used to save gpr
63 * SPRG3 virt addr of paca
64 */
65
66/*
67 * Entering into this code we make the following assumptions:
68 * For pSeries:
69 * 1. The MMU is off & open firmware is running in real mode.
70 * 2. The kernel is entered at __start
71 *
72 * For iSeries:
73 * 1. The MMU is on (as it always is for iSeries)
74 * 2. The kernel is entered at system_reset_iSeries
75 */
76
77 .text
78 .globl _stext
79_stext:
80#ifdef CONFIG_PPC_MULTIPLATFORM
81_GLOBAL(__start)
82 /* NOP this out unconditionally */
83BEGIN_FTR_SECTION
84 b .__start_initialization_multiplatform
85END_FTR_SECTION(0, 1)
86#endif /* CONFIG_PPC_MULTIPLATFORM */
87
88 /* Catch branch to 0 in real mode */
89 trap
90
91#ifdef CONFIG_PPC_ISERIES
92 /*
93 * At offset 0x20, there is a pointer to iSeries LPAR data.
94 * This is required by the hypervisor
95 */
96 . = 0x20
97 .llong hvReleaseData-KERNELBASE
98
99 /*
100 * At offset 0x28 and 0x30 are offsets to the mschunks_map
101 * array (used by the iSeries LPAR debugger to do translation
102 * between physical addresses and absolute addresses) and
103 * to the pidhash table (also used by the debugger)
104 */
105 .llong mschunks_map-KERNELBASE
106 .llong 0 /* pidhash-KERNELBASE SFRXXX */
107
108 /* Offset 0x38 - Pointer to start of embedded System.map */
109 .globl embedded_sysmap_start
110embedded_sysmap_start:
111 .llong 0
112 /* Offset 0x40 - Pointer to end of embedded System.map */
113 .globl embedded_sysmap_end
114embedded_sysmap_end:
115 .llong 0
116
117#endif /* CONFIG_PPC_ISERIES */
118
119 /* Secondary processors spin on this value until it goes to 1. */
120 .globl __secondary_hold_spinloop
121__secondary_hold_spinloop:
122 .llong 0x0
123
124 /* Secondary processors write this value with their cpu # */
125 /* after they enter the spin loop immediately below. */
126 .globl __secondary_hold_acknowledge
127__secondary_hold_acknowledge:
128 .llong 0x0
129
130 . = 0x60
131/*
132 * The following code is used on pSeries to hold secondary processors
133 * in a spin loop after they have been freed from OpenFirmware, but
134 * before the bulk of the kernel has been relocated. This code
135 * is relocated to physical address 0x60 before prom_init is run.
136 * All of it must fit below the first exception vector at 0x100.
137 */
138_GLOBAL(__secondary_hold)
139 mfmsr r24
140 ori r24,r24,MSR_RI
141 mtmsrd r24 /* RI on */
142
143 /* Grab our linux cpu number */
144 mr r24,r3
145
146 /* Tell the master cpu we're here */
147 /* Relocation is off & we are located at an address less */
148 /* than 0x100, so only need to grab low order offset. */
149 std r24,__secondary_hold_acknowledge@l(0)
150 sync
151
152 /* All secondary cpus wait here until told to start. */
153100: ld r4,__secondary_hold_spinloop@l(0)
154 cmpdi 0,r4,1
155 bne 100b
156
157#ifdef CONFIG_HMT
158 b .hmt_init
159#else
160#ifdef CONFIG_SMP
161 mr r3,r24
162 b .pSeries_secondary_smp_init
163#else
164 BUG_OPCODE
165#endif
166#endif
167
168/* This value is used to mark exception frames on the stack. */
169 .section ".toc","aw"
170exception_marker:
171 .tc ID_72656773_68657265[TC],0x7265677368657265
172 .text
173
174/*
175 * The following macros define the code that appears as
176 * the prologue to each of the exception handlers. They
177 * are split into two parts to allow a single kernel binary
178 * to be used for pSeries and iSeries.
179 * LOL. One day... - paulus
180 */
181
182/*
183 * We make as much of the exception code common between native
184 * exception handlers (including pSeries LPAR) and iSeries LPAR
185 * implementations as possible.
186 */
187
188/*
189 * This is the start of the interrupt handlers for pSeries
190 * This code runs with relocation off.
191 */
192#define EX_R9 0
193#define EX_R10 8
194#define EX_R11 16
195#define EX_R12 24
196#define EX_R13 32
197#define EX_SRR0 40
198#define EX_R3 40 /* SLB miss saves R3, but not SRR0 */
199#define EX_DAR 48
200#define EX_LR 48 /* SLB miss saves LR, but not DAR */
201#define EX_DSISR 56
202#define EX_CCR 60
203
204#define EXCEPTION_PROLOG_PSERIES(area, label) \
205 mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \
206 std r9,area+EX_R9(r13); /* save r9 - r12 */ \
207 std r10,area+EX_R10(r13); \
208 std r11,area+EX_R11(r13); \
209 std r12,area+EX_R12(r13); \
210 mfspr r9,SPRN_SPRG1; \
211 std r9,area+EX_R13(r13); \
212 mfcr r9; \
213 clrrdi r12,r13,32; /* get high part of &label */ \
214 mfmsr r10; \
215 mfspr r11,SPRN_SRR0; /* save SRR0 */ \
216 ori r12,r12,(label)@l; /* virt addr of handler */ \
217 ori r10,r10,MSR_IR|MSR_DR|MSR_RI; \
218 mtspr SPRN_SRR0,r12; \
219 mfspr r12,SPRN_SRR1; /* and SRR1 */ \
220 mtspr SPRN_SRR1,r10; \
221 rfid; \
222 b . /* prevent speculative execution */
223
224/*
225 * This is the start of the interrupt handlers for iSeries
226 * This code runs with relocation on.
227 */
228#define EXCEPTION_PROLOG_ISERIES_1(area) \
229 mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \
230 std r9,area+EX_R9(r13); /* save r9 - r12 */ \
231 std r10,area+EX_R10(r13); \
232 std r11,area+EX_R11(r13); \
233 std r12,area+EX_R12(r13); \
234 mfspr r9,SPRN_SPRG1; \
235 std r9,area+EX_R13(r13); \
236 mfcr r9
237
238#define EXCEPTION_PROLOG_ISERIES_2 \
239 mfmsr r10; \
240 ld r11,PACALPPACA+LPPACASRR0(r13); \
241 ld r12,PACALPPACA+LPPACASRR1(r13); \
242 ori r10,r10,MSR_RI; \
243 mtmsrd r10,1
244
245/*
246 * The common exception prolog is used for all except a few exceptions
247 * such as a segment miss on a kernel address. We have to be prepared
248 * to take another exception from the point where we first touch the
249 * kernel stack onwards.
250 *
251 * On entry r13 points to the paca, r9-r13 are saved in the paca,
252 * r9 contains the saved CR, r11 and r12 contain the saved SRR0 and
253 * SRR1, and relocation is on.
254 */
255#define EXCEPTION_PROLOG_COMMON(n, area) \
256 andi. r10,r12,MSR_PR; /* See if coming from user */ \
257 mr r10,r1; /* Save r1 */ \
258 subi r1,r1,INT_FRAME_SIZE; /* alloc frame on kernel stack */ \
259 beq- 1f; \
260 ld r1,PACAKSAVE(r13); /* kernel stack to use */ \
2611: cmpdi cr1,r1,0; /* check if r1 is in userspace */ \
262 bge- cr1,bad_stack; /* abort if it is */ \
263 std r9,_CCR(r1); /* save CR in stackframe */ \
264 std r11,_NIP(r1); /* save SRR0 in stackframe */ \
265 std r12,_MSR(r1); /* save SRR1 in stackframe */ \
266 std r10,0(r1); /* make stack chain pointer */ \
267 std r0,GPR0(r1); /* save r0 in stackframe */ \
268 std r10,GPR1(r1); /* save r1 in stackframe */ \
269 std r2,GPR2(r1); /* save r2 in stackframe */ \
270 SAVE_4GPRS(3, r1); /* save r3 - r6 in stackframe */ \
271 SAVE_2GPRS(7, r1); /* save r7, r8 in stackframe */ \
272 ld r9,area+EX_R9(r13); /* move r9, r10 to stackframe */ \
273 ld r10,area+EX_R10(r13); \
274 std r9,GPR9(r1); \
275 std r10,GPR10(r1); \
276 ld r9,area+EX_R11(r13); /* move r11 - r13 to stackframe */ \
277 ld r10,area+EX_R12(r13); \
278 ld r11,area+EX_R13(r13); \
279 std r9,GPR11(r1); \
280 std r10,GPR12(r1); \
281 std r11,GPR13(r1); \
282 ld r2,PACATOC(r13); /* get kernel TOC into r2 */ \
283 mflr r9; /* save LR in stackframe */ \
284 std r9,_LINK(r1); \
285 mfctr r10; /* save CTR in stackframe */ \
286 std r10,_CTR(r1); \
287 mfspr r11,SPRN_XER; /* save XER in stackframe */ \
288 std r11,_XER(r1); \
289 li r9,(n)+1; \
290 std r9,_TRAP(r1); /* set trap number */ \
291 li r10,0; \
292 ld r11,exception_marker@toc(r2); \
293 std r10,RESULT(r1); /* clear regs->result */ \
294 std r11,STACK_FRAME_OVERHEAD-16(r1); /* mark the frame */
295
296/*
297 * Exception vectors.
298 */
299#define STD_EXCEPTION_PSERIES(n, label) \
300 . = n; \
301 .globl label##_pSeries; \
302label##_pSeries: \
303 HMT_MEDIUM; \
304 mtspr SPRN_SPRG1,r13; /* save r13 */ \
305 RUNLATCH_ON(r13); \
306 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common)
307
308#define STD_EXCEPTION_ISERIES(n, label, area) \
309 .globl label##_iSeries; \
310label##_iSeries: \
311 HMT_MEDIUM; \
312 mtspr SPRN_SPRG1,r13; /* save r13 */ \
313 RUNLATCH_ON(r13); \
314 EXCEPTION_PROLOG_ISERIES_1(area); \
315 EXCEPTION_PROLOG_ISERIES_2; \
316 b label##_common
317
318#define MASKABLE_EXCEPTION_ISERIES(n, label) \
319 .globl label##_iSeries; \
320label##_iSeries: \
321 HMT_MEDIUM; \
322 mtspr SPRN_SPRG1,r13; /* save r13 */ \
323 RUNLATCH_ON(r13); \
324 EXCEPTION_PROLOG_ISERIES_1(PACA_EXGEN); \
325 lbz r10,PACAPROCENABLED(r13); \
326 cmpwi 0,r10,0; \
327 beq- label##_iSeries_masked; \
328 EXCEPTION_PROLOG_ISERIES_2; \
329 b label##_common; \
330
331#ifdef DO_SOFT_DISABLE
332#define DISABLE_INTS \
333 lbz r10,PACAPROCENABLED(r13); \
334 li r11,0; \
335 std r10,SOFTE(r1); \
336 mfmsr r10; \
337 stb r11,PACAPROCENABLED(r13); \
338 ori r10,r10,MSR_EE; \
339 mtmsrd r10,1
340
341#define ENABLE_INTS \
342 lbz r10,PACAPROCENABLED(r13); \
343 mfmsr r11; \
344 std r10,SOFTE(r1); \
345 ori r11,r11,MSR_EE; \
346 mtmsrd r11,1
347
348#else /* hard enable/disable interrupts */
349#define DISABLE_INTS
350
351#define ENABLE_INTS \
352 ld r12,_MSR(r1); \
353 mfmsr r11; \
354 rlwimi r11,r12,0,MSR_EE; \
355 mtmsrd r11,1
356
357#endif
358
359#define STD_EXCEPTION_COMMON(trap, label, hdlr) \
360 .align 7; \
361 .globl label##_common; \
362label##_common: \
363 EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN); \
364 DISABLE_INTS; \
365 bl .save_nvgprs; \
366 addi r3,r1,STACK_FRAME_OVERHEAD; \
367 bl hdlr; \
368 b .ret_from_except
369
370#define STD_EXCEPTION_COMMON_LITE(trap, label, hdlr) \
371 .align 7; \
372 .globl label##_common; \
373label##_common: \
374 EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN); \
375 DISABLE_INTS; \
376 addi r3,r1,STACK_FRAME_OVERHEAD; \
377 bl hdlr; \
378 b .ret_from_except_lite
379
380/*
381 * Start of pSeries system interrupt routines
382 */
383 . = 0x100
384 .globl __start_interrupts
385__start_interrupts:
386
387 STD_EXCEPTION_PSERIES(0x100, system_reset)
388
389 . = 0x200
390_machine_check_pSeries:
391 HMT_MEDIUM
392 mtspr SPRN_SPRG1,r13 /* save r13 */
393 RUNLATCH_ON(r13)
394 EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common)
395
396 . = 0x300
397 .globl data_access_pSeries
398data_access_pSeries:
399 HMT_MEDIUM
400 mtspr SPRN_SPRG1,r13
401BEGIN_FTR_SECTION
402 mtspr SPRN_SPRG2,r12
403 mfspr r13,SPRN_DAR
404 mfspr r12,SPRN_DSISR
405 srdi r13,r13,60
406 rlwimi r13,r12,16,0x20
407 mfcr r12
408 cmpwi r13,0x2c
409 beq .do_stab_bolted_pSeries
410 mtcrf 0x80,r12
411 mfspr r12,SPRN_SPRG2
412END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
413 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, data_access_common)
414
415 . = 0x380
416 .globl data_access_slb_pSeries
417data_access_slb_pSeries:
418 HMT_MEDIUM
419 mtspr SPRN_SPRG1,r13
420 RUNLATCH_ON(r13)
421 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */
422 std r9,PACA_EXSLB+EX_R9(r13) /* save r9 - r12 */
423 std r10,PACA_EXSLB+EX_R10(r13)
424 std r11,PACA_EXSLB+EX_R11(r13)
425 std r12,PACA_EXSLB+EX_R12(r13)
426 std r3,PACA_EXSLB+EX_R3(r13)
427 mfspr r9,SPRN_SPRG1
428 std r9,PACA_EXSLB+EX_R13(r13)
429 mfcr r9
430 mfspr r12,SPRN_SRR1 /* and SRR1 */
431 mfspr r3,SPRN_DAR
432 b .do_slb_miss /* Rel. branch works in real mode */
433
434 STD_EXCEPTION_PSERIES(0x400, instruction_access)
435
436 . = 0x480
437 .globl instruction_access_slb_pSeries
438instruction_access_slb_pSeries:
439 HMT_MEDIUM
440 mtspr SPRN_SPRG1,r13
441 RUNLATCH_ON(r13)
442 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */
443 std r9,PACA_EXSLB+EX_R9(r13) /* save r9 - r12 */
444 std r10,PACA_EXSLB+EX_R10(r13)
445 std r11,PACA_EXSLB+EX_R11(r13)
446 std r12,PACA_EXSLB+EX_R12(r13)
447 std r3,PACA_EXSLB+EX_R3(r13)
448 mfspr r9,SPRN_SPRG1
449 std r9,PACA_EXSLB+EX_R13(r13)
450 mfcr r9
451 mfspr r12,SPRN_SRR1 /* and SRR1 */
452 mfspr r3,SPRN_SRR0 /* SRR0 is faulting address */
453 b .do_slb_miss /* Rel. branch works in real mode */
454
455 STD_EXCEPTION_PSERIES(0x500, hardware_interrupt)
456 STD_EXCEPTION_PSERIES(0x600, alignment)
457 STD_EXCEPTION_PSERIES(0x700, program_check)
458 STD_EXCEPTION_PSERIES(0x800, fp_unavailable)
459 STD_EXCEPTION_PSERIES(0x900, decrementer)
460 STD_EXCEPTION_PSERIES(0xa00, trap_0a)
461 STD_EXCEPTION_PSERIES(0xb00, trap_0b)
462
463 . = 0xc00
464 .globl system_call_pSeries
465system_call_pSeries:
466 HMT_MEDIUM
467 RUNLATCH_ON(r9)
468 mr r9,r13
469 mfmsr r10
470 mfspr r13,SPRN_SPRG3
471 mfspr r11,SPRN_SRR0
472 clrrdi r12,r13,32
473 oris r12,r12,system_call_common@h
474 ori r12,r12,system_call_common@l
475 mtspr SPRN_SRR0,r12
476 ori r10,r10,MSR_IR|MSR_DR|MSR_RI
477 mfspr r12,SPRN_SRR1
478 mtspr SPRN_SRR1,r10
479 rfid
480 b . /* prevent speculative execution */
481
482 STD_EXCEPTION_PSERIES(0xd00, single_step)
483 STD_EXCEPTION_PSERIES(0xe00, trap_0e)
484
485 /* We need to deal with the Altivec unavailable exception
486 * here which is at 0xf20, thus in the middle of the
487 * prolog code of the PerformanceMonitor one. A little
488 * trickery is thus necessary
489 */
490 . = 0xf00
491 b performance_monitor_pSeries
492
493 STD_EXCEPTION_PSERIES(0xf20, altivec_unavailable)
494
495 STD_EXCEPTION_PSERIES(0x1300, instruction_breakpoint)
496 STD_EXCEPTION_PSERIES(0x1700, altivec_assist)
497
498 . = 0x3000
499
500/*** pSeries interrupt support ***/
501
502 /* moved from 0xf00 */
503 STD_EXCEPTION_PSERIES(., performance_monitor)
504
505 .align 7
506_GLOBAL(do_stab_bolted_pSeries)
507 mtcrf 0x80,r12
508 mfspr r12,SPRN_SPRG2
509 EXCEPTION_PROLOG_PSERIES(PACA_EXSLB, .do_stab_bolted)
510
511/*
512 * Vectors for the FWNMI option. Share common code.
513 */
514 .globl system_reset_fwnmi
515system_reset_fwnmi:
516 HMT_MEDIUM
517 mtspr SPRN_SPRG1,r13 /* save r13 */
518 RUNLATCH_ON(r13)
519 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common)
520
521 .globl machine_check_fwnmi
522machine_check_fwnmi:
523 HMT_MEDIUM
524 mtspr SPRN_SPRG1,r13 /* save r13 */
525 RUNLATCH_ON(r13)
526 EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common)
527
528#ifdef CONFIG_PPC_ISERIES
529/*** ISeries-LPAR interrupt handlers ***/
530
531 STD_EXCEPTION_ISERIES(0x200, machine_check, PACA_EXMC)
532
533 .globl data_access_iSeries
534data_access_iSeries:
535 mtspr SPRN_SPRG1,r13
536BEGIN_FTR_SECTION
537 mtspr SPRN_SPRG2,r12
538 mfspr r13,SPRN_DAR
539 mfspr r12,SPRN_DSISR
540 srdi r13,r13,60
541 rlwimi r13,r12,16,0x20
542 mfcr r12
543 cmpwi r13,0x2c
544 beq .do_stab_bolted_iSeries
545 mtcrf 0x80,r12
546 mfspr r12,SPRN_SPRG2
547END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
548 EXCEPTION_PROLOG_ISERIES_1(PACA_EXGEN)
549 EXCEPTION_PROLOG_ISERIES_2
550 b data_access_common
551
552.do_stab_bolted_iSeries:
553 mtcrf 0x80,r12
554 mfspr r12,SPRN_SPRG2
555 EXCEPTION_PROLOG_ISERIES_1(PACA_EXSLB)
556 EXCEPTION_PROLOG_ISERIES_2
557 b .do_stab_bolted
558
559 .globl data_access_slb_iSeries
560data_access_slb_iSeries:
561 mtspr SPRN_SPRG1,r13 /* save r13 */
562 EXCEPTION_PROLOG_ISERIES_1(PACA_EXSLB)
563 std r3,PACA_EXSLB+EX_R3(r13)
564 ld r12,PACALPPACA+LPPACASRR1(r13)
565 mfspr r3,SPRN_DAR
566 b .do_slb_miss
567
568 STD_EXCEPTION_ISERIES(0x400, instruction_access, PACA_EXGEN)
569
570 .globl instruction_access_slb_iSeries
571instruction_access_slb_iSeries:
572 mtspr SPRN_SPRG1,r13 /* save r13 */
573 EXCEPTION_PROLOG_ISERIES_1(PACA_EXSLB)
574 std r3,PACA_EXSLB+EX_R3(r13)
575 ld r12,PACALPPACA+LPPACASRR1(r13)
576 ld r3,PACALPPACA+LPPACASRR0(r13)
577 b .do_slb_miss
578
579 MASKABLE_EXCEPTION_ISERIES(0x500, hardware_interrupt)
580 STD_EXCEPTION_ISERIES(0x600, alignment, PACA_EXGEN)
581 STD_EXCEPTION_ISERIES(0x700, program_check, PACA_EXGEN)
582 STD_EXCEPTION_ISERIES(0x800, fp_unavailable, PACA_EXGEN)
583 MASKABLE_EXCEPTION_ISERIES(0x900, decrementer)
584 STD_EXCEPTION_ISERIES(0xa00, trap_0a, PACA_EXGEN)
585 STD_EXCEPTION_ISERIES(0xb00, trap_0b, PACA_EXGEN)
586
587 .globl system_call_iSeries
588system_call_iSeries:
589 mr r9,r13
590 mfspr r13,SPRN_SPRG3
591 EXCEPTION_PROLOG_ISERIES_2
592 b system_call_common
593
594 STD_EXCEPTION_ISERIES( 0xd00, single_step, PACA_EXGEN)
595 STD_EXCEPTION_ISERIES( 0xe00, trap_0e, PACA_EXGEN)
596 STD_EXCEPTION_ISERIES( 0xf00, performance_monitor, PACA_EXGEN)
597
598 .globl system_reset_iSeries
599system_reset_iSeries:
600 mfspr r13,SPRN_SPRG3 /* Get paca address */
601 mfmsr r24
602 ori r24,r24,MSR_RI
603 mtmsrd r24 /* RI on */
604 lhz r24,PACAPACAINDEX(r13) /* Get processor # */
605 cmpwi 0,r24,0 /* Are we processor 0? */
606 beq .__start_initialization_iSeries /* Start up the first processor */
607 mfspr r4,SPRN_CTRLF
608 li r5,CTRL_RUNLATCH /* Turn off the run light */
609 andc r4,r4,r5
610 mtspr SPRN_CTRLT,r4
611
6121:
613 HMT_LOW
614#ifdef CONFIG_SMP
615 lbz r23,PACAPROCSTART(r13) /* Test if this processor
616 * should start */
617 sync
618 LOADADDR(r3,current_set)
619 sldi r28,r24,3 /* get current_set[cpu#] */
620 ldx r3,r3,r28
621 addi r1,r3,THREAD_SIZE
622 subi r1,r1,STACK_FRAME_OVERHEAD
623
624 cmpwi 0,r23,0
625 beq iSeries_secondary_smp_loop /* Loop until told to go */
626 bne .__secondary_start /* Loop until told to go */
627iSeries_secondary_smp_loop:
628 /* Let the Hypervisor know we are alive */
629 /* 8002 is a call to HvCallCfg::getLps, a harmless Hypervisor function */
630 lis r3,0x8002
631 rldicr r3,r3,32,15 /* r0 = (r3 << 32) & 0xffff000000000000 */
632#else /* CONFIG_SMP */
633 /* Yield the processor. This is required for non-SMP kernels
634 which are running on multi-threaded machines. */
635 lis r3,0x8000
636 rldicr r3,r3,32,15 /* r3 = (r3 << 32) & 0xffff000000000000 */
637 addi r3,r3,18 /* r3 = 0x8000000000000012 which is "yield" */
638 li r4,0 /* "yield timed" */
639 li r5,-1 /* "yield forever" */
640#endif /* CONFIG_SMP */
641 li r0,-1 /* r0=-1 indicates a Hypervisor call */
642 sc /* Invoke the hypervisor via a system call */
643 mfspr r13,SPRN_SPRG3 /* Put r13 back ???? */
644 b 1b /* If SMP not configured, secondaries
645 * loop forever */
646
647 .globl decrementer_iSeries_masked
648decrementer_iSeries_masked:
649 li r11,1
650 stb r11,PACALPPACA+LPPACADECRINT(r13)
651 lwz r12,PACADEFAULTDECR(r13)
652 mtspr SPRN_DEC,r12
653 /* fall through */
654
655 .globl hardware_interrupt_iSeries_masked
656hardware_interrupt_iSeries_masked:
657 mtcrf 0x80,r9 /* Restore regs */
658 ld r11,PACALPPACA+LPPACASRR0(r13)
659 ld r12,PACALPPACA+LPPACASRR1(r13)
660 mtspr SPRN_SRR0,r11
661 mtspr SPRN_SRR1,r12
662 ld r9,PACA_EXGEN+EX_R9(r13)
663 ld r10,PACA_EXGEN+EX_R10(r13)
664 ld r11,PACA_EXGEN+EX_R11(r13)
665 ld r12,PACA_EXGEN+EX_R12(r13)
666 ld r13,PACA_EXGEN+EX_R13(r13)
667 rfid
668 b . /* prevent speculative execution */
669#endif /* CONFIG_PPC_ISERIES */
670
671/*** Common interrupt handlers ***/
672
673 STD_EXCEPTION_COMMON(0x100, system_reset, .system_reset_exception)
674
675 /*
676 * Machine check is different because we use a different
677 * save area: PACA_EXMC instead of PACA_EXGEN.
678 */
679 .align 7
680 .globl machine_check_common
681machine_check_common:
682 EXCEPTION_PROLOG_COMMON(0x200, PACA_EXMC)
683 DISABLE_INTS
684 bl .save_nvgprs
685 addi r3,r1,STACK_FRAME_OVERHEAD
686 bl .machine_check_exception
687 b .ret_from_except
688
689 STD_EXCEPTION_COMMON_LITE(0x900, decrementer, .timer_interrupt)
690 STD_EXCEPTION_COMMON(0xa00, trap_0a, .unknown_exception)
691 STD_EXCEPTION_COMMON(0xb00, trap_0b, .unknown_exception)
692 STD_EXCEPTION_COMMON(0xd00, single_step, .single_step_exception)
693 STD_EXCEPTION_COMMON(0xe00, trap_0e, .unknown_exception)
694 STD_EXCEPTION_COMMON(0xf00, performance_monitor, .performance_monitor_exception)
695 STD_EXCEPTION_COMMON(0x1300, instruction_breakpoint, .instruction_breakpoint_exception)
696#ifdef CONFIG_ALTIVEC
697 STD_EXCEPTION_COMMON(0x1700, altivec_assist, .altivec_assist_exception)
698#else
699 STD_EXCEPTION_COMMON(0x1700, altivec_assist, .unknown_exception)
700#endif
701
702/*
703 * Here we have detected that the kernel stack pointer is bad.
704 * R9 contains the saved CR, r13 points to the paca,
705 * r10 contains the (bad) kernel stack pointer,
706 * r11 and r12 contain the saved SRR0 and SRR1.
707 * We switch to using an emergency stack, save the registers there,
708 * and call kernel_bad_stack(), which panics.
709 */
710bad_stack:
711 ld r1,PACAEMERGSP(r13)
712 subi r1,r1,64+INT_FRAME_SIZE
713 std r9,_CCR(r1)
714 std r10,GPR1(r1)
715 std r11,_NIP(r1)
716 std r12,_MSR(r1)
717 mfspr r11,SPRN_DAR
718 mfspr r12,SPRN_DSISR
719 std r11,_DAR(r1)
720 std r12,_DSISR(r1)
721 mflr r10
722 mfctr r11
723 mfxer r12
724 std r10,_LINK(r1)
725 std r11,_CTR(r1)
726 std r12,_XER(r1)
727 SAVE_GPR(0,r1)
728 SAVE_GPR(2,r1)
729 SAVE_4GPRS(3,r1)
730 SAVE_2GPRS(7,r1)
731 SAVE_10GPRS(12,r1)
732 SAVE_10GPRS(22,r1)
733 addi r11,r1,INT_FRAME_SIZE
734 std r11,0(r1)
735 li r12,0
736 std r12,0(r11)
737 ld r2,PACATOC(r13)
7381: addi r3,r1,STACK_FRAME_OVERHEAD
739 bl .kernel_bad_stack
740 b 1b
741
742/*
743 * Return from an exception with minimal checks.
744 * The caller is assumed to have done EXCEPTION_PROLOG_COMMON.
745 * If interrupts have been enabled, or anything has been
746 * done that might have changed the scheduling status of
747 * any task or sent any task a signal, you should use
748 * ret_from_except or ret_from_except_lite instead of this.
749 */
750 .globl fast_exception_return
751fast_exception_return:
752 ld r12,_MSR(r1)
753 ld r11,_NIP(r1)
754 andi. r3,r12,MSR_RI /* check if RI is set */
755 beq- unrecov_fer
756 ld r3,_CCR(r1)
757 ld r4,_LINK(r1)
758 ld r5,_CTR(r1)
759 ld r6,_XER(r1)
760 mtcr r3
761 mtlr r4
762 mtctr r5
763 mtxer r6
764 REST_GPR(0, r1)
765 REST_8GPRS(2, r1)
766
767 mfmsr r10
768 clrrdi r10,r10,2 /* clear RI (LE is 0 already) */
769 mtmsrd r10,1
770
771 mtspr SPRN_SRR1,r12
772 mtspr SPRN_SRR0,r11
773 REST_4GPRS(10, r1)
774 ld r1,GPR1(r1)
775 rfid
776 b . /* prevent speculative execution */
777
778unrecov_fer:
779 bl .save_nvgprs
7801: addi r3,r1,STACK_FRAME_OVERHEAD
781 bl .unrecoverable_exception
782 b 1b
783
784/*
785 * Here r13 points to the paca, r9 contains the saved CR,
786 * SRR0 and SRR1 are saved in r11 and r12,
787 * r9 - r13 are saved in paca->exgen.
788 */
789 .align 7
790 .globl data_access_common
791data_access_common:
792 RUNLATCH_ON(r10) /* It wont fit in the 0x300 handler */
793 mfspr r10,SPRN_DAR
794 std r10,PACA_EXGEN+EX_DAR(r13)
795 mfspr r10,SPRN_DSISR
796 stw r10,PACA_EXGEN+EX_DSISR(r13)
797 EXCEPTION_PROLOG_COMMON(0x300, PACA_EXGEN)
798 ld r3,PACA_EXGEN+EX_DAR(r13)
799 lwz r4,PACA_EXGEN+EX_DSISR(r13)
800 li r5,0x300
801 b .do_hash_page /* Try to handle as hpte fault */
802
803 .align 7
804 .globl instruction_access_common
805instruction_access_common:
806 EXCEPTION_PROLOG_COMMON(0x400, PACA_EXGEN)
807 ld r3,_NIP(r1)
808 andis. r4,r12,0x5820
809 li r5,0x400
810 b .do_hash_page /* Try to handle as hpte fault */
811
812 .align 7
813 .globl hardware_interrupt_common
814 .globl hardware_interrupt_entry
815hardware_interrupt_common:
816 EXCEPTION_PROLOG_COMMON(0x500, PACA_EXGEN)
817hardware_interrupt_entry:
818 DISABLE_INTS
819 addi r3,r1,STACK_FRAME_OVERHEAD
820 bl .do_IRQ
821 b .ret_from_except_lite
822
823 .align 7
824 .globl alignment_common
825alignment_common:
826 mfspr r10,SPRN_DAR
827 std r10,PACA_EXGEN+EX_DAR(r13)
828 mfspr r10,SPRN_DSISR
829 stw r10,PACA_EXGEN+EX_DSISR(r13)
830 EXCEPTION_PROLOG_COMMON(0x600, PACA_EXGEN)
831 ld r3,PACA_EXGEN+EX_DAR(r13)
832 lwz r4,PACA_EXGEN+EX_DSISR(r13)
833 std r3,_DAR(r1)
834 std r4,_DSISR(r1)
835 bl .save_nvgprs
836 addi r3,r1,STACK_FRAME_OVERHEAD
837 ENABLE_INTS
838 bl .alignment_exception
839 b .ret_from_except
840
841 .align 7
842 .globl program_check_common
843program_check_common:
844 EXCEPTION_PROLOG_COMMON(0x700, PACA_EXGEN)
845 bl .save_nvgprs
846 addi r3,r1,STACK_FRAME_OVERHEAD
847 ENABLE_INTS
848 bl .program_check_exception
849 b .ret_from_except
850
851 .align 7
852 .globl fp_unavailable_common
853fp_unavailable_common:
854 EXCEPTION_PROLOG_COMMON(0x800, PACA_EXGEN)
855 bne .load_up_fpu /* if from user, just load it up */
856 bl .save_nvgprs
857 addi r3,r1,STACK_FRAME_OVERHEAD
858 ENABLE_INTS
859 bl .kernel_fp_unavailable_exception
860 BUG_OPCODE
861
862 .align 7
863 .globl altivec_unavailable_common
864altivec_unavailable_common:
865 EXCEPTION_PROLOG_COMMON(0xf20, PACA_EXGEN)
866#ifdef CONFIG_ALTIVEC
867BEGIN_FTR_SECTION
868 bne .load_up_altivec /* if from user, just load it up */
869END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
870#endif
871 bl .save_nvgprs
872 addi r3,r1,STACK_FRAME_OVERHEAD
873 ENABLE_INTS
874 bl .altivec_unavailable_exception
875 b .ret_from_except
876
877#ifdef CONFIG_ALTIVEC
878/*
879 * load_up_altivec(unused, unused, tsk)
880 * Disable VMX for the task which had it previously,
881 * and save its vector registers in its thread_struct.
882 * Enables the VMX for use in the kernel on return.
883 * On SMP we know the VMX is free, since we give it up every
884 * switch (ie, no lazy save of the vector registers).
885 * On entry: r13 == 'current' && last_task_used_altivec != 'current'
886 */
887_STATIC(load_up_altivec)
888 mfmsr r5 /* grab the current MSR */
889 oris r5,r5,MSR_VEC@h
890 mtmsrd r5 /* enable use of VMX now */
891 isync
892
893/*
894 * For SMP, we don't do lazy VMX switching because it just gets too
895 * horrendously complex, especially when a task switches from one CPU
896 * to another. Instead we call giveup_altvec in switch_to.
897 * VRSAVE isn't dealt with here, that is done in the normal context
898 * switch code. Note that we could rely on vrsave value to eventually
899 * avoid saving all of the VREGs here...
900 */
901#ifndef CONFIG_SMP
902 ld r3,last_task_used_altivec@got(r2)
903 ld r4,0(r3)
904 cmpdi 0,r4,0
905 beq 1f
906 /* Save VMX state to last_task_used_altivec's THREAD struct */
907 addi r4,r4,THREAD
908 SAVE_32VRS(0,r5,r4)
909 mfvscr vr0
910 li r10,THREAD_VSCR
911 stvx vr0,r10,r4
912 /* Disable VMX for last_task_used_altivec */
913 ld r5,PT_REGS(r4)
914 ld r4,_MSR-STACK_FRAME_OVERHEAD(r5)
915 lis r6,MSR_VEC@h
916 andc r4,r4,r6
917 std r4,_MSR-STACK_FRAME_OVERHEAD(r5)
9181:
919#endif /* CONFIG_SMP */
920 /* Hack: if we get an altivec unavailable trap with VRSAVE
921 * set to all zeros, we assume this is a broken application
922 * that fails to set it properly, and thus we switch it to
923 * all 1's
924 */
925 mfspr r4,SPRN_VRSAVE
926 cmpdi 0,r4,0
927 bne+ 1f
928 li r4,-1
929 mtspr SPRN_VRSAVE,r4
9301:
931 /* enable use of VMX after return */
932 ld r4,PACACURRENT(r13)
933 addi r5,r4,THREAD /* Get THREAD */
934 oris r12,r12,MSR_VEC@h
935 std r12,_MSR(r1)
936 li r4,1
937 li r10,THREAD_VSCR
938 stw r4,THREAD_USED_VR(r5)
939 lvx vr0,r10,r5
940 mtvscr vr0
941 REST_32VRS(0,r4,r5)
942#ifndef CONFIG_SMP
943 /* Update last_task_used_math to 'current' */
944 subi r4,r5,THREAD /* Back to 'current' */
945 std r4,0(r3)
946#endif /* CONFIG_SMP */
947 /* restore registers and return */
948 b fast_exception_return
949#endif /* CONFIG_ALTIVEC */
950
951/*
952 * Hash table stuff
953 */
954 .align 7
955_GLOBAL(do_hash_page)
956 std r3,_DAR(r1)
957 std r4,_DSISR(r1)
958
959 andis. r0,r4,0xa450 /* weird error? */
960 bne- .handle_page_fault /* if not, try to insert a HPTE */
961BEGIN_FTR_SECTION
962 andis. r0,r4,0x0020 /* Is it a segment table fault? */
963 bne- .do_ste_alloc /* If so handle it */
964END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
965
966 /*
967 * We need to set the _PAGE_USER bit if MSR_PR is set or if we are
968 * accessing a userspace segment (even from the kernel). We assume
969 * kernel addresses always have the high bit set.
970 */
971 rlwinm r4,r4,32-25+9,31-9,31-9 /* DSISR_STORE -> _PAGE_RW */
972 rotldi r0,r3,15 /* Move high bit into MSR_PR posn */
973 orc r0,r12,r0 /* MSR_PR | ~high_bit */
974 rlwimi r4,r0,32-13,30,30 /* becomes _PAGE_USER access bit */
975 ori r4,r4,1 /* add _PAGE_PRESENT */
976 rlwimi r4,r5,22+2,31-2,31-2 /* Set _PAGE_EXEC if trap is 0x400 */
977
978 /*
979 * On iSeries, we soft-disable interrupts here, then
980 * hard-enable interrupts so that the hash_page code can spin on
981 * the hash_table_lock without problems on a shared processor.
982 */
983 DISABLE_INTS
984
985 /*
986 * r3 contains the faulting address
987 * r4 contains the required access permissions
988 * r5 contains the trap number
989 *
990 * at return r3 = 0 for success
991 */
992 bl .hash_page /* build HPTE if possible */
993 cmpdi r3,0 /* see if hash_page succeeded */
994
995#ifdef DO_SOFT_DISABLE
996 /*
997 * If we had interrupts soft-enabled at the point where the
998 * DSI/ISI occurred, and an interrupt came in during hash_page,
999 * handle it now.
1000 * We jump to ret_from_except_lite rather than fast_exception_return
1001 * because ret_from_except_lite will check for and handle pending
1002 * interrupts if necessary.
1003 */
1004 beq .ret_from_except_lite
1005 /* For a hash failure, we don't bother re-enabling interrupts */
1006 ble- 12f
1007
1008 /*
1009 * hash_page couldn't handle it, set soft interrupt enable back
1010 * to what it was before the trap. Note that .local_irq_restore
1011 * handles any interrupts pending at this point.
1012 */
1013 ld r3,SOFTE(r1)
1014 bl .local_irq_restore
1015 b 11f
1016#else
1017 beq fast_exception_return /* Return from exception on success */
1018 ble- 12f /* Failure return from hash_page */
1019
1020 /* fall through */
1021#endif
1022
1023/* Here we have a page fault that hash_page can't handle. */
1024_GLOBAL(handle_page_fault)
1025 ENABLE_INTS
102611: ld r4,_DAR(r1)
1027 ld r5,_DSISR(r1)
1028 addi r3,r1,STACK_FRAME_OVERHEAD
1029 bl .do_page_fault
1030 cmpdi r3,0
1031 beq+ .ret_from_except_lite
1032 bl .save_nvgprs
1033 mr r5,r3
1034 addi r3,r1,STACK_FRAME_OVERHEAD
1035 lwz r4,_DAR(r1)
1036 bl .bad_page_fault
1037 b .ret_from_except
1038
1039/* We have a page fault that hash_page could handle but HV refused
1040 * the PTE insertion
1041 */
104212: bl .save_nvgprs
1043 addi r3,r1,STACK_FRAME_OVERHEAD
1044 lwz r4,_DAR(r1)
1045 bl .low_hash_fault
1046 b .ret_from_except
1047
1048 /* here we have a segment miss */
1049_GLOBAL(do_ste_alloc)
1050 bl .ste_allocate /* try to insert stab entry */
1051 cmpdi r3,0
1052 beq+ fast_exception_return
1053 b .handle_page_fault
1054
1055/*
1056 * r13 points to the PACA, r9 contains the saved CR,
1057 * r11 and r12 contain the saved SRR0 and SRR1.
1058 * r9 - r13 are saved in paca->exslb.
1059 * We assume we aren't going to take any exceptions during this procedure.
1060 * We assume (DAR >> 60) == 0xc.
1061 */
1062 .align 7
1063_GLOBAL(do_stab_bolted)
1064 stw r9,PACA_EXSLB+EX_CCR(r13) /* save CR in exc. frame */
1065 std r11,PACA_EXSLB+EX_SRR0(r13) /* save SRR0 in exc. frame */
1066
1067 /* Hash to the primary group */
1068 ld r10,PACASTABVIRT(r13)
1069 mfspr r11,SPRN_DAR
1070 srdi r11,r11,28
1071 rldimi r10,r11,7,52 /* r10 = first ste of the group */
1072
1073 /* Calculate VSID */
1074 /* This is a kernel address, so protovsid = ESID */
1075 ASM_VSID_SCRAMBLE(r11, r9)
1076 rldic r9,r11,12,16 /* r9 = vsid << 12 */
1077
1078 /* Search the primary group for a free entry */
10791: ld r11,0(r10) /* Test valid bit of the current ste */
1080 andi. r11,r11,0x80
1081 beq 2f
1082 addi r10,r10,16
1083 andi. r11,r10,0x70
1084 bne 1b
1085
1086 /* Stick for only searching the primary group for now. */
1087 /* At least for now, we use a very simple random castout scheme */
1088 /* Use the TB as a random number ; OR in 1 to avoid entry 0 */
1089 mftb r11
1090 rldic r11,r11,4,57 /* r11 = (r11 << 4) & 0x70 */
1091 ori r11,r11,0x10
1092
1093 /* r10 currently points to an ste one past the group of interest */
1094 /* make it point to the randomly selected entry */
1095 subi r10,r10,128
1096 or r10,r10,r11 /* r10 is the entry to invalidate */
1097
1098 isync /* mark the entry invalid */
1099 ld r11,0(r10)
1100 rldicl r11,r11,56,1 /* clear the valid bit */
1101 rotldi r11,r11,8
1102 std r11,0(r10)
1103 sync
1104
1105 clrrdi r11,r11,28 /* Get the esid part of the ste */
1106 slbie r11
1107
11082: std r9,8(r10) /* Store the vsid part of the ste */
1109 eieio
1110
1111 mfspr r11,SPRN_DAR /* Get the new esid */
1112 clrrdi r11,r11,28 /* Permits a full 32b of ESID */
1113 ori r11,r11,0x90 /* Turn on valid and kp */
1114 std r11,0(r10) /* Put new entry back into the stab */
1115
1116 sync
1117
1118 /* All done -- return from exception. */
1119 lwz r9,PACA_EXSLB+EX_CCR(r13) /* get saved CR */
1120 ld r11,PACA_EXSLB+EX_SRR0(r13) /* get saved SRR0 */
1121
1122 andi. r10,r12,MSR_RI
1123 beq- unrecov_slb
1124
1125 mtcrf 0x80,r9 /* restore CR */
1126
1127 mfmsr r10
1128 clrrdi r10,r10,2
1129 mtmsrd r10,1
1130
1131 mtspr SPRN_SRR0,r11
1132 mtspr SPRN_SRR1,r12
1133 ld r9,PACA_EXSLB+EX_R9(r13)
1134 ld r10,PACA_EXSLB+EX_R10(r13)
1135 ld r11,PACA_EXSLB+EX_R11(r13)
1136 ld r12,PACA_EXSLB+EX_R12(r13)
1137 ld r13,PACA_EXSLB+EX_R13(r13)
1138 rfid
1139 b . /* prevent speculative execution */
1140
1141/*
1142 * r13 points to the PACA, r9 contains the saved CR,
1143 * r11 and r12 contain the saved SRR0 and SRR1.
1144 * r3 has the faulting address
1145 * r9 - r13 are saved in paca->exslb.
1146 * r3 is saved in paca->slb_r3
1147 * We assume we aren't going to take any exceptions during this procedure.
1148 */
1149_GLOBAL(do_slb_miss)
1150 mflr r10
1151
1152 stw r9,PACA_EXSLB+EX_CCR(r13) /* save CR in exc. frame */
1153 std r10,PACA_EXSLB+EX_LR(r13) /* save LR */
1154
1155 bl .slb_allocate /* handle it */
1156
1157 /* All done -- return from exception. */
1158
1159 ld r10,PACA_EXSLB+EX_LR(r13)
1160 ld r3,PACA_EXSLB+EX_R3(r13)
1161 lwz r9,PACA_EXSLB+EX_CCR(r13) /* get saved CR */
1162#ifdef CONFIG_PPC_ISERIES
1163 ld r11,PACALPPACA+LPPACASRR0(r13) /* get SRR0 value */
1164#endif /* CONFIG_PPC_ISERIES */
1165
1166 mtlr r10
1167
1168 andi. r10,r12,MSR_RI /* check for unrecoverable exception */
1169 beq- unrecov_slb
1170
1171.machine push
1172.machine "power4"
1173 mtcrf 0x80,r9
1174 mtcrf 0x01,r9 /* slb_allocate uses cr0 and cr7 */
1175.machine pop
1176
1177#ifdef CONFIG_PPC_ISERIES
1178 mtspr SPRN_SRR0,r11
1179 mtspr SPRN_SRR1,r12
1180#endif /* CONFIG_PPC_ISERIES */
1181 ld r9,PACA_EXSLB+EX_R9(r13)
1182 ld r10,PACA_EXSLB+EX_R10(r13)
1183 ld r11,PACA_EXSLB+EX_R11(r13)
1184 ld r12,PACA_EXSLB+EX_R12(r13)
1185 ld r13,PACA_EXSLB+EX_R13(r13)
1186 rfid
1187 b . /* prevent speculative execution */
1188
1189unrecov_slb:
1190 EXCEPTION_PROLOG_COMMON(0x4100, PACA_EXSLB)
1191 DISABLE_INTS
1192 bl .save_nvgprs
11931: addi r3,r1,STACK_FRAME_OVERHEAD
1194 bl .unrecoverable_exception
1195 b 1b
1196
1197/*
1198 * Space for CPU0's segment table.
1199 *
1200 * On iSeries, the hypervisor must fill in at least one entry before
1201 * we get control (with relocate on). The address is give to the hv
1202 * as a page number (see xLparMap in lpardata.c), so this must be at a
1203 * fixed address (the linker can't compute (u64)&initial_stab >>
1204 * PAGE_SHIFT).
1205 */
1206 . = STAB0_PHYS_ADDR /* 0x6000 */
1207 .globl initial_stab
1208initial_stab:
1209 .space 4096
1210
1211/*
1212 * Data area reserved for FWNMI option.
1213 * This address (0x7000) is fixed by the RPA.
1214 */
1215 .= 0x7000
1216 .globl fwnmi_data_area
1217fwnmi_data_area:
1218
1219 /* iSeries does not use the FWNMI stuff, so it is safe to put
1220 * this here, even if we later allow kernels that will boot on
1221 * both pSeries and iSeries */
1222#ifdef CONFIG_PPC_ISERIES
1223 . = LPARMAP_PHYS
1224#include "lparmap.s"
1225/*
1226 * This ".text" is here for old compilers that generate a trailing
1227 * .note section when compiling .c files to .s
1228 */
1229 .text
1230#endif /* CONFIG_PPC_ISERIES */
1231
1232 . = 0x8000
1233
1234/*
1235 * On pSeries, secondary processors spin in the following code.
1236 * At entry, r3 = this processor's number (physical cpu id)
1237 */
1238_GLOBAL(pSeries_secondary_smp_init)
1239 mr r24,r3
1240
1241 /* turn on 64-bit mode */
1242 bl .enable_64b_mode
1243 isync
1244
1245 /* Copy some CPU settings from CPU 0 */
1246 bl .__restore_cpu_setup
1247
1248 /* Set up a paca value for this processor. Since we have the
1249 * physical cpu id in r24, we need to search the pacas to find
1250 * which logical id maps to our physical one.
1251 */
1252 LOADADDR(r13, paca) /* Get base vaddr of paca array */
1253 li r5,0 /* logical cpu id */
12541: lhz r6,PACAHWCPUID(r13) /* Load HW procid from paca */
1255 cmpw r6,r24 /* Compare to our id */
1256 beq 2f
1257 addi r13,r13,PACA_SIZE /* Loop to next PACA on miss */
1258 addi r5,r5,1
1259 cmpwi r5,NR_CPUS
1260 blt 1b
1261
1262 mr r3,r24 /* not found, copy phys to r3 */
1263 b .kexec_wait /* next kernel might do better */
1264
12652: mtspr SPRN_SPRG3,r13 /* Save vaddr of paca in SPRG3 */
1266 /* From now on, r24 is expected to be logical cpuid */
1267 mr r24,r5
12683: HMT_LOW
1269 lbz r23,PACAPROCSTART(r13) /* Test if this processor should */
1270 /* start. */
1271 sync
1272
1273 /* Create a temp kernel stack for use before relocation is on. */
1274 ld r1,PACAEMERGSP(r13)
1275 subi r1,r1,STACK_FRAME_OVERHEAD
1276
1277 cmpwi 0,r23,0
1278#ifdef CONFIG_SMP
1279 bne .__secondary_start
1280#endif
1281 b 3b /* Loop until told to go */
1282
1283#ifdef CONFIG_PPC_ISERIES
1284_STATIC(__start_initialization_iSeries)
1285 /* Clear out the BSS */
1286 LOADADDR(r11,__bss_stop)
1287 LOADADDR(r8,__bss_start)
1288 sub r11,r11,r8 /* bss size */
1289 addi r11,r11,7 /* round up to an even double word */
1290 rldicl. r11,r11,61,3 /* shift right by 3 */
1291 beq 4f
1292 addi r8,r8,-8
1293 li r0,0
1294 mtctr r11 /* zero this many doublewords */
12953: stdu r0,8(r8)
1296 bdnz 3b
12974:
1298 LOADADDR(r1,init_thread_union)
1299 addi r1,r1,THREAD_SIZE
1300 li r0,0
1301 stdu r0,-STACK_FRAME_OVERHEAD(r1)
1302
1303 LOADADDR(r3,cpu_specs)
1304 LOADADDR(r4,cur_cpu_spec)
1305 li r5,0
1306 bl .identify_cpu
1307
1308 LOADADDR(r2,__toc_start)
1309 addi r2,r2,0x4000
1310 addi r2,r2,0x4000
1311
1312 bl .iSeries_early_setup
1313 bl .early_setup
1314
1315 /* relocation is on at this point */
1316
1317 b .start_here_common
1318#endif /* CONFIG_PPC_ISERIES */
1319
1320#ifdef CONFIG_PPC_MULTIPLATFORM
1321
1322_STATIC(__mmu_off)
1323 mfmsr r3
1324 andi. r0,r3,MSR_IR|MSR_DR
1325 beqlr
1326 andc r3,r3,r0
1327 mtspr SPRN_SRR0,r4
1328 mtspr SPRN_SRR1,r3
1329 sync
1330 rfid
1331 b . /* prevent speculative execution */
1332
1333
1334/*
1335 * Here is our main kernel entry point. We support currently 2 kind of entries
1336 * depending on the value of r5.
1337 *
1338 * r5 != NULL -> OF entry, we go to prom_init, "legacy" parameter content
1339 * in r3...r7
1340 *
1341 * r5 == NULL -> kexec style entry. r3 is a physical pointer to the
1342 * DT block, r4 is a physical pointer to the kernel itself
1343 *
1344 */
1345_GLOBAL(__start_initialization_multiplatform)
1346 /*
1347 * Are we booted from a PROM Of-type client-interface ?
1348 */
1349 cmpldi cr0,r5,0
1350 bne .__boot_from_prom /* yes -> prom */
1351
1352 /* Save parameters */
1353 mr r31,r3
1354 mr r30,r4
1355
1356 /* Make sure we are running in 64 bits mode */
1357 bl .enable_64b_mode
1358
1359 /* Setup some critical 970 SPRs before switching MMU off */
1360 bl .__970_cpu_preinit
1361
1362 /* cpu # */
1363 li r24,0
1364
1365 /* Switch off MMU if not already */
1366 LOADADDR(r4, .__after_prom_start - KERNELBASE)
1367 add r4,r4,r30
1368 bl .__mmu_off
1369 b .__after_prom_start
1370
1371_STATIC(__boot_from_prom)
1372 /* Save parameters */
1373 mr r31,r3
1374 mr r30,r4
1375 mr r29,r5
1376 mr r28,r6
1377 mr r27,r7
1378
1379 /* Make sure we are running in 64 bits mode */
1380 bl .enable_64b_mode
1381
1382 /* put a relocation offset into r3 */
1383 bl .reloc_offset
1384
1385 LOADADDR(r2,__toc_start)
1386 addi r2,r2,0x4000
1387 addi r2,r2,0x4000
1388
1389 /* Relocate the TOC from a virt addr to a real addr */
1390 add r2,r2,r3
1391
1392 /* Restore parameters */
1393 mr r3,r31
1394 mr r4,r30
1395 mr r5,r29
1396 mr r6,r28
1397 mr r7,r27
1398
1399 /* Do all of the interaction with OF client interface */
1400 bl .prom_init
1401 /* We never return */
1402 trap
1403
1404/*
1405 * At this point, r3 contains the physical address we are running at,
1406 * returned by prom_init()
1407 */
1408_STATIC(__after_prom_start)
1409
1410/*
1411 * We need to run with __start at physical address 0.
1412 * This will leave some code in the first 256B of
1413 * real memory, which are reserved for software use.
1414 * The remainder of the first page is loaded with the fixed
1415 * interrupt vectors. The next two pages are filled with
1416 * unknown exception placeholders.
1417 *
1418 * Note: This process overwrites the OF exception vectors.
1419 * r26 == relocation offset
1420 * r27 == KERNELBASE
1421 */
1422 bl .reloc_offset
1423 mr r26,r3
1424 SET_REG_TO_CONST(r27,KERNELBASE)
1425
1426 li r3,0 /* target addr */
1427
1428 // XXX FIXME: Use phys returned by OF (r30)
1429 add r4,r27,r26 /* source addr */
1430 /* current address of _start */
1431 /* i.e. where we are running */
1432 /* the source addr */
1433
1434 LOADADDR(r5,copy_to_here) /* # bytes of memory to copy */
1435 sub r5,r5,r27
1436
1437 li r6,0x100 /* Start offset, the first 0x100 */
1438 /* bytes were copied earlier. */
1439
1440 bl .copy_and_flush /* copy the first n bytes */
1441 /* this includes the code being */
1442 /* executed here. */
1443
1444 LOADADDR(r0, 4f) /* Jump to the copy of this code */
1445 mtctr r0 /* that we just made/relocated */
1446 bctr
1447
14484: LOADADDR(r5,klimit)
1449 add r5,r5,r26
1450 ld r5,0(r5) /* get the value of klimit */
1451 sub r5,r5,r27
1452 bl .copy_and_flush /* copy the rest */
1453 b .start_here_multiplatform
1454
1455#endif /* CONFIG_PPC_MULTIPLATFORM */
1456
1457/*
1458 * Copy routine used to copy the kernel to start at physical address 0
1459 * and flush and invalidate the caches as needed.
1460 * r3 = dest addr, r4 = source addr, r5 = copy limit, r6 = start offset
1461 * on exit, r3, r4, r5 are unchanged, r6 is updated to be >= r5.
1462 *
1463 * Note: this routine *only* clobbers r0, r6 and lr
1464 */
1465_GLOBAL(copy_and_flush)
1466 addi r5,r5,-8
1467 addi r6,r6,-8
14684: li r0,16 /* Use the least common */
1469 /* denominator cache line */
1470 /* size. This results in */
1471 /* extra cache line flushes */
1472 /* but operation is correct. */
1473 /* Can't get cache line size */
1474 /* from NACA as it is being */
1475 /* moved too. */
1476
1477 mtctr r0 /* put # words/line in ctr */
14783: addi r6,r6,8 /* copy a cache line */
1479 ldx r0,r6,r4
1480 stdx r0,r6,r3
1481 bdnz 3b
1482 dcbst r6,r3 /* write it to memory */
1483 sync
1484 icbi r6,r3 /* flush the icache line */
1485 cmpld 0,r6,r5
1486 blt 4b
1487 sync
1488 addi r5,r5,8
1489 addi r6,r6,8
1490 blr
1491
1492.align 8
1493copy_to_here:
1494
1495#ifdef CONFIG_SMP
1496#ifdef CONFIG_PPC_PMAC
1497/*
1498 * On PowerMac, secondary processors starts from the reset vector, which
1499 * is temporarily turned into a call to one of the functions below.
1500 */
1501 .section ".text";
1502 .align 2 ;
1503
1504 .globl __secondary_start_pmac_0
1505__secondary_start_pmac_0:
1506 /* NB the entries for cpus 0, 1, 2 must each occupy 8 bytes. */
1507 li r24,0
1508 b 1f
1509 li r24,1
1510 b 1f
1511 li r24,2
1512 b 1f
1513 li r24,3
15141:
1515
1516_GLOBAL(pmac_secondary_start)
1517 /* turn on 64-bit mode */
1518 bl .enable_64b_mode
1519 isync
1520
1521 /* Copy some CPU settings from CPU 0 */
1522 bl .__restore_cpu_setup
1523
1524 /* pSeries do that early though I don't think we really need it */
1525 mfmsr r3
1526 ori r3,r3,MSR_RI
1527 mtmsrd r3 /* RI on */
1528
1529 /* Set up a paca value for this processor. */
1530 LOADADDR(r4, paca) /* Get base vaddr of paca array */
1531 mulli r13,r24,PACA_SIZE /* Calculate vaddr of right paca */
1532 add r13,r13,r4 /* for this processor. */
1533 mtspr SPRN_SPRG3,r13 /* Save vaddr of paca in SPRG3 */
1534
1535 /* Create a temp kernel stack for use before relocation is on. */
1536 ld r1,PACAEMERGSP(r13)
1537 subi r1,r1,STACK_FRAME_OVERHEAD
1538
1539 b .__secondary_start
1540
1541#endif /* CONFIG_PPC_PMAC */
1542
1543/*
1544 * This function is called after the master CPU has released the
1545 * secondary processors. The execution environment is relocation off.
1546 * The paca for this processor has the following fields initialized at
1547 * this point:
1548 * 1. Processor number
1549 * 2. Segment table pointer (virtual address)
1550 * On entry the following are set:
1551 * r1 = stack pointer. vaddr for iSeries, raddr (temp stack) for pSeries
1552 * r24 = cpu# (in Linux terms)
1553 * r13 = paca virtual address
1554 * SPRG3 = paca virtual address
1555 */
1556_GLOBAL(__secondary_start)
1557
1558 HMT_MEDIUM /* Set thread priority to MEDIUM */
1559
1560 ld r2,PACATOC(r13)
1561 li r6,0
1562 stb r6,PACAPROCENABLED(r13)
1563
1564#ifndef CONFIG_PPC_ISERIES
1565 /* Initialize the page table pointer register. */
1566 LOADADDR(r6,_SDR1)
1567 ld r6,0(r6) /* get the value of _SDR1 */
1568 mtspr SPRN_SDR1,r6 /* set the htab location */
1569#endif
1570 /* Initialize the first segment table (or SLB) entry */
1571 ld r3,PACASTABVIRT(r13) /* get addr of segment table */
1572 bl .stab_initialize
1573
1574 /* Initialize the kernel stack. Just a repeat for iSeries. */
1575 LOADADDR(r3,current_set)
1576 sldi r28,r24,3 /* get current_set[cpu#] */
1577 ldx r1,r3,r28
1578 addi r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD
1579 std r1,PACAKSAVE(r13)
1580
1581 ld r3,PACASTABREAL(r13) /* get raddr of segment table */
1582 ori r4,r3,1 /* turn on valid bit */
1583
1584#ifdef CONFIG_PPC_ISERIES
1585 li r0,-1 /* hypervisor call */
1586 li r3,1
1587 sldi r3,r3,63 /* 0x8000000000000000 */
1588 ori r3,r3,4 /* 0x8000000000000004 */
1589 sc /* HvCall_setASR */
1590#else
1591 /* set the ASR */
1592 ld r3,systemcfg@got(r2) /* r3 = ptr to systemcfg */
1593 ld r3,0(r3)
1594 lwz r3,PLATFORM(r3) /* r3 = platform flags */
1595 andi. r3,r3,PLATFORM_LPAR /* Test if bit 0 is set (LPAR bit) */
1596 beq 98f /* branch if result is 0 */
1597 mfspr r3,SPRN_PVR
1598 srwi r3,r3,16
1599 cmpwi r3,0x37 /* SStar */
1600 beq 97f
1601 cmpwi r3,0x36 /* IStar */
1602 beq 97f
1603 cmpwi r3,0x34 /* Pulsar */
1604 bne 98f
160597: li r3,H_SET_ASR /* hcall = H_SET_ASR */
1606 HVSC /* Invoking hcall */
1607 b 99f
160898: /* !(rpa hypervisor) || !(star) */
1609 mtasr r4 /* set the stab location */
161099:
1611#endif
1612 li r7,0
1613 mtlr r7
1614
1615 /* enable MMU and jump to start_secondary */
1616 LOADADDR(r3,.start_secondary_prolog)
1617 SET_REG_TO_CONST(r4, MSR_KERNEL)
1618#ifdef DO_SOFT_DISABLE
1619 ori r4,r4,MSR_EE
1620#endif
1621 mtspr SPRN_SRR0,r3
1622 mtspr SPRN_SRR1,r4
1623 rfid
1624 b . /* prevent speculative execution */
1625
1626/*
1627 * Running with relocation on at this point. All we want to do is
1628 * zero the stack back-chain pointer before going into C code.
1629 */
1630_GLOBAL(start_secondary_prolog)
1631 li r3,0
1632 std r3,0(r1) /* Zero the stack frame pointer */
1633 bl .start_secondary
1634#endif
1635
1636/*
1637 * This subroutine clobbers r11 and r12
1638 */
1639_GLOBAL(enable_64b_mode)
1640 mfmsr r11 /* grab the current MSR */
1641 li r12,1
1642 rldicr r12,r12,MSR_SF_LG,(63-MSR_SF_LG)
1643 or r11,r11,r12
1644 li r12,1
1645 rldicr r12,r12,MSR_ISF_LG,(63-MSR_ISF_LG)
1646 or r11,r11,r12
1647 mtmsrd r11
1648 isync
1649 blr
1650
1651#ifdef CONFIG_PPC_MULTIPLATFORM
1652/*
1653 * This is where the main kernel code starts.
1654 */
1655_STATIC(start_here_multiplatform)
1656 /* get a new offset, now that the kernel has moved. */
1657 bl .reloc_offset
1658 mr r26,r3
1659
1660 /* Clear out the BSS. It may have been done in prom_init,
1661 * already but that's irrelevant since prom_init will soon
1662 * be detached from the kernel completely. Besides, we need
1663 * to clear it now for kexec-style entry.
1664 */
1665 LOADADDR(r11,__bss_stop)
1666 LOADADDR(r8,__bss_start)
1667 sub r11,r11,r8 /* bss size */
1668 addi r11,r11,7 /* round up to an even double word */
1669 rldicl. r11,r11,61,3 /* shift right by 3 */
1670 beq 4f
1671 addi r8,r8,-8
1672 li r0,0
1673 mtctr r11 /* zero this many doublewords */
16743: stdu r0,8(r8)
1675 bdnz 3b
16764:
1677
1678 mfmsr r6
1679 ori r6,r6,MSR_RI
1680 mtmsrd r6 /* RI on */
1681
1682#ifdef CONFIG_HMT
1683 /* Start up the second thread on cpu 0 */
1684 mfspr r3,SPRN_PVR
1685 srwi r3,r3,16
1686 cmpwi r3,0x34 /* Pulsar */
1687 beq 90f
1688 cmpwi r3,0x36 /* Icestar */
1689 beq 90f
1690 cmpwi r3,0x37 /* SStar */
1691 beq 90f
1692 b 91f /* HMT not supported */
169390: li r3,0
1694 bl .hmt_start_secondary
169591:
1696#endif
1697
1698 /* The following gets the stack and TOC set up with the regs */
1699 /* pointing to the real addr of the kernel stack. This is */
1700 /* all done to support the C function call below which sets */
1701 /* up the htab. This is done because we have relocated the */
1702 /* kernel but are still running in real mode. */
1703
1704 LOADADDR(r3,init_thread_union)
1705 add r3,r3,r26
1706
1707 /* set up a stack pointer (physical address) */
1708 addi r1,r3,THREAD_SIZE
1709 li r0,0
1710 stdu r0,-STACK_FRAME_OVERHEAD(r1)
1711
1712 /* set up the TOC (physical address) */
1713 LOADADDR(r2,__toc_start)
1714 addi r2,r2,0x4000
1715 addi r2,r2,0x4000
1716 add r2,r2,r26
1717
1718 LOADADDR(r3,cpu_specs)
1719 add r3,r3,r26
1720 LOADADDR(r4,cur_cpu_spec)
1721 add r4,r4,r26
1722 mr r5,r26
1723 bl .identify_cpu
1724
1725 /* Save some low level config HIDs of CPU0 to be copied to
1726 * other CPUs later on, or used for suspend/resume
1727 */
1728 bl .__save_cpu_setup
1729 sync
1730
1731 /* Setup a valid physical PACA pointer in SPRG3 for early_setup
1732 * note that boot_cpuid can always be 0 nowadays since there is
1733 * nowhere it can be initialized differently before we reach this
1734 * code
1735 */
1736 LOADADDR(r27, boot_cpuid)
1737 add r27,r27,r26
1738 lwz r27,0(r27)
1739
1740 LOADADDR(r24, paca) /* Get base vaddr of paca array */
1741 mulli r13,r27,PACA_SIZE /* Calculate vaddr of right paca */
1742 add r13,r13,r24 /* for this processor. */
1743 add r13,r13,r26 /* convert to physical addr */
1744 mtspr SPRN_SPRG3,r13 /* PPPBBB: Temp... -Peter */
1745
1746 /* Do very early kernel initializations, including initial hash table,
1747 * stab and slb setup before we turn on relocation. */
1748
1749 /* Restore parameters passed from prom_init/kexec */
1750 mr r3,r31
1751 bl .early_setup
1752
1753 /* set the ASR */
1754 ld r3,PACASTABREAL(r13)
1755 ori r4,r3,1 /* turn on valid bit */
1756 ld r3,systemcfg@got(r2) /* r3 = ptr to systemcfg */
1757 ld r3,0(r3)
1758 lwz r3,PLATFORM(r3) /* r3 = platform flags */
1759 andi. r3,r3,PLATFORM_LPAR /* Test if bit 0 is set (LPAR bit) */
1760 beq 98f /* branch if result is 0 */
1761 mfspr r3,SPRN_PVR
1762 srwi r3,r3,16
1763 cmpwi r3,0x37 /* SStar */
1764 beq 97f
1765 cmpwi r3,0x36 /* IStar */
1766 beq 97f
1767 cmpwi r3,0x34 /* Pulsar */
1768 bne 98f
176997: li r3,H_SET_ASR /* hcall = H_SET_ASR */
1770 HVSC /* Invoking hcall */
1771 b 99f
177298: /* !(rpa hypervisor) || !(star) */
1773 mtasr r4 /* set the stab location */
177499:
1775 /* Set SDR1 (hash table pointer) */
1776 ld r3,systemcfg@got(r2) /* r3 = ptr to systemcfg */
1777 ld r3,0(r3)
1778 lwz r3,PLATFORM(r3) /* r3 = platform flags */
1779 /* Test if bit 0 is set (LPAR bit) */
1780 andi. r3,r3,PLATFORM_LPAR
1781 bne 98f /* branch if result is !0 */
1782 LOADADDR(r6,_SDR1) /* Only if NOT LPAR */
1783 add r6,r6,r26
1784 ld r6,0(r6) /* get the value of _SDR1 */
1785 mtspr SPRN_SDR1,r6 /* set the htab location */
178698:
1787 LOADADDR(r3,.start_here_common)
1788 SET_REG_TO_CONST(r4, MSR_KERNEL)
1789 mtspr SPRN_SRR0,r3
1790 mtspr SPRN_SRR1,r4
1791 rfid
1792 b . /* prevent speculative execution */
1793#endif /* CONFIG_PPC_MULTIPLATFORM */
1794
1795 /* This is where all platforms converge execution */
1796_STATIC(start_here_common)
1797 /* relocation is on at this point */
1798
1799 /* The following code sets up the SP and TOC now that we are */
1800 /* running with translation enabled. */
1801
1802 LOADADDR(r3,init_thread_union)
1803
1804 /* set up the stack */
1805 addi r1,r3,THREAD_SIZE
1806 li r0,0
1807 stdu r0,-STACK_FRAME_OVERHEAD(r1)
1808
1809 /* Apply the CPUs-specific fixups (nop out sections not relevant
1810 * to this CPU
1811 */
1812 li r3,0
1813 bl .do_cpu_ftr_fixups
1814
1815 LOADADDR(r26, boot_cpuid)
1816 lwz r26,0(r26)
1817
1818 LOADADDR(r24, paca) /* Get base vaddr of paca array */
1819 mulli r13,r26,PACA_SIZE /* Calculate vaddr of right paca */
1820 add r13,r13,r24 /* for this processor. */
1821 mtspr SPRN_SPRG3,r13
1822
1823 /* ptr to current */
1824 LOADADDR(r4,init_task)
1825 std r4,PACACURRENT(r13)
1826
1827 /* Load the TOC */
1828 ld r2,PACATOC(r13)
1829 std r1,PACAKSAVE(r13)
1830
1831 bl .setup_system
1832
1833 /* Load up the kernel context */
18345:
1835#ifdef DO_SOFT_DISABLE
1836 li r5,0
1837 stb r5,PACAPROCENABLED(r13) /* Soft Disabled */
1838 mfmsr r5
1839 ori r5,r5,MSR_EE /* Hard Enabled */
1840 mtmsrd r5
1841#endif
1842
1843 bl .start_kernel
1844
1845_GLOBAL(hmt_init)
1846#ifdef CONFIG_HMT
1847 LOADADDR(r5, hmt_thread_data)
1848 mfspr r7,SPRN_PVR
1849 srwi r7,r7,16
1850 cmpwi r7,0x34 /* Pulsar */
1851 beq 90f
1852 cmpwi r7,0x36 /* Icestar */
1853 beq 91f
1854 cmpwi r7,0x37 /* SStar */
1855 beq 91f
1856 b 101f
185790: mfspr r6,SPRN_PIR
1858 andi. r6,r6,0x1f
1859 b 92f
186091: mfspr r6,SPRN_PIR
1861 andi. r6,r6,0x3ff
186292: sldi r4,r24,3
1863 stwx r6,r5,r4
1864 bl .hmt_start_secondary
1865 b 101f
1866
1867__hmt_secondary_hold:
1868 LOADADDR(r5, hmt_thread_data)
1869 clrldi r5,r5,4
1870 li r7,0
1871 mfspr r6,SPRN_PIR
1872 mfspr r8,SPRN_PVR
1873 srwi r8,r8,16
1874 cmpwi r8,0x34
1875 bne 93f
1876 andi. r6,r6,0x1f
1877 b 103f
187893: andi. r6,r6,0x3f
1879
1880103: lwzx r8,r5,r7
1881 cmpw r8,r6
1882 beq 104f
1883 addi r7,r7,8
1884 b 103b
1885
1886104: addi r7,r7,4
1887 lwzx r9,r5,r7
1888 mr r24,r9
1889101:
1890#endif
1891 mr r3,r24
1892 b .pSeries_secondary_smp_init
1893
1894#ifdef CONFIG_HMT
1895_GLOBAL(hmt_start_secondary)
1896 LOADADDR(r4,__hmt_secondary_hold)
1897 clrldi r4,r4,4
1898 mtspr SPRN_NIADORM, r4
1899 mfspr r4, SPRN_MSRDORM
1900 li r5, -65
1901 and r4, r4, r5
1902 mtspr SPRN_MSRDORM, r4
1903 lis r4,0xffef
1904 ori r4,r4,0x7403
1905 mtspr SPRN_TSC, r4
1906 li r4,0x1f4
1907 mtspr SPRN_TST, r4
1908 mfspr r4, SPRN_HID0
1909 ori r4, r4, 0x1
1910 mtspr SPRN_HID0, r4
1911 mfspr r4, SPRN_CTRLF
1912 oris r4, r4, 0x40
1913 mtspr SPRN_CTRLT, r4
1914 blr
1915#endif
1916
1917#if defined(CONFIG_KEXEC) || defined(CONFIG_SMP)
1918_GLOBAL(smp_release_cpus)
1919 /* All secondary cpus are spinning on a common
1920 * spinloop, release them all now so they can start
1921 * to spin on their individual paca spinloops.
1922 * For non SMP kernels, the secondary cpus never
1923 * get out of the common spinloop.
1924 * XXX This does nothing useful on iSeries, secondaries are
1925 * already waiting on their paca.
1926 */
1927 li r3,1
1928 LOADADDR(r5,__secondary_hold_spinloop)
1929 std r3,0(r5)
1930 sync
1931 blr
1932#endif /* CONFIG_SMP */
1933
1934
1935/*
1936 * We put a few things here that have to be page-aligned.
1937 * This stuff goes at the beginning of the bss, which is page-aligned.
1938 */
1939 .section ".bss"
1940
1941 .align PAGE_SHIFT
1942
1943 .globl empty_zero_page
1944empty_zero_page:
1945 .space PAGE_SIZE
1946
1947 .globl swapper_pg_dir
1948swapper_pg_dir:
1949 .space PAGE_SIZE
1950
1951/*
1952 * This space gets a copy of optional info passed to us by the bootstrap
1953 * Used to pass parameters into the kernel like root=/dev/sda1, etc.
1954 */
1955 .globl cmd_line
1956cmd_line:
1957 .space COMMAND_LINE_SIZE
diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S
new file mode 100644
index 000000000000..bc6d1ac55235
--- /dev/null
+++ b/arch/powerpc/kernel/head_8xx.S
@@ -0,0 +1,860 @@
1/*
2 * arch/ppc/kernel/except_8xx.S
3 *
4 * PowerPC version
5 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
6 * Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP
7 * Copyright (C) 1996 Cort Dougan <cort@cs.nmt.edu>
8 * Low-level exception handlers and MMU support
9 * rewritten by Paul Mackerras.
10 * Copyright (C) 1996 Paul Mackerras.
11 * MPC8xx modifications by Dan Malek
12 * Copyright (C) 1997 Dan Malek (dmalek@jlc.net).
13 *
14 * This file contains low-level support and setup for PowerPC 8xx
15 * embedded processors, including trap and interrupt dispatch.
16 *
17 * This program is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU General Public License
19 * as published by the Free Software Foundation; either version
20 * 2 of the License, or (at your option) any later version.
21 *
22 */
23
24#include <linux/config.h>
25#include <asm/processor.h>
26#include <asm/page.h>
27#include <asm/mmu.h>
28#include <asm/cache.h>
29#include <asm/pgtable.h>
30#include <asm/cputable.h>
31#include <asm/thread_info.h>
32#include <asm/ppc_asm.h>
33#include <asm/asm-offsets.h>
34
35/* Macro to make the code more readable. */
36#ifdef CONFIG_8xx_CPU6
37#define DO_8xx_CPU6(val, reg) \
38 li reg, val; \
39 stw reg, 12(r0); \
40 lwz reg, 12(r0);
41#else
42#define DO_8xx_CPU6(val, reg)
43#endif
44 .text
45 .globl _stext
46_stext:
47 .text
48 .globl _start
49_start:
50
51/* MPC8xx
52 * This port was done on an MBX board with an 860. Right now I only
53 * support an ELF compressed (zImage) boot from EPPC-Bug because the
54 * code there loads up some registers before calling us:
55 * r3: ptr to board info data
56 * r4: initrd_start or if no initrd then 0
57 * r5: initrd_end - unused if r4 is 0
58 * r6: Start of command line string
59 * r7: End of command line string
60 *
61 * I decided to use conditional compilation instead of checking PVR and
62 * adding more processor specific branches around code I don't need.
63 * Since this is an embedded processor, I also appreciate any memory
64 * savings I can get.
65 *
66 * The MPC8xx does not have any BATs, but it supports large page sizes.
67 * We first initialize the MMU to support 8M byte pages, then load one
68 * entry into each of the instruction and data TLBs to map the first
69 * 8M 1:1. I also mapped an additional I/O space 1:1 so we can get to
70 * the "internal" processor registers before MMU_init is called.
71 *
72 * The TLB code currently contains a major hack. Since I use the condition
73 * code register, I have to save and restore it. I am out of registers, so
74 * I just store it in memory location 0 (the TLB handlers are not reentrant).
75 * To avoid making any decisions, I need to use the "segment" valid bit
76 * in the first level table, but that would require many changes to the
77 * Linux page directory/table functions that I don't want to do right now.
78 *
79 * I used to use SPRG2 for a temporary register in the TLB handler, but it
80 * has since been put to other uses. I now use a hack to save a register
81 * and the CCR at memory location 0.....Someday I'll fix this.....
82 * -- Dan
83 */
84 .globl __start
85__start:
86 mr r31,r3 /* save parameters */
87 mr r30,r4
88 mr r29,r5
89 mr r28,r6
90 mr r27,r7
91
92 /* We have to turn on the MMU right away so we get cache modes
93 * set correctly.
94 */
95 bl initial_mmu
96
97/* We now have the lower 8 Meg mapped into TLB entries, and the caches
98 * ready to work.
99 */
100
101turn_on_mmu:
102 mfmsr r0
103 ori r0,r0,MSR_DR|MSR_IR
104 mtspr SPRN_SRR1,r0
105 lis r0,start_here@h
106 ori r0,r0,start_here@l
107 mtspr SPRN_SRR0,r0
108 SYNC
109 rfi /* enables MMU */
110
111/*
112 * Exception entry code. This code runs with address translation
113 * turned off, i.e. using physical addresses.
114 * We assume sprg3 has the physical address of the current
115 * task's thread_struct.
116 */
117#define EXCEPTION_PROLOG \
118 mtspr SPRN_SPRG0,r10; \
119 mtspr SPRN_SPRG1,r11; \
120 mfcr r10; \
121 EXCEPTION_PROLOG_1; \
122 EXCEPTION_PROLOG_2
123
124#define EXCEPTION_PROLOG_1 \
125 mfspr r11,SPRN_SRR1; /* check whether user or kernel */ \
126 andi. r11,r11,MSR_PR; \
127 tophys(r11,r1); /* use tophys(r1) if kernel */ \
128 beq 1f; \
129 mfspr r11,SPRN_SPRG3; \
130 lwz r11,THREAD_INFO-THREAD(r11); \
131 addi r11,r11,THREAD_SIZE; \
132 tophys(r11,r11); \
1331: subi r11,r11,INT_FRAME_SIZE /* alloc exc. frame */
134
135
136#define EXCEPTION_PROLOG_2 \
137 CLR_TOP32(r11); \
138 stw r10,_CCR(r11); /* save registers */ \
139 stw r12,GPR12(r11); \
140 stw r9,GPR9(r11); \
141 mfspr r10,SPRN_SPRG0; \
142 stw r10,GPR10(r11); \
143 mfspr r12,SPRN_SPRG1; \
144 stw r12,GPR11(r11); \
145 mflr r10; \
146 stw r10,_LINK(r11); \
147 mfspr r12,SPRN_SRR0; \
148 mfspr r9,SPRN_SRR1; \
149 stw r1,GPR1(r11); \
150 stw r1,0(r11); \
151 tovirt(r1,r11); /* set new kernel sp */ \
152 li r10,MSR_KERNEL & ~(MSR_IR|MSR_DR); /* can take exceptions */ \
153 MTMSRD(r10); /* (except for mach check in rtas) */ \
154 stw r0,GPR0(r11); \
155 SAVE_4GPRS(3, r11); \
156 SAVE_2GPRS(7, r11)
157
158/*
159 * Note: code which follows this uses cr0.eq (set if from kernel),
160 * r11, r12 (SRR0), and r9 (SRR1).
161 *
162 * Note2: once we have set r1 we are in a position to take exceptions
163 * again, and we could thus set MSR:RI at that point.
164 */
165
166/*
167 * Exception vectors.
168 */
169#define EXCEPTION(n, label, hdlr, xfer) \
170 . = n; \
171label: \
172 EXCEPTION_PROLOG; \
173 addi r3,r1,STACK_FRAME_OVERHEAD; \
174 xfer(n, hdlr)
175
176#define EXC_XFER_TEMPLATE(n, hdlr, trap, copyee, tfer, ret) \
177 li r10,trap; \
178 stw r10,_TRAP(r11); \
179 li r10,MSR_KERNEL; \
180 copyee(r10, r9); \
181 bl tfer; \
182i##n: \
183 .long hdlr; \
184 .long ret
185
186#define COPY_EE(d, s) rlwimi d,s,0,16,16
187#define NOCOPY(d, s)
188
189#define EXC_XFER_STD(n, hdlr) \
190 EXC_XFER_TEMPLATE(n, hdlr, n, NOCOPY, transfer_to_handler_full, \
191 ret_from_except_full)
192
193#define EXC_XFER_LITE(n, hdlr) \
194 EXC_XFER_TEMPLATE(n, hdlr, n+1, NOCOPY, transfer_to_handler, \
195 ret_from_except)
196
197#define EXC_XFER_EE(n, hdlr) \
198 EXC_XFER_TEMPLATE(n, hdlr, n, COPY_EE, transfer_to_handler_full, \
199 ret_from_except_full)
200
201#define EXC_XFER_EE_LITE(n, hdlr) \
202 EXC_XFER_TEMPLATE(n, hdlr, n+1, COPY_EE, transfer_to_handler, \
203 ret_from_except)
204
205/* System reset */
206 EXCEPTION(0x100, Reset, unknown_exception, EXC_XFER_STD)
207
208/* Machine check */
209 . = 0x200
210MachineCheck:
211 EXCEPTION_PROLOG
212 mfspr r4,SPRN_DAR
213 stw r4,_DAR(r11)
214 mfspr r5,SPRN_DSISR
215 stw r5,_DSISR(r11)
216 addi r3,r1,STACK_FRAME_OVERHEAD
217 EXC_XFER_STD(0x200, machine_check_exception)
218
219/* Data access exception.
220 * This is "never generated" by the MPC8xx. We jump to it for other
221 * translation errors.
222 */
223 . = 0x300
224DataAccess:
225 EXCEPTION_PROLOG
226 mfspr r10,SPRN_DSISR
227 stw r10,_DSISR(r11)
228 mr r5,r10
229 mfspr r4,SPRN_DAR
230 EXC_XFER_EE_LITE(0x300, handle_page_fault)
231
232/* Instruction access exception.
233 * This is "never generated" by the MPC8xx. We jump to it for other
234 * translation errors.
235 */
236 . = 0x400
237InstructionAccess:
238 EXCEPTION_PROLOG
239 mr r4,r12
240 mr r5,r9
241 EXC_XFER_EE_LITE(0x400, handle_page_fault)
242
243/* External interrupt */
244 EXCEPTION(0x500, HardwareInterrupt, do_IRQ, EXC_XFER_LITE)
245
246/* Alignment exception */
247 . = 0x600
248Alignment:
249 EXCEPTION_PROLOG
250 mfspr r4,SPRN_DAR
251 stw r4,_DAR(r11)
252 mfspr r5,SPRN_DSISR
253 stw r5,_DSISR(r11)
254 addi r3,r1,STACK_FRAME_OVERHEAD
255 EXC_XFER_EE(0x600, alignment_exception)
256
257/* Program check exception */
258 EXCEPTION(0x700, ProgramCheck, program_check_exception, EXC_XFER_STD)
259
260/* No FPU on MPC8xx. This exception is not supposed to happen.
261*/
262 EXCEPTION(0x800, FPUnavailable, unknown_exception, EXC_XFER_STD)
263
264/* Decrementer */
265 EXCEPTION(0x900, Decrementer, timer_interrupt, EXC_XFER_LITE)
266
267 EXCEPTION(0xa00, Trap_0a, unknown_exception, EXC_XFER_EE)
268 EXCEPTION(0xb00, Trap_0b, unknown_exception, EXC_XFER_EE)
269
270/* System call */
271 . = 0xc00
272SystemCall:
273 EXCEPTION_PROLOG
274 EXC_XFER_EE_LITE(0xc00, DoSyscall)
275
276/* Single step - not used on 601 */
277 EXCEPTION(0xd00, SingleStep, single_step_exception, EXC_XFER_STD)
278 EXCEPTION(0xe00, Trap_0e, unknown_exception, EXC_XFER_EE)
279 EXCEPTION(0xf00, Trap_0f, unknown_exception, EXC_XFER_EE)
280
281/* On the MPC8xx, this is a software emulation interrupt. It occurs
282 * for all unimplemented and illegal instructions.
283 */
284 EXCEPTION(0x1000, SoftEmu, SoftwareEmulation, EXC_XFER_STD)
285
286 . = 0x1100
287/*
288 * For the MPC8xx, this is a software tablewalk to load the instruction
289 * TLB. It is modelled after the example in the Motorola manual. The task
290 * switch loads the M_TWB register with the pointer to the first level table.
291 * If we discover there is no second level table (value is zero) or if there
292 * is an invalid pte, we load that into the TLB, which causes another fault
293 * into the TLB Error interrupt where we can handle such problems.
294 * We have to use the MD_xxx registers for the tablewalk because the
295 * equivalent MI_xxx registers only perform the attribute functions.
296 */
297InstructionTLBMiss:
298#ifdef CONFIG_8xx_CPU6
299 stw r3, 8(r0)
300#endif
301 DO_8xx_CPU6(0x3f80, r3)
302 mtspr SPRN_M_TW, r10 /* Save a couple of working registers */
303 mfcr r10
304 stw r10, 0(r0)
305 stw r11, 4(r0)
306 mfspr r10, SPRN_SRR0 /* Get effective address of fault */
307 DO_8xx_CPU6(0x3780, r3)
308 mtspr SPRN_MD_EPN, r10 /* Have to use MD_EPN for walk, MI_EPN can't */
309 mfspr r10, SPRN_M_TWB /* Get level 1 table entry address */
310
311 /* If we are faulting a kernel address, we have to use the
312 * kernel page tables.
313 */
314 andi. r11, r10, 0x0800 /* Address >= 0x80000000 */
315 beq 3f
316 lis r11, swapper_pg_dir@h
317 ori r11, r11, swapper_pg_dir@l
318 rlwimi r10, r11, 0, 2, 19
3193:
320 lwz r11, 0(r10) /* Get the level 1 entry */
321 rlwinm. r10, r11,0,0,19 /* Extract page descriptor page address */
322 beq 2f /* If zero, don't try to find a pte */
323
324 /* We have a pte table, so load the MI_TWC with the attributes
325 * for this "segment."
326 */
327 ori r11,r11,1 /* Set valid bit */
328 DO_8xx_CPU6(0x2b80, r3)
329 mtspr SPRN_MI_TWC, r11 /* Set segment attributes */
330 DO_8xx_CPU6(0x3b80, r3)
331 mtspr SPRN_MD_TWC, r11 /* Load pte table base address */
332 mfspr r11, SPRN_MD_TWC /* ....and get the pte address */
333 lwz r10, 0(r11) /* Get the pte */
334
335 ori r10, r10, _PAGE_ACCESSED
336 stw r10, 0(r11)
337
338 /* The Linux PTE won't go exactly into the MMU TLB.
339 * Software indicator bits 21, 22 and 28 must be clear.
340 * Software indicator bits 24, 25, 26, and 27 must be
341 * set. All other Linux PTE bits control the behavior
342 * of the MMU.
343 */
3442: li r11, 0x00f0
345 rlwimi r10, r11, 0, 24, 28 /* Set 24-27, clear 28 */
346 DO_8xx_CPU6(0x2d80, r3)
347 mtspr SPRN_MI_RPN, r10 /* Update TLB entry */
348
349 mfspr r10, SPRN_M_TW /* Restore registers */
350 lwz r11, 0(r0)
351 mtcr r11
352 lwz r11, 4(r0)
353#ifdef CONFIG_8xx_CPU6
354 lwz r3, 8(r0)
355#endif
356 rfi
357
358 . = 0x1200
359DataStoreTLBMiss:
360#ifdef CONFIG_8xx_CPU6
361 stw r3, 8(r0)
362#endif
363 DO_8xx_CPU6(0x3f80, r3)
364 mtspr SPRN_M_TW, r10 /* Save a couple of working registers */
365 mfcr r10
366 stw r10, 0(r0)
367 stw r11, 4(r0)
368 mfspr r10, SPRN_M_TWB /* Get level 1 table entry address */
369
370 /* If we are faulting a kernel address, we have to use the
371 * kernel page tables.
372 */
373 andi. r11, r10, 0x0800
374 beq 3f
375 lis r11, swapper_pg_dir@h
376 ori r11, r11, swapper_pg_dir@l
377 rlwimi r10, r11, 0, 2, 19
3783:
379 lwz r11, 0(r10) /* Get the level 1 entry */
380 rlwinm. r10, r11,0,0,19 /* Extract page descriptor page address */
381 beq 2f /* If zero, don't try to find a pte */
382
383 /* We have a pte table, so load fetch the pte from the table.
384 */
385 ori r11, r11, 1 /* Set valid bit in physical L2 page */
386 DO_8xx_CPU6(0x3b80, r3)
387 mtspr SPRN_MD_TWC, r11 /* Load pte table base address */
388 mfspr r10, SPRN_MD_TWC /* ....and get the pte address */
389 lwz r10, 0(r10) /* Get the pte */
390
391 /* Insert the Guarded flag into the TWC from the Linux PTE.
392 * It is bit 27 of both the Linux PTE and the TWC (at least
393 * I got that right :-). It will be better when we can put
394 * this into the Linux pgd/pmd and load it in the operation
395 * above.
396 */
397 rlwimi r11, r10, 0, 27, 27
398 DO_8xx_CPU6(0x3b80, r3)
399 mtspr SPRN_MD_TWC, r11
400
401 mfspr r11, SPRN_MD_TWC /* get the pte address again */
402 ori r10, r10, _PAGE_ACCESSED
403 stw r10, 0(r11)
404
405 /* The Linux PTE won't go exactly into the MMU TLB.
406 * Software indicator bits 21, 22 and 28 must be clear.
407 * Software indicator bits 24, 25, 26, and 27 must be
408 * set. All other Linux PTE bits control the behavior
409 * of the MMU.
410 */
4112: li r11, 0x00f0
412 rlwimi r10, r11, 0, 24, 28 /* Set 24-27, clear 28 */
413 DO_8xx_CPU6(0x3d80, r3)
414 mtspr SPRN_MD_RPN, r10 /* Update TLB entry */
415
416 mfspr r10, SPRN_M_TW /* Restore registers */
417 lwz r11, 0(r0)
418 mtcr r11
419 lwz r11, 4(r0)
420#ifdef CONFIG_8xx_CPU6
421 lwz r3, 8(r0)
422#endif
423 rfi
424
425/* This is an instruction TLB error on the MPC8xx. This could be due
426 * to many reasons, such as executing guarded memory or illegal instruction
427 * addresses. There is nothing to do but handle a big time error fault.
428 */
429 . = 0x1300
430InstructionTLBError:
431 b InstructionAccess
432
433/* This is the data TLB error on the MPC8xx. This could be due to
434 * many reasons, including a dirty update to a pte. We can catch that
435 * one here, but anything else is an error. First, we track down the
436 * Linux pte. If it is valid, write access is allowed, but the
437 * page dirty bit is not set, we will set it and reload the TLB. For
438 * any other case, we bail out to a higher level function that can
439 * handle it.
440 */
441 . = 0x1400
442DataTLBError:
443#ifdef CONFIG_8xx_CPU6
444 stw r3, 8(r0)
445#endif
446 DO_8xx_CPU6(0x3f80, r3)
447 mtspr SPRN_M_TW, r10 /* Save a couple of working registers */
448 mfcr r10
449 stw r10, 0(r0)
450 stw r11, 4(r0)
451
452 /* First, make sure this was a store operation.
453 */
454 mfspr r10, SPRN_DSISR
455 andis. r11, r10, 0x0200 /* If set, indicates store op */
456 beq 2f
457
458 /* The EA of a data TLB miss is automatically stored in the MD_EPN
459 * register. The EA of a data TLB error is automatically stored in
460 * the DAR, but not the MD_EPN register. We must copy the 20 most
461 * significant bits of the EA from the DAR to MD_EPN before we
462 * start walking the page tables. We also need to copy the CASID
463 * value from the M_CASID register.
464 * Addendum: The EA of a data TLB error is _supposed_ to be stored
465 * in DAR, but it seems that this doesn't happen in some cases, such
466 * as when the error is due to a dcbi instruction to a page with a
467 * TLB that doesn't have the changed bit set. In such cases, there
468 * does not appear to be any way to recover the EA of the error
469 * since it is neither in DAR nor MD_EPN. As a workaround, the
470 * _PAGE_HWWRITE bit is set for all kernel data pages when the PTEs
471 * are initialized in mapin_ram(). This will avoid the problem,
472 * assuming we only use the dcbi instruction on kernel addresses.
473 */
474 mfspr r10, SPRN_DAR
475 rlwinm r11, r10, 0, 0, 19
476 ori r11, r11, MD_EVALID
477 mfspr r10, SPRN_M_CASID
478 rlwimi r11, r10, 0, 28, 31
479 DO_8xx_CPU6(0x3780, r3)
480 mtspr SPRN_MD_EPN, r11
481
482 mfspr r10, SPRN_M_TWB /* Get level 1 table entry address */
483
484 /* If we are faulting a kernel address, we have to use the
485 * kernel page tables.
486 */
487 andi. r11, r10, 0x0800
488 beq 3f
489 lis r11, swapper_pg_dir@h
490 ori r11, r11, swapper_pg_dir@l
491 rlwimi r10, r11, 0, 2, 19
4923:
493 lwz r11, 0(r10) /* Get the level 1 entry */
494 rlwinm. r10, r11,0,0,19 /* Extract page descriptor page address */
495 beq 2f /* If zero, bail */
496
497 /* We have a pte table, so fetch the pte from the table.
498 */
499 ori r11, r11, 1 /* Set valid bit in physical L2 page */
500 DO_8xx_CPU6(0x3b80, r3)
501 mtspr SPRN_MD_TWC, r11 /* Load pte table base address */
502 mfspr r11, SPRN_MD_TWC /* ....and get the pte address */
503 lwz r10, 0(r11) /* Get the pte */
504
505 andi. r11, r10, _PAGE_RW /* Is it writeable? */
506 beq 2f /* Bail out if not */
507
508 /* Update 'changed', among others.
509 */
510 ori r10, r10, _PAGE_DIRTY|_PAGE_ACCESSED|_PAGE_HWWRITE
511 mfspr r11, SPRN_MD_TWC /* Get pte address again */
512 stw r10, 0(r11) /* and update pte in table */
513
514 /* The Linux PTE won't go exactly into the MMU TLB.
515 * Software indicator bits 21, 22 and 28 must be clear.
516 * Software indicator bits 24, 25, 26, and 27 must be
517 * set. All other Linux PTE bits control the behavior
518 * of the MMU.
519 */
520 li r11, 0x00f0
521 rlwimi r10, r11, 0, 24, 28 /* Set 24-27, clear 28 */
522 DO_8xx_CPU6(0x3d80, r3)
523 mtspr SPRN_MD_RPN, r10 /* Update TLB entry */
524
525 mfspr r10, SPRN_M_TW /* Restore registers */
526 lwz r11, 0(r0)
527 mtcr r11
528 lwz r11, 4(r0)
529#ifdef CONFIG_8xx_CPU6
530 lwz r3, 8(r0)
531#endif
532 rfi
5332:
534 mfspr r10, SPRN_M_TW /* Restore registers */
535 lwz r11, 0(r0)
536 mtcr r11
537 lwz r11, 4(r0)
538#ifdef CONFIG_8xx_CPU6
539 lwz r3, 8(r0)
540#endif
541 b DataAccess
542
543 EXCEPTION(0x1500, Trap_15, unknown_exception, EXC_XFER_EE)
544 EXCEPTION(0x1600, Trap_16, unknown_exception, EXC_XFER_EE)
545 EXCEPTION(0x1700, Trap_17, unknown_exception, EXC_XFER_EE)
546 EXCEPTION(0x1800, Trap_18, unknown_exception, EXC_XFER_EE)
547 EXCEPTION(0x1900, Trap_19, unknown_exception, EXC_XFER_EE)
548 EXCEPTION(0x1a00, Trap_1a, unknown_exception, EXC_XFER_EE)
549 EXCEPTION(0x1b00, Trap_1b, unknown_exception, EXC_XFER_EE)
550
551/* On the MPC8xx, these next four traps are used for development
552 * support of breakpoints and such. Someday I will get around to
553 * using them.
554 */
555 EXCEPTION(0x1c00, Trap_1c, unknown_exception, EXC_XFER_EE)
556 EXCEPTION(0x1d00, Trap_1d, unknown_exception, EXC_XFER_EE)
557 EXCEPTION(0x1e00, Trap_1e, unknown_exception, EXC_XFER_EE)
558 EXCEPTION(0x1f00, Trap_1f, unknown_exception, EXC_XFER_EE)
559
560 . = 0x2000
561
562 .globl giveup_fpu
563giveup_fpu:
564 blr
565
566/*
567 * This is where the main kernel code starts.
568 */
569start_here:
570 /* ptr to current */
571 lis r2,init_task@h
572 ori r2,r2,init_task@l
573
574 /* ptr to phys current thread */
575 tophys(r4,r2)
576 addi r4,r4,THREAD /* init task's THREAD */
577 mtspr SPRN_SPRG3,r4
578 li r3,0
579 mtspr SPRN_SPRG2,r3 /* 0 => r1 has kernel sp */
580
581 /* stack */
582 lis r1,init_thread_union@ha
583 addi r1,r1,init_thread_union@l
584 li r0,0
585 stwu r0,THREAD_SIZE-STACK_FRAME_OVERHEAD(r1)
586
587 bl early_init /* We have to do this with MMU on */
588
589/*
590 * Decide what sort of machine this is and initialize the MMU.
591 */
592 mr r3,r31
593 mr r4,r30
594 mr r5,r29
595 mr r6,r28
596 mr r7,r27
597 bl machine_init
598 bl MMU_init
599
600/*
601 * Go back to running unmapped so we can load up new values
602 * and change to using our exception vectors.
603 * On the 8xx, all we have to do is invalidate the TLB to clear
604 * the old 8M byte TLB mappings and load the page table base register.
605 */
606 /* The right way to do this would be to track it down through
607 * init's THREAD like the context switch code does, but this is
608 * easier......until someone changes init's static structures.
609 */
610 lis r6, swapper_pg_dir@h
611 ori r6, r6, swapper_pg_dir@l
612 tophys(r6,r6)
613#ifdef CONFIG_8xx_CPU6
614 lis r4, cpu6_errata_word@h
615 ori r4, r4, cpu6_errata_word@l
616 li r3, 0x3980
617 stw r3, 12(r4)
618 lwz r3, 12(r4)
619#endif
620 mtspr SPRN_M_TWB, r6
621 lis r4,2f@h
622 ori r4,r4,2f@l
623 tophys(r4,r4)
624 li r3,MSR_KERNEL & ~(MSR_IR|MSR_DR)
625 mtspr SPRN_SRR0,r4
626 mtspr SPRN_SRR1,r3
627 rfi
628/* Load up the kernel context */
6292:
630 SYNC /* Force all PTE updates to finish */
631 tlbia /* Clear all TLB entries */
632 sync /* wait for tlbia/tlbie to finish */
633 TLBSYNC /* ... on all CPUs */
634
635 /* set up the PTE pointers for the Abatron bdiGDB.
636 */
637 tovirt(r6,r6)
638 lis r5, abatron_pteptrs@h
639 ori r5, r5, abatron_pteptrs@l
640 stw r5, 0xf0(r0) /* Must match your Abatron config file */
641 tophys(r5,r5)
642 stw r6, 0(r5)
643
644/* Now turn on the MMU for real! */
645 li r4,MSR_KERNEL
646 lis r3,start_kernel@h
647 ori r3,r3,start_kernel@l
648 mtspr SPRN_SRR0,r3
649 mtspr SPRN_SRR1,r4
650 rfi /* enable MMU and jump to start_kernel */
651
652/* Set up the initial MMU state so we can do the first level of
653 * kernel initialization. This maps the first 8 MBytes of memory 1:1
654 * virtual to physical. Also, set the cache mode since that is defined
655 * by TLB entries and perform any additional mapping (like of the IMMR).
656 * If configured to pin some TLBs, we pin the first 8 Mbytes of kernel,
657 * 24 Mbytes of data, and the 8M IMMR space. Anything not covered by
658 * these mappings is mapped by page tables.
659 */
660initial_mmu:
661 tlbia /* Invalidate all TLB entries */
662#ifdef CONFIG_PIN_TLB
663 lis r8, MI_RSV4I@h
664 ori r8, r8, 0x1c00
665#else
666 li r8, 0
667#endif
668 mtspr SPRN_MI_CTR, r8 /* Set instruction MMU control */
669
670#ifdef CONFIG_PIN_TLB
671 lis r10, (MD_RSV4I | MD_RESETVAL)@h
672 ori r10, r10, 0x1c00
673 mr r8, r10
674#else
675 lis r10, MD_RESETVAL@h
676#endif
677#ifndef CONFIG_8xx_COPYBACK
678 oris r10, r10, MD_WTDEF@h
679#endif
680 mtspr SPRN_MD_CTR, r10 /* Set data TLB control */
681
682 /* Now map the lower 8 Meg into the TLBs. For this quick hack,
683 * we can load the instruction and data TLB registers with the
684 * same values.
685 */
686 lis r8, KERNELBASE@h /* Create vaddr for TLB */
687 ori r8, r8, MI_EVALID /* Mark it valid */
688 mtspr SPRN_MI_EPN, r8
689 mtspr SPRN_MD_EPN, r8
690 li r8, MI_PS8MEG /* Set 8M byte page */
691 ori r8, r8, MI_SVALID /* Make it valid */
692 mtspr SPRN_MI_TWC, r8
693 mtspr SPRN_MD_TWC, r8
694 li r8, MI_BOOTINIT /* Create RPN for address 0 */
695 mtspr SPRN_MI_RPN, r8 /* Store TLB entry */
696 mtspr SPRN_MD_RPN, r8
697 lis r8, MI_Kp@h /* Set the protection mode */
698 mtspr SPRN_MI_AP, r8
699 mtspr SPRN_MD_AP, r8
700
701 /* Map another 8 MByte at the IMMR to get the processor
702 * internal registers (among other things).
703 */
704#ifdef CONFIG_PIN_TLB
705 addi r10, r10, 0x0100
706 mtspr SPRN_MD_CTR, r10
707#endif
708 mfspr r9, 638 /* Get current IMMR */
709 andis. r9, r9, 0xff80 /* Get 8Mbyte boundary */
710
711 mr r8, r9 /* Create vaddr for TLB */
712 ori r8, r8, MD_EVALID /* Mark it valid */
713 mtspr SPRN_MD_EPN, r8
714 li r8, MD_PS8MEG /* Set 8M byte page */
715 ori r8, r8, MD_SVALID /* Make it valid */
716 mtspr SPRN_MD_TWC, r8
717 mr r8, r9 /* Create paddr for TLB */
718 ori r8, r8, MI_BOOTINIT|0x2 /* Inhibit cache -- Cort */
719 mtspr SPRN_MD_RPN, r8
720
721#ifdef CONFIG_PIN_TLB
722 /* Map two more 8M kernel data pages.
723 */
724 addi r10, r10, 0x0100
725 mtspr SPRN_MD_CTR, r10
726
727 lis r8, KERNELBASE@h /* Create vaddr for TLB */
728 addis r8, r8, 0x0080 /* Add 8M */
729 ori r8, r8, MI_EVALID /* Mark it valid */
730 mtspr SPRN_MD_EPN, r8
731 li r9, MI_PS8MEG /* Set 8M byte page */
732 ori r9, r9, MI_SVALID /* Make it valid */
733 mtspr SPRN_MD_TWC, r9
734 li r11, MI_BOOTINIT /* Create RPN for address 0 */
735 addis r11, r11, 0x0080 /* Add 8M */
736 mtspr SPRN_MD_RPN, r8
737
738 addis r8, r8, 0x0080 /* Add 8M */
739 mtspr SPRN_MD_EPN, r8
740 mtspr SPRN_MD_TWC, r9
741 addis r11, r11, 0x0080 /* Add 8M */
742 mtspr SPRN_MD_RPN, r8
743#endif
744
745 /* Since the cache is enabled according to the information we
746 * just loaded into the TLB, invalidate and enable the caches here.
747 * We should probably check/set other modes....later.
748 */
749 lis r8, IDC_INVALL@h
750 mtspr SPRN_IC_CST, r8
751 mtspr SPRN_DC_CST, r8
752 lis r8, IDC_ENABLE@h
753 mtspr SPRN_IC_CST, r8
754#ifdef CONFIG_8xx_COPYBACK
755 mtspr SPRN_DC_CST, r8
756#else
757 /* For a debug option, I left this here to easily enable
758 * the write through cache mode
759 */
760 lis r8, DC_SFWT@h
761 mtspr SPRN_DC_CST, r8
762 lis r8, IDC_ENABLE@h
763 mtspr SPRN_DC_CST, r8
764#endif
765 blr
766
767
768/*
769 * Set up to use a given MMU context.
770 * r3 is context number, r4 is PGD pointer.
771 *
772 * We place the physical address of the new task page directory loaded
773 * into the MMU base register, and set the ASID compare register with
774 * the new "context."
775 */
776_GLOBAL(set_context)
777
778#ifdef CONFIG_BDI_SWITCH
779 /* Context switch the PTE pointer for the Abatron BDI2000.
780 * The PGDIR is passed as second argument.
781 */
782 lis r5, KERNELBASE@h
783 lwz r5, 0xf0(r5)
784 stw r4, 0x4(r5)
785#endif
786
787#ifdef CONFIG_8xx_CPU6
788 lis r6, cpu6_errata_word@h
789 ori r6, r6, cpu6_errata_word@l
790 tophys (r4, r4)
791 li r7, 0x3980
792 stw r7, 12(r6)
793 lwz r7, 12(r6)
794 mtspr SPRN_M_TWB, r4 /* Update MMU base address */
795 li r7, 0x3380
796 stw r7, 12(r6)
797 lwz r7, 12(r6)
798 mtspr SPRN_M_CASID, r3 /* Update context */
799#else
800 mtspr SPRN_M_CASID,r3 /* Update context */
801 tophys (r4, r4)
802 mtspr SPRN_M_TWB, r4 /* and pgd */
803#endif
804 SYNC
805 blr
806
807#ifdef CONFIG_8xx_CPU6
808/* It's here because it is unique to the 8xx.
809 * It is important we get called with interrupts disabled. I used to
810 * do that, but it appears that all code that calls this already had
811 * interrupt disabled.
812 */
813 .globl set_dec_cpu6
814set_dec_cpu6:
815 lis r7, cpu6_errata_word@h
816 ori r7, r7, cpu6_errata_word@l
817 li r4, 0x2c00
818 stw r4, 8(r7)
819 lwz r4, 8(r7)
820 mtspr 22, r3 /* Update Decrementer */
821 SYNC
822 blr
823#endif
824
825/*
826 * We put a few things here that have to be page-aligned.
827 * This stuff goes at the beginning of the data segment,
828 * which is page-aligned.
829 */
830 .data
831 .globl sdata
832sdata:
833 .globl empty_zero_page
834empty_zero_page:
835 .space 4096
836
837 .globl swapper_pg_dir
838swapper_pg_dir:
839 .space 4096
840
841/*
842 * This space gets a copy of optional info passed to us by the bootstrap
843 * Used to pass parameters into the kernel like root=/dev/sda1, etc.
844 */
845 .globl cmd_line
846cmd_line:
847 .space 512
848
849/* Room for two PTE table poiners, usually the kernel and current user
850 * pointer to their respective root page table (pgdir).
851 */
852abatron_pteptrs:
853 .space 8
854
855#ifdef CONFIG_8xx_CPU6
856 .globl cpu6_errata_word
857cpu6_errata_word:
858 .space 16
859#endif
860
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
new file mode 100644
index 000000000000..5063c603fad4
--- /dev/null
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -0,0 +1,1063 @@
1/*
2 * arch/ppc/kernel/head_fsl_booke.S
3 *
4 * Kernel execution entry point code.
5 *
6 * Copyright (c) 1995-1996 Gary Thomas <gdt@linuxppc.org>
7 * Initial PowerPC version.
8 * Copyright (c) 1996 Cort Dougan <cort@cs.nmt.edu>
9 * Rewritten for PReP
10 * Copyright (c) 1996 Paul Mackerras <paulus@cs.anu.edu.au>
11 * Low-level exception handers, MMU support, and rewrite.
12 * Copyright (c) 1997 Dan Malek <dmalek@jlc.net>
13 * PowerPC 8xx modifications.
14 * Copyright (c) 1998-1999 TiVo, Inc.
15 * PowerPC 403GCX modifications.
16 * Copyright (c) 1999 Grant Erickson <grant@lcse.umn.edu>
17 * PowerPC 403GCX/405GP modifications.
18 * Copyright 2000 MontaVista Software Inc.
19 * PPC405 modifications
20 * PowerPC 403GCX/405GP modifications.
21 * Author: MontaVista Software, Inc.
22 * frank_rowand@mvista.com or source@mvista.com
23 * debbie_chu@mvista.com
24 * Copyright 2002-2004 MontaVista Software, Inc.
25 * PowerPC 44x support, Matt Porter <mporter@kernel.crashing.org>
26 * Copyright 2004 Freescale Semiconductor, Inc
27 * PowerPC e500 modifications, Kumar Gala <kumar.gala@freescale.com>
28 *
29 * This program is free software; you can redistribute it and/or modify it
30 * under the terms of the GNU General Public License as published by the
31 * Free Software Foundation; either version 2 of the License, or (at your
32 * option) any later version.
33 */
34
35#include <linux/config.h>
36#include <linux/threads.h>
37#include <asm/processor.h>
38#include <asm/page.h>
39#include <asm/mmu.h>
40#include <asm/pgtable.h>
41#include <asm/cputable.h>
42#include <asm/thread_info.h>
43#include <asm/ppc_asm.h>
44#include <asm/asm-offsets.h>
45#include "head_booke.h"
46
47/* As with the other PowerPC ports, it is expected that when code
48 * execution begins here, the following registers contain valid, yet
49 * optional, information:
50 *
51 * r3 - Board info structure pointer (DRAM, frequency, MAC address, etc.)
52 * r4 - Starting address of the init RAM disk
53 * r5 - Ending address of the init RAM disk
54 * r6 - Start of kernel command line string (e.g. "mem=128")
55 * r7 - End of kernel command line string
56 *
57 */
58 .text
59_GLOBAL(_stext)
60_GLOBAL(_start)
61 /*
62 * Reserve a word at a fixed location to store the address
63 * of abatron_pteptrs
64 */
65 nop
66/*
67 * Save parameters we are passed
68 */
69 mr r31,r3
70 mr r30,r4
71 mr r29,r5
72 mr r28,r6
73 mr r27,r7
74 li r24,0 /* CPU number */
75
76/* We try to not make any assumptions about how the boot loader
77 * setup or used the TLBs. We invalidate all mappings from the
78 * boot loader and load a single entry in TLB1[0] to map the
79 * first 16M of kernel memory. Any boot info passed from the
80 * bootloader needs to live in this first 16M.
81 *
82 * Requirement on bootloader:
83 * - The page we're executing in needs to reside in TLB1 and
84 * have IPROT=1. If not an invalidate broadcast could
85 * evict the entry we're currently executing in.
86 *
87 * r3 = Index of TLB1 were executing in
88 * r4 = Current MSR[IS]
89 * r5 = Index of TLB1 temp mapping
90 *
91 * Later in mapin_ram we will correctly map lowmem, and resize TLB1[0]
92 * if needed
93 */
94
95/* 1. Find the index of the entry we're executing in */
96 bl invstr /* Find our address */
97invstr: mflr r6 /* Make it accessible */
98 mfmsr r7
99 rlwinm r4,r7,27,31,31 /* extract MSR[IS] */
100 mfspr r7, SPRN_PID0
101 slwi r7,r7,16
102 or r7,r7,r4
103 mtspr SPRN_MAS6,r7
104 tlbsx 0,r6 /* search MSR[IS], SPID=PID0 */
105#ifndef CONFIG_E200
106 mfspr r7,SPRN_MAS1
107 andis. r7,r7,MAS1_VALID@h
108 bne match_TLB
109 mfspr r7,SPRN_PID1
110 slwi r7,r7,16
111 or r7,r7,r4
112 mtspr SPRN_MAS6,r7
113 tlbsx 0,r6 /* search MSR[IS], SPID=PID1 */
114 mfspr r7,SPRN_MAS1
115 andis. r7,r7,MAS1_VALID@h
116 bne match_TLB
117 mfspr r7, SPRN_PID2
118 slwi r7,r7,16
119 or r7,r7,r4
120 mtspr SPRN_MAS6,r7
121 tlbsx 0,r6 /* Fall through, we had to match */
122#endif
123match_TLB:
124 mfspr r7,SPRN_MAS0
125 rlwinm r3,r7,16,20,31 /* Extract MAS0(Entry) */
126
127 mfspr r7,SPRN_MAS1 /* Insure IPROT set */
128 oris r7,r7,MAS1_IPROT@h
129 mtspr SPRN_MAS1,r7
130 tlbwe
131
132/* 2. Invalidate all entries except the entry we're executing in */
133 mfspr r9,SPRN_TLB1CFG
134 andi. r9,r9,0xfff
135 li r6,0 /* Set Entry counter to 0 */
1361: lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */
137 rlwimi r7,r6,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r6) */
138 mtspr SPRN_MAS0,r7
139 tlbre
140 mfspr r7,SPRN_MAS1
141 rlwinm r7,r7,0,2,31 /* Clear MAS1 Valid and IPROT */
142 cmpw r3,r6
143 beq skpinv /* Dont update the current execution TLB */
144 mtspr SPRN_MAS1,r7
145 tlbwe
146 isync
147skpinv: addi r6,r6,1 /* Increment */
148 cmpw r6,r9 /* Are we done? */
149 bne 1b /* If not, repeat */
150
151 /* Invalidate TLB0 */
152 li r6,0x04
153 tlbivax 0,r6
154#ifdef CONFIG_SMP
155 tlbsync
156#endif
157 /* Invalidate TLB1 */
158 li r6,0x0c
159 tlbivax 0,r6
160#ifdef CONFIG_SMP
161 tlbsync
162#endif
163 msync
164
165/* 3. Setup a temp mapping and jump to it */
166 andi. r5, r3, 0x1 /* Find an entry not used and is non-zero */
167 addi r5, r5, 0x1
168 lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */
169 rlwimi r7,r3,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r3) */
170 mtspr SPRN_MAS0,r7
171 tlbre
172
173 /* Just modify the entry ID and EPN for the temp mapping */
174 lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */
175 rlwimi r7,r5,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r5) */
176 mtspr SPRN_MAS0,r7
177 xori r6,r4,1 /* Setup TMP mapping in the other Address space */
178 slwi r6,r6,12
179 oris r6,r6,(MAS1_VALID|MAS1_IPROT)@h
180 ori r6,r6,(MAS1_TSIZE(BOOKE_PAGESZ_4K))@l
181 mtspr SPRN_MAS1,r6
182 mfspr r6,SPRN_MAS2
183 li r7,0 /* temp EPN = 0 */
184 rlwimi r7,r6,0,20,31
185 mtspr SPRN_MAS2,r7
186 tlbwe
187
188 xori r6,r4,1
189 slwi r6,r6,5 /* setup new context with other address space */
190 bl 1f /* Find our address */
1911: mflr r9
192 rlwimi r7,r9,0,20,31
193 addi r7,r7,24
194 mtspr SPRN_SRR0,r7
195 mtspr SPRN_SRR1,r6
196 rfi
197
198/* 4. Clear out PIDs & Search info */
199 li r6,0
200 mtspr SPRN_PID0,r6
201#ifndef CONFIG_E200
202 mtspr SPRN_PID1,r6
203 mtspr SPRN_PID2,r6
204#endif
205 mtspr SPRN_MAS6,r6
206
207/* 5. Invalidate mapping we started in */
208 lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */
209 rlwimi r7,r3,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r3) */
210 mtspr SPRN_MAS0,r7
211 tlbre
212 li r6,0
213 mtspr SPRN_MAS1,r6
214 tlbwe
215 /* Invalidate TLB1 */
216 li r9,0x0c
217 tlbivax 0,r9
218#ifdef CONFIG_SMP
219 tlbsync
220#endif
221 msync
222
223/* 6. Setup KERNELBASE mapping in TLB1[0] */
224 lis r6,0x1000 /* Set MAS0(TLBSEL) = TLB1(1), ESEL = 0 */
225 mtspr SPRN_MAS0,r6
226 lis r6,(MAS1_VALID|MAS1_IPROT)@h
227 ori r6,r6,(MAS1_TSIZE(BOOKE_PAGESZ_16M))@l
228 mtspr SPRN_MAS1,r6
229 li r7,0
230 lis r6,KERNELBASE@h
231 ori r6,r6,KERNELBASE@l
232 rlwimi r6,r7,0,20,31
233 mtspr SPRN_MAS2,r6
234 li r7,(MAS3_SX|MAS3_SW|MAS3_SR)
235 mtspr SPRN_MAS3,r7
236 tlbwe
237
238/* 7. Jump to KERNELBASE mapping */
239 lis r7,MSR_KERNEL@h
240 ori r7,r7,MSR_KERNEL@l
241 bl 1f /* Find our address */
2421: mflr r9
243 rlwimi r6,r9,0,20,31
244 addi r6,r6,24
245 mtspr SPRN_SRR0,r6
246 mtspr SPRN_SRR1,r7
247 rfi /* start execution out of TLB1[0] entry */
248
249/* 8. Clear out the temp mapping */
250 lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */
251 rlwimi r7,r5,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r5) */
252 mtspr SPRN_MAS0,r7
253 tlbre
254 mtspr SPRN_MAS1,r8
255 tlbwe
256 /* Invalidate TLB1 */
257 li r9,0x0c
258 tlbivax 0,r9
259#ifdef CONFIG_SMP
260 tlbsync
261#endif
262 msync
263
264 /* Establish the interrupt vector offsets */
265 SET_IVOR(0, CriticalInput);
266 SET_IVOR(1, MachineCheck);
267 SET_IVOR(2, DataStorage);
268 SET_IVOR(3, InstructionStorage);
269 SET_IVOR(4, ExternalInput);
270 SET_IVOR(5, Alignment);
271 SET_IVOR(6, Program);
272 SET_IVOR(7, FloatingPointUnavailable);
273 SET_IVOR(8, SystemCall);
274 SET_IVOR(9, AuxillaryProcessorUnavailable);
275 SET_IVOR(10, Decrementer);
276 SET_IVOR(11, FixedIntervalTimer);
277 SET_IVOR(12, WatchdogTimer);
278 SET_IVOR(13, DataTLBError);
279 SET_IVOR(14, InstructionTLBError);
280 SET_IVOR(15, Debug);
281 SET_IVOR(32, SPEUnavailable);
282 SET_IVOR(33, SPEFloatingPointData);
283 SET_IVOR(34, SPEFloatingPointRound);
284#ifndef CONFIG_E200
285 SET_IVOR(35, PerformanceMonitor);
286#endif
287
288 /* Establish the interrupt vector base */
289 lis r4,interrupt_base@h /* IVPR only uses the high 16-bits */
290 mtspr SPRN_IVPR,r4
291
292 /* Setup the defaults for TLB entries */
293 li r2,(MAS4_TSIZED(BOOKE_PAGESZ_4K))@l
294#ifdef CONFIG_E200
295 oris r2,r2,MAS4_TLBSELD(1)@h
296#endif
297 mtspr SPRN_MAS4, r2
298
299#if 0
300 /* Enable DOZE */
301 mfspr r2,SPRN_HID0
302 oris r2,r2,HID0_DOZE@h
303 mtspr SPRN_HID0, r2
304#endif
305#ifdef CONFIG_E200
306 /* enable dedicated debug exception handling resources (Debug APU) */
307 mfspr r2,SPRN_HID0
308 ori r2,r2,HID0_DAPUEN@l
309 mtspr SPRN_HID0,r2
310#endif
311
312#if !defined(CONFIG_BDI_SWITCH)
313 /*
314 * The Abatron BDI JTAG debugger does not tolerate others
315 * mucking with the debug registers.
316 */
317 lis r2,DBCR0_IDM@h
318 mtspr SPRN_DBCR0,r2
319 /* clear any residual debug events */
320 li r2,-1
321 mtspr SPRN_DBSR,r2
322#endif
323
324 /*
325 * This is where the main kernel code starts.
326 */
327
328 /* ptr to current */
329 lis r2,init_task@h
330 ori r2,r2,init_task@l
331
332 /* ptr to current thread */
333 addi r4,r2,THREAD /* init task's THREAD */
334 mtspr SPRN_SPRG3,r4
335
336 /* stack */
337 lis r1,init_thread_union@h
338 ori r1,r1,init_thread_union@l
339 li r0,0
340 stwu r0,THREAD_SIZE-STACK_FRAME_OVERHEAD(r1)
341
342 bl early_init
343
344 mfspr r3,SPRN_TLB1CFG
345 andi. r3,r3,0xfff
346 lis r4,num_tlbcam_entries@ha
347 stw r3,num_tlbcam_entries@l(r4)
348/*
349 * Decide what sort of machine this is and initialize the MMU.
350 */
351 mr r3,r31
352 mr r4,r30
353 mr r5,r29
354 mr r6,r28
355 mr r7,r27
356 bl machine_init
357 bl MMU_init
358
359 /* Setup PTE pointers for the Abatron bdiGDB */
360 lis r6, swapper_pg_dir@h
361 ori r6, r6, swapper_pg_dir@l
362 lis r5, abatron_pteptrs@h
363 ori r5, r5, abatron_pteptrs@l
364 lis r4, KERNELBASE@h
365 ori r4, r4, KERNELBASE@l
366 stw r5, 0(r4) /* Save abatron_pteptrs at a fixed location */
367 stw r6, 0(r5)
368
369 /* Let's move on */
370 lis r4,start_kernel@h
371 ori r4,r4,start_kernel@l
372 lis r3,MSR_KERNEL@h
373 ori r3,r3,MSR_KERNEL@l
374 mtspr SPRN_SRR0,r4
375 mtspr SPRN_SRR1,r3
376 rfi /* change context and jump to start_kernel */
377
378/* Macros to hide the PTE size differences
379 *
380 * FIND_PTE -- walks the page tables given EA & pgdir pointer
381 * r10 -- EA of fault
382 * r11 -- PGDIR pointer
383 * r12 -- free
384 * label 2: is the bailout case
385 *
386 * if we find the pte (fall through):
387 * r11 is low pte word
388 * r12 is pointer to the pte
389 */
390#ifdef CONFIG_PTE_64BIT
391#define PTE_FLAGS_OFFSET 4
392#define FIND_PTE \
393 rlwinm r12, r10, 13, 19, 29; /* Compute pgdir/pmd offset */ \
394 lwzx r11, r12, r11; /* Get pgd/pmd entry */ \
395 rlwinm. r12, r11, 0, 0, 20; /* Extract pt base address */ \
396 beq 2f; /* Bail if no table */ \
397 rlwimi r12, r10, 23, 20, 28; /* Compute pte address */ \
398 lwz r11, 4(r12); /* Get pte entry */
399#else
400#define PTE_FLAGS_OFFSET 0
401#define FIND_PTE \
402 rlwimi r11, r10, 12, 20, 29; /* Create L1 (pgdir/pmd) address */ \
403 lwz r11, 0(r11); /* Get L1 entry */ \
404 rlwinm. r12, r11, 0, 0, 19; /* Extract L2 (pte) base address */ \
405 beq 2f; /* Bail if no table */ \
406 rlwimi r12, r10, 22, 20, 29; /* Compute PTE address */ \
407 lwz r11, 0(r12); /* Get Linux PTE */
408#endif
409
410/*
411 * Interrupt vector entry code
412 *
413 * The Book E MMUs are always on so we don't need to handle
414 * interrupts in real mode as with previous PPC processors. In
415 * this case we handle interrupts in the kernel virtual address
416 * space.
417 *
418 * Interrupt vectors are dynamically placed relative to the
419 * interrupt prefix as determined by the address of interrupt_base.
420 * The interrupt vectors offsets are programmed using the labels
421 * for each interrupt vector entry.
422 *
423 * Interrupt vectors must be aligned on a 16 byte boundary.
424 * We align on a 32 byte cache line boundary for good measure.
425 */
426
427interrupt_base:
428 /* Critical Input Interrupt */
429 CRITICAL_EXCEPTION(0x0100, CriticalInput, unknown_exception)
430
431 /* Machine Check Interrupt */
432#ifdef CONFIG_E200
433 /* no RFMCI, MCSRRs on E200 */
434 CRITICAL_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
435#else
436 MCHECK_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
437#endif
438
439 /* Data Storage Interrupt */
440 START_EXCEPTION(DataStorage)
441 mtspr SPRN_SPRG0, r10 /* Save some working registers */
442 mtspr SPRN_SPRG1, r11
443 mtspr SPRN_SPRG4W, r12
444 mtspr SPRN_SPRG5W, r13
445 mfcr r11
446 mtspr SPRN_SPRG7W, r11
447
448 /*
449 * Check if it was a store fault, if not then bail
450 * because a user tried to access a kernel or
451 * read-protected page. Otherwise, get the
452 * offending address and handle it.
453 */
454 mfspr r10, SPRN_ESR
455 andis. r10, r10, ESR_ST@h
456 beq 2f
457
458 mfspr r10, SPRN_DEAR /* Get faulting address */
459
460 /* If we are faulting a kernel address, we have to use the
461 * kernel page tables.
462 */
463 lis r11, TASK_SIZE@h
464 ori r11, r11, TASK_SIZE@l
465 cmplw 0, r10, r11
466 bge 2f
467
468 /* Get the PGD for the current thread */
4693:
470 mfspr r11,SPRN_SPRG3
471 lwz r11,PGDIR(r11)
4724:
473 FIND_PTE
474
475 /* Are _PAGE_USER & _PAGE_RW set & _PAGE_HWWRITE not? */
476 andi. r13, r11, _PAGE_RW|_PAGE_USER|_PAGE_HWWRITE
477 cmpwi 0, r13, _PAGE_RW|_PAGE_USER
478 bne 2f /* Bail if not */
479
480 /* Update 'changed'. */
481 ori r11, r11, _PAGE_DIRTY|_PAGE_ACCESSED|_PAGE_HWWRITE
482 stw r11, PTE_FLAGS_OFFSET(r12) /* Update Linux page table */
483
484 /* MAS2 not updated as the entry does exist in the tlb, this
485 fault taken to detect state transition (eg: COW -> DIRTY)
486 */
487 andi. r11, r11, _PAGE_HWEXEC
488 rlwimi r11, r11, 31, 27, 27 /* SX <- _PAGE_HWEXEC */
489 ori r11, r11, (MAS3_UW|MAS3_SW|MAS3_UR|MAS3_SR)@l /* set static perms */
490
491 /* update search PID in MAS6, AS = 0 */
492 mfspr r12, SPRN_PID0
493 slwi r12, r12, 16
494 mtspr SPRN_MAS6, r12
495
496 /* find the TLB index that caused the fault. It has to be here. */
497 tlbsx 0, r10
498
499 /* only update the perm bits, assume the RPN is fine */
500 mfspr r12, SPRN_MAS3
501 rlwimi r12, r11, 0, 20, 31
502 mtspr SPRN_MAS3,r12
503 tlbwe
504
505 /* Done...restore registers and get out of here. */
506 mfspr r11, SPRN_SPRG7R
507 mtcr r11
508 mfspr r13, SPRN_SPRG5R
509 mfspr r12, SPRN_SPRG4R
510 mfspr r11, SPRN_SPRG1
511 mfspr r10, SPRN_SPRG0
512 rfi /* Force context change */
513
5142:
515 /*
516 * The bailout. Restore registers to pre-exception conditions
517 * and call the heavyweights to help us out.
518 */
519 mfspr r11, SPRN_SPRG7R
520 mtcr r11
521 mfspr r13, SPRN_SPRG5R
522 mfspr r12, SPRN_SPRG4R
523 mfspr r11, SPRN_SPRG1
524 mfspr r10, SPRN_SPRG0
525 b data_access
526
527 /* Instruction Storage Interrupt */
528 INSTRUCTION_STORAGE_EXCEPTION
529
530 /* External Input Interrupt */
531 EXCEPTION(0x0500, ExternalInput, do_IRQ, EXC_XFER_LITE)
532
533 /* Alignment Interrupt */
534 ALIGNMENT_EXCEPTION
535
536 /* Program Interrupt */
537 PROGRAM_EXCEPTION
538
539 /* Floating Point Unavailable Interrupt */
540#ifdef CONFIG_PPC_FPU
541 FP_UNAVAILABLE_EXCEPTION
542#else
543#ifdef CONFIG_E200
544 /* E200 treats 'normal' floating point instructions as FP Unavail exception */
545 EXCEPTION(0x0800, FloatingPointUnavailable, program_check_exception, EXC_XFER_EE)
546#else
547 EXCEPTION(0x0800, FloatingPointUnavailable, unknown_exception, EXC_XFER_EE)
548#endif
549#endif
550
551 /* System Call Interrupt */
552 START_EXCEPTION(SystemCall)
553 NORMAL_EXCEPTION_PROLOG
554 EXC_XFER_EE_LITE(0x0c00, DoSyscall)
555
556 /* Auxillary Processor Unavailable Interrupt */
557 EXCEPTION(0x2900, AuxillaryProcessorUnavailable, unknown_exception, EXC_XFER_EE)
558
559 /* Decrementer Interrupt */
560 DECREMENTER_EXCEPTION
561
562 /* Fixed Internal Timer Interrupt */
563 /* TODO: Add FIT support */
564 EXCEPTION(0x3100, FixedIntervalTimer, unknown_exception, EXC_XFER_EE)
565
566 /* Watchdog Timer Interrupt */
567#ifdef CONFIG_BOOKE_WDT
568 CRITICAL_EXCEPTION(0x3200, WatchdogTimer, WatchdogException)
569#else
570 CRITICAL_EXCEPTION(0x3200, WatchdogTimer, unknown_exception)
571#endif
572
573 /* Data TLB Error Interrupt */
574 START_EXCEPTION(DataTLBError)
575 mtspr SPRN_SPRG0, r10 /* Save some working registers */
576 mtspr SPRN_SPRG1, r11
577 mtspr SPRN_SPRG4W, r12
578 mtspr SPRN_SPRG5W, r13
579 mfcr r11
580 mtspr SPRN_SPRG7W, r11
581 mfspr r10, SPRN_DEAR /* Get faulting address */
582
583 /* If we are faulting a kernel address, we have to use the
584 * kernel page tables.
585 */
586 lis r11, TASK_SIZE@h
587 ori r11, r11, TASK_SIZE@l
588 cmplw 5, r10, r11
589 blt 5, 3f
590 lis r11, swapper_pg_dir@h
591 ori r11, r11, swapper_pg_dir@l
592
593 mfspr r12,SPRN_MAS1 /* Set TID to 0 */
594 rlwinm r12,r12,0,16,1
595 mtspr SPRN_MAS1,r12
596
597 b 4f
598
599 /* Get the PGD for the current thread */
6003:
601 mfspr r11,SPRN_SPRG3
602 lwz r11,PGDIR(r11)
603
6044:
605 FIND_PTE
606 andi. r13, r11, _PAGE_PRESENT /* Is the page present? */
607 beq 2f /* Bail if not present */
608
609#ifdef CONFIG_PTE_64BIT
610 lwz r13, 0(r12)
611#endif
612 ori r11, r11, _PAGE_ACCESSED
613 stw r11, PTE_FLAGS_OFFSET(r12)
614
615 /* Jump to common tlb load */
616 b finish_tlb_load
6172:
618 /* The bailout. Restore registers to pre-exception conditions
619 * and call the heavyweights to help us out.
620 */
621 mfspr r11, SPRN_SPRG7R
622 mtcr r11
623 mfspr r13, SPRN_SPRG5R
624 mfspr r12, SPRN_SPRG4R
625 mfspr r11, SPRN_SPRG1
626 mfspr r10, SPRN_SPRG0
627 b data_access
628
629 /* Instruction TLB Error Interrupt */
630 /*
631 * Nearly the same as above, except we get our
632 * information from different registers and bailout
633 * to a different point.
634 */
635 START_EXCEPTION(InstructionTLBError)
636 mtspr SPRN_SPRG0, r10 /* Save some working registers */
637 mtspr SPRN_SPRG1, r11
638 mtspr SPRN_SPRG4W, r12
639 mtspr SPRN_SPRG5W, r13
640 mfcr r11
641 mtspr SPRN_SPRG7W, r11
642 mfspr r10, SPRN_SRR0 /* Get faulting address */
643
644 /* If we are faulting a kernel address, we have to use the
645 * kernel page tables.
646 */
647 lis r11, TASK_SIZE@h
648 ori r11, r11, TASK_SIZE@l
649 cmplw 5, r10, r11
650 blt 5, 3f
651 lis r11, swapper_pg_dir@h
652 ori r11, r11, swapper_pg_dir@l
653
654 mfspr r12,SPRN_MAS1 /* Set TID to 0 */
655 rlwinm r12,r12,0,16,1
656 mtspr SPRN_MAS1,r12
657
658 b 4f
659
660 /* Get the PGD for the current thread */
6613:
662 mfspr r11,SPRN_SPRG3
663 lwz r11,PGDIR(r11)
664
6654:
666 FIND_PTE
667 andi. r13, r11, _PAGE_PRESENT /* Is the page present? */
668 beq 2f /* Bail if not present */
669
670#ifdef CONFIG_PTE_64BIT
671 lwz r13, 0(r12)
672#endif
673 ori r11, r11, _PAGE_ACCESSED
674 stw r11, PTE_FLAGS_OFFSET(r12)
675
676 /* Jump to common TLB load point */
677 b finish_tlb_load
678
6792:
680 /* The bailout. Restore registers to pre-exception conditions
681 * and call the heavyweights to help us out.
682 */
683 mfspr r11, SPRN_SPRG7R
684 mtcr r11
685 mfspr r13, SPRN_SPRG5R
686 mfspr r12, SPRN_SPRG4R
687 mfspr r11, SPRN_SPRG1
688 mfspr r10, SPRN_SPRG0
689 b InstructionStorage
690
691#ifdef CONFIG_SPE
692 /* SPE Unavailable */
693 START_EXCEPTION(SPEUnavailable)
694 NORMAL_EXCEPTION_PROLOG
695 bne load_up_spe
696 addi r3,r1,STACK_FRAME_OVERHEAD
697 EXC_XFER_EE_LITE(0x2010, KernelSPE)
698#else
699 EXCEPTION(0x2020, SPEUnavailable, unknown_exception, EXC_XFER_EE)
700#endif /* CONFIG_SPE */
701
702 /* SPE Floating Point Data */
703#ifdef CONFIG_SPE
704 EXCEPTION(0x2030, SPEFloatingPointData, SPEFloatingPointException, EXC_XFER_EE);
705#else
706 EXCEPTION(0x2040, SPEFloatingPointData, unknown_exception, EXC_XFER_EE)
707#endif /* CONFIG_SPE */
708
709 /* SPE Floating Point Round */
710 EXCEPTION(0x2050, SPEFloatingPointRound, unknown_exception, EXC_XFER_EE)
711
712 /* Performance Monitor */
713 EXCEPTION(0x2060, PerformanceMonitor, performance_monitor_exception, EXC_XFER_STD)
714
715
716 /* Debug Interrupt */
717 DEBUG_EXCEPTION
718
719/*
720 * Local functions
721 */
722
723 /*
724 * Data TLB exceptions will bail out to this point
725 * if they can't resolve the lightweight TLB fault.
726 */
727data_access:
728 NORMAL_EXCEPTION_PROLOG
729 mfspr r5,SPRN_ESR /* Grab the ESR, save it, pass arg3 */
730 stw r5,_ESR(r11)
731 mfspr r4,SPRN_DEAR /* Grab the DEAR, save it, pass arg2 */
732 andis. r10,r5,(ESR_ILK|ESR_DLK)@h
733 bne 1f
734 EXC_XFER_EE_LITE(0x0300, handle_page_fault)
7351:
736 addi r3,r1,STACK_FRAME_OVERHEAD
737 EXC_XFER_EE_LITE(0x0300, CacheLockingException)
738
739/*
740
741 * Both the instruction and data TLB miss get to this
742 * point to load the TLB.
743 * r10 - EA of fault
744 * r11 - TLB (info from Linux PTE)
745 * r12, r13 - available to use
746 * CR5 - results of addr < TASK_SIZE
747 * MAS0, MAS1 - loaded with proper value when we get here
748 * MAS2, MAS3 - will need additional info from Linux PTE
749 * Upon exit, we reload everything and RFI.
750 */
751finish_tlb_load:
752 /*
753 * We set execute, because we don't have the granularity to
754 * properly set this at the page level (Linux problem).
755 * Many of these bits are software only. Bits we don't set
756 * here we (properly should) assume have the appropriate value.
757 */
758
759 mfspr r12, SPRN_MAS2
760#ifdef CONFIG_PTE_64BIT
761 rlwimi r12, r11, 26, 24, 31 /* extract ...WIMGE from pte */
762#else
763 rlwimi r12, r11, 26, 27, 31 /* extract WIMGE from pte */
764#endif
765 mtspr SPRN_MAS2, r12
766
767 bge 5, 1f
768
769 /* is user addr */
770 andi. r12, r11, (_PAGE_USER | _PAGE_HWWRITE | _PAGE_HWEXEC)
771 andi. r10, r11, _PAGE_USER /* Test for _PAGE_USER */
772 srwi r10, r12, 1
773 or r12, r12, r10 /* Copy user perms into supervisor */
774 iseleq r12, 0, r12
775 b 2f
776
777 /* is kernel addr */
7781: rlwinm r12, r11, 31, 29, 29 /* Extract _PAGE_HWWRITE into SW */
779 ori r12, r12, (MAS3_SX | MAS3_SR)
780
781#ifdef CONFIG_PTE_64BIT
7822: rlwimi r12, r13, 24, 0, 7 /* grab RPN[32:39] */
783 rlwimi r12, r11, 24, 8, 19 /* grab RPN[40:51] */
784 mtspr SPRN_MAS3, r12
785BEGIN_FTR_SECTION
786 srwi r10, r13, 8 /* grab RPN[8:31] */
787 mtspr SPRN_MAS7, r10
788END_FTR_SECTION_IFSET(CPU_FTR_BIG_PHYS)
789#else
7902: rlwimi r11, r12, 0, 20, 31 /* Extract RPN from PTE and merge with perms */
791 mtspr SPRN_MAS3, r11
792#endif
793#ifdef CONFIG_E200
794 /* Round robin TLB1 entries assignment */
795 mfspr r12, SPRN_MAS0
796
797 /* Extract TLB1CFG(NENTRY) */
798 mfspr r11, SPRN_TLB1CFG
799 andi. r11, r11, 0xfff
800
801 /* Extract MAS0(NV) */
802 andi. r13, r12, 0xfff
803 addi r13, r13, 1
804 cmpw 0, r13, r11
805 addi r12, r12, 1
806
807 /* check if we need to wrap */
808 blt 7f
809
810 /* wrap back to first free tlbcam entry */
811 lis r13, tlbcam_index@ha
812 lwz r13, tlbcam_index@l(r13)
813 rlwimi r12, r13, 0, 20, 31
8147:
815 mtspr SPRN_MAS0,r12
816#endif /* CONFIG_E200 */
817
818 tlbwe
819
820 /* Done...restore registers and get out of here. */
821 mfspr r11, SPRN_SPRG7R
822 mtcr r11
823 mfspr r13, SPRN_SPRG5R
824 mfspr r12, SPRN_SPRG4R
825 mfspr r11, SPRN_SPRG1
826 mfspr r10, SPRN_SPRG0
827 rfi /* Force context change */
828
829#ifdef CONFIG_SPE
830/* Note that the SPE support is closely modeled after the AltiVec
831 * support. Changes to one are likely to be applicable to the
832 * other! */
833load_up_spe:
834/*
835 * Disable SPE for the task which had SPE previously,
836 * and save its SPE registers in its thread_struct.
837 * Enables SPE for use in the kernel on return.
838 * On SMP we know the SPE units are free, since we give it up every
839 * switch. -- Kumar
840 */
841 mfmsr r5
842 oris r5,r5,MSR_SPE@h
843 mtmsr r5 /* enable use of SPE now */
844 isync
845/*
846 * For SMP, we don't do lazy SPE switching because it just gets too
847 * horrendously complex, especially when a task switches from one CPU
848 * to another. Instead we call giveup_spe in switch_to.
849 */
850#ifndef CONFIG_SMP
851 lis r3,last_task_used_spe@ha
852 lwz r4,last_task_used_spe@l(r3)
853 cmpi 0,r4,0
854 beq 1f
855 addi r4,r4,THREAD /* want THREAD of last_task_used_spe */
856 SAVE_32EVRS(0,r10,r4)
857 evxor evr10, evr10, evr10 /* clear out evr10 */
858 evmwumiaa evr10, evr10, evr10 /* evr10 <- ACC = 0 * 0 + ACC */
859 li r5,THREAD_ACC
860 evstddx evr10, r4, r5 /* save off accumulator */
861 lwz r5,PT_REGS(r4)
862 lwz r4,_MSR-STACK_FRAME_OVERHEAD(r5)
863 lis r10,MSR_SPE@h
864 andc r4,r4,r10 /* disable SPE for previous task */
865 stw r4,_MSR-STACK_FRAME_OVERHEAD(r5)
8661:
867#endif /* CONFIG_SMP */
868 /* enable use of SPE after return */
869 oris r9,r9,MSR_SPE@h
870 mfspr r5,SPRN_SPRG3 /* current task's THREAD (phys) */
871 li r4,1
872 li r10,THREAD_ACC
873 stw r4,THREAD_USED_SPE(r5)
874 evlddx evr4,r10,r5
875 evmra evr4,evr4
876 REST_32EVRS(0,r10,r5)
877#ifndef CONFIG_SMP
878 subi r4,r5,THREAD
879 stw r4,last_task_used_spe@l(r3)
880#endif /* CONFIG_SMP */
881 /* restore registers and return */
8822: REST_4GPRS(3, r11)
883 lwz r10,_CCR(r11)
884 REST_GPR(1, r11)
885 mtcr r10
886 lwz r10,_LINK(r11)
887 mtlr r10
888 REST_GPR(10, r11)
889 mtspr SPRN_SRR1,r9
890 mtspr SPRN_SRR0,r12
891 REST_GPR(9, r11)
892 REST_GPR(12, r11)
893 lwz r11,GPR11(r11)
894 SYNC
895 rfi
896
897/*
898 * SPE unavailable trap from kernel - print a message, but let
899 * the task use SPE in the kernel until it returns to user mode.
900 */
901KernelSPE:
902 lwz r3,_MSR(r1)
903 oris r3,r3,MSR_SPE@h
904 stw r3,_MSR(r1) /* enable use of SPE after return */
905 lis r3,87f@h
906 ori r3,r3,87f@l
907 mr r4,r2 /* current */
908 lwz r5,_NIP(r1)
909 bl printk
910 b ret_from_except
91187: .string "SPE used in kernel (task=%p, pc=%x) \n"
912 .align 4,0
913
914#endif /* CONFIG_SPE */
915
916/*
917 * Global functions
918 */
919
920/*
921 * extern void loadcam_entry(unsigned int index)
922 *
923 * Load TLBCAM[index] entry in to the L2 CAM MMU
924 */
925_GLOBAL(loadcam_entry)
926 lis r4,TLBCAM@ha
927 addi r4,r4,TLBCAM@l
928 mulli r5,r3,20
929 add r3,r5,r4
930 lwz r4,0(r3)
931 mtspr SPRN_MAS0,r4
932 lwz r4,4(r3)
933 mtspr SPRN_MAS1,r4
934 lwz r4,8(r3)
935 mtspr SPRN_MAS2,r4
936 lwz r4,12(r3)
937 mtspr SPRN_MAS3,r4
938 tlbwe
939 isync
940 blr
941
942/*
943 * extern void giveup_altivec(struct task_struct *prev)
944 *
945 * The e500 core does not have an AltiVec unit.
946 */
947_GLOBAL(giveup_altivec)
948 blr
949
950#ifdef CONFIG_SPE
951/*
952 * extern void giveup_spe(struct task_struct *prev)
953 *
954 */
955_GLOBAL(giveup_spe)
956 mfmsr r5
957 oris r5,r5,MSR_SPE@h
958 SYNC
959 mtmsr r5 /* enable use of SPE now */
960 isync
961 cmpi 0,r3,0
962 beqlr- /* if no previous owner, done */
963 addi r3,r3,THREAD /* want THREAD of task */
964 lwz r5,PT_REGS(r3)
965 cmpi 0,r5,0
966 SAVE_32EVRS(0, r4, r3)
967 evxor evr6, evr6, evr6 /* clear out evr6 */
968 evmwumiaa evr6, evr6, evr6 /* evr6 <- ACC = 0 * 0 + ACC */
969 li r4,THREAD_ACC
970 evstddx evr6, r4, r3 /* save off accumulator */
971 mfspr r6,SPRN_SPEFSCR
972 stw r6,THREAD_SPEFSCR(r3) /* save spefscr register value */
973 beq 1f
974 lwz r4,_MSR-STACK_FRAME_OVERHEAD(r5)
975 lis r3,MSR_SPE@h
976 andc r4,r4,r3 /* disable SPE for previous task */
977 stw r4,_MSR-STACK_FRAME_OVERHEAD(r5)
9781:
979#ifndef CONFIG_SMP
980 li r5,0
981 lis r4,last_task_used_spe@ha
982 stw r5,last_task_used_spe@l(r4)
983#endif /* CONFIG_SMP */
984 blr
985#endif /* CONFIG_SPE */
986
987/*
988 * extern void giveup_fpu(struct task_struct *prev)
989 *
990 * Not all FSL Book-E cores have an FPU
991 */
992#ifndef CONFIG_PPC_FPU
993_GLOBAL(giveup_fpu)
994 blr
995#endif
996
997/*
998 * extern void abort(void)
999 *
1000 * At present, this routine just applies a system reset.
1001 */
1002_GLOBAL(abort)
1003 li r13,0
1004 mtspr SPRN_DBCR0,r13 /* disable all debug events */
1005 mfmsr r13
1006 ori r13,r13,MSR_DE@l /* Enable Debug Events */
1007 mtmsr r13
1008 mfspr r13,SPRN_DBCR0
1009 lis r13,(DBCR0_IDM|DBCR0_RST_CHIP)@h
1010 mtspr SPRN_DBCR0,r13
1011
1012_GLOBAL(set_context)
1013
1014#ifdef CONFIG_BDI_SWITCH
1015 /* Context switch the PTE pointer for the Abatron BDI2000.
1016 * The PGDIR is the second parameter.
1017 */
1018 lis r5, abatron_pteptrs@h
1019 ori r5, r5, abatron_pteptrs@l
1020 stw r4, 0x4(r5)
1021#endif
1022 mtspr SPRN_PID,r3
1023 isync /* Force context change */
1024 blr
1025
1026/*
1027 * We put a few things here that have to be page-aligned. This stuff
1028 * goes at the beginning of the data segment, which is page-aligned.
1029 */
1030 .data
1031 .align 12
1032 .globl sdata
1033sdata:
1034 .globl empty_zero_page
1035empty_zero_page:
1036 .space 4096
1037 .globl swapper_pg_dir
1038swapper_pg_dir:
1039 .space 4096
1040
1041/* Reserved 4k for the critical exception stack & 4k for the machine
1042 * check stack per CPU for kernel mode exceptions */
1043 .section .bss
1044 .align 12
1045exception_stack_bottom:
1046 .space BOOKE_EXCEPTION_STACK_SIZE * NR_CPUS
1047 .globl exception_stack_top
1048exception_stack_top:
1049
1050/*
1051 * This space gets a copy of optional info passed to us by the bootstrap
1052 * which is used to pass parameters into the kernel like root=/dev/sda1, etc.
1053 */
1054 .globl cmd_line
1055cmd_line:
1056 .space 512
1057
1058/*
1059 * Room for two PTE pointers, usually the kernel and current user pointers
1060 * to their respective root page table.
1061 */
1062abatron_pteptrs:
1063 .space 8
diff --git a/arch/powerpc/kernel/idle_6xx.S b/arch/powerpc/kernel/idle_6xx.S
new file mode 100644
index 000000000000..444fdcc769f1
--- /dev/null
+++ b/arch/powerpc/kernel/idle_6xx.S
@@ -0,0 +1,233 @@
1/*
2 * This file contains the power_save function for 6xx & 7xxx CPUs
3 * rewritten in assembler
4 *
5 * Warning ! This code assumes that if your machine has a 750fx
6 * it will have PLL 1 set to low speed mode (used during NAP/DOZE).
7 * if this is not the case some additional changes will have to
8 * be done to check a runtime var (a bit like powersave-nap)
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
14 */
15
16#include <linux/config.h>
17#include <linux/threads.h>
18#include <asm/reg.h>
19#include <asm/page.h>
20#include <asm/cputable.h>
21#include <asm/thread_info.h>
22#include <asm/ppc_asm.h>
23#include <asm/asm-offsets.h>
24
25#undef DEBUG
26
27 .text
28
29/*
30 * Init idle, called at early CPU setup time from head.S for each CPU
31 * Make sure no rest of NAP mode remains in HID0, save default
32 * values for some CPU specific registers. Called with r24
33 * containing CPU number and r3 reloc offset
34 */
35_GLOBAL(init_idle_6xx)
36BEGIN_FTR_SECTION
37 mfspr r4,SPRN_HID0
38 rlwinm r4,r4,0,10,8 /* Clear NAP */
39 mtspr SPRN_HID0, r4
40 b 1f
41END_FTR_SECTION_IFSET(CPU_FTR_CAN_NAP)
42 blr
431:
44 slwi r5,r24,2
45 add r5,r5,r3
46BEGIN_FTR_SECTION
47 mfspr r4,SPRN_MSSCR0
48 addis r6,r5, nap_save_msscr0@ha
49 stw r4,nap_save_msscr0@l(r6)
50END_FTR_SECTION_IFSET(CPU_FTR_NAP_DISABLE_L2_PR)
51BEGIN_FTR_SECTION
52 mfspr r4,SPRN_HID1
53 addis r6,r5,nap_save_hid1@ha
54 stw r4,nap_save_hid1@l(r6)
55END_FTR_SECTION_IFSET(CPU_FTR_DUAL_PLL_750FX)
56 blr
57
58/*
59 * Here is the power_save_6xx function. This could eventually be
60 * split into several functions & changing the function pointer
61 * depending on the various features.
62 */
63_GLOBAL(ppc6xx_idle)
64 /* Check if we can nap or doze, put HID0 mask in r3
65 */
66 lis r3, 0
67BEGIN_FTR_SECTION
68 lis r3,HID0_DOZE@h
69END_FTR_SECTION_IFSET(CPU_FTR_CAN_DOZE)
70BEGIN_FTR_SECTION
71 /* We must dynamically check for the NAP feature as it
72 * can be cleared by CPU init after the fixups are done
73 */
74 lis r4,cur_cpu_spec@ha
75 lwz r4,cur_cpu_spec@l(r4)
76 lwz r4,CPU_SPEC_FEATURES(r4)
77 andi. r0,r4,CPU_FTR_CAN_NAP
78 beq 1f
79 /* Now check if user or arch enabled NAP mode */
80 lis r4,powersave_nap@ha
81 lwz r4,powersave_nap@l(r4)
82 cmpwi 0,r4,0
83 beq 1f
84 lis r3,HID0_NAP@h
851:
86END_FTR_SECTION_IFSET(CPU_FTR_CAN_NAP)
87 cmpwi 0,r3,0
88 beqlr
89
90 /* Clear MSR:EE */
91 mfmsr r7
92 rlwinm r0,r7,0,17,15
93 mtmsr r0
94
95 /* Check current_thread_info()->flags */
96 rlwinm r4,r1,0,0,18
97 lwz r4,TI_FLAGS(r4)
98 andi. r0,r4,_TIF_NEED_RESCHED
99 beq 1f
100 mtmsr r7 /* out of line this ? */
101 blr
1021:
103 /* Some pre-nap cleanups needed on some CPUs */
104 andis. r0,r3,HID0_NAP@h
105 beq 2f
106BEGIN_FTR_SECTION
107 /* Disable L2 prefetch on some 745x and try to ensure
108 * L2 prefetch engines are idle. As explained by errata
109 * text, we can't be sure they are, we just hope very hard
110 * that well be enough (sic !). At least I noticed Apple
111 * doesn't even bother doing the dcbf's here...
112 */
113 mfspr r4,SPRN_MSSCR0
114 rlwinm r4,r4,0,0,29
115 sync
116 mtspr SPRN_MSSCR0,r4
117 sync
118 isync
119 lis r4,KERNELBASE@h
120 dcbf 0,r4
121 dcbf 0,r4
122 dcbf 0,r4
123 dcbf 0,r4
124END_FTR_SECTION_IFSET(CPU_FTR_NAP_DISABLE_L2_PR)
125#ifdef DEBUG
126 lis r6,nap_enter_count@ha
127 lwz r4,nap_enter_count@l(r6)
128 addi r4,r4,1
129 stw r4,nap_enter_count@l(r6)
130#endif
1312:
132BEGIN_FTR_SECTION
133 /* Go to low speed mode on some 750FX */
134 lis r4,powersave_lowspeed@ha
135 lwz r4,powersave_lowspeed@l(r4)
136 cmpwi 0,r4,0
137 beq 1f
138 mfspr r4,SPRN_HID1
139 oris r4,r4,0x0001
140 mtspr SPRN_HID1,r4
1411:
142END_FTR_SECTION_IFSET(CPU_FTR_DUAL_PLL_750FX)
143
144 /* Go to NAP or DOZE now */
145 mfspr r4,SPRN_HID0
146 lis r5,(HID0_NAP|HID0_SLEEP)@h
147BEGIN_FTR_SECTION
148 oris r5,r5,HID0_DOZE@h
149END_FTR_SECTION_IFSET(CPU_FTR_CAN_DOZE)
150 andc r4,r4,r5
151 or r4,r4,r3
152BEGIN_FTR_SECTION
153 oris r4,r4,HID0_DPM@h /* that should be done once for all */
154END_FTR_SECTION_IFCLR(CPU_FTR_NO_DPM)
155 mtspr SPRN_HID0,r4
156BEGIN_FTR_SECTION
157 DSSALL
158 sync
159END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
160 ori r7,r7,MSR_EE /* Could be ommited (already set) */
161 oris r7,r7,MSR_POW@h
162 sync
163 isync
164 mtmsr r7
165 isync
166 sync
167 blr
168
169/*
170 * Return from NAP/DOZE mode, restore some CPU specific registers,
171 * we are called with DR/IR still off and r2 containing physical
172 * address of current.
173 */
174_GLOBAL(power_save_6xx_restore)
175 mfspr r11,SPRN_HID0
176 rlwinm. r11,r11,0,10,8 /* Clear NAP & copy NAP bit !state to cr1 EQ */
177 cror 4*cr1+eq,4*cr0+eq,4*cr0+eq
178BEGIN_FTR_SECTION
179 rlwinm r11,r11,0,9,7 /* Clear DOZE */
180END_FTR_SECTION_IFSET(CPU_FTR_CAN_DOZE)
181 mtspr SPRN_HID0, r11
182
183#ifdef DEBUG
184 beq cr1,1f
185 lis r11,(nap_return_count-KERNELBASE)@ha
186 lwz r9,nap_return_count@l(r11)
187 addi r9,r9,1
188 stw r9,nap_return_count@l(r11)
1891:
190#endif
191
192 rlwinm r9,r1,0,0,18
193 tophys(r9,r9)
194 lwz r11,TI_CPU(r9)
195 slwi r11,r11,2
196 /* Todo make sure all these are in the same page
197 * and load r22 (@ha part + CPU offset) only once
198 */
199BEGIN_FTR_SECTION
200 beq cr1,1f
201 addis r9,r11,(nap_save_msscr0-KERNELBASE)@ha
202 lwz r9,nap_save_msscr0@l(r9)
203 mtspr SPRN_MSSCR0, r9
204 sync
205 isync
2061:
207END_FTR_SECTION_IFSET(CPU_FTR_NAP_DISABLE_L2_PR)
208BEGIN_FTR_SECTION
209 addis r9,r11,(nap_save_hid1-KERNELBASE)@ha
210 lwz r9,nap_save_hid1@l(r9)
211 mtspr SPRN_HID1, r9
212END_FTR_SECTION_IFSET(CPU_FTR_DUAL_PLL_750FX)
213 b transfer_to_handler_cont
214
215 .data
216
217_GLOBAL(nap_save_msscr0)
218 .space 4*NR_CPUS
219
220_GLOBAL(nap_save_hid1)
221 .space 4*NR_CPUS
222
223_GLOBAL(powersave_nap)
224 .long 0
225_GLOBAL(powersave_lowspeed)
226 .long 0
227
228#ifdef DEBUG
229_GLOBAL(nap_enter_count)
230 .space 4
231_GLOBAL(nap_return_count)
232 .space 4
233#endif
diff --git a/arch/ppc64/kernel/idle_power4.S b/arch/powerpc/kernel/idle_power4.S
index ca02afe2a795..1494e2f177f7 100644
--- a/arch/ppc64/kernel/idle_power4.S
+++ b/arch/powerpc/kernel/idle_power4.S
@@ -39,13 +39,13 @@ END_FTR_SECTION_IFCLR(CPU_FTR_CAN_NAP)
39 * can be cleared by CPU init after the fixups are done 39 * can be cleared by CPU init after the fixups are done
40 */ 40 */
41 LOADBASE(r3,cur_cpu_spec) 41 LOADBASE(r3,cur_cpu_spec)
42 ld r4,cur_cpu_spec@l(r3) 42 ld r4,OFF(cur_cpu_spec)(r3)
43 ld r4,CPU_SPEC_FEATURES(r4) 43 ld r4,CPU_SPEC_FEATURES(r4)
44 andi. r0,r4,CPU_FTR_CAN_NAP 44 andi. r0,r4,CPU_FTR_CAN_NAP
45 beqlr 45 beqlr
46 /* Now check if user or arch enabled NAP mode */ 46 /* Now check if user or arch enabled NAP mode */
47 LOADBASE(r3,powersave_nap) 47 LOADBASE(r3,powersave_nap)
48 lwz r4,powersave_nap@l(r3) 48 lwz r4,OFF(powersave_nap)(r3)
49 cmpwi 0,r4,0 49 cmpwi 0,r4,0
50 beqlr 50 beqlr
51 51
@@ -63,8 +63,8 @@ END_FTR_SECTION_IFCLR(CPU_FTR_CAN_NAP)
63 beq 1f 63 beq 1f
64 mtmsrd r7 /* out of line this ? */ 64 mtmsrd r7 /* out of line this ? */
65 blr 65 blr
661: 661:
67 /* Go to NAP now */ 67 /* Go to NAP now */
68BEGIN_FTR_SECTION 68BEGIN_FTR_SECTION
69 DSSALL 69 DSSALL
70 sync 70 sync
@@ -76,4 +76,3 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
76 isync 76 isync
77 sync 77 sync
78 blr 78 blr
79
diff --git a/arch/ppc64/kernel/init_task.c b/arch/powerpc/kernel/init_task.c
index 941043ae040f..941043ae040f 100644
--- a/arch/ppc64/kernel/init_task.c
+++ b/arch/powerpc/kernel/init_task.c
diff --git a/arch/ppc64/kernel/lparmap.c b/arch/powerpc/kernel/lparmap.c
index b81de286df5e..b81de286df5e 100644
--- a/arch/ppc64/kernel/lparmap.c
+++ b/arch/powerpc/kernel/lparmap.c
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S
new file mode 100644
index 000000000000..3bedb532aed9
--- /dev/null
+++ b/arch/powerpc/kernel/misc_32.S
@@ -0,0 +1,1037 @@
1/*
2 * This file contains miscellaneous low-level functions.
3 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
4 *
5 * Largely rewritten by Cort Dougan (cort@cs.nmt.edu)
6 * and Paul Mackerras.
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; either version
11 * 2 of the License, or (at your option) any later version.
12 *
13 */
14
15#include <linux/config.h>
16#include <linux/sys.h>
17#include <asm/unistd.h>
18#include <asm/errno.h>
19#include <asm/reg.h>
20#include <asm/page.h>
21#include <asm/cache.h>
22#include <asm/cputable.h>
23#include <asm/mmu.h>
24#include <asm/ppc_asm.h>
25#include <asm/thread_info.h>
26#include <asm/asm-offsets.h>
27
28 .text
29
30 .align 5
31_GLOBAL(__delay)
32 cmpwi 0,r3,0
33 mtctr r3
34 beqlr
351: bdnz 1b
36 blr
37
38/*
39 * This returns the high 64 bits of the product of two 64-bit numbers.
40 */
41_GLOBAL(mulhdu)
42 cmpwi r6,0
43 cmpwi cr1,r3,0
44 mr r10,r4
45 mulhwu r4,r4,r5
46 beq 1f
47 mulhwu r0,r10,r6
48 mullw r7,r10,r5
49 addc r7,r0,r7
50 addze r4,r4
511: beqlr cr1 /* all done if high part of A is 0 */
52 mr r10,r3
53 mullw r9,r3,r5
54 mulhwu r3,r3,r5
55 beq 2f
56 mullw r0,r10,r6
57 mulhwu r8,r10,r6
58 addc r7,r0,r7
59 adde r4,r4,r8
60 addze r3,r3
612: addc r4,r4,r9
62 addze r3,r3
63 blr
64
65/*
66 * Returns (address we're running at) - (address we were linked at)
67 * for use before the text and data are mapped to KERNELBASE.
68 */
69_GLOBAL(reloc_offset)
70 mflr r0
71 bl 1f
721: mflr r3
73 LOADADDR(r4,1b)
74 subf r3,r4,r3
75 mtlr r0
76 blr
77
78/*
79 * add_reloc_offset(x) returns x + reloc_offset().
80 */
81_GLOBAL(add_reloc_offset)
82 mflr r0
83 bl 1f
841: mflr r5
85 LOADADDR(r4,1b)
86 subf r5,r4,r5
87 add r3,r3,r5
88 mtlr r0
89 blr
90
91/*
92 * sub_reloc_offset(x) returns x - reloc_offset().
93 */
94_GLOBAL(sub_reloc_offset)
95 mflr r0
96 bl 1f
971: mflr r5
98 lis r4,1b@ha
99 addi r4,r4,1b@l
100 subf r5,r4,r5
101 subf r3,r5,r3
102 mtlr r0
103 blr
104
105/*
106 * reloc_got2 runs through the .got2 section adding an offset
107 * to each entry.
108 */
109_GLOBAL(reloc_got2)
110 mflr r11
111 lis r7,__got2_start@ha
112 addi r7,r7,__got2_start@l
113 lis r8,__got2_end@ha
114 addi r8,r8,__got2_end@l
115 subf r8,r7,r8
116 srwi. r8,r8,2
117 beqlr
118 mtctr r8
119 bl 1f
1201: mflr r0
121 lis r4,1b@ha
122 addi r4,r4,1b@l
123 subf r0,r4,r0
124 add r7,r0,r7
1252: lwz r0,0(r7)
126 add r0,r0,r3
127 stw r0,0(r7)
128 addi r7,r7,4
129 bdnz 2b
130 mtlr r11
131 blr
132
133/*
134 * identify_cpu,
135 * called with r3 = data offset and r4 = CPU number
136 * doesn't change r3
137 */
138_GLOBAL(identify_cpu)
139 addis r8,r3,cpu_specs@ha
140 addi r8,r8,cpu_specs@l
141 mfpvr r7
1421:
143 lwz r5,CPU_SPEC_PVR_MASK(r8)
144 and r5,r5,r7
145 lwz r6,CPU_SPEC_PVR_VALUE(r8)
146 cmplw 0,r6,r5
147 beq 1f
148 addi r8,r8,CPU_SPEC_ENTRY_SIZE
149 b 1b
1501:
151 addis r6,r3,cur_cpu_spec@ha
152 addi r6,r6,cur_cpu_spec@l
153 sub r8,r8,r3
154 stw r8,0(r6)
155 blr
156
157/*
158 * do_cpu_ftr_fixups - goes through the list of CPU feature fixups
159 * and writes nop's over sections of code that don't apply for this cpu.
160 * r3 = data offset (not changed)
161 */
162_GLOBAL(do_cpu_ftr_fixups)
163 /* Get CPU 0 features */
164 addis r6,r3,cur_cpu_spec@ha
165 addi r6,r6,cur_cpu_spec@l
166 lwz r4,0(r6)
167 add r4,r4,r3
168 lwz r4,CPU_SPEC_FEATURES(r4)
169
170 /* Get the fixup table */
171 addis r6,r3,__start___ftr_fixup@ha
172 addi r6,r6,__start___ftr_fixup@l
173 addis r7,r3,__stop___ftr_fixup@ha
174 addi r7,r7,__stop___ftr_fixup@l
175
176 /* Do the fixup */
1771: cmplw 0,r6,r7
178 bgelr
179 addi r6,r6,16
180 lwz r8,-16(r6) /* mask */
181 and r8,r8,r4
182 lwz r9,-12(r6) /* value */
183 cmplw 0,r8,r9
184 beq 1b
185 lwz r8,-8(r6) /* section begin */
186 lwz r9,-4(r6) /* section end */
187 subf. r9,r8,r9
188 beq 1b
189 /* write nops over the section of code */
190 /* todo: if large section, add a branch at the start of it */
191 srwi r9,r9,2
192 mtctr r9
193 add r8,r8,r3
194 lis r0,0x60000000@h /* nop */
1953: stw r0,0(r8)
196 andi. r10,r4,CPU_FTR_SPLIT_ID_CACHE@l
197 beq 2f
198 dcbst 0,r8 /* suboptimal, but simpler */
199 sync
200 icbi 0,r8
2012: addi r8,r8,4
202 bdnz 3b
203 sync /* additional sync needed on g4 */
204 isync
205 b 1b
206
207/*
208 * call_setup_cpu - call the setup_cpu function for this cpu
209 * r3 = data offset, r24 = cpu number
210 *
211 * Setup function is called with:
212 * r3 = data offset
213 * r4 = ptr to CPU spec (relocated)
214 */
215_GLOBAL(call_setup_cpu)
216 addis r4,r3,cur_cpu_spec@ha
217 addi r4,r4,cur_cpu_spec@l
218 lwz r4,0(r4)
219 add r4,r4,r3
220 lwz r5,CPU_SPEC_SETUP(r4)
221 cmpi 0,r5,0
222 add r5,r5,r3
223 beqlr
224 mtctr r5
225 bctr
226
227#if defined(CONFIG_CPU_FREQ_PMAC) && defined(CONFIG_6xx)
228
229/* This gets called by via-pmu.c to switch the PLL selection
230 * on 750fx CPU. This function should really be moved to some
231 * other place (as most of the cpufreq code in via-pmu
232 */
233_GLOBAL(low_choose_750fx_pll)
234 /* Clear MSR:EE */
235 mfmsr r7
236 rlwinm r0,r7,0,17,15
237 mtmsr r0
238
239 /* If switching to PLL1, disable HID0:BTIC */
240 cmplwi cr0,r3,0
241 beq 1f
242 mfspr r5,SPRN_HID0
243 rlwinm r5,r5,0,27,25
244 sync
245 mtspr SPRN_HID0,r5
246 isync
247 sync
248
2491:
250 /* Calc new HID1 value */
251 mfspr r4,SPRN_HID1 /* Build a HID1:PS bit from parameter */
252 rlwinm r5,r3,16,15,15 /* Clear out HID1:PS from value read */
253 rlwinm r4,r4,0,16,14 /* Could have I used rlwimi here ? */
254 or r4,r4,r5
255 mtspr SPRN_HID1,r4
256
257 /* Store new HID1 image */
258 rlwinm r6,r1,0,0,18
259 lwz r6,TI_CPU(r6)
260 slwi r6,r6,2
261 addis r6,r6,nap_save_hid1@ha
262 stw r4,nap_save_hid1@l(r6)
263
264 /* If switching to PLL0, enable HID0:BTIC */
265 cmplwi cr0,r3,0
266 bne 1f
267 mfspr r5,SPRN_HID0
268 ori r5,r5,HID0_BTIC
269 sync
270 mtspr SPRN_HID0,r5
271 isync
272 sync
273
2741:
275 /* Return */
276 mtmsr r7
277 blr
278
279_GLOBAL(low_choose_7447a_dfs)
280 /* Clear MSR:EE */
281 mfmsr r7
282 rlwinm r0,r7,0,17,15
283 mtmsr r0
284
285 /* Calc new HID1 value */
286 mfspr r4,SPRN_HID1
287 insrwi r4,r3,1,9 /* insert parameter into bit 9 */
288 sync
289 mtspr SPRN_HID1,r4
290 sync
291 isync
292
293 /* Return */
294 mtmsr r7
295 blr
296
297#endif /* CONFIG_CPU_FREQ_PMAC && CONFIG_6xx */
298
299/*
300 * complement mask on the msr then "or" some values on.
301 * _nmask_and_or_msr(nmask, value_to_or)
302 */
303_GLOBAL(_nmask_and_or_msr)
304 mfmsr r0 /* Get current msr */
305 andc r0,r0,r3 /* And off the bits set in r3 (first parm) */
306 or r0,r0,r4 /* Or on the bits in r4 (second parm) */
307 SYNC /* Some chip revs have problems here... */
308 mtmsr r0 /* Update machine state */
309 isync
310 blr /* Done */
311
312
313/*
314 * Flush MMU TLB
315 */
316_GLOBAL(_tlbia)
317#if defined(CONFIG_40x)
318 sync /* Flush to memory before changing mapping */
319 tlbia
320 isync /* Flush shadow TLB */
321#elif defined(CONFIG_44x)
322 li r3,0
323 sync
324
325 /* Load high watermark */
326 lis r4,tlb_44x_hwater@ha
327 lwz r5,tlb_44x_hwater@l(r4)
328
3291: tlbwe r3,r3,PPC44x_TLB_PAGEID
330 addi r3,r3,1
331 cmpw 0,r3,r5
332 ble 1b
333
334 isync
335#elif defined(CONFIG_FSL_BOOKE)
336 /* Invalidate all entries in TLB0 */
337 li r3, 0x04
338 tlbivax 0,3
339 /* Invalidate all entries in TLB1 */
340 li r3, 0x0c
341 tlbivax 0,3
342 /* Invalidate all entries in TLB2 */
343 li r3, 0x14
344 tlbivax 0,3
345 /* Invalidate all entries in TLB3 */
346 li r3, 0x1c
347 tlbivax 0,3
348 msync
349#ifdef CONFIG_SMP
350 tlbsync
351#endif /* CONFIG_SMP */
352#else /* !(CONFIG_40x || CONFIG_44x || CONFIG_FSL_BOOKE) */
353#if defined(CONFIG_SMP)
354 rlwinm r8,r1,0,0,18
355 lwz r8,TI_CPU(r8)
356 oris r8,r8,10
357 mfmsr r10
358 SYNC
359 rlwinm r0,r10,0,17,15 /* clear bit 16 (MSR_EE) */
360 rlwinm r0,r0,0,28,26 /* clear DR */
361 mtmsr r0
362 SYNC_601
363 isync
364 lis r9,mmu_hash_lock@h
365 ori r9,r9,mmu_hash_lock@l
366 tophys(r9,r9)
36710: lwarx r7,0,r9
368 cmpwi 0,r7,0
369 bne- 10b
370 stwcx. r8,0,r9
371 bne- 10b
372 sync
373 tlbia
374 sync
375 TLBSYNC
376 li r0,0
377 stw r0,0(r9) /* clear mmu_hash_lock */
378 mtmsr r10
379 SYNC_601
380 isync
381#else /* CONFIG_SMP */
382 sync
383 tlbia
384 sync
385#endif /* CONFIG_SMP */
386#endif /* ! defined(CONFIG_40x) */
387 blr
388
389/*
390 * Flush MMU TLB for a particular address
391 */
392_GLOBAL(_tlbie)
393#if defined(CONFIG_40x)
394 tlbsx. r3, 0, r3
395 bne 10f
396 sync
397 /* There are only 64 TLB entries, so r3 < 64, which means bit 25 is clear.
398 * Since 25 is the V bit in the TLB_TAG, loading this value will invalidate
399 * the TLB entry. */
400 tlbwe r3, r3, TLB_TAG
401 isync
40210:
403#elif defined(CONFIG_44x)
404 mfspr r4,SPRN_MMUCR
405 mfspr r5,SPRN_PID /* Get PID */
406 rlwimi r4,r5,0,24,31 /* Set TID */
407 mtspr SPRN_MMUCR,r4
408
409 tlbsx. r3, 0, r3
410 bne 10f
411 sync
412 /* There are only 64 TLB entries, so r3 < 64,
413 * which means bit 22, is clear. Since 22 is
414 * the V bit in the TLB_PAGEID, loading this
415 * value will invalidate the TLB entry.
416 */
417 tlbwe r3, r3, PPC44x_TLB_PAGEID
418 isync
41910:
420#elif defined(CONFIG_FSL_BOOKE)
421 rlwinm r4, r3, 0, 0, 19
422 ori r5, r4, 0x08 /* TLBSEL = 1 */
423 ori r6, r4, 0x10 /* TLBSEL = 2 */
424 ori r7, r4, 0x18 /* TLBSEL = 3 */
425 tlbivax 0, r4
426 tlbivax 0, r5
427 tlbivax 0, r6
428 tlbivax 0, r7
429 msync
430#if defined(CONFIG_SMP)
431 tlbsync
432#endif /* CONFIG_SMP */
433#else /* !(CONFIG_40x || CONFIG_44x || CONFIG_FSL_BOOKE) */
434#if defined(CONFIG_SMP)
435 rlwinm r8,r1,0,0,18
436 lwz r8,TI_CPU(r8)
437 oris r8,r8,11
438 mfmsr r10
439 SYNC
440 rlwinm r0,r10,0,17,15 /* clear bit 16 (MSR_EE) */
441 rlwinm r0,r0,0,28,26 /* clear DR */
442 mtmsr r0
443 SYNC_601
444 isync
445 lis r9,mmu_hash_lock@h
446 ori r9,r9,mmu_hash_lock@l
447 tophys(r9,r9)
44810: lwarx r7,0,r9
449 cmpwi 0,r7,0
450 bne- 10b
451 stwcx. r8,0,r9
452 bne- 10b
453 eieio
454 tlbie r3
455 sync
456 TLBSYNC
457 li r0,0
458 stw r0,0(r9) /* clear mmu_hash_lock */
459 mtmsr r10
460 SYNC_601
461 isync
462#else /* CONFIG_SMP */
463 tlbie r3
464 sync
465#endif /* CONFIG_SMP */
466#endif /* ! CONFIG_40x */
467 blr
468
469/*
470 * Flush instruction cache.
471 * This is a no-op on the 601.
472 */
473_GLOBAL(flush_instruction_cache)
474#if defined(CONFIG_8xx)
475 isync
476 lis r5, IDC_INVALL@h
477 mtspr SPRN_IC_CST, r5
478#elif defined(CONFIG_4xx)
479#ifdef CONFIG_403GCX
480 li r3, 512
481 mtctr r3
482 lis r4, KERNELBASE@h
4831: iccci 0, r4
484 addi r4, r4, 16
485 bdnz 1b
486#else
487 lis r3, KERNELBASE@h
488 iccci 0,r3
489#endif
490#elif CONFIG_FSL_BOOKE
491BEGIN_FTR_SECTION
492 mfspr r3,SPRN_L1CSR0
493 ori r3,r3,L1CSR0_CFI|L1CSR0_CLFC
494 /* msync; isync recommended here */
495 mtspr SPRN_L1CSR0,r3
496 isync
497 blr
498END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE)
499 mfspr r3,SPRN_L1CSR1
500 ori r3,r3,L1CSR1_ICFI|L1CSR1_ICLFR
501 mtspr SPRN_L1CSR1,r3
502#else
503 mfspr r3,SPRN_PVR
504 rlwinm r3,r3,16,16,31
505 cmpwi 0,r3,1
506 beqlr /* for 601, do nothing */
507 /* 603/604 processor - use invalidate-all bit in HID0 */
508 mfspr r3,SPRN_HID0
509 ori r3,r3,HID0_ICFI
510 mtspr SPRN_HID0,r3
511#endif /* CONFIG_8xx/4xx */
512 isync
513 blr
514
515/*
516 * Write any modified data cache blocks out to memory
517 * and invalidate the corresponding instruction cache blocks.
518 * This is a no-op on the 601.
519 *
520 * flush_icache_range(unsigned long start, unsigned long stop)
521 */
522_GLOBAL(flush_icache_range)
523BEGIN_FTR_SECTION
524 blr /* for 601, do nothing */
525END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE)
526 li r5,L1_CACHE_BYTES-1
527 andc r3,r3,r5
528 subf r4,r3,r4
529 add r4,r4,r5
530 srwi. r4,r4,L1_CACHE_SHIFT
531 beqlr
532 mtctr r4
533 mr r6,r3
5341: dcbst 0,r3
535 addi r3,r3,L1_CACHE_BYTES
536 bdnz 1b
537 sync /* wait for dcbst's to get to ram */
538 mtctr r4
5392: icbi 0,r6
540 addi r6,r6,L1_CACHE_BYTES
541 bdnz 2b
542 sync /* additional sync needed on g4 */
543 isync
544 blr
545/*
546 * Write any modified data cache blocks out to memory.
547 * Does not invalidate the corresponding cache lines (especially for
548 * any corresponding instruction cache).
549 *
550 * clean_dcache_range(unsigned long start, unsigned long stop)
551 */
552_GLOBAL(clean_dcache_range)
553 li r5,L1_CACHE_BYTES-1
554 andc r3,r3,r5
555 subf r4,r3,r4
556 add r4,r4,r5
557 srwi. r4,r4,L1_CACHE_SHIFT
558 beqlr
559 mtctr r4
560
5611: dcbst 0,r3
562 addi r3,r3,L1_CACHE_BYTES
563 bdnz 1b
564 sync /* wait for dcbst's to get to ram */
565 blr
566
567/*
568 * Write any modified data cache blocks out to memory and invalidate them.
569 * Does not invalidate the corresponding instruction cache blocks.
570 *
571 * flush_dcache_range(unsigned long start, unsigned long stop)
572 */
573_GLOBAL(flush_dcache_range)
574 li r5,L1_CACHE_BYTES-1
575 andc r3,r3,r5
576 subf r4,r3,r4
577 add r4,r4,r5
578 srwi. r4,r4,L1_CACHE_SHIFT
579 beqlr
580 mtctr r4
581
5821: dcbf 0,r3
583 addi r3,r3,L1_CACHE_BYTES
584 bdnz 1b
585 sync /* wait for dcbst's to get to ram */
586 blr
587
588/*
589 * Like above, but invalidate the D-cache. This is used by the 8xx
590 * to invalidate the cache so the PPC core doesn't get stale data
591 * from the CPM (no cache snooping here :-).
592 *
593 * invalidate_dcache_range(unsigned long start, unsigned long stop)
594 */
595_GLOBAL(invalidate_dcache_range)
596 li r5,L1_CACHE_BYTES-1
597 andc r3,r3,r5
598 subf r4,r3,r4
599 add r4,r4,r5
600 srwi. r4,r4,L1_CACHE_SHIFT
601 beqlr
602 mtctr r4
603
6041: dcbi 0,r3
605 addi r3,r3,L1_CACHE_BYTES
606 bdnz 1b
607 sync /* wait for dcbi's to get to ram */
608 blr
609
610#ifdef CONFIG_NOT_COHERENT_CACHE
611/*
612 * 40x cores have 8K or 16K dcache and 32 byte line size.
613 * 44x has a 32K dcache and 32 byte line size.
614 * 8xx has 1, 2, 4, 8K variants.
615 * For now, cover the worst case of the 44x.
616 * Must be called with external interrupts disabled.
617 */
618#define CACHE_NWAYS 64
619#define CACHE_NLINES 16
620
621_GLOBAL(flush_dcache_all)
622 li r4, (2 * CACHE_NWAYS * CACHE_NLINES)
623 mtctr r4
624 lis r5, KERNELBASE@h
6251: lwz r3, 0(r5) /* Load one word from every line */
626 addi r5, r5, L1_CACHE_BYTES
627 bdnz 1b
628 blr
629#endif /* CONFIG_NOT_COHERENT_CACHE */
630
631/*
632 * Flush a particular page from the data cache to RAM.
633 * Note: this is necessary because the instruction cache does *not*
634 * snoop from the data cache.
635 * This is a no-op on the 601 which has a unified cache.
636 *
637 * void __flush_dcache_icache(void *page)
638 */
639_GLOBAL(__flush_dcache_icache)
640BEGIN_FTR_SECTION
641 blr /* for 601, do nothing */
642END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE)
643 rlwinm r3,r3,0,0,19 /* Get page base address */
644 li r4,4096/L1_CACHE_BYTES /* Number of lines in a page */
645 mtctr r4
646 mr r6,r3
6470: dcbst 0,r3 /* Write line to ram */
648 addi r3,r3,L1_CACHE_BYTES
649 bdnz 0b
650 sync
651 mtctr r4
6521: icbi 0,r6
653 addi r6,r6,L1_CACHE_BYTES
654 bdnz 1b
655 sync
656 isync
657 blr
658
659/*
660 * Flush a particular page from the data cache to RAM, identified
661 * by its physical address. We turn off the MMU so we can just use
662 * the physical address (this may be a highmem page without a kernel
663 * mapping).
664 *
665 * void __flush_dcache_icache_phys(unsigned long physaddr)
666 */
667_GLOBAL(__flush_dcache_icache_phys)
668BEGIN_FTR_SECTION
669 blr /* for 601, do nothing */
670END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE)
671 mfmsr r10
672 rlwinm r0,r10,0,28,26 /* clear DR */
673 mtmsr r0
674 isync
675 rlwinm r3,r3,0,0,19 /* Get page base address */
676 li r4,4096/L1_CACHE_BYTES /* Number of lines in a page */
677 mtctr r4
678 mr r6,r3
6790: dcbst 0,r3 /* Write line to ram */
680 addi r3,r3,L1_CACHE_BYTES
681 bdnz 0b
682 sync
683 mtctr r4
6841: icbi 0,r6
685 addi r6,r6,L1_CACHE_BYTES
686 bdnz 1b
687 sync
688 mtmsr r10 /* restore DR */
689 isync
690 blr
691
692/*
693 * Clear pages using the dcbz instruction, which doesn't cause any
694 * memory traffic (except to write out any cache lines which get
695 * displaced). This only works on cacheable memory.
696 *
697 * void clear_pages(void *page, int order) ;
698 */
699_GLOBAL(clear_pages)
700 li r0,4096/L1_CACHE_BYTES
701 slw r0,r0,r4
702 mtctr r0
703#ifdef CONFIG_8xx
704 li r4, 0
7051: stw r4, 0(r3)
706 stw r4, 4(r3)
707 stw r4, 8(r3)
708 stw r4, 12(r3)
709#else
7101: dcbz 0,r3
711#endif
712 addi r3,r3,L1_CACHE_BYTES
713 bdnz 1b
714 blr
715
716/*
717 * Copy a whole page. We use the dcbz instruction on the destination
718 * to reduce memory traffic (it eliminates the unnecessary reads of
719 * the destination into cache). This requires that the destination
720 * is cacheable.
721 */
722#define COPY_16_BYTES \
723 lwz r6,4(r4); \
724 lwz r7,8(r4); \
725 lwz r8,12(r4); \
726 lwzu r9,16(r4); \
727 stw r6,4(r3); \
728 stw r7,8(r3); \
729 stw r8,12(r3); \
730 stwu r9,16(r3)
731
732_GLOBAL(copy_page)
733 addi r3,r3,-4
734 addi r4,r4,-4
735
736#ifdef CONFIG_8xx
737 /* don't use prefetch on 8xx */
738 li r0,4096/L1_CACHE_BYTES
739 mtctr r0
7401: COPY_16_BYTES
741 bdnz 1b
742 blr
743
744#else /* not 8xx, we can prefetch */
745 li r5,4
746
747#if MAX_COPY_PREFETCH > 1
748 li r0,MAX_COPY_PREFETCH
749 li r11,4
750 mtctr r0
75111: dcbt r11,r4
752 addi r11,r11,L1_CACHE_BYTES
753 bdnz 11b
754#else /* MAX_COPY_PREFETCH == 1 */
755 dcbt r5,r4
756 li r11,L1_CACHE_BYTES+4
757#endif /* MAX_COPY_PREFETCH */
758 li r0,4096/L1_CACHE_BYTES - MAX_COPY_PREFETCH
759 crclr 4*cr0+eq
7602:
761 mtctr r0
7621:
763 dcbt r11,r4
764 dcbz r5,r3
765 COPY_16_BYTES
766#if L1_CACHE_BYTES >= 32
767 COPY_16_BYTES
768#if L1_CACHE_BYTES >= 64
769 COPY_16_BYTES
770 COPY_16_BYTES
771#if L1_CACHE_BYTES >= 128
772 COPY_16_BYTES
773 COPY_16_BYTES
774 COPY_16_BYTES
775 COPY_16_BYTES
776#endif
777#endif
778#endif
779 bdnz 1b
780 beqlr
781 crnot 4*cr0+eq,4*cr0+eq
782 li r0,MAX_COPY_PREFETCH
783 li r11,4
784 b 2b
785#endif /* CONFIG_8xx */
786
787/*
788 * void atomic_clear_mask(atomic_t mask, atomic_t *addr)
789 * void atomic_set_mask(atomic_t mask, atomic_t *addr);
790 */
791_GLOBAL(atomic_clear_mask)
79210: lwarx r5,0,r4
793 andc r5,r5,r3
794 PPC405_ERR77(0,r4)
795 stwcx. r5,0,r4
796 bne- 10b
797 blr
798_GLOBAL(atomic_set_mask)
79910: lwarx r5,0,r4
800 or r5,r5,r3
801 PPC405_ERR77(0,r4)
802 stwcx. r5,0,r4
803 bne- 10b
804 blr
805
806/*
807 * I/O string operations
808 *
809 * insb(port, buf, len)
810 * outsb(port, buf, len)
811 * insw(port, buf, len)
812 * outsw(port, buf, len)
813 * insl(port, buf, len)
814 * outsl(port, buf, len)
815 * insw_ns(port, buf, len)
816 * outsw_ns(port, buf, len)
817 * insl_ns(port, buf, len)
818 * outsl_ns(port, buf, len)
819 *
820 * The *_ns versions don't do byte-swapping.
821 */
822_GLOBAL(_insb)
823 cmpwi 0,r5,0
824 mtctr r5
825 subi r4,r4,1
826 blelr-
82700: lbz r5,0(r3)
828 eieio
829 stbu r5,1(r4)
830 bdnz 00b
831 blr
832
833_GLOBAL(_outsb)
834 cmpwi 0,r5,0
835 mtctr r5
836 subi r4,r4,1
837 blelr-
83800: lbzu r5,1(r4)
839 stb r5,0(r3)
840 eieio
841 bdnz 00b
842 blr
843
844_GLOBAL(_insw)
845 cmpwi 0,r5,0
846 mtctr r5
847 subi r4,r4,2
848 blelr-
84900: lhbrx r5,0,r3
850 eieio
851 sthu r5,2(r4)
852 bdnz 00b
853 blr
854
855_GLOBAL(_outsw)
856 cmpwi 0,r5,0
857 mtctr r5
858 subi r4,r4,2
859 blelr-
86000: lhzu r5,2(r4)
861 eieio
862 sthbrx r5,0,r3
863 bdnz 00b
864 blr
865
866_GLOBAL(_insl)
867 cmpwi 0,r5,0
868 mtctr r5
869 subi r4,r4,4
870 blelr-
87100: lwbrx r5,0,r3
872 eieio
873 stwu r5,4(r4)
874 bdnz 00b
875 blr
876
877_GLOBAL(_outsl)
878 cmpwi 0,r5,0
879 mtctr r5
880 subi r4,r4,4
881 blelr-
88200: lwzu r5,4(r4)
883 stwbrx r5,0,r3
884 eieio
885 bdnz 00b
886 blr
887
888_GLOBAL(__ide_mm_insw)
889_GLOBAL(_insw_ns)
890 cmpwi 0,r5,0
891 mtctr r5
892 subi r4,r4,2
893 blelr-
89400: lhz r5,0(r3)
895 eieio
896 sthu r5,2(r4)
897 bdnz 00b
898 blr
899
900_GLOBAL(__ide_mm_outsw)
901_GLOBAL(_outsw_ns)
902 cmpwi 0,r5,0
903 mtctr r5
904 subi r4,r4,2
905 blelr-
90600: lhzu r5,2(r4)
907 sth r5,0(r3)
908 eieio
909 bdnz 00b
910 blr
911
912_GLOBAL(__ide_mm_insl)
913_GLOBAL(_insl_ns)
914 cmpwi 0,r5,0
915 mtctr r5
916 subi r4,r4,4
917 blelr-
91800: lwz r5,0(r3)
919 eieio
920 stwu r5,4(r4)
921 bdnz 00b
922 blr
923
924_GLOBAL(__ide_mm_outsl)
925_GLOBAL(_outsl_ns)
926 cmpwi 0,r5,0
927 mtctr r5
928 subi r4,r4,4
929 blelr-
93000: lwzu r5,4(r4)
931 stw r5,0(r3)
932 eieio
933 bdnz 00b
934 blr
935
936/*
937 * Extended precision shifts.
938 *
939 * Updated to be valid for shift counts from 0 to 63 inclusive.
940 * -- Gabriel
941 *
942 * R3/R4 has 64 bit value
943 * R5 has shift count
944 * result in R3/R4
945 *
946 * ashrdi3: arithmetic right shift (sign propagation)
947 * lshrdi3: logical right shift
948 * ashldi3: left shift
949 */
950_GLOBAL(__ashrdi3)
951 subfic r6,r5,32
952 srw r4,r4,r5 # LSW = count > 31 ? 0 : LSW >> count
953 addi r7,r5,32 # could be xori, or addi with -32
954 slw r6,r3,r6 # t1 = count > 31 ? 0 : MSW << (32-count)
955 rlwinm r8,r7,0,32 # t3 = (count < 32) ? 32 : 0
956 sraw r7,r3,r7 # t2 = MSW >> (count-32)
957 or r4,r4,r6 # LSW |= t1
958 slw r7,r7,r8 # t2 = (count < 32) ? 0 : t2
959 sraw r3,r3,r5 # MSW = MSW >> count
960 or r4,r4,r7 # LSW |= t2
961 blr
962
963_GLOBAL(__ashldi3)
964 subfic r6,r5,32
965 slw r3,r3,r5 # MSW = count > 31 ? 0 : MSW << count
966 addi r7,r5,32 # could be xori, or addi with -32
967 srw r6,r4,r6 # t1 = count > 31 ? 0 : LSW >> (32-count)
968 slw r7,r4,r7 # t2 = count < 32 ? 0 : LSW << (count-32)
969 or r3,r3,r6 # MSW |= t1
970 slw r4,r4,r5 # LSW = LSW << count
971 or r3,r3,r7 # MSW |= t2
972 blr
973
974_GLOBAL(__lshrdi3)
975 subfic r6,r5,32
976 srw r4,r4,r5 # LSW = count > 31 ? 0 : LSW >> count
977 addi r7,r5,32 # could be xori, or addi with -32
978 slw r6,r3,r6 # t1 = count > 31 ? 0 : MSW << (32-count)
979 srw r7,r3,r7 # t2 = count < 32 ? 0 : MSW >> (count-32)
980 or r4,r4,r6 # LSW |= t1
981 srw r3,r3,r5 # MSW = MSW >> count
982 or r4,r4,r7 # LSW |= t2
983 blr
984
985_GLOBAL(abs)
986 srawi r4,r3,31
987 xor r3,r3,r4
988 sub r3,r3,r4
989 blr
990
991_GLOBAL(_get_SP)
992 mr r3,r1 /* Close enough */
993 blr
994
995/*
996 * Create a kernel thread
997 * kernel_thread(fn, arg, flags)
998 */
999_GLOBAL(kernel_thread)
1000 stwu r1,-16(r1)
1001 stw r30,8(r1)
1002 stw r31,12(r1)
1003 mr r30,r3 /* function */
1004 mr r31,r4 /* argument */
1005 ori r3,r5,CLONE_VM /* flags */
1006 oris r3,r3,CLONE_UNTRACED>>16
1007 li r4,0 /* new sp (unused) */
1008 li r0,__NR_clone
1009 sc
1010 cmpwi 0,r3,0 /* parent or child? */
1011 bne 1f /* return if parent */
1012 li r0,0 /* make top-level stack frame */
1013 stwu r0,-16(r1)
1014 mtlr r30 /* fn addr in lr */
1015 mr r3,r31 /* load arg and call fn */
1016 PPC440EP_ERR42
1017 blrl
1018 li r0,__NR_exit /* exit if function returns */
1019 li r3,0
1020 sc
10211: lwz r30,8(r1)
1022 lwz r31,12(r1)
1023 addi r1,r1,16
1024 blr
1025
1026_GLOBAL(execve)
1027 li r0,__NR_execve
1028 sc
1029 bnslr
1030 neg r3,r3
1031 blr
1032
1033/*
1034 * This routine is just here to keep GCC happy - sigh...
1035 */
1036_GLOBAL(__main)
1037 blr
diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S
new file mode 100644
index 000000000000..b3e95ff0dba0
--- /dev/null
+++ b/arch/powerpc/kernel/misc_64.S
@@ -0,0 +1,880 @@
1/*
2 * arch/powerpc/kernel/misc64.S
3 *
4 * This file contains miscellaneous low-level functions.
5 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
6 *
7 * Largely rewritten by Cort Dougan (cort@cs.nmt.edu)
8 * and Paul Mackerras.
9 * Adapted for iSeries by Mike Corrigan (mikejc@us.ibm.com)
10 * PPC64 updates by Dave Engebretsen (engebret@us.ibm.com)
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version
15 * 2 of the License, or (at your option) any later version.
16 *
17 */
18
19#include <linux/config.h>
20#include <linux/sys.h>
21#include <asm/unistd.h>
22#include <asm/errno.h>
23#include <asm/processor.h>
24#include <asm/page.h>
25#include <asm/cache.h>
26#include <asm/ppc_asm.h>
27#include <asm/asm-offsets.h>
28#include <asm/cputable.h>
29#include <asm/thread_info.h>
30
31 .text
32
33/*
34 * Returns (address we are running at) - (address we were linked at)
35 * for use before the text and data are mapped to KERNELBASE.
36 */
37
38_GLOBAL(reloc_offset)
39 mflr r0
40 bl 1f
411: mflr r3
42 LOADADDR(r4,1b)
43 subf r3,r4,r3
44 mtlr r0
45 blr
46
47/*
48 * add_reloc_offset(x) returns x + reloc_offset().
49 */
50_GLOBAL(add_reloc_offset)
51 mflr r0
52 bl 1f
531: mflr r5
54 LOADADDR(r4,1b)
55 subf r5,r4,r5
56 add r3,r3,r5
57 mtlr r0
58 blr
59
60_GLOBAL(get_msr)
61 mfmsr r3
62 blr
63
64_GLOBAL(get_dar)
65 mfdar r3
66 blr
67
68_GLOBAL(get_srr0)
69 mfsrr0 r3
70 blr
71
72_GLOBAL(get_srr1)
73 mfsrr1 r3
74 blr
75
76_GLOBAL(get_sp)
77 mr r3,r1
78 blr
79
80#ifdef CONFIG_IRQSTACKS
81_GLOBAL(call_do_softirq)
82 mflr r0
83 std r0,16(r1)
84 stdu r1,THREAD_SIZE-112(r3)
85 mr r1,r3
86 bl .__do_softirq
87 ld r1,0(r1)
88 ld r0,16(r1)
89 mtlr r0
90 blr
91
92_GLOBAL(call_handle_IRQ_event)
93 mflr r0
94 std r0,16(r1)
95 stdu r1,THREAD_SIZE-112(r6)
96 mr r1,r6
97 bl .handle_IRQ_event
98 ld r1,0(r1)
99 ld r0,16(r1)
100 mtlr r0
101 blr
102#endif /* CONFIG_IRQSTACKS */
103
104 /*
105 * To be called by C code which needs to do some operations with MMU
106 * disabled. Note that interrupts have to be disabled by the caller
107 * prior to calling us. The code called _MUST_ be in the RMO of course
108 * and part of the linear mapping as we don't attempt to translate the
109 * stack pointer at all. The function is called with the stack switched
110 * to this CPU emergency stack
111 *
112 * prototype is void *call_with_mmu_off(void *func, void *data);
113 *
114 * the called function is expected to be of the form
115 *
116 * void *called(void *data);
117 */
118_GLOBAL(call_with_mmu_off)
119 mflr r0 /* get link, save it on stackframe */
120 std r0,16(r1)
121 mr r1,r5 /* save old stack ptr */
122 ld r1,PACAEMERGSP(r13) /* get emerg. stack */
123 subi r1,r1,STACK_FRAME_OVERHEAD
124 std r0,16(r1) /* save link on emerg. stack */
125 std r5,0(r1) /* save old stack ptr in backchain */
126 ld r3,0(r3) /* get to real function ptr (assume same TOC) */
127 bl 2f /* we need LR to return, continue at label 2 */
128
129 ld r0,16(r1) /* we return here from the call, get LR and */
130 ld r1,0(r1) /* .. old stack ptr */
131 mtspr SPRN_SRR0,r0 /* and get back to virtual mode with these */
132 mfmsr r4
133 ori r4,r4,MSR_IR|MSR_DR
134 mtspr SPRN_SRR1,r4
135 rfid
136
1372: mtspr SPRN_SRR0,r3 /* coming from above, enter real mode */
138 mr r3,r4 /* get parameter */
139 mfmsr r0
140 ori r0,r0,MSR_IR|MSR_DR
141 xori r0,r0,MSR_IR|MSR_DR
142 mtspr SPRN_SRR1,r0
143 rfid
144
145
146 .section ".toc","aw"
147PPC64_CACHES:
148 .tc ppc64_caches[TC],ppc64_caches
149 .section ".text"
150
151/*
152 * Write any modified data cache blocks out to memory
153 * and invalidate the corresponding instruction cache blocks.
154 *
155 * flush_icache_range(unsigned long start, unsigned long stop)
156 *
157 * flush all bytes from start through stop-1 inclusive
158 */
159
160_KPROBE(__flush_icache_range)
161
162/*
163 * Flush the data cache to memory
164 *
165 * Different systems have different cache line sizes
166 * and in some cases i-cache and d-cache line sizes differ from
167 * each other.
168 */
169 ld r10,PPC64_CACHES@toc(r2)
170 lwz r7,DCACHEL1LINESIZE(r10)/* Get cache line size */
171 addi r5,r7,-1
172 andc r6,r3,r5 /* round low to line bdy */
173 subf r8,r6,r4 /* compute length */
174 add r8,r8,r5 /* ensure we get enough */
175 lwz r9,DCACHEL1LOGLINESIZE(r10) /* Get log-2 of cache line size */
176 srw. r8,r8,r9 /* compute line count */
177 beqlr /* nothing to do? */
178 mtctr r8
1791: dcbst 0,r6
180 add r6,r6,r7
181 bdnz 1b
182 sync
183
184/* Now invalidate the instruction cache */
185
186 lwz r7,ICACHEL1LINESIZE(r10) /* Get Icache line size */
187 addi r5,r7,-1
188 andc r6,r3,r5 /* round low to line bdy */
189 subf r8,r6,r4 /* compute length */
190 add r8,r8,r5
191 lwz r9,ICACHEL1LOGLINESIZE(r10) /* Get log-2 of Icache line size */
192 srw. r8,r8,r9 /* compute line count */
193 beqlr /* nothing to do? */
194 mtctr r8
1952: icbi 0,r6
196 add r6,r6,r7
197 bdnz 2b
198 isync
199 blr
200 .previous .text
201/*
202 * Like above, but only do the D-cache.
203 *
204 * flush_dcache_range(unsigned long start, unsigned long stop)
205 *
206 * flush all bytes from start to stop-1 inclusive
207 */
208_GLOBAL(flush_dcache_range)
209
210/*
211 * Flush the data cache to memory
212 *
213 * Different systems have different cache line sizes
214 */
215 ld r10,PPC64_CACHES@toc(r2)
216 lwz r7,DCACHEL1LINESIZE(r10) /* Get dcache line size */
217 addi r5,r7,-1
218 andc r6,r3,r5 /* round low to line bdy */
219 subf r8,r6,r4 /* compute length */
220 add r8,r8,r5 /* ensure we get enough */
221 lwz r9,DCACHEL1LOGLINESIZE(r10) /* Get log-2 of dcache line size */
222 srw. r8,r8,r9 /* compute line count */
223 beqlr /* nothing to do? */
224 mtctr r8
2250: dcbst 0,r6
226 add r6,r6,r7
227 bdnz 0b
228 sync
229 blr
230
231/*
232 * Like above, but works on non-mapped physical addresses.
233 * Use only for non-LPAR setups ! It also assumes real mode
234 * is cacheable. Used for flushing out the DART before using
235 * it as uncacheable memory
236 *
237 * flush_dcache_phys_range(unsigned long start, unsigned long stop)
238 *
239 * flush all bytes from start to stop-1 inclusive
240 */
241_GLOBAL(flush_dcache_phys_range)
242 ld r10,PPC64_CACHES@toc(r2)
243 lwz r7,DCACHEL1LINESIZE(r10) /* Get dcache line size */
244 addi r5,r7,-1
245 andc r6,r3,r5 /* round low to line bdy */
246 subf r8,r6,r4 /* compute length */
247 add r8,r8,r5 /* ensure we get enough */
248 lwz r9,DCACHEL1LOGLINESIZE(r10) /* Get log-2 of dcache line size */
249 srw. r8,r8,r9 /* compute line count */
250 beqlr /* nothing to do? */
251 mfmsr r5 /* Disable MMU Data Relocation */
252 ori r0,r5,MSR_DR
253 xori r0,r0,MSR_DR
254 sync
255 mtmsr r0
256 sync
257 isync
258 mtctr r8
2590: dcbst 0,r6
260 add r6,r6,r7
261 bdnz 0b
262 sync
263 isync
264 mtmsr r5 /* Re-enable MMU Data Relocation */
265 sync
266 isync
267 blr
268
269_GLOBAL(flush_inval_dcache_range)
270 ld r10,PPC64_CACHES@toc(r2)
271 lwz r7,DCACHEL1LINESIZE(r10) /* Get dcache line size */
272 addi r5,r7,-1
273 andc r6,r3,r5 /* round low to line bdy */
274 subf r8,r6,r4 /* compute length */
275 add r8,r8,r5 /* ensure we get enough */
276 lwz r9,DCACHEL1LOGLINESIZE(r10)/* Get log-2 of dcache line size */
277 srw. r8,r8,r9 /* compute line count */
278 beqlr /* nothing to do? */
279 sync
280 isync
281 mtctr r8
2820: dcbf 0,r6
283 add r6,r6,r7
284 bdnz 0b
285 sync
286 isync
287 blr
288
289
290/*
291 * Flush a particular page from the data cache to RAM.
292 * Note: this is necessary because the instruction cache does *not*
293 * snoop from the data cache.
294 *
295 * void __flush_dcache_icache(void *page)
296 */
297_GLOBAL(__flush_dcache_icache)
298/*
299 * Flush the data cache to memory
300 *
301 * Different systems have different cache line sizes
302 */
303
304/* Flush the dcache */
305 ld r7,PPC64_CACHES@toc(r2)
306 clrrdi r3,r3,PAGE_SHIFT /* Page align */
307 lwz r4,DCACHEL1LINESPERPAGE(r7) /* Get # dcache lines per page */
308 lwz r5,DCACHEL1LINESIZE(r7) /* Get dcache line size */
309 mr r6,r3
310 mtctr r4
3110: dcbst 0,r6
312 add r6,r6,r5
313 bdnz 0b
314 sync
315
316/* Now invalidate the icache */
317
318 lwz r4,ICACHEL1LINESPERPAGE(r7) /* Get # icache lines per page */
319 lwz r5,ICACHEL1LINESIZE(r7) /* Get icache line size */
320 mtctr r4
3211: icbi 0,r3
322 add r3,r3,r5
323 bdnz 1b
324 isync
325 blr
326
327/*
328 * I/O string operations
329 *
330 * insb(port, buf, len)
331 * outsb(port, buf, len)
332 * insw(port, buf, len)
333 * outsw(port, buf, len)
334 * insl(port, buf, len)
335 * outsl(port, buf, len)
336 * insw_ns(port, buf, len)
337 * outsw_ns(port, buf, len)
338 * insl_ns(port, buf, len)
339 * outsl_ns(port, buf, len)
340 *
341 * The *_ns versions don't do byte-swapping.
342 */
343_GLOBAL(_insb)
344 cmpwi 0,r5,0
345 mtctr r5
346 subi r4,r4,1
347 blelr-
34800: lbz r5,0(r3)
349 eieio
350 stbu r5,1(r4)
351 bdnz 00b
352 twi 0,r5,0
353 isync
354 blr
355
356_GLOBAL(_outsb)
357 cmpwi 0,r5,0
358 mtctr r5
359 subi r4,r4,1
360 blelr-
36100: lbzu r5,1(r4)
362 stb r5,0(r3)
363 bdnz 00b
364 sync
365 blr
366
367_GLOBAL(_insw)
368 cmpwi 0,r5,0
369 mtctr r5
370 subi r4,r4,2
371 blelr-
37200: lhbrx r5,0,r3
373 eieio
374 sthu r5,2(r4)
375 bdnz 00b
376 twi 0,r5,0
377 isync
378 blr
379
380_GLOBAL(_outsw)
381 cmpwi 0,r5,0
382 mtctr r5
383 subi r4,r4,2
384 blelr-
38500: lhzu r5,2(r4)
386 sthbrx r5,0,r3
387 bdnz 00b
388 sync
389 blr
390
391_GLOBAL(_insl)
392 cmpwi 0,r5,0
393 mtctr r5
394 subi r4,r4,4
395 blelr-
39600: lwbrx r5,0,r3
397 eieio
398 stwu r5,4(r4)
399 bdnz 00b
400 twi 0,r5,0
401 isync
402 blr
403
404_GLOBAL(_outsl)
405 cmpwi 0,r5,0
406 mtctr r5
407 subi r4,r4,4
408 blelr-
40900: lwzu r5,4(r4)
410 stwbrx r5,0,r3
411 bdnz 00b
412 sync
413 blr
414
415/* _GLOBAL(ide_insw) now in drivers/ide/ide-iops.c */
416_GLOBAL(_insw_ns)
417 cmpwi 0,r5,0
418 mtctr r5
419 subi r4,r4,2
420 blelr-
42100: lhz r5,0(r3)
422 eieio
423 sthu r5,2(r4)
424 bdnz 00b
425 twi 0,r5,0
426 isync
427 blr
428
429/* _GLOBAL(ide_outsw) now in drivers/ide/ide-iops.c */
430_GLOBAL(_outsw_ns)
431 cmpwi 0,r5,0
432 mtctr r5
433 subi r4,r4,2
434 blelr-
43500: lhzu r5,2(r4)
436 sth r5,0(r3)
437 bdnz 00b
438 sync
439 blr
440
441_GLOBAL(_insl_ns)
442 cmpwi 0,r5,0
443 mtctr r5
444 subi r4,r4,4
445 blelr-
44600: lwz r5,0(r3)
447 eieio
448 stwu r5,4(r4)
449 bdnz 00b
450 twi 0,r5,0
451 isync
452 blr
453
454_GLOBAL(_outsl_ns)
455 cmpwi 0,r5,0
456 mtctr r5
457 subi r4,r4,4
458 blelr-
45900: lwzu r5,4(r4)
460 stw r5,0(r3)
461 bdnz 00b
462 sync
463 blr
464
465/*
466 * identify_cpu and calls setup_cpu
467 * In: r3 = base of the cpu_specs array
468 * r4 = address of cur_cpu_spec
469 * r5 = relocation offset
470 */
471_GLOBAL(identify_cpu)
472 mfpvr r7
4731:
474 lwz r8,CPU_SPEC_PVR_MASK(r3)
475 and r8,r8,r7
476 lwz r9,CPU_SPEC_PVR_VALUE(r3)
477 cmplw 0,r9,r8
478 beq 1f
479 addi r3,r3,CPU_SPEC_ENTRY_SIZE
480 b 1b
4811:
482 sub r0,r3,r5
483 std r0,0(r4)
484 ld r4,CPU_SPEC_SETUP(r3)
485 add r4,r4,r5
486 ld r4,0(r4)
487 add r4,r4,r5
488 mtctr r4
489 /* Calling convention for cpu setup is r3=offset, r4=cur_cpu_spec */
490 mr r4,r3
491 mr r3,r5
492 bctr
493
494/*
495 * do_cpu_ftr_fixups - goes through the list of CPU feature fixups
496 * and writes nop's over sections of code that don't apply for this cpu.
497 * r3 = data offset (not changed)
498 */
499_GLOBAL(do_cpu_ftr_fixups)
500 /* Get CPU 0 features */
501 LOADADDR(r6,cur_cpu_spec)
502 sub r6,r6,r3
503 ld r4,0(r6)
504 sub r4,r4,r3
505 ld r4,CPU_SPEC_FEATURES(r4)
506 /* Get the fixup table */
507 LOADADDR(r6,__start___ftr_fixup)
508 sub r6,r6,r3
509 LOADADDR(r7,__stop___ftr_fixup)
510 sub r7,r7,r3
511 /* Do the fixup */
5121: cmpld r6,r7
513 bgelr
514 addi r6,r6,32
515 ld r8,-32(r6) /* mask */
516 and r8,r8,r4
517 ld r9,-24(r6) /* value */
518 cmpld r8,r9
519 beq 1b
520 ld r8,-16(r6) /* section begin */
521 ld r9,-8(r6) /* section end */
522 subf. r9,r8,r9
523 beq 1b
524 /* write nops over the section of code */
525 /* todo: if large section, add a branch at the start of it */
526 srwi r9,r9,2
527 mtctr r9
528 sub r8,r8,r3
529 lis r0,0x60000000@h /* nop */
5303: stw r0,0(r8)
531 andi. r10,r4,CPU_FTR_SPLIT_ID_CACHE@l
532 beq 2f
533 dcbst 0,r8 /* suboptimal, but simpler */
534 sync
535 icbi 0,r8
5362: addi r8,r8,4
537 bdnz 3b
538 sync /* additional sync needed on g4 */
539 isync
540 b 1b
541
542#if defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE)
543/*
544 * Do an IO access in real mode
545 */
546_GLOBAL(real_readb)
547 mfmsr r7
548 ori r0,r7,MSR_DR
549 xori r0,r0,MSR_DR
550 sync
551 mtmsrd r0
552 sync
553 isync
554 mfspr r6,SPRN_HID4
555 rldicl r5,r6,32,0
556 ori r5,r5,0x100
557 rldicl r5,r5,32,0
558 sync
559 mtspr SPRN_HID4,r5
560 isync
561 slbia
562 isync
563 lbz r3,0(r3)
564 sync
565 mtspr SPRN_HID4,r6
566 isync
567 slbia
568 isync
569 mtmsrd r7
570 sync
571 isync
572 blr
573
574 /*
575 * Do an IO access in real mode
576 */
577_GLOBAL(real_writeb)
578 mfmsr r7
579 ori r0,r7,MSR_DR
580 xori r0,r0,MSR_DR
581 sync
582 mtmsrd r0
583 sync
584 isync
585 mfspr r6,SPRN_HID4
586 rldicl r5,r6,32,0
587 ori r5,r5,0x100
588 rldicl r5,r5,32,0
589 sync
590 mtspr SPRN_HID4,r5
591 isync
592 slbia
593 isync
594 stb r3,0(r4)
595 sync
596 mtspr SPRN_HID4,r6
597 isync
598 slbia
599 isync
600 mtmsrd r7
601 sync
602 isync
603 blr
604#endif /* defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE) */
605
606/*
607 * Create a kernel thread
608 * kernel_thread(fn, arg, flags)
609 */
610_GLOBAL(kernel_thread)
611 std r29,-24(r1)
612 std r30,-16(r1)
613 stdu r1,-STACK_FRAME_OVERHEAD(r1)
614 mr r29,r3
615 mr r30,r4
616 ori r3,r5,CLONE_VM /* flags */
617 oris r3,r3,(CLONE_UNTRACED>>16)
618 li r4,0 /* new sp (unused) */
619 li r0,__NR_clone
620 sc
621 cmpdi 0,r3,0 /* parent or child? */
622 bne 1f /* return if parent */
623 li r0,0
624 stdu r0,-STACK_FRAME_OVERHEAD(r1)
625 ld r2,8(r29)
626 ld r29,0(r29)
627 mtlr r29 /* fn addr in lr */
628 mr r3,r30 /* load arg and call fn */
629 blrl
630 li r0,__NR_exit /* exit after child exits */
631 li r3,0
632 sc
6331: addi r1,r1,STACK_FRAME_OVERHEAD
634 ld r29,-24(r1)
635 ld r30,-16(r1)
636 blr
637
638/*
639 * disable_kernel_fp()
640 * Disable the FPU.
641 */
642_GLOBAL(disable_kernel_fp)
643 mfmsr r3
644 rldicl r0,r3,(63-MSR_FP_LG),1
645 rldicl r3,r0,(MSR_FP_LG+1),0
646 mtmsrd r3 /* disable use of fpu now */
647 isync
648 blr
649
650#ifdef CONFIG_ALTIVEC
651
652#if 0 /* this has no callers for now */
653/*
654 * disable_kernel_altivec()
655 * Disable the VMX.
656 */
657_GLOBAL(disable_kernel_altivec)
658 mfmsr r3
659 rldicl r0,r3,(63-MSR_VEC_LG),1
660 rldicl r3,r0,(MSR_VEC_LG+1),0
661 mtmsrd r3 /* disable use of VMX now */
662 isync
663 blr
664#endif /* 0 */
665
666/*
667 * giveup_altivec(tsk)
668 * Disable VMX for the task given as the argument,
669 * and save the vector registers in its thread_struct.
670 * Enables the VMX for use in the kernel on return.
671 */
672_GLOBAL(giveup_altivec)
673 mfmsr r5
674 oris r5,r5,MSR_VEC@h
675 mtmsrd r5 /* enable use of VMX now */
676 isync
677 cmpdi 0,r3,0
678 beqlr- /* if no previous owner, done */
679 addi r3,r3,THREAD /* want THREAD of task */
680 ld r5,PT_REGS(r3)
681 cmpdi 0,r5,0
682 SAVE_32VRS(0,r4,r3)
683 mfvscr vr0
684 li r4,THREAD_VSCR
685 stvx vr0,r4,r3
686 beq 1f
687 ld r4,_MSR-STACK_FRAME_OVERHEAD(r5)
688 lis r3,MSR_VEC@h
689 andc r4,r4,r3 /* disable FP for previous task */
690 std r4,_MSR-STACK_FRAME_OVERHEAD(r5)
6911:
692#ifndef CONFIG_SMP
693 li r5,0
694 ld r4,last_task_used_altivec@got(r2)
695 std r5,0(r4)
696#endif /* CONFIG_SMP */
697 blr
698
699#endif /* CONFIG_ALTIVEC */
700
701_GLOBAL(__setup_cpu_power3)
702 blr
703
704_GLOBAL(execve)
705 li r0,__NR_execve
706 sc
707 bnslr
708 neg r3,r3
709 blr
710
711/* kexec_wait(phys_cpu)
712 *
713 * wait for the flag to change, indicating this kernel is going away but
714 * the slave code for the next one is at addresses 0 to 100.
715 *
716 * This is used by all slaves.
717 *
718 * Physical (hardware) cpu id should be in r3.
719 */
720_GLOBAL(kexec_wait)
721 bl 1f
7221: mflr r5
723 addi r5,r5,kexec_flag-1b
724
72599: HMT_LOW
726#ifdef CONFIG_KEXEC /* use no memory without kexec */
727 lwz r4,0(r5)
728 cmpwi 0,r4,0
729 bnea 0x60
730#endif
731 b 99b
732
733/* this can be in text because we won't change it until we are
734 * running in real anyways
735 */
736kexec_flag:
737 .long 0
738
739
740#ifdef CONFIG_KEXEC
741
742/* kexec_smp_wait(void)
743 *
744 * call with interrupts off
745 * note: this is a terminal routine, it does not save lr
746 *
747 * get phys id from paca
748 * set paca id to -1 to say we got here
749 * switch to real mode
750 * join other cpus in kexec_wait(phys_id)
751 */
752_GLOBAL(kexec_smp_wait)
753 lhz r3,PACAHWCPUID(r13)
754 li r4,-1
755 sth r4,PACAHWCPUID(r13) /* let others know we left */
756 bl real_mode
757 b .kexec_wait
758
759/*
760 * switch to real mode (turn mmu off)
761 * we use the early kernel trick that the hardware ignores bits
762 * 0 and 1 (big endian) of the effective address in real mode
763 *
764 * don't overwrite r3 here, it is live for kexec_wait above.
765 */
766real_mode: /* assume normal blr return */
7671: li r9,MSR_RI
768 li r10,MSR_DR|MSR_IR
769 mflr r11 /* return address to SRR0 */
770 mfmsr r12
771 andc r9,r12,r9
772 andc r10,r12,r10
773
774 mtmsrd r9,1
775 mtspr SPRN_SRR1,r10
776 mtspr SPRN_SRR0,r11
777 rfid
778
779
780/*
781 * kexec_sequence(newstack, start, image, control, clear_all())
782 *
783 * does the grungy work with stack switching and real mode switches
784 * also does simple calls to other code
785 */
786
787_GLOBAL(kexec_sequence)
788 mflr r0
789 std r0,16(r1)
790
791 /* switch stacks to newstack -- &kexec_stack.stack */
792 stdu r1,THREAD_SIZE-112(r3)
793 mr r1,r3
794
795 li r0,0
796 std r0,16(r1)
797
798 /* save regs for local vars on new stack.
799 * yes, we won't go back, but ...
800 */
801 std r31,-8(r1)
802 std r30,-16(r1)
803 std r29,-24(r1)
804 std r28,-32(r1)
805 std r27,-40(r1)
806 std r26,-48(r1)
807 std r25,-56(r1)
808
809 stdu r1,-112-64(r1)
810
811 /* save args into preserved regs */
812 mr r31,r3 /* newstack (both) */
813 mr r30,r4 /* start (real) */
814 mr r29,r5 /* image (virt) */
815 mr r28,r6 /* control, unused */
816 mr r27,r7 /* clear_all() fn desc */
817 mr r26,r8 /* spare */
818 lhz r25,PACAHWCPUID(r13) /* get our phys cpu from paca */
819
820 /* disable interrupts, we are overwriting kernel data next */
821 mfmsr r3
822 rlwinm r3,r3,0,17,15
823 mtmsrd r3,1
824
825 /* copy dest pages, flush whole dest image */
826 mr r3,r29
827 bl .kexec_copy_flush /* (image) */
828
829 /* turn off mmu */
830 bl real_mode
831
832 /* clear out hardware hash page table and tlb */
833 ld r5,0(r27) /* deref function descriptor */
834 mtctr r5
835 bctrl /* ppc_md.hash_clear_all(void); */
836
837/*
838 * kexec image calling is:
839 * the first 0x100 bytes of the entry point are copied to 0
840 *
841 * all slaves branch to slave = 0x60 (absolute)
842 * slave(phys_cpu_id);
843 *
844 * master goes to start = entry point
845 * start(phys_cpu_id, start, 0);
846 *
847 *
848 * a wrapper is needed to call existing kernels, here is an approximate
849 * description of one method:
850 *
851 * v2: (2.6.10)
852 * start will be near the boot_block (maybe 0x100 bytes before it?)
853 * it will have a 0x60, which will b to boot_block, where it will wait
854 * and 0 will store phys into struct boot-block and load r3 from there,
855 * copy kernel 0-0x100 and tell slaves to back down to 0x60 again
856 *
857 * v1: (2.6.9)
858 * boot block will have all cpus scanning device tree to see if they
859 * are the boot cpu ?????
860 * other device tree differences (prop sizes, va vs pa, etc)...
861 */
862
863 /* copy 0x100 bytes starting at start to 0 */
864 li r3,0
865 mr r4,r30
866 li r5,0x100
867 li r6,0
868 bl .copy_and_flush /* (dest, src, copy limit, start offset) */
8691: /* assume normal blr return */
870
871 /* release other cpus to the new kernel secondary start at 0x60 */
872 mflr r5
873 li r6,1
874 stw r6,kexec_flag-1b(5)
875 mr r3,r25 # my phys cpu
876 mr r4,r30 # start, aka phys mem offset
877 mtlr 4
878 li r5,0
879 blr /* image->start(physid, image->start, 0); */
880#endif /* CONFIG_KEXEC */
diff --git a/arch/ppc64/kernel/of_device.c b/arch/powerpc/kernel/of_device.c
index 9f200f0f2ad5..7065e40e2f42 100644
--- a/arch/ppc64/kernel/of_device.c
+++ b/arch/powerpc/kernel/of_device.c
@@ -4,6 +4,8 @@
4#include <linux/init.h> 4#include <linux/init.h>
5#include <linux/module.h> 5#include <linux/module.h>
6#include <linux/mod_devicetable.h> 6#include <linux/mod_devicetable.h>
7#include <linux/slab.h>
8
7#include <asm/errno.h> 9#include <asm/errno.h>
8#include <asm/of_device.h> 10#include <asm/of_device.h>
9 11
@@ -184,6 +186,7 @@ void of_release_dev(struct device *dev)
184 struct of_device *ofdev; 186 struct of_device *ofdev;
185 187
186 ofdev = to_of_device(dev); 188 ofdev = to_of_device(dev);
189 of_node_put(ofdev->node);
187 kfree(ofdev); 190 kfree(ofdev);
188} 191}
189 192
@@ -244,7 +247,7 @@ struct of_device* of_platform_device_create(struct device_node *np,
244 return NULL; 247 return NULL;
245 memset(dev, 0, sizeof(*dev)); 248 memset(dev, 0, sizeof(*dev));
246 249
247 dev->node = np; 250 dev->node = of_node_get(np);
248 dev->dma_mask = 0xffffffffUL; 251 dev->dma_mask = 0xffffffffUL;
249 dev->dev.dma_mask = &dev->dma_mask; 252 dev->dev.dma_mask = &dev->dma_mask;
250 dev->dev.parent = parent; 253 dev->dev.parent = parent;
@@ -261,7 +264,6 @@ struct of_device* of_platform_device_create(struct device_node *np,
261 return dev; 264 return dev;
262} 265}
263 266
264
265EXPORT_SYMBOL(of_match_device); 267EXPORT_SYMBOL(of_match_device);
266EXPORT_SYMBOL(of_platform_bus_type); 268EXPORT_SYMBOL(of_platform_bus_type);
267EXPORT_SYMBOL(of_register_driver); 269EXPORT_SYMBOL(of_register_driver);
diff --git a/arch/ppc64/kernel/pmc.c b/arch/powerpc/kernel/pmc.c
index 63d9481c3ec2..2d333cc84082 100644
--- a/arch/ppc64/kernel/pmc.c
+++ b/arch/powerpc/kernel/pmc.c
@@ -1,7 +1,10 @@
1/* 1/*
2 * linux/arch/ppc64/kernel/pmc.c 2 * arch/powerpc/kernel/pmc.c
3 * 3 *
4 * Copyright (C) 2004 David Gibson, IBM Corporation. 4 * Copyright (C) 2004 David Gibson, IBM Corporation.
5 * Includes code formerly from arch/ppc/kernel/perfmon.c:
6 * Author: Andy Fleming
7 * Copyright (c) 2004 Freescale Semiconductor, Inc
5 * 8 *
6 * This program is free software; you can redistribute it and/or 9 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License 10 * modify it under the terms of the GNU General Public License
@@ -17,6 +20,20 @@
17#include <asm/processor.h> 20#include <asm/processor.h>
18#include <asm/pmc.h> 21#include <asm/pmc.h>
19 22
23#if defined(CONFIG_FSL_BOOKE) && !defined(CONFIG_E200)
24static void dummy_perf(struct pt_regs *regs)
25{
26 unsigned int pmgc0 = mfpmr(PMRN_PMGC0);
27
28 pmgc0 &= ~PMGC0_PMIE;
29 mtpmr(PMRN_PMGC0, pmgc0);
30}
31#elif defined(CONFIG_PPC64) || defined(CONFIG_6xx)
32
33#ifndef MMCR0_PMAO
34#define MMCR0_PMAO 0
35#endif
36
20/* Ensure exceptions are disabled */ 37/* Ensure exceptions are disabled */
21static void dummy_perf(struct pt_regs *regs) 38static void dummy_perf(struct pt_regs *regs)
22{ 39{
@@ -25,6 +42,11 @@ static void dummy_perf(struct pt_regs *regs)
25 mmcr0 &= ~(MMCR0_PMXE|MMCR0_PMAO); 42 mmcr0 &= ~(MMCR0_PMXE|MMCR0_PMAO);
26 mtspr(SPRN_MMCR0, mmcr0); 43 mtspr(SPRN_MMCR0, mmcr0);
27} 44}
45#else
46static void dummy_perf(struct pt_regs *regs)
47{
48}
49#endif
28 50
29static DEFINE_SPINLOCK(pmc_owner_lock); 51static DEFINE_SPINLOCK(pmc_owner_lock);
30static void *pmc_owner_caller; /* mostly for debugging */ 52static void *pmc_owner_caller; /* mostly for debugging */
@@ -66,11 +88,12 @@ void release_pmc_hardware(void)
66} 88}
67EXPORT_SYMBOL_GPL(release_pmc_hardware); 89EXPORT_SYMBOL_GPL(release_pmc_hardware);
68 90
91#ifdef CONFIG_PPC64
69void power4_enable_pmcs(void) 92void power4_enable_pmcs(void)
70{ 93{
71 unsigned long hid0; 94 unsigned long hid0;
72 95
73 hid0 = mfspr(HID0); 96 hid0 = mfspr(SPRN_HID0);
74 hid0 |= 1UL << (63 - 20); 97 hid0 |= 1UL << (63 - 20);
75 98
76 /* POWER4 requires the following sequence */ 99 /* POWER4 requires the following sequence */
@@ -83,6 +106,7 @@ void power4_enable_pmcs(void)
83 "mfspr %0, %1\n" 106 "mfspr %0, %1\n"
84 "mfspr %0, %1\n" 107 "mfspr %0, %1\n"
85 "mfspr %0, %1\n" 108 "mfspr %0, %1\n"
86 "isync" : "=&r" (hid0) : "i" (HID0), "0" (hid0): 109 "isync" : "=&r" (hid0) : "i" (SPRN_HID0), "0" (hid0):
87 "memory"); 110 "memory");
88} 111}
112#endif /* CONFIG_PPC64 */
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
new file mode 100644
index 000000000000..8bc540337ba0
--- /dev/null
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -0,0 +1,273 @@
1#include <linux/config.h>
2#include <linux/module.h>
3#include <linux/threads.h>
4#include <linux/smp.h>
5#include <linux/sched.h>
6#include <linux/elfcore.h>
7#include <linux/string.h>
8#include <linux/interrupt.h>
9#include <linux/tty.h>
10#include <linux/vt_kern.h>
11#include <linux/nvram.h>
12#include <linux/console.h>
13#include <linux/irq.h>
14#include <linux/pci.h>
15#include <linux/delay.h>
16#include <linux/ide.h>
17#include <linux/bitops.h>
18
19#include <asm/page.h>
20#include <asm/semaphore.h>
21#include <asm/processor.h>
22#include <asm/uaccess.h>
23#include <asm/io.h>
24#include <asm/ide.h>
25#include <asm/atomic.h>
26#include <asm/checksum.h>
27#include <asm/pgtable.h>
28#include <asm/tlbflush.h>
29#include <linux/adb.h>
30#include <linux/cuda.h>
31#include <linux/pmu.h>
32#include <asm/prom.h>
33#include <asm/system.h>
34#include <asm/pci-bridge.h>
35#include <asm/irq.h>
36#include <asm/pmac_feature.h>
37#include <asm/dma.h>
38#include <asm/machdep.h>
39#include <asm/hw_irq.h>
40#include <asm/nvram.h>
41#include <asm/mmu_context.h>
42#include <asm/backlight.h>
43#include <asm/time.h>
44#include <asm/cputable.h>
45#include <asm/btext.h>
46#include <asm/div64.h>
47
48#ifdef CONFIG_8xx
49#include <asm/commproc.h>
50#endif
51
52#ifdef CONFIG_PPC32
53extern void transfer_to_handler(void);
54extern void do_IRQ(struct pt_regs *regs);
55extern void machine_check_exception(struct pt_regs *regs);
56extern void alignment_exception(struct pt_regs *regs);
57extern void program_check_exception(struct pt_regs *regs);
58extern void single_step_exception(struct pt_regs *regs);
59extern int do_signal(sigset_t *, struct pt_regs *);
60extern int pmac_newworld;
61extern int sys_sigreturn(struct pt_regs *regs);
62
63EXPORT_SYMBOL(clear_pages);
64EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
65EXPORT_SYMBOL(DMA_MODE_READ);
66EXPORT_SYMBOL(DMA_MODE_WRITE);
67EXPORT_SYMBOL(__div64_32);
68
69EXPORT_SYMBOL(do_signal);
70EXPORT_SYMBOL(transfer_to_handler);
71EXPORT_SYMBOL(do_IRQ);
72EXPORT_SYMBOL(machine_check_exception);
73EXPORT_SYMBOL(alignment_exception);
74EXPORT_SYMBOL(program_check_exception);
75EXPORT_SYMBOL(single_step_exception);
76EXPORT_SYMBOL(sys_sigreturn);
77#endif
78
79#if defined(CONFIG_PPC_PREP)
80EXPORT_SYMBOL(_prep_type);
81EXPORT_SYMBOL(ucSystemType);
82#endif
83
84#if !defined(__INLINE_BITOPS)
85EXPORT_SYMBOL(set_bit);
86EXPORT_SYMBOL(clear_bit);
87EXPORT_SYMBOL(change_bit);
88EXPORT_SYMBOL(test_and_set_bit);
89EXPORT_SYMBOL(test_and_clear_bit);
90EXPORT_SYMBOL(test_and_change_bit);
91#endif /* __INLINE_BITOPS */
92
93EXPORT_SYMBOL(strcpy);
94EXPORT_SYMBOL(strncpy);
95EXPORT_SYMBOL(strcat);
96EXPORT_SYMBOL(strncat);
97EXPORT_SYMBOL(strchr);
98EXPORT_SYMBOL(strrchr);
99EXPORT_SYMBOL(strpbrk);
100EXPORT_SYMBOL(strstr);
101EXPORT_SYMBOL(strlen);
102EXPORT_SYMBOL(strnlen);
103EXPORT_SYMBOL(strcmp);
104EXPORT_SYMBOL(strncmp);
105EXPORT_SYMBOL(strcasecmp);
106
107EXPORT_SYMBOL(csum_partial);
108EXPORT_SYMBOL(csum_partial_copy_generic);
109EXPORT_SYMBOL(ip_fast_csum);
110EXPORT_SYMBOL(csum_tcpudp_magic);
111
112EXPORT_SYMBOL(__copy_tofrom_user);
113EXPORT_SYMBOL(__clear_user);
114EXPORT_SYMBOL(__strncpy_from_user);
115EXPORT_SYMBOL(__strnlen_user);
116
117EXPORT_SYMBOL(_insb);
118EXPORT_SYMBOL(_outsb);
119EXPORT_SYMBOL(_insw);
120EXPORT_SYMBOL(_outsw);
121EXPORT_SYMBOL(_insl);
122EXPORT_SYMBOL(_outsl);
123EXPORT_SYMBOL(_insw_ns);
124EXPORT_SYMBOL(_outsw_ns);
125EXPORT_SYMBOL(_insl_ns);
126EXPORT_SYMBOL(_outsl_ns);
127EXPORT_SYMBOL(ioremap);
128#ifdef CONFIG_44x
129EXPORT_SYMBOL(ioremap64);
130#endif
131EXPORT_SYMBOL(__ioremap);
132EXPORT_SYMBOL(iounmap);
133#ifdef CONFIG_PPC32
134EXPORT_SYMBOL(ioremap_bot); /* aka VMALLOC_END */
135#endif
136
137#if defined(CONFIG_PPC32) && (defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE))
138EXPORT_SYMBOL(ppc_ide_md);
139#endif
140
141#if defined(CONFIG_PCI) && defined(CONFIG_PPC32)
142EXPORT_SYMBOL(isa_io_base);
143EXPORT_SYMBOL(isa_mem_base);
144EXPORT_SYMBOL(pci_dram_offset);
145EXPORT_SYMBOL(pci_alloc_consistent);
146EXPORT_SYMBOL(pci_free_consistent);
147EXPORT_SYMBOL(pci_bus_io_base);
148EXPORT_SYMBOL(pci_bus_io_base_phys);
149EXPORT_SYMBOL(pci_bus_mem_base_phys);
150EXPORT_SYMBOL(pci_bus_to_hose);
151EXPORT_SYMBOL(pci_resource_to_bus);
152EXPORT_SYMBOL(pci_phys_to_bus);
153EXPORT_SYMBOL(pci_bus_to_phys);
154#endif /* CONFIG_PCI */
155
156#ifdef CONFIG_NOT_COHERENT_CACHE
157EXPORT_SYMBOL(flush_dcache_all);
158#endif
159
160EXPORT_SYMBOL(start_thread);
161EXPORT_SYMBOL(kernel_thread);
162
163EXPORT_SYMBOL(giveup_fpu);
164#ifdef CONFIG_ALTIVEC
165EXPORT_SYMBOL(giveup_altivec);
166#endif /* CONFIG_ALTIVEC */
167#ifdef CONFIG_SPE
168EXPORT_SYMBOL(giveup_spe);
169#endif /* CONFIG_SPE */
170
171#ifdef CONFIG_PPC64
172EXPORT_SYMBOL(__flush_icache_range);
173#else
174EXPORT_SYMBOL(flush_instruction_cache);
175EXPORT_SYMBOL(flush_icache_range);
176EXPORT_SYMBOL(flush_tlb_kernel_range);
177EXPORT_SYMBOL(flush_tlb_page);
178EXPORT_SYMBOL(_tlbie);
179#endif
180EXPORT_SYMBOL(flush_dcache_range);
181
182#ifdef CONFIG_SMP
183EXPORT_SYMBOL(smp_call_function);
184#ifdef CONFIG_PPC32
185EXPORT_SYMBOL(smp_hw_index);
186#endif
187#endif
188
189#ifdef CONFIG_ADB
190EXPORT_SYMBOL(adb_request);
191EXPORT_SYMBOL(adb_register);
192EXPORT_SYMBOL(adb_unregister);
193EXPORT_SYMBOL(adb_poll);
194EXPORT_SYMBOL(adb_try_handler_change);
195#endif /* CONFIG_ADB */
196#ifdef CONFIG_ADB_CUDA
197EXPORT_SYMBOL(cuda_request);
198EXPORT_SYMBOL(cuda_poll);
199#endif /* CONFIG_ADB_CUDA */
200#if defined(CONFIG_PPC_MULTIPLATFORM) && defined(CONFIG_PPC32)
201EXPORT_SYMBOL(_machine);
202#endif
203#ifdef CONFIG_PPC_PMAC
204EXPORT_SYMBOL(sys_ctrler);
205#endif
206#ifdef CONFIG_VT
207EXPORT_SYMBOL(kd_mksound);
208#endif
209EXPORT_SYMBOL(to_tm);
210
211#ifdef CONFIG_PPC32
212long long __ashrdi3(long long, int);
213long long __ashldi3(long long, int);
214long long __lshrdi3(long long, int);
215EXPORT_SYMBOL(__ashrdi3);
216EXPORT_SYMBOL(__ashldi3);
217EXPORT_SYMBOL(__lshrdi3);
218#endif
219
220EXPORT_SYMBOL(memcpy);
221EXPORT_SYMBOL(memset);
222EXPORT_SYMBOL(memmove);
223EXPORT_SYMBOL(memscan);
224EXPORT_SYMBOL(memcmp);
225EXPORT_SYMBOL(memchr);
226
227#if defined(CONFIG_FB_VGA16_MODULE)
228EXPORT_SYMBOL(screen_info);
229#endif
230
231#ifdef CONFIG_PPC32
232EXPORT_SYMBOL(__delay);
233EXPORT_SYMBOL(timer_interrupt);
234EXPORT_SYMBOL(irq_desc);
235EXPORT_SYMBOL(tb_ticks_per_jiffy);
236EXPORT_SYMBOL(console_drivers);
237EXPORT_SYMBOL(cacheable_memcpy);
238#endif
239
240EXPORT_SYMBOL(__up);
241EXPORT_SYMBOL(__down);
242EXPORT_SYMBOL(__down_interruptible);
243
244#ifdef CONFIG_8xx
245EXPORT_SYMBOL(cpm_install_handler);
246EXPORT_SYMBOL(cpm_free_handler);
247#endif /* CONFIG_8xx */
248#if defined(CONFIG_8xx) || defined(CONFIG_40x) || defined(CONFIG_85xx) ||\
249 defined(CONFIG_83xx)
250EXPORT_SYMBOL(__res);
251#endif
252
253#ifdef CONFIG_PPC32
254EXPORT_SYMBOL(next_mmu_context);
255EXPORT_SYMBOL(set_context);
256#endif
257
258#ifdef CONFIG_PPC_STD_MMU_32
259extern long mol_trampoline;
260EXPORT_SYMBOL(mol_trampoline); /* For MOL */
261EXPORT_SYMBOL(flush_hash_pages); /* For MOL */
262EXPORT_SYMBOL_GPL(__handle_mm_fault); /* For MOL */
263#ifdef CONFIG_SMP
264extern int mmu_hash_lock;
265EXPORT_SYMBOL(mmu_hash_lock); /* For MOL */
266#endif /* CONFIG_SMP */
267extern long *intercept_table;
268EXPORT_SYMBOL(intercept_table);
269#endif /* CONFIG_PPC_STD_MMU_32 */
270#if defined(CONFIG_40x) || defined(CONFIG_BOOKE)
271EXPORT_SYMBOL(__mtdcr);
272EXPORT_SYMBOL(__mfdcr);
273#endif
diff --git a/arch/ppc64/kernel/process.c b/arch/powerpc/kernel/process.c
index 887005358eb1..8f85dabe4df3 100644
--- a/arch/ppc64/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/ppc64/kernel/process.c 2 * arch/ppc/kernel/process.c
3 * 3 *
4 * Derived from "arch/i386/kernel/process.c" 4 * Derived from "arch/i386/kernel/process.c"
5 * Copyright (C) 1995 Linus Torvalds 5 * Copyright (C) 1995 Linus Torvalds
@@ -7,7 +7,7 @@
7 * Updated and modified by Cort Dougan (cort@cs.nmt.edu) and 7 * Updated and modified by Cort Dougan (cort@cs.nmt.edu) and
8 * Paul Mackerras (paulus@cs.anu.edu.au) 8 * Paul Mackerras (paulus@cs.anu.edu.au)
9 * 9 *
10 * PowerPC version 10 * PowerPC version
11 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) 11 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
12 * 12 *
13 * This program is free software; you can redistribute it and/or 13 * This program is free software; you can redistribute it and/or
@@ -17,7 +17,6 @@
17 */ 17 */
18 18
19#include <linux/config.h> 19#include <linux/config.h>
20#include <linux/module.h>
21#include <linux/errno.h> 20#include <linux/errno.h>
22#include <linux/sched.h> 21#include <linux/sched.h>
23#include <linux/kernel.h> 22#include <linux/kernel.h>
@@ -26,15 +25,17 @@
26#include <linux/smp_lock.h> 25#include <linux/smp_lock.h>
27#include <linux/stddef.h> 26#include <linux/stddef.h>
28#include <linux/unistd.h> 27#include <linux/unistd.h>
28#include <linux/ptrace.h>
29#include <linux/slab.h> 29#include <linux/slab.h>
30#include <linux/user.h> 30#include <linux/user.h>
31#include <linux/elf.h> 31#include <linux/elf.h>
32#include <linux/init.h> 32#include <linux/init.h>
33#include <linux/init_task.h>
34#include <linux/prctl.h> 33#include <linux/prctl.h>
35#include <linux/ptrace.h> 34#include <linux/init_task.h>
35#include <linux/module.h>
36#include <linux/kallsyms.h> 36#include <linux/kallsyms.h>
37#include <linux/interrupt.h> 37#include <linux/mqueue.h>
38#include <linux/hardirq.h>
38#include <linux/utsname.h> 39#include <linux/utsname.h>
39#include <linux/kprobes.h> 40#include <linux/kprobes.h>
40 41
@@ -44,21 +45,19 @@
44#include <asm/io.h> 45#include <asm/io.h>
45#include <asm/processor.h> 46#include <asm/processor.h>
46#include <asm/mmu.h> 47#include <asm/mmu.h>
47#include <asm/mmu_context.h>
48#include <asm/prom.h> 48#include <asm/prom.h>
49#include <asm/ppcdebug.h> 49#ifdef CONFIG_PPC64
50#include <asm/machdep.h>
51#include <asm/iSeries/HvCallHpt.h>
52#include <asm/cputable.h>
53#include <asm/firmware.h> 50#include <asm/firmware.h>
54#include <asm/sections.h>
55#include <asm/tlbflush.h>
56#include <asm/time.h>
57#include <asm/plpar_wrappers.h> 51#include <asm/plpar_wrappers.h>
52#include <asm/time.h>
53#endif
54
55extern unsigned long _get_SP(void);
58 56
59#ifndef CONFIG_SMP 57#ifndef CONFIG_SMP
60struct task_struct *last_task_used_math = NULL; 58struct task_struct *last_task_used_math = NULL;
61struct task_struct *last_task_used_altivec = NULL; 59struct task_struct *last_task_used_altivec = NULL;
60struct task_struct *last_task_used_spe = NULL;
62#endif 61#endif
63 62
64/* 63/*
@@ -121,7 +120,6 @@ int dump_task_fpu(struct task_struct *tsk, elf_fpregset_t *fpregs)
121} 120}
122 121
123#ifdef CONFIG_ALTIVEC 122#ifdef CONFIG_ALTIVEC
124
125void enable_kernel_altivec(void) 123void enable_kernel_altivec(void)
126{ 124{
127 WARN_ON(preemptible()); 125 WARN_ON(preemptible());
@@ -130,7 +128,7 @@ void enable_kernel_altivec(void)
130 if (current->thread.regs && (current->thread.regs->msr & MSR_VEC)) 128 if (current->thread.regs && (current->thread.regs->msr & MSR_VEC))
131 giveup_altivec(current); 129 giveup_altivec(current);
132 else 130 else
133 giveup_altivec(NULL); /* just enables FP for kernel */ 131 giveup_altivec(NULL); /* just enable AltiVec for kernel - force */
134#else 132#else
135 giveup_altivec(last_task_used_altivec); 133 giveup_altivec(last_task_used_altivec);
136#endif /* CONFIG_SMP */ 134#endif /* CONFIG_SMP */
@@ -161,9 +159,48 @@ int dump_task_altivec(struct pt_regs *regs, elf_vrregset_t *vrregs)
161 memcpy(vrregs, &current->thread.vr[0], sizeof(*vrregs)); 159 memcpy(vrregs, &current->thread.vr[0], sizeof(*vrregs));
162 return 1; 160 return 1;
163} 161}
164
165#endif /* CONFIG_ALTIVEC */ 162#endif /* CONFIG_ALTIVEC */
166 163
164#ifdef CONFIG_SPE
165
166void enable_kernel_spe(void)
167{
168 WARN_ON(preemptible());
169
170#ifdef CONFIG_SMP
171 if (current->thread.regs && (current->thread.regs->msr & MSR_SPE))
172 giveup_spe(current);
173 else
174 giveup_spe(NULL); /* just enable SPE for kernel - force */
175#else
176 giveup_spe(last_task_used_spe);
177#endif /* __SMP __ */
178}
179EXPORT_SYMBOL(enable_kernel_spe);
180
181void flush_spe_to_thread(struct task_struct *tsk)
182{
183 if (tsk->thread.regs) {
184 preempt_disable();
185 if (tsk->thread.regs->msr & MSR_SPE) {
186#ifdef CONFIG_SMP
187 BUG_ON(tsk != current);
188#endif
189 giveup_spe(current);
190 }
191 preempt_enable();
192 }
193}
194
195int dump_spe(struct pt_regs *regs, elf_vrregset_t *evrregs)
196{
197 flush_spe_to_thread(current);
198 /* We copy u32 evr[32] + u64 acc + u32 spefscr -> 35 */
199 memcpy(evrregs, &current->thread.evr[0], sizeof(u32) * 35);
200 return 1;
201}
202#endif /* CONFIG_SPE */
203
167static void set_dabr_spr(unsigned long val) 204static void set_dabr_spr(unsigned long val)
168{ 205{
169 mtspr(SPRN_DABR, val); 206 mtspr(SPRN_DABR, val);
@@ -173,24 +210,27 @@ int set_dabr(unsigned long dabr)
173{ 210{
174 int ret = 0; 211 int ret = 0;
175 212
213#ifdef CONFIG_PPC64
176 if (firmware_has_feature(FW_FEATURE_XDABR)) { 214 if (firmware_has_feature(FW_FEATURE_XDABR)) {
177 /* We want to catch accesses from kernel and userspace */ 215 /* We want to catch accesses from kernel and userspace */
178 unsigned long flags = H_DABRX_KERNEL|H_DABRX_USER; 216 unsigned long flags = H_DABRX_KERNEL|H_DABRX_USER;
179 ret = plpar_set_xdabr(dabr, flags); 217 ret = plpar_set_xdabr(dabr, flags);
180 } else if (firmware_has_feature(FW_FEATURE_DABR)) { 218 } else if (firmware_has_feature(FW_FEATURE_DABR)) {
181 ret = plpar_set_dabr(dabr); 219 ret = plpar_set_dabr(dabr);
182 } else { 220 } else
221#endif
183 set_dabr_spr(dabr); 222 set_dabr_spr(dabr);
184 }
185 223
186 return ret; 224 return ret;
187} 225}
188 226
227#ifdef CONFIG_PPC64
189DEFINE_PER_CPU(struct cpu_usage, cpu_usage_array); 228DEFINE_PER_CPU(struct cpu_usage, cpu_usage_array);
190static DEFINE_PER_CPU(unsigned long, current_dabr); 229static DEFINE_PER_CPU(unsigned long, current_dabr);
230#endif
191 231
192struct task_struct *__switch_to(struct task_struct *prev, 232struct task_struct *__switch_to(struct task_struct *prev,
193 struct task_struct *new) 233 struct task_struct *new)
194{ 234{
195 struct thread_struct *new_thread, *old_thread; 235 struct thread_struct *new_thread, *old_thread;
196 unsigned long flags; 236 unsigned long flags;
@@ -200,7 +240,7 @@ struct task_struct *__switch_to(struct task_struct *prev,
200 /* avoid complexity of lazy save/restore of fpu 240 /* avoid complexity of lazy save/restore of fpu
201 * by just saving it every time we switch out if 241 * by just saving it every time we switch out if
202 * this task used the fpu during the last quantum. 242 * this task used the fpu during the last quantum.
203 * 243 *
204 * If it tries to use the fpu again, it'll trap and 244 * If it tries to use the fpu again, it'll trap and
205 * reload its fp regs. So we don't have to do a restore 245 * reload its fp regs. So we don't have to do a restore
206 * every switch, just a save. 246 * every switch, just a save.
@@ -209,31 +249,65 @@ struct task_struct *__switch_to(struct task_struct *prev,
209 if (prev->thread.regs && (prev->thread.regs->msr & MSR_FP)) 249 if (prev->thread.regs && (prev->thread.regs->msr & MSR_FP))
210 giveup_fpu(prev); 250 giveup_fpu(prev);
211#ifdef CONFIG_ALTIVEC 251#ifdef CONFIG_ALTIVEC
252 /*
253 * If the previous thread used altivec in the last quantum
254 * (thus changing altivec regs) then save them.
255 * We used to check the VRSAVE register but not all apps
256 * set it, so we don't rely on it now (and in fact we need
257 * to save & restore VSCR even if VRSAVE == 0). -- paulus
258 *
259 * On SMP we always save/restore altivec regs just to avoid the
260 * complexity of changing processors.
261 * -- Cort
262 */
212 if (prev->thread.regs && (prev->thread.regs->msr & MSR_VEC)) 263 if (prev->thread.regs && (prev->thread.regs->msr & MSR_VEC))
213 giveup_altivec(prev); 264 giveup_altivec(prev);
214#endif /* CONFIG_ALTIVEC */ 265#endif /* CONFIG_ALTIVEC */
215#endif /* CONFIG_SMP */ 266#ifdef CONFIG_SPE
267 /*
268 * If the previous thread used spe in the last quantum
269 * (thus changing spe regs) then save them.
270 *
271 * On SMP we always save/restore spe regs just to avoid the
272 * complexity of changing processors.
273 */
274 if ((prev->thread.regs && (prev->thread.regs->msr & MSR_SPE)))
275 giveup_spe(prev);
276#endif /* CONFIG_SPE */
216 277
217#if defined(CONFIG_ALTIVEC) && !defined(CONFIG_SMP) 278#else /* CONFIG_SMP */
279#ifdef CONFIG_ALTIVEC
218 /* Avoid the trap. On smp this this never happens since 280 /* Avoid the trap. On smp this this never happens since
219 * we don't set last_task_used_altivec -- Cort 281 * we don't set last_task_used_altivec -- Cort
220 */ 282 */
221 if (new->thread.regs && last_task_used_altivec == new) 283 if (new->thread.regs && last_task_used_altivec == new)
222 new->thread.regs->msr |= MSR_VEC; 284 new->thread.regs->msr |= MSR_VEC;
223#endif /* CONFIG_ALTIVEC */ 285#endif /* CONFIG_ALTIVEC */
286#ifdef CONFIG_SPE
287 /* Avoid the trap. On smp this this never happens since
288 * we don't set last_task_used_spe
289 */
290 if (new->thread.regs && last_task_used_spe == new)
291 new->thread.regs->msr |= MSR_SPE;
292#endif /* CONFIG_SPE */
224 293
294#endif /* CONFIG_SMP */
295
296#ifdef CONFIG_PPC64 /* for now */
225 if (unlikely(__get_cpu_var(current_dabr) != new->thread.dabr)) { 297 if (unlikely(__get_cpu_var(current_dabr) != new->thread.dabr)) {
226 set_dabr(new->thread.dabr); 298 set_dabr(new->thread.dabr);
227 __get_cpu_var(current_dabr) = new->thread.dabr; 299 __get_cpu_var(current_dabr) = new->thread.dabr;
228 } 300 }
229 301
230 flush_tlb_pending(); 302 flush_tlb_pending();
303#endif
231 304
232 new_thread = &new->thread; 305 new_thread = &new->thread;
233 old_thread = &current->thread; 306 old_thread = &current->thread;
234 307
235 /* Collect purr utilization data per process and per processor 308#ifdef CONFIG_PPC64
236 * wise purr is nothing but processor time base 309 /*
310 * Collect processor utilization data per process
237 */ 311 */
238 if (firmware_has_feature(FW_FEATURE_SPLPAR)) { 312 if (firmware_has_feature(FW_FEATURE_SPLPAR)) {
239 struct cpu_usage *cu = &__get_cpu_var(cpu_usage_array); 313 struct cpu_usage *cu = &__get_cpu_var(cpu_usage_array);
@@ -243,6 +317,7 @@ struct task_struct *__switch_to(struct task_struct *prev,
243 old_thread->accum_tb += (current_tb - start_tb); 317 old_thread->accum_tb += (current_tb - start_tb);
244 new_thread->start_tb = current_tb; 318 new_thread->start_tb = current_tb;
245 } 319 }
320#endif
246 321
247 local_irq_save(flags); 322 local_irq_save(flags);
248 last = _switch(old_thread, new_thread); 323 last = _switch(old_thread, new_thread);
@@ -254,6 +329,13 @@ struct task_struct *__switch_to(struct task_struct *prev,
254 329
255static int instructions_to_print = 16; 330static int instructions_to_print = 16;
256 331
332#ifdef CONFIG_PPC64
333#define BAD_PC(pc) ((REGION_ID(pc) != KERNEL_REGION_ID) && \
334 (REGION_ID(pc) != VMALLOC_REGION_ID))
335#else
336#define BAD_PC(pc) ((pc) < KERNELBASE)
337#endif
338
257static void show_instructions(struct pt_regs *regs) 339static void show_instructions(struct pt_regs *regs)
258{ 340{
259 int i; 341 int i;
@@ -268,9 +350,7 @@ static void show_instructions(struct pt_regs *regs)
268 if (!(i % 8)) 350 if (!(i % 8))
269 printk("\n"); 351 printk("\n");
270 352
271 if (((REGION_ID(pc) != KERNEL_REGION_ID) && 353 if (BAD_PC(pc) || __get_user(instr, (unsigned int *)pc)) {
272 (REGION_ID(pc) != VMALLOC_REGION_ID)) ||
273 __get_user(instr, (unsigned int *)pc)) {
274 printk("XXXXXXXX "); 354 printk("XXXXXXXX ");
275 } else { 355 } else {
276 if (regs->nip == pc) 356 if (regs->nip == pc)
@@ -285,50 +365,82 @@ static void show_instructions(struct pt_regs *regs)
285 printk("\n"); 365 printk("\n");
286} 366}
287 367
368static struct regbit {
369 unsigned long bit;
370 const char *name;
371} msr_bits[] = {
372 {MSR_EE, "EE"},
373 {MSR_PR, "PR"},
374 {MSR_FP, "FP"},
375 {MSR_ME, "ME"},
376 {MSR_IR, "IR"},
377 {MSR_DR, "DR"},
378 {0, NULL}
379};
380
381static void printbits(unsigned long val, struct regbit *bits)
382{
383 const char *sep = "";
384
385 printk("<");
386 for (; bits->bit; ++bits)
387 if (val & bits->bit) {
388 printk("%s%s", sep, bits->name);
389 sep = ",";
390 }
391 printk(">");
392}
393
394#ifdef CONFIG_PPC64
395#define REG "%016lX"
396#define REGS_PER_LINE 4
397#define LAST_VOLATILE 13
398#else
399#define REG "%08lX"
400#define REGS_PER_LINE 8
401#define LAST_VOLATILE 12
402#endif
403
288void show_regs(struct pt_regs * regs) 404void show_regs(struct pt_regs * regs)
289{ 405{
290 int i; 406 int i, trap;
291 unsigned long trap;
292 407
293 printk("NIP: %016lX XER: %08X LR: %016lX CTR: %016lX\n", 408 printk("NIP: "REG" LR: "REG" CTR: "REG"\n",
294 regs->nip, (unsigned int)regs->xer, regs->link, regs->ctr); 409 regs->nip, regs->link, regs->ctr);
295 printk("REGS: %p TRAP: %04lx %s (%s)\n", 410 printk("REGS: %p TRAP: %04lx %s (%s)\n",
296 regs, regs->trap, print_tainted(), system_utsname.release); 411 regs, regs->trap, print_tainted(), system_utsname.release);
297 printk("MSR: %016lx EE: %01x PR: %01x FP: %01x ME: %01x " 412 printk("MSR: "REG" ", regs->msr);
298 "IR/DR: %01x%01x CR: %08X\n", 413 printbits(regs->msr, msr_bits);
299 regs->msr, regs->msr&MSR_EE ? 1 : 0, regs->msr&MSR_PR ? 1 : 0, 414 printk(" CR: %08lX XER: %08lX\n", regs->ccr, regs->xer);
300 regs->msr & MSR_FP ? 1 : 0,regs->msr&MSR_ME ? 1 : 0,
301 regs->msr&MSR_IR ? 1 : 0,
302 regs->msr&MSR_DR ? 1 : 0,
303 (unsigned int)regs->ccr);
304 trap = TRAP(regs); 415 trap = TRAP(regs);
305 printk("DAR: %016lx DSISR: %016lx\n", regs->dar, regs->dsisr); 416 if (trap == 0x300 || trap == 0x600)
306 printk("TASK: %p[%d] '%s' THREAD: %p", 417 printk("DAR: "REG", DSISR: "REG"\n", regs->dar, regs->dsisr);
418 printk("TASK = %p[%d] '%s' THREAD: %p",
307 current, current->pid, current->comm, current->thread_info); 419 current, current->pid, current->comm, current->thread_info);
308 420
309#ifdef CONFIG_SMP 421#ifdef CONFIG_SMP
310 printk(" CPU: %d", smp_processor_id()); 422 printk(" CPU: %d", smp_processor_id());
311#endif /* CONFIG_SMP */ 423#endif /* CONFIG_SMP */
312 424
313 for (i = 0; i < 32; i++) { 425 for (i = 0; i < 32; i++) {
314 if ((i % 4) == 0) { 426 if ((i % REGS_PER_LINE) == 0)
315 printk("\n" KERN_INFO "GPR%02d: ", i); 427 printk("\n" KERN_INFO "GPR%02d: ", i);
316 } 428 printk(REG " ", regs->gpr[i]);
317 429 if (i == LAST_VOLATILE && !FULL_REGS(regs))
318 printk("%016lX ", regs->gpr[i]);
319 if (i == 13 && !FULL_REGS(regs))
320 break; 430 break;
321 } 431 }
322 printk("\n"); 432 printk("\n");
433#ifdef CONFIG_KALLSYMS
323 /* 434 /*
324 * Lookup NIP late so we have the best change of getting the 435 * Lookup NIP late so we have the best change of getting the
325 * above info out without failing 436 * above info out without failing
326 */ 437 */
327 printk("NIP [%016lx] ", regs->nip); 438 printk("NIP ["REG"] ", regs->nip);
328 print_symbol("%s\n", regs->nip); 439 print_symbol("%s\n", regs->nip);
329 printk("LR [%016lx] ", regs->link); 440 printk("LR ["REG"] ", regs->link);
330 print_symbol("%s\n", regs->link); 441 print_symbol("%s\n", regs->link);
331 show_stack(current, (unsigned long *)regs->gpr[1]); 442#endif
443 show_stack(current, (unsigned long *) regs->gpr[1]);
332 if (!user_mode(regs)) 444 if (!user_mode(regs))
333 show_instructions(regs); 445 show_instructions(regs);
334} 446}
@@ -344,16 +456,22 @@ void exit_thread(void)
344 if (last_task_used_altivec == current) 456 if (last_task_used_altivec == current)
345 last_task_used_altivec = NULL; 457 last_task_used_altivec = NULL;
346#endif /* CONFIG_ALTIVEC */ 458#endif /* CONFIG_ALTIVEC */
459#ifdef CONFIG_SPE
460 if (last_task_used_spe == current)
461 last_task_used_spe = NULL;
462#endif
347#endif /* CONFIG_SMP */ 463#endif /* CONFIG_SMP */
348} 464}
349 465
350void flush_thread(void) 466void flush_thread(void)
351{ 467{
468#ifdef CONFIG_PPC64
352 struct thread_info *t = current_thread_info(); 469 struct thread_info *t = current_thread_info();
353 470
354 kprobe_flush_task(current);
355 if (t->flags & _TIF_ABI_PENDING) 471 if (t->flags & _TIF_ABI_PENDING)
356 t->flags ^= (_TIF_ABI_PENDING | _TIF_32BIT); 472 t->flags ^= (_TIF_ABI_PENDING | _TIF_32BIT);
473#endif
474 kprobe_flush_task(current);
357 475
358#ifndef CONFIG_SMP 476#ifndef CONFIG_SMP
359 if (last_task_used_math == current) 477 if (last_task_used_math == current)
@@ -362,12 +480,18 @@ void flush_thread(void)
362 if (last_task_used_altivec == current) 480 if (last_task_used_altivec == current)
363 last_task_used_altivec = NULL; 481 last_task_used_altivec = NULL;
364#endif /* CONFIG_ALTIVEC */ 482#endif /* CONFIG_ALTIVEC */
483#ifdef CONFIG_SPE
484 if (last_task_used_spe == current)
485 last_task_used_spe = NULL;
486#endif
365#endif /* CONFIG_SMP */ 487#endif /* CONFIG_SMP */
366 488
489#ifdef CONFIG_PPC64 /* for now */
367 if (current->thread.dabr) { 490 if (current->thread.dabr) {
368 current->thread.dabr = 0; 491 current->thread.dabr = 0;
369 set_dabr(0); 492 set_dabr(0);
370 } 493 }
494#endif
371} 495}
372 496
373void 497void
@@ -375,7 +499,6 @@ release_thread(struct task_struct *t)
375{ 499{
376} 500}
377 501
378
379/* 502/*
380 * This gets called before we allocate a new thread and copy 503 * This gets called before we allocate a new thread and copy
381 * the current task into it. 504 * the current task into it.
@@ -384,36 +507,44 @@ void prepare_to_copy(struct task_struct *tsk)
384{ 507{
385 flush_fp_to_thread(current); 508 flush_fp_to_thread(current);
386 flush_altivec_to_thread(current); 509 flush_altivec_to_thread(current);
510 flush_spe_to_thread(current);
387} 511}
388 512
389/* 513/*
390 * Copy a thread.. 514 * Copy a thread..
391 */ 515 */
392int 516int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
393copy_thread(int nr, unsigned long clone_flags, unsigned long usp, 517 unsigned long unused, struct task_struct *p,
394 unsigned long unused, struct task_struct *p, struct pt_regs *regs) 518 struct pt_regs *regs)
395{ 519{
396 struct pt_regs *childregs, *kregs; 520 struct pt_regs *childregs, *kregs;
397 extern void ret_from_fork(void); 521 extern void ret_from_fork(void);
398 unsigned long sp = (unsigned long)p->thread_info + THREAD_SIZE; 522 unsigned long sp = (unsigned long)p->thread_info + THREAD_SIZE;
399 523
524 CHECK_FULL_REGS(regs);
400 /* Copy registers */ 525 /* Copy registers */
401 sp -= sizeof(struct pt_regs); 526 sp -= sizeof(struct pt_regs);
402 childregs = (struct pt_regs *) sp; 527 childregs = (struct pt_regs *) sp;
403 *childregs = *regs; 528 *childregs = *regs;
404 if ((childregs->msr & MSR_PR) == 0) { 529 if ((childregs->msr & MSR_PR) == 0) {
405 /* for kernel thread, set stackptr in new task */ 530 /* for kernel thread, set `current' and stackptr in new task */
406 childregs->gpr[1] = sp + sizeof(struct pt_regs); 531 childregs->gpr[1] = sp + sizeof(struct pt_regs);
407 p->thread.regs = NULL; /* no user register state */ 532#ifdef CONFIG_PPC32
533 childregs->gpr[2] = (unsigned long) p;
534#else
408 clear_ti_thread_flag(p->thread_info, TIF_32BIT); 535 clear_ti_thread_flag(p->thread_info, TIF_32BIT);
536#endif
537 p->thread.regs = NULL; /* no user register state */
409 } else { 538 } else {
410 childregs->gpr[1] = usp; 539 childregs->gpr[1] = usp;
411 p->thread.regs = childregs; 540 p->thread.regs = childregs;
412 if (clone_flags & CLONE_SETTLS) { 541 if (clone_flags & CLONE_SETTLS) {
413 if (test_thread_flag(TIF_32BIT)) 542#ifdef CONFIG_PPC64
414 childregs->gpr[2] = childregs->gpr[6]; 543 if (!test_thread_flag(TIF_32BIT))
415 else
416 childregs->gpr[13] = childregs->gpr[6]; 544 childregs->gpr[13] = childregs->gpr[6];
545 else
546#endif
547 childregs->gpr[2] = childregs->gpr[6];
417 } 548 }
418 } 549 }
419 childregs->gpr[3] = 0; /* Result from fork() */ 550 childregs->gpr[3] = 0; /* Result from fork() */
@@ -431,6 +562,8 @@ copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
431 kregs = (struct pt_regs *) sp; 562 kregs = (struct pt_regs *) sp;
432 sp -= STACK_FRAME_OVERHEAD; 563 sp -= STACK_FRAME_OVERHEAD;
433 p->thread.ksp = sp; 564 p->thread.ksp = sp;
565
566#ifdef CONFIG_PPC64
434 if (cpu_has_feature(CPU_FTR_SLB)) { 567 if (cpu_has_feature(CPU_FTR_SLB)) {
435 unsigned long sp_vsid = get_kernel_vsid(sp); 568 unsigned long sp_vsid = get_kernel_vsid(sp);
436 569
@@ -449,6 +582,10 @@ copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
449 * function. 582 * function.
450 */ 583 */
451 kregs->nip = *((unsigned long *)ret_from_fork); 584 kregs->nip = *((unsigned long *)ret_from_fork);
585#else
586 kregs->nip = (unsigned long)ret_from_fork;
587 p->thread.last_syscall = -1;
588#endif
452 589
453 return 0; 590 return 0;
454} 591}
@@ -456,30 +593,17 @@ copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
456/* 593/*
457 * Set up a thread for executing a new program 594 * Set up a thread for executing a new program
458 */ 595 */
459void start_thread(struct pt_regs *regs, unsigned long fdptr, unsigned long sp) 596void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp)
460{ 597{
461 unsigned long entry, toc, load_addr = regs->gpr[2]; 598#ifdef CONFIG_PPC64
599 unsigned long load_addr = regs->gpr[2]; /* saved by ELF_PLAT_INIT */
600#endif
462 601
463 /* fdptr is a relocated pointer to the function descriptor for
464 * the elf _start routine. The first entry in the function
465 * descriptor is the entry address of _start and the second
466 * entry is the TOC value we need to use.
467 */
468 set_fs(USER_DS); 602 set_fs(USER_DS);
469 __get_user(entry, (unsigned long __user *)fdptr);
470 __get_user(toc, (unsigned long __user *)fdptr+1);
471
472 /* Check whether the e_entry function descriptor entries
473 * need to be relocated before we can use them.
474 */
475 if (load_addr != 0) {
476 entry += load_addr;
477 toc += load_addr;
478 }
479 603
480 /* 604 /*
481 * If we exec out of a kernel thread then thread.regs will not be 605 * If we exec out of a kernel thread then thread.regs will not be
482 * set. Do it now. 606 * set. Do it now.
483 */ 607 */
484 if (!current->thread.regs) { 608 if (!current->thread.regs) {
485 unsigned long childregs = (unsigned long)current->thread_info + 609 unsigned long childregs = (unsigned long)current->thread_info +
@@ -488,36 +612,101 @@ void start_thread(struct pt_regs *regs, unsigned long fdptr, unsigned long sp)
488 current->thread.regs = (struct pt_regs *)childregs; 612 current->thread.regs = (struct pt_regs *)childregs;
489 } 613 }
490 614
491 regs->nip = entry; 615 memset(regs->gpr, 0, sizeof(regs->gpr));
616 regs->ctr = 0;
617 regs->link = 0;
618 regs->xer = 0;
619 regs->ccr = 0;
492 regs->gpr[1] = sp; 620 regs->gpr[1] = sp;
493 regs->gpr[2] = toc; 621
494 regs->msr = MSR_USER64; 622#ifdef CONFIG_PPC32
623 regs->mq = 0;
624 regs->nip = start;
625 regs->msr = MSR_USER;
626#else
627 if (!test_thread_flag(TIF_32BIT)) {
628 unsigned long entry, toc;
629
630 /* start is a relocated pointer to the function descriptor for
631 * the elf _start routine. The first entry in the function
632 * descriptor is the entry address of _start and the second
633 * entry is the TOC value we need to use.
634 */
635 __get_user(entry, (unsigned long __user *)start);
636 __get_user(toc, (unsigned long __user *)start+1);
637
638 /* Check whether the e_entry function descriptor entries
639 * need to be relocated before we can use them.
640 */
641 if (load_addr != 0) {
642 entry += load_addr;
643 toc += load_addr;
644 }
645 regs->nip = entry;
646 regs->gpr[2] = toc;
647 regs->msr = MSR_USER64;
648 } else {
649 regs->nip = start;
650 regs->gpr[2] = 0;
651 regs->msr = MSR_USER32;
652 }
653#endif
654
495#ifndef CONFIG_SMP 655#ifndef CONFIG_SMP
496 if (last_task_used_math == current) 656 if (last_task_used_math == current)
497 last_task_used_math = 0; 657 last_task_used_math = NULL;
498#endif /* CONFIG_SMP */
499 memset(current->thread.fpr, 0, sizeof(current->thread.fpr));
500 current->thread.fpscr = 0;
501#ifdef CONFIG_ALTIVEC 658#ifdef CONFIG_ALTIVEC
502#ifndef CONFIG_SMP
503 if (last_task_used_altivec == current) 659 if (last_task_used_altivec == current)
504 last_task_used_altivec = 0; 660 last_task_used_altivec = NULL;
661#endif
662#ifdef CONFIG_SPE
663 if (last_task_used_spe == current)
664 last_task_used_spe = NULL;
665#endif
505#endif /* CONFIG_SMP */ 666#endif /* CONFIG_SMP */
667 memset(current->thread.fpr, 0, sizeof(current->thread.fpr));
668 current->thread.fpscr.val = 0;
669#ifdef CONFIG_ALTIVEC
506 memset(current->thread.vr, 0, sizeof(current->thread.vr)); 670 memset(current->thread.vr, 0, sizeof(current->thread.vr));
507 current->thread.vscr.u[0] = 0; 671 memset(&current->thread.vscr, 0, sizeof(current->thread.vscr));
508 current->thread.vscr.u[1] = 0;
509 current->thread.vscr.u[2] = 0;
510 current->thread.vscr.u[3] = 0x00010000; /* Java mode disabled */ 672 current->thread.vscr.u[3] = 0x00010000; /* Java mode disabled */
511 current->thread.vrsave = 0; 673 current->thread.vrsave = 0;
512 current->thread.used_vr = 0; 674 current->thread.used_vr = 0;
513#endif /* CONFIG_ALTIVEC */ 675#endif /* CONFIG_ALTIVEC */
676#ifdef CONFIG_SPE
677 memset(current->thread.evr, 0, sizeof(current->thread.evr));
678 current->thread.acc = 0;
679 current->thread.spefscr = 0;
680 current->thread.used_spe = 0;
681#endif /* CONFIG_SPE */
514} 682}
515EXPORT_SYMBOL(start_thread); 683
684#define PR_FP_ALL_EXCEPT (PR_FP_EXC_DIV | PR_FP_EXC_OVF | PR_FP_EXC_UND \
685 | PR_FP_EXC_RES | PR_FP_EXC_INV)
516 686
517int set_fpexc_mode(struct task_struct *tsk, unsigned int val) 687int set_fpexc_mode(struct task_struct *tsk, unsigned int val)
518{ 688{
519 struct pt_regs *regs = tsk->thread.regs; 689 struct pt_regs *regs = tsk->thread.regs;
520 690
691 /* This is a bit hairy. If we are an SPE enabled processor
692 * (have embedded fp) we store the IEEE exception enable flags in
693 * fpexc_mode. fpexc_mode is also used for setting FP exception
694 * mode (asyn, precise, disabled) for 'Classic' FP. */
695 if (val & PR_FP_EXC_SW_ENABLE) {
696#ifdef CONFIG_SPE
697 tsk->thread.fpexc_mode = val &
698 (PR_FP_EXC_SW_ENABLE | PR_FP_ALL_EXCEPT);
699 return 0;
700#else
701 return -EINVAL;
702#endif
703 }
704
705 /* on a CONFIG_SPE this does not hurt us. The bits that
706 * __pack_fe01 use do not overlap with bits used for
707 * PR_FP_EXC_SW_ENABLE. Additionally, the MSR[FE0,FE1] bits
708 * on CONFIG_SPE implementations are reserved so writing to
709 * them does not change anything */
521 if (val > PR_FP_EXC_PRECISE) 710 if (val > PR_FP_EXC_PRECISE)
522 return -EINVAL; 711 return -EINVAL;
523 tsk->thread.fpexc_mode = __pack_fe01(val); 712 tsk->thread.fpexc_mode = __pack_fe01(val);
@@ -531,38 +720,41 @@ int get_fpexc_mode(struct task_struct *tsk, unsigned long adr)
531{ 720{
532 unsigned int val; 721 unsigned int val;
533 722
534 val = __unpack_fe01(tsk->thread.fpexc_mode); 723 if (tsk->thread.fpexc_mode & PR_FP_EXC_SW_ENABLE)
724#ifdef CONFIG_SPE
725 val = tsk->thread.fpexc_mode;
726#else
727 return -EINVAL;
728#endif
729 else
730 val = __unpack_fe01(tsk->thread.fpexc_mode);
535 return put_user(val, (unsigned int __user *) adr); 731 return put_user(val, (unsigned int __user *) adr);
536} 732}
537 733
538int sys_clone(unsigned long clone_flags, unsigned long p2, unsigned long p3, 734#define TRUNC_PTR(x) ((typeof(x))(((unsigned long)(x)) & 0xffffffff))
539 unsigned long p4, unsigned long p5, unsigned long p6, 735
736int sys_clone(unsigned long clone_flags, unsigned long usp,
737 int __user *parent_tidp, void __user *child_threadptr,
738 int __user *child_tidp, int p6,
540 struct pt_regs *regs) 739 struct pt_regs *regs)
541{ 740{
542 unsigned long parent_tidptr = 0; 741 CHECK_FULL_REGS(regs);
543 unsigned long child_tidptr = 0; 742 if (usp == 0)
544 743 usp = regs->gpr[1]; /* stack pointer for child */
545 if (p2 == 0) 744#ifdef CONFIG_PPC64
546 p2 = regs->gpr[1]; /* stack pointer for child */ 745 if (test_thread_flag(TIF_32BIT)) {
547 746 parent_tidp = TRUNC_PTR(parent_tidp);
548 if (clone_flags & (CLONE_PARENT_SETTID | CLONE_CHILD_SETTID | 747 child_tidp = TRUNC_PTR(child_tidp);
549 CLONE_CHILD_CLEARTID)) {
550 parent_tidptr = p3;
551 child_tidptr = p5;
552 if (test_thread_flag(TIF_32BIT)) {
553 parent_tidptr &= 0xffffffff;
554 child_tidptr &= 0xffffffff;
555 }
556 } 748 }
557 749#endif
558 return do_fork(clone_flags, p2, regs, 0, 750 return do_fork(clone_flags, usp, regs, 0, parent_tidp, child_tidp);
559 (int __user *)parent_tidptr, (int __user *)child_tidptr);
560} 751}
561 752
562int sys_fork(unsigned long p1, unsigned long p2, unsigned long p3, 753int sys_fork(unsigned long p1, unsigned long p2, unsigned long p3,
563 unsigned long p4, unsigned long p5, unsigned long p6, 754 unsigned long p4, unsigned long p5, unsigned long p6,
564 struct pt_regs *regs) 755 struct pt_regs *regs)
565{ 756{
757 CHECK_FULL_REGS(regs);
566 return do_fork(SIGCHLD, regs->gpr[1], regs, 0, NULL, NULL); 758 return do_fork(SIGCHLD, regs->gpr[1], regs, 0, NULL, NULL);
567} 759}
568 760
@@ -570,8 +762,9 @@ int sys_vfork(unsigned long p1, unsigned long p2, unsigned long p3,
570 unsigned long p4, unsigned long p5, unsigned long p6, 762 unsigned long p4, unsigned long p5, unsigned long p6,
571 struct pt_regs *regs) 763 struct pt_regs *regs)
572{ 764{
573 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->gpr[1], regs, 0, 765 CHECK_FULL_REGS(regs);
574 NULL, NULL); 766 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->gpr[1],
767 regs, 0, NULL, NULL);
575} 768}
576 769
577int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2, 770int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2,
@@ -579,30 +772,27 @@ int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2,
579 struct pt_regs *regs) 772 struct pt_regs *regs)
580{ 773{
581 int error; 774 int error;
582 char * filename; 775 char *filename;
583 776
584 filename = getname((char __user *) a0); 777 filename = getname((char __user *) a0);
585 error = PTR_ERR(filename); 778 error = PTR_ERR(filename);
586 if (IS_ERR(filename)) 779 if (IS_ERR(filename))
587 goto out; 780 goto out;
588 flush_fp_to_thread(current); 781 flush_fp_to_thread(current);
589 flush_altivec_to_thread(current); 782 flush_altivec_to_thread(current);
783 flush_spe_to_thread(current);
590 error = do_execve(filename, (char __user * __user *) a1, 784 error = do_execve(filename, (char __user * __user *) a1,
591 (char __user * __user *) a2, regs); 785 (char __user * __user *) a2, regs);
592
593 if (error == 0) { 786 if (error == 0) {
594 task_lock(current); 787 task_lock(current);
595 current->ptrace &= ~PT_DTRACE; 788 current->ptrace &= ~PT_DTRACE;
596 task_unlock(current); 789 task_unlock(current);
597 } 790 }
598 putname(filename); 791 putname(filename);
599
600out: 792out:
601 return error; 793 return error;
602} 794}
603 795
604static int kstack_depth_to_print = 64;
605
606static int validate_sp(unsigned long sp, struct task_struct *p, 796static int validate_sp(unsigned long sp, struct task_struct *p,
607 unsigned long nbytes) 797 unsigned long nbytes)
608{ 798{
@@ -627,6 +817,20 @@ static int validate_sp(unsigned long sp, struct task_struct *p,
627 return 0; 817 return 0;
628} 818}
629 819
820#ifdef CONFIG_PPC64
821#define MIN_STACK_FRAME 112 /* same as STACK_FRAME_OVERHEAD, in fact */
822#define FRAME_LR_SAVE 2
823#define INT_FRAME_SIZE (sizeof(struct pt_regs) + STACK_FRAME_OVERHEAD + 288)
824#define REGS_MARKER 0x7265677368657265ul
825#define FRAME_MARKER 12
826#else
827#define MIN_STACK_FRAME 16
828#define FRAME_LR_SAVE 1
829#define INT_FRAME_SIZE (sizeof(struct pt_regs) + STACK_FRAME_OVERHEAD)
830#define REGS_MARKER 0x72656773ul
831#define FRAME_MARKER 2
832#endif
833
630unsigned long get_wchan(struct task_struct *p) 834unsigned long get_wchan(struct task_struct *p)
631{ 835{
632 unsigned long ip, sp; 836 unsigned long ip, sp;
@@ -636,15 +840,15 @@ unsigned long get_wchan(struct task_struct *p)
636 return 0; 840 return 0;
637 841
638 sp = p->thread.ksp; 842 sp = p->thread.ksp;
639 if (!validate_sp(sp, p, 112)) 843 if (!validate_sp(sp, p, MIN_STACK_FRAME))
640 return 0; 844 return 0;
641 845
642 do { 846 do {
643 sp = *(unsigned long *)sp; 847 sp = *(unsigned long *)sp;
644 if (!validate_sp(sp, p, 112)) 848 if (!validate_sp(sp, p, MIN_STACK_FRAME))
645 return 0; 849 return 0;
646 if (count > 0) { 850 if (count > 0) {
647 ip = *(unsigned long *)(sp + 16); 851 ip = ((unsigned long *)sp)[FRAME_LR_SAVE];
648 if (!in_sched_functions(ip)) 852 if (!in_sched_functions(ip))
649 return ip; 853 return ip;
650 } 854 }
@@ -653,33 +857,35 @@ unsigned long get_wchan(struct task_struct *p)
653} 857}
654EXPORT_SYMBOL(get_wchan); 858EXPORT_SYMBOL(get_wchan);
655 859
656void show_stack(struct task_struct *p, unsigned long *_sp) 860static int kstack_depth_to_print = 64;
861
862void show_stack(struct task_struct *tsk, unsigned long *stack)
657{ 863{
658 unsigned long ip, newsp, lr; 864 unsigned long sp, ip, lr, newsp;
659 int count = 0; 865 int count = 0;
660 unsigned long sp = (unsigned long)_sp;
661 int firstframe = 1; 866 int firstframe = 1;
662 867
868 sp = (unsigned long) stack;
869 if (tsk == NULL)
870 tsk = current;
663 if (sp == 0) { 871 if (sp == 0) {
664 if (p) { 872 if (tsk == current)
665 sp = p->thread.ksp; 873 asm("mr %0,1" : "=r" (sp));
666 } else { 874 else
667 sp = __get_SP(); 875 sp = tsk->thread.ksp;
668 p = current;
669 }
670 } 876 }
671 877
672 lr = 0; 878 lr = 0;
673 printk("Call Trace:\n"); 879 printk("Call Trace:\n");
674 do { 880 do {
675 if (!validate_sp(sp, p, 112)) 881 if (!validate_sp(sp, tsk, MIN_STACK_FRAME))
676 return; 882 return;
677 883
678 _sp = (unsigned long *) sp; 884 stack = (unsigned long *) sp;
679 newsp = _sp[0]; 885 newsp = stack[0];
680 ip = _sp[2]; 886 ip = stack[FRAME_LR_SAVE];
681 if (!firstframe || ip != lr) { 887 if (!firstframe || ip != lr) {
682 printk("[%016lx] [%016lx] ", sp, ip); 888 printk("["REG"] ["REG"] ", sp, ip);
683 print_symbol("%s", ip); 889 print_symbol("%s", ip);
684 if (firstframe) 890 if (firstframe)
685 printk(" (unreliable)"); 891 printk(" (unreliable)");
@@ -691,8 +897,8 @@ void show_stack(struct task_struct *p, unsigned long *_sp)
691 * See if this is an exception frame. 897 * See if this is an exception frame.
692 * We look for the "regshere" marker in the current frame. 898 * We look for the "regshere" marker in the current frame.
693 */ 899 */
694 if (validate_sp(sp, p, sizeof(struct pt_regs) + 400) 900 if (validate_sp(sp, tsk, INT_FRAME_SIZE)
695 && _sp[12] == 0x7265677368657265ul) { 901 && stack[FRAME_MARKER] == REGS_MARKER) {
696 struct pt_regs *regs = (struct pt_regs *) 902 struct pt_regs *regs = (struct pt_regs *)
697 (sp + STACK_FRAME_OVERHEAD); 903 (sp + STACK_FRAME_OVERHEAD);
698 printk("--- Exception: %lx", regs->trap); 904 printk("--- Exception: %lx", regs->trap);
@@ -708,6 +914,6 @@ void show_stack(struct task_struct *p, unsigned long *_sp)
708 914
709void dump_stack(void) 915void dump_stack(void)
710{ 916{
711 show_stack(current, (unsigned long *)__get_SP()); 917 show_stack(current, NULL);
712} 918}
713EXPORT_SYMBOL(dump_stack); 919EXPORT_SYMBOL(dump_stack);
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
new file mode 100644
index 000000000000..2eccd0e159e3
--- /dev/null
+++ b/arch/powerpc/kernel/prom.c
@@ -0,0 +1,2170 @@
1/*
2 * Procedures for creating, accessing and interpreting the device tree.
3 *
4 * Paul Mackerras August 1996.
5 * Copyright (C) 1996-2005 Paul Mackerras.
6 *
7 * Adapted for 64bit PowerPC by Dave Engebretsen and Peter Bergner.
8 * {engebret|bergner}@us.ibm.com
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
14 */
15
16#undef DEBUG
17
18#include <stdarg.h>
19#include <linux/config.h>
20#include <linux/kernel.h>
21#include <linux/string.h>
22#include <linux/init.h>
23#include <linux/threads.h>
24#include <linux/spinlock.h>
25#include <linux/types.h>
26#include <linux/pci.h>
27#include <linux/stringify.h>
28#include <linux/delay.h>
29#include <linux/initrd.h>
30#include <linux/bitops.h>
31#include <linux/module.h>
32
33#include <asm/prom.h>
34#include <asm/rtas.h>
35#include <asm/lmb.h>
36#include <asm/page.h>
37#include <asm/processor.h>
38#include <asm/irq.h>
39#include <asm/io.h>
40#include <asm/smp.h>
41#include <asm/system.h>
42#include <asm/mmu.h>
43#include <asm/pgtable.h>
44#include <asm/pci.h>
45#include <asm/iommu.h>
46#include <asm/btext.h>
47#include <asm/sections.h>
48#include <asm/machdep.h>
49#include <asm/pSeries_reconfig.h>
50#include <asm/pci-bridge.h>
51#ifdef CONFIG_PPC64
52#include <asm/systemcfg.h>
53#endif
54
55#ifdef DEBUG
56#define DBG(fmt...) printk(KERN_ERR fmt)
57#else
58#define DBG(fmt...)
59#endif
60
61struct pci_reg_property {
62 struct pci_address addr;
63 u32 size_hi;
64 u32 size_lo;
65};
66
67struct isa_reg_property {
68 u32 space;
69 u32 address;
70 u32 size;
71};
72
73
74typedef int interpret_func(struct device_node *, unsigned long *,
75 int, int, int);
76
77extern struct rtas_t rtas;
78extern struct lmb lmb;
79extern unsigned long klimit;
80
81static int __initdata dt_root_addr_cells;
82static int __initdata dt_root_size_cells;
83
84#ifdef CONFIG_PPC64
85static int __initdata iommu_is_off;
86int __initdata iommu_force_on;
87unsigned long tce_alloc_start, tce_alloc_end;
88#endif
89
90typedef u32 cell_t;
91
92#if 0
93static struct boot_param_header *initial_boot_params __initdata;
94#else
95struct boot_param_header *initial_boot_params;
96#endif
97
98static struct device_node *allnodes = NULL;
99
100/* use when traversing tree through the allnext, child, sibling,
101 * or parent members of struct device_node.
102 */
103static DEFINE_RWLOCK(devtree_lock);
104
105/* export that to outside world */
106struct device_node *of_chosen;
107
108struct device_node *dflt_interrupt_controller;
109int num_interrupt_controllers;
110
111/*
112 * Wrapper for allocating memory for various data that needs to be
113 * attached to device nodes as they are processed at boot or when
114 * added to the device tree later (e.g. DLPAR). At boot there is
115 * already a region reserved so we just increment *mem_start by size;
116 * otherwise we call kmalloc.
117 */
118static void * prom_alloc(unsigned long size, unsigned long *mem_start)
119{
120 unsigned long tmp;
121
122 if (!mem_start)
123 return kmalloc(size, GFP_KERNEL);
124
125 tmp = *mem_start;
126 *mem_start += size;
127 return (void *)tmp;
128}
129
130/*
131 * Find the device_node with a given phandle.
132 */
133static struct device_node * find_phandle(phandle ph)
134{
135 struct device_node *np;
136
137 for (np = allnodes; np != 0; np = np->allnext)
138 if (np->linux_phandle == ph)
139 return np;
140 return NULL;
141}
142
143/*
144 * Find the interrupt parent of a node.
145 */
146static struct device_node * __devinit intr_parent(struct device_node *p)
147{
148 phandle *parp;
149
150 parp = (phandle *) get_property(p, "interrupt-parent", NULL);
151 if (parp == NULL)
152 return p->parent;
153 p = find_phandle(*parp);
154 if (p != NULL)
155 return p;
156 /*
157 * On a powermac booted with BootX, we don't get to know the
158 * phandles for any nodes, so find_phandle will return NULL.
159 * Fortunately these machines only have one interrupt controller
160 * so there isn't in fact any ambiguity. -- paulus
161 */
162 if (num_interrupt_controllers == 1)
163 p = dflt_interrupt_controller;
164 return p;
165}
166
167/*
168 * Find out the size of each entry of the interrupts property
169 * for a node.
170 */
171int __devinit prom_n_intr_cells(struct device_node *np)
172{
173 struct device_node *p;
174 unsigned int *icp;
175
176 for (p = np; (p = intr_parent(p)) != NULL; ) {
177 icp = (unsigned int *)
178 get_property(p, "#interrupt-cells", NULL);
179 if (icp != NULL)
180 return *icp;
181 if (get_property(p, "interrupt-controller", NULL) != NULL
182 || get_property(p, "interrupt-map", NULL) != NULL) {
183 printk("oops, node %s doesn't have #interrupt-cells\n",
184 p->full_name);
185 return 1;
186 }
187 }
188#ifdef DEBUG_IRQ
189 printk("prom_n_intr_cells failed for %s\n", np->full_name);
190#endif
191 return 1;
192}
193
194/*
195 * Map an interrupt from a device up to the platform interrupt
196 * descriptor.
197 */
198static int __devinit map_interrupt(unsigned int **irq, struct device_node **ictrler,
199 struct device_node *np, unsigned int *ints,
200 int nintrc)
201{
202 struct device_node *p, *ipar;
203 unsigned int *imap, *imask, *ip;
204 int i, imaplen, match;
205 int newintrc = 0, newaddrc = 0;
206 unsigned int *reg;
207 int naddrc;
208
209 reg = (unsigned int *) get_property(np, "reg", NULL);
210 naddrc = prom_n_addr_cells(np);
211 p = intr_parent(np);
212 while (p != NULL) {
213 if (get_property(p, "interrupt-controller", NULL) != NULL)
214 /* this node is an interrupt controller, stop here */
215 break;
216 imap = (unsigned int *)
217 get_property(p, "interrupt-map", &imaplen);
218 if (imap == NULL) {
219 p = intr_parent(p);
220 continue;
221 }
222 imask = (unsigned int *)
223 get_property(p, "interrupt-map-mask", NULL);
224 if (imask == NULL) {
225 printk("oops, %s has interrupt-map but no mask\n",
226 p->full_name);
227 return 0;
228 }
229 imaplen /= sizeof(unsigned int);
230 match = 0;
231 ipar = NULL;
232 while (imaplen > 0 && !match) {
233 /* check the child-interrupt field */
234 match = 1;
235 for (i = 0; i < naddrc && match; ++i)
236 match = ((reg[i] ^ imap[i]) & imask[i]) == 0;
237 for (; i < naddrc + nintrc && match; ++i)
238 match = ((ints[i-naddrc] ^ imap[i]) & imask[i]) == 0;
239 imap += naddrc + nintrc;
240 imaplen -= naddrc + nintrc;
241 /* grab the interrupt parent */
242 ipar = find_phandle((phandle) *imap++);
243 --imaplen;
244 if (ipar == NULL && num_interrupt_controllers == 1)
245 /* cope with BootX not giving us phandles */
246 ipar = dflt_interrupt_controller;
247 if (ipar == NULL) {
248 printk("oops, no int parent %x in map of %s\n",
249 imap[-1], p->full_name);
250 return 0;
251 }
252 /* find the parent's # addr and intr cells */
253 ip = (unsigned int *)
254 get_property(ipar, "#interrupt-cells", NULL);
255 if (ip == NULL) {
256 printk("oops, no #interrupt-cells on %s\n",
257 ipar->full_name);
258 return 0;
259 }
260 newintrc = *ip;
261 ip = (unsigned int *)
262 get_property(ipar, "#address-cells", NULL);
263 newaddrc = (ip == NULL)? 0: *ip;
264 imap += newaddrc + newintrc;
265 imaplen -= newaddrc + newintrc;
266 }
267 if (imaplen < 0) {
268 printk("oops, error decoding int-map on %s, len=%d\n",
269 p->full_name, imaplen);
270 return 0;
271 }
272 if (!match) {
273#ifdef DEBUG_IRQ
274 printk("oops, no match in %s int-map for %s\n",
275 p->full_name, np->full_name);
276#endif
277 return 0;
278 }
279 p = ipar;
280 naddrc = newaddrc;
281 nintrc = newintrc;
282 ints = imap - nintrc;
283 reg = ints - naddrc;
284 }
285 if (p == NULL) {
286#ifdef DEBUG_IRQ
287 printk("hmmm, int tree for %s doesn't have ctrler\n",
288 np->full_name);
289#endif
290 return 0;
291 }
292 *irq = ints;
293 *ictrler = p;
294 return nintrc;
295}
296
297static unsigned char map_isa_senses[4] = {
298 IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE,
299 IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE,
300 IRQ_SENSE_EDGE | IRQ_POLARITY_NEGATIVE,
301 IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE
302};
303
304static unsigned char map_mpic_senses[4] = {
305 IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE,
306 IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE,
307 /* 2 seems to be used for the 8259 cascade... */
308 IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE,
309 IRQ_SENSE_EDGE | IRQ_POLARITY_NEGATIVE,
310};
311
312static int __devinit finish_node_interrupts(struct device_node *np,
313 unsigned long *mem_start,
314 int measure_only)
315{
316 unsigned int *ints;
317 int intlen, intrcells, intrcount;
318 int i, j, n, sense;
319 unsigned int *irq, virq;
320 struct device_node *ic;
321
322 if (num_interrupt_controllers == 0) {
323 /*
324 * Old machines just have a list of interrupt numbers
325 * and no interrupt-controller nodes.
326 */
327 ints = (unsigned int *) get_property(np, "AAPL,interrupts",
328 &intlen);
329 /* XXX old interpret_pci_props looked in parent too */
330 /* XXX old interpret_macio_props looked for interrupts
331 before AAPL,interrupts */
332 if (ints == NULL)
333 ints = (unsigned int *) get_property(np, "interrupts",
334 &intlen);
335 if (ints == NULL)
336 return 0;
337
338 np->n_intrs = intlen / sizeof(unsigned int);
339 np->intrs = prom_alloc(np->n_intrs * sizeof(np->intrs[0]),
340 mem_start);
341 if (!np->intrs)
342 return -ENOMEM;
343 if (measure_only)
344 return 0;
345
346 for (i = 0; i < np->n_intrs; ++i) {
347 np->intrs[i].line = *ints++;
348 np->intrs[i].sense = IRQ_SENSE_LEVEL
349 | IRQ_POLARITY_NEGATIVE;
350 }
351 return 0;
352 }
353
354 ints = (unsigned int *) get_property(np, "interrupts", &intlen);
355 if (ints == NULL)
356 return 0;
357 intrcells = prom_n_intr_cells(np);
358 intlen /= intrcells * sizeof(unsigned int);
359
360 np->intrs = prom_alloc(intlen * sizeof(*(np->intrs)), mem_start);
361 if (!np->intrs)
362 return -ENOMEM;
363
364 if (measure_only)
365 return 0;
366
367 intrcount = 0;
368 for (i = 0; i < intlen; ++i, ints += intrcells) {
369 n = map_interrupt(&irq, &ic, np, ints, intrcells);
370 if (n <= 0)
371 continue;
372
373 /* don't map IRQ numbers under a cascaded 8259 controller */
374 if (ic && device_is_compatible(ic, "chrp,iic")) {
375 np->intrs[intrcount].line = irq[0];
376 sense = (n > 1)? (irq[1] & 3): 3;
377 np->intrs[intrcount].sense = map_isa_senses[sense];
378 } else {
379 virq = virt_irq_create_mapping(irq[0]);
380#ifdef CONFIG_PPC64
381 if (virq == NO_IRQ) {
382 printk(KERN_CRIT "Could not allocate interrupt"
383 " number for %s\n", np->full_name);
384 continue;
385 }
386#endif
387 np->intrs[intrcount].line = irq_offset_up(virq);
388 sense = (n > 1)? (irq[1] & 3): 1;
389 np->intrs[intrcount].sense = map_mpic_senses[sense];
390 }
391
392#ifdef CONFIG_PPC64
393 /* We offset irq numbers for the u3 MPIC by 128 in PowerMac */
394 if (systemcfg->platform == PLATFORM_POWERMAC && ic && ic->parent) {
395 char *name = get_property(ic->parent, "name", NULL);
396 if (name && !strcmp(name, "u3"))
397 np->intrs[intrcount].line += 128;
398 else if (!(name && !strcmp(name, "mac-io")))
399 /* ignore other cascaded controllers, such as
400 the k2-sata-root */
401 break;
402 }
403#endif
404 if (n > 2) {
405 printk("hmmm, got %d intr cells for %s:", n,
406 np->full_name);
407 for (j = 0; j < n; ++j)
408 printk(" %d", irq[j]);
409 printk("\n");
410 }
411 ++intrcount;
412 }
413 np->n_intrs = intrcount;
414
415 return 0;
416}
417
418static int __devinit interpret_pci_props(struct device_node *np,
419 unsigned long *mem_start,
420 int naddrc, int nsizec,
421 int measure_only)
422{
423 struct address_range *adr;
424 struct pci_reg_property *pci_addrs;
425 int i, l, n_addrs;
426
427 pci_addrs = (struct pci_reg_property *)
428 get_property(np, "assigned-addresses", &l);
429 if (!pci_addrs)
430 return 0;
431
432 n_addrs = l / sizeof(*pci_addrs);
433
434 adr = prom_alloc(n_addrs * sizeof(*adr), mem_start);
435 if (!adr)
436 return -ENOMEM;
437
438 if (measure_only)
439 return 0;
440
441 np->addrs = adr;
442 np->n_addrs = n_addrs;
443
444 for (i = 0; i < n_addrs; i++) {
445 adr[i].space = pci_addrs[i].addr.a_hi;
446 adr[i].address = pci_addrs[i].addr.a_lo |
447 ((u64)pci_addrs[i].addr.a_mid << 32);
448 adr[i].size = pci_addrs[i].size_lo;
449 }
450
451 return 0;
452}
453
454static int __init interpret_dbdma_props(struct device_node *np,
455 unsigned long *mem_start,
456 int naddrc, int nsizec,
457 int measure_only)
458{
459 struct reg_property32 *rp;
460 struct address_range *adr;
461 unsigned long base_address;
462 int i, l;
463 struct device_node *db;
464
465 base_address = 0;
466 if (!measure_only) {
467 for (db = np->parent; db != NULL; db = db->parent) {
468 if (!strcmp(db->type, "dbdma") && db->n_addrs != 0) {
469 base_address = db->addrs[0].address;
470 break;
471 }
472 }
473 }
474
475 rp = (struct reg_property32 *) get_property(np, "reg", &l);
476 if (rp != 0 && l >= sizeof(struct reg_property32)) {
477 i = 0;
478 adr = (struct address_range *) (*mem_start);
479 while ((l -= sizeof(struct reg_property32)) >= 0) {
480 if (!measure_only) {
481 adr[i].space = 2;
482 adr[i].address = rp[i].address + base_address;
483 adr[i].size = rp[i].size;
484 }
485 ++i;
486 }
487 np->addrs = adr;
488 np->n_addrs = i;
489 (*mem_start) += i * sizeof(struct address_range);
490 }
491
492 return 0;
493}
494
495static int __init interpret_macio_props(struct device_node *np,
496 unsigned long *mem_start,
497 int naddrc, int nsizec,
498 int measure_only)
499{
500 struct reg_property32 *rp;
501 struct address_range *adr;
502 unsigned long base_address;
503 int i, l;
504 struct device_node *db;
505
506 base_address = 0;
507 if (!measure_only) {
508 for (db = np->parent; db != NULL; db = db->parent) {
509 if (!strcmp(db->type, "mac-io") && db->n_addrs != 0) {
510 base_address = db->addrs[0].address;
511 break;
512 }
513 }
514 }
515
516 rp = (struct reg_property32 *) get_property(np, "reg", &l);
517 if (rp != 0 && l >= sizeof(struct reg_property32)) {
518 i = 0;
519 adr = (struct address_range *) (*mem_start);
520 while ((l -= sizeof(struct reg_property32)) >= 0) {
521 if (!measure_only) {
522 adr[i].space = 2;
523 adr[i].address = rp[i].address + base_address;
524 adr[i].size = rp[i].size;
525 }
526 ++i;
527 }
528 np->addrs = adr;
529 np->n_addrs = i;
530 (*mem_start) += i * sizeof(struct address_range);
531 }
532
533 return 0;
534}
535
536static int __init interpret_isa_props(struct device_node *np,
537 unsigned long *mem_start,
538 int naddrc, int nsizec,
539 int measure_only)
540{
541 struct isa_reg_property *rp;
542 struct address_range *adr;
543 int i, l;
544
545 rp = (struct isa_reg_property *) get_property(np, "reg", &l);
546 if (rp != 0 && l >= sizeof(struct isa_reg_property)) {
547 i = 0;
548 adr = (struct address_range *) (*mem_start);
549 while ((l -= sizeof(struct isa_reg_property)) >= 0) {
550 if (!measure_only) {
551 adr[i].space = rp[i].space;
552 adr[i].address = rp[i].address;
553 adr[i].size = rp[i].size;
554 }
555 ++i;
556 }
557 np->addrs = adr;
558 np->n_addrs = i;
559 (*mem_start) += i * sizeof(struct address_range);
560 }
561
562 return 0;
563}
564
565static int __init interpret_root_props(struct device_node *np,
566 unsigned long *mem_start,
567 int naddrc, int nsizec,
568 int measure_only)
569{
570 struct address_range *adr;
571 int i, l;
572 unsigned int *rp;
573 int rpsize = (naddrc + nsizec) * sizeof(unsigned int);
574
575 rp = (unsigned int *) get_property(np, "reg", &l);
576 if (rp != 0 && l >= rpsize) {
577 i = 0;
578 adr = (struct address_range *) (*mem_start);
579 while ((l -= rpsize) >= 0) {
580 if (!measure_only) {
581 adr[i].space = 0;
582 adr[i].address = rp[naddrc - 1];
583 adr[i].size = rp[naddrc + nsizec - 1];
584 }
585 ++i;
586 rp += naddrc + nsizec;
587 }
588 np->addrs = adr;
589 np->n_addrs = i;
590 (*mem_start) += i * sizeof(struct address_range);
591 }
592
593 return 0;
594}
595
596static int __devinit finish_node(struct device_node *np,
597 unsigned long *mem_start,
598 interpret_func *ifunc,
599 int naddrc, int nsizec,
600 int measure_only)
601{
602 struct device_node *child;
603 int *ip, rc = 0;
604
605 /* get the device addresses and interrupts */
606 if (ifunc != NULL)
607 rc = ifunc(np, mem_start, naddrc, nsizec, measure_only);
608 if (rc)
609 goto out;
610
611 rc = finish_node_interrupts(np, mem_start, measure_only);
612 if (rc)
613 goto out;
614
615 /* Look for #address-cells and #size-cells properties. */
616 ip = (int *) get_property(np, "#address-cells", NULL);
617 if (ip != NULL)
618 naddrc = *ip;
619 ip = (int *) get_property(np, "#size-cells", NULL);
620 if (ip != NULL)
621 nsizec = *ip;
622
623 if (!strcmp(np->name, "device-tree") || np->parent == NULL)
624 ifunc = interpret_root_props;
625 else if (np->type == 0)
626 ifunc = NULL;
627 else if (!strcmp(np->type, "pci") || !strcmp(np->type, "vci"))
628 ifunc = interpret_pci_props;
629 else if (!strcmp(np->type, "dbdma"))
630 ifunc = interpret_dbdma_props;
631 else if (!strcmp(np->type, "mac-io") || ifunc == interpret_macio_props)
632 ifunc = interpret_macio_props;
633 else if (!strcmp(np->type, "isa"))
634 ifunc = interpret_isa_props;
635 else if (!strcmp(np->name, "uni-n") || !strcmp(np->name, "u3"))
636 ifunc = interpret_root_props;
637 else if (!((ifunc == interpret_dbdma_props
638 || ifunc == interpret_macio_props)
639 && (!strcmp(np->type, "escc")
640 || !strcmp(np->type, "media-bay"))))
641 ifunc = NULL;
642
643 for (child = np->child; child != NULL; child = child->sibling) {
644 rc = finish_node(child, mem_start, ifunc,
645 naddrc, nsizec, measure_only);
646 if (rc)
647 goto out;
648 }
649out:
650 return rc;
651}
652
653static void __init scan_interrupt_controllers(void)
654{
655 struct device_node *np;
656 int n = 0;
657 char *name, *ic;
658 int iclen;
659
660 for (np = allnodes; np != NULL; np = np->allnext) {
661 ic = get_property(np, "interrupt-controller", &iclen);
662 name = get_property(np, "name", NULL);
663 /* checking iclen makes sure we don't get a false
664 match on /chosen.interrupt_controller */
665 if ((name != NULL
666 && strcmp(name, "interrupt-controller") == 0)
667 || (ic != NULL && iclen == 0
668 && strcmp(name, "AppleKiwi"))) {
669 if (n == 0)
670 dflt_interrupt_controller = np;
671 ++n;
672 }
673 }
674 num_interrupt_controllers = n;
675}
676
677/**
678 * finish_device_tree is called once things are running normally
679 * (i.e. with text and data mapped to the address they were linked at).
680 * It traverses the device tree and fills in some of the additional,
681 * fields in each node like {n_}addrs and {n_}intrs, the virt interrupt
682 * mapping is also initialized at this point.
683 */
684void __init finish_device_tree(void)
685{
686 unsigned long start, end, size = 0;
687
688 DBG(" -> finish_device_tree\n");
689
690#ifdef CONFIG_PPC64
691 /* Initialize virtual IRQ map */
692 virt_irq_init();
693#endif
694 scan_interrupt_controllers();
695
696 /*
697 * Finish device-tree (pre-parsing some properties etc...)
698 * We do this in 2 passes. One with "measure_only" set, which
699 * will only measure the amount of memory needed, then we can
700 * allocate that memory, and call finish_node again. However,
701 * we must be careful as most routines will fail nowadays when
702 * prom_alloc() returns 0, so we must make sure our first pass
703 * doesn't start at 0. We pre-initialize size to 16 for that
704 * reason and then remove those additional 16 bytes
705 */
706 size = 16;
707 finish_node(allnodes, &size, NULL, 0, 0, 1);
708 size -= 16;
709 end = start = (unsigned long) __va(lmb_alloc(size, 128));
710 finish_node(allnodes, &end, NULL, 0, 0, 0);
711 BUG_ON(end != start + size);
712
713 DBG(" <- finish_device_tree\n");
714}
715
716static inline char *find_flat_dt_string(u32 offset)
717{
718 return ((char *)initial_boot_params) +
719 initial_boot_params->off_dt_strings + offset;
720}
721
722/**
723 * This function is used to scan the flattened device-tree, it is
724 * used to extract the memory informations at boot before we can
725 * unflatten the tree
726 */
727static int __init scan_flat_dt(int (*it)(unsigned long node,
728 const char *uname, int depth,
729 void *data),
730 void *data)
731{
732 unsigned long p = ((unsigned long)initial_boot_params) +
733 initial_boot_params->off_dt_struct;
734 int rc = 0;
735 int depth = -1;
736
737 do {
738 u32 tag = *((u32 *)p);
739 char *pathp;
740
741 p += 4;
742 if (tag == OF_DT_END_NODE) {
743 depth --;
744 continue;
745 }
746 if (tag == OF_DT_NOP)
747 continue;
748 if (tag == OF_DT_END)
749 break;
750 if (tag == OF_DT_PROP) {
751 u32 sz = *((u32 *)p);
752 p += 8;
753 if (initial_boot_params->version < 0x10)
754 p = _ALIGN(p, sz >= 8 ? 8 : 4);
755 p += sz;
756 p = _ALIGN(p, 4);
757 continue;
758 }
759 if (tag != OF_DT_BEGIN_NODE) {
760 printk(KERN_WARNING "Invalid tag %x scanning flattened"
761 " device tree !\n", tag);
762 return -EINVAL;
763 }
764 depth++;
765 pathp = (char *)p;
766 p = _ALIGN(p + strlen(pathp) + 1, 4);
767 if ((*pathp) == '/') {
768 char *lp, *np;
769 for (lp = NULL, np = pathp; *np; np++)
770 if ((*np) == '/')
771 lp = np+1;
772 if (lp != NULL)
773 pathp = lp;
774 }
775 rc = it(p, pathp, depth, data);
776 if (rc != 0)
777 break;
778 } while(1);
779
780 return rc;
781}
782
783/**
784 * This function can be used within scan_flattened_dt callback to get
785 * access to properties
786 */
787static void* __init get_flat_dt_prop(unsigned long node, const char *name,
788 unsigned long *size)
789{
790 unsigned long p = node;
791
792 do {
793 u32 tag = *((u32 *)p);
794 u32 sz, noff;
795 const char *nstr;
796
797 p += 4;
798 if (tag == OF_DT_NOP)
799 continue;
800 if (tag != OF_DT_PROP)
801 return NULL;
802
803 sz = *((u32 *)p);
804 noff = *((u32 *)(p + 4));
805 p += 8;
806 if (initial_boot_params->version < 0x10)
807 p = _ALIGN(p, sz >= 8 ? 8 : 4);
808
809 nstr = find_flat_dt_string(noff);
810 if (nstr == NULL) {
811 printk(KERN_WARNING "Can't find property index"
812 " name !\n");
813 return NULL;
814 }
815 if (strcmp(name, nstr) == 0) {
816 if (size)
817 *size = sz;
818 return (void *)p;
819 }
820 p += sz;
821 p = _ALIGN(p, 4);
822 } while(1);
823}
824
825static void *__init unflatten_dt_alloc(unsigned long *mem, unsigned long size,
826 unsigned long align)
827{
828 void *res;
829
830 *mem = _ALIGN(*mem, align);
831 res = (void *)*mem;
832 *mem += size;
833
834 return res;
835}
836
837static unsigned long __init unflatten_dt_node(unsigned long mem,
838 unsigned long *p,
839 struct device_node *dad,
840 struct device_node ***allnextpp,
841 unsigned long fpsize)
842{
843 struct device_node *np;
844 struct property *pp, **prev_pp = NULL;
845 char *pathp;
846 u32 tag;
847 unsigned int l, allocl;
848 int has_name = 0;
849 int new_format = 0;
850
851 tag = *((u32 *)(*p));
852 if (tag != OF_DT_BEGIN_NODE) {
853 printk("Weird tag at start of node: %x\n", tag);
854 return mem;
855 }
856 *p += 4;
857 pathp = (char *)*p;
858 l = allocl = strlen(pathp) + 1;
859 *p = _ALIGN(*p + l, 4);
860
861 /* version 0x10 has a more compact unit name here instead of the full
862 * path. we accumulate the full path size using "fpsize", we'll rebuild
863 * it later. We detect this because the first character of the name is
864 * not '/'.
865 */
866 if ((*pathp) != '/') {
867 new_format = 1;
868 if (fpsize == 0) {
869 /* root node: special case. fpsize accounts for path
870 * plus terminating zero. root node only has '/', so
871 * fpsize should be 2, but we want to avoid the first
872 * level nodes to have two '/' so we use fpsize 1 here
873 */
874 fpsize = 1;
875 allocl = 2;
876 } else {
877 /* account for '/' and path size minus terminal 0
878 * already in 'l'
879 */
880 fpsize += l;
881 allocl = fpsize;
882 }
883 }
884
885
886 np = unflatten_dt_alloc(&mem, sizeof(struct device_node) + allocl,
887 __alignof__(struct device_node));
888 if (allnextpp) {
889 memset(np, 0, sizeof(*np));
890 np->full_name = ((char*)np) + sizeof(struct device_node);
891 if (new_format) {
892 char *p = np->full_name;
893 /* rebuild full path for new format */
894 if (dad && dad->parent) {
895 strcpy(p, dad->full_name);
896#ifdef DEBUG
897 if ((strlen(p) + l + 1) != allocl) {
898 DBG("%s: p: %d, l: %d, a: %d\n",
899 pathp, strlen(p), l, allocl);
900 }
901#endif
902 p += strlen(p);
903 }
904 *(p++) = '/';
905 memcpy(p, pathp, l);
906 } else
907 memcpy(np->full_name, pathp, l);
908 prev_pp = &np->properties;
909 **allnextpp = np;
910 *allnextpp = &np->allnext;
911 if (dad != NULL) {
912 np->parent = dad;
913 /* we temporarily use the next field as `last_child'*/
914 if (dad->next == 0)
915 dad->child = np;
916 else
917 dad->next->sibling = np;
918 dad->next = np;
919 }
920 kref_init(&np->kref);
921 }
922 while(1) {
923 u32 sz, noff;
924 char *pname;
925
926 tag = *((u32 *)(*p));
927 if (tag == OF_DT_NOP) {
928 *p += 4;
929 continue;
930 }
931 if (tag != OF_DT_PROP)
932 break;
933 *p += 4;
934 sz = *((u32 *)(*p));
935 noff = *((u32 *)((*p) + 4));
936 *p += 8;
937 if (initial_boot_params->version < 0x10)
938 *p = _ALIGN(*p, sz >= 8 ? 8 : 4);
939
940 pname = find_flat_dt_string(noff);
941 if (pname == NULL) {
942 printk("Can't find property name in list !\n");
943 break;
944 }
945 if (strcmp(pname, "name") == 0)
946 has_name = 1;
947 l = strlen(pname) + 1;
948 pp = unflatten_dt_alloc(&mem, sizeof(struct property),
949 __alignof__(struct property));
950 if (allnextpp) {
951 if (strcmp(pname, "linux,phandle") == 0) {
952 np->node = *((u32 *)*p);
953 if (np->linux_phandle == 0)
954 np->linux_phandle = np->node;
955 }
956 if (strcmp(pname, "ibm,phandle") == 0)
957 np->linux_phandle = *((u32 *)*p);
958 pp->name = pname;
959 pp->length = sz;
960 pp->value = (void *)*p;
961 *prev_pp = pp;
962 prev_pp = &pp->next;
963 }
964 *p = _ALIGN((*p) + sz, 4);
965 }
966 /* with version 0x10 we may not have the name property, recreate
967 * it here from the unit name if absent
968 */
969 if (!has_name) {
970 char *p = pathp, *ps = pathp, *pa = NULL;
971 int sz;
972
973 while (*p) {
974 if ((*p) == '@')
975 pa = p;
976 if ((*p) == '/')
977 ps = p + 1;
978 p++;
979 }
980 if (pa < ps)
981 pa = p;
982 sz = (pa - ps) + 1;
983 pp = unflatten_dt_alloc(&mem, sizeof(struct property) + sz,
984 __alignof__(struct property));
985 if (allnextpp) {
986 pp->name = "name";
987 pp->length = sz;
988 pp->value = (unsigned char *)(pp + 1);
989 *prev_pp = pp;
990 prev_pp = &pp->next;
991 memcpy(pp->value, ps, sz - 1);
992 ((char *)pp->value)[sz - 1] = 0;
993 DBG("fixed up name for %s -> %s\n", pathp, pp->value);
994 }
995 }
996 if (allnextpp) {
997 *prev_pp = NULL;
998 np->name = get_property(np, "name", NULL);
999 np->type = get_property(np, "device_type", NULL);
1000
1001 if (!np->name)
1002 np->name = "<NULL>";
1003 if (!np->type)
1004 np->type = "<NULL>";
1005 }
1006 while (tag == OF_DT_BEGIN_NODE) {
1007 mem = unflatten_dt_node(mem, p, np, allnextpp, fpsize);
1008 tag = *((u32 *)(*p));
1009 }
1010 if (tag != OF_DT_END_NODE) {
1011 printk("Weird tag at end of node: %x\n", tag);
1012 return mem;
1013 }
1014 *p += 4;
1015 return mem;
1016}
1017
1018
1019/**
1020 * unflattens the device-tree passed by the firmware, creating the
1021 * tree of struct device_node. It also fills the "name" and "type"
1022 * pointers of the nodes so the normal device-tree walking functions
1023 * can be used (this used to be done by finish_device_tree)
1024 */
1025void __init unflatten_device_tree(void)
1026{
1027 unsigned long start, mem, size;
1028 struct device_node **allnextp = &allnodes;
1029 char *p = NULL;
1030 int l = 0;
1031
1032 DBG(" -> unflatten_device_tree()\n");
1033
1034 /* First pass, scan for size */
1035 start = ((unsigned long)initial_boot_params) +
1036 initial_boot_params->off_dt_struct;
1037 size = unflatten_dt_node(0, &start, NULL, NULL, 0);
1038 size = (size | 3) + 1;
1039
1040 DBG(" size is %lx, allocating...\n", size);
1041
1042 /* Allocate memory for the expanded device tree */
1043 mem = lmb_alloc(size + 4, __alignof__(struct device_node));
1044 if (!mem) {
1045 DBG("Couldn't allocate memory with lmb_alloc()!\n");
1046 panic("Couldn't allocate memory with lmb_alloc()!\n");
1047 }
1048 mem = (unsigned long) __va(mem);
1049
1050 ((u32 *)mem)[size / 4] = 0xdeadbeef;
1051
1052 DBG(" unflattening %lx...\n", mem);
1053
1054 /* Second pass, do actual unflattening */
1055 start = ((unsigned long)initial_boot_params) +
1056 initial_boot_params->off_dt_struct;
1057 unflatten_dt_node(mem, &start, NULL, &allnextp, 0);
1058 if (*((u32 *)start) != OF_DT_END)
1059 printk(KERN_WARNING "Weird tag at end of tree: %08x\n", *((u32 *)start));
1060 if (((u32 *)mem)[size / 4] != 0xdeadbeef)
1061 printk(KERN_WARNING "End of tree marker overwritten: %08x\n",
1062 ((u32 *)mem)[size / 4] );
1063 *allnextp = NULL;
1064
1065 /* Get pointer to OF "/chosen" node for use everywhere */
1066 of_chosen = of_find_node_by_path("/chosen");
1067 if (of_chosen == NULL)
1068 of_chosen = of_find_node_by_path("/chosen@0");
1069
1070 /* Retreive command line */
1071 if (of_chosen != NULL) {
1072 p = (char *)get_property(of_chosen, "bootargs", &l);
1073 if (p != NULL && l > 0)
1074 strlcpy(cmd_line, p, min(l, COMMAND_LINE_SIZE));
1075 }
1076#ifdef CONFIG_CMDLINE
1077 if (l == 0 || (l == 1 && (*p) == 0))
1078 strlcpy(cmd_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
1079#endif /* CONFIG_CMDLINE */
1080
1081 DBG("Command line is: %s\n", cmd_line);
1082
1083 DBG(" <- unflatten_device_tree()\n");
1084}
1085
1086
1087static int __init early_init_dt_scan_cpus(unsigned long node,
1088 const char *uname, int depth, void *data)
1089{
1090 char *type = get_flat_dt_prop(node, "device_type", NULL);
1091 u32 *prop;
1092 unsigned long size = 0;
1093
1094 /* We are scanning "cpu" nodes only */
1095 if (type == NULL || strcmp(type, "cpu") != 0)
1096 return 0;
1097
1098#ifdef CONFIG_PPC_PSERIES
1099 /* On LPAR, look for the first ibm,pft-size property for the hash table size
1100 */
1101 if (systemcfg->platform == PLATFORM_PSERIES_LPAR && ppc64_pft_size == 0) {
1102 u32 *pft_size;
1103 pft_size = get_flat_dt_prop(node, "ibm,pft-size", NULL);
1104 if (pft_size != NULL) {
1105 /* pft_size[0] is the NUMA CEC cookie */
1106 ppc64_pft_size = pft_size[1];
1107 }
1108 }
1109#endif
1110
1111 boot_cpuid = 0;
1112 boot_cpuid_phys = 0;
1113 if (initial_boot_params && initial_boot_params->version >= 2) {
1114 /* version 2 of the kexec param format adds the phys cpuid
1115 * of booted proc.
1116 */
1117 boot_cpuid_phys = initial_boot_params->boot_cpuid_phys;
1118 } else {
1119 /* Check if it's the boot-cpu, set it's hw index now */
1120 if (get_flat_dt_prop(node, "linux,boot-cpu", NULL) != NULL) {
1121 prop = get_flat_dt_prop(node, "reg", NULL);
1122 if (prop != NULL)
1123 boot_cpuid_phys = *prop;
1124 }
1125 }
1126 set_hard_smp_processor_id(0, boot_cpuid_phys);
1127
1128#ifdef CONFIG_ALTIVEC
1129 /* Check if we have a VMX and eventually update CPU features */
1130 prop = (u32 *)get_flat_dt_prop(node, "ibm,vmx", &size);
1131 if (prop && (*prop) > 0) {
1132 cur_cpu_spec->cpu_features |= CPU_FTR_ALTIVEC;
1133 cur_cpu_spec->cpu_user_features |= PPC_FEATURE_HAS_ALTIVEC;
1134 }
1135
1136 /* Same goes for Apple's "altivec" property */
1137 prop = (u32 *)get_flat_dt_prop(node, "altivec", NULL);
1138 if (prop) {
1139 cur_cpu_spec->cpu_features |= CPU_FTR_ALTIVEC;
1140 cur_cpu_spec->cpu_user_features |= PPC_FEATURE_HAS_ALTIVEC;
1141 }
1142#endif /* CONFIG_ALTIVEC */
1143
1144#ifdef CONFIG_PPC_PSERIES
1145 /*
1146 * Check for an SMT capable CPU and set the CPU feature. We do
1147 * this by looking at the size of the ibm,ppc-interrupt-server#s
1148 * property
1149 */
1150 prop = (u32 *)get_flat_dt_prop(node, "ibm,ppc-interrupt-server#s",
1151 &size);
1152 cur_cpu_spec->cpu_features &= ~CPU_FTR_SMT;
1153 if (prop && ((size / sizeof(u32)) > 1))
1154 cur_cpu_spec->cpu_features |= CPU_FTR_SMT;
1155#endif
1156
1157 return 0;
1158}
1159
1160static int __init early_init_dt_scan_chosen(unsigned long node,
1161 const char *uname, int depth, void *data)
1162{
1163 u32 *prop;
1164 unsigned long *lprop;
1165
1166 DBG("search \"chosen\", depth: %d, uname: %s\n", depth, uname);
1167
1168 if (depth != 1 ||
1169 (strcmp(uname, "chosen") != 0 && strcmp(uname, "chosen@0") != 0))
1170 return 0;
1171
1172 /* get platform type */
1173 prop = (u32 *)get_flat_dt_prop(node, "linux,platform", NULL);
1174 if (prop == NULL)
1175 return 0;
1176#ifdef CONFIG_PPC64
1177 systemcfg->platform = *prop;
1178#else
1179#ifdef CONFIG_PPC_MULTIPLATFORM
1180 _machine = *prop;
1181#endif
1182#endif
1183
1184#ifdef CONFIG_PPC64
1185 /* check if iommu is forced on or off */
1186 if (get_flat_dt_prop(node, "linux,iommu-off", NULL) != NULL)
1187 iommu_is_off = 1;
1188 if (get_flat_dt_prop(node, "linux,iommu-force-on", NULL) != NULL)
1189 iommu_force_on = 1;
1190#endif
1191
1192 lprop = get_flat_dt_prop(node, "linux,memory-limit", NULL);
1193 if (lprop)
1194 memory_limit = *lprop;
1195
1196#ifdef CONFIG_PPC64
1197 lprop = get_flat_dt_prop(node, "linux,tce-alloc-start", NULL);
1198 if (lprop)
1199 tce_alloc_start = *lprop;
1200 lprop = get_flat_dt_prop(node, "linux,tce-alloc-end", NULL);
1201 if (lprop)
1202 tce_alloc_end = *lprop;
1203#endif
1204
1205#ifdef CONFIG_PPC_RTAS
1206 /* To help early debugging via the front panel, we retreive a minimal
1207 * set of RTAS infos now if available
1208 */
1209 {
1210 u64 *basep, *entryp;
1211
1212 basep = get_flat_dt_prop(node, "linux,rtas-base", NULL);
1213 entryp = get_flat_dt_prop(node, "linux,rtas-entry", NULL);
1214 prop = get_flat_dt_prop(node, "linux,rtas-size", NULL);
1215 if (basep && entryp && prop) {
1216 rtas.base = *basep;
1217 rtas.entry = *entryp;
1218 rtas.size = *prop;
1219 }
1220 }
1221#endif /* CONFIG_PPC_RTAS */
1222
1223 /* break now */
1224 return 1;
1225}
1226
1227static int __init early_init_dt_scan_root(unsigned long node,
1228 const char *uname, int depth, void *data)
1229{
1230 u32 *prop;
1231
1232 if (depth != 0)
1233 return 0;
1234
1235 prop = get_flat_dt_prop(node, "#size-cells", NULL);
1236 dt_root_size_cells = (prop == NULL) ? 1 : *prop;
1237 DBG("dt_root_size_cells = %x\n", dt_root_size_cells);
1238
1239 prop = get_flat_dt_prop(node, "#address-cells", NULL);
1240 dt_root_addr_cells = (prop == NULL) ? 2 : *prop;
1241 DBG("dt_root_addr_cells = %x\n", dt_root_addr_cells);
1242
1243 /* break now */
1244 return 1;
1245}
1246
1247static unsigned long __init dt_mem_next_cell(int s, cell_t **cellp)
1248{
1249 cell_t *p = *cellp;
1250 unsigned long r;
1251
1252 /* Ignore more than 2 cells */
1253 while (s > sizeof(unsigned long) / 4) {
1254 p++;
1255 s--;
1256 }
1257 r = *p++;
1258#ifdef CONFIG_PPC64
1259 if (s > 1) {
1260 r <<= 32;
1261 r |= *(p++);
1262 s--;
1263 }
1264#endif
1265
1266 *cellp = p;
1267 return r;
1268}
1269
1270
1271static int __init early_init_dt_scan_memory(unsigned long node,
1272 const char *uname, int depth, void *data)
1273{
1274 char *type = get_flat_dt_prop(node, "device_type", NULL);
1275 cell_t *reg, *endp;
1276 unsigned long l;
1277
1278 /* We are scanning "memory" nodes only */
1279 if (type == NULL || strcmp(type, "memory") != 0)
1280 return 0;
1281
1282 reg = (cell_t *)get_flat_dt_prop(node, "reg", &l);
1283 if (reg == NULL)
1284 return 0;
1285
1286 endp = reg + (l / sizeof(cell_t));
1287
1288 DBG("memory scan node %s ..., reg size %ld, data: %x %x %x %x, ...\n",
1289 uname, l, reg[0], reg[1], reg[2], reg[3]);
1290
1291 while ((endp - reg) >= (dt_root_addr_cells + dt_root_size_cells)) {
1292 unsigned long base, size;
1293
1294 base = dt_mem_next_cell(dt_root_addr_cells, &reg);
1295 size = dt_mem_next_cell(dt_root_size_cells, &reg);
1296
1297 if (size == 0)
1298 continue;
1299 DBG(" - %lx , %lx\n", base, size);
1300#ifdef CONFIG_PPC64
1301 if (iommu_is_off) {
1302 if (base >= 0x80000000ul)
1303 continue;
1304 if ((base + size) > 0x80000000ul)
1305 size = 0x80000000ul - base;
1306 }
1307#endif
1308 lmb_add(base, size);
1309 }
1310 return 0;
1311}
1312
1313static void __init early_reserve_mem(void)
1314{
1315 unsigned long base, size;
1316 unsigned long *reserve_map;
1317
1318 reserve_map = (unsigned long *)(((unsigned long)initial_boot_params) +
1319 initial_boot_params->off_mem_rsvmap);
1320 while (1) {
1321 base = *(reserve_map++);
1322 size = *(reserve_map++);
1323 if (size == 0)
1324 break;
1325 DBG("reserving: %lx -> %lx\n", base, size);
1326 lmb_reserve(base, size);
1327 }
1328
1329#if 0
1330 DBG("memory reserved, lmbs :\n");
1331 lmb_dump_all();
1332#endif
1333}
1334
1335void __init early_init_devtree(void *params)
1336{
1337 DBG(" -> early_init_devtree()\n");
1338
1339 /* Setup flat device-tree pointer */
1340 initial_boot_params = params;
1341
1342 /* Retrieve various informations from the /chosen node of the
1343 * device-tree, including the platform type, initrd location and
1344 * size, TCE reserve, and more ...
1345 */
1346 scan_flat_dt(early_init_dt_scan_chosen, NULL);
1347
1348 /* Scan memory nodes and rebuild LMBs */
1349 lmb_init();
1350 scan_flat_dt(early_init_dt_scan_root, NULL);
1351 scan_flat_dt(early_init_dt_scan_memory, NULL);
1352 lmb_enforce_memory_limit(memory_limit);
1353 lmb_analyze();
1354#ifdef CONFIG_PPC64
1355 systemcfg->physicalMemorySize = lmb_phys_mem_size();
1356#endif
1357 lmb_reserve(0, __pa(klimit));
1358
1359 DBG("Phys. mem: %lx\n", lmb_phys_mem_size());
1360
1361 /* Reserve LMB regions used by kernel, initrd, dt, etc... */
1362 early_reserve_mem();
1363
1364 DBG("Scanning CPUs ...\n");
1365
1366 /* Retreive hash table size from flattened tree plus other
1367 * CPU related informations (altivec support, boot CPU ID, ...)
1368 */
1369 scan_flat_dt(early_init_dt_scan_cpus, NULL);
1370
1371 DBG(" <- early_init_devtree()\n");
1372}
1373
1374#undef printk
1375
1376int
1377prom_n_addr_cells(struct device_node* np)
1378{
1379 int* ip;
1380 do {
1381 if (np->parent)
1382 np = np->parent;
1383 ip = (int *) get_property(np, "#address-cells", NULL);
1384 if (ip != NULL)
1385 return *ip;
1386 } while (np->parent);
1387 /* No #address-cells property for the root node, default to 1 */
1388 return 1;
1389}
1390
1391int
1392prom_n_size_cells(struct device_node* np)
1393{
1394 int* ip;
1395 do {
1396 if (np->parent)
1397 np = np->parent;
1398 ip = (int *) get_property(np, "#size-cells", NULL);
1399 if (ip != NULL)
1400 return *ip;
1401 } while (np->parent);
1402 /* No #size-cells property for the root node, default to 1 */
1403 return 1;
1404}
1405
1406/**
1407 * Work out the sense (active-low level / active-high edge)
1408 * of each interrupt from the device tree.
1409 */
1410void __init prom_get_irq_senses(unsigned char *senses, int off, int max)
1411{
1412 struct device_node *np;
1413 int i, j;
1414
1415 /* default to level-triggered */
1416 memset(senses, IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE, max - off);
1417
1418 for (np = allnodes; np != 0; np = np->allnext) {
1419 for (j = 0; j < np->n_intrs; j++) {
1420 i = np->intrs[j].line;
1421 if (i >= off && i < max)
1422 senses[i-off] = np->intrs[j].sense;
1423 }
1424 }
1425}
1426
1427/**
1428 * Construct and return a list of the device_nodes with a given name.
1429 */
1430struct device_node *find_devices(const char *name)
1431{
1432 struct device_node *head, **prevp, *np;
1433
1434 prevp = &head;
1435 for (np = allnodes; np != 0; np = np->allnext) {
1436 if (np->name != 0 && strcasecmp(np->name, name) == 0) {
1437 *prevp = np;
1438 prevp = &np->next;
1439 }
1440 }
1441 *prevp = NULL;
1442 return head;
1443}
1444EXPORT_SYMBOL(find_devices);
1445
1446/**
1447 * Construct and return a list of the device_nodes with a given type.
1448 */
1449struct device_node *find_type_devices(const char *type)
1450{
1451 struct device_node *head, **prevp, *np;
1452
1453 prevp = &head;
1454 for (np = allnodes; np != 0; np = np->allnext) {
1455 if (np->type != 0 && strcasecmp(np->type, type) == 0) {
1456 *prevp = np;
1457 prevp = &np->next;
1458 }
1459 }
1460 *prevp = NULL;
1461 return head;
1462}
1463EXPORT_SYMBOL(find_type_devices);
1464
1465/**
1466 * Returns all nodes linked together
1467 */
1468struct device_node *find_all_nodes(void)
1469{
1470 struct device_node *head, **prevp, *np;
1471
1472 prevp = &head;
1473 for (np = allnodes; np != 0; np = np->allnext) {
1474 *prevp = np;
1475 prevp = &np->next;
1476 }
1477 *prevp = NULL;
1478 return head;
1479}
1480EXPORT_SYMBOL(find_all_nodes);
1481
1482/** Checks if the given "compat" string matches one of the strings in
1483 * the device's "compatible" property
1484 */
1485int device_is_compatible(struct device_node *device, const char *compat)
1486{
1487 const char* cp;
1488 int cplen, l;
1489
1490 cp = (char *) get_property(device, "compatible", &cplen);
1491 if (cp == NULL)
1492 return 0;
1493 while (cplen > 0) {
1494 if (strncasecmp(cp, compat, strlen(compat)) == 0)
1495 return 1;
1496 l = strlen(cp) + 1;
1497 cp += l;
1498 cplen -= l;
1499 }
1500
1501 return 0;
1502}
1503EXPORT_SYMBOL(device_is_compatible);
1504
1505
1506/**
1507 * Indicates whether the root node has a given value in its
1508 * compatible property.
1509 */
1510int machine_is_compatible(const char *compat)
1511{
1512 struct device_node *root;
1513 int rc = 0;
1514
1515 root = of_find_node_by_path("/");
1516 if (root) {
1517 rc = device_is_compatible(root, compat);
1518 of_node_put(root);
1519 }
1520 return rc;
1521}
1522EXPORT_SYMBOL(machine_is_compatible);
1523
1524/**
1525 * Construct and return a list of the device_nodes with a given type
1526 * and compatible property.
1527 */
1528struct device_node *find_compatible_devices(const char *type,
1529 const char *compat)
1530{
1531 struct device_node *head, **prevp, *np;
1532
1533 prevp = &head;
1534 for (np = allnodes; np != 0; np = np->allnext) {
1535 if (type != NULL
1536 && !(np->type != 0 && strcasecmp(np->type, type) == 0))
1537 continue;
1538 if (device_is_compatible(np, compat)) {
1539 *prevp = np;
1540 prevp = &np->next;
1541 }
1542 }
1543 *prevp = NULL;
1544 return head;
1545}
1546EXPORT_SYMBOL(find_compatible_devices);
1547
1548/**
1549 * Find the device_node with a given full_name.
1550 */
1551struct device_node *find_path_device(const char *path)
1552{
1553 struct device_node *np;
1554
1555 for (np = allnodes; np != 0; np = np->allnext)
1556 if (np->full_name != 0 && strcasecmp(np->full_name, path) == 0)
1557 return np;
1558 return NULL;
1559}
1560EXPORT_SYMBOL(find_path_device);
1561
1562/*******
1563 *
1564 * New implementation of the OF "find" APIs, return a refcounted
1565 * object, call of_node_put() when done. The device tree and list
1566 * are protected by a rw_lock.
1567 *
1568 * Note that property management will need some locking as well,
1569 * this isn't dealt with yet.
1570 *
1571 *******/
1572
1573/**
1574 * of_find_node_by_name - Find a node by its "name" property
1575 * @from: The node to start searching from or NULL, the node
1576 * you pass will not be searched, only the next one
1577 * will; typically, you pass what the previous call
1578 * returned. of_node_put() will be called on it
1579 * @name: The name string to match against
1580 *
1581 * Returns a node pointer with refcount incremented, use
1582 * of_node_put() on it when done.
1583 */
1584struct device_node *of_find_node_by_name(struct device_node *from,
1585 const char *name)
1586{
1587 struct device_node *np;
1588
1589 read_lock(&devtree_lock);
1590 np = from ? from->allnext : allnodes;
1591 for (; np != 0; np = np->allnext)
1592 if (np->name != 0 && strcasecmp(np->name, name) == 0
1593 && of_node_get(np))
1594 break;
1595 if (from)
1596 of_node_put(from);
1597 read_unlock(&devtree_lock);
1598 return np;
1599}
1600EXPORT_SYMBOL(of_find_node_by_name);
1601
1602/**
1603 * of_find_node_by_type - Find a node by its "device_type" property
1604 * @from: The node to start searching from or NULL, the node
1605 * you pass will not be searched, only the next one
1606 * will; typically, you pass what the previous call
1607 * returned. of_node_put() will be called on it
1608 * @name: The type string to match against
1609 *
1610 * Returns a node pointer with refcount incremented, use
1611 * of_node_put() on it when done.
1612 */
1613struct device_node *of_find_node_by_type(struct device_node *from,
1614 const char *type)
1615{
1616 struct device_node *np;
1617
1618 read_lock(&devtree_lock);
1619 np = from ? from->allnext : allnodes;
1620 for (; np != 0; np = np->allnext)
1621 if (np->type != 0 && strcasecmp(np->type, type) == 0
1622 && of_node_get(np))
1623 break;
1624 if (from)
1625 of_node_put(from);
1626 read_unlock(&devtree_lock);
1627 return np;
1628}
1629EXPORT_SYMBOL(of_find_node_by_type);
1630
1631/**
1632 * of_find_compatible_node - Find a node based on type and one of the
1633 * tokens in its "compatible" property
1634 * @from: The node to start searching from or NULL, the node
1635 * you pass will not be searched, only the next one
1636 * will; typically, you pass what the previous call
1637 * returned. of_node_put() will be called on it
1638 * @type: The type string to match "device_type" or NULL to ignore
1639 * @compatible: The string to match to one of the tokens in the device
1640 * "compatible" list.
1641 *
1642 * Returns a node pointer with refcount incremented, use
1643 * of_node_put() on it when done.
1644 */
1645struct device_node *of_find_compatible_node(struct device_node *from,
1646 const char *type, const char *compatible)
1647{
1648 struct device_node *np;
1649
1650 read_lock(&devtree_lock);
1651 np = from ? from->allnext : allnodes;
1652 for (; np != 0; np = np->allnext) {
1653 if (type != NULL
1654 && !(np->type != 0 && strcasecmp(np->type, type) == 0))
1655 continue;
1656 if (device_is_compatible(np, compatible) && of_node_get(np))
1657 break;
1658 }
1659 if (from)
1660 of_node_put(from);
1661 read_unlock(&devtree_lock);
1662 return np;
1663}
1664EXPORT_SYMBOL(of_find_compatible_node);
1665
1666/**
1667 * of_find_node_by_path - Find a node matching a full OF path
1668 * @path: The full path to match
1669 *
1670 * Returns a node pointer with refcount incremented, use
1671 * of_node_put() on it when done.
1672 */
1673struct device_node *of_find_node_by_path(const char *path)
1674{
1675 struct device_node *np = allnodes;
1676
1677 read_lock(&devtree_lock);
1678 for (; np != 0; np = np->allnext) {
1679 if (np->full_name != 0 && strcasecmp(np->full_name, path) == 0
1680 && of_node_get(np))
1681 break;
1682 }
1683 read_unlock(&devtree_lock);
1684 return np;
1685}
1686EXPORT_SYMBOL(of_find_node_by_path);
1687
1688/**
1689 * of_find_node_by_phandle - Find a node given a phandle
1690 * @handle: phandle of the node to find
1691 *
1692 * Returns a node pointer with refcount incremented, use
1693 * of_node_put() on it when done.
1694 */
1695struct device_node *of_find_node_by_phandle(phandle handle)
1696{
1697 struct device_node *np;
1698
1699 read_lock(&devtree_lock);
1700 for (np = allnodes; np != 0; np = np->allnext)
1701 if (np->linux_phandle == handle)
1702 break;
1703 if (np)
1704 of_node_get(np);
1705 read_unlock(&devtree_lock);
1706 return np;
1707}
1708EXPORT_SYMBOL(of_find_node_by_phandle);
1709
1710/**
1711 * of_find_all_nodes - Get next node in global list
1712 * @prev: Previous node or NULL to start iteration
1713 * of_node_put() will be called on it
1714 *
1715 * Returns a node pointer with refcount incremented, use
1716 * of_node_put() on it when done.
1717 */
1718struct device_node *of_find_all_nodes(struct device_node *prev)
1719{
1720 struct device_node *np;
1721
1722 read_lock(&devtree_lock);
1723 np = prev ? prev->allnext : allnodes;
1724 for (; np != 0; np = np->allnext)
1725 if (of_node_get(np))
1726 break;
1727 if (prev)
1728 of_node_put(prev);
1729 read_unlock(&devtree_lock);
1730 return np;
1731}
1732EXPORT_SYMBOL(of_find_all_nodes);
1733
1734/**
1735 * of_get_parent - Get a node's parent if any
1736 * @node: Node to get parent
1737 *
1738 * Returns a node pointer with refcount incremented, use
1739 * of_node_put() on it when done.
1740 */
1741struct device_node *of_get_parent(const struct device_node *node)
1742{
1743 struct device_node *np;
1744
1745 if (!node)
1746 return NULL;
1747
1748 read_lock(&devtree_lock);
1749 np = of_node_get(node->parent);
1750 read_unlock(&devtree_lock);
1751 return np;
1752}
1753EXPORT_SYMBOL(of_get_parent);
1754
1755/**
1756 * of_get_next_child - Iterate a node childs
1757 * @node: parent node
1758 * @prev: previous child of the parent node, or NULL to get first
1759 *
1760 * Returns a node pointer with refcount incremented, use
1761 * of_node_put() on it when done.
1762 */
1763struct device_node *of_get_next_child(const struct device_node *node,
1764 struct device_node *prev)
1765{
1766 struct device_node *next;
1767
1768 read_lock(&devtree_lock);
1769 next = prev ? prev->sibling : node->child;
1770 for (; next != 0; next = next->sibling)
1771 if (of_node_get(next))
1772 break;
1773 if (prev)
1774 of_node_put(prev);
1775 read_unlock(&devtree_lock);
1776 return next;
1777}
1778EXPORT_SYMBOL(of_get_next_child);
1779
1780/**
1781 * of_node_get - Increment refcount of a node
1782 * @node: Node to inc refcount, NULL is supported to
1783 * simplify writing of callers
1784 *
1785 * Returns node.
1786 */
1787struct device_node *of_node_get(struct device_node *node)
1788{
1789 if (node)
1790 kref_get(&node->kref);
1791 return node;
1792}
1793EXPORT_SYMBOL(of_node_get);
1794
1795static inline struct device_node * kref_to_device_node(struct kref *kref)
1796{
1797 return container_of(kref, struct device_node, kref);
1798}
1799
1800/**
1801 * of_node_release - release a dynamically allocated node
1802 * @kref: kref element of the node to be released
1803 *
1804 * In of_node_put() this function is passed to kref_put()
1805 * as the destructor.
1806 */
1807static void of_node_release(struct kref *kref)
1808{
1809 struct device_node *node = kref_to_device_node(kref);
1810 struct property *prop = node->properties;
1811
1812 if (!OF_IS_DYNAMIC(node))
1813 return;
1814 while (prop) {
1815 struct property *next = prop->next;
1816 kfree(prop->name);
1817 kfree(prop->value);
1818 kfree(prop);
1819 prop = next;
1820 }
1821 kfree(node->intrs);
1822 kfree(node->addrs);
1823 kfree(node->full_name);
1824 kfree(node->data);
1825 kfree(node);
1826}
1827
1828/**
1829 * of_node_put - Decrement refcount of a node
1830 * @node: Node to dec refcount, NULL is supported to
1831 * simplify writing of callers
1832 *
1833 */
1834void of_node_put(struct device_node *node)
1835{
1836 if (node)
1837 kref_put(&node->kref, of_node_release);
1838}
1839EXPORT_SYMBOL(of_node_put);
1840
1841/*
1842 * Plug a device node into the tree and global list.
1843 */
1844void of_attach_node(struct device_node *np)
1845{
1846 write_lock(&devtree_lock);
1847 np->sibling = np->parent->child;
1848 np->allnext = allnodes;
1849 np->parent->child = np;
1850 allnodes = np;
1851 write_unlock(&devtree_lock);
1852}
1853
1854/*
1855 * "Unplug" a node from the device tree. The caller must hold
1856 * a reference to the node. The memory associated with the node
1857 * is not freed until its refcount goes to zero.
1858 */
1859void of_detach_node(const struct device_node *np)
1860{
1861 struct device_node *parent;
1862
1863 write_lock(&devtree_lock);
1864
1865 parent = np->parent;
1866
1867 if (allnodes == np)
1868 allnodes = np->allnext;
1869 else {
1870 struct device_node *prev;
1871 for (prev = allnodes;
1872 prev->allnext != np;
1873 prev = prev->allnext)
1874 ;
1875 prev->allnext = np->allnext;
1876 }
1877
1878 if (parent->child == np)
1879 parent->child = np->sibling;
1880 else {
1881 struct device_node *prevsib;
1882 for (prevsib = np->parent->child;
1883 prevsib->sibling != np;
1884 prevsib = prevsib->sibling)
1885 ;
1886 prevsib->sibling = np->sibling;
1887 }
1888
1889 write_unlock(&devtree_lock);
1890}
1891
1892#ifdef CONFIG_PPC_PSERIES
1893/*
1894 * Fix up the uninitialized fields in a new device node:
1895 * name, type, n_addrs, addrs, n_intrs, intrs, and pci-specific fields
1896 *
1897 * A lot of boot-time code is duplicated here, because functions such
1898 * as finish_node_interrupts, interpret_pci_props, etc. cannot use the
1899 * slab allocator.
1900 *
1901 * This should probably be split up into smaller chunks.
1902 */
1903
1904static int of_finish_dynamic_node(struct device_node *node,
1905 unsigned long *unused1, int unused2,
1906 int unused3, int unused4)
1907{
1908 struct device_node *parent = of_get_parent(node);
1909 int err = 0;
1910 phandle *ibm_phandle;
1911
1912 node->name = get_property(node, "name", NULL);
1913 node->type = get_property(node, "device_type", NULL);
1914
1915 if (!parent) {
1916 err = -ENODEV;
1917 goto out;
1918 }
1919
1920 /* We don't support that function on PowerMac, at least
1921 * not yet
1922 */
1923 if (systemcfg->platform == PLATFORM_POWERMAC)
1924 return -ENODEV;
1925
1926 /* fix up new node's linux_phandle field */
1927 if ((ibm_phandle = (unsigned int *)get_property(node, "ibm,phandle", NULL)))
1928 node->linux_phandle = *ibm_phandle;
1929
1930out:
1931 of_node_put(parent);
1932 return err;
1933}
1934
1935static int prom_reconfig_notifier(struct notifier_block *nb,
1936 unsigned long action, void *node)
1937{
1938 int err;
1939
1940 switch (action) {
1941 case PSERIES_RECONFIG_ADD:
1942 err = finish_node(node, NULL, of_finish_dynamic_node, 0, 0, 0);
1943 if (err < 0) {
1944 printk(KERN_ERR "finish_node returned %d\n", err);
1945 err = NOTIFY_BAD;
1946 }
1947 break;
1948 default:
1949 err = NOTIFY_DONE;
1950 break;
1951 }
1952 return err;
1953}
1954
1955static struct notifier_block prom_reconfig_nb = {
1956 .notifier_call = prom_reconfig_notifier,
1957 .priority = 10, /* This one needs to run first */
1958};
1959
1960static int __init prom_reconfig_setup(void)
1961{
1962 return pSeries_reconfig_notifier_register(&prom_reconfig_nb);
1963}
1964__initcall(prom_reconfig_setup);
1965#endif
1966
1967/*
1968 * Find a property with a given name for a given node
1969 * and return the value.
1970 */
1971unsigned char *get_property(struct device_node *np, const char *name,
1972 int *lenp)
1973{
1974 struct property *pp;
1975
1976 for (pp = np->properties; pp != 0; pp = pp->next)
1977 if (strcmp(pp->name, name) == 0) {
1978 if (lenp != 0)
1979 *lenp = pp->length;
1980 return pp->value;
1981 }
1982 return NULL;
1983}
1984EXPORT_SYMBOL(get_property);
1985
1986/*
1987 * Add a property to a node
1988 */
1989void prom_add_property(struct device_node* np, struct property* prop)
1990{
1991 struct property **next = &np->properties;
1992
1993 prop->next = NULL;
1994 while (*next)
1995 next = &(*next)->next;
1996 *next = prop;
1997}
1998
1999/* I quickly hacked that one, check against spec ! */
2000static inline unsigned long
2001bus_space_to_resource_flags(unsigned int bus_space)
2002{
2003 u8 space = (bus_space >> 24) & 0xf;
2004 if (space == 0)
2005 space = 0x02;
2006 if (space == 0x02)
2007 return IORESOURCE_MEM;
2008 else if (space == 0x01)
2009 return IORESOURCE_IO;
2010 else {
2011 printk(KERN_WARNING "prom.c: bus_space_to_resource_flags(), space: %x\n",
2012 bus_space);
2013 return 0;
2014 }
2015}
2016
2017#ifdef CONFIG_PCI
2018static struct resource *find_parent_pci_resource(struct pci_dev* pdev,
2019 struct address_range *range)
2020{
2021 unsigned long mask;
2022 int i;
2023
2024 /* Check this one */
2025 mask = bus_space_to_resource_flags(range->space);
2026 for (i=0; i<DEVICE_COUNT_RESOURCE; i++) {
2027 if ((pdev->resource[i].flags & mask) == mask &&
2028 pdev->resource[i].start <= range->address &&
2029 pdev->resource[i].end > range->address) {
2030 if ((range->address + range->size - 1) > pdev->resource[i].end) {
2031 /* Add better message */
2032 printk(KERN_WARNING "PCI/OF resource overlap !\n");
2033 return NULL;
2034 }
2035 break;
2036 }
2037 }
2038 if (i == DEVICE_COUNT_RESOURCE)
2039 return NULL;
2040 return &pdev->resource[i];
2041}
2042
2043/*
2044 * Request an OF device resource. Currently handles child of PCI devices,
2045 * or other nodes attached to the root node. Ultimately, put some
2046 * link to resources in the OF node.
2047 */
2048struct resource *request_OF_resource(struct device_node* node, int index,
2049 const char* name_postfix)
2050{
2051 struct pci_dev* pcidev;
2052 u8 pci_bus, pci_devfn;
2053 unsigned long iomask;
2054 struct device_node* nd;
2055 struct resource* parent;
2056 struct resource *res = NULL;
2057 int nlen, plen;
2058
2059 if (index >= node->n_addrs)
2060 goto fail;
2061
2062 /* Sanity check on bus space */
2063 iomask = bus_space_to_resource_flags(node->addrs[index].space);
2064 if (iomask & IORESOURCE_MEM)
2065 parent = &iomem_resource;
2066 else if (iomask & IORESOURCE_IO)
2067 parent = &ioport_resource;
2068 else
2069 goto fail;
2070
2071 /* Find a PCI parent if any */
2072 nd = node;
2073 pcidev = NULL;
2074 while (nd) {
2075 if (!pci_device_from_OF_node(nd, &pci_bus, &pci_devfn))
2076 pcidev = pci_find_slot(pci_bus, pci_devfn);
2077 if (pcidev) break;
2078 nd = nd->parent;
2079 }
2080 if (pcidev)
2081 parent = find_parent_pci_resource(pcidev, &node->addrs[index]);
2082 if (!parent) {
2083 printk(KERN_WARNING "request_OF_resource(%s), parent not found\n",
2084 node->name);
2085 goto fail;
2086 }
2087
2088 res = __request_region(parent, node->addrs[index].address,
2089 node->addrs[index].size, NULL);
2090 if (!res)
2091 goto fail;
2092 nlen = strlen(node->name);
2093 plen = name_postfix ? strlen(name_postfix) : 0;
2094 res->name = (const char *)kmalloc(nlen+plen+1, GFP_KERNEL);
2095 if (res->name) {
2096 strcpy((char *)res->name, node->name);
2097 if (plen)
2098 strcpy((char *)res->name+nlen, name_postfix);
2099 }
2100 return res;
2101fail:
2102 return NULL;
2103}
2104EXPORT_SYMBOL(request_OF_resource);
2105
2106int release_OF_resource(struct device_node *node, int index)
2107{
2108 struct pci_dev* pcidev;
2109 u8 pci_bus, pci_devfn;
2110 unsigned long iomask, start, end;
2111 struct device_node* nd;
2112 struct resource* parent;
2113 struct resource *res = NULL;
2114
2115 if (index >= node->n_addrs)
2116 return -EINVAL;
2117
2118 /* Sanity check on bus space */
2119 iomask = bus_space_to_resource_flags(node->addrs[index].space);
2120 if (iomask & IORESOURCE_MEM)
2121 parent = &iomem_resource;
2122 else if (iomask & IORESOURCE_IO)
2123 parent = &ioport_resource;
2124 else
2125 return -EINVAL;
2126
2127 /* Find a PCI parent if any */
2128 nd = node;
2129 pcidev = NULL;
2130 while(nd) {
2131 if (!pci_device_from_OF_node(nd, &pci_bus, &pci_devfn))
2132 pcidev = pci_find_slot(pci_bus, pci_devfn);
2133 if (pcidev) break;
2134 nd = nd->parent;
2135 }
2136 if (pcidev)
2137 parent = find_parent_pci_resource(pcidev, &node->addrs[index]);
2138 if (!parent) {
2139 printk(KERN_WARNING "release_OF_resource(%s), parent not found\n",
2140 node->name);
2141 return -ENODEV;
2142 }
2143
2144 /* Find us in the parent and its childs */
2145 res = parent->child;
2146 start = node->addrs[index].address;
2147 end = start + node->addrs[index].size - 1;
2148 while (res) {
2149 if (res->start == start && res->end == end &&
2150 (res->flags & IORESOURCE_BUSY))
2151 break;
2152 if (res->start <= start && res->end >= end)
2153 res = res->child;
2154 else
2155 res = res->sibling;
2156 }
2157 if (!res)
2158 return -ENODEV;
2159
2160 if (res->name) {
2161 kfree(res->name);
2162 res->name = NULL;
2163 }
2164 release_resource(res);
2165 kfree(res);
2166
2167 return 0;
2168}
2169EXPORT_SYMBOL(release_OF_resource);
2170#endif /* CONFIG_PCI */
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
new file mode 100644
index 000000000000..9750b3cd8ecd
--- /dev/null
+++ b/arch/powerpc/kernel/prom_init.c
@@ -0,0 +1,2109 @@
1/*
2 * Procedures for interfacing to Open Firmware.
3 *
4 * Paul Mackerras August 1996.
5 * Copyright (C) 1996-2005 Paul Mackerras.
6 *
7 * Adapted for 64bit PowerPC by Dave Engebretsen and Peter Bergner.
8 * {engebret|bergner}@us.ibm.com
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
14 */
15
16#undef DEBUG_PROM
17
18#include <stdarg.h>
19#include <linux/config.h>
20#include <linux/kernel.h>
21#include <linux/string.h>
22#include <linux/init.h>
23#include <linux/threads.h>
24#include <linux/spinlock.h>
25#include <linux/types.h>
26#include <linux/pci.h>
27#include <linux/proc_fs.h>
28#include <linux/stringify.h>
29#include <linux/delay.h>
30#include <linux/initrd.h>
31#include <linux/bitops.h>
32#include <asm/prom.h>
33#include <asm/rtas.h>
34#include <asm/page.h>
35#include <asm/processor.h>
36#include <asm/irq.h>
37#include <asm/io.h>
38#include <asm/smp.h>
39#include <asm/system.h>
40#include <asm/mmu.h>
41#include <asm/pgtable.h>
42#include <asm/pci.h>
43#include <asm/iommu.h>
44#include <asm/btext.h>
45#include <asm/sections.h>
46#include <asm/machdep.h>
47
48#ifdef CONFIG_LOGO_LINUX_CLUT224
49#include <linux/linux_logo.h>
50extern const struct linux_logo logo_linux_clut224;
51#endif
52
53/*
54 * Properties whose value is longer than this get excluded from our
55 * copy of the device tree. This value does need to be big enough to
56 * ensure that we don't lose things like the interrupt-map property
57 * on a PCI-PCI bridge.
58 */
59#define MAX_PROPERTY_LENGTH (1UL * 1024 * 1024)
60
61/*
62 * Eventually bump that one up
63 */
64#define DEVTREE_CHUNK_SIZE 0x100000
65
66/*
67 * This is the size of the local memory reserve map that gets copied
68 * into the boot params passed to the kernel. That size is totally
69 * flexible as the kernel just reads the list until it encounters an
70 * entry with size 0, so it can be changed without breaking binary
71 * compatibility
72 */
73#define MEM_RESERVE_MAP_SIZE 8
74
75/*
76 * prom_init() is called very early on, before the kernel text
77 * and data have been mapped to KERNELBASE. At this point the code
78 * is running at whatever address it has been loaded at.
79 * On ppc32 we compile with -mrelocatable, which means that references
80 * to extern and static variables get relocated automatically.
81 * On ppc64 we have to relocate the references explicitly with
82 * RELOC. (Note that strings count as static variables.)
83 *
84 * Because OF may have mapped I/O devices into the area starting at
85 * KERNELBASE, particularly on CHRP machines, we can't safely call
86 * OF once the kernel has been mapped to KERNELBASE. Therefore all
87 * OF calls must be done within prom_init().
88 *
89 * ADDR is used in calls to call_prom. The 4th and following
90 * arguments to call_prom should be 32-bit values.
91 * On ppc64, 64 bit values are truncated to 32 bits (and
92 * fortunately don't get interpreted as two arguments).
93 */
94#ifdef CONFIG_PPC64
95#define RELOC(x) (*PTRRELOC(&(x)))
96#define ADDR(x) (u32) add_reloc_offset((unsigned long)(x))
97#else
98#define RELOC(x) (x)
99#define ADDR(x) (u32) (x)
100#endif
101
102#define PROM_BUG() do { \
103 prom_printf("kernel BUG at %s line 0x%x!\n", \
104 RELOC(__FILE__), __LINE__); \
105 __asm__ __volatile__(".long " BUG_ILLEGAL_INSTR); \
106} while (0)
107
108#ifdef DEBUG_PROM
109#define prom_debug(x...) prom_printf(x)
110#else
111#define prom_debug(x...)
112#endif
113
114#ifdef CONFIG_PPC32
115#define PLATFORM_POWERMAC _MACH_Pmac
116#define PLATFORM_CHRP _MACH_chrp
117#endif
118
119
120typedef u32 prom_arg_t;
121
122struct prom_args {
123 u32 service;
124 u32 nargs;
125 u32 nret;
126 prom_arg_t args[10];
127};
128
129struct prom_t {
130 ihandle root;
131 ihandle chosen;
132 int cpu;
133 ihandle stdout;
134 ihandle mmumap;
135};
136
137struct mem_map_entry {
138 unsigned long base;
139 unsigned long size;
140};
141
142typedef u32 cell_t;
143
144extern void __start(unsigned long r3, unsigned long r4, unsigned long r5);
145
146#ifdef CONFIG_PPC64
147extern int enter_prom(struct prom_args *args, unsigned long entry);
148#else
149static inline int enter_prom(struct prom_args *args, unsigned long entry)
150{
151 return ((int (*)(struct prom_args *))entry)(args);
152}
153#endif
154
155extern void copy_and_flush(unsigned long dest, unsigned long src,
156 unsigned long size, unsigned long offset);
157
158/* prom structure */
159static struct prom_t __initdata prom;
160
161static unsigned long prom_entry __initdata;
162
163#define PROM_SCRATCH_SIZE 256
164
165static char __initdata of_stdout_device[256];
166static char __initdata prom_scratch[PROM_SCRATCH_SIZE];
167
168static unsigned long __initdata dt_header_start;
169static unsigned long __initdata dt_struct_start, dt_struct_end;
170static unsigned long __initdata dt_string_start, dt_string_end;
171
172static unsigned long __initdata prom_initrd_start, prom_initrd_end;
173
174#ifdef CONFIG_PPC64
175static int __initdata iommu_force_on;
176static int __initdata ppc64_iommu_off;
177static unsigned long __initdata prom_tce_alloc_start;
178static unsigned long __initdata prom_tce_alloc_end;
179#endif
180
181static int __initdata of_platform;
182
183static char __initdata prom_cmd_line[COMMAND_LINE_SIZE];
184
185static unsigned long __initdata prom_memory_limit;
186
187static unsigned long __initdata alloc_top;
188static unsigned long __initdata alloc_top_high;
189static unsigned long __initdata alloc_bottom;
190static unsigned long __initdata rmo_top;
191static unsigned long __initdata ram_top;
192
193static struct mem_map_entry __initdata mem_reserve_map[MEM_RESERVE_MAP_SIZE];
194static int __initdata mem_reserve_cnt;
195
196static cell_t __initdata regbuf[1024];
197
198
199#define MAX_CPU_THREADS 2
200
201/* TO GO */
202#ifdef CONFIG_HMT
203struct {
204 unsigned int pir;
205 unsigned int threadid;
206} hmt_thread_data[NR_CPUS];
207#endif /* CONFIG_HMT */
208
209/*
210 * Error results ... some OF calls will return "-1" on error, some
211 * will return 0, some will return either. To simplify, here are
212 * macros to use with any ihandle or phandle return value to check if
213 * it is valid
214 */
215
216#define PROM_ERROR (-1u)
217#define PHANDLE_VALID(p) ((p) != 0 && (p) != PROM_ERROR)
218#define IHANDLE_VALID(i) ((i) != 0 && (i) != PROM_ERROR)
219
220
221/* This is the one and *ONLY* place where we actually call open
222 * firmware.
223 */
224
225static int __init call_prom(const char *service, int nargs, int nret, ...)
226{
227 int i;
228 struct prom_args args;
229 va_list list;
230
231 args.service = ADDR(service);
232 args.nargs = nargs;
233 args.nret = nret;
234
235 va_start(list, nret);
236 for (i = 0; i < nargs; i++)
237 args.args[i] = va_arg(list, prom_arg_t);
238 va_end(list);
239
240 for (i = 0; i < nret; i++)
241 args.args[nargs+i] = 0;
242
243 if (enter_prom(&args, RELOC(prom_entry)) < 0)
244 return PROM_ERROR;
245
246 return (nret > 0) ? args.args[nargs] : 0;
247}
248
249static int __init call_prom_ret(const char *service, int nargs, int nret,
250 prom_arg_t *rets, ...)
251{
252 int i;
253 struct prom_args args;
254 va_list list;
255
256 args.service = ADDR(service);
257 args.nargs = nargs;
258 args.nret = nret;
259
260 va_start(list, rets);
261 for (i = 0; i < nargs; i++)
262 args.args[i] = va_arg(list, prom_arg_t);
263 va_end(list);
264
265 for (i = 0; i < nret; i++)
266 rets[nargs+i] = 0;
267
268 if (enter_prom(&args, RELOC(prom_entry)) < 0)
269 return PROM_ERROR;
270
271 if (rets != NULL)
272 for (i = 1; i < nret; ++i)
273 rets[i-1] = args.args[nargs+i];
274
275 return (nret > 0) ? args.args[nargs] : 0;
276}
277
278
279static void __init prom_print(const char *msg)
280{
281 const char *p, *q;
282 struct prom_t *_prom = &RELOC(prom);
283
284 if (_prom->stdout == 0)
285 return;
286
287 for (p = msg; *p != 0; p = q) {
288 for (q = p; *q != 0 && *q != '\n'; ++q)
289 ;
290 if (q > p)
291 call_prom("write", 3, 1, _prom->stdout, p, q - p);
292 if (*q == 0)
293 break;
294 ++q;
295 call_prom("write", 3, 1, _prom->stdout, ADDR("\r\n"), 2);
296 }
297}
298
299
300static void __init prom_print_hex(unsigned long val)
301{
302 int i, nibbles = sizeof(val)*2;
303 char buf[sizeof(val)*2+1];
304 struct prom_t *_prom = &RELOC(prom);
305
306 for (i = nibbles-1; i >= 0; i--) {
307 buf[i] = (val & 0xf) + '0';
308 if (buf[i] > '9')
309 buf[i] += ('a'-'0'-10);
310 val >>= 4;
311 }
312 buf[nibbles] = '\0';
313 call_prom("write", 3, 1, _prom->stdout, buf, nibbles);
314}
315
316
317static void __init prom_printf(const char *format, ...)
318{
319 const char *p, *q, *s;
320 va_list args;
321 unsigned long v;
322 struct prom_t *_prom = &RELOC(prom);
323
324 va_start(args, format);
325#ifdef CONFIG_PPC64
326 format = PTRRELOC(format);
327#endif
328 for (p = format; *p != 0; p = q) {
329 for (q = p; *q != 0 && *q != '\n' && *q != '%'; ++q)
330 ;
331 if (q > p)
332 call_prom("write", 3, 1, _prom->stdout, p, q - p);
333 if (*q == 0)
334 break;
335 if (*q == '\n') {
336 ++q;
337 call_prom("write", 3, 1, _prom->stdout,
338 ADDR("\r\n"), 2);
339 continue;
340 }
341 ++q;
342 if (*q == 0)
343 break;
344 switch (*q) {
345 case 's':
346 ++q;
347 s = va_arg(args, const char *);
348 prom_print(s);
349 break;
350 case 'x':
351 ++q;
352 v = va_arg(args, unsigned long);
353 prom_print_hex(v);
354 break;
355 }
356 }
357}
358
359
360static unsigned int __init prom_claim(unsigned long virt, unsigned long size,
361 unsigned long align)
362{
363 int ret;
364 struct prom_t *_prom = &RELOC(prom);
365
366 ret = call_prom("claim", 3, 1, (prom_arg_t)virt, (prom_arg_t)size,
367 (prom_arg_t)align);
368 if (ret != -1 && _prom->mmumap != 0)
369 /* old pmacs need us to map as well */
370 call_prom("call-method", 6, 1,
371 ADDR("map"), _prom->mmumap, 0, size, virt, virt);
372 return ret;
373}
374
375static void __init __attribute__((noreturn)) prom_panic(const char *reason)
376{
377#ifdef CONFIG_PPC64
378 reason = PTRRELOC(reason);
379#endif
380 prom_print(reason);
381 /* ToDo: should put up an SRC here on p/iSeries */
382 call_prom("exit", 0, 0);
383
384 for (;;) /* should never get here */
385 ;
386}
387
388
389static int __init prom_next_node(phandle *nodep)
390{
391 phandle node;
392
393 if ((node = *nodep) != 0
394 && (*nodep = call_prom("child", 1, 1, node)) != 0)
395 return 1;
396 if ((*nodep = call_prom("peer", 1, 1, node)) != 0)
397 return 1;
398 for (;;) {
399 if ((node = call_prom("parent", 1, 1, node)) == 0)
400 return 0;
401 if ((*nodep = call_prom("peer", 1, 1, node)) != 0)
402 return 1;
403 }
404}
405
406static int __init prom_getprop(phandle node, const char *pname,
407 void *value, size_t valuelen)
408{
409 return call_prom("getprop", 4, 1, node, ADDR(pname),
410 (u32)(unsigned long) value, (u32) valuelen);
411}
412
413static int __init prom_getproplen(phandle node, const char *pname)
414{
415 return call_prom("getproplen", 2, 1, node, ADDR(pname));
416}
417
418static int __init prom_setprop(phandle node, const char *pname,
419 void *value, size_t valuelen)
420{
421 return call_prom("setprop", 4, 1, node, ADDR(pname),
422 (u32)(unsigned long) value, (u32) valuelen);
423}
424
425/* We can't use the standard versions because of RELOC headaches. */
426#define isxdigit(c) (('0' <= (c) && (c) <= '9') \
427 || ('a' <= (c) && (c) <= 'f') \
428 || ('A' <= (c) && (c) <= 'F'))
429
430#define isdigit(c) ('0' <= (c) && (c) <= '9')
431#define islower(c) ('a' <= (c) && (c) <= 'z')
432#define toupper(c) (islower(c) ? ((c) - 'a' + 'A') : (c))
433
434unsigned long prom_strtoul(const char *cp, const char **endp)
435{
436 unsigned long result = 0, base = 10, value;
437
438 if (*cp == '0') {
439 base = 8;
440 cp++;
441 if (toupper(*cp) == 'X') {
442 cp++;
443 base = 16;
444 }
445 }
446
447 while (isxdigit(*cp) &&
448 (value = isdigit(*cp) ? *cp - '0' : toupper(*cp) - 'A' + 10) < base) {
449 result = result * base + value;
450 cp++;
451 }
452
453 if (endp)
454 *endp = cp;
455
456 return result;
457}
458
459unsigned long prom_memparse(const char *ptr, const char **retptr)
460{
461 unsigned long ret = prom_strtoul(ptr, retptr);
462 int shift = 0;
463
464 /*
465 * We can't use a switch here because GCC *may* generate a
466 * jump table which won't work, because we're not running at
467 * the address we're linked at.
468 */
469 if ('G' == **retptr || 'g' == **retptr)
470 shift = 30;
471
472 if ('M' == **retptr || 'm' == **retptr)
473 shift = 20;
474
475 if ('K' == **retptr || 'k' == **retptr)
476 shift = 10;
477
478 if (shift) {
479 ret <<= shift;
480 (*retptr)++;
481 }
482
483 return ret;
484}
485
486/*
487 * Early parsing of the command line passed to the kernel, used for
488 * "mem=x" and the options that affect the iommu
489 */
490static void __init early_cmdline_parse(void)
491{
492 struct prom_t *_prom = &RELOC(prom);
493 char *opt, *p;
494 int l = 0;
495
496 RELOC(prom_cmd_line[0]) = 0;
497 p = RELOC(prom_cmd_line);
498 if ((long)_prom->chosen > 0)
499 l = prom_getprop(_prom->chosen, "bootargs", p, COMMAND_LINE_SIZE-1);
500#ifdef CONFIG_CMDLINE
501 if (l == 0) /* dbl check */
502 strlcpy(RELOC(prom_cmd_line),
503 RELOC(CONFIG_CMDLINE), sizeof(prom_cmd_line));
504#endif /* CONFIG_CMDLINE */
505 prom_printf("command line: %s\n", RELOC(prom_cmd_line));
506
507#ifdef CONFIG_PPC64
508 opt = strstr(RELOC(prom_cmd_line), RELOC("iommu="));
509 if (opt) {
510 prom_printf("iommu opt is: %s\n", opt);
511 opt += 6;
512 while (*opt && *opt == ' ')
513 opt++;
514 if (!strncmp(opt, RELOC("off"), 3))
515 RELOC(ppc64_iommu_off) = 1;
516 else if (!strncmp(opt, RELOC("force"), 5))
517 RELOC(iommu_force_on) = 1;
518 }
519#endif
520
521 opt = strstr(RELOC(prom_cmd_line), RELOC("mem="));
522 if (opt) {
523 opt += 4;
524 RELOC(prom_memory_limit) = prom_memparse(opt, (const char **)&opt);
525#ifdef CONFIG_PPC64
526 /* Align to 16 MB == size of ppc64 large page */
527 RELOC(prom_memory_limit) = ALIGN(RELOC(prom_memory_limit), 0x1000000);
528#endif
529 }
530}
531
532#ifdef CONFIG_PPC_PSERIES
533/*
534 * To tell the firmware what our capabilities are, we have to pass
535 * it a fake 32-bit ELF header containing a couple of PT_NOTE sections
536 * that contain structures that contain the actual values.
537 */
538static struct fake_elf {
539 Elf32_Ehdr elfhdr;
540 Elf32_Phdr phdr[2];
541 struct chrpnote {
542 u32 namesz;
543 u32 descsz;
544 u32 type;
545 char name[8]; /* "PowerPC" */
546 struct chrpdesc {
547 u32 real_mode;
548 u32 real_base;
549 u32 real_size;
550 u32 virt_base;
551 u32 virt_size;
552 u32 load_base;
553 } chrpdesc;
554 } chrpnote;
555 struct rpanote {
556 u32 namesz;
557 u32 descsz;
558 u32 type;
559 char name[24]; /* "IBM,RPA-Client-Config" */
560 struct rpadesc {
561 u32 lpar_affinity;
562 u32 min_rmo_size;
563 u32 min_rmo_percent;
564 u32 max_pft_size;
565 u32 splpar;
566 u32 min_load;
567 u32 new_mem_def;
568 u32 ignore_me;
569 } rpadesc;
570 } rpanote;
571} fake_elf = {
572 .elfhdr = {
573 .e_ident = { 0x7f, 'E', 'L', 'F',
574 ELFCLASS32, ELFDATA2MSB, EV_CURRENT },
575 .e_type = ET_EXEC, /* yeah right */
576 .e_machine = EM_PPC,
577 .e_version = EV_CURRENT,
578 .e_phoff = offsetof(struct fake_elf, phdr),
579 .e_phentsize = sizeof(Elf32_Phdr),
580 .e_phnum = 2
581 },
582 .phdr = {
583 [0] = {
584 .p_type = PT_NOTE,
585 .p_offset = offsetof(struct fake_elf, chrpnote),
586 .p_filesz = sizeof(struct chrpnote)
587 }, [1] = {
588 .p_type = PT_NOTE,
589 .p_offset = offsetof(struct fake_elf, rpanote),
590 .p_filesz = sizeof(struct rpanote)
591 }
592 },
593 .chrpnote = {
594 .namesz = sizeof("PowerPC"),
595 .descsz = sizeof(struct chrpdesc),
596 .type = 0x1275,
597 .name = "PowerPC",
598 .chrpdesc = {
599 .real_mode = ~0U, /* ~0 means "don't care" */
600 .real_base = ~0U,
601 .real_size = ~0U,
602 .virt_base = ~0U,
603 .virt_size = ~0U,
604 .load_base = ~0U
605 },
606 },
607 .rpanote = {
608 .namesz = sizeof("IBM,RPA-Client-Config"),
609 .descsz = sizeof(struct rpadesc),
610 .type = 0x12759999,
611 .name = "IBM,RPA-Client-Config",
612 .rpadesc = {
613 .lpar_affinity = 0,
614 .min_rmo_size = 64, /* in megabytes */
615 .min_rmo_percent = 0,
616 .max_pft_size = 48, /* 2^48 bytes max PFT size */
617 .splpar = 1,
618 .min_load = ~0U,
619 .new_mem_def = 0
620 }
621 }
622};
623
624static void __init prom_send_capabilities(void)
625{
626 ihandle elfloader;
627
628 elfloader = call_prom("open", 1, 1, ADDR("/packages/elf-loader"));
629 if (elfloader == 0) {
630 prom_printf("couldn't open /packages/elf-loader\n");
631 return;
632 }
633 call_prom("call-method", 3, 1, ADDR("process-elf-header"),
634 elfloader, ADDR(&fake_elf));
635 call_prom("close", 1, 0, elfloader);
636}
637#endif
638
639/*
640 * Memory allocation strategy... our layout is normally:
641 *
642 * at 14Mb or more we have vmlinux, then a gap and initrd. In some
643 * rare cases, initrd might end up being before the kernel though.
644 * We assume this won't override the final kernel at 0, we have no
645 * provision to handle that in this version, but it should hopefully
646 * never happen.
647 *
648 * alloc_top is set to the top of RMO, eventually shrink down if the
649 * TCEs overlap
650 *
651 * alloc_bottom is set to the top of kernel/initrd
652 *
653 * from there, allocations are done this way : rtas is allocated
654 * topmost, and the device-tree is allocated from the bottom. We try
655 * to grow the device-tree allocation as we progress. If we can't,
656 * then we fail, we don't currently have a facility to restart
657 * elsewhere, but that shouldn't be necessary.
658 *
659 * Note that calls to reserve_mem have to be done explicitly, memory
660 * allocated with either alloc_up or alloc_down isn't automatically
661 * reserved.
662 */
663
664
665/*
666 * Allocates memory in the RMO upward from the kernel/initrd
667 *
668 * When align is 0, this is a special case, it means to allocate in place
669 * at the current location of alloc_bottom or fail (that is basically
670 * extending the previous allocation). Used for the device-tree flattening
671 */
672static unsigned long __init alloc_up(unsigned long size, unsigned long align)
673{
674 unsigned long base = RELOC(alloc_bottom);
675 unsigned long addr = 0;
676
677 if (align)
678 base = _ALIGN_UP(base, align);
679 prom_debug("alloc_up(%x, %x)\n", size, align);
680 if (RELOC(ram_top) == 0)
681 prom_panic("alloc_up() called with mem not initialized\n");
682
683 if (align)
684 base = _ALIGN_UP(RELOC(alloc_bottom), align);
685 else
686 base = RELOC(alloc_bottom);
687
688 for(; (base + size) <= RELOC(alloc_top);
689 base = _ALIGN_UP(base + 0x100000, align)) {
690 prom_debug(" trying: 0x%x\n\r", base);
691 addr = (unsigned long)prom_claim(base, size, 0);
692 if (addr != PROM_ERROR && addr != 0)
693 break;
694 addr = 0;
695 if (align == 0)
696 break;
697 }
698 if (addr == 0)
699 return 0;
700 RELOC(alloc_bottom) = addr;
701
702 prom_debug(" -> %x\n", addr);
703 prom_debug(" alloc_bottom : %x\n", RELOC(alloc_bottom));
704 prom_debug(" alloc_top : %x\n", RELOC(alloc_top));
705 prom_debug(" alloc_top_hi : %x\n", RELOC(alloc_top_high));
706 prom_debug(" rmo_top : %x\n", RELOC(rmo_top));
707 prom_debug(" ram_top : %x\n", RELOC(ram_top));
708
709 return addr;
710}
711
712/*
713 * Allocates memory downward, either from top of RMO, or if highmem
714 * is set, from the top of RAM. Note that this one doesn't handle
715 * failures. It does claim memory if highmem is not set.
716 */
717static unsigned long __init alloc_down(unsigned long size, unsigned long align,
718 int highmem)
719{
720 unsigned long base, addr = 0;
721
722 prom_debug("alloc_down(%x, %x, %s)\n", size, align,
723 highmem ? RELOC("(high)") : RELOC("(low)"));
724 if (RELOC(ram_top) == 0)
725 prom_panic("alloc_down() called with mem not initialized\n");
726
727 if (highmem) {
728 /* Carve out storage for the TCE table. */
729 addr = _ALIGN_DOWN(RELOC(alloc_top_high) - size, align);
730 if (addr <= RELOC(alloc_bottom))
731 return 0;
732 /* Will we bump into the RMO ? If yes, check out that we
733 * didn't overlap existing allocations there, if we did,
734 * we are dead, we must be the first in town !
735 */
736 if (addr < RELOC(rmo_top)) {
737 /* Good, we are first */
738 if (RELOC(alloc_top) == RELOC(rmo_top))
739 RELOC(alloc_top) = RELOC(rmo_top) = addr;
740 else
741 return 0;
742 }
743 RELOC(alloc_top_high) = addr;
744 goto bail;
745 }
746
747 base = _ALIGN_DOWN(RELOC(alloc_top) - size, align);
748 for (; base > RELOC(alloc_bottom);
749 base = _ALIGN_DOWN(base - 0x100000, align)) {
750 prom_debug(" trying: 0x%x\n\r", base);
751 addr = (unsigned long)prom_claim(base, size, 0);
752 if (addr != PROM_ERROR && addr != 0)
753 break;
754 addr = 0;
755 }
756 if (addr == 0)
757 return 0;
758 RELOC(alloc_top) = addr;
759
760 bail:
761 prom_debug(" -> %x\n", addr);
762 prom_debug(" alloc_bottom : %x\n", RELOC(alloc_bottom));
763 prom_debug(" alloc_top : %x\n", RELOC(alloc_top));
764 prom_debug(" alloc_top_hi : %x\n", RELOC(alloc_top_high));
765 prom_debug(" rmo_top : %x\n", RELOC(rmo_top));
766 prom_debug(" ram_top : %x\n", RELOC(ram_top));
767
768 return addr;
769}
770
771/*
772 * Parse a "reg" cell
773 */
774static unsigned long __init prom_next_cell(int s, cell_t **cellp)
775{
776 cell_t *p = *cellp;
777 unsigned long r = 0;
778
779 /* Ignore more than 2 cells */
780 while (s > sizeof(unsigned long) / 4) {
781 p++;
782 s--;
783 }
784 r = *p++;
785#ifdef CONFIG_PPC64
786 if (s > 1) {
787 r <<= 32;
788 r |= *(p++);
789 }
790#endif
791 *cellp = p;
792 return r;
793}
794
795/*
796 * Very dumb function for adding to the memory reserve list, but
797 * we don't need anything smarter at this point
798 *
799 * XXX Eventually check for collisions. They should NEVER happen.
800 * If problems seem to show up, it would be a good start to track
801 * them down.
802 */
803static void reserve_mem(unsigned long base, unsigned long size)
804{
805 unsigned long top = base + size;
806 unsigned long cnt = RELOC(mem_reserve_cnt);
807
808 if (size == 0)
809 return;
810
811 /* We need to always keep one empty entry so that we
812 * have our terminator with "size" set to 0 since we are
813 * dumb and just copy this entire array to the boot params
814 */
815 base = _ALIGN_DOWN(base, PAGE_SIZE);
816 top = _ALIGN_UP(top, PAGE_SIZE);
817 size = top - base;
818
819 if (cnt >= (MEM_RESERVE_MAP_SIZE - 1))
820 prom_panic("Memory reserve map exhausted !\n");
821 RELOC(mem_reserve_map)[cnt].base = base;
822 RELOC(mem_reserve_map)[cnt].size = size;
823 RELOC(mem_reserve_cnt) = cnt + 1;
824}
825
826/*
827 * Initialize memory allocation mecanism, parse "memory" nodes and
828 * obtain that way the top of memory and RMO to setup out local allocator
829 */
830static void __init prom_init_mem(void)
831{
832 phandle node;
833 char *path, type[64];
834 unsigned int plen;
835 cell_t *p, *endp;
836 struct prom_t *_prom = &RELOC(prom);
837 u32 rac, rsc;
838
839 /*
840 * We iterate the memory nodes to find
841 * 1) top of RMO (first node)
842 * 2) top of memory
843 */
844 rac = 2;
845 prom_getprop(_prom->root, "#address-cells", &rac, sizeof(rac));
846 rsc = 1;
847 prom_getprop(_prom->root, "#size-cells", &rsc, sizeof(rsc));
848 prom_debug("root_addr_cells: %x\n", (unsigned long) rac);
849 prom_debug("root_size_cells: %x\n", (unsigned long) rsc);
850
851 prom_debug("scanning memory:\n");
852 path = RELOC(prom_scratch);
853
854 for (node = 0; prom_next_node(&node); ) {
855 type[0] = 0;
856 prom_getprop(node, "device_type", type, sizeof(type));
857
858 if (type[0] == 0) {
859 /*
860 * CHRP Longtrail machines have no device_type
861 * on the memory node, so check the name instead...
862 */
863 prom_getprop(node, "name", type, sizeof(type));
864 }
865 if (strcmp(type, RELOC("memory")))
866 continue;
867
868 plen = prom_getprop(node, "reg", RELOC(regbuf), sizeof(regbuf));
869 if (plen > sizeof(regbuf)) {
870 prom_printf("memory node too large for buffer !\n");
871 plen = sizeof(regbuf);
872 }
873 p = RELOC(regbuf);
874 endp = p + (plen / sizeof(cell_t));
875
876#ifdef DEBUG_PROM
877 memset(path, 0, PROM_SCRATCH_SIZE);
878 call_prom("package-to-path", 3, 1, node, path, PROM_SCRATCH_SIZE-1);
879 prom_debug(" node %s :\n", path);
880#endif /* DEBUG_PROM */
881
882 while ((endp - p) >= (rac + rsc)) {
883 unsigned long base, size;
884
885 base = prom_next_cell(rac, &p);
886 size = prom_next_cell(rsc, &p);
887
888 if (size == 0)
889 continue;
890 prom_debug(" %x %x\n", base, size);
891 if (base == 0)
892 RELOC(rmo_top) = size;
893 if ((base + size) > RELOC(ram_top))
894 RELOC(ram_top) = base + size;
895 }
896 }
897
898 RELOC(alloc_bottom) = PAGE_ALIGN((unsigned long)&RELOC(_end) + 0x4000);
899
900 /* Check if we have an initrd after the kernel, if we do move our bottom
901 * point to after it
902 */
903 if (RELOC(prom_initrd_start)) {
904 if (RELOC(prom_initrd_end) > RELOC(alloc_bottom))
905 RELOC(alloc_bottom) = PAGE_ALIGN(RELOC(prom_initrd_end));
906 }
907
908 /*
909 * If prom_memory_limit is set we reduce the upper limits *except* for
910 * alloc_top_high. This must be the real top of RAM so we can put
911 * TCE's up there.
912 */
913
914 RELOC(alloc_top_high) = RELOC(ram_top);
915
916 if (RELOC(prom_memory_limit)) {
917 if (RELOC(prom_memory_limit) <= RELOC(alloc_bottom)) {
918 prom_printf("Ignoring mem=%x <= alloc_bottom.\n",
919 RELOC(prom_memory_limit));
920 RELOC(prom_memory_limit) = 0;
921 } else if (RELOC(prom_memory_limit) >= RELOC(ram_top)) {
922 prom_printf("Ignoring mem=%x >= ram_top.\n",
923 RELOC(prom_memory_limit));
924 RELOC(prom_memory_limit) = 0;
925 } else {
926 RELOC(ram_top) = RELOC(prom_memory_limit);
927 RELOC(rmo_top) = min(RELOC(rmo_top), RELOC(prom_memory_limit));
928 }
929 }
930
931 /*
932 * Setup our top alloc point, that is top of RMO or top of
933 * segment 0 when running non-LPAR.
934 * Some RS64 machines have buggy firmware where claims up at
935 * 1GB fail. Cap at 768MB as a workaround.
936 * Since 768MB is plenty of room, and we need to cap to something
937 * reasonable on 32-bit, cap at 768MB on all machines.
938 */
939 if (!RELOC(rmo_top))
940 RELOC(rmo_top) = RELOC(ram_top);
941 RELOC(rmo_top) = min(0x30000000ul, RELOC(rmo_top));
942 RELOC(alloc_top) = RELOC(rmo_top);
943
944 prom_printf("memory layout at init:\n");
945 prom_printf(" memory_limit : %x (16 MB aligned)\n", RELOC(prom_memory_limit));
946 prom_printf(" alloc_bottom : %x\n", RELOC(alloc_bottom));
947 prom_printf(" alloc_top : %x\n", RELOC(alloc_top));
948 prom_printf(" alloc_top_hi : %x\n", RELOC(alloc_top_high));
949 prom_printf(" rmo_top : %x\n", RELOC(rmo_top));
950 prom_printf(" ram_top : %x\n", RELOC(ram_top));
951}
952
953
954/*
955 * Allocate room for and instantiate RTAS
956 */
957static void __init prom_instantiate_rtas(void)
958{
959 phandle rtas_node;
960 ihandle rtas_inst;
961 u32 base, entry = 0;
962 u32 size = 0;
963
964 prom_debug("prom_instantiate_rtas: start...\n");
965
966 rtas_node = call_prom("finddevice", 1, 1, ADDR("/rtas"));
967 prom_debug("rtas_node: %x\n", rtas_node);
968 if (!PHANDLE_VALID(rtas_node))
969 return;
970
971 prom_getprop(rtas_node, "rtas-size", &size, sizeof(size));
972 if (size == 0)
973 return;
974
975 base = alloc_down(size, PAGE_SIZE, 0);
976 if (base == 0) {
977 prom_printf("RTAS allocation failed !\n");
978 return;
979 }
980
981 rtas_inst = call_prom("open", 1, 1, ADDR("/rtas"));
982 if (!IHANDLE_VALID(rtas_inst)) {
983 prom_printf("opening rtas package failed");
984 return;
985 }
986
987 prom_printf("instantiating rtas at 0x%x ...", base);
988
989 if (call_prom_ret("call-method", 3, 2, &entry,
990 ADDR("instantiate-rtas"),
991 rtas_inst, base) == PROM_ERROR
992 || entry == 0) {
993 prom_printf(" failed\n");
994 return;
995 }
996 prom_printf(" done\n");
997
998 reserve_mem(base, size);
999
1000 prom_setprop(rtas_node, "linux,rtas-base", &base, sizeof(base));
1001 prom_setprop(rtas_node, "linux,rtas-entry", &entry, sizeof(entry));
1002
1003 prom_debug("rtas base = 0x%x\n", base);
1004 prom_debug("rtas entry = 0x%x\n", entry);
1005 prom_debug("rtas size = 0x%x\n", (long)size);
1006
1007 prom_debug("prom_instantiate_rtas: end...\n");
1008}
1009
1010#ifdef CONFIG_PPC64
1011/*
1012 * Allocate room for and initialize TCE tables
1013 */
1014static void __init prom_initialize_tce_table(void)
1015{
1016 phandle node;
1017 ihandle phb_node;
1018 char compatible[64], type[64], model[64];
1019 char *path = RELOC(prom_scratch);
1020 u64 base, align;
1021 u32 minalign, minsize;
1022 u64 tce_entry, *tce_entryp;
1023 u64 local_alloc_top, local_alloc_bottom;
1024 u64 i;
1025
1026 if (RELOC(ppc64_iommu_off))
1027 return;
1028
1029 prom_debug("starting prom_initialize_tce_table\n");
1030
1031 /* Cache current top of allocs so we reserve a single block */
1032 local_alloc_top = RELOC(alloc_top_high);
1033 local_alloc_bottom = local_alloc_top;
1034
1035 /* Search all nodes looking for PHBs. */
1036 for (node = 0; prom_next_node(&node); ) {
1037 compatible[0] = 0;
1038 type[0] = 0;
1039 model[0] = 0;
1040 prom_getprop(node, "compatible",
1041 compatible, sizeof(compatible));
1042 prom_getprop(node, "device_type", type, sizeof(type));
1043 prom_getprop(node, "model", model, sizeof(model));
1044
1045 if ((type[0] == 0) || (strstr(type, RELOC("pci")) == NULL))
1046 continue;
1047
1048 /* Keep the old logic in tack to avoid regression. */
1049 if (compatible[0] != 0) {
1050 if ((strstr(compatible, RELOC("python")) == NULL) &&
1051 (strstr(compatible, RELOC("Speedwagon")) == NULL) &&
1052 (strstr(compatible, RELOC("Winnipeg")) == NULL))
1053 continue;
1054 } else if (model[0] != 0) {
1055 if ((strstr(model, RELOC("ython")) == NULL) &&
1056 (strstr(model, RELOC("peedwagon")) == NULL) &&
1057 (strstr(model, RELOC("innipeg")) == NULL))
1058 continue;
1059 }
1060
1061 if (prom_getprop(node, "tce-table-minalign", &minalign,
1062 sizeof(minalign)) == PROM_ERROR)
1063 minalign = 0;
1064 if (prom_getprop(node, "tce-table-minsize", &minsize,
1065 sizeof(minsize)) == PROM_ERROR)
1066 minsize = 4UL << 20;
1067
1068 /*
1069 * Even though we read what OF wants, we just set the table
1070 * size to 4 MB. This is enough to map 2GB of PCI DMA space.
1071 * By doing this, we avoid the pitfalls of trying to DMA to
1072 * MMIO space and the DMA alias hole.
1073 *
1074 * On POWER4, firmware sets the TCE region by assuming
1075 * each TCE table is 8MB. Using this memory for anything
1076 * else will impact performance, so we always allocate 8MB.
1077 * Anton
1078 */
1079 if (__is_processor(PV_POWER4) || __is_processor(PV_POWER4p))
1080 minsize = 8UL << 20;
1081 else
1082 minsize = 4UL << 20;
1083
1084 /* Align to the greater of the align or size */
1085 align = max(minalign, minsize);
1086 base = alloc_down(minsize, align, 1);
1087 if (base == 0)
1088 prom_panic("ERROR, cannot find space for TCE table.\n");
1089 if (base < local_alloc_bottom)
1090 local_alloc_bottom = base;
1091
1092 /* Save away the TCE table attributes for later use. */
1093 prom_setprop(node, "linux,tce-base", &base, sizeof(base));
1094 prom_setprop(node, "linux,tce-size", &minsize, sizeof(minsize));
1095
1096 /* It seems OF doesn't null-terminate the path :-( */
1097 memset(path, 0, sizeof(path));
1098 /* Call OF to setup the TCE hardware */
1099 if (call_prom("package-to-path", 3, 1, node,
1100 path, PROM_SCRATCH_SIZE-1) == PROM_ERROR) {
1101 prom_printf("package-to-path failed\n");
1102 }
1103
1104 prom_debug("TCE table: %s\n", path);
1105 prom_debug("\tnode = 0x%x\n", node);
1106 prom_debug("\tbase = 0x%x\n", base);
1107 prom_debug("\tsize = 0x%x\n", minsize);
1108
1109 /* Initialize the table to have a one-to-one mapping
1110 * over the allocated size.
1111 */
1112 tce_entryp = (unsigned long *)base;
1113 for (i = 0; i < (minsize >> 3) ;tce_entryp++, i++) {
1114 tce_entry = (i << PAGE_SHIFT);
1115 tce_entry |= 0x3;
1116 *tce_entryp = tce_entry;
1117 }
1118
1119 prom_printf("opening PHB %s", path);
1120 phb_node = call_prom("open", 1, 1, path);
1121 if (phb_node == 0)
1122 prom_printf("... failed\n");
1123 else
1124 prom_printf("... done\n");
1125
1126 call_prom("call-method", 6, 0, ADDR("set-64-bit-addressing"),
1127 phb_node, -1, minsize,
1128 (u32) base, (u32) (base >> 32));
1129 call_prom("close", 1, 0, phb_node);
1130 }
1131
1132 reserve_mem(local_alloc_bottom, local_alloc_top - local_alloc_bottom);
1133
1134 if (RELOC(prom_memory_limit)) {
1135 /*
1136 * We align the start to a 16MB boundary so we can map
1137 * the TCE area using large pages if possible.
1138 * The end should be the top of RAM so no need to align it.
1139 */
1140 RELOC(prom_tce_alloc_start) = _ALIGN_DOWN(local_alloc_bottom,
1141 0x1000000);
1142 RELOC(prom_tce_alloc_end) = local_alloc_top;
1143 }
1144
1145 /* Flag the first invalid entry */
1146 prom_debug("ending prom_initialize_tce_table\n");
1147}
1148#endif
1149
1150/*
1151 * With CHRP SMP we need to use the OF to start the other processors.
1152 * We can't wait until smp_boot_cpus (the OF is trashed by then)
1153 * so we have to put the processors into a holding pattern controlled
1154 * by the kernel (not OF) before we destroy the OF.
1155 *
1156 * This uses a chunk of low memory, puts some holding pattern
1157 * code there and sends the other processors off to there until
1158 * smp_boot_cpus tells them to do something. The holding pattern
1159 * checks that address until its cpu # is there, when it is that
1160 * cpu jumps to __secondary_start(). smp_boot_cpus() takes care
1161 * of setting those values.
1162 *
1163 * We also use physical address 0x4 here to tell when a cpu
1164 * is in its holding pattern code.
1165 *
1166 * -- Cort
1167 */
1168extern void __secondary_hold(void);
1169extern unsigned long __secondary_hold_spinloop;
1170extern unsigned long __secondary_hold_acknowledge;
1171
1172/*
1173 * We want to reference the copy of __secondary_hold_* in the
1174 * 0 - 0x100 address range
1175 */
1176#define LOW_ADDR(x) (((unsigned long) &(x)) & 0xff)
1177
1178static void __init prom_hold_cpus(void)
1179{
1180 unsigned long i;
1181 unsigned int reg;
1182 phandle node;
1183 char type[64];
1184 int cpuid = 0;
1185 unsigned int interrupt_server[MAX_CPU_THREADS];
1186 unsigned int cpu_threads, hw_cpu_num;
1187 int propsize;
1188 struct prom_t *_prom = &RELOC(prom);
1189 unsigned long *spinloop
1190 = (void *) LOW_ADDR(__secondary_hold_spinloop);
1191 unsigned long *acknowledge
1192 = (void *) LOW_ADDR(__secondary_hold_acknowledge);
1193#ifdef CONFIG_PPC64
1194 /* __secondary_hold is actually a descriptor, not the text address */
1195 unsigned long secondary_hold
1196 = __pa(*PTRRELOC((unsigned long *)__secondary_hold));
1197#else
1198 unsigned long secondary_hold = LOW_ADDR(__secondary_hold);
1199#endif
1200
1201 prom_debug("prom_hold_cpus: start...\n");
1202 prom_debug(" 1) spinloop = 0x%x\n", (unsigned long)spinloop);
1203 prom_debug(" 1) *spinloop = 0x%x\n", *spinloop);
1204 prom_debug(" 1) acknowledge = 0x%x\n",
1205 (unsigned long)acknowledge);
1206 prom_debug(" 1) *acknowledge = 0x%x\n", *acknowledge);
1207 prom_debug(" 1) secondary_hold = 0x%x\n", secondary_hold);
1208
1209 /* Set the common spinloop variable, so all of the secondary cpus
1210 * will block when they are awakened from their OF spinloop.
1211 * This must occur for both SMP and non SMP kernels, since OF will
1212 * be trashed when we move the kernel.
1213 */
1214 *spinloop = 0;
1215
1216#ifdef CONFIG_HMT
1217 for (i = 0; i < NR_CPUS; i++)
1218 RELOC(hmt_thread_data)[i].pir = 0xdeadbeef;
1219#endif
1220 /* look for cpus */
1221 for (node = 0; prom_next_node(&node); ) {
1222 type[0] = 0;
1223 prom_getprop(node, "device_type", type, sizeof(type));
1224 if (strcmp(type, RELOC("cpu")) != 0)
1225 continue;
1226
1227 /* Skip non-configured cpus. */
1228 if (prom_getprop(node, "status", type, sizeof(type)) > 0)
1229 if (strcmp(type, RELOC("okay")) != 0)
1230 continue;
1231
1232 reg = -1;
1233 prom_getprop(node, "reg", &reg, sizeof(reg));
1234
1235 prom_debug("\ncpuid = 0x%x\n", cpuid);
1236 prom_debug("cpu hw idx = 0x%x\n", reg);
1237
1238 /* Init the acknowledge var which will be reset by
1239 * the secondary cpu when it awakens from its OF
1240 * spinloop.
1241 */
1242 *acknowledge = (unsigned long)-1;
1243
1244 propsize = prom_getprop(node, "ibm,ppc-interrupt-server#s",
1245 &interrupt_server,
1246 sizeof(interrupt_server));
1247 if (propsize < 0) {
1248 /* no property. old hardware has no SMT */
1249 cpu_threads = 1;
1250 interrupt_server[0] = reg; /* fake it with phys id */
1251 } else {
1252 /* We have a threaded processor */
1253 cpu_threads = propsize / sizeof(u32);
1254 if (cpu_threads > MAX_CPU_THREADS) {
1255 prom_printf("SMT: too many threads!\n"
1256 "SMT: found %x, max is %x\n",
1257 cpu_threads, MAX_CPU_THREADS);
1258 cpu_threads = 1; /* ToDo: panic? */
1259 }
1260 }
1261
1262 hw_cpu_num = interrupt_server[0];
1263 if (hw_cpu_num != _prom->cpu) {
1264 /* Primary Thread of non-boot cpu */
1265 prom_printf("%x : starting cpu hw idx %x... ", cpuid, reg);
1266 call_prom("start-cpu", 3, 0, node,
1267 secondary_hold, reg);
1268
1269 for (i = 0; (i < 100000000) &&
1270 (*acknowledge == ((unsigned long)-1)); i++ )
1271 mb();
1272
1273 if (*acknowledge == reg)
1274 prom_printf("done\n");
1275 else
1276 prom_printf("failed: %x\n", *acknowledge);
1277 }
1278#ifdef CONFIG_SMP
1279 else
1280 prom_printf("%x : boot cpu %x\n", cpuid, reg);
1281#endif /* CONFIG_SMP */
1282
1283 /* Reserve cpu #s for secondary threads. They start later. */
1284 cpuid += cpu_threads;
1285 }
1286#ifdef CONFIG_HMT
1287 /* Only enable HMT on processors that provide support. */
1288 if (__is_processor(PV_PULSAR) ||
1289 __is_processor(PV_ICESTAR) ||
1290 __is_processor(PV_SSTAR)) {
1291 prom_printf(" starting secondary threads\n");
1292
1293 for (i = 0; i < NR_CPUS; i += 2) {
1294 if (!cpu_online(i))
1295 continue;
1296
1297 if (i == 0) {
1298 unsigned long pir = mfspr(SPRN_PIR);
1299 if (__is_processor(PV_PULSAR)) {
1300 RELOC(hmt_thread_data)[i].pir =
1301 pir & 0x1f;
1302 } else {
1303 RELOC(hmt_thread_data)[i].pir =
1304 pir & 0x3ff;
1305 }
1306 }
1307 }
1308 } else {
1309 prom_printf("Processor is not HMT capable\n");
1310 }
1311#endif
1312
1313 if (cpuid > NR_CPUS)
1314 prom_printf("WARNING: maximum CPUs (" __stringify(NR_CPUS)
1315 ") exceeded: ignoring extras\n");
1316
1317 prom_debug("prom_hold_cpus: end...\n");
1318}
1319
1320
1321static void __init prom_init_client_services(unsigned long pp)
1322{
1323 struct prom_t *_prom = &RELOC(prom);
1324
1325 /* Get a handle to the prom entry point before anything else */
1326 RELOC(prom_entry) = pp;
1327
1328 /* get a handle for the stdout device */
1329 _prom->chosen = call_prom("finddevice", 1, 1, ADDR("/chosen"));
1330 if (!PHANDLE_VALID(_prom->chosen))
1331 prom_panic("cannot find chosen"); /* msg won't be printed :( */
1332
1333 /* get device tree root */
1334 _prom->root = call_prom("finddevice", 1, 1, ADDR("/"));
1335 if (!PHANDLE_VALID(_prom->root))
1336 prom_panic("cannot find device tree root"); /* msg won't be printed :( */
1337
1338 _prom->mmumap = 0;
1339}
1340
1341#ifdef CONFIG_PPC32
1342/*
1343 * For really old powermacs, we need to map things we claim.
1344 * For that, we need the ihandle of the mmu.
1345 */
1346static void __init prom_find_mmu(void)
1347{
1348 struct prom_t *_prom = &RELOC(prom);
1349 phandle oprom;
1350 char version[64];
1351
1352 oprom = call_prom("finddevice", 1, 1, ADDR("/openprom"));
1353 if (!PHANDLE_VALID(oprom))
1354 return;
1355 if (prom_getprop(oprom, "model", version, sizeof(version)) <= 0)
1356 return;
1357 version[sizeof(version) - 1] = 0;
1358 prom_printf("OF version is '%s'\n", version);
1359 /* XXX might need to add other versions here */
1360 if (strcmp(version, "Open Firmware, 1.0.5") != 0)
1361 return;
1362 prom_getprop(_prom->chosen, "mmu", &_prom->mmumap,
1363 sizeof(_prom->mmumap));
1364}
1365#else
1366#define prom_find_mmu()
1367#endif
1368
1369static void __init prom_init_stdout(void)
1370{
1371 struct prom_t *_prom = &RELOC(prom);
1372 char *path = RELOC(of_stdout_device);
1373 char type[16];
1374 u32 val;
1375
1376 if (prom_getprop(_prom->chosen, "stdout", &val, sizeof(val)) <= 0)
1377 prom_panic("cannot find stdout");
1378
1379 _prom->stdout = val;
1380
1381 /* Get the full OF pathname of the stdout device */
1382 memset(path, 0, 256);
1383 call_prom("instance-to-path", 3, 1, _prom->stdout, path, 255);
1384 val = call_prom("instance-to-package", 1, 1, _prom->stdout);
1385 prom_setprop(_prom->chosen, "linux,stdout-package", &val, sizeof(val));
1386 prom_printf("OF stdout device is: %s\n", RELOC(of_stdout_device));
1387 prom_setprop(_prom->chosen, "linux,stdout-path",
1388 RELOC(of_stdout_device), strlen(RELOC(of_stdout_device))+1);
1389
1390 /* If it's a display, note it */
1391 memset(type, 0, sizeof(type));
1392 prom_getprop(val, "device_type", type, sizeof(type));
1393 if (strcmp(type, RELOC("display")) == 0)
1394 prom_setprop(val, "linux,boot-display", NULL, 0);
1395}
1396
1397static void __init prom_close_stdin(void)
1398{
1399 struct prom_t *_prom = &RELOC(prom);
1400 ihandle val;
1401
1402 if (prom_getprop(_prom->chosen, "stdin", &val, sizeof(val)) > 0)
1403 call_prom("close", 1, 0, val);
1404}
1405
1406static int __init prom_find_machine_type(void)
1407{
1408 struct prom_t *_prom = &RELOC(prom);
1409 char compat[256];
1410 int len, i = 0;
1411 phandle rtas;
1412
1413 len = prom_getprop(_prom->root, "compatible",
1414 compat, sizeof(compat)-1);
1415 if (len > 0) {
1416 compat[len] = 0;
1417 while (i < len) {
1418 char *p = &compat[i];
1419 int sl = strlen(p);
1420 if (sl == 0)
1421 break;
1422 if (strstr(p, RELOC("Power Macintosh")) ||
1423 strstr(p, RELOC("MacRISC")))
1424 return PLATFORM_POWERMAC;
1425#ifdef CONFIG_PPC64
1426 if (strstr(p, RELOC("Momentum,Maple")))
1427 return PLATFORM_MAPLE;
1428#endif
1429 i += sl + 1;
1430 }
1431 }
1432#ifdef CONFIG_PPC64
1433 /* Default to pSeries. We need to know if we are running LPAR */
1434 rtas = call_prom("finddevice", 1, 1, ADDR("/rtas"));
1435 if (PHANDLE_VALID(rtas)) {
1436 int x = prom_getproplen(rtas, "ibm,hypertas-functions");
1437 if (x != PROM_ERROR) {
1438 prom_printf("Hypertas detected, assuming LPAR !\n");
1439 return PLATFORM_PSERIES_LPAR;
1440 }
1441 }
1442 return PLATFORM_PSERIES;
1443#else
1444 return PLATFORM_CHRP;
1445#endif
1446}
1447
1448static int __init prom_set_color(ihandle ih, int i, int r, int g, int b)
1449{
1450 return call_prom("call-method", 6, 1, ADDR("color!"), ih, i, b, g, r);
1451}
1452
1453/*
1454 * If we have a display that we don't know how to drive,
1455 * we will want to try to execute OF's open method for it
1456 * later. However, OF will probably fall over if we do that
1457 * we've taken over the MMU.
1458 * So we check whether we will need to open the display,
1459 * and if so, open it now.
1460 */
1461static void __init prom_check_displays(void)
1462{
1463 char type[16], *path;
1464 phandle node;
1465 ihandle ih;
1466 int i;
1467
1468 static unsigned char default_colors[] = {
1469 0x00, 0x00, 0x00,
1470 0x00, 0x00, 0xaa,
1471 0x00, 0xaa, 0x00,
1472 0x00, 0xaa, 0xaa,
1473 0xaa, 0x00, 0x00,
1474 0xaa, 0x00, 0xaa,
1475 0xaa, 0xaa, 0x00,
1476 0xaa, 0xaa, 0xaa,
1477 0x55, 0x55, 0x55,
1478 0x55, 0x55, 0xff,
1479 0x55, 0xff, 0x55,
1480 0x55, 0xff, 0xff,
1481 0xff, 0x55, 0x55,
1482 0xff, 0x55, 0xff,
1483 0xff, 0xff, 0x55,
1484 0xff, 0xff, 0xff
1485 };
1486 const unsigned char *clut;
1487
1488 prom_printf("Looking for displays\n");
1489 for (node = 0; prom_next_node(&node); ) {
1490 memset(type, 0, sizeof(type));
1491 prom_getprop(node, "device_type", type, sizeof(type));
1492 if (strcmp(type, RELOC("display")) != 0)
1493 continue;
1494
1495 /* It seems OF doesn't null-terminate the path :-( */
1496 path = RELOC(prom_scratch);
1497 memset(path, 0, PROM_SCRATCH_SIZE);
1498
1499 /*
1500 * leave some room at the end of the path for appending extra
1501 * arguments
1502 */
1503 if (call_prom("package-to-path", 3, 1, node, path,
1504 PROM_SCRATCH_SIZE-10) == PROM_ERROR)
1505 continue;
1506 prom_printf("found display : %s, opening ... ", path);
1507
1508 ih = call_prom("open", 1, 1, path);
1509 if (ih == 0) {
1510 prom_printf("failed\n");
1511 continue;
1512 }
1513
1514 /* Success */
1515 prom_printf("done\n");
1516 prom_setprop(node, "linux,opened", NULL, 0);
1517
1518 /* Setup a usable color table when the appropriate
1519 * method is available. Should update this to set-colors */
1520 clut = RELOC(default_colors);
1521 for (i = 0; i < 32; i++, clut += 3)
1522 if (prom_set_color(ih, i, clut[0], clut[1],
1523 clut[2]) != 0)
1524 break;
1525
1526#ifdef CONFIG_LOGO_LINUX_CLUT224
1527 clut = PTRRELOC(RELOC(logo_linux_clut224.clut));
1528 for (i = 0; i < RELOC(logo_linux_clut224.clutsize); i++, clut += 3)
1529 if (prom_set_color(ih, i + 32, clut[0], clut[1],
1530 clut[2]) != 0)
1531 break;
1532#endif /* CONFIG_LOGO_LINUX_CLUT224 */
1533 }
1534}
1535
1536
1537/* Return (relocated) pointer to this much memory: moves initrd if reqd. */
1538static void __init *make_room(unsigned long *mem_start, unsigned long *mem_end,
1539 unsigned long needed, unsigned long align)
1540{
1541 void *ret;
1542
1543 *mem_start = _ALIGN(*mem_start, align);
1544 while ((*mem_start + needed) > *mem_end) {
1545 unsigned long room, chunk;
1546
1547 prom_debug("Chunk exhausted, claiming more at %x...\n",
1548 RELOC(alloc_bottom));
1549 room = RELOC(alloc_top) - RELOC(alloc_bottom);
1550 if (room > DEVTREE_CHUNK_SIZE)
1551 room = DEVTREE_CHUNK_SIZE;
1552 if (room < PAGE_SIZE)
1553 prom_panic("No memory for flatten_device_tree (no room)");
1554 chunk = alloc_up(room, 0);
1555 if (chunk == 0)
1556 prom_panic("No memory for flatten_device_tree (claim failed)");
1557 *mem_end = RELOC(alloc_top);
1558 }
1559
1560 ret = (void *)*mem_start;
1561 *mem_start += needed;
1562
1563 return ret;
1564}
1565
1566#define dt_push_token(token, mem_start, mem_end) \
1567 do { *((u32 *)make_room(mem_start, mem_end, 4, 4)) = token; } while(0)
1568
1569static unsigned long __init dt_find_string(char *str)
1570{
1571 char *s, *os;
1572
1573 s = os = (char *)RELOC(dt_string_start);
1574 s += 4;
1575 while (s < (char *)RELOC(dt_string_end)) {
1576 if (strcmp(s, str) == 0)
1577 return s - os;
1578 s += strlen(s) + 1;
1579 }
1580 return 0;
1581}
1582
1583/*
1584 * The Open Firmware 1275 specification states properties must be 31 bytes or
1585 * less, however not all firmwares obey this. Make it 64 bytes to be safe.
1586 */
1587#define MAX_PROPERTY_NAME 64
1588
1589static void __init scan_dt_build_strings(phandle node,
1590 unsigned long *mem_start,
1591 unsigned long *mem_end)
1592{
1593 char *prev_name, *namep, *sstart;
1594 unsigned long soff;
1595 phandle child;
1596
1597 sstart = (char *)RELOC(dt_string_start);
1598
1599 /* get and store all property names */
1600 prev_name = RELOC("");
1601 for (;;) {
1602 /* 64 is max len of name including nul. */
1603 namep = make_room(mem_start, mem_end, MAX_PROPERTY_NAME, 1);
1604 if (call_prom("nextprop", 3, 1, node, prev_name, namep) != 1) {
1605 /* No more nodes: unwind alloc */
1606 *mem_start = (unsigned long)namep;
1607 break;
1608 }
1609
1610 /* skip "name" */
1611 if (strcmp(namep, RELOC("name")) == 0) {
1612 *mem_start = (unsigned long)namep;
1613 prev_name = RELOC("name");
1614 continue;
1615 }
1616 /* get/create string entry */
1617 soff = dt_find_string(namep);
1618 if (soff != 0) {
1619 *mem_start = (unsigned long)namep;
1620 namep = sstart + soff;
1621 } else {
1622 /* Trim off some if we can */
1623 *mem_start = (unsigned long)namep + strlen(namep) + 1;
1624 RELOC(dt_string_end) = *mem_start;
1625 }
1626 prev_name = namep;
1627 }
1628
1629 /* do all our children */
1630 child = call_prom("child", 1, 1, node);
1631 while (child != 0) {
1632 scan_dt_build_strings(child, mem_start, mem_end);
1633 child = call_prom("peer", 1, 1, child);
1634 }
1635}
1636
1637static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start,
1638 unsigned long *mem_end)
1639{
1640 phandle child;
1641 char *namep, *prev_name, *sstart, *p, *ep, *lp, *path;
1642 unsigned long soff;
1643 unsigned char *valp;
1644 static char pname[MAX_PROPERTY_NAME];
1645 int l, room;
1646
1647 dt_push_token(OF_DT_BEGIN_NODE, mem_start, mem_end);
1648
1649 /* get the node's full name */
1650 namep = (char *)*mem_start;
1651 room = *mem_end - *mem_start;
1652 if (room > 255)
1653 room = 255;
1654 l = call_prom("package-to-path", 3, 1, node, namep, room);
1655 if (l >= 0) {
1656 /* Didn't fit? Get more room. */
1657 if (l >= room) {
1658 if (l >= *mem_end - *mem_start)
1659 namep = make_room(mem_start, mem_end, l+1, 1);
1660 call_prom("package-to-path", 3, 1, node, namep, l);
1661 }
1662 namep[l] = '\0';
1663
1664 /* Fixup an Apple bug where they have bogus \0 chars in the
1665 * middle of the path in some properties, and extract
1666 * the unit name (everything after the last '/').
1667 */
1668 for (lp = p = namep, ep = namep + l; p < ep; p++) {
1669 if (*p == '/')
1670 lp = namep;
1671 else if (*p != 0)
1672 *lp++ = *p;
1673 }
1674 *lp = 0;
1675 *mem_start = _ALIGN((unsigned long)lp + 1, 4);
1676 }
1677
1678 /* get it again for debugging */
1679 path = RELOC(prom_scratch);
1680 memset(path, 0, PROM_SCRATCH_SIZE);
1681 call_prom("package-to-path", 3, 1, node, path, PROM_SCRATCH_SIZE-1);
1682
1683 /* get and store all properties */
1684 prev_name = RELOC("");
1685 sstart = (char *)RELOC(dt_string_start);
1686 for (;;) {
1687 if (call_prom("nextprop", 3, 1, node, prev_name,
1688 RELOC(pname)) != 1)
1689 break;
1690
1691 /* skip "name" */
1692 if (strcmp(RELOC(pname), RELOC("name")) == 0) {
1693 prev_name = RELOC("name");
1694 continue;
1695 }
1696
1697 /* find string offset */
1698 soff = dt_find_string(RELOC(pname));
1699 if (soff == 0) {
1700 prom_printf("WARNING: Can't find string index for"
1701 " <%s>, node %s\n", RELOC(pname), path);
1702 break;
1703 }
1704 prev_name = sstart + soff;
1705
1706 /* get length */
1707 l = call_prom("getproplen", 2, 1, node, RELOC(pname));
1708
1709 /* sanity checks */
1710 if (l == PROM_ERROR)
1711 continue;
1712 if (l > MAX_PROPERTY_LENGTH) {
1713 prom_printf("WARNING: ignoring large property ");
1714 /* It seems OF doesn't null-terminate the path :-( */
1715 prom_printf("[%s] ", path);
1716 prom_printf("%s length 0x%x\n", RELOC(pname), l);
1717 continue;
1718 }
1719
1720 /* push property head */
1721 dt_push_token(OF_DT_PROP, mem_start, mem_end);
1722 dt_push_token(l, mem_start, mem_end);
1723 dt_push_token(soff, mem_start, mem_end);
1724
1725 /* push property content */
1726 valp = make_room(mem_start, mem_end, l, 4);
1727 call_prom("getprop", 4, 1, node, RELOC(pname), valp, l);
1728 *mem_start = _ALIGN(*mem_start, 4);
1729 }
1730
1731 /* Add a "linux,phandle" property. */
1732 soff = dt_find_string(RELOC("linux,phandle"));
1733 if (soff == 0)
1734 prom_printf("WARNING: Can't find string index for"
1735 " <linux-phandle> node %s\n", path);
1736 else {
1737 dt_push_token(OF_DT_PROP, mem_start, mem_end);
1738 dt_push_token(4, mem_start, mem_end);
1739 dt_push_token(soff, mem_start, mem_end);
1740 valp = make_room(mem_start, mem_end, 4, 4);
1741 *(u32 *)valp = node;
1742 }
1743
1744 /* do all our children */
1745 child = call_prom("child", 1, 1, node);
1746 while (child != 0) {
1747 scan_dt_build_struct(child, mem_start, mem_end);
1748 child = call_prom("peer", 1, 1, child);
1749 }
1750
1751 dt_push_token(OF_DT_END_NODE, mem_start, mem_end);
1752}
1753
1754static void __init flatten_device_tree(void)
1755{
1756 phandle root;
1757 unsigned long mem_start, mem_end, room;
1758 struct boot_param_header *hdr;
1759 struct prom_t *_prom = &RELOC(prom);
1760 char *namep;
1761 u64 *rsvmap;
1762
1763 /*
1764 * Check how much room we have between alloc top & bottom (+/- a
1765 * few pages), crop to 4Mb, as this is our "chuck" size
1766 */
1767 room = RELOC(alloc_top) - RELOC(alloc_bottom) - 0x4000;
1768 if (room > DEVTREE_CHUNK_SIZE)
1769 room = DEVTREE_CHUNK_SIZE;
1770 prom_debug("starting device tree allocs at %x\n", RELOC(alloc_bottom));
1771
1772 /* Now try to claim that */
1773 mem_start = (unsigned long)alloc_up(room, PAGE_SIZE);
1774 if (mem_start == 0)
1775 prom_panic("Can't allocate initial device-tree chunk\n");
1776 mem_end = RELOC(alloc_top);
1777
1778 /* Get root of tree */
1779 root = call_prom("peer", 1, 1, (phandle)0);
1780 if (root == (phandle)0)
1781 prom_panic ("couldn't get device tree root\n");
1782
1783 /* Build header and make room for mem rsv map */
1784 mem_start = _ALIGN(mem_start, 4);
1785 hdr = make_room(&mem_start, &mem_end,
1786 sizeof(struct boot_param_header), 4);
1787 RELOC(dt_header_start) = (unsigned long)hdr;
1788 rsvmap = make_room(&mem_start, &mem_end, sizeof(mem_reserve_map), 8);
1789
1790 /* Start of strings */
1791 mem_start = PAGE_ALIGN(mem_start);
1792 RELOC(dt_string_start) = mem_start;
1793 mem_start += 4; /* hole */
1794
1795 /* Add "linux,phandle" in there, we'll need it */
1796 namep = make_room(&mem_start, &mem_end, 16, 1);
1797 strcpy(namep, RELOC("linux,phandle"));
1798 mem_start = (unsigned long)namep + strlen(namep) + 1;
1799
1800 /* Build string array */
1801 prom_printf("Building dt strings...\n");
1802 scan_dt_build_strings(root, &mem_start, &mem_end);
1803 RELOC(dt_string_end) = mem_start;
1804
1805 /* Build structure */
1806 mem_start = PAGE_ALIGN(mem_start);
1807 RELOC(dt_struct_start) = mem_start;
1808 prom_printf("Building dt structure...\n");
1809 scan_dt_build_struct(root, &mem_start, &mem_end);
1810 dt_push_token(OF_DT_END, &mem_start, &mem_end);
1811 RELOC(dt_struct_end) = PAGE_ALIGN(mem_start);
1812
1813 /* Finish header */
1814 hdr->boot_cpuid_phys = _prom->cpu;
1815 hdr->magic = OF_DT_HEADER;
1816 hdr->totalsize = RELOC(dt_struct_end) - RELOC(dt_header_start);
1817 hdr->off_dt_struct = RELOC(dt_struct_start) - RELOC(dt_header_start);
1818 hdr->off_dt_strings = RELOC(dt_string_start) - RELOC(dt_header_start);
1819 hdr->dt_strings_size = RELOC(dt_string_end) - RELOC(dt_string_start);
1820 hdr->off_mem_rsvmap = ((unsigned long)rsvmap) - RELOC(dt_header_start);
1821 hdr->version = OF_DT_VERSION;
1822 /* Version 16 is not backward compatible */
1823 hdr->last_comp_version = 0x10;
1824
1825 /* Reserve the whole thing and copy the reserve map in, we
1826 * also bump mem_reserve_cnt to cause further reservations to
1827 * fail since it's too late.
1828 */
1829 reserve_mem(RELOC(dt_header_start), hdr->totalsize);
1830 memcpy(rsvmap, RELOC(mem_reserve_map), sizeof(mem_reserve_map));
1831
1832#ifdef DEBUG_PROM
1833 {
1834 int i;
1835 prom_printf("reserved memory map:\n");
1836 for (i = 0; i < RELOC(mem_reserve_cnt); i++)
1837 prom_printf(" %x - %x\n",
1838 RELOC(mem_reserve_map)[i].base,
1839 RELOC(mem_reserve_map)[i].size);
1840 }
1841#endif
1842 RELOC(mem_reserve_cnt) = MEM_RESERVE_MAP_SIZE;
1843
1844 prom_printf("Device tree strings 0x%x -> 0x%x\n",
1845 RELOC(dt_string_start), RELOC(dt_string_end));
1846 prom_printf("Device tree struct 0x%x -> 0x%x\n",
1847 RELOC(dt_struct_start), RELOC(dt_struct_end));
1848
1849}
1850
1851
1852static void __init fixup_device_tree(void)
1853{
1854#if defined(CONFIG_PPC64) && defined(CONFIG_PPC_PMAC)
1855 phandle u3, i2c, mpic;
1856 u32 u3_rev;
1857 u32 interrupts[2];
1858 u32 parent;
1859
1860 /* Some G5s have a missing interrupt definition, fix it up here */
1861 u3 = call_prom("finddevice", 1, 1, ADDR("/u3@0,f8000000"));
1862 if (!PHANDLE_VALID(u3))
1863 return;
1864 i2c = call_prom("finddevice", 1, 1, ADDR("/u3@0,f8000000/i2c@f8001000"));
1865 if (!PHANDLE_VALID(i2c))
1866 return;
1867 mpic = call_prom("finddevice", 1, 1, ADDR("/u3@0,f8000000/mpic@f8040000"));
1868 if (!PHANDLE_VALID(mpic))
1869 return;
1870
1871 /* check if proper rev of u3 */
1872 if (prom_getprop(u3, "device-rev", &u3_rev, sizeof(u3_rev))
1873 == PROM_ERROR)
1874 return;
1875 if (u3_rev != 0x35 && u3_rev != 0x37)
1876 return;
1877 /* does it need fixup ? */
1878 if (prom_getproplen(i2c, "interrupts") > 0)
1879 return;
1880
1881 prom_printf("fixing up bogus interrupts for u3 i2c...\n");
1882
1883 /* interrupt on this revision of u3 is number 0 and level */
1884 interrupts[0] = 0;
1885 interrupts[1] = 1;
1886 prom_setprop(i2c, "interrupts", &interrupts, sizeof(interrupts));
1887 parent = (u32)mpic;
1888 prom_setprop(i2c, "interrupt-parent", &parent, sizeof(parent));
1889#endif
1890}
1891
1892
1893static void __init prom_find_boot_cpu(void)
1894{
1895 struct prom_t *_prom = &RELOC(prom);
1896 u32 getprop_rval;
1897 ihandle prom_cpu;
1898 phandle cpu_pkg;
1899
1900 _prom->cpu = 0;
1901 if (prom_getprop(_prom->chosen, "cpu", &prom_cpu, sizeof(prom_cpu)) <= 0)
1902 return;
1903
1904 cpu_pkg = call_prom("instance-to-package", 1, 1, prom_cpu);
1905
1906 prom_getprop(cpu_pkg, "reg", &getprop_rval, sizeof(getprop_rval));
1907 _prom->cpu = getprop_rval;
1908
1909 prom_debug("Booting CPU hw index = 0x%x\n", _prom->cpu);
1910}
1911
1912static void __init prom_check_initrd(unsigned long r3, unsigned long r4)
1913{
1914#ifdef CONFIG_BLK_DEV_INITRD
1915 struct prom_t *_prom = &RELOC(prom);
1916
1917 if (r3 && r4 && r4 != 0xdeadbeef) {
1918 unsigned long val;
1919
1920 RELOC(prom_initrd_start) = (r3 >= KERNELBASE) ? __pa(r3) : r3;
1921 RELOC(prom_initrd_end) = RELOC(prom_initrd_start) + r4;
1922
1923 val = RELOC(prom_initrd_start);
1924 prom_setprop(_prom->chosen, "linux,initrd-start", &val,
1925 sizeof(val));
1926 val = RELOC(prom_initrd_end);
1927 prom_setprop(_prom->chosen, "linux,initrd-end", &val,
1928 sizeof(val));
1929
1930 reserve_mem(RELOC(prom_initrd_start),
1931 RELOC(prom_initrd_end) - RELOC(prom_initrd_start));
1932
1933 prom_debug("initrd_start=0x%x\n", RELOC(prom_initrd_start));
1934 prom_debug("initrd_end=0x%x\n", RELOC(prom_initrd_end));
1935 }
1936#endif /* CONFIG_BLK_DEV_INITRD */
1937}
1938
1939/*
1940 * We enter here early on, when the Open Firmware prom is still
1941 * handling exceptions and the MMU hash table for us.
1942 */
1943
1944unsigned long __init prom_init(unsigned long r3, unsigned long r4,
1945 unsigned long pp,
1946 unsigned long r6, unsigned long r7)
1947{
1948 struct prom_t *_prom;
1949 unsigned long hdr;
1950 u32 getprop_rval;
1951 unsigned long offset = reloc_offset();
1952
1953#ifdef CONFIG_PPC32
1954 reloc_got2(offset);
1955#endif
1956
1957 _prom = &RELOC(prom);
1958
1959 /*
1960 * First zero the BSS
1961 */
1962 memset(&RELOC(__bss_start), 0, __bss_stop - __bss_start);
1963
1964 /*
1965 * Init interface to Open Firmware, get some node references,
1966 * like /chosen
1967 */
1968 prom_init_client_services(pp);
1969
1970 /*
1971 * Init prom stdout device
1972 */
1973 prom_init_stdout();
1974
1975 /*
1976 * See if this OF is old enough that we need to do explicit maps
1977 */
1978 prom_find_mmu();
1979
1980 /*
1981 * Check for an initrd
1982 */
1983 prom_check_initrd(r3, r4);
1984
1985 /*
1986 * Get default machine type. At this point, we do not differentiate
1987 * between pSeries SMP and pSeries LPAR
1988 */
1989 RELOC(of_platform) = prom_find_machine_type();
1990 getprop_rval = RELOC(of_platform);
1991 prom_setprop(_prom->chosen, "linux,platform",
1992 &getprop_rval, sizeof(getprop_rval));
1993
1994#ifdef CONFIG_PPC_PSERIES
1995 /*
1996 * On pSeries, inform the firmware about our capabilities
1997 */
1998 if (RELOC(of_platform) & PLATFORM_PSERIES)
1999 prom_send_capabilities();
2000#endif
2001
2002 /*
2003 * On pSeries and BPA, copy the CPU hold code
2004 */
2005 if (RELOC(of_platform) != PLATFORM_POWERMAC)
2006 copy_and_flush(0, KERNELBASE + offset, 0x100, 0);
2007
2008 /*
2009 * Do early parsing of command line
2010 */
2011 early_cmdline_parse();
2012
2013 /*
2014 * Initialize memory management within prom_init
2015 */
2016 prom_init_mem();
2017
2018 /*
2019 * Determine which cpu is actually running right _now_
2020 */
2021 prom_find_boot_cpu();
2022
2023 /*
2024 * Initialize display devices
2025 */
2026 prom_check_displays();
2027
2028#ifdef CONFIG_PPC64
2029 /*
2030 * Initialize IOMMU (TCE tables) on pSeries. Do that before anything else
2031 * that uses the allocator, we need to make sure we get the top of memory
2032 * available for us here...
2033 */
2034 if (RELOC(of_platform) == PLATFORM_PSERIES)
2035 prom_initialize_tce_table();
2036#endif
2037
2038 /*
2039 * On non-powermacs, try to instantiate RTAS and puts all CPUs
2040 * in spin-loops. PowerMacs don't have a working RTAS and use
2041 * a different way to spin CPUs
2042 */
2043 if (RELOC(of_platform) != PLATFORM_POWERMAC) {
2044 prom_instantiate_rtas();
2045 prom_hold_cpus();
2046 }
2047
2048 /*
2049 * Fill in some infos for use by the kernel later on
2050 */
2051 if (RELOC(prom_memory_limit))
2052 prom_setprop(_prom->chosen, "linux,memory-limit",
2053 &RELOC(prom_memory_limit),
2054 sizeof(prom_memory_limit));
2055#ifdef CONFIG_PPC64
2056 if (RELOC(ppc64_iommu_off))
2057 prom_setprop(_prom->chosen, "linux,iommu-off", NULL, 0);
2058
2059 if (RELOC(iommu_force_on))
2060 prom_setprop(_prom->chosen, "linux,iommu-force-on", NULL, 0);
2061
2062 if (RELOC(prom_tce_alloc_start)) {
2063 prom_setprop(_prom->chosen, "linux,tce-alloc-start",
2064 &RELOC(prom_tce_alloc_start),
2065 sizeof(prom_tce_alloc_start));
2066 prom_setprop(_prom->chosen, "linux,tce-alloc-end",
2067 &RELOC(prom_tce_alloc_end),
2068 sizeof(prom_tce_alloc_end));
2069 }
2070#endif
2071
2072 /*
2073 * Fixup any known bugs in the device-tree
2074 */
2075 fixup_device_tree();
2076
2077 /*
2078 * Now finally create the flattened device-tree
2079 */
2080 prom_printf("copying OF device tree ...\n");
2081 flatten_device_tree();
2082
2083 /* in case stdin is USB and still active on IBM machines... */
2084 prom_close_stdin();
2085
2086 /*
2087 * Call OF "quiesce" method to shut down pending DMA's from
2088 * devices etc...
2089 */
2090 prom_printf("Calling quiesce ...\n");
2091 call_prom("quiesce", 0, 0);
2092
2093 /*
2094 * And finally, call the kernel passing it the flattened device
2095 * tree and NULL as r5, thus triggering the new entry point which
2096 * is common to us and kexec
2097 */
2098 hdr = RELOC(dt_header_start);
2099 prom_printf("returning from prom_init\n");
2100 prom_debug("->dt_header_start=0x%x\n", hdr);
2101
2102#ifdef CONFIG_PPC32
2103 reloc_got2(-offset);
2104#endif
2105
2106 __start(hdr, KERNELBASE + offset, 0);
2107
2108 return 0;
2109}
diff --git a/arch/ppc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index e7aee4108dea..568ea335d616 100644
--- a/arch/ppc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/kernel/ptrace.c
3 *
4 * PowerPC version 2 * PowerPC version
5 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) 3 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
6 * 4 *
@@ -10,13 +8,14 @@
10 * linux/kernel/ptrace.c is by Ross Biro 1/23/92, edited by Linus Torvalds 8 * linux/kernel/ptrace.c is by Ross Biro 1/23/92, edited by Linus Torvalds
11 * 9 *
12 * Modified by Cort Dougan (cort@hq.fsmlabs.com) 10 * Modified by Cort Dougan (cort@hq.fsmlabs.com)
13 * and Paul Mackerras (paulus@linuxcare.com.au). 11 * and Paul Mackerras (paulus@samba.org).
14 * 12 *
15 * This file is subject to the terms and conditions of the GNU General 13 * This file is subject to the terms and conditions of the GNU General
16 * Public License. See the file README.legal in the main directory of 14 * Public License. See the file README.legal in the main directory of
17 * this archive for more details. 15 * this archive for more details.
18 */ 16 */
19 17
18#include <linux/config.h>
20#include <linux/kernel.h> 19#include <linux/kernel.h>
21#include <linux/sched.h> 20#include <linux/sched.h>
22#include <linux/mm.h> 21#include <linux/mm.h>
@@ -29,13 +28,19 @@
29#include <linux/signal.h> 28#include <linux/signal.h>
30#include <linux/seccomp.h> 29#include <linux/seccomp.h>
31#include <linux/audit.h> 30#include <linux/audit.h>
31#ifdef CONFIG_PPC32
32#include <linux/module.h> 32#include <linux/module.h>
33#endif
33 34
34#include <asm/uaccess.h> 35#include <asm/uaccess.h>
35#include <asm/page.h> 36#include <asm/page.h>
36#include <asm/pgtable.h> 37#include <asm/pgtable.h>
37#include <asm/system.h> 38#include <asm/system.h>
39#ifdef CONFIG_PPC64
40#include <asm/ptrace-common.h>
41#endif
38 42
43#ifdef CONFIG_PPC32
39/* 44/*
40 * Set of msr bits that gdb can change on behalf of a process. 45 * Set of msr bits that gdb can change on behalf of a process.
41 */ 46 */
@@ -44,12 +49,14 @@
44#else 49#else
45#define MSR_DEBUGCHANGE (MSR_SE | MSR_BE) 50#define MSR_DEBUGCHANGE (MSR_SE | MSR_BE)
46#endif 51#endif
52#endif /* CONFIG_PPC32 */
47 53
48/* 54/*
49 * does not yet catch signals sent when the child dies. 55 * does not yet catch signals sent when the child dies.
50 * in exit.c or in signal.c. 56 * in exit.c or in signal.c.
51 */ 57 */
52 58
59#ifdef CONFIG_PPC32
53/* 60/*
54 * Get contents of register REGNO in task TASK. 61 * Get contents of register REGNO in task TASK.
55 */ 62 */
@@ -228,6 +235,7 @@ clear_single_step(struct task_struct *task)
228#endif 235#endif
229 } 236 }
230} 237}
238#endif /* CONFIG_PPC32 */
231 239
232/* 240/*
233 * Called by kernel/ptrace.c when detaching.. 241 * Called by kernel/ptrace.c when detaching..
@@ -240,7 +248,7 @@ void ptrace_disable(struct task_struct *child)
240 clear_single_step(child); 248 clear_single_step(child);
241} 249}
242 250
243int sys_ptrace(long request, long pid, long addr, long data) 251long sys_ptrace(long request, long pid, long addr, long data)
244{ 252{
245 struct task_struct *child; 253 struct task_struct *child;
246 int ret = -EPERM; 254 int ret = -EPERM;
@@ -296,25 +304,28 @@ int sys_ptrace(long request, long pid, long addr, long data)
296 } 304 }
297 305
298 /* read the word at location addr in the USER area. */ 306 /* read the word at location addr in the USER area. */
299 /* XXX this will need fixing for 64-bit */
300 case PTRACE_PEEKUSR: { 307 case PTRACE_PEEKUSR: {
301 unsigned long index, tmp; 308 unsigned long index, tmp;
302 309
303 ret = -EIO; 310 ret = -EIO;
304 /* convert to index and check */ 311 /* convert to index and check */
312#ifdef CONFIG_PPC32
305 index = (unsigned long) addr >> 2; 313 index = (unsigned long) addr >> 2;
306 if ((addr & 3) || index > PT_FPSCR 314 if ((addr & 3) || (index > PT_FPSCR)
307 || child->thread.regs == NULL) 315 || (child->thread.regs == NULL))
316#else
317 index = (unsigned long) addr >> 3;
318 if ((addr & 7) || (index > PT_FPSCR))
319#endif
308 break; 320 break;
309 321
322#ifdef CONFIG_PPC32
310 CHECK_FULL_REGS(child->thread.regs); 323 CHECK_FULL_REGS(child->thread.regs);
324#endif
311 if (index < PT_FPR0) { 325 if (index < PT_FPR0) {
312 tmp = get_reg(child, (int) index); 326 tmp = get_reg(child, (int) index);
313 } else { 327 } else {
314 preempt_disable(); 328 flush_fp_to_thread(child);
315 if (child->thread.regs->msr & MSR_FP)
316 giveup_fpu(child);
317 preempt_enable();
318 tmp = ((unsigned long *)child->thread.fpr)[index - PT_FPR0]; 329 tmp = ((unsigned long *)child->thread.fpr)[index - PT_FPR0];
319 } 330 }
320 ret = put_user(tmp,(unsigned long __user *) data); 331 ret = put_user(tmp,(unsigned long __user *) data);
@@ -325,7 +336,8 @@ int sys_ptrace(long request, long pid, long addr, long data)
325 case PTRACE_POKETEXT: /* write the word at location addr. */ 336 case PTRACE_POKETEXT: /* write the word at location addr. */
326 case PTRACE_POKEDATA: 337 case PTRACE_POKEDATA:
327 ret = 0; 338 ret = 0;
328 if (access_process_vm(child, addr, &data, sizeof(data), 1) == sizeof(data)) 339 if (access_process_vm(child, addr, &data, sizeof(data), 1)
340 == sizeof(data))
329 break; 341 break;
330 ret = -EIO; 342 ret = -EIO;
331 break; 343 break;
@@ -336,21 +348,25 @@ int sys_ptrace(long request, long pid, long addr, long data)
336 348
337 ret = -EIO; 349 ret = -EIO;
338 /* convert to index and check */ 350 /* convert to index and check */
351#ifdef CONFIG_PPC32
339 index = (unsigned long) addr >> 2; 352 index = (unsigned long) addr >> 2;
340 if ((addr & 3) || index > PT_FPSCR 353 if ((addr & 3) || (index > PT_FPSCR)
341 || child->thread.regs == NULL) 354 || (child->thread.regs == NULL))
355#else
356 index = (unsigned long) addr >> 3;
357 if ((addr & 7) || (index > PT_FPSCR))
358#endif
342 break; 359 break;
343 360
361#ifdef CONFIG_PPC32
344 CHECK_FULL_REGS(child->thread.regs); 362 CHECK_FULL_REGS(child->thread.regs);
363#endif
345 if (index == PT_ORIG_R3) 364 if (index == PT_ORIG_R3)
346 break; 365 break;
347 if (index < PT_FPR0) { 366 if (index < PT_FPR0) {
348 ret = put_reg(child, index, data); 367 ret = put_reg(child, index, data);
349 } else { 368 } else {
350 preempt_disable(); 369 flush_fp_to_thread(child);
351 if (child->thread.regs->msr & MSR_FP)
352 giveup_fpu(child);
353 preempt_enable();
354 ((unsigned long *)child->thread.fpr)[index - PT_FPR0] = data; 370 ((unsigned long *)child->thread.fpr)[index - PT_FPR0] = data;
355 ret = 0; 371 ret = 0;
356 } 372 }
@@ -362,11 +378,10 @@ int sys_ptrace(long request, long pid, long addr, long data)
362 ret = -EIO; 378 ret = -EIO;
363 if (!valid_signal(data)) 379 if (!valid_signal(data))
364 break; 380 break;
365 if (request == PTRACE_SYSCALL) { 381 if (request == PTRACE_SYSCALL)
366 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); 382 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
367 } else { 383 else
368 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); 384 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
369 }
370 child->exit_code = data; 385 child->exit_code = data;
371 /* make sure the single step bit is not set. */ 386 /* make sure the single step bit is not set. */
372 clear_single_step(child); 387 clear_single_step(child);
@@ -404,28 +419,102 @@ int sys_ptrace(long request, long pid, long addr, long data)
404 break; 419 break;
405 } 420 }
406 421
422#ifdef CONFIG_PPC64
423 case PTRACE_GET_DEBUGREG: {
424 ret = -EINVAL;
425 /* We only support one DABR and no IABRS at the moment */
426 if (addr > 0)
427 break;
428 ret = put_user(child->thread.dabr,
429 (unsigned long __user *)data);
430 break;
431 }
432
433 case PTRACE_SET_DEBUGREG:
434 ret = ptrace_set_debugreg(child, addr, data);
435 break;
436#endif
437
407 case PTRACE_DETACH: 438 case PTRACE_DETACH:
408 ret = ptrace_detach(child, data); 439 ret = ptrace_detach(child, data);
409 break; 440 break;
410 441
442#ifdef CONFIG_PPC64
443 case PPC_PTRACE_GETREGS: { /* Get GPRs 0 - 31. */
444 int i;
445 unsigned long *reg = &((unsigned long *)child->thread.regs)[0];
446 unsigned long __user *tmp = (unsigned long __user *)addr;
447
448 for (i = 0; i < 32; i++) {
449 ret = put_user(*reg, tmp);
450 if (ret)
451 break;
452 reg++;
453 tmp++;
454 }
455 break;
456 }
457
458 case PPC_PTRACE_SETREGS: { /* Set GPRs 0 - 31. */
459 int i;
460 unsigned long *reg = &((unsigned long *)child->thread.regs)[0];
461 unsigned long __user *tmp = (unsigned long __user *)addr;
462
463 for (i = 0; i < 32; i++) {
464 ret = get_user(*reg, tmp);
465 if (ret)
466 break;
467 reg++;
468 tmp++;
469 }
470 break;
471 }
472
473 case PPC_PTRACE_GETFPREGS: { /* Get FPRs 0 - 31. */
474 int i;
475 unsigned long *reg = &((unsigned long *)child->thread.fpr)[0];
476 unsigned long __user *tmp = (unsigned long __user *)addr;
477
478 flush_fp_to_thread(child);
479
480 for (i = 0; i < 32; i++) {
481 ret = put_user(*reg, tmp);
482 if (ret)
483 break;
484 reg++;
485 tmp++;
486 }
487 break;
488 }
489
490 case PPC_PTRACE_SETFPREGS: { /* Get FPRs 0 - 31. */
491 int i;
492 unsigned long *reg = &((unsigned long *)child->thread.fpr)[0];
493 unsigned long __user *tmp = (unsigned long __user *)addr;
494
495 flush_fp_to_thread(child);
496
497 for (i = 0; i < 32; i++) {
498 ret = get_user(*reg, tmp);
499 if (ret)
500 break;
501 reg++;
502 tmp++;
503 }
504 break;
505 }
506#endif /* CONFIG_PPC64 */
507
411#ifdef CONFIG_ALTIVEC 508#ifdef CONFIG_ALTIVEC
412 case PTRACE_GETVRREGS: 509 case PTRACE_GETVRREGS:
413 /* Get the child altivec register state. */ 510 /* Get the child altivec register state. */
414 preempt_disable(); 511 flush_altivec_to_thread(child);
415 if (child->thread.regs->msr & MSR_VEC)
416 giveup_altivec(child);
417 preempt_enable();
418 ret = get_vrregs((unsigned long __user *)data, child); 512 ret = get_vrregs((unsigned long __user *)data, child);
419 break; 513 break;
420 514
421 case PTRACE_SETVRREGS: 515 case PTRACE_SETVRREGS:
422 /* Set the child altivec register state. */ 516 /* Set the child altivec register state. */
423 /* this is to clear the MSR_VEC bit to force a reload 517 flush_altivec_to_thread(child);
424 * of register state from memory */
425 preempt_disable();
426 if (child->thread.regs->msr & MSR_VEC)
427 giveup_altivec(child);
428 preempt_enable();
429 ret = set_vrregs(child, (unsigned long __user *)data); 518 ret = set_vrregs(child, (unsigned long __user *)data);
430 break; 519 break;
431#endif 520#endif
@@ -478,12 +567,21 @@ static void do_syscall_trace(void)
478 567
479void do_syscall_trace_enter(struct pt_regs *regs) 568void do_syscall_trace_enter(struct pt_regs *regs)
480{ 569{
570#ifdef CONFIG_PPC64
571 secure_computing(regs->gpr[0]);
572#endif
573
481 if (test_thread_flag(TIF_SYSCALL_TRACE) 574 if (test_thread_flag(TIF_SYSCALL_TRACE)
482 && (current->ptrace & PT_PTRACED)) 575 && (current->ptrace & PT_PTRACED))
483 do_syscall_trace(); 576 do_syscall_trace();
484 577
485 if (unlikely(current->audit_context)) 578 if (unlikely(current->audit_context))
486 audit_syscall_entry(current, AUDIT_ARCH_PPC, 579 audit_syscall_entry(current,
580#ifdef CONFIG_PPC32
581 AUDIT_ARCH_PPC,
582#else
583 test_thread_flag(TIF_32BIT)?AUDIT_ARCH_PPC:AUDIT_ARCH_PPC64,
584#endif
487 regs->gpr[0], 585 regs->gpr[0],
488 regs->gpr[3], regs->gpr[4], 586 regs->gpr[3], regs->gpr[4],
489 regs->gpr[5], regs->gpr[6]); 587 regs->gpr[5], regs->gpr[6]);
@@ -491,17 +589,25 @@ void do_syscall_trace_enter(struct pt_regs *regs)
491 589
492void do_syscall_trace_leave(struct pt_regs *regs) 590void do_syscall_trace_leave(struct pt_regs *regs)
493{ 591{
592#ifdef CONFIG_PPC32
494 secure_computing(regs->gpr[0]); 593 secure_computing(regs->gpr[0]);
594#endif
495 595
496 if (unlikely(current->audit_context)) 596 if (unlikely(current->audit_context))
497 audit_syscall_exit(current, 597 audit_syscall_exit(current,
498 (regs->ccr&0x1000)?AUDITSC_FAILURE:AUDITSC_SUCCESS, 598 (regs->ccr&0x1000)?AUDITSC_FAILURE:AUDITSC_SUCCESS,
499 regs->result); 599 regs->result);
500 600
501 if ((test_thread_flag(TIF_SYSCALL_TRACE)) 601 if ((test_thread_flag(TIF_SYSCALL_TRACE)
602#ifdef CONFIG_PPC64
603 || test_thread_flag(TIF_SINGLESTEP)
604#endif
605 )
502 && (current->ptrace & PT_PTRACED)) 606 && (current->ptrace & PT_PTRACED))
503 do_syscall_trace(); 607 do_syscall_trace();
504} 608}
505 609
610#ifdef CONFIG_PPC32
506EXPORT_SYMBOL(do_syscall_trace_enter); 611EXPORT_SYMBOL(do_syscall_trace_enter);
507EXPORT_SYMBOL(do_syscall_trace_leave); 612EXPORT_SYMBOL(do_syscall_trace_leave);
613#endif
diff --git a/arch/ppc64/kernel/ptrace32.c b/arch/powerpc/kernel/ptrace32.c
index fb8c22d6084a..91eb952e0293 100644
--- a/arch/ppc64/kernel/ptrace32.c
+++ b/arch/powerpc/kernel/ptrace32.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/ppc64/kernel/ptrace32.c 2 * ptrace for 32-bit processes running on a 64-bit kernel.
3 * 3 *
4 * PowerPC version 4 * PowerPC version
5 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) 5 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
@@ -10,10 +10,10 @@
10 * linux/kernel/ptrace.c is by Ross Biro 1/23/92, edited by Linus Torvalds 10 * linux/kernel/ptrace.c is by Ross Biro 1/23/92, edited by Linus Torvalds
11 * 11 *
12 * Modified by Cort Dougan (cort@hq.fsmlabs.com) 12 * Modified by Cort Dougan (cort@hq.fsmlabs.com)
13 * and Paul Mackerras (paulus@linuxcare.com.au). 13 * and Paul Mackerras (paulus@samba.org).
14 * 14 *
15 * This file is subject to the terms and conditions of the GNU General 15 * This file is subject to the terms and conditions of the GNU General
16 * Public License. See the file README.legal in the main directory of 16 * Public License. See the file COPYING in the main directory of
17 * this archive for more details. 17 * this archive for more details.
18 */ 18 */
19 19
@@ -40,7 +40,8 @@
40 * in exit.c or in signal.c. 40 * in exit.c or in signal.c.
41 */ 41 */
42 42
43int sys32_ptrace(long request, long pid, unsigned long addr, unsigned long data) 43long compat_sys_ptrace(int request, int pid, unsigned long addr,
44 unsigned long data)
44{ 45{
45 struct task_struct *child; 46 struct task_struct *child;
46 int ret = -EPERM; 47 int ret = -EPERM;
diff --git a/arch/ppc64/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index 5e8eb33b8e54..4d22eeeeb91d 100644
--- a/arch/ppc64/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -25,28 +25,29 @@
25#include <asm/page.h> 25#include <asm/page.h>
26#include <asm/param.h> 26#include <asm/param.h>
27#include <asm/system.h> 27#include <asm/system.h>
28#include <asm/abs_addr.h>
29#include <asm/udbg.h>
30#include <asm/delay.h> 28#include <asm/delay.h>
31#include <asm/uaccess.h> 29#include <asm/uaccess.h>
30#include <asm/lmb.h>
31#ifdef CONFIG_PPC64
32#include <asm/systemcfg.h> 32#include <asm/systemcfg.h>
33#endif
33 34
34struct flash_block_list_header rtas_firmware_flash_list = {0, NULL}; 35struct rtas_t rtas = {
35
36struct rtas_t rtas = {
37 .lock = SPIN_LOCK_UNLOCKED 36 .lock = SPIN_LOCK_UNLOCKED
38}; 37};
39 38
40EXPORT_SYMBOL(rtas); 39EXPORT_SYMBOL(rtas);
41 40
42char rtas_err_buf[RTAS_ERROR_LOG_MAX];
43
44DEFINE_SPINLOCK(rtas_data_buf_lock); 41DEFINE_SPINLOCK(rtas_data_buf_lock);
45char rtas_data_buf[RTAS_DATA_BUF_SIZE]__page_aligned; 42char rtas_data_buf[RTAS_DATA_BUF_SIZE] __cacheline_aligned;
46unsigned long rtas_rmo_buf; 43unsigned long rtas_rmo_buf;
47 44
48void 45/*
49call_rtas_display_status(unsigned char c) 46 * call_rtas_display_status and call_rtas_display_status_delay
47 * are designed only for very early low-level debugging, which
48 * is why the token is hard-coded to 10.
49 */
50void call_rtas_display_status(unsigned char c)
50{ 51{
51 struct rtas_args *args = &rtas.args; 52 struct rtas_args *args = &rtas.args;
52 unsigned long s; 53 unsigned long s;
@@ -66,8 +67,7 @@ call_rtas_display_status(unsigned char c)
66 spin_unlock_irqrestore(&rtas.lock, s); 67 spin_unlock_irqrestore(&rtas.lock, s);
67} 68}
68 69
69void 70void call_rtas_display_status_delay(unsigned char c)
70call_rtas_display_status_delay(unsigned char c)
71{ 71{
72 static int pending_newline = 0; /* did last write end with unprinted newline? */ 72 static int pending_newline = 0; /* did last write end with unprinted newline? */
73 static int width = 16; 73 static int width = 16;
@@ -91,8 +91,7 @@ call_rtas_display_status_delay(unsigned char c)
91 } 91 }
92} 92}
93 93
94void 94void rtas_progress(char *s, unsigned short hex)
95rtas_progress(char *s, unsigned short hex)
96{ 95{
97 struct device_node *root; 96 struct device_node *root;
98 int width, *p; 97 int width, *p;
@@ -208,18 +207,16 @@ rtas_progress(char *s, unsigned short hex)
208 spin_unlock(&progress_lock); 207 spin_unlock(&progress_lock);
209} 208}
210 209
211int 210int rtas_token(const char *service)
212rtas_token(const char *service)
213{ 211{
214 int *tokp; 212 int *tokp;
215 if (rtas.dev == NULL) { 213 if (rtas.dev == NULL)
216 PPCDBG(PPCDBG_RTAS,"\tNo rtas device in device-tree...\n");
217 return RTAS_UNKNOWN_SERVICE; 214 return RTAS_UNKNOWN_SERVICE;
218 }
219 tokp = (int *) get_property(rtas.dev, service, NULL); 215 tokp = (int *) get_property(rtas.dev, service, NULL);
220 return tokp ? *tokp : RTAS_UNKNOWN_SERVICE; 216 return tokp ? *tokp : RTAS_UNKNOWN_SERVICE;
221} 217}
222 218
219#ifdef CONFIG_RTAS_ERROR_LOGGING
223/* 220/*
224 * Return the firmware-specified size of the error log buffer 221 * Return the firmware-specified size of the error log buffer
225 * for all rtas calls that require an error buffer argument. 222 * for all rtas calls that require an error buffer argument.
@@ -234,31 +231,38 @@ int rtas_get_error_log_max(void)
234 rtas_error_log_max = rtas_token ("rtas-error-log-max"); 231 rtas_error_log_max = rtas_token ("rtas-error-log-max");
235 if ((rtas_error_log_max == RTAS_UNKNOWN_SERVICE) || 232 if ((rtas_error_log_max == RTAS_UNKNOWN_SERVICE) ||
236 (rtas_error_log_max > RTAS_ERROR_LOG_MAX)) { 233 (rtas_error_log_max > RTAS_ERROR_LOG_MAX)) {
237 printk (KERN_WARNING "RTAS: bad log buffer size %d\n", rtas_error_log_max); 234 printk (KERN_WARNING "RTAS: bad log buffer size %d\n",
235 rtas_error_log_max);
238 rtas_error_log_max = RTAS_ERROR_LOG_MAX; 236 rtas_error_log_max = RTAS_ERROR_LOG_MAX;
239 } 237 }
240 return rtas_error_log_max; 238 return rtas_error_log_max;
241} 239}
240EXPORT_SYMBOL(rtas_get_error_log_max);
242 241
243 242
243char rtas_err_buf[RTAS_ERROR_LOG_MAX];
244int rtas_last_error_token;
245
244/** Return a copy of the detailed error text associated with the 246/** Return a copy of the detailed error text associated with the
245 * most recent failed call to rtas. Because the error text 247 * most recent failed call to rtas. Because the error text
246 * might go stale if there are any other intervening rtas calls, 248 * might go stale if there are any other intervening rtas calls,
247 * this routine must be called atomically with whatever produced 249 * this routine must be called atomically with whatever produced
248 * the error (i.e. with rtas.lock still held from the previous call). 250 * the error (i.e. with rtas.lock still held from the previous call).
249 */ 251 */
250static int 252static char *__fetch_rtas_last_error(char *altbuf)
251__fetch_rtas_last_error(void)
252{ 253{
253 struct rtas_args err_args, save_args; 254 struct rtas_args err_args, save_args;
254 u32 bufsz; 255 u32 bufsz;
256 char *buf = NULL;
257
258 if (rtas_last_error_token == -1)
259 return NULL;
255 260
256 bufsz = rtas_get_error_log_max(); 261 bufsz = rtas_get_error_log_max();
257 262
258 err_args.token = rtas_token("rtas-last-error"); 263 err_args.token = rtas_last_error_token;
259 err_args.nargs = 2; 264 err_args.nargs = 2;
260 err_args.nret = 1; 265 err_args.nret = 1;
261
262 err_args.args[0] = (rtas_arg_t)__pa(rtas_err_buf); 266 err_args.args[0] = (rtas_arg_t)__pa(rtas_err_buf);
263 err_args.args[1] = bufsz; 267 err_args.args[1] = bufsz;
264 err_args.args[2] = 0; 268 err_args.args[2] = 0;
@@ -271,23 +275,38 @@ __fetch_rtas_last_error(void)
271 err_args = rtas.args; 275 err_args = rtas.args;
272 rtas.args = save_args; 276 rtas.args = save_args;
273 277
274 return err_args.args[2]; 278 /* Log the error in the unlikely case that there was one. */
279 if (unlikely(err_args.args[2] == 0)) {
280 if (altbuf) {
281 buf = altbuf;
282 } else {
283 buf = rtas_err_buf;
284 if (mem_init_done)
285 buf = kmalloc(RTAS_ERROR_LOG_MAX, GFP_ATOMIC);
286 }
287 if (buf)
288 memcpy(buf, rtas_err_buf, RTAS_ERROR_LOG_MAX);
289 }
290
291 return buf;
275} 292}
276 293
294#define get_errorlog_buffer() kmalloc(RTAS_ERROR_LOG_MAX, GFP_KERNEL)
295
296#else /* CONFIG_RTAS_ERROR_LOGGING */
297#define __fetch_rtas_last_error(x) NULL
298#define get_errorlog_buffer() NULL
299#endif
300
277int rtas_call(int token, int nargs, int nret, int *outputs, ...) 301int rtas_call(int token, int nargs, int nret, int *outputs, ...)
278{ 302{
279 va_list list; 303 va_list list;
280 int i, logit = 0; 304 int i;
281 unsigned long s; 305 unsigned long s;
282 struct rtas_args *rtas_args; 306 struct rtas_args *rtas_args;
283 char * buff_copy = NULL; 307 char *buff_copy = NULL;
284 int ret; 308 int ret;
285 309
286 PPCDBG(PPCDBG_RTAS, "Entering rtas_call\n");
287 PPCDBG(PPCDBG_RTAS, "\ttoken = 0x%x\n", token);
288 PPCDBG(PPCDBG_RTAS, "\tnargs = %d\n", nargs);
289 PPCDBG(PPCDBG_RTAS, "\tnret = %d\n", nret);
290 PPCDBG(PPCDBG_RTAS, "\t&outputs = 0x%lx\n", outputs);
291 if (token == RTAS_UNKNOWN_SERVICE) 310 if (token == RTAS_UNKNOWN_SERVICE)
292 return -1; 311 return -1;
293 312
@@ -300,46 +319,25 @@ int rtas_call(int token, int nargs, int nret, int *outputs, ...)
300 rtas_args->nret = nret; 319 rtas_args->nret = nret;
301 rtas_args->rets = (rtas_arg_t *)&(rtas_args->args[nargs]); 320 rtas_args->rets = (rtas_arg_t *)&(rtas_args->args[nargs]);
302 va_start(list, outputs); 321 va_start(list, outputs);
303 for (i = 0; i < nargs; ++i) { 322 for (i = 0; i < nargs; ++i)
304 rtas_args->args[i] = va_arg(list, rtas_arg_t); 323 rtas_args->args[i] = va_arg(list, rtas_arg_t);
305 PPCDBG(PPCDBG_RTAS, "\tnarg[%d] = 0x%x\n", i, rtas_args->args[i]);
306 }
307 va_end(list); 324 va_end(list);
308 325
309 for (i = 0; i < nret; ++i) 326 for (i = 0; i < nret; ++i)
310 rtas_args->rets[i] = 0; 327 rtas_args->rets[i] = 0;
311 328
312 PPCDBG(PPCDBG_RTAS, "\tentering rtas with 0x%lx\n",
313 __pa(rtas_args));
314 enter_rtas(__pa(rtas_args)); 329 enter_rtas(__pa(rtas_args));
315 PPCDBG(PPCDBG_RTAS, "\treturned from rtas ...\n");
316 330
317 /* A -1 return code indicates that the last command couldn't 331 /* A -1 return code indicates that the last command couldn't
318 be completed due to a hardware error. */ 332 be completed due to a hardware error. */
319 if (rtas_args->rets[0] == -1) 333 if (rtas_args->rets[0] == -1)
320 logit = (__fetch_rtas_last_error() == 0); 334 buff_copy = __fetch_rtas_last_error(NULL);
321
322 ifppcdebug(PPCDBG_RTAS) {
323 for(i=0; i < nret ;i++)
324 udbg_printf("\tnret[%d] = 0x%lx\n", i, (ulong)rtas_args->rets[i]);
325 }
326 335
327 if (nret > 1 && outputs != NULL) 336 if (nret > 1 && outputs != NULL)
328 for (i = 0; i < nret-1; ++i) 337 for (i = 0; i < nret-1; ++i)
329 outputs[i] = rtas_args->rets[i+1]; 338 outputs[i] = rtas_args->rets[i+1];
330 ret = (nret > 0)? rtas_args->rets[0]: 0; 339 ret = (nret > 0)? rtas_args->rets[0]: 0;
331 340
332 /* Log the error in the unlikely case that there was one. */
333 if (unlikely(logit)) {
334 buff_copy = rtas_err_buf;
335 if (mem_init_done) {
336 buff_copy = kmalloc(RTAS_ERROR_LOG_MAX, GFP_ATOMIC);
337 if (buff_copy)
338 memcpy(buff_copy, rtas_err_buf,
339 RTAS_ERROR_LOG_MAX);
340 }
341 }
342
343 /* Gotta do something different here, use global lock for now... */ 341 /* Gotta do something different here, use global lock for now... */
344 spin_unlock_irqrestore(&rtas.lock, s); 342 spin_unlock_irqrestore(&rtas.lock, s);
345 343
@@ -354,8 +352,7 @@ int rtas_call(int token, int nargs, int nret, int *outputs, ...)
354/* Given an RTAS status code of 990n compute the hinted delay of 10^n 352/* Given an RTAS status code of 990n compute the hinted delay of 10^n
355 * (last digit) milliseconds. For now we bound at n=5 (100 sec). 353 * (last digit) milliseconds. For now we bound at n=5 (100 sec).
356 */ 354 */
357unsigned int 355unsigned int rtas_extended_busy_delay_time(int status)
358rtas_extended_busy_delay_time(int status)
359{ 356{
360 int order = status - 9900; 357 int order = status - 9900;
361 unsigned long ms; 358 unsigned long ms;
@@ -366,7 +363,7 @@ rtas_extended_busy_delay_time(int status)
366 order = 5; /* bound */ 363 order = 5; /* bound */
367 364
368 /* Use microseconds for reasonable accuracy */ 365 /* Use microseconds for reasonable accuracy */
369 for (ms=1; order > 0; order--) 366 for (ms = 1; order > 0; order--)
370 ms *= 10; 367 ms *= 10;
371 368
372 return ms; 369 return ms;
@@ -493,112 +490,23 @@ int rtas_set_indicator(int indicator, int index, int new_value)
493 return rc; 490 return rc;
494} 491}
495 492
496#define FLASH_BLOCK_LIST_VERSION (1UL) 493void rtas_restart(char *cmd)
497static void
498rtas_flash_firmware(void)
499{
500 unsigned long image_size;
501 struct flash_block_list *f, *next, *flist;
502 unsigned long rtas_block_list;
503 int i, status, update_token;
504
505 update_token = rtas_token("ibm,update-flash-64-and-reboot");
506 if (update_token == RTAS_UNKNOWN_SERVICE) {
507 printk(KERN_ALERT "FLASH: ibm,update-flash-64-and-reboot is not available -- not a service partition?\n");
508 printk(KERN_ALERT "FLASH: firmware will not be flashed\n");
509 return;
510 }
511
512 /* NOTE: the "first" block list is a global var with no data
513 * blocks in the kernel data segment. We do this because
514 * we want to ensure this block_list addr is under 4GB.
515 */
516 rtas_firmware_flash_list.num_blocks = 0;
517 flist = (struct flash_block_list *)&rtas_firmware_flash_list;
518 rtas_block_list = virt_to_abs(flist);
519 if (rtas_block_list >= 4UL*1024*1024*1024) {
520 printk(KERN_ALERT "FLASH: kernel bug...flash list header addr above 4GB\n");
521 return;
522 }
523
524 printk(KERN_ALERT "FLASH: preparing saved firmware image for flash\n");
525 /* Update the block_list in place. */
526 image_size = 0;
527 for (f = flist; f; f = next) {
528 /* Translate data addrs to absolute */
529 for (i = 0; i < f->num_blocks; i++) {
530 f->blocks[i].data = (char *)virt_to_abs(f->blocks[i].data);
531 image_size += f->blocks[i].length;
532 }
533 next = f->next;
534 /* Don't translate NULL pointer for last entry */
535 if (f->next)
536 f->next = (struct flash_block_list *)virt_to_abs(f->next);
537 else
538 f->next = NULL;
539 /* make num_blocks into the version/length field */
540 f->num_blocks = (FLASH_BLOCK_LIST_VERSION << 56) | ((f->num_blocks+1)*16);
541 }
542
543 printk(KERN_ALERT "FLASH: flash image is %ld bytes\n", image_size);
544 printk(KERN_ALERT "FLASH: performing flash and reboot\n");
545 rtas_progress("Flashing \n", 0x0);
546 rtas_progress("Please Wait... ", 0x0);
547 printk(KERN_ALERT "FLASH: this will take several minutes. Do not power off!\n");
548 status = rtas_call(update_token, 1, 1, NULL, rtas_block_list);
549 switch (status) { /* should only get "bad" status */
550 case 0:
551 printk(KERN_ALERT "FLASH: success\n");
552 break;
553 case -1:
554 printk(KERN_ALERT "FLASH: hardware error. Firmware may not be not flashed\n");
555 break;
556 case -3:
557 printk(KERN_ALERT "FLASH: image is corrupt or not correct for this platform. Firmware not flashed\n");
558 break;
559 case -4:
560 printk(KERN_ALERT "FLASH: flash failed when partially complete. System may not reboot\n");
561 break;
562 default:
563 printk(KERN_ALERT "FLASH: unknown flash return code %d\n", status);
564 break;
565 }
566}
567
568void rtas_flash_bypass_warning(void)
569{
570 printk(KERN_ALERT "FLASH: firmware flash requires a reboot\n");
571 printk(KERN_ALERT "FLASH: the firmware image will NOT be flashed\n");
572}
573
574
575void
576rtas_restart(char *cmd)
577{ 494{
578 if (rtas_firmware_flash_list.next)
579 rtas_flash_firmware();
580
581 printk("RTAS system-reboot returned %d\n", 495 printk("RTAS system-reboot returned %d\n",
582 rtas_call(rtas_token("system-reboot"), 0, 1, NULL)); 496 rtas_call(rtas_token("system-reboot"), 0, 1, NULL));
583 for (;;); 497 for (;;);
584} 498}
585 499
586void 500void rtas_power_off(void)
587rtas_power_off(void)
588{ 501{
589 if (rtas_firmware_flash_list.next)
590 rtas_flash_bypass_warning();
591 /* allow power on only with power button press */ 502 /* allow power on only with power button press */
592 printk("RTAS power-off returned %d\n", 503 printk("RTAS power-off returned %d\n",
593 rtas_call(rtas_token("power-off"), 2, 1, NULL, -1, -1)); 504 rtas_call(rtas_token("power-off"), 2, 1, NULL, -1, -1));
594 for (;;); 505 for (;;);
595} 506}
596 507
597void 508void rtas_halt(void)
598rtas_halt(void)
599{ 509{
600 if (rtas_firmware_flash_list.next)
601 rtas_flash_bypass_warning();
602 rtas_power_off(); 510 rtas_power_off();
603} 511}
604 512
@@ -631,9 +539,8 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
631{ 539{
632 struct rtas_args args; 540 struct rtas_args args;
633 unsigned long flags; 541 unsigned long flags;
634 char * buff_copy; 542 char *buff_copy, *errbuf = NULL;
635 int nargs; 543 int nargs;
636 int err_rc = 0;
637 544
638 if (!capable(CAP_SYS_ADMIN)) 545 if (!capable(CAP_SYS_ADMIN))
639 return -EPERM; 546 return -EPERM;
@@ -652,7 +559,7 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
652 nargs * sizeof(rtas_arg_t)) != 0) 559 nargs * sizeof(rtas_arg_t)) != 0)
653 return -EFAULT; 560 return -EFAULT;
654 561
655 buff_copy = kmalloc(RTAS_ERROR_LOG_MAX, GFP_KERNEL); 562 buff_copy = get_errorlog_buffer();
656 563
657 spin_lock_irqsave(&rtas.lock, flags); 564 spin_lock_irqsave(&rtas.lock, flags);
658 565
@@ -664,19 +571,14 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
664 571
665 /* A -1 return code indicates that the last command couldn't 572 /* A -1 return code indicates that the last command couldn't
666 be completed due to a hardware error. */ 573 be completed due to a hardware error. */
667 if (args.rets[0] == -1) { 574 if (args.rets[0] == -1)
668 err_rc = __fetch_rtas_last_error(); 575 errbuf = __fetch_rtas_last_error(buff_copy);
669 if ((err_rc == 0) && buff_copy) {
670 memcpy(buff_copy, rtas_err_buf, RTAS_ERROR_LOG_MAX);
671 }
672 }
673 576
674 spin_unlock_irqrestore(&rtas.lock, flags); 577 spin_unlock_irqrestore(&rtas.lock, flags);
675 578
676 if (buff_copy) { 579 if (buff_copy) {
677 if ((args.rets[0] == -1) && (err_rc == 0)) { 580 if (errbuf)
678 log_error(buff_copy, ERR_TYPE_RTAS_LOG, 0); 581 log_error(errbuf, ERR_TYPE_RTAS_LOG, 0);
679 }
680 kfree(buff_copy); 582 kfree(buff_copy);
681 } 583 }
682 584
@@ -689,6 +591,7 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
689 return 0; 591 return 0;
690} 592}
691 593
594#ifdef CONFIG_SMP
692/* This version can't take the spinlock, because it never returns */ 595/* This version can't take the spinlock, because it never returns */
693 596
694struct rtas_args rtas_stop_self_args = { 597struct rtas_args rtas_stop_self_args = {
@@ -713,6 +616,7 @@ void rtas_stop_self(void)
713 616
714 panic("Alas, I survived.\n"); 617 panic("Alas, I survived.\n");
715} 618}
619#endif
716 620
717/* 621/*
718 * Call early during boot, before mem init or bootmem, to retreive the RTAS 622 * Call early during boot, before mem init or bootmem, to retreive the RTAS
@@ -721,6 +625,8 @@ void rtas_stop_self(void)
721 */ 625 */
722void __init rtas_initialize(void) 626void __init rtas_initialize(void)
723{ 627{
628 unsigned long rtas_region = RTAS_INSTANTIATE_MAX;
629
724 /* Get RTAS dev node and fill up our "rtas" structure with infos 630 /* Get RTAS dev node and fill up our "rtas" structure with infos
725 * about it. 631 * about it.
726 */ 632 */
@@ -742,26 +648,27 @@ void __init rtas_initialize(void)
742 } else 648 } else
743 rtas.dev = NULL; 649 rtas.dev = NULL;
744 } 650 }
651 if (!rtas.dev)
652 return;
653
745 /* If RTAS was found, allocate the RMO buffer for it and look for 654 /* If RTAS was found, allocate the RMO buffer for it and look for
746 * the stop-self token if any 655 * the stop-self token if any
747 */ 656 */
748 if (rtas.dev) { 657#ifdef CONFIG_PPC64
749 unsigned long rtas_region = RTAS_INSTANTIATE_MAX; 658 if (systemcfg->platform == PLATFORM_PSERIES_LPAR)
750 if (systemcfg->platform == PLATFORM_PSERIES_LPAR) 659 rtas_region = min(lmb.rmo_size, RTAS_INSTANTIATE_MAX);
751 rtas_region = min(lmb.rmo_size, RTAS_INSTANTIATE_MAX); 660#endif
752 661 rtas_rmo_buf = lmb_alloc_base(RTAS_RMOBUF_MAX, PAGE_SIZE, rtas_region);
753 rtas_rmo_buf = lmb_alloc_base(RTAS_RMOBUF_MAX, PAGE_SIZE,
754 rtas_region);
755 662
756#ifdef CONFIG_HOTPLUG_CPU 663#ifdef CONFIG_HOTPLUG_CPU
757 rtas_stop_self_args.token = rtas_token("stop-self"); 664 rtas_stop_self_args.token = rtas_token("stop-self");
758#endif /* CONFIG_HOTPLUG_CPU */ 665#endif /* CONFIG_HOTPLUG_CPU */
759 } 666#ifdef CONFIG_RTAS_ERROR_LOGGING
760 667 rtas_last_error_token = rtas_token("rtas-last-error");
668#endif
761} 669}
762 670
763 671
764EXPORT_SYMBOL(rtas_firmware_flash_list);
765EXPORT_SYMBOL(rtas_token); 672EXPORT_SYMBOL(rtas_token);
766EXPORT_SYMBOL(rtas_call); 673EXPORT_SYMBOL(rtas_call);
767EXPORT_SYMBOL(rtas_data_buf); 674EXPORT_SYMBOL(rtas_data_buf);
@@ -771,4 +678,3 @@ EXPORT_SYMBOL(rtas_get_sensor);
771EXPORT_SYMBOL(rtas_get_power_level); 678EXPORT_SYMBOL(rtas_get_power_level);
772EXPORT_SYMBOL(rtas_set_power_level); 679EXPORT_SYMBOL(rtas_set_power_level);
773EXPORT_SYMBOL(rtas_set_indicator); 680EXPORT_SYMBOL(rtas_set_indicator);
774EXPORT_SYMBOL(rtas_get_error_log_max);
diff --git a/arch/powerpc/kernel/semaphore.c b/arch/powerpc/kernel/semaphore.c
new file mode 100644
index 000000000000..2f8c3c951394
--- /dev/null
+++ b/arch/powerpc/kernel/semaphore.c
@@ -0,0 +1,135 @@
1/*
2 * PowerPC-specific semaphore code.
3 *
4 * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 *
11 * April 2001 - Reworked by Paul Mackerras <paulus@samba.org>
12 * to eliminate the SMP races in the old version between the updates
13 * of `count' and `waking'. Now we use negative `count' values to
14 * indicate that some process(es) are waiting for the semaphore.
15 */
16
17#include <linux/sched.h>
18#include <linux/init.h>
19#include <linux/module.h>
20
21#include <asm/atomic.h>
22#include <asm/semaphore.h>
23#include <asm/errno.h>
24
25/*
26 * Atomically update sem->count.
27 * This does the equivalent of the following:
28 *
29 * old_count = sem->count;
30 * tmp = MAX(old_count, 0) + incr;
31 * sem->count = tmp;
32 * return old_count;
33 */
34static inline int __sem_update_count(struct semaphore *sem, int incr)
35{
36 int old_count, tmp;
37
38 __asm__ __volatile__("\n"
39"1: lwarx %0,0,%3\n"
40" srawi %1,%0,31\n"
41" andc %1,%0,%1\n"
42" add %1,%1,%4\n"
43 PPC405_ERR77(0,%3)
44" stwcx. %1,0,%3\n"
45" bne 1b"
46 : "=&r" (old_count), "=&r" (tmp), "=m" (sem->count)
47 : "r" (&sem->count), "r" (incr), "m" (sem->count)
48 : "cc");
49
50 return old_count;
51}
52
53void __up(struct semaphore *sem)
54{
55 /*
56 * Note that we incremented count in up() before we came here,
57 * but that was ineffective since the result was <= 0, and
58 * any negative value of count is equivalent to 0.
59 * This ends up setting count to 1, unless count is now > 0
60 * (i.e. because some other cpu has called up() in the meantime),
61 * in which case we just increment count.
62 */
63 __sem_update_count(sem, 1);
64 wake_up(&sem->wait);
65}
66EXPORT_SYMBOL(__up);
67
68/*
69 * Note that when we come in to __down or __down_interruptible,
70 * we have already decremented count, but that decrement was
71 * ineffective since the result was < 0, and any negative value
72 * of count is equivalent to 0.
73 * Thus it is only when we decrement count from some value > 0
74 * that we have actually got the semaphore.
75 */
76void __sched __down(struct semaphore *sem)
77{
78 struct task_struct *tsk = current;
79 DECLARE_WAITQUEUE(wait, tsk);
80
81 __set_task_state(tsk, TASK_UNINTERRUPTIBLE);
82 add_wait_queue_exclusive(&sem->wait, &wait);
83
84 /*
85 * Try to get the semaphore. If the count is > 0, then we've
86 * got the semaphore; we decrement count and exit the loop.
87 * If the count is 0 or negative, we set it to -1, indicating
88 * that we are asleep, and then sleep.
89 */
90 while (__sem_update_count(sem, -1) <= 0) {
91 schedule();
92 set_task_state(tsk, TASK_UNINTERRUPTIBLE);
93 }
94 remove_wait_queue(&sem->wait, &wait);
95 __set_task_state(tsk, TASK_RUNNING);
96
97 /*
98 * If there are any more sleepers, wake one of them up so
99 * that it can either get the semaphore, or set count to -1
100 * indicating that there are still processes sleeping.
101 */
102 wake_up(&sem->wait);
103}
104EXPORT_SYMBOL(__down);
105
106int __sched __down_interruptible(struct semaphore * sem)
107{
108 int retval = 0;
109 struct task_struct *tsk = current;
110 DECLARE_WAITQUEUE(wait, tsk);
111
112 __set_task_state(tsk, TASK_INTERRUPTIBLE);
113 add_wait_queue_exclusive(&sem->wait, &wait);
114
115 while (__sem_update_count(sem, -1) <= 0) {
116 if (signal_pending(current)) {
117 /*
118 * A signal is pending - give up trying.
119 * Set sem->count to 0 if it is negative,
120 * since we are no longer sleeping.
121 */
122 __sem_update_count(sem, 0);
123 retval = -EINTR;
124 break;
125 }
126 schedule();
127 set_task_state(tsk, TASK_INTERRUPTIBLE);
128 }
129 remove_wait_queue(&sem->wait, &wait);
130 __set_task_state(tsk, TASK_RUNNING);
131
132 wake_up(&sem->wait);
133 return retval;
134}
135EXPORT_SYMBOL(__down_interruptible);
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
new file mode 100644
index 000000000000..1292460fcde2
--- /dev/null
+++ b/arch/powerpc/kernel/setup-common.c
@@ -0,0 +1,410 @@
1/*
2 * Common boot and setup code for both 32-bit and 64-bit.
3 * Extracted from arch/powerpc/kernel/setup_64.c.
4 *
5 * Copyright (C) 2001 PPC64 Team, IBM Corp
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
10 * 2 of the License, or (at your option) any later version.
11 */
12#include <linux/config.h>
13#include <linux/module.h>
14#include <linux/string.h>
15#include <linux/sched.h>
16#include <linux/init.h>
17#include <linux/kernel.h>
18#include <linux/reboot.h>
19#include <linux/delay.h>
20#include <linux/initrd.h>
21#include <linux/ide.h>
22#include <linux/seq_file.h>
23#include <linux/ioport.h>
24#include <linux/console.h>
25#include <linux/utsname.h>
26#include <linux/tty.h>
27#include <linux/root_dev.h>
28#include <linux/notifier.h>
29#include <linux/cpu.h>
30#include <linux/unistd.h>
31#include <linux/serial.h>
32#include <linux/serial_8250.h>
33#include <asm/io.h>
34#include <asm/prom.h>
35#include <asm/processor.h>
36#include <asm/pgtable.h>
37#include <asm/smp.h>
38#include <asm/elf.h>
39#include <asm/machdep.h>
40#include <asm/time.h>
41#include <asm/cputable.h>
42#include <asm/sections.h>
43#include <asm/btext.h>
44#include <asm/nvram.h>
45#include <asm/setup.h>
46#include <asm/system.h>
47#include <asm/rtas.h>
48#include <asm/iommu.h>
49#include <asm/serial.h>
50#include <asm/cache.h>
51#include <asm/page.h>
52#include <asm/mmu.h>
53#include <asm/lmb.h>
54
55#undef DEBUG
56
57#ifdef DEBUG
58#define DBG(fmt...) udbg_printf(fmt)
59#else
60#define DBG(fmt...)
61#endif
62
63/*
64 * This still seems to be needed... -- paulus
65 */
66struct screen_info screen_info = {
67 .orig_x = 0,
68 .orig_y = 25,
69 .orig_video_cols = 80,
70 .orig_video_lines = 25,
71 .orig_video_isVGA = 1,
72 .orig_video_points = 16
73};
74
75#ifdef __DO_IRQ_CANON
76/* XXX should go elsewhere eventually */
77int ppc_do_canonicalize_irqs;
78EXPORT_SYMBOL(ppc_do_canonicalize_irqs);
79#endif
80
81/* also used by kexec */
82void machine_shutdown(void)
83{
84 if (ppc_md.nvram_sync)
85 ppc_md.nvram_sync();
86}
87
88void machine_restart(char *cmd)
89{
90 machine_shutdown();
91 ppc_md.restart(cmd);
92#ifdef CONFIG_SMP
93 smp_send_stop();
94#endif
95 printk(KERN_EMERG "System Halted, OK to turn off power\n");
96 local_irq_disable();
97 while (1) ;
98}
99
100void machine_power_off(void)
101{
102 machine_shutdown();
103 ppc_md.power_off();
104#ifdef CONFIG_SMP
105 smp_send_stop();
106#endif
107 printk(KERN_EMERG "System Halted, OK to turn off power\n");
108 local_irq_disable();
109 while (1) ;
110}
111/* Used by the G5 thermal driver */
112EXPORT_SYMBOL_GPL(machine_power_off);
113
114void (*pm_power_off)(void) = machine_power_off;
115EXPORT_SYMBOL_GPL(pm_power_off);
116
117void machine_halt(void)
118{
119 machine_shutdown();
120 ppc_md.halt();
121#ifdef CONFIG_SMP
122 smp_send_stop();
123#endif
124 printk(KERN_EMERG "System Halted, OK to turn off power\n");
125 local_irq_disable();
126 while (1) ;
127}
128
129
130#ifdef CONFIG_TAU
131extern u32 cpu_temp(unsigned long cpu);
132extern u32 cpu_temp_both(unsigned long cpu);
133#endif /* CONFIG_TAU */
134
135#ifdef CONFIG_SMP
136DEFINE_PER_CPU(unsigned int, pvr);
137#endif
138
139static int show_cpuinfo(struct seq_file *m, void *v)
140{
141 unsigned long cpu_id = (unsigned long)v - 1;
142 unsigned int pvr;
143 unsigned short maj;
144 unsigned short min;
145
146 if (cpu_id == NR_CPUS) {
147#if defined(CONFIG_SMP) && defined(CONFIG_PPC32)
148 unsigned long bogosum = 0;
149 int i;
150 for (i = 0; i < NR_CPUS; ++i)
151 if (cpu_online(i))
152 bogosum += loops_per_jiffy;
153 seq_printf(m, "total bogomips\t: %lu.%02lu\n",
154 bogosum/(500000/HZ), bogosum/(5000/HZ) % 100);
155#endif /* CONFIG_SMP && CONFIG_PPC32 */
156 seq_printf(m, "timebase\t: %lu\n", ppc_tb_freq);
157
158 if (ppc_md.show_cpuinfo != NULL)
159 ppc_md.show_cpuinfo(m);
160
161 return 0;
162 }
163
164 /* We only show online cpus: disable preempt (overzealous, I
165 * knew) to prevent cpu going down. */
166 preempt_disable();
167 if (!cpu_online(cpu_id)) {
168 preempt_enable();
169 return 0;
170 }
171
172#ifdef CONFIG_SMP
173#ifdef CONFIG_PPC64 /* XXX for now */
174 pvr = per_cpu(pvr, cpu_id);
175#else
176 pvr = cpu_data[cpu_id].pvr;
177#endif
178#else
179 pvr = mfspr(SPRN_PVR);
180#endif
181 maj = (pvr >> 8) & 0xFF;
182 min = pvr & 0xFF;
183
184 seq_printf(m, "processor\t: %lu\n", cpu_id);
185 seq_printf(m, "cpu\t\t: ");
186
187 if (cur_cpu_spec->pvr_mask)
188 seq_printf(m, "%s", cur_cpu_spec->cpu_name);
189 else
190 seq_printf(m, "unknown (%08x)", pvr);
191
192#ifdef CONFIG_ALTIVEC
193 if (cpu_has_feature(CPU_FTR_ALTIVEC))
194 seq_printf(m, ", altivec supported");
195#endif /* CONFIG_ALTIVEC */
196
197 seq_printf(m, "\n");
198
199#ifdef CONFIG_TAU
200 if (cur_cpu_spec->cpu_features & CPU_FTR_TAU) {
201#ifdef CONFIG_TAU_AVERAGE
202 /* more straightforward, but potentially misleading */
203 seq_printf(m, "temperature \t: %u C (uncalibrated)\n",
204 cpu_temp(i));
205#else
206 /* show the actual temp sensor range */
207 u32 temp;
208 temp = cpu_temp_both(i);
209 seq_printf(m, "temperature \t: %u-%u C (uncalibrated)\n",
210 temp & 0xff, temp >> 16);
211#endif
212 }
213#endif /* CONFIG_TAU */
214
215 /*
216 * Assume here that all clock rates are the same in a
217 * smp system. -- Cort
218 */
219 if (ppc_proc_freq)
220 seq_printf(m, "clock\t\t: %lu.%06luMHz\n",
221 ppc_proc_freq / 1000000, ppc_proc_freq % 1000000);
222
223 if (ppc_md.show_percpuinfo != NULL)
224 ppc_md.show_percpuinfo(m, cpu_id);
225
226 /* If we are a Freescale core do a simple check so
227 * we dont have to keep adding cases in the future */
228 if (PVR_VER(pvr) & 0x8000) {
229 maj = PVR_MAJ(pvr);
230 min = PVR_MIN(pvr);
231 } else {
232 switch (PVR_VER(pvr)) {
233 case 0x0020: /* 403 family */
234 maj = PVR_MAJ(pvr) + 1;
235 min = PVR_MIN(pvr);
236 break;
237 case 0x1008: /* 740P/750P ?? */
238 maj = ((pvr >> 8) & 0xFF) - 1;
239 min = pvr & 0xFF;
240 break;
241 default:
242 maj = (pvr >> 8) & 0xFF;
243 min = pvr & 0xFF;
244 break;
245 }
246 }
247
248 seq_printf(m, "revision\t: %hd.%hd (pvr %04x %04x)\n",
249 maj, min, PVR_VER(pvr), PVR_REV(pvr));
250
251#ifdef CONFIG_PPC32
252 seq_printf(m, "bogomips\t: %lu.%02lu\n",
253 loops_per_jiffy / (500000/HZ),
254 (loops_per_jiffy / (5000/HZ)) % 100);
255#endif
256
257#ifdef CONFIG_SMP
258 seq_printf(m, "\n");
259#endif
260
261 preempt_enable();
262 return 0;
263}
264
265static void *c_start(struct seq_file *m, loff_t *pos)
266{
267 unsigned long i = *pos;
268
269 return i <= NR_CPUS ? (void *)(i + 1) : NULL;
270}
271
272static void *c_next(struct seq_file *m, void *v, loff_t *pos)
273{
274 ++*pos;
275 return c_start(m, pos);
276}
277
278static void c_stop(struct seq_file *m, void *v)
279{
280}
281
282struct seq_operations cpuinfo_op = {
283 .start =c_start,
284 .next = c_next,
285 .stop = c_stop,
286 .show = show_cpuinfo,
287};
288
289#ifdef CONFIG_PPC_MULTIPLATFORM
290static int __init set_preferred_console(void)
291{
292 struct device_node *prom_stdout = NULL;
293 char *name;
294 u32 *spd;
295 int offset = 0;
296
297 DBG(" -> set_preferred_console()\n");
298
299 /* The user has requested a console so this is already set up. */
300 if (strstr(saved_command_line, "console=")) {
301 DBG(" console was specified !\n");
302 return -EBUSY;
303 }
304
305 if (!of_chosen) {
306 DBG(" of_chosen is NULL !\n");
307 return -ENODEV;
308 }
309 /* We are getting a weird phandle from OF ... */
310 /* ... So use the full path instead */
311 name = (char *)get_property(of_chosen, "linux,stdout-path", NULL);
312 if (name == NULL) {
313 DBG(" no linux,stdout-path !\n");
314 return -ENODEV;
315 }
316 prom_stdout = of_find_node_by_path(name);
317 if (!prom_stdout) {
318 DBG(" can't find stdout package %s !\n", name);
319 return -ENODEV;
320 }
321 DBG("stdout is %s\n", prom_stdout->full_name);
322
323 name = (char *)get_property(prom_stdout, "name", NULL);
324 if (!name) {
325 DBG(" stdout package has no name !\n");
326 goto not_found;
327 }
328 spd = (u32 *)get_property(prom_stdout, "current-speed", NULL);
329
330 if (0)
331 ;
332#ifdef CONFIG_SERIAL_8250_CONSOLE
333 else if (strcmp(name, "serial") == 0) {
334 int i;
335 u32 *reg = (u32 *)get_property(prom_stdout, "reg", &i);
336 if (i > 8) {
337 switch (reg[1]) {
338 case 0x3f8:
339 offset = 0;
340 break;
341 case 0x2f8:
342 offset = 1;
343 break;
344 case 0x898:
345 offset = 2;
346 break;
347 case 0x890:
348 offset = 3;
349 break;
350 default:
351 /* We dont recognise the serial port */
352 goto not_found;
353 }
354 }
355 }
356#endif /* CONFIG_SERIAL_8250_CONSOLE */
357#ifdef CONFIG_PPC_PSERIES
358 else if (strcmp(name, "vty") == 0) {
359 u32 *reg = (u32 *)get_property(prom_stdout, "reg", NULL);
360 char *compat = (char *)get_property(prom_stdout, "compatible", NULL);
361
362 if (reg && compat && (strcmp(compat, "hvterm-protocol") == 0)) {
363 /* Host Virtual Serial Interface */
364 switch (reg[0]) {
365 case 0x30000000:
366 offset = 0;
367 break;
368 case 0x30000001:
369 offset = 1;
370 break;
371 default:
372 goto not_found;
373 }
374 of_node_put(prom_stdout);
375 DBG("Found hvsi console at offset %d\n", offset);
376 return add_preferred_console("hvsi", offset, NULL);
377 } else {
378 /* pSeries LPAR virtual console */
379 of_node_put(prom_stdout);
380 DBG("Found hvc console\n");
381 return add_preferred_console("hvc", 0, NULL);
382 }
383 }
384#endif /* CONFIG_PPC_PSERIES */
385#ifdef CONFIG_SERIAL_PMACZILOG_CONSOLE
386 else if (strcmp(name, "ch-a") == 0)
387 offset = 0;
388 else if (strcmp(name, "ch-b") == 0)
389 offset = 1;
390#endif /* CONFIG_SERIAL_PMACZILOG_CONSOLE */
391 else
392 goto not_found;
393 of_node_put(prom_stdout);
394
395 DBG("Found serial console at ttyS%d\n", offset);
396
397 if (spd) {
398 static char __initdata opt[16];
399 sprintf(opt, "%d", *spd);
400 return add_preferred_console("ttyS", offset, opt);
401 } else
402 return add_preferred_console("ttyS", offset, NULL);
403
404 not_found:
405 DBG("No preferred console found !\n");
406 of_node_put(prom_stdout);
407 return -ENODEV;
408}
409console_initcall(set_preferred_console);
410#endif /* CONFIG_PPC_MULTIPLATFORM */
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
new file mode 100644
index 000000000000..9680ae99b084
--- /dev/null
+++ b/arch/powerpc/kernel/setup_32.c
@@ -0,0 +1,372 @@
1/*
2 * Common prep/pmac/chrp boot and setup code.
3 */
4
5#include <linux/config.h>
6#include <linux/module.h>
7#include <linux/string.h>
8#include <linux/sched.h>
9#include <linux/init.h>
10#include <linux/kernel.h>
11#include <linux/reboot.h>
12#include <linux/delay.h>
13#include <linux/initrd.h>
14#include <linux/ide.h>
15#include <linux/tty.h>
16#include <linux/bootmem.h>
17#include <linux/seq_file.h>
18#include <linux/root_dev.h>
19#include <linux/cpu.h>
20#include <linux/console.h>
21
22#include <asm/residual.h>
23#include <asm/io.h>
24#include <asm/prom.h>
25#include <asm/processor.h>
26#include <asm/pgtable.h>
27#include <asm/setup.h>
28#include <asm/amigappc.h>
29#include <asm/smp.h>
30#include <asm/elf.h>
31#include <asm/cputable.h>
32#include <asm/bootx.h>
33#include <asm/btext.h>
34#include <asm/machdep.h>
35#include <asm/uaccess.h>
36#include <asm/system.h>
37#include <asm/pmac_feature.h>
38#include <asm/sections.h>
39#include <asm/nvram.h>
40#include <asm/xmon.h>
41#include <asm/time.h>
42
43#define DBG(fmt...)
44
45#if defined CONFIG_KGDB
46#include <asm/kgdb.h>
47#endif
48
49extern void platform_init(void);
50extern void bootx_init(unsigned long r4, unsigned long phys);
51
52extern void ppc6xx_idle(void);
53extern void power4_idle(void);
54
55boot_infos_t *boot_infos;
56struct ide_machdep_calls ppc_ide_md;
57
58/* XXX should go elsewhere */
59int __irq_offset_value;
60EXPORT_SYMBOL(__irq_offset_value);
61
62int boot_cpuid;
63EXPORT_SYMBOL_GPL(boot_cpuid);
64int boot_cpuid_phys;
65
66unsigned long ISA_DMA_THRESHOLD;
67unsigned int DMA_MODE_READ;
68unsigned int DMA_MODE_WRITE;
69
70int have_of = 1;
71
72#ifdef CONFIG_PPC_MULTIPLATFORM
73int _machine = 0;
74
75extern void prep_init(void);
76extern void pmac_init(void);
77extern void chrp_init(void);
78
79dev_t boot_dev;
80#endif /* CONFIG_PPC_MULTIPLATFORM */
81
82#ifdef CONFIG_MAGIC_SYSRQ
83unsigned long SYSRQ_KEY = 0x54;
84#endif /* CONFIG_MAGIC_SYSRQ */
85
86#ifdef CONFIG_VGA_CONSOLE
87unsigned long vgacon_remap_base;
88#endif
89
90struct machdep_calls ppc_md;
91EXPORT_SYMBOL(ppc_md);
92
93/*
94 * These are used in binfmt_elf.c to put aux entries on the stack
95 * for each elf executable being started.
96 */
97int dcache_bsize;
98int icache_bsize;
99int ucache_bsize;
100
101/*
102 * We're called here very early in the boot. We determine the machine
103 * type and call the appropriate low-level setup functions.
104 * -- Cort <cort@fsmlabs.com>
105 *
106 * Note that the kernel may be running at an address which is different
107 * from the address that it was linked at, so we must use RELOC/PTRRELOC
108 * to access static data (including strings). -- paulus
109 */
110unsigned long __init early_init(unsigned long dt_ptr)
111{
112 unsigned long offset = reloc_offset();
113
114 /* First zero the BSS -- use memset_io, some platforms don't have
115 * caches on yet */
116 memset_io(PTRRELOC(&__bss_start), 0, _end - __bss_start);
117
118 /*
119 * Identify the CPU type and fix up code sections
120 * that depend on which cpu we have.
121 */
122 identify_cpu(offset, 0);
123 do_cpu_ftr_fixups(offset);
124
125 return KERNELBASE + offset;
126}
127
128#ifdef CONFIG_PPC_MULTIPLATFORM
129/*
130 * The PPC_MULTIPLATFORM version of platform_init...
131 */
132void __init platform_init(void)
133{
134 /* if we didn't get any bootinfo telling us what we are... */
135 if (_machine == 0) {
136 /* prep boot loader tells us if we're prep or not */
137 if ( *(unsigned long *)(KERNELBASE) == (0xdeadc0de) )
138 _machine = _MACH_prep;
139 }
140
141#ifdef CONFIG_PPC_PREP
142 /* not much more to do here, if prep */
143 if (_machine == _MACH_prep) {
144 prep_init();
145 return;
146 }
147#endif
148
149#ifdef CONFIG_ADB
150 if (strstr(cmd_line, "adb_sync")) {
151 extern int __adb_probe_sync;
152 __adb_probe_sync = 1;
153 }
154#endif /* CONFIG_ADB */
155
156 switch (_machine) {
157#ifdef CONFIG_PPC_PMAC
158 case _MACH_Pmac:
159 pmac_init();
160 break;
161#endif
162#ifdef CONFIG_PPC_CHRP
163 case _MACH_chrp:
164 chrp_init();
165 break;
166#endif
167 }
168}
169#endif
170
171/*
172 * Find out what kind of machine we're on and save any data we need
173 * from the early boot process (devtree is copied on pmac by prom_init()).
174 * This is called very early on the boot process, after a minimal
175 * MMU environment has been set up but before MMU_init is called.
176 */
177void __init machine_init(unsigned long dt_ptr, unsigned long phys)
178{
179 early_init_devtree(__va(dt_ptr));
180
181#ifdef CONFIG_CMDLINE
182 strlcpy(cmd_line, CONFIG_CMDLINE, sizeof(cmd_line));
183#endif /* CONFIG_CMDLINE */
184
185 platform_init();
186
187#ifdef CONFIG_6xx
188 ppc_md.power_save = ppc6xx_idle;
189#endif
190
191 if (ppc_md.progress)
192 ppc_md.progress("id mach(): done", 0x200);
193}
194
195#ifdef CONFIG_BOOKE_WDT
196/* Checks wdt=x and wdt_period=xx command-line option */
197int __init early_parse_wdt(char *p)
198{
199 if (p && strncmp(p, "0", 1) != 0)
200 booke_wdt_enabled = 1;
201
202 return 0;
203}
204early_param("wdt", early_parse_wdt);
205
206int __init early_parse_wdt_period (char *p)
207{
208 if (p)
209 booke_wdt_period = simple_strtoul(p, NULL, 0);
210
211 return 0;
212}
213early_param("wdt_period", early_parse_wdt_period);
214#endif /* CONFIG_BOOKE_WDT */
215
216/* Checks "l2cr=xxxx" command-line option */
217int __init ppc_setup_l2cr(char *str)
218{
219 if (cpu_has_feature(CPU_FTR_L2CR)) {
220 unsigned long val = simple_strtoul(str, NULL, 0);
221 printk(KERN_INFO "l2cr set to %lx\n", val);
222 _set_L2CR(0); /* force invalidate by disable cache */
223 _set_L2CR(val); /* and enable it */
224 }
225 return 1;
226}
227__setup("l2cr=", ppc_setup_l2cr);
228
229#ifdef CONFIG_GENERIC_NVRAM
230
231/* Generic nvram hooks used by drivers/char/gen_nvram.c */
232unsigned char nvram_read_byte(int addr)
233{
234 if (ppc_md.nvram_read_val)
235 return ppc_md.nvram_read_val(addr);
236 return 0xff;
237}
238EXPORT_SYMBOL(nvram_read_byte);
239
240void nvram_write_byte(unsigned char val, int addr)
241{
242 if (ppc_md.nvram_write_val)
243 ppc_md.nvram_write_val(addr, val);
244}
245EXPORT_SYMBOL(nvram_write_byte);
246
247void nvram_sync(void)
248{
249 if (ppc_md.nvram_sync)
250 ppc_md.nvram_sync();
251}
252EXPORT_SYMBOL(nvram_sync);
253
254#endif /* CONFIG_NVRAM */
255
256static struct cpu cpu_devices[NR_CPUS];
257
258int __init ppc_init(void)
259{
260 int i;
261
262 /* clear the progress line */
263 if ( ppc_md.progress ) ppc_md.progress(" ", 0xffff);
264
265 /* register CPU devices */
266 for (i = 0; i < NR_CPUS; i++)
267 if (cpu_possible(i))
268 register_cpu(&cpu_devices[i], i, NULL);
269
270 /* call platform init */
271 if (ppc_md.init != NULL) {
272 ppc_md.init();
273 }
274 return 0;
275}
276
277arch_initcall(ppc_init);
278
279/* Warning, IO base is not yet inited */
280void __init setup_arch(char **cmdline_p)
281{
282 extern char *klimit;
283 extern void do_init_bootmem(void);
284
285 /* so udelay does something sensible, assume <= 1000 bogomips */
286 loops_per_jiffy = 500000000 / HZ;
287
288 unflatten_device_tree();
289 finish_device_tree();
290
291#ifdef CONFIG_BOOTX_TEXT
292 init_boot_display();
293#endif
294
295#ifdef CONFIG_PPC_PMAC
296 /* This could be called "early setup arch", it must be done
297 * now because xmon need it
298 */
299 if (_machine == _MACH_Pmac)
300 pmac_feature_init(); /* New cool way */
301#endif
302
303#ifdef CONFIG_XMON
304 xmon_map_scc();
305 if (strstr(cmd_line, "xmon")) {
306 xmon_init(1);
307 debugger(NULL);
308 }
309#endif /* CONFIG_XMON */
310 if ( ppc_md.progress ) ppc_md.progress("setup_arch: enter", 0x3eab);
311
312#if defined(CONFIG_KGDB)
313 if (ppc_md.kgdb_map_scc)
314 ppc_md.kgdb_map_scc();
315 set_debug_traps();
316 if (strstr(cmd_line, "gdb")) {
317 if (ppc_md.progress)
318 ppc_md.progress("setup_arch: kgdb breakpoint", 0x4000);
319 printk("kgdb breakpoint activated\n");
320 breakpoint();
321 }
322#endif
323
324 /*
325 * Set cache line size based on type of cpu as a default.
326 * Systems with OF can look in the properties on the cpu node(s)
327 * for a possibly more accurate value.
328 */
329 if (cpu_has_feature(CPU_FTR_SPLIT_ID_CACHE)) {
330 dcache_bsize = cur_cpu_spec->dcache_bsize;
331 icache_bsize = cur_cpu_spec->icache_bsize;
332 ucache_bsize = 0;
333 } else
334 ucache_bsize = dcache_bsize = icache_bsize
335 = cur_cpu_spec->dcache_bsize;
336
337 /* reboot on panic */
338 panic_timeout = 180;
339
340 init_mm.start_code = PAGE_OFFSET;
341 init_mm.end_code = (unsigned long) _etext;
342 init_mm.end_data = (unsigned long) _edata;
343 init_mm.brk = (unsigned long) klimit;
344
345 /* Save unparsed command line copy for /proc/cmdline */
346 strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE);
347 *cmdline_p = cmd_line;
348
349 parse_early_param();
350
351 /* set up the bootmem stuff with available memory */
352 do_init_bootmem();
353 if ( ppc_md.progress ) ppc_md.progress("setup_arch: bootmem", 0x3eab);
354
355#ifdef CONFIG_PPC_OCP
356 /* Initialize OCP device list */
357 ocp_early_init();
358 if ( ppc_md.progress ) ppc_md.progress("ocp: exit", 0x3eab);
359#endif
360
361#ifdef CONFIG_DUMMY_CONSOLE
362 conswitchp = &dummy_con;
363#endif
364
365 ppc_md.setup_arch();
366 if ( ppc_md.progress ) ppc_md.progress("arch: exit", 0x3eab);
367
368 paging_init();
369
370 /* this is for modules since _machine can be a define -- Cort */
371 ppc_md.ppc_machine = _machine;
372}
diff --git a/arch/ppc64/kernel/setup.c b/arch/powerpc/kernel/setup_64.c
index 5ac48bd64891..40c48100bf1b 100644
--- a/arch/ppc64/kernel/setup.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -37,7 +37,6 @@
37#include <asm/prom.h> 37#include <asm/prom.h>
38#include <asm/processor.h> 38#include <asm/processor.h>
39#include <asm/pgtable.h> 39#include <asm/pgtable.h>
40#include <asm/bootinfo.h>
41#include <asm/smp.h> 40#include <asm/smp.h>
42#include <asm/elf.h> 41#include <asm/elf.h>
43#include <asm/machdep.h> 42#include <asm/machdep.h>
@@ -58,6 +57,9 @@
58#include <asm/mmu.h> 57#include <asm/mmu.h>
59#include <asm/lmb.h> 58#include <asm/lmb.h>
60#include <asm/iSeries/ItLpNaca.h> 59#include <asm/iSeries/ItLpNaca.h>
60#include <asm/firmware.h>
61#include <asm/systemcfg.h>
62#include <asm/xmon.h>
61 63
62#ifdef DEBUG 64#ifdef DEBUG
63#define DBG(fmt...) udbg_printf(fmt) 65#define DBG(fmt...) udbg_printf(fmt)
@@ -136,24 +138,7 @@ static struct notifier_block ppc64_panic_block = {
136 .priority = INT_MIN /* may not return; must be done last */ 138 .priority = INT_MIN /* may not return; must be done last */
137}; 139};
138 140
139/* 141#ifdef CONFIG_SMP
140 * Perhaps we can put the pmac screen_info[] here
141 * on pmac as well so we don't need the ifdef's.
142 * Until we get multiple-console support in here
143 * that is. -- Cort
144 * Maybe tie it to serial consoles, since this is really what
145 * these processors use on existing boards. -- Dan
146 */
147struct screen_info screen_info = {
148 .orig_x = 0,
149 .orig_y = 25,
150 .orig_video_cols = 80,
151 .orig_video_lines = 25,
152 .orig_video_isVGA = 1,
153 .orig_video_points = 16
154};
155
156#if defined(CONFIG_PPC_MULTIPLATFORM) && defined(CONFIG_SMP)
157 142
158static int smt_enabled_cmdline; 143static int smt_enabled_cmdline;
159 144
@@ -306,15 +291,13 @@ static void __init setup_cpu_maps(void)
306 291
307 systemcfg->processorCount = num_present_cpus(); 292 systemcfg->processorCount = num_present_cpus();
308} 293}
309#endif /* defined(CONFIG_PPC_MULTIPLATFORM) && defined(CONFIG_SMP) */ 294#endif /* CONFIG_SMP */
310
311
312#ifdef CONFIG_PPC_MULTIPLATFORM
313 295
314extern struct machdep_calls pSeries_md; 296extern struct machdep_calls pSeries_md;
315extern struct machdep_calls pmac_md; 297extern struct machdep_calls pmac_md;
316extern struct machdep_calls maple_md; 298extern struct machdep_calls maple_md;
317extern struct machdep_calls bpa_md; 299extern struct machdep_calls bpa_md;
300extern struct machdep_calls iseries_md;
318 301
319/* Ultimately, stuff them in an elf section like initcalls... */ 302/* Ultimately, stuff them in an elf section like initcalls... */
320static struct machdep_calls __initdata *machines[] = { 303static struct machdep_calls __initdata *machines[] = {
@@ -330,6 +313,9 @@ static struct machdep_calls __initdata *machines[] = {
330#ifdef CONFIG_PPC_BPA 313#ifdef CONFIG_PPC_BPA
331 &bpa_md, 314 &bpa_md,
332#endif 315#endif
316#ifdef CONFIG_PPC_ISERIES
317 &iseries_md,
318#endif
333 NULL 319 NULL
334}; 320};
335 321
@@ -401,7 +387,8 @@ void __init early_setup(unsigned long dt_ptr)
401 /* 387 /*
402 * Initialize stab / SLB management 388 * Initialize stab / SLB management
403 */ 389 */
404 stab_initialize(lpaca->stab_real); 390 if (!firmware_has_feature(FW_FEATURE_ISERIES))
391 stab_initialize(lpaca->stab_real);
405 392
406 /* 393 /*
407 * Initialize the MMU Hash table and create the linear mapping 394 * Initialize the MMU Hash table and create the linear mapping
@@ -532,8 +519,6 @@ static void __init check_for_initrd(void)
532#endif /* CONFIG_BLK_DEV_INITRD */ 519#endif /* CONFIG_BLK_DEV_INITRD */
533} 520}
534 521
535#endif /* CONFIG_PPC_MULTIPLATFORM */
536
537/* 522/*
538 * Do some initial setup of the system. The parameters are those which 523 * Do some initial setup of the system. The parameters are those which
539 * were passed in from the bootloader. 524 * were passed in from the bootloader.
@@ -542,14 +527,6 @@ void __init setup_system(void)
542{ 527{
543 DBG(" -> setup_system()\n"); 528 DBG(" -> setup_system()\n");
544 529
545#ifdef CONFIG_PPC_ISERIES
546 /* pSeries systems are identified in prom.c via OF. */
547 if (itLpNaca.xLparInstalled == 1)
548 systemcfg->platform = PLATFORM_ISERIES_LPAR;
549
550 ppc_md.init_early();
551#else /* CONFIG_PPC_ISERIES */
552
553 /* 530 /*
554 * Unflatten the device-tree passed by prom_init or kexec 531 * Unflatten the device-tree passed by prom_init or kexec
555 */ 532 */
@@ -592,6 +569,10 @@ void __init setup_system(void)
592 */ 569 */
593 finish_device_tree(); 570 finish_device_tree();
594 571
572#ifdef CONFIG_BOOTX_TEXT
573 init_boot_display();
574#endif
575
595 /* 576 /*
596 * Initialize xmon 577 * Initialize xmon
597 */ 578 */
@@ -607,9 +588,8 @@ void __init setup_system(void)
607 strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE); 588 strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE);
608 589
609 parse_early_param(); 590 parse_early_param();
610#endif /* !CONFIG_PPC_ISERIES */
611 591
612#if defined(CONFIG_SMP) && !defined(CONFIG_PPC_ISERIES) 592#ifdef CONFIG_SMP
613 /* 593 /*
614 * iSeries has already initialized the cpu maps at this point. 594 * iSeries has already initialized the cpu maps at this point.
615 */ 595 */
@@ -619,7 +599,7 @@ void __init setup_system(void)
619 * we can map physical -> logical CPU ids 599 * we can map physical -> logical CPU ids
620 */ 600 */
621 smp_release_cpus(); 601 smp_release_cpus();
622#endif /* defined(CONFIG_SMP) && !defined(CONFIG_PPC_ISERIES) */ 602#endif
623 603
624 printk("Starting Linux PPC64 %s\n", system_utsname.version); 604 printk("Starting Linux PPC64 %s\n", system_utsname.version);
625 605
@@ -644,51 +624,6 @@ void __init setup_system(void)
644 DBG(" <- setup_system()\n"); 624 DBG(" <- setup_system()\n");
645} 625}
646 626
647/* also used by kexec */
648void machine_shutdown(void)
649{
650 if (ppc_md.nvram_sync)
651 ppc_md.nvram_sync();
652}
653
654void machine_restart(char *cmd)
655{
656 machine_shutdown();
657 ppc_md.restart(cmd);
658#ifdef CONFIG_SMP
659 smp_send_stop();
660#endif
661 printk(KERN_EMERG "System Halted, OK to turn off power\n");
662 local_irq_disable();
663 while (1) ;
664}
665
666void machine_power_off(void)
667{
668 machine_shutdown();
669 ppc_md.power_off();
670#ifdef CONFIG_SMP
671 smp_send_stop();
672#endif
673 printk(KERN_EMERG "System Halted, OK to turn off power\n");
674 local_irq_disable();
675 while (1) ;
676}
677/* Used by the G5 thermal driver */
678EXPORT_SYMBOL_GPL(machine_power_off);
679
680void machine_halt(void)
681{
682 machine_shutdown();
683 ppc_md.halt();
684#ifdef CONFIG_SMP
685 smp_send_stop();
686#endif
687 printk(KERN_EMERG "System Halted, OK to turn off power\n");
688 local_irq_disable();
689 while (1) ;
690}
691
692static int ppc64_panic_event(struct notifier_block *this, 627static int ppc64_panic_event(struct notifier_block *this,
693 unsigned long event, void *ptr) 628 unsigned long event, void *ptr)
694{ 629{
@@ -696,99 +631,6 @@ static int ppc64_panic_event(struct notifier_block *this,
696 return NOTIFY_DONE; 631 return NOTIFY_DONE;
697} 632}
698 633
699
700#ifdef CONFIG_SMP
701DEFINE_PER_CPU(unsigned int, pvr);
702#endif
703
704static int show_cpuinfo(struct seq_file *m, void *v)
705{
706 unsigned long cpu_id = (unsigned long)v - 1;
707 unsigned int pvr;
708 unsigned short maj;
709 unsigned short min;
710
711 if (cpu_id == NR_CPUS) {
712 seq_printf(m, "timebase\t: %lu\n", ppc_tb_freq);
713
714 if (ppc_md.get_cpuinfo != NULL)
715 ppc_md.get_cpuinfo(m);
716
717 return 0;
718 }
719
720 /* We only show online cpus: disable preempt (overzealous, I
721 * knew) to prevent cpu going down. */
722 preempt_disable();
723 if (!cpu_online(cpu_id)) {
724 preempt_enable();
725 return 0;
726 }
727
728#ifdef CONFIG_SMP
729 pvr = per_cpu(pvr, cpu_id);
730#else
731 pvr = mfspr(SPRN_PVR);
732#endif
733 maj = (pvr >> 8) & 0xFF;
734 min = pvr & 0xFF;
735
736 seq_printf(m, "processor\t: %lu\n", cpu_id);
737 seq_printf(m, "cpu\t\t: ");
738
739 if (cur_cpu_spec->pvr_mask)
740 seq_printf(m, "%s", cur_cpu_spec->cpu_name);
741 else
742 seq_printf(m, "unknown (%08x)", pvr);
743
744#ifdef CONFIG_ALTIVEC
745 if (cpu_has_feature(CPU_FTR_ALTIVEC))
746 seq_printf(m, ", altivec supported");
747#endif /* CONFIG_ALTIVEC */
748
749 seq_printf(m, "\n");
750
751 /*
752 * Assume here that all clock rates are the same in a
753 * smp system. -- Cort
754 */
755 seq_printf(m, "clock\t\t: %lu.%06luMHz\n", ppc_proc_freq / 1000000,
756 ppc_proc_freq % 1000000);
757
758 seq_printf(m, "revision\t: %hd.%hd\n\n", maj, min);
759
760 preempt_enable();
761 return 0;
762}
763
764static void *c_start(struct seq_file *m, loff_t *pos)
765{
766 return *pos <= NR_CPUS ? (void *)((*pos)+1) : NULL;
767}
768static void *c_next(struct seq_file *m, void *v, loff_t *pos)
769{
770 ++*pos;
771 return c_start(m, pos);
772}
773static void c_stop(struct seq_file *m, void *v)
774{
775}
776struct seq_operations cpuinfo_op = {
777 .start =c_start,
778 .next = c_next,
779 .stop = c_stop,
780 .show = show_cpuinfo,
781};
782
783/*
784 * These three variables are used to save values passed to us by prom_init()
785 * via the device tree. The TCE variables are needed because with a memory_limit
786 * in force we may need to explicitly map the TCE are at the top of RAM.
787 */
788unsigned long memory_limit;
789unsigned long tce_alloc_start;
790unsigned long tce_alloc_end;
791
792#ifdef CONFIG_PPC_ISERIES 634#ifdef CONFIG_PPC_ISERIES
793/* 635/*
794 * On iSeries we just parse the mem=X option from the command line. 636 * On iSeries we just parse the mem=X option from the command line.
@@ -806,130 +648,6 @@ static int __init early_parsemem(char *p)
806early_param("mem", early_parsemem); 648early_param("mem", early_parsemem);
807#endif /* CONFIG_PPC_ISERIES */ 649#endif /* CONFIG_PPC_ISERIES */
808 650
809#ifdef CONFIG_PPC_MULTIPLATFORM
810static int __init set_preferred_console(void)
811{
812 struct device_node *prom_stdout = NULL;
813 char *name;
814 u32 *spd;
815 int offset = 0;
816
817 DBG(" -> set_preferred_console()\n");
818
819 /* The user has requested a console so this is already set up. */
820 if (strstr(saved_command_line, "console=")) {
821 DBG(" console was specified !\n");
822 return -EBUSY;
823 }
824
825 if (!of_chosen) {
826 DBG(" of_chosen is NULL !\n");
827 return -ENODEV;
828 }
829 /* We are getting a weird phandle from OF ... */
830 /* ... So use the full path instead */
831 name = (char *)get_property(of_chosen, "linux,stdout-path", NULL);
832 if (name == NULL) {
833 DBG(" no linux,stdout-path !\n");
834 return -ENODEV;
835 }
836 prom_stdout = of_find_node_by_path(name);
837 if (!prom_stdout) {
838 DBG(" can't find stdout package %s !\n", name);
839 return -ENODEV;
840 }
841 DBG("stdout is %s\n", prom_stdout->full_name);
842
843 name = (char *)get_property(prom_stdout, "name", NULL);
844 if (!name) {
845 DBG(" stdout package has no name !\n");
846 goto not_found;
847 }
848 spd = (u32 *)get_property(prom_stdout, "current-speed", NULL);
849
850 if (0)
851 ;
852#ifdef CONFIG_SERIAL_8250_CONSOLE
853 else if (strcmp(name, "serial") == 0) {
854 int i;
855 u32 *reg = (u32 *)get_property(prom_stdout, "reg", &i);
856 if (i > 8) {
857 switch (reg[1]) {
858 case 0x3f8:
859 offset = 0;
860 break;
861 case 0x2f8:
862 offset = 1;
863 break;
864 case 0x898:
865 offset = 2;
866 break;
867 case 0x890:
868 offset = 3;
869 break;
870 default:
871 /* We dont recognise the serial port */
872 goto not_found;
873 }
874 }
875 }
876#endif /* CONFIG_SERIAL_8250_CONSOLE */
877#ifdef CONFIG_PPC_PSERIES
878 else if (strcmp(name, "vty") == 0) {
879 u32 *reg = (u32 *)get_property(prom_stdout, "reg", NULL);
880 char *compat = (char *)get_property(prom_stdout, "compatible", NULL);
881
882 if (reg && compat && (strcmp(compat, "hvterm-protocol") == 0)) {
883 /* Host Virtual Serial Interface */
884 int offset;
885 switch (reg[0]) {
886 case 0x30000000:
887 offset = 0;
888 break;
889 case 0x30000001:
890 offset = 1;
891 break;
892 default:
893 goto not_found;
894 }
895 of_node_put(prom_stdout);
896 DBG("Found hvsi console at offset %d\n", offset);
897 return add_preferred_console("hvsi", offset, NULL);
898 } else {
899 /* pSeries LPAR virtual console */
900 of_node_put(prom_stdout);
901 DBG("Found hvc console\n");
902 return add_preferred_console("hvc", 0, NULL);
903 }
904 }
905#endif /* CONFIG_PPC_PSERIES */
906#ifdef CONFIG_SERIAL_PMACZILOG_CONSOLE
907 else if (strcmp(name, "ch-a") == 0)
908 offset = 0;
909 else if (strcmp(name, "ch-b") == 0)
910 offset = 1;
911#endif /* CONFIG_SERIAL_PMACZILOG_CONSOLE */
912 else
913 goto not_found;
914 of_node_put(prom_stdout);
915
916 DBG("Found serial console at ttyS%d\n", offset);
917
918 if (spd) {
919 static char __initdata opt[16];
920 sprintf(opt, "%d", *spd);
921 return add_preferred_console("ttyS", offset, opt);
922 } else
923 return add_preferred_console("ttyS", offset, NULL);
924
925 not_found:
926 DBG("No preferred console found !\n");
927 of_node_put(prom_stdout);
928 return -ENODEV;
929}
930console_initcall(set_preferred_console);
931#endif /* CONFIG_PPC_MULTIPLATFORM */
932
933#ifdef CONFIG_IRQSTACKS 651#ifdef CONFIG_IRQSTACKS
934static void __init irqstack_early_init(void) 652static void __init irqstack_early_init(void)
935{ 653{
@@ -983,23 +701,22 @@ void __init setup_syscall_map(void)
983{ 701{
984 unsigned int i, count64 = 0, count32 = 0; 702 unsigned int i, count64 = 0, count32 = 0;
985 extern unsigned long *sys_call_table; 703 extern unsigned long *sys_call_table;
986 extern unsigned long *sys_call_table32;
987 extern unsigned long sys_ni_syscall; 704 extern unsigned long sys_ni_syscall;
988 705
989 706
990 for (i = 0; i < __NR_syscalls; i++) { 707 for (i = 0; i < __NR_syscalls; i++) {
991 if (sys_call_table[i] == sys_ni_syscall) 708 if (sys_call_table[i*2] != sys_ni_syscall) {
992 continue; 709 count64++;
993 count64++; 710 systemcfg->syscall_map_64[i >> 5] |=
994 systemcfg->syscall_map_64[i >> 5] |= 0x80000000UL >> (i & 0x1f); 711 0x80000000UL >> (i & 0x1f);
995 } 712 }
996 for (i = 0; i < __NR_syscalls; i++) { 713 if (sys_call_table[i*2+1] != sys_ni_syscall) {
997 if (sys_call_table32[i] == sys_ni_syscall) 714 count32++;
998 continue; 715 systemcfg->syscall_map_32[i >> 5] |=
999 count32++; 716 0x80000000UL >> (i & 0x1f);
1000 systemcfg->syscall_map_32[i >> 5] |= 0x80000000UL >> (i & 0x1f); 717 }
1001 } 718 }
1002 printk(KERN_INFO "Syscall map setup, %d 32 bits and %d 64 bits syscalls\n", 719 printk(KERN_INFO "Syscall map setup, %d 32-bit and %d 64-bit syscalls\n",
1003 count32, count64); 720 count32, count64);
1004} 721}
1005 722
@@ -1047,6 +764,10 @@ void __init setup_arch(char **cmdline_p)
1047 /* initialize the syscall map in systemcfg */ 764 /* initialize the syscall map in systemcfg */
1048 setup_syscall_map(); 765 setup_syscall_map();
1049 766
767#ifdef CONFIG_DUMMY_CONSOLE
768 conswitchp = &dummy_con;
769#endif
770
1050 ppc_md.setup_arch(); 771 ppc_md.setup_arch();
1051 772
1052 /* Use the default idle loop if the platform hasn't provided one. */ 773 /* Use the default idle loop if the platform hasn't provided one. */
@@ -1091,15 +812,6 @@ void ppc64_terminate_msg(unsigned int src, const char *msg)
1091 printk("[terminate]%04x %s\n", src, msg); 812 printk("[terminate]%04x %s\n", src, msg);
1092} 813}
1093 814
1094/* This should only be called on processor 0 during calibrate decr */
1095void __init setup_default_decr(void)
1096{
1097 struct paca_struct *lpaca = get_paca();
1098
1099 lpaca->default_decr = tb_ticks_per_jiffy;
1100 lpaca->next_jiffy_update_tb = get_tb() + tb_ticks_per_jiffy;
1101}
1102
1103#ifndef CONFIG_PPC_ISERIES 815#ifndef CONFIG_PPC_ISERIES
1104/* 816/*
1105 * This function can be used by platforms to "find" legacy serial ports. 817 * This function can be used by platforms to "find" legacy serial ports.
diff --git a/arch/ppc64/kernel/signal32.c b/arch/powerpc/kernel/signal_32.c
index a8b7a5a56bb4..444c3e81884c 100644
--- a/arch/ppc64/kernel/signal32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -1,56 +1,353 @@
1/* 1/*
2 * signal32.c: Support 32bit signal syscalls. 2 * Signal handling for 32bit PPC and 32bit tasks on 64bit PPC
3 * 3 *
4 * PowerPC version
5 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
4 * Copyright (C) 2001 IBM 6 * Copyright (C) 2001 IBM
5 * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) 7 * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
6 * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) 8 * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
7 * 9 *
8 * These routines maintain argument size conversion between 32bit and 64bit 10 * Derived from "arch/i386/kernel/signal.c"
9 * environment. 11 * Copyright (C) 1991, 1992 Linus Torvalds
12 * 1997-11-28 Modified for POSIX.1b signals by Richard Henderson
10 * 13 *
11 * This program is free software; you can redistribute it and/or 14 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License 15 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 16 * as published by the Free Software Foundation; either version
14 * 2 of the License, or (at your option) any later version. 17 * 2 of the License, or (at your option) any later version.
15 */ 18 */
16 19
17#include <linux/config.h> 20#include <linux/config.h>
18#include <linux/sched.h> 21#include <linux/sched.h>
19#include <linux/mm.h> 22#include <linux/mm.h>
20#include <linux/smp.h> 23#include <linux/smp.h>
21#include <linux/smp_lock.h> 24#include <linux/smp_lock.h>
22#include <linux/kernel.h> 25#include <linux/kernel.h>
23#include <linux/signal.h> 26#include <linux/signal.h>
24#include <linux/syscalls.h>
25#include <linux/errno.h> 27#include <linux/errno.h>
26#include <linux/elf.h> 28#include <linux/elf.h>
29#ifdef CONFIG_PPC64
30#include <linux/syscalls.h>
27#include <linux/compat.h> 31#include <linux/compat.h>
28#include <linux/ptrace.h> 32#include <linux/ptrace.h>
29#include <asm/ppc32.h> 33#else
34#include <linux/wait.h>
35#include <linux/ptrace.h>
36#include <linux/unistd.h>
37#include <linux/stddef.h>
38#include <linux/tty.h>
39#include <linux/binfmts.h>
40#include <linux/suspend.h>
41#endif
42
30#include <asm/uaccess.h> 43#include <asm/uaccess.h>
44#include <asm/cacheflush.h>
45#ifdef CONFIG_PPC64
46#include <asm/ppc32.h>
31#include <asm/ppcdebug.h> 47#include <asm/ppcdebug.h>
32#include <asm/unistd.h> 48#include <asm/unistd.h>
33#include <asm/cacheflush.h>
34#include <asm/vdso.h> 49#include <asm/vdso.h>
50#else
51#include <asm/ucontext.h>
52#include <asm/pgtable.h>
53#endif
35 54
36#define DEBUG_SIG 0 55#undef DEBUG_SIG
37 56
38#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) 57#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
39 58
40#define GP_REGS_SIZE32 min(sizeof(elf_gregset_t32), sizeof(struct pt_regs32)) 59#ifdef CONFIG_PPC64
60#define do_signal do_signal32
61#define sys_sigsuspend compat_sys_sigsuspend
62#define sys_rt_sigsuspend compat_sys_rt_sigsuspend
63#define sys_rt_sigreturn compat_sys_rt_sigreturn
64#define sys_sigaction compat_sys_sigaction
65#define sys_swapcontext compat_sys_swapcontext
66#define sys_sigreturn compat_sys_sigreturn
67
68#define old_sigaction old_sigaction32
69#define sigcontext sigcontext32
70#define mcontext mcontext32
71#define ucontext ucontext32
72
73/*
74 * Returning 0 means we return to userspace via
75 * ret_from_except and thus restore all user
76 * registers from *regs. This is what we need
77 * to do when a signal has been delivered.
78 */
79#define sigreturn_exit(regs) return 0
80
81#define GP_REGS_SIZE min(sizeof(elf_gregset_t32), sizeof(struct pt_regs32))
82#undef __SIGNAL_FRAMESIZE
83#define __SIGNAL_FRAMESIZE __SIGNAL_FRAMESIZE32
84#undef ELF_NVRREG
85#define ELF_NVRREG ELF_NVRREG32
86
87/*
88 * Functions for flipping sigsets (thanks to brain dead generic
89 * implementation that makes things simple for little endian only)
90 */
91static inline int put_sigset_t(compat_sigset_t __user *uset, sigset_t *set)
92{
93 compat_sigset_t cset;
94
95 switch (_NSIG_WORDS) {
96 case 4: cset.sig[5] = set->sig[3] & 0xffffffffull;
97 cset.sig[7] = set->sig[3] >> 32;
98 case 3: cset.sig[4] = set->sig[2] & 0xffffffffull;
99 cset.sig[5] = set->sig[2] >> 32;
100 case 2: cset.sig[2] = set->sig[1] & 0xffffffffull;
101 cset.sig[3] = set->sig[1] >> 32;
102 case 1: cset.sig[0] = set->sig[0] & 0xffffffffull;
103 cset.sig[1] = set->sig[0] >> 32;
104 }
105 return copy_to_user(uset, &cset, sizeof(*uset));
106}
107
108static inline int get_sigset_t(sigset_t *set,
109 const compat_sigset_t __user *uset)
110{
111 compat_sigset_t s32;
112
113 if (copy_from_user(&s32, uset, sizeof(*uset)))
114 return -EFAULT;
115
116 /*
117 * Swap the 2 words of the 64-bit sigset_t (they are stored
118 * in the "wrong" endian in 32-bit user storage).
119 */
120 switch (_NSIG_WORDS) {
121 case 4: set->sig[3] = s32.sig[6] | (((long)s32.sig[7]) << 32);
122 case 3: set->sig[2] = s32.sig[4] | (((long)s32.sig[5]) << 32);
123 case 2: set->sig[1] = s32.sig[2] | (((long)s32.sig[3]) << 32);
124 case 1: set->sig[0] = s32.sig[0] | (((long)s32.sig[1]) << 32);
125 }
126 return 0;
127}
128
129static inline int get_old_sigaction(struct k_sigaction *new_ka,
130 struct old_sigaction __user *act)
131{
132 compat_old_sigset_t mask;
133 compat_uptr_t handler, restorer;
134
135 if (get_user(handler, &act->sa_handler) ||
136 __get_user(restorer, &act->sa_restorer) ||
137 __get_user(new_ka->sa.sa_flags, &act->sa_flags) ||
138 __get_user(mask, &act->sa_mask))
139 return -EFAULT;
140 new_ka->sa.sa_handler = compat_ptr(handler);
141 new_ka->sa.sa_restorer = compat_ptr(restorer);
142 siginitset(&new_ka->sa.sa_mask, mask);
143 return 0;
144}
145
146static inline compat_uptr_t to_user_ptr(void *kp)
147{
148 return (compat_uptr_t)(u64)kp;
149}
150
151#define from_user_ptr(p) compat_ptr(p)
152
153static inline int save_general_regs(struct pt_regs *regs,
154 struct mcontext __user *frame)
155{
156 elf_greg_t64 *gregs = (elf_greg_t64 *)regs;
157 int i;
158
159 for (i = 0; i <= PT_RESULT; i ++)
160 if (__put_user((unsigned int)gregs[i], &frame->mc_gregs[i]))
161 return -EFAULT;
162 return 0;
163}
164
165static inline int restore_general_regs(struct pt_regs *regs,
166 struct mcontext __user *sr)
167{
168 elf_greg_t64 *gregs = (elf_greg_t64 *)regs;
169 int i;
170
171 for (i = 0; i <= PT_RESULT; i++) {
172 if ((i == PT_MSR) || (i == PT_SOFTE))
173 continue;
174 if (__get_user(gregs[i], &sr->mc_gregs[i]))
175 return -EFAULT;
176 }
177 return 0;
178}
179
180#else /* CONFIG_PPC64 */
181
182extern void sigreturn_exit(struct pt_regs *);
183
184#define GP_REGS_SIZE min(sizeof(elf_gregset_t), sizeof(struct pt_regs))
185
186static inline int put_sigset_t(sigset_t __user *uset, sigset_t *set)
187{
188 return copy_to_user(uset, set, sizeof(*uset));
189}
190
191static inline int get_sigset_t(sigset_t *set, const sigset_t __user *uset)
192{
193 return copy_from_user(set, uset, sizeof(*uset));
194}
195
196static inline int get_old_sigaction(struct k_sigaction *new_ka,
197 struct old_sigaction __user *act)
198{
199 old_sigset_t mask;
200
201 if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
202 __get_user(new_ka->sa.sa_handler, &act->sa_handler) ||
203 __get_user(new_ka->sa.sa_restorer, &act->sa_restorer))
204 return -EFAULT;
205 __get_user(new_ka->sa.sa_flags, &act->sa_flags);
206 __get_user(mask, &act->sa_mask);
207 siginitset(&new_ka->sa.sa_mask, mask);
208 return 0;
209}
210
211#define to_user_ptr(p) (p)
212#define from_user_ptr(p) (p)
213
214static inline int save_general_regs(struct pt_regs *regs,
215 struct mcontext __user *frame)
216{
217 return __copy_to_user(&frame->mc_gregs, regs, GP_REGS_SIZE);
218}
219
220static inline int restore_general_regs(struct pt_regs *regs,
221 struct mcontext __user *sr)
222{
223 /* copy up to but not including MSR */
224 if (__copy_from_user(regs, &sr->mc_gregs,
225 PT_MSR * sizeof(elf_greg_t)))
226 return -EFAULT;
227 /* copy from orig_r3 (the word after the MSR) up to the end */
228 if (__copy_from_user(&regs->orig_gpr3, &sr->mc_gregs[PT_ORIG_R3],
229 GP_REGS_SIZE - PT_ORIG_R3 * sizeof(elf_greg_t)))
230 return -EFAULT;
231 return 0;
232}
233
234#endif /* CONFIG_PPC64 */
235
236int do_signal(sigset_t *oldset, struct pt_regs *regs);
237
238/*
239 * Atomically swap in the new signal mask, and wait for a signal.
240 */
241long sys_sigsuspend(old_sigset_t mask, int p2, int p3, int p4, int p6, int p7,
242 struct pt_regs *regs)
243{
244 sigset_t saveset;
245
246 mask &= _BLOCKABLE;
247 spin_lock_irq(&current->sighand->siglock);
248 saveset = current->blocked;
249 siginitset(&current->blocked, mask);
250 recalc_sigpending();
251 spin_unlock_irq(&current->sighand->siglock);
252
253 regs->result = -EINTR;
254 regs->gpr[3] = EINTR;
255 regs->ccr |= 0x10000000;
256 while (1) {
257 current->state = TASK_INTERRUPTIBLE;
258 schedule();
259 if (do_signal(&saveset, regs))
260 sigreturn_exit(regs);
261 }
262}
263
264long sys_rt_sigsuspend(
265#ifdef CONFIG_PPC64
266 compat_sigset_t __user *unewset,
267#else
268 sigset_t __user *unewset,
269#endif
270 size_t sigsetsize, int p3, int p4,
271 int p6, int p7, struct pt_regs *regs)
272{
273 sigset_t saveset, newset;
274
275 /* XXX: Don't preclude handling different sized sigset_t's. */
276 if (sigsetsize != sizeof(sigset_t))
277 return -EINVAL;
278
279 if (get_sigset_t(&newset, unewset))
280 return -EFAULT;
281 sigdelsetmask(&newset, ~_BLOCKABLE);
282
283 spin_lock_irq(&current->sighand->siglock);
284 saveset = current->blocked;
285 current->blocked = newset;
286 recalc_sigpending();
287 spin_unlock_irq(&current->sighand->siglock);
288
289 regs->result = -EINTR;
290 regs->gpr[3] = EINTR;
291 regs->ccr |= 0x10000000;
292 while (1) {
293 current->state = TASK_INTERRUPTIBLE;
294 schedule();
295 if (do_signal(&saveset, regs))
296 sigreturn_exit(regs);
297 }
298}
299
300#ifdef CONFIG_PPC32
301long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, int r5,
302 int r6, int r7, int r8, struct pt_regs *regs)
303{
304 return do_sigaltstack(uss, uoss, regs->gpr[1]);
305}
306#endif
307
308long sys_sigaction(int sig, struct old_sigaction __user *act,
309 struct old_sigaction __user *oact)
310{
311 struct k_sigaction new_ka, old_ka;
312 int ret;
313
314#ifdef CONFIG_PPC64
315 if (sig < 0)
316 sig = -sig;
317#endif
318
319 if (act) {
320 if (get_old_sigaction(&new_ka, act))
321 return -EFAULT;
322 }
323
324 ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
325 if (!ret && oact) {
326 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
327 __put_user(to_user_ptr(old_ka.sa.sa_handler),
328 &oact->sa_handler) ||
329 __put_user(to_user_ptr(old_ka.sa.sa_restorer),
330 &oact->sa_restorer) ||
331 __put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
332 __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
333 return -EFAULT;
334 }
335
336 return ret;
337}
41 338
42/* 339/*
43 * When we have signals to deliver, we set up on the 340 * When we have signals to deliver, we set up on the
44 * user stack, going down from the original stack pointer: 341 * user stack, going down from the original stack pointer:
45 * a sigregs32 struct 342 * a sigregs struct
46 * a sigcontext32 struct 343 * a sigcontext struct
47 * a gap of __SIGNAL_FRAMESIZE32 bytes 344 * a gap of __SIGNAL_FRAMESIZE bytes
48 * 345 *
49 * Each of these things must be a multiple of 16 bytes in size. 346 * Each of these things must be a multiple of 16 bytes in size.
50 * 347 *
51 */ 348 */
52struct sigregs32 { 349struct sigregs {
53 struct mcontext32 mctx; /* all the register values */ 350 struct mcontext mctx; /* all the register values */
54 /* 351 /*
55 * Programs using the rs6000/xcoff abi can save up to 19 gp 352 * Programs using the rs6000/xcoff abi can save up to 19 gp
56 * regs and 18 fp regs below sp before decrementing it. 353 * regs and 18 fp regs below sp before decrementing it.
@@ -64,17 +361,21 @@ struct sigregs32 {
64/* 361/*
65 * When we have rt signals to deliver, we set up on the 362 * When we have rt signals to deliver, we set up on the
66 * user stack, going down from the original stack pointer: 363 * user stack, going down from the original stack pointer:
67 * one rt_sigframe32 struct (siginfo + ucontext + ABI gap) 364 * one rt_sigframe struct (siginfo + ucontext + ABI gap)
68 * a gap of __SIGNAL_FRAMESIZE32+16 bytes 365 * a gap of __SIGNAL_FRAMESIZE+16 bytes
69 * (the +16 is to get the siginfo and ucontext32 in the same 366 * (the +16 is to get the siginfo and ucontext in the same
70 * positions as in older kernels). 367 * positions as in older kernels).
71 * 368 *
72 * Each of these things must be a multiple of 16 bytes in size. 369 * Each of these things must be a multiple of 16 bytes in size.
73 * 370 *
74 */ 371 */
75struct rt_sigframe32 { 372struct rt_sigframe {
76 compat_siginfo_t info; 373#ifdef CONFIG_PPC64
77 struct ucontext32 uc; 374 compat_siginfo_t info;
375#else
376 struct siginfo info;
377#endif
378 struct ucontext uc;
78 /* 379 /*
79 * Programs using the rs6000/xcoff abi can save up to 19 gp 380 * Programs using the rs6000/xcoff abi can save up to 19 gp
80 * regs and 18 fp regs below sp before decrementing it. 381 * regs and 18 fp regs below sp before decrementing it.
@@ -82,76 +383,34 @@ struct rt_sigframe32 {
82 int abigap[56]; 383 int abigap[56];
83}; 384};
84 385
85
86/*
87 * Common utility functions used by signal and context support
88 *
89 */
90
91/*
92 * Restore the user process's signal mask
93 * (implemented in signal.c)
94 */
95extern void restore_sigmask(sigset_t *set);
96
97/*
98 * Functions for flipping sigsets (thanks to brain dead generic
99 * implementation that makes things simple for little endian only
100 */
101static inline void compat_from_sigset(compat_sigset_t *compat, sigset_t *set)
102{
103 switch (_NSIG_WORDS) {
104 case 4: compat->sig[5] = set->sig[3] & 0xffffffffull ;
105 compat->sig[7] = set->sig[3] >> 32;
106 case 3: compat->sig[4] = set->sig[2] & 0xffffffffull ;
107 compat->sig[5] = set->sig[2] >> 32;
108 case 2: compat->sig[2] = set->sig[1] & 0xffffffffull ;
109 compat->sig[3] = set->sig[1] >> 32;
110 case 1: compat->sig[0] = set->sig[0] & 0xffffffffull ;
111 compat->sig[1] = set->sig[0] >> 32;
112 }
113}
114
115static inline void sigset_from_compat(sigset_t *set, compat_sigset_t *compat)
116{
117 switch (_NSIG_WORDS) {
118 case 4: set->sig[3] = compat->sig[6] | (((long)compat->sig[7]) << 32);
119 case 3: set->sig[2] = compat->sig[4] | (((long)compat->sig[5]) << 32);
120 case 2: set->sig[1] = compat->sig[2] | (((long)compat->sig[3]) << 32);
121 case 1: set->sig[0] = compat->sig[0] | (((long)compat->sig[1]) << 32);
122 }
123}
124
125
126/* 386/*
127 * Save the current user registers on the user stack. 387 * Save the current user registers on the user stack.
128 * We only save the altivec registers if the process has used 388 * We only save the altivec/spe registers if the process has used
129 * altivec instructions at some point. 389 * altivec/spe instructions at some point.
130 */ 390 */
131static int save_user_regs(struct pt_regs *regs, struct mcontext32 __user *frame, int sigret) 391static int save_user_regs(struct pt_regs *regs, struct mcontext __user *frame,
392 int sigret)
132{ 393{
133 elf_greg_t64 *gregs = (elf_greg_t64 *)regs; 394#ifdef CONFIG_PPC32
134 int i, err = 0; 395 CHECK_FULL_REGS(regs);
135 396#endif
136 /* Make sure floating point registers are stored in regs */ 397 /* Make sure floating point registers are stored in regs */
137 flush_fp_to_thread(current); 398 flush_fp_to_thread(current);
138 399
139 /* save general and floating-point registers */ 400 /* save general and floating-point registers */
140 for (i = 0; i <= PT_RESULT; i ++) 401 if (save_general_regs(regs, frame) ||
141 err |= __put_user((unsigned int)gregs[i], &frame->mc_gregs[i]); 402 __copy_to_user(&frame->mc_fregs, current->thread.fpr,
142 err |= __copy_to_user(&frame->mc_fregs, current->thread.fpr, 403 ELF_NFPREG * sizeof(double)))
143 ELF_NFPREG * sizeof(double));
144 if (err)
145 return 1; 404 return 1;
146 405
147 current->thread.fpscr = 0; /* turn off all fp exceptions */ 406 current->thread.fpscr.val = 0; /* turn off all fp exceptions */
148 407
149#ifdef CONFIG_ALTIVEC 408#ifdef CONFIG_ALTIVEC
150 /* save altivec registers */ 409 /* save altivec registers */
151 if (current->thread.used_vr) { 410 if (current->thread.used_vr) {
152 flush_altivec_to_thread(current); 411 flush_altivec_to_thread(current);
153 if (__copy_to_user(&frame->mc_vregs, current->thread.vr, 412 if (__copy_to_user(&frame->mc_vregs, current->thread.vr,
154 ELF_NVRREG32 * sizeof(vector128))) 413 ELF_NVRREG * sizeof(vector128)))
155 return 1; 414 return 1;
156 /* set MSR_VEC in the saved MSR value to indicate that 415 /* set MSR_VEC in the saved MSR value to indicate that
157 frame->mc_vregs contains valid data */ 416 frame->mc_vregs contains valid data */
@@ -169,6 +428,25 @@ static int save_user_regs(struct pt_regs *regs, struct mcontext32 __user *frame,
169 return 1; 428 return 1;
170#endif /* CONFIG_ALTIVEC */ 429#endif /* CONFIG_ALTIVEC */
171 430
431#ifdef CONFIG_SPE
432 /* save spe registers */
433 if (current->thread.used_spe) {
434 flush_spe_to_thread(current);
435 if (__copy_to_user(&frame->mc_vregs, current->thread.evr,
436 ELF_NEVRREG * sizeof(u32)))
437 return 1;
438 /* set MSR_SPE in the saved MSR value to indicate that
439 frame->mc_vregs contains valid data */
440 if (__put_user(regs->msr | MSR_SPE, &frame->mc_gregs[PT_MSR]))
441 return 1;
442 }
443 /* else assert((regs->msr & MSR_SPE) == 0) */
444
445 /* We always copy to/from spefscr */
446 if (__put_user(current->thread.spefscr, (u32 __user *)&frame->mc_vregs + ELF_NEVRREG))
447 return 1;
448#endif /* CONFIG_SPE */
449
172 if (sigret) { 450 if (sigret) {
173 /* Set up the sigreturn trampoline: li r0,sigret; sc */ 451 /* Set up the sigreturn trampoline: li r0,sigret; sc */
174 if (__put_user(0x38000000UL + sigret, &frame->tramp[0]) 452 if (__put_user(0x38000000UL + sigret, &frame->tramp[0])
@@ -186,13 +464,11 @@ static int save_user_regs(struct pt_regs *regs, struct mcontext32 __user *frame,
186 * (except for MSR). 464 * (except for MSR).
187 */ 465 */
188static long restore_user_regs(struct pt_regs *regs, 466static long restore_user_regs(struct pt_regs *regs,
189 struct mcontext32 __user *sr, int sig) 467 struct mcontext __user *sr, int sig)
190{ 468{
191 elf_greg_t64 *gregs = (elf_greg_t64 *)regs; 469 long err;
192 int i;
193 long err = 0;
194 unsigned int save_r2 = 0; 470 unsigned int save_r2 = 0;
195#ifdef CONFIG_ALTIVEC 471#if defined(CONFIG_ALTIVEC) || defined(CONFIG_SPE)
196 unsigned long msr; 472 unsigned long msr;
197#endif 473#endif
198 474
@@ -202,11 +478,7 @@ static long restore_user_regs(struct pt_regs *regs,
202 */ 478 */
203 if (!sig) 479 if (!sig)
204 save_r2 = (unsigned int)regs->gpr[2]; 480 save_r2 = (unsigned int)regs->gpr[2];
205 for (i = 0; i <= PT_RESULT; i++) { 481 err = restore_general_regs(regs, sr);
206 if ((i == PT_MSR) || (i == PT_SOFTE))
207 continue;
208 err |= __get_user(gregs[i], &sr->mc_gregs[i]);
209 }
210 if (!sig) 482 if (!sig)
211 regs->gpr[2] = (unsigned long) save_r2; 483 regs->gpr[2] = (unsigned long) save_r2;
212 if (err) 484 if (err)
@@ -229,135 +501,51 @@ static long restore_user_regs(struct pt_regs *regs,
229 sizeof(sr->mc_vregs))) 501 sizeof(sr->mc_vregs)))
230 return 1; 502 return 1;
231 } else if (current->thread.used_vr) 503 } else if (current->thread.used_vr)
232 memset(current->thread.vr, 0, ELF_NVRREG32 * sizeof(vector128)); 504 memset(current->thread.vr, 0, ELF_NVRREG * sizeof(vector128));
233 505
234 /* Always get VRSAVE back */ 506 /* Always get VRSAVE back */
235 if (__get_user(current->thread.vrsave, (u32 __user *)&sr->mc_vregs[32])) 507 if (__get_user(current->thread.vrsave, (u32 __user *)&sr->mc_vregs[32]))
236 return 1; 508 return 1;
237#endif /* CONFIG_ALTIVEC */ 509#endif /* CONFIG_ALTIVEC */
238 510
511#ifdef CONFIG_SPE
512 /* force the process to reload the spe registers from
513 current->thread when it next does spe instructions */
514 regs->msr &= ~MSR_SPE;
515 if (!__get_user(msr, &sr->mc_gregs[PT_MSR]) && (msr & MSR_SPE) != 0) {
516 /* restore spe registers from the stack */
517 if (__copy_from_user(current->thread.evr, &sr->mc_vregs,
518 ELF_NEVRREG * sizeof(u32)))
519 return 1;
520 } else if (current->thread.used_spe)
521 memset(current->thread.evr, 0, ELF_NEVRREG * sizeof(u32));
522
523 /* Always get SPEFSCR back */
524 if (__get_user(current->thread.spefscr, (u32 __user *)&sr->mc_vregs + ELF_NEVRREG))
525 return 1;
526#endif /* CONFIG_SPE */
527
239#ifndef CONFIG_SMP 528#ifndef CONFIG_SMP
240 preempt_disable(); 529 preempt_disable();
241 if (last_task_used_math == current) 530 if (last_task_used_math == current)
242 last_task_used_math = NULL; 531 last_task_used_math = NULL;
243 if (last_task_used_altivec == current) 532 if (last_task_used_altivec == current)
244 last_task_used_altivec = NULL; 533 last_task_used_altivec = NULL;
534#ifdef CONFIG_SPE
535 if (last_task_used_spe == current)
536 last_task_used_spe = NULL;
537#endif
245 preempt_enable(); 538 preempt_enable();
246#endif 539#endif
247 return 0; 540 return 0;
248} 541}
249 542
250 543#ifdef CONFIG_PPC64
251/* 544long compat_sys_rt_sigaction(int sig, const struct sigaction32 __user *act,
252 * Start of nonRT signal support
253 *
254 * sigset_t is 32 bits for non-rt signals
255 *
256 * System Calls
257 * sigaction sys32_sigaction
258 * sigreturn sys32_sigreturn
259 *
260 * Note sigsuspend has no special 32 bit routine - uses the 64 bit routine
261 *
262 * Other routines
263 * setup_frame32
264 */
265
266/*
267 * Atomically swap in the new signal mask, and wait for a signal.
268 */
269long sys32_sigsuspend(old_sigset_t mask, int p2, int p3, int p4, int p6, int p7,
270 struct pt_regs *regs)
271{
272 sigset_t saveset;
273
274 mask &= _BLOCKABLE;
275 spin_lock_irq(&current->sighand->siglock);
276 saveset = current->blocked;
277 siginitset(&current->blocked, mask);
278 recalc_sigpending();
279 spin_unlock_irq(&current->sighand->siglock);
280
281 regs->result = -EINTR;
282 regs->gpr[3] = EINTR;
283 regs->ccr |= 0x10000000;
284 while (1) {
285 current->state = TASK_INTERRUPTIBLE;
286 schedule();
287 if (do_signal32(&saveset, regs))
288 /*
289 * Returning 0 means we return to userspace via
290 * ret_from_except and thus restore all user
291 * registers from *regs. This is what we need
292 * to do when a signal has been delivered.
293 */
294 return 0;
295 }
296}
297
298long sys32_sigaction(int sig, struct old_sigaction32 __user *act,
299 struct old_sigaction32 __user *oact)
300{
301 struct k_sigaction new_ka, old_ka;
302 int ret;
303
304 if (sig < 0)
305 sig = -sig;
306
307 if (act) {
308 compat_old_sigset_t mask;
309 compat_uptr_t handler, restorer;
310
311 if (get_user(handler, &act->sa_handler) ||
312 __get_user(restorer, &act->sa_restorer) ||
313 __get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
314 __get_user(mask, &act->sa_mask))
315 return -EFAULT;
316 new_ka.sa.sa_handler = compat_ptr(handler);
317 new_ka.sa.sa_restorer = compat_ptr(restorer);
318 siginitset(&new_ka.sa.sa_mask, mask);
319 }
320
321 ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
322 if (!ret && oact) {
323 if (put_user((long)old_ka.sa.sa_handler, &oact->sa_handler) ||
324 __put_user((long)old_ka.sa.sa_restorer, &oact->sa_restorer) ||
325 __put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
326 __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
327 return -EFAULT;
328 }
329
330 return ret;
331}
332
333
334
335/*
336 * Start of RT signal support
337 *
338 * sigset_t is 64 bits for rt signals
339 *
340 * System Calls
341 * sigaction sys32_rt_sigaction
342 * sigpending sys32_rt_sigpending
343 * sigprocmask sys32_rt_sigprocmask
344 * sigreturn sys32_rt_sigreturn
345 * sigqueueinfo sys32_rt_sigqueueinfo
346 * sigsuspend sys32_rt_sigsuspend
347 *
348 * Other routines
349 * setup_rt_frame32
350 * copy_siginfo_to_user32
351 * siginfo32to64
352 */
353
354
355long sys32_rt_sigaction(int sig, const struct sigaction32 __user *act,
356 struct sigaction32 __user *oact, size_t sigsetsize) 545 struct sigaction32 __user *oact, size_t sigsetsize)
357{ 546{
358 struct k_sigaction new_ka, old_ka; 547 struct k_sigaction new_ka, old_ka;
359 int ret; 548 int ret;
360 compat_sigset_t set32;
361 549
362 /* XXX: Don't preclude handling different sized sigset_t's. */ 550 /* XXX: Don't preclude handling different sized sigset_t's. */
363 if (sigsetsize != sizeof(compat_sigset_t)) 551 if (sigsetsize != sizeof(compat_sigset_t))
@@ -368,9 +556,7 @@ long sys32_rt_sigaction(int sig, const struct sigaction32 __user *act,
368 556
369 ret = get_user(handler, &act->sa_handler); 557 ret = get_user(handler, &act->sa_handler);
370 new_ka.sa.sa_handler = compat_ptr(handler); 558 new_ka.sa.sa_handler = compat_ptr(handler);
371 ret |= __copy_from_user(&set32, &act->sa_mask, 559 ret |= get_sigset_t(&new_ka.sa.sa_mask, &act->sa_mask);
372 sizeof(compat_sigset_t));
373 sigset_from_compat(&new_ka.sa.sa_mask, &set32);
374 ret |= __get_user(new_ka.sa.sa_flags, &act->sa_flags); 560 ret |= __get_user(new_ka.sa.sa_flags, &act->sa_flags);
375 if (ret) 561 if (ret)
376 return -EFAULT; 562 return -EFAULT;
@@ -378,10 +564,8 @@ long sys32_rt_sigaction(int sig, const struct sigaction32 __user *act,
378 564
379 ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); 565 ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
380 if (!ret && oact) { 566 if (!ret && oact) {
381 compat_from_sigset(&set32, &old_ka.sa.sa_mask);
382 ret = put_user((long)old_ka.sa.sa_handler, &oact->sa_handler); 567 ret = put_user((long)old_ka.sa.sa_handler, &oact->sa_handler);
383 ret |= __copy_to_user(&oact->sa_mask, &set32, 568 ret |= put_sigset_t(&oact->sa_mask, &old_ka.sa.sa_mask);
384 sizeof(compat_sigset_t));
385 ret |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags); 569 ret |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags);
386 } 570 }
387 return ret; 571 return ret;
@@ -394,41 +578,37 @@ long sys32_rt_sigaction(int sig, const struct sigaction32 __user *act,
394 * of a signed int (msr in 32-bit mode) and the register representation 578 * of a signed int (msr in 32-bit mode) and the register representation
395 * of a signed int (msr in 64-bit mode) is performed. 579 * of a signed int (msr in 64-bit mode) is performed.
396 */ 580 */
397long sys32_rt_sigprocmask(u32 how, compat_sigset_t __user *set, 581long compat_sys_rt_sigprocmask(u32 how, compat_sigset_t __user *set,
398 compat_sigset_t __user *oset, size_t sigsetsize) 582 compat_sigset_t __user *oset, size_t sigsetsize)
399{ 583{
400 sigset_t s; 584 sigset_t s;
401 sigset_t __user *up; 585 sigset_t __user *up;
402 compat_sigset_t s32;
403 int ret; 586 int ret;
404 mm_segment_t old_fs = get_fs(); 587 mm_segment_t old_fs = get_fs();
405 588
406 if (set) { 589 if (set) {
407 if (copy_from_user (&s32, set, sizeof(compat_sigset_t))) 590 if (get_sigset_t(&s, set))
408 return -EFAULT; 591 return -EFAULT;
409 sigset_from_compat(&s, &s32);
410 } 592 }
411 593
412 set_fs(KERNEL_DS); 594 set_fs(KERNEL_DS);
413 /* This is valid because of the set_fs() */ 595 /* This is valid because of the set_fs() */
414 up = (sigset_t __user *) &s; 596 up = (sigset_t __user *) &s;
415 ret = sys_rt_sigprocmask((int)how, set ? up : NULL, oset ? up : NULL, 597 ret = sys_rt_sigprocmask((int)how, set ? up : NULL, oset ? up : NULL,
416 sigsetsize); 598 sigsetsize);
417 set_fs(old_fs); 599 set_fs(old_fs);
418 if (ret) 600 if (ret)
419 return ret; 601 return ret;
420 if (oset) { 602 if (oset) {
421 compat_from_sigset(&s32, &s); 603 if (put_sigset_t(oset, &s))
422 if (copy_to_user (oset, &s32, sizeof(compat_sigset_t)))
423 return -EFAULT; 604 return -EFAULT;
424 } 605 }
425 return 0; 606 return 0;
426} 607}
427 608
428long sys32_rt_sigpending(compat_sigset_t __user *set, compat_size_t sigsetsize) 609long compat_sys_rt_sigpending(compat_sigset_t __user *set, compat_size_t sigsetsize)
429{ 610{
430 sigset_t s; 611 sigset_t s;
431 compat_sigset_t s32;
432 int ret; 612 int ret;
433 mm_segment_t old_fs = get_fs(); 613 mm_segment_t old_fs = get_fs();
434 614
@@ -437,8 +617,7 @@ long sys32_rt_sigpending(compat_sigset_t __user *set, compat_size_t sigsetsize)
437 ret = sys_rt_sigpending((sigset_t __user *) &s, sigsetsize); 617 ret = sys_rt_sigpending((sigset_t __user *) &s, sigsetsize);
438 set_fs(old_fs); 618 set_fs(old_fs);
439 if (!ret) { 619 if (!ret) {
440 compat_from_sigset(&s32, &s); 620 if (put_sigset_t(set, &s))
441 if (copy_to_user (set, &s32, sizeof(compat_sigset_t)))
442 return -EFAULT; 621 return -EFAULT;
443 } 622 }
444 return ret; 623 return ret;
@@ -500,6 +679,8 @@ int copy_siginfo_to_user32(struct compat_siginfo __user *d, siginfo_t *s)
500 return err; 679 return err;
501} 680}
502 681
682#define copy_siginfo_to_user copy_siginfo_to_user32
683
503/* 684/*
504 * Note: it is necessary to treat pid and sig as unsigned ints, with the 685 * Note: it is necessary to treat pid and sig as unsigned ints, with the
505 * corresponding cast to a signed int to insure that the proper conversion 686 * corresponding cast to a signed int to insure that the proper conversion
@@ -507,12 +688,12 @@ int copy_siginfo_to_user32(struct compat_siginfo __user *d, siginfo_t *s)
507 * (msr in 32-bit mode) and the register representation of a signed int 688 * (msr in 32-bit mode) and the register representation of a signed int
508 * (msr in 64-bit mode) is performed. 689 * (msr in 64-bit mode) is performed.
509 */ 690 */
510long sys32_rt_sigqueueinfo(u32 pid, u32 sig, compat_siginfo_t __user *uinfo) 691long compat_sys_rt_sigqueueinfo(u32 pid, u32 sig, compat_siginfo_t __user *uinfo)
511{ 692{
512 siginfo_t info; 693 siginfo_t info;
513 int ret; 694 int ret;
514 mm_segment_t old_fs = get_fs(); 695 mm_segment_t old_fs = get_fs();
515 696
516 if (copy_from_user (&info, uinfo, 3*sizeof(int)) || 697 if (copy_from_user (&info, uinfo, 3*sizeof(int)) ||
517 copy_from_user (info._sifields._pad, uinfo->_sifields._pad, SI_PAD_SIZE32)) 698 copy_from_user (info._sifields._pad, uinfo->_sifields._pad, SI_PAD_SIZE32))
518 return -EFAULT; 699 return -EFAULT;
@@ -522,58 +703,14 @@ long sys32_rt_sigqueueinfo(u32 pid, u32 sig, compat_siginfo_t __user *uinfo)
522 set_fs (old_fs); 703 set_fs (old_fs);
523 return ret; 704 return ret;
524} 705}
525
526int sys32_rt_sigsuspend(compat_sigset_t __user * unewset, size_t sigsetsize, int p3,
527 int p4, int p6, int p7, struct pt_regs *regs)
528{
529 sigset_t saveset, newset;
530 compat_sigset_t s32;
531
532 /* XXX: Don't preclude handling different sized sigset_t's. */
533 if (sigsetsize != sizeof(sigset_t))
534 return -EINVAL;
535
536 if (copy_from_user(&s32, unewset, sizeof(s32)))
537 return -EFAULT;
538
539 /*
540 * Swap the 2 words of the 64-bit sigset_t (they are stored
541 * in the "wrong" endian in 32-bit user storage).
542 */
543 sigset_from_compat(&newset, &s32);
544
545 sigdelsetmask(&newset, ~_BLOCKABLE);
546 spin_lock_irq(&current->sighand->siglock);
547 saveset = current->blocked;
548 current->blocked = newset;
549 recalc_sigpending();
550 spin_unlock_irq(&current->sighand->siglock);
551
552 regs->result = -EINTR;
553 regs->gpr[3] = EINTR;
554 regs->ccr |= 0x10000000;
555 while (1) {
556 current->state = TASK_INTERRUPTIBLE;
557 schedule();
558 if (do_signal32(&saveset, regs))
559 /*
560 * Returning 0 means we return to userspace via
561 * ret_from_except and thus restore all user
562 * registers from *regs. This is what we need
563 * to do when a signal has been delivered.
564 */
565 return 0;
566 }
567}
568
569/* 706/*
570 * Start Alternate signal stack support 707 * Start Alternate signal stack support
571 * 708 *
572 * System Calls 709 * System Calls
573 * sigaltatck sys32_sigaltstack 710 * sigaltatck compat_sys_sigaltstack
574 */ 711 */
575 712
576int sys32_sigaltstack(u32 __new, u32 __old, int r5, 713int compat_sys_sigaltstack(u32 __new, u32 __old, int r5,
577 int r6, int r7, int r8, struct pt_regs *regs) 714 int r6, int r7, int r8, struct pt_regs *regs)
578{ 715{
579 stack_32_t __user * newstack = (stack_32_t __user *)(long) __new; 716 stack_32_t __user * newstack = (stack_32_t __user *)(long) __new;
@@ -615,76 +752,94 @@ int sys32_sigaltstack(u32 __new, u32 __old, int r5,
615 return -EFAULT; 752 return -EFAULT;
616 return ret; 753 return ret;
617} 754}
755#endif /* CONFIG_PPC64 */
756
618 757
758/*
759 * Restore the user process's signal mask
760 */
761#ifdef CONFIG_PPC64
762extern void restore_sigmask(sigset_t *set);
763#else /* CONFIG_PPC64 */
764static void restore_sigmask(sigset_t *set)
765{
766 sigdelsetmask(set, ~_BLOCKABLE);
767 spin_lock_irq(&current->sighand->siglock);
768 current->blocked = *set;
769 recalc_sigpending();
770 spin_unlock_irq(&current->sighand->siglock);
771}
772#endif
619 773
620/* 774/*
621 * Set up a signal frame for a "real-time" signal handler 775 * Set up a signal frame for a "real-time" signal handler
622 * (one which gets siginfo). 776 * (one which gets siginfo).
623 */ 777 */
624static int handle_rt_signal32(unsigned long sig, struct k_sigaction *ka, 778static int handle_rt_signal(unsigned long sig, struct k_sigaction *ka,
625 siginfo_t *info, sigset_t *oldset, 779 siginfo_t *info, sigset_t *oldset,
626 struct pt_regs * regs, unsigned long newsp) 780 struct pt_regs *regs, unsigned long newsp)
627{ 781{
628 struct rt_sigframe32 __user *rt_sf; 782 struct rt_sigframe __user *rt_sf;
629 struct mcontext32 __user *frame; 783 struct mcontext __user *frame;
630 unsigned long origsp = newsp; 784 unsigned long origsp = newsp;
631 compat_sigset_t c_oldset;
632 785
633 /* Set up Signal Frame */ 786 /* Set up Signal Frame */
634 /* Put a Real Time Context onto stack */ 787 /* Put a Real Time Context onto stack */
635 newsp -= sizeof(*rt_sf); 788 newsp -= sizeof(*rt_sf);
636 rt_sf = (struct rt_sigframe32 __user *)newsp; 789 rt_sf = (struct rt_sigframe __user *)newsp;
637 790
638 /* create a stack frame for the caller of the handler */ 791 /* create a stack frame for the caller of the handler */
639 newsp -= __SIGNAL_FRAMESIZE32 + 16; 792 newsp -= __SIGNAL_FRAMESIZE + 16;
640 793
641 if (!access_ok(VERIFY_WRITE, (void __user *)newsp, origsp - newsp)) 794 if (!access_ok(VERIFY_WRITE, (void __user *)newsp, origsp - newsp))
642 goto badframe; 795 goto badframe;
643 796
644 compat_from_sigset(&c_oldset, oldset);
645
646 /* Put the siginfo & fill in most of the ucontext */ 797 /* Put the siginfo & fill in most of the ucontext */
647 if (copy_siginfo_to_user32(&rt_sf->info, info) 798 if (copy_siginfo_to_user(&rt_sf->info, info)
648 || __put_user(0, &rt_sf->uc.uc_flags) 799 || __put_user(0, &rt_sf->uc.uc_flags)
649 || __put_user(0, &rt_sf->uc.uc_link) 800 || __put_user(0, &rt_sf->uc.uc_link)
650 || __put_user(current->sas_ss_sp, &rt_sf->uc.uc_stack.ss_sp) 801 || __put_user(current->sas_ss_sp, &rt_sf->uc.uc_stack.ss_sp)
651 || __put_user(sas_ss_flags(regs->gpr[1]), 802 || __put_user(sas_ss_flags(regs->gpr[1]),
652 &rt_sf->uc.uc_stack.ss_flags) 803 &rt_sf->uc.uc_stack.ss_flags)
653 || __put_user(current->sas_ss_size, &rt_sf->uc.uc_stack.ss_size) 804 || __put_user(current->sas_ss_size, &rt_sf->uc.uc_stack.ss_size)
654 || __put_user((u32)(u64)&rt_sf->uc.uc_mcontext, &rt_sf->uc.uc_regs) 805 || __put_user(to_user_ptr(&rt_sf->uc.uc_mcontext),
655 || __copy_to_user(&rt_sf->uc.uc_sigmask, &c_oldset, sizeof(c_oldset))) 806 &rt_sf->uc.uc_regs)
807 || put_sigset_t(&rt_sf->uc.uc_sigmask, oldset))
656 goto badframe; 808 goto badframe;
657 809
658 /* Save user registers on the stack */ 810 /* Save user registers on the stack */
659 frame = &rt_sf->uc.uc_mcontext; 811 frame = &rt_sf->uc.uc_mcontext;
660 if (put_user(regs->gpr[1], (u32 __user *)newsp)) 812#ifdef CONFIG_PPC64
661 goto badframe;
662
663 if (vdso32_rt_sigtramp && current->thread.vdso_base) { 813 if (vdso32_rt_sigtramp && current->thread.vdso_base) {
664 if (save_user_regs(regs, frame, 0)) 814 if (save_user_regs(regs, frame, 0))
665 goto badframe; 815 goto badframe;
666 regs->link = current->thread.vdso_base + vdso32_rt_sigtramp; 816 regs->link = current->thread.vdso_base + vdso32_rt_sigtramp;
667 } else { 817 } else
818#endif
819 {
668 if (save_user_regs(regs, frame, __NR_rt_sigreturn)) 820 if (save_user_regs(regs, frame, __NR_rt_sigreturn))
669 goto badframe; 821 goto badframe;
670 regs->link = (unsigned long) frame->tramp; 822 regs->link = (unsigned long) frame->tramp;
671 } 823 }
672 regs->gpr[1] = (unsigned long) newsp; 824 if (put_user(regs->gpr[1], (u32 __user *)newsp))
825 goto badframe;
826 regs->gpr[1] = newsp;
673 regs->gpr[3] = sig; 827 regs->gpr[3] = sig;
674 regs->gpr[4] = (unsigned long) &rt_sf->info; 828 regs->gpr[4] = (unsigned long) &rt_sf->info;
675 regs->gpr[5] = (unsigned long) &rt_sf->uc; 829 regs->gpr[5] = (unsigned long) &rt_sf->uc;
676 regs->gpr[6] = (unsigned long) rt_sf; 830 regs->gpr[6] = (unsigned long) rt_sf;
677 regs->nip = (unsigned long) ka->sa.sa_handler; 831 regs->nip = (unsigned long) ka->sa.sa_handler;
678 regs->trap = 0; 832 regs->trap = 0;
833#ifdef CONFIG_PPC64
679 regs->result = 0; 834 regs->result = 0;
680 835
681 if (test_thread_flag(TIF_SINGLESTEP)) 836 if (test_thread_flag(TIF_SINGLESTEP))
682 ptrace_notify(SIGTRAP); 837 ptrace_notify(SIGTRAP);
683 838#endif
684 return 1; 839 return 1;
685 840
686badframe: 841badframe:
687#if DEBUG_SIG 842#ifdef DEBUG_SIG
688 printk("badframe in handle_rt_signal, regs=%p frame=%p newsp=%lx\n", 843 printk("badframe in handle_rt_signal, regs=%p frame=%p newsp=%lx\n",
689 regs, frame, newsp); 844 regs, frame, newsp);
690#endif 845#endif
@@ -692,46 +847,50 @@ badframe:
692 return 0; 847 return 0;
693} 848}
694 849
695static long do_setcontext32(struct ucontext32 __user *ucp, struct pt_regs *regs, int sig) 850static int do_setcontext(struct ucontext __user *ucp, struct pt_regs *regs, int sig)
696{ 851{
697 compat_sigset_t c_set;
698 sigset_t set; 852 sigset_t set;
699 u32 mcp; 853 struct mcontext __user *mcp;
854
855 if (get_sigset_t(&set, &ucp->uc_sigmask))
856 return -EFAULT;
857#ifdef CONFIG_PPC64
858 {
859 u32 cmcp;
700 860
701 if (__copy_from_user(&c_set, &ucp->uc_sigmask, sizeof(c_set)) 861 if (__get_user(cmcp, &ucp->uc_regs))
702 || __get_user(mcp, &ucp->uc_regs)) 862 return -EFAULT;
863 mcp = (struct mcontext __user *)(u64)cmcp;
864 }
865#else
866 if (__get_user(mcp, &ucp->uc_regs))
703 return -EFAULT; 867 return -EFAULT;
704 sigset_from_compat(&set, &c_set); 868#endif
705 restore_sigmask(&set); 869 restore_sigmask(&set);
706 if (restore_user_regs(regs, (struct mcontext32 __user *)(u64)mcp, sig)) 870 if (restore_user_regs(regs, mcp, sig))
707 return -EFAULT; 871 return -EFAULT;
708 872
709 return 0; 873 return 0;
710} 874}
711 875
712/* 876long sys_swapcontext(struct ucontext __user *old_ctx,
713 * Handle {get,set,swap}_context operations for 32 bits processes 877 struct ucontext __user *new_ctx,
714 */
715
716long sys32_swapcontext(struct ucontext32 __user *old_ctx,
717 struct ucontext32 __user *new_ctx,
718 int ctx_size, int r6, int r7, int r8, struct pt_regs *regs) 878 int ctx_size, int r6, int r7, int r8, struct pt_regs *regs)
719{ 879{
720 unsigned char tmp; 880 unsigned char tmp;
721 compat_sigset_t c_set;
722 881
723 /* Context size is for future use. Right now, we only make sure 882 /* Context size is for future use. Right now, we only make sure
724 * we are passed something we understand 883 * we are passed something we understand
725 */ 884 */
726 if (ctx_size < sizeof(struct ucontext32)) 885 if (ctx_size < sizeof(struct ucontext))
727 return -EINVAL; 886 return -EINVAL;
728 887
729 if (old_ctx != NULL) { 888 if (old_ctx != NULL) {
730 compat_from_sigset(&c_set, &current->blocked);
731 if (!access_ok(VERIFY_WRITE, old_ctx, sizeof(*old_ctx)) 889 if (!access_ok(VERIFY_WRITE, old_ctx, sizeof(*old_ctx))
732 || save_user_regs(regs, &old_ctx->uc_mcontext, 0) 890 || save_user_regs(regs, &old_ctx->uc_mcontext, 0)
733 || __copy_to_user(&old_ctx->uc_sigmask, &c_set, sizeof(c_set)) 891 || put_sigset_t(&old_ctx->uc_sigmask, &current->blocked)
734 || __put_user((u32)(u64)&old_ctx->uc_mcontext, &old_ctx->uc_regs)) 892 || __put_user(to_user_ptr(&old_ctx->uc_mcontext),
893 &old_ctx->uc_regs))
735 return -EFAULT; 894 return -EFAULT;
736 } 895 }
737 if (new_ctx == NULL) 896 if (new_ctx == NULL)
@@ -752,27 +911,26 @@ long sys32_swapcontext(struct ucontext32 __user *old_ctx,
752 * or if another thread unmaps the region containing the context. 911 * or if another thread unmaps the region containing the context.
753 * We kill the task with a SIGSEGV in this situation. 912 * We kill the task with a SIGSEGV in this situation.
754 */ 913 */
755 if (do_setcontext32(new_ctx, regs, 0)) 914 if (do_setcontext(new_ctx, regs, 0))
756 do_exit(SIGSEGV); 915 do_exit(SIGSEGV);
757 916 sigreturn_exit(regs);
917 /* doesn't actually return back to here */
758 return 0; 918 return 0;
759} 919}
760 920
761long sys32_rt_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8, 921long sys_rt_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
762 struct pt_regs *regs) 922 struct pt_regs *regs)
763{ 923{
764 struct rt_sigframe32 __user *rt_sf; 924 struct rt_sigframe __user *rt_sf;
765 int ret;
766
767 925
768 /* Always make any pending restarted system calls return -EINTR */ 926 /* Always make any pending restarted system calls return -EINTR */
769 current_thread_info()->restart_block.fn = do_no_restart_syscall; 927 current_thread_info()->restart_block.fn = do_no_restart_syscall;
770 928
771 rt_sf = (struct rt_sigframe32 __user *) 929 rt_sf = (struct rt_sigframe __user *)
772 (regs->gpr[1] + __SIGNAL_FRAMESIZE32 + 16); 930 (regs->gpr[1] + __SIGNAL_FRAMESIZE + 16);
773 if (!access_ok(VERIFY_READ, rt_sf, sizeof(*rt_sf))) 931 if (!access_ok(VERIFY_READ, rt_sf, sizeof(*rt_sf)))
774 goto bad; 932 goto bad;
775 if (do_setcontext32(&rt_sf->uc, regs, 1)) 933 if (do_setcontext(&rt_sf->uc, regs, 1))
776 goto bad; 934 goto bad;
777 935
778 /* 936 /*
@@ -781,62 +939,165 @@ long sys32_rt_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
781 * signal return. But other architectures do this and we have 939 * signal return. But other architectures do this and we have
782 * always done it up until now so it is probably better not to 940 * always done it up until now so it is probably better not to
783 * change it. -- paulus 941 * change it. -- paulus
784 * We use the sys32_ version that does the 32/64 bits conversion 942 */
943#ifdef CONFIG_PPC64
944 /*
945 * We use the compat_sys_ version that does the 32/64 bits conversion
785 * and takes userland pointer directly. What about error checking ? 946 * and takes userland pointer directly. What about error checking ?
786 * nobody does any... 947 * nobody does any...
787 */ 948 */
788 sys32_sigaltstack((u32)(u64)&rt_sf->uc.uc_stack, 0, 0, 0, 0, 0, regs); 949 compat_sys_sigaltstack((u32)(u64)&rt_sf->uc.uc_stack, 0, 0, 0, 0, 0, regs);
789 950 return (int)regs->result;
790 ret = regs->result; 951#else
791 952 do_sigaltstack(&rt_sf->uc.uc_stack, NULL, regs->gpr[1]);
792 return ret; 953 sigreturn_exit(regs); /* doesn't return here */
954 return 0;
955#endif
793 956
794 bad: 957 bad:
795 force_sig(SIGSEGV, current); 958 force_sig(SIGSEGV, current);
796 return 0; 959 return 0;
797} 960}
798 961
962#ifdef CONFIG_PPC32
963int sys_debug_setcontext(struct ucontext __user *ctx,
964 int ndbg, struct sig_dbg_op __user *dbg,
965 int r6, int r7, int r8,
966 struct pt_regs *regs)
967{
968 struct sig_dbg_op op;
969 int i;
970 unsigned long new_msr = regs->msr;
971#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
972 unsigned long new_dbcr0 = current->thread.dbcr0;
973#endif
974
975 for (i=0; i<ndbg; i++) {
976 if (__copy_from_user(&op, dbg, sizeof(op)))
977 return -EFAULT;
978 switch (op.dbg_type) {
979 case SIG_DBG_SINGLE_STEPPING:
980#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
981 if (op.dbg_value) {
982 new_msr |= MSR_DE;
983 new_dbcr0 |= (DBCR0_IDM | DBCR0_IC);
984 } else {
985 new_msr &= ~MSR_DE;
986 new_dbcr0 &= ~(DBCR0_IDM | DBCR0_IC);
987 }
988#else
989 if (op.dbg_value)
990 new_msr |= MSR_SE;
991 else
992 new_msr &= ~MSR_SE;
993#endif
994 break;
995 case SIG_DBG_BRANCH_TRACING:
996#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
997 return -EINVAL;
998#else
999 if (op.dbg_value)
1000 new_msr |= MSR_BE;
1001 else
1002 new_msr &= ~MSR_BE;
1003#endif
1004 break;
1005
1006 default:
1007 return -EINVAL;
1008 }
1009 }
1010
1011 /* We wait until here to actually install the values in the
1012 registers so if we fail in the above loop, it will not
1013 affect the contents of these registers. After this point,
1014 failure is a problem, anyway, and it's very unlikely unless
1015 the user is really doing something wrong. */
1016 regs->msr = new_msr;
1017#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
1018 current->thread.dbcr0 = new_dbcr0;
1019#endif
1020
1021 /*
1022 * If we get a fault copying the context into the kernel's
1023 * image of the user's registers, we can't just return -EFAULT
1024 * because the user's registers will be corrupted. For instance
1025 * the NIP value may have been updated but not some of the
1026 * other registers. Given that we have done the access_ok
1027 * and successfully read the first and last bytes of the region
1028 * above, this should only happen in an out-of-memory situation
1029 * or if another thread unmaps the region containing the context.
1030 * We kill the task with a SIGSEGV in this situation.
1031 */
1032 if (do_setcontext(ctx, regs, 1)) {
1033 force_sig(SIGSEGV, current);
1034 goto out;
1035 }
1036
1037 /*
1038 * It's not clear whether or why it is desirable to save the
1039 * sigaltstack setting on signal delivery and restore it on
1040 * signal return. But other architectures do this and we have
1041 * always done it up until now so it is probably better not to
1042 * change it. -- paulus
1043 */
1044 do_sigaltstack(&ctx->uc_stack, NULL, regs->gpr[1]);
1045
1046 sigreturn_exit(regs);
1047 /* doesn't actually return back to here */
1048
1049 out:
1050 return 0;
1051}
1052#endif
799 1053
800/* 1054/*
801 * OK, we're invoking a handler 1055 * OK, we're invoking a handler
802 */ 1056 */
803static int handle_signal32(unsigned long sig, struct k_sigaction *ka, 1057static int handle_signal(unsigned long sig, struct k_sigaction *ka,
804 siginfo_t *info, sigset_t *oldset, 1058 siginfo_t *info, sigset_t *oldset, struct pt_regs *regs,
805 struct pt_regs * regs, unsigned long newsp) 1059 unsigned long newsp)
806{ 1060{
807 struct sigcontext32 __user *sc; 1061 struct sigcontext __user *sc;
808 struct sigregs32 __user *frame; 1062 struct sigregs __user *frame;
809 unsigned long origsp = newsp; 1063 unsigned long origsp = newsp;
810 1064
811 /* Set up Signal Frame */ 1065 /* Set up Signal Frame */
812 newsp -= sizeof(struct sigregs32); 1066 newsp -= sizeof(struct sigregs);
813 frame = (struct sigregs32 __user *) newsp; 1067 frame = (struct sigregs __user *) newsp;
814 1068
815 /* Put a sigcontext on the stack */ 1069 /* Put a sigcontext on the stack */
816 newsp -= sizeof(*sc); 1070 newsp -= sizeof(*sc);
817 sc = (struct sigcontext32 __user *) newsp; 1071 sc = (struct sigcontext __user *) newsp;
818 1072
819 /* create a stack frame for the caller of the handler */ 1073 /* create a stack frame for the caller of the handler */
820 newsp -= __SIGNAL_FRAMESIZE32; 1074 newsp -= __SIGNAL_FRAMESIZE;
821 1075
822 if (!access_ok(VERIFY_WRITE, (void __user *) newsp, origsp - newsp)) 1076 if (!access_ok(VERIFY_WRITE, (void __user *) newsp, origsp - newsp))
823 goto badframe; 1077 goto badframe;
824 1078
825#if _NSIG != 64 1079#if _NSIG != 64
826#error "Please adjust handle_signal32()" 1080#error "Please adjust handle_signal()"
827#endif 1081#endif
828 if (__put_user((u32)(u64)ka->sa.sa_handler, &sc->handler) 1082 if (__put_user(to_user_ptr(ka->sa.sa_handler), &sc->handler)
829 || __put_user(oldset->sig[0], &sc->oldmask) 1083 || __put_user(oldset->sig[0], &sc->oldmask)
1084#ifdef CONFIG_PPC64
830 || __put_user((oldset->sig[0] >> 32), &sc->_unused[3]) 1085 || __put_user((oldset->sig[0] >> 32), &sc->_unused[3])
831 || __put_user((u32)(u64)frame, &sc->regs) 1086#else
1087 || __put_user(oldset->sig[1], &sc->_unused[3])
1088#endif
1089 || __put_user(to_user_ptr(frame), &sc->regs)
832 || __put_user(sig, &sc->signal)) 1090 || __put_user(sig, &sc->signal))
833 goto badframe; 1091 goto badframe;
834 1092
1093#ifdef CONFIG_PPC64
835 if (vdso32_sigtramp && current->thread.vdso_base) { 1094 if (vdso32_sigtramp && current->thread.vdso_base) {
836 if (save_user_regs(regs, &frame->mctx, 0)) 1095 if (save_user_regs(regs, &frame->mctx, 0))
837 goto badframe; 1096 goto badframe;
838 regs->link = current->thread.vdso_base + vdso32_sigtramp; 1097 regs->link = current->thread.vdso_base + vdso32_sigtramp;
839 } else { 1098 } else
1099#endif
1100 {
840 if (save_user_regs(regs, &frame->mctx, __NR_sigreturn)) 1101 if (save_user_regs(regs, &frame->mctx, __NR_sigreturn))
841 goto badframe; 1102 goto badframe;
842 regs->link = (unsigned long) frame->mctx.tramp; 1103 regs->link = (unsigned long) frame->mctx.tramp;
@@ -844,22 +1105,24 @@ static int handle_signal32(unsigned long sig, struct k_sigaction *ka,
844 1105
845 if (put_user(regs->gpr[1], (u32 __user *)newsp)) 1106 if (put_user(regs->gpr[1], (u32 __user *)newsp))
846 goto badframe; 1107 goto badframe;
847 regs->gpr[1] = (unsigned long) newsp; 1108 regs->gpr[1] = newsp;
848 regs->gpr[3] = sig; 1109 regs->gpr[3] = sig;
849 regs->gpr[4] = (unsigned long) sc; 1110 regs->gpr[4] = (unsigned long) sc;
850 regs->nip = (unsigned long) ka->sa.sa_handler; 1111 regs->nip = (unsigned long) ka->sa.sa_handler;
851 regs->trap = 0; 1112 regs->trap = 0;
1113#ifdef CONFIG_PPC64
852 regs->result = 0; 1114 regs->result = 0;
853 1115
854 if (test_thread_flag(TIF_SINGLESTEP)) 1116 if (test_thread_flag(TIF_SINGLESTEP))
855 ptrace_notify(SIGTRAP); 1117 ptrace_notify(SIGTRAP);
1118#endif
856 1119
857 return 1; 1120 return 1;
858 1121
859badframe: 1122badframe:
860#if DEBUG_SIG 1123#ifdef DEBUG_SIG
861 printk("badframe in handle_signal, regs=%p frame=%x newsp=%x\n", 1124 printk("badframe in handle_signal, regs=%p frame=%p newsp=%lx\n",
862 regs, frame, *newspp); 1125 regs, frame, newsp);
863#endif 1126#endif
864 force_sigsegv(sig, current); 1127 force_sigsegv(sig, current);
865 return 0; 1128 return 0;
@@ -868,65 +1131,69 @@ badframe:
868/* 1131/*
869 * Do a signal return; undo the signal stack. 1132 * Do a signal return; undo the signal stack.
870 */ 1133 */
871long sys32_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8, 1134long sys_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
872 struct pt_regs *regs) 1135 struct pt_regs *regs)
873{ 1136{
874 struct sigcontext32 __user *sc; 1137 struct sigcontext __user *sc;
875 struct sigcontext32 sigctx; 1138 struct sigcontext sigctx;
876 struct mcontext32 __user *sr; 1139 struct mcontext __user *sr;
877 sigset_t set; 1140 sigset_t set;
878 int ret;
879 1141
880 /* Always make any pending restarted system calls return -EINTR */ 1142 /* Always make any pending restarted system calls return -EINTR */
881 current_thread_info()->restart_block.fn = do_no_restart_syscall; 1143 current_thread_info()->restart_block.fn = do_no_restart_syscall;
882 1144
883 sc = (struct sigcontext32 __user *)(regs->gpr[1] + __SIGNAL_FRAMESIZE32); 1145 sc = (struct sigcontext __user *)(regs->gpr[1] + __SIGNAL_FRAMESIZE);
884 if (copy_from_user(&sigctx, sc, sizeof(sigctx))) 1146 if (copy_from_user(&sigctx, sc, sizeof(sigctx)))
885 goto badframe; 1147 goto badframe;
886 1148
1149#ifdef CONFIG_PPC64
887 /* 1150 /*
888 * Note that PPC32 puts the upper 32 bits of the sigmask in the 1151 * Note that PPC32 puts the upper 32 bits of the sigmask in the
889 * unused part of the signal stackframe 1152 * unused part of the signal stackframe
890 */ 1153 */
891 set.sig[0] = sigctx.oldmask + ((long)(sigctx._unused[3]) << 32); 1154 set.sig[0] = sigctx.oldmask + ((long)(sigctx._unused[3]) << 32);
1155#else
1156 set.sig[0] = sigctx.oldmask;
1157 set.sig[1] = sigctx._unused[3];
1158#endif
892 restore_sigmask(&set); 1159 restore_sigmask(&set);
893 1160
894 sr = (struct mcontext32 __user *)(u64)sigctx.regs; 1161 sr = (struct mcontext __user *)from_user_ptr(sigctx.regs);
895 if (!access_ok(VERIFY_READ, sr, sizeof(*sr)) 1162 if (!access_ok(VERIFY_READ, sr, sizeof(*sr))
896 || restore_user_regs(regs, sr, 1)) 1163 || restore_user_regs(regs, sr, 1))
897 goto badframe; 1164 goto badframe;
898 1165
899 ret = regs->result; 1166#ifdef CONFIG_PPC64
900 return ret; 1167 return (int)regs->result;
1168#else
1169 sigreturn_exit(regs); /* doesn't return */
1170 return 0;
1171#endif
901 1172
902badframe: 1173badframe:
903 force_sig(SIGSEGV, current); 1174 force_sig(SIGSEGV, current);
904 return 0; 1175 return 0;
905} 1176}
906 1177
907
908
909/*
910 * Start of do_signal32 routine
911 *
912 * This routine gets control when a pending signal needs to be processed
913 * in the 32 bit target thread -
914 *
915 * It handles both rt and non-rt signals
916 */
917
918/* 1178/*
919 * Note that 'init' is a special process: it doesn't get signals it doesn't 1179 * Note that 'init' is a special process: it doesn't get signals it doesn't
920 * want to handle. Thus you cannot kill init even with a SIGKILL even by 1180 * want to handle. Thus you cannot kill init even with a SIGKILL even by
921 * mistake. 1181 * mistake.
922 */ 1182 */
923 1183int do_signal(sigset_t *oldset, struct pt_regs *regs)
924int do_signal32(sigset_t *oldset, struct pt_regs *regs)
925{ 1184{
926 siginfo_t info; 1185 siginfo_t info;
1186 struct k_sigaction ka;
927 unsigned int frame, newsp; 1187 unsigned int frame, newsp;
928 int signr, ret; 1188 int signr, ret;
929 struct k_sigaction ka; 1189
1190#ifdef CONFIG_PPC32
1191 if (try_to_freeze()) {
1192 signr = 0;
1193 if (!signal_pending(current))
1194 goto no_signal;
1195 }
1196#endif
930 1197
931 if (!oldset) 1198 if (!oldset)
932 oldset = &current->blocked; 1199 oldset = &current->blocked;
@@ -934,7 +1201,9 @@ int do_signal32(sigset_t *oldset, struct pt_regs *regs)
934 newsp = frame = 0; 1201 newsp = frame = 0;
935 1202
936 signr = get_signal_to_deliver(&info, &ka, regs, NULL); 1203 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
937 1204#ifdef CONFIG_PPC32
1205no_signal:
1206#endif
938 if (TRAP(regs) == 0x0C00 /* System Call! */ 1207 if (TRAP(regs) == 0x0C00 /* System Call! */
939 && regs->ccr & 0x10000000 /* error signalled */ 1208 && regs->ccr & 0x10000000 /* error signalled */
940 && ((ret = regs->gpr[3]) == ERESTARTSYS 1209 && ((ret = regs->gpr[3]) == ERESTARTSYS
@@ -964,12 +1233,13 @@ int do_signal32(sigset_t *oldset, struct pt_regs *regs)
964 return 0; /* no signals delivered */ 1233 return 0; /* no signals delivered */
965 1234
966 if ((ka.sa.sa_flags & SA_ONSTACK) && current->sas_ss_size 1235 if ((ka.sa.sa_flags & SA_ONSTACK) && current->sas_ss_size
967 && (!on_sig_stack(regs->gpr[1]))) 1236 && !on_sig_stack(regs->gpr[1]))
968 newsp = (current->sas_ss_sp + current->sas_ss_size); 1237 newsp = current->sas_ss_sp + current->sas_ss_size;
969 else 1238 else
970 newsp = regs->gpr[1]; 1239 newsp = regs->gpr[1];
971 newsp &= ~0xfUL; 1240 newsp &= ~0xfUL;
972 1241
1242#ifdef CONFIG_PPC64
973 /* 1243 /*
974 * Reenable the DABR before delivering the signal to 1244 * Reenable the DABR before delivering the signal to
975 * user space. The DABR will have been cleared if it 1245 * user space. The DABR will have been cleared if it
@@ -977,12 +1247,13 @@ int do_signal32(sigset_t *oldset, struct pt_regs *regs)
977 */ 1247 */
978 if (current->thread.dabr) 1248 if (current->thread.dabr)
979 set_dabr(current->thread.dabr); 1249 set_dabr(current->thread.dabr);
1250#endif
980 1251
981 /* Whee! Actually deliver the signal. */ 1252 /* Whee! Actually deliver the signal. */
982 if (ka.sa.sa_flags & SA_SIGINFO) 1253 if (ka.sa.sa_flags & SA_SIGINFO)
983 ret = handle_rt_signal32(signr, &ka, &info, oldset, regs, newsp); 1254 ret = handle_rt_signal(signr, &ka, &info, oldset, regs, newsp);
984 else 1255 else
985 ret = handle_signal32(signr, &ka, &info, oldset, regs, newsp); 1256 ret = handle_signal(signr, &ka, &info, oldset, regs, newsp);
986 1257
987 if (ret) { 1258 if (ret) {
988 spin_lock_irq(&current->sighand->siglock); 1259 spin_lock_irq(&current->sighand->siglock);
diff --git a/arch/ppc64/kernel/sys_ppc32.c b/arch/powerpc/kernel/sys_ppc32.c
index e93c13458910..a8210ed5c686 100644
--- a/arch/ppc64/kernel/sys_ppc32.c
+++ b/arch/powerpc/kernel/sys_ppc32.c
@@ -53,8 +53,7 @@
53#include <asm/time.h> 53#include <asm/time.h>
54#include <asm/mmu_context.h> 54#include <asm/mmu_context.h>
55#include <asm/systemcfg.h> 55#include <asm/systemcfg.h>
56 56#include <asm/ppc-pci.h>
57#include "pci.h"
58 57
59/* readdir & getdents */ 58/* readdir & getdents */
60#define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de))) 59#define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de)))
@@ -114,96 +113,6 @@ out:
114 return error; 113 return error;
115} 114}
116 115
117struct linux_dirent32 {
118 u32 d_ino;
119 u32 d_off;
120 unsigned short d_reclen;
121 char d_name[1];
122};
123
124struct getdents_callback32 {
125 struct linux_dirent32 __user * current_dir;
126 struct linux_dirent32 __user * previous;
127 int count;
128 int error;
129};
130
131static int filldir(void * __buf, const char * name, int namlen, off_t offset,
132 ino_t ino, unsigned int d_type)
133{
134 struct linux_dirent32 __user * dirent;
135 struct getdents_callback32 * buf = (struct getdents_callback32 *) __buf;
136 int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 2);
137
138 buf->error = -EINVAL; /* only used if we fail.. */
139 if (reclen > buf->count)
140 return -EINVAL;
141 dirent = buf->previous;
142 if (dirent) {
143 if (__put_user(offset, &dirent->d_off))
144 goto efault;
145 }
146 dirent = buf->current_dir;
147 if (__put_user(ino, &dirent->d_ino))
148 goto efault;
149 if (__put_user(reclen, &dirent->d_reclen))
150 goto efault;
151 if (copy_to_user(dirent->d_name, name, namlen))
152 goto efault;
153 if (__put_user(0, dirent->d_name + namlen))
154 goto efault;
155 if (__put_user(d_type, (char __user *) dirent + reclen - 1))
156 goto efault;
157 buf->previous = dirent;
158 dirent = (void __user *)dirent + reclen;
159 buf->current_dir = dirent;
160 buf->count -= reclen;
161 return 0;
162efault:
163 buf->error = -EFAULT;
164 return -EFAULT;
165}
166
167asmlinkage long sys32_getdents(unsigned int fd, struct linux_dirent32 __user *dirent,
168 unsigned int count)
169{
170 struct file * file;
171 struct linux_dirent32 __user * lastdirent;
172 struct getdents_callback32 buf;
173 int error;
174
175 error = -EFAULT;
176 if (!access_ok(VERIFY_WRITE, dirent, count))
177 goto out;
178
179 error = -EBADF;
180 file = fget(fd);
181 if (!file)
182 goto out;
183
184 buf.current_dir = dirent;
185 buf.previous = NULL;
186 buf.count = count;
187 buf.error = 0;
188
189 error = vfs_readdir(file, (filldir_t)filldir, &buf);
190 if (error < 0)
191 goto out_putf;
192 error = buf.error;
193 lastdirent = buf.previous;
194 if (lastdirent) {
195 if (put_user(file->f_pos, &lastdirent->d_off))
196 error = -EFAULT;
197 else
198 error = count - buf.count;
199 }
200
201out_putf:
202 fput(file);
203out:
204 return error;
205}
206
207asmlinkage long ppc32_select(u32 n, compat_ulong_t __user *inp, 116asmlinkage long ppc32_select(u32 n, compat_ulong_t __user *inp,
208 compat_ulong_t __user *outp, compat_ulong_t __user *exp, 117 compat_ulong_t __user *outp, compat_ulong_t __user *exp,
209 compat_uptr_t tvp_x) 118 compat_uptr_t tvp_x)
@@ -248,7 +157,7 @@ int cp_compat_stat(struct kstat *stat, struct compat_stat __user *statbuf)
248 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) 157 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
249 * and the register representation of a signed int (msr in 64-bit mode) is performed. 158 * and the register representation of a signed int (msr in 64-bit mode) is performed.
250 */ 159 */
251asmlinkage long sys32_sysfs(u32 option, u32 arg1, u32 arg2) 160asmlinkage long compat_sys_sysfs(u32 option, u32 arg1, u32 arg2)
252{ 161{
253 return sys_sysfs((int)option, arg1, arg2); 162 return sys_sysfs((int)option, arg1, arg2);
254} 163}
@@ -270,7 +179,7 @@ struct timex32 {
270extern int do_adjtimex(struct timex *); 179extern int do_adjtimex(struct timex *);
271extern void ppc_adjtimex(void); 180extern void ppc_adjtimex(void);
272 181
273asmlinkage long sys32_adjtimex(struct timex32 __user *utp) 182asmlinkage long compat_sys_adjtimex(struct timex32 __user *utp)
274{ 183{
275 struct timex txc; 184 struct timex txc;
276 int ret; 185 int ret;
@@ -329,7 +238,7 @@ asmlinkage long sys32_adjtimex(struct timex32 __user *utp)
329 return ret; 238 return ret;
330} 239}
331 240
332asmlinkage long sys32_pause(void) 241asmlinkage long compat_sys_pause(void)
333{ 242{
334 current->state = TASK_INTERRUPTIBLE; 243 current->state = TASK_INTERRUPTIBLE;
335 schedule(); 244 schedule();
@@ -375,7 +284,7 @@ struct sysinfo32 {
375 char _f[20-2*sizeof(int)-sizeof(int)]; 284 char _f[20-2*sizeof(int)-sizeof(int)];
376}; 285};
377 286
378asmlinkage long sys32_sysinfo(struct sysinfo32 __user *info) 287asmlinkage long compat_sys_sysinfo(struct sysinfo32 __user *info)
379{ 288{
380 struct sysinfo s; 289 struct sysinfo s;
381 int ret, err; 290 int ret, err;
@@ -432,7 +341,7 @@ asmlinkage long sys32_sysinfo(struct sysinfo32 __user *info)
432 sorts of things, like timeval and itimerval. */ 341 sorts of things, like timeval and itimerval. */
433extern struct timezone sys_tz; 342extern struct timezone sys_tz;
434 343
435asmlinkage long sys32_gettimeofday(struct compat_timeval __user *tv, struct timezone __user *tz) 344asmlinkage long compat_sys_gettimeofday(struct compat_timeval __user *tv, struct timezone __user *tz)
436{ 345{
437 if (tv) { 346 if (tv) {
438 struct timeval ktv; 347 struct timeval ktv;
@@ -450,7 +359,7 @@ asmlinkage long sys32_gettimeofday(struct compat_timeval __user *tv, struct time
450 359
451 360
452 361
453asmlinkage long sys32_settimeofday(struct compat_timeval __user *tv, struct timezone __user *tz) 362asmlinkage long compat_sys_settimeofday(struct compat_timeval __user *tv, struct timezone __user *tz)
454{ 363{
455 struct timespec kts; 364 struct timespec kts;
456 struct timezone ktz; 365 struct timezone ktz;
@@ -468,7 +377,7 @@ asmlinkage long sys32_settimeofday(struct compat_timeval __user *tv, struct time
468} 377}
469 378
470#ifdef CONFIG_SYSVIPC 379#ifdef CONFIG_SYSVIPC
471long sys32_ipc(u32 call, u32 first, u32 second, u32 third, compat_uptr_t ptr, 380long compat_sys_ipc(u32 call, u32 first, u32 second, u32 third, compat_uptr_t ptr,
472 u32 fifth) 381 u32 fifth)
473{ 382{
474 int version; 383 int version;
@@ -539,7 +448,7 @@ long sys32_ipc(u32 call, u32 first, u32 second, u32 third, compat_uptr_t ptr,
539 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) 448 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
540 * and the register representation of a signed int (msr in 64-bit mode) is performed. 449 * and the register representation of a signed int (msr in 64-bit mode) is performed.
541 */ 450 */
542asmlinkage long sys32_sendfile(u32 out_fd, u32 in_fd, compat_off_t __user * offset, u32 count) 451asmlinkage long compat_sys_sendfile(u32 out_fd, u32 in_fd, compat_off_t __user * offset, u32 count)
543{ 452{
544 mm_segment_t old_fs = get_fs(); 453 mm_segment_t old_fs = get_fs();
545 int ret; 454 int ret;
@@ -561,7 +470,7 @@ asmlinkage long sys32_sendfile(u32 out_fd, u32 in_fd, compat_off_t __user * offs
561 return ret; 470 return ret;
562} 471}
563 472
564asmlinkage int sys32_sendfile64(int out_fd, int in_fd, compat_loff_t __user *offset, s32 count) 473asmlinkage int compat_sys_sendfile64(int out_fd, int in_fd, compat_loff_t __user *offset, s32 count)
565{ 474{
566 mm_segment_t old_fs = get_fs(); 475 mm_segment_t old_fs = get_fs();
567 int ret; 476 int ret;
@@ -583,7 +492,7 @@ asmlinkage int sys32_sendfile64(int out_fd, int in_fd, compat_loff_t __user *off
583 return ret; 492 return ret;
584} 493}
585 494
586long sys32_execve(unsigned long a0, unsigned long a1, unsigned long a2, 495long compat_sys_execve(unsigned long a0, unsigned long a1, unsigned long a2,
587 unsigned long a3, unsigned long a4, unsigned long a5, 496 unsigned long a3, unsigned long a4, unsigned long a5,
588 struct pt_regs *regs) 497 struct pt_regs *regs)
589{ 498{
@@ -610,58 +519,12 @@ out:
610 return error; 519 return error;
611} 520}
612 521
613/* Set up a thread for executing a new program. */
614void start_thread32(struct pt_regs* regs, unsigned long nip, unsigned long sp)
615{
616 set_fs(USER_DS);
617
618 /*
619 * If we exec out of a kernel thread then thread.regs will not be
620 * set. Do it now.
621 */
622 if (!current->thread.regs) {
623 unsigned long childregs = (unsigned long)current->thread_info +
624 THREAD_SIZE;
625 childregs -= sizeof(struct pt_regs);
626 current->thread.regs = (struct pt_regs *)childregs;
627 }
628
629 /*
630 * ELF_PLAT_INIT already clears all registers but it also sets r2.
631 * So just clear r2 here.
632 */
633 regs->gpr[2] = 0;
634
635 regs->nip = nip;
636 regs->gpr[1] = sp;
637 regs->msr = MSR_USER32;
638#ifndef CONFIG_SMP
639 if (last_task_used_math == current)
640 last_task_used_math = 0;
641#endif /* CONFIG_SMP */
642 current->thread.fpscr = 0;
643 memset(current->thread.fpr, 0, sizeof(current->thread.fpr));
644#ifdef CONFIG_ALTIVEC
645#ifndef CONFIG_SMP
646 if (last_task_used_altivec == current)
647 last_task_used_altivec = 0;
648#endif /* CONFIG_SMP */
649 memset(current->thread.vr, 0, sizeof(current->thread.vr));
650 current->thread.vscr.u[0] = 0;
651 current->thread.vscr.u[1] = 0;
652 current->thread.vscr.u[2] = 0;
653 current->thread.vscr.u[3] = 0x00010000; /* Java mode disabled */
654 current->thread.vrsave = 0;
655 current->thread.used_vr = 0;
656#endif /* CONFIG_ALTIVEC */
657}
658
659/* Note: it is necessary to treat option as an unsigned int, 522/* Note: it is necessary to treat option as an unsigned int,
660 * with the corresponding cast to a signed int to insure that the 523 * with the corresponding cast to a signed int to insure that the
661 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) 524 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
662 * and the register representation of a signed int (msr in 64-bit mode) is performed. 525 * and the register representation of a signed int (msr in 64-bit mode) is performed.
663 */ 526 */
664asmlinkage long sys32_prctl(u32 option, u32 arg2, u32 arg3, u32 arg4, u32 arg5) 527asmlinkage long compat_sys_prctl(u32 option, u32 arg2, u32 arg3, u32 arg4, u32 arg5)
665{ 528{
666 return sys_prctl((int)option, 529 return sys_prctl((int)option,
667 (unsigned long) arg2, 530 (unsigned long) arg2,
@@ -675,7 +538,7 @@ asmlinkage long sys32_prctl(u32 option, u32 arg2, u32 arg3, u32 arg4, u32 arg5)
675 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) 538 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
676 * and the register representation of a signed int (msr in 64-bit mode) is performed. 539 * and the register representation of a signed int (msr in 64-bit mode) is performed.
677 */ 540 */
678asmlinkage long sys32_sched_rr_get_interval(u32 pid, struct compat_timespec __user *interval) 541asmlinkage long compat_sys_sched_rr_get_interval(u32 pid, struct compat_timespec __user *interval)
679{ 542{
680 struct timespec t; 543 struct timespec t;
681 int ret; 544 int ret;
@@ -690,7 +553,7 @@ asmlinkage long sys32_sched_rr_get_interval(u32 pid, struct compat_timespec __us
690 return ret; 553 return ret;
691} 554}
692 555
693asmlinkage int sys32_pciconfig_read(u32 bus, u32 dfn, u32 off, u32 len, u32 ubuf) 556asmlinkage int compat_sys_pciconfig_read(u32 bus, u32 dfn, u32 off, u32 len, u32 ubuf)
694{ 557{
695 return sys_pciconfig_read((unsigned long) bus, 558 return sys_pciconfig_read((unsigned long) bus,
696 (unsigned long) dfn, 559 (unsigned long) dfn,
@@ -699,7 +562,7 @@ asmlinkage int sys32_pciconfig_read(u32 bus, u32 dfn, u32 off, u32 len, u32 ubuf
699 compat_ptr(ubuf)); 562 compat_ptr(ubuf));
700} 563}
701 564
702asmlinkage int sys32_pciconfig_write(u32 bus, u32 dfn, u32 off, u32 len, u32 ubuf) 565asmlinkage int compat_sys_pciconfig_write(u32 bus, u32 dfn, u32 off, u32 len, u32 ubuf)
703{ 566{
704 return sys_pciconfig_write((unsigned long) bus, 567 return sys_pciconfig_write((unsigned long) bus,
705 (unsigned long) dfn, 568 (unsigned long) dfn,
@@ -708,7 +571,7 @@ asmlinkage int sys32_pciconfig_write(u32 bus, u32 dfn, u32 off, u32 len, u32 ubu
708 compat_ptr(ubuf)); 571 compat_ptr(ubuf));
709} 572}
710 573
711asmlinkage int sys32_pciconfig_iobase(u32 which, u32 in_bus, u32 in_devfn) 574asmlinkage int compat_sys_pciconfig_iobase(u32 which, u32 in_bus, u32 in_devfn)
712{ 575{
713 return sys_pciconfig_iobase(which, in_bus, in_devfn); 576 return sys_pciconfig_iobase(which, in_bus, in_devfn);
714} 577}
@@ -719,7 +582,7 @@ asmlinkage int sys32_pciconfig_iobase(u32 which, u32 in_bus, u32 in_devfn)
719 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) 582 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
720 * and the register representation of a signed int (msr in 64-bit mode) is performed. 583 * and the register representation of a signed int (msr in 64-bit mode) is performed.
721 */ 584 */
722asmlinkage long sys32_access(const char __user * filename, u32 mode) 585asmlinkage long compat_sys_access(const char __user * filename, u32 mode)
723{ 586{
724 return sys_access(filename, (int)mode); 587 return sys_access(filename, (int)mode);
725} 588}
@@ -730,7 +593,7 @@ asmlinkage long sys32_access(const char __user * filename, u32 mode)
730 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) 593 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
731 * and the register representation of a signed int (msr in 64-bit mode) is performed. 594 * and the register representation of a signed int (msr in 64-bit mode) is performed.
732 */ 595 */
733asmlinkage long sys32_creat(const char __user * pathname, u32 mode) 596asmlinkage long compat_sys_creat(const char __user * pathname, u32 mode)
734{ 597{
735 return sys_creat(pathname, (int)mode); 598 return sys_creat(pathname, (int)mode);
736} 599}
@@ -741,7 +604,7 @@ asmlinkage long sys32_creat(const char __user * pathname, u32 mode)
741 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) 604 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
742 * and the register representation of a signed int (msr in 64-bit mode) is performed. 605 * and the register representation of a signed int (msr in 64-bit mode) is performed.
743 */ 606 */
744asmlinkage long sys32_waitpid(u32 pid, unsigned int __user * stat_addr, u32 options) 607asmlinkage long compat_sys_waitpid(u32 pid, unsigned int __user * stat_addr, u32 options)
745{ 608{
746 return sys_waitpid((int)pid, stat_addr, (int)options); 609 return sys_waitpid((int)pid, stat_addr, (int)options);
747} 610}
@@ -752,7 +615,7 @@ asmlinkage long sys32_waitpid(u32 pid, unsigned int __user * stat_addr, u32 opti
752 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) 615 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
753 * and the register representation of a signed int (msr in 64-bit mode) is performed. 616 * and the register representation of a signed int (msr in 64-bit mode) is performed.
754 */ 617 */
755asmlinkage long sys32_getgroups(u32 gidsetsize, gid_t __user *grouplist) 618asmlinkage long compat_sys_getgroups(u32 gidsetsize, gid_t __user *grouplist)
756{ 619{
757 return sys_getgroups((int)gidsetsize, grouplist); 620 return sys_getgroups((int)gidsetsize, grouplist);
758} 621}
@@ -763,7 +626,7 @@ asmlinkage long sys32_getgroups(u32 gidsetsize, gid_t __user *grouplist)
763 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) 626 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
764 * and the register representation of a signed int (msr in 64-bit mode) is performed. 627 * and the register representation of a signed int (msr in 64-bit mode) is performed.
765 */ 628 */
766asmlinkage long sys32_getpgid(u32 pid) 629asmlinkage long compat_sys_getpgid(u32 pid)
767{ 630{
768 return sys_getpgid((int)pid); 631 return sys_getpgid((int)pid);
769} 632}
@@ -775,7 +638,7 @@ asmlinkage long sys32_getpgid(u32 pid)
775 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) 638 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
776 * and the register representation of a signed int (msr in 64-bit mode) is performed. 639 * and the register representation of a signed int (msr in 64-bit mode) is performed.
777 */ 640 */
778asmlinkage long sys32_getsid(u32 pid) 641asmlinkage long compat_sys_getsid(u32 pid)
779{ 642{
780 return sys_getsid((int)pid); 643 return sys_getsid((int)pid);
781} 644}
@@ -786,7 +649,7 @@ asmlinkage long sys32_getsid(u32 pid)
786 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) 649 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
787 * and the register representation of a signed int (msr in 64-bit mode) is performed. 650 * and the register representation of a signed int (msr in 64-bit mode) is performed.
788 */ 651 */
789asmlinkage long sys32_kill(u32 pid, u32 sig) 652asmlinkage long compat_sys_kill(u32 pid, u32 sig)
790{ 653{
791 return sys_kill((int)pid, (int)sig); 654 return sys_kill((int)pid, (int)sig);
792} 655}
@@ -797,12 +660,12 @@ asmlinkage long sys32_kill(u32 pid, u32 sig)
797 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) 660 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
798 * and the register representation of a signed int (msr in 64-bit mode) is performed. 661 * and the register representation of a signed int (msr in 64-bit mode) is performed.
799 */ 662 */
800asmlinkage long sys32_mkdir(const char __user * pathname, u32 mode) 663asmlinkage long compat_sys_mkdir(const char __user * pathname, u32 mode)
801{ 664{
802 return sys_mkdir(pathname, (int)mode); 665 return sys_mkdir(pathname, (int)mode);
803} 666}
804 667
805long sys32_nice(u32 increment) 668long compat_sys_nice(u32 increment)
806{ 669{
807 /* sign extend increment */ 670 /* sign extend increment */
808 return sys_nice((int)increment); 671 return sys_nice((int)increment);
@@ -819,7 +682,7 @@ off_t ppc32_lseek(unsigned int fd, u32 offset, unsigned int origin)
819 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) 682 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
820 * and the register representation of a signed int (msr in 64-bit mode) is performed. 683 * and the register representation of a signed int (msr in 64-bit mode) is performed.
821 */ 684 */
822asmlinkage long sys32_readlink(const char __user * path, char __user * buf, u32 bufsiz) 685asmlinkage long compat_sys_readlink(const char __user * path, char __user * buf, u32 bufsiz)
823{ 686{
824 return sys_readlink(path, buf, (int)bufsiz); 687 return sys_readlink(path, buf, (int)bufsiz);
825} 688}
@@ -829,7 +692,7 @@ asmlinkage long sys32_readlink(const char __user * path, char __user * buf, u32
829 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) 692 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
830 * and the register representation of a signed int (msr in 64-bit mode) is performed. 693 * and the register representation of a signed int (msr in 64-bit mode) is performed.
831 */ 694 */
832asmlinkage long sys32_sched_get_priority_max(u32 policy) 695asmlinkage long compat_sys_sched_get_priority_max(u32 policy)
833{ 696{
834 return sys_sched_get_priority_max((int)policy); 697 return sys_sched_get_priority_max((int)policy);
835} 698}
@@ -840,7 +703,7 @@ asmlinkage long sys32_sched_get_priority_max(u32 policy)
840 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) 703 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
841 * and the register representation of a signed int (msr in 64-bit mode) is performed. 704 * and the register representation of a signed int (msr in 64-bit mode) is performed.
842 */ 705 */
843asmlinkage long sys32_sched_get_priority_min(u32 policy) 706asmlinkage long compat_sys_sched_get_priority_min(u32 policy)
844{ 707{
845 return sys_sched_get_priority_min((int)policy); 708 return sys_sched_get_priority_min((int)policy);
846} 709}
@@ -851,7 +714,7 @@ asmlinkage long sys32_sched_get_priority_min(u32 policy)
851 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) 714 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
852 * and the register representation of a signed int (msr in 64-bit mode) is performed. 715 * and the register representation of a signed int (msr in 64-bit mode) is performed.
853 */ 716 */
854asmlinkage long sys32_sched_getparam(u32 pid, struct sched_param __user *param) 717asmlinkage long compat_sys_sched_getparam(u32 pid, struct sched_param __user *param)
855{ 718{
856 return sys_sched_getparam((int)pid, param); 719 return sys_sched_getparam((int)pid, param);
857} 720}
@@ -862,7 +725,7 @@ asmlinkage long sys32_sched_getparam(u32 pid, struct sched_param __user *param)
862 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) 725 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
863 * and the register representation of a signed int (msr in 64-bit mode) is performed. 726 * and the register representation of a signed int (msr in 64-bit mode) is performed.
864 */ 727 */
865asmlinkage long sys32_sched_getscheduler(u32 pid) 728asmlinkage long compat_sys_sched_getscheduler(u32 pid)
866{ 729{
867 return sys_sched_getscheduler((int)pid); 730 return sys_sched_getscheduler((int)pid);
868} 731}
@@ -873,7 +736,7 @@ asmlinkage long sys32_sched_getscheduler(u32 pid)
873 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) 736 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
874 * and the register representation of a signed int (msr in 64-bit mode) is performed. 737 * and the register representation of a signed int (msr in 64-bit mode) is performed.
875 */ 738 */
876asmlinkage long sys32_sched_setparam(u32 pid, struct sched_param __user *param) 739asmlinkage long compat_sys_sched_setparam(u32 pid, struct sched_param __user *param)
877{ 740{
878 return sys_sched_setparam((int)pid, param); 741 return sys_sched_setparam((int)pid, param);
879} 742}
@@ -884,7 +747,7 @@ asmlinkage long sys32_sched_setparam(u32 pid, struct sched_param __user *param)
884 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) 747 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
885 * and the register representation of a signed int (msr in 64-bit mode) is performed. 748 * and the register representation of a signed int (msr in 64-bit mode) is performed.
886 */ 749 */
887asmlinkage long sys32_sched_setscheduler(u32 pid, u32 policy, struct sched_param __user *param) 750asmlinkage long compat_sys_sched_setscheduler(u32 pid, u32 policy, struct sched_param __user *param)
888{ 751{
889 return sys_sched_setscheduler((int)pid, (int)policy, param); 752 return sys_sched_setscheduler((int)pid, (int)policy, param);
890} 753}
@@ -895,7 +758,7 @@ asmlinkage long sys32_sched_setscheduler(u32 pid, u32 policy, struct sched_param
895 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) 758 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
896 * and the register representation of a signed int (msr in 64-bit mode) is performed. 759 * and the register representation of a signed int (msr in 64-bit mode) is performed.
897 */ 760 */
898asmlinkage long sys32_setdomainname(char __user *name, u32 len) 761asmlinkage long compat_sys_setdomainname(char __user *name, u32 len)
899{ 762{
900 return sys_setdomainname(name, (int)len); 763 return sys_setdomainname(name, (int)len);
901} 764}
@@ -906,13 +769,13 @@ asmlinkage long sys32_setdomainname(char __user *name, u32 len)
906 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) 769 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
907 * and the register representation of a signed int (msr in 64-bit mode) is performed. 770 * and the register representation of a signed int (msr in 64-bit mode) is performed.
908 */ 771 */
909asmlinkage long sys32_setgroups(u32 gidsetsize, gid_t __user *grouplist) 772asmlinkage long compat_sys_setgroups(u32 gidsetsize, gid_t __user *grouplist)
910{ 773{
911 return sys_setgroups((int)gidsetsize, grouplist); 774 return sys_setgroups((int)gidsetsize, grouplist);
912} 775}
913 776
914 777
915asmlinkage long sys32_sethostname(char __user *name, u32 len) 778asmlinkage long compat_sys_sethostname(char __user *name, u32 len)
916{ 779{
917 /* sign extend len */ 780 /* sign extend len */
918 return sys_sethostname(name, (int)len); 781 return sys_sethostname(name, (int)len);
@@ -924,30 +787,30 @@ asmlinkage long sys32_sethostname(char __user *name, u32 len)
924 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) 787 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
925 * and the register representation of a signed int (msr in 64-bit mode) is performed. 788 * and the register representation of a signed int (msr in 64-bit mode) is performed.
926 */ 789 */
927asmlinkage long sys32_setpgid(u32 pid, u32 pgid) 790asmlinkage long compat_sys_setpgid(u32 pid, u32 pgid)
928{ 791{
929 return sys_setpgid((int)pid, (int)pgid); 792 return sys_setpgid((int)pid, (int)pgid);
930} 793}
931 794
932long sys32_getpriority(u32 which, u32 who) 795long compat_sys_getpriority(u32 which, u32 who)
933{ 796{
934 /* sign extend which and who */ 797 /* sign extend which and who */
935 return sys_getpriority((int)which, (int)who); 798 return sys_getpriority((int)which, (int)who);
936} 799}
937 800
938long sys32_setpriority(u32 which, u32 who, u32 niceval) 801long compat_sys_setpriority(u32 which, u32 who, u32 niceval)
939{ 802{
940 /* sign extend which, who and niceval */ 803 /* sign extend which, who and niceval */
941 return sys_setpriority((int)which, (int)who, (int)niceval); 804 return sys_setpriority((int)which, (int)who, (int)niceval);
942} 805}
943 806
944long sys32_ioprio_get(u32 which, u32 who) 807long compat_sys_ioprio_get(u32 which, u32 who)
945{ 808{
946 /* sign extend which and who */ 809 /* sign extend which and who */
947 return sys_ioprio_get((int)which, (int)who); 810 return sys_ioprio_get((int)which, (int)who);
948} 811}
949 812
950long sys32_ioprio_set(u32 which, u32 who, u32 ioprio) 813long compat_sys_ioprio_set(u32 which, u32 who, u32 ioprio)
951{ 814{
952 /* sign extend which, who and ioprio */ 815 /* sign extend which, who and ioprio */
953 return sys_ioprio_set((int)which, (int)who, (int)ioprio); 816 return sys_ioprio_set((int)which, (int)who, (int)ioprio);
@@ -958,12 +821,12 @@ long sys32_ioprio_set(u32 which, u32 who, u32 ioprio)
958 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) 821 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
959 * and the register representation of a signed int (msr in 64-bit mode) is performed. 822 * and the register representation of a signed int (msr in 64-bit mode) is performed.
960 */ 823 */
961asmlinkage long sys32_ssetmask(u32 newmask) 824asmlinkage long compat_sys_ssetmask(u32 newmask)
962{ 825{
963 return sys_ssetmask((int) newmask); 826 return sys_ssetmask((int) newmask);
964} 827}
965 828
966asmlinkage long sys32_syslog(u32 type, char __user * buf, u32 len) 829asmlinkage long compat_sys_syslog(u32 type, char __user * buf, u32 len)
967{ 830{
968 /* sign extend len */ 831 /* sign extend len */
969 return sys_syslog(type, buf, (int)len); 832 return sys_syslog(type, buf, (int)len);
@@ -975,7 +838,7 @@ asmlinkage long sys32_syslog(u32 type, char __user * buf, u32 len)
975 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) 838 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
976 * and the register representation of a signed int (msr in 64-bit mode) is performed. 839 * and the register representation of a signed int (msr in 64-bit mode) is performed.
977 */ 840 */
978asmlinkage long sys32_umask(u32 mask) 841asmlinkage long compat_sys_umask(u32 mask)
979{ 842{
980 return sys_umask((int)mask); 843 return sys_umask((int)mask);
981} 844}
@@ -991,7 +854,7 @@ struct __sysctl_args32 {
991 u32 __unused[4]; 854 u32 __unused[4];
992}; 855};
993 856
994asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args) 857asmlinkage long compat_sys_sysctl(struct __sysctl_args32 __user *args)
995{ 858{
996 struct __sysctl_args32 tmp; 859 struct __sysctl_args32 tmp;
997 int error; 860 int error;
@@ -1032,55 +895,7 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
1032} 895}
1033#endif 896#endif
1034 897
1035asmlinkage int sys32_uname(struct old_utsname __user * name) 898unsigned long compat_sys_mmap2(unsigned long addr, size_t len,
1036{
1037 int err = 0;
1038
1039 down_read(&uts_sem);
1040 if (copy_to_user(name, &system_utsname, sizeof(*name)))
1041 err = -EFAULT;
1042 up_read(&uts_sem);
1043 if (!err && personality(current->personality) == PER_LINUX32) {
1044 /* change "ppc64" to "ppc" */
1045 if (__put_user(0, name->machine + 3)
1046 || __put_user(0, name->machine + 4))
1047 err = -EFAULT;
1048 }
1049 return err;
1050}
1051
1052asmlinkage int sys32_olduname(struct oldold_utsname __user * name)
1053{
1054 int error;
1055
1056 if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname)))
1057 return -EFAULT;
1058
1059 down_read(&uts_sem);
1060 error = __copy_to_user(&name->sysname,&system_utsname.sysname,__OLD_UTS_LEN);
1061 error |= __put_user(0,name->sysname+__OLD_UTS_LEN);
1062 error |= __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN);
1063 error |= __put_user(0,name->nodename+__OLD_UTS_LEN);
1064 error |= __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN);
1065 error |= __put_user(0,name->release+__OLD_UTS_LEN);
1066 error |= __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN);
1067 error |= __put_user(0,name->version+__OLD_UTS_LEN);
1068 error |= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN);
1069 error |= __put_user(0,name->machine+__OLD_UTS_LEN);
1070 if (personality(current->personality) == PER_LINUX32) {
1071 /* change "ppc64" to "ppc" */
1072 error |= __put_user(0, name->machine + 3);
1073 error |= __put_user(0, name->machine + 4);
1074 }
1075
1076 up_read(&uts_sem);
1077
1078 error = error ? -EFAULT : 0;
1079
1080 return error;
1081}
1082
1083unsigned long sys32_mmap2(unsigned long addr, size_t len,
1084 unsigned long prot, unsigned long flags, 899 unsigned long prot, unsigned long flags,
1085 unsigned long fd, unsigned long pgoff) 900 unsigned long fd, unsigned long pgoff)
1086{ 901{
@@ -1088,29 +903,7 @@ unsigned long sys32_mmap2(unsigned long addr, size_t len,
1088 return sys_mmap(addr, len, prot, flags, fd, pgoff << 12); 903 return sys_mmap(addr, len, prot, flags, fd, pgoff << 12);
1089} 904}
1090 905
1091int get_compat_timeval(struct timeval *tv, struct compat_timeval __user *ctv) 906long compat_sys_tgkill(u32 tgid, u32 pid, int sig)
1092{
1093 return (!access_ok(VERIFY_READ, ctv, sizeof(*ctv)) ||
1094 __get_user(tv->tv_sec, &ctv->tv_sec) ||
1095 __get_user(tv->tv_usec, &ctv->tv_usec)) ? -EFAULT : 0;
1096}
1097
1098asmlinkage long sys32_utimes(char __user *filename, struct compat_timeval __user *tvs)
1099{
1100 struct timeval ktvs[2], *ptr;
1101
1102 ptr = NULL;
1103 if (tvs) {
1104 if (get_compat_timeval(&ktvs[0], &tvs[0]) ||
1105 get_compat_timeval(&ktvs[1], &tvs[1]))
1106 return -EFAULT;
1107 ptr = ktvs;
1108 }
1109
1110 return do_utimes(filename, ptr);
1111}
1112
1113long sys32_tgkill(u32 tgid, u32 pid, int sig)
1114{ 907{
1115 /* sign extend tgid, pid */ 908 /* sign extend tgid, pid */
1116 return sys_tgkill((int)tgid, (int)pid, sig); 909 return sys_tgkill((int)tgid, (int)pid, sig);
@@ -1121,30 +914,30 @@ long sys32_tgkill(u32 tgid, u32 pid, int sig)
1121 * The 32 bit ABI passes long longs in an odd even register pair. 914 * The 32 bit ABI passes long longs in an odd even register pair.
1122 */ 915 */
1123 916
1124compat_ssize_t sys32_pread64(unsigned int fd, char __user *ubuf, compat_size_t count, 917compat_ssize_t compat_sys_pread64(unsigned int fd, char __user *ubuf, compat_size_t count,
1125 u32 reg6, u32 poshi, u32 poslo) 918 u32 reg6, u32 poshi, u32 poslo)
1126{ 919{
1127 return sys_pread64(fd, ubuf, count, ((loff_t)poshi << 32) | poslo); 920 return sys_pread64(fd, ubuf, count, ((loff_t)poshi << 32) | poslo);
1128} 921}
1129 922
1130compat_ssize_t sys32_pwrite64(unsigned int fd, char __user *ubuf, compat_size_t count, 923compat_ssize_t compat_sys_pwrite64(unsigned int fd, char __user *ubuf, compat_size_t count,
1131 u32 reg6, u32 poshi, u32 poslo) 924 u32 reg6, u32 poshi, u32 poslo)
1132{ 925{
1133 return sys_pwrite64(fd, ubuf, count, ((loff_t)poshi << 32) | poslo); 926 return sys_pwrite64(fd, ubuf, count, ((loff_t)poshi << 32) | poslo);
1134} 927}
1135 928
1136compat_ssize_t sys32_readahead(int fd, u32 r4, u32 offhi, u32 offlo, u32 count) 929compat_ssize_t compat_sys_readahead(int fd, u32 r4, u32 offhi, u32 offlo, u32 count)
1137{ 930{
1138 return sys_readahead(fd, ((loff_t)offhi << 32) | offlo, count); 931 return sys_readahead(fd, ((loff_t)offhi << 32) | offlo, count);
1139} 932}
1140 933
1141asmlinkage int sys32_truncate64(const char __user * path, u32 reg4, 934asmlinkage int compat_sys_truncate64(const char __user * path, u32 reg4,
1142 unsigned long high, unsigned long low) 935 unsigned long high, unsigned long low)
1143{ 936{
1144 return sys_truncate(path, (high << 32) | low); 937 return sys_truncate(path, (high << 32) | low);
1145} 938}
1146 939
1147asmlinkage int sys32_ftruncate64(unsigned int fd, u32 reg4, unsigned long high, 940asmlinkage int compat_sys_ftruncate64(unsigned int fd, u32 reg4, unsigned long high,
1148 unsigned long low) 941 unsigned long low)
1149{ 942{
1150 return sys_ftruncate(fd, (high << 32) | low); 943 return sys_ftruncate(fd, (high << 32) | low);
@@ -1164,13 +957,6 @@ long ppc32_fadvise64(int fd, u32 unused, u32 offset_high, u32 offset_low,
1164 advice); 957 advice);
1165} 958}
1166 959
1167long ppc32_fadvise64_64(int fd, int advice, u32 offset_high, u32 offset_low,
1168 u32 len_high, u32 len_low)
1169{
1170 return sys_fadvise64(fd, (u64)offset_high << 32 | offset_low,
1171 (u64)len_high << 32 | len_low, advice);
1172}
1173
1174long ppc32_timer_create(clockid_t clock, 960long ppc32_timer_create(clockid_t clock,
1175 struct compat_sigevent __user *ev32, 961 struct compat_sigevent __user *ev32,
1176 timer_t __user *timer_id) 962 timer_t __user *timer_id)
@@ -1203,7 +989,7 @@ long ppc32_timer_create(clockid_t clock,
1203 return err; 989 return err;
1204} 990}
1205 991
1206asmlinkage long sys32_add_key(const char __user *_type, 992asmlinkage long compat_sys_add_key(const char __user *_type,
1207 const char __user *_description, 993 const char __user *_description,
1208 const void __user *_payload, 994 const void __user *_payload,
1209 u32 plen, 995 u32 plen,
@@ -1212,7 +998,7 @@ asmlinkage long sys32_add_key(const char __user *_type,
1212 return sys_add_key(_type, _description, _payload, plen, ringid); 998 return sys_add_key(_type, _description, _payload, plen, ringid);
1213} 999}
1214 1000
1215asmlinkage long sys32_request_key(const char __user *_type, 1001asmlinkage long compat_sys_request_key(const char __user *_type,
1216 const char __user *_description, 1002 const char __user *_description,
1217 const char __user *_callout_info, 1003 const char __user *_callout_info,
1218 u32 destringid) 1004 u32 destringid)
diff --git a/arch/ppc64/kernel/syscalls.c b/arch/powerpc/kernel/syscalls.c
index 05f16633bd2c..f72ced11212d 100644
--- a/arch/ppc64/kernel/syscalls.c
+++ b/arch/powerpc/kernel/syscalls.c
@@ -1,7 +1,6 @@
1/* 1/*
2 * linux/arch/ppc64/kernel/sys_ppc.c 2 * Implementation of various system calls for Linux/PowerPC
3 * 3 *
4 * PowerPC version
5 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) 4 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
6 * 5 *
7 * Derived from "arch/i386/kernel/sys_i386.c" 6 * Derived from "arch/i386/kernel/sys_i386.c"
@@ -52,9 +51,8 @@ extern unsigned long wall_jiffies;
52 * 51 *
53 * This is really horribly ugly. 52 * This is really horribly ugly.
54 */ 53 */
55asmlinkage int 54int sys_ipc(uint call, int first, unsigned long second, long third,
56sys_ipc (uint call, int first, unsigned long second, long third, 55 void __user *ptr, long fifth)
57 void __user *ptr, long fifth)
58{ 56{
59 int version, ret; 57 int version, ret;
60 58
@@ -88,7 +86,7 @@ sys_ipc (uint call, int first, unsigned long second, long third,
88 } 86 }
89 case MSGSND: 87 case MSGSND:
90 ret = sys_msgsnd(first, (struct msgbuf __user *)ptr, 88 ret = sys_msgsnd(first, (struct msgbuf __user *)ptr,
91 (size_t)second, third); 89 (size_t)second, third);
92 break; 90 break;
93 case MSGRCV: 91 case MSGRCV:
94 switch (version) { 92 switch (version) {
@@ -113,41 +111,29 @@ sys_ipc (uint call, int first, unsigned long second, long third,
113 } 111 }
114 break; 112 break;
115 case MSGGET: 113 case MSGGET:
116 ret = sys_msgget ((key_t)first, (int)second); 114 ret = sys_msgget((key_t)first, (int)second);
117 break; 115 break;
118 case MSGCTL: 116 case MSGCTL:
119 ret = sys_msgctl(first, (int)second, 117 ret = sys_msgctl(first, (int)second,
120 (struct msqid_ds __user *)ptr); 118 (struct msqid_ds __user *)ptr);
121 break; 119 break;
122 case SHMAT: 120 case SHMAT: {
123 switch (version) { 121 ulong raddr;
124 default: { 122 ret = do_shmat(first, (char __user *)ptr, (int)second, &raddr);
125 ulong raddr; 123 if (ret)
126 ret = do_shmat(first, (char __user *) ptr,
127 (int)second, &raddr);
128 if (ret)
129 break;
130 ret = put_user (raddr, (ulong __user *) third);
131 break;
132 }
133 case 1: /* iBCS2 emulator entry point */
134 ret = -EINVAL;
135 if (!segment_eq(get_fs(), get_ds()))
136 break;
137 ret = do_shmat(first, (char __user *)ptr,
138 (int)second, (ulong *)third);
139 break; 124 break;
140 } 125 ret = put_user(raddr, (ulong __user *) third);
141 break; 126 break;
142 case SHMDT: 127 }
143 ret = sys_shmdt ((char __user *)ptr); 128 case SHMDT:
129 ret = sys_shmdt((char __user *)ptr);
144 break; 130 break;
145 case SHMGET: 131 case SHMGET:
146 ret = sys_shmget (first, (size_t)second, third); 132 ret = sys_shmget(first, (size_t)second, third);
147 break; 133 break;
148 case SHMCTL: 134 case SHMCTL:
149 ret = sys_shmctl(first, (int)second, 135 ret = sys_shmctl(first, (int)second,
150 (struct shmid_ds __user *)ptr); 136 (struct shmid_ds __user *)ptr);
151 break; 137 break;
152 } 138 }
153 139
@@ -158,43 +144,89 @@ sys_ipc (uint call, int first, unsigned long second, long third,
158 * sys_pipe() is the normal C calling standard for creating 144 * sys_pipe() is the normal C calling standard for creating
159 * a pipe. It's not the way unix traditionally does this, though. 145 * a pipe. It's not the way unix traditionally does this, though.
160 */ 146 */
161asmlinkage int sys_pipe(int __user *fildes) 147int sys_pipe(int __user *fildes)
162{ 148{
163 int fd[2]; 149 int fd[2];
164 int error; 150 int error;
165 151
166 error = do_pipe(fd); 152 error = do_pipe(fd);
167 if (!error) { 153 if (!error) {
168 if (copy_to_user(fildes, fd, 2*sizeof(int))) 154 if (copy_to_user(fildes, fd, 2*sizeof(int)))
169 error = -EFAULT; 155 error = -EFAULT;
170 } 156 }
171
172 return error; 157 return error;
173} 158}
174 159
175unsigned long sys_mmap(unsigned long addr, size_t len, 160static inline unsigned long do_mmap2(unsigned long addr, size_t len,
176 unsigned long prot, unsigned long flags, 161 unsigned long prot, unsigned long flags,
177 unsigned long fd, off_t offset) 162 unsigned long fd, unsigned long off, int shift)
178{ 163{
179 struct file * file = NULL; 164 struct file * file = NULL;
180 unsigned long ret = -EBADF; 165 unsigned long ret = -EINVAL;
181 166
167 if (shift) {
168 if (off & ((1 << shift) - 1))
169 goto out;
170 off >>= shift;
171 }
172
173 ret = -EBADF;
182 if (!(flags & MAP_ANONYMOUS)) { 174 if (!(flags & MAP_ANONYMOUS)) {
183 if (!(file = fget(fd))) 175 if (!(file = fget(fd)))
184 goto out; 176 goto out;
185 } 177 }
186 178
187 flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); 179 flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
180
188 down_write(&current->mm->mmap_sem); 181 down_write(&current->mm->mmap_sem);
189 ret = do_mmap(file, addr, len, prot, flags, offset); 182 ret = do_mmap_pgoff(file, addr, len, prot, flags, off);
190 up_write(&current->mm->mmap_sem); 183 up_write(&current->mm->mmap_sem);
191 if (file) 184 if (file)
192 fput(file); 185 fput(file);
193
194out: 186out:
195 return ret; 187 return ret;
196} 188}
197 189
190unsigned long sys_mmap2(unsigned long addr, size_t len,
191 unsigned long prot, unsigned long flags,
192 unsigned long fd, unsigned long pgoff)
193{
194 return do_mmap2(addr, len, prot, flags, fd, pgoff, PAGE_SHIFT-12);
195}
196
197unsigned long sys_mmap(unsigned long addr, size_t len,
198 unsigned long prot, unsigned long flags,
199 unsigned long fd, off_t offset)
200{
201 return do_mmap2(addr, len, prot, flags, fd, offset, PAGE_SHIFT);
202}
203
204#ifdef CONFIG_PPC32
205/*
206 * Due to some executables calling the wrong select we sometimes
207 * get wrong args. This determines how the args are being passed
208 * (a single ptr to them all args passed) then calls
209 * sys_select() with the appropriate args. -- Cort
210 */
211int
212ppc_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp, struct timeval __user *tvp)
213{
214 if ( (unsigned long)n >= 4096 )
215 {
216 unsigned long __user *buffer = (unsigned long __user *)n;
217 if (!access_ok(VERIFY_READ, buffer, 5*sizeof(unsigned long))
218 || __get_user(n, buffer)
219 || __get_user(inp, ((fd_set __user * __user *)(buffer+1)))
220 || __get_user(outp, ((fd_set __user * __user *)(buffer+2)))
221 || __get_user(exp, ((fd_set __user * __user *)(buffer+3)))
222 || __get_user(tvp, ((struct timeval __user * __user *)(buffer+4))))
223 return -EFAULT;
224 }
225 return sys_select(n, inp, outp, exp, tvp);
226}
227#endif
228
229#ifdef CONFIG_PPC64
198long ppc64_personality(unsigned long personality) 230long ppc64_personality(unsigned long personality)
199{ 231{
200 long ret; 232 long ret;
@@ -207,8 +239,25 @@ long ppc64_personality(unsigned long personality)
207 ret = PER_LINUX; 239 ret = PER_LINUX;
208 return ret; 240 return ret;
209} 241}
242#endif
243
244#ifdef CONFIG_PPC64
245#define OVERRIDE_MACHINE (personality(current->personality) == PER_LINUX32)
246#else
247#define OVERRIDE_MACHINE 0
248#endif
249
250static inline int override_machine(char *mach)
251{
252 if (OVERRIDE_MACHINE) {
253 /* change ppc64 to ppc */
254 if (__put_user(0, mach+3) || __put_user(0, mach+4))
255 return -EFAULT;
256 }
257 return 0;
258}
210 259
211long ppc64_newuname(struct new_utsname __user * name) 260long ppc_newuname(struct new_utsname __user * name)
212{ 261{
213 int err = 0; 262 int err = 0;
214 263
@@ -216,16 +265,54 @@ long ppc64_newuname(struct new_utsname __user * name)
216 if (copy_to_user(name, &system_utsname, sizeof(*name))) 265 if (copy_to_user(name, &system_utsname, sizeof(*name)))
217 err = -EFAULT; 266 err = -EFAULT;
218 up_read(&uts_sem); 267 up_read(&uts_sem);
219 if (!err && personality(current->personality) == PER_LINUX32) { 268 if (!err)
220 /* change ppc64 to ppc */ 269 err = override_machine(name->machine);
221 if (__put_user(0, name->machine + 3)
222 || __put_user(0, name->machine + 4))
223 err = -EFAULT;
224 }
225 return err; 270 return err;
226} 271}
227 272
228asmlinkage time_t sys64_time(time_t __user * tloc) 273int sys_uname(struct old_utsname __user *name)
274{
275 int err = 0;
276
277 down_read(&uts_sem);
278 if (copy_to_user(name, &system_utsname, sizeof(*name)))
279 err = -EFAULT;
280 up_read(&uts_sem);
281 if (!err)
282 err = override_machine(name->machine);
283 return err;
284}
285
286int sys_olduname(struct oldold_utsname __user *name)
287{
288 int error;
289
290 if (!access_ok(VERIFY_WRITE, name, sizeof(struct oldold_utsname)))
291 return -EFAULT;
292
293 down_read(&uts_sem);
294 error = __copy_to_user(&name->sysname, &system_utsname.sysname,
295 __OLD_UTS_LEN);
296 error |= __put_user(0, name->sysname + __OLD_UTS_LEN);
297 error |= __copy_to_user(&name->nodename, &system_utsname.nodename,
298 __OLD_UTS_LEN);
299 error |= __put_user(0, name->nodename + __OLD_UTS_LEN);
300 error |= __copy_to_user(&name->release, &system_utsname.release,
301 __OLD_UTS_LEN);
302 error |= __put_user(0, name->release + __OLD_UTS_LEN);
303 error |= __copy_to_user(&name->version, &system_utsname.version,
304 __OLD_UTS_LEN);
305 error |= __put_user(0, name->version + __OLD_UTS_LEN);
306 error |= __copy_to_user(&name->machine, &system_utsname.machine,
307 __OLD_UTS_LEN);
308 error |= override_machine(name->machine);
309 up_read(&uts_sem);
310
311 return error? -EFAULT: 0;
312}
313
314#ifdef CONFIG_PPC64
315time_t sys64_time(time_t __user * tloc)
229{ 316{
230 time_t secs; 317 time_t secs;
231 time_t usecs; 318 time_t usecs;
@@ -247,6 +334,14 @@ asmlinkage time_t sys64_time(time_t __user * tloc)
247 334
248 return secs; 335 return secs;
249} 336}
337#endif
338
339long ppc_fadvise64_64(int fd, int advice, u32 offset_high, u32 offset_low,
340 u32 len_high, u32 len_low)
341{
342 return sys_fadvise64(fd, (u64)offset_high << 32 | offset_low,
343 (u64)len_high << 32 | len_low, advice);
344}
250 345
251void do_show_syscall(unsigned long r3, unsigned long r4, unsigned long r5, 346void do_show_syscall(unsigned long r3, unsigned long r4, unsigned long r5,
252 unsigned long r6, unsigned long r7, unsigned long r8, 347 unsigned long r6, unsigned long r7, unsigned long r8,
diff --git a/arch/powerpc/kernel/systbl.S b/arch/powerpc/kernel/systbl.S
new file mode 100644
index 000000000000..65eaea91b499
--- /dev/null
+++ b/arch/powerpc/kernel/systbl.S
@@ -0,0 +1,321 @@
1/*
2 * This file contains the table of syscall-handling functions.
3 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
4 *
5 * Largely rewritten by Cort Dougan (cort@cs.nmt.edu)
6 * and Paul Mackerras.
7 *
8 * Adapted for iSeries by Mike Corrigan (mikejc@us.ibm.com)
9 * PPC64 updates by Dave Engebretsen (engebret@us.ibm.com)
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
17#include <linux/config.h>
18#include <asm/ppc_asm.h>
19
20#ifdef CONFIG_PPC64
21#define SYSCALL(func) .llong .sys_##func,.sys_##func
22#define COMPAT_SYS(func) .llong .sys_##func,.compat_sys_##func
23#define PPC_SYS(func) .llong .ppc_##func,.ppc_##func
24#define OLDSYS(func) .llong .sys_ni_syscall,.sys_ni_syscall
25#define SYS32ONLY(func) .llong .sys_ni_syscall,.compat_sys_##func
26#define SYSX(f, f3264, f32) .llong .f,.f3264
27#else
28#define SYSCALL(func) .long sys_##func
29#define COMPAT_SYS(func) .long sys_##func
30#define PPC_SYS(func) .long ppc_##func
31#define OLDSYS(func) .long sys_##func
32#define SYS32ONLY(func) .long sys_##func
33#define SYSX(f, f3264, f32) .long f32
34#endif
35
36#ifdef CONFIG_PPC64
37#define sys_sigpending sys_ni_syscall
38#define sys_old_getrlimit sys_ni_syscall
39#else
40#define ppc_rtas sys_ni_syscall
41#endif
42
43_GLOBAL(sys_call_table)
44SYSCALL(restart_syscall)
45SYSCALL(exit)
46PPC_SYS(fork)
47SYSCALL(read)
48SYSCALL(write)
49COMPAT_SYS(open)
50SYSCALL(close)
51COMPAT_SYS(waitpid)
52COMPAT_SYS(creat)
53SYSCALL(link)
54SYSCALL(unlink)
55COMPAT_SYS(execve)
56SYSCALL(chdir)
57SYSX(sys64_time,compat_sys_time,sys_time)
58SYSCALL(mknod)
59SYSCALL(chmod)
60SYSCALL(lchown)
61SYSCALL(ni_syscall)
62OLDSYS(stat)
63SYSX(sys_lseek,ppc32_lseek,sys_lseek)
64SYSCALL(getpid)
65COMPAT_SYS(mount)
66SYSX(sys_ni_syscall,sys_oldumount,sys_oldumount)
67SYSCALL(setuid)
68SYSCALL(getuid)
69COMPAT_SYS(stime)
70COMPAT_SYS(ptrace)
71SYSCALL(alarm)
72OLDSYS(fstat)
73COMPAT_SYS(pause)
74COMPAT_SYS(utime)
75SYSCALL(ni_syscall)
76SYSCALL(ni_syscall)
77COMPAT_SYS(access)
78COMPAT_SYS(nice)
79SYSCALL(ni_syscall)
80SYSCALL(sync)
81COMPAT_SYS(kill)
82SYSCALL(rename)
83COMPAT_SYS(mkdir)
84SYSCALL(rmdir)
85SYSCALL(dup)
86SYSCALL(pipe)
87COMPAT_SYS(times)
88SYSCALL(ni_syscall)
89SYSCALL(brk)
90SYSCALL(setgid)
91SYSCALL(getgid)
92SYSCALL(signal)
93SYSCALL(geteuid)
94SYSCALL(getegid)
95SYSCALL(acct)
96SYSCALL(umount)
97SYSCALL(ni_syscall)
98COMPAT_SYS(ioctl)
99COMPAT_SYS(fcntl)
100SYSCALL(ni_syscall)
101COMPAT_SYS(setpgid)
102SYSCALL(ni_syscall)
103SYSX(sys_ni_syscall,sys_olduname, sys_olduname)
104COMPAT_SYS(umask)
105SYSCALL(chroot)
106SYSCALL(ustat)
107SYSCALL(dup2)
108SYSCALL(getppid)
109SYSCALL(getpgrp)
110SYSCALL(setsid)
111SYS32ONLY(sigaction)
112SYSCALL(sgetmask)
113COMPAT_SYS(ssetmask)
114SYSCALL(setreuid)
115SYSCALL(setregid)
116SYSX(sys_ni_syscall,ppc32_sigsuspend,ppc_sigsuspend)
117COMPAT_SYS(sigpending)
118COMPAT_SYS(sethostname)
119COMPAT_SYS(setrlimit)
120COMPAT_SYS(old_getrlimit)
121COMPAT_SYS(getrusage)
122COMPAT_SYS(gettimeofday)
123COMPAT_SYS(settimeofday)
124COMPAT_SYS(getgroups)
125COMPAT_SYS(setgroups)
126SYSX(sys_ni_syscall,sys_ni_syscall,ppc_select)
127SYSCALL(symlink)
128OLDSYS(lstat)
129COMPAT_SYS(readlink)
130SYSCALL(uselib)
131SYSCALL(swapon)
132SYSCALL(reboot)
133SYSX(sys_ni_syscall,old32_readdir,old_readdir)
134SYSCALL(mmap)
135SYSCALL(munmap)
136SYSCALL(truncate)
137SYSCALL(ftruncate)
138SYSCALL(fchmod)
139SYSCALL(fchown)
140COMPAT_SYS(getpriority)
141COMPAT_SYS(setpriority)
142SYSCALL(ni_syscall)
143COMPAT_SYS(statfs)
144COMPAT_SYS(fstatfs)
145SYSCALL(ni_syscall)
146COMPAT_SYS(socketcall)
147COMPAT_SYS(syslog)
148COMPAT_SYS(setitimer)
149COMPAT_SYS(getitimer)
150COMPAT_SYS(newstat)
151COMPAT_SYS(newlstat)
152COMPAT_SYS(newfstat)
153SYSX(sys_ni_syscall,sys_uname,sys_uname)
154SYSCALL(ni_syscall)
155SYSCALL(vhangup)
156SYSCALL(ni_syscall)
157SYSCALL(ni_syscall)
158COMPAT_SYS(wait4)
159SYSCALL(swapoff)
160COMPAT_SYS(sysinfo)
161COMPAT_SYS(ipc)
162SYSCALL(fsync)
163SYSX(sys_ni_syscall,ppc32_sigreturn,sys_sigreturn)
164PPC_SYS(clone)
165COMPAT_SYS(setdomainname)
166PPC_SYS(newuname)
167SYSCALL(ni_syscall)
168COMPAT_SYS(adjtimex)
169SYSCALL(mprotect)
170SYSX(sys_ni_syscall,compat_sys_sigprocmask,sys_sigprocmask)
171SYSCALL(ni_syscall)
172SYSCALL(init_module)
173SYSCALL(delete_module)
174SYSCALL(ni_syscall)
175SYSCALL(quotactl)
176COMPAT_SYS(getpgid)
177SYSCALL(fchdir)
178SYSCALL(bdflush)
179COMPAT_SYS(sysfs)
180SYSX(ppc64_personality,ppc64_personality,sys_personality)
181SYSCALL(ni_syscall)
182SYSCALL(setfsuid)
183SYSCALL(setfsgid)
184SYSCALL(llseek)
185COMPAT_SYS(getdents)
186SYSX(sys_select,ppc32_select,ppc_select)
187SYSCALL(flock)
188SYSCALL(msync)
189COMPAT_SYS(readv)
190COMPAT_SYS(writev)
191COMPAT_SYS(getsid)
192SYSCALL(fdatasync)
193COMPAT_SYS(sysctl)
194SYSCALL(mlock)
195SYSCALL(munlock)
196SYSCALL(mlockall)
197SYSCALL(munlockall)
198COMPAT_SYS(sched_setparam)
199COMPAT_SYS(sched_getparam)
200COMPAT_SYS(sched_setscheduler)
201COMPAT_SYS(sched_getscheduler)
202SYSCALL(sched_yield)
203COMPAT_SYS(sched_get_priority_max)
204COMPAT_SYS(sched_get_priority_min)
205COMPAT_SYS(sched_rr_get_interval)
206COMPAT_SYS(nanosleep)
207SYSCALL(mremap)
208SYSCALL(setresuid)
209SYSCALL(getresuid)
210SYSCALL(ni_syscall)
211SYSCALL(poll)
212COMPAT_SYS(nfsservctl)
213SYSCALL(setresgid)
214SYSCALL(getresgid)
215COMPAT_SYS(prctl)
216SYSX(ppc64_rt_sigreturn,ppc32_rt_sigreturn,sys_rt_sigreturn)
217COMPAT_SYS(rt_sigaction)
218COMPAT_SYS(rt_sigprocmask)
219COMPAT_SYS(rt_sigpending)
220COMPAT_SYS(rt_sigtimedwait)
221COMPAT_SYS(rt_sigqueueinfo)
222SYSX(ppc64_rt_sigsuspend,ppc32_rt_sigsuspend,ppc_rt_sigsuspend)
223COMPAT_SYS(pread64)
224COMPAT_SYS(pwrite64)
225SYSCALL(chown)
226SYSCALL(getcwd)
227SYSCALL(capget)
228SYSCALL(capset)
229COMPAT_SYS(sigaltstack)
230SYSX(sys_sendfile64,compat_sys_sendfile,sys_sendfile)
231SYSCALL(ni_syscall)
232SYSCALL(ni_syscall)
233PPC_SYS(vfork)
234COMPAT_SYS(getrlimit)
235COMPAT_SYS(readahead)
236SYS32ONLY(mmap2)
237SYS32ONLY(truncate64)
238SYS32ONLY(ftruncate64)
239SYSX(sys_ni_syscall,sys_stat64,sys_stat64)
240SYSX(sys_ni_syscall,sys_lstat64,sys_lstat64)
241SYSX(sys_ni_syscall,sys_fstat64,sys_fstat64)
242COMPAT_SYS(pciconfig_read)
243COMPAT_SYS(pciconfig_write)
244COMPAT_SYS(pciconfig_iobase)
245SYSCALL(ni_syscall)
246SYSCALL(getdents64)
247SYSCALL(pivot_root)
248SYSX(sys_ni_syscall,compat_sys_fcntl64,sys_fcntl64)
249SYSCALL(madvise)
250SYSCALL(mincore)
251SYSCALL(gettid)
252SYSCALL(tkill)
253SYSCALL(setxattr)
254SYSCALL(lsetxattr)
255SYSCALL(fsetxattr)
256SYSCALL(getxattr)
257SYSCALL(lgetxattr)
258SYSCALL(fgetxattr)
259SYSCALL(listxattr)
260SYSCALL(llistxattr)
261SYSCALL(flistxattr)
262SYSCALL(removexattr)
263SYSCALL(lremovexattr)
264SYSCALL(fremovexattr)
265COMPAT_SYS(futex)
266COMPAT_SYS(sched_setaffinity)
267COMPAT_SYS(sched_getaffinity)
268SYSCALL(ni_syscall)
269SYSCALL(ni_syscall)
270SYS32ONLY(sendfile64)
271COMPAT_SYS(io_setup)
272SYSCALL(io_destroy)
273COMPAT_SYS(io_getevents)
274COMPAT_SYS(io_submit)
275SYSCALL(io_cancel)
276SYSCALL(set_tid_address)
277SYSX(sys_fadvise64,ppc32_fadvise64,sys_fadvise64)
278SYSCALL(exit_group)
279SYSX(sys_lookup_dcookie,ppc32_lookup_dcookie,sys_lookup_dcookie)
280SYSCALL(epoll_create)
281SYSCALL(epoll_ctl)
282SYSCALL(epoll_wait)
283SYSCALL(remap_file_pages)
284SYSX(sys_timer_create,ppc32_timer_create,sys_timer_create)
285COMPAT_SYS(timer_settime)
286COMPAT_SYS(timer_gettime)
287SYSCALL(timer_getoverrun)
288SYSCALL(timer_delete)
289COMPAT_SYS(clock_settime)
290COMPAT_SYS(clock_gettime)
291COMPAT_SYS(clock_getres)
292COMPAT_SYS(clock_nanosleep)
293SYSX(ppc64_swapcontext,ppc32_swapcontext,ppc_swapcontext)
294COMPAT_SYS(tgkill)
295COMPAT_SYS(utimes)
296COMPAT_SYS(statfs64)
297COMPAT_SYS(fstatfs64)
298SYSX(sys_ni_syscall, ppc_fadvise64_64, ppc_fadvise64_64)
299PPC_SYS(rtas)
300OLDSYS(debug_setcontext)
301SYSCALL(ni_syscall)
302SYSCALL(ni_syscall)
303COMPAT_SYS(mbind)
304COMPAT_SYS(get_mempolicy)
305COMPAT_SYS(set_mempolicy)
306COMPAT_SYS(mq_open)
307SYSCALL(mq_unlink)
308COMPAT_SYS(mq_timedsend)
309COMPAT_SYS(mq_timedreceive)
310COMPAT_SYS(mq_notify)
311COMPAT_SYS(mq_getsetattr)
312COMPAT_SYS(kexec_load)
313COMPAT_SYS(add_key)
314COMPAT_SYS(request_key)
315COMPAT_SYS(keyctl)
316COMPAT_SYS(waitid)
317COMPAT_SYS(ioprio_set)
318COMPAT_SYS(ioprio_get)
319SYSCALL(inotify_init)
320SYSCALL(inotify_add_watch)
321SYSCALL(inotify_rm_watch)
diff --git a/arch/ppc64/kernel/time.c b/arch/powerpc/kernel/time.c
index b56c6a324e17..23436b6c1881 100644
--- a/arch/ppc64/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -1,5 +1,4 @@
1/* 1/*
2 *
3 * Common time routines among all ppc machines. 2 * Common time routines among all ppc machines.
4 * 3 *
5 * Written by Cort Dougan (cort@cs.nmt.edu) to merge 4 * Written by Cort Dougan (cort@cs.nmt.edu) to merge
@@ -44,33 +43,32 @@
44#include <linux/interrupt.h> 43#include <linux/interrupt.h>
45#include <linux/timex.h> 44#include <linux/timex.h>
46#include <linux/kernel_stat.h> 45#include <linux/kernel_stat.h>
47#include <linux/mc146818rtc.h>
48#include <linux/time.h> 46#include <linux/time.h>
49#include <linux/init.h> 47#include <linux/init.h>
50#include <linux/profile.h> 48#include <linux/profile.h>
51#include <linux/cpu.h> 49#include <linux/cpu.h>
52#include <linux/security.h> 50#include <linux/security.h>
51#include <linux/percpu.h>
52#include <linux/rtc.h>
53 53
54#include <asm/io.h> 54#include <asm/io.h>
55#include <asm/processor.h> 55#include <asm/processor.h>
56#include <asm/nvram.h> 56#include <asm/nvram.h>
57#include <asm/cache.h> 57#include <asm/cache.h>
58#include <asm/machdep.h> 58#include <asm/machdep.h>
59#ifdef CONFIG_PPC_ISERIES
60#include <asm/iSeries/ItLpQueue.h>
61#include <asm/iSeries/HvCallXm.h>
62#endif
63#include <asm/uaccess.h> 59#include <asm/uaccess.h>
64#include <asm/time.h> 60#include <asm/time.h>
65#include <asm/ppcdebug.h>
66#include <asm/prom.h> 61#include <asm/prom.h>
67#include <asm/sections.h> 62#include <asm/irq.h>
63#include <asm/div64.h>
64#ifdef CONFIG_PPC64
68#include <asm/systemcfg.h> 65#include <asm/systemcfg.h>
69#include <asm/firmware.h> 66#include <asm/firmware.h>
70 67#endif
71u64 jiffies_64 __cacheline_aligned_in_smp = INITIAL_JIFFIES; 68#ifdef CONFIG_PPC_ISERIES
72 69#include <asm/iSeries/ItLpQueue.h>
73EXPORT_SYMBOL(jiffies_64); 70#include <asm/iSeries/HvCallXm.h>
71#endif
74 72
75/* keep track of when we need to update the rtc */ 73/* keep track of when we need to update the rtc */
76time_t last_rtc_update; 74time_t last_rtc_update;
@@ -81,27 +79,37 @@ unsigned long iSeries_recal_tb = 0;
81static unsigned long first_settimeofday = 1; 79static unsigned long first_settimeofday = 1;
82#endif 80#endif
83 81
82/* The decrementer counts down by 128 every 128ns on a 601. */
83#define DECREMENTER_COUNT_601 (1000000000 / HZ)
84
84#define XSEC_PER_SEC (1024*1024) 85#define XSEC_PER_SEC (1024*1024)
85 86
87#ifdef CONFIG_PPC64
88#define SCALE_XSEC(xsec, max) (((xsec) * max) / XSEC_PER_SEC)
89#else
90/* compute ((xsec << 12) * max) >> 32 */
91#define SCALE_XSEC(xsec, max) mulhwu((xsec) << 12, max)
92#endif
93
86unsigned long tb_ticks_per_jiffy; 94unsigned long tb_ticks_per_jiffy;
87unsigned long tb_ticks_per_usec = 100; /* sane default */ 95unsigned long tb_ticks_per_usec = 100; /* sane default */
88EXPORT_SYMBOL(tb_ticks_per_usec); 96EXPORT_SYMBOL(tb_ticks_per_usec);
89unsigned long tb_ticks_per_sec; 97unsigned long tb_ticks_per_sec;
90unsigned long tb_to_xs; 98u64 tb_to_xs;
91unsigned tb_to_us; 99unsigned tb_to_us;
92unsigned long processor_freq; 100unsigned long processor_freq;
93DEFINE_SPINLOCK(rtc_lock); 101DEFINE_SPINLOCK(rtc_lock);
94EXPORT_SYMBOL_GPL(rtc_lock); 102EXPORT_SYMBOL_GPL(rtc_lock);
95 103
96unsigned long tb_to_ns_scale; 104u64 tb_to_ns_scale;
97unsigned long tb_to_ns_shift; 105unsigned tb_to_ns_shift;
98 106
99struct gettimeofday_struct do_gtod; 107struct gettimeofday_struct do_gtod;
100 108
101extern unsigned long wall_jiffies; 109extern unsigned long wall_jiffies;
102extern int smp_tb_synchronized;
103 110
104extern struct timezone sys_tz; 111extern struct timezone sys_tz;
112static long timezone_offset;
105 113
106void ppc_adjtimex(void); 114void ppc_adjtimex(void);
107 115
@@ -110,6 +118,20 @@ static unsigned adjusting_time = 0;
110unsigned long ppc_proc_freq; 118unsigned long ppc_proc_freq;
111unsigned long ppc_tb_freq; 119unsigned long ppc_tb_freq;
112 120
121#ifdef CONFIG_PPC32 /* XXX for now */
122#define boot_cpuid 0
123#endif
124
125u64 tb_last_jiffy __cacheline_aligned_in_smp;
126unsigned long tb_last_stamp;
127
128/*
129 * Note that on ppc32 this only stores the bottom 32 bits of
130 * the timebase value, but that's enough to tell when a jiffy
131 * has passed.
132 */
133DEFINE_PER_CPU(unsigned long, last_jiffy);
134
113static __inline__ void timer_check_rtc(void) 135static __inline__ void timer_check_rtc(void)
114{ 136{
115 /* 137 /*
@@ -128,31 +150,31 @@ static __inline__ void timer_check_rtc(void)
128 * We should have an rtc call that only sets the minutes and 150 * We should have an rtc call that only sets the minutes and
129 * seconds like on Intel to avoid problems with non UTC clocks. 151 * seconds like on Intel to avoid problems with non UTC clocks.
130 */ 152 */
131 if (ntp_synced() && 153 if (ppc_md.set_rtc_time && ntp_synced() &&
132 xtime.tv_sec - last_rtc_update >= 659 && 154 xtime.tv_sec - last_rtc_update >= 659 &&
133 abs((xtime.tv_nsec/1000) - (1000000-1000000/HZ)) < 500000/HZ && 155 abs((xtime.tv_nsec/1000) - (1000000-1000000/HZ)) < 500000/HZ &&
134 jiffies - wall_jiffies == 1) { 156 jiffies - wall_jiffies == 1) {
135 struct rtc_time tm; 157 struct rtc_time tm;
136 to_tm(xtime.tv_sec+1, &tm); 158 to_tm(xtime.tv_sec + 1 + timezone_offset, &tm);
137 tm.tm_year -= 1900; 159 tm.tm_year -= 1900;
138 tm.tm_mon -= 1; 160 tm.tm_mon -= 1;
139 if (ppc_md.set_rtc_time(&tm) == 0) 161 if (ppc_md.set_rtc_time(&tm) == 0)
140 last_rtc_update = xtime.tv_sec+1; 162 last_rtc_update = xtime.tv_sec + 1;
141 else 163 else
142 /* Try again one minute later */ 164 /* Try again one minute later */
143 last_rtc_update += 60; 165 last_rtc_update += 60;
144 } 166 }
145} 167}
146 168
147/* 169/*
148 * This version of gettimeofday has microsecond resolution. 170 * This version of gettimeofday has microsecond resolution.
149 */ 171 */
150static inline void __do_gettimeofday(struct timeval *tv, unsigned long tb_val) 172static inline void __do_gettimeofday(struct timeval *tv, u64 tb_val)
151{ 173{
152 unsigned long sec, usec, tb_ticks; 174 unsigned long sec, usec;
153 unsigned long xsec, tb_xsec; 175 u64 tb_ticks, xsec;
154 struct gettimeofday_vars * temp_varp; 176 struct gettimeofday_vars *temp_varp;
155 unsigned long temp_tb_to_xs, temp_stamp_xsec; 177 u64 temp_tb_to_xs, temp_stamp_xsec;
156 178
157 /* 179 /*
158 * These calculations are faster (gets rid of divides) 180 * These calculations are faster (gets rid of divides)
@@ -164,11 +186,10 @@ static inline void __do_gettimeofday(struct timeval *tv, unsigned long tb_val)
164 tb_ticks = tb_val - temp_varp->tb_orig_stamp; 186 tb_ticks = tb_val - temp_varp->tb_orig_stamp;
165 temp_tb_to_xs = temp_varp->tb_to_xs; 187 temp_tb_to_xs = temp_varp->tb_to_xs;
166 temp_stamp_xsec = temp_varp->stamp_xsec; 188 temp_stamp_xsec = temp_varp->stamp_xsec;
167 tb_xsec = mulhdu( tb_ticks, temp_tb_to_xs ); 189 xsec = temp_stamp_xsec + mulhdu(tb_ticks, temp_tb_to_xs);
168 xsec = temp_stamp_xsec + tb_xsec;
169 sec = xsec / XSEC_PER_SEC; 190 sec = xsec / XSEC_PER_SEC;
170 xsec -= sec * XSEC_PER_SEC; 191 usec = (unsigned long)xsec & (XSEC_PER_SEC - 1);
171 usec = (xsec * USEC_PER_SEC)/XSEC_PER_SEC; 192 usec = SCALE_XSEC(usec, 1000000);
172 193
173 tv->tv_sec = sec; 194 tv->tv_sec = sec;
174 tv->tv_usec = usec; 195 tv->tv_usec = usec;
@@ -176,6 +197,26 @@ static inline void __do_gettimeofday(struct timeval *tv, unsigned long tb_val)
176 197
177void do_gettimeofday(struct timeval *tv) 198void do_gettimeofday(struct timeval *tv)
178{ 199{
200 if (__USE_RTC()) {
201 /* do this the old way */
202 unsigned long flags, seq;
203 unsigned int sec, nsec, usec, lost;
204
205 do {
206 seq = read_seqbegin_irqsave(&xtime_lock, flags);
207 sec = xtime.tv_sec;
208 nsec = xtime.tv_nsec + tb_ticks_since(tb_last_stamp);
209 lost = jiffies - wall_jiffies;
210 } while (read_seqretry_irqrestore(&xtime_lock, seq, flags));
211 usec = nsec / 1000 + lost * (1000000 / HZ);
212 while (usec >= 1000000) {
213 usec -= 1000000;
214 ++sec;
215 }
216 tv->tv_sec = sec;
217 tv->tv_usec = usec;
218 return;
219 }
179 __do_gettimeofday(tv, get_tb()); 220 __do_gettimeofday(tv, get_tb());
180} 221}
181 222
@@ -185,6 +226,8 @@ EXPORT_SYMBOL(do_gettimeofday);
185 226
186static inline void timer_sync_xtime(unsigned long cur_tb) 227static inline void timer_sync_xtime(unsigned long cur_tb)
187{ 228{
229#ifdef CONFIG_PPC64
230 /* why do we do this? */
188 struct timeval my_tv; 231 struct timeval my_tv;
189 232
190 __do_gettimeofday(&my_tv, cur_tb); 233 __do_gettimeofday(&my_tv, cur_tb);
@@ -193,47 +236,76 @@ static inline void timer_sync_xtime(unsigned long cur_tb)
193 xtime.tv_sec = my_tv.tv_sec; 236 xtime.tv_sec = my_tv.tv_sec;
194 xtime.tv_nsec = my_tv.tv_usec * 1000; 237 xtime.tv_nsec = my_tv.tv_usec * 1000;
195 } 238 }
239#endif
196} 240}
197 241
198/* 242/*
199 * When the timebase - tb_orig_stamp gets too big, we do a manipulation 243 * There are two copies of tb_to_xs and stamp_xsec so that no
200 * between tb_orig_stamp and stamp_xsec. The goal here is to keep the 244 * lock is needed to access and use these values in
201 * difference tb - tb_orig_stamp small enough to always fit inside a 245 * do_gettimeofday. We alternate the copies and as long as a
202 * 32 bits number. This is a requirement of our fast 32 bits userland 246 * reasonable time elapses between changes, there will never
203 * implementation in the vdso. If we "miss" a call to this function 247 * be inconsistent values. ntpd has a minimum of one minute
204 * (interrupt latency, CPU locked in a spinlock, ...) and we end up 248 * between updates.
205 * with a too big difference, then the vdso will fallback to calling
206 * the syscall
207 */ 249 */
208static __inline__ void timer_recalc_offset(unsigned long cur_tb) 250static inline void update_gtod(u64 new_tb_stamp, u64 new_stamp_xsec,
251 u64 new_tb_to_xs)
209{ 252{
210 struct gettimeofday_vars * temp_varp;
211 unsigned temp_idx; 253 unsigned temp_idx;
212 unsigned long offset, new_stamp_xsec, new_tb_orig_stamp; 254 struct gettimeofday_vars *temp_varp;
213
214 if (((cur_tb - do_gtod.varp->tb_orig_stamp) & 0x80000000u) == 0)
215 return;
216 255
217 temp_idx = (do_gtod.var_idx == 0); 256 temp_idx = (do_gtod.var_idx == 0);
218 temp_varp = &do_gtod.vars[temp_idx]; 257 temp_varp = &do_gtod.vars[temp_idx];
219 258
220 new_tb_orig_stamp = cur_tb; 259 temp_varp->tb_to_xs = new_tb_to_xs;
221 offset = new_tb_orig_stamp - do_gtod.varp->tb_orig_stamp; 260 temp_varp->tb_orig_stamp = new_tb_stamp;
222 new_stamp_xsec = do_gtod.varp->stamp_xsec + mulhdu(offset, do_gtod.varp->tb_to_xs);
223
224 temp_varp->tb_to_xs = do_gtod.varp->tb_to_xs;
225 temp_varp->tb_orig_stamp = new_tb_orig_stamp;
226 temp_varp->stamp_xsec = new_stamp_xsec; 261 temp_varp->stamp_xsec = new_stamp_xsec;
227 smp_mb(); 262 smp_mb();
228 do_gtod.varp = temp_varp; 263 do_gtod.varp = temp_varp;
229 do_gtod.var_idx = temp_idx; 264 do_gtod.var_idx = temp_idx;
230 265
266#ifdef CONFIG_PPC64
267 /*
268 * tb_update_count is used to allow the userspace gettimeofday code
269 * to assure itself that it sees a consistent view of the tb_to_xs and
270 * stamp_xsec variables. It reads the tb_update_count, then reads
271 * tb_to_xs and stamp_xsec and then reads tb_update_count again. If
272 * the two values of tb_update_count match and are even then the
273 * tb_to_xs and stamp_xsec values are consistent. If not, then it
274 * loops back and reads them again until this criteria is met.
275 */
231 ++(systemcfg->tb_update_count); 276 ++(systemcfg->tb_update_count);
232 smp_wmb(); 277 smp_wmb();
233 systemcfg->tb_orig_stamp = new_tb_orig_stamp; 278 systemcfg->tb_orig_stamp = new_tb_stamp;
234 systemcfg->stamp_xsec = new_stamp_xsec; 279 systemcfg->stamp_xsec = new_stamp_xsec;
280 systemcfg->tb_to_xs = new_tb_to_xs;
235 smp_wmb(); 281 smp_wmb();
236 ++(systemcfg->tb_update_count); 282 ++(systemcfg->tb_update_count);
283#endif
284}
285
286/*
287 * When the timebase - tb_orig_stamp gets too big, we do a manipulation
288 * between tb_orig_stamp and stamp_xsec. The goal here is to keep the
289 * difference tb - tb_orig_stamp small enough to always fit inside a
290 * 32 bits number. This is a requirement of our fast 32 bits userland
291 * implementation in the vdso. If we "miss" a call to this function
292 * (interrupt latency, CPU locked in a spinlock, ...) and we end up
293 * with a too big difference, then the vdso will fallback to calling
294 * the syscall
295 */
296static __inline__ void timer_recalc_offset(u64 cur_tb)
297{
298 unsigned long offset;
299 u64 new_stamp_xsec;
300
301 if (__USE_RTC())
302 return;
303 offset = cur_tb - do_gtod.varp->tb_orig_stamp;
304 if ((offset & 0x80000000u) == 0)
305 return;
306 new_stamp_xsec = do_gtod.varp->stamp_xsec
307 + mulhdu(offset, do_gtod.varp->tb_to_xs);
308 update_gtod(cur_tb, new_stamp_xsec, do_gtod.varp->tb_to_xs);
237} 309}
238 310
239#ifdef CONFIG_SMP 311#ifdef CONFIG_SMP
@@ -313,26 +385,37 @@ static void iSeries_tb_recal(void)
313 * call will not be needed) 385 * call will not be needed)
314 */ 386 */
315 387
316unsigned long tb_last_stamp __cacheline_aligned_in_smp;
317
318/* 388/*
319 * timer_interrupt - gets called when the decrementer overflows, 389 * timer_interrupt - gets called when the decrementer overflows,
320 * with interrupts disabled. 390 * with interrupts disabled.
321 */ 391 */
322int timer_interrupt(struct pt_regs * regs) 392void timer_interrupt(struct pt_regs * regs)
323{ 393{
324 int next_dec; 394 int next_dec;
325 unsigned long cur_tb; 395 int cpu = smp_processor_id();
326 struct paca_struct *lpaca = get_paca(); 396 unsigned long ticks;
327 unsigned long cpu = smp_processor_id(); 397
398#ifdef CONFIG_PPC32
399 if (atomic_read(&ppc_n_lost_interrupts) != 0)
400 do_IRQ(regs);
401#endif
328 402
329 irq_enter(); 403 irq_enter();
330 404
331 profile_tick(CPU_PROFILING, regs); 405 profile_tick(CPU_PROFILING, regs);
332 406
333 lpaca->lppaca.int_dword.fields.decr_int = 0; 407#ifdef CONFIG_PPC_ISERIES
408 get_paca()->lppaca.int_dword.fields.decr_int = 0;
409#endif
410
411 while ((ticks = tb_ticks_since(per_cpu(last_jiffy, cpu)))
412 >= tb_ticks_per_jiffy) {
413 /* Update last_jiffy */
414 per_cpu(last_jiffy, cpu) += tb_ticks_per_jiffy;
415 /* Handle RTCL overflow on 601 */
416 if (__USE_RTC() && per_cpu(last_jiffy, cpu) >= 1000000000)
417 per_cpu(last_jiffy, cpu) -= 1000000000;
334 418
335 while (lpaca->next_jiffy_update_tb <= (cur_tb = get_tb())) {
336 /* 419 /*
337 * We cannot disable the decrementer, so in the period 420 * We cannot disable the decrementer, so in the period
338 * between this cpu's being marked offline in cpu_online_map 421 * between this cpu's being marked offline in cpu_online_map
@@ -342,27 +425,27 @@ int timer_interrupt(struct pt_regs * regs)
342 */ 425 */
343 if (!cpu_is_offline(cpu)) 426 if (!cpu_is_offline(cpu))
344 update_process_times(user_mode(regs)); 427 update_process_times(user_mode(regs));
428
345 /* 429 /*
346 * No need to check whether cpu is offline here; boot_cpuid 430 * No need to check whether cpu is offline here; boot_cpuid
347 * should have been fixed up by now. 431 * should have been fixed up by now.
348 */ 432 */
349 if (cpu == boot_cpuid) { 433 if (cpu != boot_cpuid)
350 write_seqlock(&xtime_lock); 434 continue;
351 tb_last_stamp = lpaca->next_jiffy_update_tb; 435
352 timer_recalc_offset(lpaca->next_jiffy_update_tb); 436 write_seqlock(&xtime_lock);
353 do_timer(regs); 437 tb_last_jiffy += tb_ticks_per_jiffy;
354 timer_sync_xtime(lpaca->next_jiffy_update_tb); 438 tb_last_stamp = per_cpu(last_jiffy, cpu);
355 timer_check_rtc(); 439 timer_recalc_offset(tb_last_jiffy);
356 write_sequnlock(&xtime_lock); 440 do_timer(regs);
357 if ( adjusting_time && (time_adjust == 0) ) 441 timer_sync_xtime(tb_last_jiffy);
358 ppc_adjtimex(); 442 timer_check_rtc();
359 } 443 write_sequnlock(&xtime_lock);
360 lpaca->next_jiffy_update_tb += tb_ticks_per_jiffy; 444 if (adjusting_time && (time_adjust == 0))
445 ppc_adjtimex();
361 } 446 }
362 447
363 next_dec = lpaca->next_jiffy_update_tb - cur_tb; 448 next_dec = tb_ticks_per_jiffy - ticks;
364 if (next_dec > lpaca->default_decr)
365 next_dec = lpaca->default_decr;
366 set_dec(next_dec); 449 set_dec(next_dec);
367 450
368#ifdef CONFIG_PPC_ISERIES 451#ifdef CONFIG_PPC_ISERIES
@@ -370,17 +453,47 @@ int timer_interrupt(struct pt_regs * regs)
370 process_hvlpevents(regs); 453 process_hvlpevents(regs);
371#endif 454#endif
372 455
456#ifdef CONFIG_PPC64
373 /* collect purr register values often, for accurate calculations */ 457 /* collect purr register values often, for accurate calculations */
374 if (firmware_has_feature(FW_FEATURE_SPLPAR)) { 458 if (firmware_has_feature(FW_FEATURE_SPLPAR)) {
375 struct cpu_usage *cu = &__get_cpu_var(cpu_usage_array); 459 struct cpu_usage *cu = &__get_cpu_var(cpu_usage_array);
376 cu->current_tb = mfspr(SPRN_PURR); 460 cu->current_tb = mfspr(SPRN_PURR);
377 } 461 }
462#endif
378 463
379 irq_exit(); 464 irq_exit();
465}
466
467void wakeup_decrementer(void)
468{
469 int i;
380 470
381 return 1; 471 set_dec(tb_ticks_per_jiffy);
472 /*
473 * We don't expect this to be called on a machine with a 601,
474 * so using get_tbl is fine.
475 */
476 tb_last_stamp = tb_last_jiffy = get_tb();
477 for_each_cpu(i)
478 per_cpu(last_jiffy, i) = tb_last_stamp;
382} 479}
383 480
481#ifdef CONFIG_SMP
482void __init smp_space_timers(unsigned int max_cpus)
483{
484 int i;
485 unsigned long offset = tb_ticks_per_jiffy / max_cpus;
486 unsigned long previous_tb = per_cpu(last_jiffy, boot_cpuid);
487
488 for_each_cpu(i) {
489 if (i != boot_cpuid) {
490 previous_tb += offset;
491 per_cpu(last_jiffy, i) = previous_tb;
492 }
493 }
494}
495#endif
496
384/* 497/*
385 * Scheduler clock - returns current time in nanosec units. 498 * Scheduler clock - returns current time in nanosec units.
386 * 499 *
@@ -390,6 +503,8 @@ int timer_interrupt(struct pt_regs * regs)
390 */ 503 */
391unsigned long long sched_clock(void) 504unsigned long long sched_clock(void)
392{ 505{
506 if (__USE_RTC())
507 return get_rtc();
393 return mulhdu(get_tb(), tb_to_ns_scale) << tb_to_ns_shift; 508 return mulhdu(get_tb(), tb_to_ns_scale) << tb_to_ns_shift;
394} 509}
395 510
@@ -398,31 +513,31 @@ int do_settimeofday(struct timespec *tv)
398 time_t wtm_sec, new_sec = tv->tv_sec; 513 time_t wtm_sec, new_sec = tv->tv_sec;
399 long wtm_nsec, new_nsec = tv->tv_nsec; 514 long wtm_nsec, new_nsec = tv->tv_nsec;
400 unsigned long flags; 515 unsigned long flags;
401 unsigned long delta_xsec;
402 long int tb_delta; 516 long int tb_delta;
403 unsigned long new_xsec; 517 u64 new_xsec, tb_delta_xs;
404 518
405 if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC) 519 if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
406 return -EINVAL; 520 return -EINVAL;
407 521
408 write_seqlock_irqsave(&xtime_lock, flags); 522 write_seqlock_irqsave(&xtime_lock, flags);
409 /* Updating the RTC is not the job of this code. If the time is 523
410 * stepped under NTP, the RTC will be update after STA_UNSYNC 524 /*
411 * is cleared. Tool like clock/hwclock either copy the RTC 525 * Updating the RTC is not the job of this code. If the time is
526 * stepped under NTP, the RTC will be updated after STA_UNSYNC
527 * is cleared. Tools like clock/hwclock either copy the RTC
412 * to the system time, in which case there is no point in writing 528 * to the system time, in which case there is no point in writing
413 * to the RTC again, or write to the RTC but then they don't call 529 * to the RTC again, or write to the RTC but then they don't call
414 * settimeofday to perform this operation. 530 * settimeofday to perform this operation.
415 */ 531 */
416#ifdef CONFIG_PPC_ISERIES 532#ifdef CONFIG_PPC_ISERIES
417 if ( first_settimeofday ) { 533 if (first_settimeofday) {
418 iSeries_tb_recal(); 534 iSeries_tb_recal();
419 first_settimeofday = 0; 535 first_settimeofday = 0;
420 } 536 }
421#endif 537#endif
422 tb_delta = tb_ticks_since(tb_last_stamp); 538 tb_delta = tb_ticks_since(tb_last_stamp);
423 tb_delta += (jiffies - wall_jiffies) * tb_ticks_per_jiffy; 539 tb_delta += (jiffies - wall_jiffies) * tb_ticks_per_jiffy;
424 540 tb_delta_xs = mulhdu(tb_delta, do_gtod.varp->tb_to_xs);
425 new_nsec -= tb_delta / tb_ticks_per_usec / 1000;
426 541
427 wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - new_sec); 542 wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - new_sec);
428 wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - new_nsec); 543 wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - new_nsec);
@@ -437,28 +552,18 @@ int do_settimeofday(struct timespec *tv)
437 552
438 ntp_clear(); 553 ntp_clear();
439 554
440 delta_xsec = mulhdu( (tb_last_stamp-do_gtod.varp->tb_orig_stamp), 555 new_xsec = 0;
441 do_gtod.varp->tb_to_xs ); 556 if (new_nsec != 0) {
442 557 new_xsec = (u64)new_nsec * XSEC_PER_SEC;
443 new_xsec = (new_nsec * XSEC_PER_SEC) / NSEC_PER_SEC; 558 do_div(new_xsec, NSEC_PER_SEC);
444 new_xsec += new_sec * XSEC_PER_SEC;
445 if ( new_xsec > delta_xsec ) {
446 do_gtod.varp->stamp_xsec = new_xsec - delta_xsec;
447 systemcfg->stamp_xsec = new_xsec - delta_xsec;
448 }
449 else {
450 /* This is only for the case where the user is setting the time
451 * way back to a time such that the boot time would have been
452 * before 1970 ... eg. we booted ten days ago, and we are setting
453 * the time to Jan 5, 1970 */
454 do_gtod.varp->stamp_xsec = new_xsec;
455 do_gtod.varp->tb_orig_stamp = tb_last_stamp;
456 systemcfg->stamp_xsec = new_xsec;
457 systemcfg->tb_orig_stamp = tb_last_stamp;
458 } 559 }
560 new_xsec += (u64)new_sec * XSEC_PER_SEC - tb_delta_xs;
561 update_gtod(tb_last_jiffy, new_xsec, do_gtod.varp->tb_to_xs);
459 562
563#ifdef CONFIG_PPC64
460 systemcfg->tz_minuteswest = sys_tz.tz_minuteswest; 564 systemcfg->tz_minuteswest = sys_tz.tz_minuteswest;
461 systemcfg->tz_dsttime = sys_tz.tz_dsttime; 565 systemcfg->tz_dsttime = sys_tz.tz_dsttime;
566#endif
462 567
463 write_sequnlock_irqrestore(&xtime_lock, flags); 568 write_sequnlock_irqrestore(&xtime_lock, flags);
464 clock_was_set(); 569 clock_was_set();
@@ -467,11 +572,9 @@ int do_settimeofday(struct timespec *tv)
467 572
468EXPORT_SYMBOL(do_settimeofday); 573EXPORT_SYMBOL(do_settimeofday);
469 574
470#if defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_MAPLE) || defined(CONFIG_PPC_BPA)
471void __init generic_calibrate_decr(void) 575void __init generic_calibrate_decr(void)
472{ 576{
473 struct device_node *cpu; 577 struct device_node *cpu;
474 struct div_result divres;
475 unsigned int *fp; 578 unsigned int *fp;
476 int node_found; 579 int node_found;
477 580
@@ -505,37 +608,74 @@ void __init generic_calibrate_decr(void)
505 ppc_proc_freq = *fp; 608 ppc_proc_freq = *fp;
506 } 609 }
507 } 610 }
611#ifdef CONFIG_BOOKE
612 /* Set the time base to zero */
613 mtspr(SPRN_TBWL, 0);
614 mtspr(SPRN_TBWU, 0);
615
616 /* Clear any pending timer interrupts */
617 mtspr(SPRN_TSR, TSR_ENW | TSR_WIS | TSR_DIS | TSR_FIS);
618
619 /* Enable decrementer interrupt */
620 mtspr(SPRN_TCR, TCR_DIE);
621#endif
508 if (!node_found) 622 if (!node_found)
509 printk(KERN_ERR "WARNING: Estimating processor frequency " 623 printk(KERN_ERR "WARNING: Estimating processor frequency "
510 "(not found)\n"); 624 "(not found)\n");
511 625
512 of_node_put(cpu); 626 of_node_put(cpu);
627}
513 628
514 printk(KERN_INFO "time_init: decrementer frequency = %lu.%.6lu MHz\n", 629unsigned long get_boot_time(void)
515 ppc_tb_freq/1000000, ppc_tb_freq%1000000); 630{
516 printk(KERN_INFO "time_init: processor frequency = %lu.%.6lu MHz\n", 631 struct rtc_time tm;
517 ppc_proc_freq/1000000, ppc_proc_freq%1000000);
518
519 tb_ticks_per_jiffy = ppc_tb_freq / HZ;
520 tb_ticks_per_sec = tb_ticks_per_jiffy * HZ;
521 tb_ticks_per_usec = ppc_tb_freq / 1000000;
522 tb_to_us = mulhwu_scale_factor(ppc_tb_freq, 1000000);
523 div128_by_32(1024*1024, 0, tb_ticks_per_sec, &divres);
524 tb_to_xs = divres.result_low;
525 632
526 setup_default_decr(); 633 if (ppc_md.get_boot_time)
634 return ppc_md.get_boot_time();
635 if (!ppc_md.get_rtc_time)
636 return 0;
637 ppc_md.get_rtc_time(&tm);
638 return mktime(tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
639 tm.tm_hour, tm.tm_min, tm.tm_sec);
527} 640}
528#endif
529 641
642/* This function is only called on the boot processor */
530void __init time_init(void) 643void __init time_init(void)
531{ 644{
532 /* This function is only called on the boot processor */
533 unsigned long flags; 645 unsigned long flags;
534 struct rtc_time tm; 646 unsigned long tm = 0;
535 struct div_result res; 647 struct div_result res;
536 unsigned long scale, shift; 648 u64 scale;
649 unsigned shift;
650
651 if (ppc_md.time_init != NULL)
652 timezone_offset = ppc_md.time_init();
653
654 if (__USE_RTC()) {
655 /* 601 processor: dec counts down by 128 every 128ns */
656 ppc_tb_freq = 1000000000;
657 tb_last_stamp = get_rtcl();
658 tb_last_jiffy = tb_last_stamp;
659 } else {
660 /* Normal PowerPC with timebase register */
661 ppc_md.calibrate_decr();
662 printk(KERN_INFO "time_init: decrementer frequency = %lu.%.6lu MHz\n",
663 ppc_tb_freq / 1000000, ppc_tb_freq % 1000000);
664 printk(KERN_INFO "time_init: processor frequency = %lu.%.6lu MHz\n",
665 ppc_proc_freq / 1000000, ppc_proc_freq % 1000000);
666 tb_last_stamp = tb_last_jiffy = get_tb();
667 }
668
669 tb_ticks_per_jiffy = ppc_tb_freq / HZ;
670 tb_ticks_per_sec = tb_ticks_per_jiffy * HZ;
671 tb_ticks_per_usec = ppc_tb_freq / 1000000;
672 tb_to_us = mulhwu_scale_factor(ppc_tb_freq, 1000000);
673 div128_by_32(1024*1024, 0, tb_ticks_per_sec, &res);
674 tb_to_xs = res.result_low;
537 675
538 ppc_md.calibrate_decr(); 676#ifdef CONFIG_PPC64
677 get_paca()->default_decr = tb_ticks_per_jiffy;
678#endif
539 679
540 /* 680 /*
541 * Compute scale factor for sched_clock. 681 * Compute scale factor for sched_clock.
@@ -559,29 +699,36 @@ void __init time_init(void)
559#ifdef CONFIG_PPC_ISERIES 699#ifdef CONFIG_PPC_ISERIES
560 if (!piranha_simulator) 700 if (!piranha_simulator)
561#endif 701#endif
562 ppc_md.get_boot_time(&tm); 702 tm = get_boot_time();
563 703
564 write_seqlock_irqsave(&xtime_lock, flags); 704 write_seqlock_irqsave(&xtime_lock, flags);
565 xtime.tv_sec = mktime(tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, 705 xtime.tv_sec = tm;
566 tm.tm_hour, tm.tm_min, tm.tm_sec); 706 xtime.tv_nsec = 0;
567 tb_last_stamp = get_tb();
568 do_gtod.varp = &do_gtod.vars[0]; 707 do_gtod.varp = &do_gtod.vars[0];
569 do_gtod.var_idx = 0; 708 do_gtod.var_idx = 0;
570 do_gtod.varp->tb_orig_stamp = tb_last_stamp; 709 do_gtod.varp->tb_orig_stamp = tb_last_jiffy;
571 get_paca()->next_jiffy_update_tb = tb_last_stamp + tb_ticks_per_jiffy; 710 __get_cpu_var(last_jiffy) = tb_last_stamp;
572 do_gtod.varp->stamp_xsec = xtime.tv_sec * XSEC_PER_SEC; 711 do_gtod.varp->stamp_xsec = (u64) xtime.tv_sec * XSEC_PER_SEC;
573 do_gtod.tb_ticks_per_sec = tb_ticks_per_sec; 712 do_gtod.tb_ticks_per_sec = tb_ticks_per_sec;
574 do_gtod.varp->tb_to_xs = tb_to_xs; 713 do_gtod.varp->tb_to_xs = tb_to_xs;
575 do_gtod.tb_to_us = tb_to_us; 714 do_gtod.tb_to_us = tb_to_us;
576 systemcfg->tb_orig_stamp = tb_last_stamp; 715#ifdef CONFIG_PPC64
716 systemcfg->tb_orig_stamp = tb_last_jiffy;
577 systemcfg->tb_update_count = 0; 717 systemcfg->tb_update_count = 0;
578 systemcfg->tb_ticks_per_sec = tb_ticks_per_sec; 718 systemcfg->tb_ticks_per_sec = tb_ticks_per_sec;
579 systemcfg->stamp_xsec = xtime.tv_sec * XSEC_PER_SEC; 719 systemcfg->stamp_xsec = xtime.tv_sec * XSEC_PER_SEC;
580 systemcfg->tb_to_xs = tb_to_xs; 720 systemcfg->tb_to_xs = tb_to_xs;
721#endif
581 722
582 time_freq = 0; 723 time_freq = 0;
583 724
584 xtime.tv_nsec = 0; 725 /* If platform provided a timezone (pmac), we correct the time */
726 if (timezone_offset) {
727 sys_tz.tz_minuteswest = -timezone_offset / 60;
728 sys_tz.tz_dsttime = 0;
729 xtime.tv_sec -= timezone_offset;
730 }
731
585 last_rtc_update = xtime.tv_sec; 732 last_rtc_update = xtime.tv_sec;
586 set_normalized_timespec(&wall_to_monotonic, 733 set_normalized_timespec(&wall_to_monotonic,
587 -xtime.tv_sec, -xtime.tv_nsec); 734 -xtime.tv_sec, -xtime.tv_nsec);
@@ -604,25 +751,28 @@ void __init time_init(void)
604 751
605void ppc_adjtimex(void) 752void ppc_adjtimex(void)
606{ 753{
607 unsigned long den, new_tb_ticks_per_sec, tb_ticks, old_xsec, new_tb_to_xs, new_xsec, new_stamp_xsec; 754#ifdef CONFIG_PPC64
755 unsigned long den, new_tb_ticks_per_sec, tb_ticks, old_xsec,
756 new_tb_to_xs, new_xsec, new_stamp_xsec;
608 unsigned long tb_ticks_per_sec_delta; 757 unsigned long tb_ticks_per_sec_delta;
609 long delta_freq, ltemp; 758 long delta_freq, ltemp;
610 struct div_result divres; 759 struct div_result divres;
611 unsigned long flags; 760 unsigned long flags;
612 struct gettimeofday_vars * temp_varp;
613 unsigned temp_idx;
614 long singleshot_ppm = 0; 761 long singleshot_ppm = 0;
615 762
616 /* Compute parts per million frequency adjustment to accomplish the time adjustment 763 /*
617 implied by time_offset to be applied over the elapsed time indicated by time_constant. 764 * Compute parts per million frequency adjustment to
618 Use SHIFT_USEC to get it into the same units as time_freq. */ 765 * accomplish the time adjustment implied by time_offset to be
766 * applied over the elapsed time indicated by time_constant.
767 * Use SHIFT_USEC to get it into the same units as
768 * time_freq.
769 */
619 if ( time_offset < 0 ) { 770 if ( time_offset < 0 ) {
620 ltemp = -time_offset; 771 ltemp = -time_offset;
621 ltemp <<= SHIFT_USEC - SHIFT_UPDATE; 772 ltemp <<= SHIFT_USEC - SHIFT_UPDATE;
622 ltemp >>= SHIFT_KG + time_constant; 773 ltemp >>= SHIFT_KG + time_constant;
623 ltemp = -ltemp; 774 ltemp = -ltemp;
624 } 775 } else {
625 else {
626 ltemp = time_offset; 776 ltemp = time_offset;
627 ltemp <<= SHIFT_USEC - SHIFT_UPDATE; 777 ltemp <<= SHIFT_USEC - SHIFT_UPDATE;
628 ltemp >>= SHIFT_KG + time_constant; 778 ltemp >>= SHIFT_KG + time_constant;
@@ -639,7 +789,10 @@ void ppc_adjtimex(void)
639 789
640 adjusting_time = 1; 790 adjusting_time = 1;
641 791
642 /* Compute parts per million frequency adjustment to match time_adjust */ 792 /*
793 * Compute parts per million frequency adjustment
794 * to match time_adjust
795 */
643 singleshot_ppm = tickadj * HZ; 796 singleshot_ppm = tickadj * HZ;
644 /* 797 /*
645 * The adjustment should be tickadj*HZ to match the code in 798 * The adjustment should be tickadj*HZ to match the code in
@@ -647,7 +800,7 @@ void ppc_adjtimex(void)
647 * large. 3/4 of tickadj*HZ seems about right 800 * large. 3/4 of tickadj*HZ seems about right
648 */ 801 */
649 singleshot_ppm -= singleshot_ppm / 4; 802 singleshot_ppm -= singleshot_ppm / 4;
650 /* Use SHIFT_USEC to get it into the same units as time_freq */ 803 /* Use SHIFT_USEC to get it into the same units as time_freq */
651 singleshot_ppm <<= SHIFT_USEC; 804 singleshot_ppm <<= SHIFT_USEC;
652 if ( time_adjust < 0 ) 805 if ( time_adjust < 0 )
653 singleshot_ppm = -singleshot_ppm; 806 singleshot_ppm = -singleshot_ppm;
@@ -663,7 +816,10 @@ void ppc_adjtimex(void)
663 /* Add up all of the frequency adjustments */ 816 /* Add up all of the frequency adjustments */
664 delta_freq = time_freq + ltemp + singleshot_ppm; 817 delta_freq = time_freq + ltemp + singleshot_ppm;
665 818
666 /* Compute a new value for tb_ticks_per_sec based on the frequency adjustment */ 819 /*
820 * Compute a new value for tb_ticks_per_sec based on
821 * the frequency adjustment
822 */
667 den = 1000000 * (1 << (SHIFT_USEC - 8)); 823 den = 1000000 * (1 << (SHIFT_USEC - 8));
668 if ( delta_freq < 0 ) { 824 if ( delta_freq < 0 ) {
669 tb_ticks_per_sec_delta = ( tb_ticks_per_sec * ( (-delta_freq) >> (SHIFT_USEC - 8))) / den; 825 tb_ticks_per_sec_delta = ( tb_ticks_per_sec * ( (-delta_freq) >> (SHIFT_USEC - 8))) / den;
@@ -678,61 +834,37 @@ void ppc_adjtimex(void)
678 printk("ppc_adjtimex: ltemp = %ld, time_freq = %ld, singleshot_ppm = %ld\n", ltemp, time_freq, singleshot_ppm); 834 printk("ppc_adjtimex: ltemp = %ld, time_freq = %ld, singleshot_ppm = %ld\n", ltemp, time_freq, singleshot_ppm);
679 printk("ppc_adjtimex: tb_ticks_per_sec - base = %ld new = %ld\n", tb_ticks_per_sec, new_tb_ticks_per_sec); 835 printk("ppc_adjtimex: tb_ticks_per_sec - base = %ld new = %ld\n", tb_ticks_per_sec, new_tb_ticks_per_sec);
680#endif 836#endif
681 837
682 /* Compute a new value of tb_to_xs (used to convert tb to microseconds and a new value of 838 /*
683 stamp_xsec which is the time (in 1/2^20 second units) corresponding to tb_orig_stamp. This 839 * Compute a new value of tb_to_xs (used to convert tb to
684 new value of stamp_xsec compensates for the change in frequency (implied by the new tb_to_xs) 840 * microseconds) and a new value of stamp_xsec which is the
685 which guarantees that the current time remains the same */ 841 * time (in 1/2^20 second units) corresponding to
842 * tb_orig_stamp. This new value of stamp_xsec compensates
843 * for the change in frequency (implied by the new tb_to_xs)
844 * which guarantees that the current time remains the same.
845 */
686 write_seqlock_irqsave( &xtime_lock, flags ); 846 write_seqlock_irqsave( &xtime_lock, flags );
687 tb_ticks = get_tb() - do_gtod.varp->tb_orig_stamp; 847 tb_ticks = get_tb() - do_gtod.varp->tb_orig_stamp;
688 div128_by_32( 1024*1024, 0, new_tb_ticks_per_sec, &divres ); 848 div128_by_32(1024*1024, 0, new_tb_ticks_per_sec, &divres);
689 new_tb_to_xs = divres.result_low; 849 new_tb_to_xs = divres.result_low;
690 new_xsec = mulhdu( tb_ticks, new_tb_to_xs ); 850 new_xsec = mulhdu(tb_ticks, new_tb_to_xs);
691 851
692 old_xsec = mulhdu( tb_ticks, do_gtod.varp->tb_to_xs ); 852 old_xsec = mulhdu(tb_ticks, do_gtod.varp->tb_to_xs);
693 new_stamp_xsec = do_gtod.varp->stamp_xsec + old_xsec - new_xsec; 853 new_stamp_xsec = do_gtod.varp->stamp_xsec + old_xsec - new_xsec;
694 854
695 /* There are two copies of tb_to_xs and stamp_xsec so that no lock is needed to access and use these 855 update_gtod(do_gtod.varp->tb_orig_stamp, new_stamp_xsec, new_tb_to_xs);
696 values in do_gettimeofday. We alternate the copies and as long as a reasonable time elapses between
697 changes, there will never be inconsistent values. ntpd has a minimum of one minute between updates */
698
699 temp_idx = (do_gtod.var_idx == 0);
700 temp_varp = &do_gtod.vars[temp_idx];
701
702 temp_varp->tb_to_xs = new_tb_to_xs;
703 temp_varp->stamp_xsec = new_stamp_xsec;
704 temp_varp->tb_orig_stamp = do_gtod.varp->tb_orig_stamp;
705 smp_mb();
706 do_gtod.varp = temp_varp;
707 do_gtod.var_idx = temp_idx;
708
709 /*
710 * tb_update_count is used to allow the problem state gettimeofday code
711 * to assure itself that it sees a consistent view of the tb_to_xs and
712 * stamp_xsec variables. It reads the tb_update_count, then reads
713 * tb_to_xs and stamp_xsec and then reads tb_update_count again. If
714 * the two values of tb_update_count match and are even then the
715 * tb_to_xs and stamp_xsec values are consistent. If not, then it
716 * loops back and reads them again until this criteria is met.
717 */
718 ++(systemcfg->tb_update_count);
719 smp_wmb();
720 systemcfg->tb_to_xs = new_tb_to_xs;
721 systemcfg->stamp_xsec = new_stamp_xsec;
722 smp_wmb();
723 ++(systemcfg->tb_update_count);
724 856
725 write_sequnlock_irqrestore( &xtime_lock, flags ); 857 write_sequnlock_irqrestore( &xtime_lock, flags );
726 858#endif /* CONFIG_PPC64 */
727} 859}
728 860
729 861
730#define TICK_SIZE tick
731#define FEBRUARY 2 862#define FEBRUARY 2
732#define STARTOFTIME 1970 863#define STARTOFTIME 1970
733#define SECDAY 86400L 864#define SECDAY 86400L
734#define SECYR (SECDAY * 365) 865#define SECYR (SECDAY * 365)
735#define leapyear(year) ((year) % 4 == 0) 866#define leapyear(year) ((year) % 4 == 0 && \
867 ((year) % 100 != 0 || (year) % 400 == 0))
736#define days_in_year(a) (leapyear(a) ? 366 : 365) 868#define days_in_year(a) (leapyear(a) ? 366 : 365)
737#define days_in_month(a) (month_days[(a) - 1]) 869#define days_in_month(a) (month_days[(a) - 1])
738 870
@@ -750,37 +882,25 @@ void GregorianDay(struct rtc_time * tm)
750 int day; 882 int day;
751 int MonthOffset[] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; 883 int MonthOffset[] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
752 884
753 lastYear=tm->tm_year-1; 885 lastYear = tm->tm_year - 1;
754 886
755 /* 887 /*
756 * Number of leap corrections to apply up to end of last year 888 * Number of leap corrections to apply up to end of last year
757 */ 889 */
758 leapsToDate = lastYear/4 - lastYear/100 + lastYear/400; 890 leapsToDate = lastYear / 4 - lastYear / 100 + lastYear / 400;
759 891
760 /* 892 /*
761 * This year is a leap year if it is divisible by 4 except when it is 893 * This year is a leap year if it is divisible by 4 except when it is
762 * divisible by 100 unless it is divisible by 400 894 * divisible by 100 unless it is divisible by 400
763 * 895 *
764 * e.g. 1904 was a leap year, 1900 was not, 1996 is, and 2000 will be 896 * e.g. 1904 was a leap year, 1900 was not, 1996 is, and 2000 was
765 */ 897 */
766 if((tm->tm_year%4==0) && 898 day = tm->tm_mon > 2 && leapyear(tm->tm_year);
767 ((tm->tm_year%100!=0) || (tm->tm_year%400==0)) &&
768 (tm->tm_mon>2))
769 {
770 /*
771 * We are past Feb. 29 in a leap year
772 */
773 day=1;
774 }
775 else
776 {
777 day=0;
778 }
779 899
780 day += lastYear*365 + leapsToDate + MonthOffset[tm->tm_mon-1] + 900 day += lastYear*365 + leapsToDate + MonthOffset[tm->tm_mon-1] +
781 tm->tm_mday; 901 tm->tm_mday;
782 902
783 tm->tm_wday=day%7; 903 tm->tm_wday = day % 7;
784} 904}
785 905
786void to_tm(int tim, struct rtc_time * tm) 906void to_tm(int tim, struct rtc_time * tm)
@@ -826,14 +946,16 @@ void to_tm(int tim, struct rtc_time * tm)
826 * oscillators and the precision with which the timebase frequency 946 * oscillators and the precision with which the timebase frequency
827 * is measured but does not harm. 947 * is measured but does not harm.
828 */ 948 */
829unsigned mulhwu_scale_factor(unsigned inscale, unsigned outscale) { 949unsigned mulhwu_scale_factor(unsigned inscale, unsigned outscale)
950{
830 unsigned mlt=0, tmp, err; 951 unsigned mlt=0, tmp, err;
831 /* No concern for performance, it's done once: use a stupid 952 /* No concern for performance, it's done once: use a stupid
832 * but safe and compact method to find the multiplier. 953 * but safe and compact method to find the multiplier.
833 */ 954 */
834 955
835 for (tmp = 1U<<31; tmp != 0; tmp >>= 1) { 956 for (tmp = 1U<<31; tmp != 0; tmp >>= 1) {
836 if (mulhwu(inscale, mlt|tmp) < outscale) mlt|=tmp; 957 if (mulhwu(inscale, mlt|tmp) < outscale)
958 mlt |= tmp;
837 } 959 }
838 960
839 /* We might still be off by 1 for the best approximation. 961 /* We might still be off by 1 for the best approximation.
@@ -843,39 +965,41 @@ unsigned mulhwu_scale_factor(unsigned inscale, unsigned outscale) {
843 * some might have been forgotten in the test however. 965 * some might have been forgotten in the test however.
844 */ 966 */
845 967
846 err = inscale*(mlt+1); 968 err = inscale * (mlt+1);
847 if (err <= inscale/2) mlt++; 969 if (err <= inscale/2)
970 mlt++;
848 return mlt; 971 return mlt;
849 } 972}
850 973
851/* 974/*
852 * Divide a 128-bit dividend by a 32-bit divisor, leaving a 128 bit 975 * Divide a 128-bit dividend by a 32-bit divisor, leaving a 128 bit
853 * result. 976 * result.
854 */ 977 */
855 978void div128_by_32(u64 dividend_high, u64 dividend_low,
856void div128_by_32( unsigned long dividend_high, unsigned long dividend_low, 979 unsigned divisor, struct div_result *dr)
857 unsigned divisor, struct div_result *dr )
858{ 980{
859 unsigned long a,b,c,d, w,x,y,z, ra,rb,rc; 981 unsigned long a, b, c, d;
982 unsigned long w, x, y, z;
983 u64 ra, rb, rc;
860 984
861 a = dividend_high >> 32; 985 a = dividend_high >> 32;
862 b = dividend_high & 0xffffffff; 986 b = dividend_high & 0xffffffff;
863 c = dividend_low >> 32; 987 c = dividend_low >> 32;
864 d = dividend_low & 0xffffffff; 988 d = dividend_low & 0xffffffff;
865 989
866 w = a/divisor; 990 w = a / divisor;
867 ra = (a - (w * divisor)) << 32; 991 ra = ((u64)(a - (w * divisor)) << 32) + b;
868 992
869 x = (ra + b)/divisor; 993 rb = ((u64) do_div(ra, divisor) << 32) + c;
870 rb = ((ra + b) - (x * divisor)) << 32; 994 x = ra;
871 995
872 y = (rb + c)/divisor; 996 rc = ((u64) do_div(rb, divisor) << 32) + d;
873 rc = ((rb + c) - (y * divisor)) << 32; 997 y = rb;
874 998
875 z = (rc + d)/divisor; 999 do_div(rc, divisor);
1000 z = rc;
876 1001
877 dr->result_high = (w << 32) + x; 1002 dr->result_high = ((u64)w << 32) + x;
878 dr->result_low = (y << 32) + z; 1003 dr->result_low = ((u64)y << 32) + z;
879 1004
880} 1005}
881
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
new file mode 100644
index 000000000000..5d638ecddbd0
--- /dev/null
+++ b/arch/powerpc/kernel/traps.c
@@ -0,0 +1,1101 @@
1/*
2 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
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 * Modified by Cort Dougan (cort@cs.nmt.edu)
10 * and Paul Mackerras (paulus@samba.org)
11 */
12
13/*
14 * This file handles the architecture-dependent parts of hardware exceptions
15 */
16
17#include <linux/config.h>
18#include <linux/errno.h>
19#include <linux/sched.h>
20#include <linux/kernel.h>
21#include <linux/mm.h>
22#include <linux/stddef.h>
23#include <linux/unistd.h>
24#include <linux/ptrace.h>
25#include <linux/slab.h>
26#include <linux/user.h>
27#include <linux/a.out.h>
28#include <linux/interrupt.h>
29#include <linux/init.h>
30#include <linux/module.h>
31#include <linux/prctl.h>
32#include <linux/delay.h>
33#include <linux/kprobes.h>
34
35#include <asm/kdebug.h>
36#include <asm/pgtable.h>
37#include <asm/uaccess.h>
38#include <asm/system.h>
39#include <asm/io.h>
40#include <asm/machdep.h>
41#include <asm/rtas.h>
42#include <asm/xmon.h>
43#include <asm/pmc.h>
44#ifdef CONFIG_PPC32
45#include <asm/reg.h>
46#endif
47#ifdef CONFIG_PMAC_BACKLIGHT
48#include <asm/backlight.h>
49#endif
50#ifdef CONFIG_PPC64
51#include <asm/firmware.h>
52#include <asm/processor.h>
53#include <asm/systemcfg.h>
54#endif
55
56#ifdef CONFIG_PPC64 /* XXX */
57#define _IO_BASE pci_io_base
58#endif
59
60#ifdef CONFIG_DEBUGGER
61int (*__debugger)(struct pt_regs *regs);
62int (*__debugger_ipi)(struct pt_regs *regs);
63int (*__debugger_bpt)(struct pt_regs *regs);
64int (*__debugger_sstep)(struct pt_regs *regs);
65int (*__debugger_iabr_match)(struct pt_regs *regs);
66int (*__debugger_dabr_match)(struct pt_regs *regs);
67int (*__debugger_fault_handler)(struct pt_regs *regs);
68
69EXPORT_SYMBOL(__debugger);
70EXPORT_SYMBOL(__debugger_ipi);
71EXPORT_SYMBOL(__debugger_bpt);
72EXPORT_SYMBOL(__debugger_sstep);
73EXPORT_SYMBOL(__debugger_iabr_match);
74EXPORT_SYMBOL(__debugger_dabr_match);
75EXPORT_SYMBOL(__debugger_fault_handler);
76#endif
77
78struct notifier_block *powerpc_die_chain;
79static DEFINE_SPINLOCK(die_notifier_lock);
80
81int register_die_notifier(struct notifier_block *nb)
82{
83 int err = 0;
84 unsigned long flags;
85
86 spin_lock_irqsave(&die_notifier_lock, flags);
87 err = notifier_chain_register(&powerpc_die_chain, nb);
88 spin_unlock_irqrestore(&die_notifier_lock, flags);
89 return err;
90}
91
92/*
93 * Trap & Exception support
94 */
95
96static DEFINE_SPINLOCK(die_lock);
97
98int die(const char *str, struct pt_regs *regs, long err)
99{
100 static int die_counter;
101 int nl = 0;
102
103 if (debugger(regs))
104 return 1;
105
106 console_verbose();
107 spin_lock_irq(&die_lock);
108 bust_spinlocks(1);
109#ifdef CONFIG_PMAC_BACKLIGHT
110 if (_machine == _MACH_Pmac) {
111 set_backlight_enable(1);
112 set_backlight_level(BACKLIGHT_MAX);
113 }
114#endif
115 printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter);
116#ifdef CONFIG_PREEMPT
117 printk("PREEMPT ");
118 nl = 1;
119#endif
120#ifdef CONFIG_SMP
121 printk("SMP NR_CPUS=%d ", NR_CPUS);
122 nl = 1;
123#endif
124#ifdef CONFIG_DEBUG_PAGEALLOC
125 printk("DEBUG_PAGEALLOC ");
126 nl = 1;
127#endif
128#ifdef CONFIG_NUMA
129 printk("NUMA ");
130 nl = 1;
131#endif
132#ifdef CONFIG_PPC64
133 switch (systemcfg->platform) {
134 case PLATFORM_PSERIES:
135 printk("PSERIES ");
136 nl = 1;
137 break;
138 case PLATFORM_PSERIES_LPAR:
139 printk("PSERIES LPAR ");
140 nl = 1;
141 break;
142 case PLATFORM_ISERIES_LPAR:
143 printk("ISERIES LPAR ");
144 nl = 1;
145 break;
146 case PLATFORM_POWERMAC:
147 printk("POWERMAC ");
148 nl = 1;
149 break;
150 case PLATFORM_BPA:
151 printk("BPA ");
152 nl = 1;
153 break;
154 }
155#endif
156 if (nl)
157 printk("\n");
158 print_modules();
159 show_regs(regs);
160 bust_spinlocks(0);
161 spin_unlock_irq(&die_lock);
162
163 if (in_interrupt())
164 panic("Fatal exception in interrupt");
165
166 if (panic_on_oops) {
167#ifdef CONFIG_PPC64
168 printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n");
169 ssleep(5);
170#endif
171 panic("Fatal exception");
172 }
173 do_exit(err);
174
175 return 0;
176}
177
178void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
179{
180 siginfo_t info;
181
182 if (!user_mode(regs)) {
183 if (die("Exception in kernel mode", regs, signr))
184 return;
185 }
186
187 memset(&info, 0, sizeof(info));
188 info.si_signo = signr;
189 info.si_code = code;
190 info.si_addr = (void __user *) addr;
191 force_sig_info(signr, &info, current);
192
193 /*
194 * Init gets no signals that it doesn't have a handler for.
195 * That's all very well, but if it has caused a synchronous
196 * exception and we ignore the resulting signal, it will just
197 * generate the same exception over and over again and we get
198 * nowhere. Better to kill it and let the kernel panic.
199 */
200 if (current->pid == 1) {
201 __sighandler_t handler;
202
203 spin_lock_irq(&current->sighand->siglock);
204 handler = current->sighand->action[signr-1].sa.sa_handler;
205 spin_unlock_irq(&current->sighand->siglock);
206 if (handler == SIG_DFL) {
207 /* init has generated a synchronous exception
208 and it doesn't have a handler for the signal */
209 printk(KERN_CRIT "init has generated signal %d "
210 "but has no handler for it\n", signr);
211 do_exit(signr);
212 }
213 }
214}
215
216#ifdef CONFIG_PPC64
217void system_reset_exception(struct pt_regs *regs)
218{
219 /* See if any machine dependent calls */
220 if (ppc_md.system_reset_exception)
221 ppc_md.system_reset_exception(regs);
222
223 die("System Reset", regs, SIGABRT);
224
225 /* Must die if the interrupt is not recoverable */
226 if (!(regs->msr & MSR_RI))
227 panic("Unrecoverable System Reset");
228
229 /* What should we do here? We could issue a shutdown or hard reset. */
230}
231#endif
232
233/*
234 * I/O accesses can cause machine checks on powermacs.
235 * Check if the NIP corresponds to the address of a sync
236 * instruction for which there is an entry in the exception
237 * table.
238 * Note that the 601 only takes a machine check on TEA
239 * (transfer error ack) signal assertion, and does not
240 * set any of the top 16 bits of SRR1.
241 * -- paulus.
242 */
243static inline int check_io_access(struct pt_regs *regs)
244{
245#ifdef CONFIG_PPC_PMAC
246 unsigned long msr = regs->msr;
247 const struct exception_table_entry *entry;
248 unsigned int *nip = (unsigned int *)regs->nip;
249
250 if (((msr & 0xffff0000) == 0 || (msr & (0x80000 | 0x40000)))
251 && (entry = search_exception_tables(regs->nip)) != NULL) {
252 /*
253 * Check that it's a sync instruction, or somewhere
254 * in the twi; isync; nop sequence that inb/inw/inl uses.
255 * As the address is in the exception table
256 * we should be able to read the instr there.
257 * For the debug message, we look at the preceding
258 * load or store.
259 */
260 if (*nip == 0x60000000) /* nop */
261 nip -= 2;
262 else if (*nip == 0x4c00012c) /* isync */
263 --nip;
264 if (*nip == 0x7c0004ac || (*nip >> 26) == 3) {
265 /* sync or twi */
266 unsigned int rb;
267
268 --nip;
269 rb = (*nip >> 11) & 0x1f;
270 printk(KERN_DEBUG "%s bad port %lx at %p\n",
271 (*nip & 0x100)? "OUT to": "IN from",
272 regs->gpr[rb] - _IO_BASE, nip);
273 regs->msr |= MSR_RI;
274 regs->nip = entry->fixup;
275 return 1;
276 }
277 }
278#endif /* CONFIG_PPC_PMAC */
279 return 0;
280}
281
282#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
283/* On 4xx, the reason for the machine check or program exception
284 is in the ESR. */
285#define get_reason(regs) ((regs)->dsisr)
286#ifndef CONFIG_FSL_BOOKE
287#define get_mc_reason(regs) ((regs)->dsisr)
288#else
289#define get_mc_reason(regs) (mfspr(SPRN_MCSR))
290#endif
291#define REASON_FP ESR_FP
292#define REASON_ILLEGAL (ESR_PIL | ESR_PUO)
293#define REASON_PRIVILEGED ESR_PPR
294#define REASON_TRAP ESR_PTR
295
296/* single-step stuff */
297#define single_stepping(regs) (current->thread.dbcr0 & DBCR0_IC)
298#define clear_single_step(regs) (current->thread.dbcr0 &= ~DBCR0_IC)
299
300#else
301/* On non-4xx, the reason for the machine check or program
302 exception is in the MSR. */
303#define get_reason(regs) ((regs)->msr)
304#define get_mc_reason(regs) ((regs)->msr)
305#define REASON_FP 0x100000
306#define REASON_ILLEGAL 0x80000
307#define REASON_PRIVILEGED 0x40000
308#define REASON_TRAP 0x20000
309
310#define single_stepping(regs) ((regs)->msr & MSR_SE)
311#define clear_single_step(regs) ((regs)->msr &= ~MSR_SE)
312#endif
313
314/*
315 * This is "fall-back" implementation for configurations
316 * which don't provide platform-specific machine check info
317 */
318void __attribute__ ((weak))
319platform_machine_check(struct pt_regs *regs)
320{
321}
322
323void machine_check_exception(struct pt_regs *regs)
324{
325#ifdef CONFIG_PPC64
326 int recover = 0;
327
328 /* See if any machine dependent calls */
329 if (ppc_md.machine_check_exception)
330 recover = ppc_md.machine_check_exception(regs);
331
332 if (recover)
333 return;
334#else
335 unsigned long reason = get_mc_reason(regs);
336
337 if (user_mode(regs)) {
338 regs->msr |= MSR_RI;
339 _exception(SIGBUS, regs, BUS_ADRERR, regs->nip);
340 return;
341 }
342
343#if defined(CONFIG_8xx) && defined(CONFIG_PCI)
344 /* the qspan pci read routines can cause machine checks -- Cort */
345 bad_page_fault(regs, regs->dar, SIGBUS);
346 return;
347#endif
348
349 if (debugger_fault_handler(regs)) {
350 regs->msr |= MSR_RI;
351 return;
352 }
353
354 if (check_io_access(regs))
355 return;
356
357#if defined(CONFIG_4xx) && !defined(CONFIG_440A)
358 if (reason & ESR_IMCP) {
359 printk("Instruction");
360 mtspr(SPRN_ESR, reason & ~ESR_IMCP);
361 } else
362 printk("Data");
363 printk(" machine check in kernel mode.\n");
364#elif defined(CONFIG_440A)
365 printk("Machine check in kernel mode.\n");
366 if (reason & ESR_IMCP){
367 printk("Instruction Synchronous Machine Check exception\n");
368 mtspr(SPRN_ESR, reason & ~ESR_IMCP);
369 }
370 else {
371 u32 mcsr = mfspr(SPRN_MCSR);
372 if (mcsr & MCSR_IB)
373 printk("Instruction Read PLB Error\n");
374 if (mcsr & MCSR_DRB)
375 printk("Data Read PLB Error\n");
376 if (mcsr & MCSR_DWB)
377 printk("Data Write PLB Error\n");
378 if (mcsr & MCSR_TLBP)
379 printk("TLB Parity Error\n");
380 if (mcsr & MCSR_ICP){
381 flush_instruction_cache();
382 printk("I-Cache Parity Error\n");
383 }
384 if (mcsr & MCSR_DCSP)
385 printk("D-Cache Search Parity Error\n");
386 if (mcsr & MCSR_DCFP)
387 printk("D-Cache Flush Parity Error\n");
388 if (mcsr & MCSR_IMPE)
389 printk("Machine Check exception is imprecise\n");
390
391 /* Clear MCSR */
392 mtspr(SPRN_MCSR, mcsr);
393 }
394#elif defined (CONFIG_E500)
395 printk("Machine check in kernel mode.\n");
396 printk("Caused by (from MCSR=%lx): ", reason);
397
398 if (reason & MCSR_MCP)
399 printk("Machine Check Signal\n");
400 if (reason & MCSR_ICPERR)
401 printk("Instruction Cache Parity Error\n");
402 if (reason & MCSR_DCP_PERR)
403 printk("Data Cache Push Parity Error\n");
404 if (reason & MCSR_DCPERR)
405 printk("Data Cache Parity Error\n");
406 if (reason & MCSR_GL_CI)
407 printk("Guarded Load or Cache-Inhibited stwcx.\n");
408 if (reason & MCSR_BUS_IAERR)
409 printk("Bus - Instruction Address Error\n");
410 if (reason & MCSR_BUS_RAERR)
411 printk("Bus - Read Address Error\n");
412 if (reason & MCSR_BUS_WAERR)
413 printk("Bus - Write Address Error\n");
414 if (reason & MCSR_BUS_IBERR)
415 printk("Bus - Instruction Data Error\n");
416 if (reason & MCSR_BUS_RBERR)
417 printk("Bus - Read Data Bus Error\n");
418 if (reason & MCSR_BUS_WBERR)
419 printk("Bus - Read Data Bus Error\n");
420 if (reason & MCSR_BUS_IPERR)
421 printk("Bus - Instruction Parity Error\n");
422 if (reason & MCSR_BUS_RPERR)
423 printk("Bus - Read Parity Error\n");
424#elif defined (CONFIG_E200)
425 printk("Machine check in kernel mode.\n");
426 printk("Caused by (from MCSR=%lx): ", reason);
427
428 if (reason & MCSR_MCP)
429 printk("Machine Check Signal\n");
430 if (reason & MCSR_CP_PERR)
431 printk("Cache Push Parity Error\n");
432 if (reason & MCSR_CPERR)
433 printk("Cache Parity Error\n");
434 if (reason & MCSR_EXCP_ERR)
435 printk("ISI, ITLB, or Bus Error on first instruction fetch for an exception handler\n");
436 if (reason & MCSR_BUS_IRERR)
437 printk("Bus - Read Bus Error on instruction fetch\n");
438 if (reason & MCSR_BUS_DRERR)
439 printk("Bus - Read Bus Error on data load\n");
440 if (reason & MCSR_BUS_WRERR)
441 printk("Bus - Write Bus Error on buffered store or cache line push\n");
442#else /* !CONFIG_4xx && !CONFIG_E500 && !CONFIG_E200 */
443 printk("Machine check in kernel mode.\n");
444 printk("Caused by (from SRR1=%lx): ", reason);
445 switch (reason & 0x601F0000) {
446 case 0x80000:
447 printk("Machine check signal\n");
448 break;
449 case 0: /* for 601 */
450 case 0x40000:
451 case 0x140000: /* 7450 MSS error and TEA */
452 printk("Transfer error ack signal\n");
453 break;
454 case 0x20000:
455 printk("Data parity error signal\n");
456 break;
457 case 0x10000:
458 printk("Address parity error signal\n");
459 break;
460 case 0x20000000:
461 printk("L1 Data Cache error\n");
462 break;
463 case 0x40000000:
464 printk("L1 Instruction Cache error\n");
465 break;
466 case 0x00100000:
467 printk("L2 data cache parity error\n");
468 break;
469 default:
470 printk("Unknown values in msr\n");
471 }
472#endif /* CONFIG_4xx */
473
474 /*
475 * Optional platform-provided routine to print out
476 * additional info, e.g. bus error registers.
477 */
478 platform_machine_check(regs);
479#endif /* CONFIG_PPC64 */
480
481 if (debugger_fault_handler(regs))
482 return;
483 die("Machine check", regs, SIGBUS);
484
485 /* Must die if the interrupt is not recoverable */
486 if (!(regs->msr & MSR_RI))
487 panic("Unrecoverable Machine check");
488}
489
490void SMIException(struct pt_regs *regs)
491{
492 die("System Management Interrupt", regs, SIGABRT);
493}
494
495void unknown_exception(struct pt_regs *regs)
496{
497 printk("Bad trap at PC: %lx, SR: %lx, vector=%lx\n",
498 regs->nip, regs->msr, regs->trap);
499
500 _exception(SIGTRAP, regs, 0, 0);
501}
502
503void instruction_breakpoint_exception(struct pt_regs *regs)
504{
505 if (notify_die(DIE_IABR_MATCH, "iabr_match", regs, 5,
506 5, SIGTRAP) == NOTIFY_STOP)
507 return;
508 if (debugger_iabr_match(regs))
509 return;
510 _exception(SIGTRAP, regs, TRAP_BRKPT, regs->nip);
511}
512
513void RunModeException(struct pt_regs *regs)
514{
515 _exception(SIGTRAP, regs, 0, 0);
516}
517
518void __kprobes single_step_exception(struct pt_regs *regs)
519{
520 regs->msr &= ~(MSR_SE | MSR_BE); /* Turn off 'trace' bits */
521
522 if (notify_die(DIE_SSTEP, "single_step", regs, 5,
523 5, SIGTRAP) == NOTIFY_STOP)
524 return;
525 if (debugger_sstep(regs))
526 return;
527
528 _exception(SIGTRAP, regs, TRAP_TRACE, regs->nip);
529}
530
531/*
532 * After we have successfully emulated an instruction, we have to
533 * check if the instruction was being single-stepped, and if so,
534 * pretend we got a single-step exception. This was pointed out
535 * by Kumar Gala. -- paulus
536 */
537static void emulate_single_step(struct pt_regs *regs)
538{
539 if (single_stepping(regs)) {
540 clear_single_step(regs);
541 _exception(SIGTRAP, regs, TRAP_TRACE, 0);
542 }
543}
544
545static void parse_fpe(struct pt_regs *regs)
546{
547 int code = 0;
548 unsigned long fpscr;
549
550 flush_fp_to_thread(current);
551
552 fpscr = current->thread.fpscr.val;
553
554 /* Invalid operation */
555 if ((fpscr & FPSCR_VE) && (fpscr & FPSCR_VX))
556 code = FPE_FLTINV;
557
558 /* Overflow */
559 else if ((fpscr & FPSCR_OE) && (fpscr & FPSCR_OX))
560 code = FPE_FLTOVF;
561
562 /* Underflow */
563 else if ((fpscr & FPSCR_UE) && (fpscr & FPSCR_UX))
564 code = FPE_FLTUND;
565
566 /* Divide by zero */
567 else if ((fpscr & FPSCR_ZE) && (fpscr & FPSCR_ZX))
568 code = FPE_FLTDIV;
569
570 /* Inexact result */
571 else if ((fpscr & FPSCR_XE) && (fpscr & FPSCR_XX))
572 code = FPE_FLTRES;
573
574 _exception(SIGFPE, regs, code, regs->nip);
575}
576
577/*
578 * Illegal instruction emulation support. Originally written to
579 * provide the PVR to user applications using the mfspr rd, PVR.
580 * Return non-zero if we can't emulate, or -EFAULT if the associated
581 * memory access caused an access fault. Return zero on success.
582 *
583 * There are a couple of ways to do this, either "decode" the instruction
584 * or directly match lots of bits. In this case, matching lots of
585 * bits is faster and easier.
586 *
587 */
588#define INST_MFSPR_PVR 0x7c1f42a6
589#define INST_MFSPR_PVR_MASK 0xfc1fffff
590
591#define INST_DCBA 0x7c0005ec
592#define INST_DCBA_MASK 0x7c0007fe
593
594#define INST_MCRXR 0x7c000400
595#define INST_MCRXR_MASK 0x7c0007fe
596
597#define INST_STRING 0x7c00042a
598#define INST_STRING_MASK 0x7c0007fe
599#define INST_STRING_GEN_MASK 0x7c00067e
600#define INST_LSWI 0x7c0004aa
601#define INST_LSWX 0x7c00042a
602#define INST_STSWI 0x7c0005aa
603#define INST_STSWX 0x7c00052a
604
605static int emulate_string_inst(struct pt_regs *regs, u32 instword)
606{
607 u8 rT = (instword >> 21) & 0x1f;
608 u8 rA = (instword >> 16) & 0x1f;
609 u8 NB_RB = (instword >> 11) & 0x1f;
610 u32 num_bytes;
611 unsigned long EA;
612 int pos = 0;
613
614 /* Early out if we are an invalid form of lswx */
615 if ((instword & INST_STRING_MASK) == INST_LSWX)
616 if ((rT == rA) || (rT == NB_RB))
617 return -EINVAL;
618
619 EA = (rA == 0) ? 0 : regs->gpr[rA];
620
621 switch (instword & INST_STRING_MASK) {
622 case INST_LSWX:
623 case INST_STSWX:
624 EA += NB_RB;
625 num_bytes = regs->xer & 0x7f;
626 break;
627 case INST_LSWI:
628 case INST_STSWI:
629 num_bytes = (NB_RB == 0) ? 32 : NB_RB;
630 break;
631 default:
632 return -EINVAL;
633 }
634
635 while (num_bytes != 0)
636 {
637 u8 val;
638 u32 shift = 8 * (3 - (pos & 0x3));
639
640 switch ((instword & INST_STRING_MASK)) {
641 case INST_LSWX:
642 case INST_LSWI:
643 if (get_user(val, (u8 __user *)EA))
644 return -EFAULT;
645 /* first time updating this reg,
646 * zero it out */
647 if (pos == 0)
648 regs->gpr[rT] = 0;
649 regs->gpr[rT] |= val << shift;
650 break;
651 case INST_STSWI:
652 case INST_STSWX:
653 val = regs->gpr[rT] >> shift;
654 if (put_user(val, (u8 __user *)EA))
655 return -EFAULT;
656 break;
657 }
658 /* move EA to next address */
659 EA += 1;
660 num_bytes--;
661
662 /* manage our position within the register */
663 if (++pos == 4) {
664 pos = 0;
665 if (++rT == 32)
666 rT = 0;
667 }
668 }
669
670 return 0;
671}
672
673static int emulate_instruction(struct pt_regs *regs)
674{
675 u32 instword;
676 u32 rd;
677
678 if (!user_mode(regs))
679 return -EINVAL;
680 CHECK_FULL_REGS(regs);
681
682 if (get_user(instword, (u32 __user *)(regs->nip)))
683 return -EFAULT;
684
685 /* Emulate the mfspr rD, PVR. */
686 if ((instword & INST_MFSPR_PVR_MASK) == INST_MFSPR_PVR) {
687 rd = (instword >> 21) & 0x1f;
688 regs->gpr[rd] = mfspr(SPRN_PVR);
689 return 0;
690 }
691
692 /* Emulating the dcba insn is just a no-op. */
693 if ((instword & INST_DCBA_MASK) == INST_DCBA)
694 return 0;
695
696 /* Emulate the mcrxr insn. */
697 if ((instword & INST_MCRXR_MASK) == INST_MCRXR) {
698 int shift = (instword >> 21) & 0x1c;
699 unsigned long msk = 0xf0000000UL >> shift;
700
701 regs->ccr = (regs->ccr & ~msk) | ((regs->xer >> shift) & msk);
702 regs->xer &= ~0xf0000000UL;
703 return 0;
704 }
705
706 /* Emulate load/store string insn. */
707 if ((instword & INST_STRING_GEN_MASK) == INST_STRING)
708 return emulate_string_inst(regs, instword);
709
710 return -EINVAL;
711}
712
713/*
714 * Look through the list of trap instructions that are used for BUG(),
715 * BUG_ON() and WARN_ON() and see if we hit one. At this point we know
716 * that the exception was caused by a trap instruction of some kind.
717 * Returns 1 if we should continue (i.e. it was a WARN_ON) or 0
718 * otherwise.
719 */
720extern struct bug_entry __start___bug_table[], __stop___bug_table[];
721
722#ifndef CONFIG_MODULES
723#define module_find_bug(x) NULL
724#endif
725
726struct bug_entry *find_bug(unsigned long bugaddr)
727{
728 struct bug_entry *bug;
729
730 for (bug = __start___bug_table; bug < __stop___bug_table; ++bug)
731 if (bugaddr == bug->bug_addr)
732 return bug;
733 return module_find_bug(bugaddr);
734}
735
736static int check_bug_trap(struct pt_regs *regs)
737{
738 struct bug_entry *bug;
739 unsigned long addr;
740
741 if (regs->msr & MSR_PR)
742 return 0; /* not in kernel */
743 addr = regs->nip; /* address of trap instruction */
744 if (addr < PAGE_OFFSET)
745 return 0;
746 bug = find_bug(regs->nip);
747 if (bug == NULL)
748 return 0;
749 if (bug->line & BUG_WARNING_TRAP) {
750 /* this is a WARN_ON rather than BUG/BUG_ON */
751#ifdef CONFIG_XMON
752 xmon_printf(KERN_ERR "Badness in %s at %s:%d\n",
753 bug->function, bug->file,
754 bug->line & ~BUG_WARNING_TRAP);
755#endif /* CONFIG_XMON */
756 printk(KERN_ERR "Badness in %s at %s:%d\n",
757 bug->function, bug->file,
758 bug->line & ~BUG_WARNING_TRAP);
759 dump_stack();
760 return 1;
761 }
762#ifdef CONFIG_XMON
763 xmon_printf(KERN_CRIT "kernel BUG in %s at %s:%d!\n",
764 bug->function, bug->file, bug->line);
765 xmon(regs);
766#endif /* CONFIG_XMON */
767 printk(KERN_CRIT "kernel BUG in %s at %s:%d!\n",
768 bug->function, bug->file, bug->line);
769
770 return 0;
771}
772
773void __kprobes program_check_exception(struct pt_regs *regs)
774{
775 unsigned int reason = get_reason(regs);
776 extern int do_mathemu(struct pt_regs *regs);
777
778#ifdef CONFIG_MATH_EMULATION
779 /* (reason & REASON_ILLEGAL) would be the obvious thing here,
780 * but there seems to be a hardware bug on the 405GP (RevD)
781 * that means ESR is sometimes set incorrectly - either to
782 * ESR_DST (!?) or 0. In the process of chasing this with the
783 * hardware people - not sure if it can happen on any illegal
784 * instruction or only on FP instructions, whether there is a
785 * pattern to occurences etc. -dgibson 31/Mar/2003 */
786 if (!(reason & REASON_TRAP) && do_mathemu(regs) == 0) {
787 emulate_single_step(regs);
788 return;
789 }
790#endif /* CONFIG_MATH_EMULATION */
791
792 if (reason & REASON_FP) {
793 /* IEEE FP exception */
794 parse_fpe(regs);
795 return;
796 }
797 if (reason & REASON_TRAP) {
798 /* trap exception */
799 if (notify_die(DIE_BPT, "breakpoint", regs, 5, 5, SIGTRAP)
800 == NOTIFY_STOP)
801 return;
802 if (debugger_bpt(regs))
803 return;
804 if (check_bug_trap(regs)) {
805 regs->nip += 4;
806 return;
807 }
808 _exception(SIGTRAP, regs, TRAP_BRKPT, regs->nip);
809 return;
810 }
811
812 /* Try to emulate it if we should. */
813 if (reason & (REASON_ILLEGAL | REASON_PRIVILEGED)) {
814 switch (emulate_instruction(regs)) {
815 case 0:
816 regs->nip += 4;
817 emulate_single_step(regs);
818 return;
819 case -EFAULT:
820 _exception(SIGSEGV, regs, SEGV_MAPERR, regs->nip);
821 return;
822 }
823 }
824
825 if (reason & REASON_PRIVILEGED)
826 _exception(SIGILL, regs, ILL_PRVOPC, regs->nip);
827 else
828 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
829}
830
831void alignment_exception(struct pt_regs *regs)
832{
833 int fixed;
834
835 fixed = fix_alignment(regs);
836
837 if (fixed == 1) {
838 regs->nip += 4; /* skip over emulated instruction */
839 emulate_single_step(regs);
840 return;
841 }
842
843 /* Operand address was bad */
844 if (fixed == -EFAULT) {
845 if (user_mode(regs))
846 _exception(SIGSEGV, regs, SEGV_ACCERR, regs->dar);
847 else
848 /* Search exception table */
849 bad_page_fault(regs, regs->dar, SIGSEGV);
850 return;
851 }
852 _exception(SIGBUS, regs, BUS_ADRALN, regs->dar);
853}
854
855void StackOverflow(struct pt_regs *regs)
856{
857 printk(KERN_CRIT "Kernel stack overflow in process %p, r1=%lx\n",
858 current, regs->gpr[1]);
859 debugger(regs);
860 show_regs(regs);
861 panic("kernel stack overflow");
862}
863
864void nonrecoverable_exception(struct pt_regs *regs)
865{
866 printk(KERN_ERR "Non-recoverable exception at PC=%lx MSR=%lx\n",
867 regs->nip, regs->msr);
868 debugger(regs);
869 die("nonrecoverable exception", regs, SIGKILL);
870}
871
872void trace_syscall(struct pt_regs *regs)
873{
874 printk("Task: %p(%d), PC: %08lX/%08lX, Syscall: %3ld, Result: %s%ld %s\n",
875 current, current->pid, regs->nip, regs->link, regs->gpr[0],
876 regs->ccr&0x10000000?"Error=":"", regs->gpr[3], print_tainted());
877}
878
879void kernel_fp_unavailable_exception(struct pt_regs *regs)
880{
881 printk(KERN_EMERG "Unrecoverable FP Unavailable Exception "
882 "%lx at %lx\n", regs->trap, regs->nip);
883 die("Unrecoverable FP Unavailable Exception", regs, SIGABRT);
884}
885
886void altivec_unavailable_exception(struct pt_regs *regs)
887{
888#if !defined(CONFIG_ALTIVEC)
889 if (user_mode(regs)) {
890 /* A user program has executed an altivec instruction,
891 but this kernel doesn't support altivec. */
892 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
893 return;
894 }
895#endif
896 printk(KERN_EMERG "Unrecoverable VMX/Altivec Unavailable Exception "
897 "%lx at %lx\n", regs->trap, regs->nip);
898 die("Unrecoverable VMX/Altivec Unavailable Exception", regs, SIGABRT);
899}
900
901#ifdef CONFIG_PPC64
902extern perf_irq_t perf_irq;
903#endif
904
905#if defined(CONFIG_PPC64) || defined(CONFIG_E500)
906void performance_monitor_exception(struct pt_regs *regs)
907{
908 perf_irq(regs);
909}
910#endif
911
912#ifdef CONFIG_8xx
913void SoftwareEmulation(struct pt_regs *regs)
914{
915 extern int do_mathemu(struct pt_regs *);
916 extern int Soft_emulate_8xx(struct pt_regs *);
917 int errcode;
918
919 CHECK_FULL_REGS(regs);
920
921 if (!user_mode(regs)) {
922 debugger(regs);
923 die("Kernel Mode Software FPU Emulation", regs, SIGFPE);
924 }
925
926#ifdef CONFIG_MATH_EMULATION
927 errcode = do_mathemu(regs);
928#else
929 errcode = Soft_emulate_8xx(regs);
930#endif
931 if (errcode) {
932 if (errcode > 0)
933 _exception(SIGFPE, regs, 0, 0);
934 else if (errcode == -EFAULT)
935 _exception(SIGSEGV, regs, 0, 0);
936 else
937 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
938 } else
939 emulate_single_step(regs);
940}
941#endif /* CONFIG_8xx */
942
943#if defined(CONFIG_40x) || defined(CONFIG_BOOKE)
944
945void DebugException(struct pt_regs *regs, unsigned long debug_status)
946{
947 if (debug_status & DBSR_IC) { /* instruction completion */
948 regs->msr &= ~MSR_DE;
949 if (user_mode(regs)) {
950 current->thread.dbcr0 &= ~DBCR0_IC;
951 } else {
952 /* Disable instruction completion */
953 mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) & ~DBCR0_IC);
954 /* Clear the instruction completion event */
955 mtspr(SPRN_DBSR, DBSR_IC);
956 if (debugger_sstep(regs))
957 return;
958 }
959 _exception(SIGTRAP, regs, TRAP_TRACE, 0);
960 }
961}
962#endif /* CONFIG_4xx || CONFIG_BOOKE */
963
964#if !defined(CONFIG_TAU_INT)
965void TAUException(struct pt_regs *regs)
966{
967 printk("TAU trap at PC: %lx, MSR: %lx, vector=%lx %s\n",
968 regs->nip, regs->msr, regs->trap, print_tainted());
969}
970#endif /* CONFIG_INT_TAU */
971
972#ifdef CONFIG_ALTIVEC
973void altivec_assist_exception(struct pt_regs *regs)
974{
975 int err;
976
977 if (!user_mode(regs)) {
978 printk(KERN_EMERG "VMX/Altivec assist exception in kernel mode"
979 " at %lx\n", regs->nip);
980 die("Kernel VMX/Altivec assist exception", regs, SIGILL);
981 }
982
983 flush_altivec_to_thread(current);
984
985 err = emulate_altivec(regs);
986 if (err == 0) {
987 regs->nip += 4; /* skip emulated instruction */
988 emulate_single_step(regs);
989 return;
990 }
991
992 if (err == -EFAULT) {
993 /* got an error reading the instruction */
994 _exception(SIGSEGV, regs, SEGV_ACCERR, regs->nip);
995 } else {
996 /* didn't recognize the instruction */
997 /* XXX quick hack for now: set the non-Java bit in the VSCR */
998 if (printk_ratelimit())
999 printk(KERN_ERR "Unrecognized altivec instruction "
1000 "in %s at %lx\n", current->comm, regs->nip);
1001 current->thread.vscr.u[3] |= 0x10000;
1002 }
1003}
1004#endif /* CONFIG_ALTIVEC */
1005
1006#ifdef CONFIG_FSL_BOOKE
1007void CacheLockingException(struct pt_regs *regs, unsigned long address,
1008 unsigned long error_code)
1009{
1010 /* We treat cache locking instructions from the user
1011 * as priv ops, in the future we could try to do
1012 * something smarter
1013 */
1014 if (error_code & (ESR_DLK|ESR_ILK))
1015 _exception(SIGILL, regs, ILL_PRVOPC, regs->nip);
1016 return;
1017}
1018#endif /* CONFIG_FSL_BOOKE */
1019
1020#ifdef CONFIG_SPE
1021void SPEFloatingPointException(struct pt_regs *regs)
1022{
1023 unsigned long spefscr;
1024 int fpexc_mode;
1025 int code = 0;
1026
1027 spefscr = current->thread.spefscr;
1028 fpexc_mode = current->thread.fpexc_mode;
1029
1030 /* Hardware does not neccessarily set sticky
1031 * underflow/overflow/invalid flags */
1032 if ((spefscr & SPEFSCR_FOVF) && (fpexc_mode & PR_FP_EXC_OVF)) {
1033 code = FPE_FLTOVF;
1034 spefscr |= SPEFSCR_FOVFS;
1035 }
1036 else if ((spefscr & SPEFSCR_FUNF) && (fpexc_mode & PR_FP_EXC_UND)) {
1037 code = FPE_FLTUND;
1038 spefscr |= SPEFSCR_FUNFS;
1039 }
1040 else if ((spefscr & SPEFSCR_FDBZ) && (fpexc_mode & PR_FP_EXC_DIV))
1041 code = FPE_FLTDIV;
1042 else if ((spefscr & SPEFSCR_FINV) && (fpexc_mode & PR_FP_EXC_INV)) {
1043 code = FPE_FLTINV;
1044 spefscr |= SPEFSCR_FINVS;
1045 }
1046 else if ((spefscr & (SPEFSCR_FG | SPEFSCR_FX)) && (fpexc_mode & PR_FP_EXC_RES))
1047 code = FPE_FLTRES;
1048
1049 current->thread.spefscr = spefscr;
1050
1051 _exception(SIGFPE, regs, code, regs->nip);
1052 return;
1053}
1054#endif
1055
1056/*
1057 * We enter here if we get an unrecoverable exception, that is, one
1058 * that happened at a point where the RI (recoverable interrupt) bit
1059 * in the MSR is 0. This indicates that SRR0/1 are live, and that
1060 * we therefore lost state by taking this exception.
1061 */
1062void unrecoverable_exception(struct pt_regs *regs)
1063{
1064 printk(KERN_EMERG "Unrecoverable exception %lx at %lx\n",
1065 regs->trap, regs->nip);
1066 die("Unrecoverable exception", regs, SIGABRT);
1067}
1068
1069#ifdef CONFIG_BOOKE_WDT
1070/*
1071 * Default handler for a Watchdog exception,
1072 * spins until a reboot occurs
1073 */
1074void __attribute__ ((weak)) WatchdogHandler(struct pt_regs *regs)
1075{
1076 /* Generic WatchdogHandler, implement your own */
1077 mtspr(SPRN_TCR, mfspr(SPRN_TCR)&(~TCR_WIE));
1078 return;
1079}
1080
1081void WatchdogException(struct pt_regs *regs)
1082{
1083 printk (KERN_EMERG "PowerPC Book-E Watchdog Exception\n");
1084 WatchdogHandler(regs);
1085}
1086#endif
1087
1088/*
1089 * We enter here if we discover during exception entry that we are
1090 * running in supervisor mode with a userspace value in the stack pointer.
1091 */
1092void kernel_bad_stack(struct pt_regs *regs)
1093{
1094 printk(KERN_EMERG "Bad kernel stack pointer %lx at %lx\n",
1095 regs->gpr[1], regs->nip);
1096 die("Bad kernel stack pointer", regs, SIGABRT);
1097}
1098
1099void __init trap_init(void)
1100{
1101}
diff --git a/arch/ppc/kernel/vecemu.c b/arch/powerpc/kernel/vecemu.c
index 604d0947cb20..604d0947cb20 100644
--- a/arch/ppc/kernel/vecemu.c
+++ b/arch/powerpc/kernel/vecemu.c
diff --git a/arch/ppc64/kernel/vector.S b/arch/powerpc/kernel/vector.S
index b79d33e4001e..66b3d03c5fa5 100644
--- a/arch/ppc64/kernel/vector.S
+++ b/arch/powerpc/kernel/vector.S
@@ -1,11 +1,26 @@
1#include <linux/config.h>
1#include <asm/ppc_asm.h> 2#include <asm/ppc_asm.h>
2#include <asm/processor.h> 3#include <asm/reg.h>
3 4
4/* 5/*
5 * The routines below are in assembler so we can closely control the 6 * The routines below are in assembler so we can closely control the
6 * usage of floating-point registers. These routines must be called 7 * usage of floating-point registers. These routines must be called
7 * with preempt disabled. 8 * with preempt disabled.
8 */ 9 */
10#ifdef CONFIG_PPC32
11 .data
12fpzero:
13 .long 0
14fpone:
15 .long 0x3f800000 /* 1.0 in single-precision FP */
16fphalf:
17 .long 0x3f000000 /* 0.5 in single-precision FP */
18
19#define LDCONST(fr, name) \
20 lis r11,name@ha; \
21 lfs fr,name@l(r11)
22#else
23
9 .section ".toc","aw" 24 .section ".toc","aw"
10fpzero: 25fpzero:
11 .tc FD_0_0[TC],0 26 .tc FD_0_0[TC],0
@@ -14,32 +29,42 @@ fpone:
14fphalf: 29fphalf:
15 .tc FD_3fe00000_0[TC],0x3fe0000000000000 /* 0.5 */ 30 .tc FD_3fe00000_0[TC],0x3fe0000000000000 /* 0.5 */
16 31
32#define LDCONST(fr, name) \
33 lfd fr,name@toc(r2)
34#endif
35
17 .text 36 .text
18/* 37/*
19 * Internal routine to enable floating point and set FPSCR to 0. 38 * Internal routine to enable floating point and set FPSCR to 0.
20 * Don't call it from C; it doesn't use the normal calling convention. 39 * Don't call it from C; it doesn't use the normal calling convention.
21 */ 40 */
22fpenable: 41fpenable:
42#ifdef CONFIG_PPC32
43 stwu r1,-64(r1)
44#else
45 stdu r1,-64(r1)
46#endif
23 mfmsr r10 47 mfmsr r10
24 ori r11,r10,MSR_FP 48 ori r11,r10,MSR_FP
25 mtmsr r11 49 mtmsr r11
26 isync 50 isync
27 stfd fr31,-8(r1) 51 stfd fr0,24(r1)
28 stfd fr0,-16(r1) 52 stfd fr1,16(r1)
29 stfd fr1,-24(r1) 53 stfd fr31,8(r1)
54 LDCONST(fr1, fpzero)
30 mffs fr31 55 mffs fr31
31 lfd fr1,fpzero@toc(r2)
32 mtfsf 0xff,fr1 56 mtfsf 0xff,fr1
33 blr 57 blr
34 58
35fpdisable: 59fpdisable:
36 mtlr r12 60 mtlr r12
37 mtfsf 0xff,fr31 61 mtfsf 0xff,fr31
38 lfd fr1,-24(r1) 62 lfd fr31,8(r1)
39 lfd fr0,-16(r1) 63 lfd fr1,16(r1)
40 lfd fr31,-8(r1) 64 lfd fr0,24(r1)
41 mtmsr r10 65 mtmsr r10
42 isync 66 isync
67 addi r1,r1,64
43 blr 68 blr
44 69
45/* 70/*
@@ -82,7 +107,7 @@ _GLOBAL(vsubfp)
82_GLOBAL(vmaddfp) 107_GLOBAL(vmaddfp)
83 mflr r12 108 mflr r12
84 bl fpenable 109 bl fpenable
85 stfd fr2,-32(r1) 110 stfd fr2,32(r1)
86 li r0,4 111 li r0,4
87 mtctr r0 112 mtctr r0
88 li r7,0 113 li r7,0
@@ -93,7 +118,7 @@ _GLOBAL(vmaddfp)
93 stfsx fr0,r3,r7 118 stfsx fr0,r3,r7
94 addi r7,r7,4 119 addi r7,r7,4
95 bdnz 1b 120 bdnz 1b
96 lfd fr2,-32(r1) 121 lfd fr2,32(r1)
97 b fpdisable 122 b fpdisable
98 123
99/* 124/*
@@ -102,7 +127,7 @@ _GLOBAL(vmaddfp)
102_GLOBAL(vnmsubfp) 127_GLOBAL(vnmsubfp)
103 mflr r12 128 mflr r12
104 bl fpenable 129 bl fpenable
105 stfd fr2,-32(r1) 130 stfd fr2,32(r1)
106 li r0,4 131 li r0,4
107 mtctr r0 132 mtctr r0
108 li r7,0 133 li r7,0
@@ -113,7 +138,7 @@ _GLOBAL(vnmsubfp)
113 stfsx fr0,r3,r7 138 stfsx fr0,r3,r7
114 addi r7,r7,4 139 addi r7,r7,4
115 bdnz 1b 140 bdnz 1b
116 lfd fr2,-32(r1) 141 lfd fr2,32(r1)
117 b fpdisable 142 b fpdisable
118 143
119/* 144/*
@@ -124,7 +149,7 @@ _GLOBAL(vrefp)
124 mflr r12 149 mflr r12
125 bl fpenable 150 bl fpenable
126 li r0,4 151 li r0,4
127 lfd fr1,fpone@toc(r2) 152 LDCONST(fr1, fpone)
128 mtctr r0 153 mtctr r0
129 li r6,0 154 li r6,0
1301: lfsx fr0,r4,r6 1551: lfsx fr0,r4,r6
@@ -143,13 +168,13 @@ _GLOBAL(vrefp)
143_GLOBAL(vrsqrtefp) 168_GLOBAL(vrsqrtefp)
144 mflr r12 169 mflr r12
145 bl fpenable 170 bl fpenable
146 stfd fr2,-32(r1) 171 stfd fr2,32(r1)
147 stfd fr3,-40(r1) 172 stfd fr3,40(r1)
148 stfd fr4,-48(r1) 173 stfd fr4,48(r1)
149 stfd fr5,-56(r1) 174 stfd fr5,56(r1)
150 li r0,4 175 li r0,4
151 lfd fr4,fpone@toc(r2) 176 LDCONST(fr4, fpone)
152 lfd fr5,fphalf@toc(r2) 177 LDCONST(fr5, fphalf)
153 mtctr r0 178 mtctr r0
154 li r6,0 179 li r6,0
1551: lfsx fr0,r4,r6 1801: lfsx fr0,r4,r6
@@ -165,8 +190,8 @@ _GLOBAL(vrsqrtefp)
165 stfsx fr1,r3,r6 190 stfsx fr1,r3,r6
166 addi r6,r6,4 191 addi r6,r6,4
167 bdnz 1b 192 bdnz 1b
168 lfd fr5,-56(r1) 193 lfd fr5,56(r1)
169 lfd fr4,-48(r1) 194 lfd fr4,48(r1)
170 lfd fr3,-40(r1) 195 lfd fr3,40(r1)
171 lfd fr2,-32(r1) 196 lfd fr2,32(r1)
172 b fpdisable 197 b fpdisable
diff --git a/arch/ppc64/kernel/vio.c b/arch/powerpc/kernel/vio.c
index 0e555b7a6587..97082a4203ad 100644
--- a/arch/ppc64/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -69,6 +69,16 @@ static int vio_bus_remove(struct device *dev)
69 return 1; 69 return 1;
70} 70}
71 71
72/* convert from struct device to struct vio_dev and pass to driver. */
73static void vio_bus_shutdown(struct device *dev)
74{
75 struct vio_dev *viodev = to_vio_dev(dev);
76 struct vio_driver *viodrv = to_vio_driver(dev->driver);
77
78 if (viodrv->shutdown)
79 viodrv->shutdown(viodev);
80}
81
72/** 82/**
73 * vio_register_driver: - Register a new vio driver 83 * vio_register_driver: - Register a new vio driver
74 * @drv: The vio_driver structure to be registered. 84 * @drv: The vio_driver structure to be registered.
@@ -76,13 +86,13 @@ static int vio_bus_remove(struct device *dev)
76int vio_register_driver(struct vio_driver *viodrv) 86int vio_register_driver(struct vio_driver *viodrv)
77{ 87{
78 printk(KERN_DEBUG "%s: driver %s registering\n", __FUNCTION__, 88 printk(KERN_DEBUG "%s: driver %s registering\n", __FUNCTION__,
79 viodrv->name); 89 viodrv->driver.name);
80 90
81 /* fill in 'struct driver' fields */ 91 /* fill in 'struct driver' fields */
82 viodrv->driver.name = viodrv->name;
83 viodrv->driver.bus = &vio_bus_type; 92 viodrv->driver.bus = &vio_bus_type;
84 viodrv->driver.probe = vio_bus_probe; 93 viodrv->driver.probe = vio_bus_probe;
85 viodrv->driver.remove = vio_bus_remove; 94 viodrv->driver.remove = vio_bus_remove;
95 viodrv->driver.shutdown = vio_bus_shutdown;
86 96
87 return driver_register(&viodrv->driver); 97 return driver_register(&viodrv->driver);
88} 98}
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
new file mode 100644
index 000000000000..d4dfcfbce272
--- /dev/null
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -0,0 +1,279 @@
1#include <linux/config.h>
2#ifdef CONFIG_PPC64
3#include <asm/page.h>
4#else
5#define PAGE_SIZE 4096
6#endif
7#include <asm-generic/vmlinux.lds.h>
8
9#ifdef CONFIG_PPC64
10OUTPUT_ARCH(powerpc:common64)
11jiffies = jiffies_64;
12#else
13OUTPUT_ARCH(powerpc:common)
14jiffies = jiffies_64 + 4;
15#endif
16SECTIONS
17{
18 /* Sections to be discarded. */
19 /DISCARD/ : {
20 *(.exitcall.exit)
21 *(.exit.data)
22 }
23
24
25 /* Read-only sections, merged into text segment: */
26#ifdef CONFIG_PPC32
27 . = + SIZEOF_HEADERS;
28 .interp : { *(.interp) }
29 .hash : { *(.hash) }
30 .dynsym : { *(.dynsym) }
31 .dynstr : { *(.dynstr) }
32 .rel.text : { *(.rel.text) }
33 .rela.text : { *(.rela.text) }
34 .rel.data : { *(.rel.data) }
35 .rela.data : { *(.rela.data) }
36 .rel.rodata : { *(.rel.rodata) }
37 .rela.rodata : { *(.rela.rodata) }
38 .rel.got : { *(.rel.got) }
39 .rela.got : { *(.rela.got) }
40 .rel.ctors : { *(.rel.ctors) }
41 .rela.ctors : { *(.rela.ctors) }
42 .rel.dtors : { *(.rel.dtors) }
43 .rela.dtors : { *(.rela.dtors) }
44 .rel.bss : { *(.rel.bss) }
45 .rela.bss : { *(.rela.bss) }
46 .rel.plt : { *(.rel.plt) }
47 .rela.plt : { *(.rela.plt) }
48/* .init : { *(.init) } =0*/
49 .plt : { *(.plt) }
50#endif
51 .text : {
52 *(.text .text.*)
53 SCHED_TEXT
54 LOCK_TEXT
55 KPROBES_TEXT
56 *(.fixup)
57#ifdef CONFIG_PPC32
58 *(.got1)
59 __got2_start = .;
60 *(.got2)
61 __got2_end = .;
62#else
63 . = ALIGN(PAGE_SIZE);
64 _etext = .;
65#endif
66 }
67#ifdef CONFIG_PPC32
68 _etext = .;
69 PROVIDE (etext = .);
70
71 RODATA
72 .fini : { *(.fini) } =0
73 .ctors : { *(.ctors) }
74 .dtors : { *(.dtors) }
75
76 .fixup : { *(.fixup) }
77#endif
78
79 __ex_table : {
80 __start___ex_table = .;
81 *(__ex_table)
82 __stop___ex_table = .;
83 }
84
85 __bug_table : {
86 __start___bug_table = .;
87 *(__bug_table)
88 __stop___bug_table = .;
89 }
90
91#ifdef CONFIG_PPC64
92 __ftr_fixup : {
93 __start___ftr_fixup = .;
94 *(__ftr_fixup)
95 __stop___ftr_fixup = .;
96 }
97
98 RODATA
99#endif
100
101#ifdef CONFIG_PPC32
102 /* Read-write section, merged into data segment: */
103 . = ALIGN(PAGE_SIZE);
104 _sdata = .;
105 .data :
106 {
107 *(.data)
108 *(.data1)
109 *(.sdata)
110 *(.sdata2)
111 *(.got.plt) *(.got)
112 *(.dynamic)
113 CONSTRUCTORS
114 }
115
116 . = ALIGN(PAGE_SIZE);
117 __nosave_begin = .;
118 .data_nosave : { *(.data.nosave) }
119 . = ALIGN(PAGE_SIZE);
120 __nosave_end = .;
121
122 . = ALIGN(32);
123 .data.cacheline_aligned : { *(.data.cacheline_aligned) }
124
125 _edata = .;
126 PROVIDE (edata = .);
127
128 . = ALIGN(8192);
129 .data.init_task : { *(.data.init_task) }
130#endif
131
132 /* will be freed after init */
133 . = ALIGN(PAGE_SIZE);
134 __init_begin = .;
135 .init.text : {
136 _sinittext = .;
137 *(.init.text)
138 _einittext = .;
139 }
140#ifdef CONFIG_PPC32
141 /* .exit.text is discarded at runtime, not link time,
142 to deal with references from __bug_table */
143 .exit.text : { *(.exit.text) }
144#endif
145 .init.data : {
146 *(.init.data);
147 __vtop_table_begin = .;
148 *(.vtop_fixup);
149 __vtop_table_end = .;
150 __ptov_table_begin = .;
151 *(.ptov_fixup);
152 __ptov_table_end = .;
153 }
154
155 . = ALIGN(16);
156 .init.setup : {
157 __setup_start = .;
158 *(.init.setup)
159 __setup_end = .;
160 }
161
162 .initcall.init : {
163 __initcall_start = .;
164 *(.initcall1.init)
165 *(.initcall2.init)
166 *(.initcall3.init)
167 *(.initcall4.init)
168 *(.initcall5.init)
169 *(.initcall6.init)
170 *(.initcall7.init)
171 __initcall_end = .;
172 }
173
174 .con_initcall.init : {
175 __con_initcall_start = .;
176 *(.con_initcall.init)
177 __con_initcall_end = .;
178 }
179
180 SECURITY_INIT
181
182#ifdef CONFIG_PPC32
183 __start___ftr_fixup = .;
184 __ftr_fixup : { *(__ftr_fixup) }
185 __stop___ftr_fixup = .;
186#else
187 . = ALIGN(PAGE_SIZE);
188 .init.ramfs : {
189 __initramfs_start = .;
190 *(.init.ramfs)
191 __initramfs_end = .;
192 }
193#endif
194
195#ifdef CONFIG_PPC32
196 . = ALIGN(32);
197#endif
198 .data.percpu : {
199 __per_cpu_start = .;
200 *(.data.percpu)
201 __per_cpu_end = .;
202 }
203
204 . = ALIGN(PAGE_SIZE);
205#ifdef CONFIG_PPC64
206 . = ALIGN(16384);
207 __init_end = .;
208 /* freed after init ends here */
209
210 /* Read/write sections */
211 . = ALIGN(PAGE_SIZE);
212 . = ALIGN(16384);
213 _sdata = .;
214 /* The initial task and kernel stack */
215 .data.init_task : {
216 *(.data.init_task)
217 }
218
219 . = ALIGN(PAGE_SIZE);
220 .data.page_aligned : {
221 *(.data.page_aligned)
222 }
223
224 .data.cacheline_aligned : {
225 *(.data.cacheline_aligned)
226 }
227
228 .data : {
229 *(.data .data.rel* .toc1)
230 *(.branch_lt)
231 }
232
233 .opd : {
234 *(.opd)
235 }
236
237 .got : {
238 __toc_start = .;
239 *(.got)
240 *(.toc)
241 . = ALIGN(PAGE_SIZE);
242 _edata = .;
243 }
244
245 . = ALIGN(PAGE_SIZE);
246#else
247 __initramfs_start = .;
248 .init.ramfs : {
249 *(.init.ramfs)
250 }
251 __initramfs_end = .;
252
253 . = ALIGN(4096);
254 __init_end = .;
255
256 . = ALIGN(4096);
257 _sextratext = .;
258 _eextratext = .;
259
260 __bss_start = .;
261#endif
262
263 .bss : {
264 __bss_start = .;
265 *(.sbss) *(.scommon)
266 *(.dynbss)
267 *(.bss)
268 *(COMMON)
269 __bss_stop = .;
270 }
271
272#ifdef CONFIG_PPC64
273 . = ALIGN(PAGE_SIZE);
274#endif
275 _end = . ;
276#ifdef CONFIG_PPC32
277 PROVIDE (end = .);
278#endif
279}
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
new file mode 100644
index 000000000000..e6b2be3bcec1
--- /dev/null
+++ b/arch/powerpc/lib/Makefile
@@ -0,0 +1,19 @@
1#
2# Makefile for ppc-specific library files..
3#
4
5ifeq ($(CONFIG_PPC_MERGE),y)
6obj-y := string.o
7endif
8
9obj-y += strcase.o
10obj-$(CONFIG_PPC32) += div64.o copy_32.o checksum_32.o
11obj-$(CONFIG_PPC64) += checksum_64.o copypage_64.o copyuser_64.o \
12 memcpy_64.o usercopy_64.o mem_64.o
13obj-$(CONFIG_PPC_ISERIES) += e2a.o
14obj-$(CONFIG_XMON) += sstep.o
15
16ifeq ($(CONFIG_PPC64),y)
17obj-$(CONFIG_SMP) += locks.o
18obj-$(CONFIG_DEBUG_KERNEL) += sstep.o
19endif
diff --git a/arch/powerpc/lib/checksum_32.S b/arch/powerpc/lib/checksum_32.S
new file mode 100644
index 000000000000..7874e8a80455
--- /dev/null
+++ b/arch/powerpc/lib/checksum_32.S
@@ -0,0 +1,225 @@
1/*
2 * This file contains assembly-language implementations
3 * of IP-style 1's complement checksum routines.
4 *
5 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
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
10 * 2 of the License, or (at your option) any later version.
11 *
12 * Severely hacked about by Paul Mackerras (paulus@cs.anu.edu.au).
13 */
14
15#include <linux/sys.h>
16#include <asm/processor.h>
17#include <asm/errno.h>
18#include <asm/ppc_asm.h>
19
20 .text
21
22/*
23 * ip_fast_csum(buf, len) -- Optimized for IP header
24 * len is in words and is always >= 5.
25 */
26_GLOBAL(ip_fast_csum)
27 lwz r0,0(r3)
28 lwzu r5,4(r3)
29 addic. r4,r4,-2
30 addc r0,r0,r5
31 mtctr r4
32 blelr-
331: lwzu r4,4(r3)
34 adde r0,r0,r4
35 bdnz 1b
36 addze r0,r0 /* add in final carry */
37 rlwinm r3,r0,16,0,31 /* fold two halves together */
38 add r3,r0,r3
39 not r3,r3
40 srwi r3,r3,16
41 blr
42
43/*
44 * Compute checksum of TCP or UDP pseudo-header:
45 * csum_tcpudp_magic(saddr, daddr, len, proto, sum)
46 */
47_GLOBAL(csum_tcpudp_magic)
48 rlwimi r5,r6,16,0,15 /* put proto in upper half of len */
49 addc r0,r3,r4 /* add 4 32-bit words together */
50 adde r0,r0,r5
51 adde r0,r0,r7
52 addze r0,r0 /* add in final carry */
53 rlwinm r3,r0,16,0,31 /* fold two halves together */
54 add r3,r0,r3
55 not r3,r3
56 srwi r3,r3,16
57 blr
58
59/*
60 * computes the checksum of a memory block at buff, length len,
61 * and adds in "sum" (32-bit)
62 *
63 * csum_partial(buff, len, sum)
64 */
65_GLOBAL(csum_partial)
66 addic r0,r5,0
67 subi r3,r3,4
68 srwi. r6,r4,2
69 beq 3f /* if we're doing < 4 bytes */
70 andi. r5,r3,2 /* Align buffer to longword boundary */
71 beq+ 1f
72 lhz r5,4(r3) /* do 2 bytes to get aligned */
73 addi r3,r3,2
74 subi r4,r4,2
75 addc r0,r0,r5
76 srwi. r6,r4,2 /* # words to do */
77 beq 3f
781: mtctr r6
792: lwzu r5,4(r3) /* the bdnz has zero overhead, so it should */
80 adde r0,r0,r5 /* be unnecessary to unroll this loop */
81 bdnz 2b
82 andi. r4,r4,3
833: cmpwi 0,r4,2
84 blt+ 4f
85 lhz r5,4(r3)
86 addi r3,r3,2
87 subi r4,r4,2
88 adde r0,r0,r5
894: cmpwi 0,r4,1
90 bne+ 5f
91 lbz r5,4(r3)
92 slwi r5,r5,8 /* Upper byte of word */
93 adde r0,r0,r5
945: addze r3,r0 /* add in final carry */
95 blr
96
97/*
98 * Computes the checksum of a memory block at src, length len,
99 * and adds in "sum" (32-bit), while copying the block to dst.
100 * If an access exception occurs on src or dst, it stores -EFAULT
101 * to *src_err or *dst_err respectively, and (for an error on
102 * src) zeroes the rest of dst.
103 *
104 * csum_partial_copy_generic(src, dst, len, sum, src_err, dst_err)
105 */
106_GLOBAL(csum_partial_copy_generic)
107 addic r0,r6,0
108 subi r3,r3,4
109 subi r4,r4,4
110 srwi. r6,r5,2
111 beq 3f /* if we're doing < 4 bytes */
112 andi. r9,r4,2 /* Align dst to longword boundary */
113 beq+ 1f
11481: lhz r6,4(r3) /* do 2 bytes to get aligned */
115 addi r3,r3,2
116 subi r5,r5,2
11791: sth r6,4(r4)
118 addi r4,r4,2
119 addc r0,r0,r6
120 srwi. r6,r5,2 /* # words to do */
121 beq 3f
1221: srwi. r6,r5,4 /* # groups of 4 words to do */
123 beq 10f
124 mtctr r6
12571: lwz r6,4(r3)
12672: lwz r9,8(r3)
12773: lwz r10,12(r3)
12874: lwzu r11,16(r3)
129 adde r0,r0,r6
13075: stw r6,4(r4)
131 adde r0,r0,r9
13276: stw r9,8(r4)
133 adde r0,r0,r10
13477: stw r10,12(r4)
135 adde r0,r0,r11
13678: stwu r11,16(r4)
137 bdnz 71b
13810: rlwinm. r6,r5,30,30,31 /* # words left to do */
139 beq 13f
140 mtctr r6
14182: lwzu r9,4(r3)
14292: stwu r9,4(r4)
143 adde r0,r0,r9
144 bdnz 82b
14513: andi. r5,r5,3
1463: cmpwi 0,r5,2
147 blt+ 4f
14883: lhz r6,4(r3)
149 addi r3,r3,2
150 subi r5,r5,2
15193: sth r6,4(r4)
152 addi r4,r4,2
153 adde r0,r0,r6
1544: cmpwi 0,r5,1
155 bne+ 5f
15684: lbz r6,4(r3)
15794: stb r6,4(r4)
158 slwi r6,r6,8 /* Upper byte of word */
159 adde r0,r0,r6
1605: addze r3,r0 /* add in final carry */
161 blr
162
163/* These shouldn't go in the fixup section, since that would
164 cause the ex_table addresses to get out of order. */
165
166src_error_4:
167 mfctr r6 /* update # bytes remaining from ctr */
168 rlwimi r5,r6,4,0,27
169 b 79f
170src_error_1:
171 li r6,0
172 subi r5,r5,2
17395: sth r6,4(r4)
174 addi r4,r4,2
17579: srwi. r6,r5,2
176 beq 3f
177 mtctr r6
178src_error_2:
179 li r6,0
18096: stwu r6,4(r4)
181 bdnz 96b
1823: andi. r5,r5,3
183 beq src_error
184src_error_3:
185 li r6,0
186 mtctr r5
187 addi r4,r4,3
18897: stbu r6,1(r4)
189 bdnz 97b
190src_error:
191 cmpwi 0,r7,0
192 beq 1f
193 li r6,-EFAULT
194 stw r6,0(r7)
1951: addze r3,r0
196 blr
197
198dst_error:
199 cmpwi 0,r8,0
200 beq 1f
201 li r6,-EFAULT
202 stw r6,0(r8)
2031: addze r3,r0
204 blr
205
206.section __ex_table,"a"
207 .long 81b,src_error_1
208 .long 91b,dst_error
209 .long 71b,src_error_4
210 .long 72b,src_error_4
211 .long 73b,src_error_4
212 .long 74b,src_error_4
213 .long 75b,dst_error
214 .long 76b,dst_error
215 .long 77b,dst_error
216 .long 78b,dst_error
217 .long 82b,src_error_2
218 .long 92b,dst_error
219 .long 83b,src_error_3
220 .long 93b,dst_error
221 .long 84b,src_error_3
222 .long 94b,dst_error
223 .long 95b,dst_error
224 .long 96b,dst_error
225 .long 97b,dst_error
diff --git a/arch/ppc64/lib/checksum.S b/arch/powerpc/lib/checksum_64.S
index ef96c6c58efc..ef96c6c58efc 100644
--- a/arch/ppc64/lib/checksum.S
+++ b/arch/powerpc/lib/checksum_64.S
diff --git a/arch/powerpc/lib/copy_32.S b/arch/powerpc/lib/copy_32.S
new file mode 100644
index 000000000000..bee51414812e
--- /dev/null
+++ b/arch/powerpc/lib/copy_32.S
@@ -0,0 +1,543 @@
1/*
2 * Memory copy functions for 32-bit PowerPC.
3 *
4 * Copyright (C) 1996-2005 Paul Mackerras.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11#include <linux/config.h>
12#include <asm/processor.h>
13#include <asm/cache.h>
14#include <asm/errno.h>
15#include <asm/ppc_asm.h>
16
17#define COPY_16_BYTES \
18 lwz r7,4(r4); \
19 lwz r8,8(r4); \
20 lwz r9,12(r4); \
21 lwzu r10,16(r4); \
22 stw r7,4(r6); \
23 stw r8,8(r6); \
24 stw r9,12(r6); \
25 stwu r10,16(r6)
26
27#define COPY_16_BYTES_WITHEX(n) \
288 ## n ## 0: \
29 lwz r7,4(r4); \
308 ## n ## 1: \
31 lwz r8,8(r4); \
328 ## n ## 2: \
33 lwz r9,12(r4); \
348 ## n ## 3: \
35 lwzu r10,16(r4); \
368 ## n ## 4: \
37 stw r7,4(r6); \
388 ## n ## 5: \
39 stw r8,8(r6); \
408 ## n ## 6: \
41 stw r9,12(r6); \
428 ## n ## 7: \
43 stwu r10,16(r6)
44
45#define COPY_16_BYTES_EXCODE(n) \
469 ## n ## 0: \
47 addi r5,r5,-(16 * n); \
48 b 104f; \
499 ## n ## 1: \
50 addi r5,r5,-(16 * n); \
51 b 105f; \
52.section __ex_table,"a"; \
53 .align 2; \
54 .long 8 ## n ## 0b,9 ## n ## 0b; \
55 .long 8 ## n ## 1b,9 ## n ## 0b; \
56 .long 8 ## n ## 2b,9 ## n ## 0b; \
57 .long 8 ## n ## 3b,9 ## n ## 0b; \
58 .long 8 ## n ## 4b,9 ## n ## 1b; \
59 .long 8 ## n ## 5b,9 ## n ## 1b; \
60 .long 8 ## n ## 6b,9 ## n ## 1b; \
61 .long 8 ## n ## 7b,9 ## n ## 1b; \
62 .text
63
64 .text
65 .stabs "arch/powerpc/lib/",N_SO,0,0,0f
66 .stabs "copy32.S",N_SO,0,0,0f
670:
68
69CACHELINE_BYTES = L1_CACHE_BYTES
70LG_CACHELINE_BYTES = L1_CACHE_SHIFT
71CACHELINE_MASK = (L1_CACHE_BYTES-1)
72
73/*
74 * Use dcbz on the complete cache lines in the destination
75 * to set them to zero. This requires that the destination
76 * area is cacheable. -- paulus
77 */
78_GLOBAL(cacheable_memzero)
79 mr r5,r4
80 li r4,0
81 addi r6,r3,-4
82 cmplwi 0,r5,4
83 blt 7f
84 stwu r4,4(r6)
85 beqlr
86 andi. r0,r6,3
87 add r5,r0,r5
88 subf r6,r0,r6
89 clrlwi r7,r6,32-LG_CACHELINE_BYTES
90 add r8,r7,r5
91 srwi r9,r8,LG_CACHELINE_BYTES
92 addic. r9,r9,-1 /* total number of complete cachelines */
93 ble 2f
94 xori r0,r7,CACHELINE_MASK & ~3
95 srwi. r0,r0,2
96 beq 3f
97 mtctr r0
984: stwu r4,4(r6)
99 bdnz 4b
1003: mtctr r9
101 li r7,4
102#if !defined(CONFIG_8xx)
10310: dcbz r7,r6
104#else
10510: stw r4, 4(r6)
106 stw r4, 8(r6)
107 stw r4, 12(r6)
108 stw r4, 16(r6)
109#if CACHE_LINE_SIZE >= 32
110 stw r4, 20(r6)
111 stw r4, 24(r6)
112 stw r4, 28(r6)
113 stw r4, 32(r6)
114#endif /* CACHE_LINE_SIZE */
115#endif
116 addi r6,r6,CACHELINE_BYTES
117 bdnz 10b
118 clrlwi r5,r8,32-LG_CACHELINE_BYTES
119 addi r5,r5,4
1202: srwi r0,r5,2
121 mtctr r0
122 bdz 6f
1231: stwu r4,4(r6)
124 bdnz 1b
1256: andi. r5,r5,3
1267: cmpwi 0,r5,0
127 beqlr
128 mtctr r5
129 addi r6,r6,3
1308: stbu r4,1(r6)
131 bdnz 8b
132 blr
133
134_GLOBAL(memset)
135 rlwimi r4,r4,8,16,23
136 rlwimi r4,r4,16,0,15
137 addi r6,r3,-4
138 cmplwi 0,r5,4
139 blt 7f
140 stwu r4,4(r6)
141 beqlr
142 andi. r0,r6,3
143 add r5,r0,r5
144 subf r6,r0,r6
145 srwi r0,r5,2
146 mtctr r0
147 bdz 6f
1481: stwu r4,4(r6)
149 bdnz 1b
1506: andi. r5,r5,3
1517: cmpwi 0,r5,0
152 beqlr
153 mtctr r5
154 addi r6,r6,3
1558: stbu r4,1(r6)
156 bdnz 8b
157 blr
158
159/*
160 * This version uses dcbz on the complete cache lines in the
161 * destination area to reduce memory traffic. This requires that
162 * the destination area is cacheable.
163 * We only use this version if the source and dest don't overlap.
164 * -- paulus.
165 */
166_GLOBAL(cacheable_memcpy)
167 add r7,r3,r5 /* test if the src & dst overlap */
168 add r8,r4,r5
169 cmplw 0,r4,r7
170 cmplw 1,r3,r8
171 crand 0,0,4 /* cr0.lt &= cr1.lt */
172 blt memcpy /* if regions overlap */
173
174 addi r4,r4,-4
175 addi r6,r3,-4
176 neg r0,r3
177 andi. r0,r0,CACHELINE_MASK /* # bytes to start of cache line */
178 beq 58f
179
180 cmplw 0,r5,r0 /* is this more than total to do? */
181 blt 63f /* if not much to do */
182 andi. r8,r0,3 /* get it word-aligned first */
183 subf r5,r0,r5
184 mtctr r8
185 beq+ 61f
18670: lbz r9,4(r4) /* do some bytes */
187 stb r9,4(r6)
188 addi r4,r4,1
189 addi r6,r6,1
190 bdnz 70b
19161: srwi. r0,r0,2
192 mtctr r0
193 beq 58f
19472: lwzu r9,4(r4) /* do some words */
195 stwu r9,4(r6)
196 bdnz 72b
197
19858: srwi. r0,r5,LG_CACHELINE_BYTES /* # complete cachelines */
199 clrlwi r5,r5,32-LG_CACHELINE_BYTES
200 li r11,4
201 mtctr r0
202 beq 63f
20353:
204#if !defined(CONFIG_8xx)
205 dcbz r11,r6
206#endif
207 COPY_16_BYTES
208#if L1_CACHE_BYTES >= 32
209 COPY_16_BYTES
210#if L1_CACHE_BYTES >= 64
211 COPY_16_BYTES
212 COPY_16_BYTES
213#if L1_CACHE_BYTES >= 128
214 COPY_16_BYTES
215 COPY_16_BYTES
216 COPY_16_BYTES
217 COPY_16_BYTES
218#endif
219#endif
220#endif
221 bdnz 53b
222
22363: srwi. r0,r5,2
224 mtctr r0
225 beq 64f
22630: lwzu r0,4(r4)
227 stwu r0,4(r6)
228 bdnz 30b
229
23064: andi. r0,r5,3
231 mtctr r0
232 beq+ 65f
23340: lbz r0,4(r4)
234 stb r0,4(r6)
235 addi r4,r4,1
236 addi r6,r6,1
237 bdnz 40b
23865: blr
239
240_GLOBAL(memmove)
241 cmplw 0,r3,r4
242 bgt backwards_memcpy
243 /* fall through */
244
245_GLOBAL(memcpy)
246 srwi. r7,r5,3
247 addi r6,r3,-4
248 addi r4,r4,-4
249 beq 2f /* if less than 8 bytes to do */
250 andi. r0,r6,3 /* get dest word aligned */
251 mtctr r7
252 bne 5f
2531: lwz r7,4(r4)
254 lwzu r8,8(r4)
255 stw r7,4(r6)
256 stwu r8,8(r6)
257 bdnz 1b
258 andi. r5,r5,7
2592: cmplwi 0,r5,4
260 blt 3f
261 lwzu r0,4(r4)
262 addi r5,r5,-4
263 stwu r0,4(r6)
2643: cmpwi 0,r5,0
265 beqlr
266 mtctr r5
267 addi r4,r4,3
268 addi r6,r6,3
2694: lbzu r0,1(r4)
270 stbu r0,1(r6)
271 bdnz 4b
272 blr
2735: subfic r0,r0,4
274 mtctr r0
2756: lbz r7,4(r4)
276 addi r4,r4,1
277 stb r7,4(r6)
278 addi r6,r6,1
279 bdnz 6b
280 subf r5,r0,r5
281 rlwinm. r7,r5,32-3,3,31
282 beq 2b
283 mtctr r7
284 b 1b
285
286_GLOBAL(backwards_memcpy)
287 rlwinm. r7,r5,32-3,3,31 /* r0 = r5 >> 3 */
288 add r6,r3,r5
289 add r4,r4,r5
290 beq 2f
291 andi. r0,r6,3
292 mtctr r7
293 bne 5f
2941: lwz r7,-4(r4)
295 lwzu r8,-8(r4)
296 stw r7,-4(r6)
297 stwu r8,-8(r6)
298 bdnz 1b
299 andi. r5,r5,7
3002: cmplwi 0,r5,4
301 blt 3f
302 lwzu r0,-4(r4)
303 subi r5,r5,4
304 stwu r0,-4(r6)
3053: cmpwi 0,r5,0
306 beqlr
307 mtctr r5
3084: lbzu r0,-1(r4)
309 stbu r0,-1(r6)
310 bdnz 4b
311 blr
3125: mtctr r0
3136: lbzu r7,-1(r4)
314 stbu r7,-1(r6)
315 bdnz 6b
316 subf r5,r0,r5
317 rlwinm. r7,r5,32-3,3,31
318 beq 2b
319 mtctr r7
320 b 1b
321
322_GLOBAL(__copy_tofrom_user)
323 addi r4,r4,-4
324 addi r6,r3,-4
325 neg r0,r3
326 andi. r0,r0,CACHELINE_MASK /* # bytes to start of cache line */
327 beq 58f
328
329 cmplw 0,r5,r0 /* is this more than total to do? */
330 blt 63f /* if not much to do */
331 andi. r8,r0,3 /* get it word-aligned first */
332 mtctr r8
333 beq+ 61f
33470: lbz r9,4(r4) /* do some bytes */
33571: stb r9,4(r6)
336 addi r4,r4,1
337 addi r6,r6,1
338 bdnz 70b
33961: subf r5,r0,r5
340 srwi. r0,r0,2
341 mtctr r0
342 beq 58f
34372: lwzu r9,4(r4) /* do some words */
34473: stwu r9,4(r6)
345 bdnz 72b
346
347 .section __ex_table,"a"
348 .align 2
349 .long 70b,100f
350 .long 71b,101f
351 .long 72b,102f
352 .long 73b,103f
353 .text
354
35558: srwi. r0,r5,LG_CACHELINE_BYTES /* # complete cachelines */
356 clrlwi r5,r5,32-LG_CACHELINE_BYTES
357 li r11,4
358 beq 63f
359
360#ifdef CONFIG_8xx
361 /* Don't use prefetch on 8xx */
362 mtctr r0
363 li r0,0
36453: COPY_16_BYTES_WITHEX(0)
365 bdnz 53b
366
367#else /* not CONFIG_8xx */
368 /* Here we decide how far ahead to prefetch the source */
369 li r3,4
370 cmpwi r0,1
371 li r7,0
372 ble 114f
373 li r7,1
374#if MAX_COPY_PREFETCH > 1
375 /* Heuristically, for large transfers we prefetch
376 MAX_COPY_PREFETCH cachelines ahead. For small transfers
377 we prefetch 1 cacheline ahead. */
378 cmpwi r0,MAX_COPY_PREFETCH
379 ble 112f
380 li r7,MAX_COPY_PREFETCH
381112: mtctr r7
382111: dcbt r3,r4
383 addi r3,r3,CACHELINE_BYTES
384 bdnz 111b
385#else
386 dcbt r3,r4
387 addi r3,r3,CACHELINE_BYTES
388#endif /* MAX_COPY_PREFETCH > 1 */
389
390114: subf r8,r7,r0
391 mr r0,r7
392 mtctr r8
393
39453: dcbt r3,r4
39554: dcbz r11,r6
396 .section __ex_table,"a"
397 .align 2
398 .long 54b,105f
399 .text
400/* the main body of the cacheline loop */
401 COPY_16_BYTES_WITHEX(0)
402#if L1_CACHE_BYTES >= 32
403 COPY_16_BYTES_WITHEX(1)
404#if L1_CACHE_BYTES >= 64
405 COPY_16_BYTES_WITHEX(2)
406 COPY_16_BYTES_WITHEX(3)
407#if L1_CACHE_BYTES >= 128
408 COPY_16_BYTES_WITHEX(4)
409 COPY_16_BYTES_WITHEX(5)
410 COPY_16_BYTES_WITHEX(6)
411 COPY_16_BYTES_WITHEX(7)
412#endif
413#endif
414#endif
415 bdnz 53b
416 cmpwi r0,0
417 li r3,4
418 li r7,0
419 bne 114b
420#endif /* CONFIG_8xx */
421
42263: srwi. r0,r5,2
423 mtctr r0
424 beq 64f
42530: lwzu r0,4(r4)
42631: stwu r0,4(r6)
427 bdnz 30b
428
42964: andi. r0,r5,3
430 mtctr r0
431 beq+ 65f
43240: lbz r0,4(r4)
43341: stb r0,4(r6)
434 addi r4,r4,1
435 addi r6,r6,1
436 bdnz 40b
43765: li r3,0
438 blr
439
440/* read fault, initial single-byte copy */
441100: li r9,0
442 b 90f
443/* write fault, initial single-byte copy */
444101: li r9,1
44590: subf r5,r8,r5
446 li r3,0
447 b 99f
448/* read fault, initial word copy */
449102: li r9,0
450 b 91f
451/* write fault, initial word copy */
452103: li r9,1
45391: li r3,2
454 b 99f
455
456/*
457 * this stuff handles faults in the cacheline loop and branches to either
458 * 104f (if in read part) or 105f (if in write part), after updating r5
459 */
460 COPY_16_BYTES_EXCODE(0)
461#if L1_CACHE_BYTES >= 32
462 COPY_16_BYTES_EXCODE(1)
463#if L1_CACHE_BYTES >= 64
464 COPY_16_BYTES_EXCODE(2)
465 COPY_16_BYTES_EXCODE(3)
466#if L1_CACHE_BYTES >= 128
467 COPY_16_BYTES_EXCODE(4)
468 COPY_16_BYTES_EXCODE(5)
469 COPY_16_BYTES_EXCODE(6)
470 COPY_16_BYTES_EXCODE(7)
471#endif
472#endif
473#endif
474
475/* read fault in cacheline loop */
476104: li r9,0
477 b 92f
478/* fault on dcbz (effectively a write fault) */
479/* or write fault in cacheline loop */
480105: li r9,1
48192: li r3,LG_CACHELINE_BYTES
482 mfctr r8
483 add r0,r0,r8
484 b 106f
485/* read fault in final word loop */
486108: li r9,0
487 b 93f
488/* write fault in final word loop */
489109: li r9,1
49093: andi. r5,r5,3
491 li r3,2
492 b 99f
493/* read fault in final byte loop */
494110: li r9,0
495 b 94f
496/* write fault in final byte loop */
497111: li r9,1
49894: li r5,0
499 li r3,0
500/*
501 * At this stage the number of bytes not copied is
502 * r5 + (ctr << r3), and r9 is 0 for read or 1 for write.
503 */
50499: mfctr r0
505106: slw r3,r0,r3
506 add. r3,r3,r5
507 beq 120f /* shouldn't happen */
508 cmpwi 0,r9,0
509 bne 120f
510/* for a read fault, first try to continue the copy one byte at a time */
511 mtctr r3
512130: lbz r0,4(r4)
513131: stb r0,4(r6)
514 addi r4,r4,1
515 addi r6,r6,1
516 bdnz 130b
517/* then clear out the destination: r3 bytes starting at 4(r6) */
518132: mfctr r3
519 srwi. r0,r3,2
520 li r9,0
521 mtctr r0
522 beq 113f
523112: stwu r9,4(r6)
524 bdnz 112b
525113: andi. r0,r3,3
526 mtctr r0
527 beq 120f
528114: stb r9,4(r6)
529 addi r6,r6,1
530 bdnz 114b
531120: blr
532
533 .section __ex_table,"a"
534 .align 2
535 .long 30b,108b
536 .long 31b,109b
537 .long 40b,110b
538 .long 41b,111b
539 .long 130b,132b
540 .long 131b,120b
541 .long 112b,120b
542 .long 114b,120b
543 .text
diff --git a/arch/ppc64/lib/copypage.S b/arch/powerpc/lib/copypage_64.S
index 733d61618bbf..733d61618bbf 100644
--- a/arch/ppc64/lib/copypage.S
+++ b/arch/powerpc/lib/copypage_64.S
diff --git a/arch/ppc64/lib/copyuser.S b/arch/powerpc/lib/copyuser_64.S
index a0b3fbbd6fb1..a0b3fbbd6fb1 100644
--- a/arch/ppc64/lib/copyuser.S
+++ b/arch/powerpc/lib/copyuser_64.S
diff --git a/arch/powerpc/lib/div64.S b/arch/powerpc/lib/div64.S
new file mode 100644
index 000000000000..83d9832fd919
--- /dev/null
+++ b/arch/powerpc/lib/div64.S
@@ -0,0 +1,59 @@
1/*
2 * Divide a 64-bit unsigned number by a 32-bit unsigned number.
3 * This routine assumes that the top 32 bits of the dividend are
4 * non-zero to start with.
5 * On entry, r3 points to the dividend, which get overwritten with
6 * the 64-bit quotient, and r4 contains the divisor.
7 * On exit, r3 contains the remainder.
8 *
9 * Copyright (C) 2002 Paul Mackerras, IBM Corp.
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 <asm/ppc_asm.h>
17#include <asm/processor.h>
18
19_GLOBAL(__div64_32)
20 lwz r5,0(r3) # get the dividend into r5/r6
21 lwz r6,4(r3)
22 cmplw r5,r4
23 li r7,0
24 li r8,0
25 blt 1f
26 divwu r7,r5,r4 # if dividend.hi >= divisor,
27 mullw r0,r7,r4 # quotient.hi = dividend.hi / divisor
28 subf. r5,r0,r5 # dividend.hi %= divisor
29 beq 3f
301: mr r11,r5 # here dividend.hi != 0
31 andis. r0,r5,0xc000
32 bne 2f
33 cntlzw r0,r5 # we are shifting the dividend right
34 li r10,-1 # to make it < 2^32, and shifting
35 srw r10,r10,r0 # the divisor right the same amount,
36 addc r9,r4,r10 # rounding up (so the estimate cannot
37 andc r11,r6,r10 # ever be too large, only too small)
38 andc r9,r9,r10
39 addze r9,r9
40 or r11,r5,r11
41 rotlw r9,r9,r0
42 rotlw r11,r11,r0
43 divwu r11,r11,r9 # then we divide the shifted quantities
442: mullw r10,r11,r4 # to get an estimate of the quotient,
45 mulhwu r9,r11,r4 # multiply the estimate by the divisor,
46 subfc r6,r10,r6 # take the product from the divisor,
47 add r8,r8,r11 # and add the estimate to the accumulated
48 subfe. r5,r9,r5 # quotient
49 bne 1b
503: cmplw r6,r4
51 blt 4f
52 divwu r0,r6,r4 # perform the remaining 32-bit division
53 mullw r10,r0,r4 # and get the remainder
54 add r8,r8,r0
55 subf r6,r10,r6
564: stw r7,0(r3) # return the quotient in *r3
57 stw r8,4(r3)
58 mr r3,r6 # return the remainder in r3
59 blr
diff --git a/arch/ppc64/lib/e2a.c b/arch/powerpc/lib/e2a.c
index d2b834887920..d2b834887920 100644
--- a/arch/ppc64/lib/e2a.c
+++ b/arch/powerpc/lib/e2a.c
diff --git a/arch/ppc64/lib/locks.c b/arch/powerpc/lib/locks.c
index 033643ab69e0..3794715b2972 100644
--- a/arch/ppc64/lib/locks.c
+++ b/arch/powerpc/lib/locks.c
@@ -17,11 +17,12 @@
17#include <linux/spinlock.h> 17#include <linux/spinlock.h>
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/stringify.h> 19#include <linux/stringify.h>
20#include <asm/hvcall.h> 20#include <linux/smp.h>
21#include <asm/iSeries/HvCall.h>
22 21
23/* waiting for a spinlock... */ 22/* waiting for a spinlock... */
24#if defined(CONFIG_PPC_SPLPAR) || defined(CONFIG_PPC_ISERIES) 23#if defined(CONFIG_PPC_SPLPAR) || defined(CONFIG_PPC_ISERIES)
24#include <asm/hvcall.h>
25#include <asm/iSeries/HvCall.h>
25 26
26void __spin_yield(raw_spinlock_t *lock) 27void __spin_yield(raw_spinlock_t *lock)
27{ 28{
diff --git a/arch/powerpc/lib/mem_64.S b/arch/powerpc/lib/mem_64.S
new file mode 100644
index 000000000000..68df20283ff5
--- /dev/null
+++ b/arch/powerpc/lib/mem_64.S
@@ -0,0 +1,119 @@
1/*
2 * String handling functions for PowerPC.
3 *
4 * Copyright (C) 1996 Paul Mackerras.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11#include <asm/processor.h>
12#include <asm/errno.h>
13#include <asm/ppc_asm.h>
14
15_GLOBAL(memset)
16 neg r0,r3
17 rlwimi r4,r4,8,16,23
18 andi. r0,r0,7 /* # bytes to be 8-byte aligned */
19 rlwimi r4,r4,16,0,15
20 cmplw cr1,r5,r0 /* do we get that far? */
21 rldimi r4,r4,32,0
22 mtcrf 1,r0
23 mr r6,r3
24 blt cr1,8f
25 beq+ 3f /* if already 8-byte aligned */
26 subf r5,r0,r5
27 bf 31,1f
28 stb r4,0(r6)
29 addi r6,r6,1
301: bf 30,2f
31 sth r4,0(r6)
32 addi r6,r6,2
332: bf 29,3f
34 stw r4,0(r6)
35 addi r6,r6,4
363: srdi. r0,r5,6
37 clrldi r5,r5,58
38 mtctr r0
39 beq 5f
404: std r4,0(r6)
41 std r4,8(r6)
42 std r4,16(r6)
43 std r4,24(r6)
44 std r4,32(r6)
45 std r4,40(r6)
46 std r4,48(r6)
47 std r4,56(r6)
48 addi r6,r6,64
49 bdnz 4b
505: srwi. r0,r5,3
51 clrlwi r5,r5,29
52 mtcrf 1,r0
53 beq 8f
54 bf 29,6f
55 std r4,0(r6)
56 std r4,8(r6)
57 std r4,16(r6)
58 std r4,24(r6)
59 addi r6,r6,32
606: bf 30,7f
61 std r4,0(r6)
62 std r4,8(r6)
63 addi r6,r6,16
647: bf 31,8f
65 std r4,0(r6)
66 addi r6,r6,8
678: cmpwi r5,0
68 mtcrf 1,r5
69 beqlr+
70 bf 29,9f
71 stw r4,0(r6)
72 addi r6,r6,4
739: bf 30,10f
74 sth r4,0(r6)
75 addi r6,r6,2
7610: bflr 31
77 stb r4,0(r6)
78 blr
79
80_GLOBAL(memmove)
81 cmplw 0,r3,r4
82 bgt .backwards_memcpy
83 b .memcpy
84
85_GLOBAL(backwards_memcpy)
86 rlwinm. r7,r5,32-3,3,31 /* r0 = r5 >> 3 */
87 add r6,r3,r5
88 add r4,r4,r5
89 beq 2f
90 andi. r0,r6,3
91 mtctr r7
92 bne 5f
931: lwz r7,-4(r4)
94 lwzu r8,-8(r4)
95 stw r7,-4(r6)
96 stwu r8,-8(r6)
97 bdnz 1b
98 andi. r5,r5,7
992: cmplwi 0,r5,4
100 blt 3f
101 lwzu r0,-4(r4)
102 subi r5,r5,4
103 stwu r0,-4(r6)
1043: cmpwi 0,r5,0
105 beqlr
106 mtctr r5
1074: lbzu r0,-1(r4)
108 stbu r0,-1(r6)
109 bdnz 4b
110 blr
1115: mtctr r0
1126: lbzu r7,-1(r4)
113 stbu r7,-1(r6)
114 bdnz 6b
115 subf r5,r0,r5
116 rlwinm. r7,r5,32-3,3,31
117 beq 2b
118 mtctr r7
119 b 1b
diff --git a/arch/ppc64/lib/memcpy.S b/arch/powerpc/lib/memcpy_64.S
index 9ccacdf5bcb9..9ccacdf5bcb9 100644
--- a/arch/ppc64/lib/memcpy.S
+++ b/arch/powerpc/lib/memcpy_64.S
diff --git a/arch/powerpc/lib/rheap.c b/arch/powerpc/lib/rheap.c
new file mode 100644
index 000000000000..42c5de2c898f
--- /dev/null
+++ b/arch/powerpc/lib/rheap.c
@@ -0,0 +1,693 @@
1/*
2 * arch/ppc/syslib/rheap.c
3 *
4 * A Remote Heap. Remote means that we don't touch the memory that the
5 * heap points to. Normal heap implementations use the memory they manage
6 * to place their list. We cannot do that because the memory we manage may
7 * have special properties, for example it is uncachable or of different
8 * endianess.
9 *
10 * Author: Pantelis Antoniou <panto@intracom.gr>
11 *
12 * 2004 (c) INTRACOM S.A. Greece. This file is licensed under
13 * the terms of the GNU General Public License version 2. This program
14 * is licensed "as is" without any warranty of any kind, whether express
15 * or implied.
16 */
17#include <linux/types.h>
18#include <linux/errno.h>
19#include <linux/mm.h>
20#include <linux/slab.h>
21
22#include <asm/rheap.h>
23
24/*
25 * Fixup a list_head, needed when copying lists. If the pointers fall
26 * between s and e, apply the delta. This assumes that
27 * sizeof(struct list_head *) == sizeof(unsigned long *).
28 */
29static inline void fixup(unsigned long s, unsigned long e, int d,
30 struct list_head *l)
31{
32 unsigned long *pp;
33
34 pp = (unsigned long *)&l->next;
35 if (*pp >= s && *pp < e)
36 *pp += d;
37
38 pp = (unsigned long *)&l->prev;
39 if (*pp >= s && *pp < e)
40 *pp += d;
41}
42
43/* Grow the allocated blocks */
44static int grow(rh_info_t * info, int max_blocks)
45{
46 rh_block_t *block, *blk;
47 int i, new_blocks;
48 int delta;
49 unsigned long blks, blke;
50
51 if (max_blocks <= info->max_blocks)
52 return -EINVAL;
53
54 new_blocks = max_blocks - info->max_blocks;
55
56 block = kmalloc(sizeof(rh_block_t) * max_blocks, GFP_KERNEL);
57 if (block == NULL)
58 return -ENOMEM;
59
60 if (info->max_blocks > 0) {
61
62 /* copy old block area */
63 memcpy(block, info->block,
64 sizeof(rh_block_t) * info->max_blocks);
65
66 delta = (char *)block - (char *)info->block;
67
68 /* and fixup list pointers */
69 blks = (unsigned long)info->block;
70 blke = (unsigned long)(info->block + info->max_blocks);
71
72 for (i = 0, blk = block; i < info->max_blocks; i++, blk++)
73 fixup(blks, blke, delta, &blk->list);
74
75 fixup(blks, blke, delta, &info->empty_list);
76 fixup(blks, blke, delta, &info->free_list);
77 fixup(blks, blke, delta, &info->taken_list);
78
79 /* free the old allocated memory */
80 if ((info->flags & RHIF_STATIC_BLOCK) == 0)
81 kfree(info->block);
82 }
83
84 info->block = block;
85 info->empty_slots += new_blocks;
86 info->max_blocks = max_blocks;
87 info->flags &= ~RHIF_STATIC_BLOCK;
88
89 /* add all new blocks to the free list */
90 for (i = 0, blk = block + info->max_blocks; i < new_blocks; i++, blk++)
91 list_add(&blk->list, &info->empty_list);
92
93 return 0;
94}
95
96/*
97 * Assure at least the required amount of empty slots. If this function
98 * causes a grow in the block area then all pointers kept to the block
99 * area are invalid!
100 */
101static int assure_empty(rh_info_t * info, int slots)
102{
103 int max_blocks;
104
105 /* This function is not meant to be used to grow uncontrollably */
106 if (slots >= 4)
107 return -EINVAL;
108
109 /* Enough space */
110 if (info->empty_slots >= slots)
111 return 0;
112
113 /* Next 16 sized block */
114 max_blocks = ((info->max_blocks + slots) + 15) & ~15;
115
116 return grow(info, max_blocks);
117}
118
119static rh_block_t *get_slot(rh_info_t * info)
120{
121 rh_block_t *blk;
122
123 /* If no more free slots, and failure to extend. */
124 /* XXX: You should have called assure_empty before */
125 if (info->empty_slots == 0) {
126 printk(KERN_ERR "rh: out of slots; crash is imminent.\n");
127 return NULL;
128 }
129
130 /* Get empty slot to use */
131 blk = list_entry(info->empty_list.next, rh_block_t, list);
132 list_del_init(&blk->list);
133 info->empty_slots--;
134
135 /* Initialize */
136 blk->start = NULL;
137 blk->size = 0;
138 blk->owner = NULL;
139
140 return blk;
141}
142
143static inline void release_slot(rh_info_t * info, rh_block_t * blk)
144{
145 list_add(&blk->list, &info->empty_list);
146 info->empty_slots++;
147}
148
149static void attach_free_block(rh_info_t * info, rh_block_t * blkn)
150{
151 rh_block_t *blk;
152 rh_block_t *before;
153 rh_block_t *after;
154 rh_block_t *next;
155 int size;
156 unsigned long s, e, bs, be;
157 struct list_head *l;
158
159 /* We assume that they are aligned properly */
160 size = blkn->size;
161 s = (unsigned long)blkn->start;
162 e = s + size;
163
164 /* Find the blocks immediately before and after the given one
165 * (if any) */
166 before = NULL;
167 after = NULL;
168 next = NULL;
169
170 list_for_each(l, &info->free_list) {
171 blk = list_entry(l, rh_block_t, list);
172
173 bs = (unsigned long)blk->start;
174 be = bs + blk->size;
175
176 if (next == NULL && s >= bs)
177 next = blk;
178
179 if (be == s)
180 before = blk;
181
182 if (e == bs)
183 after = blk;
184
185 /* If both are not null, break now */
186 if (before != NULL && after != NULL)
187 break;
188 }
189
190 /* Now check if they are really adjacent */
191 if (before != NULL && s != (unsigned long)before->start + before->size)
192 before = NULL;
193
194 if (after != NULL && e != (unsigned long)after->start)
195 after = NULL;
196
197 /* No coalescing; list insert and return */
198 if (before == NULL && after == NULL) {
199
200 if (next != NULL)
201 list_add(&blkn->list, &next->list);
202 else
203 list_add(&blkn->list, &info->free_list);
204
205 return;
206 }
207
208 /* We don't need it anymore */
209 release_slot(info, blkn);
210
211 /* Grow the before block */
212 if (before != NULL && after == NULL) {
213 before->size += size;
214 return;
215 }
216
217 /* Grow the after block backwards */
218 if (before == NULL && after != NULL) {
219 after->start = (int8_t *)after->start - size;
220 after->size += size;
221 return;
222 }
223
224 /* Grow the before block, and release the after block */
225 before->size += size + after->size;
226 list_del(&after->list);
227 release_slot(info, after);
228}
229
230static void attach_taken_block(rh_info_t * info, rh_block_t * blkn)
231{
232 rh_block_t *blk;
233 struct list_head *l;
234
235 /* Find the block immediately before the given one (if any) */
236 list_for_each(l, &info->taken_list) {
237 blk = list_entry(l, rh_block_t, list);
238 if (blk->start > blkn->start) {
239 list_add_tail(&blkn->list, &blk->list);
240 return;
241 }
242 }
243
244 list_add_tail(&blkn->list, &info->taken_list);
245}
246
247/*
248 * Create a remote heap dynamically. Note that no memory for the blocks
249 * are allocated. It will upon the first allocation
250 */
251rh_info_t *rh_create(unsigned int alignment)
252{
253 rh_info_t *info;
254
255 /* Alignment must be a power of two */
256 if ((alignment & (alignment - 1)) != 0)
257 return ERR_PTR(-EINVAL);
258
259 info = kmalloc(sizeof(*info), GFP_KERNEL);
260 if (info == NULL)
261 return ERR_PTR(-ENOMEM);
262
263 info->alignment = alignment;
264
265 /* Initially everything as empty */
266 info->block = NULL;
267 info->max_blocks = 0;
268 info->empty_slots = 0;
269 info->flags = 0;
270
271 INIT_LIST_HEAD(&info->empty_list);
272 INIT_LIST_HEAD(&info->free_list);
273 INIT_LIST_HEAD(&info->taken_list);
274
275 return info;
276}
277
278/*
279 * Destroy a dynamically created remote heap. Deallocate only if the areas
280 * are not static
281 */
282void rh_destroy(rh_info_t * info)
283{
284 if ((info->flags & RHIF_STATIC_BLOCK) == 0 && info->block != NULL)
285 kfree(info->block);
286
287 if ((info->flags & RHIF_STATIC_INFO) == 0)
288 kfree(info);
289}
290
291/*
292 * Initialize in place a remote heap info block. This is needed to support
293 * operation very early in the startup of the kernel, when it is not yet safe
294 * to call kmalloc.
295 */
296void rh_init(rh_info_t * info, unsigned int alignment, int max_blocks,
297 rh_block_t * block)
298{
299 int i;
300 rh_block_t *blk;
301
302 /* Alignment must be a power of two */
303 if ((alignment & (alignment - 1)) != 0)
304 return;
305
306 info->alignment = alignment;
307
308 /* Initially everything as empty */
309 info->block = block;
310 info->max_blocks = max_blocks;
311 info->empty_slots = max_blocks;
312 info->flags = RHIF_STATIC_INFO | RHIF_STATIC_BLOCK;
313
314 INIT_LIST_HEAD(&info->empty_list);
315 INIT_LIST_HEAD(&info->free_list);
316 INIT_LIST_HEAD(&info->taken_list);
317
318 /* Add all new blocks to the free list */
319 for (i = 0, blk = block; i < max_blocks; i++, blk++)
320 list_add(&blk->list, &info->empty_list);
321}
322
323/* Attach a free memory region, coalesces regions if adjuscent */
324int rh_attach_region(rh_info_t * info, void *start, int size)
325{
326 rh_block_t *blk;
327 unsigned long s, e, m;
328 int r;
329
330 /* The region must be aligned */
331 s = (unsigned long)start;
332 e = s + size;
333 m = info->alignment - 1;
334
335 /* Round start up */
336 s = (s + m) & ~m;
337
338 /* Round end down */
339 e = e & ~m;
340
341 /* Take final values */
342 start = (void *)s;
343 size = (int)(e - s);
344
345 /* Grow the blocks, if needed */
346 r = assure_empty(info, 1);
347 if (r < 0)
348 return r;
349
350 blk = get_slot(info);
351 blk->start = start;
352 blk->size = size;
353 blk->owner = NULL;
354
355 attach_free_block(info, blk);
356
357 return 0;
358}
359
360/* Detatch given address range, splits free block if needed. */
361void *rh_detach_region(rh_info_t * info, void *start, int size)
362{
363 struct list_head *l;
364 rh_block_t *blk, *newblk;
365 unsigned long s, e, m, bs, be;
366
367 /* Validate size */
368 if (size <= 0)
369 return ERR_PTR(-EINVAL);
370
371 /* The region must be aligned */
372 s = (unsigned long)start;
373 e = s + size;
374 m = info->alignment - 1;
375
376 /* Round start up */
377 s = (s + m) & ~m;
378
379 /* Round end down */
380 e = e & ~m;
381
382 if (assure_empty(info, 1) < 0)
383 return ERR_PTR(-ENOMEM);
384
385 blk = NULL;
386 list_for_each(l, &info->free_list) {
387 blk = list_entry(l, rh_block_t, list);
388 /* The range must lie entirely inside one free block */
389 bs = (unsigned long)blk->start;
390 be = (unsigned long)blk->start + blk->size;
391 if (s >= bs && e <= be)
392 break;
393 blk = NULL;
394 }
395
396 if (blk == NULL)
397 return ERR_PTR(-ENOMEM);
398
399 /* Perfect fit */
400 if (bs == s && be == e) {
401 /* Delete from free list, release slot */
402 list_del(&blk->list);
403 release_slot(info, blk);
404 return (void *)s;
405 }
406
407 /* blk still in free list, with updated start and/or size */
408 if (bs == s || be == e) {
409 if (bs == s)
410 blk->start = (int8_t *)blk->start + size;
411 blk->size -= size;
412
413 } else {
414 /* The front free fragment */
415 blk->size = s - bs;
416
417 /* the back free fragment */
418 newblk = get_slot(info);
419 newblk->start = (void *)e;
420 newblk->size = be - e;
421
422 list_add(&newblk->list, &blk->list);
423 }
424
425 return (void *)s;
426}
427
428void *rh_alloc(rh_info_t * info, int size, const char *owner)
429{
430 struct list_head *l;
431 rh_block_t *blk;
432 rh_block_t *newblk;
433 void *start;
434
435 /* Validate size */
436 if (size <= 0)
437 return ERR_PTR(-EINVAL);
438
439 /* Align to configured alignment */
440 size = (size + (info->alignment - 1)) & ~(info->alignment - 1);
441
442 if (assure_empty(info, 1) < 0)
443 return ERR_PTR(-ENOMEM);
444
445 blk = NULL;
446 list_for_each(l, &info->free_list) {
447 blk = list_entry(l, rh_block_t, list);
448 if (size <= blk->size)
449 break;
450 blk = NULL;
451 }
452
453 if (blk == NULL)
454 return ERR_PTR(-ENOMEM);
455
456 /* Just fits */
457 if (blk->size == size) {
458 /* Move from free list to taken list */
459 list_del(&blk->list);
460 blk->owner = owner;
461 start = blk->start;
462
463 attach_taken_block(info, blk);
464
465 return start;
466 }
467
468 newblk = get_slot(info);
469 newblk->start = blk->start;
470 newblk->size = size;
471 newblk->owner = owner;
472
473 /* blk still in free list, with updated start, size */
474 blk->start = (int8_t *)blk->start + size;
475 blk->size -= size;
476
477 start = newblk->start;
478
479 attach_taken_block(info, newblk);
480
481 return start;
482}
483
484/* allocate at precisely the given address */
485void *rh_alloc_fixed(rh_info_t * info, void *start, int size, const char *owner)
486{
487 struct list_head *l;
488 rh_block_t *blk, *newblk1, *newblk2;
489 unsigned long s, e, m, bs, be;
490
491 /* Validate size */
492 if (size <= 0)
493 return ERR_PTR(-EINVAL);
494
495 /* The region must be aligned */
496 s = (unsigned long)start;
497 e = s + size;
498 m = info->alignment - 1;
499
500 /* Round start up */
501 s = (s + m) & ~m;
502
503 /* Round end down */
504 e = e & ~m;
505
506 if (assure_empty(info, 2) < 0)
507 return ERR_PTR(-ENOMEM);
508
509 blk = NULL;
510 list_for_each(l, &info->free_list) {
511 blk = list_entry(l, rh_block_t, list);
512 /* The range must lie entirely inside one free block */
513 bs = (unsigned long)blk->start;
514 be = (unsigned long)blk->start + blk->size;
515 if (s >= bs && e <= be)
516 break;
517 }
518
519 if (blk == NULL)
520 return ERR_PTR(-ENOMEM);
521
522 /* Perfect fit */
523 if (bs == s && be == e) {
524 /* Move from free list to taken list */
525 list_del(&blk->list);
526 blk->owner = owner;
527
528 start = blk->start;
529 attach_taken_block(info, blk);
530
531 return start;
532
533 }
534
535 /* blk still in free list, with updated start and/or size */
536 if (bs == s || be == e) {
537 if (bs == s)
538 blk->start = (int8_t *)blk->start + size;
539 blk->size -= size;
540
541 } else {
542 /* The front free fragment */
543 blk->size = s - bs;
544
545 /* The back free fragment */
546 newblk2 = get_slot(info);
547 newblk2->start = (void *)e;
548 newblk2->size = be - e;
549
550 list_add(&newblk2->list, &blk->list);
551 }
552
553 newblk1 = get_slot(info);
554 newblk1->start = (void *)s;
555 newblk1->size = e - s;
556 newblk1->owner = owner;
557
558 start = newblk1->start;
559 attach_taken_block(info, newblk1);
560
561 return start;
562}
563
564int rh_free(rh_info_t * info, void *start)
565{
566 rh_block_t *blk, *blk2;
567 struct list_head *l;
568 int size;
569
570 /* Linear search for block */
571 blk = NULL;
572 list_for_each(l, &info->taken_list) {
573 blk2 = list_entry(l, rh_block_t, list);
574 if (start < blk2->start)
575 break;
576 blk = blk2;
577 }
578
579 if (blk == NULL || start > (blk->start + blk->size))
580 return -EINVAL;
581
582 /* Remove from taken list */
583 list_del(&blk->list);
584
585 /* Get size of freed block */
586 size = blk->size;
587 attach_free_block(info, blk);
588
589 return size;
590}
591
592int rh_get_stats(rh_info_t * info, int what, int max_stats, rh_stats_t * stats)
593{
594 rh_block_t *blk;
595 struct list_head *l;
596 struct list_head *h;
597 int nr;
598
599 switch (what) {
600
601 case RHGS_FREE:
602 h = &info->free_list;
603 break;
604
605 case RHGS_TAKEN:
606 h = &info->taken_list;
607 break;
608
609 default:
610 return -EINVAL;
611 }
612
613 /* Linear search for block */
614 nr = 0;
615 list_for_each(l, h) {
616 blk = list_entry(l, rh_block_t, list);
617 if (stats != NULL && nr < max_stats) {
618 stats->start = blk->start;
619 stats->size = blk->size;
620 stats->owner = blk->owner;
621 stats++;
622 }
623 nr++;
624 }
625
626 return nr;
627}
628
629int rh_set_owner(rh_info_t * info, void *start, const char *owner)
630{
631 rh_block_t *blk, *blk2;
632 struct list_head *l;
633 int size;
634
635 /* Linear search for block */
636 blk = NULL;
637 list_for_each(l, &info->taken_list) {
638 blk2 = list_entry(l, rh_block_t, list);
639 if (start < blk2->start)
640 break;
641 blk = blk2;
642 }
643
644 if (blk == NULL || start > (blk->start + blk->size))
645 return -EINVAL;
646
647 blk->owner = owner;
648 size = blk->size;
649
650 return size;
651}
652
653void rh_dump(rh_info_t * info)
654{
655 static rh_stats_t st[32]; /* XXX maximum 32 blocks */
656 int maxnr;
657 int i, nr;
658
659 maxnr = sizeof(st) / sizeof(st[0]);
660
661 printk(KERN_INFO
662 "info @0x%p (%d slots empty / %d max)\n",
663 info, info->empty_slots, info->max_blocks);
664
665 printk(KERN_INFO " Free:\n");
666 nr = rh_get_stats(info, RHGS_FREE, maxnr, st);
667 if (nr > maxnr)
668 nr = maxnr;
669 for (i = 0; i < nr; i++)
670 printk(KERN_INFO
671 " 0x%p-0x%p (%u)\n",
672 st[i].start, (int8_t *) st[i].start + st[i].size,
673 st[i].size);
674 printk(KERN_INFO "\n");
675
676 printk(KERN_INFO " Taken:\n");
677 nr = rh_get_stats(info, RHGS_TAKEN, maxnr, st);
678 if (nr > maxnr)
679 nr = maxnr;
680 for (i = 0; i < nr; i++)
681 printk(KERN_INFO
682 " 0x%p-0x%p (%u) %s\n",
683 st[i].start, (int8_t *) st[i].start + st[i].size,
684 st[i].size, st[i].owner != NULL ? st[i].owner : "");
685 printk(KERN_INFO "\n");
686}
687
688void rh_dump_blk(rh_info_t * info, rh_block_t * blk)
689{
690 printk(KERN_INFO
691 "blk @0x%p: 0x%p-0x%p (%u)\n",
692 blk, blk->start, (int8_t *) blk->start + blk->size, blk->size);
693}
diff --git a/arch/ppc64/lib/sstep.c b/arch/powerpc/lib/sstep.c
index e79123d1485c..666c2aa55016 100644
--- a/arch/ppc64/lib/sstep.c
+++ b/arch/powerpc/lib/sstep.c
@@ -10,13 +10,18 @@
10 */ 10 */
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/ptrace.h> 12#include <linux/ptrace.h>
13#include <linux/config.h>
13#include <asm/sstep.h> 14#include <asm/sstep.h>
14#include <asm/processor.h> 15#include <asm/processor.h>
15 16
16extern char system_call_common[]; 17extern char system_call_common[];
17 18
19#ifdef CONFIG_PPC64
18/* Bits in SRR1 that are copied from MSR */ 20/* Bits in SRR1 that are copied from MSR */
19#define MSR_MASK 0xffffffff87c0ffff 21#define MSR_MASK 0xffffffff87c0ffff
22#else
23#define MSR_MASK 0x87c0ffff
24#endif
20 25
21/* 26/*
22 * Determine whether a conditional branch instruction would branch. 27 * Determine whether a conditional branch instruction would branch.
@@ -66,6 +71,7 @@ int emulate_step(struct pt_regs *regs, unsigned int instr)
66 if (branch_taken(instr, regs)) 71 if (branch_taken(instr, regs))
67 regs->nip = imm; 72 regs->nip = imm;
68 return 1; 73 return 1;
74#ifdef CONFIG_PPC64
69 case 17: /* sc */ 75 case 17: /* sc */
70 /* 76 /*
71 * N.B. this uses knowledge about how the syscall 77 * N.B. this uses knowledge about how the syscall
@@ -79,6 +85,7 @@ int emulate_step(struct pt_regs *regs, unsigned int instr)
79 regs->nip = (unsigned long) &system_call_common; 85 regs->nip = (unsigned long) &system_call_common;
80 regs->msr = MSR_KERNEL; 86 regs->msr = MSR_KERNEL;
81 return 1; 87 return 1;
88#endif
82 case 18: /* b */ 89 case 18: /* b */
83 imm = instr & 0x03fffffc; 90 imm = instr & 0x03fffffc;
84 if (imm & 0x02000000) 91 if (imm & 0x02000000)
@@ -121,6 +128,15 @@ int emulate_step(struct pt_regs *regs, unsigned int instr)
121 if ((regs->msr & MSR_SF) == 0) 128 if ((regs->msr & MSR_SF) == 0)
122 regs->nip &= 0xffffffffUL; 129 regs->nip &= 0xffffffffUL;
123 return 1; 130 return 1;
131 case 0x124: /* mtmsr */
132 imm = regs->gpr[rd];
133 if ((imm & MSR_RI) == 0)
134 /* can't step mtmsr that would clear MSR_RI */
135 return -1;
136 regs->msr = imm;
137 regs->nip += 4;
138 return 1;
139#ifdef CONFIG_PPC64
124 case 0x164: /* mtmsrd */ 140 case 0x164: /* mtmsrd */
125 /* only MSR_EE and MSR_RI get changed if bit 15 set */ 141 /* only MSR_EE and MSR_RI get changed if bit 15 set */
126 /* mtmsrd doesn't change MSR_HV and MSR_ME */ 142 /* mtmsrd doesn't change MSR_HV and MSR_ME */
@@ -135,6 +151,7 @@ int emulate_step(struct pt_regs *regs, unsigned int instr)
135 if ((imm & MSR_SF) == 0) 151 if ((imm & MSR_SF) == 0)
136 regs->nip &= 0xffffffffUL; 152 regs->nip &= 0xffffffffUL;
137 return 1; 153 return 1;
154#endif
138 } 155 }
139 } 156 }
140 return 0; 157 return 0;
diff --git a/arch/ppc64/lib/strcase.c b/arch/powerpc/lib/strcase.c
index e84f243368c0..36b521091bbc 100644
--- a/arch/ppc64/lib/strcase.c
+++ b/arch/powerpc/lib/strcase.c
@@ -1,11 +1,3 @@
1/*
2 * c 2001 PPC 64 Team, 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 <linux/ctype.h> 1#include <linux/ctype.h>
10 2
11int strcasecmp(const char *s1, const char *s2) 3int strcasecmp(const char *s1, const char *s2)
diff --git a/arch/powerpc/lib/string.S b/arch/powerpc/lib/string.S
new file mode 100644
index 000000000000..b9ca84ed8927
--- /dev/null
+++ b/arch/powerpc/lib/string.S
@@ -0,0 +1,198 @@
1/*
2 * String handling functions for PowerPC.
3 *
4 * Copyright (C) 1996 Paul Mackerras.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11#include <linux/config.h>
12#include <asm/processor.h>
13#include <asm/errno.h>
14#include <asm/ppc_asm.h>
15
16 .section __ex_table,"a"
17#ifdef CONFIG_PPC64
18 .align 3
19#define EXTBL .llong
20#else
21 .align 2
22#define EXTBL .long
23#endif
24 .text
25
26_GLOBAL(strcpy)
27 addi r5,r3,-1
28 addi r4,r4,-1
291: lbzu r0,1(r4)
30 cmpwi 0,r0,0
31 stbu r0,1(r5)
32 bne 1b
33 blr
34
35/* This clears out any unused part of the destination buffer,
36 just as the libc version does. -- paulus */
37_GLOBAL(strncpy)
38 cmpwi 0,r5,0
39 beqlr
40 mtctr r5
41 addi r6,r3,-1
42 addi r4,r4,-1
431: lbzu r0,1(r4)
44 cmpwi 0,r0,0
45 stbu r0,1(r6)
46 bdnzf 2,1b /* dec ctr, branch if ctr != 0 && !cr0.eq */
47 bnelr /* if we didn't hit a null char, we're done */
48 mfctr r5
49 cmpwi 0,r5,0 /* any space left in destination buffer? */
50 beqlr /* we know r0 == 0 here */
512: stbu r0,1(r6) /* clear it out if so */
52 bdnz 2b
53 blr
54
55_GLOBAL(strcat)
56 addi r5,r3,-1
57 addi r4,r4,-1
581: lbzu r0,1(r5)
59 cmpwi 0,r0,0
60 bne 1b
61 addi r5,r5,-1
621: lbzu r0,1(r4)
63 cmpwi 0,r0,0
64 stbu r0,1(r5)
65 bne 1b
66 blr
67
68_GLOBAL(strcmp)
69 addi r5,r3,-1
70 addi r4,r4,-1
711: lbzu r3,1(r5)
72 cmpwi 1,r3,0
73 lbzu r0,1(r4)
74 subf. r3,r0,r3
75 beqlr 1
76 beq 1b
77 blr
78
79_GLOBAL(strlen)
80 addi r4,r3,-1
811: lbzu r0,1(r4)
82 cmpwi 0,r0,0
83 bne 1b
84 subf r3,r3,r4
85 blr
86
87_GLOBAL(memcmp)
88 cmpwi 0,r5,0
89 ble- 2f
90 mtctr r5
91 addi r6,r3,-1
92 addi r4,r4,-1
931: lbzu r3,1(r6)
94 lbzu r0,1(r4)
95 subf. r3,r0,r3
96 bdnzt 2,1b
97 blr
982: li r3,0
99 blr
100
101_GLOBAL(memchr)
102 cmpwi 0,r5,0
103 ble- 2f
104 mtctr r5
105 addi r3,r3,-1
1061: lbzu r0,1(r3)
107 cmpw 0,r0,r4
108 bdnzf 2,1b
109 beqlr
1102: li r3,0
111 blr
112
113_GLOBAL(__clear_user)
114 addi r6,r3,-4
115 li r3,0
116 li r5,0
117 cmplwi 0,r4,4
118 blt 7f
119 /* clear a single word */
12011: stwu r5,4(r6)
121 beqlr
122 /* clear word sized chunks */
123 andi. r0,r6,3
124 add r4,r0,r4
125 subf r6,r0,r6
126 srwi r0,r4,2
127 andi. r4,r4,3
128 mtctr r0
129 bdz 7f
1301: stwu r5,4(r6)
131 bdnz 1b
132 /* clear byte sized chunks */
1337: cmpwi 0,r4,0
134 beqlr
135 mtctr r4
136 addi r6,r6,3
1378: stbu r5,1(r6)
138 bdnz 8b
139 blr
14090: mr r3,r4
141 blr
14291: mfctr r3
143 slwi r3,r3,2
144 add r3,r3,r4
145 blr
14692: mfctr r3
147 blr
148
149 .section __ex_table,"a"
150 EXTBL 11b,90b
151 EXTBL 1b,91b
152 EXTBL 8b,92b
153 .text
154
155_GLOBAL(__strncpy_from_user)
156 addi r6,r3,-1
157 addi r4,r4,-1
158 cmpwi 0,r5,0
159 beq 2f
160 mtctr r5
1611: lbzu r0,1(r4)
162 cmpwi 0,r0,0
163 stbu r0,1(r6)
164 bdnzf 2,1b /* dec ctr, branch if ctr != 0 && !cr0.eq */
165 beq 3f
1662: addi r6,r6,1
1673: subf r3,r3,r6
168 blr
16999: li r3,-EFAULT
170 blr
171
172 .section __ex_table,"a"
173 EXTBL 1b,99b
174 .text
175
176/* r3 = str, r4 = len (> 0), r5 = top (highest addr) */
177_GLOBAL(__strnlen_user)
178 addi r7,r3,-1
179 subf r6,r7,r5 /* top+1 - str */
180 cmplw 0,r4,r6
181 bge 0f
182 mr r6,r4
1830: mtctr r6 /* ctr = min(len, top - str) */
1841: lbzu r0,1(r7) /* get next byte */
185 cmpwi 0,r0,0
186 bdnzf 2,1b /* loop if --ctr != 0 && byte != 0 */
187 addi r7,r7,1
188 subf r3,r3,r7 /* number of bytes we have looked at */
189 beqlr /* return if we found a 0 byte */
190 cmpw 0,r3,r4 /* did we look at all len bytes? */
191 blt 99f /* if not, must have hit top */
192 addi r3,r4,1 /* return len + 1 to indicate no null found */
193 blr
19499: li r3,0 /* bad address, return 0 */
195 blr
196
197 .section __ex_table,"a"
198 EXTBL 1b,99b
diff --git a/arch/ppc64/lib/usercopy.c b/arch/powerpc/lib/usercopy_64.c
index 5eea6f3c1e03..5eea6f3c1e03 100644
--- a/arch/ppc64/lib/usercopy.c
+++ b/arch/powerpc/lib/usercopy_64.c
diff --git a/arch/powerpc/mm/44x_mmu.c b/arch/powerpc/mm/44x_mmu.c
new file mode 100644
index 000000000000..3d79ce281b67
--- /dev/null
+++ b/arch/powerpc/mm/44x_mmu.c
@@ -0,0 +1,120 @@
1/*
2 * Modifications by Matt Porter (mporter@mvista.com) to support
3 * PPC44x Book E processors.
4 *
5 * This file contains the routines for initializing the MMU
6 * on the 4xx series of chips.
7 * -- paulus
8 *
9 * Derived from arch/ppc/mm/init.c:
10 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
11 *
12 * Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
13 * and Cort Dougan (PReP) (cort@cs.nmt.edu)
14 * Copyright (C) 1996 Paul Mackerras
15 * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk).
16 *
17 * Derived from "arch/i386/mm/init.c"
18 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
19 *
20 * This program is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU General Public License
22 * as published by the Free Software Foundation; either version
23 * 2 of the License, or (at your option) any later version.
24 *
25 */
26
27#include <linux/config.h>
28#include <linux/signal.h>
29#include <linux/sched.h>
30#include <linux/kernel.h>
31#include <linux/errno.h>
32#include <linux/string.h>
33#include <linux/types.h>
34#include <linux/ptrace.h>
35#include <linux/mman.h>
36#include <linux/mm.h>
37#include <linux/swap.h>
38#include <linux/stddef.h>
39#include <linux/vmalloc.h>
40#include <linux/init.h>
41#include <linux/delay.h>
42#include <linux/highmem.h>
43
44#include <asm/pgalloc.h>
45#include <asm/prom.h>
46#include <asm/io.h>
47#include <asm/mmu_context.h>
48#include <asm/pgtable.h>
49#include <asm/mmu.h>
50#include <asm/uaccess.h>
51#include <asm/smp.h>
52#include <asm/bootx.h>
53#include <asm/machdep.h>
54#include <asm/setup.h>
55
56#include "mmu_decl.h"
57
58extern char etext[], _stext[];
59
60/* Used by the 44x TLB replacement exception handler.
61 * Just needed it declared someplace.
62 */
63unsigned int tlb_44x_index = 0;
64unsigned int tlb_44x_hwater = 62;
65
66/*
67 * "Pins" a 256MB TLB entry in AS0 for kernel lowmem
68 */
69static void __init
70ppc44x_pin_tlb(int slot, unsigned int virt, unsigned int phys)
71{
72 unsigned long attrib = 0;
73
74 __asm__ __volatile__("\
75 clrrwi %2,%2,10\n\
76 ori %2,%2,%4\n\
77 clrrwi %1,%1,10\n\
78 li %0,0\n\
79 ori %0,%0,%5\n\
80 tlbwe %2,%3,%6\n\
81 tlbwe %1,%3,%7\n\
82 tlbwe %0,%3,%8"
83 :
84 : "r" (attrib), "r" (phys), "r" (virt), "r" (slot),
85 "i" (PPC44x_TLB_VALID | PPC44x_TLB_256M),
86 "i" (PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_G),
87 "i" (PPC44x_TLB_PAGEID),
88 "i" (PPC44x_TLB_XLAT),
89 "i" (PPC44x_TLB_ATTRIB));
90}
91
92/*
93 * MMU_init_hw does the chip-specific initialization of the MMU hardware.
94 */
95void __init MMU_init_hw(void)
96{
97 flush_instruction_cache();
98}
99
100unsigned long __init mmu_mapin_ram(void)
101{
102 unsigned int pinned_tlbs = 1;
103 int i;
104
105 /* Determine number of entries necessary to cover lowmem */
106 pinned_tlbs = (unsigned int)
107 (_ALIGN(total_lowmem, PPC44x_PIN_SIZE) >> PPC44x_PIN_SHIFT);
108
109 /* Write upper watermark to save location */
110 tlb_44x_hwater = PPC44x_LOW_SLOT - pinned_tlbs;
111
112 /* If necessary, set additional pinned TLBs */
113 if (pinned_tlbs > 1)
114 for (i = (PPC44x_LOW_SLOT-(pinned_tlbs-1)); i < PPC44x_LOW_SLOT; i++) {
115 unsigned int phys_addr = (PPC44x_LOW_SLOT-i) * PPC44x_PIN_SIZE;
116 ppc44x_pin_tlb(i, phys_addr+PAGE_OFFSET, phys_addr);
117 }
118
119 return total_lowmem;
120}
diff --git a/arch/powerpc/mm/4xx_mmu.c b/arch/powerpc/mm/4xx_mmu.c
new file mode 100644
index 000000000000..b7bcbc232f39
--- /dev/null
+++ b/arch/powerpc/mm/4xx_mmu.c
@@ -0,0 +1,141 @@
1/*
2 * This file contains the routines for initializing the MMU
3 * on the 4xx series of chips.
4 * -- paulus
5 *
6 * Derived from arch/ppc/mm/init.c:
7 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
8 *
9 * Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
10 * and Cort Dougan (PReP) (cort@cs.nmt.edu)
11 * Copyright (C) 1996 Paul Mackerras
12 * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk).
13 *
14 * Derived from "arch/i386/mm/init.c"
15 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
16 *
17 * This program is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU General Public License
19 * as published by the Free Software Foundation; either version
20 * 2 of the License, or (at your option) any later version.
21 *
22 */
23
24#include <linux/config.h>
25#include <linux/signal.h>
26#include <linux/sched.h>
27#include <linux/kernel.h>
28#include <linux/errno.h>
29#include <linux/string.h>
30#include <linux/types.h>
31#include <linux/ptrace.h>
32#include <linux/mman.h>
33#include <linux/mm.h>
34#include <linux/swap.h>
35#include <linux/stddef.h>
36#include <linux/vmalloc.h>
37#include <linux/init.h>
38#include <linux/delay.h>
39#include <linux/highmem.h>
40
41#include <asm/pgalloc.h>
42#include <asm/prom.h>
43#include <asm/io.h>
44#include <asm/mmu_context.h>
45#include <asm/pgtable.h>
46#include <asm/mmu.h>
47#include <asm/uaccess.h>
48#include <asm/smp.h>
49#include <asm/bootx.h>
50#include <asm/machdep.h>
51#include <asm/setup.h>
52#include "mmu_decl.h"
53
54extern int __map_without_ltlbs;
55/*
56 * MMU_init_hw does the chip-specific initialization of the MMU hardware.
57 */
58void __init MMU_init_hw(void)
59{
60 /*
61 * The Zone Protection Register (ZPR) defines how protection will
62 * be applied to every page which is a member of a given zone. At
63 * present, we utilize only two of the 4xx's zones.
64 * The zone index bits (of ZSEL) in the PTE are used for software
65 * indicators, except the LSB. For user access, zone 1 is used,
66 * for kernel access, zone 0 is used. We set all but zone 1
67 * to zero, allowing only kernel access as indicated in the PTE.
68 * For zone 1, we set a 01 binary (a value of 10 will not work)
69 * to allow user access as indicated in the PTE. This also allows
70 * kernel access as indicated in the PTE.
71 */
72
73 mtspr(SPRN_ZPR, 0x10000000);
74
75 flush_instruction_cache();
76
77 /*
78 * Set up the real-mode cache parameters for the exception vector
79 * handlers (which are run in real-mode).
80 */
81
82 mtspr(SPRN_DCWR, 0x00000000); /* All caching is write-back */
83
84 /*
85 * Cache instruction and data space where the exception
86 * vectors and the kernel live in real-mode.
87 */
88
89 mtspr(SPRN_DCCR, 0xF0000000); /* 512 MB of data space at 0x0. */
90 mtspr(SPRN_ICCR, 0xF0000000); /* 512 MB of instr. space at 0x0. */
91}
92
93#define LARGE_PAGE_SIZE_16M (1<<24)
94#define LARGE_PAGE_SIZE_4M (1<<22)
95
96unsigned long __init mmu_mapin_ram(void)
97{
98 unsigned long v, s;
99 phys_addr_t p;
100
101 v = KERNELBASE;
102 p = PPC_MEMSTART;
103 s = 0;
104
105 if (__map_without_ltlbs) {
106 return s;
107 }
108
109 while (s <= (total_lowmem - LARGE_PAGE_SIZE_16M)) {
110 pmd_t *pmdp;
111 unsigned long val = p | _PMD_SIZE_16M | _PAGE_HWEXEC | _PAGE_HWWRITE;
112
113 spin_lock(&init_mm.page_table_lock);
114 pmdp = pmd_offset(pgd_offset_k(v), v);
115 pmd_val(*pmdp++) = val;
116 pmd_val(*pmdp++) = val;
117 pmd_val(*pmdp++) = val;
118 pmd_val(*pmdp++) = val;
119 spin_unlock(&init_mm.page_table_lock);
120
121 v += LARGE_PAGE_SIZE_16M;
122 p += LARGE_PAGE_SIZE_16M;
123 s += LARGE_PAGE_SIZE_16M;
124 }
125
126 while (s <= (total_lowmem - LARGE_PAGE_SIZE_4M)) {
127 pmd_t *pmdp;
128 unsigned long val = p | _PMD_SIZE_4M | _PAGE_HWEXEC | _PAGE_HWWRITE;
129
130 spin_lock(&init_mm.page_table_lock);
131 pmdp = pmd_offset(pgd_offset_k(v), v);
132 pmd_val(*pmdp) = val;
133 spin_unlock(&init_mm.page_table_lock);
134
135 v += LARGE_PAGE_SIZE_4M;
136 p += LARGE_PAGE_SIZE_4M;
137 s += LARGE_PAGE_SIZE_4M;
138 }
139
140 return s;
141}
diff --git a/arch/powerpc/mm/Makefile b/arch/powerpc/mm/Makefile
new file mode 100644
index 000000000000..93441e7a2921
--- /dev/null
+++ b/arch/powerpc/mm/Makefile
@@ -0,0 +1,21 @@
1#
2# Makefile for the linux ppc-specific parts of the memory manager.
3#
4
5ifeq ($(CONFIG_PPC64),y)
6EXTRA_CFLAGS += -mno-minimal-toc
7endif
8
9obj-y := fault.o mem.o lmb.o
10obj-$(CONFIG_PPC32) += init_32.o pgtable_32.o mmu_context_32.o
11hash-$(CONFIG_PPC_MULTIPLATFORM) := hash_native_64.o
12obj-$(CONFIG_PPC64) += init_64.o pgtable_64.o mmu_context_64.o \
13 hash_utils_64.o hash_low_64.o tlb_64.o \
14 slb_low.o slb.o stab.o mmap.o imalloc.o \
15 $(hash-y)
16obj-$(CONFIG_PPC_STD_MMU_32) += ppc_mmu_32.o hash_low_32.o tlb_32.o
17obj-$(CONFIG_40x) += 4xx_mmu.o
18obj-$(CONFIG_44x) += 44x_mmu.o
19obj-$(CONFIG_FSL_BOOKE) += fsl_booke_mmu.o
20obj-$(CONFIG_NEED_MULTIPLE_NODES) += numa.o
21obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
diff --git a/arch/ppc64/mm/fault.c b/arch/powerpc/mm/fault.c
index be3f25cf3e9f..841d8b6323a8 100644
--- a/arch/ppc64/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * arch/ppc/mm/fault.c 2 * arch/ppc/mm/fault.c
3 * 3 *
4 * PowerPC version 4 * PowerPC version
5 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) 5 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
6 * 6 *
7 * Derived from "arch/i386/mm/fault.c" 7 * Derived from "arch/i386/mm/fault.c"
@@ -24,10 +24,11 @@
24#include <linux/errno.h> 24#include <linux/errno.h>
25#include <linux/string.h> 25#include <linux/string.h>
26#include <linux/types.h> 26#include <linux/types.h>
27#include <linux/ptrace.h>
27#include <linux/mman.h> 28#include <linux/mman.h>
28#include <linux/mm.h> 29#include <linux/mm.h>
29#include <linux/interrupt.h> 30#include <linux/interrupt.h>
30#include <linux/smp_lock.h> 31#include <linux/highmem.h>
31#include <linux/module.h> 32#include <linux/module.h>
32#include <linux/kprobes.h> 33#include <linux/kprobes.h>
33 34
@@ -37,6 +38,7 @@
37#include <asm/mmu_context.h> 38#include <asm/mmu_context.h>
38#include <asm/system.h> 39#include <asm/system.h>
39#include <asm/uaccess.h> 40#include <asm/uaccess.h>
41#include <asm/tlbflush.h>
40#include <asm/kdebug.h> 42#include <asm/kdebug.h>
41#include <asm/siginfo.h> 43#include <asm/siginfo.h>
42 44
@@ -78,6 +80,7 @@ static int store_updates_sp(struct pt_regs *regs)
78 return 0; 80 return 0;
79} 81}
80 82
83#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE))
81static void do_dabr(struct pt_regs *regs, unsigned long error_code) 84static void do_dabr(struct pt_regs *regs, unsigned long error_code)
82{ 85{
83 siginfo_t info; 86 siginfo_t info;
@@ -99,12 +102,18 @@ static void do_dabr(struct pt_regs *regs, unsigned long error_code)
99 info.si_addr = (void __user *)regs->nip; 102 info.si_addr = (void __user *)regs->nip;
100 force_sig_info(SIGTRAP, &info, current); 103 force_sig_info(SIGTRAP, &info, current);
101} 104}
105#endif /* !(CONFIG_4xx || CONFIG_BOOKE)*/
102 106
103/* 107/*
104 * The error_code parameter is 108 * For 600- and 800-family processors, the error_code parameter is DSISR
109 * for a data fault, SRR1 for an instruction fault. For 400-family processors
110 * the error_code parameter is ESR for a data fault, 0 for an instruction
111 * fault.
112 * For 64-bit processors, the error_code parameter is
105 * - DSISR for a non-SLB data access fault, 113 * - DSISR for a non-SLB data access fault,
106 * - SRR1 & 0x08000000 for a non-SLB instruction access fault 114 * - SRR1 & 0x08000000 for a non-SLB instruction access fault
107 * - 0 any SLB fault. 115 * - 0 any SLB fault.
116 *
108 * The return value is 0 if the fault was handled, or the signal 117 * The return value is 0 if the fault was handled, or the signal
109 * number if this is a kernel fault that can't be handled here. 118 * number if this is a kernel fault that can't be handled here.
110 */ 119 */
@@ -114,12 +123,25 @@ int __kprobes do_page_fault(struct pt_regs *regs, unsigned long address,
114 struct vm_area_struct * vma; 123 struct vm_area_struct * vma;
115 struct mm_struct *mm = current->mm; 124 struct mm_struct *mm = current->mm;
116 siginfo_t info; 125 siginfo_t info;
117 unsigned long code = SEGV_MAPERR; 126 int code = SEGV_MAPERR;
118 unsigned long is_write = error_code & DSISR_ISSTORE; 127 int is_write = 0;
119 unsigned long trap = TRAP(regs); 128 int trap = TRAP(regs);
120 unsigned long is_exec = trap == 0x400; 129 int is_exec = trap == 0x400;
121 130
122 BUG_ON((trap == 0x380) || (trap == 0x480)); 131#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE))
132 /*
133 * Fortunately the bit assignments in SRR1 for an instruction
134 * fault and DSISR for a data fault are mostly the same for the
135 * bits we are interested in. But there are some bits which
136 * indicate errors in DSISR but can validly be set in SRR1.
137 */
138 if (trap == 0x400)
139 error_code &= 0x48200000;
140 else
141 is_write = error_code & DSISR_ISSTORE;
142#else
143 is_write = error_code & ESR_DST;
144#endif /* CONFIG_4xx || CONFIG_BOOKE */
123 145
124 if (notify_die(DIE_PAGE_FAULT, "page_fault", regs, error_code, 146 if (notify_die(DIE_PAGE_FAULT, "page_fault", regs, error_code,
125 11, SIGSEGV) == NOTIFY_STOP) 147 11, SIGSEGV) == NOTIFY_STOP)
@@ -134,10 +156,13 @@ int __kprobes do_page_fault(struct pt_regs *regs, unsigned long address,
134 if (!user_mode(regs) && (address >= TASK_SIZE)) 156 if (!user_mode(regs) && (address >= TASK_SIZE))
135 return SIGSEGV; 157 return SIGSEGV;
136 158
159#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE))
137 if (error_code & DSISR_DABRMATCH) { 160 if (error_code & DSISR_DABRMATCH) {
161 /* DABR match */
138 do_dabr(regs, error_code); 162 do_dabr(regs, error_code);
139 return 0; 163 return 0;
140 } 164 }
165#endif /* !(CONFIG_4xx || CONFIG_BOOKE)*/
141 166
142 if (in_atomic() || mm == NULL) { 167 if (in_atomic() || mm == NULL) {
143 if (!user_mode(regs)) 168 if (!user_mode(regs))
@@ -176,10 +201,8 @@ int __kprobes do_page_fault(struct pt_regs *regs, unsigned long address,
176 vma = find_vma(mm, address); 201 vma = find_vma(mm, address);
177 if (!vma) 202 if (!vma)
178 goto bad_area; 203 goto bad_area;
179 204 if (vma->vm_start <= address)
180 if (vma->vm_start <= address) {
181 goto good_area; 205 goto good_area;
182 }
183 if (!(vma->vm_flags & VM_GROWSDOWN)) 206 if (!(vma->vm_flags & VM_GROWSDOWN))
184 goto bad_area; 207 goto bad_area;
185 208
@@ -214,35 +237,76 @@ int __kprobes do_page_fault(struct pt_regs *regs, unsigned long address,
214 && (!user_mode(regs) || !store_updates_sp(regs))) 237 && (!user_mode(regs) || !store_updates_sp(regs)))
215 goto bad_area; 238 goto bad_area;
216 } 239 }
217
218 if (expand_stack(vma, address)) 240 if (expand_stack(vma, address))
219 goto bad_area; 241 goto bad_area;
220 242
221good_area: 243good_area:
222 code = SEGV_ACCERR; 244 code = SEGV_ACCERR;
245#if defined(CONFIG_6xx)
246 if (error_code & 0x95700000)
247 /* an error such as lwarx to I/O controller space,
248 address matching DABR, eciwx, etc. */
249 goto bad_area;
250#endif /* CONFIG_6xx */
251#if defined(CONFIG_8xx)
252 /* The MPC8xx seems to always set 0x80000000, which is
253 * "undefined". Of those that can be set, this is the only
254 * one which seems bad.
255 */
256 if (error_code & 0x10000000)
257 /* Guarded storage error. */
258 goto bad_area;
259#endif /* CONFIG_8xx */
223 260
224 if (is_exec) { 261 if (is_exec) {
262#ifdef CONFIG_PPC64
225 /* protection fault */ 263 /* protection fault */
226 if (error_code & DSISR_PROTFAULT) 264 if (error_code & DSISR_PROTFAULT)
227 goto bad_area; 265 goto bad_area;
228 if (!(vma->vm_flags & VM_EXEC)) 266 if (!(vma->vm_flags & VM_EXEC))
229 goto bad_area; 267 goto bad_area;
268#endif
269#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
270 pte_t *ptep;
271
272 /* Since 4xx/Book-E supports per-page execute permission,
273 * we lazily flush dcache to icache. */
274 ptep = NULL;
275 if (get_pteptr(mm, address, &ptep) && pte_present(*ptep)) {
276 struct page *page = pte_page(*ptep);
277
278 if (! test_bit(PG_arch_1, &page->flags)) {
279 flush_dcache_icache_page(page);
280 set_bit(PG_arch_1, &page->flags);
281 }
282 pte_update(ptep, 0, _PAGE_HWEXEC);
283 _tlbie(address);
284 pte_unmap(ptep);
285 up_read(&mm->mmap_sem);
286 return 0;
287 }
288 if (ptep != NULL)
289 pte_unmap(ptep);
290#endif
230 /* a write */ 291 /* a write */
231 } else if (is_write) { 292 } else if (is_write) {
232 if (!(vma->vm_flags & VM_WRITE)) 293 if (!(vma->vm_flags & VM_WRITE))
233 goto bad_area; 294 goto bad_area;
234 /* a read */ 295 /* a read */
235 } else { 296 } else {
236 if (!(vma->vm_flags & VM_READ)) 297 /* protection fault */
298 if (error_code & 0x08000000)
299 goto bad_area;
300 if (!(vma->vm_flags & (VM_READ | VM_EXEC)))
237 goto bad_area; 301 goto bad_area;
238 } 302 }
239 303
240 survive:
241 /* 304 /*
242 * If for any reason at all we couldn't handle the fault, 305 * If for any reason at all we couldn't handle the fault,
243 * make sure we exit gracefully rather than endlessly redo 306 * make sure we exit gracefully rather than endlessly redo
244 * the fault. 307 * the fault.
245 */ 308 */
309 survive:
246 switch (handle_mm_fault(mm, vma, address, is_write)) { 310 switch (handle_mm_fault(mm, vma, address, is_write)) {
247 311
248 case VM_FAULT_MINOR: 312 case VM_FAULT_MINOR:
@@ -268,15 +332,11 @@ bad_area:
268bad_area_nosemaphore: 332bad_area_nosemaphore:
269 /* User mode accesses cause a SIGSEGV */ 333 /* User mode accesses cause a SIGSEGV */
270 if (user_mode(regs)) { 334 if (user_mode(regs)) {
271 info.si_signo = SIGSEGV; 335 _exception(SIGSEGV, regs, code, address);
272 info.si_errno = 0;
273 info.si_code = code;
274 info.si_addr = (void __user *) address;
275 force_sig_info(SIGSEGV, &info, current);
276 return 0; 336 return 0;
277 } 337 }
278 338
279 if (trap == 0x400 && (error_code & DSISR_PROTFAULT) 339 if (is_exec && (error_code & DSISR_PROTFAULT)
280 && printk_ratelimit()) 340 && printk_ratelimit())
281 printk(KERN_CRIT "kernel tried to execute NX-protected" 341 printk(KERN_CRIT "kernel tried to execute NX-protected"
282 " page (%lx) - exploit attempt? (uid: %d)\n", 342 " page (%lx) - exploit attempt? (uid: %d)\n",
@@ -315,8 +375,8 @@ do_sigbus:
315 375
316/* 376/*
317 * bad_page_fault is called when we have a bad access from the kernel. 377 * bad_page_fault is called when we have a bad access from the kernel.
318 * It is called from do_page_fault above and from some of the procedures 378 * It is called from the DSI and ISI handlers in head.S and from some
319 * in traps.c. 379 * of the procedures in traps.c.
320 */ 380 */
321void bad_page_fault(struct pt_regs *regs, unsigned long address, int sig) 381void bad_page_fault(struct pt_regs *regs, unsigned long address, int sig)
322{ 382{
diff --git a/arch/powerpc/mm/fsl_booke_mmu.c b/arch/powerpc/mm/fsl_booke_mmu.c
new file mode 100644
index 000000000000..af9ca0eb6d55
--- /dev/null
+++ b/arch/powerpc/mm/fsl_booke_mmu.c
@@ -0,0 +1,237 @@
1/*
2 * Modifications by Kumar Gala (kumar.gala@freescale.com) to support
3 * E500 Book E processors.
4 *
5 * Copyright 2004 Freescale Semiconductor, Inc
6 *
7 * This file contains the routines for initializing the MMU
8 * on the 4xx series of chips.
9 * -- paulus
10 *
11 * Derived from arch/ppc/mm/init.c:
12 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
13 *
14 * Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
15 * and Cort Dougan (PReP) (cort@cs.nmt.edu)
16 * Copyright (C) 1996 Paul Mackerras
17 * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk).
18 *
19 * Derived from "arch/i386/mm/init.c"
20 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
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
29#include <linux/config.h>
30#include <linux/signal.h>
31#include <linux/sched.h>
32#include <linux/kernel.h>
33#include <linux/errno.h>
34#include <linux/string.h>
35#include <linux/types.h>
36#include <linux/ptrace.h>
37#include <linux/mman.h>
38#include <linux/mm.h>
39#include <linux/swap.h>
40#include <linux/stddef.h>
41#include <linux/vmalloc.h>
42#include <linux/init.h>
43#include <linux/delay.h>
44#include <linux/highmem.h>
45
46#include <asm/pgalloc.h>
47#include <asm/prom.h>
48#include <asm/io.h>
49#include <asm/mmu_context.h>
50#include <asm/pgtable.h>
51#include <asm/mmu.h>
52#include <asm/uaccess.h>
53#include <asm/smp.h>
54#include <asm/bootx.h>
55#include <asm/machdep.h>
56#include <asm/setup.h>
57
58extern void loadcam_entry(unsigned int index);
59unsigned int tlbcam_index;
60unsigned int num_tlbcam_entries;
61static unsigned long __cam0, __cam1, __cam2;
62extern unsigned long total_lowmem;
63extern unsigned long __max_low_memory;
64#define MAX_LOW_MEM CONFIG_LOWMEM_SIZE
65
66#define NUM_TLBCAMS (16)
67
68struct tlbcam {
69 u32 MAS0;
70 u32 MAS1;
71 u32 MAS2;
72 u32 MAS3;
73 u32 MAS7;
74} TLBCAM[NUM_TLBCAMS];
75
76struct tlbcamrange {
77 unsigned long start;
78 unsigned long limit;
79 phys_addr_t phys;
80} tlbcam_addrs[NUM_TLBCAMS];
81
82extern unsigned int tlbcam_index;
83
84/*
85 * Return PA for this VA if it is mapped by a CAM, or 0
86 */
87unsigned long v_mapped_by_tlbcam(unsigned long va)
88{
89 int b;
90 for (b = 0; b < tlbcam_index; ++b)
91 if (va >= tlbcam_addrs[b].start && va < tlbcam_addrs[b].limit)
92 return tlbcam_addrs[b].phys + (va - tlbcam_addrs[b].start);
93 return 0;
94}
95
96/*
97 * Return VA for a given PA or 0 if not mapped
98 */
99unsigned long p_mapped_by_tlbcam(unsigned long pa)
100{
101 int b;
102 for (b = 0; b < tlbcam_index; ++b)
103 if (pa >= tlbcam_addrs[b].phys
104 && pa < (tlbcam_addrs[b].limit-tlbcam_addrs[b].start)
105 +tlbcam_addrs[b].phys)
106 return tlbcam_addrs[b].start+(pa-tlbcam_addrs[b].phys);
107 return 0;
108}
109
110/*
111 * Set up one of the I/D BAT (block address translation) register pairs.
112 * The parameters are not checked; in particular size must be a power
113 * of 4 between 4k and 256M.
114 */
115void settlbcam(int index, unsigned long virt, phys_addr_t phys,
116 unsigned int size, int flags, unsigned int pid)
117{
118 unsigned int tsize, lz;
119
120 asm ("cntlzw %0,%1" : "=r" (lz) : "r" (size));
121 tsize = (21 - lz) / 2;
122
123#ifdef CONFIG_SMP
124 if ((flags & _PAGE_NO_CACHE) == 0)
125 flags |= _PAGE_COHERENT;
126#endif
127
128 TLBCAM[index].MAS0 = MAS0_TLBSEL(1) | MAS0_ESEL(index) | MAS0_NV(index+1);
129 TLBCAM[index].MAS1 = MAS1_VALID | MAS1_IPROT | MAS1_TSIZE(tsize) | MAS1_TID(pid);
130 TLBCAM[index].MAS2 = virt & PAGE_MASK;
131
132 TLBCAM[index].MAS2 |= (flags & _PAGE_WRITETHRU) ? MAS2_W : 0;
133 TLBCAM[index].MAS2 |= (flags & _PAGE_NO_CACHE) ? MAS2_I : 0;
134 TLBCAM[index].MAS2 |= (flags & _PAGE_COHERENT) ? MAS2_M : 0;
135 TLBCAM[index].MAS2 |= (flags & _PAGE_GUARDED) ? MAS2_G : 0;
136 TLBCAM[index].MAS2 |= (flags & _PAGE_ENDIAN) ? MAS2_E : 0;
137
138 TLBCAM[index].MAS3 = (phys & PAGE_MASK) | MAS3_SX | MAS3_SR;
139 TLBCAM[index].MAS3 |= ((flags & _PAGE_RW) ? MAS3_SW : 0);
140
141#ifndef CONFIG_KGDB /* want user access for breakpoints */
142 if (flags & _PAGE_USER) {
143 TLBCAM[index].MAS3 |= MAS3_UX | MAS3_UR;
144 TLBCAM[index].MAS3 |= ((flags & _PAGE_RW) ? MAS3_UW : 0);
145 }
146#else
147 TLBCAM[index].MAS3 |= MAS3_UX | MAS3_UR;
148 TLBCAM[index].MAS3 |= ((flags & _PAGE_RW) ? MAS3_UW : 0);
149#endif
150
151 tlbcam_addrs[index].start = virt;
152 tlbcam_addrs[index].limit = virt + size - 1;
153 tlbcam_addrs[index].phys = phys;
154
155 loadcam_entry(index);
156}
157
158void invalidate_tlbcam_entry(int index)
159{
160 TLBCAM[index].MAS0 = MAS0_TLBSEL(1) | MAS0_ESEL(index);
161 TLBCAM[index].MAS1 = ~MAS1_VALID;
162
163 loadcam_entry(index);
164}
165
166void __init cam_mapin_ram(unsigned long cam0, unsigned long cam1,
167 unsigned long cam2)
168{
169 settlbcam(0, KERNELBASE, PPC_MEMSTART, cam0, _PAGE_KERNEL, 0);
170 tlbcam_index++;
171 if (cam1) {
172 tlbcam_index++;
173 settlbcam(1, KERNELBASE+cam0, PPC_MEMSTART+cam0, cam1, _PAGE_KERNEL, 0);
174 }
175 if (cam2) {
176 tlbcam_index++;
177 settlbcam(2, KERNELBASE+cam0+cam1, PPC_MEMSTART+cam0+cam1, cam2, _PAGE_KERNEL, 0);
178 }
179}
180
181/*
182 * MMU_init_hw does the chip-specific initialization of the MMU hardware.
183 */
184void __init MMU_init_hw(void)
185{
186 flush_instruction_cache();
187}
188
189unsigned long __init mmu_mapin_ram(void)
190{
191 cam_mapin_ram(__cam0, __cam1, __cam2);
192
193 return __cam0 + __cam1 + __cam2;
194}
195
196
197void __init
198adjust_total_lowmem(void)
199{
200 unsigned long max_low_mem = MAX_LOW_MEM;
201 unsigned long cam_max = 0x10000000;
202 unsigned long ram;
203
204 /* adjust CAM size to max_low_mem */
205 if (max_low_mem < cam_max)
206 cam_max = max_low_mem;
207
208 /* adjust lowmem size to max_low_mem */
209 if (max_low_mem < total_lowmem)
210 ram = max_low_mem;
211 else
212 ram = total_lowmem;
213
214 /* Calculate CAM values */
215 __cam0 = 1UL << 2 * (__ilog2(ram) / 2);
216 if (__cam0 > cam_max)
217 __cam0 = cam_max;
218 ram -= __cam0;
219 if (ram) {
220 __cam1 = 1UL << 2 * (__ilog2(ram) / 2);
221 if (__cam1 > cam_max)
222 __cam1 = cam_max;
223 ram -= __cam1;
224 }
225 if (ram) {
226 __cam2 = 1UL << 2 * (__ilog2(ram) / 2);
227 if (__cam2 > cam_max)
228 __cam2 = cam_max;
229 ram -= __cam2;
230 }
231
232 printk(KERN_INFO "Memory CAM mapping: CAM0=%ldMb, CAM1=%ldMb,"
233 " CAM2=%ldMb residual: %ldMb\n",
234 __cam0 >> 20, __cam1 >> 20, __cam2 >> 20,
235 (total_lowmem - __cam0 - __cam1 - __cam2) >> 20);
236 __max_low_memory = max_low_mem = __cam0 + __cam1 + __cam2;
237}
diff --git a/arch/powerpc/mm/hash_low_32.S b/arch/powerpc/mm/hash_low_32.S
new file mode 100644
index 000000000000..12ccd7155bac
--- /dev/null
+++ b/arch/powerpc/mm/hash_low_32.S
@@ -0,0 +1,618 @@
1/*
2 * arch/ppc/kernel/hashtable.S
3 *
4 * $Id: hashtable.S,v 1.6 1999/10/08 01:56:15 paulus Exp $
5 *
6 * PowerPC version
7 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
8 * Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP
9 * Copyright (C) 1996 Cort Dougan <cort@cs.nmt.edu>
10 * Adapted for Power Macintosh by Paul Mackerras.
11 * Low-level exception handlers and MMU support
12 * rewritten by Paul Mackerras.
13 * Copyright (C) 1996 Paul Mackerras.
14 *
15 * This file contains low-level assembler routines for managing
16 * the PowerPC MMU hash table. (PPC 8xx processors don't use a
17 * hash table, so this file is not used on them.)
18 *
19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License
21 * as published by the Free Software Foundation; either version
22 * 2 of the License, or (at your option) any later version.
23 *
24 */
25
26#include <linux/config.h>
27#include <asm/reg.h>
28#include <asm/page.h>
29#include <asm/pgtable.h>
30#include <asm/cputable.h>
31#include <asm/ppc_asm.h>
32#include <asm/thread_info.h>
33#include <asm/asm-offsets.h>
34
35#ifdef CONFIG_SMP
36 .comm mmu_hash_lock,4
37#endif /* CONFIG_SMP */
38
39/*
40 * Sync CPUs with hash_page taking & releasing the hash
41 * table lock
42 */
43#ifdef CONFIG_SMP
44 .text
45_GLOBAL(hash_page_sync)
46 lis r8,mmu_hash_lock@h
47 ori r8,r8,mmu_hash_lock@l
48 lis r0,0x0fff
49 b 10f
5011: lwz r6,0(r8)
51 cmpwi 0,r6,0
52 bne 11b
5310: lwarx r6,0,r8
54 cmpwi 0,r6,0
55 bne- 11b
56 stwcx. r0,0,r8
57 bne- 10b
58 isync
59 eieio
60 li r0,0
61 stw r0,0(r8)
62 blr
63#endif
64
65/*
66 * Load a PTE into the hash table, if possible.
67 * The address is in r4, and r3 contains an access flag:
68 * _PAGE_RW (0x400) if a write.
69 * r9 contains the SRR1 value, from which we use the MSR_PR bit.
70 * SPRG3 contains the physical address of the current task's thread.
71 *
72 * Returns to the caller if the access is illegal or there is no
73 * mapping for the address. Otherwise it places an appropriate PTE
74 * in the hash table and returns from the exception.
75 * Uses r0, r3 - r8, ctr, lr.
76 */
77 .text
78_GLOBAL(hash_page)
79#ifdef CONFIG_PPC64BRIDGE
80 mfmsr r0
81 clrldi r0,r0,1 /* make sure it's in 32-bit mode */
82 MTMSRD(r0)
83 isync
84#endif
85 tophys(r7,0) /* gets -KERNELBASE into r7 */
86#ifdef CONFIG_SMP
87 addis r8,r7,mmu_hash_lock@h
88 ori r8,r8,mmu_hash_lock@l
89 lis r0,0x0fff
90 b 10f
9111: lwz r6,0(r8)
92 cmpwi 0,r6,0
93 bne 11b
9410: lwarx r6,0,r8
95 cmpwi 0,r6,0
96 bne- 11b
97 stwcx. r0,0,r8
98 bne- 10b
99 isync
100#endif
101 /* Get PTE (linux-style) and check access */
102 lis r0,KERNELBASE@h /* check if kernel address */
103 cmplw 0,r4,r0
104 mfspr r8,SPRN_SPRG3 /* current task's THREAD (phys) */
105 ori r3,r3,_PAGE_USER|_PAGE_PRESENT /* test low addresses as user */
106 lwz r5,PGDIR(r8) /* virt page-table root */
107 blt+ 112f /* assume user more likely */
108 lis r5,swapper_pg_dir@ha /* if kernel address, use */
109 addi r5,r5,swapper_pg_dir@l /* kernel page table */
110 rlwimi r3,r9,32-12,29,29 /* MSR_PR -> _PAGE_USER */
111112: add r5,r5,r7 /* convert to phys addr */
112 rlwimi r5,r4,12,20,29 /* insert top 10 bits of address */
113 lwz r8,0(r5) /* get pmd entry */
114 rlwinm. r8,r8,0,0,19 /* extract address of pte page */
115#ifdef CONFIG_SMP
116 beq- hash_page_out /* return if no mapping */
117#else
118 /* XXX it seems like the 601 will give a machine fault on the
119 rfi if its alignment is wrong (bottom 4 bits of address are
120 8 or 0xc) and we have had a not-taken conditional branch
121 to the address following the rfi. */
122 beqlr-
123#endif
124 rlwimi r8,r4,22,20,29 /* insert next 10 bits of address */
125 rlwinm r0,r3,32-3,24,24 /* _PAGE_RW access -> _PAGE_DIRTY */
126 ori r0,r0,_PAGE_ACCESSED|_PAGE_HASHPTE
127
128 /*
129 * Update the linux PTE atomically. We do the lwarx up-front
130 * because almost always, there won't be a permission violation
131 * and there won't already be an HPTE, and thus we will have
132 * to update the PTE to set _PAGE_HASHPTE. -- paulus.
133 */
134retry:
135 lwarx r6,0,r8 /* get linux-style pte */
136 andc. r5,r3,r6 /* check access & ~permission */
137#ifdef CONFIG_SMP
138 bne- hash_page_out /* return if access not permitted */
139#else
140 bnelr-
141#endif
142 or r5,r0,r6 /* set accessed/dirty bits */
143 stwcx. r5,0,r8 /* attempt to update PTE */
144 bne- retry /* retry if someone got there first */
145
146 mfsrin r3,r4 /* get segment reg for segment */
147 mfctr r0
148 stw r0,_CTR(r11)
149 bl create_hpte /* add the hash table entry */
150
151#ifdef CONFIG_SMP
152 eieio
153 addis r8,r7,mmu_hash_lock@ha
154 li r0,0
155 stw r0,mmu_hash_lock@l(r8)
156#endif
157
158 /* Return from the exception */
159 lwz r5,_CTR(r11)
160 mtctr r5
161 lwz r0,GPR0(r11)
162 lwz r7,GPR7(r11)
163 lwz r8,GPR8(r11)
164 b fast_exception_return
165
166#ifdef CONFIG_SMP
167hash_page_out:
168 eieio
169 addis r8,r7,mmu_hash_lock@ha
170 li r0,0
171 stw r0,mmu_hash_lock@l(r8)
172 blr
173#endif /* CONFIG_SMP */
174
175/*
176 * Add an entry for a particular page to the hash table.
177 *
178 * add_hash_page(unsigned context, unsigned long va, unsigned long pmdval)
179 *
180 * We assume any necessary modifications to the pte (e.g. setting
181 * the accessed bit) have already been done and that there is actually
182 * a hash table in use (i.e. we're not on a 603).
183 */
184_GLOBAL(add_hash_page)
185 mflr r0
186 stw r0,4(r1)
187
188 /* Convert context and va to VSID */
189 mulli r3,r3,897*16 /* multiply context by context skew */
190 rlwinm r0,r4,4,28,31 /* get ESID (top 4 bits of va) */
191 mulli r0,r0,0x111 /* multiply by ESID skew */
192 add r3,r3,r0 /* note create_hpte trims to 24 bits */
193
194#ifdef CONFIG_SMP
195 rlwinm r8,r1,0,0,18 /* use cpu number to make tag */
196 lwz r8,TI_CPU(r8) /* to go in mmu_hash_lock */
197 oris r8,r8,12
198#endif /* CONFIG_SMP */
199
200 /*
201 * We disable interrupts here, even on UP, because we don't
202 * want to race with hash_page, and because we want the
203 * _PAGE_HASHPTE bit to be a reliable indication of whether
204 * the HPTE exists (or at least whether one did once).
205 * We also turn off the MMU for data accesses so that we
206 * we can't take a hash table miss (assuming the code is
207 * covered by a BAT). -- paulus
208 */
209 mfmsr r10
210 SYNC
211 rlwinm r0,r10,0,17,15 /* clear bit 16 (MSR_EE) */
212 rlwinm r0,r0,0,28,26 /* clear MSR_DR */
213 mtmsr r0
214 SYNC_601
215 isync
216
217 tophys(r7,0)
218
219#ifdef CONFIG_SMP
220 addis r9,r7,mmu_hash_lock@ha
221 addi r9,r9,mmu_hash_lock@l
22210: lwarx r0,0,r9 /* take the mmu_hash_lock */
223 cmpi 0,r0,0
224 bne- 11f
225 stwcx. r8,0,r9
226 beq+ 12f
22711: lwz r0,0(r9)
228 cmpi 0,r0,0
229 beq 10b
230 b 11b
23112: isync
232#endif
233
234 /*
235 * Fetch the linux pte and test and set _PAGE_HASHPTE atomically.
236 * If _PAGE_HASHPTE was already set, we don't replace the existing
237 * HPTE, so we just unlock and return.
238 */
239 mr r8,r5
240 rlwimi r8,r4,22,20,29
2411: lwarx r6,0,r8
242 andi. r0,r6,_PAGE_HASHPTE
243 bne 9f /* if HASHPTE already set, done */
244 ori r5,r6,_PAGE_HASHPTE
245 stwcx. r5,0,r8
246 bne- 1b
247
248 bl create_hpte
249
2509:
251#ifdef CONFIG_SMP
252 eieio
253 li r0,0
254 stw r0,0(r9) /* clear mmu_hash_lock */
255#endif
256
257 /* reenable interrupts and DR */
258 mtmsr r10
259 SYNC_601
260 isync
261
262 lwz r0,4(r1)
263 mtlr r0
264 blr
265
266/*
267 * This routine adds a hardware PTE to the hash table.
268 * It is designed to be called with the MMU either on or off.
269 * r3 contains the VSID, r4 contains the virtual address,
270 * r5 contains the linux PTE, r6 contains the old value of the
271 * linux PTE (before setting _PAGE_HASHPTE) and r7 contains the
272 * offset to be added to addresses (0 if the MMU is on,
273 * -KERNELBASE if it is off).
274 * On SMP, the caller should have the mmu_hash_lock held.
275 * We assume that the caller has (or will) set the _PAGE_HASHPTE
276 * bit in the linux PTE in memory. The value passed in r6 should
277 * be the old linux PTE value; if it doesn't have _PAGE_HASHPTE set
278 * this routine will skip the search for an existing HPTE.
279 * This procedure modifies r0, r3 - r6, r8, cr0.
280 * -- paulus.
281 *
282 * For speed, 4 of the instructions get patched once the size and
283 * physical address of the hash table are known. These definitions
284 * of Hash_base and Hash_bits below are just an example.
285 */
286Hash_base = 0xc0180000
287Hash_bits = 12 /* e.g. 256kB hash table */
288Hash_msk = (((1 << Hash_bits) - 1) * 64)
289
290#ifndef CONFIG_PPC64BRIDGE
291/* defines for the PTE format for 32-bit PPCs */
292#define PTE_SIZE 8
293#define PTEG_SIZE 64
294#define LG_PTEG_SIZE 6
295#define LDPTEu lwzu
296#define STPTE stw
297#define CMPPTE cmpw
298#define PTE_H 0x40
299#define PTE_V 0x80000000
300#define TST_V(r) rlwinm. r,r,0,0,0
301#define SET_V(r) oris r,r,PTE_V@h
302#define CLR_V(r,t) rlwinm r,r,0,1,31
303
304#else
305/* defines for the PTE format for 64-bit PPCs */
306#define PTE_SIZE 16
307#define PTEG_SIZE 128
308#define LG_PTEG_SIZE 7
309#define LDPTEu ldu
310#define STPTE std
311#define CMPPTE cmpd
312#define PTE_H 2
313#define PTE_V 1
314#define TST_V(r) andi. r,r,PTE_V
315#define SET_V(r) ori r,r,PTE_V
316#define CLR_V(r,t) li t,PTE_V; andc r,r,t
317#endif /* CONFIG_PPC64BRIDGE */
318
319#define HASH_LEFT 31-(LG_PTEG_SIZE+Hash_bits-1)
320#define HASH_RIGHT 31-LG_PTEG_SIZE
321
322_GLOBAL(create_hpte)
323 /* Convert linux-style PTE (r5) to low word of PPC-style PTE (r8) */
324 rlwinm r8,r5,32-10,31,31 /* _PAGE_RW -> PP lsb */
325 rlwinm r0,r5,32-7,31,31 /* _PAGE_DIRTY -> PP lsb */
326 and r8,r8,r0 /* writable if _RW & _DIRTY */
327 rlwimi r5,r5,32-1,30,30 /* _PAGE_USER -> PP msb */
328 rlwimi r5,r5,32-2,31,31 /* _PAGE_USER -> PP lsb */
329 ori r8,r8,0xe14 /* clear out reserved bits and M */
330 andc r8,r5,r8 /* PP = user? (rw&dirty? 2: 3): 0 */
331BEGIN_FTR_SECTION
332 ori r8,r8,_PAGE_COHERENT /* set M (coherence required) */
333END_FTR_SECTION_IFSET(CPU_FTR_NEED_COHERENT)
334
335 /* Construct the high word of the PPC-style PTE (r5) */
336#ifndef CONFIG_PPC64BRIDGE
337 rlwinm r5,r3,7,1,24 /* put VSID in 0x7fffff80 bits */
338 rlwimi r5,r4,10,26,31 /* put in API (abbrev page index) */
339#else /* CONFIG_PPC64BRIDGE */
340 clrlwi r3,r3,8 /* reduce vsid to 24 bits */
341 sldi r5,r3,12 /* shift vsid into position */
342 rlwimi r5,r4,16,20,24 /* put in API (abbrev page index) */
343#endif /* CONFIG_PPC64BRIDGE */
344 SET_V(r5) /* set V (valid) bit */
345
346 /* Get the address of the primary PTE group in the hash table (r3) */
347_GLOBAL(hash_page_patch_A)
348 addis r0,r7,Hash_base@h /* base address of hash table */
349 rlwimi r0,r3,LG_PTEG_SIZE,HASH_LEFT,HASH_RIGHT /* VSID -> hash */
350 rlwinm r3,r4,20+LG_PTEG_SIZE,HASH_LEFT,HASH_RIGHT /* PI -> hash */
351 xor r3,r3,r0 /* make primary hash */
352 li r0,8 /* PTEs/group */
353
354 /*
355 * Test the _PAGE_HASHPTE bit in the old linux PTE, and skip the search
356 * if it is clear, meaning that the HPTE isn't there already...
357 */
358 andi. r6,r6,_PAGE_HASHPTE
359 beq+ 10f /* no PTE: go look for an empty slot */
360 tlbie r4
361
362 addis r4,r7,htab_hash_searches@ha
363 lwz r6,htab_hash_searches@l(r4)
364 addi r6,r6,1 /* count how many searches we do */
365 stw r6,htab_hash_searches@l(r4)
366
367 /* Search the primary PTEG for a PTE whose 1st (d)word matches r5 */
368 mtctr r0
369 addi r4,r3,-PTE_SIZE
3701: LDPTEu r6,PTE_SIZE(r4) /* get next PTE */
371 CMPPTE 0,r6,r5
372 bdnzf 2,1b /* loop while ctr != 0 && !cr0.eq */
373 beq+ found_slot
374
375 /* Search the secondary PTEG for a matching PTE */
376 ori r5,r5,PTE_H /* set H (secondary hash) bit */
377_GLOBAL(hash_page_patch_B)
378 xoris r4,r3,Hash_msk>>16 /* compute secondary hash */
379 xori r4,r4,(-PTEG_SIZE & 0xffff)
380 addi r4,r4,-PTE_SIZE
381 mtctr r0
3822: LDPTEu r6,PTE_SIZE(r4)
383 CMPPTE 0,r6,r5
384 bdnzf 2,2b
385 beq+ found_slot
386 xori r5,r5,PTE_H /* clear H bit again */
387
388 /* Search the primary PTEG for an empty slot */
38910: mtctr r0
390 addi r4,r3,-PTE_SIZE /* search primary PTEG */
3911: LDPTEu r6,PTE_SIZE(r4) /* get next PTE */
392 TST_V(r6) /* test valid bit */
393 bdnzf 2,1b /* loop while ctr != 0 && !cr0.eq */
394 beq+ found_empty
395
396 /* update counter of times that the primary PTEG is full */
397 addis r4,r7,primary_pteg_full@ha
398 lwz r6,primary_pteg_full@l(r4)
399 addi r6,r6,1
400 stw r6,primary_pteg_full@l(r4)
401
402 /* Search the secondary PTEG for an empty slot */
403 ori r5,r5,PTE_H /* set H (secondary hash) bit */
404_GLOBAL(hash_page_patch_C)
405 xoris r4,r3,Hash_msk>>16 /* compute secondary hash */
406 xori r4,r4,(-PTEG_SIZE & 0xffff)
407 addi r4,r4,-PTE_SIZE
408 mtctr r0
4092: LDPTEu r6,PTE_SIZE(r4)
410 TST_V(r6)
411 bdnzf 2,2b
412 beq+ found_empty
413 xori r5,r5,PTE_H /* clear H bit again */
414
415 /*
416 * Choose an arbitrary slot in the primary PTEG to overwrite.
417 * Since both the primary and secondary PTEGs are full, and we
418 * have no information that the PTEs in the primary PTEG are
419 * more important or useful than those in the secondary PTEG,
420 * and we know there is a definite (although small) speed
421 * advantage to putting the PTE in the primary PTEG, we always
422 * put the PTE in the primary PTEG.
423 */
424 addis r4,r7,next_slot@ha
425 lwz r6,next_slot@l(r4)
426 addi r6,r6,PTE_SIZE
427 andi. r6,r6,7*PTE_SIZE
428 stw r6,next_slot@l(r4)
429 add r4,r3,r6
430
431#ifndef CONFIG_SMP
432 /* Store PTE in PTEG */
433found_empty:
434 STPTE r5,0(r4)
435found_slot:
436 STPTE r8,PTE_SIZE/2(r4)
437
438#else /* CONFIG_SMP */
439/*
440 * Between the tlbie above and updating the hash table entry below,
441 * another CPU could read the hash table entry and put it in its TLB.
442 * There are 3 cases:
443 * 1. using an empty slot
444 * 2. updating an earlier entry to change permissions (i.e. enable write)
445 * 3. taking over the PTE for an unrelated address
446 *
447 * In each case it doesn't really matter if the other CPUs have the old
448 * PTE in their TLB. So we don't need to bother with another tlbie here,
449 * which is convenient as we've overwritten the register that had the
450 * address. :-) The tlbie above is mainly to make sure that this CPU comes
451 * and gets the new PTE from the hash table.
452 *
453 * We do however have to make sure that the PTE is never in an invalid
454 * state with the V bit set.
455 */
456found_empty:
457found_slot:
458 CLR_V(r5,r0) /* clear V (valid) bit in PTE */
459 STPTE r5,0(r4)
460 sync
461 TLBSYNC
462 STPTE r8,PTE_SIZE/2(r4) /* put in correct RPN, WIMG, PP bits */
463 sync
464 SET_V(r5)
465 STPTE r5,0(r4) /* finally set V bit in PTE */
466#endif /* CONFIG_SMP */
467
468 sync /* make sure pte updates get to memory */
469 blr
470
471 .comm next_slot,4
472 .comm primary_pteg_full,4
473 .comm htab_hash_searches,4
474
475/*
476 * Flush the entry for a particular page from the hash table.
477 *
478 * flush_hash_pages(unsigned context, unsigned long va, unsigned long pmdval,
479 * int count)
480 *
481 * We assume that there is a hash table in use (Hash != 0).
482 */
483_GLOBAL(flush_hash_pages)
484 tophys(r7,0)
485
486 /*
487 * We disable interrupts here, even on UP, because we want
488 * the _PAGE_HASHPTE bit to be a reliable indication of
489 * whether the HPTE exists (or at least whether one did once).
490 * We also turn off the MMU for data accesses so that we
491 * we can't take a hash table miss (assuming the code is
492 * covered by a BAT). -- paulus
493 */
494 mfmsr r10
495 SYNC
496 rlwinm r0,r10,0,17,15 /* clear bit 16 (MSR_EE) */
497 rlwinm r0,r0,0,28,26 /* clear MSR_DR */
498 mtmsr r0
499 SYNC_601
500 isync
501
502 /* First find a PTE in the range that has _PAGE_HASHPTE set */
503 rlwimi r5,r4,22,20,29
5041: lwz r0,0(r5)
505 cmpwi cr1,r6,1
506 andi. r0,r0,_PAGE_HASHPTE
507 bne 2f
508 ble cr1,19f
509 addi r4,r4,0x1000
510 addi r5,r5,4
511 addi r6,r6,-1
512 b 1b
513
514 /* Convert context and va to VSID */
5152: mulli r3,r3,897*16 /* multiply context by context skew */
516 rlwinm r0,r4,4,28,31 /* get ESID (top 4 bits of va) */
517 mulli r0,r0,0x111 /* multiply by ESID skew */
518 add r3,r3,r0 /* note code below trims to 24 bits */
519
520 /* Construct the high word of the PPC-style PTE (r11) */
521#ifndef CONFIG_PPC64BRIDGE
522 rlwinm r11,r3,7,1,24 /* put VSID in 0x7fffff80 bits */
523 rlwimi r11,r4,10,26,31 /* put in API (abbrev page index) */
524#else /* CONFIG_PPC64BRIDGE */
525 clrlwi r3,r3,8 /* reduce vsid to 24 bits */
526 sldi r11,r3,12 /* shift vsid into position */
527 rlwimi r11,r4,16,20,24 /* put in API (abbrev page index) */
528#endif /* CONFIG_PPC64BRIDGE */
529 SET_V(r11) /* set V (valid) bit */
530
531#ifdef CONFIG_SMP
532 addis r9,r7,mmu_hash_lock@ha
533 addi r9,r9,mmu_hash_lock@l
534 rlwinm r8,r1,0,0,18
535 add r8,r8,r7
536 lwz r8,TI_CPU(r8)
537 oris r8,r8,9
53810: lwarx r0,0,r9
539 cmpi 0,r0,0
540 bne- 11f
541 stwcx. r8,0,r9
542 beq+ 12f
54311: lwz r0,0(r9)
544 cmpi 0,r0,0
545 beq 10b
546 b 11b
54712: isync
548#endif
549
550 /*
551 * Check the _PAGE_HASHPTE bit in the linux PTE. If it is
552 * already clear, we're done (for this pte). If not,
553 * clear it (atomically) and proceed. -- paulus.
554 */
55533: lwarx r8,0,r5 /* fetch the pte */
556 andi. r0,r8,_PAGE_HASHPTE
557 beq 8f /* done if HASHPTE is already clear */
558 rlwinm r8,r8,0,31,29 /* clear HASHPTE bit */
559 stwcx. r8,0,r5 /* update the pte */
560 bne- 33b
561
562 /* Get the address of the primary PTE group in the hash table (r3) */
563_GLOBAL(flush_hash_patch_A)
564 addis r8,r7,Hash_base@h /* base address of hash table */
565 rlwimi r8,r3,LG_PTEG_SIZE,HASH_LEFT,HASH_RIGHT /* VSID -> hash */
566 rlwinm r0,r4,20+LG_PTEG_SIZE,HASH_LEFT,HASH_RIGHT /* PI -> hash */
567 xor r8,r0,r8 /* make primary hash */
568
569 /* Search the primary PTEG for a PTE whose 1st (d)word matches r5 */
570 li r0,8 /* PTEs/group */
571 mtctr r0
572 addi r12,r8,-PTE_SIZE
5731: LDPTEu r0,PTE_SIZE(r12) /* get next PTE */
574 CMPPTE 0,r0,r11
575 bdnzf 2,1b /* loop while ctr != 0 && !cr0.eq */
576 beq+ 3f
577
578 /* Search the secondary PTEG for a matching PTE */
579 ori r11,r11,PTE_H /* set H (secondary hash) bit */
580 li r0,8 /* PTEs/group */
581_GLOBAL(flush_hash_patch_B)
582 xoris r12,r8,Hash_msk>>16 /* compute secondary hash */
583 xori r12,r12,(-PTEG_SIZE & 0xffff)
584 addi r12,r12,-PTE_SIZE
585 mtctr r0
5862: LDPTEu r0,PTE_SIZE(r12)
587 CMPPTE 0,r0,r11
588 bdnzf 2,2b
589 xori r11,r11,PTE_H /* clear H again */
590 bne- 4f /* should rarely fail to find it */
591
5923: li r0,0
593 STPTE r0,0(r12) /* invalidate entry */
5944: sync
595 tlbie r4 /* in hw tlb too */
596 sync
597
5988: ble cr1,9f /* if all ptes checked */
59981: addi r6,r6,-1
600 addi r5,r5,4 /* advance to next pte */
601 addi r4,r4,0x1000
602 lwz r0,0(r5) /* check next pte */
603 cmpwi cr1,r6,1
604 andi. r0,r0,_PAGE_HASHPTE
605 bne 33b
606 bgt cr1,81b
607
6089:
609#ifdef CONFIG_SMP
610 TLBSYNC
611 li r0,0
612 stw r0,0(r9) /* clear mmu_hash_lock */
613#endif
614
61519: mtmsr r10
616 SYNC_601
617 isync
618 blr
diff --git a/arch/ppc64/mm/hash_low.S b/arch/powerpc/mm/hash_low_64.S
index ee5a5d36bfa8..d6ed9102eeea 100644
--- a/arch/ppc64/mm/hash_low.S
+++ b/arch/powerpc/mm/hash_low_64.S
@@ -10,7 +10,7 @@
10 * described in the kernel's COPYING file. 10 * described in the kernel's COPYING file.
11 */ 11 */
12 12
13#include <asm/processor.h> 13#include <asm/reg.h>
14#include <asm/pgtable.h> 14#include <asm/pgtable.h>
15#include <asm/mmu.h> 15#include <asm/mmu.h>
16#include <asm/page.h> 16#include <asm/page.h>
diff --git a/arch/ppc64/mm/hash_native.c b/arch/powerpc/mm/hash_native_64.c
index bfd385b7713c..174d14576c28 100644
--- a/arch/ppc64/mm/hash_native.c
+++ b/arch/powerpc/mm/hash_native_64.c
@@ -335,10 +335,9 @@ static void native_hpte_clear(void)
335 local_irq_restore(flags); 335 local_irq_restore(flags);
336} 336}
337 337
338static void native_flush_hash_range(unsigned long context, 338static void native_flush_hash_range(unsigned long number, int local)
339 unsigned long number, int local)
340{ 339{
341 unsigned long vsid, vpn, va, hash, secondary, slot, flags, avpn; 340 unsigned long va, vpn, hash, secondary, slot, flags, avpn;
342 int i, j; 341 int i, j;
343 hpte_t *hptep; 342 hpte_t *hptep;
344 unsigned long hpte_v; 343 unsigned long hpte_v;
@@ -349,13 +348,7 @@ static void native_flush_hash_range(unsigned long context,
349 348
350 j = 0; 349 j = 0;
351 for (i = 0; i < number; i++) { 350 for (i = 0; i < number; i++) {
352 if (batch->addr[i] < KERNELBASE) 351 va = batch->vaddr[j];
353 vsid = get_vsid(context, batch->addr[i]);
354 else
355 vsid = get_kernel_vsid(batch->addr[i]);
356
357 va = (vsid << 28) | (batch->addr[i] & 0x0fffffff);
358 batch->vaddr[j] = va;
359 if (large) 352 if (large)
360 vpn = va >> HPAGE_SHIFT; 353 vpn = va >> HPAGE_SHIFT;
361 else 354 else
diff --git a/arch/ppc64/mm/hash_utils.c b/arch/powerpc/mm/hash_utils_64.c
index 09475c8edf7c..6e9e05cce02c 100644
--- a/arch/ppc64/mm/hash_utils.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -78,7 +78,7 @@ extern unsigned long dart_tablebase;
78hpte_t *htab_address; 78hpte_t *htab_address;
79unsigned long htab_hash_mask; 79unsigned long htab_hash_mask;
80 80
81extern unsigned long _SDR1; 81unsigned long _SDR1;
82 82
83#define KB (1024) 83#define KB (1024)
84#define MB (1024*KB) 84#define MB (1024*KB)
@@ -90,7 +90,6 @@ static inline void loop_forever(void)
90 ; 90 ;
91} 91}
92 92
93#ifdef CONFIG_PPC_MULTIPLATFORM
94static inline void create_pte_mapping(unsigned long start, unsigned long end, 93static inline void create_pte_mapping(unsigned long start, unsigned long end,
95 unsigned long mode, int large) 94 unsigned long mode, int large)
96{ 95{
@@ -111,7 +110,7 @@ static inline void create_pte_mapping(unsigned long start, unsigned long end,
111 unsigned long vpn, hash, hpteg; 110 unsigned long vpn, hash, hpteg;
112 unsigned long vsid = get_kernel_vsid(addr); 111 unsigned long vsid = get_kernel_vsid(addr);
113 unsigned long va = (vsid << 28) | (addr & 0xfffffff); 112 unsigned long va = (vsid << 28) | (addr & 0xfffffff);
114 int ret; 113 int ret = -1;
115 114
116 if (large) 115 if (large)
117 vpn = va >> HPAGE_SHIFT; 116 vpn = va >> HPAGE_SHIFT;
@@ -129,16 +128,25 @@ static inline void create_pte_mapping(unsigned long start, unsigned long end,
129 128
130 hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP); 129 hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP);
131 130
131#ifdef CONFIG_PPC_ISERIES
132 if (systemcfg->platform & PLATFORM_ISERIES_LPAR)
133 ret = iSeries_hpte_bolt_or_insert(hpteg, va,
134 virt_to_abs(addr) >> PAGE_SHIFT,
135 vflags, tmp_mode);
136 else
137#endif
132#ifdef CONFIG_PPC_PSERIES 138#ifdef CONFIG_PPC_PSERIES
133 if (systemcfg->platform & PLATFORM_LPAR) 139 if (systemcfg->platform & PLATFORM_LPAR)
134 ret = pSeries_lpar_hpte_insert(hpteg, va, 140 ret = pSeries_lpar_hpte_insert(hpteg, va,
135 virt_to_abs(addr) >> PAGE_SHIFT, 141 virt_to_abs(addr) >> PAGE_SHIFT,
136 vflags, tmp_mode); 142 vflags, tmp_mode);
137 else 143 else
138#endif /* CONFIG_PPC_PSERIES */ 144#endif
145#ifdef CONFIG_PPC_MULTIPLATFORM
139 ret = native_hpte_insert(hpteg, va, 146 ret = native_hpte_insert(hpteg, va,
140 virt_to_abs(addr) >> PAGE_SHIFT, 147 virt_to_abs(addr) >> PAGE_SHIFT,
141 vflags, tmp_mode); 148 vflags, tmp_mode);
149#endif
142 150
143 if (ret == -1) { 151 if (ret == -1) {
144 ppc64_terminate_msg(0x20, "create_pte_mapping"); 152 ppc64_terminate_msg(0x20, "create_pte_mapping");
@@ -147,6 +155,27 @@ static inline void create_pte_mapping(unsigned long start, unsigned long end,
147 } 155 }
148} 156}
149 157
158static unsigned long get_hashtable_size(void)
159{
160 unsigned long rnd_mem_size, pteg_count;
161
162 /* If hash size wasn't obtained in prom.c, we calculate it now based on
163 * the total RAM size
164 */
165 if (ppc64_pft_size)
166 return 1UL << ppc64_pft_size;
167
168 /* round mem_size up to next power of 2 */
169 rnd_mem_size = 1UL << __ilog2(systemcfg->physicalMemorySize);
170 if (rnd_mem_size < systemcfg->physicalMemorySize)
171 rnd_mem_size <<= 1;
172
173 /* # pages / 2 */
174 pteg_count = max(rnd_mem_size >> (12 + 1), 1UL << 11);
175
176 return pteg_count << 7;
177}
178
150void __init htab_initialize(void) 179void __init htab_initialize(void)
151{ 180{
152 unsigned long table, htab_size_bytes; 181 unsigned long table, htab_size_bytes;
@@ -162,7 +191,7 @@ void __init htab_initialize(void)
162 * Calculate the required size of the htab. We want the number of 191 * Calculate the required size of the htab. We want the number of
163 * PTEGs to equal one half the number of real pages. 192 * PTEGs to equal one half the number of real pages.
164 */ 193 */
165 htab_size_bytes = 1UL << ppc64_pft_size; 194 htab_size_bytes = get_hashtable_size();
166 pteg_count = htab_size_bytes >> 7; 195 pteg_count = htab_size_bytes >> 7;
167 196
168 /* For debug, make the HTAB 1/8 as big as it normally would be. */ 197 /* For debug, make the HTAB 1/8 as big as it normally would be. */
@@ -261,7 +290,6 @@ void __init htab_initialize(void)
261} 290}
262#undef KB 291#undef KB
263#undef MB 292#undef MB
264#endif /* CONFIG_PPC_MULTIPLATFORM */
265 293
266/* 294/*
267 * Called by asm hashtable.S for doing lazy icache flush 295 * Called by asm hashtable.S for doing lazy icache flush
@@ -355,18 +383,11 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
355 return ret; 383 return ret;
356} 384}
357 385
358void flush_hash_page(unsigned long context, unsigned long ea, pte_t pte, 386void flush_hash_page(unsigned long va, pte_t pte, int local)
359 int local)
360{ 387{
361 unsigned long vsid, vpn, va, hash, secondary, slot; 388 unsigned long vpn, hash, secondary, slot;
362 unsigned long huge = pte_huge(pte); 389 unsigned long huge = pte_huge(pte);
363 390
364 if (ea < KERNELBASE)
365 vsid = get_vsid(context, ea);
366 else
367 vsid = get_kernel_vsid(ea);
368
369 va = (vsid << 28) | (ea & 0x0fffffff);
370 if (huge) 391 if (huge)
371 vpn = va >> HPAGE_SHIFT; 392 vpn = va >> HPAGE_SHIFT;
372 else 393 else
@@ -381,17 +402,17 @@ void flush_hash_page(unsigned long context, unsigned long ea, pte_t pte,
381 ppc_md.hpte_invalidate(slot, va, huge, local); 402 ppc_md.hpte_invalidate(slot, va, huge, local);
382} 403}
383 404
384void flush_hash_range(unsigned long context, unsigned long number, int local) 405void flush_hash_range(unsigned long number, int local)
385{ 406{
386 if (ppc_md.flush_hash_range) { 407 if (ppc_md.flush_hash_range) {
387 ppc_md.flush_hash_range(context, number, local); 408 ppc_md.flush_hash_range(number, local);
388 } else { 409 } else {
389 int i; 410 int i;
390 struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch); 411 struct ppc64_tlb_batch *batch =
412 &__get_cpu_var(ppc64_tlb_batch);
391 413
392 for (i = 0; i < number; i++) 414 for (i = 0; i < number; i++)
393 flush_hash_page(context, batch->addr[i], batch->pte[i], 415 flush_hash_page(batch->vaddr[i], batch->pte[i], local);
394 local);
395 } 416 }
396} 417}
397 418
diff --git a/arch/ppc64/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index 0ea0994ed974..0ea0994ed974 100644
--- a/arch/ppc64/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
diff --git a/arch/ppc64/mm/imalloc.c b/arch/powerpc/mm/imalloc.c
index c65b87b92756..f4ca29cf5364 100644
--- a/arch/ppc64/mm/imalloc.c
+++ b/arch/powerpc/mm/imalloc.c
@@ -300,12 +300,7 @@ void im_free(void * addr)
300 for (p = &imlist ; (tmp = *p) ; p = &tmp->next) { 300 for (p = &imlist ; (tmp = *p) ; p = &tmp->next) {
301 if (tmp->addr == addr) { 301 if (tmp->addr == addr) {
302 *p = tmp->next; 302 *p = tmp->next;
303
304 /* XXX: do we need the lock? */
305 spin_lock(&init_mm.page_table_lock);
306 unmap_vm_area(tmp); 303 unmap_vm_area(tmp);
307 spin_unlock(&init_mm.page_table_lock);
308
309 kfree(tmp); 304 kfree(tmp);
310 up(&imlist_sem); 305 up(&imlist_sem);
311 return; 306 return;
diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c
new file mode 100644
index 000000000000..4612a79dfb6e
--- /dev/null
+++ b/arch/powerpc/mm/init_32.c
@@ -0,0 +1,254 @@
1/*
2 * PowerPC version
3 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
4 *
5 * Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
6 * and Cort Dougan (PReP) (cort@cs.nmt.edu)
7 * Copyright (C) 1996 Paul Mackerras
8 * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk).
9 * PPC44x/36-bit changes by Matt Porter (mporter@mvista.com)
10 *
11 * Derived from "arch/i386/mm/init.c"
12 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version
17 * 2 of the License, or (at your option) any later version.
18 *
19 */
20
21#include <linux/config.h>
22#include <linux/module.h>
23#include <linux/sched.h>
24#include <linux/kernel.h>
25#include <linux/errno.h>
26#include <linux/string.h>
27#include <linux/types.h>
28#include <linux/mm.h>
29#include <linux/stddef.h>
30#include <linux/init.h>
31#include <linux/bootmem.h>
32#include <linux/highmem.h>
33#include <linux/initrd.h>
34#include <linux/pagemap.h>
35
36#include <asm/pgalloc.h>
37#include <asm/prom.h>
38#include <asm/io.h>
39#include <asm/mmu_context.h>
40#include <asm/pgtable.h>
41#include <asm/mmu.h>
42#include <asm/smp.h>
43#include <asm/machdep.h>
44#include <asm/btext.h>
45#include <asm/tlb.h>
46#include <asm/prom.h>
47#include <asm/lmb.h>
48#include <asm/sections.h>
49
50#include "mmu_decl.h"
51
52#if defined(CONFIG_KERNEL_START_BOOL) || defined(CONFIG_LOWMEM_SIZE_BOOL)
53/* The ammount of lowmem must be within 0xF0000000 - KERNELBASE. */
54#if (CONFIG_LOWMEM_SIZE > (0xF0000000 - KERNELBASE))
55#error "You must adjust CONFIG_LOWMEM_SIZE or CONFIG_START_KERNEL"
56#endif
57#endif
58#define MAX_LOW_MEM CONFIG_LOWMEM_SIZE
59
60DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
61
62unsigned long total_memory;
63unsigned long total_lowmem;
64
65unsigned long ppc_memstart;
66unsigned long ppc_memoffset = PAGE_OFFSET;
67
68int boot_mapsize;
69#ifdef CONFIG_PPC_PMAC
70unsigned long agp_special_page;
71EXPORT_SYMBOL(agp_special_page);
72#endif
73
74#ifdef CONFIG_HIGHMEM
75pte_t *kmap_pte;
76pgprot_t kmap_prot;
77
78EXPORT_SYMBOL(kmap_prot);
79EXPORT_SYMBOL(kmap_pte);
80#endif
81
82void MMU_init(void);
83
84/* XXX should be in current.h -- paulus */
85extern struct task_struct *current_set[NR_CPUS];
86
87char *klimit = _end;
88struct device_node *memory_node;
89
90extern int init_bootmem_done;
91
92/*
93 * this tells the system to map all of ram with the segregs
94 * (i.e. page tables) instead of the bats.
95 * -- Cort
96 */
97int __map_without_bats;
98int __map_without_ltlbs;
99
100/* max amount of low RAM to map in */
101unsigned long __max_low_memory = MAX_LOW_MEM;
102
103/*
104 * limit of what is accessible with initial MMU setup -
105 * 256MB usually, but only 16MB on 601.
106 */
107unsigned long __initial_memory_limit = 0x10000000;
108
109/*
110 * Check for command-line options that affect what MMU_init will do.
111 */
112void MMU_setup(void)
113{
114 /* Check for nobats option (used in mapin_ram). */
115 if (strstr(cmd_line, "nobats")) {
116 __map_without_bats = 1;
117 }
118
119 if (strstr(cmd_line, "noltlbs")) {
120 __map_without_ltlbs = 1;
121 }
122}
123
124/*
125 * MMU_init sets up the basic memory mappings for the kernel,
126 * including both RAM and possibly some I/O regions,
127 * and sets up the page tables and the MMU hardware ready to go.
128 */
129void __init MMU_init(void)
130{
131 if (ppc_md.progress)
132 ppc_md.progress("MMU:enter", 0x111);
133
134 /* 601 can only access 16MB at the moment */
135 if (PVR_VER(mfspr(SPRN_PVR)) == 1)
136 __initial_memory_limit = 0x01000000;
137
138 /* parse args from command line */
139 MMU_setup();
140
141 if (lmb.memory.cnt > 1) {
142 lmb.memory.cnt = 1;
143 lmb_analyze();
144 printk(KERN_WARNING "Only using first contiguous memory region");
145 }
146
147 total_memory = lmb_end_of_DRAM();
148 total_lowmem = total_memory;
149
150#ifdef CONFIG_FSL_BOOKE
151 /* Freescale Book-E parts expect lowmem to be mapped by fixed TLB
152 * entries, so we need to adjust lowmem to match the amount we can map
153 * in the fixed entries */
154 adjust_total_lowmem();
155#endif /* CONFIG_FSL_BOOKE */
156
157 if (total_lowmem > __max_low_memory) {
158 total_lowmem = __max_low_memory;
159#ifndef CONFIG_HIGHMEM
160 total_memory = total_lowmem;
161 lmb_enforce_memory_limit(total_lowmem);
162 lmb_analyze();
163#endif /* CONFIG_HIGHMEM */
164 }
165
166 /* Initialize the MMU hardware */
167 if (ppc_md.progress)
168 ppc_md.progress("MMU:hw init", 0x300);
169 MMU_init_hw();
170
171 /* Map in all of RAM starting at KERNELBASE */
172 if (ppc_md.progress)
173 ppc_md.progress("MMU:mapin", 0x301);
174 mapin_ram();
175
176#ifdef CONFIG_HIGHMEM
177 ioremap_base = PKMAP_BASE;
178#else
179 ioremap_base = 0xfe000000UL; /* for now, could be 0xfffff000 */
180#endif /* CONFIG_HIGHMEM */
181 ioremap_bot = ioremap_base;
182
183 /* Map in I/O resources */
184 if (ppc_md.progress)
185 ppc_md.progress("MMU:setio", 0x302);
186 if (ppc_md.setup_io_mappings)
187 ppc_md.setup_io_mappings();
188
189 /* Initialize the context management stuff */
190 mmu_context_init();
191
192 if (ppc_md.progress)
193 ppc_md.progress("MMU:exit", 0x211);
194}
195
196/* This is only called until mem_init is done. */
197void __init *early_get_page(void)
198{
199 void *p;
200
201 if (init_bootmem_done) {
202 p = alloc_bootmem_pages(PAGE_SIZE);
203 } else {
204 p = __va(lmb_alloc_base(PAGE_SIZE, PAGE_SIZE,
205 __initial_memory_limit));
206 }
207 return p;
208}
209
210/* Free up now-unused memory */
211static void free_sec(unsigned long start, unsigned long end, const char *name)
212{
213 unsigned long cnt = 0;
214
215 while (start < end) {
216 ClearPageReserved(virt_to_page(start));
217 set_page_count(virt_to_page(start), 1);
218 free_page(start);
219 cnt++;
220 start += PAGE_SIZE;
221 }
222 if (cnt) {
223 printk(" %ldk %s", cnt << (PAGE_SHIFT - 10), name);
224 totalram_pages += cnt;
225 }
226}
227
228void free_initmem(void)
229{
230#define FREESEC(TYPE) \
231 free_sec((unsigned long)(&__ ## TYPE ## _begin), \
232 (unsigned long)(&__ ## TYPE ## _end), \
233 #TYPE);
234
235 printk ("Freeing unused kernel memory:");
236 FREESEC(init);
237 printk("\n");
238 ppc_md.progress = NULL;
239#undef FREESEC
240}
241
242#ifdef CONFIG_BLK_DEV_INITRD
243void free_initrd_mem(unsigned long start, unsigned long end)
244{
245 if (start < end)
246 printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
247 for (; start < end; start += PAGE_SIZE) {
248 ClearPageReserved(virt_to_page(start));
249 set_page_count(virt_to_page(start), 1);
250 free_page(start);
251 totalram_pages++;
252 }
253}
254#endif
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
new file mode 100644
index 000000000000..b0fc822ec29f
--- /dev/null
+++ b/arch/powerpc/mm/init_64.c
@@ -0,0 +1,223 @@
1/*
2 * PowerPC version
3 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
4 *
5 * Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
6 * and Cort Dougan (PReP) (cort@cs.nmt.edu)
7 * Copyright (C) 1996 Paul Mackerras
8 * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk).
9 *
10 * Derived from "arch/i386/mm/init.c"
11 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
12 *
13 * Dave Engebretsen <engebret@us.ibm.com>
14 * Rework for PPC64 port.
15 *
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version
19 * 2 of the License, or (at your option) any later version.
20 *
21 */
22
23#include <linux/config.h>
24#include <linux/signal.h>
25#include <linux/sched.h>
26#include <linux/kernel.h>
27#include <linux/errno.h>
28#include <linux/string.h>
29#include <linux/types.h>
30#include <linux/mman.h>
31#include <linux/mm.h>
32#include <linux/swap.h>
33#include <linux/stddef.h>
34#include <linux/vmalloc.h>
35#include <linux/init.h>
36#include <linux/delay.h>
37#include <linux/bootmem.h>
38#include <linux/highmem.h>
39#include <linux/idr.h>
40#include <linux/nodemask.h>
41#include <linux/module.h>
42
43#include <asm/pgalloc.h>
44#include <asm/page.h>
45#include <asm/prom.h>
46#include <asm/lmb.h>
47#include <asm/rtas.h>
48#include <asm/io.h>
49#include <asm/mmu_context.h>
50#include <asm/pgtable.h>
51#include <asm/mmu.h>
52#include <asm/uaccess.h>
53#include <asm/smp.h>
54#include <asm/machdep.h>
55#include <asm/tlb.h>
56#include <asm/eeh.h>
57#include <asm/processor.h>
58#include <asm/mmzone.h>
59#include <asm/cputable.h>
60#include <asm/ppcdebug.h>
61#include <asm/sections.h>
62#include <asm/system.h>
63#include <asm/iommu.h>
64#include <asm/abs_addr.h>
65#include <asm/vdso.h>
66#include <asm/imalloc.h>
67
68#if PGTABLE_RANGE > USER_VSID_RANGE
69#warning Limited user VSID range means pagetable space is wasted
70#endif
71
72#if (TASK_SIZE_USER64 < PGTABLE_RANGE) && (TASK_SIZE_USER64 < USER_VSID_RANGE)
73#warning TASK_SIZE is smaller than it needs to be.
74#endif
75
76unsigned long klimit = (unsigned long)_end;
77
78/* max amount of RAM to use */
79unsigned long __max_memory;
80
81/* info on what we think the IO hole is */
82unsigned long io_hole_start;
83unsigned long io_hole_size;
84
85/*
86 * Do very early mm setup.
87 */
88void __init mm_init_ppc64(void)
89{
90#ifndef CONFIG_PPC_ISERIES
91 unsigned long i;
92#endif
93
94 ppc64_boot_msg(0x100, "MM Init");
95
96 /* This is the story of the IO hole... please, keep seated,
97 * unfortunately, we are out of oxygen masks at the moment.
98 * So we need some rough way to tell where your big IO hole
99 * is. On pmac, it's between 2G and 4G, on POWER3, it's around
100 * that area as well, on POWER4 we don't have one, etc...
101 * We need that as a "hint" when sizing the TCE table on POWER3
102 * So far, the simplest way that seem work well enough for us it
103 * to just assume that the first discontinuity in our physical
104 * RAM layout is the IO hole. That may not be correct in the future
105 * (and isn't on iSeries but then we don't care ;)
106 */
107
108#ifndef CONFIG_PPC_ISERIES
109 for (i = 1; i < lmb.memory.cnt; i++) {
110 unsigned long base, prevbase, prevsize;
111
112 prevbase = lmb.memory.region[i-1].base;
113 prevsize = lmb.memory.region[i-1].size;
114 base = lmb.memory.region[i].base;
115 if (base > (prevbase + prevsize)) {
116 io_hole_start = prevbase + prevsize;
117 io_hole_size = base - (prevbase + prevsize);
118 break;
119 }
120 }
121#endif /* CONFIG_PPC_ISERIES */
122 if (io_hole_start)
123 printk("IO Hole assumed to be %lx -> %lx\n",
124 io_hole_start, io_hole_start + io_hole_size - 1);
125
126 ppc64_boot_msg(0x100, "MM Init Done");
127}
128
129void free_initmem(void)
130{
131 unsigned long addr;
132
133 addr = (unsigned long)__init_begin;
134 for (; addr < (unsigned long)__init_end; addr += PAGE_SIZE) {
135 memset((void *)addr, 0xcc, PAGE_SIZE);
136 ClearPageReserved(virt_to_page(addr));
137 set_page_count(virt_to_page(addr), 1);
138 free_page(addr);
139 totalram_pages++;
140 }
141 printk ("Freeing unused kernel memory: %luk freed\n",
142 ((unsigned long)__init_end - (unsigned long)__init_begin) >> 10);
143}
144
145#ifdef CONFIG_BLK_DEV_INITRD
146void free_initrd_mem(unsigned long start, unsigned long end)
147{
148 if (start < end)
149 printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
150 for (; start < end; start += PAGE_SIZE) {
151 ClearPageReserved(virt_to_page(start));
152 set_page_count(virt_to_page(start), 1);
153 free_page(start);
154 totalram_pages++;
155 }
156}
157#endif
158
159static struct kcore_list kcore_vmem;
160
161static int __init setup_kcore(void)
162{
163 int i;
164
165 for (i=0; i < lmb.memory.cnt; i++) {
166 unsigned long base, size;
167 struct kcore_list *kcore_mem;
168
169 base = lmb.memory.region[i].base;
170 size = lmb.memory.region[i].size;
171
172 /* GFP_ATOMIC to avoid might_sleep warnings during boot */
173 kcore_mem = kmalloc(sizeof(struct kcore_list), GFP_ATOMIC);
174 if (!kcore_mem)
175 panic("mem_init: kmalloc failed\n");
176
177 kclist_add(kcore_mem, __va(base), size);
178 }
179
180 kclist_add(&kcore_vmem, (void *)VMALLOC_START, VMALLOC_END-VMALLOC_START);
181
182 return 0;
183}
184module_init(setup_kcore);
185
186static void zero_ctor(void *addr, kmem_cache_t *cache, unsigned long flags)
187{
188 memset(addr, 0, kmem_cache_size(cache));
189}
190
191static const int pgtable_cache_size[2] = {
192 PTE_TABLE_SIZE, PMD_TABLE_SIZE
193};
194static const char *pgtable_cache_name[ARRAY_SIZE(pgtable_cache_size)] = {
195 "pgd_pte_cache", "pud_pmd_cache",
196};
197
198kmem_cache_t *pgtable_cache[ARRAY_SIZE(pgtable_cache_size)];
199
200void pgtable_cache_init(void)
201{
202 int i;
203
204 BUILD_BUG_ON(PTE_TABLE_SIZE != pgtable_cache_size[PTE_CACHE_NUM]);
205 BUILD_BUG_ON(PMD_TABLE_SIZE != pgtable_cache_size[PMD_CACHE_NUM]);
206 BUILD_BUG_ON(PUD_TABLE_SIZE != pgtable_cache_size[PUD_CACHE_NUM]);
207 BUILD_BUG_ON(PGD_TABLE_SIZE != pgtable_cache_size[PGD_CACHE_NUM]);
208
209 for (i = 0; i < ARRAY_SIZE(pgtable_cache_size); i++) {
210 int size = pgtable_cache_size[i];
211 const char *name = pgtable_cache_name[i];
212
213 pgtable_cache[i] = kmem_cache_create(name,
214 size, size,
215 SLAB_HWCACHE_ALIGN
216 | SLAB_MUST_HWCACHE_ALIGN,
217 zero_ctor,
218 NULL);
219 if (! pgtable_cache[i])
220 panic("pgtable_cache_init(): could not create %s!\n",
221 name);
222 }
223}
diff --git a/arch/ppc64/kernel/lmb.c b/arch/powerpc/mm/lmb.c
index 5adaca2ddc9d..9b5aa6808eb8 100644
--- a/arch/ppc64/kernel/lmb.c
+++ b/arch/powerpc/mm/lmb.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Procedures for interfacing to Open Firmware. 2 * Procedures for maintaining information about logical memory blocks.
3 * 3 *
4 * Peter Bergner, IBM Corp. June 2001. 4 * Peter Bergner, IBM Corp. June 2001.
5 * Copyright (C) 2001 Peter Bergner. 5 * Copyright (C) 2001 Peter Bergner.
@@ -18,7 +18,9 @@
18#include <asm/page.h> 18#include <asm/page.h>
19#include <asm/prom.h> 19#include <asm/prom.h>
20#include <asm/lmb.h> 20#include <asm/lmb.h>
21#include <asm/abs_addr.h> 21#ifdef CONFIG_PPC32
22#include "mmu_decl.h" /* for __max_low_memory */
23#endif
22 24
23struct lmb lmb; 25struct lmb lmb;
24 26
@@ -54,16 +56,14 @@ void lmb_dump_all(void)
54#endif /* DEBUG */ 56#endif /* DEBUG */
55} 57}
56 58
57static unsigned long __init 59static unsigned long __init lmb_addrs_overlap(unsigned long base1,
58lmb_addrs_overlap(unsigned long base1, unsigned long size1, 60 unsigned long size1, unsigned long base2, unsigned long size2)
59 unsigned long base2, unsigned long size2)
60{ 61{
61 return ((base1 < (base2+size2)) && (base2 < (base1+size1))); 62 return ((base1 < (base2+size2)) && (base2 < (base1+size1)));
62} 63}
63 64
64static long __init 65static long __init lmb_addrs_adjacent(unsigned long base1, unsigned long size1,
65lmb_addrs_adjacent(unsigned long base1, unsigned long size1, 66 unsigned long base2, unsigned long size2)
66 unsigned long base2, unsigned long size2)
67{ 67{
68 if (base2 == base1 + size1) 68 if (base2 == base1 + size1)
69 return 1; 69 return 1;
@@ -73,8 +73,8 @@ lmb_addrs_adjacent(unsigned long base1, unsigned long size1,
73 return 0; 73 return 0;
74} 74}
75 75
76static long __init 76static long __init lmb_regions_adjacent(struct lmb_region *rgn,
77lmb_regions_adjacent(struct lmb_region *rgn, unsigned long r1, unsigned long r2) 77 unsigned long r1, unsigned long r2)
78{ 78{
79 unsigned long base1 = rgn->region[r1].base; 79 unsigned long base1 = rgn->region[r1].base;
80 unsigned long size1 = rgn->region[r1].size; 80 unsigned long size1 = rgn->region[r1].size;
@@ -85,8 +85,8 @@ lmb_regions_adjacent(struct lmb_region *rgn, unsigned long r1, unsigned long r2)
85} 85}
86 86
87/* Assumption: base addr of region 1 < base addr of region 2 */ 87/* Assumption: base addr of region 1 < base addr of region 2 */
88static void __init 88static void __init lmb_coalesce_regions(struct lmb_region *rgn,
89lmb_coalesce_regions(struct lmb_region *rgn, unsigned long r1, unsigned long r2) 89 unsigned long r1, unsigned long r2)
90{ 90{
91 unsigned long i; 91 unsigned long i;
92 92
@@ -99,8 +99,7 @@ lmb_coalesce_regions(struct lmb_region *rgn, unsigned long r1, unsigned long r2)
99} 99}
100 100
101/* This routine called with relocation disabled. */ 101/* This routine called with relocation disabled. */
102void __init 102void __init lmb_init(void)
103lmb_init(void)
104{ 103{
105 /* Create a dummy zero size LMB which will get coalesced away later. 104 /* Create a dummy zero size LMB which will get coalesced away later.
106 * This simplifies the lmb_add() code below... 105 * This simplifies the lmb_add() code below...
@@ -115,9 +114,8 @@ lmb_init(void)
115 lmb.reserved.cnt = 1; 114 lmb.reserved.cnt = 1;
116} 115}
117 116
118/* This routine called with relocation disabled. */ 117/* This routine may be called with relocation disabled. */
119void __init 118void __init lmb_analyze(void)
120lmb_analyze(void)
121{ 119{
122 int i; 120 int i;
123 121
@@ -128,8 +126,8 @@ lmb_analyze(void)
128} 126}
129 127
130/* This routine called with relocation disabled. */ 128/* This routine called with relocation disabled. */
131static long __init 129static long __init lmb_add_region(struct lmb_region *rgn, unsigned long base,
132lmb_add_region(struct lmb_region *rgn, unsigned long base, unsigned long size) 130 unsigned long size)
133{ 131{
134 unsigned long i, coalesced = 0; 132 unsigned long i, coalesced = 0;
135 long adjacent; 133 long adjacent;
@@ -158,18 +156,17 @@ lmb_add_region(struct lmb_region *rgn, unsigned long base, unsigned long size)
158 coalesced++; 156 coalesced++;
159 } 157 }
160 158
161 if ( coalesced ) { 159 if (coalesced)
162 return coalesced; 160 return coalesced;
163 } else if ( rgn->cnt >= MAX_LMB_REGIONS ) { 161 if (rgn->cnt >= MAX_LMB_REGIONS)
164 return -1; 162 return -1;
165 }
166 163
167 /* Couldn't coalesce the LMB, so add it to the sorted table. */ 164 /* Couldn't coalesce the LMB, so add it to the sorted table. */
168 for (i=rgn->cnt-1; i >= 0; i--) { 165 for (i = rgn->cnt-1; i >= 0; i--) {
169 if (base < rgn->region[i].base) { 166 if (base < rgn->region[i].base) {
170 rgn->region[i+1].base = rgn->region[i].base; 167 rgn->region[i+1].base = rgn->region[i].base;
171 rgn->region[i+1].size = rgn->region[i].size; 168 rgn->region[i+1].size = rgn->region[i].size;
172 } else { 169 } else {
173 rgn->region[i+1].base = base; 170 rgn->region[i+1].base = base;
174 rgn->region[i+1].size = size; 171 rgn->region[i+1].size = size;
175 break; 172 break;
@@ -180,30 +177,28 @@ lmb_add_region(struct lmb_region *rgn, unsigned long base, unsigned long size)
180 return 0; 177 return 0;
181} 178}
182 179
183/* This routine called with relocation disabled. */ 180/* This routine may be called with relocation disabled. */
184long __init 181long __init lmb_add(unsigned long base, unsigned long size)
185lmb_add(unsigned long base, unsigned long size)
186{ 182{
187 struct lmb_region *_rgn = &(lmb.memory); 183 struct lmb_region *_rgn = &(lmb.memory);
188 184
189 /* On pSeries LPAR systems, the first LMB is our RMO region. */ 185 /* On pSeries LPAR systems, the first LMB is our RMO region. */
190 if ( base == 0 ) 186 if (base == 0)
191 lmb.rmo_size = size; 187 lmb.rmo_size = size;
192 188
193 return lmb_add_region(_rgn, base, size); 189 return lmb_add_region(_rgn, base, size);
194 190
195} 191}
196 192
197long __init 193long __init lmb_reserve(unsigned long base, unsigned long size)
198lmb_reserve(unsigned long base, unsigned long size)
199{ 194{
200 struct lmb_region *_rgn = &(lmb.reserved); 195 struct lmb_region *_rgn = &(lmb.reserved);
201 196
202 return lmb_add_region(_rgn, base, size); 197 return lmb_add_region(_rgn, base, size);
203} 198}
204 199
205long __init 200long __init lmb_overlaps_region(struct lmb_region *rgn, unsigned long base,
206lmb_overlaps_region(struct lmb_region *rgn, unsigned long base, unsigned long size) 201 unsigned long size)
207{ 202{
208 unsigned long i; 203 unsigned long i;
209 204
@@ -218,39 +213,44 @@ lmb_overlaps_region(struct lmb_region *rgn, unsigned long base, unsigned long si
218 return (i < rgn->cnt) ? i : -1; 213 return (i < rgn->cnt) ? i : -1;
219} 214}
220 215
221unsigned long __init 216unsigned long __init lmb_alloc(unsigned long size, unsigned long align)
222lmb_alloc(unsigned long size, unsigned long align)
223{ 217{
224 return lmb_alloc_base(size, align, LMB_ALLOC_ANYWHERE); 218 return lmb_alloc_base(size, align, LMB_ALLOC_ANYWHERE);
225} 219}
226 220
227unsigned long __init 221unsigned long __init lmb_alloc_base(unsigned long size, unsigned long align,
228lmb_alloc_base(unsigned long size, unsigned long align, unsigned long max_addr) 222 unsigned long max_addr)
229{ 223{
230 long i, j; 224 long i, j;
231 unsigned long base = 0; 225 unsigned long base = 0;
232 226
233 for (i=lmb.memory.cnt-1; i >= 0; i--) { 227#ifdef CONFIG_PPC32
228 /* On 32-bit, make sure we allocate lowmem */
229 if (max_addr == LMB_ALLOC_ANYWHERE)
230 max_addr = __max_low_memory;
231#endif
232 for (i = lmb.memory.cnt-1; i >= 0; i--) {
234 unsigned long lmbbase = lmb.memory.region[i].base; 233 unsigned long lmbbase = lmb.memory.region[i].base;
235 unsigned long lmbsize = lmb.memory.region[i].size; 234 unsigned long lmbsize = lmb.memory.region[i].size;
236 235
237 if ( max_addr == LMB_ALLOC_ANYWHERE ) 236 if (max_addr == LMB_ALLOC_ANYWHERE)
238 base = _ALIGN_DOWN(lmbbase+lmbsize-size, align); 237 base = _ALIGN_DOWN(lmbbase + lmbsize - size, align);
239 else if ( lmbbase < max_addr ) 238 else if (lmbbase < max_addr) {
240 base = _ALIGN_DOWN(min(lmbbase+lmbsize,max_addr)-size, align); 239 base = min(lmbbase + lmbsize, max_addr);
241 else 240 base = _ALIGN_DOWN(base - size, align);
241 } else
242 continue; 242 continue;
243 243
244 while ( (lmbbase <= base) && 244 while ((lmbbase <= base) &&
245 ((j = lmb_overlaps_region(&lmb.reserved,base,size)) >= 0) ) { 245 ((j = lmb_overlaps_region(&lmb.reserved, base, size)) >= 0) )
246 base = _ALIGN_DOWN(lmb.reserved.region[j].base-size, align); 246 base = _ALIGN_DOWN(lmb.reserved.region[j].base - size,
247 } 247 align);
248 248
249 if ( (base != 0) && (lmbbase <= base) ) 249 if ((base != 0) && (lmbbase <= base))
250 break; 250 break;
251 } 251 }
252 252
253 if ( i < 0 ) 253 if (i < 0)
254 return 0; 254 return 0;
255 255
256 lmb_add_region(&lmb.reserved, base, size); 256 lmb_add_region(&lmb.reserved, base, size);
@@ -259,14 +259,12 @@ lmb_alloc_base(unsigned long size, unsigned long align, unsigned long max_addr)
259} 259}
260 260
261/* You must call lmb_analyze() before this. */ 261/* You must call lmb_analyze() before this. */
262unsigned long __init 262unsigned long __init lmb_phys_mem_size(void)
263lmb_phys_mem_size(void)
264{ 263{
265 return lmb.memory.size; 264 return lmb.memory.size;
266} 265}
267 266
268unsigned long __init 267unsigned long __init lmb_end_of_DRAM(void)
269lmb_end_of_DRAM(void)
270{ 268{
271 int idx = lmb.memory.cnt - 1; 269 int idx = lmb.memory.cnt - 1;
272 270
@@ -277,9 +275,8 @@ lmb_end_of_DRAM(void)
277 * Truncate the lmb list to memory_limit if it's set 275 * Truncate the lmb list to memory_limit if it's set
278 * You must call lmb_analyze() after this. 276 * You must call lmb_analyze() after this.
279 */ 277 */
280void __init lmb_enforce_memory_limit(void) 278void __init lmb_enforce_memory_limit(unsigned long memory_limit)
281{ 279{
282 extern unsigned long memory_limit;
283 unsigned long i, limit; 280 unsigned long i, limit;
284 281
285 if (! memory_limit) 282 if (! memory_limit)
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
new file mode 100644
index 000000000000..117b00012e14
--- /dev/null
+++ b/arch/powerpc/mm/mem.c
@@ -0,0 +1,564 @@
1/*
2 * PowerPC version
3 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
4 *
5 * Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
6 * and Cort Dougan (PReP) (cort@cs.nmt.edu)
7 * Copyright (C) 1996 Paul Mackerras
8 * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk).
9 * PPC44x/36-bit changes by Matt Porter (mporter@mvista.com)
10 *
11 * Derived from "arch/i386/mm/init.c"
12 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version
17 * 2 of the License, or (at your option) any later version.
18 *
19 */
20
21#include <linux/config.h>
22#include <linux/module.h>
23#include <linux/sched.h>
24#include <linux/kernel.h>
25#include <linux/errno.h>
26#include <linux/string.h>
27#include <linux/types.h>
28#include <linux/mm.h>
29#include <linux/stddef.h>
30#include <linux/init.h>
31#include <linux/bootmem.h>
32#include <linux/highmem.h>
33#include <linux/initrd.h>
34#include <linux/pagemap.h>
35
36#include <asm/pgalloc.h>
37#include <asm/prom.h>
38#include <asm/io.h>
39#include <asm/mmu_context.h>
40#include <asm/pgtable.h>
41#include <asm/mmu.h>
42#include <asm/smp.h>
43#include <asm/machdep.h>
44#include <asm/btext.h>
45#include <asm/tlb.h>
46#include <asm/prom.h>
47#include <asm/lmb.h>
48#include <asm/sections.h>
49#ifdef CONFIG_PPC64
50#include <asm/vdso.h>
51#endif
52
53#include "mmu_decl.h"
54
55#ifndef CPU_FTR_COHERENT_ICACHE
56#define CPU_FTR_COHERENT_ICACHE 0 /* XXX for now */
57#define CPU_FTR_NOEXECUTE 0
58#endif
59
60int init_bootmem_done;
61int mem_init_done;
62unsigned long memory_limit;
63
64/*
65 * This is called by /dev/mem to know if a given address has to
66 * be mapped non-cacheable or not
67 */
68int page_is_ram(unsigned long pfn)
69{
70 unsigned long paddr = (pfn << PAGE_SHIFT);
71
72#ifndef CONFIG_PPC64 /* XXX for now */
73 return paddr < __pa(high_memory);
74#else
75 int i;
76 for (i=0; i < lmb.memory.cnt; i++) {
77 unsigned long base;
78
79 base = lmb.memory.region[i].base;
80
81 if ((paddr >= base) &&
82 (paddr < (base + lmb.memory.region[i].size))) {
83 return 1;
84 }
85 }
86
87 return 0;
88#endif
89}
90EXPORT_SYMBOL(page_is_ram);
91
92pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
93 unsigned long size, pgprot_t vma_prot)
94{
95 if (ppc_md.phys_mem_access_prot)
96 return ppc_md.phys_mem_access_prot(file, pfn, size, vma_prot);
97
98 if (!page_is_ram(pfn))
99 vma_prot = __pgprot(pgprot_val(vma_prot)
100 | _PAGE_GUARDED | _PAGE_NO_CACHE);
101 return vma_prot;
102}
103EXPORT_SYMBOL(phys_mem_access_prot);
104
105#ifdef CONFIG_MEMORY_HOTPLUG
106
107void online_page(struct page *page)
108{
109 ClearPageReserved(page);
110 free_cold_page(page);
111 totalram_pages++;
112 num_physpages++;
113}
114
115/*
116 * This works only for the non-NUMA case. Later, we'll need a lookup
117 * to convert from real physical addresses to nid, that doesn't use
118 * pfn_to_nid().
119 */
120int __devinit add_memory(u64 start, u64 size)
121{
122 struct pglist_data *pgdata = NODE_DATA(0);
123 struct zone *zone;
124 unsigned long start_pfn = start >> PAGE_SHIFT;
125 unsigned long nr_pages = size >> PAGE_SHIFT;
126
127 /* this should work for most non-highmem platforms */
128 zone = pgdata->node_zones;
129
130 return __add_pages(zone, start_pfn, nr_pages);
131
132 return 0;
133}
134
135/*
136 * First pass at this code will check to determine if the remove
137 * request is within the RMO. Do not allow removal within the RMO.
138 */
139int __devinit remove_memory(u64 start, u64 size)
140{
141 struct zone *zone;
142 unsigned long start_pfn, end_pfn, nr_pages;
143
144 start_pfn = start >> PAGE_SHIFT;
145 nr_pages = size >> PAGE_SHIFT;
146 end_pfn = start_pfn + nr_pages;
147
148 printk("%s(): Attempting to remove memoy in range "
149 "%lx to %lx\n", __func__, start, start+size);
150 /*
151 * check for range within RMO
152 */
153 zone = page_zone(pfn_to_page(start_pfn));
154
155 printk("%s(): memory will be removed from "
156 "the %s zone\n", __func__, zone->name);
157
158 /*
159 * not handling removing memory ranges that
160 * overlap multiple zones yet
161 */
162 if (end_pfn > (zone->zone_start_pfn + zone->spanned_pages))
163 goto overlap;
164
165 /* make sure it is NOT in RMO */
166 if ((start < lmb.rmo_size) || ((start+size) < lmb.rmo_size)) {
167 printk("%s(): range to be removed must NOT be in RMO!\n",
168 __func__);
169 goto in_rmo;
170 }
171
172 return __remove_pages(zone, start_pfn, nr_pages);
173
174overlap:
175 printk("%s(): memory range to be removed overlaps "
176 "multiple zones!!!\n", __func__);
177in_rmo:
178 return -1;
179}
180#endif /* CONFIG_MEMORY_HOTPLUG */
181
182void show_mem(void)
183{
184 unsigned long total = 0, reserved = 0;
185 unsigned long shared = 0, cached = 0;
186 unsigned long highmem = 0;
187 struct page *page;
188 pg_data_t *pgdat;
189 unsigned long i;
190
191 printk("Mem-info:\n");
192 show_free_areas();
193 printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
194 for_each_pgdat(pgdat) {
195 unsigned long flags;
196 pgdat_resize_lock(pgdat, &flags);
197 for (i = 0; i < pgdat->node_spanned_pages; i++) {
198 page = pgdat_page_nr(pgdat, i);
199 total++;
200 if (PageHighMem(page))
201 highmem++;
202 if (PageReserved(page))
203 reserved++;
204 else if (PageSwapCache(page))
205 cached++;
206 else if (page_count(page))
207 shared += page_count(page) - 1;
208 }
209 pgdat_resize_unlock(pgdat, &flags);
210 }
211 printk("%ld pages of RAM\n", total);
212#ifdef CONFIG_HIGHMEM
213 printk("%ld pages of HIGHMEM\n", highmem);
214#endif
215 printk("%ld reserved pages\n", reserved);
216 printk("%ld pages shared\n", shared);
217 printk("%ld pages swap cached\n", cached);
218}
219
220/*
221 * Initialize the bootmem system and give it all the memory we
222 * have available. If we are using highmem, we only put the
223 * lowmem into the bootmem system.
224 */
225#ifndef CONFIG_NEED_MULTIPLE_NODES
226void __init do_init_bootmem(void)
227{
228 unsigned long i;
229 unsigned long start, bootmap_pages;
230 unsigned long total_pages;
231 int boot_mapsize;
232
233 max_pfn = total_pages = lmb_end_of_DRAM() >> PAGE_SHIFT;
234#ifdef CONFIG_HIGHMEM
235 total_pages = total_lowmem >> PAGE_SHIFT;
236#endif
237
238 /*
239 * Find an area to use for the bootmem bitmap. Calculate the size of
240 * bitmap required as (Total Memory) / PAGE_SIZE / BITS_PER_BYTE.
241 * Add 1 additional page in case the address isn't page-aligned.
242 */
243 bootmap_pages = bootmem_bootmap_pages(total_pages);
244
245 start = lmb_alloc(bootmap_pages << PAGE_SHIFT, PAGE_SIZE);
246 BUG_ON(!start);
247
248 boot_mapsize = init_bootmem(start >> PAGE_SHIFT, total_pages);
249
250 /* Add all physical memory to the bootmem map, mark each area
251 * present.
252 */
253 for (i = 0; i < lmb.memory.cnt; i++) {
254 unsigned long base = lmb.memory.region[i].base;
255 unsigned long size = lmb_size_bytes(&lmb.memory, i);
256#ifdef CONFIG_HIGHMEM
257 if (base >= total_lowmem)
258 continue;
259 if (base + size > total_lowmem)
260 size = total_lowmem - base;
261#endif
262 free_bootmem(base, size);
263 }
264
265 /* reserve the sections we're already using */
266 for (i = 0; i < lmb.reserved.cnt; i++)
267 reserve_bootmem(lmb.reserved.region[i].base,
268 lmb_size_bytes(&lmb.reserved, i));
269
270 /* XXX need to clip this if using highmem? */
271 for (i = 0; i < lmb.memory.cnt; i++)
272 memory_present(0, lmb_start_pfn(&lmb.memory, i),
273 lmb_end_pfn(&lmb.memory, i));
274 init_bootmem_done = 1;
275}
276
277/*
278 * paging_init() sets up the page tables - in fact we've already done this.
279 */
280void __init paging_init(void)
281{
282 unsigned long zones_size[MAX_NR_ZONES];
283 unsigned long zholes_size[MAX_NR_ZONES];
284 unsigned long total_ram = lmb_phys_mem_size();
285 unsigned long top_of_ram = lmb_end_of_DRAM();
286
287#ifdef CONFIG_HIGHMEM
288 map_page(PKMAP_BASE, 0, 0); /* XXX gross */
289 pkmap_page_table = pte_offset_kernel(pmd_offset(pgd_offset_k
290 (PKMAP_BASE), PKMAP_BASE), PKMAP_BASE);
291 map_page(KMAP_FIX_BEGIN, 0, 0); /* XXX gross */
292 kmap_pte = pte_offset_kernel(pmd_offset(pgd_offset_k
293 (KMAP_FIX_BEGIN), KMAP_FIX_BEGIN), KMAP_FIX_BEGIN);
294 kmap_prot = PAGE_KERNEL;
295#endif /* CONFIG_HIGHMEM */
296
297 printk(KERN_INFO "Top of RAM: 0x%lx, Total RAM: 0x%lx\n",
298 top_of_ram, total_ram);
299 printk(KERN_INFO "Memory hole size: %ldMB\n",
300 (top_of_ram - total_ram) >> 20);
301 /*
302 * All pages are DMA-able so we put them all in the DMA zone.
303 */
304 memset(zones_size, 0, sizeof(zones_size));
305 memset(zholes_size, 0, sizeof(zholes_size));
306
307 zones_size[ZONE_DMA] = top_of_ram >> PAGE_SHIFT;
308 zholes_size[ZONE_DMA] = (top_of_ram - total_ram) >> PAGE_SHIFT;
309
310#ifdef CONFIG_HIGHMEM
311 zones_size[ZONE_DMA] = total_lowmem >> PAGE_SHIFT;
312 zones_size[ZONE_HIGHMEM] = (total_memory - total_lowmem) >> PAGE_SHIFT;
313 zholes_size[ZONE_HIGHMEM] = (top_of_ram - total_ram) >> PAGE_SHIFT;
314#else
315 zones_size[ZONE_DMA] = top_of_ram >> PAGE_SHIFT;
316 zholes_size[ZONE_DMA] = (top_of_ram - total_ram) >> PAGE_SHIFT;
317#endif /* CONFIG_HIGHMEM */
318
319 free_area_init_node(0, NODE_DATA(0), zones_size,
320 __pa(PAGE_OFFSET) >> PAGE_SHIFT, zholes_size);
321}
322#endif /* ! CONFIG_NEED_MULTIPLE_NODES */
323
324void __init mem_init(void)
325{
326#ifdef CONFIG_NEED_MULTIPLE_NODES
327 int nid;
328#endif
329 pg_data_t *pgdat;
330 unsigned long i;
331 struct page *page;
332 unsigned long reservedpages = 0, codesize, initsize, datasize, bsssize;
333
334 num_physpages = max_pfn; /* RAM is assumed contiguous */
335 high_memory = (void *) __va(max_low_pfn * PAGE_SIZE);
336
337#ifdef CONFIG_NEED_MULTIPLE_NODES
338 for_each_online_node(nid) {
339 if (NODE_DATA(nid)->node_spanned_pages != 0) {
340 printk("freeing bootmem node %x\n", nid);
341 totalram_pages +=
342 free_all_bootmem_node(NODE_DATA(nid));
343 }
344 }
345#else
346 max_mapnr = num_physpages;
347 totalram_pages += free_all_bootmem();
348#endif
349 for_each_pgdat(pgdat) {
350 for (i = 0; i < pgdat->node_spanned_pages; i++) {
351 page = pgdat_page_nr(pgdat, i);
352 if (PageReserved(page))
353 reservedpages++;
354 }
355 }
356
357 codesize = (unsigned long)&_sdata - (unsigned long)&_stext;
358 datasize = (unsigned long)&__init_begin - (unsigned long)&_sdata;
359 initsize = (unsigned long)&__init_end - (unsigned long)&__init_begin;
360 bsssize = (unsigned long)&__bss_stop - (unsigned long)&__bss_start;
361
362#ifdef CONFIG_HIGHMEM
363 {
364 unsigned long pfn, highmem_mapnr;
365
366 highmem_mapnr = total_lowmem >> PAGE_SHIFT;
367 for (pfn = highmem_mapnr; pfn < max_mapnr; ++pfn) {
368 struct page *page = pfn_to_page(pfn);
369
370 ClearPageReserved(page);
371 set_page_count(page, 1);
372 __free_page(page);
373 totalhigh_pages++;
374 }
375 totalram_pages += totalhigh_pages;
376 printk(KERN_INFO "High memory: %luk\n",
377 totalhigh_pages << (PAGE_SHIFT-10));
378 }
379#endif /* CONFIG_HIGHMEM */
380
381 printk(KERN_INFO "Memory: %luk/%luk available (%luk kernel code, "
382 "%luk reserved, %luk data, %luk bss, %luk init)\n",
383 (unsigned long)nr_free_pages() << (PAGE_SHIFT-10),
384 num_physpages << (PAGE_SHIFT-10),
385 codesize >> 10,
386 reservedpages << (PAGE_SHIFT-10),
387 datasize >> 10,
388 bsssize >> 10,
389 initsize >> 10);
390
391 mem_init_done = 1;
392
393#ifdef CONFIG_PPC64
394 /* Initialize the vDSO */
395 vdso_init();
396#endif
397}
398
399/*
400 * This is called when a page has been modified by the kernel.
401 * It just marks the page as not i-cache clean. We do the i-cache
402 * flush later when the page is given to a user process, if necessary.
403 */
404void flush_dcache_page(struct page *page)
405{
406 if (cpu_has_feature(CPU_FTR_COHERENT_ICACHE))
407 return;
408 /* avoid an atomic op if possible */
409 if (test_bit(PG_arch_1, &page->flags))
410 clear_bit(PG_arch_1, &page->flags);
411}
412EXPORT_SYMBOL(flush_dcache_page);
413
414void flush_dcache_icache_page(struct page *page)
415{
416#ifdef CONFIG_BOOKE
417 void *start = kmap_atomic(page, KM_PPC_SYNC_ICACHE);
418 __flush_dcache_icache(start);
419 kunmap_atomic(start, KM_PPC_SYNC_ICACHE);
420#elif defined(CONFIG_8xx) || defined(CONFIG_PPC64)
421 /* On 8xx there is no need to kmap since highmem is not supported */
422 __flush_dcache_icache(page_address(page));
423#else
424 __flush_dcache_icache_phys(page_to_pfn(page) << PAGE_SHIFT);
425#endif
426
427}
428void clear_user_page(void *page, unsigned long vaddr, struct page *pg)
429{
430 clear_page(page);
431
432 if (cpu_has_feature(CPU_FTR_COHERENT_ICACHE))
433 return;
434 /*
435 * We shouldnt have to do this, but some versions of glibc
436 * require it (ld.so assumes zero filled pages are icache clean)
437 * - Anton
438 */
439
440 /* avoid an atomic op if possible */
441 if (test_bit(PG_arch_1, &pg->flags))
442 clear_bit(PG_arch_1, &pg->flags);
443}
444EXPORT_SYMBOL(clear_user_page);
445
446void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
447 struct page *pg)
448{
449 copy_page(vto, vfrom);
450
451 /*
452 * We should be able to use the following optimisation, however
453 * there are two problems.
454 * Firstly a bug in some versions of binutils meant PLT sections
455 * were not marked executable.
456 * Secondly the first word in the GOT section is blrl, used
457 * to establish the GOT address. Until recently the GOT was
458 * not marked executable.
459 * - Anton
460 */
461#if 0
462 if (!vma->vm_file && ((vma->vm_flags & VM_EXEC) == 0))
463 return;
464#endif
465
466 if (cpu_has_feature(CPU_FTR_COHERENT_ICACHE))
467 return;
468
469 /* avoid an atomic op if possible */
470 if (test_bit(PG_arch_1, &pg->flags))
471 clear_bit(PG_arch_1, &pg->flags);
472}
473
474void flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
475 unsigned long addr, int len)
476{
477 unsigned long maddr;
478
479 maddr = (unsigned long) kmap(page) + (addr & ~PAGE_MASK);
480 flush_icache_range(maddr, maddr + len);
481 kunmap(page);
482}
483EXPORT_SYMBOL(flush_icache_user_range);
484
485/*
486 * This is called at the end of handling a user page fault, when the
487 * fault has been handled by updating a PTE in the linux page tables.
488 * We use it to preload an HPTE into the hash table corresponding to
489 * the updated linux PTE.
490 *
491 * This must always be called with the mm->page_table_lock held
492 */
493void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
494 pte_t pte)
495{
496 /* handle i-cache coherency */
497 unsigned long pfn = pte_pfn(pte);
498#ifdef CONFIG_PPC32
499 pmd_t *pmd;
500#else
501 unsigned long vsid;
502 void *pgdir;
503 pte_t *ptep;
504 int local = 0;
505 cpumask_t tmp;
506 unsigned long flags;
507#endif
508
509 /* handle i-cache coherency */
510 if (!cpu_has_feature(CPU_FTR_COHERENT_ICACHE) &&
511 !cpu_has_feature(CPU_FTR_NOEXECUTE) &&
512 pfn_valid(pfn)) {
513 struct page *page = pfn_to_page(pfn);
514 if (!PageReserved(page)
515 && !test_bit(PG_arch_1, &page->flags)) {
516 if (vma->vm_mm == current->active_mm) {
517#ifdef CONFIG_8xx
518 /* On 8xx, cache control instructions (particularly
519 * "dcbst" from flush_dcache_icache) fault as write
520 * operation if there is an unpopulated TLB entry
521 * for the address in question. To workaround that,
522 * we invalidate the TLB here, thus avoiding dcbst
523 * misbehaviour.
524 */
525 _tlbie(address);
526#endif
527 __flush_dcache_icache((void *) address);
528 } else
529 flush_dcache_icache_page(page);
530 set_bit(PG_arch_1, &page->flags);
531 }
532 }
533
534#ifdef CONFIG_PPC_STD_MMU
535 /* We only want HPTEs for linux PTEs that have _PAGE_ACCESSED set */
536 if (!pte_young(pte) || address >= TASK_SIZE)
537 return;
538#ifdef CONFIG_PPC32
539 if (Hash == 0)
540 return;
541 pmd = pmd_offset(pgd_offset(vma->vm_mm, address), address);
542 if (!pmd_none(*pmd))
543 add_hash_page(vma->vm_mm->context, address, pmd_val(*pmd));
544#else
545 pgdir = vma->vm_mm->pgd;
546 if (pgdir == NULL)
547 return;
548
549 ptep = find_linux_pte(pgdir, address);
550 if (!ptep)
551 return;
552
553 vsid = get_vsid(vma->vm_mm->context.id, address);
554
555 local_irq_save(flags);
556 tmp = cpumask_of_cpu(smp_processor_id());
557 if (cpus_equal(vma->vm_mm->cpu_vm_mask, tmp))
558 local = 1;
559
560 __hash_page(address, 0, vsid, ptep, 0x300, local);
561 local_irq_restore(flags);
562#endif
563#endif
564}
diff --git a/arch/ppc64/mm/mmap.c b/arch/powerpc/mm/mmap.c
index fe65f522aff3..fe65f522aff3 100644
--- a/arch/ppc64/mm/mmap.c
+++ b/arch/powerpc/mm/mmap.c
diff --git a/arch/powerpc/mm/mmu_context_32.c b/arch/powerpc/mm/mmu_context_32.c
new file mode 100644
index 000000000000..a8816e0f6a86
--- /dev/null
+++ b/arch/powerpc/mm/mmu_context_32.c
@@ -0,0 +1,86 @@
1/*
2 * This file contains the routines for handling the MMU on those
3 * PowerPC implementations where the MMU substantially follows the
4 * architecture specification. This includes the 6xx, 7xx, 7xxx,
5 * 8260, and POWER3 implementations but excludes the 8xx and 4xx.
6 * -- paulus
7 *
8 * Derived from arch/ppc/mm/init.c:
9 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
10 *
11 * Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
12 * and Cort Dougan (PReP) (cort@cs.nmt.edu)
13 * Copyright (C) 1996 Paul Mackerras
14 * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk).
15 *
16 * Derived from "arch/i386/mm/init.c"
17 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
18 *
19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License
21 * as published by the Free Software Foundation; either version
22 * 2 of the License, or (at your option) any later version.
23 *
24 */
25
26#include <linux/config.h>
27#include <linux/mm.h>
28#include <linux/init.h>
29
30#include <asm/mmu_context.h>
31#include <asm/tlbflush.h>
32
33mm_context_t next_mmu_context;
34unsigned long context_map[LAST_CONTEXT / BITS_PER_LONG + 1];
35#ifdef FEW_CONTEXTS
36atomic_t nr_free_contexts;
37struct mm_struct *context_mm[LAST_CONTEXT+1];
38void steal_context(void);
39#endif /* FEW_CONTEXTS */
40
41/*
42 * Initialize the context management stuff.
43 */
44void __init
45mmu_context_init(void)
46{
47 /*
48 * Some processors have too few contexts to reserve one for
49 * init_mm, and require using context 0 for a normal task.
50 * Other processors reserve the use of context zero for the kernel.
51 * This code assumes FIRST_CONTEXT < 32.
52 */
53 context_map[0] = (1 << FIRST_CONTEXT) - 1;
54 next_mmu_context = FIRST_CONTEXT;
55#ifdef FEW_CONTEXTS
56 atomic_set(&nr_free_contexts, LAST_CONTEXT - FIRST_CONTEXT + 1);
57#endif /* FEW_CONTEXTS */
58}
59
60#ifdef FEW_CONTEXTS
61/*
62 * Steal a context from a task that has one at the moment.
63 * This is only used on 8xx and 4xx and we presently assume that
64 * they don't do SMP. If they do then this will have to check
65 * whether the MM we steal is in use.
66 * We also assume that this is only used on systems that don't
67 * use an MMU hash table - this is true for 8xx and 4xx.
68 * This isn't an LRU system, it just frees up each context in
69 * turn (sort-of pseudo-random replacement :). This would be the
70 * place to implement an LRU scheme if anyone was motivated to do it.
71 * -- paulus
72 */
73void
74steal_context(void)
75{
76 struct mm_struct *mm;
77
78 /* free up context `next_mmu_context' */
79 /* if we shouldn't free context 0, don't... */
80 if (next_mmu_context < FIRST_CONTEXT)
81 next_mmu_context = FIRST_CONTEXT;
82 mm = context_mm[next_mmu_context];
83 flush_tlb_mm(mm);
84 destroy_context(mm);
85}
86#endif /* FEW_CONTEXTS */
diff --git a/arch/powerpc/mm/mmu_context_64.c b/arch/powerpc/mm/mmu_context_64.c
new file mode 100644
index 000000000000..714a84dd8d5d
--- /dev/null
+++ b/arch/powerpc/mm/mmu_context_64.c
@@ -0,0 +1,63 @@
1/*
2 * MMU context allocation for 64-bit kernels.
3 *
4 * Copyright (C) 2004 Anton Blanchard, IBM Corp. <anton@samba.org>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 *
11 */
12
13#include <linux/config.h>
14#include <linux/sched.h>
15#include <linux/kernel.h>
16#include <linux/errno.h>
17#include <linux/string.h>
18#include <linux/types.h>
19#include <linux/mm.h>
20#include <linux/spinlock.h>
21#include <linux/idr.h>
22
23#include <asm/mmu_context.h>
24
25static DEFINE_SPINLOCK(mmu_context_lock);
26static DEFINE_IDR(mmu_context_idr);
27
28int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
29{
30 int index;
31 int err;
32
33again:
34 if (!idr_pre_get(&mmu_context_idr, GFP_KERNEL))
35 return -ENOMEM;
36
37 spin_lock(&mmu_context_lock);
38 err = idr_get_new_above(&mmu_context_idr, NULL, 1, &index);
39 spin_unlock(&mmu_context_lock);
40
41 if (err == -EAGAIN)
42 goto again;
43 else if (err)
44 return err;
45
46 if (index > MAX_CONTEXT) {
47 idr_remove(&mmu_context_idr, index);
48 return -ENOMEM;
49 }
50
51 mm->context.id = index;
52
53 return 0;
54}
55
56void destroy_context(struct mm_struct *mm)
57{
58 spin_lock(&mmu_context_lock);
59 idr_remove(&mmu_context_idr, mm->context.id);
60 spin_unlock(&mmu_context_lock);
61
62 mm->context.id = NO_CONTEXT;
63}
diff --git a/arch/powerpc/mm/mmu_decl.h b/arch/powerpc/mm/mmu_decl.h
new file mode 100644
index 000000000000..a4d7a327c0e5
--- /dev/null
+++ b/arch/powerpc/mm/mmu_decl.h
@@ -0,0 +1,87 @@
1/*
2 * Declarations of procedures and variables shared between files
3 * in arch/ppc/mm/.
4 *
5 * Derived from arch/ppc/mm/init.c:
6 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
7 *
8 * Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
9 * and Cort Dougan (PReP) (cort@cs.nmt.edu)
10 * Copyright (C) 1996 Paul Mackerras
11 * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk).
12 *
13 * Derived from "arch/i386/mm/init.c"
14 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
15 *
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version
19 * 2 of the License, or (at your option) any later version.
20 *
21 */
22#include <asm/tlbflush.h>
23#include <asm/mmu.h>
24
25#ifdef CONFIG_PPC32
26extern void mapin_ram(void);
27extern int map_page(unsigned long va, phys_addr_t pa, int flags);
28extern void setbat(int index, unsigned long virt, unsigned long phys,
29 unsigned int size, int flags);
30extern void settlbcam(int index, unsigned long virt, phys_addr_t phys,
31 unsigned int size, int flags, unsigned int pid);
32extern void invalidate_tlbcam_entry(int index);
33
34extern int __map_without_bats;
35extern unsigned long ioremap_base;
36extern unsigned long ioremap_bot;
37extern unsigned int rtas_data, rtas_size;
38
39extern PTE *Hash, *Hash_end;
40extern unsigned long Hash_size, Hash_mask;
41
42extern unsigned int num_tlbcam_entries;
43#endif
44
45extern unsigned long __max_low_memory;
46extern unsigned long __initial_memory_limit;
47extern unsigned long total_memory;
48extern unsigned long total_lowmem;
49
50/* ...and now those things that may be slightly different between processor
51 * architectures. -- Dan
52 */
53#if defined(CONFIG_8xx)
54#define flush_HPTE(X, va, pg) _tlbie(va)
55#define MMU_init_hw() do { } while(0)
56#define mmu_mapin_ram() (0UL)
57
58#elif defined(CONFIG_4xx)
59#define flush_HPTE(X, va, pg) _tlbie(va)
60extern void MMU_init_hw(void);
61extern unsigned long mmu_mapin_ram(void);
62
63#elif defined(CONFIG_FSL_BOOKE)
64#define flush_HPTE(X, va, pg) _tlbie(va)
65extern void MMU_init_hw(void);
66extern unsigned long mmu_mapin_ram(void);
67extern void adjust_total_lowmem(void);
68
69#elif defined(CONFIG_PPC32)
70/* anything 32-bit except 4xx or 8xx */
71extern void MMU_init_hw(void);
72extern unsigned long mmu_mapin_ram(void);
73
74/* Be careful....this needs to be updated if we ever encounter 603 SMPs,
75 * which includes all new 82xx processors. We need tlbie/tlbsync here
76 * in that case (I think). -- Dan.
77 */
78static inline void flush_HPTE(unsigned context, unsigned long va,
79 unsigned long pdval)
80{
81 if ((Hash != 0) &&
82 cpu_has_feature(CPU_FTR_HPTE_TABLE))
83 flush_hash_pages(0, va, pdval, 1);
84 else
85 _tlbie(va);
86}
87#endif
diff --git a/arch/ppc64/mm/numa.c b/arch/powerpc/mm/numa.c
index cb864b8f2750..4035cad8d7f1 100644
--- a/arch/ppc64/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -20,6 +20,7 @@
20#include <asm/lmb.h> 20#include <asm/lmb.h>
21#include <asm/machdep.h> 21#include <asm/machdep.h>
22#include <asm/abs_addr.h> 22#include <asm/abs_addr.h>
23#include <asm/system.h>
23 24
24static int numa_enabled = 1; 25static int numa_enabled = 1;
25 26
@@ -300,7 +301,6 @@ static unsigned long __init numa_enforce_memory_limit(unsigned long start, unsig
300 * we've already adjusted it for the limit and it takes care of 301 * we've already adjusted it for the limit and it takes care of
301 * having memory holes below the limit. 302 * having memory holes below the limit.
302 */ 303 */
303 extern unsigned long memory_limit;
304 304
305 if (! memory_limit) 305 if (! memory_limit)
306 return size; 306 return size;
diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
new file mode 100644
index 000000000000..f4e5ac122615
--- /dev/null
+++ b/arch/powerpc/mm/pgtable_32.c
@@ -0,0 +1,467 @@
1/*
2 * This file contains the routines setting up the linux page tables.
3 * -- paulus
4 *
5 * Derived from arch/ppc/mm/init.c:
6 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
7 *
8 * Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
9 * and Cort Dougan (PReP) (cort@cs.nmt.edu)
10 * Copyright (C) 1996 Paul Mackerras
11 * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk).
12 *
13 * Derived from "arch/i386/mm/init.c"
14 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
15 *
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version
19 * 2 of the License, or (at your option) any later version.
20 *
21 */
22
23#include <linux/config.h>
24#include <linux/kernel.h>
25#include <linux/module.h>
26#include <linux/types.h>
27#include <linux/mm.h>
28#include <linux/vmalloc.h>
29#include <linux/init.h>
30#include <linux/highmem.h>
31
32#include <asm/pgtable.h>
33#include <asm/pgalloc.h>
34#include <asm/io.h>
35
36#include "mmu_decl.h"
37
38unsigned long ioremap_base;
39unsigned long ioremap_bot;
40int io_bat_index;
41
42#if defined(CONFIG_6xx) || defined(CONFIG_POWER3)
43#define HAVE_BATS 1
44#endif
45
46#if defined(CONFIG_FSL_BOOKE)
47#define HAVE_TLBCAM 1
48#endif
49
50extern char etext[], _stext[];
51
52#ifdef CONFIG_SMP
53extern void hash_page_sync(void);
54#endif
55
56#ifdef HAVE_BATS
57extern unsigned long v_mapped_by_bats(unsigned long va);
58extern unsigned long p_mapped_by_bats(unsigned long pa);
59void setbat(int index, unsigned long virt, unsigned long phys,
60 unsigned int size, int flags);
61
62#else /* !HAVE_BATS */
63#define v_mapped_by_bats(x) (0UL)
64#define p_mapped_by_bats(x) (0UL)
65#endif /* HAVE_BATS */
66
67#ifdef HAVE_TLBCAM
68extern unsigned int tlbcam_index;
69extern unsigned long v_mapped_by_tlbcam(unsigned long va);
70extern unsigned long p_mapped_by_tlbcam(unsigned long pa);
71#else /* !HAVE_TLBCAM */
72#define v_mapped_by_tlbcam(x) (0UL)
73#define p_mapped_by_tlbcam(x) (0UL)
74#endif /* HAVE_TLBCAM */
75
76#ifdef CONFIG_PTE_64BIT
77/* 44x uses an 8kB pgdir because it has 8-byte Linux PTEs. */
78#define PGDIR_ORDER 1
79#else
80#define PGDIR_ORDER 0
81#endif
82
83pgd_t *pgd_alloc(struct mm_struct *mm)
84{
85 pgd_t *ret;
86
87 ret = (pgd_t *)__get_free_pages(GFP_KERNEL|__GFP_ZERO, PGDIR_ORDER);
88 return ret;
89}
90
91void pgd_free(pgd_t *pgd)
92{
93 free_pages((unsigned long)pgd, PGDIR_ORDER);
94}
95
96pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
97{
98 pte_t *pte;
99 extern int mem_init_done;
100 extern void *early_get_page(void);
101
102 if (mem_init_done) {
103 pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
104 } else {
105 pte = (pte_t *)early_get_page();
106 if (pte)
107 clear_page(pte);
108 }
109 return pte;
110}
111
112struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
113{
114 struct page *ptepage;
115
116#ifdef CONFIG_HIGHPTE
117 gfp_t flags = GFP_KERNEL | __GFP_HIGHMEM | __GFP_REPEAT;
118#else
119 gfp_t flags = GFP_KERNEL | __GFP_REPEAT;
120#endif
121
122 ptepage = alloc_pages(flags, 0);
123 if (ptepage)
124 clear_highpage(ptepage);
125 return ptepage;
126}
127
128void pte_free_kernel(pte_t *pte)
129{
130#ifdef CONFIG_SMP
131 hash_page_sync();
132#endif
133 free_page((unsigned long)pte);
134}
135
136void pte_free(struct page *ptepage)
137{
138#ifdef CONFIG_SMP
139 hash_page_sync();
140#endif
141 __free_page(ptepage);
142}
143
144#ifndef CONFIG_PHYS_64BIT
145void __iomem *
146ioremap(phys_addr_t addr, unsigned long size)
147{
148 return __ioremap(addr, size, _PAGE_NO_CACHE);
149}
150#else /* CONFIG_PHYS_64BIT */
151void __iomem *
152ioremap64(unsigned long long addr, unsigned long size)
153{
154 return __ioremap(addr, size, _PAGE_NO_CACHE);
155}
156
157void __iomem *
158ioremap(phys_addr_t addr, unsigned long size)
159{
160 phys_addr_t addr64 = fixup_bigphys_addr(addr, size);
161
162 return ioremap64(addr64, size);
163}
164#endif /* CONFIG_PHYS_64BIT */
165
166void __iomem *
167__ioremap(phys_addr_t addr, unsigned long size, unsigned long flags)
168{
169 unsigned long v, i;
170 phys_addr_t p;
171 int err;
172
173 /*
174 * Choose an address to map it to.
175 * Once the vmalloc system is running, we use it.
176 * Before then, we use space going down from ioremap_base
177 * (ioremap_bot records where we're up to).
178 */
179 p = addr & PAGE_MASK;
180 size = PAGE_ALIGN(addr + size) - p;
181
182 /*
183 * If the address lies within the first 16 MB, assume it's in ISA
184 * memory space
185 */
186 if (p < 16*1024*1024)
187 p += _ISA_MEM_BASE;
188
189 /*
190 * Don't allow anybody to remap normal RAM that we're using.
191 * mem_init() sets high_memory so only do the check after that.
192 */
193 if (mem_init_done && (p < virt_to_phys(high_memory))) {
194 printk("__ioremap(): phys addr "PHYS_FMT" is RAM lr %p\n", p,
195 __builtin_return_address(0));
196 return NULL;
197 }
198
199 if (size == 0)
200 return NULL;
201
202 /*
203 * Is it already mapped? Perhaps overlapped by a previous
204 * BAT mapping. If the whole area is mapped then we're done,
205 * otherwise remap it since we want to keep the virt addrs for
206 * each request contiguous.
207 *
208 * We make the assumption here that if the bottom and top
209 * of the range we want are mapped then it's mapped to the
210 * same virt address (and this is contiguous).
211 * -- Cort
212 */
213 if ((v = p_mapped_by_bats(p)) /*&& p_mapped_by_bats(p+size-1)*/ )
214 goto out;
215
216 if ((v = p_mapped_by_tlbcam(p)))
217 goto out;
218
219 if (mem_init_done) {
220 struct vm_struct *area;
221 area = get_vm_area(size, VM_IOREMAP);
222 if (area == 0)
223 return NULL;
224 v = (unsigned long) area->addr;
225 } else {
226 v = (ioremap_bot -= size);
227 }
228
229 if ((flags & _PAGE_PRESENT) == 0)
230 flags |= _PAGE_KERNEL;
231 if (flags & _PAGE_NO_CACHE)
232 flags |= _PAGE_GUARDED;
233
234 /*
235 * Should check if it is a candidate for a BAT mapping
236 */
237
238 err = 0;
239 for (i = 0; i < size && err == 0; i += PAGE_SIZE)
240 err = map_page(v+i, p+i, flags);
241 if (err) {
242 if (mem_init_done)
243 vunmap((void *)v);
244 return NULL;
245 }
246
247out:
248 return (void __iomem *) (v + ((unsigned long)addr & ~PAGE_MASK));
249}
250
251void iounmap(volatile void __iomem *addr)
252{
253 /*
254 * If mapped by BATs then there is nothing to do.
255 * Calling vfree() generates a benign warning.
256 */
257 if (v_mapped_by_bats((unsigned long)addr)) return;
258
259 if (addr > high_memory && (unsigned long) addr < ioremap_bot)
260 vunmap((void *) (PAGE_MASK & (unsigned long)addr));
261}
262
263void __iomem *ioport_map(unsigned long port, unsigned int len)
264{
265 return (void __iomem *) (port + _IO_BASE);
266}
267
268void ioport_unmap(void __iomem *addr)
269{
270 /* Nothing to do */
271}
272EXPORT_SYMBOL(ioport_map);
273EXPORT_SYMBOL(ioport_unmap);
274
275int
276map_page(unsigned long va, phys_addr_t pa, int flags)
277{
278 pmd_t *pd;
279 pte_t *pg;
280 int err = -ENOMEM;
281
282 /* Use upper 10 bits of VA to index the first level map */
283 pd = pmd_offset(pgd_offset_k(va), va);
284 /* Use middle 10 bits of VA to index the second-level map */
285 pg = pte_alloc_kernel(pd, va);
286 if (pg != 0) {
287 err = 0;
288 set_pte_at(&init_mm, va, pg, pfn_pte(pa >> PAGE_SHIFT, __pgprot(flags)));
289 if (mem_init_done)
290 flush_HPTE(0, va, pmd_val(*pd));
291 }
292 return err;
293}
294
295/*
296 * Map in all of physical memory starting at KERNELBASE.
297 */
298void __init mapin_ram(void)
299{
300 unsigned long v, p, s, f;
301
302 s = mmu_mapin_ram();
303 v = KERNELBASE + s;
304 p = PPC_MEMSTART + s;
305 for (; s < total_lowmem; s += PAGE_SIZE) {
306 if ((char *) v >= _stext && (char *) v < etext)
307 f = _PAGE_RAM_TEXT;
308 else
309 f = _PAGE_RAM;
310 map_page(v, p, f);
311 v += PAGE_SIZE;
312 p += PAGE_SIZE;
313 }
314}
315
316/* is x a power of 2? */
317#define is_power_of_2(x) ((x) != 0 && (((x) & ((x) - 1)) == 0))
318
319/* is x a power of 4? */
320#define is_power_of_4(x) ((x) != 0 && (((x) & (x-1)) == 0) && (ffs(x) & 1))
321
322/*
323 * Set up a mapping for a block of I/O.
324 * virt, phys, size must all be page-aligned.
325 * This should only be called before ioremap is called.
326 */
327void __init io_block_mapping(unsigned long virt, phys_addr_t phys,
328 unsigned int size, int flags)
329{
330 int i;
331
332 if (virt > KERNELBASE && virt < ioremap_bot)
333 ioremap_bot = ioremap_base = virt;
334
335#ifdef HAVE_BATS
336 /*
337 * Use a BAT for this if possible...
338 */
339 if (io_bat_index < 2 && is_power_of_2(size)
340 && (virt & (size - 1)) == 0 && (phys & (size - 1)) == 0) {
341 setbat(io_bat_index, virt, phys, size, flags);
342 ++io_bat_index;
343 return;
344 }
345#endif /* HAVE_BATS */
346
347#ifdef HAVE_TLBCAM
348 /*
349 * Use a CAM for this if possible...
350 */
351 if (tlbcam_index < num_tlbcam_entries && is_power_of_4(size)
352 && (virt & (size - 1)) == 0 && (phys & (size - 1)) == 0) {
353 settlbcam(tlbcam_index, virt, phys, size, flags, 0);
354 ++tlbcam_index;
355 return;
356 }
357#endif /* HAVE_TLBCAM */
358
359 /* No BATs available, put it in the page tables. */
360 for (i = 0; i < size; i += PAGE_SIZE)
361 map_page(virt + i, phys + i, flags);
362}
363
364/* Scan the real Linux page tables and return a PTE pointer for
365 * a virtual address in a context.
366 * Returns true (1) if PTE was found, zero otherwise. The pointer to
367 * the PTE pointer is unmodified if PTE is not found.
368 */
369int
370get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep)
371{
372 pgd_t *pgd;
373 pmd_t *pmd;
374 pte_t *pte;
375 int retval = 0;
376
377 pgd = pgd_offset(mm, addr & PAGE_MASK);
378 if (pgd) {
379 pmd = pmd_offset(pgd, addr & PAGE_MASK);
380 if (pmd_present(*pmd)) {
381 pte = pte_offset_map(pmd, addr & PAGE_MASK);
382 if (pte) {
383 retval = 1;
384 *ptep = pte;
385 /* XXX caller needs to do pte_unmap, yuck */
386 }
387 }
388 }
389 return(retval);
390}
391
392/* Find physical address for this virtual address. Normally used by
393 * I/O functions, but anyone can call it.
394 */
395unsigned long iopa(unsigned long addr)
396{
397 unsigned long pa;
398
399 /* I don't know why this won't work on PMacs or CHRP. It
400 * appears there is some bug, or there is some implicit
401 * mapping done not properly represented by BATs or in page
402 * tables.......I am actively working on resolving this, but
403 * can't hold up other stuff. -- Dan
404 */
405 pte_t *pte;
406 struct mm_struct *mm;
407
408 /* Check the BATs */
409 pa = v_mapped_by_bats(addr);
410 if (pa)
411 return pa;
412
413 /* Allow mapping of user addresses (within the thread)
414 * for DMA if necessary.
415 */
416 if (addr < TASK_SIZE)
417 mm = current->mm;
418 else
419 mm = &init_mm;
420
421 pa = 0;
422 if (get_pteptr(mm, addr, &pte)) {
423 pa = (pte_val(*pte) & PAGE_MASK) | (addr & ~PAGE_MASK);
424 pte_unmap(pte);
425 }
426
427 return(pa);
428}
429
430/* This is will find the virtual address for a physical one....
431 * Swiped from APUS, could be dangerous :-).
432 * This is only a placeholder until I really find a way to make this
433 * work. -- Dan
434 */
435unsigned long
436mm_ptov (unsigned long paddr)
437{
438 unsigned long ret;
439#if 0
440 if (paddr < 16*1024*1024)
441 ret = ZTWO_VADDR(paddr);
442 else {
443 int i;
444
445 for (i = 0; i < kmap_chunk_count;){
446 unsigned long phys = kmap_chunks[i++];
447 unsigned long size = kmap_chunks[i++];
448 unsigned long virt = kmap_chunks[i++];
449 if (paddr >= phys
450 && paddr < (phys + size)){
451 ret = virt + paddr - phys;
452 goto exit;
453 }
454 }
455
456 ret = (unsigned long) __va(paddr);
457 }
458exit:
459#ifdef DEBUGPV
460 printk ("PTOV(%lx)=%lx\n", paddr, ret);
461#endif
462#else
463 ret = (unsigned long)paddr + KERNELBASE;
464#endif
465 return ret;
466}
467
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
new file mode 100644
index 000000000000..b79a78206135
--- /dev/null
+++ b/arch/powerpc/mm/pgtable_64.c
@@ -0,0 +1,347 @@
1/*
2 * This file contains ioremap and related functions for 64-bit machines.
3 *
4 * Derived from arch/ppc64/mm/init.c
5 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
6 *
7 * Modifications by Paul Mackerras (PowerMac) (paulus@samba.org)
8 * and Cort Dougan (PReP) (cort@cs.nmt.edu)
9 * Copyright (C) 1996 Paul Mackerras
10 * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk).
11 *
12 * Derived from "arch/i386/mm/init.c"
13 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
14 *
15 * Dave Engebretsen <engebret@us.ibm.com>
16 * Rework for PPC64 port.
17 *
18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License
20 * as published by the Free Software Foundation; either version
21 * 2 of the License, or (at your option) any later version.
22 *
23 */
24
25#include <linux/config.h>
26#include <linux/signal.h>
27#include <linux/sched.h>
28#include <linux/kernel.h>
29#include <linux/errno.h>
30#include <linux/string.h>
31#include <linux/types.h>
32#include <linux/mman.h>
33#include <linux/mm.h>
34#include <linux/swap.h>
35#include <linux/stddef.h>
36#include <linux/vmalloc.h>
37#include <linux/init.h>
38#include <linux/delay.h>
39#include <linux/bootmem.h>
40#include <linux/highmem.h>
41#include <linux/idr.h>
42#include <linux/nodemask.h>
43#include <linux/module.h>
44
45#include <asm/pgalloc.h>
46#include <asm/page.h>
47#include <asm/prom.h>
48#include <asm/lmb.h>
49#include <asm/rtas.h>
50#include <asm/io.h>
51#include <asm/mmu_context.h>
52#include <asm/pgtable.h>
53#include <asm/mmu.h>
54#include <asm/uaccess.h>
55#include <asm/smp.h>
56#include <asm/machdep.h>
57#include <asm/tlb.h>
58#include <asm/eeh.h>
59#include <asm/processor.h>
60#include <asm/mmzone.h>
61#include <asm/cputable.h>
62#include <asm/ppcdebug.h>
63#include <asm/sections.h>
64#include <asm/system.h>
65#include <asm/iommu.h>
66#include <asm/abs_addr.h>
67#include <asm/vdso.h>
68#include <asm/imalloc.h>
69
70unsigned long ioremap_bot = IMALLOC_BASE;
71static unsigned long phbs_io_bot = PHBS_IO_BASE;
72
73#ifdef CONFIG_PPC_ISERIES
74
75void __iomem *ioremap(unsigned long addr, unsigned long size)
76{
77 return (void __iomem *)addr;
78}
79
80extern void __iomem *__ioremap(unsigned long addr, unsigned long size,
81 unsigned long flags)
82{
83 return (void __iomem *)addr;
84}
85
86void iounmap(volatile void __iomem *addr)
87{
88 return;
89}
90
91#else
92
93/*
94 * map_io_page currently only called by __ioremap
95 * map_io_page adds an entry to the ioremap page table
96 * and adds an entry to the HPT, possibly bolting it
97 */
98static int map_io_page(unsigned long ea, unsigned long pa, int flags)
99{
100 pgd_t *pgdp;
101 pud_t *pudp;
102 pmd_t *pmdp;
103 pte_t *ptep;
104 unsigned long vsid;
105
106 if (mem_init_done) {
107 pgdp = pgd_offset_k(ea);
108 pudp = pud_alloc(&init_mm, pgdp, ea);
109 if (!pudp)
110 return -ENOMEM;
111 pmdp = pmd_alloc(&init_mm, pudp, ea);
112 if (!pmdp)
113 return -ENOMEM;
114 ptep = pte_alloc_kernel(pmdp, ea);
115 if (!ptep)
116 return -ENOMEM;
117 set_pte_at(&init_mm, ea, ptep, pfn_pte(pa >> PAGE_SHIFT,
118 __pgprot(flags)));
119 } else {
120 unsigned long va, vpn, hash, hpteg;
121
122 /*
123 * If the mm subsystem is not fully up, we cannot create a
124 * linux page table entry for this mapping. Simply bolt an
125 * entry in the hardware page table.
126 */
127 vsid = get_kernel_vsid(ea);
128 va = (vsid << 28) | (ea & 0xFFFFFFF);
129 vpn = va >> PAGE_SHIFT;
130
131 hash = hpt_hash(vpn, 0);
132
133 hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP);
134
135 /* Panic if a pte grpup is full */
136 if (ppc_md.hpte_insert(hpteg, va, pa >> PAGE_SHIFT,
137 HPTE_V_BOLTED,
138 _PAGE_NO_CACHE|_PAGE_GUARDED|PP_RWXX)
139 == -1) {
140 panic("map_io_page: could not insert mapping");
141 }
142 }
143 return 0;
144}
145
146
147static void __iomem * __ioremap_com(unsigned long addr, unsigned long pa,
148 unsigned long ea, unsigned long size,
149 unsigned long flags)
150{
151 unsigned long i;
152
153 if ((flags & _PAGE_PRESENT) == 0)
154 flags |= pgprot_val(PAGE_KERNEL);
155
156 for (i = 0; i < size; i += PAGE_SIZE)
157 if (map_io_page(ea+i, pa+i, flags))
158 return NULL;
159
160 return (void __iomem *) (ea + (addr & ~PAGE_MASK));
161}
162
163
164void __iomem *
165ioremap(unsigned long addr, unsigned long size)
166{
167 return __ioremap(addr, size, _PAGE_NO_CACHE | _PAGE_GUARDED);
168}
169
170void __iomem * __ioremap(unsigned long addr, unsigned long size,
171 unsigned long flags)
172{
173 unsigned long pa, ea;
174 void __iomem *ret;
175
176 /*
177 * Choose an address to map it to.
178 * Once the imalloc system is running, we use it.
179 * Before that, we map using addresses going
180 * up from ioremap_bot. imalloc will use
181 * the addresses from ioremap_bot through
182 * IMALLOC_END
183 *
184 */
185 pa = addr & PAGE_MASK;
186 size = PAGE_ALIGN(addr + size) - pa;
187
188 if (size == 0)
189 return NULL;
190
191 if (mem_init_done) {
192 struct vm_struct *area;
193 area = im_get_free_area(size);
194 if (area == NULL)
195 return NULL;
196 ea = (unsigned long)(area->addr);
197 ret = __ioremap_com(addr, pa, ea, size, flags);
198 if (!ret)
199 im_free(area->addr);
200 } else {
201 ea = ioremap_bot;
202 ret = __ioremap_com(addr, pa, ea, size, flags);
203 if (ret)
204 ioremap_bot += size;
205 }
206 return ret;
207}
208
209#define IS_PAGE_ALIGNED(_val) ((_val) == ((_val) & PAGE_MASK))
210
211int __ioremap_explicit(unsigned long pa, unsigned long ea,
212 unsigned long size, unsigned long flags)
213{
214 struct vm_struct *area;
215 void __iomem *ret;
216
217 /* For now, require page-aligned values for pa, ea, and size */
218 if (!IS_PAGE_ALIGNED(pa) || !IS_PAGE_ALIGNED(ea) ||
219 !IS_PAGE_ALIGNED(size)) {
220 printk(KERN_ERR "unaligned value in %s\n", __FUNCTION__);
221 return 1;
222 }
223
224 if (!mem_init_done) {
225 /* Two things to consider in this case:
226 * 1) No records will be kept (imalloc, etc) that the region
227 * has been remapped
228 * 2) It won't be easy to iounmap() the region later (because
229 * of 1)
230 */
231 ;
232 } else {
233 area = im_get_area(ea, size,
234 IM_REGION_UNUSED|IM_REGION_SUBSET|IM_REGION_EXISTS);
235 if (area == NULL) {
236 /* Expected when PHB-dlpar is in play */
237 return 1;
238 }
239 if (ea != (unsigned long) area->addr) {
240 printk(KERN_ERR "unexpected addr return from "
241 "im_get_area\n");
242 return 1;
243 }
244 }
245
246 ret = __ioremap_com(pa, pa, ea, size, flags);
247 if (ret == NULL) {
248 printk(KERN_ERR "ioremap_explicit() allocation failure !\n");
249 return 1;
250 }
251 if (ret != (void *) ea) {
252 printk(KERN_ERR "__ioremap_com() returned unexpected addr\n");
253 return 1;
254 }
255
256 return 0;
257}
258
259/*
260 * Unmap an IO region and remove it from imalloc'd list.
261 * Access to IO memory should be serialized by driver.
262 * This code is modeled after vmalloc code - unmap_vm_area()
263 *
264 * XXX what about calls before mem_init_done (ie python_countermeasures())
265 */
266void iounmap(volatile void __iomem *token)
267{
268 void *addr;
269
270 if (!mem_init_done)
271 return;
272
273 addr = (void *) ((unsigned long __force) token & PAGE_MASK);
274
275 im_free(addr);
276}
277
278static int iounmap_subset_regions(unsigned long addr, unsigned long size)
279{
280 struct vm_struct *area;
281
282 /* Check whether subsets of this region exist */
283 area = im_get_area(addr, size, IM_REGION_SUPERSET);
284 if (area == NULL)
285 return 1;
286
287 while (area) {
288 iounmap((void __iomem *) area->addr);
289 area = im_get_area(addr, size,
290 IM_REGION_SUPERSET);
291 }
292
293 return 0;
294}
295
296int iounmap_explicit(volatile void __iomem *start, unsigned long size)
297{
298 struct vm_struct *area;
299 unsigned long addr;
300 int rc;
301
302 addr = (unsigned long __force) start & PAGE_MASK;
303
304 /* Verify that the region either exists or is a subset of an existing
305 * region. In the latter case, split the parent region to create
306 * the exact region
307 */
308 area = im_get_area(addr, size,
309 IM_REGION_EXISTS | IM_REGION_SUBSET);
310 if (area == NULL) {
311 /* Determine whether subset regions exist. If so, unmap */
312 rc = iounmap_subset_regions(addr, size);
313 if (rc) {
314 printk(KERN_ERR
315 "%s() cannot unmap nonexistent range 0x%lx\n",
316 __FUNCTION__, addr);
317 return 1;
318 }
319 } else {
320 iounmap((void __iomem *) area->addr);
321 }
322 /*
323 * FIXME! This can't be right:
324 iounmap(area->addr);
325 * Maybe it should be "iounmap(area);"
326 */
327 return 0;
328}
329
330#endif
331
332EXPORT_SYMBOL(ioremap);
333EXPORT_SYMBOL(__ioremap);
334EXPORT_SYMBOL(iounmap);
335
336void __iomem * reserve_phb_iospace(unsigned long size)
337{
338 void __iomem *virt_addr;
339
340 if (phbs_io_bot >= IMALLOC_BASE)
341 panic("reserve_phb_iospace(): phb io space overflow\n");
342
343 virt_addr = (void __iomem *) phbs_io_bot;
344 phbs_io_bot += size;
345
346 return virt_addr;
347}
diff --git a/arch/powerpc/mm/ppc_mmu_32.c b/arch/powerpc/mm/ppc_mmu_32.c
new file mode 100644
index 000000000000..cef9e83cc7e9
--- /dev/null
+++ b/arch/powerpc/mm/ppc_mmu_32.c
@@ -0,0 +1,285 @@
1/*
2 * This file contains the routines for handling the MMU on those
3 * PowerPC implementations where the MMU substantially follows the
4 * architecture specification. This includes the 6xx, 7xx, 7xxx,
5 * 8260, and POWER3 implementations but excludes the 8xx and 4xx.
6 * -- paulus
7 *
8 * Derived from arch/ppc/mm/init.c:
9 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
10 *
11 * Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
12 * and Cort Dougan (PReP) (cort@cs.nmt.edu)
13 * Copyright (C) 1996 Paul Mackerras
14 * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk).
15 *
16 * Derived from "arch/i386/mm/init.c"
17 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
18 *
19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License
21 * as published by the Free Software Foundation; either version
22 * 2 of the License, or (at your option) any later version.
23 *
24 */
25
26#include <linux/config.h>
27#include <linux/kernel.h>
28#include <linux/mm.h>
29#include <linux/init.h>
30#include <linux/highmem.h>
31
32#include <asm/prom.h>
33#include <asm/mmu.h>
34#include <asm/machdep.h>
35#include <asm/lmb.h>
36
37#include "mmu_decl.h"
38
39PTE *Hash, *Hash_end;
40unsigned long Hash_size, Hash_mask;
41unsigned long _SDR1;
42
43union ubat { /* BAT register values to be loaded */
44 BAT bat;
45#ifdef CONFIG_PPC64BRIDGE
46 u64 word[2];
47#else
48 u32 word[2];
49#endif
50} BATS[4][2]; /* 4 pairs of IBAT, DBAT */
51
52struct batrange { /* stores address ranges mapped by BATs */
53 unsigned long start;
54 unsigned long limit;
55 unsigned long phys;
56} bat_addrs[4];
57
58/*
59 * Return PA for this VA if it is mapped by a BAT, or 0
60 */
61unsigned long v_mapped_by_bats(unsigned long va)
62{
63 int b;
64 for (b = 0; b < 4; ++b)
65 if (va >= bat_addrs[b].start && va < bat_addrs[b].limit)
66 return bat_addrs[b].phys + (va - bat_addrs[b].start);
67 return 0;
68}
69
70/*
71 * Return VA for a given PA or 0 if not mapped
72 */
73unsigned long p_mapped_by_bats(unsigned long pa)
74{
75 int b;
76 for (b = 0; b < 4; ++b)
77 if (pa >= bat_addrs[b].phys
78 && pa < (bat_addrs[b].limit-bat_addrs[b].start)
79 +bat_addrs[b].phys)
80 return bat_addrs[b].start+(pa-bat_addrs[b].phys);
81 return 0;
82}
83
84unsigned long __init mmu_mapin_ram(void)
85{
86#ifdef CONFIG_POWER4
87 return 0;
88#else
89 unsigned long tot, bl, done;
90 unsigned long max_size = (256<<20);
91 unsigned long align;
92
93 if (__map_without_bats)
94 return 0;
95
96 /* Set up BAT2 and if necessary BAT3 to cover RAM. */
97
98 /* Make sure we don't map a block larger than the
99 smallest alignment of the physical address. */
100 /* alignment of PPC_MEMSTART */
101 align = ~(PPC_MEMSTART-1) & PPC_MEMSTART;
102 /* set BAT block size to MIN(max_size, align) */
103 if (align && align < max_size)
104 max_size = align;
105
106 tot = total_lowmem;
107 for (bl = 128<<10; bl < max_size; bl <<= 1) {
108 if (bl * 2 > tot)
109 break;
110 }
111
112 setbat(2, KERNELBASE, PPC_MEMSTART, bl, _PAGE_RAM);
113 done = (unsigned long)bat_addrs[2].limit - KERNELBASE + 1;
114 if ((done < tot) && !bat_addrs[3].limit) {
115 /* use BAT3 to cover a bit more */
116 tot -= done;
117 for (bl = 128<<10; bl < max_size; bl <<= 1)
118 if (bl * 2 > tot)
119 break;
120 setbat(3, KERNELBASE+done, PPC_MEMSTART+done, bl, _PAGE_RAM);
121 done = (unsigned long)bat_addrs[3].limit - KERNELBASE + 1;
122 }
123
124 return done;
125#endif
126}
127
128/*
129 * Set up one of the I/D BAT (block address translation) register pairs.
130 * The parameters are not checked; in particular size must be a power
131 * of 2 between 128k and 256M.
132 */
133void __init setbat(int index, unsigned long virt, unsigned long phys,
134 unsigned int size, int flags)
135{
136 unsigned int bl;
137 int wimgxpp;
138 union ubat *bat = BATS[index];
139
140 if (((flags & _PAGE_NO_CACHE) == 0) &&
141 cpu_has_feature(CPU_FTR_NEED_COHERENT))
142 flags |= _PAGE_COHERENT;
143
144 bl = (size >> 17) - 1;
145 if (PVR_VER(mfspr(SPRN_PVR)) != 1) {
146 /* 603, 604, etc. */
147 /* Do DBAT first */
148 wimgxpp = flags & (_PAGE_WRITETHRU | _PAGE_NO_CACHE
149 | _PAGE_COHERENT | _PAGE_GUARDED);
150 wimgxpp |= (flags & _PAGE_RW)? BPP_RW: BPP_RX;
151 bat[1].word[0] = virt | (bl << 2) | 2; /* Vs=1, Vp=0 */
152 bat[1].word[1] = phys | wimgxpp;
153#ifndef CONFIG_KGDB /* want user access for breakpoints */
154 if (flags & _PAGE_USER)
155#endif
156 bat[1].bat.batu.vp = 1;
157 if (flags & _PAGE_GUARDED) {
158 /* G bit must be zero in IBATs */
159 bat[0].word[0] = bat[0].word[1] = 0;
160 } else {
161 /* make IBAT same as DBAT */
162 bat[0] = bat[1];
163 }
164 } else {
165 /* 601 cpu */
166 if (bl > BL_8M)
167 bl = BL_8M;
168 wimgxpp = flags & (_PAGE_WRITETHRU | _PAGE_NO_CACHE
169 | _PAGE_COHERENT);
170 wimgxpp |= (flags & _PAGE_RW)?
171 ((flags & _PAGE_USER)? PP_RWRW: PP_RWXX): PP_RXRX;
172 bat->word[0] = virt | wimgxpp | 4; /* Ks=0, Ku=1 */
173 bat->word[1] = phys | bl | 0x40; /* V=1 */
174 }
175
176 bat_addrs[index].start = virt;
177 bat_addrs[index].limit = virt + ((bl + 1) << 17) - 1;
178 bat_addrs[index].phys = phys;
179}
180
181/*
182 * Initialize the hash table and patch the instructions in hashtable.S.
183 */
184void __init MMU_init_hw(void)
185{
186 unsigned int hmask, mb, mb2;
187 unsigned int n_hpteg, lg_n_hpteg;
188
189 extern unsigned int hash_page_patch_A[];
190 extern unsigned int hash_page_patch_B[], hash_page_patch_C[];
191 extern unsigned int hash_page[];
192 extern unsigned int flush_hash_patch_A[], flush_hash_patch_B[];
193
194 if (!cpu_has_feature(CPU_FTR_HPTE_TABLE)) {
195 /*
196 * Put a blr (procedure return) instruction at the
197 * start of hash_page, since we can still get DSI
198 * exceptions on a 603.
199 */
200 hash_page[0] = 0x4e800020;
201 flush_icache_range((unsigned long) &hash_page[0],
202 (unsigned long) &hash_page[1]);
203 return;
204 }
205
206 if ( ppc_md.progress ) ppc_md.progress("hash:enter", 0x105);
207
208#ifdef CONFIG_PPC64BRIDGE
209#define LG_HPTEG_SIZE 7 /* 128 bytes per HPTEG */
210#define SDR1_LOW_BITS (lg_n_hpteg - 11)
211#define MIN_N_HPTEG 2048 /* min 256kB hash table */
212#else
213#define LG_HPTEG_SIZE 6 /* 64 bytes per HPTEG */
214#define SDR1_LOW_BITS ((n_hpteg - 1) >> 10)
215#define MIN_N_HPTEG 1024 /* min 64kB hash table */
216#endif
217
218 /*
219 * Allow 1 HPTE (1/8 HPTEG) for each page of memory.
220 * This is less than the recommended amount, but then
221 * Linux ain't AIX.
222 */
223 n_hpteg = total_memory / (PAGE_SIZE * 8);
224 if (n_hpteg < MIN_N_HPTEG)
225 n_hpteg = MIN_N_HPTEG;
226 lg_n_hpteg = __ilog2(n_hpteg);
227 if (n_hpteg & (n_hpteg - 1)) {
228 ++lg_n_hpteg; /* round up if not power of 2 */
229 n_hpteg = 1 << lg_n_hpteg;
230 }
231 Hash_size = n_hpteg << LG_HPTEG_SIZE;
232
233 /*
234 * Find some memory for the hash table.
235 */
236 if ( ppc_md.progress ) ppc_md.progress("hash:find piece", 0x322);
237 Hash = __va(lmb_alloc_base(Hash_size, Hash_size,
238 __initial_memory_limit));
239 cacheable_memzero(Hash, Hash_size);
240 _SDR1 = __pa(Hash) | SDR1_LOW_BITS;
241
242 Hash_end = (PTE *) ((unsigned long)Hash + Hash_size);
243
244 printk("Total memory = %ldMB; using %ldkB for hash table (at %p)\n",
245 total_memory >> 20, Hash_size >> 10, Hash);
246
247
248 /*
249 * Patch up the instructions in hashtable.S:create_hpte
250 */
251 if ( ppc_md.progress ) ppc_md.progress("hash:patch", 0x345);
252 Hash_mask = n_hpteg - 1;
253 hmask = Hash_mask >> (16 - LG_HPTEG_SIZE);
254 mb2 = mb = 32 - LG_HPTEG_SIZE - lg_n_hpteg;
255 if (lg_n_hpteg > 16)
256 mb2 = 16 - LG_HPTEG_SIZE;
257
258 hash_page_patch_A[0] = (hash_page_patch_A[0] & ~0xffff)
259 | ((unsigned int)(Hash) >> 16);
260 hash_page_patch_A[1] = (hash_page_patch_A[1] & ~0x7c0) | (mb << 6);
261 hash_page_patch_A[2] = (hash_page_patch_A[2] & ~0x7c0) | (mb2 << 6);
262 hash_page_patch_B[0] = (hash_page_patch_B[0] & ~0xffff) | hmask;
263 hash_page_patch_C[0] = (hash_page_patch_C[0] & ~0xffff) | hmask;
264
265 /*
266 * Ensure that the locations we've patched have been written
267 * out from the data cache and invalidated in the instruction
268 * cache, on those machines with split caches.
269 */
270 flush_icache_range((unsigned long) &hash_page_patch_A[0],
271 (unsigned long) &hash_page_patch_C[1]);
272
273 /*
274 * Patch up the instructions in hashtable.S:flush_hash_page
275 */
276 flush_hash_patch_A[0] = (flush_hash_patch_A[0] & ~0xffff)
277 | ((unsigned int)(Hash) >> 16);
278 flush_hash_patch_A[1] = (flush_hash_patch_A[1] & ~0x7c0) | (mb << 6);
279 flush_hash_patch_A[2] = (flush_hash_patch_A[2] & ~0x7c0) | (mb2 << 6);
280 flush_hash_patch_B[0] = (flush_hash_patch_B[0] & ~0xffff) | hmask;
281 flush_icache_range((unsigned long) &flush_hash_patch_A[0],
282 (unsigned long) &flush_hash_patch_B[1]);
283
284 if ( ppc_md.progress ) ppc_md.progress("hash:done", 0x205);
285}
diff --git a/arch/ppc64/mm/slb.c b/arch/powerpc/mm/slb.c
index 0473953f6a37..0473953f6a37 100644
--- a/arch/ppc64/mm/slb.c
+++ b/arch/powerpc/mm/slb.c
diff --git a/arch/ppc64/mm/slb_low.S b/arch/powerpc/mm/slb_low.S
index a3a03da503bc..a3a03da503bc 100644
--- a/arch/ppc64/mm/slb_low.S
+++ b/arch/powerpc/mm/slb_low.S
diff --git a/arch/ppc64/mm/stab.c b/arch/powerpc/mm/stab.c
index 1b83f002bf27..1b83f002bf27 100644
--- a/arch/ppc64/mm/stab.c
+++ b/arch/powerpc/mm/stab.c
diff --git a/arch/powerpc/mm/tlb_32.c b/arch/powerpc/mm/tlb_32.c
new file mode 100644
index 000000000000..6c3dc3c44c86
--- /dev/null
+++ b/arch/powerpc/mm/tlb_32.c
@@ -0,0 +1,183 @@
1/*
2 * This file contains the routines for TLB flushing.
3 * On machines where the MMU uses a hash table to store virtual to
4 * physical translations, these routines flush entries from the
5 * hash table also.
6 * -- paulus
7 *
8 * Derived from arch/ppc/mm/init.c:
9 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
10 *
11 * Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
12 * and Cort Dougan (PReP) (cort@cs.nmt.edu)
13 * Copyright (C) 1996 Paul Mackerras
14 * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk).
15 *
16 * Derived from "arch/i386/mm/init.c"
17 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
18 *
19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License
21 * as published by the Free Software Foundation; either version
22 * 2 of the License, or (at your option) any later version.
23 *
24 */
25
26#include <linux/config.h>
27#include <linux/kernel.h>
28#include <linux/mm.h>
29#include <linux/init.h>
30#include <linux/highmem.h>
31#include <asm/tlbflush.h>
32#include <asm/tlb.h>
33
34#include "mmu_decl.h"
35
36/*
37 * Called when unmapping pages to flush entries from the TLB/hash table.
38 */
39void flush_hash_entry(struct mm_struct *mm, pte_t *ptep, unsigned long addr)
40{
41 unsigned long ptephys;
42
43 if (Hash != 0) {
44 ptephys = __pa(ptep) & PAGE_MASK;
45 flush_hash_pages(mm->context, addr, ptephys, 1);
46 }
47}
48
49/*
50 * Called by ptep_set_access_flags, must flush on CPUs for which the
51 * DSI handler can't just "fixup" the TLB on a write fault
52 */
53void flush_tlb_page_nohash(struct vm_area_struct *vma, unsigned long addr)
54{
55 if (Hash != 0)
56 return;
57 _tlbie(addr);
58}
59
60/*
61 * Called at the end of a mmu_gather operation to make sure the
62 * TLB flush is completely done.
63 */
64void tlb_flush(struct mmu_gather *tlb)
65{
66 if (Hash == 0) {
67 /*
68 * 603 needs to flush the whole TLB here since
69 * it doesn't use a hash table.
70 */
71 _tlbia();
72 }
73}
74
75/*
76 * TLB flushing:
77 *
78 * - flush_tlb_mm(mm) flushes the specified mm context TLB's
79 * - flush_tlb_page(vma, vmaddr) flushes one page
80 * - flush_tlb_range(vma, start, end) flushes a range of pages
81 * - flush_tlb_kernel_range(start, end) flushes kernel pages
82 *
83 * since the hardware hash table functions as an extension of the
84 * tlb as far as the linux tables are concerned, flush it too.
85 * -- Cort
86 */
87
88/*
89 * 750 SMP is a Bad Idea because the 750 doesn't broadcast all
90 * the cache operations on the bus. Hence we need to use an IPI
91 * to get the other CPU(s) to invalidate their TLBs.
92 */
93#ifdef CONFIG_SMP_750
94#define FINISH_FLUSH smp_send_tlb_invalidate(0)
95#else
96#define FINISH_FLUSH do { } while (0)
97#endif
98
99static void flush_range(struct mm_struct *mm, unsigned long start,
100 unsigned long end)
101{
102 pmd_t *pmd;
103 unsigned long pmd_end;
104 int count;
105 unsigned int ctx = mm->context;
106
107 if (Hash == 0) {
108 _tlbia();
109 return;
110 }
111 start &= PAGE_MASK;
112 if (start >= end)
113 return;
114 end = (end - 1) | ~PAGE_MASK;
115 pmd = pmd_offset(pgd_offset(mm, start), start);
116 for (;;) {
117 pmd_end = ((start + PGDIR_SIZE) & PGDIR_MASK) - 1;
118 if (pmd_end > end)
119 pmd_end = end;
120 if (!pmd_none(*pmd)) {
121 count = ((pmd_end - start) >> PAGE_SHIFT) + 1;
122 flush_hash_pages(ctx, start, pmd_val(*pmd), count);
123 }
124 if (pmd_end == end)
125 break;
126 start = pmd_end + 1;
127 ++pmd;
128 }
129}
130
131/*
132 * Flush kernel TLB entries in the given range
133 */
134void flush_tlb_kernel_range(unsigned long start, unsigned long end)
135{
136 flush_range(&init_mm, start, end);
137 FINISH_FLUSH;
138}
139
140/*
141 * Flush all the (user) entries for the address space described by mm.
142 */
143void flush_tlb_mm(struct mm_struct *mm)
144{
145 struct vm_area_struct *mp;
146
147 if (Hash == 0) {
148 _tlbia();
149 return;
150 }
151
152 for (mp = mm->mmap; mp != NULL; mp = mp->vm_next)
153 flush_range(mp->vm_mm, mp->vm_start, mp->vm_end);
154 FINISH_FLUSH;
155}
156
157void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr)
158{
159 struct mm_struct *mm;
160 pmd_t *pmd;
161
162 if (Hash == 0) {
163 _tlbie(vmaddr);
164 return;
165 }
166 mm = (vmaddr < TASK_SIZE)? vma->vm_mm: &init_mm;
167 pmd = pmd_offset(pgd_offset(mm, vmaddr), vmaddr);
168 if (!pmd_none(*pmd))
169 flush_hash_pages(mm->context, vmaddr, pmd_val(*pmd), 1);
170 FINISH_FLUSH;
171}
172
173/*
174 * For each address in the range, find the pte for the address
175 * and check _PAGE_HASHPTE bit; if it is set, find and destroy
176 * the corresponding HPTE.
177 */
178void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
179 unsigned long end)
180{
181 flush_range(vma->vm_mm, start, end);
182 FINISH_FLUSH;
183}
diff --git a/arch/ppc64/mm/tlb.c b/arch/powerpc/mm/tlb_64.c
index 21fbffb23a43..09ab81a10f4f 100644
--- a/arch/ppc64/mm/tlb.c
+++ b/arch/powerpc/mm/tlb_64.c
@@ -128,12 +128,10 @@ void pgtable_free_tlb(struct mmu_gather *tlb, pgtable_free_t pgf)
128void hpte_update(struct mm_struct *mm, unsigned long addr, 128void hpte_update(struct mm_struct *mm, unsigned long addr,
129 unsigned long pte, int wrprot) 129 unsigned long pte, int wrprot)
130{ 130{
131 int i;
132 unsigned long context = 0;
133 struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch); 131 struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch);
132 unsigned long vsid;
133 int i;
134 134
135 if (REGION_ID(addr) == USER_REGION_ID)
136 context = mm->context.id;
137 i = batch->index; 135 i = batch->index;
138 136
139 /* 137 /*
@@ -143,19 +141,21 @@ void hpte_update(struct mm_struct *mm, unsigned long addr,
143 * up scanning and resetting referenced bits then our batch context 141 * up scanning and resetting referenced bits then our batch context
144 * will change mid stream. 142 * will change mid stream.
145 */ 143 */
146 if (i != 0 && (context != batch->context || 144 if (i != 0 && (mm != batch->mm || batch->large != pte_huge(pte))) {
147 batch->large != pte_huge(pte))) {
148 flush_tlb_pending(); 145 flush_tlb_pending();
149 i = 0; 146 i = 0;
150 } 147 }
151
152 if (i == 0) { 148 if (i == 0) {
153 batch->context = context;
154 batch->mm = mm; 149 batch->mm = mm;
155 batch->large = pte_huge(pte); 150 batch->large = pte_huge(pte);
156 } 151 }
152 if (addr < KERNELBASE) {
153 vsid = get_vsid(mm->context.id, addr);
154 WARN_ON(vsid == 0);
155 } else
156 vsid = get_kernel_vsid(addr);
157 batch->vaddr[i] = (vsid << 28 ) | (addr & 0x0fffffff);
157 batch->pte[i] = __pte(pte); 158 batch->pte[i] = __pte(pte);
158 batch->addr[i] = addr;
159 batch->index = ++i; 159 batch->index = ++i;
160 if (i >= PPC64_TLB_BATCH_NR) 160 if (i >= PPC64_TLB_BATCH_NR)
161 flush_tlb_pending(); 161 flush_tlb_pending();
@@ -177,10 +177,9 @@ void __flush_tlb_pending(struct ppc64_tlb_batch *batch)
177 local = 1; 177 local = 1;
178 178
179 if (i == 1) 179 if (i == 1)
180 flush_hash_page(batch->context, batch->addr[0], batch->pte[0], 180 flush_hash_page(batch->vaddr[0], batch->pte[0], local);
181 local);
182 else 181 else
183 flush_hash_range(batch->context, i, local); 182 flush_hash_range(i, local);
184 batch->index = 0; 183 batch->index = 0;
185 put_cpu(); 184 put_cpu();
186} 185}
diff --git a/arch/ppc/oprofile/Kconfig b/arch/powerpc/oprofile/Kconfig
index 19d37730b664..19d37730b664 100644
--- a/arch/ppc/oprofile/Kconfig
+++ b/arch/powerpc/oprofile/Kconfig
diff --git a/arch/ppc/oprofile/Makefile b/arch/powerpc/oprofile/Makefile
index e2218d32a4eb..0782d0cca89c 100644
--- a/arch/ppc/oprofile/Makefile
+++ b/arch/powerpc/oprofile/Makefile
@@ -7,8 +7,5 @@ DRIVER_OBJS := $(addprefix ../../../drivers/oprofile/, \
7 timer_int.o ) 7 timer_int.o )
8 8
9oprofile-y := $(DRIVER_OBJS) common.o 9oprofile-y := $(DRIVER_OBJS) common.o
10 10oprofile-$(CONFIG_PPC64) += op_model_rs64.o op_model_power4.o
11ifeq ($(CONFIG_FSL_BOOKE),y) 11oprofile-$(CONFIG_FSL_BOOKE) += op_model_fsl_booke.o
12 oprofile-y += op_model_fsl_booke.o
13endif
14
diff --git a/arch/ppc64/oprofile/common.c b/arch/powerpc/oprofile/common.c
index e5f572710aa0..af2c05d20ba5 100644
--- a/arch/ppc64/oprofile/common.c
+++ b/arch/powerpc/oprofile/common.c
@@ -1,5 +1,9 @@
1/* 1/*
2 * PPC 64 oprofile support:
2 * Copyright (C) 2004 Anton Blanchard <anton@au.ibm.com>, IBM 3 * Copyright (C) 2004 Anton Blanchard <anton@au.ibm.com>, IBM
4 * PPC 32 oprofile support: (based on PPC 64 support)
5 * Copyright (C) Freescale Semiconductor, Inc 2004
6 * Author: Andy Fleming
3 * 7 *
4 * Based on alpha version. 8 * Based on alpha version.
5 * 9 *
@@ -10,6 +14,9 @@
10 */ 14 */
11 15
12#include <linux/oprofile.h> 16#include <linux/oprofile.h>
17#ifndef __powerpc64__
18#include <linux/slab.h>
19#endif /* ! __powerpc64__ */
13#include <linux/init.h> 20#include <linux/init.h>
14#include <linux/smp.h> 21#include <linux/smp.h>
15#include <linux/errno.h> 22#include <linux/errno.h>
@@ -19,17 +26,21 @@
19#include <asm/cputable.h> 26#include <asm/cputable.h>
20#include <asm/oprofile_impl.h> 27#include <asm/oprofile_impl.h>
21 28
22static struct op_ppc64_model *model; 29static struct op_powerpc_model *model;
23 30
24static struct op_counter_config ctr[OP_MAX_COUNTER]; 31static struct op_counter_config ctr[OP_MAX_COUNTER];
25static struct op_system_config sys; 32static struct op_system_config sys;
26 33
34#ifndef __powerpc64__
35static char *cpu_type;
36#endif /* ! __powerpc64__ */
37
27static void op_handle_interrupt(struct pt_regs *regs) 38static void op_handle_interrupt(struct pt_regs *regs)
28{ 39{
29 model->handle_interrupt(regs, ctr); 40 model->handle_interrupt(regs, ctr);
30} 41}
31 42
32static int op_ppc64_setup(void) 43static int op_powerpc_setup(void)
33{ 44{
34 int err; 45 int err;
35 46
@@ -42,41 +53,49 @@ static int op_ppc64_setup(void)
42 model->reg_setup(ctr, &sys, model->num_counters); 53 model->reg_setup(ctr, &sys, model->num_counters);
43 54
44 /* Configure the registers on all cpus. */ 55 /* Configure the registers on all cpus. */
56#ifdef __powerpc64__
45 on_each_cpu(model->cpu_setup, NULL, 0, 1); 57 on_each_cpu(model->cpu_setup, NULL, 0, 1);
58#else /* __powerpc64__ */
59#if 0
60 /* FIXME: Make multi-cpu work */
61 on_each_cpu(model->reg_setup, NULL, 0, 1);
62#endif
63#endif /* __powerpc64__ */
46 64
47 return 0; 65 return 0;
48} 66}
49 67
50static void op_ppc64_shutdown(void) 68static void op_powerpc_shutdown(void)
51{ 69{
52 release_pmc_hardware(); 70 release_pmc_hardware();
53} 71}
54 72
55static void op_ppc64_cpu_start(void *dummy) 73static void op_powerpc_cpu_start(void *dummy)
56{ 74{
57 model->start(ctr); 75 model->start(ctr);
58} 76}
59 77
60static int op_ppc64_start(void) 78static int op_powerpc_start(void)
61{ 79{
62 on_each_cpu(op_ppc64_cpu_start, NULL, 0, 1); 80 on_each_cpu(op_powerpc_cpu_start, NULL, 0, 1);
63 return 0; 81 return 0;
64} 82}
65 83
66static inline void op_ppc64_cpu_stop(void *dummy) 84static inline void op_powerpc_cpu_stop(void *dummy)
67{ 85{
68 model->stop(); 86 model->stop();
69} 87}
70 88
71static void op_ppc64_stop(void) 89static void op_powerpc_stop(void)
72{ 90{
73 on_each_cpu(op_ppc64_cpu_stop, NULL, 0, 1); 91 on_each_cpu(op_powerpc_cpu_stop, NULL, 0, 1);
74} 92}
75 93
76static int op_ppc64_create_files(struct super_block *sb, struct dentry *root) 94static int op_powerpc_create_files(struct super_block *sb, struct dentry *root)
77{ 95{
78 int i; 96 int i;
79 97
98#ifdef __powerpc64__
80 /* 99 /*
81 * There is one mmcr0, mmcr1 and mmcra for setting the events for 100 * There is one mmcr0, mmcr1 and mmcra for setting the events for
82 * all of the counters. 101 * all of the counters.
@@ -84,6 +103,7 @@ static int op_ppc64_create_files(struct super_block *sb, struct dentry *root)
84 oprofilefs_create_ulong(sb, root, "mmcr0", &sys.mmcr0); 103 oprofilefs_create_ulong(sb, root, "mmcr0", &sys.mmcr0);
85 oprofilefs_create_ulong(sb, root, "mmcr1", &sys.mmcr1); 104 oprofilefs_create_ulong(sb, root, "mmcr1", &sys.mmcr1);
86 oprofilefs_create_ulong(sb, root, "mmcra", &sys.mmcra); 105 oprofilefs_create_ulong(sb, root, "mmcra", &sys.mmcra);
106#endif /* __powerpc64__ */
87 107
88 for (i = 0; i < model->num_counters; ++i) { 108 for (i = 0; i < model->num_counters; ++i) {
89 struct dentry *dir; 109 struct dentry *dir;
@@ -95,44 +115,70 @@ static int op_ppc64_create_files(struct super_block *sb, struct dentry *root)
95 oprofilefs_create_ulong(sb, dir, "enabled", &ctr[i].enabled); 115 oprofilefs_create_ulong(sb, dir, "enabled", &ctr[i].enabled);
96 oprofilefs_create_ulong(sb, dir, "event", &ctr[i].event); 116 oprofilefs_create_ulong(sb, dir, "event", &ctr[i].event);
97 oprofilefs_create_ulong(sb, dir, "count", &ctr[i].count); 117 oprofilefs_create_ulong(sb, dir, "count", &ctr[i].count);
118#ifdef __powerpc64__
98 /* 119 /*
99 * We dont support per counter user/kernel selection, but 120 * We dont support per counter user/kernel selection, but
100 * we leave the entries because userspace expects them 121 * we leave the entries because userspace expects them
101 */ 122 */
123#endif /* __powerpc64__ */
102 oprofilefs_create_ulong(sb, dir, "kernel", &ctr[i].kernel); 124 oprofilefs_create_ulong(sb, dir, "kernel", &ctr[i].kernel);
103 oprofilefs_create_ulong(sb, dir, "user", &ctr[i].user); 125 oprofilefs_create_ulong(sb, dir, "user", &ctr[i].user);
126
127#ifndef __powerpc64__
128 /* FIXME: Not sure if this is used */
129#endif /* ! __powerpc64__ */
104 oprofilefs_create_ulong(sb, dir, "unit_mask", &ctr[i].unit_mask); 130 oprofilefs_create_ulong(sb, dir, "unit_mask", &ctr[i].unit_mask);
105 } 131 }
106 132
107 oprofilefs_create_ulong(sb, root, "enable_kernel", &sys.enable_kernel); 133 oprofilefs_create_ulong(sb, root, "enable_kernel", &sys.enable_kernel);
108 oprofilefs_create_ulong(sb, root, "enable_user", &sys.enable_user); 134 oprofilefs_create_ulong(sb, root, "enable_user", &sys.enable_user);
135#ifdef __powerpc64__
109 oprofilefs_create_ulong(sb, root, "backtrace_spinlocks", 136 oprofilefs_create_ulong(sb, root, "backtrace_spinlocks",
110 &sys.backtrace_spinlocks); 137 &sys.backtrace_spinlocks);
138#endif /* __powerpc64__ */
111 139
112 /* Default to tracing both kernel and user */ 140 /* Default to tracing both kernel and user */
113 sys.enable_kernel = 1; 141 sys.enable_kernel = 1;
114 sys.enable_user = 1; 142 sys.enable_user = 1;
115 143#ifdef __powerpc64__
116 /* Turn on backtracing through spinlocks by default */ 144 /* Turn on backtracing through spinlocks by default */
117 sys.backtrace_spinlocks = 1; 145 sys.backtrace_spinlocks = 1;
146#endif /* __powerpc64__ */
118 147
119 return 0; 148 return 0;
120} 149}
121 150
122int __init oprofile_arch_init(struct oprofile_operations *ops) 151int __init oprofile_arch_init(struct oprofile_operations *ops)
123{ 152{
153#ifndef __powerpc64__
154#ifdef CONFIG_FSL_BOOKE
155 model = &op_model_fsl_booke;
156#else
157 return -ENODEV;
158#endif
159
160 cpu_type = kmalloc(32, GFP_KERNEL);
161 if (NULL == cpu_type)
162 return -ENOMEM;
163
164 sprintf(cpu_type, "ppc/%s", cur_cpu_spec->cpu_name);
165
166 model->num_counters = cur_cpu_spec->num_pmcs;
167
168 ops->cpu_type = cpu_type;
169#else /* __powerpc64__ */
124 if (!cur_cpu_spec->oprofile_model || !cur_cpu_spec->oprofile_cpu_type) 170 if (!cur_cpu_spec->oprofile_model || !cur_cpu_spec->oprofile_cpu_type)
125 return -ENODEV; 171 return -ENODEV;
126
127 model = cur_cpu_spec->oprofile_model; 172 model = cur_cpu_spec->oprofile_model;
128 model->num_counters = cur_cpu_spec->num_pmcs; 173 model->num_counters = cur_cpu_spec->num_pmcs;
129 174
130 ops->cpu_type = cur_cpu_spec->oprofile_cpu_type; 175 ops->cpu_type = cur_cpu_spec->oprofile_cpu_type;
131 ops->create_files = op_ppc64_create_files; 176#endif /* __powerpc64__ */
132 ops->setup = op_ppc64_setup; 177 ops->create_files = op_powerpc_create_files;
133 ops->shutdown = op_ppc64_shutdown; 178 ops->setup = op_powerpc_setup;
134 ops->start = op_ppc64_start; 179 ops->shutdown = op_powerpc_shutdown;
135 ops->stop = op_ppc64_stop; 180 ops->start = op_powerpc_start;
181 ops->stop = op_powerpc_stop;
136 182
137 printk(KERN_INFO "oprofile: using %s performance monitoring.\n", 183 printk(KERN_INFO "oprofile: using %s performance monitoring.\n",
138 ops->cpu_type); 184 ops->cpu_type);
@@ -142,4 +188,8 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
142 188
143void oprofile_arch_exit(void) 189void oprofile_arch_exit(void)
144{ 190{
191#ifndef __powerpc64__
192 kfree(cpu_type);
193 cpu_type = NULL;
194#endif /* ! __powerpc64__ */
145} 195}
diff --git a/arch/ppc/oprofile/op_model_fsl_booke.c b/arch/powerpc/oprofile/op_model_fsl_booke.c
index fc9c859358c6..86124a94c9af 100644
--- a/arch/ppc/oprofile/op_model_fsl_booke.c
+++ b/arch/powerpc/oprofile/op_model_fsl_booke.c
@@ -24,9 +24,8 @@
24#include <asm/cputable.h> 24#include <asm/cputable.h>
25#include <asm/reg_booke.h> 25#include <asm/reg_booke.h>
26#include <asm/page.h> 26#include <asm/page.h>
27#include <asm/perfmon.h> 27#include <asm/pmc.h>
28 28#include <asm/oprofile_impl.h>
29#include "op_impl.h"
30 29
31static unsigned long reset_value[OP_MAX_COUNTER]; 30static unsigned long reset_value[OP_MAX_COUNTER];
32 31
@@ -176,7 +175,7 @@ static void fsl_booke_handle_interrupt(struct pt_regs *regs,
176 pmc_start_ctrs(1); 175 pmc_start_ctrs(1);
177} 176}
178 177
179struct op_ppc32_model op_model_fsl_booke = { 178struct op_powerpc_model op_model_fsl_booke = {
180 .reg_setup = fsl_booke_reg_setup, 179 .reg_setup = fsl_booke_reg_setup,
181 .start = fsl_booke_start, 180 .start = fsl_booke_start,
182 .stop = fsl_booke_stop, 181 .stop = fsl_booke_stop,
diff --git a/arch/ppc64/oprofile/op_model_power4.c b/arch/powerpc/oprofile/op_model_power4.c
index 32b2bb5625fe..886449315847 100644
--- a/arch/ppc64/oprofile/op_model_power4.c
+++ b/arch/powerpc/oprofile/op_model_power4.c
@@ -300,7 +300,7 @@ static void power4_handle_interrupt(struct pt_regs *regs,
300 mtspr(SPRN_MMCR0, mmcr0); 300 mtspr(SPRN_MMCR0, mmcr0);
301} 301}
302 302
303struct op_ppc64_model op_model_power4 = { 303struct op_powerpc_model op_model_power4 = {
304 .reg_setup = power4_reg_setup, 304 .reg_setup = power4_reg_setup,
305 .cpu_setup = power4_cpu_setup, 305 .cpu_setup = power4_cpu_setup,
306 .start = power4_start, 306 .start = power4_start,
diff --git a/arch/ppc64/oprofile/op_model_rs64.c b/arch/powerpc/oprofile/op_model_rs64.c
index 08c5b333f5c4..e010b85996e8 100644
--- a/arch/ppc64/oprofile/op_model_rs64.c
+++ b/arch/powerpc/oprofile/op_model_rs64.c
@@ -209,7 +209,7 @@ static void rs64_handle_interrupt(struct pt_regs *regs,
209 mtspr(SPRN_MMCR0, mmcr0); 209 mtspr(SPRN_MMCR0, mmcr0);
210} 210}
211 211
212struct op_ppc64_model op_model_rs64 = { 212struct op_powerpc_model op_model_rs64 = {
213 .reg_setup = rs64_reg_setup, 213 .reg_setup = rs64_reg_setup,
214 .cpu_setup = rs64_cpu_setup, 214 .cpu_setup = rs64_cpu_setup,
215 .start = rs64_start, 215 .start = rs64_start,
diff --git a/arch/powerpc/platforms/4xx/Kconfig b/arch/powerpc/platforms/4xx/Kconfig
new file mode 100644
index 000000000000..ed39d6a3d22a
--- /dev/null
+++ b/arch/powerpc/platforms/4xx/Kconfig
@@ -0,0 +1,280 @@
1config 4xx
2 bool
3 depends on 40x || 44x
4 default y
5
6config WANT_EARLY_SERIAL
7 bool
8 select SERIAL_8250
9 default n
10
11menu "AMCC 4xx options"
12 depends on 4xx
13
14choice
15 prompt "Machine Type"
16 depends on 40x
17 default WALNUT
18
19config BUBINGA
20 bool "Bubinga"
21 select WANT_EARLY_SERIAL
22 help
23 This option enables support for the IBM 405EP evaluation board.
24
25config CPCI405
26 bool "CPCI405"
27 help
28 This option enables support for the CPCI405 board.
29
30config EP405
31 bool "EP405/EP405PC"
32 help
33 This option enables support for the EP405/EP405PC boards.
34
35config REDWOOD_5
36 bool "Redwood-5"
37 help
38 This option enables support for the IBM STB04 evaluation board.
39
40config REDWOOD_6
41 bool "Redwood-6"
42 help
43 This option enables support for the IBM STBx25xx evaluation board.
44
45config SYCAMORE
46 bool "Sycamore"
47 help
48 This option enables support for the IBM PPC405GPr evaluation board.
49
50config WALNUT
51 bool "Walnut"
52 help
53 This option enables support for the IBM PPC405GP evaluation board.
54
55config XILINX_ML300
56 bool "Xilinx-ML300"
57 help
58 This option enables support for the Xilinx ML300 evaluation board.
59
60endchoice
61
62choice
63 prompt "Machine Type"
64 depends on 44x
65 default EBONY
66
67config BAMBOO
68 bool "Bamboo"
69 select WANT_EARLY_SERIAL
70 help
71 This option enables support for the IBM PPC440EP evaluation board.
72
73config EBONY
74 bool "Ebony"
75 select WANT_EARLY_SERIAL
76 help
77 This option enables support for the IBM PPC440GP evaluation board.
78
79config LUAN
80 bool "Luan"
81 select WANT_EARLY_SERIAL
82 help
83 This option enables support for the IBM PPC440SP evaluation board.
84
85config OCOTEA
86 bool "Ocotea"
87 select WANT_EARLY_SERIAL
88 help
89 This option enables support for the IBM PPC440GX evaluation board.
90
91endchoice
92
93config EP405PC
94 bool "EP405PC Support"
95 depends on EP405
96
97
98# It's often necessary to know the specific 4xx processor type.
99# Fortunately, it is impled (so far) from the board type, so we
100# don't need to ask more redundant questions.
101config NP405H
102 bool
103 depends on ASH
104 default y
105
106config 440EP
107 bool
108 depends on BAMBOO
109 select PPC_FPU
110 default y
111
112config 440GP
113 bool
114 depends on EBONY
115 default y
116
117config 440GX
118 bool
119 depends on OCOTEA
120 default y
121
122config 440SP
123 bool
124 depends on LUAN
125 default y
126
127config 440
128 bool
129 depends on 440GP || 440SP || 440EP
130 default y
131
132config 440A
133 bool
134 depends on 440GX
135 default y
136
137config IBM440EP_ERR42
138 bool
139 depends on 440EP
140 default y
141
142# All 405-based cores up until the 405GPR and 405EP have this errata.
143config IBM405_ERR77
144 bool
145 depends on 40x && !403GCX && !405GPR && !405EP
146 default y
147
148# All 40x-based cores, up until the 405GPR and 405EP have this errata.
149config IBM405_ERR51
150 bool
151 depends on 40x && !405GPR && !405EP
152 default y
153
154config BOOKE
155 bool
156 depends on 44x
157 default y
158
159config IBM_OCP
160 bool
161 depends on ASH || BAMBOO || BUBINGA || CPCI405 || EBONY || EP405 || LUAN || OCOTEA || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT
162 default y
163
164config XILINX_OCP
165 bool
166 depends on XILINX_ML300
167 default y
168
169config IBM_EMAC4
170 bool
171 depends on 440GX || 440SP
172 default y
173
174config BIOS_FIXUP
175 bool
176 depends on BUBINGA || EP405 || SYCAMORE || WALNUT
177 default y
178
179# OAK doesn't exist but wanted to keep this around for any future 403GCX boards
180config 403GCX
181 bool
182 depends OAK
183 default y
184
185config 405EP
186 bool
187 depends on BUBINGA
188 default y
189
190config 405GP
191 bool
192 depends on CPCI405 || EP405 || WALNUT
193 default y
194
195config 405GPR
196 bool
197 depends on SYCAMORE
198 default y
199
200config VIRTEX_II_PRO
201 bool
202 depends on XILINX_ML300
203 default y
204
205config STB03xxx
206 bool
207 depends on REDWOOD_5 || REDWOOD_6
208 default y
209
210config EMBEDDEDBOOT
211 bool
212 depends on EP405 || XILINX_ML300
213 default y
214
215config IBM_OPENBIOS
216 bool
217 depends on ASH || BUBINGA || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT
218 default y
219
220config PPC4xx_DMA
221 bool "PPC4xx DMA controller support"
222 depends on 4xx
223
224config PPC4xx_EDMA
225 bool
226 depends on !STB03xxx && PPC4xx_DMA
227 default y
228
229config PPC_GEN550
230 bool
231 depends on 4xx
232 default y
233
234choice
235 prompt "TTYS0 device and default console"
236 depends on 40x
237 default UART0_TTYS0
238
239config UART0_TTYS0
240 bool "UART0"
241
242config UART0_TTYS1
243 bool "UART1"
244
245endchoice
246
247config SERIAL_SICC
248 bool "SICC Serial port support"
249 depends on STB03xxx
250
251config UART1_DFLT_CONSOLE
252 bool
253 depends on SERIAL_SICC && UART0_TTYS1
254 default y
255
256config SERIAL_SICC_CONSOLE
257 bool
258 depends on SERIAL_SICC && UART0_TTYS1
259 default y
260endmenu
261
262
263menu "IBM 40x options"
264 depends on 40x
265
266config SERIAL_SICC
267 bool "SICC Serial port"
268 depends on STB03xxx
269
270config UART1_DFLT_CONSOLE
271 bool
272 depends on SERIAL_SICC && UART0_TTYS1
273 default y
274
275config SERIAL_SICC_CONSOLE
276 bool
277 depends on SERIAL_SICC && UART0_TTYS1
278 default y
279
280endmenu
diff --git a/arch/powerpc/platforms/4xx/Makefile b/arch/powerpc/platforms/4xx/Makefile
new file mode 100644
index 000000000000..79ff6b1e887c
--- /dev/null
+++ b/arch/powerpc/platforms/4xx/Makefile
@@ -0,0 +1 @@
# empty makefile so make clean works \ No newline at end of file
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
new file mode 100644
index 000000000000..c5bc2821d991
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -0,0 +1,86 @@
1config 85xx
2 bool
3 depends on E500
4 default y
5
6config PPC_INDIRECT_PCI_BE
7 bool
8 depends on 85xx
9 default y
10
11menu "Freescale 85xx options"
12 depends on E500
13
14choice
15 prompt "Machine Type"
16 depends on 85xx
17 default MPC8540_ADS
18
19config MPC8540_ADS
20 bool "Freescale MPC8540 ADS"
21 help
22 This option enables support for the MPC 8540 ADS evaluation board.
23
24config MPC8548_CDS
25 bool "Freescale MPC8548 CDS"
26 help
27 This option enablese support for the MPC8548 CDS evaluation board.
28
29config MPC8555_CDS
30 bool "Freescale MPC8555 CDS"
31 help
32 This option enablese support for the MPC8555 CDS evaluation board.
33
34config MPC8560_ADS
35 bool "Freescale MPC8560 ADS"
36 help
37 This option enables support for the MPC 8560 ADS evaluation board.
38
39config SBC8560
40 bool "WindRiver PowerQUICC III SBC8560"
41 help
42 This option enables support for the WindRiver PowerQUICC III
43 SBC8560 board.
44
45config STX_GP3
46 bool "Silicon Turnkey Express GP3"
47 help
48 This option enables support for the Silicon Turnkey Express GP3
49 board.
50
51endchoice
52
53# It's often necessary to know the specific 85xx processor type.
54# Fortunately, it is implied (so far) from the board type, so we
55# don't need to ask more redundant questions.
56config MPC8540
57 bool
58 depends on MPC8540_ADS
59 default y
60
61config MPC8548
62 bool
63 depends on MPC8548_CDS
64 default y
65
66config MPC8555
67 bool
68 depends on MPC8555_CDS
69 default y
70
71config MPC8560
72 bool
73 depends on SBC8560 || MPC8560_ADS || STX_GP3
74 default y
75
76config 85xx_PCI2
77 bool "Supprt for 2nd PCI host controller"
78 depends on MPC8555_CDS
79 default y
80
81config PPC_GEN550
82 bool
83 depends on MPC8540 || SBC8560 || MPC8555
84 default y
85
86endmenu
diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/85xx/Makefile
new file mode 100644
index 000000000000..6407197ffd89
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/Makefile
@@ -0,0 +1 @@
# empty makefile so make clean works
diff --git a/arch/powerpc/platforms/8xx/Kconfig b/arch/powerpc/platforms/8xx/Kconfig
new file mode 100644
index 000000000000..c8c0ba3cf8e8
--- /dev/null
+++ b/arch/powerpc/platforms/8xx/Kconfig
@@ -0,0 +1,352 @@
1config FADS
2 bool
3
4choice
5 prompt "8xx Machine Type"
6 depends on 8xx
7 default RPXLITE
8
9config RPXLITE
10 bool "RPX-Lite"
11 ---help---
12 Single-board computers based around the PowerPC MPC8xx chips and
13 intended for embedded applications. The following types are
14 supported:
15
16 RPX-Lite:
17 Embedded Planet RPX Lite. PC104 form-factor SBC based on the MPC823.
18
19 RPX-Classic:
20 Embedded Planet RPX Classic Low-fat. Credit-card-size SBC based on
21 the MPC 860
22
23 BSE-IP:
24 Bright Star Engineering ip-Engine.
25
26 TQM823L:
27 TQM850L:
28 TQM855L:
29 TQM860L:
30 MPC8xx based family of mini modules, half credit card size,
31 up to 64 MB of RAM, 8 MB Flash, (Fast) Ethernet, 2 x serial ports,
32 2 x CAN bus interface, ...
33 Manufacturer: TQ Components, www.tq-group.de
34 Date of Release: October (?) 1999
35 End of Life: not yet :-)
36 URL:
37 - module: <http://www.denx.de/PDF/TQM8xxLHWM201.pdf>
38 - starter kit: <http://www.denx.de/PDF/STK8xxLHWM201.pdf>
39 - images: <http://www.denx.de/embedded-ppc-en.html>
40
41 FPS850L:
42 FingerPrint Sensor System (based on TQM850L)
43 Manufacturer: IKENDI AG, <http://www.ikendi.com/>
44 Date of Release: November 1999
45 End of life: end 2000 ?
46 URL: see TQM850L
47
48 IVMS8:
49 MPC860 based board used in the "Integrated Voice Mail System",
50 Small Version (8 voice channels)
51 Manufacturer: Speech Design, <http://www.speech-design.de/>
52 Date of Release: December 2000 (?)
53 End of life: -
54 URL: <http://www.speech-design.de/>
55
56 IVML24:
57 MPC860 based board used in the "Integrated Voice Mail System",
58 Large Version (24 voice channels)
59 Manufacturer: Speech Design, <http://www.speech-design.de/>
60 Date of Release: March 2001 (?)
61 End of life: -
62 URL: <http://www.speech-design.de/>
63
64 HERMES:
65 Hermes-Pro ISDN/LAN router with integrated 8 x hub
66 Manufacturer: Multidata Gesellschaft fur Datentechnik und Informatik
67 <http://www.multidata.de/>
68 Date of Release: 2000 (?)
69 End of life: -
70 URL: <http://www.multidata.de/english/products/hpro.htm>
71
72 IP860:
73 VMEBus IP (Industry Pack) carrier board with MPC860
74 Manufacturer: MicroSys GmbH, <http://www.microsys.de/>
75 Date of Release: ?
76 End of life: -
77 URL: <http://www.microsys.de/html/ip860.html>
78
79 PCU_E:
80 PCU = Peripheral Controller Unit, Extended
81 Manufacturer: Siemens AG, ICN (Information and Communication Networks)
82 <http://www.siemens.de/page/1,3771,224315-1-999_2_226207-0,00.html>
83 Date of Release: April 2001
84 End of life: August 2001
85 URL: n. a.
86
87config RPXCLASSIC
88 bool "RPX-Classic"
89 help
90 The RPX-Classic is a single-board computer based on the Motorola
91 MPC860. It features 16MB of DRAM and a variable amount of flash,
92 I2C EEPROM, thermal monitoring, a PCMCIA slot, a DIP switch and two
93 LEDs. Variants with Ethernet ports exist. Say Y here to support it
94 directly.
95
96config BSEIP
97 bool "BSE-IP"
98 help
99 Say Y here to support the Bright Star Engineering ipEngine SBC.
100 This is a credit-card-sized device featuring a MPC823 processor,
101 26MB DRAM, 4MB flash, Ethernet, a 16K-gate FPGA, USB, an LCD/video
102 controller, and two RS232 ports.
103
104config MPC8XXFADS
105 bool "FADS"
106 select FADS
107
108config MPC86XADS
109 bool "MPC86XADS"
110 help
111 MPC86x Application Development System by Freescale Semiconductor.
112 The MPC86xADS is meant to serve as a platform for s/w and h/w
113 development around the MPC86X processor families.
114 select FADS
115
116config MPC885ADS
117 bool "MPC885ADS"
118 help
119 Freescale Semiconductor MPC885 Application Development System (ADS).
120 Also known as DUET.
121 The MPC885ADS is meant to serve as a platform for s/w and h/w
122 development around the MPC885 processor family.
123
124config TQM823L
125 bool "TQM823L"
126 help
127 Say Y here to support the TQM823L, one of an MPC8xx-based family of
128 mini SBCs (half credit-card size) from TQ Components first released
129 in late 1999. Technical references are at
130 <http://www.denx.de/PDF/TQM8xxLHWM201.pdf>, and
131 <http://www.denx.de/PDF/STK8xxLHWM201.pdf>, and an image at
132 <http://www.denx.de/embedded-ppc-en.html>.
133
134config TQM850L
135 bool "TQM850L"
136 help
137 Say Y here to support the TQM850L, one of an MPC8xx-based family of
138 mini SBCs (half credit-card size) from TQ Components first released
139 in late 1999. Technical references are at
140 <http://www.denx.de/PDF/TQM8xxLHWM201.pdf>, and
141 <http://www.denx.de/PDF/STK8xxLHWM201.pdf>, and an image at
142 <http://www.denx.de/embedded-ppc-en.html>.
143
144config TQM855L
145 bool "TQM855L"
146 help
147 Say Y here to support the TQM855L, one of an MPC8xx-based family of
148 mini SBCs (half credit-card size) from TQ Components first released
149 in late 1999. Technical references are at
150 <http://www.denx.de/PDF/TQM8xxLHWM201.pdf>, and
151 <http://www.denx.de/PDF/STK8xxLHWM201.pdf>, and an image at
152 <http://www.denx.de/embedded-ppc-en.html>.
153
154config TQM860L
155 bool "TQM860L"
156 help
157 Say Y here to support the TQM860L, one of an MPC8xx-based family of
158 mini SBCs (half credit-card size) from TQ Components first released
159 in late 1999. Technical references are at
160 <http://www.denx.de/PDF/TQM8xxLHWM201.pdf>, and
161 <http://www.denx.de/PDF/STK8xxLHWM201.pdf>, and an image at
162 <http://www.denx.de/embedded-ppc-en.html>.
163
164config FPS850L
165 bool "FPS850L"
166
167config IVMS8
168 bool "IVMS8"
169 help
170 Say Y here to support the Integrated Voice-Mail Small 8-channel SBC
171 from Speech Design, released March 2001. The manufacturer's website
172 is at <http://www.speech-design.de/>.
173
174config IVML24
175 bool "IVML24"
176 help
177 Say Y here to support the Integrated Voice-Mail Large 24-channel SBC
178 from Speech Design, released March 2001. The manufacturer's website
179 is at <http://www.speech-design.de/>.
180
181config HERMES_PRO
182 bool "HERMES"
183
184config IP860
185 bool "IP860"
186
187config LWMON
188 bool "LWMON"
189
190config PCU_E
191 bool "PCU_E"
192
193config CCM
194 bool "CCM"
195
196config LANTEC
197 bool "LANTEC"
198
199config MBX
200 bool "MBX"
201 help
202 MBX is a line of Motorola single-board computer based around the
203 MPC821 and MPC860 processors, and intended for embedded-controller
204 applications. Say Y here to support these boards directly.
205
206config WINCEPT
207 bool "WinCept"
208 help
209 The Wincept 100/110 is a Motorola single-board computer based on the
210 MPC821 PowerPC, introduced in 1998 and designed to be used in
211 thin-client machines. Say Y to support it directly.
212
213endchoice
214
215#
216# MPC8xx Communication options
217#
218
219menu "MPC8xx CPM Options"
220 depends on 8xx
221
222config SCC_ENET
223 bool "CPM SCC Ethernet"
224 depends on NET_ETHERNET
225 help
226 Enable Ethernet support via the Motorola MPC8xx serial
227 communications controller.
228
229choice
230 prompt "SCC used for Ethernet"
231 depends on SCC_ENET
232 default SCC1_ENET
233
234config SCC1_ENET
235 bool "SCC1"
236 help
237 Use MPC8xx serial communications controller 1 to drive Ethernet
238 (default).
239
240config SCC2_ENET
241 bool "SCC2"
242 help
243 Use MPC8xx serial communications controller 2 to drive Ethernet.
244
245config SCC3_ENET
246 bool "SCC3"
247 help
248 Use MPC8xx serial communications controller 3 to drive Ethernet.
249
250endchoice
251
252config FEC_ENET
253 bool "860T FEC Ethernet"
254 depends on NET_ETHERNET
255 help
256 Enable Ethernet support via the Fast Ethernet Controller (FCC) on
257 the Motorola MPC8260.
258
259config USE_MDIO
260 bool "Use MDIO for PHY configuration"
261 depends on FEC_ENET
262 help
263 On some boards the hardware configuration of the ethernet PHY can be
264 used without any software interaction over the MDIO interface, so
265 all MII code can be omitted. Say N here if unsure or if you don't
266 need link status reports.
267
268config FEC_AM79C874
269 bool "Support AMD79C874 PHY"
270 depends on USE_MDIO
271
272config FEC_LXT970
273 bool "Support LXT970 PHY"
274 depends on USE_MDIO
275
276config FEC_LXT971
277 bool "Support LXT971 PHY"
278 depends on USE_MDIO
279
280config FEC_QS6612
281 bool "Support QS6612 PHY"
282 depends on USE_MDIO
283
284config ENET_BIG_BUFFERS
285 bool "Use Big CPM Ethernet Buffers"
286 depends on SCC_ENET || FEC_ENET
287 help
288 Allocate large buffers for MPC8xx Ethernet. Increases throughput
289 and decreases the likelihood of dropped packets, but costs memory.
290
291config HTDMSOUND
292 bool "Embedded Planet HIOX Audio"
293 depends on SOUND=y
294
295# This doesn't really belong here, but it is convenient to ask
296# 8xx specific questions.
297comment "Generic MPC8xx Options"
298
299config 8xx_COPYBACK
300 bool "Copy-Back Data Cache (else Writethrough)"
301 help
302 Saying Y here will cause the cache on an MPC8xx processor to be used
303 in Copy-Back mode. If you say N here, it is used in Writethrough
304 mode.
305
306 If in doubt, say Y here.
307
308config 8xx_CPU6
309 bool "CPU6 Silicon Errata (860 Pre Rev. C)"
310 help
311 MPC860 CPUs, prior to Rev C have some bugs in the silicon, which
312 require workarounds for Linux (and most other OSes to work). If you
313 get a BUG() very early in boot, this might fix the problem. For
314 more details read the document entitled "MPC860 Family Device Errata
315 Reference" on Motorola's website. This option also incurs a
316 performance hit.
317
318 If in doubt, say N here.
319
320choice
321 prompt "Microcode patch selection"
322 default NO_UCODE_PATCH
323 help
324 Help not implemented yet, coming soon.
325
326config NO_UCODE_PATCH
327 bool "None"
328
329config USB_SOF_UCODE_PATCH
330 bool "USB SOF patch"
331 help
332 Help not implemented yet, coming soon.
333
334config I2C_SPI_UCODE_PATCH
335 bool "I2C/SPI relocation patch"
336 help
337 Help not implemented yet, coming soon.
338
339config I2C_SPI_SMC1_UCODE_PATCH
340 bool "I2C/SPI/SMC1 relocation patch"
341 help
342 Help not implemented yet, coming soon.
343
344endchoice
345
346config UCODE_PATCH
347 bool
348 default y
349 depends on !NO_UCODE_PATCH
350
351endmenu
352
diff --git a/arch/powerpc/platforms/Makefile b/arch/powerpc/platforms/Makefile
new file mode 100644
index 000000000000..172c0db63504
--- /dev/null
+++ b/arch/powerpc/platforms/Makefile
@@ -0,0 +1,13 @@
1ifeq ($(CONFIG_PPC_MERGE),y)
2obj-$(CONFIG_PPC_PMAC) += powermac/
3else
4ifeq ($(CONFIG_PPC64),y)
5obj-$(CONFIG_PPC_PMAC) += powermac/
6endif
7endif
8obj-$(CONFIG_PPC_CHRP) += chrp/
9obj-$(CONFIG_4xx) += 4xx/
10obj-$(CONFIG_85xx) += 85xx/
11obj-$(CONFIG_PPC_PSERIES) += pseries/
12obj-$(CONFIG_PPC_ISERIES) += iseries/
13obj-$(CONFIG_PPC_MAPLE) += maple/
diff --git a/arch/powerpc/platforms/apus/Kconfig b/arch/powerpc/platforms/apus/Kconfig
new file mode 100644
index 000000000000..6bde3bffed86
--- /dev/null
+++ b/arch/powerpc/platforms/apus/Kconfig
@@ -0,0 +1,130 @@
1
2config AMIGA
3 bool
4 depends on APUS
5 default y
6 help
7 This option enables support for the Amiga series of computers.
8
9config ZORRO
10 bool
11 depends on APUS
12 default y
13 help
14 This enables support for the Zorro bus in the Amiga. If you have
15 expansion cards in your Amiga that conform to the Amiga
16 AutoConfig(tm) specification, say Y, otherwise N. Note that even
17 expansion cards that do not fit in the Zorro slots but fit in e.g.
18 the CPU slot may fall in this category, so you have to say Y to let
19 Linux use these.
20
21config ABSTRACT_CONSOLE
22 bool
23 depends on APUS
24 default y
25
26config APUS_FAST_EXCEPT
27 bool
28 depends on APUS
29 default y
30
31config AMIGA_PCMCIA
32 bool "Amiga 1200/600 PCMCIA support"
33 depends on APUS && EXPERIMENTAL
34 help
35 Include support in the kernel for pcmcia on Amiga 1200 and Amiga
36 600. If you intend to use pcmcia cards say Y; otherwise say N.
37
38config AMIGA_BUILTIN_SERIAL
39 tristate "Amiga builtin serial support"
40 depends on APUS
41 help
42 If you want to use your Amiga's built-in serial port in Linux,
43 answer Y.
44
45 To compile this driver as a module, choose M here.
46
47config GVPIOEXT
48 tristate "GVP IO-Extender support"
49 depends on APUS
50 help
51 If you want to use a GVP IO-Extender serial card in Linux, say Y.
52 Otherwise, say N.
53
54config GVPIOEXT_LP
55 tristate "GVP IO-Extender parallel printer support"
56 depends on GVPIOEXT
57 help
58 Say Y to enable driving a printer from the parallel port on your
59 GVP IO-Extender card, N otherwise.
60
61config GVPIOEXT_PLIP
62 tristate "GVP IO-Extender PLIP support"
63 depends on GVPIOEXT
64 help
65 Say Y to enable doing IP over the parallel port on your GVP
66 IO-Extender card, N otherwise.
67
68config MULTIFACE_III_TTY
69 tristate "Multiface Card III serial support"
70 depends on APUS
71 help
72 If you want to use a Multiface III card's serial port in Linux,
73 answer Y.
74
75 To compile this driver as a module, choose M here.
76
77config A2232
78 tristate "Commodore A2232 serial support (EXPERIMENTAL)"
79 depends on EXPERIMENTAL && APUS
80 ---help---
81 This option supports the 2232 7-port serial card shipped with the
82 Amiga 2000 and other Zorro-bus machines, dating from 1989. At
83 a max of 19,200 bps, the ports are served by a 6551 ACIA UART chip
84 each, plus a 8520 CIA, and a master 6502 CPU and buffer as well. The
85 ports were connected with 8 pin DIN connectors on the card bracket,
86 for which 8 pin to DB25 adapters were supplied. The card also had
87 jumpers internally to toggle various pinning configurations.
88
89 This driver can be built as a module; but then "generic_serial"
90 will also be built as a module. This has to be loaded before
91 "ser_a2232". If you want to do this, answer M here.
92
93config WHIPPET_SERIAL
94 tristate "Hisoft Whippet PCMCIA serial support"
95 depends on AMIGA_PCMCIA
96 help
97 HiSoft has a web page at <http://www.hisoft.co.uk/>, but there
98 is no listing for the Whippet in their Amiga section.
99
100config APNE
101 tristate "PCMCIA NE2000 support"
102 depends on AMIGA_PCMCIA
103 help
104 If you have a PCMCIA NE2000 compatible adapter, say Y. Otherwise,
105 say N.
106
107 To compile this driver as a module, choose M here: the
108 module will be called apne.
109
110config SERIAL_CONSOLE
111 bool "Support for serial port console"
112 depends on APUS && (AMIGA_BUILTIN_SERIAL=y || GVPIOEXT=y || MULTIFACE_III_TTY=y)
113
114config HEARTBEAT
115 bool "Use power LED as a heartbeat"
116 depends on APUS
117 help
118 Use the power-on LED on your machine as a load meter. The exact
119 behavior is platform-dependent, but normally the flash frequency is
120 a hyperbolic function of the 5-minute load average.
121
122config PROC_HARDWARE
123 bool "/proc/hardware support"
124 depends on APUS
125
126source "drivers/zorro/Kconfig"
127
128config PCI_PERMEDIA
129 bool "PCI for Permedia2"
130 depends on !4xx && !8xx && APUS
diff --git a/arch/powerpc/platforms/chrp/Makefile b/arch/powerpc/platforms/chrp/Makefile
new file mode 100644
index 000000000000..902feb1ac431
--- /dev/null
+++ b/arch/powerpc/platforms/chrp/Makefile
@@ -0,0 +1,4 @@
1obj-y += setup.o time.o pegasos_eth.o
2obj-$(CONFIG_PCI) += pci.o
3obj-$(CONFIG_SMP) += smp.o
4obj-$(CONFIG_NVRAM) += nvram.o
diff --git a/arch/powerpc/platforms/chrp/chrp.h b/arch/powerpc/platforms/chrp/chrp.h
new file mode 100644
index 000000000000..3a2057fa314a
--- /dev/null
+++ b/arch/powerpc/platforms/chrp/chrp.h
@@ -0,0 +1,12 @@
1/*
2 * Declarations of CHRP platform-specific things.
3 */
4
5extern void chrp_nvram_init(void);
6extern void chrp_get_rtc_time(struct rtc_time *);
7extern int chrp_set_rtc_time(struct rtc_time *);
8extern void chrp_calibrate_decr(void);
9extern long chrp_time_init(void);
10
11extern void chrp_find_bridges(void);
12extern void chrp_event_scan(void);
diff --git a/arch/powerpc/platforms/chrp/nvram.c b/arch/powerpc/platforms/chrp/nvram.c
new file mode 100644
index 000000000000..4ac7125aa09c
--- /dev/null
+++ b/arch/powerpc/platforms/chrp/nvram.c
@@ -0,0 +1,84 @@
1/*
2 * c 2001 PPC 64 Team, 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 * /dev/nvram driver for PPC
10 *
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/slab.h>
16#include <linux/spinlock.h>
17#include <asm/uaccess.h>
18#include <asm/prom.h>
19#include <asm/machdep.h>
20#include "chrp.h"
21
22static unsigned int nvram_size;
23static unsigned char nvram_buf[4];
24static DEFINE_SPINLOCK(nvram_lock);
25
26static unsigned char chrp_nvram_read(int addr)
27{
28 unsigned long done, flags;
29 unsigned char ret;
30
31 if (addr >= nvram_size) {
32 printk(KERN_DEBUG "%s: read addr %d > nvram_size %u\n",
33 current->comm, addr, nvram_size);
34 return 0xff;
35 }
36 spin_lock_irqsave(&nvram_lock, flags);
37 if ((call_rtas("nvram-fetch", 3, 2, &done, addr, __pa(nvram_buf), 1) != 0) || 1 != done)
38 ret = 0xff;
39 else
40 ret = nvram_buf[0];
41 spin_unlock_irqrestore(&nvram_lock, flags);
42
43 return ret;
44}
45
46static void chrp_nvram_write(int addr, unsigned char val)
47{
48 unsigned long done, flags;
49
50 if (addr >= nvram_size) {
51 printk(KERN_DEBUG "%s: write addr %d > nvram_size %u\n",
52 current->comm, addr, nvram_size);
53 return;
54 }
55 spin_lock_irqsave(&nvram_lock, flags);
56 nvram_buf[0] = val;
57 if ((call_rtas("nvram-store", 3, 2, &done, addr, __pa(nvram_buf), 1) != 0) || 1 != done)
58 printk(KERN_DEBUG "rtas IO error storing 0x%02x at %d", val, addr);
59 spin_unlock_irqrestore(&nvram_lock, flags);
60}
61
62void __init chrp_nvram_init(void)
63{
64 struct device_node *nvram;
65 unsigned int *nbytes_p, proplen;
66
67 nvram = of_find_node_by_type(NULL, "nvram");
68 if (nvram == NULL)
69 return;
70
71 nbytes_p = (unsigned int *)get_property(nvram, "#bytes", &proplen);
72 if (nbytes_p == NULL || proplen != sizeof(unsigned int))
73 return;
74
75 nvram_size = *nbytes_p;
76
77 printk(KERN_INFO "CHRP nvram contains %u bytes\n", nvram_size);
78 of_node_put(nvram);
79
80 ppc_md.nvram_read_val = chrp_nvram_read;
81 ppc_md.nvram_write_val = chrp_nvram_write;
82
83 return;
84}
diff --git a/arch/powerpc/platforms/chrp/pci.c b/arch/powerpc/platforms/chrp/pci.c
new file mode 100644
index 000000000000..82c429d487f3
--- /dev/null
+++ b/arch/powerpc/platforms/chrp/pci.c
@@ -0,0 +1,310 @@
1/*
2 * CHRP pci routines.
3 */
4
5#include <linux/config.h>
6#include <linux/kernel.h>
7#include <linux/pci.h>
8#include <linux/delay.h>
9#include <linux/string.h>
10#include <linux/init.h>
11#include <linux/ide.h>
12
13#include <asm/io.h>
14#include <asm/pgtable.h>
15#include <asm/irq.h>
16#include <asm/hydra.h>
17#include <asm/prom.h>
18#include <asm/gg2.h>
19#include <asm/machdep.h>
20#include <asm/sections.h>
21#include <asm/pci-bridge.h>
22#include <asm/open_pic.h>
23#include <asm/grackle.h>
24#include <asm/rtas.h>
25
26/* LongTrail */
27void __iomem *gg2_pci_config_base;
28
29/*
30 * The VLSI Golden Gate II has only 512K of PCI configuration space, so we
31 * limit the bus number to 3 bits
32 */
33
34int gg2_read_config(struct pci_bus *bus, unsigned int devfn, int off,
35 int len, u32 *val)
36{
37 volatile void __iomem *cfg_data;
38 struct pci_controller *hose = bus->sysdata;
39
40 if (bus->number > 7)
41 return PCIBIOS_DEVICE_NOT_FOUND;
42 /*
43 * Note: the caller has already checked that off is
44 * suitably aligned and that len is 1, 2 or 4.
45 */
46 cfg_data = hose->cfg_data + ((bus->number<<16) | (devfn<<8) | off);
47 switch (len) {
48 case 1:
49 *val = in_8(cfg_data);
50 break;
51 case 2:
52 *val = in_le16(cfg_data);
53 break;
54 default:
55 *val = in_le32(cfg_data);
56 break;
57 }
58 return PCIBIOS_SUCCESSFUL;
59}
60
61int gg2_write_config(struct pci_bus *bus, unsigned int devfn, int off,
62 int len, u32 val)
63{
64 volatile void __iomem *cfg_data;
65 struct pci_controller *hose = bus->sysdata;
66
67 if (bus->number > 7)
68 return PCIBIOS_DEVICE_NOT_FOUND;
69 /*
70 * Note: the caller has already checked that off is
71 * suitably aligned and that len is 1, 2 or 4.
72 */
73 cfg_data = hose->cfg_data + ((bus->number<<16) | (devfn<<8) | off);
74 switch (len) {
75 case 1:
76 out_8(cfg_data, val);
77 break;
78 case 2:
79 out_le16(cfg_data, val);
80 break;
81 default:
82 out_le32(cfg_data, val);
83 break;
84 }
85 return PCIBIOS_SUCCESSFUL;
86}
87
88static struct pci_ops gg2_pci_ops =
89{
90 gg2_read_config,
91 gg2_write_config
92};
93
94/*
95 * Access functions for PCI config space using RTAS calls.
96 */
97int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
98 int len, u32 *val)
99{
100 struct pci_controller *hose = bus->sysdata;
101 unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8)
102 | (((bus->number - hose->first_busno) & 0xff) << 16)
103 | (hose->index << 24);
104 int ret = -1;
105 int rval;
106
107 rval = rtas_call(rtas_token("read-pci-config"), 2, 2, &ret, addr, len);
108 *val = ret;
109 return rval? PCIBIOS_DEVICE_NOT_FOUND: PCIBIOS_SUCCESSFUL;
110}
111
112int rtas_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
113 int len, u32 val)
114{
115 struct pci_controller *hose = bus->sysdata;
116 unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8)
117 | (((bus->number - hose->first_busno) & 0xff) << 16)
118 | (hose->index << 24);
119 int rval;
120
121 rval = rtas_call(rtas_token("write-pci-config"), 3, 1, NULL,
122 addr, len, val);
123 return rval? PCIBIOS_DEVICE_NOT_FOUND: PCIBIOS_SUCCESSFUL;
124}
125
126static struct pci_ops rtas_pci_ops =
127{
128 rtas_read_config,
129 rtas_write_config
130};
131
132volatile struct Hydra __iomem *Hydra = NULL;
133
134int __init
135hydra_init(void)
136{
137 struct device_node *np;
138
139 np = find_devices("mac-io");
140 if (np == NULL || np->n_addrs == 0)
141 return 0;
142 Hydra = ioremap(np->addrs[0].address, np->addrs[0].size);
143 printk("Hydra Mac I/O at %lx\n", np->addrs[0].address);
144 printk("Hydra Feature_Control was %x",
145 in_le32(&Hydra->Feature_Control));
146 out_le32(&Hydra->Feature_Control, (HYDRA_FC_SCC_CELL_EN |
147 HYDRA_FC_SCSI_CELL_EN |
148 HYDRA_FC_SCCA_ENABLE |
149 HYDRA_FC_SCCB_ENABLE |
150 HYDRA_FC_ARB_BYPASS |
151 HYDRA_FC_MPIC_ENABLE |
152 HYDRA_FC_SLOW_SCC_PCLK |
153 HYDRA_FC_MPIC_IS_MASTER));
154 printk(", now %x\n", in_le32(&Hydra->Feature_Control));
155 return 1;
156}
157
158void __init
159chrp_pcibios_fixup(void)
160{
161 struct pci_dev *dev = NULL;
162 struct device_node *np;
163
164 /* PCI interrupts are controlled by the OpenPIC */
165 for_each_pci_dev(dev) {
166 np = pci_device_to_OF_node(dev);
167 if ((np != 0) && (np->n_intrs > 0) && (np->intrs[0].line != 0))
168 dev->irq = np->intrs[0].line;
169 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
170 }
171}
172
173#define PRG_CL_RESET_VALID 0x00010000
174
175static void __init
176setup_python(struct pci_controller *hose, struct device_node *dev)
177{
178 u32 __iomem *reg;
179 u32 val;
180 unsigned long addr = dev->addrs[0].address;
181
182 setup_indirect_pci(hose, addr + 0xf8000, addr + 0xf8010);
183
184 /* Clear the magic go-slow bit */
185 reg = ioremap(dev->addrs[0].address + 0xf6000, 0x40);
186 val = in_be32(&reg[12]);
187 if (val & PRG_CL_RESET_VALID) {
188 out_be32(&reg[12], val & ~PRG_CL_RESET_VALID);
189 in_be32(&reg[12]);
190 }
191 iounmap(reg);
192}
193
194/* Marvell Discovery II based Pegasos 2 */
195static void __init setup_peg2(struct pci_controller *hose, struct device_node *dev)
196{
197 struct device_node *root = find_path_device("/");
198 struct device_node *rtas;
199
200 rtas = of_find_node_by_name (root, "rtas");
201 if (rtas) {
202 hose->ops = &rtas_pci_ops;
203 } else {
204 printk ("RTAS supporting Pegasos OF not found, please upgrade"
205 " your firmware\n");
206 }
207 pci_assign_all_buses = 1;
208}
209
210void __init
211chrp_find_bridges(void)
212{
213 struct device_node *dev;
214 int *bus_range;
215 int len, index = -1;
216 struct pci_controller *hose;
217 unsigned int *dma;
218 char *model, *machine;
219 int is_longtrail = 0, is_mot = 0, is_pegasos = 0;
220 struct device_node *root = find_path_device("/");
221
222 /*
223 * The PCI host bridge nodes on some machines don't have
224 * properties to adequately identify them, so we have to
225 * look at what sort of machine this is as well.
226 */
227 machine = get_property(root, "model", NULL);
228 if (machine != NULL) {
229 is_longtrail = strncmp(machine, "IBM,LongTrail", 13) == 0;
230 is_mot = strncmp(machine, "MOT", 3) == 0;
231 if (strncmp(machine, "Pegasos2", 8) == 0)
232 is_pegasos = 2;
233 else if (strncmp(machine, "Pegasos", 7) == 0)
234 is_pegasos = 1;
235 }
236 for (dev = root->child; dev != NULL; dev = dev->sibling) {
237 if (dev->type == NULL || strcmp(dev->type, "pci") != 0)
238 continue;
239 ++index;
240 /* The GG2 bridge on the LongTrail doesn't have an address */
241 if (dev->n_addrs < 1 && !is_longtrail) {
242 printk(KERN_WARNING "Can't use %s: no address\n",
243 dev->full_name);
244 continue;
245 }
246 bus_range = (int *) get_property(dev, "bus-range", &len);
247 if (bus_range == NULL || len < 2 * sizeof(int)) {
248 printk(KERN_WARNING "Can't get bus-range for %s\n",
249 dev->full_name);
250 continue;
251 }
252 if (bus_range[1] == bus_range[0])
253 printk(KERN_INFO "PCI bus %d", bus_range[0]);
254 else
255 printk(KERN_INFO "PCI buses %d..%d",
256 bus_range[0], bus_range[1]);
257 printk(" controlled by %s", dev->type);
258 if (dev->n_addrs > 0)
259 printk(" at %lx", dev->addrs[0].address);
260 printk("\n");
261
262 hose = pcibios_alloc_controller();
263 if (!hose) {
264 printk("Can't allocate PCI controller structure for %s\n",
265 dev->full_name);
266 continue;
267 }
268 hose->arch_data = dev;
269 hose->first_busno = bus_range[0];
270 hose->last_busno = bus_range[1];
271
272 model = get_property(dev, "model", NULL);
273 if (model == NULL)
274 model = "<none>";
275 if (device_is_compatible(dev, "IBM,python")) {
276 setup_python(hose, dev);
277 } else if (is_mot
278 || strncmp(model, "Motorola, Grackle", 17) == 0) {
279 setup_grackle(hose);
280 } else if (is_longtrail) {
281 void __iomem *p = ioremap(GG2_PCI_CONFIG_BASE, 0x80000);
282 hose->ops = &gg2_pci_ops;
283 hose->cfg_data = p;
284 gg2_pci_config_base = p;
285 } else if (is_pegasos == 1) {
286 setup_indirect_pci(hose, 0xfec00cf8, 0xfee00cfc);
287 } else if (is_pegasos == 2) {
288 setup_peg2(hose, dev);
289 } else {
290 printk("No methods for %s (model %s), using RTAS\n",
291 dev->full_name, model);
292 hose->ops = &rtas_pci_ops;
293 }
294
295 pci_process_bridge_OF_ranges(hose, dev, index == 0);
296
297 /* check the first bridge for a property that we can
298 use to set pci_dram_offset */
299 dma = (unsigned int *)
300 get_property(dev, "ibm,dma-ranges", &len);
301 if (index == 0 && dma != NULL && len >= 6 * sizeof(*dma)) {
302 pci_dram_offset = dma[2] - dma[3];
303 printk("pci_dram_offset = %lx\n", pci_dram_offset);
304 }
305 }
306
307 /* Do not fixup interrupts from OF tree on pegasos */
308 if (is_pegasos == 0)
309 ppc_md.pcibios_fixup = chrp_pcibios_fixup;
310}
diff --git a/arch/powerpc/platforms/chrp/pegasos_eth.c b/arch/powerpc/platforms/chrp/pegasos_eth.c
new file mode 100644
index 000000000000..a9052305c35d
--- /dev/null
+++ b/arch/powerpc/platforms/chrp/pegasos_eth.c
@@ -0,0 +1,213 @@
1/*
2 * arch/ppc/platforms/chrp_pegasos_eth.c
3 *
4 * Copyright (C) 2005 Sven Luther <sl@bplan-gmbh.de>
5 * Thanks to :
6 * Dale Farnsworth <dale@farnsworth.org>
7 * Mark A. Greer <mgreer@mvista.com>
8 * Nicolas DET <nd@bplan-gmbh.de>
9 * Benjamin Herrenschmidt <benh@kernel.crashing.org>
10 * And anyone else who helped me on this.
11 */
12
13#include <linux/types.h>
14#include <linux/init.h>
15#include <linux/ioport.h>
16#include <linux/device.h>
17#include <linux/mv643xx.h>
18#include <linux/pci.h>
19
20#define PEGASOS2_MARVELL_REGBASE (0xf1000000)
21#define PEGASOS2_MARVELL_REGSIZE (0x00004000)
22#define PEGASOS2_SRAM_BASE (0xf2000000)
23#define PEGASOS2_SRAM_SIZE (256*1024)
24
25#define PEGASOS2_SRAM_BASE_ETH0 (PEGASOS2_SRAM_BASE)
26#define PEGASOS2_SRAM_BASE_ETH1 (PEGASOS2_SRAM_BASE_ETH0 + (PEGASOS2_SRAM_SIZE / 2) )
27
28
29#define PEGASOS2_SRAM_RXRING_SIZE (PEGASOS2_SRAM_SIZE/4)
30#define PEGASOS2_SRAM_TXRING_SIZE (PEGASOS2_SRAM_SIZE/4)
31
32#undef BE_VERBOSE
33
34static struct resource mv643xx_eth_shared_resources[] = {
35 [0] = {
36 .name = "ethernet shared base",
37 .start = 0xf1000000 + MV643XX_ETH_SHARED_REGS,
38 .end = 0xf1000000 + MV643XX_ETH_SHARED_REGS +
39 MV643XX_ETH_SHARED_REGS_SIZE - 1,
40 .flags = IORESOURCE_MEM,
41 },
42};
43
44static struct platform_device mv643xx_eth_shared_device = {
45 .name = MV643XX_ETH_SHARED_NAME,
46 .id = 0,
47 .num_resources = ARRAY_SIZE(mv643xx_eth_shared_resources),
48 .resource = mv643xx_eth_shared_resources,
49};
50
51static struct resource mv643xx_eth0_resources[] = {
52 [0] = {
53 .name = "eth0 irq",
54 .start = 9,
55 .end = 9,
56 .flags = IORESOURCE_IRQ,
57 },
58};
59
60
61static struct mv643xx_eth_platform_data eth0_pd = {
62 .tx_sram_addr = PEGASOS2_SRAM_BASE_ETH0,
63 .tx_sram_size = PEGASOS2_SRAM_TXRING_SIZE,
64 .tx_queue_size = PEGASOS2_SRAM_TXRING_SIZE/16,
65
66 .rx_sram_addr = PEGASOS2_SRAM_BASE_ETH0 + PEGASOS2_SRAM_TXRING_SIZE,
67 .rx_sram_size = PEGASOS2_SRAM_RXRING_SIZE,
68 .rx_queue_size = PEGASOS2_SRAM_RXRING_SIZE/16,
69};
70
71static struct platform_device eth0_device = {
72 .name = MV643XX_ETH_NAME,
73 .id = 0,
74 .num_resources = ARRAY_SIZE(mv643xx_eth0_resources),
75 .resource = mv643xx_eth0_resources,
76 .dev = {
77 .platform_data = &eth0_pd,
78 },
79};
80
81static struct resource mv643xx_eth1_resources[] = {
82 [0] = {
83 .name = "eth1 irq",
84 .start = 9,
85 .end = 9,
86 .flags = IORESOURCE_IRQ,
87 },
88};
89
90static struct mv643xx_eth_platform_data eth1_pd = {
91 .tx_sram_addr = PEGASOS2_SRAM_BASE_ETH1,
92 .tx_sram_size = PEGASOS2_SRAM_TXRING_SIZE,
93 .tx_queue_size = PEGASOS2_SRAM_TXRING_SIZE/16,
94
95 .rx_sram_addr = PEGASOS2_SRAM_BASE_ETH1 + PEGASOS2_SRAM_TXRING_SIZE,
96 .rx_sram_size = PEGASOS2_SRAM_RXRING_SIZE,
97 .rx_queue_size = PEGASOS2_SRAM_RXRING_SIZE/16,
98};
99
100static struct platform_device eth1_device = {
101 .name = MV643XX_ETH_NAME,
102 .id = 1,
103 .num_resources = ARRAY_SIZE(mv643xx_eth1_resources),
104 .resource = mv643xx_eth1_resources,
105 .dev = {
106 .platform_data = &eth1_pd,
107 },
108};
109
110static struct platform_device *mv643xx_eth_pd_devs[] __initdata = {
111 &mv643xx_eth_shared_device,
112 &eth0_device,
113 &eth1_device,
114};
115
116/***********/
117/***********/
118#define MV_READ(offset,val) { val = readl(mv643xx_reg_base + offset); }
119#define MV_WRITE(offset,data) writel(data, mv643xx_reg_base + offset)
120
121static void __iomem *mv643xx_reg_base;
122
123static int Enable_SRAM(void)
124{
125 u32 ALong;
126
127 if (mv643xx_reg_base == NULL)
128 mv643xx_reg_base = ioremap(PEGASOS2_MARVELL_REGBASE,
129 PEGASOS2_MARVELL_REGSIZE);
130
131 if (mv643xx_reg_base == NULL)
132 return -ENOMEM;
133
134#ifdef BE_VERBOSE
135 printk("Pegasos II/Marvell MV64361: register remapped from %p to %p\n",
136 (void *)PEGASOS2_MARVELL_REGBASE, (void *)mv643xx_reg_base);
137#endif
138
139 MV_WRITE(MV64340_SRAM_CONFIG, 0);
140
141 MV_WRITE(MV64340_INTEGRATED_SRAM_BASE_ADDR, PEGASOS2_SRAM_BASE >> 16);
142
143 MV_READ(MV64340_BASE_ADDR_ENABLE, ALong);
144 ALong &= ~(1 << 19);
145 MV_WRITE(MV64340_BASE_ADDR_ENABLE, ALong);
146
147 ALong = 0x02;
148 ALong |= PEGASOS2_SRAM_BASE & 0xffff0000;
149 MV_WRITE(MV643XX_ETH_BAR_4, ALong);
150
151 MV_WRITE(MV643XX_ETH_SIZE_REG_4, (PEGASOS2_SRAM_SIZE-1) & 0xffff0000);
152
153 MV_READ(MV643XX_ETH_BASE_ADDR_ENABLE_REG, ALong);
154 ALong &= ~(1 << 4);
155 MV_WRITE(MV643XX_ETH_BASE_ADDR_ENABLE_REG, ALong);
156
157#ifdef BE_VERBOSE
158 printk("Pegasos II/Marvell MV64361: register unmapped\n");
159 printk("Pegasos II/Marvell MV64361: SRAM at %p, size=%x\n", (void*) PEGASOS2_SRAM_BASE, PEGASOS2_SRAM_SIZE);
160#endif
161
162 iounmap(mv643xx_reg_base);
163 mv643xx_reg_base = NULL;
164
165 return 1;
166}
167
168
169/***********/
170/***********/
171int mv643xx_eth_add_pds(void)
172{
173 int ret = 0;
174 static struct pci_device_id pci_marvell_mv64360[] = {
175 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, PCI_DEVICE_ID_MARVELL_MV64360) },
176 { }
177 };
178
179#ifdef BE_VERBOSE
180 printk("Pegasos II/Marvell MV64361: init\n");
181#endif
182
183 if (pci_dev_present(pci_marvell_mv64360)) {
184 ret = platform_add_devices(mv643xx_eth_pd_devs,
185 ARRAY_SIZE(mv643xx_eth_pd_devs));
186
187 if ( Enable_SRAM() < 0)
188 {
189 eth0_pd.tx_sram_addr = 0;
190 eth0_pd.tx_sram_size = 0;
191 eth0_pd.rx_sram_addr = 0;
192 eth0_pd.rx_sram_size = 0;
193
194 eth1_pd.tx_sram_addr = 0;
195 eth1_pd.tx_sram_size = 0;
196 eth1_pd.rx_sram_addr = 0;
197 eth1_pd.rx_sram_size = 0;
198
199#ifdef BE_VERBOSE
200 printk("Pegasos II/Marvell MV64361: Can't enable the "
201 "SRAM\n");
202#endif
203 }
204 }
205
206#ifdef BE_VERBOSE
207 printk("Pegasos II/Marvell MV64361: init is over\n");
208#endif
209
210 return ret;
211}
212
213device_initcall(mv643xx_eth_add_pds);
diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c
new file mode 100644
index 000000000000..ecd32d5d85f4
--- /dev/null
+++ b/arch/powerpc/platforms/chrp/setup.c
@@ -0,0 +1,522 @@
1/*
2 * arch/ppc/platforms/setup.c
3 *
4 * Copyright (C) 1995 Linus Torvalds
5 * Adapted from 'alpha' version by Gary Thomas
6 * Modified by Cort Dougan (cort@cs.nmt.edu)
7 */
8
9/*
10 * bootup setup stuff..
11 */
12
13#include <linux/config.h>
14#include <linux/errno.h>
15#include <linux/sched.h>
16#include <linux/kernel.h>
17#include <linux/mm.h>
18#include <linux/stddef.h>
19#include <linux/unistd.h>
20#include <linux/ptrace.h>
21#include <linux/slab.h>
22#include <linux/user.h>
23#include <linux/a.out.h>
24#include <linux/tty.h>
25#include <linux/major.h>
26#include <linux/interrupt.h>
27#include <linux/reboot.h>
28#include <linux/init.h>
29#include <linux/pci.h>
30#include <linux/version.h>
31#include <linux/adb.h>
32#include <linux/module.h>
33#include <linux/delay.h>
34#include <linux/ide.h>
35#include <linux/console.h>
36#include <linux/seq_file.h>
37#include <linux/root_dev.h>
38#include <linux/initrd.h>
39#include <linux/module.h>
40
41#include <asm/io.h>
42#include <asm/pgtable.h>
43#include <asm/prom.h>
44#include <asm/gg2.h>
45#include <asm/pci-bridge.h>
46#include <asm/dma.h>
47#include <asm/machdep.h>
48#include <asm/irq.h>
49#include <asm/hydra.h>
50#include <asm/sections.h>
51#include <asm/time.h>
52#include <asm/btext.h>
53#include <asm/i8259.h>
54#include <asm/mpic.h>
55#include <asm/rtas.h>
56#include <asm/xmon.h>
57
58#include "chrp.h"
59
60void rtas_indicator_progress(char *, unsigned short);
61void btext_progress(char *, unsigned short);
62
63int _chrp_type;
64EXPORT_SYMBOL(_chrp_type);
65
66struct mpic *chrp_mpic;
67
68/*
69 * XXX this should be in xmon.h, but putting it there means xmon.h
70 * has to include <linux/interrupt.h> (to get irqreturn_t), which
71 * causes all sorts of problems. -- paulus
72 */
73extern irqreturn_t xmon_irq(int, void *, struct pt_regs *);
74
75extern unsigned long loops_per_jiffy;
76
77#ifdef CONFIG_SMP
78extern struct smp_ops_t chrp_smp_ops;
79#endif
80
81static const char *gg2_memtypes[4] = {
82 "FPM", "SDRAM", "EDO", "BEDO"
83};
84static const char *gg2_cachesizes[4] = {
85 "256 KB", "512 KB", "1 MB", "Reserved"
86};
87static const char *gg2_cachetypes[4] = {
88 "Asynchronous", "Reserved", "Flow-Through Synchronous",
89 "Pipelined Synchronous"
90};
91static const char *gg2_cachemodes[4] = {
92 "Disabled", "Write-Through", "Copy-Back", "Transparent Mode"
93};
94
95void chrp_show_cpuinfo(struct seq_file *m)
96{
97 int i, sdramen;
98 unsigned int t;
99 struct device_node *root;
100 const char *model = "";
101
102 root = find_path_device("/");
103 if (root)
104 model = get_property(root, "model", NULL);
105 seq_printf(m, "machine\t\t: CHRP %s\n", model);
106
107 /* longtrail (goldengate) stuff */
108 if (!strncmp(model, "IBM,LongTrail", 13)) {
109 /* VLSI VAS96011/12 `Golden Gate 2' */
110 /* Memory banks */
111 sdramen = (in_le32(gg2_pci_config_base + GG2_PCI_DRAM_CTRL)
112 >>31) & 1;
113 for (i = 0; i < (sdramen ? 4 : 6); i++) {
114 t = in_le32(gg2_pci_config_base+
115 GG2_PCI_DRAM_BANK0+
116 i*4);
117 if (!(t & 1))
118 continue;
119 switch ((t>>8) & 0x1f) {
120 case 0x1f:
121 model = "4 MB";
122 break;
123 case 0x1e:
124 model = "8 MB";
125 break;
126 case 0x1c:
127 model = "16 MB";
128 break;
129 case 0x18:
130 model = "32 MB";
131 break;
132 case 0x10:
133 model = "64 MB";
134 break;
135 case 0x00:
136 model = "128 MB";
137 break;
138 default:
139 model = "Reserved";
140 break;
141 }
142 seq_printf(m, "memory bank %d\t: %s %s\n", i, model,
143 gg2_memtypes[sdramen ? 1 : ((t>>1) & 3)]);
144 }
145 /* L2 cache */
146 t = in_le32(gg2_pci_config_base+GG2_PCI_CC_CTRL);
147 seq_printf(m, "board l2\t: %s %s (%s)\n",
148 gg2_cachesizes[(t>>7) & 3],
149 gg2_cachetypes[(t>>2) & 3],
150 gg2_cachemodes[t & 3]);
151 }
152}
153
154/*
155 * Fixes for the National Semiconductor PC78308VUL SuperI/O
156 *
157 * Some versions of Open Firmware incorrectly initialize the IRQ settings
158 * for keyboard and mouse
159 */
160static inline void __init sio_write(u8 val, u8 index)
161{
162 outb(index, 0x15c);
163 outb(val, 0x15d);
164}
165
166static inline u8 __init sio_read(u8 index)
167{
168 outb(index, 0x15c);
169 return inb(0x15d);
170}
171
172static void __init sio_fixup_irq(const char *name, u8 device, u8 level,
173 u8 type)
174{
175 u8 level0, type0, active;
176
177 /* select logical device */
178 sio_write(device, 0x07);
179 active = sio_read(0x30);
180 level0 = sio_read(0x70);
181 type0 = sio_read(0x71);
182 if (level0 != level || type0 != type || !active) {
183 printk(KERN_WARNING "sio: %s irq level %d, type %d, %sactive: "
184 "remapping to level %d, type %d, active\n",
185 name, level0, type0, !active ? "in" : "", level, type);
186 sio_write(0x01, 0x30);
187 sio_write(level, 0x70);
188 sio_write(type, 0x71);
189 }
190}
191
192static void __init sio_init(void)
193{
194 struct device_node *root;
195
196 if ((root = find_path_device("/")) &&
197 !strncmp(get_property(root, "model", NULL), "IBM,LongTrail", 13)) {
198 /* logical device 0 (KBC/Keyboard) */
199 sio_fixup_irq("keyboard", 0, 1, 2);
200 /* select logical device 1 (KBC/Mouse) */
201 sio_fixup_irq("mouse", 1, 12, 2);
202 }
203}
204
205
206static void __init pegasos_set_l2cr(void)
207{
208 struct device_node *np;
209
210 /* On Pegasos, enable the l2 cache if needed, as the OF forgets it */
211 if (_chrp_type != _CHRP_Pegasos)
212 return;
213
214 /* Enable L2 cache if needed */
215 np = find_type_devices("cpu");
216 if (np != NULL) {
217 unsigned int *l2cr = (unsigned int *)
218 get_property (np, "l2cr", NULL);
219 if (l2cr == NULL) {
220 printk ("Pegasos l2cr : no cpu l2cr property found\n");
221 return;
222 }
223 if (!((*l2cr) & 0x80000000)) {
224 printk ("Pegasos l2cr : L2 cache was not active, "
225 "activating\n");
226 _set_L2CR(0);
227 _set_L2CR((*l2cr) | 0x80000000);
228 }
229 }
230}
231
232void __init chrp_setup_arch(void)
233{
234 struct device_node *root = find_path_device ("/");
235 char *machine = NULL;
236 struct device_node *device;
237 unsigned int *p = NULL;
238
239 /* init to some ~sane value until calibrate_delay() runs */
240 loops_per_jiffy = 50000000/HZ;
241
242 if (root)
243 machine = get_property(root, "model", NULL);
244 if (machine && strncmp(machine, "Pegasos", 7) == 0) {
245 _chrp_type = _CHRP_Pegasos;
246 } else if (machine && strncmp(machine, "IBM", 3) == 0) {
247 _chrp_type = _CHRP_IBM;
248 } else if (machine && strncmp(machine, "MOT", 3) == 0) {
249 _chrp_type = _CHRP_Motorola;
250 } else {
251 /* Let's assume it is an IBM chrp if all else fails */
252 _chrp_type = _CHRP_IBM;
253 }
254 printk("chrp type = %x\n", _chrp_type);
255
256 rtas_initialize();
257 if (rtas_token("display-character") >= 0)
258 ppc_md.progress = rtas_progress;
259
260#ifdef CONFIG_BOOTX_TEXT
261 if (ppc_md.progress == NULL && boot_text_mapped)
262 ppc_md.progress = btext_progress;
263#endif
264
265#ifdef CONFIG_BLK_DEV_INITRD
266 /* this is fine for chrp */
267 initrd_below_start_ok = 1;
268
269 if (initrd_start)
270 ROOT_DEV = Root_RAM0;
271 else
272#endif
273 ROOT_DEV = Root_SDA2; /* sda2 (sda1 is for the kernel) */
274
275 /* On pegasos, enable the L2 cache if not already done by OF */
276 pegasos_set_l2cr();
277
278 /* Lookup PCI host bridges */
279 chrp_find_bridges();
280
281 /*
282 * Temporary fixes for PCI devices.
283 * -- Geert
284 */
285 hydra_init(); /* Mac I/O */
286
287 /*
288 * Fix the Super I/O configuration
289 */
290 sio_init();
291
292 /* Get the event scan rate for the rtas so we know how
293 * often it expects a heartbeat. -- Cort
294 */
295 device = find_devices("rtas");
296 if (device)
297 p = (unsigned int *) get_property
298 (device, "rtas-event-scan-rate", NULL);
299 if (p && *p) {
300 ppc_md.heartbeat = chrp_event_scan;
301 ppc_md.heartbeat_reset = HZ / (*p * 30) - 1;
302 ppc_md.heartbeat_count = 1;
303 printk("RTAS Event Scan Rate: %u (%lu jiffies)\n",
304 *p, ppc_md.heartbeat_reset);
305 }
306
307 pci_create_OF_bus_map();
308
309 /*
310 * Print the banner, then scroll down so boot progress
311 * can be printed. -- Cort
312 */
313 if (ppc_md.progress) ppc_md.progress("Linux/PPC "UTS_RELEASE"\n", 0x0);
314}
315
316void
317chrp_event_scan(void)
318{
319 unsigned char log[1024];
320 int ret = 0;
321
322 /* XXX: we should loop until the hardware says no more error logs -- Cort */
323 rtas_call(rtas_token("event-scan"), 4, 1, &ret, 0xffffffff, 0,
324 __pa(log), 1024);
325 ppc_md.heartbeat_count = ppc_md.heartbeat_reset;
326}
327
328/*
329 * Finds the open-pic node and sets up the mpic driver.
330 */
331static void __init chrp_find_openpic(void)
332{
333 struct device_node *np, *root;
334 int len, i, j, irq_count;
335 int isu_size, idu_size;
336 unsigned int *iranges, *opprop = NULL;
337 int oplen = 0;
338 unsigned long opaddr;
339 int na = 1;
340 unsigned char init_senses[NR_IRQS - NUM_8259_INTERRUPTS];
341
342 np = find_type_devices("open-pic");
343 if (np == NULL)
344 return;
345 root = find_path_device("/");
346 if (root) {
347 opprop = (unsigned int *) get_property
348 (root, "platform-open-pic", &oplen);
349 na = prom_n_addr_cells(root);
350 }
351 if (opprop && oplen >= na * sizeof(unsigned int)) {
352 opaddr = opprop[na-1]; /* assume 32-bit */
353 oplen /= na * sizeof(unsigned int);
354 } else {
355 if (np->n_addrs == 0)
356 return;
357 opaddr = np->addrs[0].address;
358 oplen = 0;
359 }
360
361 printk(KERN_INFO "OpenPIC at %lx\n", opaddr);
362
363 irq_count = NR_IRQS - NUM_ISA_INTERRUPTS - 4; /* leave room for IPIs */
364 prom_get_irq_senses(init_senses, NUM_8259_INTERRUPTS, NR_IRQS - 4);
365
366 iranges = (unsigned int *) get_property(np, "interrupt-ranges", &len);
367 if (iranges == NULL)
368 len = 0; /* non-distributed mpic */
369 else
370 len /= 2 * sizeof(unsigned int);
371
372 /*
373 * The first pair of cells in interrupt-ranges refers to the
374 * IDU; subsequent pairs refer to the ISUs.
375 */
376 if (oplen < len) {
377 printk(KERN_ERR "Insufficient addresses for distributed"
378 " OpenPIC (%d < %d)\n", np->n_addrs, len);
379 len = oplen;
380 }
381
382 isu_size = 0;
383 idu_size = 0;
384 if (len > 0 && iranges[1] != 0) {
385 printk(KERN_INFO "OpenPIC irqs %d..%d in IDU\n",
386 iranges[0], iranges[0] + iranges[1] - 1);
387 idu_size = iranges[1];
388 }
389 if (len > 1)
390 isu_size = iranges[3];
391
392 chrp_mpic = mpic_alloc(opaddr, MPIC_PRIMARY,
393 isu_size, NUM_ISA_INTERRUPTS, irq_count,
394 NR_IRQS - 4, init_senses, irq_count,
395 " MPIC ");
396 if (chrp_mpic == NULL) {
397 printk(KERN_ERR "Failed to allocate MPIC structure\n");
398 return;
399 }
400
401 j = na - 1;
402 for (i = 1; i < len; ++i) {
403 iranges += 2;
404 j += na;
405 printk(KERN_INFO "OpenPIC irqs %d..%d in ISU at %x\n",
406 iranges[0], iranges[0] + iranges[1] - 1,
407 opprop[j]);
408 mpic_assign_isu(chrp_mpic, i - 1, opprop[j]);
409 }
410
411 mpic_init(chrp_mpic);
412 mpic_setup_cascade(NUM_ISA_INTERRUPTS, i8259_irq_cascade, NULL);
413}
414
415#if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) && defined(XMON)
416static struct irqaction xmon_irqaction = {
417 .handler = xmon_irq,
418 .mask = CPU_MASK_NONE,
419 .name = "XMON break",
420};
421#endif
422
423void __init chrp_init_IRQ(void)
424{
425 struct device_node *np;
426 unsigned long chrp_int_ack = 0;
427#if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) && defined(XMON)
428 struct device_node *kbd;
429#endif
430
431 for (np = find_devices("pci"); np != NULL; np = np->next) {
432 unsigned int *addrp = (unsigned int *)
433 get_property(np, "8259-interrupt-acknowledge", NULL);
434
435 if (addrp == NULL)
436 continue;
437 chrp_int_ack = addrp[prom_n_addr_cells(np)-1];
438 break;
439 }
440 if (np == NULL)
441 printk(KERN_ERR "Cannot find PCI interrupt acknowledge address\n");
442
443 chrp_find_openpic();
444
445 i8259_init(chrp_int_ack, 0);
446
447 if (_chrp_type == _CHRP_Pegasos)
448 ppc_md.get_irq = i8259_irq;
449 else
450 ppc_md.get_irq = mpic_get_irq;
451
452#if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) && defined(XMON)
453 /* see if there is a keyboard in the device tree
454 with a parent of type "adb" */
455 for (kbd = find_devices("keyboard"); kbd; kbd = kbd->next)
456 if (kbd->parent && kbd->parent->type
457 && strcmp(kbd->parent->type, "adb") == 0)
458 break;
459 if (kbd)
460 setup_irq(HYDRA_INT_ADB_NMI, &xmon_irqaction);
461#endif
462}
463
464void __init
465chrp_init2(void)
466{
467#ifdef CONFIG_NVRAM
468 chrp_nvram_init();
469#endif
470
471 request_region(0x20,0x20,"pic1");
472 request_region(0xa0,0x20,"pic2");
473 request_region(0x00,0x20,"dma1");
474 request_region(0x40,0x20,"timer");
475 request_region(0x80,0x10,"dma page reg");
476 request_region(0xc0,0x20,"dma2");
477
478 if (ppc_md.progress)
479 ppc_md.progress(" Have fun! ", 0x7777);
480}
481
482void __init chrp_init(void)
483{
484 ISA_DMA_THRESHOLD = ~0L;
485 DMA_MODE_READ = 0x44;
486 DMA_MODE_WRITE = 0x48;
487 isa_io_base = CHRP_ISA_IO_BASE; /* default value */
488 ppc_do_canonicalize_irqs = 1;
489
490 /* Assume we have an 8259... */
491 __irq_offset_value = NUM_ISA_INTERRUPTS;
492
493 ppc_md.setup_arch = chrp_setup_arch;
494 ppc_md.show_cpuinfo = chrp_show_cpuinfo;
495
496 ppc_md.init_IRQ = chrp_init_IRQ;
497 ppc_md.init = chrp_init2;
498
499 ppc_md.phys_mem_access_prot = pci_phys_mem_access_prot;
500
501 ppc_md.restart = rtas_restart;
502 ppc_md.power_off = rtas_power_off;
503 ppc_md.halt = rtas_halt;
504
505 ppc_md.time_init = chrp_time_init;
506 ppc_md.set_rtc_time = chrp_set_rtc_time;
507 ppc_md.get_rtc_time = chrp_get_rtc_time;
508 ppc_md.calibrate_decr = chrp_calibrate_decr;
509
510#ifdef CONFIG_SMP
511 smp_ops = &chrp_smp_ops;
512#endif /* CONFIG_SMP */
513}
514
515#ifdef CONFIG_BOOTX_TEXT
516void
517btext_progress(char *s, unsigned short hex)
518{
519 btext_drawstring(s);
520 btext_drawstring("\n");
521}
522#endif /* CONFIG_BOOTX_TEXT */
diff --git a/arch/powerpc/platforms/chrp/smp.c b/arch/powerpc/platforms/chrp/smp.c
new file mode 100644
index 000000000000..31ee49c25014
--- /dev/null
+++ b/arch/powerpc/platforms/chrp/smp.c
@@ -0,0 +1,122 @@
1/*
2 * Smp support for CHRP machines.
3 *
4 * Written by Cort Dougan (cort@cs.nmt.edu) borrowing a great
5 * deal of code from the sparc and intel versions.
6 *
7 * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu>
8 *
9 */
10
11#include <linux/config.h>
12#include <linux/kernel.h>
13#include <linux/sched.h>
14#include <linux/smp.h>
15#include <linux/smp_lock.h>
16#include <linux/interrupt.h>
17#include <linux/kernel_stat.h>
18#include <linux/delay.h>
19#include <linux/init.h>
20#include <linux/spinlock.h>
21
22#include <asm/ptrace.h>
23#include <asm/atomic.h>
24#include <asm/irq.h>
25#include <asm/page.h>
26#include <asm/pgtable.h>
27#include <asm/sections.h>
28#include <asm/io.h>
29#include <asm/prom.h>
30#include <asm/smp.h>
31#include <asm/residual.h>
32#include <asm/time.h>
33#include <asm/open_pic.h>
34#include <asm/machdep.h>
35#include <asm/smp.h>
36#include <asm/mpic.h>
37
38extern unsigned long smp_chrp_cpu_nr;
39
40static int __init smp_chrp_probe(void)
41{
42 struct device_node *cpus = NULL;
43 unsigned int *reg;
44 int reglen;
45 int ncpus = 0;
46 int cpuid;
47 unsigned int phys;
48
49 /* Count CPUs in the device-tree */
50 cpuid = 1; /* the boot cpu is logical cpu 0 */
51 while ((cpus = of_find_node_by_type(cpus, "cpu")) != NULL) {
52 phys = ncpus;
53 reg = (unsigned int *) get_property(cpus, "reg", &reglen);
54 if (reg && reglen >= sizeof(unsigned int))
55 /* hmmm, not having a reg property would be bad */
56 phys = *reg;
57 if (phys != boot_cpuid_phys) {
58 set_hard_smp_processor_id(cpuid, phys);
59 ++cpuid;
60 }
61 ++ncpus;
62 }
63
64 printk(KERN_INFO "CHRP SMP probe found %d cpus\n", ncpus);
65
66 /* Nothing more to do if less than 2 of them */
67 if (ncpus <= 1)
68 return 1;
69
70 mpic_request_ipis();
71
72 return ncpus;
73}
74
75static void __devinit smp_chrp_kick_cpu(int nr)
76{
77 *(unsigned long *)KERNELBASE = nr;
78 asm volatile("dcbf 0,%0"::"r"(KERNELBASE):"memory");
79}
80
81static void __devinit smp_chrp_setup_cpu(int cpu_nr)
82{
83 mpic_setup_this_cpu();
84}
85
86static DEFINE_SPINLOCK(timebase_lock);
87static unsigned int timebase_upper = 0, timebase_lower = 0;
88
89void __devinit smp_chrp_give_timebase(void)
90{
91 spin_lock(&timebase_lock);
92 rtas_call(rtas_token("freeze-time-base"), 0, 1, NULL);
93 timebase_upper = get_tbu();
94 timebase_lower = get_tbl();
95 spin_unlock(&timebase_lock);
96
97 while (timebase_upper || timebase_lower)
98 barrier();
99 rtas_call(rtas_token("thaw-time-base"), 0, 1, NULL);
100}
101
102void __devinit smp_chrp_take_timebase(void)
103{
104 while (!(timebase_upper || timebase_lower))
105 barrier();
106 spin_lock(&timebase_lock);
107 set_tb(timebase_upper, timebase_lower);
108 timebase_upper = 0;
109 timebase_lower = 0;
110 spin_unlock(&timebase_lock);
111 printk("CPU %i taken timebase\n", smp_processor_id());
112}
113
114/* CHRP with openpic */
115struct smp_ops_t chrp_smp_ops = {
116 .message_pass = smp_mpic_message_pass,
117 .probe = smp_chrp_probe,
118 .kick_cpu = smp_chrp_kick_cpu,
119 .setup_cpu = smp_chrp_setup_cpu,
120 .give_timebase = smp_chrp_give_timebase,
121 .take_timebase = smp_chrp_take_timebase,
122};
diff --git a/arch/powerpc/platforms/chrp/time.c b/arch/powerpc/platforms/chrp/time.c
new file mode 100644
index 000000000000..9e53535ddb82
--- /dev/null
+++ b/arch/powerpc/platforms/chrp/time.c
@@ -0,0 +1,188 @@
1/*
2 * arch/ppc/platforms/chrp_time.c
3 *
4 * Copyright (C) 1991, 1992, 1995 Linus Torvalds
5 *
6 * Adapted for PowerPC (PReP) by Gary Thomas
7 * Modified by Cort Dougan (cort@cs.nmt.edu).
8 * Copied and modified from arch/i386/kernel/time.c
9 *
10 */
11#include <linux/errno.h>
12#include <linux/sched.h>
13#include <linux/kernel.h>
14#include <linux/param.h>
15#include <linux/string.h>
16#include <linux/mm.h>
17#include <linux/interrupt.h>
18#include <linux/time.h>
19#include <linux/timex.h>
20#include <linux/kernel_stat.h>
21#include <linux/mc146818rtc.h>
22#include <linux/init.h>
23#include <linux/bcd.h>
24
25#include <asm/io.h>
26#include <asm/nvram.h>
27#include <asm/prom.h>
28#include <asm/sections.h>
29#include <asm/time.h>
30
31extern spinlock_t rtc_lock;
32
33static int nvram_as1 = NVRAM_AS1;
34static int nvram_as0 = NVRAM_AS0;
35static int nvram_data = NVRAM_DATA;
36
37long __init chrp_time_init(void)
38{
39 struct device_node *rtcs;
40 int base;
41
42 rtcs = find_compatible_devices("rtc", "pnpPNP,b00");
43 if (rtcs == NULL)
44 rtcs = find_compatible_devices("rtc", "ds1385-rtc");
45 if (rtcs == NULL || rtcs->addrs == NULL)
46 return 0;
47 base = rtcs->addrs[0].address;
48 nvram_as1 = 0;
49 nvram_as0 = base;
50 nvram_data = base + 1;
51
52 return 0;
53}
54
55int chrp_cmos_clock_read(int addr)
56{
57 if (nvram_as1 != 0)
58 outb(addr>>8, nvram_as1);
59 outb(addr, nvram_as0);
60 return (inb(nvram_data));
61}
62
63void chrp_cmos_clock_write(unsigned long val, int addr)
64{
65 if (nvram_as1 != 0)
66 outb(addr>>8, nvram_as1);
67 outb(addr, nvram_as0);
68 outb(val, nvram_data);
69 return;
70}
71
72/*
73 * Set the hardware clock. -- Cort
74 */
75int chrp_set_rtc_time(struct rtc_time *tmarg)
76{
77 unsigned char save_control, save_freq_select;
78 struct rtc_time tm = *tmarg;
79
80 spin_lock(&rtc_lock);
81
82 save_control = chrp_cmos_clock_read(RTC_CONTROL); /* tell the clock it's being set */
83
84 chrp_cmos_clock_write((save_control|RTC_SET), RTC_CONTROL);
85
86 save_freq_select = chrp_cmos_clock_read(RTC_FREQ_SELECT); /* stop and reset prescaler */
87
88 chrp_cmos_clock_write((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT);
89
90 tm.tm_year -= 1900;
91 if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
92 BIN_TO_BCD(tm.tm_sec);
93 BIN_TO_BCD(tm.tm_min);
94 BIN_TO_BCD(tm.tm_hour);
95 BIN_TO_BCD(tm.tm_mon);
96 BIN_TO_BCD(tm.tm_mday);
97 BIN_TO_BCD(tm.tm_year);
98 }
99 chrp_cmos_clock_write(tm.tm_sec,RTC_SECONDS);
100 chrp_cmos_clock_write(tm.tm_min,RTC_MINUTES);
101 chrp_cmos_clock_write(tm.tm_hour,RTC_HOURS);
102 chrp_cmos_clock_write(tm.tm_mon,RTC_MONTH);
103 chrp_cmos_clock_write(tm.tm_mday,RTC_DAY_OF_MONTH);
104 chrp_cmos_clock_write(tm.tm_year,RTC_YEAR);
105
106 /* The following flags have to be released exactly in this order,
107 * otherwise the DS12887 (popular MC146818A clone with integrated
108 * battery and quartz) will not reset the oscillator and will not
109 * update precisely 500 ms later. You won't find this mentioned in
110 * the Dallas Semiconductor data sheets, but who believes data
111 * sheets anyway ... -- Markus Kuhn
112 */
113 chrp_cmos_clock_write(save_control, RTC_CONTROL);
114 chrp_cmos_clock_write(save_freq_select, RTC_FREQ_SELECT);
115
116 spin_unlock(&rtc_lock);
117 return 0;
118}
119
120void chrp_get_rtc_time(struct rtc_time *tm)
121{
122 unsigned int year, mon, day, hour, min, sec;
123 int uip, i;
124
125 /* The Linux interpretation of the CMOS clock register contents:
126 * When the Update-In-Progress (UIP) flag goes from 1 to 0, the
127 * RTC registers show the second which has precisely just started.
128 * Let's hope other operating systems interpret the RTC the same way.
129 */
130
131 /* Since the UIP flag is set for about 2.2 ms and the clock
132 * is typically written with a precision of 1 jiffy, trying
133 * to obtain a precision better than a few milliseconds is
134 * an illusion. Only consistency is interesting, this also
135 * allows to use the routine for /dev/rtc without a potential
136 * 1 second kernel busy loop triggered by any reader of /dev/rtc.
137 */
138
139 for ( i = 0; i<1000000; i++) {
140 uip = chrp_cmos_clock_read(RTC_FREQ_SELECT);
141 sec = chrp_cmos_clock_read(RTC_SECONDS);
142 min = chrp_cmos_clock_read(RTC_MINUTES);
143 hour = chrp_cmos_clock_read(RTC_HOURS);
144 day = chrp_cmos_clock_read(RTC_DAY_OF_MONTH);
145 mon = chrp_cmos_clock_read(RTC_MONTH);
146 year = chrp_cmos_clock_read(RTC_YEAR);
147 uip |= chrp_cmos_clock_read(RTC_FREQ_SELECT);
148 if ((uip & RTC_UIP)==0) break;
149 }
150
151 if (!(chrp_cmos_clock_read(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
152 BCD_TO_BIN(sec);
153 BCD_TO_BIN(min);
154 BCD_TO_BIN(hour);
155 BCD_TO_BIN(day);
156 BCD_TO_BIN(mon);
157 BCD_TO_BIN(year);
158 }
159 if ((year += 1900) < 1970)
160 year += 100;
161 tm->tm_sec = sec;
162 tm->tm_min = min;
163 tm->tm_hour = hour;
164 tm->tm_mday = day;
165 tm->tm_mon = mon;
166 tm->tm_year = year;
167}
168
169
170void __init chrp_calibrate_decr(void)
171{
172 struct device_node *cpu;
173 unsigned int freq, *fp;
174
175 /*
176 * The cpu node should have a timebase-frequency property
177 * to tell us the rate at which the decrementer counts.
178 */
179 freq = 16666000; /* hardcoded default */
180 cpu = find_type_devices("cpu");
181 if (cpu != 0) {
182 fp = (unsigned int *)
183 get_property(cpu, "timebase-frequency", NULL);
184 if (fp != 0)
185 freq = *fp;
186 }
187 ppc_tb_freq = freq;
188}
diff --git a/arch/powerpc/platforms/embedded6xx/Kconfig b/arch/powerpc/platforms/embedded6xx/Kconfig
new file mode 100644
index 000000000000..81250090f98d
--- /dev/null
+++ b/arch/powerpc/platforms/embedded6xx/Kconfig
@@ -0,0 +1,318 @@
1choice
2 prompt "Machine Type"
3 depends on EMBEDDED6xx
4
5config KATANA
6 bool "Artesyn-Katana"
7 help
8 Select KATANA if configuring an Artesyn KATANA 750i or 3750
9 cPCI board.
10
11config WILLOW
12 bool "Cogent-Willow"
13
14config CPCI690
15 bool "Force-CPCI690"
16 help
17 Select CPCI690 if configuring a Force CPCI690 cPCI board.
18
19config POWERPMC250
20 bool "Force-PowerPMC250"
21
22config CHESTNUT
23 bool "IBM 750FX Eval board or 750GX Eval board"
24 help
25 Select CHESTNUT if configuring an IBM 750FX Eval Board or a
26 IBM 750GX Eval board.
27
28config SPRUCE
29 bool "IBM-Spruce"
30 select PPC_INDIRECT_PCI
31
32config HDPU
33 bool "Sky-HDPU"
34 help
35 Select HDPU if configuring a Sky Computers Compute Blade.
36
37config HDPU_FEATURES
38 depends HDPU
39 tristate "HDPU-Features"
40 help
41 Select to enable HDPU enhanced features.
42
43config EV64260
44 bool "Marvell-EV64260BP"
45 help
46 Select EV64260 if configuring a Marvell (formerly Galileo)
47 EV64260BP Evaluation platform.
48
49config LOPEC
50 bool "Motorola-LoPEC"
51 select PPC_I8259
52
53config MVME5100
54 bool "Motorola-MVME5100"
55 select PPC_INDIRECT_PCI
56
57config PPLUS
58 bool "Motorola-PowerPlus"
59 select PPC_I8259
60 select PPC_INDIRECT_PCI
61
62config PRPMC750
63 bool "Motorola-PrPMC750"
64 select PPC_INDIRECT_PCI
65
66config PRPMC800
67 bool "Motorola-PrPMC800"
68 select PPC_INDIRECT_PCI
69
70config SANDPOINT
71 bool "Motorola-Sandpoint"
72 select PPC_I8259
73 help
74 Select SANDPOINT if configuring for a Motorola Sandpoint X3
75 (any flavor).
76
77config RADSTONE_PPC7D
78 bool "Radstone Technology PPC7D board"
79 select PPC_I8259
80
81config PAL4
82 bool "SBS-Palomar4"
83
84config GEMINI
85 bool "Synergy-Gemini"
86 select PPC_INDIRECT_PCI
87 depends on BROKEN
88 help
89 Select Gemini if configuring for a Synergy Microsystems' Gemini
90 series Single Board Computer. More information is available at:
91 <http://www.synergymicro.com/PressRel/97_10_15.html>.
92
93config EST8260
94 bool "EST8260"
95 ---help---
96 The EST8260 is a single-board computer manufactured by Wind River
97 Systems, Inc. (formerly Embedded Support Tools Corp.) and based on
98 the MPC8260. Wind River Systems has a website at
99 <http://www.windriver.com/>, but the EST8260 cannot be found on it
100 and has probably been discontinued or rebadged.
101
102config SBC82xx
103 bool "SBC82xx"
104 ---help---
105 SBC PowerQUICC II, single-board computer with MPC82xx CPU
106 Manufacturer: Wind River Systems, Inc.
107 Date of Release: May 2003
108 End of Life: -
109 URL: <http://www.windriver.com/>
110
111config SBS8260
112 bool "SBS8260"
113
114config RPX8260
115 bool "RPXSUPER"
116
117config TQM8260
118 bool "TQM8260"
119 ---help---
120 MPC8260 based module, little larger than credit card,
121 up to 128 MB global + 64 MB local RAM, 32 MB Flash,
122 32 kB EEPROM, 256 kB L@ Cache, 10baseT + 100baseT Ethernet,
123 2 x serial ports, ...
124 Manufacturer: TQ Components, www.tq-group.de
125 Date of Release: June 2001
126 End of Life: not yet :-)
127 URL: <http://www.denx.de/PDF/TQM82xx_SPEC_Rev005.pdf>
128
129config ADS8272
130 bool "ADS8272"
131
132config PQ2FADS
133 bool "Freescale-PQ2FADS"
134 help
135 Select PQ2FADS if you wish to configure for a Freescale
136 PQ2FADS board (-VR or -ZU).
137
138config LITE5200
139 bool "Freescale LITE5200 / (IceCube)"
140 select PPC_MPC52xx
141 help
142 Support for the LITE5200 dev board for the MPC5200 from Freescale.
143 This is for the LITE5200 version 2.0 board. Don't know if it changes
144 much but it's only been tested on this board version. I think this
145 board is also known as IceCube.
146
147config MPC834x_SYS
148 bool "Freescale MPC834x SYS"
149 help
150 This option enables support for the MPC 834x SYS evaluation board.
151
152 Be aware that PCI buses can only function when SYS board is plugged
153 into the PIB (Platform IO Board) board from Freescale which provide
154 3 PCI slots. The PIBs PCI initialization is the bootloader's
155 responsiblilty.
156
157config EV64360
158 bool "Marvell-EV64360BP"
159 help
160 Select EV64360 if configuring a Marvell EV64360BP Evaluation
161 platform.
162endchoice
163
164config PQ2ADS
165 bool
166 depends on ADS8272
167 default y
168
169config TQM8xxL
170 bool
171 depends on 8xx && (TQM823L || TQM850L || FPS850L || TQM855L || TQM860L)
172 default y
173
174config PPC_MPC52xx
175 bool
176
177config 8260
178 bool "CPM2 Support" if WILLOW
179 depends on 6xx
180 default y if TQM8260 || RPX8260 || EST8260 || SBS8260 || SBC82xx || PQ2FADS
181 help
182 The MPC8260 is a typical embedded CPU made by Motorola. Selecting
183 this option means that you wish to build a kernel for a machine with
184 an 8260 class CPU.
185
186config 8272
187 bool
188 depends on 6xx
189 default y if ADS8272
190 select 8260
191 help
192 The MPC8272 CPM has a different internal dpram setup than other CPM2
193 devices
194
195config 83xx
196 bool
197 default y if MPC834x_SYS
198
199config MPC834x
200 bool
201 default y if MPC834x_SYS
202
203config CPM2
204 bool
205 depends on 8260 || MPC8560 || MPC8555
206 default y
207 help
208 The CPM2 (Communications Processor Module) is a coprocessor on
209 embedded CPUs made by Motorola. Selecting this option means that
210 you wish to build a kernel for a machine with a CPM2 coprocessor
211 on it (826x, 827x, 8560).
212
213config PPC_GEN550
214 bool
215 depends on SANDPOINT || SPRUCE || PPLUS || \
216 PRPMC750 || PRPMC800 || LOPEC || \
217 (EV64260 && !SERIAL_MPSC) || CHESTNUT || RADSTONE_PPC7D || \
218 83xx
219 default y
220
221config FORCE
222 bool
223 depends on 6xx && POWERPMC250
224 default y
225
226config GT64260
227 bool
228 depends on EV64260 || CPCI690
229 default y
230
231config MV64360 # Really MV64360 & MV64460
232 bool
233 depends on CHESTNUT || KATANA || RADSTONE_PPC7D || HDPU || EV64360
234 default y
235
236config MV64X60
237 bool
238 depends on (GT64260 || MV64360)
239 select PPC_INDIRECT_PCI
240 default y
241
242menu "Set bridge options"
243 depends on MV64X60
244
245config NOT_COHERENT_CACHE
246 bool "Turn off Cache Coherency"
247 default n
248 help
249 Some 64x60 bridges lock up when trying to enforce cache coherency.
250 When this option is selected, cache coherency will be turned off.
251 Note that this can cause other problems (e.g., stale data being
252 speculatively loaded via a cached mapping). Use at your own risk.
253
254config MV64X60_BASE
255 hex "Set bridge base used by firmware"
256 default "0xf1000000"
257 help
258 A firmware can leave the base address of the bridge's registers at
259 a non-standard location. If so, set this value to reflect the
260 address of that non-standard location.
261
262config MV64X60_NEW_BASE
263 hex "Set bridge base used by kernel"
264 default "0xf1000000"
265 help
266 If the current base address of the bridge's registers is not where
267 you want it, set this value to the address that you want it moved to.
268
269endmenu
270
271config NONMONARCH_SUPPORT
272 bool "Enable Non-Monarch Support"
273 depends on PRPMC800
274
275config HARRIER
276 bool
277 depends on PRPMC800
278 default y
279
280config EPIC_SERIAL_MODE
281 bool
282 depends on 6xx && (LOPEC || SANDPOINT)
283 default y
284
285config MPC10X_BRIDGE
286 bool
287 depends on POWERPMC250 || LOPEC || SANDPOINT
288 select PPC_INDIRECT_PCI
289 default y
290
291config MPC10X_OPENPIC
292 bool
293 depends on POWERPMC250 || LOPEC || SANDPOINT
294 default y
295
296config MPC10X_STORE_GATHERING
297 bool "Enable MPC10x store gathering"
298 depends on MPC10X_BRIDGE
299
300config SANDPOINT_ENABLE_UART1
301 bool "Enable DUART mode on Sandpoint"
302 depends on SANDPOINT
303 help
304 If this option is enabled then the MPC824x processor will run
305 in DUART mode instead of UART mode.
306
307config HARRIER_STORE_GATHERING
308 bool "Enable Harrier store gathering"
309 depends on HARRIER
310
311config MVME5100_IPMC761_PRESENT
312 bool "MVME5100 configured with an IPMC761"
313 depends on MVME5100
314 select PPC_I8259
315
316config SPRUCE_BAUD_33M
317 bool "Spruce baud clock support"
318 depends on SPRUCE
diff --git a/arch/powerpc/platforms/iseries/Kconfig b/arch/powerpc/platforms/iseries/Kconfig
new file mode 100644
index 000000000000..3d957a30c8c2
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/Kconfig
@@ -0,0 +1,31 @@
1
2menu "iSeries device drivers"
3 depends on PPC_ISERIES
4
5config VIOCONS
6 tristate "iSeries Virtual Console Support"
7
8config VIODASD
9 tristate "iSeries Virtual I/O disk support"
10 help
11 If you are running on an iSeries system and you want to use
12 virtual disks created and managed by OS/400, say Y.
13
14config VIOCD
15 tristate "iSeries Virtual I/O CD support"
16 help
17 If you are running Linux on an IBM iSeries system and you want to
18 read a CD drive owned by OS/400, say Y here.
19
20config VIOTAPE
21 tristate "iSeries Virtual Tape Support"
22 help
23 If you are running Linux on an iSeries system and you want Linux
24 to read and/or write a tape drive owned by OS/400, say Y here.
25
26endmenu
27
28config VIOPATH
29 bool
30 depends on VIOCONS || VIODASD || VIOCD || VIOTAPE || VETH
31 default y
diff --git a/arch/powerpc/platforms/iseries/Makefile b/arch/powerpc/platforms/iseries/Makefile
new file mode 100644
index 000000000000..127b465308be
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/Makefile
@@ -0,0 +1,9 @@
1EXTRA_CFLAGS += -mno-minimal-toc
2
3obj-y += hvlog.o hvlpconfig.o lpardata.o setup.o mf.o lpevents.o \
4 hvcall.o proc.o htab.o iommu.o misc.o
5obj-$(CONFIG_PCI) += pci.o irq.o vpdinfo.o
6obj-$(CONFIG_IBMVIO) += vio.o
7obj-$(CONFIG_SMP) += smp.o
8obj-$(CONFIG_VIOPATH) += viopath.o
9obj-$(CONFIG_MODULES) += ksyms.o
diff --git a/arch/powerpc/platforms/iseries/call_hpt.h b/arch/powerpc/platforms/iseries/call_hpt.h
new file mode 100644
index 000000000000..321f3bb7a8f5
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/call_hpt.h
@@ -0,0 +1,101 @@
1/*
2 * Copyright (C) 2001 Mike Corrigan IBM Corporation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (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#ifndef _PLATFORMS_ISERIES_CALL_HPT_H
19#define _PLATFORMS_ISERIES_CALL_HPT_H
20
21/*
22 * This file contains the "hypervisor call" interface which is used to
23 * drive the hypervisor from the OS.
24 */
25
26#include <asm/iSeries/HvCallSc.h>
27#include <asm/iSeries/HvTypes.h>
28#include <asm/mmu.h>
29
30#define HvCallHptGetHptAddress HvCallHpt + 0
31#define HvCallHptGetHptPages HvCallHpt + 1
32#define HvCallHptSetPp HvCallHpt + 5
33#define HvCallHptSetSwBits HvCallHpt + 6
34#define HvCallHptUpdate HvCallHpt + 7
35#define HvCallHptInvalidateNoSyncICache HvCallHpt + 8
36#define HvCallHptGet HvCallHpt + 11
37#define HvCallHptFindNextValid HvCallHpt + 12
38#define HvCallHptFindValid HvCallHpt + 13
39#define HvCallHptAddValidate HvCallHpt + 16
40#define HvCallHptInvalidateSetSwBitsGet HvCallHpt + 18
41
42
43static inline u64 HvCallHpt_getHptAddress(void)
44{
45 return HvCall0(HvCallHptGetHptAddress);
46}
47
48static inline u64 HvCallHpt_getHptPages(void)
49{
50 return HvCall0(HvCallHptGetHptPages);
51}
52
53static inline void HvCallHpt_setPp(u32 hpteIndex, u8 value)
54{
55 HvCall2(HvCallHptSetPp, hpteIndex, value);
56}
57
58static inline void HvCallHpt_setSwBits(u32 hpteIndex, u8 bitson, u8 bitsoff)
59{
60 HvCall3(HvCallHptSetSwBits, hpteIndex, bitson, bitsoff);
61}
62
63static inline void HvCallHpt_invalidateNoSyncICache(u32 hpteIndex)
64{
65 HvCall1(HvCallHptInvalidateNoSyncICache, hpteIndex);
66}
67
68static inline u64 HvCallHpt_invalidateSetSwBitsGet(u32 hpteIndex, u8 bitson,
69 u8 bitsoff)
70{
71 u64 compressedStatus;
72
73 compressedStatus = HvCall4(HvCallHptInvalidateSetSwBitsGet,
74 hpteIndex, bitson, bitsoff, 1);
75 HvCall1(HvCallHptInvalidateNoSyncICache, hpteIndex);
76 return compressedStatus;
77}
78
79static inline u64 HvCallHpt_findValid(hpte_t *hpte, u64 vpn)
80{
81 return HvCall3Ret16(HvCallHptFindValid, hpte, vpn, 0, 0);
82}
83
84static inline u64 HvCallHpt_findNextValid(hpte_t *hpte, u32 hpteIndex,
85 u8 bitson, u8 bitsoff)
86{
87 return HvCall3Ret16(HvCallHptFindNextValid, hpte, hpteIndex,
88 bitson, bitsoff);
89}
90
91static inline void HvCallHpt_get(hpte_t *hpte, u32 hpteIndex)
92{
93 HvCall2Ret16(HvCallHptGet, hpte, hpteIndex, 0);
94}
95
96static inline void HvCallHpt_addValidate(u32 hpteIndex, u32 hBit, hpte_t *hpte)
97{
98 HvCall4(HvCallHptAddValidate, hpteIndex, hBit, hpte->v, hpte->r);
99}
100
101#endif /* _PLATFORMS_ISERIES_CALL_HPT_H */
diff --git a/arch/powerpc/platforms/iseries/call_pci.h b/arch/powerpc/platforms/iseries/call_pci.h
new file mode 100644
index 000000000000..a86e065b9577
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/call_pci.h
@@ -0,0 +1,290 @@
1/*
2 * Provides the Hypervisor PCI calls for iSeries Linux Parition.
3 * Copyright (C) 2001 <Wayne G Holm> <IBM Corporation>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the:
17 * Free Software Foundation, Inc.,
18 * 59 Temple Place, Suite 330,
19 * Boston, MA 02111-1307 USA
20 *
21 * Change Activity:
22 * Created, Jan 9, 2001
23 */
24
25#ifndef _PLATFORMS_ISERIES_CALL_PCI_H
26#define _PLATFORMS_ISERIES_CALL_PCI_H
27
28#include <asm/iSeries/HvCallSc.h>
29#include <asm/iSeries/HvTypes.h>
30
31/*
32 * DSA == Direct Select Address
33 * this struct must be 64 bits in total
34 */
35struct HvCallPci_DsaAddr {
36 u16 busNumber; /* PHB index? */
37 u8 subBusNumber; /* PCI bus number? */
38 u8 deviceId; /* device and function? */
39 u8 barNumber;
40 u8 reserved[3];
41};
42
43union HvDsaMap {
44 u64 DsaAddr;
45 struct HvCallPci_DsaAddr Dsa;
46};
47
48struct HvCallPci_LoadReturn {
49 u64 rc;
50 u64 value;
51};
52
53enum HvCallPci_DeviceType {
54 HvCallPci_NodeDevice = 1,
55 HvCallPci_SpDevice = 2,
56 HvCallPci_IopDevice = 3,
57 HvCallPci_BridgeDevice = 4,
58 HvCallPci_MultiFunctionDevice = 5,
59 HvCallPci_IoaDevice = 6
60};
61
62
63struct HvCallPci_DeviceInfo {
64 u32 deviceType; /* See DeviceType enum for values */
65};
66
67struct HvCallPci_BusUnitInfo {
68 u32 sizeReturned; /* length of data returned */
69 u32 deviceType; /* see DeviceType enum for values */
70};
71
72struct HvCallPci_BridgeInfo {
73 struct HvCallPci_BusUnitInfo busUnitInfo; /* Generic bus unit info */
74 u8 subBusNumber; /* Bus number of secondary bus */
75 u8 maxAgents; /* Max idsels on secondary bus */
76 u8 maxSubBusNumber; /* Max Sub Bus */
77 u8 logicalSlotNumber; /* Logical Slot Number for IOA */
78};
79
80
81/*
82 * Maximum BusUnitInfo buffer size. Provided for clients so
83 * they can allocate a buffer big enough for any type of bus
84 * unit. Increase as needed.
85 */
86enum {HvCallPci_MaxBusUnitInfoSize = 128};
87
88struct HvCallPci_BarParms {
89 u64 vaddr;
90 u64 raddr;
91 u64 size;
92 u64 protectStart;
93 u64 protectEnd;
94 u64 relocationOffset;
95 u64 pciAddress;
96 u64 reserved[3];
97};
98
99enum HvCallPci_VpdType {
100 HvCallPci_BusVpd = 1,
101 HvCallPci_BusAdapterVpd = 2
102};
103
104#define HvCallPciConfigLoad8 HvCallPci + 0
105#define HvCallPciConfigLoad16 HvCallPci + 1
106#define HvCallPciConfigLoad32 HvCallPci + 2
107#define HvCallPciConfigStore8 HvCallPci + 3
108#define HvCallPciConfigStore16 HvCallPci + 4
109#define HvCallPciConfigStore32 HvCallPci + 5
110#define HvCallPciEoi HvCallPci + 16
111#define HvCallPciGetBarParms HvCallPci + 18
112#define HvCallPciMaskFisr HvCallPci + 20
113#define HvCallPciUnmaskFisr HvCallPci + 21
114#define HvCallPciSetSlotReset HvCallPci + 25
115#define HvCallPciGetDeviceInfo HvCallPci + 27
116#define HvCallPciGetCardVpd HvCallPci + 28
117#define HvCallPciBarLoad8 HvCallPci + 40
118#define HvCallPciBarLoad16 HvCallPci + 41
119#define HvCallPciBarLoad32 HvCallPci + 42
120#define HvCallPciBarLoad64 HvCallPci + 43
121#define HvCallPciBarStore8 HvCallPci + 44
122#define HvCallPciBarStore16 HvCallPci + 45
123#define HvCallPciBarStore32 HvCallPci + 46
124#define HvCallPciBarStore64 HvCallPci + 47
125#define HvCallPciMaskInterrupts HvCallPci + 48
126#define HvCallPciUnmaskInterrupts HvCallPci + 49
127#define HvCallPciGetBusUnitInfo HvCallPci + 50
128
129static inline u64 HvCallPci_configLoad16(u16 busNumber, u8 subBusNumber,
130 u8 deviceId, u32 offset, u16 *value)
131{
132 struct HvCallPci_DsaAddr dsa;
133 struct HvCallPci_LoadReturn retVal;
134
135 *((u64*)&dsa) = 0;
136
137 dsa.busNumber = busNumber;
138 dsa.subBusNumber = subBusNumber;
139 dsa.deviceId = deviceId;
140
141 HvCall3Ret16(HvCallPciConfigLoad16, &retVal, *(u64 *)&dsa, offset, 0);
142
143 *value = retVal.value;
144
145 return retVal.rc;
146}
147
148static inline u64 HvCallPci_configStore8(u16 busNumber, u8 subBusNumber,
149 u8 deviceId, u32 offset, u8 value)
150{
151 struct HvCallPci_DsaAddr dsa;
152
153 *((u64*)&dsa) = 0;
154
155 dsa.busNumber = busNumber;
156 dsa.subBusNumber = subBusNumber;
157 dsa.deviceId = deviceId;
158
159 return HvCall4(HvCallPciConfigStore8, *(u64 *)&dsa, offset, value, 0);
160}
161
162static inline u64 HvCallPci_eoi(u16 busNumberParm, u8 subBusParm,
163 u8 deviceIdParm)
164{
165 struct HvCallPci_DsaAddr dsa;
166 struct HvCallPci_LoadReturn retVal;
167
168 *((u64*)&dsa) = 0;
169
170 dsa.busNumber = busNumberParm;
171 dsa.subBusNumber = subBusParm;
172 dsa.deviceId = deviceIdParm;
173
174 HvCall1Ret16(HvCallPciEoi, &retVal, *(u64*)&dsa);
175
176 return retVal.rc;
177}
178
179static inline u64 HvCallPci_getBarParms(u16 busNumberParm, u8 subBusParm,
180 u8 deviceIdParm, u8 barNumberParm, u64 parms, u32 sizeofParms)
181{
182 struct HvCallPci_DsaAddr dsa;
183
184 *((u64*)&dsa) = 0;
185
186 dsa.busNumber = busNumberParm;
187 dsa.subBusNumber = subBusParm;
188 dsa.deviceId = deviceIdParm;
189 dsa.barNumber = barNumberParm;
190
191 return HvCall3(HvCallPciGetBarParms, *(u64*)&dsa, parms, sizeofParms);
192}
193
194static inline u64 HvCallPci_maskFisr(u16 busNumberParm, u8 subBusParm,
195 u8 deviceIdParm, u64 fisrMask)
196{
197 struct HvCallPci_DsaAddr dsa;
198
199 *((u64*)&dsa) = 0;
200
201 dsa.busNumber = busNumberParm;
202 dsa.subBusNumber = subBusParm;
203 dsa.deviceId = deviceIdParm;
204
205 return HvCall2(HvCallPciMaskFisr, *(u64*)&dsa, fisrMask);
206}
207
208static inline u64 HvCallPci_unmaskFisr(u16 busNumberParm, u8 subBusParm,
209 u8 deviceIdParm, u64 fisrMask)
210{
211 struct HvCallPci_DsaAddr dsa;
212
213 *((u64*)&dsa) = 0;
214
215 dsa.busNumber = busNumberParm;
216 dsa.subBusNumber = subBusParm;
217 dsa.deviceId = deviceIdParm;
218
219 return HvCall2(HvCallPciUnmaskFisr, *(u64*)&dsa, fisrMask);
220}
221
222static inline u64 HvCallPci_getDeviceInfo(u16 busNumberParm, u8 subBusParm,
223 u8 deviceNumberParm, u64 parms, u32 sizeofParms)
224{
225 struct HvCallPci_DsaAddr dsa;
226
227 *((u64*)&dsa) = 0;
228
229 dsa.busNumber = busNumberParm;
230 dsa.subBusNumber = subBusParm;
231 dsa.deviceId = deviceNumberParm << 4;
232
233 return HvCall3(HvCallPciGetDeviceInfo, *(u64*)&dsa, parms, sizeofParms);
234}
235
236static inline u64 HvCallPci_maskInterrupts(u16 busNumberParm, u8 subBusParm,
237 u8 deviceIdParm, u64 interruptMask)
238{
239 struct HvCallPci_DsaAddr dsa;
240
241 *((u64*)&dsa) = 0;
242
243 dsa.busNumber = busNumberParm;
244 dsa.subBusNumber = subBusParm;
245 dsa.deviceId = deviceIdParm;
246
247 return HvCall2(HvCallPciMaskInterrupts, *(u64*)&dsa, interruptMask);
248}
249
250static inline u64 HvCallPci_unmaskInterrupts(u16 busNumberParm, u8 subBusParm,
251 u8 deviceIdParm, u64 interruptMask)
252{
253 struct HvCallPci_DsaAddr dsa;
254
255 *((u64*)&dsa) = 0;
256
257 dsa.busNumber = busNumberParm;
258 dsa.subBusNumber = subBusParm;
259 dsa.deviceId = deviceIdParm;
260
261 return HvCall2(HvCallPciUnmaskInterrupts, *(u64*)&dsa, interruptMask);
262}
263
264static inline u64 HvCallPci_getBusUnitInfo(u16 busNumberParm, u8 subBusParm,
265 u8 deviceIdParm, u64 parms, u32 sizeofParms)
266{
267 struct HvCallPci_DsaAddr dsa;
268
269 *((u64*)&dsa) = 0;
270
271 dsa.busNumber = busNumberParm;
272 dsa.subBusNumber = subBusParm;
273 dsa.deviceId = deviceIdParm;
274
275 return HvCall3(HvCallPciGetBusUnitInfo, *(u64*)&dsa, parms,
276 sizeofParms);
277}
278
279static inline int HvCallPci_getBusVpd(u16 busNumParm, u64 destParm,
280 u16 sizeParm)
281{
282 u64 xRc = HvCall4(HvCallPciGetCardVpd, busNumParm, destParm,
283 sizeParm, HvCallPci_BusVpd);
284 if (xRc == -1)
285 return -1;
286 else
287 return xRc & 0xFFFF;
288}
289
290#endif /* _PLATFORMS_ISERIES_CALL_PCI_H */
diff --git a/arch/powerpc/platforms/iseries/call_sm.h b/arch/powerpc/platforms/iseries/call_sm.h
new file mode 100644
index 000000000000..ef223166cf22
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/call_sm.h
@@ -0,0 +1,37 @@
1/*
2 * Copyright (C) 2001 Mike Corrigan IBM Corporation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (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#ifndef _ISERIES_CALL_SM_H
19#define _ISERIES_CALL_SM_H
20
21/*
22 * This file contains the "hypervisor call" interface which is used to
23 * drive the hypervisor from the OS.
24 */
25
26#include <asm/iSeries/HvCallSc.h>
27#include <asm/iSeries/HvTypes.h>
28
29#define HvCallSmGet64BitsOfAccessMap HvCallSm + 11
30
31static inline u64 HvCallSm_get64BitsOfAccessMap(HvLpIndex lpIndex,
32 u64 indexIntoBitMap)
33{
34 return HvCall2(HvCallSmGet64BitsOfAccessMap, lpIndex, indexIntoBitMap);
35}
36
37#endif /* _ISERIES_CALL_SM_H */
diff --git a/arch/ppc64/kernel/iSeries_htab.c b/arch/powerpc/platforms/iseries/htab.c
index 073b76661747..b3c6c3374ca6 100644
--- a/arch/ppc64/kernel/iSeries_htab.c
+++ b/arch/powerpc/platforms/iseries/htab.c
@@ -1,10 +1,10 @@
1/* 1/*
2 * iSeries hashtable management. 2 * iSeries hashtable management.
3 * Derived from pSeries_htab.c 3 * Derived from pSeries_htab.c
4 * 4 *
5 * SMP scalability work: 5 * SMP scalability work:
6 * Copyright (C) 2001 Anton Blanchard <anton@au.ibm.com>, IBM 6 * Copyright (C) 2001 Anton Blanchard <anton@au.ibm.com>, IBM
7 * 7 *
8 * This program is free software; you can redistribute it and/or 8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License 9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 10 * as published by the Free Software Foundation; either version
@@ -14,11 +14,13 @@
14#include <asm/pgtable.h> 14#include <asm/pgtable.h>
15#include <asm/mmu.h> 15#include <asm/mmu.h>
16#include <asm/mmu_context.h> 16#include <asm/mmu_context.h>
17#include <asm/iSeries/HvCallHpt.h>
18#include <asm/abs_addr.h> 17#include <asm/abs_addr.h>
19#include <linux/spinlock.h> 18#include <linux/spinlock.h>
20 19
21static spinlock_t iSeries_hlocks[64] __cacheline_aligned_in_smp = { [0 ... 63] = SPIN_LOCK_UNLOCKED}; 20#include "call_hpt.h"
21
22static spinlock_t iSeries_hlocks[64] __cacheline_aligned_in_smp =
23 { [0 ... 63] = SPIN_LOCK_UNLOCKED};
22 24
23/* 25/*
24 * Very primitive algorithm for picking up a lock 26 * Very primitive algorithm for picking up a lock
@@ -84,6 +86,25 @@ static long iSeries_hpte_insert(unsigned long hpte_group, unsigned long va,
84 return (secondary << 3) | (slot & 7); 86 return (secondary << 3) | (slot & 7);
85} 87}
86 88
89long iSeries_hpte_bolt_or_insert(unsigned long hpte_group,
90 unsigned long va, unsigned long prpn, unsigned long vflags,
91 unsigned long rflags)
92{
93 long slot;
94 hpte_t lhpte;
95
96 slot = HvCallHpt_findValid(&lhpte, va >> PAGE_SHIFT);
97
98 if (lhpte.v & HPTE_V_VALID) {
99 /* Bolt the existing HPTE */
100 HvCallHpt_setSwBits(slot, 0x10, 0);
101 HvCallHpt_setPp(slot, PP_RWXX);
102 return 0;
103 }
104
105 return iSeries_hpte_insert(hpte_group, va, prpn, vflags, rflags);
106}
107
87static unsigned long iSeries_hpte_getword0(unsigned long slot) 108static unsigned long iSeries_hpte_getword0(unsigned long slot)
88{ 109{
89 hpte_t hpte; 110 hpte_t hpte;
@@ -107,7 +128,7 @@ static long iSeries_hpte_remove(unsigned long hpte_group)
107 hpte_v = iSeries_hpte_getword0(hpte_group + slot_offset); 128 hpte_v = iSeries_hpte_getword0(hpte_group + slot_offset);
108 129
109 if (! (hpte_v & HPTE_V_BOLTED)) { 130 if (! (hpte_v & HPTE_V_BOLTED)) {
110 HvCallHpt_invalidateSetSwBitsGet(hpte_group + 131 HvCallHpt_invalidateSetSwBitsGet(hpte_group +
111 slot_offset, 0, 0); 132 slot_offset, 0, 0);
112 iSeries_hunlock(hpte_group); 133 iSeries_hunlock(hpte_group);
113 return i; 134 return i;
@@ -124,9 +145,9 @@ static long iSeries_hpte_remove(unsigned long hpte_group)
124 145
125/* 146/*
126 * The HyperVisor expects the "flags" argument in this form: 147 * The HyperVisor expects the "flags" argument in this form:
127 * bits 0..59 : reserved 148 * bits 0..59 : reserved
128 * bit 60 : N 149 * bit 60 : N
129 * bits 61..63 : PP2,PP1,PP0 150 * bits 61..63 : PP2,PP1,PP0
130 */ 151 */
131static long iSeries_hpte_updatepp(unsigned long slot, unsigned long newpp, 152static long iSeries_hpte_updatepp(unsigned long slot, unsigned long newpp,
132 unsigned long va, int large, int local) 153 unsigned long va, int large, int local)
@@ -152,7 +173,7 @@ static long iSeries_hpte_updatepp(unsigned long slot, unsigned long newpp,
152} 173}
153 174
154/* 175/*
155 * Functions used to find the PTE for a particular virtual address. 176 * Functions used to find the PTE for a particular virtual address.
156 * Only used during boot when bolting pages. 177 * Only used during boot when bolting pages.
157 * 178 *
158 * Input : vpn : virtual page number 179 * Input : vpn : virtual page number
@@ -170,7 +191,7 @@ static long iSeries_hpte_find(unsigned long vpn)
170 * 0x00000000xxxxxxxx : Entry found in primary group, slot x 191 * 0x00000000xxxxxxxx : Entry found in primary group, slot x
171 * 0x80000000xxxxxxxx : Entry found in secondary group, slot x 192 * 0x80000000xxxxxxxx : Entry found in secondary group, slot x
172 */ 193 */
173 slot = HvCallHpt_findValid(&hpte, vpn); 194 slot = HvCallHpt_findValid(&hpte, vpn);
174 if (hpte.v & HPTE_V_VALID) { 195 if (hpte.v & HPTE_V_VALID) {
175 if (slot < 0) { 196 if (slot < 0) {
176 slot &= 0x7fffffffffffffff; 197 slot &= 0x7fffffffffffffff;
@@ -197,7 +218,7 @@ static void iSeries_hpte_updateboltedpp(unsigned long newpp, unsigned long ea)
197 vsid = get_kernel_vsid(ea); 218 vsid = get_kernel_vsid(ea);
198 va = (vsid << 28) | (ea & 0x0fffffff); 219 va = (vsid << 28) | (ea & 0x0fffffff);
199 vpn = va >> PAGE_SHIFT; 220 vpn = va >> PAGE_SHIFT;
200 slot = iSeries_hpte_find(vpn); 221 slot = iSeries_hpte_find(vpn);
201 if (slot == -1) 222 if (slot == -1)
202 panic("updateboltedpp: Could not find page to bolt\n"); 223 panic("updateboltedpp: Could not find page to bolt\n");
203 HvCallHpt_setPp(slot, newpp); 224 HvCallHpt_setPp(slot, newpp);
@@ -215,7 +236,7 @@ static void iSeries_hpte_invalidate(unsigned long slot, unsigned long va,
215 iSeries_hlock(slot); 236 iSeries_hlock(slot);
216 237
217 hpte_v = iSeries_hpte_getword0(slot); 238 hpte_v = iSeries_hpte_getword0(slot);
218 239
219 if ((HPTE_V_AVPN_VAL(hpte_v) == avpn) && (hpte_v & HPTE_V_VALID)) 240 if ((HPTE_V_AVPN_VAL(hpte_v) == avpn) && (hpte_v & HPTE_V_VALID))
220 HvCallHpt_invalidateSetSwBitsGet(slot, 0, 0); 241 HvCallHpt_invalidateSetSwBitsGet(slot, 0, 0);
221 242
@@ -230,7 +251,7 @@ void hpte_init_iSeries(void)
230 ppc_md.hpte_updatepp = iSeries_hpte_updatepp; 251 ppc_md.hpte_updatepp = iSeries_hpte_updatepp;
231 ppc_md.hpte_updateboltedpp = iSeries_hpte_updateboltedpp; 252 ppc_md.hpte_updateboltedpp = iSeries_hpte_updateboltedpp;
232 ppc_md.hpte_insert = iSeries_hpte_insert; 253 ppc_md.hpte_insert = iSeries_hpte_insert;
233 ppc_md.hpte_remove = iSeries_hpte_remove; 254 ppc_md.hpte_remove = iSeries_hpte_remove;
234 255
235 htab_finish_init(); 256 htab_finish_init();
236} 257}
diff --git a/arch/ppc64/kernel/hvCall.S b/arch/powerpc/platforms/iseries/hvcall.S
index 4c699eab1b95..07ae6ad5f49f 100644
--- a/arch/ppc64/kernel/hvCall.S
+++ b/arch/powerpc/platforms/iseries/hvcall.S
@@ -1,7 +1,4 @@
1/* 1/*
2 * arch/ppc64/kernel/hvCall.S
3 *
4 *
5 * This file contains the code to perform calls to the 2 * This file contains the code to perform calls to the
6 * iSeries LPAR hypervisor 3 * iSeries LPAR hypervisor
7 * 4 *
@@ -13,15 +10,16 @@
13 10
14#include <asm/ppc_asm.h> 11#include <asm/ppc_asm.h>
15#include <asm/processor.h> 12#include <asm/processor.h>
13#include <asm/ptrace.h> /* XXX for STACK_FRAME_OVERHEAD */
16 14
17 .text 15 .text
18 16
19/* 17/*
20 * Hypervisor call 18 * Hypervisor call
21 * 19 *
22 * Invoke the iSeries hypervisor via the System Call instruction 20 * Invoke the iSeries hypervisor via the System Call instruction
23 * Parameters are passed to this routine in registers r3 - r10 21 * Parameters are passed to this routine in registers r3 - r10
24 * 22 *
25 * r3 contains the HV function to be called 23 * r3 contains the HV function to be called
26 * r4-r10 contain the operands to the hypervisor function 24 * r4-r10 contain the operands to the hypervisor function
27 * 25 *
@@ -41,11 +39,11 @@ _GLOBAL(HvCall7)
41 mfcr r0 39 mfcr r0
42 std r0,-8(r1) 40 std r0,-8(r1)
43 stdu r1,-(STACK_FRAME_OVERHEAD+16)(r1) 41 stdu r1,-(STACK_FRAME_OVERHEAD+16)(r1)
44 42
45 /* r0 = 0xffffffffffffffff indicates a hypervisor call */ 43 /* r0 = 0xffffffffffffffff indicates a hypervisor call */
46 44
47 li r0,-1 45 li r0,-1
48 46
49 /* Invoke the hypervisor */ 47 /* Invoke the hypervisor */
50 48
51 sc 49 sc
@@ -55,7 +53,7 @@ _GLOBAL(HvCall7)
55 mtcrf 0xff,r0 53 mtcrf 0xff,r0
56 54
57 /* return to caller, return value in r3 */ 55 /* return to caller, return value in r3 */
58 56
59 blr 57 blr
60 58
61_GLOBAL(HvCall0Ret16) 59_GLOBAL(HvCall0Ret16)
@@ -92,7 +90,5 @@ _GLOBAL(HvCall7Ret16)
92 ld r0,-8(r1) 90 ld r0,-8(r1)
93 mtcrf 0xff,r0 91 mtcrf 0xff,r0
94 ld r31,-16(r1) 92 ld r31,-16(r1)
95
96 blr
97
98 93
94 blr
diff --git a/arch/ppc64/kernel/HvCall.c b/arch/powerpc/platforms/iseries/hvlog.c
index b772e65b57a2..f61e2e9ac9ec 100644
--- a/arch/ppc64/kernel/HvCall.c
+++ b/arch/powerpc/platforms/iseries/hvlog.c
@@ -1,5 +1,4 @@
1/* 1/*
2 * HvCall.c
3 * Copyright (C) 2001 Mike Corrigan IBM Corporation 2 * Copyright (C) 2001 Mike Corrigan IBM Corporation
4 * 3 *
5 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
diff --git a/arch/ppc64/kernel/HvLpConfig.c b/arch/powerpc/platforms/iseries/hvlpconfig.c
index cb1d6473203c..dc28621aea0d 100644
--- a/arch/ppc64/kernel/HvLpConfig.c
+++ b/arch/powerpc/platforms/iseries/hvlpconfig.c
@@ -1,5 +1,4 @@
1/* 1/*
2 * HvLpConfig.c
3 * Copyright (C) 2001 Kyle A. Lucke, IBM Corporation 2 * Copyright (C) 2001 Kyle A. Lucke, IBM Corporation
4 * 3 *
5 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
diff --git a/arch/ppc64/kernel/iSeries_iommu.c b/arch/powerpc/platforms/iseries/iommu.c
index f8ff1bb054dc..1db26d8be640 100644
--- a/arch/ppc64/kernel/iSeries_iommu.c
+++ b/arch/powerpc/platforms/iseries/iommu.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc64/kernel/iSeries_iommu.c
3 *
4 * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation 2 * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation
5 * 3 *
6 * Rewrite, cleanup: 4 * Rewrite, cleanup:
@@ -30,9 +28,11 @@
30#include <linux/list.h> 28#include <linux/list.h>
31 29
32#include <asm/iommu.h> 30#include <asm/iommu.h>
31#include <asm/tce.h>
33#include <asm/machdep.h> 32#include <asm/machdep.h>
33#include <asm/abs_addr.h>
34#include <asm/pci-bridge.h>
34#include <asm/iSeries/HvCallXm.h> 35#include <asm/iSeries/HvCallXm.h>
35#include <asm/iSeries/iSeries_pci.h>
36 36
37extern struct list_head iSeries_Global_Device_List; 37extern struct list_head iSeries_Global_Device_List;
38 38
@@ -90,15 +90,16 @@ static void tce_free_iSeries(struct iommu_table *tbl, long index, long npages)
90 */ 90 */
91static struct iommu_table *iommu_table_find(struct iommu_table * tbl) 91static struct iommu_table *iommu_table_find(struct iommu_table * tbl)
92{ 92{
93 struct iSeries_Device_Node *dp; 93 struct pci_dn *pdn;
94 94
95 list_for_each_entry(dp, &iSeries_Global_Device_List, Device_List) { 95 list_for_each_entry(pdn, &iSeries_Global_Device_List, Device_List) {
96 if ((dp->iommu_table != NULL) && 96 struct iommu_table *it = pdn->iommu_table;
97 (dp->iommu_table->it_type == TCE_PCI) && 97 if ((it != NULL) &&
98 (dp->iommu_table->it_offset == tbl->it_offset) && 98 (it->it_type == TCE_PCI) &&
99 (dp->iommu_table->it_index == tbl->it_index) && 99 (it->it_offset == tbl->it_offset) &&
100 (dp->iommu_table->it_size == tbl->it_size)) 100 (it->it_index == tbl->it_index) &&
101 return dp->iommu_table; 101 (it->it_size == tbl->it_size))
102 return it;
102 } 103 }
103 return NULL; 104 return NULL;
104} 105}
@@ -112,7 +113,7 @@ static struct iommu_table *iommu_table_find(struct iommu_table * tbl)
112 * 2. TCE table per Bus. 113 * 2. TCE table per Bus.
113 * 3. TCE Table per IOA. 114 * 3. TCE Table per IOA.
114 */ 115 */
115static void iommu_table_getparms(struct iSeries_Device_Node* dn, 116static void iommu_table_getparms(struct pci_dn *pdn,
116 struct iommu_table* tbl) 117 struct iommu_table* tbl)
117{ 118{
118 struct iommu_table_cb *parms; 119 struct iommu_table_cb *parms;
@@ -123,11 +124,11 @@ static void iommu_table_getparms(struct iSeries_Device_Node* dn,
123 124
124 memset(parms, 0, sizeof(*parms)); 125 memset(parms, 0, sizeof(*parms));
125 126
126 parms->itc_busno = ISERIES_BUS(dn); 127 parms->itc_busno = pdn->busno;
127 parms->itc_slotno = dn->LogicalSlot; 128 parms->itc_slotno = pdn->LogicalSlot;
128 parms->itc_virtbus = 0; 129 parms->itc_virtbus = 0;
129 130
130 HvCallXm_getTceTableParms(ISERIES_HV_ADDR(parms)); 131 HvCallXm_getTceTableParms(iseries_hv_addr(parms));
131 132
132 if (parms->itc_size == 0) 133 if (parms->itc_size == 0)
133 panic("PCI_DMA: parms->size is zero, parms is 0x%p", parms); 134 panic("PCI_DMA: parms->size is zero, parms is 0x%p", parms);
@@ -144,18 +145,19 @@ static void iommu_table_getparms(struct iSeries_Device_Node* dn,
144} 145}
145 146
146 147
147void iommu_devnode_init_iSeries(struct iSeries_Device_Node *dn) 148void iommu_devnode_init_iSeries(struct device_node *dn)
148{ 149{
149 struct iommu_table *tbl; 150 struct iommu_table *tbl;
151 struct pci_dn *pdn = PCI_DN(dn);
150 152
151 tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL); 153 tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL);
152 154
153 iommu_table_getparms(dn, tbl); 155 iommu_table_getparms(pdn, tbl);
154 156
155 /* Look for existing tce table */ 157 /* Look for existing tce table */
156 dn->iommu_table = iommu_table_find(tbl); 158 pdn->iommu_table = iommu_table_find(tbl);
157 if (dn->iommu_table == NULL) 159 if (pdn->iommu_table == NULL)
158 dn->iommu_table = iommu_init_table(tbl); 160 pdn->iommu_table = iommu_init_table(tbl);
159 else 161 else
160 kfree(tbl); 162 kfree(tbl);
161} 163}
diff --git a/arch/powerpc/platforms/iseries/ipl_parms.h b/arch/powerpc/platforms/iseries/ipl_parms.h
new file mode 100644
index 000000000000..77c135ddbf1b
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/ipl_parms.h
@@ -0,0 +1,70 @@
1/*
2 * Copyright (C) 2001 Mike Corrigan IBM Corporation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (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#ifndef _ISERIES_IPL_PARMS_H
19#define _ISERIES_IPL_PARMS_H
20
21/*
22 * This struct maps the IPL Parameters DMA'd from the SP.
23 *
24 * Warning:
25 * This data must map in exactly 64 bytes and match the architecture for
26 * the IPL parms
27 */
28
29#include <asm/types.h>
30
31struct ItIplParmsReal {
32 u8 xFormat; // Defines format of IplParms x00-x00
33 u8 xRsvd01:6; // Reserved x01-x01
34 u8 xAlternateSearch:1; // Alternate search indicator ...
35 u8 xUaSupplied:1; // UA Supplied on programmed IPL...
36 u8 xLsUaFormat; // Format byte for UA x02-x02
37 u8 xRsvd02; // Reserved x03-x03
38 u32 xLsUa; // LS UA x04-x07
39 u32 xUnusedLsLid; // First OS LID to load x08-x0B
40 u16 xLsBusNumber; // LS Bus Number x0C-x0D
41 u8 xLsCardAdr; // LS Card Address x0E-x0E
42 u8 xLsBoardAdr; // LS Board Address x0F-x0F
43 u32 xRsvd03; // Reserved x10-x13
44 u8 xSpcnPresent:1; // SPCN present x14-x14
45 u8 xCpmPresent:1; // CPM present ...
46 u8 xRsvd04:6; // Reserved ...
47 u8 xRsvd05:4; // Reserved x15-x15
48 u8 xKeyLock:4; // Keylock setting ...
49 u8 xRsvd06:6; // Reserved x16-x16
50 u8 xIplMode:2; // Ipl mode (A|B|C|D) ...
51 u8 xHwIplType; // Fast v slow v slow EC HW IPL x17-x17
52 u16 xCpmEnabledIpl:1; // CPM in effect when IPL initiatedx18-x19
53 u16 xPowerOnResetIpl:1; // Indicate POR condition ...
54 u16 xMainStorePreserved:1; // Main Storage is preserved ...
55 u16 xRsvd07:13; // Reserved ...
56 u16 xIplSource:16; // Ipl source x1A-x1B
57 u8 xIplReason:8; // Reason for this IPL x1C-x1C
58 u8 xRsvd08; // Reserved x1D-x1D
59 u16 xRsvd09; // Reserved x1E-x1F
60 u16 xSysBoxType; // System Box Type x20-x21
61 u16 xSysProcType; // System Processor Type x22-x23
62 u32 xRsvd10; // Reserved x24-x27
63 u64 xRsvd11; // Reserved x28-x2F
64 u64 xRsvd12; // Reserved x30-x37
65 u64 xRsvd13; // Reserved x38-x3F
66};
67
68extern struct ItIplParmsReal xItIplParmsReal;
69
70#endif /* _ISERIES_IPL_PARMS_H */
diff --git a/arch/ppc64/kernel/iSeries_irq.c b/arch/powerpc/platforms/iseries/irq.c
index 77376c1bd611..937ac99b9d33 100644
--- a/arch/ppc64/kernel/iSeries_irq.c
+++ b/arch/powerpc/platforms/iseries/irq.c
@@ -38,9 +38,10 @@
38#include <asm/ppcdebug.h> 38#include <asm/ppcdebug.h>
39#include <asm/iSeries/HvTypes.h> 39#include <asm/iSeries/HvTypes.h>
40#include <asm/iSeries/HvLpEvent.h> 40#include <asm/iSeries/HvLpEvent.h>
41#include <asm/iSeries/HvCallPci.h>
42#include <asm/iSeries/HvCallXm.h> 41#include <asm/iSeries/HvCallXm.h>
43#include <asm/iSeries/iSeries_irq.h> 42
43#include "irq.h"
44#include "call_pci.h"
44 45
45/* This maps virtual irq numbers to real irqs */ 46/* This maps virtual irq numbers to real irqs */
46unsigned int virt_irq_to_real_map[NR_IRQS]; 47unsigned int virt_irq_to_real_map[NR_IRQS];
@@ -351,3 +352,15 @@ int __init iSeries_allocate_IRQ(HvBusNumber busNumber,
351 irq_desc[virtirq].handler = &iSeries_IRQ_handler; 352 irq_desc[virtirq].handler = &iSeries_IRQ_handler;
352 return virtirq; 353 return virtirq;
353} 354}
355
356int virt_irq_create_mapping(unsigned int real_irq)
357{
358 BUG(); /* Don't call this on iSeries, yet */
359
360 return 0;
361}
362
363void virt_irq_init(void)
364{
365 return;
366}
diff --git a/arch/powerpc/platforms/iseries/irq.h b/arch/powerpc/platforms/iseries/irq.h
new file mode 100644
index 000000000000..5f643f16ecc0
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/irq.h
@@ -0,0 +1,8 @@
1#ifndef _ISERIES_IRQ_H
2#define _ISERIES_IRQ_H
3
4extern void iSeries_init_IRQ(void);
5extern int iSeries_allocate_IRQ(HvBusNumber, HvSubBusNumber, HvAgentId);
6extern void iSeries_activate_IRQs(void);
7
8#endif /* _ISERIES_IRQ_H */
diff --git a/arch/powerpc/platforms/iseries/ksyms.c b/arch/powerpc/platforms/iseries/ksyms.c
new file mode 100644
index 000000000000..f271b3539721
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/ksyms.c
@@ -0,0 +1,27 @@
1/*
2 * (C) 2001-2005 PPC 64 Team, 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 <linux/module.h>
10
11#include <asm/hw_irq.h>
12#include <asm/iSeries/HvCallSc.h>
13
14EXPORT_SYMBOL(HvCall0);
15EXPORT_SYMBOL(HvCall1);
16EXPORT_SYMBOL(HvCall2);
17EXPORT_SYMBOL(HvCall3);
18EXPORT_SYMBOL(HvCall4);
19EXPORT_SYMBOL(HvCall5);
20EXPORT_SYMBOL(HvCall6);
21EXPORT_SYMBOL(HvCall7);
22
23#ifdef CONFIG_SMP
24EXPORT_SYMBOL(local_get_flags);
25EXPORT_SYMBOL(local_irq_disable);
26EXPORT_SYMBOL(local_irq_restore);
27#endif
diff --git a/arch/ppc64/kernel/LparData.c b/arch/powerpc/platforms/iseries/lpardata.c
index 0a9c23ca2f0c..ed2ffee6f731 100644
--- a/arch/ppc64/kernel/LparData.c
+++ b/arch/powerpc/platforms/iseries/lpardata.c
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright 2001 Mike Corrigan, IBM Corp 2 * Copyright 2001 Mike Corrigan, IBM Corp
3 * 3 *
4 * This program is free software; you can redistribute it and/or 4 * This program is free software; you can redistribute it and/or
@@ -19,18 +19,18 @@
19#include <asm/lppaca.h> 19#include <asm/lppaca.h>
20#include <asm/iSeries/ItLpRegSave.h> 20#include <asm/iSeries/ItLpRegSave.h>
21#include <asm/paca.h> 21#include <asm/paca.h>
22#include <asm/iSeries/HvReleaseData.h>
23#include <asm/iSeries/LparMap.h> 22#include <asm/iSeries/LparMap.h>
24#include <asm/iSeries/ItVpdAreas.h>
25#include <asm/iSeries/ItIplParmsReal.h>
26#include <asm/iSeries/ItExtVpdPanel.h> 23#include <asm/iSeries/ItExtVpdPanel.h>
27#include <asm/iSeries/ItLpQueue.h> 24#include <asm/iSeries/ItLpQueue.h>
28#include <asm/iSeries/IoHriProcessorVpd.h>
29#include <asm/iSeries/ItSpCommArea.h>
30 25
26#include "vpd_areas.h"
27#include "spcomm_area.h"
28#include "ipl_parms.h"
29#include "processor_vpd.h"
30#include "release_data.h"
31 31
32/* The HvReleaseData is the root of the information shared between 32/* The HvReleaseData is the root of the information shared between
33 * the hypervisor and Linux. 33 * the hypervisor and Linux.
34 */ 34 */
35struct HvReleaseData hvReleaseData = { 35struct HvReleaseData hvReleaseData = {
36 .xDesc = 0xc8a5d9c4, /* "HvRD" ebcdic */ 36 .xDesc = 0xc8a5d9c4, /* "HvRD" ebcdic */
@@ -79,7 +79,7 @@ extern void trap_0e_iSeries(void);
79extern void performance_monitor_iSeries(void); 79extern void performance_monitor_iSeries(void);
80extern void data_access_slb_iSeries(void); 80extern void data_access_slb_iSeries(void);
81extern void instruction_access_slb_iSeries(void); 81extern void instruction_access_slb_iSeries(void);
82 82
83struct ItLpNaca itLpNaca = { 83struct ItLpNaca itLpNaca = {
84 .xDesc = 0xd397d581, /* "LpNa" ebcdic */ 84 .xDesc = 0xd397d581, /* "LpNa" ebcdic */
85 .xSize = 0x0400, /* size of ItLpNaca */ 85 .xSize = 0x0400, /* size of ItLpNaca */
@@ -106,7 +106,7 @@ struct ItLpNaca itLpNaca = {
106 .xLoadAreaChunks = 0, /* chunks for load area */ 106 .xLoadAreaChunks = 0, /* chunks for load area */
107 .xPaseSysCallCRMask = 0, /* PASE mask */ 107 .xPaseSysCallCRMask = 0, /* PASE mask */
108 .xSlicSegmentTablePtr = 0, /* seg table */ 108 .xSlicSegmentTablePtr = 0, /* seg table */
109 .xOldLpQueue = { 0 }, /* Old LP Queue */ 109 .xOldLpQueue = { 0 }, /* Old LP Queue */
110 .xInterruptHdlr = { 110 .xInterruptHdlr = {
111 (u64)system_reset_iSeries, /* 0x100 System Reset */ 111 (u64)system_reset_iSeries, /* 0x100 System Reset */
112 (u64)machine_check_iSeries, /* 0x200 Machine Check */ 112 (u64)machine_check_iSeries, /* 0x200 Machine Check */
@@ -134,7 +134,7 @@ struct ItLpNaca itLpNaca = {
134EXPORT_SYMBOL(itLpNaca); 134EXPORT_SYMBOL(itLpNaca);
135 135
136/* May be filled in by the hypervisor so cannot end up in the BSS */ 136/* May be filled in by the hypervisor so cannot end up in the BSS */
137struct ItIplParmsReal xItIplParmsReal __attribute__((__section__(".data"))); 137struct ItIplParmsReal xItIplParmsReal __attribute__((__section__(".data")));
138 138
139/* May be filled in by the hypervisor so cannot end up in the BSS */ 139/* May be filled in by the hypervisor so cannot end up in the BSS */
140struct ItExtVpdPanel xItExtVpdPanel __attribute__((__section__(".data"))); 140struct ItExtVpdPanel xItExtVpdPanel __attribute__((__section__(".data")));
@@ -151,7 +151,7 @@ struct IoHriProcessorVpd xIoHriProcessorVpd[maxPhysicalProcessors] = {
151 .xPVR = 0x3600 151 .xPVR = 0x3600
152 } 152 }
153}; 153};
154 154
155/* Space for Main Store Vpd 27,200 bytes */ 155/* Space for Main Store Vpd 27,200 bytes */
156/* May be filled in by the hypervisor so cannot end up in the BSS */ 156/* May be filled in by the hypervisor so cannot end up in the BSS */
157u64 xMsVpd[3400] __attribute__((__section__(".data"))); 157u64 xMsVpd[3400] __attribute__((__section__(".data")));
@@ -197,7 +197,7 @@ struct ItVpdAreas itVpdAreas = {
197 26992, /* 7 length of MS VPD */ 197 26992, /* 7 length of MS VPD */
198 0, /* 8 */ 198 0, /* 8 */
199 sizeof(struct ItLpNaca),/* 9 length of LP Naca */ 199 sizeof(struct ItLpNaca),/* 9 length of LP Naca */
200 0, /* 10 */ 200 0, /* 10 */
201 256, /* 11 length of Recovery Log Buf */ 201 256, /* 11 length of Recovery Log Buf */
202 sizeof(struct SpCommArea), /* 12 length of SP Comm Area */ 202 sizeof(struct SpCommArea), /* 12 length of SP Comm Area */
203 0,0,0, /* 13 - 15 */ 203 0,0,0, /* 13 - 15 */
@@ -207,7 +207,7 @@ struct ItVpdAreas itVpdAreas = {
207 0,0 /* 24 - 25 */ 207 0,0 /* 24 - 25 */
208 }, 208 },
209 .xSlicVpdAdrs = { /* VPD addresses */ 209 .xSlicVpdAdrs = { /* VPD addresses */
210 0,0,0, /* 0 - 2 */ 210 0,0,0, /* 0 - 2 */
211 &xItExtVpdPanel, /* 3 Extended VPD */ 211 &xItExtVpdPanel, /* 3 Extended VPD */
212 &paca[0], /* 4 first Paca */ 212 &paca[0], /* 4 first Paca */
213 0, /* 5 */ 213 0, /* 5 */
diff --git a/arch/ppc64/kernel/ItLpQueue.c b/arch/powerpc/platforms/iseries/lpevents.c
index 4231861288a3..54c7753dbe05 100644
--- a/arch/ppc64/kernel/ItLpQueue.c
+++ b/arch/powerpc/platforms/iseries/lpevents.c
@@ -1,5 +1,4 @@
1/* 1/*
2 * ItLpQueue.c
3 * Copyright (C) 2001 Mike Corrigan IBM Corporation 2 * Copyright (C) 2001 Mike Corrigan IBM Corporation
4 * 3 *
5 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
@@ -14,11 +13,14 @@
14#include <linux/bootmem.h> 13#include <linux/bootmem.h>
15#include <linux/seq_file.h> 14#include <linux/seq_file.h>
16#include <linux/proc_fs.h> 15#include <linux/proc_fs.h>
16#include <linux/module.h>
17
17#include <asm/system.h> 18#include <asm/system.h>
18#include <asm/paca.h> 19#include <asm/paca.h>
19#include <asm/iSeries/ItLpQueue.h> 20#include <asm/iSeries/ItLpQueue.h>
20#include <asm/iSeries/HvLpEvent.h> 21#include <asm/iSeries/HvLpEvent.h>
21#include <asm/iSeries/HvCallEvent.h> 22#include <asm/iSeries/HvCallEvent.h>
23#include <asm/iSeries/ItLpNaca.h>
22 24
23/* 25/*
24 * The LpQueue is used to pass event data from the hypervisor to 26 * The LpQueue is used to pass event data from the hypervisor to
@@ -43,7 +45,8 @@ static char *event_types[HvLpEvent_Type_NumTypes] = {
43}; 45};
44 46
45/* Array of LpEvent handler functions */ 47/* Array of LpEvent handler functions */
46extern LpEventHandler lpEventHandler[HvLpEvent_Type_NumTypes]; 48static LpEventHandler lpEventHandler[HvLpEvent_Type_NumTypes];
49static unsigned lpEventHandlerPaths[HvLpEvent_Type_NumTypes];
47 50
48static struct HvLpEvent * get_next_hvlpevent(void) 51static struct HvLpEvent * get_next_hvlpevent(void)
49{ 52{
@@ -181,11 +184,7 @@ void setup_hvlpevent_queue(void)
181{ 184{
182 void *eventStack; 185 void *eventStack;
183 186
184 /* 187 /* Allocate a page for the Event Stack. */
185 * Allocate a page for the Event Stack. The Hypervisor needs the
186 * absolute real address, so we subtract out the KERNELBASE and add
187 * in the absolute real address of the kernel load area.
188 */
189 eventStack = alloc_bootmem_pages(LpEventStackSize); 188 eventStack = alloc_bootmem_pages(LpEventStackSize);
190 memset(eventStack, 0, LpEventStackSize); 189 memset(eventStack, 0, LpEventStackSize);
191 190
@@ -199,6 +198,70 @@ void setup_hvlpevent_queue(void)
199 hvlpevent_queue.xIndex = 0; 198 hvlpevent_queue.xIndex = 0;
200} 199}
201 200
201/* Register a handler for an LpEvent type */
202int HvLpEvent_registerHandler(HvLpEvent_Type eventType, LpEventHandler handler)
203{
204 if (eventType < HvLpEvent_Type_NumTypes) {
205 lpEventHandler[eventType] = handler;
206 return 0;
207 }
208 return 1;
209}
210EXPORT_SYMBOL(HvLpEvent_registerHandler);
211
212int HvLpEvent_unregisterHandler(HvLpEvent_Type eventType)
213{
214 might_sleep();
215
216 if (eventType < HvLpEvent_Type_NumTypes) {
217 if (!lpEventHandlerPaths[eventType]) {
218 lpEventHandler[eventType] = NULL;
219 /*
220 * We now sleep until all other CPUs have scheduled.
221 * This ensures that the deletion is seen by all
222 * other CPUs, and that the deleted handler isn't
223 * still running on another CPU when we return.
224 */
225 synchronize_rcu();
226 return 0;
227 }
228 }
229 return 1;
230}
231EXPORT_SYMBOL(HvLpEvent_unregisterHandler);
232
233/*
234 * lpIndex is the partition index of the target partition.
235 * needed only for VirtualIo, VirtualLan and SessionMgr. Zero
236 * indicates to use our partition index - for the other types.
237 */
238int HvLpEvent_openPath(HvLpEvent_Type eventType, HvLpIndex lpIndex)
239{
240 if ((eventType < HvLpEvent_Type_NumTypes) &&
241 lpEventHandler[eventType]) {
242 if (lpIndex == 0)
243 lpIndex = itLpNaca.xLpIndex;
244 HvCallEvent_openLpEventPath(lpIndex, eventType);
245 ++lpEventHandlerPaths[eventType];
246 return 0;
247 }
248 return 1;
249}
250
251int HvLpEvent_closePath(HvLpEvent_Type eventType, HvLpIndex lpIndex)
252{
253 if ((eventType < HvLpEvent_Type_NumTypes) &&
254 lpEventHandler[eventType] &&
255 lpEventHandlerPaths[eventType]) {
256 if (lpIndex == 0)
257 lpIndex = itLpNaca.xLpIndex;
258 HvCallEvent_closeLpEventPath(lpIndex, eventType);
259 --lpEventHandlerPaths[eventType];
260 return 0;
261 }
262 return 1;
263}
264
202static int proc_lpevents_show(struct seq_file *m, void *v) 265static int proc_lpevents_show(struct seq_file *m, void *v)
203{ 266{
204 int cpu, i; 267 int cpu, i;
diff --git a/arch/powerpc/platforms/iseries/main_store.h b/arch/powerpc/platforms/iseries/main_store.h
new file mode 100644
index 000000000000..74f6889f834f
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/main_store.h
@@ -0,0 +1,165 @@
1/*
2 * Copyright (C) 2001 Mike Corrigan IBM Corporation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (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#ifndef _ISERIES_MAIN_STORE_H
20#define _ISERIES_MAIN_STORE_H
21
22/* Main Store Vpd for Condor,iStar,sStar */
23struct IoHriMainStoreSegment4 {
24 u8 msArea0Exists:1;
25 u8 msArea1Exists:1;
26 u8 msArea2Exists:1;
27 u8 msArea3Exists:1;
28 u8 reserved1:4;
29 u8 reserved2;
30
31 u8 msArea0Functional:1;
32 u8 msArea1Functional:1;
33 u8 msArea2Functional:1;
34 u8 msArea3Functional:1;
35 u8 reserved3:4;
36 u8 reserved4;
37
38 u32 totalMainStore;
39
40 u64 msArea0Ptr;
41 u64 msArea1Ptr;
42 u64 msArea2Ptr;
43 u64 msArea3Ptr;
44
45 u32 cardProductionLevel;
46
47 u32 msAdrHole;
48
49 u8 msArea0HasRiserVpd:1;
50 u8 msArea1HasRiserVpd:1;
51 u8 msArea2HasRiserVpd:1;
52 u8 msArea3HasRiserVpd:1;
53 u8 reserved5:4;
54 u8 reserved6;
55 u16 reserved7;
56
57 u8 reserved8[28];
58
59 u64 nonInterleavedBlocksStartAdr;
60 u64 nonInterleavedBlocksEndAdr;
61};
62
63/* Main Store VPD for Power4 */
64struct IoHriMainStoreChipInfo1 {
65 u32 chipMfgID __attribute((packed));
66 char chipECLevel[4] __attribute((packed));
67};
68
69struct IoHriMainStoreVpdIdData {
70 char typeNumber[4];
71 char modelNumber[4];
72 char partNumber[12];
73 char serialNumber[12];
74};
75
76struct IoHriMainStoreVpdFruData {
77 char fruLabel[8] __attribute((packed));
78 u8 numberOfSlots __attribute((packed));
79 u8 pluggingType __attribute((packed));
80 u16 slotMapIndex __attribute((packed));
81};
82
83struct IoHriMainStoreAdrRangeBlock {
84 void *blockStart __attribute((packed));
85 void *blockEnd __attribute((packed));
86 u32 blockProcChipId __attribute((packed));
87};
88
89#define MaxAreaAdrRangeBlocks 4
90
91struct IoHriMainStoreArea4 {
92 u32 msVpdFormat __attribute((packed));
93 u8 containedVpdType __attribute((packed));
94 u8 reserved1 __attribute((packed));
95 u16 reserved2 __attribute((packed));
96
97 u64 msExists __attribute((packed));
98 u64 msFunctional __attribute((packed));
99
100 u32 memorySize __attribute((packed));
101 u32 procNodeId __attribute((packed));
102
103 u32 numAdrRangeBlocks __attribute((packed));
104 struct IoHriMainStoreAdrRangeBlock xAdrRangeBlock[MaxAreaAdrRangeBlocks] __attribute((packed));
105
106 struct IoHriMainStoreChipInfo1 chipInfo0 __attribute((packed));
107 struct IoHriMainStoreChipInfo1 chipInfo1 __attribute((packed));
108 struct IoHriMainStoreChipInfo1 chipInfo2 __attribute((packed));
109 struct IoHriMainStoreChipInfo1 chipInfo3 __attribute((packed));
110 struct IoHriMainStoreChipInfo1 chipInfo4 __attribute((packed));
111 struct IoHriMainStoreChipInfo1 chipInfo5 __attribute((packed));
112 struct IoHriMainStoreChipInfo1 chipInfo6 __attribute((packed));
113 struct IoHriMainStoreChipInfo1 chipInfo7 __attribute((packed));
114
115 void *msRamAreaArray __attribute((packed));
116 u32 msRamAreaArrayNumEntries __attribute((packed));
117 u32 msRamAreaArrayEntrySize __attribute((packed));
118
119 u32 numaDimmExists __attribute((packed));
120 u32 numaDimmFunctional __attribute((packed));
121 void *numaDimmArray __attribute((packed));
122 u32 numaDimmArrayNumEntries __attribute((packed));
123 u32 numaDimmArrayEntrySize __attribute((packed));
124
125 struct IoHriMainStoreVpdIdData idData __attribute((packed));
126
127 u64 powerData __attribute((packed));
128 u64 cardAssemblyPartNum __attribute((packed));
129 u64 chipSerialNum __attribute((packed));
130
131 u64 reserved3 __attribute((packed));
132 char reserved4[16] __attribute((packed));
133
134 struct IoHriMainStoreVpdFruData fruData __attribute((packed));
135
136 u8 vpdPortNum __attribute((packed));
137 u8 reserved5 __attribute((packed));
138 u8 frameId __attribute((packed));
139 u8 rackUnit __attribute((packed));
140 char asciiKeywordVpd[256] __attribute((packed));
141 u32 reserved6 __attribute((packed));
142};
143
144
145struct IoHriMainStoreSegment5 {
146 u16 reserved1;
147 u8 reserved2;
148 u8 msVpdFormat;
149
150 u32 totalMainStore;
151 u64 maxConfiguredMsAdr;
152
153 struct IoHriMainStoreArea4 *msAreaArray;
154 u32 msAreaArrayNumEntries;
155 u32 msAreaArrayEntrySize;
156
157 u32 msAreaExists;
158 u32 msAreaFunctional;
159
160 u64 reserved3;
161};
162
163extern u64 xMsVpd[];
164
165#endif /* _ISERIES_MAIN_STORE_H */
diff --git a/arch/ppc64/kernel/mf.c b/arch/powerpc/platforms/iseries/mf.c
index ef4a338ebd01..e5de31aa0015 100644
--- a/arch/ppc64/kernel/mf.c
+++ b/arch/powerpc/platforms/iseries/mf.c
@@ -1,29 +1,28 @@
1/* 1/*
2 * mf.c 2 * Copyright (C) 2001 Troy D. Armstrong IBM Corporation
3 * Copyright (C) 2001 Troy D. Armstrong IBM Corporation 3 * Copyright (C) 2004-2005 Stephen Rothwell IBM Corporation
4 * Copyright (C) 2004-2005 Stephen Rothwell IBM Corporation 4 *
5 * 5 * This modules exists as an interface between a Linux secondary partition
6 * This modules exists as an interface between a Linux secondary partition 6 * running on an iSeries and the primary partition's Virtual Service
7 * running on an iSeries and the primary partition's Virtual Service 7 * Processor (VSP) object. The VSP has final authority over powering on/off
8 * Processor (VSP) object. The VSP has final authority over powering on/off 8 * all partitions in the iSeries. It also provides miscellaneous low-level
9 * all partitions in the iSeries. It also provides miscellaneous low-level 9 * machine facility type operations.
10 * machine facility type operations. 10 *
11 * 11 *
12 * 12 * This program is free software; you can redistribute it and/or modify
13 * This program is free software; you can redistribute it and/or modify 13 * it under the terms of the GNU General Public License as published by
14 * it under the terms of the GNU General Public License as published by 14 * the Free Software Foundation; either version 2 of the License, or
15 * the Free Software Foundation; either version 2 of the License, or 15 * (at your option) any later version.
16 * (at your option) any later version. 16 *
17 * 17 * This program is distributed in the hope that it will be useful,
18 * This program is distributed in the hope that it will be useful, 18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 * GNU General Public License for more details.
21 * GNU General Public License for more details. 21 *
22 * 22 * You should have received a copy of the GNU General Public License
23 * You should have received a copy of the GNU General Public License 23 * along with this program; if not, write to the Free Software
24 * along with this program; if not, write to the Free Software 24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 25 */
26 */
27 26
28#include <linux/types.h> 27#include <linux/types.h>
29#include <linux/errno.h> 28#include <linux/errno.h>
@@ -33,15 +32,21 @@
33#include <linux/delay.h> 32#include <linux/delay.h>
34#include <linux/dma-mapping.h> 33#include <linux/dma-mapping.h>
35#include <linux/bcd.h> 34#include <linux/bcd.h>
35#include <linux/rtc.h>
36 36
37#include <asm/time.h> 37#include <asm/time.h>
38#include <asm/uaccess.h> 38#include <asm/uaccess.h>
39#include <asm/paca.h> 39#include <asm/paca.h>
40#include <asm/abs_addr.h>
40#include <asm/iSeries/vio.h> 41#include <asm/iSeries/vio.h>
41#include <asm/iSeries/mf.h> 42#include <asm/iSeries/mf.h>
42#include <asm/iSeries/HvLpConfig.h> 43#include <asm/iSeries/HvLpConfig.h>
43#include <asm/iSeries/ItLpQueue.h> 44#include <asm/iSeries/ItLpQueue.h>
44 45
46#include "setup.h"
47
48extern int piranha_simulator;
49
45/* 50/*
46 * This is the structure layout for the Machine Facilites LPAR event 51 * This is the structure layout for the Machine Facilites LPAR event
47 * flows. 52 * flows.
@@ -1061,10 +1066,10 @@ static void mf_getSrcHistory(char *buffer, int size)
1061 ev->event.data.vsp_cmd.lp_index = HvLpConfig_getLpIndex(); 1066 ev->event.data.vsp_cmd.lp_index = HvLpConfig_getLpIndex();
1062 ev->event.data.vsp_cmd.result_code = 0xFF; 1067 ev->event.data.vsp_cmd.result_code = 0xFF;
1063 ev->event.data.vsp_cmd.reserved = 0; 1068 ev->event.data.vsp_cmd.reserved = 0;
1064 ev->event.data.vsp_cmd.sub_data.page[0] = ISERIES_HV_ADDR(pages[0]); 1069 ev->event.data.vsp_cmd.sub_data.page[0] = iseries_hv_addr(pages[0]);
1065 ev->event.data.vsp_cmd.sub_data.page[1] = ISERIES_HV_ADDR(pages[1]); 1070 ev->event.data.vsp_cmd.sub_data.page[1] = iseries_hv_addr(pages[1]);
1066 ev->event.data.vsp_cmd.sub_data.page[2] = ISERIES_HV_ADDR(pages[2]); 1071 ev->event.data.vsp_cmd.sub_data.page[2] = iseries_hv_addr(pages[2]);
1067 ev->event.data.vsp_cmd.sub_data.page[3] = ISERIES_HV_ADDR(pages[3]); 1072 ev->event.data.vsp_cmd.sub_data.page[3] = iseries_hv_addr(pages[3]);
1068 mb(); 1073 mb();
1069 if (signal_event(ev) != 0) 1074 if (signal_event(ev) != 0)
1070 return; 1075 return;
@@ -1279,3 +1284,38 @@ static int __init mf_proc_init(void)
1279__initcall(mf_proc_init); 1284__initcall(mf_proc_init);
1280 1285
1281#endif /* CONFIG_PROC_FS */ 1286#endif /* CONFIG_PROC_FS */
1287
1288/*
1289 * Get the RTC from the virtual service processor
1290 * This requires flowing LpEvents to the primary partition
1291 */
1292void iSeries_get_rtc_time(struct rtc_time *rtc_tm)
1293{
1294 if (piranha_simulator)
1295 return;
1296
1297 mf_get_rtc(rtc_tm);
1298 rtc_tm->tm_mon--;
1299}
1300
1301/*
1302 * Set the RTC in the virtual service processor
1303 * This requires flowing LpEvents to the primary partition
1304 */
1305int iSeries_set_rtc_time(struct rtc_time *tm)
1306{
1307 mf_set_rtc(tm);
1308 return 0;
1309}
1310
1311unsigned long iSeries_get_boot_time(void)
1312{
1313 struct rtc_time tm;
1314
1315 if (piranha_simulator)
1316 return 0;
1317
1318 mf_get_boot_rtc(&tm);
1319 return mktime(tm.tm_year + 1900, tm.tm_mon, tm.tm_mday,
1320 tm.tm_hour, tm.tm_min, tm.tm_sec);
1321}
diff --git a/arch/powerpc/platforms/iseries/misc.S b/arch/powerpc/platforms/iseries/misc.S
new file mode 100644
index 000000000000..09f14522e176
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/misc.S
@@ -0,0 +1,55 @@
1/*
2 * This file contains miscellaneous low-level functions.
3 * Copyright (C) 1995-2005 IBM Corp
4 *
5 * Largely rewritten by Cort Dougan (cort@cs.nmt.edu)
6 * and Paul Mackerras.
7 * Adapted for iSeries by Mike Corrigan (mikejc@us.ibm.com)
8 * PPC64 updates by Dave Engebretsen (engebret@us.ibm.com)
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
14 */
15
16#include <asm/processor.h>
17#include <asm/asm-offsets.h>
18
19 .text
20
21/* unsigned long local_save_flags(void) */
22_GLOBAL(local_get_flags)
23 lbz r3,PACAPROCENABLED(r13)
24 blr
25
26/* unsigned long local_irq_disable(void) */
27_GLOBAL(local_irq_disable)
28 lbz r3,PACAPROCENABLED(r13)
29 li r4,0
30 stb r4,PACAPROCENABLED(r13)
31 blr /* Done */
32
33/* void local_irq_restore(unsigned long flags) */
34_GLOBAL(local_irq_restore)
35 lbz r5,PACAPROCENABLED(r13)
36 /* Check if things are setup the way we want _already_. */
37 cmpw 0,r3,r5
38 beqlr
39 /* are we enabling interrupts? */
40 cmpdi 0,r3,0
41 stb r3,PACAPROCENABLED(r13)
42 beqlr
43 /* Check pending interrupts */
44 /* A decrementer, IPI or PMC interrupt may have occurred
45 * while we were in the hypervisor (which enables) */
46 ld r4,PACALPPACA+LPPACAANYINT(r13)
47 cmpdi r4,0
48 beqlr
49
50 /*
51 * Handle pending interrupts in interrupt context
52 */
53 li r0,0x5555
54 sc
55 blr
diff --git a/arch/ppc64/kernel/iSeries_pci.c b/arch/powerpc/platforms/iseries/pci.c
index fbc273c32bcc..959e59fd9c11 100644
--- a/arch/ppc64/kernel/iSeries_pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -1,28 +1,26 @@
1/* 1/*
2 * iSeries_pci.c
3 *
4 * Copyright (C) 2001 Allan Trautman, IBM Corporation 2 * Copyright (C) 2001 Allan Trautman, IBM Corporation
5 * 3 *
6 * iSeries specific routines for PCI. 4 * iSeries specific routines for PCI.
7 * 5 *
8 * Based on code from pci.c and iSeries_pci.c 32bit 6 * Based on code from pci.c and iSeries_pci.c 32bit
9 * 7 *
10 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or 10 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version. 11 * (at your option) any later version.
14 * 12 *
15 * This program is distributed in the hope that it will be useful, 13 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details. 16 * GNU General Public License for more details.
19 * 17 *
20 * You should have received a copy of the GNU General Public License 18 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software 19 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */ 21 */
24#include <linux/kernel.h> 22#include <linux/kernel.h>
25#include <linux/list.h> 23#include <linux/list.h>
26#include <linux/string.h> 24#include <linux/string.h>
27#include <linux/init.h> 25#include <linux/init.h>
28#include <linux/module.h> 26#include <linux/module.h>
@@ -36,21 +34,23 @@
36#include <asm/pci-bridge.h> 34#include <asm/pci-bridge.h>
37#include <asm/ppcdebug.h> 35#include <asm/ppcdebug.h>
38#include <asm/iommu.h> 36#include <asm/iommu.h>
37#include <asm/abs_addr.h>
39 38
40#include <asm/iSeries/HvCallPci.h>
41#include <asm/iSeries/HvCallXm.h> 39#include <asm/iSeries/HvCallXm.h>
42#include <asm/iSeries/iSeries_irq.h>
43#include <asm/iSeries/iSeries_pci.h>
44#include <asm/iSeries/mf.h> 40#include <asm/iSeries/mf.h>
45 41
42#include <asm/ppc-pci.h>
43
44#include "irq.h"
46#include "pci.h" 45#include "pci.h"
46#include "call_pci.h"
47 47
48extern unsigned long io_page_mask; 48extern unsigned long io_page_mask;
49 49
50/* 50/*
51 * Forward declares of prototypes. 51 * Forward declares of prototypes.
52 */ 52 */
53static struct iSeries_Device_Node *find_Device_Node(int bus, int devfn); 53static struct device_node *find_Device_Node(int bus, int devfn);
54static void scan_PHB_slots(struct pci_controller *Phb); 54static void scan_PHB_slots(struct pci_controller *Phb);
55static void scan_EADS_bridge(HvBusNumber Bus, HvSubBusNumber SubBus, int IdSel); 55static void scan_EADS_bridge(HvBusNumber Bus, HvSubBusNumber SubBus, int IdSel);
56static int scan_bridge_slot(HvBusNumber Bus, struct HvCallPci_BridgeInfo *Info); 56static int scan_bridge_slot(HvBusNumber Bus, struct HvCallPci_BridgeInfo *Info);
@@ -68,7 +68,7 @@ static long Pci_Cfg_Write_Count;
68#endif 68#endif
69static long Pci_Error_Count; 69static long Pci_Error_Count;
70 70
71static int Pci_Retry_Max = 3; /* Only retry 3 times */ 71static int Pci_Retry_Max = 3; /* Only retry 3 times */
72static int Pci_Error_Flag = 1; /* Set Retry Error on. */ 72static int Pci_Error_Flag = 1; /* Set Retry Error on. */
73 73
74static struct pci_ops iSeries_pci_ops; 74static struct pci_ops iSeries_pci_ops;
@@ -87,7 +87,7 @@ static long current_iomm_table_entry;
87/* 87/*
88 * Lookup Tables. 88 * Lookup Tables.
89 */ 89 */
90static struct iSeries_Device_Node **iomm_table; 90static struct device_node **iomm_table;
91static u8 *iobar_table; 91static u8 *iobar_table;
92 92
93/* 93/*
@@ -179,7 +179,7 @@ static void allocate_device_bars(struct pci_dev *dev)
179 for (bar_num = 0; bar_num <= PCI_ROM_RESOURCE; ++bar_num) { 179 for (bar_num = 0; bar_num <= PCI_ROM_RESOURCE; ++bar_num) {
180 bar_res = &dev->resource[bar_num]; 180 bar_res = &dev->resource[bar_num];
181 iomm_table_allocate_entry(dev, bar_num); 181 iomm_table_allocate_entry(dev, bar_num);
182 } 182 }
183} 183}
184 184
185/* 185/*
@@ -201,29 +201,31 @@ static void pci_Log_Error(char *Error_Text, int Bus, int SubBus,
201/* 201/*
202 * build_device_node(u16 Bus, int SubBus, u8 DevFn) 202 * build_device_node(u16 Bus, int SubBus, u8 DevFn)
203 */ 203 */
204static struct iSeries_Device_Node *build_device_node(HvBusNumber Bus, 204static struct device_node *build_device_node(HvBusNumber Bus,
205 HvSubBusNumber SubBus, int AgentId, int Function) 205 HvSubBusNumber SubBus, int AgentId, int Function)
206{ 206{
207 struct iSeries_Device_Node *node; 207 struct device_node *node;
208 struct pci_dn *pdn;
208 209
209 PPCDBG(PPCDBG_BUSWALK, 210 PPCDBG(PPCDBG_BUSWALK,
210 "-build_device_node 0x%02X.%02X.%02X Function: %02X\n", 211 "-build_device_node 0x%02X.%02X.%02X Function: %02X\n",
211 Bus, SubBus, AgentId, Function); 212 Bus, SubBus, AgentId, Function);
212 213
213 node = kmalloc(sizeof(struct iSeries_Device_Node), GFP_KERNEL); 214 node = kmalloc(sizeof(struct device_node), GFP_KERNEL);
214 if (node == NULL) 215 if (node == NULL)
215 return NULL; 216 return NULL;
216 217 memset(node, 0, sizeof(struct device_node));
217 memset(node, 0, sizeof(struct iSeries_Device_Node)); 218 pdn = kzalloc(sizeof(*pdn), GFP_KERNEL);
218 list_add_tail(&node->Device_List, &iSeries_Global_Device_List); 219 if (pdn == NULL) {
219#if 0 220 kfree(node);
220 node->DsaAddr = ((u64)Bus << 48) + ((u64)SubBus << 40) + ((u64)0x10 << 32); 221 return NULL;
221#endif 222 }
222 node->DsaAddr.DsaAddr = 0; 223 node->data = pdn;
223 node->DsaAddr.Dsa.busNumber = Bus; 224 pdn->node = node;
224 node->DsaAddr.Dsa.subBusNumber = SubBus; 225 list_add_tail(&pdn->Device_List, &iSeries_Global_Device_List);
225 node->DsaAddr.Dsa.deviceId = 0x10; 226 pdn->busno = Bus;
226 node->DevFn = PCI_DEVFN(ISERIES_ENCODE_DEVICE(AgentId), Function); 227 pdn->bussubno = SubBus;
228 pdn->devfn = PCI_DEVFN(ISERIES_ENCODE_DEVICE(AgentId), Function);
227 return node; 229 return node;
228} 230}
229 231
@@ -278,28 +280,28 @@ unsigned long __init find_and_init_phbs(void)
278 280
279/* 281/*
280 * iSeries_pcibios_init 282 * iSeries_pcibios_init
281 * 283 *
282 * Chance to initialize and structures or variable before PCI Bus walk. 284 * Chance to initialize and structures or variable before PCI Bus walk.
283 */ 285 */
284void iSeries_pcibios_init(void) 286void iSeries_pcibios_init(void)
285{ 287{
286 PPCDBG(PPCDBG_BUSWALK, "iSeries_pcibios_init Entry.\n"); 288 PPCDBG(PPCDBG_BUSWALK, "iSeries_pcibios_init Entry.\n");
287 iomm_table_initialize(); 289 iomm_table_initialize();
288 find_and_init_phbs(); 290 find_and_init_phbs();
289 io_page_mask = -1; 291 io_page_mask = -1;
290 PPCDBG(PPCDBG_BUSWALK, "iSeries_pcibios_init Exit.\n"); 292 PPCDBG(PPCDBG_BUSWALK, "iSeries_pcibios_init Exit.\n");
291} 293}
292 294
293/* 295/*
294 * iSeries_pci_final_fixup(void) 296 * iSeries_pci_final_fixup(void)
295 */ 297 */
296void __init iSeries_pci_final_fixup(void) 298void __init iSeries_pci_final_fixup(void)
297{ 299{
298 struct pci_dev *pdev = NULL; 300 struct pci_dev *pdev = NULL;
299 struct iSeries_Device_Node *node; 301 struct device_node *node;
300 int DeviceCount = 0; 302 int DeviceCount = 0;
301 303
302 PPCDBG(PPCDBG_BUSWALK, "iSeries_pcibios_fixup Entry.\n"); 304 PPCDBG(PPCDBG_BUSWALK, "iSeries_pcibios_fixup Entry.\n");
303 305
304 /* Fix up at the device node and pci_dev relationship */ 306 /* Fix up at the device node and pci_dev relationship */
305 mf_display_src(0xC9000100); 307 mf_display_src(0xC9000100);
@@ -313,7 +315,7 @@ void __init iSeries_pci_final_fixup(void)
313 if (node != NULL) { 315 if (node != NULL) {
314 ++DeviceCount; 316 ++DeviceCount;
315 pdev->sysdata = (void *)node; 317 pdev->sysdata = (void *)node;
316 node->PciDev = pdev; 318 PCI_DN(node)->pcidev = pdev;
317 PPCDBG(PPCDBG_BUSWALK, 319 PPCDBG(PPCDBG_BUSWALK,
318 "pdev 0x%p <==> DevNode 0x%p\n", 320 "pdev 0x%p <==> DevNode 0x%p\n",
319 pdev, node); 321 pdev, node);
@@ -323,7 +325,7 @@ void __init iSeries_pci_final_fixup(void)
323 } else 325 } else
324 printk("PCI: Device Tree not found for 0x%016lX\n", 326 printk("PCI: Device Tree not found for 0x%016lX\n",
325 (unsigned long)pdev); 327 (unsigned long)pdev);
326 pdev->irq = node->Irq; 328 pdev->irq = PCI_DN(node)->Irq;
327 } 329 }
328 iSeries_activate_IRQs(); 330 iSeries_activate_IRQs();
329 mf_display_src(0xC9000200); 331 mf_display_src(0xC9000200);
@@ -332,24 +334,24 @@ void __init iSeries_pci_final_fixup(void)
332void pcibios_fixup_bus(struct pci_bus *PciBus) 334void pcibios_fixup_bus(struct pci_bus *PciBus)
333{ 335{
334 PPCDBG(PPCDBG_BUSWALK, "iSeries_pcibios_fixup_bus(0x%04X) Entry.\n", 336 PPCDBG(PPCDBG_BUSWALK, "iSeries_pcibios_fixup_bus(0x%04X) Entry.\n",
335 PciBus->number); 337 PciBus->number);
336} 338}
337 339
338void pcibios_fixup_resources(struct pci_dev *pdev) 340void pcibios_fixup_resources(struct pci_dev *pdev)
339{ 341{
340 PPCDBG(PPCDBG_BUSWALK, "fixup_resources pdev %p\n", pdev); 342 PPCDBG(PPCDBG_BUSWALK, "fixup_resources pdev %p\n", pdev);
341} 343}
342 344
343/* 345/*
344 * Loop through each node function to find usable EADs bridges. 346 * Loop through each node function to find usable EADs bridges.
345 */ 347 */
346static void scan_PHB_slots(struct pci_controller *Phb) 348static void scan_PHB_slots(struct pci_controller *Phb)
347{ 349{
348 struct HvCallPci_DeviceInfo *DevInfo; 350 struct HvCallPci_DeviceInfo *DevInfo;
349 HvBusNumber bus = Phb->local_number; /* System Bus */ 351 HvBusNumber bus = Phb->local_number; /* System Bus */
350 const HvSubBusNumber SubBus = 0; /* EADs is always 0. */ 352 const HvSubBusNumber SubBus = 0; /* EADs is always 0. */
351 int HvRc = 0; 353 int HvRc = 0;
352 int IdSel; 354 int IdSel;
353 const int MaxAgents = 8; 355 const int MaxAgents = 8;
354 356
355 DevInfo = (struct HvCallPci_DeviceInfo*) 357 DevInfo = (struct HvCallPci_DeviceInfo*)
@@ -358,11 +360,11 @@ static void scan_PHB_slots(struct pci_controller *Phb)
358 return; 360 return;
359 361
360 /* 362 /*
361 * Probe for EADs Bridges 363 * Probe for EADs Bridges
362 */ 364 */
363 for (IdSel = 1; IdSel < MaxAgents; ++IdSel) { 365 for (IdSel = 1; IdSel < MaxAgents; ++IdSel) {
364 HvRc = HvCallPci_getDeviceInfo(bus, SubBus, IdSel, 366 HvRc = HvCallPci_getDeviceInfo(bus, SubBus, IdSel,
365 ISERIES_HV_ADDR(DevInfo), 367 iseries_hv_addr(DevInfo),
366 sizeof(struct HvCallPci_DeviceInfo)); 368 sizeof(struct HvCallPci_DeviceInfo));
367 if (HvRc == 0) { 369 if (HvRc == 0) {
368 if (DevInfo->deviceType == HvCallPci_NodeDevice) 370 if (DevInfo->deviceType == HvCallPci_NodeDevice)
@@ -393,19 +395,19 @@ static void scan_EADS_bridge(HvBusNumber bus, HvSubBusNumber SubBus,
393 395
394 /* Note: hvSubBus and irq is always be 0 at this level! */ 396 /* Note: hvSubBus and irq is always be 0 at this level! */
395 for (Function = 0; Function < 8; ++Function) { 397 for (Function = 0; Function < 8; ++Function) {
396 AgentId = ISERIES_PCI_AGENTID(IdSel, Function); 398 AgentId = ISERIES_PCI_AGENTID(IdSel, Function);
397 HvRc = HvCallXm_connectBusUnit(bus, SubBus, AgentId, 0); 399 HvRc = HvCallXm_connectBusUnit(bus, SubBus, AgentId, 0);
398 if (HvRc == 0) { 400 if (HvRc == 0) {
399 printk("found device at bus %d idsel %d func %d (AgentId %x)\n", 401 printk("found device at bus %d idsel %d func %d (AgentId %x)\n",
400 bus, IdSel, Function, AgentId); 402 bus, IdSel, Function, AgentId);
401 /* Connect EADs: 0x18.00.12 = 0x00 */ 403 /* Connect EADs: 0x18.00.12 = 0x00 */
402 PPCDBG(PPCDBG_BUSWALK, 404 PPCDBG(PPCDBG_BUSWALK,
403 "PCI:Connect EADs: 0x%02X.%02X.%02X\n", 405 "PCI:Connect EADs: 0x%02X.%02X.%02X\n",
404 bus, SubBus, AgentId); 406 bus, SubBus, AgentId);
405 HvRc = HvCallPci_getBusUnitInfo(bus, SubBus, AgentId, 407 HvRc = HvCallPci_getBusUnitInfo(bus, SubBus, AgentId,
406 ISERIES_HV_ADDR(BridgeInfo), 408 iseries_hv_addr(BridgeInfo),
407 sizeof(struct HvCallPci_BridgeInfo)); 409 sizeof(struct HvCallPci_BridgeInfo));
408 if (HvRc == 0) { 410 if (HvRc == 0) {
409 printk("bridge info: type %x subbus %x maxAgents %x maxsubbus %x logslot %x\n", 411 printk("bridge info: type %x subbus %x maxAgents %x maxsubbus %x logslot %x\n",
410 BridgeInfo->busUnitInfo.deviceType, 412 BridgeInfo->busUnitInfo.deviceType,
411 BridgeInfo->subBusNumber, 413 BridgeInfo->subBusNumber,
@@ -428,7 +430,7 @@ static void scan_EADS_bridge(HvBusNumber bus, HvSubBusNumber SubBus,
428 printk("PCI: Invalid Bridge Configuration(0x%02X)", 430 printk("PCI: Invalid Bridge Configuration(0x%02X)",
429 BridgeInfo->busUnitInfo.deviceType); 431 BridgeInfo->busUnitInfo.deviceType);
430 } 432 }
431 } else if (HvRc != 0x000B) 433 } else if (HvRc != 0x000B)
432 pci_Log_Error("EADs Connect", 434 pci_Log_Error("EADs Connect",
433 bus, SubBus, AgentId, HvRc); 435 bus, SubBus, AgentId, HvRc);
434 } 436 }
@@ -441,7 +443,7 @@ static void scan_EADS_bridge(HvBusNumber bus, HvSubBusNumber SubBus,
441static int scan_bridge_slot(HvBusNumber Bus, 443static int scan_bridge_slot(HvBusNumber Bus,
442 struct HvCallPci_BridgeInfo *BridgeInfo) 444 struct HvCallPci_BridgeInfo *BridgeInfo)
443{ 445{
444 struct iSeries_Device_Node *node; 446 struct device_node *node;
445 HvSubBusNumber SubBus = BridgeInfo->subBusNumber; 447 HvSubBusNumber SubBus = BridgeInfo->subBusNumber;
446 u16 VendorId = 0; 448 u16 VendorId = 0;
447 int HvRc = 0; 449 int HvRc = 0;
@@ -451,16 +453,16 @@ static int scan_bridge_slot(HvBusNumber Bus,
451 HvAgentId EADsIdSel = ISERIES_PCI_AGENTID(IdSel, Function); 453 HvAgentId EADsIdSel = ISERIES_PCI_AGENTID(IdSel, Function);
452 454
453 /* iSeries_allocate_IRQ.: 0x18.00.12(0xA3) */ 455 /* iSeries_allocate_IRQ.: 0x18.00.12(0xA3) */
454 Irq = iSeries_allocate_IRQ(Bus, 0, EADsIdSel); 456 Irq = iSeries_allocate_IRQ(Bus, 0, EADsIdSel);
455 PPCDBG(PPCDBG_BUSWALK, 457 PPCDBG(PPCDBG_BUSWALK,
456 "PCI:- allocate and assign IRQ 0x%02X.%02X.%02X = 0x%02X\n", 458 "PCI:- allocate and assign IRQ 0x%02X.%02X.%02X = 0x%02X\n",
457 Bus, 0, EADsIdSel, Irq); 459 Bus, 0, EADsIdSel, Irq);
458 460
459 /* 461 /*
460 * Connect all functions of any device found. 462 * Connect all functions of any device found.
461 */ 463 */
462 for (IdSel = 1; IdSel <= BridgeInfo->maxAgents; ++IdSel) { 464 for (IdSel = 1; IdSel <= BridgeInfo->maxAgents; ++IdSel) {
463 for (Function = 0; Function < 8; ++Function) { 465 for (Function = 0; Function < 8; ++Function) {
464 HvAgentId AgentId = ISERIES_PCI_AGENTID(IdSel, Function); 466 HvAgentId AgentId = ISERIES_PCI_AGENTID(IdSel, Function);
465 HvRc = HvCallXm_connectBusUnit(Bus, SubBus, 467 HvRc = HvCallXm_connectBusUnit(Bus, SubBus,
466 AgentId, Irq); 468 AgentId, Irq);
@@ -484,15 +486,15 @@ static int scan_bridge_slot(HvBusNumber Bus,
484 "PCI:- FoundDevice: 0x%02X.%02X.%02X = 0x%04X, irq %d\n", 486 "PCI:- FoundDevice: 0x%02X.%02X.%02X = 0x%04X, irq %d\n",
485 Bus, SubBus, AgentId, VendorId, Irq); 487 Bus, SubBus, AgentId, VendorId, Irq);
486 HvRc = HvCallPci_configStore8(Bus, SubBus, AgentId, 488 HvRc = HvCallPci_configStore8(Bus, SubBus, AgentId,
487 PCI_INTERRUPT_LINE, Irq); 489 PCI_INTERRUPT_LINE, Irq);
488 if (HvRc != 0) 490 if (HvRc != 0)
489 pci_Log_Error("PciCfgStore Irq Failed!", 491 pci_Log_Error("PciCfgStore Irq Failed!",
490 Bus, SubBus, AgentId, HvRc); 492 Bus, SubBus, AgentId, HvRc);
491 493
492 ++DeviceCount; 494 ++DeviceCount;
493 node = build_device_node(Bus, SubBus, EADsIdSel, Function); 495 node = build_device_node(Bus, SubBus, EADsIdSel, Function);
494 node->Irq = Irq; 496 PCI_DN(node)->Irq = Irq;
495 node->LogicalSlot = BridgeInfo->logicalSlotNumber; 497 PCI_DN(node)->LogicalSlot = BridgeInfo->logicalSlotNumber;
496 498
497 } /* for (Function = 0; Function < 8; ++Function) */ 499 } /* for (Function = 0; Function < 8; ++Function) */
498 } /* for (IdSel = 1; IdSel <= MaxAgents; ++IdSel) */ 500 } /* for (IdSel = 1; IdSel <= MaxAgents; ++IdSel) */
@@ -542,16 +544,13 @@ EXPORT_SYMBOL(iSeries_memcpy_fromio);
542/* 544/*
543 * Look down the chain to find the matching Device Device 545 * Look down the chain to find the matching Device Device
544 */ 546 */
545static struct iSeries_Device_Node *find_Device_Node(int bus, int devfn) 547static struct device_node *find_Device_Node(int bus, int devfn)
546{ 548{
547 struct list_head *pos; 549 struct pci_dn *pdn;
548 550
549 list_for_each(pos, &iSeries_Global_Device_List) { 551 list_for_each_entry(pdn, &iSeries_Global_Device_List, Device_List) {
550 struct iSeries_Device_Node *node = 552 if ((bus == pdn->busno) && (devfn == pdn->devfn))
551 list_entry(pos, struct iSeries_Device_Node, Device_List); 553 return pdn->node;
552
553 if ((bus == ISERIES_BUS(node)) && (devfn == node->DevFn))
554 return node;
555 } 554 }
556 return NULL; 555 return NULL;
557} 556}
@@ -562,12 +561,12 @@ static struct iSeries_Device_Node *find_Device_Node(int bus, int devfn)
562 * Sanity Check Node PciDev to passed pci_dev 561 * Sanity Check Node PciDev to passed pci_dev
563 * If none is found, returns a NULL which the client must handle. 562 * If none is found, returns a NULL which the client must handle.
564 */ 563 */
565static struct iSeries_Device_Node *get_Device_Node(struct pci_dev *pdev) 564static struct device_node *get_Device_Node(struct pci_dev *pdev)
566{ 565{
567 struct iSeries_Device_Node *node; 566 struct device_node *node;
568 567
569 node = pdev->sysdata; 568 node = pdev->sysdata;
570 if (node == NULL || node->PciDev != pdev) 569 if (node == NULL || PCI_DN(node)->pcidev != pdev)
571 node = find_Device_Node(pdev->bus->number, pdev->devfn); 570 node = find_Device_Node(pdev->bus->number, pdev->devfn);
572 return node; 571 return node;
573} 572}
@@ -595,7 +594,7 @@ static u64 hv_cfg_write_func[4] = {
595static int iSeries_pci_read_config(struct pci_bus *bus, unsigned int devfn, 594static int iSeries_pci_read_config(struct pci_bus *bus, unsigned int devfn,
596 int offset, int size, u32 *val) 595 int offset, int size, u32 *val)
597{ 596{
598 struct iSeries_Device_Node *node = find_Device_Node(bus->number, devfn); 597 struct device_node *node = find_Device_Node(bus->number, devfn);
599 u64 fn; 598 u64 fn;
600 struct HvCallPci_LoadReturn ret; 599 struct HvCallPci_LoadReturn ret;
601 600
@@ -607,7 +606,7 @@ static int iSeries_pci_read_config(struct pci_bus *bus, unsigned int devfn,
607 } 606 }
608 607
609 fn = hv_cfg_read_func[(size - 1) & 3]; 608 fn = hv_cfg_read_func[(size - 1) & 3];
610 HvCall3Ret16(fn, &ret, node->DsaAddr.DsaAddr, offset, 0); 609 HvCall3Ret16(fn, &ret, iseries_ds_addr(node), offset, 0);
611 610
612 if (ret.rc != 0) { 611 if (ret.rc != 0) {
613 *val = ~0; 612 *val = ~0;
@@ -625,7 +624,7 @@ static int iSeries_pci_read_config(struct pci_bus *bus, unsigned int devfn,
625static int iSeries_pci_write_config(struct pci_bus *bus, unsigned int devfn, 624static int iSeries_pci_write_config(struct pci_bus *bus, unsigned int devfn,
626 int offset, int size, u32 val) 625 int offset, int size, u32 val)
627{ 626{
628 struct iSeries_Device_Node *node = find_Device_Node(bus->number, devfn); 627 struct device_node *node = find_Device_Node(bus->number, devfn);
629 u64 fn; 628 u64 fn;
630 u64 ret; 629 u64 ret;
631 630
@@ -635,7 +634,7 @@ static int iSeries_pci_write_config(struct pci_bus *bus, unsigned int devfn,
635 return PCIBIOS_BAD_REGISTER_NUMBER; 634 return PCIBIOS_BAD_REGISTER_NUMBER;
636 635
637 fn = hv_cfg_write_func[(size - 1) & 3]; 636 fn = hv_cfg_write_func[(size - 1) & 3];
638 ret = HvCall4(fn, node->DsaAddr.DsaAddr, offset, val, 0); 637 ret = HvCall4(fn, iseries_ds_addr(node), offset, val, 0);
639 638
640 if (ret != 0) 639 if (ret != 0)
641 return PCIBIOS_DEVICE_NOT_FOUND; 640 return PCIBIOS_DEVICE_NOT_FOUND;
@@ -657,14 +656,16 @@ static struct pci_ops iSeries_pci_ops = {
657 * PCI: Device 23.90 ReadL Retry( 1) 656 * PCI: Device 23.90 ReadL Retry( 1)
658 * PCI: Device 23.90 ReadL Retry Successful(1) 657 * PCI: Device 23.90 ReadL Retry Successful(1)
659 */ 658 */
660static int CheckReturnCode(char *TextHdr, struct iSeries_Device_Node *DevNode, 659static int CheckReturnCode(char *TextHdr, struct device_node *DevNode,
661 int *retry, u64 ret) 660 int *retry, u64 ret)
662{ 661{
663 if (ret != 0) { 662 if (ret != 0) {
663 struct pci_dn *pdn = PCI_DN(DevNode);
664
664 ++Pci_Error_Count; 665 ++Pci_Error_Count;
665 (*retry)++; 666 (*retry)++;
666 printk("PCI: %s: Device 0x%04X:%02X I/O Error(%2d): 0x%04X\n", 667 printk("PCI: %s: Device 0x%04X:%02X I/O Error(%2d): 0x%04X\n",
667 TextHdr, DevNode->DsaAddr.Dsa.busNumber, DevNode->DevFn, 668 TextHdr, pdn->busno, pdn->devfn,
668 *retry, (int)ret); 669 *retry, (int)ret);
669 /* 670 /*
670 * Bump the retry and check for retry count exceeded. 671 * Bump the retry and check for retry count exceeded.
@@ -687,14 +688,14 @@ static int CheckReturnCode(char *TextHdr, struct iSeries_Device_Node *DevNode,
687 * Note: Make sure the passed variable end up on the stack to avoid 688 * Note: Make sure the passed variable end up on the stack to avoid
688 * the exposure of being device global. 689 * the exposure of being device global.
689 */ 690 */
690static inline struct iSeries_Device_Node *xlate_iomm_address( 691static inline struct device_node *xlate_iomm_address(
691 const volatile void __iomem *IoAddress, 692 const volatile void __iomem *IoAddress,
692 u64 *dsaptr, u64 *BarOffsetPtr) 693 u64 *dsaptr, u64 *BarOffsetPtr)
693{ 694{
694 unsigned long OrigIoAddr; 695 unsigned long OrigIoAddr;
695 unsigned long BaseIoAddr; 696 unsigned long BaseIoAddr;
696 unsigned long TableIndex; 697 unsigned long TableIndex;
697 struct iSeries_Device_Node *DevNode; 698 struct device_node *DevNode;
698 699
699 OrigIoAddr = (unsigned long __force)IoAddress; 700 OrigIoAddr = (unsigned long __force)IoAddress;
700 if ((OrigIoAddr < BASE_IO_MEMORY) || (OrigIoAddr >= max_io_memory)) 701 if ((OrigIoAddr < BASE_IO_MEMORY) || (OrigIoAddr >= max_io_memory))
@@ -705,7 +706,7 @@ static inline struct iSeries_Device_Node *xlate_iomm_address(
705 706
706 if (DevNode != NULL) { 707 if (DevNode != NULL) {
707 int barnum = iobar_table[TableIndex]; 708 int barnum = iobar_table[TableIndex];
708 *dsaptr = DevNode->DsaAddr.DsaAddr | (barnum << 24); 709 *dsaptr = iseries_ds_addr(DevNode) | (barnum << 24);
709 *BarOffsetPtr = BaseIoAddr % IOMM_TABLE_ENTRY_SIZE; 710 *BarOffsetPtr = BaseIoAddr % IOMM_TABLE_ENTRY_SIZE;
710 } else 711 } else
711 panic("PCI: Invalid PCI IoAddress detected!\n"); 712 panic("PCI: Invalid PCI IoAddress detected!\n");
@@ -727,7 +728,7 @@ u8 iSeries_Read_Byte(const volatile void __iomem *IoAddress)
727 u64 dsa; 728 u64 dsa;
728 int retry = 0; 729 int retry = 0;
729 struct HvCallPci_LoadReturn ret; 730 struct HvCallPci_LoadReturn ret;
730 struct iSeries_Device_Node *DevNode = 731 struct device_node *DevNode =
731 xlate_iomm_address(IoAddress, &dsa, &BarOffset); 732 xlate_iomm_address(IoAddress, &dsa, &BarOffset);
732 733
733 if (DevNode == NULL) { 734 if (DevNode == NULL) {
@@ -757,7 +758,7 @@ u16 iSeries_Read_Word(const volatile void __iomem *IoAddress)
757 u64 dsa; 758 u64 dsa;
758 int retry = 0; 759 int retry = 0;
759 struct HvCallPci_LoadReturn ret; 760 struct HvCallPci_LoadReturn ret;
760 struct iSeries_Device_Node *DevNode = 761 struct device_node *DevNode =
761 xlate_iomm_address(IoAddress, &dsa, &BarOffset); 762 xlate_iomm_address(IoAddress, &dsa, &BarOffset);
762 763
763 if (DevNode == NULL) { 764 if (DevNode == NULL) {
@@ -788,7 +789,7 @@ u32 iSeries_Read_Long(const volatile void __iomem *IoAddress)
788 u64 dsa; 789 u64 dsa;
789 int retry = 0; 790 int retry = 0;
790 struct HvCallPci_LoadReturn ret; 791 struct HvCallPci_LoadReturn ret;
791 struct iSeries_Device_Node *DevNode = 792 struct device_node *DevNode =
792 xlate_iomm_address(IoAddress, &dsa, &BarOffset); 793 xlate_iomm_address(IoAddress, &dsa, &BarOffset);
793 794
794 if (DevNode == NULL) { 795 if (DevNode == NULL) {
@@ -826,7 +827,7 @@ void iSeries_Write_Byte(u8 data, volatile void __iomem *IoAddress)
826 u64 dsa; 827 u64 dsa;
827 int retry = 0; 828 int retry = 0;
828 u64 rc; 829 u64 rc;
829 struct iSeries_Device_Node *DevNode = 830 struct device_node *DevNode =
830 xlate_iomm_address(IoAddress, &dsa, &BarOffset); 831 xlate_iomm_address(IoAddress, &dsa, &BarOffset);
831 832
832 if (DevNode == NULL) { 833 if (DevNode == NULL) {
@@ -854,7 +855,7 @@ void iSeries_Write_Word(u16 data, volatile void __iomem *IoAddress)
854 u64 dsa; 855 u64 dsa;
855 int retry = 0; 856 int retry = 0;
856 u64 rc; 857 u64 rc;
857 struct iSeries_Device_Node *DevNode = 858 struct device_node *DevNode =
858 xlate_iomm_address(IoAddress, &dsa, &BarOffset); 859 xlate_iomm_address(IoAddress, &dsa, &BarOffset);
859 860
860 if (DevNode == NULL) { 861 if (DevNode == NULL) {
@@ -882,7 +883,7 @@ void iSeries_Write_Long(u32 data, volatile void __iomem *IoAddress)
882 u64 dsa; 883 u64 dsa;
883 int retry = 0; 884 int retry = 0;
884 u64 rc; 885 u64 rc;
885 struct iSeries_Device_Node *DevNode = 886 struct device_node *DevNode =
886 xlate_iomm_address(IoAddress, &dsa, &BarOffset); 887 xlate_iomm_address(IoAddress, &dsa, &BarOffset);
887 888
888 if (DevNode == NULL) { 889 if (DevNode == NULL) {
diff --git a/arch/powerpc/platforms/iseries/pci.h b/arch/powerpc/platforms/iseries/pci.h
new file mode 100644
index 000000000000..33a8489fde54
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/pci.h
@@ -0,0 +1,63 @@
1#ifndef _PLATFORMS_ISERIES_PCI_H
2#define _PLATFORMS_ISERIES_PCI_H
3
4/*
5 * Created by Allan Trautman on Tue Feb 20, 2001.
6 *
7 * Define some useful macros for the iSeries pci routines.
8 * Copyright (C) 2001 Allan H Trautman, IBM Corporation
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the:
22 * Free Software Foundation, Inc.,
23 * 59 Temple Place, Suite 330,
24 * Boston, MA 02111-1307 USA
25 *
26 * Change Activity:
27 * Created Feb 20, 2001
28 * Added device reset, March 22, 2001
29 * Ported to ppc64, May 25, 2001
30 * End Change Activity
31 */
32
33#include <asm/pci-bridge.h>
34
35struct pci_dev; /* For Forward Reference */
36
37/*
38 * Decodes Linux DevFn to iSeries DevFn, bridge device, or function.
39 * For Linux, see PCI_SLOT and PCI_FUNC in include/linux/pci.h
40 */
41
42#define ISERIES_PCI_AGENTID(idsel, func) \
43 (((idsel & 0x0F) << 4) | (func & 0x07))
44#define ISERIES_ENCODE_DEVICE(agentid) \
45 ((0x10) | ((agentid & 0x20) >> 2) | (agentid & 0x07))
46
47#define ISERIES_GET_DEVICE_FROM_SUBBUS(subbus) ((subbus >> 5) & 0x7)
48#define ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus) ((subbus >> 2) & 0x7)
49
50/*
51 * Generate a Direct Select Address for the Hypervisor
52 */
53static inline u64 iseries_ds_addr(struct device_node *node)
54{
55 struct pci_dn *pdn = PCI_DN(node);
56
57 return ((u64)pdn->busno << 48) + ((u64)pdn->bussubno << 40)
58 + ((u64)0x10 << 32);
59}
60
61extern void iSeries_Device_Information(struct pci_dev*, int);
62
63#endif /* _PLATFORMS_ISERIES_PCI_H */
diff --git a/arch/ppc64/kernel/iSeries_proc.c b/arch/powerpc/platforms/iseries/proc.c
index 0fe3116eba29..6f1929cac66b 100644
--- a/arch/ppc64/kernel/iSeries_proc.c
+++ b/arch/powerpc/platforms/iseries/proc.c
@@ -1,5 +1,4 @@
1/* 1/*
2 * iSeries_proc.c
3 * Copyright (C) 2001 Kyle A. Lucke IBM Corporation 2 * Copyright (C) 2001 Kyle A. Lucke IBM Corporation
4 * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen IBM Corporation 3 * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen IBM Corporation
5 * 4 *
@@ -27,8 +26,9 @@
27#include <asm/lppaca.h> 26#include <asm/lppaca.h>
28#include <asm/iSeries/ItLpQueue.h> 27#include <asm/iSeries/ItLpQueue.h>
29#include <asm/iSeries/HvCallXm.h> 28#include <asm/iSeries/HvCallXm.h>
30#include <asm/iSeries/IoHriMainStore.h> 29
31#include <asm/iSeries/IoHriProcessorVpd.h> 30#include "processor_vpd.h"
31#include "main_store.h"
32 32
33static int __init iseries_proc_create(void) 33static int __init iseries_proc_create(void)
34{ 34{
@@ -68,12 +68,15 @@ static int proc_titantod_show(struct seq_file *m, void *v)
68 unsigned long tb_ticks = (tb0 - startTb); 68 unsigned long tb_ticks = (tb0 - startTb);
69 unsigned long titan_jiffies = titan_usec / (1000000/HZ); 69 unsigned long titan_jiffies = titan_usec / (1000000/HZ);
70 unsigned long titan_jiff_usec = titan_jiffies * (1000000/HZ); 70 unsigned long titan_jiff_usec = titan_jiffies * (1000000/HZ);
71 unsigned long titan_jiff_rem_usec = titan_usec - titan_jiff_usec; 71 unsigned long titan_jiff_rem_usec =
72 titan_usec - titan_jiff_usec;
72 unsigned long tb_jiffies = tb_ticks / tb_ticks_per_jiffy; 73 unsigned long tb_jiffies = tb_ticks / tb_ticks_per_jiffy;
73 unsigned long tb_jiff_ticks = tb_jiffies * tb_ticks_per_jiffy; 74 unsigned long tb_jiff_ticks = tb_jiffies * tb_ticks_per_jiffy;
74 unsigned long tb_jiff_rem_ticks = tb_ticks - tb_jiff_ticks; 75 unsigned long tb_jiff_rem_ticks = tb_ticks - tb_jiff_ticks;
75 unsigned long tb_jiff_rem_usec = tb_jiff_rem_ticks / tb_ticks_per_usec; 76 unsigned long tb_jiff_rem_usec =
76 unsigned long new_tb_ticks_per_jiffy = (tb_ticks * (1000000/HZ))/titan_usec; 77 tb_jiff_rem_ticks / tb_ticks_per_usec;
78 unsigned long new_tb_ticks_per_jiffy =
79 (tb_ticks * (1000000/HZ))/titan_usec;
77 80
78 seq_printf(m, " titan elapsed = %lu uSec\n", titan_usec); 81 seq_printf(m, " titan elapsed = %lu uSec\n", titan_usec);
79 seq_printf(m, " tb elapsed = %lu ticks\n", tb_ticks); 82 seq_printf(m, " tb elapsed = %lu ticks\n", tb_ticks);
diff --git a/arch/powerpc/platforms/iseries/processor_vpd.h b/arch/powerpc/platforms/iseries/processor_vpd.h
new file mode 100644
index 000000000000..7ac5d0d0dbfa
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/processor_vpd.h
@@ -0,0 +1,85 @@
1/*
2 * Copyright (C) 2001 Mike Corrigan IBM Corporation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (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#ifndef _ISERIES_PROCESSOR_VPD_H
19#define _ISERIES_PROCESSOR_VPD_H
20
21#include <asm/types.h>
22
23/*
24 * This struct maps Processor Vpd that is DMAd to SLIC by CSP
25 */
26struct IoHriProcessorVpd {
27 u8 xFormat; // VPD format indicator x00-x00
28 u8 xProcStatus:8; // Processor State x01-x01
29 u8 xSecondaryThreadCount; // Secondary thread cnt x02-x02
30 u8 xSrcType:1; // Src Type x03-x03
31 u8 xSrcSoft:1; // Src stay soft ...
32 u8 xSrcParable:1; // Src parable ...
33 u8 xRsvd1:5; // Reserved ...
34 u16 xHvPhysicalProcIndex; // Hypervisor physical proc index04-x05
35 u16 xRsvd2; // Reserved x06-x07
36 u32 xHwNodeId; // Hardware node id x08-x0B
37 u32 xHwProcId; // Hardware processor id x0C-x0F
38
39 u32 xTypeNum; // Card Type/CCIN number x10-x13
40 u32 xModelNum; // Model/Feature number x14-x17
41 u64 xSerialNum; // Serial number x18-x1F
42 char xPartNum[12]; // Book Part or FPU number x20-x2B
43 char xMfgID[4]; // Manufacturing ID x2C-x2F
44
45 u32 xProcFreq; // Processor Frequency x30-x33
46 u32 xTimeBaseFreq; // Time Base Frequency x34-x37
47
48 u32 xChipEcLevel; // Chip EC Levels x38-x3B
49 u32 xProcIdReg; // PIR SPR value x3C-x3F
50 u32 xPVR; // PVR value x40-x43
51 u8 xRsvd3[12]; // Reserved x44-x4F
52
53 u32 xInstCacheSize; // Instruction cache size in KB x50-x53
54 u32 xInstBlockSize; // Instruction cache block size x54-x57
55 u32 xDataCacheOperandSize; // Data cache operand size x58-x5B
56 u32 xInstCacheOperandSize; // Inst cache operand size x5C-x5F
57
58 u32 xDataL1CacheSizeKB; // L1 data cache size in KB x60-x63
59 u32 xDataL1CacheLineSize; // L1 data cache block size x64-x67
60 u64 xRsvd4; // Reserved x68-x6F
61
62 u32 xDataL2CacheSizeKB; // L2 data cache size in KB x70-x73
63 u32 xDataL2CacheLineSize; // L2 data cache block size x74-x77
64 u64 xRsvd5; // Reserved x78-x7F
65
66 u32 xDataL3CacheSizeKB; // L3 data cache size in KB x80-x83
67 u32 xDataL3CacheLineSize; // L3 data cache block size x84-x87
68 u64 xRsvd6; // Reserved x88-x8F
69
70 u64 xFruLabel; // Card Location Label x90-x97
71 u8 xSlotsOnCard; // Slots on card (0=no slots) x98-x98
72 u8 xPartLocFlag; // Location flag (0-pluggable 1-imbedded) x99-x99
73 u16 xSlotMapIndex; // Index in slot map table x9A-x9B
74 u8 xSmartCardPortNo; // Smart card port number x9C-x9C
75 u8 xRsvd7; // Reserved x9D-x9D
76 u16 xFrameIdAndRackUnit; // Frame ID and rack unit adr x9E-x9F
77
78 u8 xRsvd8[24]; // Reserved xA0-xB7
79
80 char xProcSrc[72]; // CSP format SRC xB8-xFF
81};
82
83extern struct IoHriProcessorVpd xIoHriProcessorVpd[];
84
85#endif /* _ISERIES_PROCESSOR_VPD_H */
diff --git a/arch/powerpc/platforms/iseries/release_data.h b/arch/powerpc/platforms/iseries/release_data.h
new file mode 100644
index 000000000000..c68b9c3e5caf
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/release_data.h
@@ -0,0 +1,63 @@
1/*
2 * Copyright (C) 2001 Mike Corrigan IBM Corporation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (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#ifndef _ISERIES_RELEASE_DATA_H
19#define _ISERIES_RELEASE_DATA_H
20
21/*
22 * This control block contains the critical information about the
23 * release so that it can be changed in the future (ie, the virtual
24 * address of the OS's NACA).
25 */
26#include <asm/types.h>
27#include <asm/naca.h>
28
29/*
30 * When we IPL a secondary partition, we will check if if the
31 * secondary xMinPlicVrmIndex > the primary xVrmIndex.
32 * If it is then this tells PLIC that this secondary is not
33 * supported running on this "old" of a level of PLIC.
34 *
35 * Likewise, we will compare the primary xMinSlicVrmIndex to
36 * the secondary xVrmIndex.
37 * If the primary xMinSlicVrmDelta > secondary xVrmDelta then we
38 * know that this PLIC does not support running an OS "that old".
39 */
40
41#define HVREL_TAGSINACTIVE 0x8000
42#define HVREL_32BIT 0x4000
43#define HVREL_NOSHAREDPROCS 0x2000
44#define HVREL_NOHMT 0x1000
45
46struct HvReleaseData {
47 u32 xDesc; /* Descriptor "HvRD" ebcdic x00-x03 */
48 u16 xSize; /* Size of this control block x04-x05 */
49 u16 xVpdAreasPtrOffset; /* Offset in NACA of ItVpdAreas x06-x07 */
50 struct naca_struct *xSlicNacaAddr; /* Virt addr of SLIC NACA x08-x0F */
51 u32 xMsNucDataOffset; /* Offset of Linux Mapping Data x10-x13 */
52 u32 xRsvd1; /* Reserved x14-x17 */
53 u16 xFlags;
54 u16 xVrmIndex; /* VRM Index of OS image x1A-x1B */
55 u16 xMinSupportedPlicVrmIndex; /* Min PLIC level (soft) x1C-x1D */
56 u16 xMinCompatablePlicVrmIndex; /* Min PLIC levelP (hard) x1E-x1F */
57 char xVrmName[12]; /* Displayable name x20-x2B */
58 char xRsvd3[20]; /* Reserved x2C-x3F */
59};
60
61extern struct HvReleaseData hvReleaseData;
62
63#endif /* _ISERIES_RELEASE_DATA_H */
diff --git a/arch/ppc64/kernel/iSeries_setup.c b/arch/powerpc/platforms/iseries/setup.c
index 3ffefbbc6623..1544c6f10a38 100644
--- a/arch/ppc64/kernel/iSeries_setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -2,8 +2,6 @@
2 * Copyright (c) 2000 Mike Corrigan <mikejc@us.ibm.com> 2 * Copyright (c) 2000 Mike Corrigan <mikejc@us.ibm.com>
3 * Copyright (c) 1999-2000 Grant Erickson <grant@lcse.umn.edu> 3 * Copyright (c) 1999-2000 Grant Erickson <grant@lcse.umn.edu>
4 * 4 *
5 * Module name: iSeries_setup.c
6 *
7 * Description: 5 * Description:
8 * Architecture- / platform-specific boot-time initialization code for 6 * Architecture- / platform-specific boot-time initialization code for
9 * the IBM iSeries LPAR. Adapted from original code by Grant Erickson and 7 * the IBM iSeries LPAR. Adapted from original code by Grant Erickson and
@@ -42,26 +40,27 @@
42#include <asm/firmware.h> 40#include <asm/firmware.h>
43 41
44#include <asm/time.h> 42#include <asm/time.h>
45#include "iSeries_setup.h"
46#include <asm/naca.h> 43#include <asm/naca.h>
47#include <asm/paca.h> 44#include <asm/paca.h>
48#include <asm/cache.h> 45#include <asm/cache.h>
49#include <asm/sections.h> 46#include <asm/sections.h>
50#include <asm/abs_addr.h> 47#include <asm/abs_addr.h>
51#include <asm/iSeries/HvCallHpt.h>
52#include <asm/iSeries/HvLpConfig.h> 48#include <asm/iSeries/HvLpConfig.h>
53#include <asm/iSeries/HvCallEvent.h> 49#include <asm/iSeries/HvCallEvent.h>
54#include <asm/iSeries/HvCallSm.h>
55#include <asm/iSeries/HvCallXm.h> 50#include <asm/iSeries/HvCallXm.h>
56#include <asm/iSeries/ItLpQueue.h> 51#include <asm/iSeries/ItLpQueue.h>
57#include <asm/iSeries/IoHriMainStore.h>
58#include <asm/iSeries/mf.h> 52#include <asm/iSeries/mf.h>
59#include <asm/iSeries/HvLpEvent.h> 53#include <asm/iSeries/HvLpEvent.h>
60#include <asm/iSeries/iSeries_irq.h>
61#include <asm/iSeries/IoHriProcessorVpd.h>
62#include <asm/iSeries/ItVpdAreas.h>
63#include <asm/iSeries/LparMap.h> 54#include <asm/iSeries/LparMap.h>
64 55
56#include "setup.h"
57#include "irq.h"
58#include "vpd_areas.h"
59#include "processor_vpd.h"
60#include "main_store.h"
61#include "call_sm.h"
62#include "call_hpt.h"
63
65extern void hvlog(char *fmt, ...); 64extern void hvlog(char *fmt, ...);
66 65
67#ifdef DEBUG 66#ifdef DEBUG
@@ -74,8 +73,8 @@ extern void hvlog(char *fmt, ...);
74extern void ppcdbg_initialize(void); 73extern void ppcdbg_initialize(void);
75 74
76static void build_iSeries_Memory_Map(void); 75static void build_iSeries_Memory_Map(void);
77static void setup_iSeries_cache_sizes(void); 76static void iseries_shared_idle(void);
78static void iSeries_bolt_kernel(unsigned long saddr, unsigned long eaddr); 77static void iseries_dedicated_idle(void);
79#ifdef CONFIG_PCI 78#ifdef CONFIG_PCI
80extern void iSeries_pci_final_fixup(void); 79extern void iSeries_pci_final_fixup(void);
81#else 80#else
@@ -83,14 +82,6 @@ static void iSeries_pci_final_fixup(void) { }
83#endif 82#endif
84 83
85/* Global Variables */ 84/* Global Variables */
86static unsigned long procFreqHz;
87static unsigned long procFreqMhz;
88static unsigned long procFreqMhzHundreths;
89
90static unsigned long tbFreqHz;
91static unsigned long tbFreqMhz;
92static unsigned long tbFreqMhzHundreths;
93
94int piranha_simulator; 85int piranha_simulator;
95 86
96extern int rd_size; /* Defined in drivers/block/rd.c */ 87extern int rd_size; /* Defined in drivers/block/rd.c */
@@ -311,14 +302,14 @@ static void __init iSeries_get_cmdline(void)
311 302
312static void __init iSeries_init_early(void) 303static void __init iSeries_init_early(void)
313{ 304{
314 extern unsigned long memory_limit;
315
316 DBG(" -> iSeries_init_early()\n"); 305 DBG(" -> iSeries_init_early()\n");
317 306
318 ppc64_firmware_features = FW_FEATURE_ISERIES; 307 ppc64_firmware_features = FW_FEATURE_ISERIES;
319 308
320 ppcdbg_initialize(); 309 ppcdbg_initialize();
321 310
311 ppc64_interrupt_controller = IC_ISERIES;
312
322#if defined(CONFIG_BLK_DEV_INITRD) 313#if defined(CONFIG_BLK_DEV_INITRD)
323 /* 314 /*
324 * If the init RAM disk has been configured and there is 315 * If the init RAM disk has been configured and there is
@@ -341,12 +332,6 @@ static void __init iSeries_init_early(void)
341 iSeries_recal_titan = HvCallXm_loadTod(); 332 iSeries_recal_titan = HvCallXm_loadTod();
342 333
343 /* 334 /*
344 * Cache sizes must be initialized before hpte_init_iSeries is called
345 * as the later need them for flush_icache_range()
346 */
347 setup_iSeries_cache_sizes();
348
349 /*
350 * Initialize the hash table management pointers 335 * Initialize the hash table management pointers
351 */ 336 */
352 hpte_init_iSeries(); 337 hpte_init_iSeries();
@@ -356,12 +341,6 @@ static void __init iSeries_init_early(void)
356 */ 341 */
357 iommu_init_early_iSeries(); 342 iommu_init_early_iSeries();
358 343
359 /*
360 * Initialize the table which translate Linux physical addresses to
361 * AS/400 absolute addresses
362 */
363 build_iSeries_Memory_Map();
364
365 iSeries_get_cmdline(); 344 iSeries_get_cmdline();
366 345
367 /* Save unparsed command line copy for /proc/cmdline */ 346 /* Save unparsed command line copy for /proc/cmdline */
@@ -379,14 +358,6 @@ static void __init iSeries_init_early(void)
379 } 358 }
380 } 359 }
381 360
382 /* Bolt kernel mappings for all of memory (or just a bit if we've got a limit) */
383 iSeries_bolt_kernel(0, systemcfg->physicalMemorySize);
384
385 lmb_init();
386 lmb_add(0, systemcfg->physicalMemorySize);
387 lmb_analyze();
388 lmb_reserve(0, __pa(klimit));
389
390 /* Initialize machine-dependency vectors */ 361 /* Initialize machine-dependency vectors */
391#ifdef CONFIG_SMP 362#ifdef CONFIG_SMP
392 smp_init_iSeries(); 363 smp_init_iSeries();
@@ -457,7 +428,6 @@ static void __init build_iSeries_Memory_Map(void)
457 u32 loadAreaFirstChunk, loadAreaLastChunk, loadAreaSize; 428 u32 loadAreaFirstChunk, loadAreaLastChunk, loadAreaSize;
458 u32 nextPhysChunk; 429 u32 nextPhysChunk;
459 u32 hptFirstChunk, hptLastChunk, hptSizeChunks, hptSizePages; 430 u32 hptFirstChunk, hptLastChunk, hptSizeChunks, hptSizePages;
460 u32 num_ptegs;
461 u32 totalChunks,moreChunks; 431 u32 totalChunks,moreChunks;
462 u32 currChunk, thisChunk, absChunk; 432 u32 currChunk, thisChunk, absChunk;
463 u32 currDword; 433 u32 currDword;
@@ -520,10 +490,7 @@ static void __init build_iSeries_Memory_Map(void)
520 printk("HPT absolute addr = %016lx, size = %dK\n", 490 printk("HPT absolute addr = %016lx, size = %dK\n",
521 chunk_to_addr(hptFirstChunk), hptSizeChunks * 256); 491 chunk_to_addr(hptFirstChunk), hptSizeChunks * 256);
522 492
523 /* Fill in the hashed page table hash mask */ 493 ppc64_pft_size = __ilog2(hptSizePages * PAGE_SIZE);
524 num_ptegs = hptSizePages *
525 (PAGE_SIZE / (sizeof(hpte_t) * HPTES_PER_GROUP));
526 htab_hash_mask = num_ptegs - 1;
527 494
528 /* 495 /*
529 * The actual hashed page table is in the hypervisor, 496 * The actual hashed page table is in the hypervisor,
@@ -592,144 +559,33 @@ static void __init build_iSeries_Memory_Map(void)
592} 559}
593 560
594/* 561/*
595 * Set up the variables that describe the cache line sizes
596 * for this machine.
597 */
598static void __init setup_iSeries_cache_sizes(void)
599{
600 unsigned int i, n;
601 unsigned int procIx = get_paca()->lppaca.dyn_hv_phys_proc_index;
602
603 systemcfg->icache_size =
604 ppc64_caches.isize = xIoHriProcessorVpd[procIx].xInstCacheSize * 1024;
605 systemcfg->icache_line_size =
606 ppc64_caches.iline_size =
607 xIoHriProcessorVpd[procIx].xInstCacheOperandSize;
608 systemcfg->dcache_size =
609 ppc64_caches.dsize =
610 xIoHriProcessorVpd[procIx].xDataL1CacheSizeKB * 1024;
611 systemcfg->dcache_line_size =
612 ppc64_caches.dline_size =
613 xIoHriProcessorVpd[procIx].xDataCacheOperandSize;
614 ppc64_caches.ilines_per_page = PAGE_SIZE / ppc64_caches.iline_size;
615 ppc64_caches.dlines_per_page = PAGE_SIZE / ppc64_caches.dline_size;
616
617 i = ppc64_caches.iline_size;
618 n = 0;
619 while ((i = (i / 2)))
620 ++n;
621 ppc64_caches.log_iline_size = n;
622
623 i = ppc64_caches.dline_size;
624 n = 0;
625 while ((i = (i / 2)))
626 ++n;
627 ppc64_caches.log_dline_size = n;
628
629 printk("D-cache line size = %d\n",
630 (unsigned int)ppc64_caches.dline_size);
631 printk("I-cache line size = %d\n",
632 (unsigned int)ppc64_caches.iline_size);
633}
634
635/*
636 * Create a pte. Used during initialization only.
637 */
638static void iSeries_make_pte(unsigned long va, unsigned long pa,
639 int mode)
640{
641 hpte_t local_hpte, rhpte;
642 unsigned long hash, vpn;
643 long slot;
644
645 vpn = va >> PAGE_SHIFT;
646 hash = hpt_hash(vpn, 0);
647
648 local_hpte.r = pa | mode;
649 local_hpte.v = ((va >> 23) << HPTE_V_AVPN_SHIFT)
650 | HPTE_V_BOLTED | HPTE_V_VALID;
651
652 slot = HvCallHpt_findValid(&rhpte, vpn);
653 if (slot < 0) {
654 /* Must find space in primary group */
655 panic("hash_page: hpte already exists\n");
656 }
657 HvCallHpt_addValidate(slot, 0, &local_hpte);
658}
659
660/*
661 * Bolt the kernel addr space into the HPT
662 */
663static void __init iSeries_bolt_kernel(unsigned long saddr, unsigned long eaddr)
664{
665 unsigned long pa;
666 unsigned long mode_rw = _PAGE_ACCESSED | _PAGE_COHERENT | PP_RWXX;
667 hpte_t hpte;
668
669 for (pa = saddr; pa < eaddr ;pa += PAGE_SIZE) {
670 unsigned long ea = (unsigned long)__va(pa);
671 unsigned long vsid = get_kernel_vsid(ea);
672 unsigned long va = (vsid << 28) | (pa & 0xfffffff);
673 unsigned long vpn = va >> PAGE_SHIFT;
674 unsigned long slot = HvCallHpt_findValid(&hpte, vpn);
675
676 /* Make non-kernel text non-executable */
677 if (!in_kernel_text(ea))
678 mode_rw |= HW_NO_EXEC;
679
680 if (hpte.v & HPTE_V_VALID) {
681 /* HPTE exists, so just bolt it */
682 HvCallHpt_setSwBits(slot, 0x10, 0);
683 /* And make sure the pp bits are correct */
684 HvCallHpt_setPp(slot, PP_RWXX);
685 } else
686 /* No HPTE exists, so create a new bolted one */
687 iSeries_make_pte(va, phys_to_abs(pa), mode_rw);
688 }
689}
690
691/*
692 * Document me. 562 * Document me.
693 */ 563 */
694static void __init iSeries_setup_arch(void) 564static void __init iSeries_setup_arch(void)
695{ 565{
696 unsigned procIx = get_paca()->lppaca.dyn_hv_phys_proc_index; 566 unsigned procIx = get_paca()->lppaca.dyn_hv_phys_proc_index;
697 567
698 /* Add an eye catcher and the systemcfg layout version number */ 568 if (get_paca()->lppaca.shared_proc) {
699 strcpy(systemcfg->eye_catcher, "SYSTEMCFG:PPC64"); 569 ppc_md.idle_loop = iseries_shared_idle;
700 systemcfg->version.major = SYSTEMCFG_MAJOR; 570 printk(KERN_INFO "Using shared processor idle loop\n");
701 systemcfg->version.minor = SYSTEMCFG_MINOR; 571 } else {
572 ppc_md.idle_loop = iseries_dedicated_idle;
573 printk(KERN_INFO "Using dedicated idle loop\n");
574 }
702 575
703 /* Setup the Lp Event Queue */ 576 /* Setup the Lp Event Queue */
704 setup_hvlpevent_queue(); 577 setup_hvlpevent_queue();
705 578
706 /* Compute processor frequency */
707 procFreqHz = ((1UL << 34) * 1000000) /
708 xIoHriProcessorVpd[procIx].xProcFreq;
709 procFreqMhz = procFreqHz / 1000000;
710 procFreqMhzHundreths = (procFreqHz / 10000) - (procFreqMhz * 100);
711 ppc_proc_freq = procFreqHz;
712
713 /* Compute time base frequency */
714 tbFreqHz = ((1UL << 32) * 1000000) /
715 xIoHriProcessorVpd[procIx].xTimeBaseFreq;
716 tbFreqMhz = tbFreqHz / 1000000;
717 tbFreqMhzHundreths = (tbFreqHz / 10000) - (tbFreqMhz * 100);
718 ppc_tb_freq = tbFreqHz;
719
720 printk("Max logical processors = %d\n", 579 printk("Max logical processors = %d\n",
721 itVpdAreas.xSlicMaxLogicalProcs); 580 itVpdAreas.xSlicMaxLogicalProcs);
722 printk("Max physical processors = %d\n", 581 printk("Max physical processors = %d\n",
723 itVpdAreas.xSlicMaxPhysicalProcs); 582 itVpdAreas.xSlicMaxPhysicalProcs);
724 printk("Processor frequency = %lu.%02lu\n", procFreqMhz, 583
725 procFreqMhzHundreths);
726 printk("Time base frequency = %lu.%02lu\n", tbFreqMhz,
727 tbFreqMhzHundreths);
728 systemcfg->processor = xIoHriProcessorVpd[procIx].xPVR; 584 systemcfg->processor = xIoHriProcessorVpd[procIx].xPVR;
729 printk("Processor version = %x\n", systemcfg->processor); 585 printk("Processor version = %x\n", systemcfg->processor);
730} 586}
731 587
732static void iSeries_get_cpuinfo(struct seq_file *m) 588static void iSeries_show_cpuinfo(struct seq_file *m)
733{ 589{
734 seq_printf(m, "machine\t\t: 64-bit iSeries Logical Partition\n"); 590 seq_printf(m, "machine\t\t: 64-bit iSeries Logical Partition\n");
735} 591}
@@ -768,49 +624,6 @@ static void iSeries_halt(void)
768 mf_power_off(); 624 mf_power_off();
769} 625}
770 626
771/*
772 * void __init iSeries_calibrate_decr()
773 *
774 * Description:
775 * This routine retrieves the internal processor frequency from the VPD,
776 * and sets up the kernel timer decrementer based on that value.
777 *
778 */
779static void __init iSeries_calibrate_decr(void)
780{
781 unsigned long cyclesPerUsec;
782 struct div_result divres;
783
784 /* Compute decrementer (and TB) frequency in cycles/sec */
785 cyclesPerUsec = ppc_tb_freq / 1000000;
786
787 /*
788 * Set the amount to refresh the decrementer by. This
789 * is the number of decrementer ticks it takes for
790 * 1/HZ seconds.
791 */
792 tb_ticks_per_jiffy = ppc_tb_freq / HZ;
793
794#if 0
795 /* TEST CODE FOR ADJTIME */
796 tb_ticks_per_jiffy += tb_ticks_per_jiffy / 5000;
797 /* END OF TEST CODE */
798#endif
799
800 /*
801 * tb_ticks_per_sec = freq; would give better accuracy
802 * but tb_ticks_per_sec = tb_ticks_per_jiffy*HZ; assures
803 * that jiffies (and xtime) will match the time returned
804 * by do_gettimeofday.
805 */
806 tb_ticks_per_sec = tb_ticks_per_jiffy * HZ;
807 tb_ticks_per_usec = cyclesPerUsec;
808 tb_to_us = mulhwu_scale_factor(ppc_tb_freq, 1000000);
809 div128_by_32(1024 * 1024, 0, tb_ticks_per_sec, &divres);
810 tb_to_xs = divres.result_low;
811 setup_default_decr();
812}
813
814static void __init iSeries_progress(char * st, unsigned short code) 627static void __init iSeries_progress(char * st, unsigned short code)
815{ 628{
816 printk("Progress: [%04x] - %s\n", (unsigned)code, st); 629 printk("Progress: [%04x] - %s\n", (unsigned)code, st);
@@ -878,7 +691,7 @@ static void yield_shared_processor(void)
878 process_iSeries_events(); 691 process_iSeries_events();
879} 692}
880 693
881static int iseries_shared_idle(void) 694static void iseries_shared_idle(void)
882{ 695{
883 while (1) { 696 while (1) {
884 while (!need_resched() && !hvlpevent_is_pending()) { 697 while (!need_resched() && !hvlpevent_is_pending()) {
@@ -900,11 +713,9 @@ static int iseries_shared_idle(void)
900 713
901 schedule(); 714 schedule();
902 } 715 }
903
904 return 0;
905} 716}
906 717
907static int iseries_dedicated_idle(void) 718static void iseries_dedicated_idle(void)
908{ 719{
909 long oldval; 720 long oldval;
910 721
@@ -934,44 +745,252 @@ static int iseries_dedicated_idle(void)
934 ppc64_runlatch_on(); 745 ppc64_runlatch_on();
935 schedule(); 746 schedule();
936 } 747 }
937
938 return 0;
939} 748}
940 749
941#ifndef CONFIG_PCI 750#ifndef CONFIG_PCI
942void __init iSeries_init_IRQ(void) { } 751void __init iSeries_init_IRQ(void) { }
943#endif 752#endif
944 753
945void __init iSeries_early_setup(void) 754static int __init iseries_probe(int platform)
946{ 755{
947 iSeries_fixup_klimit(); 756 return PLATFORM_ISERIES_LPAR == platform;
757}
948 758
949 ppc_md.setup_arch = iSeries_setup_arch; 759struct machdep_calls __initdata iseries_md = {
950 ppc_md.get_cpuinfo = iSeries_get_cpuinfo; 760 .setup_arch = iSeries_setup_arch,
951 ppc_md.init_IRQ = iSeries_init_IRQ; 761 .show_cpuinfo = iSeries_show_cpuinfo,
952 ppc_md.get_irq = iSeries_get_irq; 762 .init_IRQ = iSeries_init_IRQ,
953 ppc_md.init_early = iSeries_init_early, 763 .get_irq = iSeries_get_irq,
764 .init_early = iSeries_init_early,
765 .pcibios_fixup = iSeries_pci_final_fixup,
766 .restart = iSeries_restart,
767 .power_off = iSeries_power_off,
768 .halt = iSeries_halt,
769 .get_boot_time = iSeries_get_boot_time,
770 .set_rtc_time = iSeries_set_rtc_time,
771 .get_rtc_time = iSeries_get_rtc_time,
772 .calibrate_decr = generic_calibrate_decr,
773 .progress = iSeries_progress,
774 .probe = iseries_probe,
775 /* XXX Implement enable_pmcs for iSeries */
776};
954 777
955 ppc_md.pcibios_fixup = iSeries_pci_final_fixup; 778struct blob {
779 unsigned char data[PAGE_SIZE];
780 unsigned long next;
781};
956 782
957 ppc_md.restart = iSeries_restart; 783struct iseries_flat_dt {
958 ppc_md.power_off = iSeries_power_off; 784 struct boot_param_header header;
959 ppc_md.halt = iSeries_halt; 785 u64 reserve_map[2];
786 struct blob dt;
787 struct blob strings;
788};
960 789
961 ppc_md.get_boot_time = iSeries_get_boot_time; 790struct iseries_flat_dt iseries_dt;
962 ppc_md.set_rtc_time = iSeries_set_rtc_time;
963 ppc_md.get_rtc_time = iSeries_get_rtc_time;
964 ppc_md.calibrate_decr = iSeries_calibrate_decr;
965 ppc_md.progress = iSeries_progress;
966 791
967 /* XXX Implement enable_pmcs for iSeries */ 792void dt_init(struct iseries_flat_dt *dt)
793{
794 dt->header.off_mem_rsvmap =
795 offsetof(struct iseries_flat_dt, reserve_map);
796 dt->header.off_dt_struct = offsetof(struct iseries_flat_dt, dt);
797 dt->header.off_dt_strings = offsetof(struct iseries_flat_dt, strings);
798 dt->header.totalsize = sizeof(struct iseries_flat_dt);
799 dt->header.dt_strings_size = sizeof(struct blob);
968 800
969 if (get_paca()->lppaca.shared_proc) { 801 /* There is no notion of hardware cpu id on iSeries */
970 ppc_md.idle_loop = iseries_shared_idle; 802 dt->header.boot_cpuid_phys = smp_processor_id();
971 printk(KERN_INFO "Using shared processor idle loop\n"); 803
972 } else { 804 dt->dt.next = (unsigned long)&dt->dt.data;
973 ppc_md.idle_loop = iseries_dedicated_idle; 805 dt->strings.next = (unsigned long)&dt->strings.data;
974 printk(KERN_INFO "Using dedicated idle loop\n"); 806
807 dt->header.magic = OF_DT_HEADER;
808 dt->header.version = 0x10;
809 dt->header.last_comp_version = 0x10;
810
811 dt->reserve_map[0] = 0;
812 dt->reserve_map[1] = 0;
813}
814
815void dt_check_blob(struct blob *b)
816{
817 if (b->next >= (unsigned long)&b->next) {
818 DBG("Ran out of space in flat device tree blob!\n");
819 BUG();
975 } 820 }
976} 821}
977 822
823void dt_push_u32(struct iseries_flat_dt *dt, u32 value)
824{
825 *((u32*)dt->dt.next) = value;
826 dt->dt.next += sizeof(u32);
827
828 dt_check_blob(&dt->dt);
829}
830
831void dt_push_u64(struct iseries_flat_dt *dt, u64 value)
832{
833 *((u64*)dt->dt.next) = value;
834 dt->dt.next += sizeof(u64);
835
836 dt_check_blob(&dt->dt);
837}
838
839unsigned long dt_push_bytes(struct blob *blob, char *data, int len)
840{
841 unsigned long start = blob->next - (unsigned long)blob->data;
842
843 memcpy((char *)blob->next, data, len);
844 blob->next = _ALIGN(blob->next + len, 4);
845
846 dt_check_blob(blob);
847
848 return start;
849}
850
851void dt_start_node(struct iseries_flat_dt *dt, char *name)
852{
853 dt_push_u32(dt, OF_DT_BEGIN_NODE);
854 dt_push_bytes(&dt->dt, name, strlen(name) + 1);
855}
856
857#define dt_end_node(dt) dt_push_u32(dt, OF_DT_END_NODE)
858
859void dt_prop(struct iseries_flat_dt *dt, char *name, char *data, int len)
860{
861 unsigned long offset;
862
863 dt_push_u32(dt, OF_DT_PROP);
864
865 /* Length of the data */
866 dt_push_u32(dt, len);
867
868 /* Put the property name in the string blob. */
869 offset = dt_push_bytes(&dt->strings, name, strlen(name) + 1);
870
871 /* The offset of the properties name in the string blob. */
872 dt_push_u32(dt, (u32)offset);
873
874 /* The actual data. */
875 dt_push_bytes(&dt->dt, data, len);
876}
877
878void dt_prop_str(struct iseries_flat_dt *dt, char *name, char *data)
879{
880 dt_prop(dt, name, data, strlen(data) + 1); /* + 1 for NULL */
881}
882
883void dt_prop_u32(struct iseries_flat_dt *dt, char *name, u32 data)
884{
885 dt_prop(dt, name, (char *)&data, sizeof(u32));
886}
887
888void dt_prop_u64(struct iseries_flat_dt *dt, char *name, u64 data)
889{
890 dt_prop(dt, name, (char *)&data, sizeof(u64));
891}
892
893void dt_prop_u64_list(struct iseries_flat_dt *dt, char *name, u64 *data, int n)
894{
895 dt_prop(dt, name, (char *)data, sizeof(u64) * n);
896}
897
898void dt_prop_empty(struct iseries_flat_dt *dt, char *name)
899{
900 dt_prop(dt, name, NULL, 0);
901}
902
903void dt_cpus(struct iseries_flat_dt *dt)
904{
905 unsigned char buf[32];
906 unsigned char *p;
907 unsigned int i, index;
908 struct IoHriProcessorVpd *d;
909
910 /* yuck */
911 snprintf(buf, 32, "PowerPC,%s", cur_cpu_spec->cpu_name);
912 p = strchr(buf, ' ');
913 if (!p) p = buf + strlen(buf);
914
915 dt_start_node(dt, "cpus");
916 dt_prop_u32(dt, "#address-cells", 1);
917 dt_prop_u32(dt, "#size-cells", 0);
918
919 for (i = 0; i < NR_CPUS; i++) {
920 if (paca[i].lppaca.dyn_proc_status >= 2)
921 continue;
922
923 snprintf(p, 32 - (p - buf), "@%d", i);
924 dt_start_node(dt, buf);
925
926 dt_prop_str(dt, "device_type", "cpu");
927
928 index = paca[i].lppaca.dyn_hv_phys_proc_index;
929 d = &xIoHriProcessorVpd[index];
930
931 dt_prop_u32(dt, "i-cache-size", d->xInstCacheSize * 1024);
932 dt_prop_u32(dt, "i-cache-line-size", d->xInstCacheOperandSize);
933
934 dt_prop_u32(dt, "d-cache-size", d->xDataL1CacheSizeKB * 1024);
935 dt_prop_u32(dt, "d-cache-line-size", d->xDataCacheOperandSize);
936
937 /* magic conversions to Hz copied from old code */
938 dt_prop_u32(dt, "clock-frequency",
939 ((1UL << 34) * 1000000) / d->xProcFreq);
940 dt_prop_u32(dt, "timebase-frequency",
941 ((1UL << 32) * 1000000) / d->xTimeBaseFreq);
942
943 dt_prop_u32(dt, "reg", i);
944
945 dt_end_node(dt);
946 }
947
948 dt_end_node(dt);
949}
950
951void build_flat_dt(struct iseries_flat_dt *dt)
952{
953 u64 tmp[2];
954
955 dt_init(dt);
956
957 dt_start_node(dt, "");
958
959 dt_prop_u32(dt, "#address-cells", 2);
960 dt_prop_u32(dt, "#size-cells", 2);
961
962 /* /memory */
963 dt_start_node(dt, "memory@0");
964 dt_prop_str(dt, "name", "memory");
965 dt_prop_str(dt, "device_type", "memory");
966 tmp[0] = 0;
967 tmp[1] = systemcfg->physicalMemorySize;
968 dt_prop_u64_list(dt, "reg", tmp, 2);
969 dt_end_node(dt);
970
971 /* /chosen */
972 dt_start_node(dt, "chosen");
973 dt_prop_u32(dt, "linux,platform", PLATFORM_ISERIES_LPAR);
974 dt_end_node(dt);
975
976 dt_cpus(dt);
977
978 dt_end_node(dt);
979
980 dt_push_u32(dt, OF_DT_END);
981}
982
983void * __init iSeries_early_setup(void)
984{
985 iSeries_fixup_klimit();
986
987 /*
988 * Initialize the table which translate Linux physical addresses to
989 * AS/400 absolute addresses
990 */
991 build_iSeries_Memory_Map();
992
993 build_flat_dt(&iseries_dt);
994
995 return (void *) __pa(&iseries_dt);
996}
diff --git a/arch/ppc64/kernel/iSeries_setup.h b/arch/powerpc/platforms/iseries/setup.h
index c6eb29a245ac..5213044ec411 100644
--- a/arch/ppc64/kernel/iSeries_setup.h
+++ b/arch/powerpc/platforms/iseries/setup.h
@@ -2,8 +2,6 @@
2 * Copyright (c) 2000 Mike Corrigan <mikejc@us.ibm.com> 2 * Copyright (c) 2000 Mike Corrigan <mikejc@us.ibm.com>
3 * Copyright (c) 1999-2000 Grant Erickson <grant@lcse.umn.edu> 3 * Copyright (c) 1999-2000 Grant Erickson <grant@lcse.umn.edu>
4 * 4 *
5 * Module name: as400_setup.h
6 *
7 * Description: 5 * Description:
8 * Architecture- / platform-specific boot-time initialization code for 6 * Architecture- / platform-specific boot-time initialization code for
9 * the IBM AS/400 LPAR. Adapted from original code by Grant Erickson and 7 * the IBM AS/400 LPAR. Adapted from original code by Grant Erickson and
@@ -19,7 +17,7 @@
19#ifndef __ISERIES_SETUP_H__ 17#ifndef __ISERIES_SETUP_H__
20#define __ISERIES_SETUP_H__ 18#define __ISERIES_SETUP_H__
21 19
22extern void iSeries_get_boot_time(struct rtc_time *tm); 20extern unsigned long iSeries_get_boot_time(void);
23extern int iSeries_set_rtc_time(struct rtc_time *tm); 21extern int iSeries_set_rtc_time(struct rtc_time *tm);
24extern void iSeries_get_rtc_time(struct rtc_time *tm); 22extern void iSeries_get_rtc_time(struct rtc_time *tm);
25 23
diff --git a/arch/ppc64/kernel/iSeries_smp.c b/arch/powerpc/platforms/iseries/smp.c
index f74386e31638..f720916682f6 100644
--- a/arch/ppc64/kernel/iSeries_smp.c
+++ b/arch/powerpc/platforms/iseries/smp.c
@@ -47,17 +47,17 @@
47 47
48static unsigned long iSeries_smp_message[NR_CPUS]; 48static unsigned long iSeries_smp_message[NR_CPUS];
49 49
50void iSeries_smp_message_recv( struct pt_regs * regs ) 50void iSeries_smp_message_recv(struct pt_regs *regs)
51{ 51{
52 int cpu = smp_processor_id(); 52 int cpu = smp_processor_id();
53 int msg; 53 int msg;
54 54
55 if ( num_online_cpus() < 2 ) 55 if (num_online_cpus() < 2)
56 return; 56 return;
57 57
58 for ( msg = 0; msg < 4; ++msg ) 58 for (msg = 0; msg < 4; msg++)
59 if ( test_and_clear_bit( msg, &iSeries_smp_message[cpu] ) ) 59 if (test_and_clear_bit(msg, &iSeries_smp_message[cpu]))
60 smp_message_recv( msg, regs ); 60 smp_message_recv(msg, regs);
61} 61}
62 62
63static inline void smp_iSeries_do_message(int cpu, int msg) 63static inline void smp_iSeries_do_message(int cpu, int msg)
@@ -74,48 +74,22 @@ static void smp_iSeries_message_pass(int target, int msg)
74 smp_iSeries_do_message(target, msg); 74 smp_iSeries_do_message(target, msg);
75 else { 75 else {
76 for_each_online_cpu(i) { 76 for_each_online_cpu(i) {
77 if (target == MSG_ALL_BUT_SELF 77 if ((target == MSG_ALL_BUT_SELF) &&
78 && i == smp_processor_id()) 78 (i == smp_processor_id()))
79 continue; 79 continue;
80 smp_iSeries_do_message(i, msg); 80 smp_iSeries_do_message(i, msg);
81 } 81 }
82 } 82 }
83} 83}
84 84
85static int smp_iSeries_numProcs(void)
86{
87 unsigned np, i;
88
89 np = 0;
90 for (i=0; i < NR_CPUS; ++i) {
91 if (paca[i].lppaca.dyn_proc_status < 2) {
92 cpu_set(i, cpu_possible_map);
93 cpu_set(i, cpu_present_map);
94 cpu_set(i, cpu_sibling_map[i]);
95 ++np;
96 }
97 }
98 return np;
99}
100
101static int smp_iSeries_probe(void) 85static int smp_iSeries_probe(void)
102{ 86{
103 unsigned i; 87 return cpus_weight(cpu_possible_map);
104 unsigned np = 0;
105
106 for (i=0; i < NR_CPUS; ++i) {
107 if (paca[i].lppaca.dyn_proc_status < 2) {
108 /*paca[i].active = 1;*/
109 ++np;
110 }
111 }
112
113 return np;
114} 88}
115 89
116static void smp_iSeries_kick_cpu(int nr) 90static void smp_iSeries_kick_cpu(int nr)
117{ 91{
118 BUG_ON(nr < 0 || nr >= NR_CPUS); 92 BUG_ON((nr < 0) || (nr >= NR_CPUS));
119 93
120 /* Verify that our partition has a processor nr */ 94 /* Verify that our partition has a processor nr */
121 if (paca[nr].lppaca.dyn_proc_status >= 2) 95 if (paca[nr].lppaca.dyn_proc_status >= 2)
@@ -144,6 +118,4 @@ static struct smp_ops_t iSeries_smp_ops = {
144void __init smp_init_iSeries(void) 118void __init smp_init_iSeries(void)
145{ 119{
146 smp_ops = &iSeries_smp_ops; 120 smp_ops = &iSeries_smp_ops;
147 systemcfg->processorCount = smp_iSeries_numProcs();
148} 121}
149
diff --git a/arch/powerpc/platforms/iseries/spcomm_area.h b/arch/powerpc/platforms/iseries/spcomm_area.h
new file mode 100644
index 000000000000..6e3b685115c9
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/spcomm_area.h
@@ -0,0 +1,36 @@
1/*
2 * Copyright (C) 2001 Mike Corrigan IBM Corporation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (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#ifndef _ISERIES_SPCOMM_AREA_H
20#define _ISERIES_SPCOMM_AREA_H
21
22
23struct SpCommArea {
24 u32 xDesc; // Descriptor (only in new formats) 000-003
25 u8 xFormat; // Format (only in new formats) 004-004
26 u8 xRsvd1[11]; // Reserved 005-00F
27 u64 xRawTbAtIplStart; // Raw HW TB value when IPL is started 010-017
28 u64 xRawTodAtIplStart; // Raw HW TOD value when IPL is started 018-01F
29 u64 xBcdTimeAtIplStart; // BCD time when IPL is started 020-027
30 u64 xBcdTimeAtOsStart; // BCD time when OS passed control 028-02F
31 u8 xRsvd2[80]; // Reserved 030-07F
32};
33
34extern struct SpCommArea xSpCommArea;
35
36#endif /* _ISERIES_SPCOMM_AREA_H */
diff --git a/arch/ppc64/kernel/iSeries_vio.c b/arch/powerpc/platforms/iseries/vio.c
index 6b754b0c8344..c0f7d2e9153f 100644
--- a/arch/ppc64/kernel/iSeries_vio.c
+++ b/arch/powerpc/platforms/iseries/vio.c
@@ -14,6 +14,7 @@
14 14
15#include <asm/vio.h> 15#include <asm/vio.h>
16#include <asm/iommu.h> 16#include <asm/iommu.h>
17#include <asm/tce.h>
17#include <asm/abs_addr.h> 18#include <asm/abs_addr.h>
18#include <asm/page.h> 19#include <asm/page.h>
19#include <asm/iSeries/vio.h> 20#include <asm/iSeries/vio.h>
diff --git a/arch/ppc64/kernel/viopath.c b/arch/powerpc/platforms/iseries/viopath.c
index 2a6c4f01c45e..c0c767bd37f1 100644
--- a/arch/ppc64/kernel/viopath.c
+++ b/arch/powerpc/platforms/iseries/viopath.c
@@ -1,5 +1,4 @@
1/* -*- linux-c -*- 1/* -*- linux-c -*-
2 * arch/ppc64/kernel/viopath.c
3 * 2 *
4 * iSeries Virtual I/O Message Path code 3 * iSeries Virtual I/O Message Path code
5 * 4 *
@@ -7,7 +6,7 @@
7 * Ryan Arnold <ryanarn@us.ibm.com> 6 * Ryan Arnold <ryanarn@us.ibm.com>
8 * Colin Devilbiss <devilbis@us.ibm.com> 7 * Colin Devilbiss <devilbis@us.ibm.com>
9 * 8 *
10 * (C) Copyright 2000-2003 IBM Corporation 9 * (C) Copyright 2000-2005 IBM Corporation
11 * 10 *
12 * This code is used by the iSeries virtual disk, cd, 11 * This code is used by the iSeries virtual disk, cd,
13 * tape, and console to communicate with OS/400 in another 12 * tape, and console to communicate with OS/400 in another
diff --git a/arch/powerpc/platforms/iseries/vpd_areas.h b/arch/powerpc/platforms/iseries/vpd_areas.h
new file mode 100644
index 000000000000..601e6dd860ed
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/vpd_areas.h
@@ -0,0 +1,88 @@
1/*
2 * Copyright (C) 2001 Mike Corrigan IBM Corporation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (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#ifndef _ISERIES_VPD_AREAS_H
19#define _ISERIES_VPD_AREAS_H
20
21/*
22 * This file defines the address and length of all of the VPD area passed to
23 * the OS from PLIC (most of which start from the SP).
24 */
25
26#include <asm/types.h>
27
28/* VPD Entry index is carved in stone - cannot be changed (easily). */
29#define ItVpdCecVpd 0
30#define ItVpdDynamicSpace 1
31#define ItVpdExtVpd 2
32#define ItVpdExtVpdOnPanel 3
33#define ItVpdFirstPaca 4
34#define ItVpdIoVpd 5
35#define ItVpdIplParms 6
36#define ItVpdMsVpd 7
37#define ItVpdPanelVpd 8
38#define ItVpdLpNaca 9
39#define ItVpdBackplaneAndMaybeClockCardVpd 10
40#define ItVpdRecoveryLogBuffer 11
41#define ItVpdSpCommArea 12
42#define ItVpdSpLogBuffer 13
43#define ItVpdSpLogBufferSave 14
44#define ItVpdSpCardVpd 15
45#define ItVpdFirstProcVpd 16
46#define ItVpdApModelVpd 17
47#define ItVpdClockCardVpd 18
48#define ItVpdBusExtCardVpd 19
49#define ItVpdProcCapacityVpd 20
50#define ItVpdInteractiveCapacityVpd 21
51#define ItVpdFirstSlotLabel 22
52#define ItVpdFirstLpQueue 23
53#define ItVpdFirstL3CacheVpd 24
54#define ItVpdFirstProcFruVpd 25
55
56#define ItVpdMaxEntries 26
57
58#define ItDmaMaxEntries 10
59
60#define ItVpdAreasMaxSlotLabels 192
61
62
63struct ItVpdAreas {
64 u32 xSlicDesc; // Descriptor 000-003
65 u16 xSlicSize; // Size of this control block 004-005
66 u16 xPlicAdjustVpdLens:1; // Flag to indicate new interface006-007
67 u16 xRsvd1:15; // Reserved bits ...
68 u16 xSlicVpdEntries; // Number of VPD entries 008-009
69 u16 xSlicDmaEntries; // Number of DMA entries 00A-00B
70 u16 xSlicMaxLogicalProcs; // Maximum logical processors 00C-00D
71 u16 xSlicMaxPhysicalProcs; // Maximum physical processors 00E-00F
72 u16 xSlicDmaToksOffset; // Offset into this of array 010-011
73 u16 xSlicVpdAdrsOffset; // Offset into this of array 012-013
74 u16 xSlicDmaLensOffset; // Offset into this of array 014-015
75 u16 xSlicVpdLensOffset; // Offset into this of array 016-017
76 u16 xSlicMaxSlotLabels; // Maximum number of slot labels018-019
77 u16 xSlicMaxLpQueues; // Maximum number of LP Queues 01A-01B
78 u8 xRsvd2[4]; // Reserved 01C-01F
79 u64 xRsvd3[12]; // Reserved 020-07F
80 u32 xPlicDmaLens[ItDmaMaxEntries];// Array of DMA lengths 080-0A7
81 u32 xPlicDmaToks[ItDmaMaxEntries];// Array of DMA tokens 0A8-0CF
82 u32 xSlicVpdLens[ItVpdMaxEntries];// Array of VPD lengths 0D0-12F
83 void *xSlicVpdAdrs[ItVpdMaxEntries];// Array of VPD buffers 130-1EF
84};
85
86extern struct ItVpdAreas itVpdAreas;
87
88#endif /* _ISERIES_VPD_AREAS_H */
diff --git a/arch/ppc64/kernel/iSeries_VpdInfo.c b/arch/powerpc/platforms/iseries/vpdinfo.c
index 5d921792571f..9c318849dee7 100644
--- a/arch/ppc64/kernel/iSeries_VpdInfo.c
+++ b/arch/powerpc/platforms/iseries/vpdinfo.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * File iSeries_vpdInfo.c created by Allan Trautman on Fri Feb 2 2001.
3 *
4 * This code gets the card location of the hardware 2 * This code gets the card location of the hardware
5 * Copyright (C) 2001 <Allan H Trautman> <IBM Corp> 3 * Copyright (C) 2001 <Allan H Trautman> <IBM Corp>
6 * Copyright (C) 2005 Stephen Rothwel, IBM Corp 4 * Copyright (C) 2005 Stephen Rothwel, IBM Corp
@@ -29,12 +27,15 @@
29#include <linux/init.h> 27#include <linux/init.h>
30#include <linux/module.h> 28#include <linux/module.h>
31#include <linux/pci.h> 29#include <linux/pci.h>
30
32#include <asm/types.h> 31#include <asm/types.h>
33#include <asm/resource.h> 32#include <asm/resource.h>
34 33#include <asm/abs_addr.h>
35#include <asm/iSeries/HvCallPci.h> 34#include <asm/pci-bridge.h>
36#include <asm/iSeries/HvTypes.h> 35#include <asm/iSeries/HvTypes.h>
37#include <asm/iSeries/iSeries_pci.h> 36
37#include "pci.h"
38#include "call_pci.h"
38 39
39/* 40/*
40 * Size of Bus VPD data 41 * Size of Bus VPD data
@@ -214,7 +215,7 @@ static void __init iSeries_Get_Location_Code(u16 bus, HvAgentId agent,
214 printk("PCI: Bus VPD Buffer allocation failure.\n"); 215 printk("PCI: Bus VPD Buffer allocation failure.\n");
215 return; 216 return;
216 } 217 }
217 BusVpdLen = HvCallPci_getBusVpd(bus, ISERIES_HV_ADDR(BusVpdPtr), 218 BusVpdLen = HvCallPci_getBusVpd(bus, iseries_hv_addr(BusVpdPtr),
218 BUS_VPDSIZE); 219 BUS_VPDSIZE);
219 if (BusVpdLen == 0) { 220 if (BusVpdLen == 0) {
220 printk("PCI: Bus VPD Buffer zero length.\n"); 221 printk("PCI: Bus VPD Buffer zero length.\n");
@@ -242,7 +243,8 @@ out_free:
242 */ 243 */
243void __init iSeries_Device_Information(struct pci_dev *PciDev, int count) 244void __init iSeries_Device_Information(struct pci_dev *PciDev, int count)
244{ 245{
245 struct iSeries_Device_Node *DevNode = PciDev->sysdata; 246 struct device_node *DevNode = PciDev->sysdata;
247 struct pci_dn *pdn;
246 u16 bus; 248 u16 bus;
247 u8 frame; 249 u8 frame;
248 char card[4]; 250 char card[4];
@@ -255,8 +257,9 @@ void __init iSeries_Device_Information(struct pci_dev *PciDev, int count)
255 return; 257 return;
256 } 258 }
257 259
258 bus = ISERIES_BUS(DevNode); 260 pdn = PCI_DN(DevNode);
259 subbus = ISERIES_SUBBUS(DevNode); 261 bus = pdn->busno;
262 subbus = pdn->bussubno;
260 agent = ISERIES_PCI_AGENTID(ISERIES_GET_DEVICE_FROM_SUBBUS(subbus), 263 agent = ISERIES_PCI_AGENTID(ISERIES_GET_DEVICE_FROM_SUBBUS(subbus),
261 ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus)); 264 ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus));
262 iSeries_Get_Location_Code(bus, agent, &frame, card); 265 iSeries_Get_Location_Code(bus, agent, &frame, card);
diff --git a/arch/powerpc/platforms/maple/Makefile b/arch/powerpc/platforms/maple/Makefile
new file mode 100644
index 000000000000..1be1a993c5f5
--- /dev/null
+++ b/arch/powerpc/platforms/maple/Makefile
@@ -0,0 +1 @@
obj-y += setup.o pci.o time.o
diff --git a/arch/powerpc/platforms/maple/maple.h b/arch/powerpc/platforms/maple/maple.h
new file mode 100644
index 000000000000..0657c579b840
--- /dev/null
+++ b/arch/powerpc/platforms/maple/maple.h
@@ -0,0 +1,12 @@
1/*
2 * Declarations for maple-specific code.
3 *
4 * Maple is the name of a PPC970 evaluation board.
5 */
6extern int maple_set_rtc_time(struct rtc_time *tm);
7extern void maple_get_rtc_time(struct rtc_time *tm);
8extern unsigned long maple_get_boot_time(void);
9extern void maple_calibrate_decr(void);
10extern void maple_pci_init(void);
11extern void maple_pcibios_fixup(void);
12extern int maple_pci_get_legacy_ide_irq(struct pci_dev *dev, int channel);
diff --git a/arch/ppc64/kernel/maple_pci.c b/arch/powerpc/platforms/maple/pci.c
index 1d297e0edfc0..340c21caeae2 100644
--- a/arch/ppc64/kernel/maple_pci.c
+++ b/arch/powerpc/platforms/maple/pci.c
@@ -23,8 +23,9 @@
23#include <asm/pci-bridge.h> 23#include <asm/pci-bridge.h>
24#include <asm/machdep.h> 24#include <asm/machdep.h>
25#include <asm/iommu.h> 25#include <asm/iommu.h>
26#include <asm/ppc-pci.h>
26 27
27#include "pci.h" 28#include "maple.h"
28 29
29#ifdef DEBUG 30#ifdef DEBUG
30#define DBG(x...) printk(x) 31#define DBG(x...) printk(x)
@@ -276,7 +277,7 @@ static void __init setup_u3_agp(struct pci_controller* hose)
276{ 277{
277 /* On G5, we move AGP up to high bus number so we don't need 278 /* On G5, we move AGP up to high bus number so we don't need
278 * to reassign bus numbers for HT. If we ever have P2P bridges 279 * to reassign bus numbers for HT. If we ever have P2P bridges
279 * on AGP, we'll have to move pci_assign_all_busses to the 280 * on AGP, we'll have to move pci_assign_all_buses to the
280 * pci_controller structure so we enable it for AGP and not for 281 * pci_controller structure so we enable it for AGP and not for
281 * HT childs. 282 * HT childs.
282 * We hard code the address because of the different size of 283 * We hard code the address because of the different size of
@@ -360,7 +361,7 @@ static int __init add_bridge(struct device_node *dev)
360 361
361 /* Interpret the "ranges" property */ 362 /* Interpret the "ranges" property */
362 /* This also maps the I/O region and sets isa_io/mem_base */ 363 /* This also maps the I/O region and sets isa_io/mem_base */
363 pci_process_bridge_OF_ranges(hose, dev); 364 pci_process_bridge_OF_ranges(hose, dev, primary);
364 pci_setup_phb_io(hose, primary); 365 pci_setup_phb_io(hose, primary);
365 366
366 /* Fixup "bus-range" OF property */ 367 /* Fixup "bus-range" OF property */
diff --git a/arch/ppc64/kernel/maple_setup.c b/arch/powerpc/platforms/maple/setup.c
index fc0567498a3a..7ece8983a105 100644
--- a/arch/ppc64/kernel/maple_setup.c
+++ b/arch/powerpc/platforms/maple/setup.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * arch/ppc64/kernel/maple_setup.c 2 * Maple (970 eval board) setup code
3 * 3 *
4 * (c) Copyright 2004 Benjamin Herrenschmidt (benh@kernel.crashing.org), 4 * (c) Copyright 2004 Benjamin Herrenschmidt (benh@kernel.crashing.org),
5 * IBM Corp. 5 * IBM Corp.
@@ -59,8 +59,10 @@
59#include <asm/time.h> 59#include <asm/time.h>
60#include <asm/of_device.h> 60#include <asm/of_device.h>
61#include <asm/lmb.h> 61#include <asm/lmb.h>
62#include <asm/mpic.h>
63#include <asm/udbg.h>
62 64
63#include "mpic.h" 65#include "maple.h"
64 66
65#ifdef DEBUG 67#ifdef DEBUG
66#define DBG(fmt...) udbg_printf(fmt) 68#define DBG(fmt...) udbg_printf(fmt)
@@ -68,13 +70,6 @@
68#define DBG(fmt...) 70#define DBG(fmt...)
69#endif 71#endif
70 72
71extern int maple_set_rtc_time(struct rtc_time *tm);
72extern void maple_get_rtc_time(struct rtc_time *tm);
73extern void maple_get_boot_time(struct rtc_time *tm);
74extern void maple_calibrate_decr(void);
75extern void maple_pci_init(void);
76extern void maple_pcibios_fixup(void);
77extern int maple_pci_get_legacy_ide_irq(struct pci_dev *dev, int channel);
78extern void generic_find_legacy_serial_ports(u64 *physport, 73extern void generic_find_legacy_serial_ports(u64 *physport,
79 unsigned int *default_speed); 74 unsigned int *default_speed);
80 75
diff --git a/arch/ppc64/kernel/maple_time.c b/arch/powerpc/platforms/maple/time.c
index d65210abcd03..40fc07a8e606 100644
--- a/arch/ppc64/kernel/maple_time.c
+++ b/arch/powerpc/platforms/maple/time.c
@@ -36,6 +36,8 @@
36#include <asm/machdep.h> 36#include <asm/machdep.h>
37#include <asm/time.h> 37#include <asm/time.h>
38 38
39#include "maple.h"
40
39#ifdef DEBUG 41#ifdef DEBUG
40#define DBG(x...) printk(x) 42#define DBG(x...) printk(x)
41#else 43#else
@@ -156,8 +158,9 @@ int maple_set_rtc_time(struct rtc_time *tm)
156 return 0; 158 return 0;
157} 159}
158 160
159void __init maple_get_boot_time(struct rtc_time *tm) 161unsigned long __init maple_get_boot_time(void)
160{ 162{
163 struct rtc_time tm;
161 struct device_node *rtcs; 164 struct device_node *rtcs;
162 165
163 rtcs = find_compatible_devices("rtc", "pnpPNP,b00"); 166 rtcs = find_compatible_devices("rtc", "pnpPNP,b00");
@@ -170,6 +173,8 @@ void __init maple_get_boot_time(struct rtc_time *tm)
170 "legacy address (0x%x)\n", maple_rtc_addr); 173 "legacy address (0x%x)\n", maple_rtc_addr);
171 } 174 }
172 175
173 maple_get_rtc_time(tm); 176 maple_get_rtc_time(&tm);
177 return mktime(tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
178 tm.tm_hour, tm.tm_min, tm.tm_sec);
174} 179}
175 180
diff --git a/arch/powerpc/platforms/powermac/Makefile b/arch/powerpc/platforms/powermac/Makefile
new file mode 100644
index 000000000000..4369676f1d54
--- /dev/null
+++ b/arch/powerpc/platforms/powermac/Makefile
@@ -0,0 +1,8 @@
1obj-y += pic.o setup.o time.o feature.o pci.o \
2 sleep.o low_i2c.o cache.o
3obj-$(CONFIG_PMAC_BACKLIGHT) += backlight.o
4obj-$(CONFIG_CPU_FREQ_PMAC) += cpufreq.o
5obj-$(CONFIG_NVRAM) += nvram.o
6# ppc64 pmac doesn't define CONFIG_NVRAM but needs nvram stuff
7obj-$(CONFIG_PPC64) += nvram.o
8obj-$(CONFIG_SMP) += smp.o
diff --git a/arch/powerpc/platforms/powermac/backlight.c b/arch/powerpc/platforms/powermac/backlight.c
new file mode 100644
index 000000000000..8be2f7d071f0
--- /dev/null
+++ b/arch/powerpc/platforms/powermac/backlight.c
@@ -0,0 +1,202 @@
1/*
2 * Miscellaneous procedures for dealing with the PowerMac hardware.
3 * Contains support for the backlight.
4 *
5 * Copyright (C) 2000 Benjamin Herrenschmidt
6 *
7 */
8
9#include <linux/config.h>
10#include <linux/kernel.h>
11#include <linux/module.h>
12#include <linux/stddef.h>
13#include <linux/reboot.h>
14#include <linux/nvram.h>
15#include <linux/console.h>
16#include <asm/sections.h>
17#include <asm/ptrace.h>
18#include <asm/io.h>
19#include <asm/pgtable.h>
20#include <asm/system.h>
21#include <asm/prom.h>
22#include <asm/machdep.h>
23#include <asm/nvram.h>
24#include <asm/backlight.h>
25
26#include <linux/adb.h>
27#include <linux/pmu.h>
28
29static struct backlight_controller *backlighter;
30static void* backlighter_data;
31static int backlight_autosave;
32static int backlight_level = BACKLIGHT_MAX;
33static int backlight_enabled = 1;
34static int backlight_req_level = -1;
35static int backlight_req_enable = -1;
36
37static void backlight_callback(void *);
38static DECLARE_WORK(backlight_work, backlight_callback, NULL);
39
40void register_backlight_controller(struct backlight_controller *ctrler,
41 void *data, char *type)
42{
43 struct device_node* bk_node;
44 char *prop;
45 int valid = 0;
46
47 /* There's already a matching controller, bail out */
48 if (backlighter != NULL)
49 return;
50
51 bk_node = find_devices("backlight");
52
53#ifdef CONFIG_ADB_PMU
54 /* Special case for the old PowerBook since I can't test on it */
55 backlight_autosave = machine_is_compatible("AAPL,3400/2400")
56 || machine_is_compatible("AAPL,3500");
57 if ((backlight_autosave
58 || machine_is_compatible("AAPL,PowerBook1998")
59 || machine_is_compatible("PowerBook1,1"))
60 && !strcmp(type, "pmu"))
61 valid = 1;
62#endif
63 if (bk_node) {
64 prop = get_property(bk_node, "backlight-control", NULL);
65 if (prop && !strncmp(prop, type, strlen(type)))
66 valid = 1;
67 }
68 if (!valid)
69 return;
70 backlighter = ctrler;
71 backlighter_data = data;
72
73 if (bk_node && !backlight_autosave)
74 prop = get_property(bk_node, "bklt", NULL);
75 else
76 prop = NULL;
77 if (prop) {
78 backlight_level = ((*prop)+1) >> 1;
79 if (backlight_level > BACKLIGHT_MAX)
80 backlight_level = BACKLIGHT_MAX;
81 }
82
83#ifdef CONFIG_ADB_PMU
84 if (backlight_autosave) {
85 struct adb_request req;
86 pmu_request(&req, NULL, 2, 0xd9, 0);
87 while (!req.complete)
88 pmu_poll();
89 backlight_level = req.reply[0] >> 4;
90 }
91#endif
92 acquire_console_sem();
93 if (!backlighter->set_enable(1, backlight_level, data))
94 backlight_enabled = 1;
95 release_console_sem();
96
97 printk(KERN_INFO "Registered \"%s\" backlight controller,"
98 "level: %d/15\n", type, backlight_level);
99}
100EXPORT_SYMBOL(register_backlight_controller);
101
102void unregister_backlight_controller(struct backlight_controller
103 *ctrler, void *data)
104{
105 /* We keep the current backlight level (for now) */
106 if (ctrler == backlighter && data == backlighter_data)
107 backlighter = NULL;
108}
109EXPORT_SYMBOL(unregister_backlight_controller);
110
111static int __set_backlight_enable(int enable)
112{
113 int rc;
114
115 if (!backlighter)
116 return -ENODEV;
117 acquire_console_sem();
118 rc = backlighter->set_enable(enable, backlight_level,
119 backlighter_data);
120 if (!rc)
121 backlight_enabled = enable;
122 release_console_sem();
123 return rc;
124}
125int set_backlight_enable(int enable)
126{
127 if (!backlighter)
128 return -ENODEV;
129 backlight_req_enable = enable;
130 schedule_work(&backlight_work);
131 return 0;
132}
133
134EXPORT_SYMBOL(set_backlight_enable);
135
136int get_backlight_enable(void)
137{
138 if (!backlighter)
139 return -ENODEV;
140 return backlight_enabled;
141}
142EXPORT_SYMBOL(get_backlight_enable);
143
144static int __set_backlight_level(int level)
145{
146 int rc = 0;
147
148 if (!backlighter)
149 return -ENODEV;
150 if (level < BACKLIGHT_MIN)
151 level = BACKLIGHT_OFF;
152 if (level > BACKLIGHT_MAX)
153 level = BACKLIGHT_MAX;
154 acquire_console_sem();
155 if (backlight_enabled)
156 rc = backlighter->set_level(level, backlighter_data);
157 if (!rc)
158 backlight_level = level;
159 release_console_sem();
160 if (!rc && !backlight_autosave) {
161 level <<=1;
162 if (level & 0x10)
163 level |= 0x01;
164 // -- todo: save to property "bklt"
165 }
166 return rc;
167}
168int set_backlight_level(int level)
169{
170 if (!backlighter)
171 return -ENODEV;
172 backlight_req_level = level;
173 schedule_work(&backlight_work);
174 return 0;
175}
176
177EXPORT_SYMBOL(set_backlight_level);
178
179int get_backlight_level(void)
180{
181 if (!backlighter)
182 return -ENODEV;
183 return backlight_level;
184}
185EXPORT_SYMBOL(get_backlight_level);
186
187static void backlight_callback(void *dummy)
188{
189 int level, enable;
190
191 do {
192 level = backlight_req_level;
193 enable = backlight_req_enable;
194 mb();
195
196 if (level >= 0)
197 __set_backlight_level(level);
198 if (enable >= 0)
199 __set_backlight_enable(enable);
200 } while(cmpxchg(&backlight_req_level, level, -1) != level ||
201 cmpxchg(&backlight_req_enable, enable, -1) != enable);
202}
diff --git a/arch/powerpc/platforms/powermac/cache.S b/arch/powerpc/platforms/powermac/cache.S
new file mode 100644
index 000000000000..fb977de6b704
--- /dev/null
+++ b/arch/powerpc/platforms/powermac/cache.S
@@ -0,0 +1,359 @@
1/*
2 * This file contains low-level cache management functions
3 * used for sleep and CPU speed changes on Apple machines.
4 * (In fact the only thing that is Apple-specific is that we assume
5 * that we can read from ROM at physical address 0xfff00000.)
6 *
7 * Copyright (C) 2004 Paul Mackerras (paulus@samba.org) and
8 * Benjamin Herrenschmidt (benh@kernel.crashing.org)
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
14 *
15 */
16
17#include <linux/config.h>
18#include <asm/processor.h>
19#include <asm/ppc_asm.h>
20#include <asm/cputable.h>
21
22/*
23 * Flush and disable all data caches (dL1, L2, L3). This is used
24 * when going to sleep, when doing a PMU based cpufreq transition,
25 * or when "offlining" a CPU on SMP machines. This code is over
26 * paranoid, but I've had enough issues with various CPU revs and
27 * bugs that I decided it was worth beeing over cautious
28 */
29
30_GLOBAL(flush_disable_caches)
31#ifndef CONFIG_6xx
32 blr
33#else
34BEGIN_FTR_SECTION
35 b flush_disable_745x
36END_FTR_SECTION_IFSET(CPU_FTR_SPEC7450)
37BEGIN_FTR_SECTION
38 b flush_disable_75x
39END_FTR_SECTION_IFSET(CPU_FTR_L2CR)
40 b __flush_disable_L1
41
42/* This is the code for G3 and 74[01]0 */
43flush_disable_75x:
44 mflr r10
45
46 /* Turn off EE and DR in MSR */
47 mfmsr r11
48 rlwinm r0,r11,0,~MSR_EE
49 rlwinm r0,r0,0,~MSR_DR
50 sync
51 mtmsr r0
52 isync
53
54 /* Stop DST streams */
55BEGIN_FTR_SECTION
56 DSSALL
57 sync
58END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
59
60 /* Stop DPM */
61 mfspr r8,SPRN_HID0 /* Save SPRN_HID0 in r8 */
62 rlwinm r4,r8,0,12,10 /* Turn off HID0[DPM] */
63 sync
64 mtspr SPRN_HID0,r4 /* Disable DPM */
65 sync
66
67 /* Disp-flush L1. We have a weird problem here that I never
68 * totally figured out. On 750FX, using the ROM for the flush
69 * results in a non-working flush. We use that workaround for
70 * now until I finally understand what's going on. --BenH
71 */
72
73 /* ROM base by default */
74 lis r4,0xfff0
75 mfpvr r3
76 srwi r3,r3,16
77 cmplwi cr0,r3,0x7000
78 bne+ 1f
79 /* RAM base on 750FX */
80 li r4,0
811: li r4,0x4000
82 mtctr r4
831: lwz r0,0(r4)
84 addi r4,r4,32
85 bdnz 1b
86 sync
87 isync
88
89 /* Disable / invalidate / enable L1 data */
90 mfspr r3,SPRN_HID0
91 rlwinm r3,r3,0,~(HID0_DCE | HID0_ICE)
92 mtspr SPRN_HID0,r3
93 sync
94 isync
95 ori r3,r3,(HID0_DCE|HID0_DCI|HID0_ICE|HID0_ICFI)
96 sync
97 isync
98 mtspr SPRN_HID0,r3
99 xori r3,r3,(HID0_DCI|HID0_ICFI)
100 mtspr SPRN_HID0,r3
101 sync
102
103 /* Get the current enable bit of the L2CR into r4 */
104 mfspr r5,SPRN_L2CR
105 /* Set to data-only (pre-745x bit) */
106 oris r3,r5,L2CR_L2DO@h
107 b 2f
108 /* When disabling L2, code must be in L1 */
109 .balign 32
1101: mtspr SPRN_L2CR,r3
1113: sync
112 isync
113 b 1f
1142: b 3f
1153: sync
116 isync
117 b 1b
1181: /* disp-flush L2. The interesting thing here is that the L2 can be
119 * up to 2Mb ... so using the ROM, we'll end up wrapping back to memory
120 * but that is probbaly fine. We disp-flush over 4Mb to be safe
121 */
122 lis r4,2
123 mtctr r4
124 lis r4,0xfff0
1251: lwz r0,0(r4)
126 addi r4,r4,32
127 bdnz 1b
128 sync
129 isync
130 lis r4,2
131 mtctr r4
132 lis r4,0xfff0
1331: dcbf 0,r4
134 addi r4,r4,32
135 bdnz 1b
136 sync
137 isync
138
139 /* now disable L2 */
140 rlwinm r5,r5,0,~L2CR_L2E
141 b 2f
142 /* When disabling L2, code must be in L1 */
143 .balign 32
1441: mtspr SPRN_L2CR,r5
1453: sync
146 isync
147 b 1f
1482: b 3f
1493: sync
150 isync
151 b 1b
1521: sync
153 isync
154 /* Invalidate L2. This is pre-745x, we clear the L2I bit ourselves */
155 oris r4,r5,L2CR_L2I@h
156 mtspr SPRN_L2CR,r4
157 sync
158 isync
159
160 /* Wait for the invalidation to complete */
1611: mfspr r3,SPRN_L2CR
162 rlwinm. r0,r3,0,31,31
163 bne 1b
164
165 /* Clear L2I */
166 xoris r4,r4,L2CR_L2I@h
167 sync
168 mtspr SPRN_L2CR,r4
169 sync
170
171 /* now disable the L1 data cache */
172 mfspr r0,SPRN_HID0
173 rlwinm r0,r0,0,~(HID0_DCE|HID0_ICE)
174 mtspr SPRN_HID0,r0
175 sync
176 isync
177
178 /* Restore HID0[DPM] to whatever it was before */
179 sync
180 mfspr r0,SPRN_HID0
181 rlwimi r0,r8,0,11,11 /* Turn back HID0[DPM] */
182 mtspr SPRN_HID0,r0
183 sync
184
185 /* restore DR and EE */
186 sync
187 mtmsr r11
188 isync
189
190 mtlr r10
191 blr
192
193/* This code is for 745x processors */
194flush_disable_745x:
195 /* Turn off EE and DR in MSR */
196 mfmsr r11
197 rlwinm r0,r11,0,~MSR_EE
198 rlwinm r0,r0,0,~MSR_DR
199 sync
200 mtmsr r0
201 isync
202
203 /* Stop prefetch streams */
204 DSSALL
205 sync
206
207 /* Disable L2 prefetching */
208 mfspr r0,SPRN_MSSCR0
209 rlwinm r0,r0,0,0,29
210 mtspr SPRN_MSSCR0,r0
211 sync
212 isync
213 lis r4,0
214 dcbf 0,r4
215 dcbf 0,r4
216 dcbf 0,r4
217 dcbf 0,r4
218 dcbf 0,r4
219 dcbf 0,r4
220 dcbf 0,r4
221 dcbf 0,r4
222
223 /* Due to a bug with the HW flush on some CPU revs, we occasionally
224 * experience data corruption. I'm adding a displacement flush along
225 * with a dcbf loop over a few Mb to "help". The problem isn't totally
226 * fixed by this in theory, but at least, in practice, I couldn't reproduce
227 * it even with a big hammer...
228 */
229
230 lis r4,0x0002
231 mtctr r4
232 li r4,0
2331:
234 lwz r0,0(r4)
235 addi r4,r4,32 /* Go to start of next cache line */
236 bdnz 1b
237 isync
238
239 /* Now, flush the first 4MB of memory */
240 lis r4,0x0002
241 mtctr r4
242 li r4,0
243 sync
2441:
245 dcbf 0,r4
246 addi r4,r4,32 /* Go to start of next cache line */
247 bdnz 1b
248
249 /* Flush and disable the L1 data cache */
250 mfspr r6,SPRN_LDSTCR
251 lis r3,0xfff0 /* read from ROM for displacement flush */
252 li r4,0xfe /* start with only way 0 unlocked */
253 li r5,128 /* 128 lines in each way */
2541: mtctr r5
255 rlwimi r6,r4,0,24,31
256 mtspr SPRN_LDSTCR,r6
257 sync
258 isync
2592: lwz r0,0(r3) /* touch each cache line */
260 addi r3,r3,32
261 bdnz 2b
262 rlwinm r4,r4,1,24,30 /* move on to the next way */
263 ori r4,r4,1
264 cmpwi r4,0xff /* all done? */
265 bne 1b
266 /* now unlock the L1 data cache */
267 li r4,0
268 rlwimi r6,r4,0,24,31
269 sync
270 mtspr SPRN_LDSTCR,r6
271 sync
272 isync
273
274 /* Flush the L2 cache using the hardware assist */
275 mfspr r3,SPRN_L2CR
276 cmpwi r3,0 /* check if it is enabled first */
277 bge 4f
278 oris r0,r3,(L2CR_L2IO_745x|L2CR_L2DO_745x)@h
279 b 2f
280 /* When disabling/locking L2, code must be in L1 */
281 .balign 32
2821: mtspr SPRN_L2CR,r0 /* lock the L2 cache */
2833: sync
284 isync
285 b 1f
2862: b 3f
2873: sync
288 isync
289 b 1b
2901: sync
291 isync
292 ori r0,r3,L2CR_L2HWF_745x
293 sync
294 mtspr SPRN_L2CR,r0 /* set the hardware flush bit */
2953: mfspr r0,SPRN_L2CR /* wait for it to go to 0 */
296 andi. r0,r0,L2CR_L2HWF_745x
297 bne 3b
298 sync
299 rlwinm r3,r3,0,~L2CR_L2E
300 b 2f
301 /* When disabling L2, code must be in L1 */
302 .balign 32
3031: mtspr SPRN_L2CR,r3 /* disable the L2 cache */
3043: sync
305 isync
306 b 1f
3072: b 3f
3083: sync
309 isync
310 b 1b
3111: sync
312 isync
313 oris r4,r3,L2CR_L2I@h
314 mtspr SPRN_L2CR,r4
315 sync
316 isync
3171: mfspr r4,SPRN_L2CR
318 andis. r0,r4,L2CR_L2I@h
319 bne 1b
320 sync
321
322BEGIN_FTR_SECTION
323 /* Flush the L3 cache using the hardware assist */
3244: mfspr r3,SPRN_L3CR
325 cmpwi r3,0 /* check if it is enabled */
326 bge 6f
327 oris r0,r3,L3CR_L3IO@h
328 ori r0,r0,L3CR_L3DO
329 sync
330 mtspr SPRN_L3CR,r0 /* lock the L3 cache */
331 sync
332 isync
333 ori r0,r0,L3CR_L3HWF
334 sync
335 mtspr SPRN_L3CR,r0 /* set the hardware flush bit */
3365: mfspr r0,SPRN_L3CR /* wait for it to go to zero */
337 andi. r0,r0,L3CR_L3HWF
338 bne 5b
339 rlwinm r3,r3,0,~L3CR_L3E
340 sync
341 mtspr SPRN_L3CR,r3 /* disable the L3 cache */
342 sync
343 ori r4,r3,L3CR_L3I
344 mtspr SPRN_L3CR,r4
3451: mfspr r4,SPRN_L3CR
346 andi. r0,r4,L3CR_L3I
347 bne 1b
348 sync
349END_FTR_SECTION_IFSET(CPU_FTR_L3CR)
350
3516: mfspr r0,SPRN_HID0 /* now disable the L1 data cache */
352 rlwinm r0,r0,0,~HID0_DCE
353 mtspr SPRN_HID0,r0
354 sync
355 isync
356 mtmsr r11 /* restore DR and EE */
357 isync
358 blr
359#endif /* CONFIG_6xx */
diff --git a/arch/powerpc/platforms/powermac/cpufreq.c b/arch/powerpc/platforms/powermac/cpufreq.c
new file mode 100644
index 000000000000..c47f8b69725c
--- /dev/null
+++ b/arch/powerpc/platforms/powermac/cpufreq.c
@@ -0,0 +1,726 @@
1/*
2 * arch/ppc/platforms/pmac_cpufreq.c
3 *
4 * Copyright (C) 2002 - 2005 Benjamin Herrenschmidt <benh@kernel.crashing.org>
5 * Copyright (C) 2004 John Steele Scott <toojays@toojays.net>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * TODO: Need a big cleanup here. Basically, we need to have different
12 * cpufreq_driver structures for the different type of HW instead of the
13 * current mess. We also need to better deal with the detection of the
14 * type of machine.
15 *
16 */
17
18#include <linux/config.h>
19#include <linux/module.h>
20#include <linux/types.h>
21#include <linux/errno.h>
22#include <linux/kernel.h>
23#include <linux/delay.h>
24#include <linux/sched.h>
25#include <linux/adb.h>
26#include <linux/pmu.h>
27#include <linux/slab.h>
28#include <linux/cpufreq.h>
29#include <linux/init.h>
30#include <linux/sysdev.h>
31#include <linux/i2c.h>
32#include <linux/hardirq.h>
33#include <asm/prom.h>
34#include <asm/machdep.h>
35#include <asm/irq.h>
36#include <asm/pmac_feature.h>
37#include <asm/mmu_context.h>
38#include <asm/sections.h>
39#include <asm/cputable.h>
40#include <asm/time.h>
41#include <asm/system.h>
42#include <asm/mpic.h>
43#include <asm/keylargo.h>
44
45/* WARNING !!! This will cause calibrate_delay() to be called,
46 * but this is an __init function ! So you MUST go edit
47 * init/main.c to make it non-init before enabling DEBUG_FREQ
48 */
49#undef DEBUG_FREQ
50
51/*
52 * There is a problem with the core cpufreq code on SMP kernels,
53 * it won't recalculate the Bogomips properly
54 */
55#ifdef CONFIG_SMP
56#warning "WARNING, CPUFREQ not recommended on SMP kernels"
57#endif
58
59extern void low_choose_7447a_dfs(int dfs);
60extern void low_choose_750fx_pll(int pll);
61extern void low_sleep_handler(void);
62
63/*
64 * Currently, PowerMac cpufreq supports only high & low frequencies
65 * that are set by the firmware
66 */
67static unsigned int low_freq;
68static unsigned int hi_freq;
69static unsigned int cur_freq;
70static unsigned int sleep_freq;
71
72/*
73 * Different models uses different mecanisms to switch the frequency
74 */
75static int (*set_speed_proc)(int low_speed);
76static unsigned int (*get_speed_proc)(void);
77
78/*
79 * Some definitions used by the various speedprocs
80 */
81static u32 voltage_gpio;
82static u32 frequency_gpio;
83static u32 slew_done_gpio;
84static int no_schedule;
85static int has_cpu_l2lve;
86static int is_pmu_based;
87
88/* There are only two frequency states for each processor. Values
89 * are in kHz for the time being.
90 */
91#define CPUFREQ_HIGH 0
92#define CPUFREQ_LOW 1
93
94static struct cpufreq_frequency_table pmac_cpu_freqs[] = {
95 {CPUFREQ_HIGH, 0},
96 {CPUFREQ_LOW, 0},
97 {0, CPUFREQ_TABLE_END},
98};
99
100static struct freq_attr* pmac_cpu_freqs_attr[] = {
101 &cpufreq_freq_attr_scaling_available_freqs,
102 NULL,
103};
104
105static inline void local_delay(unsigned long ms)
106{
107 if (no_schedule)
108 mdelay(ms);
109 else
110 msleep(ms);
111}
112
113#ifdef DEBUG_FREQ
114static inline void debug_calc_bogomips(void)
115{
116 /* This will cause a recalc of bogomips and display the
117 * result. We backup/restore the value to avoid affecting the
118 * core cpufreq framework's own calculation.
119 */
120 extern void calibrate_delay(void);
121
122 unsigned long save_lpj = loops_per_jiffy;
123 calibrate_delay();
124 loops_per_jiffy = save_lpj;
125}
126#endif /* DEBUG_FREQ */
127
128/* Switch CPU speed under 750FX CPU control
129 */
130static int cpu_750fx_cpu_speed(int low_speed)
131{
132 u32 hid2;
133
134 if (low_speed == 0) {
135 /* ramping up, set voltage first */
136 pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, voltage_gpio, 0x05);
137 /* Make sure we sleep for at least 1ms */
138 local_delay(10);
139
140 /* tweak L2 for high voltage */
141 if (has_cpu_l2lve) {
142 hid2 = mfspr(SPRN_HID2);
143 hid2 &= ~0x2000;
144 mtspr(SPRN_HID2, hid2);
145 }
146 }
147#ifdef CONFIG_6xx
148 low_choose_750fx_pll(low_speed);
149#endif
150 if (low_speed == 1) {
151 /* tweak L2 for low voltage */
152 if (has_cpu_l2lve) {
153 hid2 = mfspr(SPRN_HID2);
154 hid2 |= 0x2000;
155 mtspr(SPRN_HID2, hid2);
156 }
157
158 /* ramping down, set voltage last */
159 pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, voltage_gpio, 0x04);
160 local_delay(10);
161 }
162
163 return 0;
164}
165
166static unsigned int cpu_750fx_get_cpu_speed(void)
167{
168 if (mfspr(SPRN_HID1) & HID1_PS)
169 return low_freq;
170 else
171 return hi_freq;
172}
173
174/* Switch CPU speed using DFS */
175static int dfs_set_cpu_speed(int low_speed)
176{
177 if (low_speed == 0) {
178 /* ramping up, set voltage first */
179 pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, voltage_gpio, 0x05);
180 /* Make sure we sleep for at least 1ms */
181 local_delay(1);
182 }
183
184 /* set frequency */
185#ifdef CONFIG_6xx
186 low_choose_7447a_dfs(low_speed);
187#endif
188 udelay(100);
189
190 if (low_speed == 1) {
191 /* ramping down, set voltage last */
192 pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, voltage_gpio, 0x04);
193 local_delay(1);
194 }
195
196 return 0;
197}
198
199static unsigned int dfs_get_cpu_speed(void)
200{
201 if (mfspr(SPRN_HID1) & HID1_DFS)
202 return low_freq;
203 else
204 return hi_freq;
205}
206
207
208/* Switch CPU speed using slewing GPIOs
209 */
210static int gpios_set_cpu_speed(int low_speed)
211{
212 int gpio, timeout = 0;
213
214 /* If ramping up, set voltage first */
215 if (low_speed == 0) {
216 pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, voltage_gpio, 0x05);
217 /* Delay is way too big but it's ok, we schedule */
218 local_delay(10);
219 }
220
221 /* Set frequency */
222 gpio = pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, frequency_gpio, 0);
223 if (low_speed == ((gpio & 0x01) == 0))
224 goto skip;
225
226 pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, frequency_gpio,
227 low_speed ? 0x04 : 0x05);
228 udelay(200);
229 do {
230 if (++timeout > 100)
231 break;
232 local_delay(1);
233 gpio = pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, slew_done_gpio, 0);
234 } while((gpio & 0x02) == 0);
235 skip:
236 /* If ramping down, set voltage last */
237 if (low_speed == 1) {
238 pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, voltage_gpio, 0x04);
239 /* Delay is way too big but it's ok, we schedule */
240 local_delay(10);
241 }
242
243#ifdef DEBUG_FREQ
244 debug_calc_bogomips();
245#endif
246
247 return 0;
248}
249
250/* Switch CPU speed under PMU control
251 */
252static int pmu_set_cpu_speed(int low_speed)
253{
254 struct adb_request req;
255 unsigned long save_l2cr;
256 unsigned long save_l3cr;
257 unsigned int pic_prio;
258 unsigned long flags;
259
260 preempt_disable();
261
262#ifdef DEBUG_FREQ
263 printk(KERN_DEBUG "HID1, before: %x\n", mfspr(SPRN_HID1));
264#endif
265 pmu_suspend();
266
267 /* Disable all interrupt sources on openpic */
268 pic_prio = mpic_cpu_get_priority();
269 mpic_cpu_set_priority(0xf);
270
271 /* Make sure the decrementer won't interrupt us */
272 asm volatile("mtdec %0" : : "r" (0x7fffffff));
273 /* Make sure any pending DEC interrupt occuring while we did
274 * the above didn't re-enable the DEC */
275 mb();
276 asm volatile("mtdec %0" : : "r" (0x7fffffff));
277
278 /* We can now disable MSR_EE */
279 local_irq_save(flags);
280
281 /* Giveup the FPU & vec */
282 enable_kernel_fp();
283
284#ifdef CONFIG_ALTIVEC
285 if (cpu_has_feature(CPU_FTR_ALTIVEC))
286 enable_kernel_altivec();
287#endif /* CONFIG_ALTIVEC */
288
289 /* Save & disable L2 and L3 caches */
290 save_l3cr = _get_L3CR(); /* (returns -1 if not available) */
291 save_l2cr = _get_L2CR(); /* (returns -1 if not available) */
292
293 /* Send the new speed command. My assumption is that this command
294 * will cause PLL_CFG[0..3] to be changed next time CPU goes to sleep
295 */
296 pmu_request(&req, NULL, 6, PMU_CPU_SPEED, 'W', 'O', 'O', 'F', low_speed);
297 while (!req.complete)
298 pmu_poll();
299
300 /* Prepare the northbridge for the speed transition */
301 pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,1,1);
302
303 /* Call low level code to backup CPU state and recover from
304 * hardware reset
305 */
306 low_sleep_handler();
307
308 /* Restore the northbridge */
309 pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,1,0);
310
311 /* Restore L2 cache */
312 if (save_l2cr != 0xffffffff && (save_l2cr & L2CR_L2E) != 0)
313 _set_L2CR(save_l2cr);
314 /* Restore L3 cache */
315 if (save_l3cr != 0xffffffff && (save_l3cr & L3CR_L3E) != 0)
316 _set_L3CR(save_l3cr);
317
318 /* Restore userland MMU context */
319 set_context(current->active_mm->context, current->active_mm->pgd);
320
321#ifdef DEBUG_FREQ
322 printk(KERN_DEBUG "HID1, after: %x\n", mfspr(SPRN_HID1));
323#endif
324
325 /* Restore low level PMU operations */
326 pmu_unlock();
327
328 /* Restore decrementer */
329 wakeup_decrementer();
330
331 /* Restore interrupts */
332 mpic_cpu_set_priority(pic_prio);
333
334 /* Let interrupts flow again ... */
335 local_irq_restore(flags);
336
337#ifdef DEBUG_FREQ
338 debug_calc_bogomips();
339#endif
340
341 pmu_resume();
342
343 preempt_enable();
344
345 return 0;
346}
347
348static int do_set_cpu_speed(int speed_mode, int notify)
349{
350 struct cpufreq_freqs freqs;
351 unsigned long l3cr;
352 static unsigned long prev_l3cr;
353
354 freqs.old = cur_freq;
355 freqs.new = (speed_mode == CPUFREQ_HIGH) ? hi_freq : low_freq;
356 freqs.cpu = smp_processor_id();
357
358 if (freqs.old == freqs.new)
359 return 0;
360
361 if (notify)
362 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
363 if (speed_mode == CPUFREQ_LOW &&
364 cpu_has_feature(CPU_FTR_L3CR)) {
365 l3cr = _get_L3CR();
366 if (l3cr & L3CR_L3E) {
367 prev_l3cr = l3cr;
368 _set_L3CR(0);
369 }
370 }
371 set_speed_proc(speed_mode == CPUFREQ_LOW);
372 if (speed_mode == CPUFREQ_HIGH &&
373 cpu_has_feature(CPU_FTR_L3CR)) {
374 l3cr = _get_L3CR();
375 if ((prev_l3cr & L3CR_L3E) && l3cr != prev_l3cr)
376 _set_L3CR(prev_l3cr);
377 }
378 if (notify)
379 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
380 cur_freq = (speed_mode == CPUFREQ_HIGH) ? hi_freq : low_freq;
381
382 return 0;
383}
384
385static unsigned int pmac_cpufreq_get_speed(unsigned int cpu)
386{
387 return cur_freq;
388}
389
390static int pmac_cpufreq_verify(struct cpufreq_policy *policy)
391{
392 return cpufreq_frequency_table_verify(policy, pmac_cpu_freqs);
393}
394
395static int pmac_cpufreq_target( struct cpufreq_policy *policy,
396 unsigned int target_freq,
397 unsigned int relation)
398{
399 unsigned int newstate = 0;
400
401 if (cpufreq_frequency_table_target(policy, pmac_cpu_freqs,
402 target_freq, relation, &newstate))
403 return -EINVAL;
404
405 return do_set_cpu_speed(newstate, 1);
406}
407
408unsigned int pmac_get_one_cpufreq(int i)
409{
410 /* Supports only one CPU for now */
411 return (i == 0) ? cur_freq : 0;
412}
413
414static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy)
415{
416 if (policy->cpu != 0)
417 return -ENODEV;
418
419 policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
420 policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
421 policy->cur = cur_freq;
422
423 cpufreq_frequency_table_get_attr(pmac_cpu_freqs, policy->cpu);
424 return cpufreq_frequency_table_cpuinfo(policy, pmac_cpu_freqs);
425}
426
427static u32 read_gpio(struct device_node *np)
428{
429 u32 *reg = (u32 *)get_property(np, "reg", NULL);
430 u32 offset;
431
432 if (reg == NULL)
433 return 0;
434 /* That works for all keylargos but shall be fixed properly
435 * some day... The problem is that it seems we can't rely
436 * on the "reg" property of the GPIO nodes, they are either
437 * relative to the base of KeyLargo or to the base of the
438 * GPIO space, and the device-tree doesn't help.
439 */
440 offset = *reg;
441 if (offset < KEYLARGO_GPIO_LEVELS0)
442 offset += KEYLARGO_GPIO_LEVELS0;
443 return offset;
444}
445
446static int pmac_cpufreq_suspend(struct cpufreq_policy *policy, pm_message_t pmsg)
447{
448 /* Ok, this could be made a bit smarter, but let's be robust for now. We
449 * always force a speed change to high speed before sleep, to make sure
450 * we have appropriate voltage and/or bus speed for the wakeup process,
451 * and to make sure our loops_per_jiffies are "good enough", that is will
452 * not cause too short delays if we sleep in low speed and wake in high
453 * speed..
454 */
455 no_schedule = 1;
456 sleep_freq = cur_freq;
457 if (cur_freq == low_freq && !is_pmu_based)
458 do_set_cpu_speed(CPUFREQ_HIGH, 0);
459 return 0;
460}
461
462static int pmac_cpufreq_resume(struct cpufreq_policy *policy)
463{
464 /* If we resume, first check if we have a get() function */
465 if (get_speed_proc)
466 cur_freq = get_speed_proc();
467 else
468 cur_freq = 0;
469
470 /* We don't, hrm... we don't really know our speed here, best
471 * is that we force a switch to whatever it was, which is
472 * probably high speed due to our suspend() routine
473 */
474 do_set_cpu_speed(sleep_freq == low_freq ?
475 CPUFREQ_LOW : CPUFREQ_HIGH, 0);
476
477 no_schedule = 0;
478 return 0;
479}
480
481static struct cpufreq_driver pmac_cpufreq_driver = {
482 .verify = pmac_cpufreq_verify,
483 .target = pmac_cpufreq_target,
484 .get = pmac_cpufreq_get_speed,
485 .init = pmac_cpufreq_cpu_init,
486 .suspend = pmac_cpufreq_suspend,
487 .resume = pmac_cpufreq_resume,
488 .flags = CPUFREQ_PM_NO_WARN,
489 .attr = pmac_cpu_freqs_attr,
490 .name = "powermac",
491 .owner = THIS_MODULE,
492};
493
494
495static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode)
496{
497 struct device_node *volt_gpio_np = of_find_node_by_name(NULL,
498 "voltage-gpio");
499 struct device_node *freq_gpio_np = of_find_node_by_name(NULL,
500 "frequency-gpio");
501 struct device_node *slew_done_gpio_np = of_find_node_by_name(NULL,
502 "slewing-done");
503 u32 *value;
504
505 /*
506 * Check to see if it's GPIO driven or PMU only
507 *
508 * The way we extract the GPIO address is slightly hackish, but it
509 * works well enough for now. We need to abstract the whole GPIO
510 * stuff sooner or later anyway
511 */
512
513 if (volt_gpio_np)
514 voltage_gpio = read_gpio(volt_gpio_np);
515 if (freq_gpio_np)
516 frequency_gpio = read_gpio(freq_gpio_np);
517 if (slew_done_gpio_np)
518 slew_done_gpio = read_gpio(slew_done_gpio_np);
519
520 /* If we use the frequency GPIOs, calculate the min/max speeds based
521 * on the bus frequencies
522 */
523 if (frequency_gpio && slew_done_gpio) {
524 int lenp, rc;
525 u32 *freqs, *ratio;
526
527 freqs = (u32 *)get_property(cpunode, "bus-frequencies", &lenp);
528 lenp /= sizeof(u32);
529 if (freqs == NULL || lenp != 2) {
530 printk(KERN_ERR "cpufreq: bus-frequencies incorrect or missing\n");
531 return 1;
532 }
533 ratio = (u32 *)get_property(cpunode, "processor-to-bus-ratio*2", NULL);
534 if (ratio == NULL) {
535 printk(KERN_ERR "cpufreq: processor-to-bus-ratio*2 missing\n");
536 return 1;
537 }
538
539 /* Get the min/max bus frequencies */
540 low_freq = min(freqs[0], freqs[1]);
541 hi_freq = max(freqs[0], freqs[1]);
542
543 /* Grrrr.. It _seems_ that the device-tree is lying on the low bus
544 * frequency, it claims it to be around 84Mhz on some models while
545 * it appears to be approx. 101Mhz on all. Let's hack around here...
546 * fortunately, we don't need to be too precise
547 */
548 if (low_freq < 98000000)
549 low_freq = 101000000;
550
551 /* Convert those to CPU core clocks */
552 low_freq = (low_freq * (*ratio)) / 2000;
553 hi_freq = (hi_freq * (*ratio)) / 2000;
554
555 /* Now we get the frequencies, we read the GPIO to see what is out current
556 * speed
557 */
558 rc = pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, frequency_gpio, 0);
559 cur_freq = (rc & 0x01) ? hi_freq : low_freq;
560
561 set_speed_proc = gpios_set_cpu_speed;
562 return 1;
563 }
564
565 /* If we use the PMU, look for the min & max frequencies in the
566 * device-tree
567 */
568 value = (u32 *)get_property(cpunode, "min-clock-frequency", NULL);
569 if (!value)
570 return 1;
571 low_freq = (*value) / 1000;
572 /* The PowerBook G4 12" (PowerBook6,1) has an error in the device-tree
573 * here */
574 if (low_freq < 100000)
575 low_freq *= 10;
576
577 value = (u32 *)get_property(cpunode, "max-clock-frequency", NULL);
578 if (!value)
579 return 1;
580 hi_freq = (*value) / 1000;
581 set_speed_proc = pmu_set_cpu_speed;
582 is_pmu_based = 1;
583
584 return 0;
585}
586
587static int pmac_cpufreq_init_7447A(struct device_node *cpunode)
588{
589 struct device_node *volt_gpio_np;
590
591 if (get_property(cpunode, "dynamic-power-step", NULL) == NULL)
592 return 1;
593
594 volt_gpio_np = of_find_node_by_name(NULL, "cpu-vcore-select");
595 if (volt_gpio_np)
596 voltage_gpio = read_gpio(volt_gpio_np);
597 if (!voltage_gpio){
598 printk(KERN_ERR "cpufreq: missing cpu-vcore-select gpio\n");
599 return 1;
600 }
601
602 /* OF only reports the high frequency */
603 hi_freq = cur_freq;
604 low_freq = cur_freq/2;
605
606 /* Read actual frequency from CPU */
607 cur_freq = dfs_get_cpu_speed();
608 set_speed_proc = dfs_set_cpu_speed;
609 get_speed_proc = dfs_get_cpu_speed;
610
611 return 0;
612}
613
614static int pmac_cpufreq_init_750FX(struct device_node *cpunode)
615{
616 struct device_node *volt_gpio_np;
617 u32 pvr, *value;
618
619 if (get_property(cpunode, "dynamic-power-step", NULL) == NULL)
620 return 1;
621
622 hi_freq = cur_freq;
623 value = (u32 *)get_property(cpunode, "reduced-clock-frequency", NULL);
624 if (!value)
625 return 1;
626 low_freq = (*value) / 1000;
627
628 volt_gpio_np = of_find_node_by_name(NULL, "cpu-vcore-select");
629 if (volt_gpio_np)
630 voltage_gpio = read_gpio(volt_gpio_np);
631
632 pvr = mfspr(SPRN_PVR);
633 has_cpu_l2lve = !((pvr & 0xf00) == 0x100);
634
635 set_speed_proc = cpu_750fx_cpu_speed;
636 get_speed_proc = cpu_750fx_get_cpu_speed;
637 cur_freq = cpu_750fx_get_cpu_speed();
638
639 return 0;
640}
641
642/* Currently, we support the following machines:
643 *
644 * - Titanium PowerBook 1Ghz (PMU based, 667Mhz & 1Ghz)
645 * - Titanium PowerBook 800 (PMU based, 667Mhz & 800Mhz)
646 * - Titanium PowerBook 400 (PMU based, 300Mhz & 400Mhz)
647 * - Titanium PowerBook 500 (PMU based, 300Mhz & 500Mhz)
648 * - iBook2 500/600 (PMU based, 400Mhz & 500/600Mhz)
649 * - iBook2 700 (CPU based, 400Mhz & 700Mhz, support low voltage)
650 * - Recent MacRISC3 laptops
651 * - All new machines with 7447A CPUs
652 */
653static int __init pmac_cpufreq_setup(void)
654{
655 struct device_node *cpunode;
656 u32 *value;
657
658 if (strstr(cmd_line, "nocpufreq"))
659 return 0;
660
661 /* Assume only one CPU */
662 cpunode = find_type_devices("cpu");
663 if (!cpunode)
664 goto out;
665
666 /* Get current cpu clock freq */
667 value = (u32 *)get_property(cpunode, "clock-frequency", NULL);
668 if (!value)
669 goto out;
670 cur_freq = (*value) / 1000;
671
672 /* Check for 7447A based MacRISC3 */
673 if (machine_is_compatible("MacRISC3") &&
674 get_property(cpunode, "dynamic-power-step", NULL) &&
675 PVR_VER(mfspr(SPRN_PVR)) == 0x8003) {
676 pmac_cpufreq_init_7447A(cpunode);
677 /* Check for other MacRISC3 machines */
678 } else if (machine_is_compatible("PowerBook3,4") ||
679 machine_is_compatible("PowerBook3,5") ||
680 machine_is_compatible("MacRISC3")) {
681 pmac_cpufreq_init_MacRISC3(cpunode);
682 /* Else check for iBook2 500/600 */
683 } else if (machine_is_compatible("PowerBook4,1")) {
684 hi_freq = cur_freq;
685 low_freq = 400000;
686 set_speed_proc = pmu_set_cpu_speed;
687 is_pmu_based = 1;
688 }
689 /* Else check for TiPb 550 */
690 else if (machine_is_compatible("PowerBook3,3") && cur_freq == 550000) {
691 hi_freq = cur_freq;
692 low_freq = 500000;
693 set_speed_proc = pmu_set_cpu_speed;
694 is_pmu_based = 1;
695 }
696 /* Else check for TiPb 400 & 500 */
697 else if (machine_is_compatible("PowerBook3,2")) {
698 /* We only know about the 400 MHz and the 500Mhz model
699 * they both have 300 MHz as low frequency
700 */
701 if (cur_freq < 350000 || cur_freq > 550000)
702 goto out;
703 hi_freq = cur_freq;
704 low_freq = 300000;
705 set_speed_proc = pmu_set_cpu_speed;
706 is_pmu_based = 1;
707 }
708 /* Else check for 750FX */
709 else if (PVR_VER(mfspr(SPRN_PVR)) == 0x7000)
710 pmac_cpufreq_init_750FX(cpunode);
711out:
712 if (set_speed_proc == NULL)
713 return -ENODEV;
714
715 pmac_cpu_freqs[CPUFREQ_LOW].frequency = low_freq;
716 pmac_cpu_freqs[CPUFREQ_HIGH].frequency = hi_freq;
717
718 printk(KERN_INFO "Registering PowerMac CPU frequency driver\n");
719 printk(KERN_INFO "Low: %d Mhz, High: %d Mhz, Boot: %d Mhz\n",
720 low_freq/1000, hi_freq/1000, cur_freq/1000);
721
722 return cpufreq_register_driver(&pmac_cpufreq_driver);
723}
724
725module_init(pmac_cpufreq_setup);
726
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c
new file mode 100644
index 000000000000..10f1d942c661
--- /dev/null
+++ b/arch/powerpc/platforms/powermac/feature.c
@@ -0,0 +1,3063 @@
1/*
2 * arch/ppc/platforms/pmac_feature.c
3 *
4 * Copyright (C) 1996-2001 Paul Mackerras (paulus@cs.anu.edu.au)
5 * Ben. Herrenschmidt (benh@kernel.crashing.org)
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
10 * 2 of the License, or (at your option) any later version.
11 *
12 * TODO:
13 *
14 * - Replace mdelay with some schedule loop if possible
15 * - Shorten some obfuscated delays on some routines (like modem
16 * power)
17 * - Refcount some clocks (see darwin)
18 * - Split split split...
19 *
20 */
21#include <linux/config.h>
22#include <linux/types.h>
23#include <linux/init.h>
24#include <linux/delay.h>
25#include <linux/kernel.h>
26#include <linux/sched.h>
27#include <linux/spinlock.h>
28#include <linux/adb.h>
29#include <linux/pmu.h>
30#include <linux/ioport.h>
31#include <linux/pci.h>
32#include <asm/sections.h>
33#include <asm/errno.h>
34#include <asm/ohare.h>
35#include <asm/heathrow.h>
36#include <asm/keylargo.h>
37#include <asm/uninorth.h>
38#include <asm/io.h>
39#include <asm/prom.h>
40#include <asm/machdep.h>
41#include <asm/pmac_feature.h>
42#include <asm/dbdma.h>
43#include <asm/pci-bridge.h>
44#include <asm/pmac_low_i2c.h>
45
46#undef DEBUG_FEATURE
47
48#ifdef DEBUG_FEATURE
49#define DBG(fmt...) printk(KERN_DEBUG fmt)
50#else
51#define DBG(fmt...)
52#endif
53
54#ifdef CONFIG_6xx
55extern int powersave_lowspeed;
56#endif
57
58extern int powersave_nap;
59extern struct device_node *k2_skiplist[2];
60
61
62/*
63 * We use a single global lock to protect accesses. Each driver has
64 * to take care of its own locking
65 */
66static DEFINE_SPINLOCK(feature_lock);
67
68#define LOCK(flags) spin_lock_irqsave(&feature_lock, flags);
69#define UNLOCK(flags) spin_unlock_irqrestore(&feature_lock, flags);
70
71
72/*
73 * Instance of some macio stuffs
74 */
75struct macio_chip macio_chips[MAX_MACIO_CHIPS];
76
77struct macio_chip *macio_find(struct device_node *child, int type)
78{
79 while(child) {
80 int i;
81
82 for (i=0; i < MAX_MACIO_CHIPS && macio_chips[i].of_node; i++)
83 if (child == macio_chips[i].of_node &&
84 (!type || macio_chips[i].type == type))
85 return &macio_chips[i];
86 child = child->parent;
87 }
88 return NULL;
89}
90EXPORT_SYMBOL_GPL(macio_find);
91
92static const char *macio_names[] =
93{
94 "Unknown",
95 "Grand Central",
96 "OHare",
97 "OHareII",
98 "Heathrow",
99 "Gatwick",
100 "Paddington",
101 "Keylargo",
102 "Pangea",
103 "Intrepid",
104 "K2"
105};
106
107
108
109/*
110 * Uninorth reg. access. Note that Uni-N regs are big endian
111 */
112
113#define UN_REG(r) (uninorth_base + ((r) >> 2))
114#define UN_IN(r) (in_be32(UN_REG(r)))
115#define UN_OUT(r,v) (out_be32(UN_REG(r), (v)))
116#define UN_BIS(r,v) (UN_OUT((r), UN_IN(r) | (v)))
117#define UN_BIC(r,v) (UN_OUT((r), UN_IN(r) & ~(v)))
118
119static struct device_node *uninorth_node;
120static u32 __iomem *uninorth_base;
121static u32 uninorth_rev;
122static int uninorth_u3;
123static void __iomem *u3_ht;
124
125/*
126 * For each motherboard family, we have a table of functions pointers
127 * that handle the various features.
128 */
129
130typedef long (*feature_call)(struct device_node *node, long param, long value);
131
132struct feature_table_entry {
133 unsigned int selector;
134 feature_call function;
135};
136
137struct pmac_mb_def
138{
139 const char* model_string;
140 const char* model_name;
141 int model_id;
142 struct feature_table_entry* features;
143 unsigned long board_flags;
144};
145static struct pmac_mb_def pmac_mb;
146
147/*
148 * Here are the chip specific feature functions
149 */
150
151static inline int simple_feature_tweak(struct device_node *node, int type,
152 int reg, u32 mask, int value)
153{
154 struct macio_chip* macio;
155 unsigned long flags;
156
157 macio = macio_find(node, type);
158 if (!macio)
159 return -ENODEV;
160 LOCK(flags);
161 if (value)
162 MACIO_BIS(reg, mask);
163 else
164 MACIO_BIC(reg, mask);
165 (void)MACIO_IN32(reg);
166 UNLOCK(flags);
167
168 return 0;
169}
170
171#ifndef CONFIG_POWER4
172
173static long ohare_htw_scc_enable(struct device_node *node, long param,
174 long value)
175{
176 struct macio_chip* macio;
177 unsigned long chan_mask;
178 unsigned long fcr;
179 unsigned long flags;
180 int htw, trans;
181 unsigned long rmask;
182
183 macio = macio_find(node, 0);
184 if (!macio)
185 return -ENODEV;
186 if (!strcmp(node->name, "ch-a"))
187 chan_mask = MACIO_FLAG_SCCA_ON;
188 else if (!strcmp(node->name, "ch-b"))
189 chan_mask = MACIO_FLAG_SCCB_ON;
190 else
191 return -ENODEV;
192
193 htw = (macio->type == macio_heathrow || macio->type == macio_paddington
194 || macio->type == macio_gatwick);
195 /* On these machines, the HRW_SCC_TRANS_EN_N bit mustn't be touched */
196 trans = (pmac_mb.model_id != PMAC_TYPE_YOSEMITE &&
197 pmac_mb.model_id != PMAC_TYPE_YIKES);
198 if (value) {
199#ifdef CONFIG_ADB_PMU
200 if ((param & 0xfff) == PMAC_SCC_IRDA)
201 pmu_enable_irled(1);
202#endif /* CONFIG_ADB_PMU */
203 LOCK(flags);
204 fcr = MACIO_IN32(OHARE_FCR);
205 /* Check if scc cell need enabling */
206 if (!(fcr & OH_SCC_ENABLE)) {
207 fcr |= OH_SCC_ENABLE;
208 if (htw) {
209 /* Side effect: this will also power up the
210 * modem, but it's too messy to figure out on which
211 * ports this controls the tranceiver and on which
212 * it controls the modem
213 */
214 if (trans)
215 fcr &= ~HRW_SCC_TRANS_EN_N;
216 MACIO_OUT32(OHARE_FCR, fcr);
217 fcr |= (rmask = HRW_RESET_SCC);
218 MACIO_OUT32(OHARE_FCR, fcr);
219 } else {
220 fcr |= (rmask = OH_SCC_RESET);
221 MACIO_OUT32(OHARE_FCR, fcr);
222 }
223 UNLOCK(flags);
224 (void)MACIO_IN32(OHARE_FCR);
225 mdelay(15);
226 LOCK(flags);
227 fcr &= ~rmask;
228 MACIO_OUT32(OHARE_FCR, fcr);
229 }
230 if (chan_mask & MACIO_FLAG_SCCA_ON)
231 fcr |= OH_SCCA_IO;
232 if (chan_mask & MACIO_FLAG_SCCB_ON)
233 fcr |= OH_SCCB_IO;
234 MACIO_OUT32(OHARE_FCR, fcr);
235 macio->flags |= chan_mask;
236 UNLOCK(flags);
237 if (param & PMAC_SCC_FLAG_XMON)
238 macio->flags |= MACIO_FLAG_SCC_LOCKED;
239 } else {
240 if (macio->flags & MACIO_FLAG_SCC_LOCKED)
241 return -EPERM;
242 LOCK(flags);
243 fcr = MACIO_IN32(OHARE_FCR);
244 if (chan_mask & MACIO_FLAG_SCCA_ON)
245 fcr &= ~OH_SCCA_IO;
246 if (chan_mask & MACIO_FLAG_SCCB_ON)
247 fcr &= ~OH_SCCB_IO;
248 MACIO_OUT32(OHARE_FCR, fcr);
249 if ((fcr & (OH_SCCA_IO | OH_SCCB_IO)) == 0) {
250 fcr &= ~OH_SCC_ENABLE;
251 if (htw && trans)
252 fcr |= HRW_SCC_TRANS_EN_N;
253 MACIO_OUT32(OHARE_FCR, fcr);
254 }
255 macio->flags &= ~(chan_mask);
256 UNLOCK(flags);
257 mdelay(10);
258#ifdef CONFIG_ADB_PMU
259 if ((param & 0xfff) == PMAC_SCC_IRDA)
260 pmu_enable_irled(0);
261#endif /* CONFIG_ADB_PMU */
262 }
263 return 0;
264}
265
266static long ohare_floppy_enable(struct device_node *node, long param,
267 long value)
268{
269 return simple_feature_tweak(node, macio_ohare,
270 OHARE_FCR, OH_FLOPPY_ENABLE, value);
271}
272
273static long ohare_mesh_enable(struct device_node *node, long param, long value)
274{
275 return simple_feature_tweak(node, macio_ohare,
276 OHARE_FCR, OH_MESH_ENABLE, value);
277}
278
279static long ohare_ide_enable(struct device_node *node, long param, long value)
280{
281 switch(param) {
282 case 0:
283 /* For some reason, setting the bit in set_initial_features()
284 * doesn't stick. I'm still investigating... --BenH.
285 */
286 if (value)
287 simple_feature_tweak(node, macio_ohare,
288 OHARE_FCR, OH_IOBUS_ENABLE, 1);
289 return simple_feature_tweak(node, macio_ohare,
290 OHARE_FCR, OH_IDE0_ENABLE, value);
291 case 1:
292 return simple_feature_tweak(node, macio_ohare,
293 OHARE_FCR, OH_BAY_IDE_ENABLE, value);
294 default:
295 return -ENODEV;
296 }
297}
298
299static long ohare_ide_reset(struct device_node *node, long param, long value)
300{
301 switch(param) {
302 case 0:
303 return simple_feature_tweak(node, macio_ohare,
304 OHARE_FCR, OH_IDE0_RESET_N, !value);
305 case 1:
306 return simple_feature_tweak(node, macio_ohare,
307 OHARE_FCR, OH_IDE1_RESET_N, !value);
308 default:
309 return -ENODEV;
310 }
311}
312
313static long ohare_sleep_state(struct device_node *node, long param, long value)
314{
315 struct macio_chip* macio = &macio_chips[0];
316
317 if ((pmac_mb.board_flags & PMAC_MB_CAN_SLEEP) == 0)
318 return -EPERM;
319 if (value == 1) {
320 MACIO_BIC(OHARE_FCR, OH_IOBUS_ENABLE);
321 } else if (value == 0) {
322 MACIO_BIS(OHARE_FCR, OH_IOBUS_ENABLE);
323 }
324
325 return 0;
326}
327
328static long heathrow_modem_enable(struct device_node *node, long param,
329 long value)
330{
331 struct macio_chip* macio;
332 u8 gpio;
333 unsigned long flags;
334
335 macio = macio_find(node, macio_unknown);
336 if (!macio)
337 return -ENODEV;
338 gpio = MACIO_IN8(HRW_GPIO_MODEM_RESET) & ~1;
339 if (!value) {
340 LOCK(flags);
341 MACIO_OUT8(HRW_GPIO_MODEM_RESET, gpio);
342 UNLOCK(flags);
343 (void)MACIO_IN8(HRW_GPIO_MODEM_RESET);
344 mdelay(250);
345 }
346 if (pmac_mb.model_id != PMAC_TYPE_YOSEMITE &&
347 pmac_mb.model_id != PMAC_TYPE_YIKES) {
348 LOCK(flags);
349 if (value)
350 MACIO_BIC(HEATHROW_FCR, HRW_SCC_TRANS_EN_N);
351 else
352 MACIO_BIS(HEATHROW_FCR, HRW_SCC_TRANS_EN_N);
353 UNLOCK(flags);
354 (void)MACIO_IN32(HEATHROW_FCR);
355 mdelay(250);
356 }
357 if (value) {
358 LOCK(flags);
359 MACIO_OUT8(HRW_GPIO_MODEM_RESET, gpio | 1);
360 (void)MACIO_IN8(HRW_GPIO_MODEM_RESET);
361 UNLOCK(flags); mdelay(250); LOCK(flags);
362 MACIO_OUT8(HRW_GPIO_MODEM_RESET, gpio);
363 (void)MACIO_IN8(HRW_GPIO_MODEM_RESET);
364 UNLOCK(flags); mdelay(250); LOCK(flags);
365 MACIO_OUT8(HRW_GPIO_MODEM_RESET, gpio | 1);
366 (void)MACIO_IN8(HRW_GPIO_MODEM_RESET);
367 UNLOCK(flags); mdelay(250);
368 }
369 return 0;
370}
371
372static long heathrow_floppy_enable(struct device_node *node, long param,
373 long value)
374{
375 return simple_feature_tweak(node, macio_unknown,
376 HEATHROW_FCR,
377 HRW_SWIM_ENABLE|HRW_BAY_FLOPPY_ENABLE,
378 value);
379}
380
381static long heathrow_mesh_enable(struct device_node *node, long param,
382 long value)
383{
384 struct macio_chip* macio;
385 unsigned long flags;
386
387 macio = macio_find(node, macio_unknown);
388 if (!macio)
389 return -ENODEV;
390 LOCK(flags);
391 /* Set clear mesh cell enable */
392 if (value)
393 MACIO_BIS(HEATHROW_FCR, HRW_MESH_ENABLE);
394 else
395 MACIO_BIC(HEATHROW_FCR, HRW_MESH_ENABLE);
396 (void)MACIO_IN32(HEATHROW_FCR);
397 udelay(10);
398 /* Set/Clear termination power */
399 if (value)
400 MACIO_BIC(HEATHROW_MBCR, 0x04000000);
401 else
402 MACIO_BIS(HEATHROW_MBCR, 0x04000000);
403 (void)MACIO_IN32(HEATHROW_MBCR);
404 udelay(10);
405 UNLOCK(flags);
406
407 return 0;
408}
409
410static long heathrow_ide_enable(struct device_node *node, long param,
411 long value)
412{
413 switch(param) {
414 case 0:
415 return simple_feature_tweak(node, macio_unknown,
416 HEATHROW_FCR, HRW_IDE0_ENABLE, value);
417 case 1:
418 return simple_feature_tweak(node, macio_unknown,
419 HEATHROW_FCR, HRW_BAY_IDE_ENABLE, value);
420 default:
421 return -ENODEV;
422 }
423}
424
425static long heathrow_ide_reset(struct device_node *node, long param,
426 long value)
427{
428 switch(param) {
429 case 0:
430 return simple_feature_tweak(node, macio_unknown,
431 HEATHROW_FCR, HRW_IDE0_RESET_N, !value);
432 case 1:
433 return simple_feature_tweak(node, macio_unknown,
434 HEATHROW_FCR, HRW_IDE1_RESET_N, !value);
435 default:
436 return -ENODEV;
437 }
438}
439
440static long heathrow_bmac_enable(struct device_node *node, long param,
441 long value)
442{
443 struct macio_chip* macio;
444 unsigned long flags;
445
446 macio = macio_find(node, 0);
447 if (!macio)
448 return -ENODEV;
449 if (value) {
450 LOCK(flags);
451 MACIO_BIS(HEATHROW_FCR, HRW_BMAC_IO_ENABLE);
452 MACIO_BIS(HEATHROW_FCR, HRW_BMAC_RESET);
453 UNLOCK(flags);
454 (void)MACIO_IN32(HEATHROW_FCR);
455 mdelay(10);
456 LOCK(flags);
457 MACIO_BIC(HEATHROW_FCR, HRW_BMAC_RESET);
458 UNLOCK(flags);
459 (void)MACIO_IN32(HEATHROW_FCR);
460 mdelay(10);
461 } else {
462 LOCK(flags);
463 MACIO_BIC(HEATHROW_FCR, HRW_BMAC_IO_ENABLE);
464 UNLOCK(flags);
465 }
466 return 0;
467}
468
469static long heathrow_sound_enable(struct device_node *node, long param,
470 long value)
471{
472 struct macio_chip* macio;
473 unsigned long flags;
474
475 /* B&W G3 and Yikes don't support that properly (the
476 * sound appear to never come back after beeing shut down).
477 */
478 if (pmac_mb.model_id == PMAC_TYPE_YOSEMITE ||
479 pmac_mb.model_id == PMAC_TYPE_YIKES)
480 return 0;
481
482 macio = macio_find(node, 0);
483 if (!macio)
484 return -ENODEV;
485 if (value) {
486 LOCK(flags);
487 MACIO_BIS(HEATHROW_FCR, HRW_SOUND_CLK_ENABLE);
488 MACIO_BIC(HEATHROW_FCR, HRW_SOUND_POWER_N);
489 UNLOCK(flags);
490 (void)MACIO_IN32(HEATHROW_FCR);
491 } else {
492 LOCK(flags);
493 MACIO_BIS(HEATHROW_FCR, HRW_SOUND_POWER_N);
494 MACIO_BIC(HEATHROW_FCR, HRW_SOUND_CLK_ENABLE);
495 UNLOCK(flags);
496 }
497 return 0;
498}
499
500static u32 save_fcr[6];
501static u32 save_mbcr;
502static u32 save_gpio_levels[2];
503static u8 save_gpio_extint[KEYLARGO_GPIO_EXTINT_CNT];
504static u8 save_gpio_normal[KEYLARGO_GPIO_CNT];
505static u32 save_unin_clock_ctl;
506static struct dbdma_regs save_dbdma[13];
507static struct dbdma_regs save_alt_dbdma[13];
508
509static void dbdma_save(struct macio_chip *macio, struct dbdma_regs *save)
510{
511 int i;
512
513 /* Save state & config of DBDMA channels */
514 for (i = 0; i < 13; i++) {
515 volatile struct dbdma_regs __iomem * chan = (void __iomem *)
516 (macio->base + ((0x8000+i*0x100)>>2));
517 save[i].cmdptr_hi = in_le32(&chan->cmdptr_hi);
518 save[i].cmdptr = in_le32(&chan->cmdptr);
519 save[i].intr_sel = in_le32(&chan->intr_sel);
520 save[i].br_sel = in_le32(&chan->br_sel);
521 save[i].wait_sel = in_le32(&chan->wait_sel);
522 }
523}
524
525static void dbdma_restore(struct macio_chip *macio, struct dbdma_regs *save)
526{
527 int i;
528
529 /* Save state & config of DBDMA channels */
530 for (i = 0; i < 13; i++) {
531 volatile struct dbdma_regs __iomem * chan = (void __iomem *)
532 (macio->base + ((0x8000+i*0x100)>>2));
533 out_le32(&chan->control, (ACTIVE|DEAD|WAKE|FLUSH|PAUSE|RUN)<<16);
534 while (in_le32(&chan->status) & ACTIVE)
535 mb();
536 out_le32(&chan->cmdptr_hi, save[i].cmdptr_hi);
537 out_le32(&chan->cmdptr, save[i].cmdptr);
538 out_le32(&chan->intr_sel, save[i].intr_sel);
539 out_le32(&chan->br_sel, save[i].br_sel);
540 out_le32(&chan->wait_sel, save[i].wait_sel);
541 }
542}
543
544static void heathrow_sleep(struct macio_chip *macio, int secondary)
545{
546 if (secondary) {
547 dbdma_save(macio, save_alt_dbdma);
548 save_fcr[2] = MACIO_IN32(0x38);
549 save_fcr[3] = MACIO_IN32(0x3c);
550 } else {
551 dbdma_save(macio, save_dbdma);
552 save_fcr[0] = MACIO_IN32(0x38);
553 save_fcr[1] = MACIO_IN32(0x3c);
554 save_mbcr = MACIO_IN32(0x34);
555 /* Make sure sound is shut down */
556 MACIO_BIS(HEATHROW_FCR, HRW_SOUND_POWER_N);
557 MACIO_BIC(HEATHROW_FCR, HRW_SOUND_CLK_ENABLE);
558 /* This seems to be necessary as well or the fan
559 * keeps coming up and battery drains fast */
560 MACIO_BIC(HEATHROW_FCR, HRW_IOBUS_ENABLE);
561 MACIO_BIC(HEATHROW_FCR, HRW_IDE0_RESET_N);
562 /* Make sure eth is down even if module or sleep
563 * won't work properly */
564 MACIO_BIC(HEATHROW_FCR, HRW_BMAC_IO_ENABLE | HRW_BMAC_RESET);
565 }
566 /* Make sure modem is shut down */
567 MACIO_OUT8(HRW_GPIO_MODEM_RESET,
568 MACIO_IN8(HRW_GPIO_MODEM_RESET) & ~1);
569 MACIO_BIS(HEATHROW_FCR, HRW_SCC_TRANS_EN_N);
570 MACIO_BIC(HEATHROW_FCR, OH_SCCA_IO|OH_SCCB_IO|HRW_SCC_ENABLE);
571
572 /* Let things settle */
573 (void)MACIO_IN32(HEATHROW_FCR);
574}
575
576static void heathrow_wakeup(struct macio_chip *macio, int secondary)
577{
578 if (secondary) {
579 MACIO_OUT32(0x38, save_fcr[2]);
580 (void)MACIO_IN32(0x38);
581 mdelay(1);
582 MACIO_OUT32(0x3c, save_fcr[3]);
583 (void)MACIO_IN32(0x38);
584 mdelay(10);
585 dbdma_restore(macio, save_alt_dbdma);
586 } else {
587 MACIO_OUT32(0x38, save_fcr[0] | HRW_IOBUS_ENABLE);
588 (void)MACIO_IN32(0x38);
589 mdelay(1);
590 MACIO_OUT32(0x3c, save_fcr[1]);
591 (void)MACIO_IN32(0x38);
592 mdelay(1);
593 MACIO_OUT32(0x34, save_mbcr);
594 (void)MACIO_IN32(0x38);
595 mdelay(10);
596 dbdma_restore(macio, save_dbdma);
597 }
598}
599
600static long heathrow_sleep_state(struct device_node *node, long param,
601 long value)
602{
603 if ((pmac_mb.board_flags & PMAC_MB_CAN_SLEEP) == 0)
604 return -EPERM;
605 if (value == 1) {
606 if (macio_chips[1].type == macio_gatwick)
607 heathrow_sleep(&macio_chips[0], 1);
608 heathrow_sleep(&macio_chips[0], 0);
609 } else if (value == 0) {
610 heathrow_wakeup(&macio_chips[0], 0);
611 if (macio_chips[1].type == macio_gatwick)
612 heathrow_wakeup(&macio_chips[0], 1);
613 }
614 return 0;
615}
616
617static long core99_scc_enable(struct device_node *node, long param, long value)
618{
619 struct macio_chip* macio;
620 unsigned long flags;
621 unsigned long chan_mask;
622 u32 fcr;
623
624 macio = macio_find(node, 0);
625 if (!macio)
626 return -ENODEV;
627 if (!strcmp(node->name, "ch-a"))
628 chan_mask = MACIO_FLAG_SCCA_ON;
629 else if (!strcmp(node->name, "ch-b"))
630 chan_mask = MACIO_FLAG_SCCB_ON;
631 else
632 return -ENODEV;
633
634 if (value) {
635 int need_reset_scc = 0;
636 int need_reset_irda = 0;
637
638 LOCK(flags);
639 fcr = MACIO_IN32(KEYLARGO_FCR0);
640 /* Check if scc cell need enabling */
641 if (!(fcr & KL0_SCC_CELL_ENABLE)) {
642 fcr |= KL0_SCC_CELL_ENABLE;
643 need_reset_scc = 1;
644 }
645 if (chan_mask & MACIO_FLAG_SCCA_ON) {
646 fcr |= KL0_SCCA_ENABLE;
647 /* Don't enable line drivers for I2S modem */
648 if ((param & 0xfff) == PMAC_SCC_I2S1)
649 fcr &= ~KL0_SCC_A_INTF_ENABLE;
650 else
651 fcr |= KL0_SCC_A_INTF_ENABLE;
652 }
653 if (chan_mask & MACIO_FLAG_SCCB_ON) {
654 fcr |= KL0_SCCB_ENABLE;
655 /* Perform irda specific inits */
656 if ((param & 0xfff) == PMAC_SCC_IRDA) {
657 fcr &= ~KL0_SCC_B_INTF_ENABLE;
658 fcr |= KL0_IRDA_ENABLE;
659 fcr |= KL0_IRDA_CLK32_ENABLE | KL0_IRDA_CLK19_ENABLE;
660 fcr |= KL0_IRDA_SOURCE1_SEL;
661 fcr &= ~(KL0_IRDA_FAST_CONNECT|KL0_IRDA_DEFAULT1|KL0_IRDA_DEFAULT0);
662 fcr &= ~(KL0_IRDA_SOURCE2_SEL|KL0_IRDA_HIGH_BAND);
663 need_reset_irda = 1;
664 } else
665 fcr |= KL0_SCC_B_INTF_ENABLE;
666 }
667 MACIO_OUT32(KEYLARGO_FCR0, fcr);
668 macio->flags |= chan_mask;
669 if (need_reset_scc) {
670 MACIO_BIS(KEYLARGO_FCR0, KL0_SCC_RESET);
671 (void)MACIO_IN32(KEYLARGO_FCR0);
672 UNLOCK(flags);
673 mdelay(15);
674 LOCK(flags);
675 MACIO_BIC(KEYLARGO_FCR0, KL0_SCC_RESET);
676 }
677 if (need_reset_irda) {
678 MACIO_BIS(KEYLARGO_FCR0, KL0_IRDA_RESET);
679 (void)MACIO_IN32(KEYLARGO_FCR0);
680 UNLOCK(flags);
681 mdelay(15);
682 LOCK(flags);
683 MACIO_BIC(KEYLARGO_FCR0, KL0_IRDA_RESET);
684 }
685 UNLOCK(flags);
686 if (param & PMAC_SCC_FLAG_XMON)
687 macio->flags |= MACIO_FLAG_SCC_LOCKED;
688 } else {
689 if (macio->flags & MACIO_FLAG_SCC_LOCKED)
690 return -EPERM;
691 LOCK(flags);
692 fcr = MACIO_IN32(KEYLARGO_FCR0);
693 if (chan_mask & MACIO_FLAG_SCCA_ON)
694 fcr &= ~KL0_SCCA_ENABLE;
695 if (chan_mask & MACIO_FLAG_SCCB_ON) {
696 fcr &= ~KL0_SCCB_ENABLE;
697 /* Perform irda specific clears */
698 if ((param & 0xfff) == PMAC_SCC_IRDA) {
699 fcr &= ~KL0_IRDA_ENABLE;
700 fcr &= ~(KL0_IRDA_CLK32_ENABLE | KL0_IRDA_CLK19_ENABLE);
701 fcr &= ~(KL0_IRDA_FAST_CONNECT|KL0_IRDA_DEFAULT1|KL0_IRDA_DEFAULT0);
702 fcr &= ~(KL0_IRDA_SOURCE1_SEL|KL0_IRDA_SOURCE2_SEL|KL0_IRDA_HIGH_BAND);
703 }
704 }
705 MACIO_OUT32(KEYLARGO_FCR0, fcr);
706 if ((fcr & (KL0_SCCA_ENABLE | KL0_SCCB_ENABLE)) == 0) {
707 fcr &= ~KL0_SCC_CELL_ENABLE;
708 MACIO_OUT32(KEYLARGO_FCR0, fcr);
709 }
710 macio->flags &= ~(chan_mask);
711 UNLOCK(flags);
712 mdelay(10);
713 }
714 return 0;
715}
716
717static long
718core99_modem_enable(struct device_node *node, long param, long value)
719{
720 struct macio_chip* macio;
721 u8 gpio;
722 unsigned long flags;
723
724 /* Hack for internal USB modem */
725 if (node == NULL) {
726 if (macio_chips[0].type != macio_keylargo)
727 return -ENODEV;
728 node = macio_chips[0].of_node;
729 }
730 macio = macio_find(node, 0);
731 if (!macio)
732 return -ENODEV;
733 gpio = MACIO_IN8(KL_GPIO_MODEM_RESET);
734 gpio |= KEYLARGO_GPIO_OUTPUT_ENABLE;
735 gpio &= ~KEYLARGO_GPIO_OUTOUT_DATA;
736
737 if (!value) {
738 LOCK(flags);
739 MACIO_OUT8(KL_GPIO_MODEM_RESET, gpio);
740 UNLOCK(flags);
741 (void)MACIO_IN8(KL_GPIO_MODEM_RESET);
742 mdelay(250);
743 }
744 LOCK(flags);
745 if (value) {
746 MACIO_BIC(KEYLARGO_FCR2, KL2_ALT_DATA_OUT);
747 UNLOCK(flags);
748 (void)MACIO_IN32(KEYLARGO_FCR2);
749 mdelay(250);
750 } else {
751 MACIO_BIS(KEYLARGO_FCR2, KL2_ALT_DATA_OUT);
752 UNLOCK(flags);
753 }
754 if (value) {
755 LOCK(flags);
756 MACIO_OUT8(KL_GPIO_MODEM_RESET, gpio | KEYLARGO_GPIO_OUTOUT_DATA);
757 (void)MACIO_IN8(KL_GPIO_MODEM_RESET);
758 UNLOCK(flags); mdelay(250); LOCK(flags);
759 MACIO_OUT8(KL_GPIO_MODEM_RESET, gpio);
760 (void)MACIO_IN8(KL_GPIO_MODEM_RESET);
761 UNLOCK(flags); mdelay(250); LOCK(flags);
762 MACIO_OUT8(KL_GPIO_MODEM_RESET, gpio | KEYLARGO_GPIO_OUTOUT_DATA);
763 (void)MACIO_IN8(KL_GPIO_MODEM_RESET);
764 UNLOCK(flags); mdelay(250);
765 }
766 return 0;
767}
768
769static long
770pangea_modem_enable(struct device_node *node, long param, long value)
771{
772 struct macio_chip* macio;
773 u8 gpio;
774 unsigned long flags;
775
776 /* Hack for internal USB modem */
777 if (node == NULL) {
778 if (macio_chips[0].type != macio_pangea &&
779 macio_chips[0].type != macio_intrepid)
780 return -ENODEV;
781 node = macio_chips[0].of_node;
782 }
783 macio = macio_find(node, 0);
784 if (!macio)
785 return -ENODEV;
786 gpio = MACIO_IN8(KL_GPIO_MODEM_RESET);
787 gpio |= KEYLARGO_GPIO_OUTPUT_ENABLE;
788 gpio &= ~KEYLARGO_GPIO_OUTOUT_DATA;
789
790 if (!value) {
791 LOCK(flags);
792 MACIO_OUT8(KL_GPIO_MODEM_RESET, gpio);
793 UNLOCK(flags);
794 (void)MACIO_IN8(KL_GPIO_MODEM_RESET);
795 mdelay(250);
796 }
797 LOCK(flags);
798 if (value) {
799 MACIO_OUT8(KL_GPIO_MODEM_POWER,
800 KEYLARGO_GPIO_OUTPUT_ENABLE);
801 UNLOCK(flags);
802 (void)MACIO_IN32(KEYLARGO_FCR2);
803 mdelay(250);
804 } else {
805 MACIO_OUT8(KL_GPIO_MODEM_POWER,
806 KEYLARGO_GPIO_OUTPUT_ENABLE | KEYLARGO_GPIO_OUTOUT_DATA);
807 UNLOCK(flags);
808 }
809 if (value) {
810 LOCK(flags);
811 MACIO_OUT8(KL_GPIO_MODEM_RESET, gpio | KEYLARGO_GPIO_OUTOUT_DATA);
812 (void)MACIO_IN8(KL_GPIO_MODEM_RESET);
813 UNLOCK(flags); mdelay(250); LOCK(flags);
814 MACIO_OUT8(KL_GPIO_MODEM_RESET, gpio);
815 (void)MACIO_IN8(KL_GPIO_MODEM_RESET);
816 UNLOCK(flags); mdelay(250); LOCK(flags);
817 MACIO_OUT8(KL_GPIO_MODEM_RESET, gpio | KEYLARGO_GPIO_OUTOUT_DATA);
818 (void)MACIO_IN8(KL_GPIO_MODEM_RESET);
819 UNLOCK(flags); mdelay(250);
820 }
821 return 0;
822}
823
824static long
825core99_ata100_enable(struct device_node *node, long value)
826{
827 unsigned long flags;
828 struct pci_dev *pdev = NULL;
829 u8 pbus, pid;
830
831 if (uninorth_rev < 0x24)
832 return -ENODEV;
833
834 LOCK(flags);
835 if (value)
836 UN_BIS(UNI_N_CLOCK_CNTL, UNI_N_CLOCK_CNTL_ATA100);
837 else
838 UN_BIC(UNI_N_CLOCK_CNTL, UNI_N_CLOCK_CNTL_ATA100);
839 (void)UN_IN(UNI_N_CLOCK_CNTL);
840 UNLOCK(flags);
841 udelay(20);
842
843 if (value) {
844 if (pci_device_from_OF_node(node, &pbus, &pid) == 0)
845 pdev = pci_find_slot(pbus, pid);
846 if (pdev == NULL)
847 return 0;
848 pci_enable_device(pdev);
849 pci_set_master(pdev);
850 }
851 return 0;
852}
853
854static long
855core99_ide_enable(struct device_node *node, long param, long value)
856{
857 /* Bus ID 0 to 2 are KeyLargo based IDE, busID 3 is U2
858 * based ata-100
859 */
860 switch(param) {
861 case 0:
862 return simple_feature_tweak(node, macio_unknown,
863 KEYLARGO_FCR1, KL1_EIDE0_ENABLE, value);
864 case 1:
865 return simple_feature_tweak(node, macio_unknown,
866 KEYLARGO_FCR1, KL1_EIDE1_ENABLE, value);
867 case 2:
868 return simple_feature_tweak(node, macio_unknown,
869 KEYLARGO_FCR1, KL1_UIDE_ENABLE, value);
870 case 3:
871 return core99_ata100_enable(node, value);
872 default:
873 return -ENODEV;
874 }
875}
876
877static long
878core99_ide_reset(struct device_node *node, long param, long value)
879{
880 switch(param) {
881 case 0:
882 return simple_feature_tweak(node, macio_unknown,
883 KEYLARGO_FCR1, KL1_EIDE0_RESET_N, !value);
884 case 1:
885 return simple_feature_tweak(node, macio_unknown,
886 KEYLARGO_FCR1, KL1_EIDE1_RESET_N, !value);
887 case 2:
888 return simple_feature_tweak(node, macio_unknown,
889 KEYLARGO_FCR1, KL1_UIDE_RESET_N, !value);
890 default:
891 return -ENODEV;
892 }
893}
894
895static long
896core99_gmac_enable(struct device_node *node, long param, long value)
897{
898 unsigned long flags;
899
900 LOCK(flags);
901 if (value)
902 UN_BIS(UNI_N_CLOCK_CNTL, UNI_N_CLOCK_CNTL_GMAC);
903 else
904 UN_BIC(UNI_N_CLOCK_CNTL, UNI_N_CLOCK_CNTL_GMAC);
905 (void)UN_IN(UNI_N_CLOCK_CNTL);
906 UNLOCK(flags);
907 udelay(20);
908
909 return 0;
910}
911
912static long
913core99_gmac_phy_reset(struct device_node *node, long param, long value)
914{
915 unsigned long flags;
916 struct macio_chip *macio;
917
918 macio = &macio_chips[0];
919 if (macio->type != macio_keylargo && macio->type != macio_pangea &&
920 macio->type != macio_intrepid)
921 return -ENODEV;
922
923 LOCK(flags);
924 MACIO_OUT8(KL_GPIO_ETH_PHY_RESET, KEYLARGO_GPIO_OUTPUT_ENABLE);
925 (void)MACIO_IN8(KL_GPIO_ETH_PHY_RESET);
926 UNLOCK(flags);
927 mdelay(10);
928 LOCK(flags);
929 MACIO_OUT8(KL_GPIO_ETH_PHY_RESET, /*KEYLARGO_GPIO_OUTPUT_ENABLE | */
930 KEYLARGO_GPIO_OUTOUT_DATA);
931 UNLOCK(flags);
932 mdelay(10);
933
934 return 0;
935}
936
937static long
938core99_sound_chip_enable(struct device_node *node, long param, long value)
939{
940 struct macio_chip* macio;
941 unsigned long flags;
942
943 macio = macio_find(node, 0);
944 if (!macio)
945 return -ENODEV;
946
947 /* Do a better probe code, screamer G4 desktops &
948 * iMacs can do that too, add a recalibrate in
949 * the driver as well
950 */
951 if (pmac_mb.model_id == PMAC_TYPE_PISMO ||
952 pmac_mb.model_id == PMAC_TYPE_TITANIUM) {
953 LOCK(flags);
954 if (value)
955 MACIO_OUT8(KL_GPIO_SOUND_POWER,
956 KEYLARGO_GPIO_OUTPUT_ENABLE |
957 KEYLARGO_GPIO_OUTOUT_DATA);
958 else
959 MACIO_OUT8(KL_GPIO_SOUND_POWER,
960 KEYLARGO_GPIO_OUTPUT_ENABLE);
961 (void)MACIO_IN8(KL_GPIO_SOUND_POWER);
962 UNLOCK(flags);
963 }
964 return 0;
965}
966
967static long
968core99_airport_enable(struct device_node *node, long param, long value)
969{
970 struct macio_chip* macio;
971 unsigned long flags;
972 int state;
973
974 macio = macio_find(node, 0);
975 if (!macio)
976 return -ENODEV;
977
978 /* Hint: we allow passing of macio itself for the sake of the
979 * sleep code
980 */
981 if (node != macio->of_node &&
982 (!node->parent || node->parent != macio->of_node))
983 return -ENODEV;
984 state = (macio->flags & MACIO_FLAG_AIRPORT_ON) != 0;
985 if (value == state)
986 return 0;
987 if (value) {
988 /* This code is a reproduction of OF enable-cardslot
989 * and init-wireless methods, slightly hacked until
990 * I got it working.
991 */
992 LOCK(flags);
993 MACIO_OUT8(KEYLARGO_GPIO_0+0xf, 5);
994 (void)MACIO_IN8(KEYLARGO_GPIO_0+0xf);
995 UNLOCK(flags);
996 mdelay(10);
997 LOCK(flags);
998 MACIO_OUT8(KEYLARGO_GPIO_0+0xf, 4);
999 (void)MACIO_IN8(KEYLARGO_GPIO_0+0xf);
1000 UNLOCK(flags);
1001
1002 mdelay(10);
1003
1004 LOCK(flags);
1005 MACIO_BIC(KEYLARGO_FCR2, KL2_CARDSEL_16);
1006 (void)MACIO_IN32(KEYLARGO_FCR2);
1007 udelay(10);
1008 MACIO_OUT8(KEYLARGO_GPIO_EXTINT_0+0xb, 0);
1009 (void)MACIO_IN8(KEYLARGO_GPIO_EXTINT_0+0xb);
1010 udelay(10);
1011 MACIO_OUT8(KEYLARGO_GPIO_EXTINT_0+0xa, 0x28);
1012 (void)MACIO_IN8(KEYLARGO_GPIO_EXTINT_0+0xa);
1013 udelay(10);
1014 MACIO_OUT8(KEYLARGO_GPIO_EXTINT_0+0xd, 0x28);
1015 (void)MACIO_IN8(KEYLARGO_GPIO_EXTINT_0+0xd);
1016 udelay(10);
1017 MACIO_OUT8(KEYLARGO_GPIO_0+0xd, 0x28);
1018 (void)MACIO_IN8(KEYLARGO_GPIO_0+0xd);
1019 udelay(10);
1020 MACIO_OUT8(KEYLARGO_GPIO_0+0xe, 0x28);
1021 (void)MACIO_IN8(KEYLARGO_GPIO_0+0xe);
1022 UNLOCK(flags);
1023 udelay(10);
1024 MACIO_OUT32(0x1c000, 0);
1025 mdelay(1);
1026 MACIO_OUT8(0x1a3e0, 0x41);
1027 (void)MACIO_IN8(0x1a3e0);
1028 udelay(10);
1029 LOCK(flags);
1030 MACIO_BIS(KEYLARGO_FCR2, KL2_CARDSEL_16);
1031 (void)MACIO_IN32(KEYLARGO_FCR2);
1032 UNLOCK(flags);
1033 mdelay(100);
1034
1035 macio->flags |= MACIO_FLAG_AIRPORT_ON;
1036 } else {
1037 LOCK(flags);
1038 MACIO_BIC(KEYLARGO_FCR2, KL2_CARDSEL_16);
1039 (void)MACIO_IN32(KEYLARGO_FCR2);
1040 MACIO_OUT8(KL_GPIO_AIRPORT_0, 0);
1041 MACIO_OUT8(KL_GPIO_AIRPORT_1, 0);
1042 MACIO_OUT8(KL_GPIO_AIRPORT_2, 0);
1043 MACIO_OUT8(KL_GPIO_AIRPORT_3, 0);
1044 MACIO_OUT8(KL_GPIO_AIRPORT_4, 0);
1045 (void)MACIO_IN8(KL_GPIO_AIRPORT_4);
1046 UNLOCK(flags);
1047
1048 macio->flags &= ~MACIO_FLAG_AIRPORT_ON;
1049 }
1050 return 0;
1051}
1052
1053#ifdef CONFIG_SMP
1054static long
1055core99_reset_cpu(struct device_node *node, long param, long value)
1056{
1057 unsigned int reset_io = 0;
1058 unsigned long flags;
1059 struct macio_chip *macio;
1060 struct device_node *np;
1061 const int dflt_reset_lines[] = { KL_GPIO_RESET_CPU0,
1062 KL_GPIO_RESET_CPU1,
1063 KL_GPIO_RESET_CPU2,
1064 KL_GPIO_RESET_CPU3 };
1065
1066 macio = &macio_chips[0];
1067 if (macio->type != macio_keylargo)
1068 return -ENODEV;
1069
1070 np = find_path_device("/cpus");
1071 if (np == NULL)
1072 return -ENODEV;
1073 for (np = np->child; np != NULL; np = np->sibling) {
1074 u32 *num = (u32 *)get_property(np, "reg", NULL);
1075 u32 *rst = (u32 *)get_property(np, "soft-reset", NULL);
1076 if (num == NULL || rst == NULL)
1077 continue;
1078 if (param == *num) {
1079 reset_io = *rst;
1080 break;
1081 }
1082 }
1083 if (np == NULL || reset_io == 0)
1084 reset_io = dflt_reset_lines[param];
1085
1086 LOCK(flags);
1087 MACIO_OUT8(reset_io, KEYLARGO_GPIO_OUTPUT_ENABLE);
1088 (void)MACIO_IN8(reset_io);
1089 udelay(1);
1090 MACIO_OUT8(reset_io, 0);
1091 (void)MACIO_IN8(reset_io);
1092 UNLOCK(flags);
1093
1094 return 0;
1095}
1096#endif /* CONFIG_SMP */
1097
1098static long
1099core99_usb_enable(struct device_node *node, long param, long value)
1100{
1101 struct macio_chip *macio;
1102 unsigned long flags;
1103 char *prop;
1104 int number;
1105 u32 reg;
1106
1107 macio = &macio_chips[0];
1108 if (macio->type != macio_keylargo && macio->type != macio_pangea &&
1109 macio->type != macio_intrepid)
1110 return -ENODEV;
1111
1112 prop = (char *)get_property(node, "AAPL,clock-id", NULL);
1113 if (!prop)
1114 return -ENODEV;
1115 if (strncmp(prop, "usb0u048", 8) == 0)
1116 number = 0;
1117 else if (strncmp(prop, "usb1u148", 8) == 0)
1118 number = 2;
1119 else if (strncmp(prop, "usb2u248", 8) == 0)
1120 number = 4;
1121 else
1122 return -ENODEV;
1123
1124 /* Sorry for the brute-force locking, but this is only used during
1125 * sleep and the timing seem to be critical
1126 */
1127 LOCK(flags);
1128 if (value) {
1129 /* Turn ON */
1130 if (number == 0) {
1131 MACIO_BIC(KEYLARGO_FCR0, (KL0_USB0_PAD_SUSPEND0 | KL0_USB0_PAD_SUSPEND1));
1132 (void)MACIO_IN32(KEYLARGO_FCR0);
1133 UNLOCK(flags);
1134 mdelay(1);
1135 LOCK(flags);
1136 MACIO_BIS(KEYLARGO_FCR0, KL0_USB0_CELL_ENABLE);
1137 } else if (number == 2) {
1138 MACIO_BIC(KEYLARGO_FCR0, (KL0_USB1_PAD_SUSPEND0 | KL0_USB1_PAD_SUSPEND1));
1139 UNLOCK(flags);
1140 (void)MACIO_IN32(KEYLARGO_FCR0);
1141 mdelay(1);
1142 LOCK(flags);
1143 MACIO_BIS(KEYLARGO_FCR0, KL0_USB1_CELL_ENABLE);
1144 } else if (number == 4) {
1145 MACIO_BIC(KEYLARGO_FCR1, (KL1_USB2_PAD_SUSPEND0 | KL1_USB2_PAD_SUSPEND1));
1146 UNLOCK(flags);
1147 (void)MACIO_IN32(KEYLARGO_FCR1);
1148 mdelay(1);
1149 LOCK(flags);
1150 MACIO_BIS(KEYLARGO_FCR1, KL1_USB2_CELL_ENABLE);
1151 }
1152 if (number < 4) {
1153 reg = MACIO_IN32(KEYLARGO_FCR4);
1154 reg &= ~(KL4_PORT_WAKEUP_ENABLE(number) | KL4_PORT_RESUME_WAKE_EN(number) |
1155 KL4_PORT_CONNECT_WAKE_EN(number) | KL4_PORT_DISCONNECT_WAKE_EN(number));
1156 reg &= ~(KL4_PORT_WAKEUP_ENABLE(number+1) | KL4_PORT_RESUME_WAKE_EN(number+1) |
1157 KL4_PORT_CONNECT_WAKE_EN(number+1) | KL4_PORT_DISCONNECT_WAKE_EN(number+1));
1158 MACIO_OUT32(KEYLARGO_FCR4, reg);
1159 (void)MACIO_IN32(KEYLARGO_FCR4);
1160 udelay(10);
1161 } else {
1162 reg = MACIO_IN32(KEYLARGO_FCR3);
1163 reg &= ~(KL3_IT_PORT_WAKEUP_ENABLE(0) | KL3_IT_PORT_RESUME_WAKE_EN(0) |
1164 KL3_IT_PORT_CONNECT_WAKE_EN(0) | KL3_IT_PORT_DISCONNECT_WAKE_EN(0));
1165 reg &= ~(KL3_IT_PORT_WAKEUP_ENABLE(1) | KL3_IT_PORT_RESUME_WAKE_EN(1) |
1166 KL3_IT_PORT_CONNECT_WAKE_EN(1) | KL3_IT_PORT_DISCONNECT_WAKE_EN(1));
1167 MACIO_OUT32(KEYLARGO_FCR3, reg);
1168 (void)MACIO_IN32(KEYLARGO_FCR3);
1169 udelay(10);
1170 }
1171 if (macio->type == macio_intrepid) {
1172 /* wait for clock stopped bits to clear */
1173 u32 test0 = 0, test1 = 0;
1174 u32 status0, status1;
1175 int timeout = 1000;
1176
1177 UNLOCK(flags);
1178 switch (number) {
1179 case 0:
1180 test0 = UNI_N_CLOCK_STOPPED_USB0;
1181 test1 = UNI_N_CLOCK_STOPPED_USB0PCI;
1182 break;
1183 case 2:
1184 test0 = UNI_N_CLOCK_STOPPED_USB1;
1185 test1 = UNI_N_CLOCK_STOPPED_USB1PCI;
1186 break;
1187 case 4:
1188 test0 = UNI_N_CLOCK_STOPPED_USB2;
1189 test1 = UNI_N_CLOCK_STOPPED_USB2PCI;
1190 break;
1191 }
1192 do {
1193 if (--timeout <= 0) {
1194 printk(KERN_ERR "core99_usb_enable: "
1195 "Timeout waiting for clocks\n");
1196 break;
1197 }
1198 mdelay(1);
1199 status0 = UN_IN(UNI_N_CLOCK_STOP_STATUS0);
1200 status1 = UN_IN(UNI_N_CLOCK_STOP_STATUS1);
1201 } while ((status0 & test0) | (status1 & test1));
1202 LOCK(flags);
1203 }
1204 } else {
1205 /* Turn OFF */
1206 if (number < 4) {
1207 reg = MACIO_IN32(KEYLARGO_FCR4);
1208 reg |= KL4_PORT_WAKEUP_ENABLE(number) | KL4_PORT_RESUME_WAKE_EN(number) |
1209 KL4_PORT_CONNECT_WAKE_EN(number) | KL4_PORT_DISCONNECT_WAKE_EN(number);
1210 reg |= KL4_PORT_WAKEUP_ENABLE(number+1) | KL4_PORT_RESUME_WAKE_EN(number+1) |
1211 KL4_PORT_CONNECT_WAKE_EN(number+1) | KL4_PORT_DISCONNECT_WAKE_EN(number+1);
1212 MACIO_OUT32(KEYLARGO_FCR4, reg);
1213 (void)MACIO_IN32(KEYLARGO_FCR4);
1214 udelay(1);
1215 } else {
1216 reg = MACIO_IN32(KEYLARGO_FCR3);
1217 reg |= KL3_IT_PORT_WAKEUP_ENABLE(0) | KL3_IT_PORT_RESUME_WAKE_EN(0) |
1218 KL3_IT_PORT_CONNECT_WAKE_EN(0) | KL3_IT_PORT_DISCONNECT_WAKE_EN(0);
1219 reg |= KL3_IT_PORT_WAKEUP_ENABLE(1) | KL3_IT_PORT_RESUME_WAKE_EN(1) |
1220 KL3_IT_PORT_CONNECT_WAKE_EN(1) | KL3_IT_PORT_DISCONNECT_WAKE_EN(1);
1221 MACIO_OUT32(KEYLARGO_FCR3, reg);
1222 (void)MACIO_IN32(KEYLARGO_FCR3);
1223 udelay(1);
1224 }
1225 if (number == 0) {
1226 if (macio->type != macio_intrepid)
1227 MACIO_BIC(KEYLARGO_FCR0, KL0_USB0_CELL_ENABLE);
1228 (void)MACIO_IN32(KEYLARGO_FCR0);
1229 udelay(1);
1230 MACIO_BIS(KEYLARGO_FCR0, (KL0_USB0_PAD_SUSPEND0 | KL0_USB0_PAD_SUSPEND1));
1231 (void)MACIO_IN32(KEYLARGO_FCR0);
1232 } else if (number == 2) {
1233 if (macio->type != macio_intrepid)
1234 MACIO_BIC(KEYLARGO_FCR0, KL0_USB1_CELL_ENABLE);
1235 (void)MACIO_IN32(KEYLARGO_FCR0);
1236 udelay(1);
1237 MACIO_BIS(KEYLARGO_FCR0, (KL0_USB1_PAD_SUSPEND0 | KL0_USB1_PAD_SUSPEND1));
1238 (void)MACIO_IN32(KEYLARGO_FCR0);
1239 } else if (number == 4) {
1240 udelay(1);
1241 MACIO_BIS(KEYLARGO_FCR1, (KL1_USB2_PAD_SUSPEND0 | KL1_USB2_PAD_SUSPEND1));
1242 (void)MACIO_IN32(KEYLARGO_FCR1);
1243 }
1244 udelay(1);
1245 }
1246 UNLOCK(flags);
1247
1248 return 0;
1249}
1250
1251static long
1252core99_firewire_enable(struct device_node *node, long param, long value)
1253{
1254 unsigned long flags;
1255 struct macio_chip *macio;
1256
1257 macio = &macio_chips[0];
1258 if (macio->type != macio_keylargo && macio->type != macio_pangea &&
1259 macio->type != macio_intrepid)
1260 return -ENODEV;
1261 if (!(macio->flags & MACIO_FLAG_FW_SUPPORTED))
1262 return -ENODEV;
1263
1264 LOCK(flags);
1265 if (value) {
1266 UN_BIS(UNI_N_CLOCK_CNTL, UNI_N_CLOCK_CNTL_FW);
1267 (void)UN_IN(UNI_N_CLOCK_CNTL);
1268 } else {
1269 UN_BIC(UNI_N_CLOCK_CNTL, UNI_N_CLOCK_CNTL_FW);
1270 (void)UN_IN(UNI_N_CLOCK_CNTL);
1271 }
1272 UNLOCK(flags);
1273 mdelay(1);
1274
1275 return 0;
1276}
1277
1278static long
1279core99_firewire_cable_power(struct device_node *node, long param, long value)
1280{
1281 unsigned long flags;
1282 struct macio_chip *macio;
1283
1284 /* Trick: we allow NULL node */
1285 if ((pmac_mb.board_flags & PMAC_MB_HAS_FW_POWER) == 0)
1286 return -ENODEV;
1287 macio = &macio_chips[0];
1288 if (macio->type != macio_keylargo && macio->type != macio_pangea &&
1289 macio->type != macio_intrepid)
1290 return -ENODEV;
1291 if (!(macio->flags & MACIO_FLAG_FW_SUPPORTED))
1292 return -ENODEV;
1293
1294 LOCK(flags);
1295 if (value) {
1296 MACIO_OUT8(KL_GPIO_FW_CABLE_POWER , 0);
1297 MACIO_IN8(KL_GPIO_FW_CABLE_POWER);
1298 udelay(10);
1299 } else {
1300 MACIO_OUT8(KL_GPIO_FW_CABLE_POWER , 4);
1301 MACIO_IN8(KL_GPIO_FW_CABLE_POWER); udelay(10);
1302 }
1303 UNLOCK(flags);
1304 mdelay(1);
1305
1306 return 0;
1307}
1308
1309static long
1310intrepid_aack_delay_enable(struct device_node *node, long param, long value)
1311{
1312 unsigned long flags;
1313
1314 if (uninorth_rev < 0xd2)
1315 return -ENODEV;
1316
1317 LOCK(flags);
1318 if (param)
1319 UN_BIS(UNI_N_AACK_DELAY, UNI_N_AACK_DELAY_ENABLE);
1320 else
1321 UN_BIC(UNI_N_AACK_DELAY, UNI_N_AACK_DELAY_ENABLE);
1322 UNLOCK(flags);
1323
1324 return 0;
1325}
1326
1327
1328#endif /* CONFIG_POWER4 */
1329
1330static long
1331core99_read_gpio(struct device_node *node, long param, long value)
1332{
1333 struct macio_chip *macio = &macio_chips[0];
1334
1335 return MACIO_IN8(param);
1336}
1337
1338
1339static long
1340core99_write_gpio(struct device_node *node, long param, long value)
1341{
1342 struct macio_chip *macio = &macio_chips[0];
1343
1344 MACIO_OUT8(param, (u8)(value & 0xff));
1345 return 0;
1346}
1347
1348#ifdef CONFIG_POWER4
1349static long g5_gmac_enable(struct device_node *node, long param, long value)
1350{
1351 struct macio_chip *macio = &macio_chips[0];
1352 unsigned long flags;
1353
1354 if (node == NULL)
1355 return -ENODEV;
1356
1357 LOCK(flags);
1358 if (value) {
1359 MACIO_BIS(KEYLARGO_FCR1, K2_FCR1_GMAC_CLK_ENABLE);
1360 mb();
1361 k2_skiplist[0] = NULL;
1362 } else {
1363 k2_skiplist[0] = node;
1364 mb();
1365 MACIO_BIC(KEYLARGO_FCR1, K2_FCR1_GMAC_CLK_ENABLE);
1366 }
1367
1368 UNLOCK(flags);
1369 mdelay(1);
1370
1371 return 0;
1372}
1373
1374static long g5_fw_enable(struct device_node *node, long param, long value)
1375{
1376 struct macio_chip *macio = &macio_chips[0];
1377 unsigned long flags;
1378
1379 if (node == NULL)
1380 return -ENODEV;
1381
1382 LOCK(flags);
1383 if (value) {
1384 MACIO_BIS(KEYLARGO_FCR1, K2_FCR1_FW_CLK_ENABLE);
1385 mb();
1386 k2_skiplist[1] = NULL;
1387 } else {
1388 k2_skiplist[1] = node;
1389 mb();
1390 MACIO_BIC(KEYLARGO_FCR1, K2_FCR1_FW_CLK_ENABLE);
1391 }
1392
1393 UNLOCK(flags);
1394 mdelay(1);
1395
1396 return 0;
1397}
1398
1399static long g5_mpic_enable(struct device_node *node, long param, long value)
1400{
1401 unsigned long flags;
1402
1403 if (node->parent == NULL || strcmp(node->parent->name, "u3"))
1404 return 0;
1405
1406 LOCK(flags);
1407 UN_BIS(U3_TOGGLE_REG, U3_MPIC_RESET | U3_MPIC_OUTPUT_ENABLE);
1408 UNLOCK(flags);
1409
1410 return 0;
1411}
1412
1413static long g5_eth_phy_reset(struct device_node *node, long param, long value)
1414{
1415 struct macio_chip *macio = &macio_chips[0];
1416 struct device_node *phy;
1417 int need_reset;
1418
1419 /*
1420 * We must not reset the combo PHYs, only the BCM5221 found in
1421 * the iMac G5.
1422 */
1423 phy = of_get_next_child(node, NULL);
1424 if (!phy)
1425 return -ENODEV;
1426 need_reset = device_is_compatible(phy, "B5221");
1427 of_node_put(phy);
1428 if (!need_reset)
1429 return 0;
1430
1431 /* PHY reset is GPIO 29, not in device-tree unfortunately */
1432 MACIO_OUT8(K2_GPIO_EXTINT_0 + 29,
1433 KEYLARGO_GPIO_OUTPUT_ENABLE | KEYLARGO_GPIO_OUTOUT_DATA);
1434 /* Thankfully, this is now always called at a time when we can
1435 * schedule by sungem.
1436 */
1437 msleep(10);
1438 MACIO_OUT8(K2_GPIO_EXTINT_0 + 29, 0);
1439
1440 return 0;
1441}
1442
1443static long g5_i2s_enable(struct device_node *node, long param, long value)
1444{
1445 /* Very crude implementation for now */
1446 struct macio_chip *macio = &macio_chips[0];
1447 unsigned long flags;
1448
1449 if (value == 0)
1450 return 0; /* don't disable yet */
1451
1452 LOCK(flags);
1453 MACIO_BIS(KEYLARGO_FCR3, KL3_CLK45_ENABLE | KL3_CLK49_ENABLE |
1454 KL3_I2S0_CLK18_ENABLE);
1455 udelay(10);
1456 MACIO_BIS(KEYLARGO_FCR1, K2_FCR1_I2S0_CELL_ENABLE |
1457 K2_FCR1_I2S0_CLK_ENABLE_BIT | K2_FCR1_I2S0_ENABLE);
1458 udelay(10);
1459 MACIO_BIC(KEYLARGO_FCR1, K2_FCR1_I2S0_RESET);
1460 UNLOCK(flags);
1461 udelay(10);
1462
1463 return 0;
1464}
1465
1466
1467#ifdef CONFIG_SMP
1468static long g5_reset_cpu(struct device_node *node, long param, long value)
1469{
1470 unsigned int reset_io = 0;
1471 unsigned long flags;
1472 struct macio_chip *macio;
1473 struct device_node *np;
1474
1475 macio = &macio_chips[0];
1476 if (macio->type != macio_keylargo2)
1477 return -ENODEV;
1478
1479 np = find_path_device("/cpus");
1480 if (np == NULL)
1481 return -ENODEV;
1482 for (np = np->child; np != NULL; np = np->sibling) {
1483 u32 *num = (u32 *)get_property(np, "reg", NULL);
1484 u32 *rst = (u32 *)get_property(np, "soft-reset", NULL);
1485 if (num == NULL || rst == NULL)
1486 continue;
1487 if (param == *num) {
1488 reset_io = *rst;
1489 break;
1490 }
1491 }
1492 if (np == NULL || reset_io == 0)
1493 return -ENODEV;
1494
1495 LOCK(flags);
1496 MACIO_OUT8(reset_io, KEYLARGO_GPIO_OUTPUT_ENABLE);
1497 (void)MACIO_IN8(reset_io);
1498 udelay(1);
1499 MACIO_OUT8(reset_io, 0);
1500 (void)MACIO_IN8(reset_io);
1501 UNLOCK(flags);
1502
1503 return 0;
1504}
1505#endif /* CONFIG_SMP */
1506
1507/*
1508 * This can be called from pmac_smp so isn't static
1509 *
1510 * This takes the second CPU off the bus on dual CPU machines
1511 * running UP
1512 */
1513void g5_phy_disable_cpu1(void)
1514{
1515 UN_OUT(U3_API_PHY_CONFIG_1, 0);
1516}
1517#endif /* CONFIG_POWER4 */
1518
1519#ifndef CONFIG_POWER4
1520
1521static void
1522keylargo_shutdown(struct macio_chip *macio, int sleep_mode)
1523{
1524 u32 temp;
1525
1526 if (sleep_mode) {
1527 mdelay(1);
1528 MACIO_BIS(KEYLARGO_FCR0, KL0_USB_REF_SUSPEND);
1529 (void)MACIO_IN32(KEYLARGO_FCR0);
1530 mdelay(1);
1531 }
1532
1533 MACIO_BIC(KEYLARGO_FCR0,KL0_SCCA_ENABLE | KL0_SCCB_ENABLE |
1534 KL0_SCC_CELL_ENABLE |
1535 KL0_IRDA_ENABLE | KL0_IRDA_CLK32_ENABLE |
1536 KL0_IRDA_CLK19_ENABLE);
1537
1538 MACIO_BIC(KEYLARGO_MBCR, KL_MBCR_MB0_DEV_MASK);
1539 MACIO_BIS(KEYLARGO_MBCR, KL_MBCR_MB0_IDE_ENABLE);
1540
1541 MACIO_BIC(KEYLARGO_FCR1,
1542 KL1_AUDIO_SEL_22MCLK | KL1_AUDIO_CLK_ENABLE_BIT |
1543 KL1_AUDIO_CLK_OUT_ENABLE | KL1_AUDIO_CELL_ENABLE |
1544 KL1_I2S0_CELL_ENABLE | KL1_I2S0_CLK_ENABLE_BIT |
1545 KL1_I2S0_ENABLE | KL1_I2S1_CELL_ENABLE |
1546 KL1_I2S1_CLK_ENABLE_BIT | KL1_I2S1_ENABLE |
1547 KL1_EIDE0_ENABLE | KL1_EIDE0_RESET_N |
1548 KL1_EIDE1_ENABLE | KL1_EIDE1_RESET_N |
1549 KL1_UIDE_ENABLE);
1550
1551 MACIO_BIS(KEYLARGO_FCR2, KL2_ALT_DATA_OUT);
1552 MACIO_BIC(KEYLARGO_FCR2, KL2_IOBUS_ENABLE);
1553
1554 temp = MACIO_IN32(KEYLARGO_FCR3);
1555 if (macio->rev >= 2) {
1556 temp |= KL3_SHUTDOWN_PLL2X;
1557 if (sleep_mode)
1558 temp |= KL3_SHUTDOWN_PLL_TOTAL;
1559 }
1560
1561 temp |= KL3_SHUTDOWN_PLLKW6 | KL3_SHUTDOWN_PLLKW4 |
1562 KL3_SHUTDOWN_PLLKW35;
1563 if (sleep_mode)
1564 temp |= KL3_SHUTDOWN_PLLKW12;
1565 temp &= ~(KL3_CLK66_ENABLE | KL3_CLK49_ENABLE | KL3_CLK45_ENABLE
1566 | KL3_CLK31_ENABLE | KL3_I2S1_CLK18_ENABLE | KL3_I2S0_CLK18_ENABLE);
1567 if (sleep_mode)
1568 temp &= ~(KL3_TIMER_CLK18_ENABLE | KL3_VIA_CLK16_ENABLE);
1569 MACIO_OUT32(KEYLARGO_FCR3, temp);
1570
1571 /* Flush posted writes & wait a bit */
1572 (void)MACIO_IN32(KEYLARGO_FCR0); mdelay(1);
1573}
1574
1575static void
1576pangea_shutdown(struct macio_chip *macio, int sleep_mode)
1577{
1578 u32 temp;
1579
1580 MACIO_BIC(KEYLARGO_FCR0,KL0_SCCA_ENABLE | KL0_SCCB_ENABLE |
1581 KL0_SCC_CELL_ENABLE |
1582 KL0_USB0_CELL_ENABLE | KL0_USB1_CELL_ENABLE);
1583
1584 MACIO_BIC(KEYLARGO_FCR1,
1585 KL1_AUDIO_SEL_22MCLK | KL1_AUDIO_CLK_ENABLE_BIT |
1586 KL1_AUDIO_CLK_OUT_ENABLE | KL1_AUDIO_CELL_ENABLE |
1587 KL1_I2S0_CELL_ENABLE | KL1_I2S0_CLK_ENABLE_BIT |
1588 KL1_I2S0_ENABLE | KL1_I2S1_CELL_ENABLE |
1589 KL1_I2S1_CLK_ENABLE_BIT | KL1_I2S1_ENABLE |
1590 KL1_UIDE_ENABLE);
1591 if (pmac_mb.board_flags & PMAC_MB_MOBILE)
1592 MACIO_BIC(KEYLARGO_FCR1, KL1_UIDE_RESET_N);
1593
1594 MACIO_BIS(KEYLARGO_FCR2, KL2_ALT_DATA_OUT);
1595
1596 temp = MACIO_IN32(KEYLARGO_FCR3);
1597 temp |= KL3_SHUTDOWN_PLLKW6 | KL3_SHUTDOWN_PLLKW4 |
1598 KL3_SHUTDOWN_PLLKW35;
1599 temp &= ~(KL3_CLK49_ENABLE | KL3_CLK45_ENABLE | KL3_CLK31_ENABLE
1600 | KL3_I2S0_CLK18_ENABLE | KL3_I2S1_CLK18_ENABLE);
1601 if (sleep_mode)
1602 temp &= ~(KL3_VIA_CLK16_ENABLE | KL3_TIMER_CLK18_ENABLE);
1603 MACIO_OUT32(KEYLARGO_FCR3, temp);
1604
1605 /* Flush posted writes & wait a bit */
1606 (void)MACIO_IN32(KEYLARGO_FCR0); mdelay(1);
1607}
1608
1609static void
1610intrepid_shutdown(struct macio_chip *macio, int sleep_mode)
1611{
1612 u32 temp;
1613
1614 MACIO_BIC(KEYLARGO_FCR0,KL0_SCCA_ENABLE | KL0_SCCB_ENABLE |
1615 KL0_SCC_CELL_ENABLE);
1616
1617 MACIO_BIC(KEYLARGO_FCR1,
1618 /*KL1_USB2_CELL_ENABLE |*/
1619 KL1_I2S0_CELL_ENABLE | KL1_I2S0_CLK_ENABLE_BIT |
1620 KL1_I2S0_ENABLE | KL1_I2S1_CELL_ENABLE |
1621 KL1_I2S1_CLK_ENABLE_BIT | KL1_I2S1_ENABLE);
1622 if (pmac_mb.board_flags & PMAC_MB_MOBILE)
1623 MACIO_BIC(KEYLARGO_FCR1, KL1_UIDE_RESET_N);
1624
1625 temp = MACIO_IN32(KEYLARGO_FCR3);
1626 temp &= ~(KL3_CLK49_ENABLE | KL3_CLK45_ENABLE |
1627 KL3_I2S1_CLK18_ENABLE | KL3_I2S0_CLK18_ENABLE);
1628 if (sleep_mode)
1629 temp &= ~(KL3_TIMER_CLK18_ENABLE | KL3_IT_VIA_CLK32_ENABLE);
1630 MACIO_OUT32(KEYLARGO_FCR3, temp);
1631
1632 /* Flush posted writes & wait a bit */
1633 (void)MACIO_IN32(KEYLARGO_FCR0);
1634 mdelay(10);
1635}
1636
1637
1638void pmac_tweak_clock_spreading(int enable)
1639{
1640 struct macio_chip *macio = &macio_chips[0];
1641
1642 /* Hack for doing clock spreading on some machines PowerBooks and
1643 * iBooks. This implements the "platform-do-clockspreading" OF
1644 * property as decoded manually on various models. For safety, we also
1645 * check the product ID in the device-tree in cases we'll whack the i2c
1646 * chip to make reasonably sure we won't set wrong values in there
1647 *
1648 * Of course, ultimately, we have to implement a real parser for
1649 * the platform-do-* stuff...
1650 */
1651
1652 if (macio->type == macio_intrepid) {
1653 if (enable)
1654 UN_OUT(UNI_N_CLOCK_SPREADING, 2);
1655 else
1656 UN_OUT(UNI_N_CLOCK_SPREADING, 0);
1657 mdelay(40);
1658 }
1659
1660 while (machine_is_compatible("PowerBook5,2") ||
1661 machine_is_compatible("PowerBook5,3") ||
1662 machine_is_compatible("PowerBook6,2") ||
1663 machine_is_compatible("PowerBook6,3")) {
1664 struct device_node *ui2c = of_find_node_by_type(NULL, "i2c");
1665 struct device_node *dt = of_find_node_by_name(NULL, "device-tree");
1666 u8 buffer[9];
1667 u32 *productID;
1668 int i, rc, changed = 0;
1669
1670 if (dt == NULL)
1671 break;
1672 productID = (u32 *)get_property(dt, "pid#", NULL);
1673 if (productID == NULL)
1674 break;
1675 while(ui2c) {
1676 struct device_node *p = of_get_parent(ui2c);
1677 if (p && !strcmp(p->name, "uni-n"))
1678 break;
1679 ui2c = of_find_node_by_type(ui2c, "i2c");
1680 }
1681 if (ui2c == NULL)
1682 break;
1683 DBG("Trying to bump clock speed for PID: %08x...\n", *productID);
1684 rc = pmac_low_i2c_open(ui2c, 1);
1685 if (rc != 0)
1686 break;
1687 pmac_low_i2c_setmode(ui2c, pmac_low_i2c_mode_combined);
1688 rc = pmac_low_i2c_xfer(ui2c, 0xd2 | pmac_low_i2c_read, 0x80, buffer, 9);
1689 DBG("read result: %d,", rc);
1690 if (rc != 0) {
1691 pmac_low_i2c_close(ui2c);
1692 break;
1693 }
1694 for (i=0; i<9; i++)
1695 DBG(" %02x", buffer[i]);
1696 DBG("\n");
1697
1698 switch(*productID) {
1699 case 0x1182: /* AlBook 12" rev 2 */
1700 case 0x1183: /* iBook G4 12" */
1701 buffer[0] = (buffer[0] & 0x8f) | 0x70;
1702 buffer[2] = (buffer[2] & 0x7f) | 0x00;
1703 buffer[5] = (buffer[5] & 0x80) | 0x31;
1704 buffer[6] = (buffer[6] & 0x40) | 0xb0;
1705 buffer[7] = (buffer[7] & 0x00) | (enable ? 0xc0 : 0xba);
1706 buffer[8] = (buffer[8] & 0x00) | 0x30;
1707 changed = 1;
1708 break;
1709 case 0x3142: /* AlBook 15" (ATI M10) */
1710 case 0x3143: /* AlBook 17" (ATI M10) */
1711 buffer[0] = (buffer[0] & 0xaf) | 0x50;
1712 buffer[2] = (buffer[2] & 0x7f) | 0x00;
1713 buffer[5] = (buffer[5] & 0x80) | 0x31;
1714 buffer[6] = (buffer[6] & 0x40) | 0xb0;
1715 buffer[7] = (buffer[7] & 0x00) | (enable ? 0xd0 : 0xc0);
1716 buffer[8] = (buffer[8] & 0x00) | 0x30;
1717 changed = 1;
1718 break;
1719 default:
1720 DBG("i2c-hwclock: Machine model not handled\n");
1721 break;
1722 }
1723 if (!changed) {
1724 pmac_low_i2c_close(ui2c);
1725 break;
1726 }
1727 pmac_low_i2c_setmode(ui2c, pmac_low_i2c_mode_stdsub);
1728 rc = pmac_low_i2c_xfer(ui2c, 0xd2 | pmac_low_i2c_write, 0x80, buffer, 9);
1729 DBG("write result: %d,", rc);
1730 pmac_low_i2c_setmode(ui2c, pmac_low_i2c_mode_combined);
1731 rc = pmac_low_i2c_xfer(ui2c, 0xd2 | pmac_low_i2c_read, 0x80, buffer, 9);
1732 DBG("read result: %d,", rc);
1733 if (rc != 0) {
1734 pmac_low_i2c_close(ui2c);
1735 break;
1736 }
1737 for (i=0; i<9; i++)
1738 DBG(" %02x", buffer[i]);
1739 pmac_low_i2c_close(ui2c);
1740 break;
1741 }
1742}
1743
1744
1745static int
1746core99_sleep(void)
1747{
1748 struct macio_chip *macio;
1749 int i;
1750
1751 macio = &macio_chips[0];
1752 if (macio->type != macio_keylargo && macio->type != macio_pangea &&
1753 macio->type != macio_intrepid)
1754 return -ENODEV;
1755
1756 /* We power off the wireless slot in case it was not done
1757 * by the driver. We don't power it on automatically however
1758 */
1759 if (macio->flags & MACIO_FLAG_AIRPORT_ON)
1760 core99_airport_enable(macio->of_node, 0, 0);
1761
1762 /* We power off the FW cable. Should be done by the driver... */
1763 if (macio->flags & MACIO_FLAG_FW_SUPPORTED) {
1764 core99_firewire_enable(NULL, 0, 0);
1765 core99_firewire_cable_power(NULL, 0, 0);
1766 }
1767
1768 /* We make sure int. modem is off (in case driver lost it) */
1769 if (macio->type == macio_keylargo)
1770 core99_modem_enable(macio->of_node, 0, 0);
1771 else
1772 pangea_modem_enable(macio->of_node, 0, 0);
1773
1774 /* We make sure the sound is off as well */
1775 core99_sound_chip_enable(macio->of_node, 0, 0);
1776
1777 /*
1778 * Save various bits of KeyLargo
1779 */
1780
1781 /* Save the state of the various GPIOs */
1782 save_gpio_levels[0] = MACIO_IN32(KEYLARGO_GPIO_LEVELS0);
1783 save_gpio_levels[1] = MACIO_IN32(KEYLARGO_GPIO_LEVELS1);
1784 for (i=0; i<KEYLARGO_GPIO_EXTINT_CNT; i++)
1785 save_gpio_extint[i] = MACIO_IN8(KEYLARGO_GPIO_EXTINT_0+i);
1786 for (i=0; i<KEYLARGO_GPIO_CNT; i++)
1787 save_gpio_normal[i] = MACIO_IN8(KEYLARGO_GPIO_0+i);
1788
1789 /* Save the FCRs */
1790 if (macio->type == macio_keylargo)
1791 save_mbcr = MACIO_IN32(KEYLARGO_MBCR);
1792 save_fcr[0] = MACIO_IN32(KEYLARGO_FCR0);
1793 save_fcr[1] = MACIO_IN32(KEYLARGO_FCR1);
1794 save_fcr[2] = MACIO_IN32(KEYLARGO_FCR2);
1795 save_fcr[3] = MACIO_IN32(KEYLARGO_FCR3);
1796 save_fcr[4] = MACIO_IN32(KEYLARGO_FCR4);
1797 if (macio->type == macio_pangea || macio->type == macio_intrepid)
1798 save_fcr[5] = MACIO_IN32(KEYLARGO_FCR5);
1799
1800 /* Save state & config of DBDMA channels */
1801 dbdma_save(macio, save_dbdma);
1802
1803 /*
1804 * Turn off as much as we can
1805 */
1806 if (macio->type == macio_pangea)
1807 pangea_shutdown(macio, 1);
1808 else if (macio->type == macio_intrepid)
1809 intrepid_shutdown(macio, 1);
1810 else if (macio->type == macio_keylargo)
1811 keylargo_shutdown(macio, 1);
1812
1813 /*
1814 * Put the host bridge to sleep
1815 */
1816
1817 save_unin_clock_ctl = UN_IN(UNI_N_CLOCK_CNTL);
1818 /* Note: do not switch GMAC off, driver does it when necessary, WOL must keep it
1819 * enabled !
1820 */
1821 UN_OUT(UNI_N_CLOCK_CNTL, save_unin_clock_ctl &
1822 ~(/*UNI_N_CLOCK_CNTL_GMAC|*/UNI_N_CLOCK_CNTL_FW/*|UNI_N_CLOCK_CNTL_PCI*/));
1823 udelay(100);
1824 UN_OUT(UNI_N_HWINIT_STATE, UNI_N_HWINIT_STATE_SLEEPING);
1825 UN_OUT(UNI_N_POWER_MGT, UNI_N_POWER_MGT_SLEEP);
1826 mdelay(10);
1827
1828 /*
1829 * FIXME: A bit of black magic with OpenPIC (don't ask me why)
1830 */
1831 if (pmac_mb.model_id == PMAC_TYPE_SAWTOOTH) {
1832 MACIO_BIS(0x506e0, 0x00400000);
1833 MACIO_BIS(0x506e0, 0x80000000);
1834 }
1835 return 0;
1836}
1837
1838static int
1839core99_wake_up(void)
1840{
1841 struct macio_chip *macio;
1842 int i;
1843
1844 macio = &macio_chips[0];
1845 if (macio->type != macio_keylargo && macio->type != macio_pangea &&
1846 macio->type != macio_intrepid)
1847 return -ENODEV;
1848
1849 /*
1850 * Wakeup the host bridge
1851 */
1852 UN_OUT(UNI_N_POWER_MGT, UNI_N_POWER_MGT_NORMAL);
1853 udelay(10);
1854 UN_OUT(UNI_N_HWINIT_STATE, UNI_N_HWINIT_STATE_RUNNING);
1855 udelay(10);
1856
1857 /*
1858 * Restore KeyLargo
1859 */
1860
1861 if (macio->type == macio_keylargo) {
1862 MACIO_OUT32(KEYLARGO_MBCR, save_mbcr);
1863 (void)MACIO_IN32(KEYLARGO_MBCR); udelay(10);
1864 }
1865 MACIO_OUT32(KEYLARGO_FCR0, save_fcr[0]);
1866 (void)MACIO_IN32(KEYLARGO_FCR0); udelay(10);
1867 MACIO_OUT32(KEYLARGO_FCR1, save_fcr[1]);
1868 (void)MACIO_IN32(KEYLARGO_FCR1); udelay(10);
1869 MACIO_OUT32(KEYLARGO_FCR2, save_fcr[2]);
1870 (void)MACIO_IN32(KEYLARGO_FCR2); udelay(10);
1871 MACIO_OUT32(KEYLARGO_FCR3, save_fcr[3]);
1872 (void)MACIO_IN32(KEYLARGO_FCR3); udelay(10);
1873 MACIO_OUT32(KEYLARGO_FCR4, save_fcr[4]);
1874 (void)MACIO_IN32(KEYLARGO_FCR4); udelay(10);
1875 if (macio->type == macio_pangea || macio->type == macio_intrepid) {
1876 MACIO_OUT32(KEYLARGO_FCR5, save_fcr[5]);
1877 (void)MACIO_IN32(KEYLARGO_FCR5); udelay(10);
1878 }
1879
1880 dbdma_restore(macio, save_dbdma);
1881
1882 MACIO_OUT32(KEYLARGO_GPIO_LEVELS0, save_gpio_levels[0]);
1883 MACIO_OUT32(KEYLARGO_GPIO_LEVELS1, save_gpio_levels[1]);
1884 for (i=0; i<KEYLARGO_GPIO_EXTINT_CNT; i++)
1885 MACIO_OUT8(KEYLARGO_GPIO_EXTINT_0+i, save_gpio_extint[i]);
1886 for (i=0; i<KEYLARGO_GPIO_CNT; i++)
1887 MACIO_OUT8(KEYLARGO_GPIO_0+i, save_gpio_normal[i]);
1888
1889 /* FIXME more black magic with OpenPIC ... */
1890 if (pmac_mb.model_id == PMAC_TYPE_SAWTOOTH) {
1891 MACIO_BIC(0x506e0, 0x00400000);
1892 MACIO_BIC(0x506e0, 0x80000000);
1893 }
1894
1895 UN_OUT(UNI_N_CLOCK_CNTL, save_unin_clock_ctl);
1896 udelay(100);
1897
1898 return 0;
1899}
1900
1901static long
1902core99_sleep_state(struct device_node *node, long param, long value)
1903{
1904 /* Param == 1 means to enter the "fake sleep" mode that is
1905 * used for CPU speed switch
1906 */
1907 if (param == 1) {
1908 if (value == 1) {
1909 UN_OUT(UNI_N_HWINIT_STATE, UNI_N_HWINIT_STATE_SLEEPING);
1910 UN_OUT(UNI_N_POWER_MGT, UNI_N_POWER_MGT_IDLE2);
1911 } else {
1912 UN_OUT(UNI_N_POWER_MGT, UNI_N_POWER_MGT_NORMAL);
1913 udelay(10);
1914 UN_OUT(UNI_N_HWINIT_STATE, UNI_N_HWINIT_STATE_RUNNING);
1915 udelay(10);
1916 }
1917 return 0;
1918 }
1919 if ((pmac_mb.board_flags & PMAC_MB_CAN_SLEEP) == 0)
1920 return -EPERM;
1921
1922 if (value == 1)
1923 return core99_sleep();
1924 else if (value == 0)
1925 return core99_wake_up();
1926 return 0;
1927}
1928
1929#endif /* CONFIG_POWER4 */
1930
1931static long
1932generic_dev_can_wake(struct device_node *node, long param, long value)
1933{
1934 /* Todo: eventually check we are really dealing with on-board
1935 * video device ...
1936 */
1937
1938 if (pmac_mb.board_flags & PMAC_MB_MAY_SLEEP)
1939 pmac_mb.board_flags |= PMAC_MB_CAN_SLEEP;
1940 return 0;
1941}
1942
1943static long generic_get_mb_info(struct device_node *node, long param, long value)
1944{
1945 switch(param) {
1946 case PMAC_MB_INFO_MODEL:
1947 return pmac_mb.model_id;
1948 case PMAC_MB_INFO_FLAGS:
1949 return pmac_mb.board_flags;
1950 case PMAC_MB_INFO_NAME:
1951 /* hack hack hack... but should work */
1952 *((const char **)value) = pmac_mb.model_name;
1953 return 0;
1954 }
1955 return -EINVAL;
1956}
1957
1958
1959/*
1960 * Table definitions
1961 */
1962
1963/* Used on any machine
1964 */
1965static struct feature_table_entry any_features[] = {
1966 { PMAC_FTR_GET_MB_INFO, generic_get_mb_info },
1967 { PMAC_FTR_DEVICE_CAN_WAKE, generic_dev_can_wake },
1968 { 0, NULL }
1969};
1970
1971#ifndef CONFIG_POWER4
1972
1973/* OHare based motherboards. Currently, we only use these on the
1974 * 2400,3400 and 3500 series powerbooks. Some older desktops seem
1975 * to have issues with turning on/off those asic cells
1976 */
1977static struct feature_table_entry ohare_features[] = {
1978 { PMAC_FTR_SCC_ENABLE, ohare_htw_scc_enable },
1979 { PMAC_FTR_SWIM3_ENABLE, ohare_floppy_enable },
1980 { PMAC_FTR_MESH_ENABLE, ohare_mesh_enable },
1981 { PMAC_FTR_IDE_ENABLE, ohare_ide_enable},
1982 { PMAC_FTR_IDE_RESET, ohare_ide_reset},
1983 { PMAC_FTR_SLEEP_STATE, ohare_sleep_state },
1984 { 0, NULL }
1985};
1986
1987/* Heathrow desktop machines (Beige G3).
1988 * Separated as some features couldn't be properly tested
1989 * and the serial port control bits appear to confuse it.
1990 */
1991static struct feature_table_entry heathrow_desktop_features[] = {
1992 { PMAC_FTR_SWIM3_ENABLE, heathrow_floppy_enable },
1993 { PMAC_FTR_MESH_ENABLE, heathrow_mesh_enable },
1994 { PMAC_FTR_IDE_ENABLE, heathrow_ide_enable },
1995 { PMAC_FTR_IDE_RESET, heathrow_ide_reset },
1996 { PMAC_FTR_BMAC_ENABLE, heathrow_bmac_enable },
1997 { 0, NULL }
1998};
1999
2000/* Heathrow based laptop, that is the Wallstreet and mainstreet
2001 * powerbooks.
2002 */
2003static struct feature_table_entry heathrow_laptop_features[] = {
2004 { PMAC_FTR_SCC_ENABLE, ohare_htw_scc_enable },
2005 { PMAC_FTR_MODEM_ENABLE, heathrow_modem_enable },
2006 { PMAC_FTR_SWIM3_ENABLE, heathrow_floppy_enable },
2007 { PMAC_FTR_MESH_ENABLE, heathrow_mesh_enable },
2008 { PMAC_FTR_IDE_ENABLE, heathrow_ide_enable },
2009 { PMAC_FTR_IDE_RESET, heathrow_ide_reset },
2010 { PMAC_FTR_BMAC_ENABLE, heathrow_bmac_enable },
2011 { PMAC_FTR_SOUND_CHIP_ENABLE, heathrow_sound_enable },
2012 { PMAC_FTR_SLEEP_STATE, heathrow_sleep_state },
2013 { 0, NULL }
2014};
2015
2016/* Paddington based machines
2017 * The lombard (101) powerbook, first iMac models, B&W G3 and Yikes G4.
2018 */
2019static struct feature_table_entry paddington_features[] = {
2020 { PMAC_FTR_SCC_ENABLE, ohare_htw_scc_enable },
2021 { PMAC_FTR_MODEM_ENABLE, heathrow_modem_enable },
2022 { PMAC_FTR_SWIM3_ENABLE, heathrow_floppy_enable },
2023 { PMAC_FTR_MESH_ENABLE, heathrow_mesh_enable },
2024 { PMAC_FTR_IDE_ENABLE, heathrow_ide_enable },
2025 { PMAC_FTR_IDE_RESET, heathrow_ide_reset },
2026 { PMAC_FTR_BMAC_ENABLE, heathrow_bmac_enable },
2027 { PMAC_FTR_SOUND_CHIP_ENABLE, heathrow_sound_enable },
2028 { PMAC_FTR_SLEEP_STATE, heathrow_sleep_state },
2029 { 0, NULL }
2030};
2031
2032/* Core99 & MacRISC 2 machines (all machines released since the
2033 * iBook (included), that is all AGP machines, except pangea
2034 * chipset. The pangea chipset is the "combo" UniNorth/KeyLargo
2035 * used on iBook2 & iMac "flow power".
2036 */
2037static struct feature_table_entry core99_features[] = {
2038 { PMAC_FTR_SCC_ENABLE, core99_scc_enable },
2039 { PMAC_FTR_MODEM_ENABLE, core99_modem_enable },
2040 { PMAC_FTR_IDE_ENABLE, core99_ide_enable },
2041 { PMAC_FTR_IDE_RESET, core99_ide_reset },
2042 { PMAC_FTR_GMAC_ENABLE, core99_gmac_enable },
2043 { PMAC_FTR_GMAC_PHY_RESET, core99_gmac_phy_reset },
2044 { PMAC_FTR_SOUND_CHIP_ENABLE, core99_sound_chip_enable },
2045 { PMAC_FTR_AIRPORT_ENABLE, core99_airport_enable },
2046 { PMAC_FTR_USB_ENABLE, core99_usb_enable },
2047 { PMAC_FTR_1394_ENABLE, core99_firewire_enable },
2048 { PMAC_FTR_1394_CABLE_POWER, core99_firewire_cable_power },
2049 { PMAC_FTR_SLEEP_STATE, core99_sleep_state },
2050#ifdef CONFIG_SMP
2051 { PMAC_FTR_RESET_CPU, core99_reset_cpu },
2052#endif /* CONFIG_SMP */
2053 { PMAC_FTR_READ_GPIO, core99_read_gpio },
2054 { PMAC_FTR_WRITE_GPIO, core99_write_gpio },
2055 { 0, NULL }
2056};
2057
2058/* RackMac
2059 */
2060static struct feature_table_entry rackmac_features[] = {
2061 { PMAC_FTR_SCC_ENABLE, core99_scc_enable },
2062 { PMAC_FTR_IDE_ENABLE, core99_ide_enable },
2063 { PMAC_FTR_IDE_RESET, core99_ide_reset },
2064 { PMAC_FTR_GMAC_ENABLE, core99_gmac_enable },
2065 { PMAC_FTR_GMAC_PHY_RESET, core99_gmac_phy_reset },
2066 { PMAC_FTR_USB_ENABLE, core99_usb_enable },
2067 { PMAC_FTR_1394_ENABLE, core99_firewire_enable },
2068 { PMAC_FTR_1394_CABLE_POWER, core99_firewire_cable_power },
2069 { PMAC_FTR_SLEEP_STATE, core99_sleep_state },
2070#ifdef CONFIG_SMP
2071 { PMAC_FTR_RESET_CPU, core99_reset_cpu },
2072#endif /* CONFIG_SMP */
2073 { PMAC_FTR_READ_GPIO, core99_read_gpio },
2074 { PMAC_FTR_WRITE_GPIO, core99_write_gpio },
2075 { 0, NULL }
2076};
2077
2078/* Pangea features
2079 */
2080static struct feature_table_entry pangea_features[] = {
2081 { PMAC_FTR_SCC_ENABLE, core99_scc_enable },
2082 { PMAC_FTR_MODEM_ENABLE, pangea_modem_enable },
2083 { PMAC_FTR_IDE_ENABLE, core99_ide_enable },
2084 { PMAC_FTR_IDE_RESET, core99_ide_reset },
2085 { PMAC_FTR_GMAC_ENABLE, core99_gmac_enable },
2086 { PMAC_FTR_GMAC_PHY_RESET, core99_gmac_phy_reset },
2087 { PMAC_FTR_SOUND_CHIP_ENABLE, core99_sound_chip_enable },
2088 { PMAC_FTR_AIRPORT_ENABLE, core99_airport_enable },
2089 { PMAC_FTR_USB_ENABLE, core99_usb_enable },
2090 { PMAC_FTR_1394_ENABLE, core99_firewire_enable },
2091 { PMAC_FTR_1394_CABLE_POWER, core99_firewire_cable_power },
2092 { PMAC_FTR_SLEEP_STATE, core99_sleep_state },
2093 { PMAC_FTR_READ_GPIO, core99_read_gpio },
2094 { PMAC_FTR_WRITE_GPIO, core99_write_gpio },
2095 { 0, NULL }
2096};
2097
2098/* Intrepid features
2099 */
2100static struct feature_table_entry intrepid_features[] = {
2101 { PMAC_FTR_SCC_ENABLE, core99_scc_enable },
2102 { PMAC_FTR_MODEM_ENABLE, pangea_modem_enable },
2103 { PMAC_FTR_IDE_ENABLE, core99_ide_enable },
2104 { PMAC_FTR_IDE_RESET, core99_ide_reset },
2105 { PMAC_FTR_GMAC_ENABLE, core99_gmac_enable },
2106 { PMAC_FTR_GMAC_PHY_RESET, core99_gmac_phy_reset },
2107 { PMAC_FTR_SOUND_CHIP_ENABLE, core99_sound_chip_enable },
2108 { PMAC_FTR_AIRPORT_ENABLE, core99_airport_enable },
2109 { PMAC_FTR_USB_ENABLE, core99_usb_enable },
2110 { PMAC_FTR_1394_ENABLE, core99_firewire_enable },
2111 { PMAC_FTR_1394_CABLE_POWER, core99_firewire_cable_power },
2112 { PMAC_FTR_SLEEP_STATE, core99_sleep_state },
2113 { PMAC_FTR_READ_GPIO, core99_read_gpio },
2114 { PMAC_FTR_WRITE_GPIO, core99_write_gpio },
2115 { PMAC_FTR_AACK_DELAY_ENABLE, intrepid_aack_delay_enable },
2116 { 0, NULL }
2117};
2118
2119#else /* CONFIG_POWER4 */
2120
2121/* G5 features
2122 */
2123static struct feature_table_entry g5_features[] = {
2124 { PMAC_FTR_GMAC_ENABLE, g5_gmac_enable },
2125 { PMAC_FTR_1394_ENABLE, g5_fw_enable },
2126 { PMAC_FTR_ENABLE_MPIC, g5_mpic_enable },
2127 { PMAC_FTR_GMAC_PHY_RESET, g5_eth_phy_reset },
2128 { PMAC_FTR_SOUND_CHIP_ENABLE, g5_i2s_enable },
2129#ifdef CONFIG_SMP
2130 { PMAC_FTR_RESET_CPU, g5_reset_cpu },
2131#endif /* CONFIG_SMP */
2132 { PMAC_FTR_READ_GPIO, core99_read_gpio },
2133 { PMAC_FTR_WRITE_GPIO, core99_write_gpio },
2134 { 0, NULL }
2135};
2136
2137#endif /* CONFIG_POWER4 */
2138
2139static struct pmac_mb_def pmac_mb_defs[] = {
2140#ifndef CONFIG_POWER4
2141 /*
2142 * Desktops
2143 */
2144
2145 { "AAPL,8500", "PowerMac 8500/8600",
2146 PMAC_TYPE_PSURGE, NULL,
2147 0
2148 },
2149 { "AAPL,9500", "PowerMac 9500/9600",
2150 PMAC_TYPE_PSURGE, NULL,
2151 0
2152 },
2153 { "AAPL,7200", "PowerMac 7200",
2154 PMAC_TYPE_PSURGE, NULL,
2155 0
2156 },
2157 { "AAPL,7300", "PowerMac 7200/7300",
2158 PMAC_TYPE_PSURGE, NULL,
2159 0
2160 },
2161 { "AAPL,7500", "PowerMac 7500",
2162 PMAC_TYPE_PSURGE, NULL,
2163 0
2164 },
2165 { "AAPL,ShinerESB", "Apple Network Server",
2166 PMAC_TYPE_ANS, NULL,
2167 0
2168 },
2169 { "AAPL,e407", "Alchemy",
2170 PMAC_TYPE_ALCHEMY, NULL,
2171 0
2172 },
2173 { "AAPL,e411", "Gazelle",
2174 PMAC_TYPE_GAZELLE, NULL,
2175 0
2176 },
2177 { "AAPL,Gossamer", "PowerMac G3 (Gossamer)",
2178 PMAC_TYPE_GOSSAMER, heathrow_desktop_features,
2179 0
2180 },
2181 { "AAPL,PowerMac G3", "PowerMac G3 (Silk)",
2182 PMAC_TYPE_SILK, heathrow_desktop_features,
2183 0
2184 },
2185 { "PowerMac1,1", "Blue&White G3",
2186 PMAC_TYPE_YOSEMITE, paddington_features,
2187 0
2188 },
2189 { "PowerMac1,2", "PowerMac G4 PCI Graphics",
2190 PMAC_TYPE_YIKES, paddington_features,
2191 0
2192 },
2193 { "PowerMac2,1", "iMac FireWire",
2194 PMAC_TYPE_FW_IMAC, core99_features,
2195 PMAC_MB_MAY_SLEEP | PMAC_MB_OLD_CORE99
2196 },
2197 { "PowerMac2,2", "iMac FireWire",
2198 PMAC_TYPE_FW_IMAC, core99_features,
2199 PMAC_MB_MAY_SLEEP | PMAC_MB_OLD_CORE99
2200 },
2201 { "PowerMac3,1", "PowerMac G4 AGP Graphics",
2202 PMAC_TYPE_SAWTOOTH, core99_features,
2203 PMAC_MB_OLD_CORE99
2204 },
2205 { "PowerMac3,2", "PowerMac G4 AGP Graphics",
2206 PMAC_TYPE_SAWTOOTH, core99_features,
2207 PMAC_MB_MAY_SLEEP | PMAC_MB_OLD_CORE99
2208 },
2209 { "PowerMac3,3", "PowerMac G4 AGP Graphics",
2210 PMAC_TYPE_SAWTOOTH, core99_features,
2211 PMAC_MB_MAY_SLEEP | PMAC_MB_OLD_CORE99
2212 },
2213 { "PowerMac3,4", "PowerMac G4 Silver",
2214 PMAC_TYPE_QUICKSILVER, core99_features,
2215 PMAC_MB_MAY_SLEEP
2216 },
2217 { "PowerMac3,5", "PowerMac G4 Silver",
2218 PMAC_TYPE_QUICKSILVER, core99_features,
2219 PMAC_MB_MAY_SLEEP
2220 },
2221 { "PowerMac3,6", "PowerMac G4 Windtunnel",
2222 PMAC_TYPE_WINDTUNNEL, core99_features,
2223 PMAC_MB_MAY_SLEEP,
2224 },
2225 { "PowerMac4,1", "iMac \"Flower Power\"",
2226 PMAC_TYPE_PANGEA_IMAC, pangea_features,
2227 PMAC_MB_MAY_SLEEP
2228 },
2229 { "PowerMac4,2", "Flat panel iMac",
2230 PMAC_TYPE_FLAT_PANEL_IMAC, pangea_features,
2231 PMAC_MB_CAN_SLEEP
2232 },
2233 { "PowerMac4,4", "eMac",
2234 PMAC_TYPE_EMAC, core99_features,
2235 PMAC_MB_MAY_SLEEP
2236 },
2237 { "PowerMac5,1", "PowerMac G4 Cube",
2238 PMAC_TYPE_CUBE, core99_features,
2239 PMAC_MB_MAY_SLEEP | PMAC_MB_OLD_CORE99
2240 },
2241 { "PowerMac6,1", "Flat panel iMac",
2242 PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
2243 PMAC_MB_MAY_SLEEP,
2244 },
2245 { "PowerMac6,3", "Flat panel iMac",
2246 PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
2247 PMAC_MB_MAY_SLEEP,
2248 },
2249 { "PowerMac6,4", "eMac",
2250 PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
2251 PMAC_MB_MAY_SLEEP,
2252 },
2253 { "PowerMac10,1", "Mac mini",
2254 PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
2255 PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER,
2256 },
2257 { "iMac,1", "iMac (first generation)",
2258 PMAC_TYPE_ORIG_IMAC, paddington_features,
2259 0
2260 },
2261
2262 /*
2263 * Xserve's
2264 */
2265
2266 { "RackMac1,1", "XServe",
2267 PMAC_TYPE_RACKMAC, rackmac_features,
2268 0,
2269 },
2270 { "RackMac1,2", "XServe rev. 2",
2271 PMAC_TYPE_RACKMAC, rackmac_features,
2272 0,
2273 },
2274
2275 /*
2276 * Laptops
2277 */
2278
2279 { "AAPL,3400/2400", "PowerBook 3400",
2280 PMAC_TYPE_HOOPER, ohare_features,
2281 PMAC_MB_CAN_SLEEP | PMAC_MB_MOBILE
2282 },
2283 { "AAPL,3500", "PowerBook 3500",
2284 PMAC_TYPE_KANGA, ohare_features,
2285 PMAC_MB_CAN_SLEEP | PMAC_MB_MOBILE
2286 },
2287 { "AAPL,PowerBook1998", "PowerBook Wallstreet",
2288 PMAC_TYPE_WALLSTREET, heathrow_laptop_features,
2289 PMAC_MB_CAN_SLEEP | PMAC_MB_MOBILE
2290 },
2291 { "PowerBook1,1", "PowerBook 101 (Lombard)",
2292 PMAC_TYPE_101_PBOOK, paddington_features,
2293 PMAC_MB_CAN_SLEEP | PMAC_MB_MOBILE
2294 },
2295 { "PowerBook2,1", "iBook (first generation)",
2296 PMAC_TYPE_ORIG_IBOOK, core99_features,
2297 PMAC_MB_CAN_SLEEP | PMAC_MB_OLD_CORE99 | PMAC_MB_MOBILE
2298 },
2299 { "PowerBook2,2", "iBook FireWire",
2300 PMAC_TYPE_FW_IBOOK, core99_features,
2301 PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER |
2302 PMAC_MB_OLD_CORE99 | PMAC_MB_MOBILE
2303 },
2304 { "PowerBook3,1", "PowerBook Pismo",
2305 PMAC_TYPE_PISMO, core99_features,
2306 PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER |
2307 PMAC_MB_OLD_CORE99 | PMAC_MB_MOBILE
2308 },
2309 { "PowerBook3,2", "PowerBook Titanium",
2310 PMAC_TYPE_TITANIUM, core99_features,
2311 PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE
2312 },
2313 { "PowerBook3,3", "PowerBook Titanium II",
2314 PMAC_TYPE_TITANIUM2, core99_features,
2315 PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE
2316 },
2317 { "PowerBook3,4", "PowerBook Titanium III",
2318 PMAC_TYPE_TITANIUM3, core99_features,
2319 PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE
2320 },
2321 { "PowerBook3,5", "PowerBook Titanium IV",
2322 PMAC_TYPE_TITANIUM4, core99_features,
2323 PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE
2324 },
2325 { "PowerBook4,1", "iBook 2",
2326 PMAC_TYPE_IBOOK2, pangea_features,
2327 PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE
2328 },
2329 { "PowerBook4,2", "iBook 2",
2330 PMAC_TYPE_IBOOK2, pangea_features,
2331 PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE
2332 },
2333 { "PowerBook4,3", "iBook 2 rev. 2",
2334 PMAC_TYPE_IBOOK2, pangea_features,
2335 PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE
2336 },
2337 { "PowerBook5,1", "PowerBook G4 17\"",
2338 PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
2339 PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
2340 },
2341 { "PowerBook5,2", "PowerBook G4 15\"",
2342 PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
2343 PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
2344 },
2345 { "PowerBook5,3", "PowerBook G4 17\"",
2346 PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
2347 PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
2348 },
2349 { "PowerBook5,4", "PowerBook G4 15\"",
2350 PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
2351 PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
2352 },
2353 { "PowerBook5,5", "PowerBook G4 17\"",
2354 PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
2355 PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
2356 },
2357 { "PowerBook5,6", "PowerBook G4 15\"",
2358 PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
2359 PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
2360 },
2361 { "PowerBook5,7", "PowerBook G4 17\"",
2362 PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
2363 PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
2364 },
2365 { "PowerBook6,1", "PowerBook G4 12\"",
2366 PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
2367 PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
2368 },
2369 { "PowerBook6,2", "PowerBook G4",
2370 PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
2371 PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
2372 },
2373 { "PowerBook6,3", "iBook G4",
2374 PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
2375 PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
2376 },
2377 { "PowerBook6,4", "PowerBook G4 12\"",
2378 PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
2379 PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
2380 },
2381 { "PowerBook6,5", "iBook G4",
2382 PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
2383 PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
2384 },
2385 { "PowerBook6,7", "iBook G4",
2386 PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
2387 PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
2388 },
2389 { "PowerBook6,8", "PowerBook G4 12\"",
2390 PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
2391 PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
2392 },
2393#else /* CONFIG_POWER4 */
2394 { "PowerMac7,2", "PowerMac G5",
2395 PMAC_TYPE_POWERMAC_G5, g5_features,
2396 0,
2397 },
2398#ifdef CONFIG_PPC64
2399 { "PowerMac7,3", "PowerMac G5",
2400 PMAC_TYPE_POWERMAC_G5, g5_features,
2401 0,
2402 },
2403 { "PowerMac8,1", "iMac G5",
2404 PMAC_TYPE_IMAC_G5, g5_features,
2405 0,
2406 },
2407 { "PowerMac9,1", "PowerMac G5",
2408 PMAC_TYPE_POWERMAC_G5_U3L, g5_features,
2409 0,
2410 },
2411 { "RackMac3,1", "XServe G5",
2412 PMAC_TYPE_XSERVE_G5, g5_features,
2413 0,
2414 },
2415#endif /* CONFIG_PPC64 */
2416#endif /* CONFIG_POWER4 */
2417};
2418
2419/*
2420 * The toplevel feature_call callback
2421 */
2422long pmac_do_feature_call(unsigned int selector, ...)
2423{
2424 struct device_node *node;
2425 long param, value;
2426 int i;
2427 feature_call func = NULL;
2428 va_list args;
2429
2430 if (pmac_mb.features)
2431 for (i=0; pmac_mb.features[i].function; i++)
2432 if (pmac_mb.features[i].selector == selector) {
2433 func = pmac_mb.features[i].function;
2434 break;
2435 }
2436 if (!func)
2437 for (i=0; any_features[i].function; i++)
2438 if (any_features[i].selector == selector) {
2439 func = any_features[i].function;
2440 break;
2441 }
2442 if (!func)
2443 return -ENODEV;
2444
2445 va_start(args, selector);
2446 node = (struct device_node*)va_arg(args, void*);
2447 param = va_arg(args, long);
2448 value = va_arg(args, long);
2449 va_end(args);
2450
2451 return func(node, param, value);
2452}
2453
2454static int __init probe_motherboard(void)
2455{
2456 int i;
2457 struct macio_chip *macio = &macio_chips[0];
2458 const char *model = NULL;
2459 struct device_node *dt;
2460
2461 /* Lookup known motherboard type in device-tree. First try an
2462 * exact match on the "model" property, then try a "compatible"
2463 * match is none is found.
2464 */
2465 dt = find_devices("device-tree");
2466 if (dt != NULL)
2467 model = (const char *) get_property(dt, "model", NULL);
2468 for(i=0; model && i<(sizeof(pmac_mb_defs)/sizeof(struct pmac_mb_def)); i++) {
2469 if (strcmp(model, pmac_mb_defs[i].model_string) == 0) {
2470 pmac_mb = pmac_mb_defs[i];
2471 goto found;
2472 }
2473 }
2474 for(i=0; i<(sizeof(pmac_mb_defs)/sizeof(struct pmac_mb_def)); i++) {
2475 if (machine_is_compatible(pmac_mb_defs[i].model_string)) {
2476 pmac_mb = pmac_mb_defs[i];
2477 goto found;
2478 }
2479 }
2480
2481 /* Fallback to selection depending on mac-io chip type */
2482 switch(macio->type) {
2483#ifndef CONFIG_POWER4
2484 case macio_grand_central:
2485 pmac_mb.model_id = PMAC_TYPE_PSURGE;
2486 pmac_mb.model_name = "Unknown PowerSurge";
2487 break;
2488 case macio_ohare:
2489 pmac_mb.model_id = PMAC_TYPE_UNKNOWN_OHARE;
2490 pmac_mb.model_name = "Unknown OHare-based";
2491 break;
2492 case macio_heathrow:
2493 pmac_mb.model_id = PMAC_TYPE_UNKNOWN_HEATHROW;
2494 pmac_mb.model_name = "Unknown Heathrow-based";
2495 pmac_mb.features = heathrow_desktop_features;
2496 break;
2497 case macio_paddington:
2498 pmac_mb.model_id = PMAC_TYPE_UNKNOWN_PADDINGTON;
2499 pmac_mb.model_name = "Unknown Paddington-based";
2500 pmac_mb.features = paddington_features;
2501 break;
2502 case macio_keylargo:
2503 pmac_mb.model_id = PMAC_TYPE_UNKNOWN_CORE99;
2504 pmac_mb.model_name = "Unknown Keylargo-based";
2505 pmac_mb.features = core99_features;
2506 break;
2507 case macio_pangea:
2508 pmac_mb.model_id = PMAC_TYPE_UNKNOWN_PANGEA;
2509 pmac_mb.model_name = "Unknown Pangea-based";
2510 pmac_mb.features = pangea_features;
2511 break;
2512 case macio_intrepid:
2513 pmac_mb.model_id = PMAC_TYPE_UNKNOWN_INTREPID;
2514 pmac_mb.model_name = "Unknown Intrepid-based";
2515 pmac_mb.features = intrepid_features;
2516 break;
2517#else /* CONFIG_POWER4 */
2518 case macio_keylargo2:
2519 pmac_mb.model_id = PMAC_TYPE_UNKNOWN_K2;
2520 pmac_mb.model_name = "Unknown K2-based";
2521 pmac_mb.features = g5_features;
2522 break;
2523#endif /* CONFIG_POWER4 */
2524 default:
2525 return -ENODEV;
2526 }
2527found:
2528#ifndef CONFIG_POWER4
2529 /* Fixup Hooper vs. Comet */
2530 if (pmac_mb.model_id == PMAC_TYPE_HOOPER) {
2531 u32 __iomem * mach_id_ptr = ioremap(0xf3000034, 4);
2532 if (!mach_id_ptr)
2533 return -ENODEV;
2534 /* Here, I used to disable the media-bay on comet. It
2535 * appears this is wrong, the floppy connector is actually
2536 * a kind of media-bay and works with the current driver.
2537 */
2538 if (__raw_readl(mach_id_ptr) & 0x20000000UL)
2539 pmac_mb.model_id = PMAC_TYPE_COMET;
2540 iounmap(mach_id_ptr);
2541 }
2542#endif /* CONFIG_POWER4 */
2543
2544#ifdef CONFIG_6xx
2545 /* Set default value of powersave_nap on machines that support it.
2546 * It appears that uninorth rev 3 has a problem with it, we don't
2547 * enable it on those. In theory, the flush-on-lock property is
2548 * supposed to be set when not supported, but I'm not very confident
2549 * that all Apple OF revs did it properly, I do it the paranoid way.
2550 */
2551 while (uninorth_base && uninorth_rev > 3) {
2552 struct device_node *np = find_path_device("/cpus");
2553 if (!np || !np->child) {
2554 printk(KERN_WARNING "Can't find CPU(s) in device tree !\n");
2555 break;
2556 }
2557 np = np->child;
2558 /* Nap mode not supported on SMP */
2559 if (np->sibling)
2560 break;
2561 /* Nap mode not supported if flush-on-lock property is present */
2562 if (get_property(np, "flush-on-lock", NULL))
2563 break;
2564 powersave_nap = 1;
2565 printk(KERN_INFO "Processor NAP mode on idle enabled.\n");
2566 break;
2567 }
2568
2569 /* On CPUs that support it (750FX), lowspeed by default during
2570 * NAP mode
2571 */
2572 powersave_lowspeed = 1;
2573#endif /* CONFIG_6xx */
2574#ifdef CONFIG_POWER4
2575 powersave_nap = 1;
2576#endif
2577 /* Check for "mobile" machine */
2578 if (model && (strncmp(model, "PowerBook", 9) == 0
2579 || strncmp(model, "iBook", 5) == 0))
2580 pmac_mb.board_flags |= PMAC_MB_MOBILE;
2581
2582
2583 printk(KERN_INFO "PowerMac motherboard: %s\n", pmac_mb.model_name);
2584 return 0;
2585}
2586
2587/* Initialize the Core99 UniNorth host bridge and memory controller
2588 */
2589static void __init probe_uninorth(void)
2590{
2591 unsigned long actrl;
2592
2593 /* Locate core99 Uni-N */
2594 uninorth_node = of_find_node_by_name(NULL, "uni-n");
2595 /* Locate G5 u3 */
2596 if (uninorth_node == NULL) {
2597 uninorth_node = of_find_node_by_name(NULL, "u3");
2598 uninorth_u3 = 1;
2599 }
2600 if (uninorth_node && uninorth_node->n_addrs > 0) {
2601 unsigned long address = uninorth_node->addrs[0].address;
2602 uninorth_base = ioremap(address, 0x40000);
2603 uninorth_rev = in_be32(UN_REG(UNI_N_VERSION));
2604 if (uninorth_u3)
2605 u3_ht = ioremap(address + U3_HT_CONFIG_BASE, 0x1000);
2606 } else
2607 uninorth_node = NULL;
2608
2609 if (!uninorth_node)
2610 return;
2611
2612 printk(KERN_INFO "Found %s memory controller & host bridge, revision: %d\n",
2613 uninorth_u3 ? "U3" : "UniNorth", uninorth_rev);
2614 printk(KERN_INFO "Mapped at 0x%08lx\n", (unsigned long)uninorth_base);
2615
2616 /* Set the arbitrer QAck delay according to what Apple does
2617 */
2618 if (uninorth_rev < 0x11) {
2619 actrl = UN_IN(UNI_N_ARB_CTRL) & ~UNI_N_ARB_CTRL_QACK_DELAY_MASK;
2620 actrl |= ((uninorth_rev < 3) ? UNI_N_ARB_CTRL_QACK_DELAY105 :
2621 UNI_N_ARB_CTRL_QACK_DELAY) << UNI_N_ARB_CTRL_QACK_DELAY_SHIFT;
2622 UN_OUT(UNI_N_ARB_CTRL, actrl);
2623 }
2624
2625 /* Some more magic as done by them in recent MacOS X on UniNorth
2626 * revs 1.5 to 2.O and Pangea. Seem to toggle the UniN Maxbus/PCI
2627 * memory timeout
2628 */
2629 if ((uninorth_rev >= 0x11 && uninorth_rev <= 0x24) || uninorth_rev == 0xc0)
2630 UN_OUT(0x2160, UN_IN(0x2160) & 0x00ffffff);
2631}
2632
2633static void __init probe_one_macio(const char *name, const char *compat, int type)
2634{
2635 struct device_node* node;
2636 int i;
2637 volatile u32 __iomem * base;
2638 u32* revp;
2639
2640 node = find_devices(name);
2641 if (!node || !node->n_addrs)
2642 return;
2643 if (compat)
2644 do {
2645 if (device_is_compatible(node, compat))
2646 break;
2647 node = node->next;
2648 } while (node);
2649 if (!node)
2650 return;
2651 for(i=0; i<MAX_MACIO_CHIPS; i++) {
2652 if (!macio_chips[i].of_node)
2653 break;
2654 if (macio_chips[i].of_node == node)
2655 return;
2656 }
2657 if (i >= MAX_MACIO_CHIPS) {
2658 printk(KERN_ERR "pmac_feature: Please increase MAX_MACIO_CHIPS !\n");
2659 printk(KERN_ERR "pmac_feature: %s skipped\n", node->full_name);
2660 return;
2661 }
2662 base = ioremap(node->addrs[0].address, node->addrs[0].size);
2663 if (!base) {
2664 printk(KERN_ERR "pmac_feature: Can't map mac-io chip !\n");
2665 return;
2666 }
2667 if (type == macio_keylargo) {
2668 u32 *did = (u32 *)get_property(node, "device-id", NULL);
2669 if (*did == 0x00000025)
2670 type = macio_pangea;
2671 if (*did == 0x0000003e)
2672 type = macio_intrepid;
2673 }
2674 macio_chips[i].of_node = node;
2675 macio_chips[i].type = type;
2676 macio_chips[i].base = base;
2677 macio_chips[i].flags = MACIO_FLAG_SCCB_ON | MACIO_FLAG_SCCB_ON;
2678 macio_chips[i].name = macio_names[type];
2679 revp = (u32 *)get_property(node, "revision-id", NULL);
2680 if (revp)
2681 macio_chips[i].rev = *revp;
2682 printk(KERN_INFO "Found a %s mac-io controller, rev: %d, mapped at 0x%p\n",
2683 macio_names[type], macio_chips[i].rev, macio_chips[i].base);
2684}
2685
2686static int __init
2687probe_macios(void)
2688{
2689 /* Warning, ordering is important */
2690 probe_one_macio("gc", NULL, macio_grand_central);
2691 probe_one_macio("ohare", NULL, macio_ohare);
2692 probe_one_macio("pci106b,7", NULL, macio_ohareII);
2693 probe_one_macio("mac-io", "keylargo", macio_keylargo);
2694 probe_one_macio("mac-io", "paddington", macio_paddington);
2695 probe_one_macio("mac-io", "gatwick", macio_gatwick);
2696 probe_one_macio("mac-io", "heathrow", macio_heathrow);
2697 probe_one_macio("mac-io", "K2-Keylargo", macio_keylargo2);
2698
2699 /* Make sure the "main" macio chip appear first */
2700 if (macio_chips[0].type == macio_gatwick
2701 && macio_chips[1].type == macio_heathrow) {
2702 struct macio_chip temp = macio_chips[0];
2703 macio_chips[0] = macio_chips[1];
2704 macio_chips[1] = temp;
2705 }
2706 if (macio_chips[0].type == macio_ohareII
2707 && macio_chips[1].type == macio_ohare) {
2708 struct macio_chip temp = macio_chips[0];
2709 macio_chips[0] = macio_chips[1];
2710 macio_chips[1] = temp;
2711 }
2712 macio_chips[0].lbus.index = 0;
2713 macio_chips[1].lbus.index = 1;
2714
2715 return (macio_chips[0].of_node == NULL) ? -ENODEV : 0;
2716}
2717
2718static void __init
2719initial_serial_shutdown(struct device_node *np)
2720{
2721 int len;
2722 struct slot_names_prop {
2723 int count;
2724 char name[1];
2725 } *slots;
2726 char *conn;
2727 int port_type = PMAC_SCC_ASYNC;
2728 int modem = 0;
2729
2730 slots = (struct slot_names_prop *)get_property(np, "slot-names", &len);
2731 conn = get_property(np, "AAPL,connector", &len);
2732 if (conn && (strcmp(conn, "infrared") == 0))
2733 port_type = PMAC_SCC_IRDA;
2734 else if (device_is_compatible(np, "cobalt"))
2735 modem = 1;
2736 else if (slots && slots->count > 0) {
2737 if (strcmp(slots->name, "IrDA") == 0)
2738 port_type = PMAC_SCC_IRDA;
2739 else if (strcmp(slots->name, "Modem") == 0)
2740 modem = 1;
2741 }
2742 if (modem)
2743 pmac_call_feature(PMAC_FTR_MODEM_ENABLE, np, 0, 0);
2744 pmac_call_feature(PMAC_FTR_SCC_ENABLE, np, port_type, 0);
2745}
2746
2747static void __init
2748set_initial_features(void)
2749{
2750 struct device_node *np;
2751
2752 /* That hack appears to be necessary for some StarMax motherboards
2753 * but I'm not too sure it was audited for side-effects on other
2754 * ohare based machines...
2755 * Since I still have difficulties figuring the right way to
2756 * differenciate them all and since that hack was there for a long
2757 * time, I'll keep it around
2758 */
2759 if (macio_chips[0].type == macio_ohare && !find_devices("via-pmu")) {
2760 struct macio_chip *macio = &macio_chips[0];
2761 MACIO_OUT32(OHARE_FCR, STARMAX_FEATURES);
2762 } else if (macio_chips[0].type == macio_ohare) {
2763 struct macio_chip *macio = &macio_chips[0];
2764 MACIO_BIS(OHARE_FCR, OH_IOBUS_ENABLE);
2765 } else if (macio_chips[1].type == macio_ohare) {
2766 struct macio_chip *macio = &macio_chips[1];
2767 MACIO_BIS(OHARE_FCR, OH_IOBUS_ENABLE);
2768 }
2769
2770#ifdef CONFIG_POWER4
2771 if (macio_chips[0].type == macio_keylargo2) {
2772#ifndef CONFIG_SMP
2773 /* On SMP machines running UP, we have the second CPU eating
2774 * bus cycles. We need to take it off the bus. This is done
2775 * from pmac_smp for SMP kernels running on one CPU
2776 */
2777 np = of_find_node_by_type(NULL, "cpu");
2778 if (np != NULL)
2779 np = of_find_node_by_type(np, "cpu");
2780 if (np != NULL) {
2781 g5_phy_disable_cpu1();
2782 of_node_put(np);
2783 }
2784#endif /* CONFIG_SMP */
2785 /* Enable GMAC for now for PCI probing. It will be disabled
2786 * later on after PCI probe
2787 */
2788 np = of_find_node_by_name(NULL, "ethernet");
2789 while(np) {
2790 if (device_is_compatible(np, "K2-GMAC"))
2791 g5_gmac_enable(np, 0, 1);
2792 np = of_find_node_by_name(np, "ethernet");
2793 }
2794
2795 /* Enable FW before PCI probe. Will be disabled later on
2796 * Note: We should have a batter way to check that we are
2797 * dealing with uninorth internal cell and not a PCI cell
2798 * on the external PCI. The code below works though.
2799 */
2800 np = of_find_node_by_name(NULL, "firewire");
2801 while(np) {
2802 if (device_is_compatible(np, "pci106b,5811")) {
2803 macio_chips[0].flags |= MACIO_FLAG_FW_SUPPORTED;
2804 g5_fw_enable(np, 0, 1);
2805 }
2806 np = of_find_node_by_name(np, "firewire");
2807 }
2808 }
2809#else /* CONFIG_POWER4 */
2810
2811 if (macio_chips[0].type == macio_keylargo ||
2812 macio_chips[0].type == macio_pangea ||
2813 macio_chips[0].type == macio_intrepid) {
2814 /* Enable GMAC for now for PCI probing. It will be disabled
2815 * later on after PCI probe
2816 */
2817 np = of_find_node_by_name(NULL, "ethernet");
2818 while(np) {
2819 if (np->parent
2820 && device_is_compatible(np->parent, "uni-north")
2821 && device_is_compatible(np, "gmac"))
2822 core99_gmac_enable(np, 0, 1);
2823 np = of_find_node_by_name(np, "ethernet");
2824 }
2825
2826 /* Enable FW before PCI probe. Will be disabled later on
2827 * Note: We should have a batter way to check that we are
2828 * dealing with uninorth internal cell and not a PCI cell
2829 * on the external PCI. The code below works though.
2830 */
2831 np = of_find_node_by_name(NULL, "firewire");
2832 while(np) {
2833 if (np->parent
2834 && device_is_compatible(np->parent, "uni-north")
2835 && (device_is_compatible(np, "pci106b,18") ||
2836 device_is_compatible(np, "pci106b,30") ||
2837 device_is_compatible(np, "pci11c1,5811"))) {
2838 macio_chips[0].flags |= MACIO_FLAG_FW_SUPPORTED;
2839 core99_firewire_enable(np, 0, 1);
2840 }
2841 np = of_find_node_by_name(np, "firewire");
2842 }
2843
2844 /* Enable ATA-100 before PCI probe. */
2845 np = of_find_node_by_name(NULL, "ata-6");
2846 while(np) {
2847 if (np->parent
2848 && device_is_compatible(np->parent, "uni-north")
2849 && device_is_compatible(np, "kauai-ata")) {
2850 core99_ata100_enable(np, 1);
2851 }
2852 np = of_find_node_by_name(np, "ata-6");
2853 }
2854
2855 /* Switch airport off */
2856 np = find_devices("radio");
2857 while(np) {
2858 if (np && np->parent == macio_chips[0].of_node) {
2859 macio_chips[0].flags |= MACIO_FLAG_AIRPORT_ON;
2860 core99_airport_enable(np, 0, 0);
2861 }
2862 np = np->next;
2863 }
2864 }
2865
2866 /* On all machines that support sound PM, switch sound off */
2867 if (macio_chips[0].of_node)
2868 pmac_do_feature_call(PMAC_FTR_SOUND_CHIP_ENABLE,
2869 macio_chips[0].of_node, 0, 0);
2870
2871 /* While on some desktop G3s, we turn it back on */
2872 if (macio_chips[0].of_node && macio_chips[0].type == macio_heathrow
2873 && (pmac_mb.model_id == PMAC_TYPE_GOSSAMER ||
2874 pmac_mb.model_id == PMAC_TYPE_SILK)) {
2875 struct macio_chip *macio = &macio_chips[0];
2876 MACIO_BIS(HEATHROW_FCR, HRW_SOUND_CLK_ENABLE);
2877 MACIO_BIC(HEATHROW_FCR, HRW_SOUND_POWER_N);
2878 }
2879
2880 /* Some machine models need the clock chip to be properly setup for
2881 * clock spreading now. This should be a platform function but we
2882 * don't do these at the moment
2883 */
2884 pmac_tweak_clock_spreading(1);
2885
2886#endif /* CONFIG_POWER4 */
2887
2888 /* On all machines, switch modem & serial ports off */
2889 np = find_devices("ch-a");
2890 while(np) {
2891 initial_serial_shutdown(np);
2892 np = np->next;
2893 }
2894 np = find_devices("ch-b");
2895 while(np) {
2896 initial_serial_shutdown(np);
2897 np = np->next;
2898 }
2899}
2900
2901void __init
2902pmac_feature_init(void)
2903{
2904 /* Detect the UniNorth memory controller */
2905 probe_uninorth();
2906
2907 /* Probe mac-io controllers */
2908 if (probe_macios()) {
2909 printk(KERN_WARNING "No mac-io chip found\n");
2910 return;
2911 }
2912
2913 /* Setup low-level i2c stuffs */
2914 pmac_init_low_i2c();
2915
2916 /* Probe machine type */
2917 if (probe_motherboard())
2918 printk(KERN_WARNING "Unknown PowerMac !\n");
2919
2920 /* Set some initial features (turn off some chips that will
2921 * be later turned on)
2922 */
2923 set_initial_features();
2924}
2925
2926int __init pmac_feature_late_init(void)
2927{
2928#if 0
2929 struct device_node *np;
2930
2931 /* Request some resources late */
2932 if (uninorth_node)
2933 request_OF_resource(uninorth_node, 0, NULL);
2934 np = find_devices("hammerhead");
2935 if (np)
2936 request_OF_resource(np, 0, NULL);
2937 np = find_devices("interrupt-controller");
2938 if (np)
2939 request_OF_resource(np, 0, NULL);
2940#endif
2941 return 0;
2942}
2943
2944device_initcall(pmac_feature_late_init);
2945
2946#if 0
2947static void dump_HT_speeds(char *name, u32 cfg, u32 frq)
2948{
2949 int freqs[16] = { 200,300,400,500,600,800,1000,0,0,0,0,0,0,0,0,0 };
2950 int bits[8] = { 8,16,0,32,2,4,0,0 };
2951 int freq = (frq >> 8) & 0xf;
2952
2953 if (freqs[freq] == 0)
2954 printk("%s: Unknown HT link frequency %x\n", name, freq);
2955 else
2956 printk("%s: %d MHz on main link, (%d in / %d out) bits width\n",
2957 name, freqs[freq],
2958 bits[(cfg >> 28) & 0x7], bits[(cfg >> 24) & 0x7]);
2959}
2960
2961void __init pmac_check_ht_link(void)
2962{
2963 u32 ufreq, freq, ucfg, cfg;
2964 struct device_node *pcix_node;
2965 u8 px_bus, px_devfn;
2966 struct pci_controller *px_hose;
2967
2968 (void)in_be32(u3_ht + U3_HT_LINK_COMMAND);
2969 ucfg = cfg = in_be32(u3_ht + U3_HT_LINK_CONFIG);
2970 ufreq = freq = in_be32(u3_ht + U3_HT_LINK_FREQ);
2971 dump_HT_speeds("U3 HyperTransport", cfg, freq);
2972
2973 pcix_node = of_find_compatible_node(NULL, "pci", "pci-x");
2974 if (pcix_node == NULL) {
2975 printk("No PCI-X bridge found\n");
2976 return;
2977 }
2978 if (pci_device_from_OF_node(pcix_node, &px_bus, &px_devfn) != 0) {
2979 printk("PCI-X bridge found but not matched to pci\n");
2980 return;
2981 }
2982 px_hose = pci_find_hose_for_OF_device(pcix_node);
2983 if (px_hose == NULL) {
2984 printk("PCI-X bridge found but not matched to host\n");
2985 return;
2986 }
2987 early_read_config_dword(px_hose, px_bus, px_devfn, 0xc4, &cfg);
2988 early_read_config_dword(px_hose, px_bus, px_devfn, 0xcc, &freq);
2989 dump_HT_speeds("PCI-X HT Uplink", cfg, freq);
2990 early_read_config_dword(px_hose, px_bus, px_devfn, 0xc8, &cfg);
2991 early_read_config_dword(px_hose, px_bus, px_devfn, 0xd0, &freq);
2992 dump_HT_speeds("PCI-X HT Downlink", cfg, freq);
2993}
2994#endif /* 0 */
2995
2996/*
2997 * Early video resume hook
2998 */
2999
3000static void (*pmac_early_vresume_proc)(void *data);
3001static void *pmac_early_vresume_data;
3002
3003void pmac_set_early_video_resume(void (*proc)(void *data), void *data)
3004{
3005 if (_machine != _MACH_Pmac)
3006 return;
3007 preempt_disable();
3008 pmac_early_vresume_proc = proc;
3009 pmac_early_vresume_data = data;
3010 preempt_enable();
3011}
3012EXPORT_SYMBOL(pmac_set_early_video_resume);
3013
3014void pmac_call_early_video_resume(void)
3015{
3016 if (pmac_early_vresume_proc)
3017 pmac_early_vresume_proc(pmac_early_vresume_data);
3018}
3019
3020/*
3021 * AGP related suspend/resume code
3022 */
3023
3024static struct pci_dev *pmac_agp_bridge;
3025static int (*pmac_agp_suspend)(struct pci_dev *bridge);
3026static int (*pmac_agp_resume)(struct pci_dev *bridge);
3027
3028void pmac_register_agp_pm(struct pci_dev *bridge,
3029 int (*suspend)(struct pci_dev *bridge),
3030 int (*resume)(struct pci_dev *bridge))
3031{
3032 if (suspend || resume) {
3033 pmac_agp_bridge = bridge;
3034 pmac_agp_suspend = suspend;
3035 pmac_agp_resume = resume;
3036 return;
3037 }
3038 if (bridge != pmac_agp_bridge)
3039 return;
3040 pmac_agp_suspend = pmac_agp_resume = NULL;
3041 return;
3042}
3043EXPORT_SYMBOL(pmac_register_agp_pm);
3044
3045void pmac_suspend_agp_for_card(struct pci_dev *dev)
3046{
3047 if (pmac_agp_bridge == NULL || pmac_agp_suspend == NULL)
3048 return;
3049 if (pmac_agp_bridge->bus != dev->bus)
3050 return;
3051 pmac_agp_suspend(pmac_agp_bridge);
3052}
3053EXPORT_SYMBOL(pmac_suspend_agp_for_card);
3054
3055void pmac_resume_agp_for_card(struct pci_dev *dev)
3056{
3057 if (pmac_agp_bridge == NULL || pmac_agp_resume == NULL)
3058 return;
3059 if (pmac_agp_bridge->bus != dev->bus)
3060 return;
3061 pmac_agp_resume(pmac_agp_bridge);
3062}
3063EXPORT_SYMBOL(pmac_resume_agp_for_card);
diff --git a/arch/ppc64/kernel/pmac_low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c
index f3f39e8e337a..f3f39e8e337a 100644
--- a/arch/ppc64/kernel/pmac_low_i2c.c
+++ b/arch/powerpc/platforms/powermac/low_i2c.c
diff --git a/arch/ppc64/kernel/pmac_nvram.c b/arch/powerpc/platforms/powermac/nvram.c
index e32a902236e3..4042e2f06ee0 100644
--- a/arch/ppc64/kernel/pmac_nvram.c
+++ b/arch/powerpc/platforms/powermac/nvram.c
@@ -15,10 +15,13 @@
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/stddef.h> 16#include <linux/stddef.h>
17#include <linux/string.h> 17#include <linux/string.h>
18#include <linux/nvram.h>
18#include <linux/init.h> 19#include <linux/init.h>
19#include <linux/slab.h> 20#include <linux/slab.h>
20#include <linux/delay.h> 21#include <linux/delay.h>
21#include <linux/errno.h> 22#include <linux/errno.h>
23#include <linux/adb.h>
24#include <linux/pmu.h>
22#include <linux/bootmem.h> 25#include <linux/bootmem.h>
23#include <linux/completion.h> 26#include <linux/completion.h>
24#include <linux/spinlock.h> 27#include <linux/spinlock.h>
@@ -72,20 +75,38 @@ struct core99_header {
72/* 75/*
73 * Read and write the non-volatile RAM on PowerMacs and CHRP machines. 76 * Read and write the non-volatile RAM on PowerMacs and CHRP machines.
74 */ 77 */
78static int nvram_naddrs;
75static volatile unsigned char *nvram_data; 79static volatile unsigned char *nvram_data;
80static int is_core_99;
76static int core99_bank = 0; 81static int core99_bank = 0;
82static int nvram_partitions[3];
77// XXX Turn that into a sem 83// XXX Turn that into a sem
78static DEFINE_SPINLOCK(nv_lock); 84static DEFINE_SPINLOCK(nv_lock);
79 85
86extern int pmac_newworld;
80extern int system_running; 87extern int system_running;
81 88
82static int (*core99_write_bank)(int bank, u8* datas); 89static int (*core99_write_bank)(int bank, u8* datas);
83static int (*core99_erase_bank)(int bank); 90static int (*core99_erase_bank)(int bank);
84 91
85static char *nvram_image __pmacdata; 92static char *nvram_image;
86 93
87 94
88static ssize_t __pmac core99_nvram_read(char *buf, size_t count, loff_t *index) 95static unsigned char core99_nvram_read_byte(int addr)
96{
97 if (nvram_image == NULL)
98 return 0xff;
99 return nvram_image[addr];
100}
101
102static void core99_nvram_write_byte(int addr, unsigned char val)
103{
104 if (nvram_image == NULL)
105 return;
106 nvram_image[addr] = val;
107}
108
109static ssize_t core99_nvram_read(char *buf, size_t count, loff_t *index)
89{ 110{
90 int i; 111 int i;
91 112
@@ -103,7 +124,7 @@ static ssize_t __pmac core99_nvram_read(char *buf, size_t count, loff_t *index)
103 return count; 124 return count;
104} 125}
105 126
106static ssize_t __pmac core99_nvram_write(char *buf, size_t count, loff_t *index) 127static ssize_t core99_nvram_write(char *buf, size_t count, loff_t *index)
107{ 128{
108 int i; 129 int i;
109 130
@@ -121,14 +142,95 @@ static ssize_t __pmac core99_nvram_write(char *buf, size_t count, loff_t *index)
121 return count; 142 return count;
122} 143}
123 144
124static ssize_t __pmac core99_nvram_size(void) 145static ssize_t core99_nvram_size(void)
125{ 146{
126 if (nvram_image == NULL) 147 if (nvram_image == NULL)
127 return -ENODEV; 148 return -ENODEV;
128 return NVRAM_SIZE; 149 return NVRAM_SIZE;
129} 150}
130 151
131static u8 __pmac chrp_checksum(struct chrp_header* hdr) 152#ifdef CONFIG_PPC32
153static volatile unsigned char *nvram_addr;
154static int nvram_mult;
155
156static unsigned char direct_nvram_read_byte(int addr)
157{
158 return in_8(&nvram_data[(addr & (NVRAM_SIZE - 1)) * nvram_mult]);
159}
160
161static void direct_nvram_write_byte(int addr, unsigned char val)
162{
163 out_8(&nvram_data[(addr & (NVRAM_SIZE - 1)) * nvram_mult], val);
164}
165
166
167static unsigned char indirect_nvram_read_byte(int addr)
168{
169 unsigned char val;
170 unsigned long flags;
171
172 spin_lock_irqsave(&nv_lock, flags);
173 out_8(nvram_addr, addr >> 5);
174 val = in_8(&nvram_data[(addr & 0x1f) << 4]);
175 spin_unlock_irqrestore(&nv_lock, flags);
176
177 return val;
178}
179
180static void indirect_nvram_write_byte(int addr, unsigned char val)
181{
182 unsigned long flags;
183
184 spin_lock_irqsave(&nv_lock, flags);
185 out_8(nvram_addr, addr >> 5);
186 out_8(&nvram_data[(addr & 0x1f) << 4], val);
187 spin_unlock_irqrestore(&nv_lock, flags);
188}
189
190
191#ifdef CONFIG_ADB_PMU
192
193static void pmu_nvram_complete(struct adb_request *req)
194{
195 if (req->arg)
196 complete((struct completion *)req->arg);
197}
198
199static unsigned char pmu_nvram_read_byte(int addr)
200{
201 struct adb_request req;
202 DECLARE_COMPLETION(req_complete);
203
204 req.arg = system_state == SYSTEM_RUNNING ? &req_complete : NULL;
205 if (pmu_request(&req, pmu_nvram_complete, 3, PMU_READ_NVRAM,
206 (addr >> 8) & 0xff, addr & 0xff))
207 return 0xff;
208 if (system_state == SYSTEM_RUNNING)
209 wait_for_completion(&req_complete);
210 while (!req.complete)
211 pmu_poll();
212 return req.reply[0];
213}
214
215static void pmu_nvram_write_byte(int addr, unsigned char val)
216{
217 struct adb_request req;
218 DECLARE_COMPLETION(req_complete);
219
220 req.arg = system_state == SYSTEM_RUNNING ? &req_complete : NULL;
221 if (pmu_request(&req, pmu_nvram_complete, 4, PMU_WRITE_NVRAM,
222 (addr >> 8) & 0xff, addr & 0xff, val))
223 return;
224 if (system_state == SYSTEM_RUNNING)
225 wait_for_completion(&req_complete);
226 while (!req.complete)
227 pmu_poll();
228}
229
230#endif /* CONFIG_ADB_PMU */
231#endif /* CONFIG_PPC32 */
232
233static u8 chrp_checksum(struct chrp_header* hdr)
132{ 234{
133 u8 *ptr; 235 u8 *ptr;
134 u16 sum = hdr->signature; 236 u16 sum = hdr->signature;
@@ -139,7 +241,7 @@ static u8 __pmac chrp_checksum(struct chrp_header* hdr)
139 return sum; 241 return sum;
140} 242}
141 243
142static u32 __pmac core99_calc_adler(u8 *buffer) 244static u32 core99_calc_adler(u8 *buffer)
143{ 245{
144 int cnt; 246 int cnt;
145 u32 low, high; 247 u32 low, high;
@@ -161,7 +263,7 @@ static u32 __pmac core99_calc_adler(u8 *buffer)
161 return (high << 16) | low; 263 return (high << 16) | low;
162} 264}
163 265
164static u32 __pmac core99_check(u8* datas) 266static u32 core99_check(u8* datas)
165{ 267{
166 struct core99_header* hdr99 = (struct core99_header*)datas; 268 struct core99_header* hdr99 = (struct core99_header*)datas;
167 269
@@ -180,7 +282,7 @@ static u32 __pmac core99_check(u8* datas)
180 return hdr99->generation; 282 return hdr99->generation;
181} 283}
182 284
183static int __pmac sm_erase_bank(int bank) 285static int sm_erase_bank(int bank)
184{ 286{
185 int stat, i; 287 int stat, i;
186 unsigned long timeout; 288 unsigned long timeout;
@@ -194,7 +296,7 @@ static int __pmac sm_erase_bank(int bank)
194 timeout = 0; 296 timeout = 0;
195 do { 297 do {
196 if (++timeout > 1000000) { 298 if (++timeout > 1000000) {
197 printk(KERN_ERR "nvram: Sharp/Miron flash erase timeout !\n"); 299 printk(KERN_ERR "nvram: Sharp/Micron flash erase timeout !\n");
198 break; 300 break;
199 } 301 }
200 out_8(base, SM_FLASH_CMD_READ_STATUS); 302 out_8(base, SM_FLASH_CMD_READ_STATUS);
@@ -212,7 +314,7 @@ static int __pmac sm_erase_bank(int bank)
212 return 0; 314 return 0;
213} 315}
214 316
215static int __pmac sm_write_bank(int bank, u8* datas) 317static int sm_write_bank(int bank, u8* datas)
216{ 318{
217 int i, stat = 0; 319 int i, stat = 0;
218 unsigned long timeout; 320 unsigned long timeout;
@@ -247,7 +349,7 @@ static int __pmac sm_write_bank(int bank, u8* datas)
247 return 0; 349 return 0;
248} 350}
249 351
250static int __pmac amd_erase_bank(int bank) 352static int amd_erase_bank(int bank)
251{ 353{
252 int i, stat = 0; 354 int i, stat = 0;
253 unsigned long timeout; 355 unsigned long timeout;
@@ -294,7 +396,7 @@ static int __pmac amd_erase_bank(int bank)
294 return 0; 396 return 0;
295} 397}
296 398
297static int __pmac amd_write_bank(int bank, u8* datas) 399static int amd_write_bank(int bank, u8* datas)
298{ 400{
299 int i, stat = 0; 401 int i, stat = 0;
300 unsigned long timeout; 402 unsigned long timeout;
@@ -340,12 +442,49 @@ static int __pmac amd_write_bank(int bank, u8* datas)
340 return 0; 442 return 0;
341} 443}
342 444
445static void __init lookup_partitions(void)
446{
447 u8 buffer[17];
448 int i, offset;
449 struct chrp_header* hdr;
450
451 if (pmac_newworld) {
452 nvram_partitions[pmac_nvram_OF] = -1;
453 nvram_partitions[pmac_nvram_XPRAM] = -1;
454 nvram_partitions[pmac_nvram_NR] = -1;
455 hdr = (struct chrp_header *)buffer;
456
457 offset = 0;
458 buffer[16] = 0;
459 do {
460 for (i=0;i<16;i++)
461 buffer[i] = ppc_md.nvram_read_val(offset+i);
462 if (!strcmp(hdr->name, "common"))
463 nvram_partitions[pmac_nvram_OF] = offset + 0x10;
464 if (!strcmp(hdr->name, "APL,MacOS75")) {
465 nvram_partitions[pmac_nvram_XPRAM] = offset + 0x10;
466 nvram_partitions[pmac_nvram_NR] = offset + 0x110;
467 }
468 offset += (hdr->len * 0x10);
469 } while(offset < NVRAM_SIZE);
470 } else {
471 nvram_partitions[pmac_nvram_OF] = 0x1800;
472 nvram_partitions[pmac_nvram_XPRAM] = 0x1300;
473 nvram_partitions[pmac_nvram_NR] = 0x1400;
474 }
475 DBG("nvram: OF partition at 0x%x\n", nvram_partitions[pmac_nvram_OF]);
476 DBG("nvram: XP partition at 0x%x\n", nvram_partitions[pmac_nvram_XPRAM]);
477 DBG("nvram: NR partition at 0x%x\n", nvram_partitions[pmac_nvram_NR]);
478}
343 479
344static int __pmac core99_nvram_sync(void) 480static void core99_nvram_sync(void)
345{ 481{
346 struct core99_header* hdr99; 482 struct core99_header* hdr99;
347 unsigned long flags; 483 unsigned long flags;
348 484
485 if (!is_core_99 || !nvram_data || !nvram_image)
486 return;
487
349 spin_lock_irqsave(&nv_lock, flags); 488 spin_lock_irqsave(&nv_lock, flags);
350 if (!memcmp(nvram_image, (u8*)nvram_data + core99_bank*NVRAM_SIZE, 489 if (!memcmp(nvram_image, (u8*)nvram_data + core99_bank*NVRAM_SIZE,
351 NVRAM_SIZE)) 490 NVRAM_SIZE))
@@ -370,32 +509,28 @@ static int __pmac core99_nvram_sync(void)
370 bail: 509 bail:
371 spin_unlock_irqrestore(&nv_lock, flags); 510 spin_unlock_irqrestore(&nv_lock, flags);
372 511
373 return 0; 512#ifdef DEBUG
513 mdelay(2000);
514#endif
374} 515}
375 516
376int __init pmac_nvram_init(void) 517static int __init core99_nvram_setup(struct device_node *dp)
377{ 518{
378 struct device_node *dp;
379 u32 gen_bank0, gen_bank1;
380 int i; 519 int i;
520 u32 gen_bank0, gen_bank1;
381 521
382 dp = find_devices("nvram"); 522 if (nvram_naddrs < 1) {
383 if (dp == NULL) { 523 printk(KERN_ERR "nvram: no address\n");
384 printk(KERN_ERR "Can't find NVRAM device\n"); 524 return -EINVAL;
385 return -ENODEV;
386 }
387 if (!device_is_compatible(dp, "nvram,flash")) {
388 printk(KERN_ERR "Incompatible type of NVRAM\n");
389 return -ENXIO;
390 } 525 }
391
392 nvram_image = alloc_bootmem(NVRAM_SIZE); 526 nvram_image = alloc_bootmem(NVRAM_SIZE);
393 if (nvram_image == NULL) { 527 if (nvram_image == NULL) {
394 printk(KERN_ERR "nvram: can't allocate ram image\n"); 528 printk(KERN_ERR "nvram: can't allocate ram image\n");
395 return -ENOMEM; 529 return -ENOMEM;
396 } 530 }
397 nvram_data = ioremap(dp->addrs[0].address, NVRAM_SIZE*2); 531 nvram_data = ioremap(dp->addrs[0].address, NVRAM_SIZE*2);
398 532 nvram_naddrs = 1; /* Make sure we get the correct case */
533
399 DBG("nvram: Checking bank 0...\n"); 534 DBG("nvram: Checking bank 0...\n");
400 535
401 gen_bank0 = core99_check((u8 *)nvram_data); 536 gen_bank0 = core99_check((u8 *)nvram_data);
@@ -408,11 +543,12 @@ int __init pmac_nvram_init(void)
408 for (i=0; i<NVRAM_SIZE; i++) 543 for (i=0; i<NVRAM_SIZE; i++)
409 nvram_image[i] = nvram_data[i + core99_bank*NVRAM_SIZE]; 544 nvram_image[i] = nvram_data[i + core99_bank*NVRAM_SIZE];
410 545
546 ppc_md.nvram_read_val = core99_nvram_read_byte;
547 ppc_md.nvram_write_val = core99_nvram_write_byte;
411 ppc_md.nvram_read = core99_nvram_read; 548 ppc_md.nvram_read = core99_nvram_read;
412 ppc_md.nvram_write = core99_nvram_write; 549 ppc_md.nvram_write = core99_nvram_write;
413 ppc_md.nvram_size = core99_nvram_size; 550 ppc_md.nvram_size = core99_nvram_size;
414 ppc_md.nvram_sync = core99_nvram_sync; 551 ppc_md.nvram_sync = core99_nvram_sync;
415
416 /* 552 /*
417 * Maybe we could be smarter here though making an exclusive list 553 * Maybe we could be smarter here though making an exclusive list
418 * of known flash chips is a bit nasty as older OF didn't provide us 554 * of known flash chips is a bit nasty as older OF didn't provide us
@@ -427,67 +563,81 @@ int __init pmac_nvram_init(void)
427 core99_erase_bank = sm_erase_bank; 563 core99_erase_bank = sm_erase_bank;
428 core99_write_bank = sm_write_bank; 564 core99_write_bank = sm_write_bank;
429 } 565 }
430
431 return 0; 566 return 0;
432} 567}
433 568
434int __pmac pmac_get_partition(int partition) 569int __init pmac_nvram_init(void)
435{ 570{
436 struct nvram_partition *part; 571 struct device_node *dp;
437 const char *name; 572 int err = 0;
438 int sig; 573
439 574 nvram_naddrs = 0;
440 switch(partition) { 575
441 case pmac_nvram_OF: 576 dp = find_devices("nvram");
442 name = "common"; 577 if (dp == NULL) {
443 sig = NVRAM_SIG_SYS; 578 printk(KERN_ERR "Can't find NVRAM device\n");
444 break;
445 case pmac_nvram_XPRAM:
446 name = "APL,MacOS75";
447 sig = NVRAM_SIG_OS;
448 break;
449 case pmac_nvram_NR:
450 default:
451 /* Oldworld stuff */
452 return -ENODEV; 579 return -ENODEV;
453 } 580 }
581 nvram_naddrs = dp->n_addrs;
582 is_core_99 = device_is_compatible(dp, "nvram,flash");
583 if (is_core_99)
584 err = core99_nvram_setup(dp);
585#ifdef CONFIG_PPC32
586 else if (_machine == _MACH_chrp && nvram_naddrs == 1) {
587 nvram_data = ioremap(dp->addrs[0].address + isa_mem_base,
588 dp->addrs[0].size);
589 nvram_mult = 1;
590 ppc_md.nvram_read_val = direct_nvram_read_byte;
591 ppc_md.nvram_write_val = direct_nvram_write_byte;
592 } else if (nvram_naddrs == 1) {
593 nvram_data = ioremap(dp->addrs[0].address, dp->addrs[0].size);
594 nvram_mult = (dp->addrs[0].size + NVRAM_SIZE - 1) / NVRAM_SIZE;
595 ppc_md.nvram_read_val = direct_nvram_read_byte;
596 ppc_md.nvram_write_val = direct_nvram_write_byte;
597 } else if (nvram_naddrs == 2) {
598 nvram_addr = ioremap(dp->addrs[0].address, dp->addrs[0].size);
599 nvram_data = ioremap(dp->addrs[1].address, dp->addrs[1].size);
600 ppc_md.nvram_read_val = indirect_nvram_read_byte;
601 ppc_md.nvram_write_val = indirect_nvram_write_byte;
602 } else if (nvram_naddrs == 0 && sys_ctrler == SYS_CTRLER_PMU) {
603#ifdef CONFIG_ADB_PMU
604 nvram_naddrs = -1;
605 ppc_md.nvram_read_val = pmu_nvram_read_byte;
606 ppc_md.nvram_write_val = pmu_nvram_write_byte;
607#endif /* CONFIG_ADB_PMU */
608 }
609#endif
610 else {
611 printk(KERN_ERR "Incompatible type of NVRAM\n");
612 return -ENXIO;
613 }
614 lookup_partitions();
615 return err;
616}
454 617
455 part = nvram_find_partition(sig, name); 618int pmac_get_partition(int partition)
456 if (part == NULL) 619{
457 return 0; 620 return nvram_partitions[partition];
458
459 return part->index;
460} 621}
461 622
462u8 __pmac pmac_xpram_read(int xpaddr) 623u8 pmac_xpram_read(int xpaddr)
463{ 624{
464 int offset = pmac_get_partition(pmac_nvram_XPRAM); 625 int offset = pmac_get_partition(pmac_nvram_XPRAM);
465 loff_t index;
466 u8 buf;
467 ssize_t count;
468 626
469 if (offset < 0 || xpaddr < 0 || xpaddr > 0x100) 627 if (offset < 0 || xpaddr < 0 || xpaddr > 0x100)
470 return 0xff; 628 return 0xff;
471 index = offset + xpaddr;
472 629
473 count = ppc_md.nvram_read(&buf, 1, &index); 630 return ppc_md.nvram_read_val(xpaddr + offset);
474 if (count != 1)
475 return 0xff;
476 return buf;
477} 631}
478 632
479void __pmac pmac_xpram_write(int xpaddr, u8 data) 633void pmac_xpram_write(int xpaddr, u8 data)
480{ 634{
481 int offset = pmac_get_partition(pmac_nvram_XPRAM); 635 int offset = pmac_get_partition(pmac_nvram_XPRAM);
482 loff_t index;
483 u8 buf;
484 636
485 if (offset < 0 || xpaddr < 0 || xpaddr > 0x100) 637 if (offset < 0 || xpaddr < 0 || xpaddr > 0x100)
486 return; 638 return;
487 index = offset + xpaddr;
488 buf = data;
489 639
490 ppc_md.nvram_write(&buf, 1, &index); 640 ppc_md.nvram_write_val(xpaddr + offset, data);
491} 641}
492 642
493EXPORT_SYMBOL(pmac_get_partition); 643EXPORT_SYMBOL(pmac_get_partition);
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c
new file mode 100644
index 000000000000..8f818d092e2b
--- /dev/null
+++ b/arch/powerpc/platforms/powermac/pci.c
@@ -0,0 +1,1170 @@
1/*
2 * Support for PCI bridges found on Power Macintoshes.
3 *
4 * Copyright (C) 2003 Benjamin Herrenschmuidt (benh@kernel.crashing.org)
5 * Copyright (C) 1997 Paul Mackerras (paulus@samba.org)
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
10 * 2 of the License, or (at your option) any later version.
11 */
12
13#include <linux/kernel.h>
14#include <linux/pci.h>
15#include <linux/delay.h>
16#include <linux/string.h>
17#include <linux/init.h>
18#include <linux/bootmem.h>
19
20#include <asm/sections.h>
21#include <asm/io.h>
22#include <asm/prom.h>
23#include <asm/pci-bridge.h>
24#include <asm/machdep.h>
25#include <asm/pmac_feature.h>
26#include <asm/grackle.h>
27#ifdef CONFIG_PPC64
28#include <asm/iommu.h>
29#include <asm/ppc-pci.h>
30#endif
31
32#undef DEBUG
33
34#ifdef DEBUG
35#define DBG(x...) printk(x)
36#else
37#define DBG(x...)
38#endif
39
40static int add_bridge(struct device_node *dev);
41
42/* XXX Could be per-controller, but I don't think we risk anything by
43 * assuming we won't have both UniNorth and Bandit */
44static int has_uninorth;
45#ifdef CONFIG_PPC64
46static struct pci_controller *u3_agp;
47static struct pci_controller *u3_ht;
48#endif /* CONFIG_PPC64 */
49
50extern u8 pci_cache_line_size;
51extern int pcibios_assign_bus_offset;
52
53struct device_node *k2_skiplist[2];
54
55/*
56 * Magic constants for enabling cache coherency in the bandit/PSX bridge.
57 */
58#define BANDIT_DEVID_2 8
59#define BANDIT_REVID 3
60
61#define BANDIT_DEVNUM 11
62#define BANDIT_MAGIC 0x50
63#define BANDIT_COHERENT 0x40
64
65static int __init fixup_one_level_bus_range(struct device_node *node, int higher)
66{
67 for (; node != 0;node = node->sibling) {
68 int * bus_range;
69 unsigned int *class_code;
70 int len;
71
72 /* For PCI<->PCI bridges or CardBus bridges, we go down */
73 class_code = (unsigned int *) get_property(node, "class-code", NULL);
74 if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
75 (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS))
76 continue;
77 bus_range = (int *) get_property(node, "bus-range", &len);
78 if (bus_range != NULL && len > 2 * sizeof(int)) {
79 if (bus_range[1] > higher)
80 higher = bus_range[1];
81 }
82 higher = fixup_one_level_bus_range(node->child, higher);
83 }
84 return higher;
85}
86
87/* This routine fixes the "bus-range" property of all bridges in the
88 * system since they tend to have their "last" member wrong on macs
89 *
90 * Note that the bus numbers manipulated here are OF bus numbers, they
91 * are not Linux bus numbers.
92 */
93static void __init fixup_bus_range(struct device_node *bridge)
94{
95 int * bus_range;
96 int len;
97
98 /* Lookup the "bus-range" property for the hose */
99 bus_range = (int *) get_property(bridge, "bus-range", &len);
100 if (bus_range == NULL || len < 2 * sizeof(int)) {
101 printk(KERN_WARNING "Can't get bus-range for %s\n",
102 bridge->full_name);
103 return;
104 }
105 bus_range[1] = fixup_one_level_bus_range(bridge->child, bus_range[1]);
106}
107
108/*
109 * Apple MacRISC (U3, UniNorth, Bandit, Chaos) PCI controllers.
110 *
111 * The "Bandit" version is present in all early PCI PowerMacs,
112 * and up to the first ones using Grackle. Some machines may
113 * have 2 bandit controllers (2 PCI busses).
114 *
115 * "Chaos" is used in some "Bandit"-type machines as a bridge
116 * for the separate display bus. It is accessed the same
117 * way as bandit, but cannot be probed for devices. It therefore
118 * has its own config access functions.
119 *
120 * The "UniNorth" version is present in all Core99 machines
121 * (iBook, G4, new IMacs, and all the recent Apple machines).
122 * It contains 3 controllers in one ASIC.
123 *
124 * The U3 is the bridge used on G5 machines. It contains an
125 * AGP bus which is dealt with the old UniNorth access routines
126 * and a HyperTransport bus which uses its own set of access
127 * functions.
128 */
129
130#define MACRISC_CFA0(devfn, off) \
131 ((1 << (unsigned long)PCI_SLOT(dev_fn)) \
132 | (((unsigned long)PCI_FUNC(dev_fn)) << 8) \
133 | (((unsigned long)(off)) & 0xFCUL))
134
135#define MACRISC_CFA1(bus, devfn, off) \
136 ((((unsigned long)(bus)) << 16) \
137 |(((unsigned long)(devfn)) << 8) \
138 |(((unsigned long)(off)) & 0xFCUL) \
139 |1UL)
140
141static unsigned long macrisc_cfg_access(struct pci_controller* hose,
142 u8 bus, u8 dev_fn, u8 offset)
143{
144 unsigned int caddr;
145
146 if (bus == hose->first_busno) {
147 if (dev_fn < (11 << 3))
148 return 0;
149 caddr = MACRISC_CFA0(dev_fn, offset);
150 } else
151 caddr = MACRISC_CFA1(bus, dev_fn, offset);
152
153 /* Uninorth will return garbage if we don't read back the value ! */
154 do {
155 out_le32(hose->cfg_addr, caddr);
156 } while (in_le32(hose->cfg_addr) != caddr);
157
158 offset &= has_uninorth ? 0x07 : 0x03;
159 return ((unsigned long)hose->cfg_data) + offset;
160}
161
162static int macrisc_read_config(struct pci_bus *bus, unsigned int devfn,
163 int offset, int len, u32 *val)
164{
165 struct pci_controller *hose;
166 unsigned long addr;
167
168 hose = pci_bus_to_host(bus);
169 if (hose == NULL)
170 return PCIBIOS_DEVICE_NOT_FOUND;
171
172 addr = macrisc_cfg_access(hose, bus->number, devfn, offset);
173 if (!addr)
174 return PCIBIOS_DEVICE_NOT_FOUND;
175 /*
176 * Note: the caller has already checked that offset is
177 * suitably aligned and that len is 1, 2 or 4.
178 */
179 switch (len) {
180 case 1:
181 *val = in_8((u8 *)addr);
182 break;
183 case 2:
184 *val = in_le16((u16 *)addr);
185 break;
186 default:
187 *val = in_le32((u32 *)addr);
188 break;
189 }
190 return PCIBIOS_SUCCESSFUL;
191}
192
193static int macrisc_write_config(struct pci_bus *bus, unsigned int devfn,
194 int offset, int len, u32 val)
195{
196 struct pci_controller *hose;
197 unsigned long addr;
198
199 hose = pci_bus_to_host(bus);
200 if (hose == NULL)
201 return PCIBIOS_DEVICE_NOT_FOUND;
202
203 addr = macrisc_cfg_access(hose, bus->number, devfn, offset);
204 if (!addr)
205 return PCIBIOS_DEVICE_NOT_FOUND;
206 /*
207 * Note: the caller has already checked that offset is
208 * suitably aligned and that len is 1, 2 or 4.
209 */
210 switch (len) {
211 case 1:
212 out_8((u8 *)addr, val);
213 (void) in_8((u8 *)addr);
214 break;
215 case 2:
216 out_le16((u16 *)addr, val);
217 (void) in_le16((u16 *)addr);
218 break;
219 default:
220 out_le32((u32 *)addr, val);
221 (void) in_le32((u32 *)addr);
222 break;
223 }
224 return PCIBIOS_SUCCESSFUL;
225}
226
227static struct pci_ops macrisc_pci_ops =
228{
229 macrisc_read_config,
230 macrisc_write_config
231};
232
233#ifdef CONFIG_PPC32
234/*
235 * Verify that a specific (bus, dev_fn) exists on chaos
236 */
237static int
238chaos_validate_dev(struct pci_bus *bus, int devfn, int offset)
239{
240 struct device_node *np;
241 u32 *vendor, *device;
242
243 np = pci_busdev_to_OF_node(bus, devfn);
244 if (np == NULL)
245 return PCIBIOS_DEVICE_NOT_FOUND;
246
247 vendor = (u32 *)get_property(np, "vendor-id", NULL);
248 device = (u32 *)get_property(np, "device-id", NULL);
249 if (vendor == NULL || device == NULL)
250 return PCIBIOS_DEVICE_NOT_FOUND;
251
252 if ((*vendor == 0x106b) && (*device == 3) && (offset >= 0x10)
253 && (offset != 0x14) && (offset != 0x18) && (offset <= 0x24))
254 return PCIBIOS_BAD_REGISTER_NUMBER;
255
256 return PCIBIOS_SUCCESSFUL;
257}
258
259static int
260chaos_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
261 int len, u32 *val)
262{
263 int result = chaos_validate_dev(bus, devfn, offset);
264 if (result == PCIBIOS_BAD_REGISTER_NUMBER)
265 *val = ~0U;
266 if (result != PCIBIOS_SUCCESSFUL)
267 return result;
268 return macrisc_read_config(bus, devfn, offset, len, val);
269}
270
271static int
272chaos_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
273 int len, u32 val)
274{
275 int result = chaos_validate_dev(bus, devfn, offset);
276 if (result != PCIBIOS_SUCCESSFUL)
277 return result;
278 return macrisc_write_config(bus, devfn, offset, len, val);
279}
280
281static struct pci_ops chaos_pci_ops =
282{
283 chaos_read_config,
284 chaos_write_config
285};
286
287static void __init setup_chaos(struct pci_controller *hose,
288 struct reg_property *addr)
289{
290 /* assume a `chaos' bridge */
291 hose->ops = &chaos_pci_ops;
292 hose->cfg_addr = ioremap(addr->address + 0x800000, 0x1000);
293 hose->cfg_data = ioremap(addr->address + 0xc00000, 0x1000);
294}
295#else
296#define setup_chaos(hose, addr)
297#endif /* CONFIG_PPC32 */
298
299#ifdef CONFIG_PPC64
300/*
301 * These versions of U3 HyperTransport config space access ops do not
302 * implement self-view of the HT host yet
303 */
304
305/*
306 * This function deals with some "special cases" devices.
307 *
308 * 0 -> No special case
309 * 1 -> Skip the device but act as if the access was successfull
310 * (return 0xff's on reads, eventually, cache config space
311 * accesses in a later version)
312 * -1 -> Hide the device (unsuccessful acess)
313 */
314static int u3_ht_skip_device(struct pci_controller *hose,
315 struct pci_bus *bus, unsigned int devfn)
316{
317 struct device_node *busdn, *dn;
318 int i;
319
320 /* We only allow config cycles to devices that are in OF device-tree
321 * as we are apparently having some weird things going on with some
322 * revs of K2 on recent G5s
323 */
324 if (bus->self)
325 busdn = pci_device_to_OF_node(bus->self);
326 else
327 busdn = hose->arch_data;
328 for (dn = busdn->child; dn; dn = dn->sibling)
329 if (dn->data && PCI_DN(dn)->devfn == devfn)
330 break;
331 if (dn == NULL)
332 return -1;
333
334 /*
335 * When a device in K2 is powered down, we die on config
336 * cycle accesses. Fix that here.
337 */
338 for (i=0; i<2; i++)
339 if (k2_skiplist[i] == dn)
340 return 1;
341
342 return 0;
343}
344
345#define U3_HT_CFA0(devfn, off) \
346 ((((unsigned long)devfn) << 8) | offset)
347#define U3_HT_CFA1(bus, devfn, off) \
348 (U3_HT_CFA0(devfn, off) \
349 + (((unsigned long)bus) << 16) \
350 + 0x01000000UL)
351
352static unsigned long u3_ht_cfg_access(struct pci_controller* hose,
353 u8 bus, u8 devfn, u8 offset)
354{
355 if (bus == hose->first_busno) {
356 /* For now, we don't self probe U3 HT bridge */
357 if (PCI_SLOT(devfn) == 0)
358 return 0;
359 return ((unsigned long)hose->cfg_data) + U3_HT_CFA0(devfn, offset);
360 } else
361 return ((unsigned long)hose->cfg_data) + U3_HT_CFA1(bus, devfn, offset);
362}
363
364static int u3_ht_read_config(struct pci_bus *bus, unsigned int devfn,
365 int offset, int len, u32 *val)
366{
367 struct pci_controller *hose;
368 unsigned long addr;
369
370 hose = pci_bus_to_host(bus);
371 if (hose == NULL)
372 return PCIBIOS_DEVICE_NOT_FOUND;
373
374 addr = u3_ht_cfg_access(hose, bus->number, devfn, offset);
375 if (!addr)
376 return PCIBIOS_DEVICE_NOT_FOUND;
377
378 switch (u3_ht_skip_device(hose, bus, devfn)) {
379 case 0:
380 break;
381 case 1:
382 switch (len) {
383 case 1:
384 *val = 0xff; break;
385 case 2:
386 *val = 0xffff; break;
387 default:
388 *val = 0xfffffffful; break;
389 }
390 return PCIBIOS_SUCCESSFUL;
391 default:
392 return PCIBIOS_DEVICE_NOT_FOUND;
393 }
394
395 /*
396 * Note: the caller has already checked that offset is
397 * suitably aligned and that len is 1, 2 or 4.
398 */
399 switch (len) {
400 case 1:
401 *val = in_8((u8 *)addr);
402 break;
403 case 2:
404 *val = in_le16((u16 *)addr);
405 break;
406 default:
407 *val = in_le32((u32 *)addr);
408 break;
409 }
410 return PCIBIOS_SUCCESSFUL;
411}
412
413static int u3_ht_write_config(struct pci_bus *bus, unsigned int devfn,
414 int offset, int len, u32 val)
415{
416 struct pci_controller *hose;
417 unsigned long addr;
418
419 hose = pci_bus_to_host(bus);
420 if (hose == NULL)
421 return PCIBIOS_DEVICE_NOT_FOUND;
422
423 addr = u3_ht_cfg_access(hose, bus->number, devfn, offset);
424 if (!addr)
425 return PCIBIOS_DEVICE_NOT_FOUND;
426
427 switch (u3_ht_skip_device(hose, bus, devfn)) {
428 case 0:
429 break;
430 case 1:
431 return PCIBIOS_SUCCESSFUL;
432 default:
433 return PCIBIOS_DEVICE_NOT_FOUND;
434 }
435
436 /*
437 * Note: the caller has already checked that offset is
438 * suitably aligned and that len is 1, 2 or 4.
439 */
440 switch (len) {
441 case 1:
442 out_8((u8 *)addr, val);
443 (void) in_8((u8 *)addr);
444 break;
445 case 2:
446 out_le16((u16 *)addr, val);
447 (void) in_le16((u16 *)addr);
448 break;
449 default:
450 out_le32((u32 *)addr, val);
451 (void) in_le32((u32 *)addr);
452 break;
453 }
454 return PCIBIOS_SUCCESSFUL;
455}
456
457static struct pci_ops u3_ht_pci_ops =
458{
459 u3_ht_read_config,
460 u3_ht_write_config
461};
462#endif /* CONFIG_PPC64 */
463
464#ifdef CONFIG_PPC32
465/*
466 * For a bandit bridge, turn on cache coherency if necessary.
467 * N.B. we could clean this up using the hose ops directly.
468 */
469static void __init init_bandit(struct pci_controller *bp)
470{
471 unsigned int vendev, magic;
472 int rev;
473
474 /* read the word at offset 0 in config space for device 11 */
475 out_le32(bp->cfg_addr, (1UL << BANDIT_DEVNUM) + PCI_VENDOR_ID);
476 udelay(2);
477 vendev = in_le32(bp->cfg_data);
478 if (vendev == (PCI_DEVICE_ID_APPLE_BANDIT << 16) +
479 PCI_VENDOR_ID_APPLE) {
480 /* read the revision id */
481 out_le32(bp->cfg_addr,
482 (1UL << BANDIT_DEVNUM) + PCI_REVISION_ID);
483 udelay(2);
484 rev = in_8(bp->cfg_data);
485 if (rev != BANDIT_REVID)
486 printk(KERN_WARNING
487 "Unknown revision %d for bandit\n", rev);
488 } else if (vendev != (BANDIT_DEVID_2 << 16) + PCI_VENDOR_ID_APPLE) {
489 printk(KERN_WARNING "bandit isn't? (%x)\n", vendev);
490 return;
491 }
492
493 /* read the word at offset 0x50 */
494 out_le32(bp->cfg_addr, (1UL << BANDIT_DEVNUM) + BANDIT_MAGIC);
495 udelay(2);
496 magic = in_le32(bp->cfg_data);
497 if ((magic & BANDIT_COHERENT) != 0)
498 return;
499 magic |= BANDIT_COHERENT;
500 udelay(2);
501 out_le32(bp->cfg_data, magic);
502 printk(KERN_INFO "Cache coherency enabled for bandit/PSX\n");
503}
504
505/*
506 * Tweak the PCI-PCI bridge chip on the blue & white G3s.
507 */
508static void __init init_p2pbridge(void)
509{
510 struct device_node *p2pbridge;
511 struct pci_controller* hose;
512 u8 bus, devfn;
513 u16 val;
514
515 /* XXX it would be better here to identify the specific
516 PCI-PCI bridge chip we have. */
517 if ((p2pbridge = find_devices("pci-bridge")) == 0
518 || p2pbridge->parent == NULL
519 || strcmp(p2pbridge->parent->name, "pci") != 0)
520 return;
521 if (pci_device_from_OF_node(p2pbridge, &bus, &devfn) < 0) {
522 DBG("Can't find PCI infos for PCI<->PCI bridge\n");
523 return;
524 }
525 /* Warning: At this point, we have not yet renumbered all busses.
526 * So we must use OF walking to find out hose
527 */
528 hose = pci_find_hose_for_OF_device(p2pbridge);
529 if (!hose) {
530 DBG("Can't find hose for PCI<->PCI bridge\n");
531 return;
532 }
533 if (early_read_config_word(hose, bus, devfn,
534 PCI_BRIDGE_CONTROL, &val) < 0) {
535 printk(KERN_ERR "init_p2pbridge: couldn't read bridge control\n");
536 return;
537 }
538 val &= ~PCI_BRIDGE_CTL_MASTER_ABORT;
539 early_write_config_word(hose, bus, devfn, PCI_BRIDGE_CONTROL, val);
540}
541
542/*
543 * Some Apple desktop machines have a NEC PD720100A USB2 controller
544 * on the motherboard. Open Firmware, on these, will disable the
545 * EHCI part of it so it behaves like a pair of OHCI's. This fixup
546 * code re-enables it ;)
547 */
548static void __init fixup_nec_usb2(void)
549{
550 struct device_node *nec;
551
552 for (nec = NULL; (nec = of_find_node_by_name(nec, "usb")) != NULL;) {
553 struct pci_controller *hose;
554 u32 data, *prop;
555 u8 bus, devfn;
556
557 prop = (u32 *)get_property(nec, "vendor-id", NULL);
558 if (prop == NULL)
559 continue;
560 if (0x1033 != *prop)
561 continue;
562 prop = (u32 *)get_property(nec, "device-id", NULL);
563 if (prop == NULL)
564 continue;
565 if (0x0035 != *prop)
566 continue;
567 prop = (u32 *)get_property(nec, "reg", NULL);
568 if (prop == NULL)
569 continue;
570 devfn = (prop[0] >> 8) & 0xff;
571 bus = (prop[0] >> 16) & 0xff;
572 if (PCI_FUNC(devfn) != 0)
573 continue;
574 hose = pci_find_hose_for_OF_device(nec);
575 if (!hose)
576 continue;
577 early_read_config_dword(hose, bus, devfn, 0xe4, &data);
578 if (data & 1UL) {
579 printk("Found NEC PD720100A USB2 chip with disabled EHCI, fixing up...\n");
580 data &= ~1UL;
581 early_write_config_dword(hose, bus, devfn, 0xe4, data);
582 early_write_config_byte(hose, bus, devfn | 2, PCI_INTERRUPT_LINE,
583 nec->intrs[0].line);
584 }
585 }
586}
587
588static void __init setup_bandit(struct pci_controller *hose,
589 struct reg_property *addr)
590{
591 hose->ops = &macrisc_pci_ops;
592 hose->cfg_addr = ioremap(addr->address + 0x800000, 0x1000);
593 hose->cfg_data = ioremap(addr->address + 0xc00000, 0x1000);
594 init_bandit(hose);
595}
596
597static int __init setup_uninorth(struct pci_controller *hose,
598 struct reg_property *addr)
599{
600 pci_assign_all_buses = 1;
601 has_uninorth = 1;
602 hose->ops = &macrisc_pci_ops;
603 hose->cfg_addr = ioremap(addr->address + 0x800000, 0x1000);
604 hose->cfg_data = ioremap(addr->address + 0xc00000, 0x1000);
605 /* We "know" that the bridge at f2000000 has the PCI slots. */
606 return addr->address == 0xf2000000;
607}
608#endif
609
610#ifdef CONFIG_PPC64
611static void __init setup_u3_agp(struct pci_controller* hose)
612{
613 /* On G5, we move AGP up to high bus number so we don't need
614 * to reassign bus numbers for HT. If we ever have P2P bridges
615 * on AGP, we'll have to move pci_assign_all_busses to the
616 * pci_controller structure so we enable it for AGP and not for
617 * HT childs.
618 * We hard code the address because of the different size of
619 * the reg address cell, we shall fix that by killing struct
620 * reg_property and using some accessor functions instead
621 */
622 hose->first_busno = 0xf0;
623 hose->last_busno = 0xff;
624 has_uninorth = 1;
625 hose->ops = &macrisc_pci_ops;
626 hose->cfg_addr = ioremap(0xf0000000 + 0x800000, 0x1000);
627 hose->cfg_data = ioremap(0xf0000000 + 0xc00000, 0x1000);
628
629 u3_agp = hose;
630}
631
632static void __init setup_u3_ht(struct pci_controller* hose)
633{
634 struct device_node *np = (struct device_node *)hose->arch_data;
635 int i, cur;
636
637 hose->ops = &u3_ht_pci_ops;
638
639 /* We hard code the address because of the different size of
640 * the reg address cell, we shall fix that by killing struct
641 * reg_property and using some accessor functions instead
642 */
643 hose->cfg_data = (volatile unsigned char *)ioremap(0xf2000000, 0x02000000);
644
645 /*
646 * /ht node doesn't expose a "ranges" property, so we "remove" regions that
647 * have been allocated to AGP. So far, this version of the code doesn't assign
648 * any of the 0xfxxxxxxx "fine" memory regions to /ht.
649 * We need to fix that sooner or later by either parsing all child "ranges"
650 * properties or figuring out the U3 address space decoding logic and
651 * then read its configuration register (if any).
652 */
653 hose->io_base_phys = 0xf4000000;
654 hose->pci_io_size = 0x00400000;
655 hose->io_resource.name = np->full_name;
656 hose->io_resource.start = 0;
657 hose->io_resource.end = 0x003fffff;
658 hose->io_resource.flags = IORESOURCE_IO;
659 hose->pci_mem_offset = 0;
660 hose->first_busno = 0;
661 hose->last_busno = 0xef;
662 hose->mem_resources[0].name = np->full_name;
663 hose->mem_resources[0].start = 0x80000000;
664 hose->mem_resources[0].end = 0xefffffff;
665 hose->mem_resources[0].flags = IORESOURCE_MEM;
666
667 u3_ht = hose;
668
669 if (u3_agp == NULL) {
670 DBG("U3 has no AGP, using full resource range\n");
671 return;
672 }
673
674 /* We "remove" the AGP resources from the resources allocated to HT, that
675 * is we create "holes". However, that code does assumptions that so far
676 * happen to be true (cross fingers...), typically that resources in the
677 * AGP node are properly ordered
678 */
679 cur = 0;
680 for (i=0; i<3; i++) {
681 struct resource *res = &u3_agp->mem_resources[i];
682 if (res->flags != IORESOURCE_MEM)
683 continue;
684 /* We don't care about "fine" resources */
685 if (res->start >= 0xf0000000)
686 continue;
687 /* Check if it's just a matter of "shrinking" us in one direction */
688 if (hose->mem_resources[cur].start == res->start) {
689 DBG("U3/HT: shrink start of %d, %08lx -> %08lx\n",
690 cur, hose->mem_resources[cur].start, res->end + 1);
691 hose->mem_resources[cur].start = res->end + 1;
692 continue;
693 }
694 if (hose->mem_resources[cur].end == res->end) {
695 DBG("U3/HT: shrink end of %d, %08lx -> %08lx\n",
696 cur, hose->mem_resources[cur].end, res->start - 1);
697 hose->mem_resources[cur].end = res->start - 1;
698 continue;
699 }
700 /* No, it's not the case, we need a hole */
701 if (cur == 2) {
702 /* not enough resources for a hole, we drop part of the range */
703 printk(KERN_WARNING "Running out of resources for /ht host !\n");
704 hose->mem_resources[cur].end = res->start - 1;
705 continue;
706 }
707 cur++;
708 DBG("U3/HT: hole, %d end at %08lx, %d start at %08lx\n",
709 cur-1, res->start - 1, cur, res->end + 1);
710 hose->mem_resources[cur].name = np->full_name;
711 hose->mem_resources[cur].flags = IORESOURCE_MEM;
712 hose->mem_resources[cur].start = res->end + 1;
713 hose->mem_resources[cur].end = hose->mem_resources[cur-1].end;
714 hose->mem_resources[cur-1].end = res->start - 1;
715 }
716}
717
718/* XXX this needs to be converged between ppc32 and ppc64... */
719static struct pci_controller * __init pcibios_alloc_controller(void)
720{
721 struct pci_controller *hose;
722
723 hose = alloc_bootmem(sizeof(struct pci_controller));
724 if (hose)
725 pci_setup_pci_controller(hose);
726 return hose;
727}
728#endif
729
730/*
731 * We assume that if we have a G3 powermac, we have one bridge called
732 * "pci" (a MPC106) and no bandit or chaos bridges, and contrariwise,
733 * if we have one or more bandit or chaos bridges, we don't have a MPC106.
734 */
735static int __init add_bridge(struct device_node *dev)
736{
737 int len;
738 struct pci_controller *hose;
739#ifdef CONFIG_PPC32
740 struct reg_property *addr;
741#endif
742 char *disp_name;
743 int *bus_range;
744 int primary = 1;
745
746 DBG("Adding PCI host bridge %s\n", dev->full_name);
747
748#ifdef CONFIG_PPC32
749 /* XXX fix this */
750 addr = (struct reg_property *) get_property(dev, "reg", &len);
751 if (addr == NULL || len < sizeof(*addr)) {
752 printk(KERN_WARNING "Can't use %s: no address\n",
753 dev->full_name);
754 return -ENODEV;
755 }
756#endif
757 bus_range = (int *) get_property(dev, "bus-range", &len);
758 if (bus_range == NULL || len < 2 * sizeof(int)) {
759 printk(KERN_WARNING "Can't get bus-range for %s, assume bus 0\n",
760 dev->full_name);
761 }
762
763 hose = pcibios_alloc_controller();
764 if (!hose)
765 return -ENOMEM;
766 hose->arch_data = dev;
767 hose->first_busno = bus_range ? bus_range[0] : 0;
768 hose->last_busno = bus_range ? bus_range[1] : 0xff;
769
770 disp_name = NULL;
771#ifdef CONFIG_POWER4
772 if (device_is_compatible(dev, "u3-agp")) {
773 setup_u3_agp(hose);
774 disp_name = "U3-AGP";
775 primary = 0;
776 } else if (device_is_compatible(dev, "u3-ht")) {
777 setup_u3_ht(hose);
778 disp_name = "U3-HT";
779 primary = 1;
780 }
781 printk(KERN_INFO "Found %s PCI host bridge. Firmware bus number: %d->%d\n",
782 disp_name, hose->first_busno, hose->last_busno);
783#else
784 if (device_is_compatible(dev, "uni-north")) {
785 primary = setup_uninorth(hose, addr);
786 disp_name = "UniNorth";
787 } else if (strcmp(dev->name, "pci") == 0) {
788 /* XXX assume this is a mpc106 (grackle) */
789 setup_grackle(hose);
790 disp_name = "Grackle (MPC106)";
791 } else if (strcmp(dev->name, "bandit") == 0) {
792 setup_bandit(hose, addr);
793 disp_name = "Bandit";
794 } else if (strcmp(dev->name, "chaos") == 0) {
795 setup_chaos(hose, addr);
796 disp_name = "Chaos";
797 primary = 0;
798 }
799 printk(KERN_INFO "Found %s PCI host bridge at 0x%08lx. Firmware bus number: %d->%d\n",
800 disp_name, addr->address, hose->first_busno, hose->last_busno);
801#endif
802 DBG(" ->Hose at 0x%p, cfg_addr=0x%p,cfg_data=0x%p\n",
803 hose, hose->cfg_addr, hose->cfg_data);
804
805 /* Interpret the "ranges" property */
806 /* This also maps the I/O region and sets isa_io/mem_base */
807 pci_process_bridge_OF_ranges(hose, dev, primary);
808
809 /* Fixup "bus-range" OF property */
810 fixup_bus_range(dev);
811
812 return 0;
813}
814
815static void __init
816pcibios_fixup_OF_interrupts(void)
817{
818 struct pci_dev* dev = NULL;
819
820 /*
821 * Open Firmware often doesn't initialize the
822 * PCI_INTERRUPT_LINE config register properly, so we
823 * should find the device node and apply the interrupt
824 * obtained from the OF device-tree
825 */
826 for_each_pci_dev(dev) {
827 struct device_node *node;
828 node = pci_device_to_OF_node(dev);
829 /* this is the node, see if it has interrupts */
830 if (node && node->n_intrs > 0)
831 dev->irq = node->intrs[0].line;
832 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
833 }
834}
835
836void __init
837pmac_pcibios_fixup(void)
838{
839 /* Fixup interrupts according to OF tree */
840 pcibios_fixup_OF_interrupts();
841}
842
843#ifdef CONFIG_PPC64
844static void __init pmac_fixup_phb_resources(void)
845{
846 struct pci_controller *hose, *tmp;
847
848 list_for_each_entry_safe(hose, tmp, &hose_list, list_node) {
849 printk(KERN_INFO "PCI Host %d, io start: %lx; io end: %lx\n",
850 hose->global_number,
851 hose->io_resource.start, hose->io_resource.end);
852 }
853}
854#endif
855
856void __init pmac_pci_init(void)
857{
858 struct device_node *np, *root;
859 struct device_node *ht = NULL;
860
861 root = of_find_node_by_path("/");
862 if (root == NULL) {
863 printk(KERN_CRIT "pmac_pci_init: can't find root "
864 "of device tree\n");
865 return;
866 }
867 for (np = NULL; (np = of_get_next_child(root, np)) != NULL;) {
868 if (np->name == NULL)
869 continue;
870 if (strcmp(np->name, "bandit") == 0
871 || strcmp(np->name, "chaos") == 0
872 || strcmp(np->name, "pci") == 0) {
873 if (add_bridge(np) == 0)
874 of_node_get(np);
875 }
876 if (strcmp(np->name, "ht") == 0) {
877 of_node_get(np);
878 ht = np;
879 }
880 }
881 of_node_put(root);
882
883#ifdef CONFIG_PPC64
884 /* Probe HT last as it relies on the agp resources to be already
885 * setup
886 */
887 if (ht && add_bridge(ht) != 0)
888 of_node_put(ht);
889
890 /*
891 * We need to call pci_setup_phb_io for the HT bridge first
892 * so it gets the I/O port numbers starting at 0, and we
893 * need to call it for the AGP bridge after that so it gets
894 * small positive I/O port numbers.
895 */
896 if (u3_ht)
897 pci_setup_phb_io(u3_ht, 1);
898 if (u3_agp)
899 pci_setup_phb_io(u3_agp, 0);
900
901 /*
902 * On ppc64, fixup the IO resources on our host bridges as
903 * the common code does it only for children of the host bridges
904 */
905 pmac_fixup_phb_resources();
906
907 /* Setup the linkage between OF nodes and PHBs */
908 pci_devs_phb_init();
909
910 /* Fixup the PCI<->OF mapping for U3 AGP due to bus renumbering. We
911 * assume there is no P2P bridge on the AGP bus, which should be a
912 * safe assumptions hopefully.
913 */
914 if (u3_agp) {
915 struct device_node *np = u3_agp->arch_data;
916 PCI_DN(np)->busno = 0xf0;
917 for (np = np->child; np; np = np->sibling)
918 PCI_DN(np)->busno = 0xf0;
919 }
920
921 /* map in PCI I/O space */
922 phbs_remap_io();
923
924 /* pmac_check_ht_link(); */
925
926 /* Tell pci.c to not use the common resource allocation mechanism */
927 pci_probe_only = 1;
928
929 /* Allow all IO */
930 io_page_mask = -1;
931
932#else /* CONFIG_PPC64 */
933 init_p2pbridge();
934 fixup_nec_usb2();
935
936 /* We are still having some issues with the Xserve G4, enabling
937 * some offset between bus number and domains for now when we
938 * assign all busses should help for now
939 */
940 if (pci_assign_all_buses)
941 pcibios_assign_bus_offset = 0x10;
942#endif
943}
944
945int
946pmac_pci_enable_device_hook(struct pci_dev *dev, int initial)
947{
948 struct device_node* node;
949 int updatecfg = 0;
950 int uninorth_child;
951
952 node = pci_device_to_OF_node(dev);
953
954 /* We don't want to enable USB controllers absent from the OF tree
955 * (iBook second controller)
956 */
957 if (dev->vendor == PCI_VENDOR_ID_APPLE
958 && (dev->class == ((PCI_CLASS_SERIAL_USB << 8) | 0x10))
959 && !node) {
960 printk(KERN_INFO "Apple USB OHCI %s disabled by firmware\n",
961 pci_name(dev));
962 return -EINVAL;
963 }
964
965 if (!node)
966 return 0;
967
968 uninorth_child = node->parent &&
969 device_is_compatible(node->parent, "uni-north");
970
971 /* Firewire & GMAC were disabled after PCI probe, the driver is
972 * claiming them, we must re-enable them now.
973 */
974 if (uninorth_child && !strcmp(node->name, "firewire") &&
975 (device_is_compatible(node, "pci106b,18") ||
976 device_is_compatible(node, "pci106b,30") ||
977 device_is_compatible(node, "pci11c1,5811"))) {
978 pmac_call_feature(PMAC_FTR_1394_CABLE_POWER, node, 0, 1);
979 pmac_call_feature(PMAC_FTR_1394_ENABLE, node, 0, 1);
980 updatecfg = 1;
981 }
982 if (uninorth_child && !strcmp(node->name, "ethernet") &&
983 device_is_compatible(node, "gmac")) {
984 pmac_call_feature(PMAC_FTR_GMAC_ENABLE, node, 0, 1);
985 updatecfg = 1;
986 }
987
988 if (updatecfg) {
989 u16 cmd;
990
991 /*
992 * Make sure PCI is correctly configured
993 *
994 * We use old pci_bios versions of the function since, by
995 * default, gmac is not powered up, and so will be absent
996 * from the kernel initial PCI lookup.
997 *
998 * Should be replaced by 2.4 new PCI mechanisms and really
999 * register the device.
1000 */
1001 pci_read_config_word(dev, PCI_COMMAND, &cmd);
1002 cmd |= PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER
1003 | PCI_COMMAND_INVALIDATE;
1004 pci_write_config_word(dev, PCI_COMMAND, cmd);
1005 pci_write_config_byte(dev, PCI_LATENCY_TIMER, 16);
1006 pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE,
1007 L1_CACHE_BYTES >> 2);
1008 }
1009
1010 return 0;
1011}
1012
1013/* We power down some devices after they have been probed. They'll
1014 * be powered back on later on
1015 */
1016void __init pmac_pcibios_after_init(void)
1017{
1018 struct device_node* nd;
1019
1020#ifdef CONFIG_BLK_DEV_IDE
1021 struct pci_dev *dev = NULL;
1022
1023 /* OF fails to initialize IDE controllers on macs
1024 * (and maybe other machines)
1025 *
1026 * Ideally, this should be moved to the IDE layer, but we need
1027 * to check specifically with Andre Hedrick how to do it cleanly
1028 * since the common IDE code seem to care about the fact that the
1029 * BIOS may have disabled a controller.
1030 *
1031 * -- BenH
1032 */
1033 for_each_pci_dev(dev) {
1034 if ((dev->class >> 16) == PCI_BASE_CLASS_STORAGE)
1035 pci_enable_device(dev);
1036 }
1037#endif /* CONFIG_BLK_DEV_IDE */
1038
1039 nd = find_devices("firewire");
1040 while (nd) {
1041 if (nd->parent && (device_is_compatible(nd, "pci106b,18") ||
1042 device_is_compatible(nd, "pci106b,30") ||
1043 device_is_compatible(nd, "pci11c1,5811"))
1044 && device_is_compatible(nd->parent, "uni-north")) {
1045 pmac_call_feature(PMAC_FTR_1394_ENABLE, nd, 0, 0);
1046 pmac_call_feature(PMAC_FTR_1394_CABLE_POWER, nd, 0, 0);
1047 }
1048 nd = nd->next;
1049 }
1050 nd = find_devices("ethernet");
1051 while (nd) {
1052 if (nd->parent && device_is_compatible(nd, "gmac")
1053 && device_is_compatible(nd->parent, "uni-north"))
1054 pmac_call_feature(PMAC_FTR_GMAC_ENABLE, nd, 0, 0);
1055 nd = nd->next;
1056 }
1057}
1058
1059#ifdef CONFIG_PPC32
1060void pmac_pci_fixup_cardbus(struct pci_dev* dev)
1061{
1062 if (_machine != _MACH_Pmac)
1063 return;
1064 /*
1065 * Fix the interrupt routing on the various cardbus bridges
1066 * used on powerbooks
1067 */
1068 if (dev->vendor != PCI_VENDOR_ID_TI)
1069 return;
1070 if (dev->device == PCI_DEVICE_ID_TI_1130 ||
1071 dev->device == PCI_DEVICE_ID_TI_1131) {
1072 u8 val;
1073 /* Enable PCI interrupt */
1074 if (pci_read_config_byte(dev, 0x91, &val) == 0)
1075 pci_write_config_byte(dev, 0x91, val | 0x30);
1076 /* Disable ISA interrupt mode */
1077 if (pci_read_config_byte(dev, 0x92, &val) == 0)
1078 pci_write_config_byte(dev, 0x92, val & ~0x06);
1079 }
1080 if (dev->device == PCI_DEVICE_ID_TI_1210 ||
1081 dev->device == PCI_DEVICE_ID_TI_1211 ||
1082 dev->device == PCI_DEVICE_ID_TI_1410 ||
1083 dev->device == PCI_DEVICE_ID_TI_1510) {
1084 u8 val;
1085 /* 0x8c == TI122X_IRQMUX, 2 says to route the INTA
1086 signal out the MFUNC0 pin */
1087 if (pci_read_config_byte(dev, 0x8c, &val) == 0)
1088 pci_write_config_byte(dev, 0x8c, (val & ~0x0f) | 2);
1089 /* Disable ISA interrupt mode */
1090 if (pci_read_config_byte(dev, 0x92, &val) == 0)
1091 pci_write_config_byte(dev, 0x92, val & ~0x06);
1092 }
1093}
1094
1095DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_TI, PCI_ANY_ID, pmac_pci_fixup_cardbus);
1096
1097void pmac_pci_fixup_pciata(struct pci_dev* dev)
1098{
1099 u8 progif = 0;
1100
1101 /*
1102 * On PowerMacs, we try to switch any PCI ATA controller to
1103 * fully native mode
1104 */
1105 if (_machine != _MACH_Pmac)
1106 return;
1107 /* Some controllers don't have the class IDE */
1108 if (dev->vendor == PCI_VENDOR_ID_PROMISE)
1109 switch(dev->device) {
1110 case PCI_DEVICE_ID_PROMISE_20246:
1111 case PCI_DEVICE_ID_PROMISE_20262:
1112 case PCI_DEVICE_ID_PROMISE_20263:
1113 case PCI_DEVICE_ID_PROMISE_20265:
1114 case PCI_DEVICE_ID_PROMISE_20267:
1115 case PCI_DEVICE_ID_PROMISE_20268:
1116 case PCI_DEVICE_ID_PROMISE_20269:
1117 case PCI_DEVICE_ID_PROMISE_20270:
1118 case PCI_DEVICE_ID_PROMISE_20271:
1119 case PCI_DEVICE_ID_PROMISE_20275:
1120 case PCI_DEVICE_ID_PROMISE_20276:
1121 case PCI_DEVICE_ID_PROMISE_20277:
1122 goto good;
1123 }
1124 /* Others, check PCI class */
1125 if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE)
1126 return;
1127 good:
1128 pci_read_config_byte(dev, PCI_CLASS_PROG, &progif);
1129 if ((progif & 5) != 5) {
1130 printk(KERN_INFO "Forcing PCI IDE into native mode: %s\n", pci_name(dev));
1131 (void) pci_write_config_byte(dev, PCI_CLASS_PROG, progif|5);
1132 if (pci_read_config_byte(dev, PCI_CLASS_PROG, &progif) ||
1133 (progif & 5) != 5)
1134 printk(KERN_ERR "Rewrite of PROGIF failed !\n");
1135 }
1136}
1137DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, pmac_pci_fixup_pciata);
1138#endif
1139
1140/*
1141 * Disable second function on K2-SATA, it's broken
1142 * and disable IO BARs on first one
1143 */
1144static void fixup_k2_sata(struct pci_dev* dev)
1145{
1146 int i;
1147 u16 cmd;
1148
1149 if (PCI_FUNC(dev->devfn) > 0) {
1150 pci_read_config_word(dev, PCI_COMMAND, &cmd);
1151 cmd &= ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY);
1152 pci_write_config_word(dev, PCI_COMMAND, cmd);
1153 for (i = 0; i < 6; i++) {
1154 dev->resource[i].start = dev->resource[i].end = 0;
1155 dev->resource[i].flags = 0;
1156 pci_write_config_dword(dev, PCI_BASE_ADDRESS_0 + 4 * i, 0);
1157 }
1158 } else {
1159 pci_read_config_word(dev, PCI_COMMAND, &cmd);
1160 cmd &= ~PCI_COMMAND_IO;
1161 pci_write_config_word(dev, PCI_COMMAND, cmd);
1162 for (i = 0; i < 5; i++) {
1163 dev->resource[i].start = dev->resource[i].end = 0;
1164 dev->resource[i].flags = 0;
1165 pci_write_config_dword(dev, PCI_BASE_ADDRESS_0 + 4 * i, 0);
1166 }
1167 }
1168}
1169DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SERVERWORKS, 0x0240, fixup_k2_sata);
1170
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c
new file mode 100644
index 000000000000..0037a8c8c81f
--- /dev/null
+++ b/arch/powerpc/platforms/powermac/pic.c
@@ -0,0 +1,678 @@
1/*
2 * Support for the interrupt controllers found on Power Macintosh,
3 * currently Apple's "Grand Central" interrupt controller in all
4 * it's incarnations. OpenPIC support used on newer machines is
5 * in a separate file
6 *
7 * Copyright (C) 1997 Paul Mackerras (paulus@samba.org)
8 *
9 * Maintained by Benjamin Herrenschmidt (benh@kernel.crashing.org)
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 */
17
18#include <linux/config.h>
19#include <linux/stddef.h>
20#include <linux/init.h>
21#include <linux/sched.h>
22#include <linux/signal.h>
23#include <linux/pci.h>
24#include <linux/interrupt.h>
25#include <linux/sysdev.h>
26#include <linux/adb.h>
27#include <linux/pmu.h>
28#include <linux/module.h>
29
30#include <asm/sections.h>
31#include <asm/io.h>
32#include <asm/smp.h>
33#include <asm/prom.h>
34#include <asm/pci-bridge.h>
35#include <asm/time.h>
36#include <asm/pmac_feature.h>
37#include <asm/mpic.h>
38
39#include "pmac.h"
40
41/*
42 * XXX this should be in xmon.h, but putting it there means xmon.h
43 * has to include <linux/interrupt.h> (to get irqreturn_t), which
44 * causes all sorts of problems. -- paulus
45 */
46extern irqreturn_t xmon_irq(int, void *, struct pt_regs *);
47
48#ifdef CONFIG_PPC32
49struct pmac_irq_hw {
50 unsigned int event;
51 unsigned int enable;
52 unsigned int ack;
53 unsigned int level;
54};
55
56/* Default addresses */
57static volatile struct pmac_irq_hw *pmac_irq_hw[4] = {
58 (struct pmac_irq_hw *) 0xf3000020,
59 (struct pmac_irq_hw *) 0xf3000010,
60 (struct pmac_irq_hw *) 0xf4000020,
61 (struct pmac_irq_hw *) 0xf4000010,
62};
63
64#define GC_LEVEL_MASK 0x3ff00000
65#define OHARE_LEVEL_MASK 0x1ff00000
66#define HEATHROW_LEVEL_MASK 0x1ff00000
67
68static int max_irqs;
69static int max_real_irqs;
70static u32 level_mask[4];
71
72static DEFINE_SPINLOCK(pmac_pic_lock);
73
74#define GATWICK_IRQ_POOL_SIZE 10
75static struct interrupt_info gatwick_int_pool[GATWICK_IRQ_POOL_SIZE];
76
77/*
78 * Mark an irq as "lost". This is only used on the pmac
79 * since it can lose interrupts (see pmac_set_irq_mask).
80 * -- Cort
81 */
82void
83__set_lost(unsigned long irq_nr, int nokick)
84{
85 if (!test_and_set_bit(irq_nr, ppc_lost_interrupts)) {
86 atomic_inc(&ppc_n_lost_interrupts);
87 if (!nokick)
88 set_dec(1);
89 }
90}
91
92static void
93pmac_mask_and_ack_irq(unsigned int irq_nr)
94{
95 unsigned long bit = 1UL << (irq_nr & 0x1f);
96 int i = irq_nr >> 5;
97 unsigned long flags;
98
99 if ((unsigned)irq_nr >= max_irqs)
100 return;
101
102 clear_bit(irq_nr, ppc_cached_irq_mask);
103 if (test_and_clear_bit(irq_nr, ppc_lost_interrupts))
104 atomic_dec(&ppc_n_lost_interrupts);
105 spin_lock_irqsave(&pmac_pic_lock, flags);
106 out_le32(&pmac_irq_hw[i]->enable, ppc_cached_irq_mask[i]);
107 out_le32(&pmac_irq_hw[i]->ack, bit);
108 do {
109 /* make sure ack gets to controller before we enable
110 interrupts */
111 mb();
112 } while((in_le32(&pmac_irq_hw[i]->enable) & bit)
113 != (ppc_cached_irq_mask[i] & bit));
114 spin_unlock_irqrestore(&pmac_pic_lock, flags);
115}
116
117static void pmac_set_irq_mask(unsigned int irq_nr, int nokicklost)
118{
119 unsigned long bit = 1UL << (irq_nr & 0x1f);
120 int i = irq_nr >> 5;
121 unsigned long flags;
122
123 if ((unsigned)irq_nr >= max_irqs)
124 return;
125
126 spin_lock_irqsave(&pmac_pic_lock, flags);
127 /* enable unmasked interrupts */
128 out_le32(&pmac_irq_hw[i]->enable, ppc_cached_irq_mask[i]);
129
130 do {
131 /* make sure mask gets to controller before we
132 return to user */
133 mb();
134 } while((in_le32(&pmac_irq_hw[i]->enable) & bit)
135 != (ppc_cached_irq_mask[i] & bit));
136
137 /*
138 * Unfortunately, setting the bit in the enable register
139 * when the device interrupt is already on *doesn't* set
140 * the bit in the flag register or request another interrupt.
141 */
142 if (bit & ppc_cached_irq_mask[i] & in_le32(&pmac_irq_hw[i]->level))
143 __set_lost((ulong)irq_nr, nokicklost);
144 spin_unlock_irqrestore(&pmac_pic_lock, flags);
145}
146
147/* When an irq gets requested for the first client, if it's an
148 * edge interrupt, we clear any previous one on the controller
149 */
150static unsigned int pmac_startup_irq(unsigned int irq_nr)
151{
152 unsigned long bit = 1UL << (irq_nr & 0x1f);
153 int i = irq_nr >> 5;
154
155 if ((irq_desc[irq_nr].status & IRQ_LEVEL) == 0)
156 out_le32(&pmac_irq_hw[i]->ack, bit);
157 set_bit(irq_nr, ppc_cached_irq_mask);
158 pmac_set_irq_mask(irq_nr, 0);
159
160 return 0;
161}
162
163static void pmac_mask_irq(unsigned int irq_nr)
164{
165 clear_bit(irq_nr, ppc_cached_irq_mask);
166 pmac_set_irq_mask(irq_nr, 0);
167 mb();
168}
169
170static void pmac_unmask_irq(unsigned int irq_nr)
171{
172 set_bit(irq_nr, ppc_cached_irq_mask);
173 pmac_set_irq_mask(irq_nr, 0);
174}
175
176static void pmac_end_irq(unsigned int irq_nr)
177{
178 if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS))
179 && irq_desc[irq_nr].action) {
180 set_bit(irq_nr, ppc_cached_irq_mask);
181 pmac_set_irq_mask(irq_nr, 1);
182 }
183}
184
185
186struct hw_interrupt_type pmac_pic = {
187 .typename = " PMAC-PIC ",
188 .startup = pmac_startup_irq,
189 .enable = pmac_unmask_irq,
190 .disable = pmac_mask_irq,
191 .ack = pmac_mask_and_ack_irq,
192 .end = pmac_end_irq,
193};
194
195struct hw_interrupt_type gatwick_pic = {
196 .typename = " GATWICK ",
197 .startup = pmac_startup_irq,
198 .enable = pmac_unmask_irq,
199 .disable = pmac_mask_irq,
200 .ack = pmac_mask_and_ack_irq,
201 .end = pmac_end_irq,
202};
203
204static irqreturn_t gatwick_action(int cpl, void *dev_id, struct pt_regs *regs)
205{
206 int irq, bits;
207
208 for (irq = max_irqs; (irq -= 32) >= max_real_irqs; ) {
209 int i = irq >> 5;
210 bits = in_le32(&pmac_irq_hw[i]->event) | ppc_lost_interrupts[i];
211 /* We must read level interrupts from the level register */
212 bits |= (in_le32(&pmac_irq_hw[i]->level) & level_mask[i]);
213 bits &= ppc_cached_irq_mask[i];
214 if (bits == 0)
215 continue;
216 irq += __ilog2(bits);
217 __do_IRQ(irq, regs);
218 return IRQ_HANDLED;
219 }
220 printk("gatwick irq not from gatwick pic\n");
221 return IRQ_NONE;
222}
223
224int
225pmac_get_irq(struct pt_regs *regs)
226{
227 int irq;
228 unsigned long bits = 0;
229
230#ifdef CONFIG_SMP
231 void psurge_smp_message_recv(struct pt_regs *);
232
233 /* IPI's are a hack on the powersurge -- Cort */
234 if ( smp_processor_id() != 0 ) {
235 psurge_smp_message_recv(regs);
236 return -2; /* ignore, already handled */
237 }
238#endif /* CONFIG_SMP */
239 for (irq = max_real_irqs; (irq -= 32) >= 0; ) {
240 int i = irq >> 5;
241 bits = in_le32(&pmac_irq_hw[i]->event) | ppc_lost_interrupts[i];
242 /* We must read level interrupts from the level register */
243 bits |= (in_le32(&pmac_irq_hw[i]->level) & level_mask[i]);
244 bits &= ppc_cached_irq_mask[i];
245 if (bits == 0)
246 continue;
247 irq += __ilog2(bits);
248 break;
249 }
250
251 return irq;
252}
253
254/* This routine will fix some missing interrupt values in the device tree
255 * on the gatwick mac-io controller used by some PowerBooks
256 */
257static void __init
258pmac_fix_gatwick_interrupts(struct device_node *gw, int irq_base)
259{
260 struct device_node *node;
261 int count;
262
263 memset(gatwick_int_pool, 0, sizeof(gatwick_int_pool));
264 node = gw->child;
265 count = 0;
266 while(node)
267 {
268 /* Fix SCC */
269 if (strcasecmp(node->name, "escc") == 0)
270 if (node->child) {
271 if (node->child->n_intrs < 3) {
272 node->child->intrs = &gatwick_int_pool[count];
273 count += 3;
274 }
275 node->child->n_intrs = 3;
276 node->child->intrs[0].line = 15+irq_base;
277 node->child->intrs[1].line = 4+irq_base;
278 node->child->intrs[2].line = 5+irq_base;
279 printk(KERN_INFO "irq: fixed SCC on second controller (%d,%d,%d)\n",
280 node->child->intrs[0].line,
281 node->child->intrs[1].line,
282 node->child->intrs[2].line);
283 }
284 /* Fix media-bay & left SWIM */
285 if (strcasecmp(node->name, "media-bay") == 0) {
286 struct device_node* ya_node;
287
288 if (node->n_intrs == 0)
289 node->intrs = &gatwick_int_pool[count++];
290 node->n_intrs = 1;
291 node->intrs[0].line = 29+irq_base;
292 printk(KERN_INFO "irq: fixed media-bay on second controller (%d)\n",
293 node->intrs[0].line);
294
295 ya_node = node->child;
296 while(ya_node)
297 {
298 if (strcasecmp(ya_node->name, "floppy") == 0) {
299 if (ya_node->n_intrs < 2) {
300 ya_node->intrs = &gatwick_int_pool[count];
301 count += 2;
302 }
303 ya_node->n_intrs = 2;
304 ya_node->intrs[0].line = 19+irq_base;
305 ya_node->intrs[1].line = 1+irq_base;
306 printk(KERN_INFO "irq: fixed floppy on second controller (%d,%d)\n",
307 ya_node->intrs[0].line, ya_node->intrs[1].line);
308 }
309 if (strcasecmp(ya_node->name, "ata4") == 0) {
310 if (ya_node->n_intrs < 2) {
311 ya_node->intrs = &gatwick_int_pool[count];
312 count += 2;
313 }
314 ya_node->n_intrs = 2;
315 ya_node->intrs[0].line = 14+irq_base;
316 ya_node->intrs[1].line = 3+irq_base;
317 printk(KERN_INFO "irq: fixed ide on second controller (%d,%d)\n",
318 ya_node->intrs[0].line, ya_node->intrs[1].line);
319 }
320 ya_node = ya_node->sibling;
321 }
322 }
323 node = node->sibling;
324 }
325 if (count > 10) {
326 printk("WARNING !! Gatwick interrupt pool overflow\n");
327 printk(" GATWICK_IRQ_POOL_SIZE = %d\n", GATWICK_IRQ_POOL_SIZE);
328 printk(" requested = %d\n", count);
329 }
330}
331
332/*
333 * The PowerBook 3400/2400/3500 can have a combo ethernet/modem
334 * card which includes an ohare chip that acts as a second interrupt
335 * controller. If we find this second ohare, set it up and fix the
336 * interrupt value in the device tree for the ethernet chip.
337 */
338static int __init enable_second_ohare(void)
339{
340 unsigned char bus, devfn;
341 unsigned short cmd;
342 unsigned long addr;
343 struct device_node *irqctrler = find_devices("pci106b,7");
344 struct device_node *ether;
345
346 if (irqctrler == NULL || irqctrler->n_addrs <= 0)
347 return -1;
348 addr = (unsigned long) ioremap(irqctrler->addrs[0].address, 0x40);
349 pmac_irq_hw[1] = (volatile struct pmac_irq_hw *)(addr + 0x20);
350 max_irqs = 64;
351 if (pci_device_from_OF_node(irqctrler, &bus, &devfn) == 0) {
352 struct pci_controller* hose = pci_find_hose_for_OF_device(irqctrler);
353 if (!hose)
354 printk(KERN_ERR "Can't find PCI hose for OHare2 !\n");
355 else {
356 early_read_config_word(hose, bus, devfn, PCI_COMMAND, &cmd);
357 cmd |= PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER;
358 cmd &= ~PCI_COMMAND_IO;
359 early_write_config_word(hose, bus, devfn, PCI_COMMAND, cmd);
360 }
361 }
362
363 /* Fix interrupt for the modem/ethernet combo controller. The number
364 in the device tree (27) is bogus (correct for the ethernet-only
365 board but not the combo ethernet/modem board).
366 The real interrupt is 28 on the second controller -> 28+32 = 60.
367 */
368 ether = find_devices("pci1011,14");
369 if (ether && ether->n_intrs > 0) {
370 ether->intrs[0].line = 60;
371 printk(KERN_INFO "irq: Fixed ethernet IRQ to %d\n",
372 ether->intrs[0].line);
373 }
374
375 /* Return the interrupt number of the cascade */
376 return irqctrler->intrs[0].line;
377}
378
379#ifdef CONFIG_XMON
380static struct irqaction xmon_action = {
381 .handler = xmon_irq,
382 .flags = 0,
383 .mask = CPU_MASK_NONE,
384 .name = "NMI - XMON"
385};
386#endif
387
388static struct irqaction gatwick_cascade_action = {
389 .handler = gatwick_action,
390 .flags = SA_INTERRUPT,
391 .mask = CPU_MASK_NONE,
392 .name = "cascade",
393};
394#endif /* CONFIG_PPC32 */
395
396static int pmac_u3_cascade(struct pt_regs *regs, void *data)
397{
398 return mpic_get_one_irq((struct mpic *)data, regs);
399}
400
401void __init pmac_pic_init(void)
402{
403 struct device_node *irqctrler = NULL;
404 struct device_node *irqctrler2 = NULL;
405 struct device_node *np;
406#ifdef CONFIG_PPC32
407 int i;
408 unsigned long addr;
409 int irq_cascade = -1;
410#endif
411 struct mpic *mpic1, *mpic2;
412
413 /* We first try to detect Apple's new Core99 chipset, since mac-io
414 * is quite different on those machines and contains an IBM MPIC2.
415 */
416 np = find_type_devices("open-pic");
417 while (np) {
418 if (np->parent && !strcmp(np->parent->name, "u3"))
419 irqctrler2 = np;
420 else
421 irqctrler = np;
422 np = np->next;
423 }
424 if (irqctrler != NULL && irqctrler->n_addrs > 0) {
425 unsigned char senses[128];
426
427 printk(KERN_INFO "PowerMac using OpenPIC irq controller at 0x%08x\n",
428 (unsigned int)irqctrler->addrs[0].address);
429 pmac_call_feature(PMAC_FTR_ENABLE_MPIC, irqctrler, 0, 0);
430
431 prom_get_irq_senses(senses, 0, 128);
432 mpic1 = mpic_alloc(irqctrler->addrs[0].address,
433 MPIC_PRIMARY | MPIC_WANTS_RESET,
434 0, 0, 128, 252, senses, 128, " OpenPIC ");
435 BUG_ON(mpic1 == NULL);
436 mpic_init(mpic1);
437
438 if (irqctrler2 != NULL && irqctrler2->n_intrs > 0 &&
439 irqctrler2->n_addrs > 0) {
440 printk(KERN_INFO "Slave OpenPIC at 0x%08x hooked on IRQ %d\n",
441 (u32)irqctrler2->addrs[0].address,
442 irqctrler2->intrs[0].line);
443
444 pmac_call_feature(PMAC_FTR_ENABLE_MPIC, irqctrler2, 0, 0);
445 prom_get_irq_senses(senses, 128, 128 + 124);
446
447 /* We don't need to set MPIC_BROKEN_U3 here since we don't have
448 * hypertransport interrupts routed to it
449 */
450 mpic2 = mpic_alloc(irqctrler2->addrs[0].address,
451 MPIC_BIG_ENDIAN | MPIC_WANTS_RESET,
452 0, 128, 124, 0, senses, 124,
453 " U3-MPIC ");
454 BUG_ON(mpic2 == NULL);
455 mpic_init(mpic2);
456 mpic_setup_cascade(irqctrler2->intrs[0].line,
457 pmac_u3_cascade, mpic2);
458 }
459#if defined(CONFIG_XMON) && defined(CONFIG_PPC32)
460 {
461 struct device_node* pswitch;
462 int nmi_irq;
463
464 pswitch = find_devices("programmer-switch");
465 if (pswitch && pswitch->n_intrs) {
466 nmi_irq = pswitch->intrs[0].line;
467 mpic_irq_set_priority(nmi_irq, 9);
468 setup_irq(nmi_irq, &xmon_action);
469 }
470 }
471#endif /* CONFIG_XMON */
472 return;
473 }
474 irqctrler = NULL;
475
476#ifdef CONFIG_PPC32
477 /* Get the level/edge settings, assume if it's not
478 * a Grand Central nor an OHare, then it's an Heathrow
479 * (or Paddington).
480 */
481 ppc_md.get_irq = pmac_get_irq;
482 if (find_devices("gc"))
483 level_mask[0] = GC_LEVEL_MASK;
484 else if (find_devices("ohare")) {
485 level_mask[0] = OHARE_LEVEL_MASK;
486 /* We might have a second cascaded ohare */
487 level_mask[1] = OHARE_LEVEL_MASK;
488 } else {
489 level_mask[0] = HEATHROW_LEVEL_MASK;
490 level_mask[1] = 0;
491 /* We might have a second cascaded heathrow */
492 level_mask[2] = HEATHROW_LEVEL_MASK;
493 level_mask[3] = 0;
494 }
495
496 /*
497 * G3 powermacs and 1999 G3 PowerBooks have 64 interrupts,
498 * 1998 G3 Series PowerBooks have 128,
499 * other powermacs have 32.
500 * The combo ethernet/modem card for the Powerstar powerbooks
501 * (2400/3400/3500, ohare based) has a second ohare chip
502 * effectively making a total of 64.
503 */
504 max_irqs = max_real_irqs = 32;
505 irqctrler = find_devices("mac-io");
506 if (irqctrler)
507 {
508 max_real_irqs = 64;
509 if (irqctrler->next)
510 max_irqs = 128;
511 else
512 max_irqs = 64;
513 }
514 for ( i = 0; i < max_real_irqs ; i++ )
515 irq_desc[i].handler = &pmac_pic;
516
517 /* get addresses of first controller */
518 if (irqctrler) {
519 if (irqctrler->n_addrs > 0) {
520 addr = (unsigned long)
521 ioremap(irqctrler->addrs[0].address, 0x40);
522 for (i = 0; i < 2; ++i)
523 pmac_irq_hw[i] = (volatile struct pmac_irq_hw*)
524 (addr + (2 - i) * 0x10);
525 }
526
527 /* get addresses of second controller */
528 irqctrler = irqctrler->next;
529 if (irqctrler && irqctrler->n_addrs > 0) {
530 addr = (unsigned long)
531 ioremap(irqctrler->addrs[0].address, 0x40);
532 for (i = 2; i < 4; ++i)
533 pmac_irq_hw[i] = (volatile struct pmac_irq_hw*)
534 (addr + (4 - i) * 0x10);
535 irq_cascade = irqctrler->intrs[0].line;
536 if (device_is_compatible(irqctrler, "gatwick"))
537 pmac_fix_gatwick_interrupts(irqctrler, max_real_irqs);
538 }
539 } else {
540 /* older powermacs have a GC (grand central) or ohare at
541 f3000000, with interrupt control registers at f3000020. */
542 addr = (unsigned long) ioremap(0xf3000000, 0x40);
543 pmac_irq_hw[0] = (volatile struct pmac_irq_hw *) (addr + 0x20);
544 }
545
546 /* PowerBooks 3400 and 3500 can have a second controller in a second
547 ohare chip, on the combo ethernet/modem card */
548 if (machine_is_compatible("AAPL,3400/2400")
549 || machine_is_compatible("AAPL,3500"))
550 irq_cascade = enable_second_ohare();
551
552 /* disable all interrupts in all controllers */
553 for (i = 0; i * 32 < max_irqs; ++i)
554 out_le32(&pmac_irq_hw[i]->enable, 0);
555 /* mark level interrupts */
556 for (i = 0; i < max_irqs; i++)
557 if (level_mask[i >> 5] & (1UL << (i & 0x1f)))
558 irq_desc[i].status = IRQ_LEVEL;
559
560 /* get interrupt line of secondary interrupt controller */
561 if (irq_cascade >= 0) {
562 printk(KERN_INFO "irq: secondary controller on irq %d\n",
563 (int)irq_cascade);
564 for ( i = max_real_irqs ; i < max_irqs ; i++ )
565 irq_desc[i].handler = &gatwick_pic;
566 setup_irq(irq_cascade, &gatwick_cascade_action);
567 }
568 printk("System has %d possible interrupts\n", max_irqs);
569 if (max_irqs != max_real_irqs)
570 printk(KERN_DEBUG "%d interrupts on main controller\n",
571 max_real_irqs);
572
573#ifdef CONFIG_XMON
574 setup_irq(20, &xmon_action);
575#endif /* CONFIG_XMON */
576#endif /* CONFIG_PPC32 */
577}
578
579#ifdef CONFIG_PM
580/*
581 * These procedures are used in implementing sleep on the powerbooks.
582 * sleep_save_intrs() saves the states of all interrupt enables
583 * and disables all interrupts except for the nominated one.
584 * sleep_restore_intrs() restores the states of all interrupt enables.
585 */
586unsigned long sleep_save_mask[2];
587
588/* This used to be passed by the PMU driver but that link got
589 * broken with the new driver model. We use this tweak for now...
590 */
591static int pmacpic_find_viaint(void)
592{
593 int viaint = -1;
594
595#ifdef CONFIG_ADB_PMU
596 struct device_node *np;
597
598 if (pmu_get_model() != PMU_OHARE_BASED)
599 goto not_found;
600 np = of_find_node_by_name(NULL, "via-pmu");
601 if (np == NULL)
602 goto not_found;
603 viaint = np->intrs[0].line;
604#endif /* CONFIG_ADB_PMU */
605
606not_found:
607 return viaint;
608}
609
610static int pmacpic_suspend(struct sys_device *sysdev, pm_message_t state)
611{
612 int viaint = pmacpic_find_viaint();
613
614 sleep_save_mask[0] = ppc_cached_irq_mask[0];
615 sleep_save_mask[1] = ppc_cached_irq_mask[1];
616 ppc_cached_irq_mask[0] = 0;
617 ppc_cached_irq_mask[1] = 0;
618 if (viaint > 0)
619 set_bit(viaint, ppc_cached_irq_mask);
620 out_le32(&pmac_irq_hw[0]->enable, ppc_cached_irq_mask[0]);
621 if (max_real_irqs > 32)
622 out_le32(&pmac_irq_hw[1]->enable, ppc_cached_irq_mask[1]);
623 (void)in_le32(&pmac_irq_hw[0]->event);
624 /* make sure mask gets to controller before we return to caller */
625 mb();
626 (void)in_le32(&pmac_irq_hw[0]->enable);
627
628 return 0;
629}
630
631static int pmacpic_resume(struct sys_device *sysdev)
632{
633 int i;
634
635 out_le32(&pmac_irq_hw[0]->enable, 0);
636 if (max_real_irqs > 32)
637 out_le32(&pmac_irq_hw[1]->enable, 0);
638 mb();
639 for (i = 0; i < max_real_irqs; ++i)
640 if (test_bit(i, sleep_save_mask))
641 pmac_unmask_irq(i);
642
643 return 0;
644}
645
646#endif /* CONFIG_PM */
647
648static struct sysdev_class pmacpic_sysclass = {
649 set_kset_name("pmac_pic"),
650};
651
652static struct sys_device device_pmacpic = {
653 .id = 0,
654 .cls = &pmacpic_sysclass,
655};
656
657static struct sysdev_driver driver_pmacpic = {
658#ifdef CONFIG_PM
659 .suspend = &pmacpic_suspend,
660 .resume = &pmacpic_resume,
661#endif /* CONFIG_PM */
662};
663
664static int __init init_pmacpic_sysfs(void)
665{
666#ifdef CONFIG_PPC32
667 if (max_irqs == 0)
668 return -ENODEV;
669#endif
670 printk(KERN_DEBUG "Registering pmac pic with sysfs...\n");
671 sysdev_class_register(&pmacpic_sysclass);
672 sysdev_register(&device_pmacpic);
673 sysdev_driver_register(&pmacpic_sysclass, &driver_pmacpic);
674 return 0;
675}
676
677subsys_initcall(init_pmacpic_sysfs);
678
diff --git a/arch/powerpc/platforms/powermac/pic.h b/arch/powerpc/platforms/powermac/pic.h
new file mode 100644
index 000000000000..664103dfeef9
--- /dev/null
+++ b/arch/powerpc/platforms/powermac/pic.h
@@ -0,0 +1,11 @@
1#ifndef __PPC_PLATFORMS_PMAC_PIC_H
2#define __PPC_PLATFORMS_PMAC_PIC_H
3
4#include <linux/irq.h>
5
6extern struct hw_interrupt_type pmac_pic;
7
8void pmac_pic_init(void);
9int pmac_get_irq(struct pt_regs *regs);
10
11#endif /* __PPC_PLATFORMS_PMAC_PIC_H */
diff --git a/arch/powerpc/platforms/powermac/pmac.h b/arch/powerpc/platforms/powermac/pmac.h
new file mode 100644
index 000000000000..2ad25e13423e
--- /dev/null
+++ b/arch/powerpc/platforms/powermac/pmac.h
@@ -0,0 +1,51 @@
1#ifndef __PMAC_H__
2#define __PMAC_H__
3
4#include <linux/pci.h>
5#include <linux/ide.h>
6#include <linux/irq.h>
7
8/*
9 * Declaration for the various functions exported by the
10 * pmac_* files. Mostly for use by pmac_setup
11 */
12
13struct rtc_time;
14
15extern long pmac_time_init(void);
16extern unsigned long pmac_get_boot_time(void);
17extern void pmac_get_rtc_time(struct rtc_time *);
18extern int pmac_set_rtc_time(struct rtc_time *);
19extern void pmac_read_rtc_time(void);
20extern void pmac_calibrate_decr(void);
21extern void pmac_pcibios_fixup(void);
22extern void pmac_pci_init(void);
23extern unsigned long pmac_ide_get_base(int index);
24extern void pmac_ide_init_hwif_ports(hw_regs_t *hw,
25 unsigned long data_port, unsigned long ctrl_port, int *irq);
26
27extern void pmac_nvram_update(void);
28extern unsigned char pmac_nvram_read_byte(int addr);
29extern void pmac_nvram_write_byte(int addr, unsigned char val);
30extern int pmac_pci_enable_device_hook(struct pci_dev *dev, int initial);
31extern void pmac_pcibios_after_init(void);
32extern int of_show_percpuinfo(struct seq_file *m, int i);
33
34extern void pmac_pci_init(void);
35extern void pmac_setup_pci_dma(void);
36extern void pmac_check_ht_link(void);
37
38extern void pmac_setup_smp(void);
39
40extern unsigned long pmac_ide_get_base(int index);
41extern void pmac_ide_init_hwif_ports(hw_regs_t *hw,
42 unsigned long data_port, unsigned long ctrl_port, int *irq);
43
44extern int pmac_nvram_init(void);
45
46extern struct hw_interrupt_type pmac_pic;
47
48void pmac_pic_init(void);
49int pmac_get_irq(struct pt_regs *regs);
50
51#endif /* __PMAC_H__ */
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
new file mode 100644
index 000000000000..6f62af597291
--- /dev/null
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -0,0 +1,794 @@
1/*
2 * Powermac setup and early boot code plus other random bits.
3 *
4 * PowerPC version
5 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
6 *
7 * Adapted for Power Macintosh by Paul Mackerras
8 * Copyright (C) 1996 Paul Mackerras (paulus@samba.org)
9 *
10 * Derived from "arch/alpha/kernel/setup.c"
11 * Copyright (C) 1995 Linus Torvalds
12 *
13 * Maintained by Benjamin Herrenschmidt (benh@kernel.crashing.org)
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version
18 * 2 of the License, or (at your option) any later version.
19 *
20 */
21
22/*
23 * bootup setup stuff..
24 */
25
26#include <linux/config.h>
27#include <linux/init.h>
28#include <linux/errno.h>
29#include <linux/sched.h>
30#include <linux/kernel.h>
31#include <linux/mm.h>
32#include <linux/stddef.h>
33#include <linux/unistd.h>
34#include <linux/ptrace.h>
35#include <linux/slab.h>
36#include <linux/user.h>
37#include <linux/a.out.h>
38#include <linux/tty.h>
39#include <linux/string.h>
40#include <linux/delay.h>
41#include <linux/ioport.h>
42#include <linux/major.h>
43#include <linux/initrd.h>
44#include <linux/vt_kern.h>
45#include <linux/console.h>
46#include <linux/ide.h>
47#include <linux/pci.h>
48#include <linux/adb.h>
49#include <linux/cuda.h>
50#include <linux/pmu.h>
51#include <linux/irq.h>
52#include <linux/seq_file.h>
53#include <linux/root_dev.h>
54#include <linux/bitops.h>
55#include <linux/suspend.h>
56
57#include <asm/reg.h>
58#include <asm/sections.h>
59#include <asm/prom.h>
60#include <asm/system.h>
61#include <asm/pgtable.h>
62#include <asm/io.h>
63#include <asm/pci-bridge.h>
64#include <asm/ohare.h>
65#include <asm/mediabay.h>
66#include <asm/machdep.h>
67#include <asm/dma.h>
68#include <asm/cputable.h>
69#include <asm/btext.h>
70#include <asm/pmac_feature.h>
71#include <asm/time.h>
72#include <asm/of_device.h>
73#include <asm/mmu_context.h>
74#include <asm/iommu.h>
75#include <asm/smu.h>
76#include <asm/pmc.h>
77#include <asm/mpic.h>
78
79#include "pmac.h"
80
81#undef SHOW_GATWICK_IRQS
82
83unsigned char drive_info;
84
85int ppc_override_l2cr = 0;
86int ppc_override_l2cr_value;
87int has_l2cache = 0;
88
89int pmac_newworld = 1;
90
91static int current_root_goodness = -1;
92
93extern int pmac_newworld;
94extern struct machdep_calls pmac_md;
95
96#define DEFAULT_ROOT_DEVICE Root_SDA1 /* sda1 - slightly silly choice */
97
98#ifdef CONFIG_PPC64
99#include <asm/udbg.h>
100int sccdbg;
101#endif
102
103extern void zs_kgdb_hook(int tty_num);
104
105sys_ctrler_t sys_ctrler = SYS_CTRLER_UNKNOWN;
106EXPORT_SYMBOL(sys_ctrler);
107
108#ifdef CONFIG_PMAC_SMU
109unsigned long smu_cmdbuf_abs;
110EXPORT_SYMBOL(smu_cmdbuf_abs);
111#endif
112
113#ifdef CONFIG_SMP
114extern struct smp_ops_t psurge_smp_ops;
115extern struct smp_ops_t core99_smp_ops;
116#endif /* CONFIG_SMP */
117
118static void pmac_show_cpuinfo(struct seq_file *m)
119{
120 struct device_node *np;
121 char *pp;
122 int plen;
123 int mbmodel;
124 unsigned int mbflags;
125 char* mbname;
126
127 mbmodel = pmac_call_feature(PMAC_FTR_GET_MB_INFO, NULL,
128 PMAC_MB_INFO_MODEL, 0);
129 mbflags = pmac_call_feature(PMAC_FTR_GET_MB_INFO, NULL,
130 PMAC_MB_INFO_FLAGS, 0);
131 if (pmac_call_feature(PMAC_FTR_GET_MB_INFO, NULL, PMAC_MB_INFO_NAME,
132 (long) &mbname) != 0)
133 mbname = "Unknown";
134
135 /* find motherboard type */
136 seq_printf(m, "machine\t\t: ");
137 np = of_find_node_by_path("/");
138 if (np != NULL) {
139 pp = (char *) get_property(np, "model", NULL);
140 if (pp != NULL)
141 seq_printf(m, "%s\n", pp);
142 else
143 seq_printf(m, "PowerMac\n");
144 pp = (char *) get_property(np, "compatible", &plen);
145 if (pp != NULL) {
146 seq_printf(m, "motherboard\t:");
147 while (plen > 0) {
148 int l = strlen(pp) + 1;
149 seq_printf(m, " %s", pp);
150 plen -= l;
151 pp += l;
152 }
153 seq_printf(m, "\n");
154 }
155 of_node_put(np);
156 } else
157 seq_printf(m, "PowerMac\n");
158
159 /* print parsed model */
160 seq_printf(m, "detected as\t: %d (%s)\n", mbmodel, mbname);
161 seq_printf(m, "pmac flags\t: %08x\n", mbflags);
162
163 /* find l2 cache info */
164 np = of_find_node_by_name(NULL, "l2-cache");
165 if (np == NULL)
166 np = of_find_node_by_type(NULL, "cache");
167 if (np != NULL) {
168 unsigned int *ic = (unsigned int *)
169 get_property(np, "i-cache-size", NULL);
170 unsigned int *dc = (unsigned int *)
171 get_property(np, "d-cache-size", NULL);
172 seq_printf(m, "L2 cache\t:");
173 has_l2cache = 1;
174 if (get_property(np, "cache-unified", NULL) != 0 && dc) {
175 seq_printf(m, " %dK unified", *dc / 1024);
176 } else {
177 if (ic)
178 seq_printf(m, " %dK instruction", *ic / 1024);
179 if (dc)
180 seq_printf(m, "%s %dK data",
181 (ic? " +": ""), *dc / 1024);
182 }
183 pp = get_property(np, "ram-type", NULL);
184 if (pp)
185 seq_printf(m, " %s", pp);
186 seq_printf(m, "\n");
187 of_node_put(np);
188 }
189
190 /* Indicate newworld/oldworld */
191 seq_printf(m, "pmac-generation\t: %s\n",
192 pmac_newworld ? "NewWorld" : "OldWorld");
193}
194
195static void pmac_show_percpuinfo(struct seq_file *m, int i)
196{
197#ifdef CONFIG_CPU_FREQ_PMAC
198 extern unsigned int pmac_get_one_cpufreq(int i);
199 unsigned int freq = pmac_get_one_cpufreq(i);
200 if (freq != 0) {
201 seq_printf(m, "clock\t\t: %dMHz\n", freq/1000);
202 return;
203 }
204#endif /* CONFIG_CPU_FREQ_PMAC */
205}
206
207#ifndef CONFIG_ADB_CUDA
208int find_via_cuda(void)
209{
210 if (!find_devices("via-cuda"))
211 return 0;
212 printk("WARNING ! Your machine is CUDA-based but your kernel\n");
213 printk(" wasn't compiled with CONFIG_ADB_CUDA option !\n");
214 return 0;
215}
216#endif
217
218#ifndef CONFIG_ADB_PMU
219int find_via_pmu(void)
220{
221 if (!find_devices("via-pmu"))
222 return 0;
223 printk("WARNING ! Your machine is PMU-based but your kernel\n");
224 printk(" wasn't compiled with CONFIG_ADB_PMU option !\n");
225 return 0;
226}
227#endif
228
229#ifndef CONFIG_PMAC_SMU
230int smu_init(void)
231{
232 /* should check and warn if SMU is present */
233 return 0;
234}
235#endif
236
237#ifdef CONFIG_PPC32
238static volatile u32 *sysctrl_regs;
239
240static void __init ohare_init(void)
241{
242 /* this area has the CPU identification register
243 and some registers used by smp boards */
244 sysctrl_regs = (volatile u32 *) ioremap(0xf8000000, 0x1000);
245
246 /*
247 * Turn on the L2 cache.
248 * We assume that we have a PSX memory controller iff
249 * we have an ohare I/O controller.
250 */
251 if (find_devices("ohare") != NULL) {
252 if (((sysctrl_regs[2] >> 24) & 0xf) >= 3) {
253 if (sysctrl_regs[4] & 0x10)
254 sysctrl_regs[4] |= 0x04000020;
255 else
256 sysctrl_regs[4] |= 0x04000000;
257 if(has_l2cache)
258 printk(KERN_INFO "Level 2 cache enabled\n");
259 }
260 }
261}
262
263static void __init l2cr_init(void)
264{
265 /* Checks "l2cr-value" property in the registry */
266 if (cpu_has_feature(CPU_FTR_L2CR)) {
267 struct device_node *np = find_devices("cpus");
268 if (np == 0)
269 np = find_type_devices("cpu");
270 if (np != 0) {
271 unsigned int *l2cr = (unsigned int *)
272 get_property(np, "l2cr-value", NULL);
273 if (l2cr != 0) {
274 ppc_override_l2cr = 1;
275 ppc_override_l2cr_value = *l2cr;
276 _set_L2CR(0);
277 _set_L2CR(ppc_override_l2cr_value);
278 }
279 }
280 }
281
282 if (ppc_override_l2cr)
283 printk(KERN_INFO "L2CR overridden (0x%x), "
284 "backside cache is %s\n",
285 ppc_override_l2cr_value,
286 (ppc_override_l2cr_value & 0x80000000)
287 ? "enabled" : "disabled");
288}
289#endif
290
291void __init pmac_setup_arch(void)
292{
293 struct device_node *cpu, *ic;
294 int *fp;
295 unsigned long pvr;
296
297 pvr = PVR_VER(mfspr(SPRN_PVR));
298
299 /* Set loops_per_jiffy to a half-way reasonable value,
300 for use until calibrate_delay gets called. */
301 loops_per_jiffy = 50000000 / HZ;
302 cpu = of_find_node_by_type(NULL, "cpu");
303 if (cpu != NULL) {
304 fp = (int *) get_property(cpu, "clock-frequency", NULL);
305 if (fp != NULL) {
306 if (pvr >= 0x30 && pvr < 0x80)
307 /* PPC970 etc. */
308 loops_per_jiffy = *fp / (3 * HZ);
309 else if (pvr == 4 || pvr >= 8)
310 /* 604, G3, G4 etc. */
311 loops_per_jiffy = *fp / HZ;
312 else
313 /* 601, 603, etc. */
314 loops_per_jiffy = *fp / (2 * HZ);
315 }
316 of_node_put(cpu);
317 }
318
319 /* See if newworld or oldworld */
320 for (ic = NULL; (ic = of_find_all_nodes(ic)) != NULL; )
321 if (get_property(ic, "interrupt-controller", NULL))
322 break;
323 pmac_newworld = (ic != NULL);
324 if (ic)
325 of_node_put(ic);
326
327 /* Lookup PCI hosts */
328 pmac_pci_init();
329
330#ifdef CONFIG_PPC32
331 ohare_init();
332 l2cr_init();
333#endif /* CONFIG_PPC32 */
334
335#ifdef CONFIG_PPC64
336 /* Probe motherboard chipset */
337 /* this is done earlier in setup_arch for 32-bit */
338 pmac_feature_init();
339
340 /* We can NAP */
341 powersave_nap = 1;
342 printk(KERN_INFO "Using native/NAP idle loop\n");
343#endif
344
345#ifdef CONFIG_KGDB
346 zs_kgdb_hook(0);
347#endif
348
349 find_via_cuda();
350 find_via_pmu();
351 smu_init();
352
353#ifdef CONFIG_NVRAM
354 pmac_nvram_init();
355#endif
356
357#ifdef CONFIG_PPC32
358#ifdef CONFIG_BLK_DEV_INITRD
359 if (initrd_start)
360 ROOT_DEV = Root_RAM0;
361 else
362#endif
363 ROOT_DEV = DEFAULT_ROOT_DEVICE;
364#endif
365
366#ifdef CONFIG_SMP
367 /* Check for Core99 */
368 if (find_devices("uni-n") || find_devices("u3"))
369 smp_ops = &core99_smp_ops;
370#ifdef CONFIG_PPC32
371 else
372 smp_ops = &psurge_smp_ops;
373#endif
374#endif /* CONFIG_SMP */
375}
376
377char *bootpath;
378char *bootdevice;
379void *boot_host;
380int boot_target;
381int boot_part;
382extern dev_t boot_dev;
383
384#ifdef CONFIG_SCSI
385void __init note_scsi_host(struct device_node *node, void *host)
386{
387 int l;
388 char *p;
389
390 l = strlen(node->full_name);
391 if (bootpath != NULL && bootdevice != NULL
392 && strncmp(node->full_name, bootdevice, l) == 0
393 && (bootdevice[l] == '/' || bootdevice[l] == 0)) {
394 boot_host = host;
395 /*
396 * There's a bug in OF 1.0.5. (Why am I not surprised.)
397 * If you pass a path like scsi/sd@1:0 to canon, it returns
398 * something like /bandit@F2000000/gc@10/53c94@10000/sd@0,0
399 * That is, the scsi target number doesn't get preserved.
400 * So we pick the target number out of bootpath and use that.
401 */
402 p = strstr(bootpath, "/sd@");
403 if (p != NULL) {
404 p += 4;
405 boot_target = simple_strtoul(p, NULL, 10);
406 p = strchr(p, ':');
407 if (p != NULL)
408 boot_part = simple_strtoul(p + 1, NULL, 10);
409 }
410 }
411}
412EXPORT_SYMBOL(note_scsi_host);
413#endif
414
415#if defined(CONFIG_BLK_DEV_IDE) && defined(CONFIG_BLK_DEV_IDE_PMAC)
416static dev_t __init find_ide_boot(void)
417{
418 char *p;
419 int n;
420 dev_t __init pmac_find_ide_boot(char *bootdevice, int n);
421
422 if (bootdevice == NULL)
423 return 0;
424 p = strrchr(bootdevice, '/');
425 if (p == NULL)
426 return 0;
427 n = p - bootdevice;
428
429 return pmac_find_ide_boot(bootdevice, n);
430}
431#endif /* CONFIG_BLK_DEV_IDE && CONFIG_BLK_DEV_IDE_PMAC */
432
433static void __init find_boot_device(void)
434{
435#if defined(CONFIG_BLK_DEV_IDE) && defined(CONFIG_BLK_DEV_IDE_PMAC)
436 boot_dev = find_ide_boot();
437#endif
438}
439
440/* TODO: Merge the suspend-to-ram with the common code !!!
441 * currently, this is a stub implementation for suspend-to-disk
442 * only
443 */
444
445#ifdef CONFIG_SOFTWARE_SUSPEND
446
447static int pmac_pm_prepare(suspend_state_t state)
448{
449 printk(KERN_DEBUG "%s(%d)\n", __FUNCTION__, state);
450
451 return 0;
452}
453
454static int pmac_pm_enter(suspend_state_t state)
455{
456 printk(KERN_DEBUG "%s(%d)\n", __FUNCTION__, state);
457
458 /* Giveup the lazy FPU & vec so we don't have to back them
459 * up from the low level code
460 */
461 enable_kernel_fp();
462
463#ifdef CONFIG_ALTIVEC
464 if (cur_cpu_spec->cpu_features & CPU_FTR_ALTIVEC)
465 enable_kernel_altivec();
466#endif /* CONFIG_ALTIVEC */
467
468 return 0;
469}
470
471static int pmac_pm_finish(suspend_state_t state)
472{
473 printk(KERN_DEBUG "%s(%d)\n", __FUNCTION__, state);
474
475 /* Restore userland MMU context */
476 set_context(current->active_mm->context, current->active_mm->pgd);
477
478 return 0;
479}
480
481static struct pm_ops pmac_pm_ops = {
482 .pm_disk_mode = PM_DISK_SHUTDOWN,
483 .prepare = pmac_pm_prepare,
484 .enter = pmac_pm_enter,
485 .finish = pmac_pm_finish,
486};
487
488#endif /* CONFIG_SOFTWARE_SUSPEND */
489
490static int initializing = 1;
491
492static int pmac_late_init(void)
493{
494 initializing = 0;
495#ifdef CONFIG_SOFTWARE_SUSPEND
496 pm_set_ops(&pmac_pm_ops);
497#endif /* CONFIG_SOFTWARE_SUSPEND */
498 return 0;
499}
500
501late_initcall(pmac_late_init);
502
503/* can't be __init - can be called whenever a disk is first accessed */
504void note_bootable_part(dev_t dev, int part, int goodness)
505{
506 static int found_boot = 0;
507 char *p;
508
509 if (!initializing)
510 return;
511 if ((goodness <= current_root_goodness) &&
512 ROOT_DEV != DEFAULT_ROOT_DEVICE)
513 return;
514 p = strstr(saved_command_line, "root=");
515 if (p != NULL && (p == saved_command_line || p[-1] == ' '))
516 return;
517
518 if (!found_boot) {
519 find_boot_device();
520 found_boot = 1;
521 }
522 if (!boot_dev || dev == boot_dev) {
523 ROOT_DEV = dev + part;
524 boot_dev = 0;
525 current_root_goodness = goodness;
526 }
527}
528
529#ifdef CONFIG_ADB_CUDA
530static void cuda_restart(void)
531{
532 struct adb_request req;
533
534 cuda_request(&req, NULL, 2, CUDA_PACKET, CUDA_RESET_SYSTEM);
535 for (;;)
536 cuda_poll();
537}
538
539static void cuda_shutdown(void)
540{
541 struct adb_request req;
542
543 cuda_request(&req, NULL, 2, CUDA_PACKET, CUDA_POWERDOWN);
544 for (;;)
545 cuda_poll();
546}
547
548#else
549#define cuda_restart()
550#define cuda_shutdown()
551#endif
552
553#ifndef CONFIG_ADB_PMU
554#define pmu_restart()
555#define pmu_shutdown()
556#endif
557
558#ifndef CONFIG_PMAC_SMU
559#define smu_restart()
560#define smu_shutdown()
561#endif
562
563static void pmac_restart(char *cmd)
564{
565 switch (sys_ctrler) {
566 case SYS_CTRLER_CUDA:
567 cuda_restart();
568 break;
569 case SYS_CTRLER_PMU:
570 pmu_restart();
571 break;
572 case SYS_CTRLER_SMU:
573 smu_restart();
574 break;
575 default: ;
576 }
577}
578
579static void pmac_power_off(void)
580{
581 switch (sys_ctrler) {
582 case SYS_CTRLER_CUDA:
583 cuda_shutdown();
584 break;
585 case SYS_CTRLER_PMU:
586 pmu_shutdown();
587 break;
588 case SYS_CTRLER_SMU:
589 smu_shutdown();
590 break;
591 default: ;
592 }
593}
594
595static void
596pmac_halt(void)
597{
598 pmac_power_off();
599}
600
601#ifdef CONFIG_PPC32
602void __init pmac_init(void)
603{
604 /* isa_io_base gets set in pmac_pci_init */
605 isa_mem_base = PMAC_ISA_MEM_BASE;
606 pci_dram_offset = PMAC_PCI_DRAM_OFFSET;
607 ISA_DMA_THRESHOLD = ~0L;
608 DMA_MODE_READ = 1;
609 DMA_MODE_WRITE = 2;
610
611 ppc_md = pmac_md;
612
613#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
614#ifdef CONFIG_BLK_DEV_IDE_PMAC
615 ppc_ide_md.ide_init_hwif = pmac_ide_init_hwif_ports;
616 ppc_ide_md.default_io_base = pmac_ide_get_base;
617#endif /* CONFIG_BLK_DEV_IDE_PMAC */
618#endif /* defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) */
619
620 if (ppc_md.progress) ppc_md.progress("pmac_init(): exit", 0);
621
622}
623#endif
624
625/*
626 * Early initialization.
627 */
628static void __init pmac_init_early(void)
629{
630#ifdef CONFIG_PPC64
631 /* Initialize hash table, from now on, we can take hash faults
632 * and call ioremap
633 */
634 hpte_init_native();
635
636 /* Init SCC */
637 if (strstr(cmd_line, "sccdbg")) {
638 sccdbg = 1;
639 udbg_init_scc(NULL);
640 }
641
642 /* Setup interrupt mapping options */
643 ppc64_interrupt_controller = IC_OPEN_PIC;
644
645 iommu_init_early_u3();
646#endif
647}
648
649static void __init pmac_progress(char *s, unsigned short hex)
650{
651#ifdef CONFIG_PPC64
652 if (sccdbg) {
653 udbg_puts(s);
654 udbg_puts("\n");
655 return;
656 }
657#endif
658#ifdef CONFIG_BOOTX_TEXT
659 if (boot_text_mapped) {
660 btext_drawstring(s);
661 btext_drawchar('\n');
662 }
663#endif /* CONFIG_BOOTX_TEXT */
664}
665
666/*
667 * pmac has no legacy IO, anything calling this function has to
668 * fail or bad things will happen
669 */
670static int pmac_check_legacy_ioport(unsigned int baseport)
671{
672 return -ENODEV;
673}
674
675static int __init pmac_declare_of_platform_devices(void)
676{
677 struct device_node *np, *npp;
678
679 np = find_devices("uni-n");
680 if (np) {
681 for (np = np->child; np != NULL; np = np->sibling)
682 if (strncmp(np->name, "i2c", 3) == 0) {
683 of_platform_device_create(np, "uni-n-i2c",
684 NULL);
685 break;
686 }
687 }
688 np = find_devices("valkyrie");
689 if (np)
690 of_platform_device_create(np, "valkyrie", NULL);
691 np = find_devices("platinum");
692 if (np)
693 of_platform_device_create(np, "platinum", NULL);
694
695 npp = of_find_node_by_name(NULL, "u3");
696 if (npp) {
697 for (np = NULL; (np = of_get_next_child(npp, np)) != NULL;) {
698 if (strncmp(np->name, "i2c", 3) == 0) {
699 of_platform_device_create(np, "u3-i2c", NULL);
700 of_node_put(np);
701 break;
702 }
703 }
704 of_node_put(npp);
705 }
706 np = of_find_node_by_type(NULL, "smu");
707 if (np) {
708 of_platform_device_create(np, "smu", NULL);
709 of_node_put(np);
710 }
711
712 return 0;
713}
714
715device_initcall(pmac_declare_of_platform_devices);
716
717/*
718 * Called very early, MMU is off, device-tree isn't unflattened
719 */
720static int __init pmac_probe(int platform)
721{
722#ifdef CONFIG_PPC64
723 if (platform != PLATFORM_POWERMAC)
724 return 0;
725
726 /*
727 * On U3, the DART (iommu) must be allocated now since it
728 * has an impact on htab_initialize (due to the large page it
729 * occupies having to be broken up so the DART itself is not
730 * part of the cacheable linar mapping
731 */
732 alloc_u3_dart_table();
733#endif
734
735#ifdef CONFIG_PMAC_SMU
736 /*
737 * SMU based G5s need some memory below 2Gb, at least the current
738 * driver needs that. We have to allocate it now. We allocate 4k
739 * (1 small page) for now.
740 */
741 smu_cmdbuf_abs = lmb_alloc_base(4096, 4096, 0x80000000UL);
742#endif /* CONFIG_PMAC_SMU */
743
744 return 1;
745}
746
747#ifdef CONFIG_PPC64
748static int pmac_probe_mode(struct pci_bus *bus)
749{
750 struct device_node *node = bus->sysdata;
751
752 /* We need to use normal PCI probing for the AGP bus,
753 since the device for the AGP bridge isn't in the tree. */
754 if (bus->self == NULL && device_is_compatible(node, "u3-agp"))
755 return PCI_PROBE_NORMAL;
756
757 return PCI_PROBE_DEVTREE;
758}
759#endif
760
761struct machdep_calls __initdata pmac_md = {
762#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC64)
763 .cpu_die = generic_mach_cpu_die,
764#endif
765 .probe = pmac_probe,
766 .setup_arch = pmac_setup_arch,
767 .init_early = pmac_init_early,
768 .show_cpuinfo = pmac_show_cpuinfo,
769 .show_percpuinfo = pmac_show_percpuinfo,
770 .init_IRQ = pmac_pic_init,
771 .get_irq = mpic_get_irq, /* changed later */
772 .pcibios_fixup = pmac_pcibios_fixup,
773 .restart = pmac_restart,
774 .power_off = pmac_power_off,
775 .halt = pmac_halt,
776 .time_init = pmac_time_init,
777 .get_boot_time = pmac_get_boot_time,
778 .set_rtc_time = pmac_set_rtc_time,
779 .get_rtc_time = pmac_get_rtc_time,
780 .calibrate_decr = pmac_calibrate_decr,
781 .feature_call = pmac_do_feature_call,
782 .check_legacy_ioport = pmac_check_legacy_ioport,
783 .progress = pmac_progress,
784#ifdef CONFIG_PPC64
785 .pci_probe_mode = pmac_probe_mode,
786 .idle_loop = native_idle,
787 .enable_pmcs = power4_enable_pmcs,
788#endif
789#ifdef CONFIG_PPC32
790 .pcibios_enable_device_hook = pmac_pci_enable_device_hook,
791 .pcibios_after_init = pmac_pcibios_after_init,
792 .phys_mem_access_prot = pci_phys_mem_access_prot,
793#endif
794};
diff --git a/arch/powerpc/platforms/powermac/sleep.S b/arch/powerpc/platforms/powermac/sleep.S
new file mode 100644
index 000000000000..22b113d19b24
--- /dev/null
+++ b/arch/powerpc/platforms/powermac/sleep.S
@@ -0,0 +1,396 @@
1/*
2 * This file contains sleep low-level functions for PowerBook G3.
3 * Copyright (C) 1999 Benjamin Herrenschmidt (benh@kernel.crashing.org)
4 * and Paul Mackerras (paulus@samba.org).
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 *
11 */
12
13#include <linux/config.h>
14#include <asm/processor.h>
15#include <asm/page.h>
16#include <asm/ppc_asm.h>
17#include <asm/cputable.h>
18#include <asm/cache.h>
19#include <asm/thread_info.h>
20#include <asm/asm-offsets.h>
21
22#define MAGIC 0x4c617273 /* 'Lars' */
23
24/*
25 * Structure for storing CPU registers on the stack.
26 */
27#define SL_SP 0
28#define SL_PC 4
29#define SL_MSR 8
30#define SL_SDR1 0xc
31#define SL_SPRG0 0x10 /* 4 sprg's */
32#define SL_DBAT0 0x20
33#define SL_IBAT0 0x28
34#define SL_DBAT1 0x30
35#define SL_IBAT1 0x38
36#define SL_DBAT2 0x40
37#define SL_IBAT2 0x48
38#define SL_DBAT3 0x50
39#define SL_IBAT3 0x58
40#define SL_TB 0x60
41#define SL_R2 0x68
42#define SL_CR 0x6c
43#define SL_R12 0x70 /* r12 to r31 */
44#define SL_SIZE (SL_R12 + 80)
45
46 .section .text
47 .align 5
48
49#if defined(CONFIG_PM) || defined(CONFIG_CPU_FREQ_PMAC)
50
51/* This gets called by via-pmu.c late during the sleep process.
52 * The PMU was already send the sleep command and will shut us down
53 * soon. We need to save all that is needed and setup the wakeup
54 * vector that will be called by the ROM on wakeup
55 */
56_GLOBAL(low_sleep_handler)
57#ifndef CONFIG_6xx
58 blr
59#else
60 mflr r0
61 stw r0,4(r1)
62 stwu r1,-SL_SIZE(r1)
63 mfcr r0
64 stw r0,SL_CR(r1)
65 stw r2,SL_R2(r1)
66 stmw r12,SL_R12(r1)
67
68 /* Save MSR & SDR1 */
69 mfmsr r4
70 stw r4,SL_MSR(r1)
71 mfsdr1 r4
72 stw r4,SL_SDR1(r1)
73
74 /* Get a stable timebase and save it */
751: mftbu r4
76 stw r4,SL_TB(r1)
77 mftb r5
78 stw r5,SL_TB+4(r1)
79 mftbu r3
80 cmpw r3,r4
81 bne 1b
82
83 /* Save SPRGs */
84 mfsprg r4,0
85 stw r4,SL_SPRG0(r1)
86 mfsprg r4,1
87 stw r4,SL_SPRG0+4(r1)
88 mfsprg r4,2
89 stw r4,SL_SPRG0+8(r1)
90 mfsprg r4,3
91 stw r4,SL_SPRG0+12(r1)
92
93 /* Save BATs */
94 mfdbatu r4,0
95 stw r4,SL_DBAT0(r1)
96 mfdbatl r4,0
97 stw r4,SL_DBAT0+4(r1)
98 mfdbatu r4,1
99 stw r4,SL_DBAT1(r1)
100 mfdbatl r4,1
101 stw r4,SL_DBAT1+4(r1)
102 mfdbatu r4,2
103 stw r4,SL_DBAT2(r1)
104 mfdbatl r4,2
105 stw r4,SL_DBAT2+4(r1)
106 mfdbatu r4,3
107 stw r4,SL_DBAT3(r1)
108 mfdbatl r4,3
109 stw r4,SL_DBAT3+4(r1)
110 mfibatu r4,0
111 stw r4,SL_IBAT0(r1)
112 mfibatl r4,0
113 stw r4,SL_IBAT0+4(r1)
114 mfibatu r4,1
115 stw r4,SL_IBAT1(r1)
116 mfibatl r4,1
117 stw r4,SL_IBAT1+4(r1)
118 mfibatu r4,2
119 stw r4,SL_IBAT2(r1)
120 mfibatl r4,2
121 stw r4,SL_IBAT2+4(r1)
122 mfibatu r4,3
123 stw r4,SL_IBAT3(r1)
124 mfibatl r4,3
125 stw r4,SL_IBAT3+4(r1)
126
127 /* Backup various CPU config stuffs */
128 bl __save_cpu_setup
129
130 /* The ROM can wake us up via 2 different vectors:
131 * - On wallstreet & lombard, we must write a magic
132 * value 'Lars' at address 4 and a pointer to a
133 * memory location containing the PC to resume from
134 * at address 0.
135 * - On Core99, we must store the wakeup vector at
136 * address 0x80 and eventually it's parameters
137 * at address 0x84. I've have some trouble with those
138 * parameters however and I no longer use them.
139 */
140 lis r5,grackle_wake_up@ha
141 addi r5,r5,grackle_wake_up@l
142 tophys(r5,r5)
143 stw r5,SL_PC(r1)
144 lis r4,KERNELBASE@h
145 tophys(r5,r1)
146 addi r5,r5,SL_PC
147 lis r6,MAGIC@ha
148 addi r6,r6,MAGIC@l
149 stw r5,0(r4)
150 stw r6,4(r4)
151 /* Setup stuffs at 0x80-0x84 for Core99 */
152 lis r3,core99_wake_up@ha
153 addi r3,r3,core99_wake_up@l
154 tophys(r3,r3)
155 stw r3,0x80(r4)
156 stw r5,0x84(r4)
157 /* Store a pointer to our backup storage into
158 * a kernel global
159 */
160 lis r3,sleep_storage@ha
161 addi r3,r3,sleep_storage@l
162 stw r5,0(r3)
163
164 .globl low_cpu_die
165low_cpu_die:
166 /* Flush & disable all caches */
167 bl flush_disable_caches
168
169 /* Turn off data relocation. */
170 mfmsr r3 /* Save MSR in r7 */
171 rlwinm r3,r3,0,28,26 /* Turn off DR bit */
172 sync
173 mtmsr r3
174 isync
175
176BEGIN_FTR_SECTION
177 /* Flush any pending L2 data prefetches to work around HW bug */
178 sync
179 lis r3,0xfff0
180 lwz r0,0(r3) /* perform cache-inhibited load to ROM */
181 sync /* (caches are disabled at this point) */
182END_FTR_SECTION_IFSET(CPU_FTR_SPEC7450)
183
184/*
185 * Set the HID0 and MSR for sleep.
186 */
187 mfspr r2,SPRN_HID0
188 rlwinm r2,r2,0,10,7 /* clear doze, nap */
189 oris r2,r2,HID0_SLEEP@h
190 sync
191 isync
192 mtspr SPRN_HID0,r2
193 sync
194
195/* This loop puts us back to sleep in case we have a spurrious
196 * wakeup so that the host bridge properly stays asleep. The
197 * CPU will be turned off, either after a known time (about 1
198 * second) on wallstreet & lombard, or as soon as the CPU enters
199 * SLEEP mode on core99
200 */
201 mfmsr r2
202 oris r2,r2,MSR_POW@h
2031: sync
204 mtmsr r2
205 isync
206 b 1b
207
208/*
209 * Here is the resume code.
210 */
211
212
213/*
214 * Core99 machines resume here
215 * r4 has the physical address of SL_PC(sp) (unused)
216 */
217_GLOBAL(core99_wake_up)
218 /* Make sure HID0 no longer contains any sleep bit and that data cache
219 * is disabled
220 */
221 mfspr r3,SPRN_HID0
222 rlwinm r3,r3,0,11,7 /* clear SLEEP, NAP, DOZE bits */
223 rlwinm 3,r3,0,18,15 /* clear DCE, ICE */
224 mtspr SPRN_HID0,r3
225 sync
226 isync
227
228 /* sanitize MSR */
229 mfmsr r3
230 ori r3,r3,MSR_EE|MSR_IP
231 xori r3,r3,MSR_EE|MSR_IP
232 sync
233 isync
234 mtmsr r3
235 sync
236 isync
237
238 /* Recover sleep storage */
239 lis r3,sleep_storage@ha
240 addi r3,r3,sleep_storage@l
241 tophys(r3,r3)
242 lwz r1,0(r3)
243
244 /* Pass thru to older resume code ... */
245/*
246 * Here is the resume code for older machines.
247 * r1 has the physical address of SL_PC(sp).
248 */
249
250grackle_wake_up:
251
252 /* Restore the kernel's segment registers before
253 * we do any r1 memory access as we are not sure they
254 * are in a sane state above the first 256Mb region
255 */
256 li r0,16 /* load up segment register values */
257 mtctr r0 /* for context 0 */
258 lis r3,0x2000 /* Ku = 1, VSID = 0 */
259 li r4,0
2603: mtsrin r3,r4
261 addi r3,r3,0x111 /* increment VSID */
262 addis r4,r4,0x1000 /* address of next segment */
263 bdnz 3b
264 sync
265 isync
266
267 subi r1,r1,SL_PC
268
269 /* Restore various CPU config stuffs */
270 bl __restore_cpu_setup
271
272 /* Make sure all FPRs have been initialized */
273 bl reloc_offset
274 bl __init_fpu_registers
275
276 /* Invalidate & enable L1 cache, we don't care about
277 * whatever the ROM may have tried to write to memory
278 */
279 bl __inval_enable_L1
280
281 /* Restore the BATs, and SDR1. Then we can turn on the MMU. */
282 lwz r4,SL_SDR1(r1)
283 mtsdr1 r4
284 lwz r4,SL_SPRG0(r1)
285 mtsprg 0,r4
286 lwz r4,SL_SPRG0+4(r1)
287 mtsprg 1,r4
288 lwz r4,SL_SPRG0+8(r1)
289 mtsprg 2,r4
290 lwz r4,SL_SPRG0+12(r1)
291 mtsprg 3,r4
292
293 lwz r4,SL_DBAT0(r1)
294 mtdbatu 0,r4
295 lwz r4,SL_DBAT0+4(r1)
296 mtdbatl 0,r4
297 lwz r4,SL_DBAT1(r1)
298 mtdbatu 1,r4
299 lwz r4,SL_DBAT1+4(r1)
300 mtdbatl 1,r4
301 lwz r4,SL_DBAT2(r1)
302 mtdbatu 2,r4
303 lwz r4,SL_DBAT2+4(r1)
304 mtdbatl 2,r4
305 lwz r4,SL_DBAT3(r1)
306 mtdbatu 3,r4
307 lwz r4,SL_DBAT3+4(r1)
308 mtdbatl 3,r4
309 lwz r4,SL_IBAT0(r1)
310 mtibatu 0,r4
311 lwz r4,SL_IBAT0+4(r1)
312 mtibatl 0,r4
313 lwz r4,SL_IBAT1(r1)
314 mtibatu 1,r4
315 lwz r4,SL_IBAT1+4(r1)
316 mtibatl 1,r4
317 lwz r4,SL_IBAT2(r1)
318 mtibatu 2,r4
319 lwz r4,SL_IBAT2+4(r1)
320 mtibatl 2,r4
321 lwz r4,SL_IBAT3(r1)
322 mtibatu 3,r4
323 lwz r4,SL_IBAT3+4(r1)
324 mtibatl 3,r4
325
326BEGIN_FTR_SECTION
327 li r4,0
328 mtspr SPRN_DBAT4U,r4
329 mtspr SPRN_DBAT4L,r4
330 mtspr SPRN_DBAT5U,r4
331 mtspr SPRN_DBAT5L,r4
332 mtspr SPRN_DBAT6U,r4
333 mtspr SPRN_DBAT6L,r4
334 mtspr SPRN_DBAT7U,r4
335 mtspr SPRN_DBAT7L,r4
336 mtspr SPRN_IBAT4U,r4
337 mtspr SPRN_IBAT4L,r4
338 mtspr SPRN_IBAT5U,r4
339 mtspr SPRN_IBAT5L,r4
340 mtspr SPRN_IBAT6U,r4
341 mtspr SPRN_IBAT6L,r4
342 mtspr SPRN_IBAT7U,r4
343 mtspr SPRN_IBAT7L,r4
344END_FTR_SECTION_IFSET(CPU_FTR_HAS_HIGH_BATS)
345
346 /* Flush all TLBs */
347 lis r4,0x1000
3481: addic. r4,r4,-0x1000
349 tlbie r4
350 blt 1b
351 sync
352
353 /* restore the MSR and turn on the MMU */
354 lwz r3,SL_MSR(r1)
355 bl turn_on_mmu
356
357 /* get back the stack pointer */
358 tovirt(r1,r1)
359
360 /* Restore TB */
361 li r3,0
362 mttbl r3
363 lwz r3,SL_TB(r1)
364 lwz r4,SL_TB+4(r1)
365 mttbu r3
366 mttbl r4
367
368 /* Restore the callee-saved registers and return */
369 lwz r0,SL_CR(r1)
370 mtcr r0
371 lwz r2,SL_R2(r1)
372 lmw r12,SL_R12(r1)
373 addi r1,r1,SL_SIZE
374 lwz r0,4(r1)
375 mtlr r0
376 blr
377
378turn_on_mmu:
379 mflr r4
380 tovirt(r4,r4)
381 mtsrr0 r4
382 mtsrr1 r3
383 sync
384 isync
385 rfi
386
387#endif /* defined(CONFIG_PM) || defined(CONFIG_CPU_FREQ) */
388
389 .section .data
390 .balign L1_CACHE_BYTES
391sleep_storage:
392 .long 0
393 .balign L1_CACHE_BYTES, 0
394
395#endif /* CONFIG_6xx */
396 .section .text
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
new file mode 100644
index 000000000000..e1f9443cc872
--- /dev/null
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -0,0 +1,865 @@
1/*
2 * SMP support for power macintosh.
3 *
4 * We support both the old "powersurge" SMP architecture
5 * and the current Core99 (G4 PowerMac) machines.
6 *
7 * Note that we don't support the very first rev. of
8 * Apple/DayStar 2 CPUs board, the one with the funky
9 * watchdog. Hopefully, none of these should be there except
10 * maybe internally to Apple. I should probably still add some
11 * code to detect this card though and disable SMP. --BenH.
12 *
13 * Support Macintosh G4 SMP by Troy Benjegerdes (hozer@drgw.net)
14 * and Ben Herrenschmidt <benh@kernel.crashing.org>.
15 *
16 * Support for DayStar quad CPU cards
17 * Copyright (C) XLR8, Inc. 1994-2000
18 *
19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License
21 * as published by the Free Software Foundation; either version
22 * 2 of the License, or (at your option) any later version.
23 */
24#include <linux/config.h>
25#include <linux/kernel.h>
26#include <linux/sched.h>
27#include <linux/smp.h>
28#include <linux/smp_lock.h>
29#include <linux/interrupt.h>
30#include <linux/kernel_stat.h>
31#include <linux/delay.h>
32#include <linux/init.h>
33#include <linux/spinlock.h>
34#include <linux/errno.h>
35#include <linux/hardirq.h>
36#include <linux/cpu.h>
37
38#include <asm/ptrace.h>
39#include <asm/atomic.h>
40#include <asm/irq.h>
41#include <asm/page.h>
42#include <asm/pgtable.h>
43#include <asm/sections.h>
44#include <asm/io.h>
45#include <asm/prom.h>
46#include <asm/smp.h>
47#include <asm/machdep.h>
48#include <asm/pmac_feature.h>
49#include <asm/time.h>
50#include <asm/mpic.h>
51#include <asm/cacheflush.h>
52#include <asm/keylargo.h>
53#include <asm/pmac_low_i2c.h>
54
55#undef DEBUG
56
57#ifdef DEBUG
58#define DBG(fmt...) udbg_printf(fmt)
59#else
60#define DBG(fmt...)
61#endif
62
63extern void __secondary_start_pmac_0(void);
64
65#ifdef CONFIG_PPC32
66
67/* Sync flag for HW tb sync */
68static volatile int sec_tb_reset = 0;
69
70/*
71 * Powersurge (old powermac SMP) support.
72 */
73
74/* Addresses for powersurge registers */
75#define HAMMERHEAD_BASE 0xf8000000
76#define HHEAD_CONFIG 0x90
77#define HHEAD_SEC_INTR 0xc0
78
79/* register for interrupting the primary processor on the powersurge */
80/* N.B. this is actually the ethernet ROM! */
81#define PSURGE_PRI_INTR 0xf3019000
82
83/* register for storing the start address for the secondary processor */
84/* N.B. this is the PCI config space address register for the 1st bridge */
85#define PSURGE_START 0xf2800000
86
87/* Daystar/XLR8 4-CPU card */
88#define PSURGE_QUAD_REG_ADDR 0xf8800000
89
90#define PSURGE_QUAD_IRQ_SET 0
91#define PSURGE_QUAD_IRQ_CLR 1
92#define PSURGE_QUAD_IRQ_PRIMARY 2
93#define PSURGE_QUAD_CKSTOP_CTL 3
94#define PSURGE_QUAD_PRIMARY_ARB 4
95#define PSURGE_QUAD_BOARD_ID 6
96#define PSURGE_QUAD_WHICH_CPU 7
97#define PSURGE_QUAD_CKSTOP_RDBK 8
98#define PSURGE_QUAD_RESET_CTL 11
99
100#define PSURGE_QUAD_OUT(r, v) (out_8(quad_base + ((r) << 4) + 4, (v)))
101#define PSURGE_QUAD_IN(r) (in_8(quad_base + ((r) << 4) + 4) & 0x0f)
102#define PSURGE_QUAD_BIS(r, v) (PSURGE_QUAD_OUT((r), PSURGE_QUAD_IN(r) | (v)))
103#define PSURGE_QUAD_BIC(r, v) (PSURGE_QUAD_OUT((r), PSURGE_QUAD_IN(r) & ~(v)))
104
105/* virtual addresses for the above */
106static volatile u8 __iomem *hhead_base;
107static volatile u8 __iomem *quad_base;
108static volatile u32 __iomem *psurge_pri_intr;
109static volatile u8 __iomem *psurge_sec_intr;
110static volatile u32 __iomem *psurge_start;
111
112/* values for psurge_type */
113#define PSURGE_NONE -1
114#define PSURGE_DUAL 0
115#define PSURGE_QUAD_OKEE 1
116#define PSURGE_QUAD_COTTON 2
117#define PSURGE_QUAD_ICEGRASS 3
118
119/* what sort of powersurge board we have */
120static int psurge_type = PSURGE_NONE;
121
122/*
123 * Set and clear IPIs for powersurge.
124 */
125static inline void psurge_set_ipi(int cpu)
126{
127 if (psurge_type == PSURGE_NONE)
128 return;
129 if (cpu == 0)
130 in_be32(psurge_pri_intr);
131 else if (psurge_type == PSURGE_DUAL)
132 out_8(psurge_sec_intr, 0);
133 else
134 PSURGE_QUAD_OUT(PSURGE_QUAD_IRQ_SET, 1 << cpu);
135}
136
137static inline void psurge_clr_ipi(int cpu)
138{
139 if (cpu > 0) {
140 switch(psurge_type) {
141 case PSURGE_DUAL:
142 out_8(psurge_sec_intr, ~0);
143 case PSURGE_NONE:
144 break;
145 default:
146 PSURGE_QUAD_OUT(PSURGE_QUAD_IRQ_CLR, 1 << cpu);
147 }
148 }
149}
150
151/*
152 * On powersurge (old SMP powermac architecture) we don't have
153 * separate IPIs for separate messages like openpic does. Instead
154 * we have a bitmap for each processor, where a 1 bit means that
155 * the corresponding message is pending for that processor.
156 * Ideally each cpu's entry would be in a different cache line.
157 * -- paulus.
158 */
159static unsigned long psurge_smp_message[NR_CPUS];
160
161void psurge_smp_message_recv(struct pt_regs *regs)
162{
163 int cpu = smp_processor_id();
164 int msg;
165
166 /* clear interrupt */
167 psurge_clr_ipi(cpu);
168
169 if (num_online_cpus() < 2)
170 return;
171
172 /* make sure there is a message there */
173 for (msg = 0; msg < 4; msg++)
174 if (test_and_clear_bit(msg, &psurge_smp_message[cpu]))
175 smp_message_recv(msg, regs);
176}
177
178irqreturn_t psurge_primary_intr(int irq, void *d, struct pt_regs *regs)
179{
180 psurge_smp_message_recv(regs);
181 return IRQ_HANDLED;
182}
183
184static void smp_psurge_message_pass(int target, int msg)
185{
186 int i;
187
188 if (num_online_cpus() < 2)
189 return;
190
191 for (i = 0; i < NR_CPUS; i++) {
192 if (!cpu_online(i))
193 continue;
194 if (target == MSG_ALL
195 || (target == MSG_ALL_BUT_SELF && i != smp_processor_id())
196 || target == i) {
197 set_bit(msg, &psurge_smp_message[i]);
198 psurge_set_ipi(i);
199 }
200 }
201}
202
203/*
204 * Determine a quad card presence. We read the board ID register, we
205 * force the data bus to change to something else, and we read it again.
206 * It it's stable, then the register probably exist (ugh !)
207 */
208static int __init psurge_quad_probe(void)
209{
210 int type;
211 unsigned int i;
212
213 type = PSURGE_QUAD_IN(PSURGE_QUAD_BOARD_ID);
214 if (type < PSURGE_QUAD_OKEE || type > PSURGE_QUAD_ICEGRASS
215 || type != PSURGE_QUAD_IN(PSURGE_QUAD_BOARD_ID))
216 return PSURGE_DUAL;
217
218 /* looks OK, try a slightly more rigorous test */
219 /* bogus is not necessarily cacheline-aligned,
220 though I don't suppose that really matters. -- paulus */
221 for (i = 0; i < 100; i++) {
222 volatile u32 bogus[8];
223 bogus[(0+i)%8] = 0x00000000;
224 bogus[(1+i)%8] = 0x55555555;
225 bogus[(2+i)%8] = 0xFFFFFFFF;
226 bogus[(3+i)%8] = 0xAAAAAAAA;
227 bogus[(4+i)%8] = 0x33333333;
228 bogus[(5+i)%8] = 0xCCCCCCCC;
229 bogus[(6+i)%8] = 0xCCCCCCCC;
230 bogus[(7+i)%8] = 0x33333333;
231 wmb();
232 asm volatile("dcbf 0,%0" : : "r" (bogus) : "memory");
233 mb();
234 if (type != PSURGE_QUAD_IN(PSURGE_QUAD_BOARD_ID))
235 return PSURGE_DUAL;
236 }
237 return type;
238}
239
240static void __init psurge_quad_init(void)
241{
242 int procbits;
243
244 if (ppc_md.progress) ppc_md.progress("psurge_quad_init", 0x351);
245 procbits = ~PSURGE_QUAD_IN(PSURGE_QUAD_WHICH_CPU);
246 if (psurge_type == PSURGE_QUAD_ICEGRASS)
247 PSURGE_QUAD_BIS(PSURGE_QUAD_RESET_CTL, procbits);
248 else
249 PSURGE_QUAD_BIC(PSURGE_QUAD_CKSTOP_CTL, procbits);
250 mdelay(33);
251 out_8(psurge_sec_intr, ~0);
252 PSURGE_QUAD_OUT(PSURGE_QUAD_IRQ_CLR, procbits);
253 PSURGE_QUAD_BIS(PSURGE_QUAD_RESET_CTL, procbits);
254 if (psurge_type != PSURGE_QUAD_ICEGRASS)
255 PSURGE_QUAD_BIS(PSURGE_QUAD_CKSTOP_CTL, procbits);
256 PSURGE_QUAD_BIC(PSURGE_QUAD_PRIMARY_ARB, procbits);
257 mdelay(33);
258 PSURGE_QUAD_BIC(PSURGE_QUAD_RESET_CTL, procbits);
259 mdelay(33);
260 PSURGE_QUAD_BIS(PSURGE_QUAD_PRIMARY_ARB, procbits);
261 mdelay(33);
262}
263
264static int __init smp_psurge_probe(void)
265{
266 int i, ncpus;
267
268 /* We don't do SMP on the PPC601 -- paulus */
269 if (PVR_VER(mfspr(SPRN_PVR)) == 1)
270 return 1;
271
272 /*
273 * The powersurge cpu board can be used in the generation
274 * of powermacs that have a socket for an upgradeable cpu card,
275 * including the 7500, 8500, 9500, 9600.
276 * The device tree doesn't tell you if you have 2 cpus because
277 * OF doesn't know anything about the 2nd processor.
278 * Instead we look for magic bits in magic registers,
279 * in the hammerhead memory controller in the case of the
280 * dual-cpu powersurge board. -- paulus.
281 */
282 if (find_devices("hammerhead") == NULL)
283 return 1;
284
285 hhead_base = ioremap(HAMMERHEAD_BASE, 0x800);
286 quad_base = ioremap(PSURGE_QUAD_REG_ADDR, 1024);
287 psurge_sec_intr = hhead_base + HHEAD_SEC_INTR;
288
289 psurge_type = psurge_quad_probe();
290 if (psurge_type != PSURGE_DUAL) {
291 psurge_quad_init();
292 /* All released cards using this HW design have 4 CPUs */
293 ncpus = 4;
294 } else {
295 iounmap(quad_base);
296 if ((in_8(hhead_base + HHEAD_CONFIG) & 0x02) == 0) {
297 /* not a dual-cpu card */
298 iounmap(hhead_base);
299 psurge_type = PSURGE_NONE;
300 return 1;
301 }
302 ncpus = 2;
303 }
304
305 psurge_start = ioremap(PSURGE_START, 4);
306 psurge_pri_intr = ioremap(PSURGE_PRI_INTR, 4);
307
308 /* this is not actually strictly necessary -- paulus. */
309 for (i = 1; i < ncpus; ++i)
310 smp_hw_index[i] = i;
311
312 if (ppc_md.progress) ppc_md.progress("smp_psurge_probe - done", 0x352);
313
314 return ncpus;
315}
316
317static void __init smp_psurge_kick_cpu(int nr)
318{
319 unsigned long start = __pa(__secondary_start_pmac_0) + nr * 8;
320 unsigned long a;
321
322 /* may need to flush here if secondary bats aren't setup */
323 for (a = KERNELBASE; a < KERNELBASE + 0x800000; a += 32)
324 asm volatile("dcbf 0,%0" : : "r" (a) : "memory");
325 asm volatile("sync");
326
327 if (ppc_md.progress) ppc_md.progress("smp_psurge_kick_cpu", 0x353);
328
329 out_be32(psurge_start, start);
330 mb();
331
332 psurge_set_ipi(nr);
333 udelay(10);
334 psurge_clr_ipi(nr);
335
336 if (ppc_md.progress) ppc_md.progress("smp_psurge_kick_cpu - done", 0x354);
337}
338
339/*
340 * With the dual-cpu powersurge board, the decrementers and timebases
341 * of both cpus are frozen after the secondary cpu is started up,
342 * until we give the secondary cpu another interrupt. This routine
343 * uses this to get the timebases synchronized.
344 * -- paulus.
345 */
346static void __init psurge_dual_sync_tb(int cpu_nr)
347{
348 int t;
349
350 set_dec(tb_ticks_per_jiffy);
351 set_tb(0, 0);
352 last_jiffy_stamp(cpu_nr) = 0;
353
354 if (cpu_nr > 0) {
355 mb();
356 sec_tb_reset = 1;
357 return;
358 }
359
360 /* wait for the secondary to have reset its TB before proceeding */
361 for (t = 10000000; t > 0 && !sec_tb_reset; --t)
362 ;
363
364 /* now interrupt the secondary, starting both TBs */
365 psurge_set_ipi(1);
366
367 smp_tb_synchronized = 1;
368}
369
370static struct irqaction psurge_irqaction = {
371 .handler = psurge_primary_intr,
372 .flags = SA_INTERRUPT,
373 .mask = CPU_MASK_NONE,
374 .name = "primary IPI",
375};
376
377static void __init smp_psurge_setup_cpu(int cpu_nr)
378{
379
380 if (cpu_nr == 0) {
381 /* If we failed to start the second CPU, we should still
382 * send it an IPI to start the timebase & DEC or we might
383 * have them stuck.
384 */
385 if (num_online_cpus() < 2) {
386 if (psurge_type == PSURGE_DUAL)
387 psurge_set_ipi(1);
388 return;
389 }
390 /* reset the entry point so if we get another intr we won't
391 * try to startup again */
392 out_be32(psurge_start, 0x100);
393 if (setup_irq(30, &psurge_irqaction))
394 printk(KERN_ERR "Couldn't get primary IPI interrupt");
395 }
396
397 if (psurge_type == PSURGE_DUAL)
398 psurge_dual_sync_tb(cpu_nr);
399}
400
401void __init smp_psurge_take_timebase(void)
402{
403 /* Dummy implementation */
404}
405
406void __init smp_psurge_give_timebase(void)
407{
408 /* Dummy implementation */
409}
410
411/* PowerSurge-style Macs */
412struct smp_ops_t psurge_smp_ops = {
413 .message_pass = smp_psurge_message_pass,
414 .probe = smp_psurge_probe,
415 .kick_cpu = smp_psurge_kick_cpu,
416 .setup_cpu = smp_psurge_setup_cpu,
417 .give_timebase = smp_psurge_give_timebase,
418 .take_timebase = smp_psurge_take_timebase,
419};
420#endif /* CONFIG_PPC32 - actually powersurge support */
421
422#ifdef CONFIG_PPC64
423/*
424 * G5s enable/disable the timebase via an i2c-connected clock chip.
425 */
426static struct device_node *pmac_tb_clock_chip_host;
427static u8 pmac_tb_pulsar_addr;
428static void (*pmac_tb_freeze)(int freeze);
429static DEFINE_SPINLOCK(timebase_lock);
430static unsigned long timebase;
431
432static void smp_core99_cypress_tb_freeze(int freeze)
433{
434 u8 data;
435 int rc;
436
437 /* Strangely, the device-tree says address is 0xd2, but darwin
438 * accesses 0xd0 ...
439 */
440 pmac_low_i2c_setmode(pmac_tb_clock_chip_host, pmac_low_i2c_mode_combined);
441 rc = pmac_low_i2c_xfer(pmac_tb_clock_chip_host,
442 0xd0 | pmac_low_i2c_read,
443 0x81, &data, 1);
444 if (rc != 0)
445 goto bail;
446
447 data = (data & 0xf3) | (freeze ? 0x00 : 0x0c);
448
449 pmac_low_i2c_setmode(pmac_tb_clock_chip_host, pmac_low_i2c_mode_stdsub);
450 rc = pmac_low_i2c_xfer(pmac_tb_clock_chip_host,
451 0xd0 | pmac_low_i2c_write,
452 0x81, &data, 1);
453
454 bail:
455 if (rc != 0) {
456 printk("Cypress Timebase %s rc: %d\n",
457 freeze ? "freeze" : "unfreeze", rc);
458 panic("Timebase freeze failed !\n");
459 }
460}
461
462
463static void smp_core99_pulsar_tb_freeze(int freeze)
464{
465 u8 data;
466 int rc;
467
468 pmac_low_i2c_setmode(pmac_tb_clock_chip_host, pmac_low_i2c_mode_combined);
469 rc = pmac_low_i2c_xfer(pmac_tb_clock_chip_host,
470 pmac_tb_pulsar_addr | pmac_low_i2c_read,
471 0x2e, &data, 1);
472 if (rc != 0)
473 goto bail;
474
475 data = (data & 0x88) | (freeze ? 0x11 : 0x22);
476
477 pmac_low_i2c_setmode(pmac_tb_clock_chip_host, pmac_low_i2c_mode_stdsub);
478 rc = pmac_low_i2c_xfer(pmac_tb_clock_chip_host,
479 pmac_tb_pulsar_addr | pmac_low_i2c_write,
480 0x2e, &data, 1);
481 bail:
482 if (rc != 0) {
483 printk(KERN_ERR "Pulsar Timebase %s rc: %d\n",
484 freeze ? "freeze" : "unfreeze", rc);
485 panic("Timebase freeze failed !\n");
486 }
487}
488
489
490static void smp_core99_give_timebase(void)
491{
492 /* Open i2c bus for synchronous access */
493 if (pmac_low_i2c_open(pmac_tb_clock_chip_host, 0))
494 panic("Can't open i2c for TB sync !\n");
495
496 spin_lock(&timebase_lock);
497 (*pmac_tb_freeze)(1);
498 mb();
499 timebase = get_tb();
500 spin_unlock(&timebase_lock);
501
502 while (timebase)
503 barrier();
504
505 spin_lock(&timebase_lock);
506 (*pmac_tb_freeze)(0);
507 spin_unlock(&timebase_lock);
508
509 /* Close i2c bus */
510 pmac_low_i2c_close(pmac_tb_clock_chip_host);
511}
512
513
514static void __devinit smp_core99_take_timebase(void)
515{
516 while (!timebase)
517 barrier();
518 spin_lock(&timebase_lock);
519 set_tb(timebase >> 32, timebase & 0xffffffff);
520 timebase = 0;
521 spin_unlock(&timebase_lock);
522}
523
524static void __init smp_core99_setup(int ncpus)
525{
526 struct device_node *cc = NULL;
527 struct device_node *p;
528 u32 *reg;
529 int ok;
530
531 /* HW sync only on these platforms */
532 if (!machine_is_compatible("PowerMac7,2") &&
533 !machine_is_compatible("PowerMac7,3") &&
534 !machine_is_compatible("RackMac3,1"))
535 return;
536
537 /* Look for the clock chip */
538 while ((cc = of_find_node_by_name(cc, "i2c-hwclock")) != NULL) {
539 p = of_get_parent(cc);
540 ok = p && device_is_compatible(p, "uni-n-i2c");
541 of_node_put(p);
542 if (!ok)
543 continue;
544
545 reg = (u32 *)get_property(cc, "reg", NULL);
546 if (reg == NULL)
547 continue;
548
549 switch (*reg) {
550 case 0xd2:
551 if (device_is_compatible(cc, "pulsar-legacy-slewing")) {
552 pmac_tb_freeze = smp_core99_pulsar_tb_freeze;
553 pmac_tb_pulsar_addr = 0xd2;
554 printk(KERN_INFO "Timebase clock is Pulsar chip\n");
555 } else if (device_is_compatible(cc, "cy28508")) {
556 pmac_tb_freeze = smp_core99_cypress_tb_freeze;
557 printk(KERN_INFO "Timebase clock is Cypress chip\n");
558 }
559 break;
560 case 0xd4:
561 pmac_tb_freeze = smp_core99_pulsar_tb_freeze;
562 pmac_tb_pulsar_addr = 0xd4;
563 printk(KERN_INFO "Timebase clock is Pulsar chip\n");
564 break;
565 }
566 if (pmac_tb_freeze != NULL) {
567 pmac_tb_clock_chip_host = of_get_parent(cc);
568 of_node_put(cc);
569 break;
570 }
571 }
572 if (pmac_tb_freeze == NULL) {
573 smp_ops->give_timebase = smp_generic_give_timebase;
574 smp_ops->take_timebase = smp_generic_take_timebase;
575 }
576}
577
578/* nothing to do here, caches are already set up by service processor */
579static inline void __devinit core99_init_caches(int cpu)
580{
581}
582
583#else /* CONFIG_PPC64 */
584
585/*
586 * SMP G4 powermacs use a GPIO to enable/disable the timebase.
587 */
588
589static unsigned int core99_tb_gpio; /* Timebase freeze GPIO */
590
591static unsigned int pri_tb_hi, pri_tb_lo;
592static unsigned int pri_tb_stamp;
593
594/* not __init, called in sleep/wakeup code */
595void smp_core99_give_timebase(void)
596{
597 unsigned long flags;
598 unsigned int t;
599
600 /* wait for the secondary to be in take_timebase */
601 for (t = 100000; t > 0 && !sec_tb_reset; --t)
602 udelay(10);
603 if (!sec_tb_reset) {
604 printk(KERN_WARNING "Timeout waiting sync on second CPU\n");
605 return;
606 }
607
608 /* freeze the timebase and read it */
609 /* disable interrupts so the timebase is disabled for the
610 shortest possible time */
611 local_irq_save(flags);
612 pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, core99_tb_gpio, 4);
613 pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, core99_tb_gpio, 0);
614 mb();
615 pri_tb_hi = get_tbu();
616 pri_tb_lo = get_tbl();
617 pri_tb_stamp = last_jiffy_stamp(smp_processor_id());
618 mb();
619
620 /* tell the secondary we're ready */
621 sec_tb_reset = 2;
622 mb();
623
624 /* wait for the secondary to have taken it */
625 for (t = 100000; t > 0 && sec_tb_reset; --t)
626 udelay(10);
627 if (sec_tb_reset)
628 printk(KERN_WARNING "Timeout waiting sync(2) on second CPU\n");
629 else
630 smp_tb_synchronized = 1;
631
632 /* Now, restart the timebase by leaving the GPIO to an open collector */
633 pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, core99_tb_gpio, 0);
634 pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, core99_tb_gpio, 0);
635 local_irq_restore(flags);
636}
637
638/* not __init, called in sleep/wakeup code */
639void smp_core99_take_timebase(void)
640{
641 unsigned long flags;
642
643 /* tell the primary we're here */
644 sec_tb_reset = 1;
645 mb();
646
647 /* wait for the primary to set pri_tb_hi/lo */
648 while (sec_tb_reset < 2)
649 mb();
650
651 /* set our stuff the same as the primary */
652 local_irq_save(flags);
653 set_dec(1);
654 set_tb(pri_tb_hi, pri_tb_lo);
655 last_jiffy_stamp(smp_processor_id()) = pri_tb_stamp;
656 mb();
657
658 /* tell the primary we're done */
659 sec_tb_reset = 0;
660 mb();
661 local_irq_restore(flags);
662}
663
664/* L2 and L3 cache settings to pass from CPU0 to CPU1 on G4 cpus */
665volatile static long int core99_l2_cache;
666volatile static long int core99_l3_cache;
667
668static void __devinit core99_init_caches(int cpu)
669{
670 if (!cpu_has_feature(CPU_FTR_L2CR))
671 return;
672
673 if (cpu == 0) {
674 core99_l2_cache = _get_L2CR();
675 printk("CPU0: L2CR is %lx\n", core99_l2_cache);
676 } else {
677 printk("CPU%d: L2CR was %lx\n", cpu, _get_L2CR());
678 _set_L2CR(0);
679 _set_L2CR(core99_l2_cache);
680 printk("CPU%d: L2CR set to %lx\n", cpu, core99_l2_cache);
681 }
682
683 if (!cpu_has_feature(CPU_FTR_L3CR))
684 return;
685
686 if (cpu == 0){
687 core99_l3_cache = _get_L3CR();
688 printk("CPU0: L3CR is %lx\n", core99_l3_cache);
689 } else {
690 printk("CPU%d: L3CR was %lx\n", cpu, _get_L3CR());
691 _set_L3CR(0);
692 _set_L3CR(core99_l3_cache);
693 printk("CPU%d: L3CR set to %lx\n", cpu, core99_l3_cache);
694 }
695}
696
697static void __init smp_core99_setup(int ncpus)
698{
699 struct device_node *cpu;
700 u32 *tbprop = NULL;
701 int i;
702
703 core99_tb_gpio = KL_GPIO_TB_ENABLE; /* default value */
704 cpu = of_find_node_by_type(NULL, "cpu");
705 if (cpu != NULL) {
706 tbprop = (u32 *)get_property(cpu, "timebase-enable", NULL);
707 if (tbprop)
708 core99_tb_gpio = *tbprop;
709 of_node_put(cpu);
710 }
711
712 /* XXX should get this from reg properties */
713 for (i = 1; i < ncpus; ++i)
714 smp_hw_index[i] = i;
715 powersave_nap = 0;
716}
717#endif
718
719static int __init smp_core99_probe(void)
720{
721 struct device_node *cpus;
722 int ncpus = 0;
723
724 if (ppc_md.progress) ppc_md.progress("smp_core99_probe", 0x345);
725
726 /* Count CPUs in the device-tree */
727 for (cpus = NULL; (cpus = of_find_node_by_type(cpus, "cpu")) != NULL;)
728 ++ncpus;
729
730 printk(KERN_INFO "PowerMac SMP probe found %d cpus\n", ncpus);
731
732 /* Nothing more to do if less than 2 of them */
733 if (ncpus <= 1)
734 return 1;
735
736 smp_core99_setup(ncpus);
737 mpic_request_ipis();
738 core99_init_caches(0);
739
740 return ncpus;
741}
742
743static void __devinit smp_core99_kick_cpu(int nr)
744{
745 unsigned int save_vector;
746 unsigned long new_vector;
747 unsigned long flags;
748 volatile unsigned int *vector
749 = ((volatile unsigned int *)(KERNELBASE+0x100));
750
751 if (nr < 0 || nr > 3)
752 return;
753 if (ppc_md.progress) ppc_md.progress("smp_core99_kick_cpu", 0x346);
754
755 local_irq_save(flags);
756 local_irq_disable();
757
758 /* Save reset vector */
759 save_vector = *vector;
760
761 /* Setup fake reset vector that does
762 * b __secondary_start_pmac_0 + nr*8 - KERNELBASE
763 */
764 new_vector = (unsigned long) __secondary_start_pmac_0 + nr * 8;
765 *vector = 0x48000002 + new_vector - KERNELBASE;
766
767 /* flush data cache and inval instruction cache */
768 flush_icache_range((unsigned long) vector, (unsigned long) vector + 4);
769
770 /* Put some life in our friend */
771 pmac_call_feature(PMAC_FTR_RESET_CPU, NULL, nr, 0);
772
773 /* FIXME: We wait a bit for the CPU to take the exception, I should
774 * instead wait for the entry code to set something for me. Well,
775 * ideally, all that crap will be done in prom.c and the CPU left
776 * in a RAM-based wait loop like CHRP.
777 */
778 mdelay(1);
779
780 /* Restore our exception vector */
781 *vector = save_vector;
782 flush_icache_range((unsigned long) vector, (unsigned long) vector + 4);
783
784 local_irq_restore(flags);
785 if (ppc_md.progress) ppc_md.progress("smp_core99_kick_cpu done", 0x347);
786}
787
788static void __devinit smp_core99_setup_cpu(int cpu_nr)
789{
790 /* Setup L2/L3 */
791 if (cpu_nr != 0)
792 core99_init_caches(cpu_nr);
793
794 /* Setup openpic */
795 mpic_setup_this_cpu();
796
797 if (cpu_nr == 0) {
798#ifdef CONFIG_POWER4
799 extern void g5_phy_disable_cpu1(void);
800
801 /* If we didn't start the second CPU, we must take
802 * it off the bus
803 */
804 if (machine_is_compatible("MacRISC4") &&
805 num_online_cpus() < 2)
806 g5_phy_disable_cpu1();
807#endif /* CONFIG_POWER4 */
808 if (ppc_md.progress) ppc_md.progress("core99_setup_cpu 0 done", 0x349);
809 }
810}
811
812
813/* Core99 Macs (dual G4s and G5s) */
814struct smp_ops_t core99_smp_ops = {
815 .message_pass = smp_mpic_message_pass,
816 .probe = smp_core99_probe,
817 .kick_cpu = smp_core99_kick_cpu,
818 .setup_cpu = smp_core99_setup_cpu,
819 .give_timebase = smp_core99_give_timebase,
820 .take_timebase = smp_core99_take_timebase,
821};
822
823#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC32)
824
825int __cpu_disable(void)
826{
827 cpu_clear(smp_processor_id(), cpu_online_map);
828
829 /* XXX reset cpu affinity here */
830 mpic_cpu_set_priority(0xf);
831 asm volatile("mtdec %0" : : "r" (0x7fffffff));
832 mb();
833 udelay(20);
834 asm volatile("mtdec %0" : : "r" (0x7fffffff));
835 return 0;
836}
837
838extern void low_cpu_die(void) __attribute__((noreturn)); /* in sleep.S */
839static int cpu_dead[NR_CPUS];
840
841void cpu_die(void)
842{
843 local_irq_disable();
844 cpu_dead[smp_processor_id()] = 1;
845 mb();
846 low_cpu_die();
847}
848
849void __cpu_die(unsigned int cpu)
850{
851 int timeout;
852
853 timeout = 1000;
854 while (!cpu_dead[cpu]) {
855 if (--timeout == 0) {
856 printk("CPU %u refused to die!\n", cpu);
857 break;
858 }
859 msleep(1);
860 }
861 cpu_callin_map[cpu] = 0;
862 cpu_dead[cpu] = 0;
863}
864
865#endif
diff --git a/arch/powerpc/platforms/powermac/time.c b/arch/powerpc/platforms/powermac/time.c
new file mode 100644
index 000000000000..5947b21a8588
--- /dev/null
+++ b/arch/powerpc/platforms/powermac/time.c
@@ -0,0 +1,360 @@
1/*
2 * Support for periodic interrupts (100 per second) and for getting
3 * the current time from the RTC on Power Macintoshes.
4 *
5 * We use the decrementer register for our periodic interrupts.
6 *
7 * Paul Mackerras August 1996.
8 * Copyright (C) 1996 Paul Mackerras.
9 * Copyright (C) 2003-2005 Benjamin Herrenschmidt.
10 *
11 */
12#include <linux/config.h>
13#include <linux/errno.h>
14#include <linux/sched.h>
15#include <linux/kernel.h>
16#include <linux/param.h>
17#include <linux/string.h>
18#include <linux/mm.h>
19#include <linux/init.h>
20#include <linux/time.h>
21#include <linux/adb.h>
22#include <linux/cuda.h>
23#include <linux/pmu.h>
24#include <linux/interrupt.h>
25#include <linux/hardirq.h>
26#include <linux/rtc.h>
27
28#include <asm/sections.h>
29#include <asm/prom.h>
30#include <asm/system.h>
31#include <asm/io.h>
32#include <asm/pgtable.h>
33#include <asm/machdep.h>
34#include <asm/time.h>
35#include <asm/nvram.h>
36#include <asm/smu.h>
37
38#undef DEBUG
39
40#ifdef DEBUG
41#define DBG(x...) printk(x)
42#else
43#define DBG(x...)
44#endif
45
46/* Apparently the RTC stores seconds since 1 Jan 1904 */
47#define RTC_OFFSET 2082844800
48
49/*
50 * Calibrate the decrementer frequency with the VIA timer 1.
51 */
52#define VIA_TIMER_FREQ_6 4700000 /* time 1 frequency * 6 */
53
54/* VIA registers */
55#define RS 0x200 /* skip between registers */
56#define T1CL (4*RS) /* Timer 1 ctr/latch (low 8 bits) */
57#define T1CH (5*RS) /* Timer 1 counter (high 8 bits) */
58#define T1LL (6*RS) /* Timer 1 latch (low 8 bits) */
59#define T1LH (7*RS) /* Timer 1 latch (high 8 bits) */
60#define ACR (11*RS) /* Auxiliary control register */
61#define IFR (13*RS) /* Interrupt flag register */
62
63/* Bits in ACR */
64#define T1MODE 0xc0 /* Timer 1 mode */
65#define T1MODE_CONT 0x40 /* continuous interrupts */
66
67/* Bits in IFR and IER */
68#define T1_INT 0x40 /* Timer 1 interrupt */
69
70long __init pmac_time_init(void)
71{
72 s32 delta = 0;
73#ifdef CONFIG_NVRAM
74 int dst;
75
76 delta = ((s32)pmac_xpram_read(PMAC_XPRAM_MACHINE_LOC + 0x9)) << 16;
77 delta |= ((s32)pmac_xpram_read(PMAC_XPRAM_MACHINE_LOC + 0xa)) << 8;
78 delta |= pmac_xpram_read(PMAC_XPRAM_MACHINE_LOC + 0xb);
79 if (delta & 0x00800000UL)
80 delta |= 0xFF000000UL;
81 dst = ((pmac_xpram_read(PMAC_XPRAM_MACHINE_LOC + 0x8) & 0x80) != 0);
82 printk("GMT Delta read from XPRAM: %d minutes, DST: %s\n", delta/60,
83 dst ? "on" : "off");
84#endif
85 return delta;
86}
87
88static void to_rtc_time(unsigned long now, struct rtc_time *tm)
89{
90 to_tm(now, tm);
91 tm->tm_year -= 1900;
92 tm->tm_mon -= 1;
93}
94
95static unsigned long from_rtc_time(struct rtc_time *tm)
96{
97 return mktime(tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday,
98 tm->tm_hour, tm->tm_min, tm->tm_sec);
99}
100
101#ifdef CONFIG_ADB_CUDA
102static unsigned long cuda_get_time(void)
103{
104 struct adb_request req;
105 unsigned long now;
106
107 if (cuda_request(&req, NULL, 2, CUDA_PACKET, CUDA_GET_TIME) < 0)
108 return 0;
109 while (!req.complete)
110 cuda_poll();
111 if (req.reply_len != 7)
112 printk(KERN_ERR "cuda_get_time: got %d byte reply\n",
113 req.reply_len);
114 now = (req.reply[3] << 24) + (req.reply[4] << 16)
115 + (req.reply[5] << 8) + req.reply[6];
116 return now - RTC_OFFSET;
117}
118
119#define cuda_get_rtc_time(tm) to_rtc_time(cuda_get_time(), (tm))
120
121static int cuda_set_rtc_time(struct rtc_time *tm)
122{
123 unsigned int nowtime;
124 struct adb_request req;
125
126 nowtime = from_rtc_time(tm) + RTC_OFFSET;
127 if (cuda_request(&req, NULL, 6, CUDA_PACKET, CUDA_SET_TIME,
128 nowtime >> 24, nowtime >> 16, nowtime >> 8,
129 nowtime) < 0)
130 return -ENXIO;
131 while (!req.complete)
132 cuda_poll();
133 if ((req.reply_len != 3) && (req.reply_len != 7))
134 printk(KERN_ERR "cuda_set_rtc_time: got %d byte reply\n",
135 req.reply_len);
136 return 0;
137}
138
139#else
140#define cuda_get_time() 0
141#define cuda_get_rtc_time(tm)
142#define cuda_set_rtc_time(tm) 0
143#endif
144
145#ifdef CONFIG_ADB_PMU
146static unsigned long pmu_get_time(void)
147{
148 struct adb_request req;
149 unsigned long now;
150
151 if (pmu_request(&req, NULL, 1, PMU_READ_RTC) < 0)
152 return 0;
153 pmu_wait_complete(&req);
154 if (req.reply_len != 4)
155 printk(KERN_ERR "pmu_get_time: got %d byte reply from PMU\n",
156 req.reply_len);
157 now = (req.reply[0] << 24) + (req.reply[1] << 16)
158 + (req.reply[2] << 8) + req.reply[3];
159 return now - RTC_OFFSET;
160}
161
162#define pmu_get_rtc_time(tm) to_rtc_time(pmu_get_time(), (tm))
163
164static int pmu_set_rtc_time(struct rtc_time *tm)
165{
166 unsigned int nowtime;
167 struct adb_request req;
168
169 nowtime = from_rtc_time(tm) + RTC_OFFSET;
170 if (pmu_request(&req, NULL, 5, PMU_SET_RTC, nowtime >> 24,
171 nowtime >> 16, nowtime >> 8, nowtime) < 0)
172 return -ENXIO;
173 pmu_wait_complete(&req);
174 if (req.reply_len != 0)
175 printk(KERN_ERR "pmu_set_rtc_time: %d byte reply from PMU\n",
176 req.reply_len);
177 return 0;
178}
179
180#else
181#define pmu_get_time() 0
182#define pmu_get_rtc_time(tm)
183#define pmu_set_rtc_time(tm) 0
184#endif
185
186#ifdef CONFIG_PMAC_SMU
187static unsigned long smu_get_time(void)
188{
189 struct rtc_time tm;
190
191 if (smu_get_rtc_time(&tm, 1))
192 return 0;
193 return from_rtc_time(&tm);
194}
195
196#else
197#define smu_get_time() 0
198#define smu_get_rtc_time(tm, spin)
199#define smu_set_rtc_time(tm, spin) 0
200#endif
201
202unsigned long pmac_get_boot_time(void)
203{
204 /* Get the time from the RTC, used only at boot time */
205 switch (sys_ctrler) {
206 case SYS_CTRLER_CUDA:
207 return cuda_get_time();
208 case SYS_CTRLER_PMU:
209 return pmu_get_time();
210 case SYS_CTRLER_SMU:
211 return smu_get_time();
212 default:
213 return 0;
214 }
215}
216
217void pmac_get_rtc_time(struct rtc_time *tm)
218{
219 /* Get the time from the RTC, used only at boot time */
220 switch (sys_ctrler) {
221 case SYS_CTRLER_CUDA:
222 cuda_get_rtc_time(tm);
223 break;
224 case SYS_CTRLER_PMU:
225 pmu_get_rtc_time(tm);
226 break;
227 case SYS_CTRLER_SMU:
228 smu_get_rtc_time(tm, 1);
229 break;
230 default:
231 ;
232 }
233}
234
235int pmac_set_rtc_time(struct rtc_time *tm)
236{
237 switch (sys_ctrler) {
238 case SYS_CTRLER_CUDA:
239 return cuda_set_rtc_time(tm);
240 case SYS_CTRLER_PMU:
241 return pmu_set_rtc_time(tm);
242 case SYS_CTRLER_SMU:
243 return smu_set_rtc_time(tm, 1);
244 default:
245 return -ENODEV;
246 }
247}
248
249#ifdef CONFIG_PPC32
250/*
251 * Calibrate the decrementer register using VIA timer 1.
252 * This is used both on powermacs and CHRP machines.
253 */
254int __init via_calibrate_decr(void)
255{
256 struct device_node *vias;
257 volatile unsigned char __iomem *via;
258 int count = VIA_TIMER_FREQ_6 / 100;
259 unsigned int dstart, dend;
260
261 vias = find_devices("via-cuda");
262 if (vias == 0)
263 vias = find_devices("via-pmu");
264 if (vias == 0)
265 vias = find_devices("via");
266 if (vias == 0 || vias->n_addrs == 0)
267 return 0;
268 via = ioremap(vias->addrs[0].address, vias->addrs[0].size);
269
270 /* set timer 1 for continuous interrupts */
271 out_8(&via[ACR], (via[ACR] & ~T1MODE) | T1MODE_CONT);
272 /* set the counter to a small value */
273 out_8(&via[T1CH], 2);
274 /* set the latch to `count' */
275 out_8(&via[T1LL], count);
276 out_8(&via[T1LH], count >> 8);
277 /* wait until it hits 0 */
278 while ((in_8(&via[IFR]) & T1_INT) == 0)
279 ;
280 dstart = get_dec();
281 /* clear the interrupt & wait until it hits 0 again */
282 in_8(&via[T1CL]);
283 while ((in_8(&via[IFR]) & T1_INT) == 0)
284 ;
285 dend = get_dec();
286
287 ppc_tb_freq = (dstart - dend) * 100 / 6;
288
289 iounmap(via);
290
291 return 1;
292}
293#endif
294
295#ifdef CONFIG_PM
296/*
297 * Reset the time after a sleep.
298 */
299static int
300time_sleep_notify(struct pmu_sleep_notifier *self, int when)
301{
302 static unsigned long time_diff;
303 unsigned long flags;
304 unsigned long seq;
305 struct timespec tv;
306
307 switch (when) {
308 case PBOOK_SLEEP_NOW:
309 do {
310 seq = read_seqbegin_irqsave(&xtime_lock, flags);
311 time_diff = xtime.tv_sec - pmac_get_boot_time();
312 } while (read_seqretry_irqrestore(&xtime_lock, seq, flags));
313 break;
314 case PBOOK_WAKE:
315 tv.tv_sec = pmac_get_boot_time() + time_diff;
316 tv.tv_nsec = 0;
317 do_settimeofday(&tv);
318 break;
319 }
320 return PBOOK_SLEEP_OK;
321}
322
323static struct pmu_sleep_notifier time_sleep_notifier = {
324 time_sleep_notify, SLEEP_LEVEL_MISC,
325};
326#endif /* CONFIG_PM */
327
328/*
329 * Query the OF and get the decr frequency.
330 */
331void __init pmac_calibrate_decr(void)
332{
333#ifdef CONFIG_PM
334 /* XXX why here? */
335 pmu_register_sleep_notifier(&time_sleep_notifier);
336#endif /* CONFIG_PM */
337
338 generic_calibrate_decr();
339
340#ifdef CONFIG_PPC32
341 /* We assume MacRISC2 machines have correct device-tree
342 * calibration. That's better since the VIA itself seems
343 * to be slightly off. --BenH
344 */
345 if (!machine_is_compatible("MacRISC2") &&
346 !machine_is_compatible("MacRISC3") &&
347 !machine_is_compatible("MacRISC4"))
348 if (via_calibrate_decr())
349 return;
350
351 /* Special case: QuickSilver G4s seem to have a badly calibrated
352 * timebase-frequency in OF, VIA is much better on these. We should
353 * probably implement calibration based on the KL timer on these
354 * machines anyway... -BenH
355 */
356 if (machine_is_compatible("PowerMac3,5"))
357 if (via_calibrate_decr())
358 return;
359#endif
360}
diff --git a/arch/powerpc/platforms/prep/Kconfig b/arch/powerpc/platforms/prep/Kconfig
new file mode 100644
index 000000000000..673ac47a1626
--- /dev/null
+++ b/arch/powerpc/platforms/prep/Kconfig
@@ -0,0 +1,22 @@
1
2config PREP_RESIDUAL
3 bool "Support for PReP Residual Data"
4 depends on PPC_PREP
5 help
6 Some PReP systems have residual data passed to the kernel by the
7 firmware. This allows detection of memory size, devices present and
8 other useful pieces of information. Sometimes this information is
9 not present or incorrect, in which case it could lead to the machine
10 behaving incorrectly. If this happens, either disable PREP_RESIDUAL
11 or pass the 'noresidual' option to the kernel.
12
13 If you are running a PReP system, say Y here, otherwise say N.
14
15config PROC_PREPRESIDUAL
16 bool "Support for reading of PReP Residual Data in /proc"
17 depends on PREP_RESIDUAL && PROC_FS
18 help
19 Enabling this option will create a /proc/residual file which allows
20 you to get at the residual data on PReP systems. You will need a tool
21 (lsresidual) to parse it. If you aren't on a PReP system, you don't
22 want this.
diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig
new file mode 100644
index 000000000000..2d57f588151d
--- /dev/null
+++ b/arch/powerpc/platforms/pseries/Kconfig
@@ -0,0 +1,42 @@
1
2config PPC_SPLPAR
3 depends on PPC_PSERIES
4 bool "Support for shared-processor logical partitions"
5 default n
6 help
7 Enabling this option will make the kernel run more efficiently
8 on logically-partitioned pSeries systems which use shared
9 processors, that is, which share physical processors between
10 two or more partitions.
11
12config HMT
13 bool "Hardware multithreading"
14 depends on SMP && PPC_PSERIES && BROKEN
15 help
16 This option enables hardware multithreading on RS64 cpus.
17 pSeries systems p620 and p660 have such a cpu type.
18
19config EEH
20 bool "PCI Extended Error Handling (EEH)" if EMBEDDED
21 depends on PPC_PSERIES
22 default y if !EMBEDDED
23
24config RTAS_PROC
25 bool "Proc interface to RTAS"
26 depends on PPC_RTAS
27 default y
28
29config RTAS_FLASH
30 tristate "Firmware flash interface"
31 depends on PPC64 && RTAS_PROC
32
33config SCANLOG
34 tristate "Scanlog dump interface"
35 depends on RTAS_PROC && PPC_PSERIES
36
37config LPARCFG
38 tristate "LPAR Configuration Data"
39 depends on PPC_PSERIES || PPC_ISERIES
40 help
41 Provide system capacity information via human readable
42 <key word>=<value> pairs through a /proc/ppc64/lparcfg interface.
diff --git a/arch/powerpc/platforms/pseries/Makefile b/arch/powerpc/platforms/pseries/Makefile
new file mode 100644
index 000000000000..5ef494e3a70f
--- /dev/null
+++ b/arch/powerpc/platforms/pseries/Makefile
@@ -0,0 +1,5 @@
1obj-y := pci.o lpar.o hvCall.o nvram.o reconfig.o \
2 setup.o iommu.o rtas-fw.o ras.o
3obj-$(CONFIG_SMP) += smp.o
4obj-$(CONFIG_IBMVIO) += vio.o
5obj-$(CONFIG_XICS) += xics.o
diff --git a/arch/ppc64/kernel/pSeries_hvCall.S b/arch/powerpc/platforms/pseries/hvCall.S
index 176e8da76466..176e8da76466 100644
--- a/arch/ppc64/kernel/pSeries_hvCall.S
+++ b/arch/powerpc/platforms/pseries/hvCall.S
diff --git a/arch/ppc64/kernel/pSeries_iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index d17f0108a032..9e90d41131d8 100644
--- a/arch/ppc64/kernel/pSeries_iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -46,7 +46,8 @@
46#include <asm/pSeries_reconfig.h> 46#include <asm/pSeries_reconfig.h>
47#include <asm/systemcfg.h> 47#include <asm/systemcfg.h>
48#include <asm/firmware.h> 48#include <asm/firmware.h>
49#include "pci.h" 49#include <asm/tce.h>
50#include <asm/ppc-pci.h>
50 51
51#define DBG(fmt...) 52#define DBG(fmt...)
52 53
@@ -59,6 +60,9 @@ static void tce_build_pSeries(struct iommu_table *tbl, long index,
59 union tce_entry t; 60 union tce_entry t;
60 union tce_entry *tp; 61 union tce_entry *tp;
61 62
63 index <<= TCE_PAGE_FACTOR;
64 npages <<= TCE_PAGE_FACTOR;
65
62 t.te_word = 0; 66 t.te_word = 0;
63 t.te_rdwr = 1; // Read allowed 67 t.te_rdwr = 1; // Read allowed
64 68
@@ -69,11 +73,11 @@ static void tce_build_pSeries(struct iommu_table *tbl, long index,
69 73
70 while (npages--) { 74 while (npages--) {
71 /* can't move this out since we might cross LMB boundary */ 75 /* can't move this out since we might cross LMB boundary */
72 t.te_rpn = (virt_to_abs(uaddr)) >> PAGE_SHIFT; 76 t.te_rpn = (virt_to_abs(uaddr)) >> TCE_SHIFT;
73 77
74 tp->te_word = t.te_word; 78 tp->te_word = t.te_word;
75 79
76 uaddr += PAGE_SIZE; 80 uaddr += TCE_PAGE_SIZE;
77 tp++; 81 tp++;
78 } 82 }
79} 83}
@@ -84,6 +88,9 @@ static void tce_free_pSeries(struct iommu_table *tbl, long index, long npages)
84 union tce_entry t; 88 union tce_entry t;
85 union tce_entry *tp; 89 union tce_entry *tp;
86 90
91 npages <<= TCE_PAGE_FACTOR;
92 index <<= TCE_PAGE_FACTOR;
93
87 t.te_word = 0; 94 t.te_word = 0;
88 tp = ((union tce_entry *)tbl->it_base) + index; 95 tp = ((union tce_entry *)tbl->it_base) + index;
89 96
@@ -103,7 +110,7 @@ static void tce_build_pSeriesLP(struct iommu_table *tbl, long tcenum,
103 union tce_entry tce; 110 union tce_entry tce;
104 111
105 tce.te_word = 0; 112 tce.te_word = 0;
106 tce.te_rpn = (virt_to_abs(uaddr)) >> PAGE_SHIFT; 113 tce.te_rpn = (virt_to_abs(uaddr)) >> TCE_SHIFT;
107 tce.te_rdwr = 1; 114 tce.te_rdwr = 1;
108 if (direction != DMA_TO_DEVICE) 115 if (direction != DMA_TO_DEVICE)
109 tce.te_pciwr = 1; 116 tce.te_pciwr = 1;
@@ -136,6 +143,9 @@ static void tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum,
136 union tce_entry tce, *tcep; 143 union tce_entry tce, *tcep;
137 long l, limit; 144 long l, limit;
138 145
146 tcenum <<= TCE_PAGE_FACTOR;
147 npages <<= TCE_PAGE_FACTOR;
148
139 if (npages == 1) 149 if (npages == 1)
140 return tce_build_pSeriesLP(tbl, tcenum, npages, uaddr, 150 return tce_build_pSeriesLP(tbl, tcenum, npages, uaddr,
141 direction); 151 direction);
@@ -155,7 +165,7 @@ static void tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum,
155 } 165 }
156 166
157 tce.te_word = 0; 167 tce.te_word = 0;
158 tce.te_rpn = (virt_to_abs(uaddr)) >> PAGE_SHIFT; 168 tce.te_rpn = (virt_to_abs(uaddr)) >> TCE_SHIFT;
159 tce.te_rdwr = 1; 169 tce.te_rdwr = 1;
160 if (direction != DMA_TO_DEVICE) 170 if (direction != DMA_TO_DEVICE)
161 tce.te_pciwr = 1; 171 tce.te_pciwr = 1;
@@ -166,7 +176,7 @@ static void tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum,
166 * Set up the page with TCE data, looping through and setting 176 * Set up the page with TCE data, looping through and setting
167 * the values. 177 * the values.
168 */ 178 */
169 limit = min_t(long, npages, PAGE_SIZE/sizeof(union tce_entry)); 179 limit = min_t(long, npages, 4096/sizeof(union tce_entry));
170 180
171 for (l = 0; l < limit; l++) { 181 for (l = 0; l < limit; l++) {
172 tcep[l] = tce; 182 tcep[l] = tce;
@@ -196,6 +206,9 @@ static void tce_free_pSeriesLP(struct iommu_table *tbl, long tcenum, long npages
196 u64 rc; 206 u64 rc;
197 union tce_entry tce; 207 union tce_entry tce;
198 208
209 tcenum <<= TCE_PAGE_FACTOR;
210 npages <<= TCE_PAGE_FACTOR;
211
199 tce.te_word = 0; 212 tce.te_word = 0;
200 213
201 while (npages--) { 214 while (npages--) {
@@ -221,6 +234,9 @@ static void tce_freemulti_pSeriesLP(struct iommu_table *tbl, long tcenum, long n
221 u64 rc; 234 u64 rc;
222 union tce_entry tce; 235 union tce_entry tce;
223 236
237 tcenum <<= TCE_PAGE_FACTOR;
238 npages <<= TCE_PAGE_FACTOR;
239
224 tce.te_word = 0; 240 tce.te_word = 0;
225 241
226 rc = plpar_tce_stuff((u64)tbl->it_index, 242 rc = plpar_tce_stuff((u64)tbl->it_index,
diff --git a/arch/ppc64/kernel/pSeries_lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index a6de83f2078f..268d8362dde7 100644
--- a/arch/ppc64/kernel/pSeries_lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -486,8 +486,7 @@ static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long va,
486 * Take a spinlock around flushes to avoid bouncing the hypervisor tlbie 486 * Take a spinlock around flushes to avoid bouncing the hypervisor tlbie
487 * lock. 487 * lock.
488 */ 488 */
489void pSeries_lpar_flush_hash_range(unsigned long context, unsigned long number, 489void pSeries_lpar_flush_hash_range(unsigned long number, int local)
490 int local)
491{ 490{
492 int i; 491 int i;
493 unsigned long flags = 0; 492 unsigned long flags = 0;
@@ -498,7 +497,7 @@ void pSeries_lpar_flush_hash_range(unsigned long context, unsigned long number,
498 spin_lock_irqsave(&pSeries_lpar_tlbie_lock, flags); 497 spin_lock_irqsave(&pSeries_lpar_tlbie_lock, flags);
499 498
500 for (i = 0; i < number; i++) 499 for (i = 0; i < number; i++)
501 flush_hash_page(context, batch->addr[i], batch->pte[i], local); 500 flush_hash_page(batch->vaddr[i], batch->pte[i], local);
502 501
503 if (lock_tlbie) 502 if (lock_tlbie)
504 spin_unlock_irqrestore(&pSeries_lpar_tlbie_lock, flags); 503 spin_unlock_irqrestore(&pSeries_lpar_tlbie_lock, flags);
diff --git a/arch/ppc64/kernel/pSeries_nvram.c b/arch/powerpc/platforms/pseries/nvram.c
index 18abfb1f4e24..18abfb1f4e24 100644
--- a/arch/ppc64/kernel/pSeries_nvram.c
+++ b/arch/powerpc/platforms/pseries/nvram.c
diff --git a/arch/ppc64/kernel/pSeries_pci.c b/arch/powerpc/platforms/pseries/pci.c
index 928f8febdb3b..c198656a3bb5 100644
--- a/arch/ppc64/kernel/pSeries_pci.c
+++ b/arch/powerpc/platforms/pseries/pci.c
@@ -29,8 +29,7 @@
29 29
30#include <asm/pci-bridge.h> 30#include <asm/pci-bridge.h>
31#include <asm/prom.h> 31#include <asm/prom.h>
32 32#include <asm/ppc-pci.h>
33#include "pci.h"
34 33
35static int __devinitdata s7a_workaround = -1; 34static int __devinitdata s7a_workaround = -1;
36 35
diff --git a/arch/ppc64/kernel/ras.c b/arch/powerpc/platforms/pseries/ras.c
index 41b97dc9cc0a..6562ff4b0a82 100644
--- a/arch/ppc64/kernel/ras.c
+++ b/arch/powerpc/platforms/pseries/ras.c
@@ -1,17 +1,16 @@
1/* 1/*
2 * ras.c
3 * Copyright (C) 2001 Dave Engebretsen IBM Corporation 2 * Copyright (C) 2001 Dave Engebretsen IBM Corporation
4 * 3 *
5 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by 5 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or 6 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version. 7 * (at your option) any later version.
9 * 8 *
10 * This program is distributed in the hope that it will be useful, 9 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details. 12 * GNU General Public License for more details.
14 * 13 *
15 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software 15 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
@@ -19,7 +18,7 @@
19 18
20/* Change Activity: 19/* Change Activity:
21 * 2001/09/21 : engebret : Created with minimal EPOW and HW exception support. 20 * 2001/09/21 : engebret : Created with minimal EPOW and HW exception support.
22 * End Change Activity 21 * End Change Activity
23 */ 22 */
24 23
25#include <linux/errno.h> 24#include <linux/errno.h>
@@ -323,7 +322,7 @@ static int recover_mce(struct pt_regs *regs, struct rtas_error_log * err)
323 nonfatal = 1; 322 nonfatal = 1;
324 } 323 }
325 324
326 log_error((char *)err, ERR_TYPE_RTAS_LOG, !nonfatal); 325 log_error((char *)err, ERR_TYPE_RTAS_LOG, !nonfatal);
327 326
328 return nonfatal; 327 return nonfatal;
329} 328}
diff --git a/arch/ppc64/kernel/pSeries_reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c
index 58c61219d08e..58c61219d08e 100644
--- a/arch/ppc64/kernel/pSeries_reconfig.c
+++ b/arch/powerpc/platforms/pseries/reconfig.c
diff --git a/arch/powerpc/platforms/pseries/rtas-fw.c b/arch/powerpc/platforms/pseries/rtas-fw.c
new file mode 100644
index 000000000000..15d81d758ca0
--- /dev/null
+++ b/arch/powerpc/platforms/pseries/rtas-fw.c
@@ -0,0 +1,138 @@
1/*
2 *
3 * Procedures for firmware flash updates on pSeries systems.
4 *
5 * Peter Bergner, IBM March 2001.
6 * Copyright (C) 2001 IBM.
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; either version
11 * 2 of the License, or (at your option) any later version.
12 */
13
14#include <stdarg.h>
15#include <linux/kernel.h>
16#include <linux/types.h>
17#include <linux/spinlock.h>
18#include <linux/module.h>
19#include <linux/init.h>
20
21#include <asm/prom.h>
22#include <asm/rtas.h>
23#include <asm/semaphore.h>
24#include <asm/machdep.h>
25#include <asm/page.h>
26#include <asm/param.h>
27#include <asm/system.h>
28#include <asm/abs_addr.h>
29#include <asm/udbg.h>
30#include <asm/delay.h>
31#include <asm/uaccess.h>
32#include <asm/systemcfg.h>
33
34#include "rtas-fw.h"
35
36struct flash_block_list_header rtas_firmware_flash_list = {0, NULL};
37
38#define FLASH_BLOCK_LIST_VERSION (1UL)
39
40static void rtas_flash_firmware(void)
41{
42 unsigned long image_size;
43 struct flash_block_list *f, *next, *flist;
44 unsigned long rtas_block_list;
45 int i, status, update_token;
46
47 update_token = rtas_token("ibm,update-flash-64-and-reboot");
48 if (update_token == RTAS_UNKNOWN_SERVICE) {
49 printk(KERN_ALERT "FLASH: ibm,update-flash-64-and-reboot is not available -- not a service partition?\n");
50 printk(KERN_ALERT "FLASH: firmware will not be flashed\n");
51 return;
52 }
53
54 /* NOTE: the "first" block list is a global var with no data
55 * blocks in the kernel data segment. We do this because
56 * we want to ensure this block_list addr is under 4GB.
57 */
58 rtas_firmware_flash_list.num_blocks = 0;
59 flist = (struct flash_block_list *)&rtas_firmware_flash_list;
60 rtas_block_list = virt_to_abs(flist);
61 if (rtas_block_list >= 4UL*1024*1024*1024) {
62 printk(KERN_ALERT "FLASH: kernel bug...flash list header addr above 4GB\n");
63 return;
64 }
65
66 printk(KERN_ALERT "FLASH: preparing saved firmware image for flash\n");
67 /* Update the block_list in place. */
68 image_size = 0;
69 for (f = flist; f; f = next) {
70 /* Translate data addrs to absolute */
71 for (i = 0; i < f->num_blocks; i++) {
72 f->blocks[i].data = (char *)virt_to_abs(f->blocks[i].data);
73 image_size += f->blocks[i].length;
74 }
75 next = f->next;
76 /* Don't translate NULL pointer for last entry */
77 if (f->next)
78 f->next = (struct flash_block_list *)virt_to_abs(f->next);
79 else
80 f->next = NULL;
81 /* make num_blocks into the version/length field */
82 f->num_blocks = (FLASH_BLOCK_LIST_VERSION << 56) | ((f->num_blocks+1)*16);
83 }
84
85 printk(KERN_ALERT "FLASH: flash image is %ld bytes\n", image_size);
86 printk(KERN_ALERT "FLASH: performing flash and reboot\n");
87 rtas_progress("Flashing \n", 0x0);
88 rtas_progress("Please Wait... ", 0x0);
89 printk(KERN_ALERT "FLASH: this will take several minutes. Do not power off!\n");
90 status = rtas_call(update_token, 1, 1, NULL, rtas_block_list);
91 switch (status) { /* should only get "bad" status */
92 case 0:
93 printk(KERN_ALERT "FLASH: success\n");
94 break;
95 case -1:
96 printk(KERN_ALERT "FLASH: hardware error. Firmware may not be not flashed\n");
97 break;
98 case -3:
99 printk(KERN_ALERT "FLASH: image is corrupt or not correct for this platform. Firmware not flashed\n");
100 break;
101 case -4:
102 printk(KERN_ALERT "FLASH: flash failed when partially complete. System may not reboot\n");
103 break;
104 default:
105 printk(KERN_ALERT "FLASH: unknown flash return code %d\n", status);
106 break;
107 }
108}
109
110void rtas_flash_bypass_warning(void)
111{
112 printk(KERN_ALERT "FLASH: firmware flash requires a reboot\n");
113 printk(KERN_ALERT "FLASH: the firmware image will NOT be flashed\n");
114}
115
116
117void rtas_fw_restart(char *cmd)
118{
119 if (rtas_firmware_flash_list.next)
120 rtas_flash_firmware();
121 rtas_restart(cmd);
122}
123
124void rtas_fw_power_off(void)
125{
126 if (rtas_firmware_flash_list.next)
127 rtas_flash_bypass_warning();
128 rtas_power_off();
129}
130
131void rtas_fw_halt(void)
132{
133 if (rtas_firmware_flash_list.next)
134 rtas_flash_bypass_warning();
135 rtas_halt();
136}
137
138EXPORT_SYMBOL(rtas_firmware_flash_list);
diff --git a/arch/powerpc/platforms/pseries/rtas-fw.h b/arch/powerpc/platforms/pseries/rtas-fw.h
new file mode 100644
index 000000000000..e70fa69974a3
--- /dev/null
+++ b/arch/powerpc/platforms/pseries/rtas-fw.h
@@ -0,0 +1,3 @@
1void rtas_fw_restart(char *cmd);
2void rtas_fw_power_off(void);
3void rtas_fw_halt(void);
diff --git a/arch/ppc64/kernel/pSeries_setup.c b/arch/powerpc/platforms/pseries/setup.c
index 3009701eb90d..10cb0f2d9b5b 100644
--- a/arch/ppc64/kernel/pSeries_setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/ppc/kernel/setup.c 2 * 64-bit pSeries and RS/6000 setup code.
3 * 3 *
4 * Copyright (C) 1995 Linus Torvalds 4 * Copyright (C) 1995 Linus Torvalds
5 * Adapted from 'alpha' version by Gary Thomas 5 * Adapted from 'alpha' version by Gary Thomas
@@ -59,13 +59,15 @@
59#include <asm/time.h> 59#include <asm/time.h>
60#include <asm/nvram.h> 60#include <asm/nvram.h>
61#include <asm/plpar_wrappers.h> 61#include <asm/plpar_wrappers.h>
62#include <asm/xics.h> 62#include "xics.h"
63#include <asm/firmware.h> 63#include <asm/firmware.h>
64#include <asm/pmc.h> 64#include <asm/pmc.h>
65#include <asm/mpic.h>
66#include <asm/ppc-pci.h>
67#include <asm/i8259.h>
68#include <asm/udbg.h>
65 69
66#include "i8259.h" 70#include "rtas-fw.h"
67#include "mpic.h"
68#include "pci.h"
69 71
70#ifdef DEBUG 72#ifdef DEBUG
71#define DBG(fmt...) udbg_printf(fmt) 73#define DBG(fmt...) udbg_printf(fmt)
@@ -84,13 +86,12 @@ int fwnmi_active; /* TRUE if an FWNMI handler is present */
84extern void pSeries_system_reset_exception(struct pt_regs *regs); 86extern void pSeries_system_reset_exception(struct pt_regs *regs);
85extern int pSeries_machine_check_exception(struct pt_regs *regs); 87extern int pSeries_machine_check_exception(struct pt_regs *regs);
86 88
87static int pseries_shared_idle(void); 89static void pseries_shared_idle(void);
88static int pseries_dedicated_idle(void); 90static void pseries_dedicated_idle(void);
89 91
90static volatile void __iomem * chrp_int_ack_special;
91struct mpic *pSeries_mpic; 92struct mpic *pSeries_mpic;
92 93
93void pSeries_get_cpuinfo(struct seq_file *m) 94void pSeries_show_cpuinfo(struct seq_file *m)
94{ 95{
95 struct device_node *root; 96 struct device_node *root;
96 const char *model = ""; 97 const char *model = "";
@@ -119,19 +120,11 @@ static void __init fwnmi_init(void)
119 fwnmi_active = 1; 120 fwnmi_active = 1;
120} 121}
121 122
122static int pSeries_irq_cascade(struct pt_regs *regs, void *data)
123{
124 if (chrp_int_ack_special)
125 return readb(chrp_int_ack_special);
126 else
127 return i8259_irq(smp_processor_id());
128}
129
130static void __init pSeries_init_mpic(void) 123static void __init pSeries_init_mpic(void)
131{ 124{
132 unsigned int *addrp; 125 unsigned int *addrp;
133 struct device_node *np; 126 struct device_node *np;
134 int i; 127 unsigned long intack = 0;
135 128
136 /* All ISUs are setup, complete initialization */ 129 /* All ISUs are setup, complete initialization */
137 mpic_init(pSeries_mpic); 130 mpic_init(pSeries_mpic);
@@ -142,16 +135,14 @@ static void __init pSeries_init_mpic(void)
142 get_property(np, "8259-interrupt-acknowledge", NULL))) 135 get_property(np, "8259-interrupt-acknowledge", NULL)))
143 printk(KERN_ERR "Cannot find pci to get ack address\n"); 136 printk(KERN_ERR "Cannot find pci to get ack address\n");
144 else 137 else
145 chrp_int_ack_special = ioremap(addrp[prom_n_addr_cells(np)-1], 1); 138 intack = addrp[prom_n_addr_cells(np)-1];
146 of_node_put(np); 139 of_node_put(np);
147 140
148 /* Setup the legacy interrupts & controller */ 141 /* Setup the legacy interrupts & controller */
149 for (i = 0; i < NUM_ISA_INTERRUPTS; i++) 142 i8259_init(intack, 0);
150 irq_desc[i].handler = &i8259_pic;
151 i8259_init(0);
152 143
153 /* Hook cascade to mpic */ 144 /* Hook cascade to mpic */
154 mpic_setup_cascade(NUM_ISA_INTERRUPTS, pSeries_irq_cascade, NULL); 145 mpic_setup_cascade(NUM_ISA_INTERRUPTS, i8259_irq_cascade, NULL);
155} 146}
156 147
157static void __init pSeries_setup_mpic(void) 148static void __init pSeries_setup_mpic(void)
@@ -241,10 +232,6 @@ static void __init pSeries_setup_arch(void)
241 find_and_init_phbs(); 232 find_and_init_phbs();
242 eeh_init(); 233 eeh_init();
243 234
244#ifdef CONFIG_DUMMY_CONSOLE
245 conswitchp = &dummy_con;
246#endif
247
248 pSeries_nvram_init(); 235 pSeries_nvram_init();
249 236
250 /* Choose an idle loop */ 237 /* Choose an idle loop */
@@ -488,8 +475,8 @@ static inline void dedicated_idle_sleep(unsigned int cpu)
488 } 475 }
489} 476}
490 477
491static int pseries_dedicated_idle(void) 478static void pseries_dedicated_idle(void)
492{ 479{
493 long oldval; 480 long oldval;
494 struct paca_struct *lpaca = get_paca(); 481 struct paca_struct *lpaca = get_paca();
495 unsigned int cpu = smp_processor_id(); 482 unsigned int cpu = smp_processor_id();
@@ -544,7 +531,7 @@ static int pseries_dedicated_idle(void)
544 } 531 }
545} 532}
546 533
547static int pseries_shared_idle(void) 534static void pseries_shared_idle(void)
548{ 535{
549 struct paca_struct *lpaca = get_paca(); 536 struct paca_struct *lpaca = get_paca();
550 unsigned int cpu = smp_processor_id(); 537 unsigned int cpu = smp_processor_id();
@@ -586,8 +573,6 @@ static int pseries_shared_idle(void)
586 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING) 573 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING)
587 cpu_die(); 574 cpu_die();
588 } 575 }
589
590 return 0;
591} 576}
592 577
593static int pSeries_pci_probe_mode(struct pci_bus *bus) 578static int pSeries_pci_probe_mode(struct pci_bus *bus)
@@ -601,14 +586,14 @@ struct machdep_calls __initdata pSeries_md = {
601 .probe = pSeries_probe, 586 .probe = pSeries_probe,
602 .setup_arch = pSeries_setup_arch, 587 .setup_arch = pSeries_setup_arch,
603 .init_early = pSeries_init_early, 588 .init_early = pSeries_init_early,
604 .get_cpuinfo = pSeries_get_cpuinfo, 589 .show_cpuinfo = pSeries_show_cpuinfo,
605 .log_error = pSeries_log_error, 590 .log_error = pSeries_log_error,
606 .pcibios_fixup = pSeries_final_fixup, 591 .pcibios_fixup = pSeries_final_fixup,
607 .pci_probe_mode = pSeries_pci_probe_mode, 592 .pci_probe_mode = pSeries_pci_probe_mode,
608 .irq_bus_setup = pSeries_irq_bus_setup, 593 .irq_bus_setup = pSeries_irq_bus_setup,
609 .restart = rtas_restart, 594 .restart = rtas_fw_restart,
610 .power_off = rtas_power_off, 595 .power_off = rtas_fw_power_off,
611 .halt = rtas_halt, 596 .halt = rtas_fw_halt,
612 .panic = rtas_os_term, 597 .panic = rtas_os_term,
613 .cpu_die = pSeries_mach_cpu_die, 598 .cpu_die = pSeries_mach_cpu_die,
614 .get_boot_time = rtas_get_boot_time, 599 .get_boot_time = rtas_get_boot_time,
diff --git a/arch/ppc64/kernel/pSeries_smp.c b/arch/powerpc/platforms/pseries/smp.c
index d2c7e2c4733b..9c9458ddfc25 100644
--- a/arch/ppc64/kernel/pSeries_smp.c
+++ b/arch/powerpc/platforms/pseries/smp.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * SMP support for pSeries and BPA machines. 2 * SMP support for pSeries machines.
3 * 3 *
4 * Dave Engebretsen, Peter Bergner, and 4 * Dave Engebretsen, Peter Bergner, and
5 * Mike Corrigan {engebret|bergner|mikec}@us.ibm.com 5 * Mike Corrigan {engebret|bergner|mikec}@us.ibm.com
@@ -39,16 +39,14 @@
39#include <asm/paca.h> 39#include <asm/paca.h>
40#include <asm/time.h> 40#include <asm/time.h>
41#include <asm/machdep.h> 41#include <asm/machdep.h>
42#include <asm/xics.h> 42#include "xics.h"
43#include <asm/cputable.h> 43#include <asm/cputable.h>
44#include <asm/firmware.h> 44#include <asm/firmware.h>
45#include <asm/system.h> 45#include <asm/system.h>
46#include <asm/rtas.h> 46#include <asm/rtas.h>
47#include <asm/plpar_wrappers.h> 47#include <asm/plpar_wrappers.h>
48#include <asm/pSeries_reconfig.h> 48#include <asm/pSeries_reconfig.h>
49 49#include <asm/mpic.h>
50#include "mpic.h"
51#include "bpa_iic.h"
52 50
53#ifdef DEBUG 51#ifdef DEBUG
54#define DBG(fmt...) udbg_printf(fmt) 52#define DBG(fmt...) udbg_printf(fmt)
@@ -343,36 +341,6 @@ static void __devinit smp_xics_setup_cpu(int cpu)
343 341
344} 342}
345#endif /* CONFIG_XICS */ 343#endif /* CONFIG_XICS */
346#ifdef CONFIG_BPA_IIC
347static void smp_iic_message_pass(int target, int msg)
348{
349 unsigned int i;
350
351 if (target < NR_CPUS) {
352 iic_cause_IPI(target, msg);
353 } else {
354 for_each_online_cpu(i) {
355 if (target == MSG_ALL_BUT_SELF
356 && i == smp_processor_id())
357 continue;
358 iic_cause_IPI(i, msg);
359 }
360 }
361}
362
363static int __init smp_iic_probe(void)
364{
365 iic_request_IPIs();
366
367 return cpus_weight(cpu_possible_map);
368}
369
370static void __devinit smp_iic_setup_cpu(int cpu)
371{
372 if (cpu != boot_cpuid)
373 iic_setup_cpu();
374}
375#endif /* CONFIG_BPA_IIC */
376 344
377static DEFINE_SPINLOCK(timebase_lock); 345static DEFINE_SPINLOCK(timebase_lock);
378static unsigned long timebase = 0; 346static unsigned long timebase = 0;
@@ -444,15 +412,6 @@ static struct smp_ops_t pSeries_xics_smp_ops = {
444 .cpu_bootable = smp_pSeries_cpu_bootable, 412 .cpu_bootable = smp_pSeries_cpu_bootable,
445}; 413};
446#endif 414#endif
447#ifdef CONFIG_BPA_IIC
448static struct smp_ops_t bpa_iic_smp_ops = {
449 .message_pass = smp_iic_message_pass,
450 .probe = smp_iic_probe,
451 .kick_cpu = smp_pSeries_kick_cpu,
452 .setup_cpu = smp_iic_setup_cpu,
453 .cpu_bootable = smp_pSeries_cpu_bootable,
454};
455#endif
456 415
457/* This is called very early */ 416/* This is called very early */
458void __init smp_init_pSeries(void) 417void __init smp_init_pSeries(void)
@@ -472,11 +431,6 @@ void __init smp_init_pSeries(void)
472 smp_ops = &pSeries_xics_smp_ops; 431 smp_ops = &pSeries_xics_smp_ops;
473 break; 432 break;
474#endif 433#endif
475#ifdef CONFIG_BPA_IIC
476 case IC_BPA_IIC:
477 smp_ops = &bpa_iic_smp_ops;
478 break;
479#endif
480 default: 434 default:
481 panic("Invalid interrupt controller"); 435 panic("Invalid interrupt controller");
482 } 436 }
diff --git a/arch/ppc64/kernel/pSeries_vio.c b/arch/powerpc/platforms/pseries/vio.c
index e0ae06f58f86..866379b80c09 100644
--- a/arch/ppc64/kernel/pSeries_vio.c
+++ b/arch/powerpc/platforms/pseries/vio.c
@@ -22,6 +22,7 @@
22#include <asm/prom.h> 22#include <asm/prom.h>
23#include <asm/vio.h> 23#include <asm/vio.h>
24#include <asm/hvcall.h> 24#include <asm/hvcall.h>
25#include <asm/tce.h>
25 26
26extern struct subsystem devices_subsys; /* needed for vio_find_name() */ 27extern struct subsystem devices_subsys; /* needed for vio_find_name() */
27 28
diff --git a/arch/ppc64/kernel/xics.c b/arch/powerpc/platforms/pseries/xics.c
index daf93885dcfa..c72c86f05cb6 100644
--- a/arch/ppc64/kernel/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * arch/ppc64/kernel/xics.c 2 * arch/powerpc/platforms/pseries/xics.c
3 * 3 *
4 * Copyright 2000 IBM Corporation. 4 * Copyright 2000 IBM Corporation.
5 * 5 *
@@ -25,11 +25,11 @@
25#include <asm/pgtable.h> 25#include <asm/pgtable.h>
26#include <asm/smp.h> 26#include <asm/smp.h>
27#include <asm/rtas.h> 27#include <asm/rtas.h>
28#include <asm/xics.h>
29#include <asm/hvcall.h> 28#include <asm/hvcall.h>
30#include <asm/machdep.h> 29#include <asm/machdep.h>
30#include <asm/i8259.h>
31 31
32#include "i8259.h" 32#include "xics.h"
33 33
34static unsigned int xics_startup(unsigned int irq); 34static unsigned int xics_startup(unsigned int irq);
35static void xics_enable_irq(unsigned int irq); 35static void xics_enable_irq(unsigned int irq);
@@ -62,7 +62,7 @@ static struct radix_tree_root irq_map = RADIX_TREE_INIT(GFP_ATOMIC);
62/* Want a priority other than 0. Various HW issues require this. */ 62/* Want a priority other than 0. Various HW issues require this. */
63#define DEFAULT_PRIORITY 5 63#define DEFAULT_PRIORITY 5
64 64
65/* 65/*
66 * Mark IPIs as higher priority so we can take them inside interrupts that 66 * Mark IPIs as higher priority so we can take them inside interrupts that
67 * arent marked SA_INTERRUPT 67 * arent marked SA_INTERRUPT
68 */ 68 */
@@ -169,11 +169,11 @@ static inline long plpar_xirr(unsigned long *xirr_ret)
169static int pSeriesLP_xirr_info_get(int n_cpu) 169static int pSeriesLP_xirr_info_get(int n_cpu)
170{ 170{
171 unsigned long lpar_rc; 171 unsigned long lpar_rc;
172 unsigned long return_value; 172 unsigned long return_value;
173 173
174 lpar_rc = plpar_xirr(&return_value); 174 lpar_rc = plpar_xirr(&return_value);
175 if (lpar_rc != H_Success) 175 if (lpar_rc != H_Success)
176 panic(" bad return code xirr - rc = %lx \n", lpar_rc); 176 panic(" bad return code xirr - rc = %lx \n", lpar_rc);
177 return (int)return_value; 177 return (int)return_value;
178} 178}
179 179
@@ -185,7 +185,7 @@ static void pSeriesLP_xirr_info_set(int n_cpu, int value)
185 lpar_rc = plpar_eoi(val64); 185 lpar_rc = plpar_eoi(val64);
186 if (lpar_rc != H_Success) 186 if (lpar_rc != H_Success)
187 panic("bad return code EOI - rc = %ld, value=%lx\n", lpar_rc, 187 panic("bad return code EOI - rc = %ld, value=%lx\n", lpar_rc,
188 val64); 188 val64);
189} 189}
190 190
191void pSeriesLP_cppr_info(int n_cpu, u8 value) 191void pSeriesLP_cppr_info(int n_cpu, u8 value)
@@ -194,7 +194,7 @@ void pSeriesLP_cppr_info(int n_cpu, u8 value)
194 194
195 lpar_rc = plpar_cppr(value); 195 lpar_rc = plpar_cppr(value);
196 if (lpar_rc != H_Success) 196 if (lpar_rc != H_Success)
197 panic("bad return code cppr - rc = %lx\n", lpar_rc); 197 panic("bad return code cppr - rc = %lx\n", lpar_rc);
198} 198}
199 199
200static void pSeriesLP_qirr_info(int n_cpu , u8 value) 200static void pSeriesLP_qirr_info(int n_cpu , u8 value)
@@ -203,7 +203,7 @@ static void pSeriesLP_qirr_info(int n_cpu , u8 value)
203 203
204 lpar_rc = plpar_ipi(get_hard_smp_processor_id(n_cpu), value); 204 lpar_rc = plpar_ipi(get_hard_smp_processor_id(n_cpu), value);
205 if (lpar_rc != H_Success) 205 if (lpar_rc != H_Success)
206 panic("bad return code qirr - rc = %lx\n", lpar_rc); 206 panic("bad return code qirr - rc = %lx\n", lpar_rc);
207} 207}
208 208
209xics_ops pSeriesLP_ops = { 209xics_ops pSeriesLP_ops = {
@@ -366,7 +366,7 @@ int xics_get_irq(struct pt_regs *regs)
366 366
367 /* for sanity, this had better be < NR_IRQS - 16 */ 367 /* for sanity, this had better be < NR_IRQS - 16 */
368 if (vec == xics_irq_8259_cascade_real) { 368 if (vec == xics_irq_8259_cascade_real) {
369 irq = i8259_irq(cpu); 369 irq = i8259_irq(regs);
370 if (irq == -1) { 370 if (irq == -1) {
371 /* Spurious cascaded interrupt. Still must ack xics */ 371 /* Spurious cascaded interrupt. Still must ack xics */
372 xics_end_irq(irq_offset_up(xics_irq_8259_cascade)); 372 xics_end_irq(irq_offset_up(xics_irq_8259_cascade));
@@ -462,7 +462,7 @@ void xics_init_IRQ(void)
462 struct xics_interrupt_node { 462 struct xics_interrupt_node {
463 unsigned long addr; 463 unsigned long addr;
464 unsigned long size; 464 unsigned long size;
465 } intnodes[NR_CPUS]; 465 } intnodes[NR_CPUS];
466 466
467 ppc64_boot_msg(0x20, "XICS Init"); 467 ppc64_boot_msg(0x20, "XICS Init");
468 468
@@ -487,7 +487,7 @@ nextnode:
487 ireg = (uint *)get_property(np, "reg", &ilen); 487 ireg = (uint *)get_property(np, "reg", &ilen);
488 if (!ireg) 488 if (!ireg)
489 panic("xics_init_IRQ: can't find interrupt reg property"); 489 panic("xics_init_IRQ: can't find interrupt reg property");
490 490
491 while (ilen) { 491 while (ilen) {
492 intnodes[indx].addr = (unsigned long)*ireg++ << 32; 492 intnodes[indx].addr = (unsigned long)*ireg++ << 32;
493 ilen -= sizeof(uint); 493 ilen -= sizeof(uint);
@@ -555,7 +555,7 @@ nextnode:
555 continue; 555 continue;
556 556
557 hard_id = get_hard_smp_processor_id(i); 557 hard_id = get_hard_smp_processor_id(i);
558 xics_per_cpu[i] = ioremap(intnodes[hard_id].addr, 558 xics_per_cpu[i] = ioremap(intnodes[hard_id].addr,
559 intnodes[hard_id].size); 559 intnodes[hard_id].size);
560 } 560 }
561#else 561#else
@@ -589,7 +589,7 @@ static int __init xics_setup_i8259(void)
589 no_action, 0, "8259 cascade", NULL)) 589 no_action, 0, "8259 cascade", NULL))
590 printk(KERN_ERR "xics_setup_i8259: couldn't get 8259 " 590 printk(KERN_ERR "xics_setup_i8259: couldn't get 8259 "
591 "cascade\n"); 591 "cascade\n");
592 i8259_init(0); 592 i8259_init(0, 0);
593 } 593 }
594 return 0; 594 return 0;
595} 595}
diff --git a/arch/powerpc/platforms/pseries/xics.h b/arch/powerpc/platforms/pseries/xics.h
new file mode 100644
index 000000000000..e14c70868f1d
--- /dev/null
+++ b/arch/powerpc/platforms/pseries/xics.h
@@ -0,0 +1,34 @@
1/*
2 * arch/powerpc/platforms/pseries/xics.h
3 *
4 * Copyright 2000 IBM Corporation.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#ifndef _POWERPC_KERNEL_XICS_H
13#define _POWERPC_KERNEL_XICS_H
14
15#include <linux/cache.h>
16
17void xics_init_IRQ(void);
18int xics_get_irq(struct pt_regs *);
19void xics_setup_cpu(void);
20void xics_teardown_cpu(int secondary);
21void xics_cause_IPI(int cpu);
22void xics_request_IPIs(void);
23void xics_migrate_irqs_away(void);
24
25/* first argument is ignored for now*/
26void pSeriesLP_cppr_info(int n_cpu, u8 value);
27
28struct xics_ipi_struct {
29 volatile unsigned long value;
30} ____cacheline_aligned;
31
32extern struct xics_ipi_struct xics_ipi_message[NR_CPUS] __cacheline_aligned;
33
34#endif /* _POWERPC_KERNEL_XICS_H */
diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile
new file mode 100644
index 000000000000..8acd21dee05d
--- /dev/null
+++ b/arch/powerpc/sysdev/Makefile
@@ -0,0 +1,7 @@
1obj-$(CONFIG_MPIC) += mpic.o
2obj-$(CONFIG_PPC_INDIRECT_PCI) += indirect_pci.o
3obj-$(CONFIG_PPC_I8259) += i8259.o
4obj-$(CONFIG_PPC_MPC106) += grackle.o
5obj-$(CONFIG_BOOKE) += dcr.o
6obj-$(CONFIG_40x) += dcr.o
7obj-$(CONFIG_U3_DART) += u3_iommu.o
diff --git a/arch/ppc/syslib/dcr.S b/arch/powerpc/sysdev/dcr.S
index 895f10243a43..895f10243a43 100644
--- a/arch/ppc/syslib/dcr.S
+++ b/arch/powerpc/sysdev/dcr.S
diff --git a/arch/powerpc/sysdev/grackle.c b/arch/powerpc/sysdev/grackle.c
new file mode 100644
index 000000000000..b6ec793a23be
--- /dev/null
+++ b/arch/powerpc/sysdev/grackle.c
@@ -0,0 +1,64 @@
1/*
2 * Functions for setting up and using a MPC106 northbridge
3 * Extracted from arch/powerpc/platforms/powermac/pci.c.
4 *
5 * Copyright (C) 2003 Benjamin Herrenschmuidt (benh@kernel.crashing.org)
6 * Copyright (C) 1997 Paul Mackerras (paulus@samba.org)
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; either version
11 * 2 of the License, or (at your option) any later version.
12 */
13#include <linux/kernel.h>
14#include <linux/pci.h>
15#include <linux/init.h>
16
17#include <asm/io.h>
18#include <asm/prom.h>
19#include <asm/pci-bridge.h>
20#include <asm/grackle.h>
21
22#define GRACKLE_CFA(b, d, o) (0x80 | ((b) << 8) | ((d) << 16) \
23 | (((o) & ~3) << 24))
24
25#define GRACKLE_PICR1_STG 0x00000040
26#define GRACKLE_PICR1_LOOPSNOOP 0x00000010
27
28/* N.B. this is called before bridges is initialized, so we can't
29 use grackle_pcibios_{read,write}_config_dword. */
30static inline void grackle_set_stg(struct pci_controller* bp, int enable)
31{
32 unsigned int val;
33
34 out_be32(bp->cfg_addr, GRACKLE_CFA(0, 0, 0xa8));
35 val = in_le32(bp->cfg_data);
36 val = enable? (val | GRACKLE_PICR1_STG) :
37 (val & ~GRACKLE_PICR1_STG);
38 out_be32(bp->cfg_addr, GRACKLE_CFA(0, 0, 0xa8));
39 out_le32(bp->cfg_data, val);
40 (void)in_le32(bp->cfg_data);
41}
42
43static inline void grackle_set_loop_snoop(struct pci_controller *bp, int enable)
44{
45 unsigned int val;
46
47 out_be32(bp->cfg_addr, GRACKLE_CFA(0, 0, 0xa8));
48 val = in_le32(bp->cfg_data);
49 val = enable? (val | GRACKLE_PICR1_LOOPSNOOP) :
50 (val & ~GRACKLE_PICR1_LOOPSNOOP);
51 out_be32(bp->cfg_addr, GRACKLE_CFA(0, 0, 0xa8));
52 out_le32(bp->cfg_data, val);
53 (void)in_le32(bp->cfg_data);
54}
55
56void __init setup_grackle(struct pci_controller *hose)
57{
58 setup_indirect_pci(hose, 0xfec00000, 0xfee00000);
59 if (machine_is_compatible("AAPL,PowerBook1998"))
60 grackle_set_loop_snoop(hose, 1);
61#if 0 /* Disabled for now, HW problems ??? */
62 grackle_set_stg(hose, 1);
63#endif
64}
diff --git a/arch/ppc/syslib/i8259.c b/arch/powerpc/sysdev/i8259.c
index 5c7908c20e43..90bce6e0c191 100644
--- a/arch/ppc/syslib/i8259.c
+++ b/arch/powerpc/sysdev/i8259.c
@@ -1,18 +1,26 @@
1/*
2 * i8259 interrupt controller driver.
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 */
1#include <linux/init.h> 9#include <linux/init.h>
2#include <linux/ioport.h> 10#include <linux/ioport.h>
3#include <linux/interrupt.h> 11#include <linux/interrupt.h>
4#include <asm/io.h> 12#include <asm/io.h>
5#include <asm/i8259.h> 13#include <asm/i8259.h>
6 14
7static volatile unsigned char *pci_intack; /* RO, gives us the irq vector */ 15static volatile void __iomem *pci_intack; /* RO, gives us the irq vector */
8 16
9unsigned char cached_8259[2] = { 0xff, 0xff }; 17static unsigned char cached_8259[2] = { 0xff, 0xff };
10#define cached_A1 (cached_8259[0]) 18#define cached_A1 (cached_8259[0])
11#define cached_21 (cached_8259[1]) 19#define cached_21 (cached_8259[1])
12 20
13static DEFINE_SPINLOCK(i8259_lock); 21static DEFINE_SPINLOCK(i8259_lock);
14 22
15int i8259_pic_irq_offset; 23static int i8259_pic_irq_offset;
16 24
17/* 25/*
18 * Acknowledge the IRQ using either the PCI host bridge's interrupt 26 * Acknowledge the IRQ using either the PCI host bridge's interrupt
@@ -20,8 +28,7 @@ int i8259_pic_irq_offset;
20 * which is called. It should be noted that polling is broken on some 28 * which is called. It should be noted that polling is broken on some
21 * IBM and Motorola PReP boxes so we must use the int-ack feature on them. 29 * IBM and Motorola PReP boxes so we must use the int-ack feature on them.
22 */ 30 */
23int 31int i8259_irq(struct pt_regs *regs)
24i8259_irq(struct pt_regs *regs)
25{ 32{
26 int irq; 33 int irq;
27 34
@@ -29,7 +36,7 @@ i8259_irq(struct pt_regs *regs)
29 36
30 /* Either int-ack or poll for the IRQ */ 37 /* Either int-ack or poll for the IRQ */
31 if (pci_intack) 38 if (pci_intack)
32 irq = *pci_intack; 39 irq = readb(pci_intack);
33 else { 40 else {
34 /* Perform an interrupt acknowledge cycle on controller 1. */ 41 /* Perform an interrupt acknowledge cycle on controller 1. */
35 outb(0x0C, 0x20); /* prepare for poll */ 42 outb(0x0C, 0x20); /* prepare for poll */
@@ -59,7 +66,12 @@ i8259_irq(struct pt_regs *regs)
59 } 66 }
60 67
61 spin_unlock(&i8259_lock); 68 spin_unlock(&i8259_lock);
62 return irq; 69 return irq + i8259_pic_irq_offset;
70}
71
72int i8259_irq_cascade(struct pt_regs *regs, void *unused)
73{
74 return i8259_irq(regs);
63} 75}
64 76
65static void i8259_mask_and_ack_irq(unsigned int irq_nr) 77static void i8259_mask_and_ack_irq(unsigned int irq_nr)
@@ -67,20 +79,18 @@ static void i8259_mask_and_ack_irq(unsigned int irq_nr)
67 unsigned long flags; 79 unsigned long flags;
68 80
69 spin_lock_irqsave(&i8259_lock, flags); 81 spin_lock_irqsave(&i8259_lock, flags);
70 if ( irq_nr >= i8259_pic_irq_offset ) 82 irq_nr -= i8259_pic_irq_offset;
71 irq_nr -= i8259_pic_irq_offset;
72
73 if (irq_nr > 7) { 83 if (irq_nr > 7) {
74 cached_A1 |= 1 << (irq_nr-8); 84 cached_A1 |= 1 << (irq_nr-8);
75 inb(0xA1); /* DUMMY */ 85 inb(0xA1); /* DUMMY */
76 outb(cached_A1,0xA1); 86 outb(cached_A1, 0xA1);
77 outb(0x20,0xA0); /* Non-specific EOI */ 87 outb(0x20, 0xA0); /* Non-specific EOI */
78 outb(0x20,0x20); /* Non-specific EOI to cascade */ 88 outb(0x20, 0x20); /* Non-specific EOI to cascade */
79 } else { 89 } else {
80 cached_21 |= 1 << irq_nr; 90 cached_21 |= 1 << irq_nr;
81 inb(0x21); /* DUMMY */ 91 inb(0x21); /* DUMMY */
82 outb(cached_21,0x21); 92 outb(cached_21, 0x21);
83 outb(0x20,0x20); /* Non-specific EOI */ 93 outb(0x20, 0x20); /* Non-specific EOI */
84 } 94 }
85 spin_unlock_irqrestore(&i8259_lock, flags); 95 spin_unlock_irqrestore(&i8259_lock, flags);
86} 96}
@@ -96,9 +106,8 @@ static void i8259_mask_irq(unsigned int irq_nr)
96 unsigned long flags; 106 unsigned long flags;
97 107
98 spin_lock_irqsave(&i8259_lock, flags); 108 spin_lock_irqsave(&i8259_lock, flags);
99 if ( irq_nr >= i8259_pic_irq_offset ) 109 irq_nr -= i8259_pic_irq_offset;
100 irq_nr -= i8259_pic_irq_offset; 110 if (irq_nr < 8)
101 if ( irq_nr < 8 )
102 cached_21 |= 1 << irq_nr; 111 cached_21 |= 1 << irq_nr;
103 else 112 else
104 cached_A1 |= 1 << (irq_nr-8); 113 cached_A1 |= 1 << (irq_nr-8);
@@ -111,9 +120,8 @@ static void i8259_unmask_irq(unsigned int irq_nr)
111 unsigned long flags; 120 unsigned long flags;
112 121
113 spin_lock_irqsave(&i8259_lock, flags); 122 spin_lock_irqsave(&i8259_lock, flags);
114 if ( irq_nr >= i8259_pic_irq_offset ) 123 irq_nr -= i8259_pic_irq_offset;
115 irq_nr -= i8259_pic_irq_offset; 124 if (irq_nr < 8)
116 if ( irq_nr < 8 )
117 cached_21 &= ~(1 << irq_nr); 125 cached_21 &= ~(1 << irq_nr);
118 else 126 else
119 cached_A1 &= ~(1 << (irq_nr-8)); 127 cached_A1 &= ~(1 << (irq_nr-8));
@@ -169,12 +177,14 @@ static struct irqaction i8259_irqaction = {
169 * intack_addr - PCI interrupt acknowledge (real) address which will return 177 * intack_addr - PCI interrupt acknowledge (real) address which will return
170 * the active irq from the 8259 178 * the active irq from the 8259
171 */ 179 */
172void __init 180void __init i8259_init(unsigned long intack_addr, int offset)
173i8259_init(long intack_addr)
174{ 181{
175 unsigned long flags; 182 unsigned long flags;
183 int i;
176 184
177 spin_lock_irqsave(&i8259_lock, flags); 185 spin_lock_irqsave(&i8259_lock, flags);
186 i8259_pic_irq_offset = offset;
187
178 /* init master interrupt controller */ 188 /* init master interrupt controller */
179 outb(0x11, 0x20); /* Start init sequence */ 189 outb(0x11, 0x20); /* Start init sequence */
180 outb(0x00, 0x21); /* Vector base */ 190 outb(0x00, 0x21); /* Vector base */
@@ -198,11 +208,14 @@ i8259_init(long intack_addr)
198 spin_unlock_irqrestore(&i8259_lock, flags); 208 spin_unlock_irqrestore(&i8259_lock, flags);
199 209
200 /* reserve our resources */ 210 /* reserve our resources */
201 setup_irq( i8259_pic_irq_offset + 2, &i8259_irqaction); 211 setup_irq(offset + 2, &i8259_irqaction);
202 request_resource(&ioport_resource, &pic1_iores); 212 request_resource(&ioport_resource, &pic1_iores);
203 request_resource(&ioport_resource, &pic2_iores); 213 request_resource(&ioport_resource, &pic2_iores);
204 request_resource(&ioport_resource, &pic_edgectrl_iores); 214 request_resource(&ioport_resource, &pic_edgectrl_iores);
205 215
206 if (intack_addr != 0) 216 if (intack_addr != 0)
207 pci_intack = ioremap(intack_addr, 1); 217 pci_intack = ioremap(intack_addr, 1);
218
219 for (i = 0; i < NUM_ISA_INTERRUPTS; ++i)
220 irq_desc[offset + i].handler = &i8259_pic;
208} 221}
diff --git a/arch/ppc/syslib/indirect_pci.c b/arch/powerpc/sysdev/indirect_pci.c
index e71488469704..e71488469704 100644
--- a/arch/ppc/syslib/indirect_pci.c
+++ b/arch/powerpc/sysdev/indirect_pci.c
diff --git a/arch/ppc64/kernel/mpic.c b/arch/powerpc/sysdev/mpic.c
index 5f5bc73754d9..105f05341a41 100644
--- a/arch/ppc64/kernel/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * arch/ppc64/kernel/mpic.c 2 * arch/powerpc/kernel/mpic.c
3 * 3 *
4 * Driver for interrupt controllers following the OpenPIC standard, the 4 * Driver for interrupt controllers following the OpenPIC standard, the
5 * common implementation beeing IBM's MPIC. This driver also can deal 5 * common implementation beeing IBM's MPIC. This driver also can deal
@@ -31,8 +31,8 @@
31#include <asm/pgtable.h> 31#include <asm/pgtable.h>
32#include <asm/irq.h> 32#include <asm/irq.h>
33#include <asm/machdep.h> 33#include <asm/machdep.h>
34 34#include <asm/mpic.h>
35#include "mpic.h" 35#include <asm/smp.h>
36 36
37#ifdef DEBUG 37#ifdef DEBUG
38#define DBG(fmt...) printk(fmt) 38#define DBG(fmt...) printk(fmt)
@@ -44,6 +44,9 @@ static struct mpic *mpics;
44static struct mpic *mpic_primary; 44static struct mpic *mpic_primary;
45static DEFINE_SPINLOCK(mpic_lock); 45static DEFINE_SPINLOCK(mpic_lock);
46 46
47#ifdef CONFIG_PPC32 /* XXX for now */
48#define distribute_irqs CONFIG_IRQ_ALL_CPUS
49#endif
47 50
48/* 51/*
49 * Register accessor functions 52 * Register accessor functions
@@ -355,7 +358,7 @@ static void mpic_enable_irq(unsigned int irq)
355 struct mpic *mpic = mpic_from_irq(irq); 358 struct mpic *mpic = mpic_from_irq(irq);
356 unsigned int src = irq - mpic->irq_offset; 359 unsigned int src = irq - mpic->irq_offset;
357 360
358 DBG("%s: enable_irq: %d (src %d)\n", mpic->name, irq, src); 361 DBG("%p: %s: enable_irq: %d (src %d)\n", mpic, mpic->name, irq, src);
359 362
360 mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI, 363 mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI,
361 mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) & ~MPIC_VECPRI_MASK); 364 mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) & ~MPIC_VECPRI_MASK);
@@ -480,6 +483,7 @@ struct mpic * __init mpic_alloc(unsigned long phys_addr,
480 if (mpic == NULL) 483 if (mpic == NULL)
481 return NULL; 484 return NULL;
482 485
486
483 memset(mpic, 0, sizeof(struct mpic)); 487 memset(mpic, 0, sizeof(struct mpic));
484 mpic->name = name; 488 mpic->name = name;
485 489
@@ -506,7 +510,7 @@ struct mpic * __init mpic_alloc(unsigned long phys_addr,
506 mpic->senses_count = senses_count; 510 mpic->senses_count = senses_count;
507 511
508 /* Map the global registers */ 512 /* Map the global registers */
509 mpic->gregs = ioremap(phys_addr + MPIC_GREG_BASE, 0x2000); 513 mpic->gregs = ioremap(phys_addr + MPIC_GREG_BASE, 0x1000);
510 mpic->tmregs = mpic->gregs + ((MPIC_TIMER_BASE - MPIC_GREG_BASE) >> 2); 514 mpic->tmregs = mpic->gregs + ((MPIC_TIMER_BASE - MPIC_GREG_BASE) >> 2);
511 BUG_ON(mpic->gregs == NULL); 515 BUG_ON(mpic->gregs == NULL);
512 516
@@ -644,7 +648,6 @@ void __init mpic_init(struct mpic *mpic)
644 continue; 648 continue;
645 irq_desc[mpic->ipi_offset+i].status |= IRQ_PER_CPU; 649 irq_desc[mpic->ipi_offset+i].status |= IRQ_PER_CPU;
646 irq_desc[mpic->ipi_offset+i].handler = &mpic->hc_ipi; 650 irq_desc[mpic->ipi_offset+i].handler = &mpic->hc_ipi;
647
648#endif /* CONFIG_SMP */ 651#endif /* CONFIG_SMP */
649 } 652 }
650 653
@@ -700,7 +703,7 @@ void __init mpic_init(struct mpic *mpic)
700 /* init hw */ 703 /* init hw */
701 mpic_irq_write(i, MPIC_IRQ_VECTOR_PRI, vecpri); 704 mpic_irq_write(i, MPIC_IRQ_VECTOR_PRI, vecpri);
702 mpic_irq_write(i, MPIC_IRQ_DESTINATION, 705 mpic_irq_write(i, MPIC_IRQ_DESTINATION,
703 1 << get_hard_smp_processor_id(boot_cpuid)); 706 1 << hard_smp_processor_id());
704 707
705 /* init linux descriptors */ 708 /* init linux descriptors */
706 if (i < mpic->irq_count) { 709 if (i < mpic->irq_count) {
@@ -792,6 +795,21 @@ void mpic_setup_this_cpu(void)
792#endif /* CONFIG_SMP */ 795#endif /* CONFIG_SMP */
793} 796}
794 797
798int mpic_cpu_get_priority(void)
799{
800 struct mpic *mpic = mpic_primary;
801
802 return mpic_cpu_read(MPIC_CPU_CURRENT_TASK_PRI);
803}
804
805void mpic_cpu_set_priority(int prio)
806{
807 struct mpic *mpic = mpic_primary;
808
809 prio &= MPIC_CPU_TASKPRI_MASK;
810 mpic_cpu_write(MPIC_CPU_CURRENT_TASK_PRI, prio);
811}
812
795/* 813/*
796 * XXX: someone who knows mpic should check this. 814 * XXX: someone who knows mpic should check this.
797 * do we need to eoi the ipi including for kexec cpu here (see xics comments)? 815 * do we need to eoi the ipi including for kexec cpu here (see xics comments)?
@@ -885,4 +903,25 @@ void mpic_request_ipis(void)
885 903
886 printk("IPIs requested... \n"); 904 printk("IPIs requested... \n");
887} 905}
906
907void smp_mpic_message_pass(int target, int msg)
908{
909 /* make sure we're sending something that translates to an IPI */
910 if ((unsigned int)msg > 3) {
911 printk("SMP %d: smp_message_pass: unknown msg %d\n",
912 smp_processor_id(), msg);
913 return;
914 }
915 switch (target) {
916 case MSG_ALL:
917 mpic_send_ipi(msg, 0xffffffff);
918 break;
919 case MSG_ALL_BUT_SELF:
920 mpic_send_ipi(msg, 0xffffffff & ~(1 << smp_processor_id()));
921 break;
922 default:
923 mpic_send_ipi(msg, 1 << target);
924 break;
925 }
926}
888#endif /* CONFIG_SMP */ 927#endif /* CONFIG_SMP */
diff --git a/arch/ppc64/kernel/u3_iommu.c b/arch/powerpc/sysdev/u3_iommu.c
index 41ea09cb9ac7..fba871a1bda5 100644
--- a/arch/ppc64/kernel/u3_iommu.c
+++ b/arch/powerpc/sysdev/u3_iommu.c
@@ -44,39 +44,11 @@
44#include <asm/abs_addr.h> 44#include <asm/abs_addr.h>
45#include <asm/cacheflush.h> 45#include <asm/cacheflush.h>
46#include <asm/lmb.h> 46#include <asm/lmb.h>
47 47#include <asm/dart.h>
48#include "pci.h" 48#include <asm/ppc-pci.h>
49 49
50extern int iommu_force_on; 50extern int iommu_force_on;
51 51
52/* physical base of DART registers */
53#define DART_BASE 0xf8033000UL
54
55/* Offset from base to control register */
56#define DARTCNTL 0
57/* Offset from base to exception register */
58#define DARTEXCP 0x10
59/* Offset from base to TLB tag registers */
60#define DARTTAG 0x1000
61
62
63/* Control Register fields */
64
65/* base address of table (pfn) */
66#define DARTCNTL_BASE_MASK 0xfffff
67#define DARTCNTL_BASE_SHIFT 12
68
69#define DARTCNTL_FLUSHTLB 0x400
70#define DARTCNTL_ENABLE 0x200
71
72/* size of table in pages */
73#define DARTCNTL_SIZE_MASK 0x1ff
74#define DARTCNTL_SIZE_SHIFT 0
75
76/* DART table fields */
77#define DARTMAP_VALID 0x80000000
78#define DARTMAP_RPNMASK 0x00ffffff
79
80/* Physical base address and size of the DART table */ 52/* Physical base address and size of the DART table */
81unsigned long dart_tablebase; /* exported to htab_initialize */ 53unsigned long dart_tablebase; /* exported to htab_initialize */
82static unsigned long dart_tablesize; 54static unsigned long dart_tablesize;
@@ -152,18 +124,21 @@ static void dart_build(struct iommu_table *tbl, long index,
152 124
153 DBG("dart: build at: %lx, %lx, addr: %x\n", index, npages, uaddr); 125 DBG("dart: build at: %lx, %lx, addr: %x\n", index, npages, uaddr);
154 126
127 index <<= DART_PAGE_FACTOR;
128 npages <<= DART_PAGE_FACTOR;
129
155 dp = ((unsigned int*)tbl->it_base) + index; 130 dp = ((unsigned int*)tbl->it_base) + index;
156 131
157 /* On U3, all memory is contigous, so we can move this 132 /* On U3, all memory is contigous, so we can move this
158 * out of the loop. 133 * out of the loop.
159 */ 134 */
160 while (npages--) { 135 while (npages--) {
161 rpn = virt_to_abs(uaddr) >> PAGE_SHIFT; 136 rpn = virt_to_abs(uaddr) >> DART_PAGE_SHIFT;
162 137
163 *(dp++) = DARTMAP_VALID | (rpn & DARTMAP_RPNMASK); 138 *(dp++) = DARTMAP_VALID | (rpn & DARTMAP_RPNMASK);
164 139
165 rpn++; 140 rpn++;
166 uaddr += PAGE_SIZE; 141 uaddr += DART_PAGE_SIZE;
167 } 142 }
168 143
169 dart_dirty = 1; 144 dart_dirty = 1;
@@ -181,6 +156,9 @@ static void dart_free(struct iommu_table *tbl, long index, long npages)
181 156
182 DBG("dart: free at: %lx, %lx\n", index, npages); 157 DBG("dart: free at: %lx, %lx\n", index, npages);
183 158
159 index <<= DART_PAGE_FACTOR;
160 npages <<= DART_PAGE_FACTOR;
161
184 dp = ((unsigned int *)tbl->it_base) + index; 162 dp = ((unsigned int *)tbl->it_base) + index;
185 163
186 while (npages--) 164 while (npages--)
@@ -209,10 +187,10 @@ static int dart_init(struct device_node *dart_node)
209 * that to work around what looks like a problem with the HT bridge 187 * that to work around what looks like a problem with the HT bridge
210 * prefetching into invalid pages and corrupting data 188 * prefetching into invalid pages and corrupting data
211 */ 189 */
212 tmp = lmb_alloc(PAGE_SIZE, PAGE_SIZE); 190 tmp = lmb_alloc(DART_PAGE_SIZE, DART_PAGE_SIZE);
213 if (!tmp) 191 if (!tmp)
214 panic("U3-DART: Cannot allocate spare page!"); 192 panic("U3-DART: Cannot allocate spare page!");
215 dart_emptyval = DARTMAP_VALID | ((tmp >> PAGE_SHIFT) & DARTMAP_RPNMASK); 193 dart_emptyval = DARTMAP_VALID | ((tmp >> DART_PAGE_SHIFT) & DARTMAP_RPNMASK);
216 194
217 /* Map in DART registers. FIXME: Use device node to get base address */ 195 /* Map in DART registers. FIXME: Use device node to get base address */
218 dart = ioremap(DART_BASE, 0x7000); 196 dart = ioremap(DART_BASE, 0x7000);
@@ -223,8 +201,8 @@ static int dart_init(struct device_node *dart_node)
223 * table size and enable bit 201 * table size and enable bit
224 */ 202 */
225 regword = DARTCNTL_ENABLE | 203 regword = DARTCNTL_ENABLE |
226 ((dart_tablebase >> PAGE_SHIFT) << DARTCNTL_BASE_SHIFT) | 204 ((dart_tablebase >> DART_PAGE_SHIFT) << DARTCNTL_BASE_SHIFT) |
227 (((dart_tablesize >> PAGE_SHIFT) & DARTCNTL_SIZE_MASK) 205 (((dart_tablesize >> DART_PAGE_SHIFT) & DARTCNTL_SIZE_MASK)
228 << DARTCNTL_SIZE_SHIFT); 206 << DARTCNTL_SIZE_SHIFT);
229 dart_vbase = ioremap(virt_to_abs(dart_tablebase), dart_tablesize); 207 dart_vbase = ioremap(virt_to_abs(dart_tablebase), dart_tablesize);
230 208
diff --git a/arch/powerpc/xmon/Makefile b/arch/powerpc/xmon/Makefile
new file mode 100644
index 000000000000..79a784f0e7a9
--- /dev/null
+++ b/arch/powerpc/xmon/Makefile
@@ -0,0 +1,11 @@
1# Makefile for xmon
2
3ifdef CONFIG_PPC64
4EXTRA_CFLAGS += -mno-minimal-toc
5endif
6
7obj-$(CONFIG_8xx) += start_8xx.o
8obj-$(CONFIG_6xx) += start_32.o
9obj-$(CONFIG_4xx) += start_32.o
10obj-$(CONFIG_PPC64) += start_64.o
11obj-y += xmon.o ppc-dis.o ppc-opc.o subr_prf.o setjmp.o
diff --git a/arch/ppc64/xmon/ansidecl.h b/arch/powerpc/xmon/ansidecl.h
index c9b9f0929e9e..c9b9f0929e9e 100644
--- a/arch/ppc64/xmon/ansidecl.h
+++ b/arch/powerpc/xmon/ansidecl.h
diff --git a/arch/ppc64/xmon/nonstdio.h b/arch/powerpc/xmon/nonstdio.h
index 84211a21c6f4..84211a21c6f4 100644
--- a/arch/ppc64/xmon/nonstdio.h
+++ b/arch/powerpc/xmon/nonstdio.h
diff --git a/arch/ppc64/xmon/ppc-dis.c b/arch/powerpc/xmon/ppc-dis.c
index ac0a9d2427e0..ac0a9d2427e0 100644
--- a/arch/ppc64/xmon/ppc-dis.c
+++ b/arch/powerpc/xmon/ppc-dis.c
diff --git a/arch/ppc64/xmon/ppc-opc.c b/arch/powerpc/xmon/ppc-opc.c
index 5ee8fc32f824..5ee8fc32f824 100644
--- a/arch/ppc64/xmon/ppc-opc.c
+++ b/arch/powerpc/xmon/ppc-opc.c
diff --git a/arch/ppc64/xmon/ppc.h b/arch/powerpc/xmon/ppc.h
index 342237e8dd69..342237e8dd69 100644
--- a/arch/ppc64/xmon/ppc.h
+++ b/arch/powerpc/xmon/ppc.h
diff --git a/arch/powerpc/xmon/setjmp.S b/arch/powerpc/xmon/setjmp.S
new file mode 100644
index 000000000000..f8e40dfd2bff
--- /dev/null
+++ b/arch/powerpc/xmon/setjmp.S
@@ -0,0 +1,135 @@
1/*
2 * Copyright (C) 1996 Paul Mackerras.
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 * NOTE: assert(sizeof(buf) > 23 * sizeof(long))
10 */
11#include <asm/processor.h>
12#include <asm/ppc_asm.h>
13#include <asm/asm-offsets.h>
14
15_GLOBAL(xmon_setjmp)
16 mflr r0
17 STL r0,0(r3)
18 STL r1,SZL(r3)
19 STL r2,2*SZL(r3)
20 mfcr r0
21 STL r0,3*SZL(r3)
22 STL r13,4*SZL(r3)
23 STL r14,5*SZL(r3)
24 STL r15,6*SZL(r3)
25 STL r16,7*SZL(r3)
26 STL r17,8*SZL(r3)
27 STL r18,9*SZL(r3)
28 STL r19,10*SZL(r3)
29 STL r20,11*SZL(r3)
30 STL r21,12*SZL(r3)
31 STL r22,13*SZL(r3)
32 STL r23,14*SZL(r3)
33 STL r24,15*SZL(r3)
34 STL r25,16*SZL(r3)
35 STL r26,17*SZL(r3)
36 STL r27,18*SZL(r3)
37 STL r28,19*SZL(r3)
38 STL r29,20*SZL(r3)
39 STL r30,21*SZL(r3)
40 STL r31,22*SZL(r3)
41 li r3,0
42 blr
43
44_GLOBAL(xmon_longjmp)
45 CMPI r4,0
46 bne 1f
47 li r4,1
481: LDL r13,4*SZL(r3)
49 LDL r14,5*SZL(r3)
50 LDL r15,6*SZL(r3)
51 LDL r16,7*SZL(r3)
52 LDL r17,8*SZL(r3)
53 LDL r18,9*SZL(r3)
54 LDL r19,10*SZL(r3)
55 LDL r20,11*SZL(r3)
56 LDL r21,12*SZL(r3)
57 LDL r22,13*SZL(r3)
58 LDL r23,14*SZL(r3)
59 LDL r24,15*SZL(r3)
60 LDL r25,16*SZL(r3)
61 LDL r26,17*SZL(r3)
62 LDL r27,18*SZL(r3)
63 LDL r28,19*SZL(r3)
64 LDL r29,20*SZL(r3)
65 LDL r30,21*SZL(r3)
66 LDL r31,22*SZL(r3)
67 LDL r0,3*SZL(r3)
68 mtcrf 0x38,r0
69 LDL r0,0(r3)
70 LDL r1,SZL(r3)
71 LDL r2,2*SZL(r3)
72 mtlr r0
73 mr r3,r4
74 blr
75
76/*
77 * Grab the register values as they are now.
78 * This won't do a particularily good job because we really
79 * want our caller's caller's registers, and our caller has
80 * already executed its prologue.
81 * ToDo: We could reach back into the caller's save area to do
82 * a better job of representing the caller's state (note that
83 * that will be different for 32-bit and 64-bit, because of the
84 * different ABIs, though).
85 */
86_GLOBAL(xmon_save_regs)
87 STL r0,0*SZL(r3)
88 STL r2,2*SZL(r3)
89 STL r3,3*SZL(r3)
90 STL r4,4*SZL(r3)
91 STL r5,5*SZL(r3)
92 STL r6,6*SZL(r3)
93 STL r7,7*SZL(r3)
94 STL r8,8*SZL(r3)
95 STL r9,9*SZL(r3)
96 STL r10,10*SZL(r3)
97 STL r11,11*SZL(r3)
98 STL r12,12*SZL(r3)
99 STL r13,13*SZL(r3)
100 STL r14,14*SZL(r3)
101 STL r15,15*SZL(r3)
102 STL r16,16*SZL(r3)
103 STL r17,17*SZL(r3)
104 STL r18,18*SZL(r3)
105 STL r19,19*SZL(r3)
106 STL r20,20*SZL(r3)
107 STL r21,21*SZL(r3)
108 STL r22,22*SZL(r3)
109 STL r23,23*SZL(r3)
110 STL r24,24*SZL(r3)
111 STL r25,25*SZL(r3)
112 STL r26,26*SZL(r3)
113 STL r27,27*SZL(r3)
114 STL r28,28*SZL(r3)
115 STL r29,29*SZL(r3)
116 STL r30,30*SZL(r3)
117 STL r31,31*SZL(r3)
118 /* go up one stack frame for SP */
119 LDL r4,0(r1)
120 STL r4,1*SZL(r3)
121 /* get caller's LR */
122 LDL r0,LRSAVE(r4)
123 STL r0,_NIP-STACK_FRAME_OVERHEAD(r3)
124 STL r0,_LINK-STACK_FRAME_OVERHEAD(r3)
125 mfmsr r0
126 STL r0,_MSR-STACK_FRAME_OVERHEAD(r3)
127 mfctr r0
128 STL r0,_CTR-STACK_FRAME_OVERHEAD(r3)
129 mfxer r0
130 STL r0,_XER-STACK_FRAME_OVERHEAD(r3)
131 mfcr r0
132 STL r0,_CCR-STACK_FRAME_OVERHEAD(r3)
133 li r0,0
134 STL r0,_TRAP-STACK_FRAME_OVERHEAD(r3)
135 blr
diff --git a/arch/powerpc/xmon/start_32.c b/arch/powerpc/xmon/start_32.c
new file mode 100644
index 000000000000..69b658c0f760
--- /dev/null
+++ b/arch/powerpc/xmon/start_32.c
@@ -0,0 +1,624 @@
1/*
2 * Copyright (C) 1996 Paul Mackerras.
3 */
4#include <linux/config.h>
5#include <linux/string.h>
6#include <asm/machdep.h>
7#include <asm/io.h>
8#include <asm/page.h>
9#include <linux/adb.h>
10#include <linux/pmu.h>
11#include <linux/cuda.h>
12#include <linux/kernel.h>
13#include <linux/errno.h>
14#include <linux/sysrq.h>
15#include <linux/bitops.h>
16#include <asm/xmon.h>
17#include <asm/prom.h>
18#include <asm/bootx.h>
19#include <asm/machdep.h>
20#include <asm/errno.h>
21#include <asm/pmac_feature.h>
22#include <asm/processor.h>
23#include <asm/delay.h>
24#include <asm/btext.h>
25
26static volatile unsigned char __iomem *sccc, *sccd;
27unsigned int TXRDY, RXRDY, DLAB;
28static int xmon_expect(const char *str, unsigned int timeout);
29
30static int use_serial;
31static int use_screen;
32static int via_modem;
33static int xmon_use_sccb;
34static struct device_node *channel_node;
35
36#define TB_SPEED 25000000
37
38static inline unsigned int readtb(void)
39{
40 unsigned int ret;
41
42 asm volatile("mftb %0" : "=r" (ret) :);
43 return ret;
44}
45
46void buf_access(void)
47{
48 if (DLAB)
49 sccd[3] &= ~DLAB; /* reset DLAB */
50}
51
52extern int adb_init(void);
53
54#ifdef CONFIG_PPC_CHRP
55/*
56 * This looks in the "ranges" property for the primary PCI host bridge
57 * to find the physical address of the start of PCI/ISA I/O space.
58 * It is basically a cut-down version of pci_process_bridge_OF_ranges.
59 */
60static unsigned long chrp_find_phys_io_base(void)
61{
62 struct device_node *node;
63 unsigned int *ranges;
64 unsigned long base = CHRP_ISA_IO_BASE;
65 int rlen = 0;
66 int np;
67
68 node = find_devices("isa");
69 if (node != NULL) {
70 node = node->parent;
71 if (node == NULL || node->type == NULL
72 || strcmp(node->type, "pci") != 0)
73 node = NULL;
74 }
75 if (node == NULL)
76 node = find_devices("pci");
77 if (node == NULL)
78 return base;
79
80 ranges = (unsigned int *) get_property(node, "ranges", &rlen);
81 np = prom_n_addr_cells(node) + 5;
82 while ((rlen -= np * sizeof(unsigned int)) >= 0) {
83 if ((ranges[0] >> 24) == 1 && ranges[2] == 0) {
84 /* I/O space starting at 0, grab the phys base */
85 base = ranges[np - 3];
86 break;
87 }
88 ranges += np;
89 }
90 return base;
91}
92#endif /* CONFIG_PPC_CHRP */
93
94#ifdef CONFIG_MAGIC_SYSRQ
95static void sysrq_handle_xmon(int key, struct pt_regs *regs,
96 struct tty_struct *tty)
97{
98 xmon(regs);
99}
100
101static struct sysrq_key_op sysrq_xmon_op =
102{
103 .handler = sysrq_handle_xmon,
104 .help_msg = "Xmon",
105 .action_msg = "Entering xmon",
106};
107#endif
108
109void
110xmon_map_scc(void)
111{
112#ifdef CONFIG_PPC_MULTIPLATFORM
113 volatile unsigned char __iomem *base;
114
115 if (_machine == _MACH_Pmac) {
116 struct device_node *np;
117 unsigned long addr;
118#ifdef CONFIG_BOOTX_TEXT
119 if (!use_screen && !use_serial
120 && !machine_is_compatible("iMac")) {
121 /* see if there is a keyboard in the device tree
122 with a parent of type "adb" */
123 for (np = find_devices("keyboard"); np; np = np->next)
124 if (np->parent && np->parent->type
125 && strcmp(np->parent->type, "adb") == 0)
126 break;
127
128 /* needs to be hacked if xmon_printk is to be used
129 from within find_via_pmu() */
130#ifdef CONFIG_ADB_PMU
131 if (np != NULL && boot_text_mapped && find_via_pmu())
132 use_screen = 1;
133#endif
134#ifdef CONFIG_ADB_CUDA
135 if (np != NULL && boot_text_mapped && find_via_cuda())
136 use_screen = 1;
137#endif
138 }
139 if (!use_screen && (np = find_devices("escc")) != NULL) {
140 /*
141 * look for the device node for the serial port
142 * we're using and see if it says it has a modem
143 */
144 char *name = xmon_use_sccb? "ch-b": "ch-a";
145 char *slots;
146 int l;
147
148 np = np->child;
149 while (np != NULL && strcmp(np->name, name) != 0)
150 np = np->sibling;
151 if (np != NULL) {
152 /* XXX should parse this properly */
153 channel_node = np;
154 slots = get_property(np, "slot-names", &l);
155 if (slots != NULL && l >= 10
156 && strcmp(slots+4, "Modem") == 0)
157 via_modem = 1;
158 }
159 }
160 btext_drawstring("xmon uses ");
161 if (use_screen)
162 btext_drawstring("screen and keyboard\n");
163 else {
164 if (via_modem)
165 btext_drawstring("modem on ");
166 btext_drawstring(xmon_use_sccb? "printer": "modem");
167 btext_drawstring(" port\n");
168 }
169
170#endif /* CONFIG_BOOTX_TEXT */
171
172#ifdef CHRP_ESCC
173 addr = 0xc1013020;
174#else
175 addr = 0xf3013020;
176#endif
177 TXRDY = 4;
178 RXRDY = 1;
179
180 np = find_devices("mac-io");
181 if (np && np->n_addrs)
182 addr = np->addrs[0].address + 0x13020;
183 base = (volatile unsigned char *) ioremap(addr & PAGE_MASK, PAGE_SIZE);
184 sccc = base + (addr & ~PAGE_MASK);
185 sccd = sccc + 0x10;
186
187 } else {
188 base = (volatile unsigned char *) isa_io_base;
189
190#ifdef CONFIG_PPC_CHRP
191 if (_machine == _MACH_chrp)
192 base = (volatile unsigned char __iomem *)
193 ioremap(chrp_find_phys_io_base(), 0x1000);
194#endif
195
196 sccc = base + 0x3fd;
197 sccd = base + 0x3f8;
198 if (xmon_use_sccb) {
199 sccc -= 0x100;
200 sccd -= 0x100;
201 }
202 TXRDY = 0x20;
203 RXRDY = 1;
204 DLAB = 0x80;
205 }
206#elif defined(CONFIG_GEMINI)
207 /* should already be mapped by the kernel boot */
208 sccc = (volatile unsigned char __iomem *) 0xffeffb0d;
209 sccd = (volatile unsigned char __iomem *) 0xffeffb08;
210 TXRDY = 0x20;
211 RXRDY = 1;
212 DLAB = 0x80;
213#elif defined(CONFIG_405GP)
214 sccc = (volatile unsigned char __iomem *)0xef600305;
215 sccd = (volatile unsigned char __iomem *)0xef600300;
216 TXRDY = 0x20;
217 RXRDY = 1;
218 DLAB = 0x80;
219#endif /* platform */
220
221 register_sysrq_key('x', &sysrq_xmon_op);
222}
223
224static int scc_initialized = 0;
225
226void xmon_init_scc(void);
227extern void cuda_poll(void);
228
229static inline void do_poll_adb(void)
230{
231#ifdef CONFIG_ADB_PMU
232 if (sys_ctrler == SYS_CTRLER_PMU)
233 pmu_poll_adb();
234#endif /* CONFIG_ADB_PMU */
235#ifdef CONFIG_ADB_CUDA
236 if (sys_ctrler == SYS_CTRLER_CUDA)
237 cuda_poll();
238#endif /* CONFIG_ADB_CUDA */
239}
240
241int
242xmon_write(void *handle, void *ptr, int nb)
243{
244 char *p = ptr;
245 int i, c, ct;
246
247#ifdef CONFIG_SMP
248 static unsigned long xmon_write_lock;
249 int lock_wait = 1000000;
250 int locked;
251
252 while ((locked = test_and_set_bit(0, &xmon_write_lock)) != 0)
253 if (--lock_wait == 0)
254 break;
255#endif
256
257#ifdef CONFIG_BOOTX_TEXT
258 if (use_screen) {
259 /* write it on the screen */
260 for (i = 0; i < nb; ++i)
261 btext_drawchar(*p++);
262 goto out;
263 }
264#endif
265 if (!scc_initialized)
266 xmon_init_scc();
267 ct = 0;
268 for (i = 0; i < nb; ++i) {
269 while ((*sccc & TXRDY) == 0)
270 do_poll_adb();
271 c = p[i];
272 if (c == '\n' && !ct) {
273 c = '\r';
274 ct = 1;
275 --i;
276 } else {
277 ct = 0;
278 }
279 buf_access();
280 *sccd = c;
281 eieio();
282 }
283
284 out:
285#ifdef CONFIG_SMP
286 if (!locked)
287 clear_bit(0, &xmon_write_lock);
288#endif
289 return nb;
290}
291
292int xmon_wants_key;
293int xmon_adb_keycode;
294
295#ifdef CONFIG_BOOTX_TEXT
296static int xmon_adb_shiftstate;
297
298static unsigned char xmon_keytab[128] =
299 "asdfhgzxcv\000bqwer" /* 0x00 - 0x0f */
300 "yt123465=97-80]o" /* 0x10 - 0x1f */
301 "u[ip\rlj'k;\\,/nm." /* 0x20 - 0x2f */
302 "\t `\177\0\033\0\0\0\0\0\0\0\0\0\0" /* 0x30 - 0x3f */
303 "\0.\0*\0+\0\0\0\0\0/\r\0-\0" /* 0x40 - 0x4f */
304 "\0\0000123456789\0\0\0"; /* 0x50 - 0x5f */
305
306static unsigned char xmon_shift_keytab[128] =
307 "ASDFHGZXCV\000BQWER" /* 0x00 - 0x0f */
308 "YT!@#$^%+(&_*)}O" /* 0x10 - 0x1f */
309 "U{IP\rLJ\"K:|<?NM>" /* 0x20 - 0x2f */
310 "\t ~\177\0\033\0\0\0\0\0\0\0\0\0\0" /* 0x30 - 0x3f */
311 "\0.\0*\0+\0\0\0\0\0/\r\0-\0" /* 0x40 - 0x4f */
312 "\0\0000123456789\0\0\0"; /* 0x50 - 0x5f */
313
314static int
315xmon_get_adb_key(void)
316{
317 int k, t, on;
318
319 xmon_wants_key = 1;
320 for (;;) {
321 xmon_adb_keycode = -1;
322 t = 0;
323 on = 0;
324 do {
325 if (--t < 0) {
326 on = 1 - on;
327 btext_drawchar(on? 0xdb: 0x20);
328 btext_drawchar('\b');
329 t = 200000;
330 }
331 do_poll_adb();
332 } while (xmon_adb_keycode == -1);
333 k = xmon_adb_keycode;
334 if (on)
335 btext_drawstring(" \b");
336
337 /* test for shift keys */
338 if ((k & 0x7f) == 0x38 || (k & 0x7f) == 0x7b) {
339 xmon_adb_shiftstate = (k & 0x80) == 0;
340 continue;
341 }
342 if (k >= 0x80)
343 continue; /* ignore up transitions */
344 k = (xmon_adb_shiftstate? xmon_shift_keytab: xmon_keytab)[k];
345 if (k != 0)
346 break;
347 }
348 xmon_wants_key = 0;
349 return k;
350}
351#endif /* CONFIG_BOOTX_TEXT */
352
353int
354xmon_read(void *handle, void *ptr, int nb)
355{
356 char *p = ptr;
357 int i;
358
359#ifdef CONFIG_BOOTX_TEXT
360 if (use_screen) {
361 for (i = 0; i < nb; ++i)
362 *p++ = xmon_get_adb_key();
363 return i;
364 }
365#endif
366 if (!scc_initialized)
367 xmon_init_scc();
368 for (i = 0; i < nb; ++i) {
369 while ((*sccc & RXRDY) == 0)
370 do_poll_adb();
371 buf_access();
372 *p++ = *sccd;
373 }
374 return i;
375}
376
377int
378xmon_read_poll(void)
379{
380 if ((*sccc & RXRDY) == 0) {
381 do_poll_adb();
382 return -1;
383 }
384 buf_access();
385 return *sccd;
386}
387
388static unsigned char scc_inittab[] = {
389 13, 0, /* set baud rate divisor */
390 12, 1,
391 14, 1, /* baud rate gen enable, src=rtxc */
392 11, 0x50, /* clocks = br gen */
393 5, 0xea, /* tx 8 bits, assert DTR & RTS */
394 4, 0x46, /* x16 clock, 1 stop */
395 3, 0xc1, /* rx enable, 8 bits */
396};
397
398void
399xmon_init_scc(void)
400{
401 if ( _machine == _MACH_chrp )
402 {
403 sccd[3] = 0x83; eieio(); /* LCR = 8N1 + DLAB */
404 sccd[0] = 12; eieio(); /* DLL = 9600 baud */
405 sccd[1] = 0; eieio();
406 sccd[2] = 0; eieio(); /* FCR = 0 */
407 sccd[3] = 3; eieio(); /* LCR = 8N1 */
408 sccd[1] = 0; eieio(); /* IER = 0 */
409 }
410 else if ( _machine == _MACH_Pmac )
411 {
412 int i, x;
413
414 if (channel_node != 0)
415 pmac_call_feature(
416 PMAC_FTR_SCC_ENABLE,
417 channel_node,
418 PMAC_SCC_ASYNC | PMAC_SCC_FLAG_XMON, 1);
419 printk(KERN_INFO "Serial port locked ON by debugger !\n");
420 if (via_modem && channel_node != 0) {
421 unsigned int t0;
422
423 pmac_call_feature(
424 PMAC_FTR_MODEM_ENABLE,
425 channel_node, 0, 1);
426 printk(KERN_INFO "Modem powered up by debugger !\n");
427 t0 = readtb();
428 while (readtb() - t0 < 3*TB_SPEED)
429 eieio();
430 }
431 /* use the B channel if requested */
432 if (xmon_use_sccb) {
433 sccc = (volatile unsigned char *)
434 ((unsigned long)sccc & ~0x20);
435 sccd = sccc + 0x10;
436 }
437 for (i = 20000; i != 0; --i) {
438 x = *sccc; eieio();
439 }
440 *sccc = 9; eieio(); /* reset A or B side */
441 *sccc = ((unsigned long)sccc & 0x20)? 0x80: 0x40; eieio();
442 for (i = 0; i < sizeof(scc_inittab); ++i) {
443 *sccc = scc_inittab[i];
444 eieio();
445 }
446 }
447 scc_initialized = 1;
448 if (via_modem) {
449 for (;;) {
450 xmon_write(NULL, "ATE1V1\r", 7);
451 if (xmon_expect("OK", 5)) {
452 xmon_write(NULL, "ATA\r", 4);
453 if (xmon_expect("CONNECT", 40))
454 break;
455 }
456 xmon_write(NULL, "+++", 3);
457 xmon_expect("OK", 3);
458 }
459 }
460}
461
462void *xmon_stdin;
463void *xmon_stdout;
464void *xmon_stderr;
465
466int xmon_putc(int c, void *f)
467{
468 char ch = c;
469
470 if (c == '\n')
471 xmon_putc('\r', f);
472 return xmon_write(f, &ch, 1) == 1? c: -1;
473}
474
475int xmon_putchar(int c)
476{
477 return xmon_putc(c, xmon_stdout);
478}
479
480int xmon_fputs(char *str, void *f)
481{
482 int n = strlen(str);
483
484 return xmon_write(f, str, n) == n? 0: -1;
485}
486
487int
488xmon_readchar(void)
489{
490 char ch;
491
492 for (;;) {
493 switch (xmon_read(xmon_stdin, &ch, 1)) {
494 case 1:
495 return ch;
496 case -1:
497 xmon_printf("read(stdin) returned -1\r\n", 0, 0);
498 return -1;
499 }
500 }
501}
502
503static char line[256];
504static char *lineptr;
505static int lineleft;
506
507int xmon_expect(const char *str, unsigned int timeout)
508{
509 int c;
510 unsigned int t0;
511
512 timeout *= TB_SPEED;
513 t0 = readtb();
514 do {
515 lineptr = line;
516 for (;;) {
517 c = xmon_read_poll();
518 if (c == -1) {
519 if (readtb() - t0 > timeout)
520 return 0;
521 continue;
522 }
523 if (c == '\n')
524 break;
525 if (c != '\r' && lineptr < &line[sizeof(line) - 1])
526 *lineptr++ = c;
527 }
528 *lineptr = 0;
529 } while (strstr(line, str) == NULL);
530 return 1;
531}
532
533int
534xmon_getchar(void)
535{
536 int c;
537
538 if (lineleft == 0) {
539 lineptr = line;
540 for (;;) {
541 c = xmon_readchar();
542 if (c == -1 || c == 4)
543 break;
544 if (c == '\r' || c == '\n') {
545 *lineptr++ = '\n';
546 xmon_putchar('\n');
547 break;
548 }
549 switch (c) {
550 case 0177:
551 case '\b':
552 if (lineptr > line) {
553 xmon_putchar('\b');
554 xmon_putchar(' ');
555 xmon_putchar('\b');
556 --lineptr;
557 }
558 break;
559 case 'U' & 0x1F:
560 while (lineptr > line) {
561 xmon_putchar('\b');
562 xmon_putchar(' ');
563 xmon_putchar('\b');
564 --lineptr;
565 }
566 break;
567 default:
568 if (lineptr >= &line[sizeof(line) - 1])
569 xmon_putchar('\a');
570 else {
571 xmon_putchar(c);
572 *lineptr++ = c;
573 }
574 }
575 }
576 lineleft = lineptr - line;
577 lineptr = line;
578 }
579 if (lineleft == 0)
580 return -1;
581 --lineleft;
582 return *lineptr++;
583}
584
585char *
586xmon_fgets(char *str, int nb, void *f)
587{
588 char *p;
589 int c;
590
591 for (p = str; p < str + nb - 1; ) {
592 c = xmon_getchar();
593 if (c == -1) {
594 if (p == str)
595 return NULL;
596 break;
597 }
598 *p++ = c;
599 if (c == '\n')
600 break;
601 }
602 *p = 0;
603 return str;
604}
605
606void
607xmon_enter(void)
608{
609#ifdef CONFIG_ADB_PMU
610 if (_machine == _MACH_Pmac) {
611 pmu_suspend();
612 }
613#endif
614}
615
616void
617xmon_leave(void)
618{
619#ifdef CONFIG_ADB_PMU
620 if (_machine == _MACH_Pmac) {
621 pmu_resume();
622 }
623#endif
624}
diff --git a/arch/ppc64/xmon/start.c b/arch/powerpc/xmon/start_64.c
index e50c158191e1..e50c158191e1 100644
--- a/arch/ppc64/xmon/start.c
+++ b/arch/powerpc/xmon/start_64.c
diff --git a/arch/powerpc/xmon/start_8xx.c b/arch/powerpc/xmon/start_8xx.c
new file mode 100644
index 000000000000..a48bd594cf61
--- /dev/null
+++ b/arch/powerpc/xmon/start_8xx.c
@@ -0,0 +1,287 @@
1/*
2 * Copyright (C) 1996 Paul Mackerras.
3 * Copyright (C) 2000 Dan Malek.
4 * Quick hack of Paul's code to make XMON work on 8xx processors. Lots
5 * of assumptions, like the SMC1 is used, it has been initialized by the
6 * loader at some point, and we can just stuff and suck bytes.
7 * We rely upon the 8xx uart driver to support us, as the interface
8 * changes between boot up and operational phases of the kernel.
9 */
10#include <linux/string.h>
11#include <asm/machdep.h>
12#include <asm/io.h>
13#include <asm/page.h>
14#include <linux/kernel.h>
15#include <asm/8xx_immap.h>
16#include <asm/mpc8xx.h>
17#include <asm/commproc.h>
18
19extern void xmon_printf(const char *fmt, ...);
20extern int xmon_8xx_write(char *str, int nb);
21extern int xmon_8xx_read_poll(void);
22extern int xmon_8xx_read_char(void);
23void prom_drawhex(uint);
24void prom_drawstring(const char *str);
25
26static int use_screen = 1; /* default */
27
28#define TB_SPEED 25000000
29
30static inline unsigned int readtb(void)
31{
32 unsigned int ret;
33
34 asm volatile("mftb %0" : "=r" (ret) :);
35 return ret;
36}
37
38void buf_access(void)
39{
40}
41
42void
43xmon_map_scc(void)
44{
45
46 cpmp = (cpm8xx_t *)&(((immap_t *)IMAP_ADDR)->im_cpm);
47 use_screen = 0;
48
49 prom_drawstring("xmon uses serial port\n");
50}
51
52static int scc_initialized = 0;
53
54void xmon_init_scc(void);
55
56int
57xmon_write(void *handle, void *ptr, int nb)
58{
59 char *p = ptr;
60 int i, c, ct;
61
62 if (!scc_initialized)
63 xmon_init_scc();
64
65 return(xmon_8xx_write(ptr, nb));
66}
67
68int xmon_wants_key;
69
70int
71xmon_read(void *handle, void *ptr, int nb)
72{
73 char *p = ptr;
74 int i;
75
76 if (!scc_initialized)
77 xmon_init_scc();
78
79 for (i = 0; i < nb; ++i) {
80 *p++ = xmon_8xx_read_char();
81 }
82 return i;
83}
84
85int
86xmon_read_poll(void)
87{
88 return(xmon_8xx_read_poll());
89}
90
91void
92xmon_init_scc()
93{
94 scc_initialized = 1;
95}
96
97#if 0
98extern int (*prom_entry)(void *);
99
100int
101xmon_exit(void)
102{
103 struct prom_args {
104 char *service;
105 } args;
106
107 for (;;) {
108 args.service = "exit";
109 (*prom_entry)(&args);
110 }
111}
112#endif
113
114void *xmon_stdin;
115void *xmon_stdout;
116void *xmon_stderr;
117
118void
119xmon_init(void)
120{
121}
122
123int
124xmon_putc(int c, void *f)
125{
126 char ch = c;
127
128 if (c == '\n')
129 xmon_putc('\r', f);
130 return xmon_write(f, &ch, 1) == 1? c: -1;
131}
132
133int
134xmon_putchar(int c)
135{
136 return xmon_putc(c, xmon_stdout);
137}
138
139int
140xmon_fputs(char *str, void *f)
141{
142 int n = strlen(str);
143
144 return xmon_write(f, str, n) == n? 0: -1;
145}
146
147int
148xmon_readchar(void)
149{
150 char ch;
151
152 for (;;) {
153 switch (xmon_read(xmon_stdin, &ch, 1)) {
154 case 1:
155 return ch;
156 case -1:
157 xmon_printf("read(stdin) returned -1\r\n", 0, 0);
158 return -1;
159 }
160 }
161}
162
163static char line[256];
164static char *lineptr;
165static int lineleft;
166
167#if 0
168int xmon_expect(const char *str, unsigned int timeout)
169{
170 int c;
171 unsigned int t0;
172
173 timeout *= TB_SPEED;
174 t0 = readtb();
175 do {
176 lineptr = line;
177 for (;;) {
178 c = xmon_read_poll();
179 if (c == -1) {
180 if (readtb() - t0 > timeout)
181 return 0;
182 continue;
183 }
184 if (c == '\n')
185 break;
186 if (c != '\r' && lineptr < &line[sizeof(line) - 1])
187 *lineptr++ = c;
188 }
189 *lineptr = 0;
190 } while (strstr(line, str) == NULL);
191 return 1;
192}
193#endif
194
195int
196xmon_getchar(void)
197{
198 int c;
199
200 if (lineleft == 0) {
201 lineptr = line;
202 for (;;) {
203 c = xmon_readchar();
204 if (c == -1 || c == 4)
205 break;
206 if (c == '\r' || c == '\n') {
207 *lineptr++ = '\n';
208 xmon_putchar('\n');
209 break;
210 }
211 switch (c) {
212 case 0177:
213 case '\b':
214 if (lineptr > line) {
215 xmon_putchar('\b');
216 xmon_putchar(' ');
217 xmon_putchar('\b');
218 --lineptr;
219 }
220 break;
221 case 'U' & 0x1F:
222 while (lineptr > line) {
223 xmon_putchar('\b');
224 xmon_putchar(' ');
225 xmon_putchar('\b');
226 --lineptr;
227 }
228 break;
229 default:
230 if (lineptr >= &line[sizeof(line) - 1])
231 xmon_putchar('\a');
232 else {
233 xmon_putchar(c);
234 *lineptr++ = c;
235 }
236 }
237 }
238 lineleft = lineptr - line;
239 lineptr = line;
240 }
241 if (lineleft == 0)
242 return -1;
243 --lineleft;
244 return *lineptr++;
245}
246
247char *
248xmon_fgets(char *str, int nb, void *f)
249{
250 char *p;
251 int c;
252
253 for (p = str; p < str + nb - 1; ) {
254 c = xmon_getchar();
255 if (c == -1) {
256 if (p == str)
257 return 0;
258 break;
259 }
260 *p++ = c;
261 if (c == '\n')
262 break;
263 }
264 *p = 0;
265 return str;
266}
267
268void
269prom_drawhex(uint val)
270{
271 unsigned char buf[10];
272
273 int i;
274 for (i = 7; i >= 0; i--)
275 {
276 buf[i] = "0123456789abcdef"[val & 0x0f];
277 val >>= 4;
278 }
279 buf[8] = '\0';
280 xmon_fputs(buf, xmon_stdout);
281}
282
283void
284prom_drawstring(const char *str)
285{
286 xmon_fputs(str, xmon_stdout);
287}
diff --git a/arch/ppc64/xmon/subr_prf.c b/arch/powerpc/xmon/subr_prf.c
index 5242bd7d0959..b48738c6dd33 100644
--- a/arch/ppc64/xmon/subr_prf.c
+++ b/arch/powerpc/xmon/subr_prf.c
@@ -18,13 +18,13 @@
18 18
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/string.h> 20#include <linux/string.h>
21#include <linux/module.h>
21#include <stdarg.h> 22#include <stdarg.h>
22#include "nonstdio.h" 23#include "nonstdio.h"
23 24
24extern int xmon_write(void *, void *, int); 25extern int xmon_write(void *, void *, int);
25 26
26void 27void xmon_vfprintf(void *f, const char *fmt, va_list ap)
27xmon_vfprintf(void *f, const char *fmt, va_list ap)
28{ 28{
29 static char xmon_buf[2048]; 29 static char xmon_buf[2048];
30 int n; 30 int n;
@@ -33,8 +33,7 @@ xmon_vfprintf(void *f, const char *fmt, va_list ap)
33 xmon_write(f, xmon_buf, n); 33 xmon_write(f, xmon_buf, n);
34} 34}
35 35
36void 36void xmon_printf(const char *fmt, ...)
37xmon_printf(const char *fmt, ...)
38{ 37{
39 va_list ap; 38 va_list ap;
40 39
@@ -42,9 +41,9 @@ xmon_printf(const char *fmt, ...)
42 xmon_vfprintf(stdout, fmt, ap); 41 xmon_vfprintf(stdout, fmt, ap);
43 va_end(ap); 42 va_end(ap);
44} 43}
44EXPORT_SYMBOL(xmon_printf);
45 45
46void 46void xmon_fprintf(void *f, const char *fmt, ...)
47xmon_fprintf(void *f, const char *fmt, ...)
48{ 47{
49 va_list ap; 48 va_list ap;
50 49
diff --git a/arch/ppc64/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 74e63a886a69..1124f1146202 100644
--- a/arch/ppc64/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -17,25 +17,31 @@
17#include <linux/delay.h> 17#include <linux/delay.h>
18#include <linux/kallsyms.h> 18#include <linux/kallsyms.h>
19#include <linux/cpumask.h> 19#include <linux/cpumask.h>
20#include <linux/module.h>
20 21
21#include <asm/ptrace.h> 22#include <asm/ptrace.h>
22#include <asm/string.h> 23#include <asm/string.h>
23#include <asm/prom.h> 24#include <asm/prom.h>
24#include <asm/machdep.h> 25#include <asm/machdep.h>
26#include <asm/xmon.h>
27#ifdef CONFIG_PMAC_BACKLIGHT
28#include <asm/backlight.h>
29#endif
25#include <asm/processor.h> 30#include <asm/processor.h>
26#include <asm/pgtable.h> 31#include <asm/pgtable.h>
27#include <asm/mmu.h> 32#include <asm/mmu.h>
28#include <asm/mmu_context.h> 33#include <asm/mmu_context.h>
29#include <asm/paca.h>
30#include <asm/ppcdebug.h>
31#include <asm/cputable.h> 34#include <asm/cputable.h>
32#include <asm/rtas.h> 35#include <asm/rtas.h>
33#include <asm/sstep.h> 36#include <asm/sstep.h>
34#include <asm/bug.h> 37#include <asm/bug.h>
38
39#ifdef CONFIG_PPC64
35#include <asm/hvcall.h> 40#include <asm/hvcall.h>
41#include <asm/paca.h>
42#endif
36 43
37#include "nonstdio.h" 44#include "nonstdio.h"
38#include "privinst.h"
39 45
40#define scanhex xmon_scanhex 46#define scanhex xmon_scanhex
41#define skipbl xmon_skipbl 47#define skipbl xmon_skipbl
@@ -58,7 +64,7 @@ static unsigned long ncsum = 4096;
58static int termch; 64static int termch;
59static char tmpstr[128]; 65static char tmpstr[128];
60 66
61#define JMP_BUF_LEN (184/sizeof(long)) 67#define JMP_BUF_LEN 23
62static long bus_error_jmp[JMP_BUF_LEN]; 68static long bus_error_jmp[JMP_BUF_LEN];
63static int catch_memory_errors; 69static int catch_memory_errors;
64static long *xmon_fault_jmp[NR_CPUS]; 70static long *xmon_fault_jmp[NR_CPUS];
@@ -130,23 +136,36 @@ static void cacheflush(void);
130static int cpu_cmd(void); 136static int cpu_cmd(void);
131static void csum(void); 137static void csum(void);
132static void bootcmds(void); 138static void bootcmds(void);
139static void proccall(void);
133void dump_segments(void); 140void dump_segments(void);
134static void symbol_lookup(void); 141static void symbol_lookup(void);
135static void xmon_print_symbol(unsigned long address, const char *mid, 142static void xmon_print_symbol(unsigned long address, const char *mid,
136 const char *after); 143 const char *after);
137static const char *getvecname(unsigned long vec); 144static const char *getvecname(unsigned long vec);
138 145
139static void debug_trace(void);
140
141extern int print_insn_powerpc(unsigned long, unsigned long, int); 146extern int print_insn_powerpc(unsigned long, unsigned long, int);
142extern void printf(const char *fmt, ...); 147extern void printf(const char *fmt, ...);
143extern void xmon_vfprintf(void *f, const char *fmt, va_list ap); 148extern void xmon_vfprintf(void *f, const char *fmt, va_list ap);
144extern int xmon_putc(int c, void *f); 149extern int xmon_putc(int c, void *f);
145extern int putchar(int ch); 150extern int putchar(int ch);
151
152extern void xmon_enter(void);
153extern void xmon_leave(void);
154
146extern int xmon_read_poll(void); 155extern int xmon_read_poll(void);
147extern int setjmp(long *); 156extern long setjmp(long *);
148extern void longjmp(long *, int); 157extern void longjmp(long *, long);
149extern unsigned long _ASR; 158extern void xmon_save_regs(struct pt_regs *);
159
160#ifdef CONFIG_PPC64
161#define REG "%.16lx"
162#define REGS_PER_LINE 4
163#define LAST_VOLATILE 13
164#else
165#define REG "%.8lx"
166#define REGS_PER_LINE 8
167#define LAST_VOLATILE 12
168#endif
150 169
151#define GETWORD(v) (((v)[0] << 24) + ((v)[1] << 16) + ((v)[2] << 8) + (v)[3]) 170#define GETWORD(v) (((v)[0] << 24) + ((v)[1] << 16) + ((v)[2] << 8) + (v)[3])
152 171
@@ -186,47 +205,45 @@ Commands:\n\
186 ml locate a block of memory\n\ 205 ml locate a block of memory\n\
187 mz zero a block of memory\n\ 206 mz zero a block of memory\n\
188 mi show information about memory allocation\n\ 207 mi show information about memory allocation\n\
189 p show the task list\n\ 208 p call a procedure\n\
190 r print registers\n\ 209 r print registers\n\
191 s single step\n\ 210 s single step\n\
192 S print special registers\n\ 211 S print special registers\n\
193 t print backtrace\n\ 212 t print backtrace\n\
194 T Enable/Disable PPCDBG flags\n\
195 x exit monitor and recover\n\ 213 x exit monitor and recover\n\
196 X exit monitor and dont recover\n\ 214 X exit monitor and dont recover\n"
197 u dump segment table or SLB\n\ 215#ifdef CONFIG_PPC64
198 ? help\n" 216" u dump segment table or SLB\n"
199 "\ 217#endif
200 zr reboot\n\ 218#ifdef CONFIG_PPC_STD_MMU_32
219" u dump segment registers\n"
220#endif
221" ? help\n"
222" zr reboot\n\
201 zh halt\n" 223 zh halt\n"
202; 224;
203 225
204static struct pt_regs *xmon_regs; 226static struct pt_regs *xmon_regs;
205 227
206extern inline void sync(void) 228static inline void sync(void)
207{ 229{
208 asm volatile("sync; isync"); 230 asm volatile("sync; isync");
209} 231}
210 232
211/* (Ref: 64-bit PowerPC ELF ABI Spplement; Ian Lance Taylor, Zembu Labs). 233static inline void store_inst(void *p)
212 A PPC stack frame looks like this: 234{
213 235 asm volatile ("dcbst 0,%0; sync; icbi 0,%0; isync" : : "r" (p));
214 High Address 236}
215 Back Chain 237
216 FP reg save area 238static inline void cflush(void *p)
217 GP reg save area 239{
218 Local var space 240 asm volatile ("dcbf 0,%0; icbi 0,%0" : : "r" (p));
219 Parameter save area (SP+48) 241}
220 TOC save area (SP+40) 242
221 link editor doubleword (SP+32) 243static inline void cinval(void *p)
222 compiler doubleword (SP+24) 244{
223 LR save (SP+16) 245 asm volatile ("dcbi 0,%0; icbi 0,%0" : : "r" (p));
224 CR save (SP+8) 246}
225 Back Chain (SP+0)
226
227 Note that the LR (ret addr) may not be saved in the current frame if
228 no functions have been called from the current function.
229 */
230 247
231/* 248/*
232 * Disable surveillance (the service processor watchdog function) 249 * Disable surveillance (the service processor watchdog function)
@@ -310,8 +327,8 @@ int xmon_core(struct pt_regs *regs, int fromipi)
310 unsigned long timeout; 327 unsigned long timeout;
311#endif 328#endif
312 329
313 msr = get_msr(); 330 msr = mfmsr();
314 set_msrd(msr & ~MSR_EE); /* disable interrupts */ 331 mtmsr(msr & ~MSR_EE); /* disable interrupts */
315 332
316 bp = in_breakpoint_table(regs->nip, &offset); 333 bp = in_breakpoint_table(regs->nip, &offset);
317 if (bp != NULL) { 334 if (bp != NULL) {
@@ -487,7 +504,7 @@ int xmon_core(struct pt_regs *regs, int fromipi)
487 504
488 insert_cpu_bpts(); 505 insert_cpu_bpts();
489 506
490 set_msrd(msr); /* restore interrupt enable */ 507 mtmsr(msr); /* restore interrupt enable */
491 508
492 return cmd != 'X'; 509 return cmd != 'X';
493} 510}
@@ -497,56 +514,23 @@ int xmon(struct pt_regs *excp)
497 struct pt_regs regs; 514 struct pt_regs regs;
498 515
499 if (excp == NULL) { 516 if (excp == NULL) {
500 /* Ok, grab regs as they are now. 517 xmon_save_regs(&regs);
501 This won't do a particularily good job because the
502 prologue has already been executed.
503 ToDo: We could reach back into the callers save
504 area to do a better job of representing the
505 caller's state.
506 */
507 asm volatile ("std 0,0(%0)\n\
508 std 1,8(%0)\n\
509 std 2,16(%0)\n\
510 std 3,24(%0)\n\
511 std 4,32(%0)\n\
512 std 5,40(%0)\n\
513 std 6,48(%0)\n\
514 std 7,56(%0)\n\
515 std 8,64(%0)\n\
516 std 9,72(%0)\n\
517 std 10,80(%0)\n\
518 std 11,88(%0)\n\
519 std 12,96(%0)\n\
520 std 13,104(%0)\n\
521 std 14,112(%0)\n\
522 std 15,120(%0)\n\
523 std 16,128(%0)\n\
524 std 17,136(%0)\n\
525 std 18,144(%0)\n\
526 std 19,152(%0)\n\
527 std 20,160(%0)\n\
528 std 21,168(%0)\n\
529 std 22,176(%0)\n\
530 std 23,184(%0)\n\
531 std 24,192(%0)\n\
532 std 25,200(%0)\n\
533 std 26,208(%0)\n\
534 std 27,216(%0)\n\
535 std 28,224(%0)\n\
536 std 29,232(%0)\n\
537 std 30,240(%0)\n\
538 std 31,248(%0)" : : "b" (&regs));
539
540 regs.nip = regs.link = ((unsigned long *)(regs.gpr[1]))[2];
541 regs.msr = get_msr();
542 regs.ctr = get_ctr();
543 regs.xer = get_xer();
544 regs.ccr = get_cr();
545 regs.trap = 0;
546 excp = &regs; 518 excp = &regs;
547 } 519 }
548 return xmon_core(excp, 0); 520 return xmon_core(excp, 0);
549} 521}
522EXPORT_SYMBOL(xmon);
523
524irqreturn_t
525xmon_irq(int irq, void *d, struct pt_regs *regs)
526{
527 unsigned long flags;
528 local_irq_save(flags);
529 printf("Keyboard interrupt\n");
530 xmon(regs);
531 local_irq_restore(flags);
532 return IRQ_HANDLED;
533}
550 534
551int xmon_bpt(struct pt_regs *regs) 535int xmon_bpt(struct pt_regs *regs)
552{ 536{
@@ -718,7 +702,7 @@ static void insert_cpu_bpts(void)
718 if (dabr.enabled) 702 if (dabr.enabled)
719 set_dabr(dabr.address | (dabr.enabled & 7)); 703 set_dabr(dabr.address | (dabr.enabled & 7));
720 if (iabr && cpu_has_feature(CPU_FTR_IABR)) 704 if (iabr && cpu_has_feature(CPU_FTR_IABR))
721 set_iabr(iabr->address 705 mtspr(SPRN_IABR, iabr->address
722 | (iabr->enabled & (BP_IABR|BP_IABR_TE))); 706 | (iabr->enabled & (BP_IABR|BP_IABR_TE)));
723} 707}
724 708
@@ -746,7 +730,7 @@ static void remove_cpu_bpts(void)
746{ 730{
747 set_dabr(0); 731 set_dabr(0);
748 if (cpu_has_feature(CPU_FTR_IABR)) 732 if (cpu_has_feature(CPU_FTR_IABR))
749 set_iabr(0); 733 mtspr(SPRN_IABR, 0);
750} 734}
751 735
752/* Command interpreting routine */ 736/* Command interpreting routine */
@@ -830,9 +814,6 @@ cmds(struct pt_regs *excp)
830 case '?': 814 case '?':
831 printf(help_string); 815 printf(help_string);
832 break; 816 break;
833 case 'p':
834 show_state();
835 break;
836 case 'b': 817 case 'b':
837 bpt_cmds(); 818 bpt_cmds();
838 break; 819 break;
@@ -846,12 +827,14 @@ cmds(struct pt_regs *excp)
846 case 'z': 827 case 'z':
847 bootcmds(); 828 bootcmds();
848 break; 829 break;
849 case 'T': 830 case 'p':
850 debug_trace(); 831 proccall();
851 break; 832 break;
833#ifdef CONFIG_PPC_STD_MMU
852 case 'u': 834 case 'u':
853 dump_segments(); 835 dump_segments();
854 break; 836 break;
837#endif
855 default: 838 default:
856 printf("Unrecognized command: "); 839 printf("Unrecognized command: ");
857 do { 840 do {
@@ -1070,6 +1053,7 @@ bpt_cmds(void)
1070 1053
1071 cmd = inchar(); 1054 cmd = inchar();
1072 switch (cmd) { 1055 switch (cmd) {
1056#ifndef CONFIG_8xx
1073 case 'd': /* bd - hardware data breakpoint */ 1057 case 'd': /* bd - hardware data breakpoint */
1074 mode = 7; 1058 mode = 7;
1075 cmd = inchar(); 1059 cmd = inchar();
@@ -1111,6 +1095,7 @@ bpt_cmds(void)
1111 iabr = bp; 1095 iabr = bp;
1112 } 1096 }
1113 break; 1097 break;
1098#endif
1114 1099
1115 case 'c': 1100 case 'c':
1116 if (!scanhex(&a)) { 1101 if (!scanhex(&a)) {
@@ -1152,7 +1137,7 @@ bpt_cmds(void)
1152 /* print all breakpoints */ 1137 /* print all breakpoints */
1153 printf(" type address\n"); 1138 printf(" type address\n");
1154 if (dabr.enabled) { 1139 if (dabr.enabled) {
1155 printf(" data %.16lx [", dabr.address); 1140 printf(" data "REG" [", dabr.address);
1156 if (dabr.enabled & 1) 1141 if (dabr.enabled & 1)
1157 printf("r"); 1142 printf("r");
1158 if (dabr.enabled & 2) 1143 if (dabr.enabled & 2)
@@ -1231,6 +1216,18 @@ static void get_function_bounds(unsigned long pc, unsigned long *startp,
1231 1216
1232static int xmon_depth_to_print = 64; 1217static int xmon_depth_to_print = 64;
1233 1218
1219#ifdef CONFIG_PPC64
1220#define LRSAVE_OFFSET 0x10
1221#define REG_FRAME_MARKER 0x7265677368657265ul /* "regshere" */
1222#define MARKER_OFFSET 0x60
1223#define REGS_OFFSET 0x70
1224#else
1225#define LRSAVE_OFFSET 4
1226#define REG_FRAME_MARKER 0x72656773
1227#define MARKER_OFFSET 8
1228#define REGS_OFFSET 16
1229#endif
1230
1234static void xmon_show_stack(unsigned long sp, unsigned long lr, 1231static void xmon_show_stack(unsigned long sp, unsigned long lr,
1235 unsigned long pc) 1232 unsigned long pc)
1236{ 1233{
@@ -1247,7 +1244,7 @@ static void xmon_show_stack(unsigned long sp, unsigned long lr,
1247 break; 1244 break;
1248 } 1245 }
1249 1246
1250 if (!mread(sp + 16, &ip, sizeof(unsigned long)) 1247 if (!mread(sp + LRSAVE_OFFSET, &ip, sizeof(unsigned long))
1251 || !mread(sp, &newsp, sizeof(unsigned long))) { 1248 || !mread(sp, &newsp, sizeof(unsigned long))) {
1252 printf("Couldn't read stack frame at %lx\n", sp); 1249 printf("Couldn't read stack frame at %lx\n", sp);
1253 break; 1250 break;
@@ -1266,7 +1263,7 @@ static void xmon_show_stack(unsigned long sp, unsigned long lr,
1266 get_function_bounds(pc, &fnstart, &fnend); 1263 get_function_bounds(pc, &fnstart, &fnend);
1267 nextip = 0; 1264 nextip = 0;
1268 if (newsp > sp) 1265 if (newsp > sp)
1269 mread(newsp + 16, &nextip, 1266 mread(newsp + LRSAVE_OFFSET, &nextip,
1270 sizeof(unsigned long)); 1267 sizeof(unsigned long));
1271 if (lr == ip) { 1268 if (lr == ip) {
1272 if (lr < PAGE_OFFSET 1269 if (lr < PAGE_OFFSET
@@ -1280,24 +1277,24 @@ static void xmon_show_stack(unsigned long sp, unsigned long lr,
1280 xmon_print_symbol(lr, " ", "\n"); 1277 xmon_print_symbol(lr, " ", "\n");
1281 } 1278 }
1282 if (printip) { 1279 if (printip) {
1283 printf("[%.16lx] ", sp); 1280 printf("["REG"] ", sp);
1284 xmon_print_symbol(ip, " ", " (unreliable)\n"); 1281 xmon_print_symbol(ip, " ", " (unreliable)\n");
1285 } 1282 }
1286 pc = lr = 0; 1283 pc = lr = 0;
1287 1284
1288 } else { 1285 } else {
1289 printf("[%.16lx] ", sp); 1286 printf("["REG"] ", sp);
1290 xmon_print_symbol(ip, " ", "\n"); 1287 xmon_print_symbol(ip, " ", "\n");
1291 } 1288 }
1292 1289
1293 /* Look for "regshere" marker to see if this is 1290 /* Look for "regshere" marker to see if this is
1294 an exception frame. */ 1291 an exception frame. */
1295 if (mread(sp + 0x60, &marker, sizeof(unsigned long)) 1292 if (mread(sp + MARKER_OFFSET, &marker, sizeof(unsigned long))
1296 && marker == 0x7265677368657265ul) { 1293 && marker == REG_FRAME_MARKER) {
1297 if (mread(sp + 0x70, &regs, sizeof(regs)) 1294 if (mread(sp + REGS_OFFSET, &regs, sizeof(regs))
1298 != sizeof(regs)) { 1295 != sizeof(regs)) {
1299 printf("Couldn't read registers at %lx\n", 1296 printf("Couldn't read registers at %lx\n",
1300 sp + 0x70); 1297 sp + REGS_OFFSET);
1301 break; 1298 break;
1302 } 1299 }
1303 printf("--- Exception: %lx %s at ", regs.trap, 1300 printf("--- Exception: %lx %s at ", regs.trap,
@@ -1371,7 +1368,9 @@ void excprint(struct pt_regs *fp)
1371 } 1368 }
1372 1369
1373 printf(" current = 0x%lx\n", current); 1370 printf(" current = 0x%lx\n", current);
1371#ifdef CONFIG_PPC64
1374 printf(" paca = 0x%lx\n", get_paca()); 1372 printf(" paca = 0x%lx\n", get_paca());
1373#endif
1375 if (current) { 1374 if (current) {
1376 printf(" pid = %ld, comm = %s\n", 1375 printf(" pid = %ld, comm = %s\n",
1377 current->pid, current->comm); 1376 current->pid, current->comm);
@@ -1383,7 +1382,7 @@ void excprint(struct pt_regs *fp)
1383 1382
1384void prregs(struct pt_regs *fp) 1383void prregs(struct pt_regs *fp)
1385{ 1384{
1386 int n; 1385 int n, trap;
1387 unsigned long base; 1386 unsigned long base;
1388 struct pt_regs regs; 1387 struct pt_regs regs;
1389 1388
@@ -1396,7 +1395,7 @@ void prregs(struct pt_regs *fp)
1396 __delay(200); 1395 __delay(200);
1397 } else { 1396 } else {
1398 catch_memory_errors = 0; 1397 catch_memory_errors = 0;
1399 printf("*** Error reading registers from %.16lx\n", 1398 printf("*** Error reading registers from "REG"\n",
1400 base); 1399 base);
1401 return; 1400 return;
1402 } 1401 }
@@ -1404,22 +1403,36 @@ void prregs(struct pt_regs *fp)
1404 fp = &regs; 1403 fp = &regs;
1405 } 1404 }
1406 1405
1406#ifdef CONFIG_PPC64
1407 if (FULL_REGS(fp)) { 1407 if (FULL_REGS(fp)) {
1408 for (n = 0; n < 16; ++n) 1408 for (n = 0; n < 16; ++n)
1409 printf("R%.2ld = %.16lx R%.2ld = %.16lx\n", 1409 printf("R%.2ld = "REG" R%.2ld = "REG"\n",
1410 n, fp->gpr[n], n+16, fp->gpr[n+16]); 1410 n, fp->gpr[n], n+16, fp->gpr[n+16]);
1411 } else { 1411 } else {
1412 for (n = 0; n < 7; ++n) 1412 for (n = 0; n < 7; ++n)
1413 printf("R%.2ld = %.16lx R%.2ld = %.16lx\n", 1413 printf("R%.2ld = "REG" R%.2ld = "REG"\n",
1414 n, fp->gpr[n], n+7, fp->gpr[n+7]); 1414 n, fp->gpr[n], n+7, fp->gpr[n+7]);
1415 } 1415 }
1416#else
1417 for (n = 0; n < 32; ++n) {
1418 printf("R%.2d = %.8x%s", n, fp->gpr[n],
1419 (n & 3) == 3? "\n": " ");
1420 if (n == 12 && !FULL_REGS(fp)) {
1421 printf("\n");
1422 break;
1423 }
1424 }
1425#endif
1416 printf("pc = "); 1426 printf("pc = ");
1417 xmon_print_symbol(fp->nip, " ", "\n"); 1427 xmon_print_symbol(fp->nip, " ", "\n");
1418 printf("lr = "); 1428 printf("lr = ");
1419 xmon_print_symbol(fp->link, " ", "\n"); 1429 xmon_print_symbol(fp->link, " ", "\n");
1420 printf("msr = %.16lx cr = %.8lx\n", fp->msr, fp->ccr); 1430 printf("msr = "REG" cr = %.8lx\n", fp->msr, fp->ccr);
1421 printf("ctr = %.16lx xer = %.16lx trap = %8lx\n", 1431 printf("ctr = "REG" xer = "REG" trap = %4lx\n",
1422 fp->ctr, fp->xer, fp->trap); 1432 fp->ctr, fp->xer, fp->trap);
1433 trap = TRAP(fp);
1434 if (trap == 0x300 || trap == 0x380 || trap == 0x600)
1435 printf("dar = "REG" dsisr = %.8lx\n", fp->dar, fp->dsisr);
1423} 1436}
1424 1437
1425void cacheflush(void) 1438void cacheflush(void)
@@ -1519,8 +1532,7 @@ static unsigned long regno;
1519extern char exc_prolog; 1532extern char exc_prolog;
1520extern char dec_exc; 1533extern char dec_exc;
1521 1534
1522void 1535void super_regs(void)
1523super_regs(void)
1524{ 1536{
1525 int cmd; 1537 int cmd;
1526 unsigned long val; 1538 unsigned long val;
@@ -1536,12 +1548,14 @@ super_regs(void)
1536 asm("mr %0,1" : "=r" (sp) :); 1548 asm("mr %0,1" : "=r" (sp) :);
1537 asm("mr %0,2" : "=r" (toc) :); 1549 asm("mr %0,2" : "=r" (toc) :);
1538 1550
1539 printf("msr = %.16lx sprg0= %.16lx\n", get_msr(), get_sprg0()); 1551 printf("msr = "REG" sprg0= "REG"\n",
1540 printf("pvr = %.16lx sprg1= %.16lx\n", get_pvr(), get_sprg1()); 1552 mfmsr(), mfspr(SPRN_SPRG0));
1541 printf("dec = %.16lx sprg2= %.16lx\n", get_dec(), get_sprg2()); 1553 printf("pvr = "REG" sprg1= "REG"\n",
1542 printf("sp = %.16lx sprg3= %.16lx\n", sp, get_sprg3()); 1554 mfspr(SPRN_PVR), mfspr(SPRN_SPRG1));
1543 printf("toc = %.16lx dar = %.16lx\n", toc, get_dar()); 1555 printf("dec = "REG" sprg2= "REG"\n",
1544 printf("srr0 = %.16lx srr1 = %.16lx\n", get_srr0(), get_srr1()); 1556 mfspr(SPRN_DEC), mfspr(SPRN_SPRG2));
1557 printf("sp = "REG" sprg3= "REG"\n", sp, mfspr(SPRN_SPRG3));
1558 printf("toc = "REG" dar = "REG"\n", toc, mfspr(SPRN_DAR));
1545#ifdef CONFIG_PPC_ISERIES 1559#ifdef CONFIG_PPC_ISERIES
1546 // Dump out relevant Paca data areas. 1560 // Dump out relevant Paca data areas.
1547 printf("Paca: \n"); 1561 printf("Paca: \n");
@@ -1578,11 +1592,6 @@ super_regs(void)
1578 case 'r': 1592 case 'r':
1579 printf("spr %lx = %lx\n", regno, read_spr(regno)); 1593 printf("spr %lx = %lx\n", regno, read_spr(regno));
1580 break; 1594 break;
1581 case 'm':
1582 val = get_msr();
1583 scanhex(&val);
1584 set_msrd(val);
1585 break;
1586 } 1595 }
1587 scannl(); 1596 scannl();
1588} 1597}
@@ -1604,13 +1613,13 @@ mread(unsigned long adrs, void *buf, int size)
1604 q = (char *)buf; 1613 q = (char *)buf;
1605 switch (size) { 1614 switch (size) {
1606 case 2: 1615 case 2:
1607 *(short *)q = *(short *)p; 1616 *(u16 *)q = *(u16 *)p;
1608 break; 1617 break;
1609 case 4: 1618 case 4:
1610 *(int *)q = *(int *)p; 1619 *(u32 *)q = *(u32 *)p;
1611 break; 1620 break;
1612 case 8: 1621 case 8:
1613 *(long *)q = *(long *)p; 1622 *(u64 *)q = *(u64 *)p;
1614 break; 1623 break;
1615 default: 1624 default:
1616 for( ; n < size; ++n) { 1625 for( ; n < size; ++n) {
@@ -1641,13 +1650,13 @@ mwrite(unsigned long adrs, void *buf, int size)
1641 q = (char *) buf; 1650 q = (char *) buf;
1642 switch (size) { 1651 switch (size) {
1643 case 2: 1652 case 2:
1644 *(short *)p = *(short *)q; 1653 *(u16 *)p = *(u16 *)q;
1645 break; 1654 break;
1646 case 4: 1655 case 4:
1647 *(int *)p = *(int *)q; 1656 *(u32 *)p = *(u32 *)q;
1648 break; 1657 break;
1649 case 8: 1658 case 8:
1650 *(long *)p = *(long *)q; 1659 *(u64 *)p = *(u64 *)q;
1651 break; 1660 break;
1652 default: 1661 default:
1653 for ( ; n < size; ++n) { 1662 for ( ; n < size; ++n) {
@@ -1667,11 +1676,12 @@ mwrite(unsigned long adrs, void *buf, int size)
1667} 1676}
1668 1677
1669static int fault_type; 1678static int fault_type;
1679static int fault_except;
1670static char *fault_chars[] = { "--", "**", "##" }; 1680static char *fault_chars[] = { "--", "**", "##" };
1671 1681
1672static int 1682static int handle_fault(struct pt_regs *regs)
1673handle_fault(struct pt_regs *regs)
1674{ 1683{
1684 fault_except = TRAP(regs);
1675 switch (TRAP(regs)) { 1685 switch (TRAP(regs)) {
1676 case 0x200: 1686 case 0x200:
1677 fault_type = 0; 1687 fault_type = 0;
@@ -1960,7 +1970,7 @@ prdump(unsigned long adrs, long ndump)
1960 unsigned char temp[16]; 1970 unsigned char temp[16];
1961 1971
1962 for (n = ndump; n > 0;) { 1972 for (n = ndump; n > 0;) {
1963 printf("%.16lx", adrs); 1973 printf(REG, adrs);
1964 putchar(' '); 1974 putchar(' ');
1965 r = n < 16? n: 16; 1975 r = n < 16? n: 16;
1966 nr = mread(adrs, temp, r); 1976 nr = mread(adrs, temp, r);
@@ -2008,7 +2018,7 @@ ppc_inst_dump(unsigned long adr, long count, int praddr)
2008 if (nr == 0) { 2018 if (nr == 0) {
2009 if (praddr) { 2019 if (praddr) {
2010 const char *x = fault_chars[fault_type]; 2020 const char *x = fault_chars[fault_type];
2011 printf("%.16lx %s%s%s%s\n", adr, x, x, x, x); 2021 printf(REG" %s%s%s%s\n", adr, x, x, x, x);
2012 } 2022 }
2013 break; 2023 break;
2014 } 2024 }
@@ -2023,7 +2033,7 @@ ppc_inst_dump(unsigned long adr, long count, int praddr)
2023 dotted = 0; 2033 dotted = 0;
2024 last_inst = inst; 2034 last_inst = inst;
2025 if (praddr) 2035 if (praddr)
2026 printf("%.16lx %.8x", adr, inst); 2036 printf(REG" %.8x", adr, inst);
2027 printf("\t"); 2037 printf("\t");
2028 print_insn_powerpc(inst, adr, 0); /* always returns 4 */ 2038 print_insn_powerpc(inst, adr, 0); /* always returns 4 */
2029 printf("\n"); 2039 printf("\n");
@@ -2152,6 +2162,42 @@ memzcan(void)
2152 printf("%.8x\n", a - mskip); 2162 printf("%.8x\n", a - mskip);
2153} 2163}
2154 2164
2165void proccall(void)
2166{
2167 unsigned long args[8];
2168 unsigned long ret;
2169 int i;
2170 typedef unsigned long (*callfunc_t)(unsigned long, unsigned long,
2171 unsigned long, unsigned long, unsigned long,
2172 unsigned long, unsigned long, unsigned long);
2173 callfunc_t func;
2174
2175 if (!scanhex(&adrs))
2176 return;
2177 if (termch != '\n')
2178 termch = 0;
2179 for (i = 0; i < 8; ++i)
2180 args[i] = 0;
2181 for (i = 0; i < 8; ++i) {
2182 if (!scanhex(&args[i]) || termch == '\n')
2183 break;
2184 termch = 0;
2185 }
2186 func = (callfunc_t) adrs;
2187 ret = 0;
2188 if (setjmp(bus_error_jmp) == 0) {
2189 catch_memory_errors = 1;
2190 sync();
2191 ret = func(args[0], args[1], args[2], args[3],
2192 args[4], args[5], args[6], args[7]);
2193 sync();
2194 printf("return value is %x\n", ret);
2195 } else {
2196 printf("*** %x exception occurred\n", fault_except);
2197 }
2198 catch_memory_errors = 0;
2199}
2200
2155/* Input scanning routines */ 2201/* Input scanning routines */
2156int 2202int
2157skipbl(void) 2203skipbl(void)
@@ -2174,7 +2220,12 @@ static char *regnames[N_PTREGS] = {
2174 "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", 2220 "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
2175 "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", 2221 "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
2176 "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31", 2222 "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31",
2177 "pc", "msr", "or3", "ctr", "lr", "xer", "ccr", "softe", 2223 "pc", "msr", "or3", "ctr", "lr", "xer", "ccr",
2224#ifdef CONFIG_PPC64
2225 "softe",
2226#else
2227 "mq",
2228#endif
2178 "trap", "dar", "dsisr", "res" 2229 "trap", "dar", "dsisr", "res"
2179}; 2230};
2180 2231
@@ -2280,8 +2331,7 @@ scannl(void)
2280 c = inchar(); 2331 c = inchar();
2281} 2332}
2282 2333
2283int 2334int hexdigit(int c)
2284hexdigit(int c)
2285{ 2335{
2286 if( '0' <= c && c <= '9' ) 2336 if( '0' <= c && c <= '9' )
2287 return c - '0'; 2337 return c - '0';
@@ -2378,7 +2428,7 @@ static void xmon_print_symbol(unsigned long address, const char *mid,
2378 const char *name = NULL; 2428 const char *name = NULL;
2379 unsigned long offset, size; 2429 unsigned long offset, size;
2380 2430
2381 printf("%.16lx", address); 2431 printf(REG, address);
2382 if (setjmp(bus_error_jmp) == 0) { 2432 if (setjmp(bus_error_jmp) == 0) {
2383 catch_memory_errors = 1; 2433 catch_memory_errors = 1;
2384 sync(); 2434 sync();
@@ -2399,55 +2449,7 @@ static void xmon_print_symbol(unsigned long address, const char *mid,
2399 printf("%s", after); 2449 printf("%s", after);
2400} 2450}
2401 2451
2402static void debug_trace(void) 2452#ifdef CONFIG_PPC64
2403{
2404 unsigned long val, cmd, on;
2405
2406 cmd = skipbl();
2407 if (cmd == '\n') {
2408 /* show current state */
2409 unsigned long i;
2410 printf("ppc64_debug_switch = 0x%lx\n", ppc64_debug_switch);
2411 for (i = 0; i < PPCDBG_NUM_FLAGS ;i++) {
2412 on = PPCDBG_BITVAL(i) & ppc64_debug_switch;
2413 printf("%02x %s %12s ", i, on ? "on " : "off", trace_names[i] ? trace_names[i] : "");
2414 if (((i+1) % 3) == 0)
2415 printf("\n");
2416 }
2417 printf("\n");
2418 return;
2419 }
2420 while (cmd != '\n') {
2421 on = 1; /* default if no sign given */
2422 while (cmd == '+' || cmd == '-') {
2423 on = (cmd == '+');
2424 cmd = inchar();
2425 if (cmd == ' ' || cmd == '\n') { /* Turn on or off based on + or - */
2426 ppc64_debug_switch = on ? PPCDBG_ALL:PPCDBG_NONE;
2427 printf("Setting all values to %s...\n", on ? "on" : "off");
2428 if (cmd == '\n') return;
2429 else cmd = skipbl();
2430 }
2431 else
2432 termch = cmd;
2433 }
2434 termch = cmd; /* not +/- ... let scanhex see it */
2435 scanhex((void *)&val);
2436 if (val >= 64) {
2437 printf("Value %x out of range:\n", val);
2438 return;
2439 }
2440 if (on) {
2441 ppc64_debug_switch |= PPCDBG_BITVAL(val);
2442 printf("enable debug %x %s\n", val, trace_names[val] ? trace_names[val] : "");
2443 } else {
2444 ppc64_debug_switch &= ~PPCDBG_BITVAL(val);
2445 printf("disable debug %x %s\n", val, trace_names[val] ? trace_names[val] : "");
2446 }
2447 cmd = skipbl();
2448 }
2449}
2450
2451static void dump_slb(void) 2453static void dump_slb(void)
2452{ 2454{
2453 int i; 2455 int i;
@@ -2484,6 +2486,27 @@ static void dump_stab(void)
2484 } 2486 }
2485} 2487}
2486 2488
2489void dump_segments(void)
2490{
2491 if (cpu_has_feature(CPU_FTR_SLB))
2492 dump_slb();
2493 else
2494 dump_stab();
2495}
2496#endif
2497
2498#ifdef CONFIG_PPC_STD_MMU_32
2499void dump_segments(void)
2500{
2501 int i;
2502
2503 printf("sr0-15 =");
2504 for (i = 0; i < 16; ++i)
2505 printf(" %x", mfsrin(i));
2506 printf("\n");
2507}
2508#endif
2509
2487void xmon_init(int enable) 2510void xmon_init(int enable)
2488{ 2511{
2489 if (enable) { 2512 if (enable) {
@@ -2504,11 +2527,3 @@ void xmon_init(int enable)
2504 __debugger_fault_handler = NULL; 2527 __debugger_fault_handler = NULL;
2505 } 2528 }
2506} 2529}
2507
2508void dump_segments(void)
2509{
2510 if (cpu_has_feature(CPU_FTR_SLB))
2511 dump_slb();
2512 else
2513 dump_stab();
2514}
diff --git a/arch/ppc/8xx_io/commproc.c b/arch/ppc/8xx_io/commproc.c
index 11726e2a4ec8..b42789f8eb76 100644
--- a/arch/ppc/8xx_io/commproc.c
+++ b/arch/ppc/8xx_io/commproc.c
@@ -73,7 +73,7 @@ cpm_mask_irq(unsigned int irq)
73{ 73{
74 int cpm_vec = irq - CPM_IRQ_OFFSET; 74 int cpm_vec = irq - CPM_IRQ_OFFSET;
75 75
76 ((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr &= ~(1 << cpm_vec); 76 out_be32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr, in_be32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr) & ~(1 << cpm_vec));
77} 77}
78 78
79static void 79static void
@@ -81,7 +81,7 @@ cpm_unmask_irq(unsigned int irq)
81{ 81{
82 int cpm_vec = irq - CPM_IRQ_OFFSET; 82 int cpm_vec = irq - CPM_IRQ_OFFSET;
83 83
84 ((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr |= (1 << cpm_vec); 84 out_be32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr, in_be32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr) | (1 << cpm_vec));
85} 85}
86 86
87static void 87static void
@@ -95,7 +95,7 @@ cpm_eoi(unsigned int irq)
95{ 95{
96 int cpm_vec = irq - CPM_IRQ_OFFSET; 96 int cpm_vec = irq - CPM_IRQ_OFFSET;
97 97
98 ((immap_t *)IMAP_ADDR)->im_cpic.cpic_cisr = (1 << cpm_vec); 98 out_be32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cisr, (1 << cpm_vec));
99} 99}
100 100
101struct hw_interrupt_type cpm_pic = { 101struct hw_interrupt_type cpm_pic = {
@@ -133,7 +133,7 @@ m8xx_cpm_reset(void)
133 * manual recommends it. 133 * manual recommends it.
134 * Bit 25, FAM can also be set to use FEC aggressive mode (860T). 134 * Bit 25, FAM can also be set to use FEC aggressive mode (860T).
135 */ 135 */
136 imp->im_siu_conf.sc_sdcr = 1; 136 out_be32(&imp->im_siu_conf.sc_sdcr, 1),
137 137
138 /* Reclaim the DP memory for our use. */ 138 /* Reclaim the DP memory for our use. */
139 m8xx_cpm_dpinit(); 139 m8xx_cpm_dpinit();
@@ -178,10 +178,10 @@ cpm_interrupt_init(void)
178 178
179 /* Initialize the CPM interrupt controller. 179 /* Initialize the CPM interrupt controller.
180 */ 180 */
181 ((immap_t *)IMAP_ADDR)->im_cpic.cpic_cicr = 181 out_be32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cicr,
182 (CICR_SCD_SCC4 | CICR_SCC_SCC3 | CICR_SCB_SCC2 | CICR_SCA_SCC1) | 182 (CICR_SCD_SCC4 | CICR_SCC_SCC3 | CICR_SCB_SCC2 | CICR_SCA_SCC1) |
183 ((CPM_INTERRUPT/2) << 13) | CICR_HP_MASK; 183 ((CPM_INTERRUPT/2) << 13) | CICR_HP_MASK);
184 ((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr = 0; 184 out_be32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr, 0);
185 185
186 /* install the CPM interrupt controller routines for the CPM 186 /* install the CPM interrupt controller routines for the CPM
187 * interrupt vectors 187 * interrupt vectors
@@ -198,7 +198,7 @@ cpm_interrupt_init(void)
198 if (setup_irq(CPM_IRQ_OFFSET + CPMVEC_ERROR, &cpm_error_irqaction)) 198 if (setup_irq(CPM_IRQ_OFFSET + CPMVEC_ERROR, &cpm_error_irqaction))
199 panic("Could not allocate CPM error IRQ!"); 199 panic("Could not allocate CPM error IRQ!");
200 200
201 ((immap_t *)IMAP_ADDR)->im_cpic.cpic_cicr |= CICR_IEN; 201 out_be32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cicr, in_be32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cicr) | CICR_IEN);
202} 202}
203 203
204/* 204/*
@@ -212,8 +212,8 @@ cpm_get_irq(struct pt_regs *regs)
212 /* Get the vector by setting the ACK bit and then reading 212 /* Get the vector by setting the ACK bit and then reading
213 * the register. 213 * the register.
214 */ 214 */
215 ((volatile immap_t *)IMAP_ADDR)->im_cpic.cpic_civr = 1; 215 out_be16(&((volatile immap_t *)IMAP_ADDR)->im_cpic.cpic_civr, 1);
216 cpm_vec = ((volatile immap_t *)IMAP_ADDR)->im_cpic.cpic_civr; 216 cpm_vec = in_be16(&((volatile immap_t *)IMAP_ADDR)->im_cpic.cpic_civr);
217 cpm_vec >>= 11; 217 cpm_vec >>= 11;
218 218
219 return cpm_vec; 219 return cpm_vec;
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
index 776941c75672..114b90fdea24 100644
--- a/arch/ppc/Kconfig
+++ b/arch/ppc/Kconfig
@@ -568,6 +568,7 @@ config CHESTNUT
568 568
569config SPRUCE 569config SPRUCE
570 bool "IBM-Spruce" 570 bool "IBM-Spruce"
571 select PPC_INDIRECT_PCI
571 572
572config HDPU 573config HDPU
573 bool "Sky-HDPU" 574 bool "Sky-HDPU"
@@ -588,27 +589,35 @@ config EV64260
588 589
589config LOPEC 590config LOPEC
590 bool "Motorola-LoPEC" 591 bool "Motorola-LoPEC"
592 select PPC_I8259
591 593
592config MVME5100 594config MVME5100
593 bool "Motorola-MVME5100" 595 bool "Motorola-MVME5100"
596 select PPC_INDIRECT_PCI
594 597
595config PPLUS 598config PPLUS
596 bool "Motorola-PowerPlus" 599 bool "Motorola-PowerPlus"
600 select PPC_I8259
601 select PPC_INDIRECT_PCI
597 602
598config PRPMC750 603config PRPMC750
599 bool "Motorola-PrPMC750" 604 bool "Motorola-PrPMC750"
605 select PPC_INDIRECT_PCI
600 606
601config PRPMC800 607config PRPMC800
602 bool "Motorola-PrPMC800" 608 bool "Motorola-PrPMC800"
609 select PPC_INDIRECT_PCI
603 610
604config SANDPOINT 611config SANDPOINT
605 bool "Motorola-Sandpoint" 612 bool "Motorola-Sandpoint"
613 select PPC_I8259
606 help 614 help
607 Select SANDPOINT if configuring for a Motorola Sandpoint X3 615 Select SANDPOINT if configuring for a Motorola Sandpoint X3
608 (any flavor). 616 (any flavor).
609 617
610config RADSTONE_PPC7D 618config RADSTONE_PPC7D
611 bool "Radstone Technology PPC7D board" 619 bool "Radstone Technology PPC7D board"
620 select PPC_I8259
612 621
613config PAL4 622config PAL4
614 bool "SBS-Palomar4" 623 bool "SBS-Palomar4"
@@ -616,6 +625,7 @@ config PAL4
616config GEMINI 625config GEMINI
617 bool "Synergy-Gemini" 626 bool "Synergy-Gemini"
618 depends on BROKEN 627 depends on BROKEN
628 select PPC_INDIRECT_PCI
619 help 629 help
620 Select Gemini if configuring for a Synergy Microsystems' Gemini 630 Select Gemini if configuring for a Synergy Microsystems' Gemini
621 series Single Board Computer. More information is available at: 631 series Single Board Computer. More information is available at:
@@ -747,13 +757,16 @@ config CPM2
747 on it (826x, 827x, 8560). 757 on it (826x, 827x, 8560).
748 758
749config PPC_CHRP 759config PPC_CHRP
750 bool 760 bool " Common Hardware Reference Platform (CHRP) based machines"
751 depends on PPC_MULTIPLATFORM 761 depends on PPC_MULTIPLATFORM
762 select PPC_I8259
763 select PPC_INDIRECT_PCI
752 default y 764 default y
753 765
754config PPC_PMAC 766config PPC_PMAC
755 bool 767 bool " Apple PowerMac based machines"
756 depends on PPC_MULTIPLATFORM 768 depends on PPC_MULTIPLATFORM
769 select PPC_INDIRECT_PCI
757 default y 770 default y
758 771
759config PPC_PMAC64 772config PPC_PMAC64
@@ -762,8 +775,10 @@ config PPC_PMAC64
762 default y 775 default y
763 776
764config PPC_PREP 777config PPC_PREP
765 bool 778 bool " PowerPC Reference Platform (PReP) based machines"
766 depends on PPC_MULTIPLATFORM 779 depends on PPC_MULTIPLATFORM
780 select PPC_I8259
781 select PPC_INDIRECT_PCI
767 default y 782 default y
768 783
769config PPC_OF 784config PPC_OF
@@ -797,6 +812,7 @@ config MV64360 # Really MV64360 & MV64460
797config MV64X60 812config MV64X60
798 bool 813 bool
799 depends on (GT64260 || MV64360) 814 depends on (GT64260 || MV64360)
815 select PPC_INDIRECT_PCI
800 default y 816 default y
801 817
802menu "Set bridge options" 818menu "Set bridge options"
@@ -845,6 +861,7 @@ config EPIC_SERIAL_MODE
845config MPC10X_BRIDGE 861config MPC10X_BRIDGE
846 bool 862 bool
847 depends on POWERPMC250 || LOPEC || SANDPOINT 863 depends on POWERPMC250 || LOPEC || SANDPOINT
864 select PPC_INDIRECT_PCI
848 default y 865 default y
849 866
850config MPC10X_OPENPIC 867config MPC10X_OPENPIC
@@ -870,6 +887,7 @@ config HARRIER_STORE_GATHERING
870config MVME5100_IPMC761_PRESENT 887config MVME5100_IPMC761_PRESENT
871 bool "MVME5100 configured with an IPMC761" 888 bool "MVME5100 configured with an IPMC761"
872 depends on MVME5100 889 depends on MVME5100
890 select PPC_I8259
873 891
874config SPRUCE_BAUD_33M 892config SPRUCE_BAUD_33M
875 bool "Spruce baud clock support" 893 bool "Spruce baud clock support"
@@ -1127,6 +1145,7 @@ menu "Bus options"
1127config ISA 1145config ISA
1128 bool "Support for ISA-bus hardware" 1146 bool "Support for ISA-bus hardware"
1129 depends on PPC_PREP || PPC_CHRP 1147 depends on PPC_PREP || PPC_CHRP
1148 select PPC_I8259
1130 help 1149 help
1131 Find out whether you have ISA slots on your motherboard. ISA is the 1150 Find out whether you have ISA slots on your motherboard. ISA is the
1132 name of a bus system, i.e. the way the CPU talks to the other stuff 1151 name of a bus system, i.e. the way the CPU talks to the other stuff
@@ -1139,6 +1158,17 @@ config GENERIC_ISA_DMA
1139 depends on POWER3 || POWER4 || 6xx && !CPM2 1158 depends on POWER3 || POWER4 || 6xx && !CPM2
1140 default y 1159 default y
1141 1160
1161config PPC_I8259
1162 bool
1163 default y if 85xx
1164 default n
1165
1166config PPC_INDIRECT_PCI
1167 bool
1168 depends on PCI
1169 default y if 40x || 44x || 85xx || 83xx
1170 default n
1171
1142config EISA 1172config EISA
1143 bool 1173 bool
1144 help 1174 help
@@ -1175,6 +1205,7 @@ config MPC83xx_PCI2
1175config PCI_QSPAN 1205config PCI_QSPAN
1176 bool "QSpan PCI" 1206 bool "QSpan PCI"
1177 depends on !4xx && !CPM2 && 8xx 1207 depends on !4xx && !CPM2 && 8xx
1208 select PPC_I8259
1178 help 1209 help
1179 Say Y here if you have a system based on a Motorola 8xx-series 1210 Say Y here if you have a system based on a Motorola 8xx-series
1180 embedded processor with a QSPAN PCI interface, otherwise say N. 1211 embedded processor with a QSPAN PCI interface, otherwise say N.
@@ -1182,6 +1213,7 @@ config PCI_QSPAN
1182config PCI_8260 1213config PCI_8260
1183 bool 1214 bool
1184 depends on PCI && 8260 1215 depends on PCI && 8260
1216 select PPC_INDIRECT_PCI
1185 default y 1217 default y
1186 1218
1187config 8260_PCI9 1219config 8260_PCI9
@@ -1368,7 +1400,7 @@ endmenu
1368 1400
1369source "lib/Kconfig" 1401source "lib/Kconfig"
1370 1402
1371source "arch/ppc/oprofile/Kconfig" 1403source "arch/powerpc/oprofile/Kconfig"
1372 1404
1373source "arch/ppc/Kconfig.debug" 1405source "arch/ppc/Kconfig.debug"
1374 1406
diff --git a/arch/ppc/Makefile b/arch/ppc/Makefile
index 16e2675f3270..94d5716fa7c3 100644
--- a/arch/ppc/Makefile
+++ b/arch/ppc/Makefile
@@ -26,6 +26,10 @@ CPPFLAGS += -Iarch/$(ARCH) -Iarch/$(ARCH)/include
26AFLAGS += -Iarch/$(ARCH) 26AFLAGS += -Iarch/$(ARCH)
27CFLAGS += -Iarch/$(ARCH) -msoft-float -pipe \ 27CFLAGS += -Iarch/$(ARCH) -msoft-float -pipe \
28 -ffixed-r2 -mmultiple 28 -ffixed-r2 -mmultiple
29
30# No AltiVec instruction when building kernel
31CFLAGS += $(call cc-option, -mno-altivec)
32
29CPP = $(CC) -E $(CFLAGS) 33CPP = $(CC) -E $(CFLAGS)
30# Temporary hack until we have migrated to asm-powerpc 34# Temporary hack until we have migrated to asm-powerpc
31LINUXINCLUDE += -Iarch/$(ARCH)/include 35LINUXINCLUDE += -Iarch/$(ARCH)/include
@@ -57,10 +61,12 @@ head-$(CONFIG_FSL_BOOKE) := arch/ppc/kernel/head_fsl_booke.o
57 61
58head-$(CONFIG_6xx) += arch/ppc/kernel/idle_6xx.o 62head-$(CONFIG_6xx) += arch/ppc/kernel/idle_6xx.o
59head-$(CONFIG_POWER4) += arch/ppc/kernel/idle_power4.o 63head-$(CONFIG_POWER4) += arch/ppc/kernel/idle_power4.o
60head-$(CONFIG_PPC_FPU) += arch/ppc/kernel/fpu.o 64head-$(CONFIG_PPC_FPU) += arch/powerpc/kernel/fpu.o
61 65
62core-y += arch/ppc/kernel/ arch/ppc/platforms/ \ 66core-y += arch/ppc/kernel/ arch/powerpc/kernel/ \
63 arch/ppc/mm/ arch/ppc/lib/ arch/ppc/syslib/ 67 arch/ppc/platforms/ \
68 arch/ppc/mm/ arch/ppc/lib/ \
69 arch/ppc/syslib/ arch/powerpc/sysdev/
64core-$(CONFIG_4xx) += arch/ppc/platforms/4xx/ 70core-$(CONFIG_4xx) += arch/ppc/platforms/4xx/
65core-$(CONFIG_83xx) += arch/ppc/platforms/83xx/ 71core-$(CONFIG_83xx) += arch/ppc/platforms/83xx/
66core-$(CONFIG_85xx) += arch/ppc/platforms/85xx/ 72core-$(CONFIG_85xx) += arch/ppc/platforms/85xx/
@@ -71,7 +77,7 @@ drivers-$(CONFIG_8xx) += arch/ppc/8xx_io/
71drivers-$(CONFIG_4xx) += arch/ppc/4xx_io/ 77drivers-$(CONFIG_4xx) += arch/ppc/4xx_io/
72drivers-$(CONFIG_CPM2) += arch/ppc/8260_io/ 78drivers-$(CONFIG_CPM2) += arch/ppc/8260_io/
73 79
74drivers-$(CONFIG_OPROFILE) += arch/ppc/oprofile/ 80drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/
75 81
76BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm 82BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm
77 83
diff --git a/arch/ppc/boot/of1275/claim.c b/arch/ppc/boot/of1275/claim.c
index e060292ae2a7..13169a5c4339 100644
--- a/arch/ppc/boot/of1275/claim.c
+++ b/arch/ppc/boot/of1275/claim.c
@@ -29,6 +29,7 @@ claim(unsigned int virt, unsigned int size, unsigned int align)
29 args.virt = virt; 29 args.virt = virt;
30 args.size = size; 30 args.size = size;
31 args.align = align; 31 args.align = align;
32 args.ret = (void *) 0;
32 (*of_prom_entry)(&args); 33 (*of_prom_entry)(&args);
33 return args.ret; 34 return args.ret;
34} 35}
diff --git a/arch/ppc/boot/openfirmware/chrpmain.c b/arch/ppc/boot/openfirmware/chrpmain.c
index effe4a0624b0..245dbd9fc120 100644
--- a/arch/ppc/boot/openfirmware/chrpmain.c
+++ b/arch/ppc/boot/openfirmware/chrpmain.c
@@ -78,7 +78,7 @@ boot(int a1, int a2, void *prom)
78 begin_avail = avail_high = avail_ram; 78 begin_avail = avail_high = avail_ram;
79 end_avail = scratch + sizeof(scratch); 79 end_avail = scratch + sizeof(scratch);
80 printf("gunzipping (0x%p <- 0x%p:0x%p)...", dst, im, im+len); 80 printf("gunzipping (0x%p <- 0x%p:0x%p)...", dst, im, im+len);
81 gunzip(dst, 0x400000, im, &len); 81 gunzip(dst, PROG_SIZE - PROG_START, im, &len);
82 printf("done %u bytes\n\r", len); 82 printf("done %u bytes\n\r", len);
83 printf("%u bytes of heap consumed, max in use %u\n\r", 83 printf("%u bytes of heap consumed, max in use %u\n\r",
84 avail_high - begin_avail, heap_max); 84 avail_high - begin_avail, heap_max);
diff --git a/arch/ppc/boot/openfirmware/coffmain.c b/arch/ppc/boot/openfirmware/coffmain.c
index 04ba9d57e110..2da8855e2be0 100644
--- a/arch/ppc/boot/openfirmware/coffmain.c
+++ b/arch/ppc/boot/openfirmware/coffmain.c
@@ -38,7 +38,7 @@ static char heap[SCRATCH_SIZE];
38static unsigned long ram_start = 0; 38static unsigned long ram_start = 0;
39static unsigned long ram_end = 0x1000000; 39static unsigned long ram_end = 0x1000000;
40 40
41static unsigned long prog_start = 0x900000; 41static unsigned long prog_start = 0x800000;
42static unsigned long prog_size = 0x700000; 42static unsigned long prog_size = 0x700000;
43 43
44typedef void (*kernel_start_t)(int, int, void *); 44typedef void (*kernel_start_t)(int, int, void *);
diff --git a/arch/ppc/kernel/Makefile b/arch/ppc/kernel/Makefile
index b1457a8a9c0f..b35346df1e37 100644
--- a/arch/ppc/kernel/Makefile
+++ b/arch/ppc/kernel/Makefile
@@ -1,6 +1,7 @@
1# 1#
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4ifneq ($(CONFIG_PPC_MERGE),y)
4 5
5extra-$(CONFIG_PPC_STD_MMU) := head.o 6extra-$(CONFIG_PPC_STD_MMU) := head.o
6extra-$(CONFIG_40x) := head_4xx.o 7extra-$(CONFIG_40x) := head_4xx.o
@@ -9,13 +10,12 @@ extra-$(CONFIG_FSL_BOOKE) := head_fsl_booke.o
9extra-$(CONFIG_8xx) := head_8xx.o 10extra-$(CONFIG_8xx) := head_8xx.o
10extra-$(CONFIG_6xx) += idle_6xx.o 11extra-$(CONFIG_6xx) += idle_6xx.o
11extra-$(CONFIG_POWER4) += idle_power4.o 12extra-$(CONFIG_POWER4) += idle_power4.o
12extra-$(CONFIG_PPC_FPU) += fpu.o
13extra-y += vmlinux.lds 13extra-y += vmlinux.lds
14 14
15obj-y := entry.o traps.o irq.o idle.o time.o misc.o \ 15obj-y := entry.o traps.o irq.o idle.o time.o misc.o \
16 process.o signal.o ptrace.o align.o \ 16 process.o align.o \
17 semaphore.o syscalls.o setup.o \ 17 setup.o \
18 cputable.o ppc_htab.o perfmon.o 18 ppc_htab.o
19obj-$(CONFIG_6xx) += l2cr.o cpu_setup_6xx.o 19obj-$(CONFIG_6xx) += l2cr.o cpu_setup_6xx.o
20obj-$(CONFIG_SOFTWARE_SUSPEND) += swsusp.o 20obj-$(CONFIG_SOFTWARE_SUSPEND) += swsusp.o
21obj-$(CONFIG_POWER4) += cpu_setup_power4.o 21obj-$(CONFIG_POWER4) += cpu_setup_power4.o
@@ -25,7 +25,6 @@ obj-$(CONFIG_PCI) += pci.o
25obj-$(CONFIG_KGDB) += ppc-stub.o 25obj-$(CONFIG_KGDB) += ppc-stub.o
26obj-$(CONFIG_SMP) += smp.o smp-tbsync.o 26obj-$(CONFIG_SMP) += smp.o smp-tbsync.o
27obj-$(CONFIG_TAU) += temp.o 27obj-$(CONFIG_TAU) += temp.o
28obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o
29ifndef CONFIG_E200 28ifndef CONFIG_E200
30obj-$(CONFIG_FSL_BOOKE) += perfmon_fsl_booke.o 29obj-$(CONFIG_FSL_BOOKE) += perfmon_fsl_booke.o
31endif 30endif
@@ -35,3 +34,21 @@ ifndef CONFIG_MATH_EMULATION
35obj-$(CONFIG_8xx) += softemu8xx.o 34obj-$(CONFIG_8xx) += softemu8xx.o
36endif 35endif
37 36
37# These are here while we do the architecture merge
38
39else
40obj-y := irq.o idle.o \
41 align.o
42obj-$(CONFIG_6xx) += l2cr.o cpu_setup_6xx.o
43obj-$(CONFIG_SOFTWARE_SUSPEND) += swsusp.o
44obj-$(CONFIG_MODULES) += module.o
45obj-$(CONFIG_NOT_COHERENT_CACHE) += dma-mapping.o
46obj-$(CONFIG_PCI) += pci.o
47obj-$(CONFIG_KGDB) += ppc-stub.o
48obj-$(CONFIG_SMP) += smp.o smp-tbsync.o
49obj-$(CONFIG_TAU) += temp.o
50ifndef CONFIG_E200
51obj-$(CONFIG_FSL_BOOKE) += perfmon_fsl_booke.o
52endif
53obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
54endif
diff --git a/arch/ppc/kernel/align.c b/arch/ppc/kernel/align.c
index ff81da9598d8..ab398c4b70b6 100644
--- a/arch/ppc/kernel/align.c
+++ b/arch/ppc/kernel/align.c
@@ -375,7 +375,7 @@ fix_alignment(struct pt_regs *regs)
375#ifdef CONFIG_PPC_FPU 375#ifdef CONFIG_PPC_FPU
376 preempt_disable(); 376 preempt_disable();
377 enable_kernel_fp(); 377 enable_kernel_fp();
378 cvt_fd(&data.f, &data.d, &current->thread.fpscr); 378 cvt_fd(&data.f, &data.d, &current->thread);
379 preempt_enable(); 379 preempt_enable();
380#else 380#else
381 return 0; 381 return 0;
@@ -385,7 +385,7 @@ fix_alignment(struct pt_regs *regs)
385#ifdef CONFIG_PPC_FPU 385#ifdef CONFIG_PPC_FPU
386 preempt_disable(); 386 preempt_disable();
387 enable_kernel_fp(); 387 enable_kernel_fp();
388 cvt_df(&data.d, &data.f, &current->thread.fpscr); 388 cvt_df(&data.d, &data.f, &current->thread);
389 preempt_enable(); 389 preempt_enable();
390#else 390#else
391 return 0; 391 return 0;
diff --git a/arch/ppc/kernel/asm-offsets.c b/arch/ppc/kernel/asm-offsets.c
index d9ad1d776d0e..968261d69572 100644
--- a/arch/ppc/kernel/asm-offsets.c
+++ b/arch/ppc/kernel/asm-offsets.c
@@ -130,10 +130,10 @@ main(void)
130 DEFINE(CPU_SPEC_FEATURES, offsetof(struct cpu_spec, cpu_features)); 130 DEFINE(CPU_SPEC_FEATURES, offsetof(struct cpu_spec, cpu_features));
131 DEFINE(CPU_SPEC_SETUP, offsetof(struct cpu_spec, cpu_setup)); 131 DEFINE(CPU_SPEC_SETUP, offsetof(struct cpu_spec, cpu_setup));
132 132
133 DEFINE(TI_SC_NOERR, offsetof(struct thread_info, syscall_noerror));
133 DEFINE(TI_TASK, offsetof(struct thread_info, task)); 134 DEFINE(TI_TASK, offsetof(struct thread_info, task));
134 DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain)); 135 DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain));
135 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); 136 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
136 DEFINE(TI_LOCAL_FLAGS, offsetof(struct thread_info, local_flags));
137 DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); 137 DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
138 DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); 138 DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
139 139
@@ -141,6 +141,7 @@ main(void)
141 DEFINE(pbe_orig_address, offsetof(struct pbe, orig_address)); 141 DEFINE(pbe_orig_address, offsetof(struct pbe, orig_address));
142 DEFINE(pbe_next, offsetof(struct pbe, next)); 142 DEFINE(pbe_next, offsetof(struct pbe, next));
143 143
144 DEFINE(TASK_SIZE, TASK_SIZE);
144 DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28); 145 DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28);
145 return 0; 146 return 0;
146} 147}
diff --git a/arch/ppc/kernel/cpu_setup_6xx.S b/arch/ppc/kernel/cpu_setup_6xx.S
index ba396438ede3..55ed7716636f 100644
--- a/arch/ppc/kernel/cpu_setup_6xx.S
+++ b/arch/ppc/kernel/cpu_setup_6xx.S
@@ -17,8 +17,6 @@
17#include <asm/asm-offsets.h> 17#include <asm/asm-offsets.h>
18#include <asm/cache.h> 18#include <asm/cache.h>
19 19
20_GLOBAL(__setup_cpu_601)
21 blr
22_GLOBAL(__setup_cpu_603) 20_GLOBAL(__setup_cpu_603)
23 b setup_common_caches 21 b setup_common_caches
24_GLOBAL(__setup_cpu_604) 22_GLOBAL(__setup_cpu_604)
@@ -292,10 +290,10 @@ _GLOBAL(__init_fpu_registers)
292#define CS_SIZE 32 290#define CS_SIZE 32
293 291
294 .data 292 .data
295 .balign L1_CACHE_LINE_SIZE 293 .balign L1_CACHE_BYTES
296cpu_state_storage: 294cpu_state_storage:
297 .space CS_SIZE 295 .space CS_SIZE
298 .balign L1_CACHE_LINE_SIZE,0 296 .balign L1_CACHE_BYTES,0
299 .text 297 .text
300 298
301/* Called in normal context to backup CPU 0 state. This 299/* Called in normal context to backup CPU 0 state. This
diff --git a/arch/ppc/kernel/cpu_setup_power4.S b/arch/ppc/kernel/cpu_setup_power4.S
index 7e4fbb653724..d7bfd60e21fc 100644
--- a/arch/ppc/kernel/cpu_setup_power4.S
+++ b/arch/ppc/kernel/cpu_setup_power4.S
@@ -63,8 +63,6 @@ _GLOBAL(__970_cpu_preinit)
63 isync 63 isync
64 blr 64 blr
65 65
66_GLOBAL(__setup_cpu_power4)
67 blr
68_GLOBAL(__setup_cpu_ppc970) 66_GLOBAL(__setup_cpu_ppc970)
69 mfspr r0,SPRN_HID0 67 mfspr r0,SPRN_HID0
70 li r11,5 /* clear DOZE and SLEEP */ 68 li r11,5 /* clear DOZE and SLEEP */
@@ -88,10 +86,10 @@ _GLOBAL(__setup_cpu_ppc970)
88#define CS_SIZE 32 86#define CS_SIZE 32
89 87
90 .data 88 .data
91 .balign L1_CACHE_LINE_SIZE 89 .balign L1_CACHE_BYTES
92cpu_state_storage: 90cpu_state_storage:
93 .space CS_SIZE 91 .space CS_SIZE
94 .balign L1_CACHE_LINE_SIZE,0 92 .balign L1_CACHE_BYTES,0
95 .text 93 .text
96 94
97/* Called in normal context to backup CPU 0 state. This 95/* Called in normal context to backup CPU 0 state. This
diff --git a/arch/ppc/kernel/dma-mapping.c b/arch/ppc/kernel/dma-mapping.c
index 0f710d2baec6..685fd0defe23 100644
--- a/arch/ppc/kernel/dma-mapping.c
+++ b/arch/ppc/kernel/dma-mapping.c
@@ -335,8 +335,6 @@ static int __init dma_alloc_init(void)
335 pte_t *pte; 335 pte_t *pte;
336 int ret = 0; 336 int ret = 0;
337 337
338 spin_lock(&init_mm.page_table_lock);
339
340 do { 338 do {
341 pgd = pgd_offset(&init_mm, CONSISTENT_BASE); 339 pgd = pgd_offset(&init_mm, CONSISTENT_BASE);
342 pmd = pmd_alloc(&init_mm, pgd, CONSISTENT_BASE); 340 pmd = pmd_alloc(&init_mm, pgd, CONSISTENT_BASE);
@@ -347,7 +345,7 @@ static int __init dma_alloc_init(void)
347 } 345 }
348 WARN_ON(!pmd_none(*pmd)); 346 WARN_ON(!pmd_none(*pmd));
349 347
350 pte = pte_alloc_kernel(&init_mm, pmd, CONSISTENT_BASE); 348 pte = pte_alloc_kernel(pmd, CONSISTENT_BASE);
351 if (!pte) { 349 if (!pte) {
352 printk(KERN_ERR "%s: no pte tables\n", __func__); 350 printk(KERN_ERR "%s: no pte tables\n", __func__);
353 ret = -ENOMEM; 351 ret = -ENOMEM;
@@ -357,8 +355,6 @@ static int __init dma_alloc_init(void)
357 consistent_pte = pte; 355 consistent_pte = pte;
358 } while (0); 356 } while (0);
359 357
360 spin_unlock(&init_mm.page_table_lock);
361
362 return ret; 358 return ret;
363} 359}
364 360
diff --git a/arch/ppc/kernel/entry.S b/arch/ppc/kernel/entry.S
index 03d4886869f3..f044edbb454f 100644
--- a/arch/ppc/kernel/entry.S
+++ b/arch/ppc/kernel/entry.S
@@ -200,9 +200,8 @@ _GLOBAL(DoSyscall)
200 bl do_show_syscall 200 bl do_show_syscall
201#endif /* SHOW_SYSCALLS */ 201#endif /* SHOW_SYSCALLS */
202 rlwinm r10,r1,0,0,18 /* current_thread_info() */ 202 rlwinm r10,r1,0,0,18 /* current_thread_info() */
203 lwz r11,TI_LOCAL_FLAGS(r10) 203 li r11,0
204 rlwinm r11,r11,0,~_TIFL_FORCE_NOERROR 204 stb r11,TI_SC_NOERR(r10)
205 stw r11,TI_LOCAL_FLAGS(r10)
206 lwz r11,TI_FLAGS(r10) 205 lwz r11,TI_FLAGS(r10)
207 andi. r11,r11,_TIF_SYSCALL_T_OR_A 206 andi. r11,r11,_TIF_SYSCALL_T_OR_A
208 bne- syscall_dotrace 207 bne- syscall_dotrace
@@ -227,8 +226,8 @@ ret_from_syscall:
227 cmplw 0,r3,r11 226 cmplw 0,r3,r11
228 rlwinm r12,r1,0,0,18 /* current_thread_info() */ 227 rlwinm r12,r1,0,0,18 /* current_thread_info() */
229 blt+ 30f 228 blt+ 30f
230 lwz r11,TI_LOCAL_FLAGS(r12) 229 lbz r11,TI_SC_NOERR(r12)
231 andi. r11,r11,_TIFL_FORCE_NOERROR 230 cmpwi r11,0
232 bne 30f 231 bne 30f
233 neg r3,r3 232 neg r3,r3
234 lwz r10,_CCR(r1) /* Set SO bit in CR */ 233 lwz r10,_CCR(r1) /* Set SO bit in CR */
@@ -633,7 +632,8 @@ sigreturn_exit:
633 rlwinm r12,r1,0,0,18 /* current_thread_info() */ 632 rlwinm r12,r1,0,0,18 /* current_thread_info() */
634 lwz r9,TI_FLAGS(r12) 633 lwz r9,TI_FLAGS(r12)
635 andi. r0,r9,_TIF_SYSCALL_T_OR_A 634 andi. r0,r9,_TIF_SYSCALL_T_OR_A
636 bnel- do_syscall_trace_leave 635 beq+ ret_from_except_full
636 bl do_syscall_trace_leave
637 /* fall through */ 637 /* fall through */
638 638
639 .globl ret_from_except_full 639 .globl ret_from_except_full
diff --git a/arch/ppc/kernel/head.S b/arch/ppc/kernel/head.S
index 1960fb8c259c..c5a890dca9cf 100644
--- a/arch/ppc/kernel/head.S
+++ b/arch/ppc/kernel/head.S
@@ -349,12 +349,12 @@ i##n: \
349 349
350/* System reset */ 350/* System reset */
351/* core99 pmac starts the seconary here by changing the vector, and 351/* core99 pmac starts the seconary here by changing the vector, and
352 putting it back to what it was (UnknownException) when done. */ 352 putting it back to what it was (unknown_exception) when done. */
353#if defined(CONFIG_GEMINI) && defined(CONFIG_SMP) 353#if defined(CONFIG_GEMINI) && defined(CONFIG_SMP)
354 . = 0x100 354 . = 0x100
355 b __secondary_start_gemini 355 b __secondary_start_gemini
356#else 356#else
357 EXCEPTION(0x100, Reset, UnknownException, EXC_XFER_STD) 357 EXCEPTION(0x100, Reset, unknown_exception, EXC_XFER_STD)
358#endif 358#endif
359 359
360/* Machine check */ 360/* Machine check */
@@ -389,7 +389,7 @@ i##n: \
389 cmpwi cr1,r4,0 389 cmpwi cr1,r4,0
390 bne cr1,1f 390 bne cr1,1f
391#endif 391#endif
392 EXC_XFER_STD(0x200, MachineCheckException) 392 EXC_XFER_STD(0x200, machine_check_exception)
393#ifdef CONFIG_PPC_CHRP 393#ifdef CONFIG_PPC_CHRP
3941: b machine_check_in_rtas 3941: b machine_check_in_rtas
395#endif 395#endif
@@ -456,10 +456,10 @@ Alignment:
456 mfspr r5,SPRN_DSISR 456 mfspr r5,SPRN_DSISR
457 stw r5,_DSISR(r11) 457 stw r5,_DSISR(r11)
458 addi r3,r1,STACK_FRAME_OVERHEAD 458 addi r3,r1,STACK_FRAME_OVERHEAD
459 EXC_XFER_EE(0x600, AlignmentException) 459 EXC_XFER_EE(0x600, alignment_exception)
460 460
461/* Program check exception */ 461/* Program check exception */
462 EXCEPTION(0x700, ProgramCheck, ProgramCheckException, EXC_XFER_STD) 462 EXCEPTION(0x700, ProgramCheck, program_check_exception, EXC_XFER_STD)
463 463
464/* Floating-point unavailable */ 464/* Floating-point unavailable */
465 . = 0x800 465 . = 0x800
@@ -467,13 +467,13 @@ FPUnavailable:
467 EXCEPTION_PROLOG 467 EXCEPTION_PROLOG
468 bne load_up_fpu /* if from user, just load it up */ 468 bne load_up_fpu /* if from user, just load it up */
469 addi r3,r1,STACK_FRAME_OVERHEAD 469 addi r3,r1,STACK_FRAME_OVERHEAD
470 EXC_XFER_EE_LITE(0x800, KernelFP) 470 EXC_XFER_EE_LITE(0x800, kernel_fp_unavailable_exception)
471 471
472/* Decrementer */ 472/* Decrementer */
473 EXCEPTION(0x900, Decrementer, timer_interrupt, EXC_XFER_LITE) 473 EXCEPTION(0x900, Decrementer, timer_interrupt, EXC_XFER_LITE)
474 474
475 EXCEPTION(0xa00, Trap_0a, UnknownException, EXC_XFER_EE) 475 EXCEPTION(0xa00, Trap_0a, unknown_exception, EXC_XFER_EE)
476 EXCEPTION(0xb00, Trap_0b, UnknownException, EXC_XFER_EE) 476 EXCEPTION(0xb00, Trap_0b, unknown_exception, EXC_XFER_EE)
477 477
478/* System call */ 478/* System call */
479 . = 0xc00 479 . = 0xc00
@@ -482,8 +482,8 @@ SystemCall:
482 EXC_XFER_EE_LITE(0xc00, DoSyscall) 482 EXC_XFER_EE_LITE(0xc00, DoSyscall)
483 483
484/* Single step - not used on 601 */ 484/* Single step - not used on 601 */
485 EXCEPTION(0xd00, SingleStep, SingleStepException, EXC_XFER_STD) 485 EXCEPTION(0xd00, SingleStep, single_step_exception, EXC_XFER_STD)
486 EXCEPTION(0xe00, Trap_0e, UnknownException, EXC_XFER_EE) 486 EXCEPTION(0xe00, Trap_0e, unknown_exception, EXC_XFER_EE)
487 487
488/* 488/*
489 * The Altivec unavailable trap is at 0x0f20. Foo. 489 * The Altivec unavailable trap is at 0x0f20. Foo.
@@ -502,7 +502,7 @@ SystemCall:
502Trap_0f: 502Trap_0f:
503 EXCEPTION_PROLOG 503 EXCEPTION_PROLOG
504 addi r3,r1,STACK_FRAME_OVERHEAD 504 addi r3,r1,STACK_FRAME_OVERHEAD
505 EXC_XFER_EE(0xf00, UnknownException) 505 EXC_XFER_EE(0xf00, unknown_exception)
506 506
507/* 507/*
508 * Handle TLB miss for instruction on 603/603e. 508 * Handle TLB miss for instruction on 603/603e.
@@ -702,44 +702,44 @@ DataStoreTLBMiss:
702 rfi 702 rfi
703 703
704#ifndef CONFIG_ALTIVEC 704#ifndef CONFIG_ALTIVEC
705#define AltivecAssistException UnknownException 705#define altivec_assist_exception unknown_exception
706#endif 706#endif
707 707
708 EXCEPTION(0x1300, Trap_13, InstructionBreakpoint, EXC_XFER_EE) 708 EXCEPTION(0x1300, Trap_13, instruction_breakpoint_exception, EXC_XFER_EE)
709 EXCEPTION(0x1400, SMI, SMIException, EXC_XFER_EE) 709 EXCEPTION(0x1400, SMI, SMIException, EXC_XFER_EE)
710 EXCEPTION(0x1500, Trap_15, UnknownException, EXC_XFER_EE) 710 EXCEPTION(0x1500, Trap_15, unknown_exception, EXC_XFER_EE)
711#ifdef CONFIG_POWER4 711#ifdef CONFIG_POWER4
712 EXCEPTION(0x1600, Trap_16, UnknownException, EXC_XFER_EE) 712 EXCEPTION(0x1600, Trap_16, unknown_exception, EXC_XFER_EE)
713 EXCEPTION(0x1700, Trap_17, AltivecAssistException, EXC_XFER_EE) 713 EXCEPTION(0x1700, Trap_17, altivec_assist_exception, EXC_XFER_EE)
714 EXCEPTION(0x1800, Trap_18, TAUException, EXC_XFER_STD) 714 EXCEPTION(0x1800, Trap_18, TAUException, EXC_XFER_STD)
715#else /* !CONFIG_POWER4 */ 715#else /* !CONFIG_POWER4 */
716 EXCEPTION(0x1600, Trap_16, AltivecAssistException, EXC_XFER_EE) 716 EXCEPTION(0x1600, Trap_16, altivec_assist_exception, EXC_XFER_EE)
717 EXCEPTION(0x1700, Trap_17, TAUException, EXC_XFER_STD) 717 EXCEPTION(0x1700, Trap_17, TAUException, EXC_XFER_STD)
718 EXCEPTION(0x1800, Trap_18, UnknownException, EXC_XFER_EE) 718 EXCEPTION(0x1800, Trap_18, unknown_exception, EXC_XFER_EE)
719#endif /* CONFIG_POWER4 */ 719#endif /* CONFIG_POWER4 */
720 EXCEPTION(0x1900, Trap_19, UnknownException, EXC_XFER_EE) 720 EXCEPTION(0x1900, Trap_19, unknown_exception, EXC_XFER_EE)
721 EXCEPTION(0x1a00, Trap_1a, UnknownException, EXC_XFER_EE) 721 EXCEPTION(0x1a00, Trap_1a, unknown_exception, EXC_XFER_EE)
722 EXCEPTION(0x1b00, Trap_1b, UnknownException, EXC_XFER_EE) 722 EXCEPTION(0x1b00, Trap_1b, unknown_exception, EXC_XFER_EE)
723 EXCEPTION(0x1c00, Trap_1c, UnknownException, EXC_XFER_EE) 723 EXCEPTION(0x1c00, Trap_1c, unknown_exception, EXC_XFER_EE)
724 EXCEPTION(0x1d00, Trap_1d, UnknownException, EXC_XFER_EE) 724 EXCEPTION(0x1d00, Trap_1d, unknown_exception, EXC_XFER_EE)
725 EXCEPTION(0x1e00, Trap_1e, UnknownException, EXC_XFER_EE) 725 EXCEPTION(0x1e00, Trap_1e, unknown_exception, EXC_XFER_EE)
726 EXCEPTION(0x1f00, Trap_1f, UnknownException, EXC_XFER_EE) 726 EXCEPTION(0x1f00, Trap_1f, unknown_exception, EXC_XFER_EE)
727 EXCEPTION(0x2000, RunMode, RunModeException, EXC_XFER_EE) 727 EXCEPTION(0x2000, RunMode, RunModeException, EXC_XFER_EE)
728 EXCEPTION(0x2100, Trap_21, UnknownException, EXC_XFER_EE) 728 EXCEPTION(0x2100, Trap_21, unknown_exception, EXC_XFER_EE)
729 EXCEPTION(0x2200, Trap_22, UnknownException, EXC_XFER_EE) 729 EXCEPTION(0x2200, Trap_22, unknown_exception, EXC_XFER_EE)
730 EXCEPTION(0x2300, Trap_23, UnknownException, EXC_XFER_EE) 730 EXCEPTION(0x2300, Trap_23, unknown_exception, EXC_XFER_EE)
731 EXCEPTION(0x2400, Trap_24, UnknownException, EXC_XFER_EE) 731 EXCEPTION(0x2400, Trap_24, unknown_exception, EXC_XFER_EE)
732 EXCEPTION(0x2500, Trap_25, UnknownException, EXC_XFER_EE) 732 EXCEPTION(0x2500, Trap_25, unknown_exception, EXC_XFER_EE)
733 EXCEPTION(0x2600, Trap_26, UnknownException, EXC_XFER_EE) 733 EXCEPTION(0x2600, Trap_26, unknown_exception, EXC_XFER_EE)
734 EXCEPTION(0x2700, Trap_27, UnknownException, EXC_XFER_EE) 734 EXCEPTION(0x2700, Trap_27, unknown_exception, EXC_XFER_EE)
735 EXCEPTION(0x2800, Trap_28, UnknownException, EXC_XFER_EE) 735 EXCEPTION(0x2800, Trap_28, unknown_exception, EXC_XFER_EE)
736 EXCEPTION(0x2900, Trap_29, UnknownException, EXC_XFER_EE) 736 EXCEPTION(0x2900, Trap_29, unknown_exception, EXC_XFER_EE)
737 EXCEPTION(0x2a00, Trap_2a, UnknownException, EXC_XFER_EE) 737 EXCEPTION(0x2a00, Trap_2a, unknown_exception, EXC_XFER_EE)
738 EXCEPTION(0x2b00, Trap_2b, UnknownException, EXC_XFER_EE) 738 EXCEPTION(0x2b00, Trap_2b, unknown_exception, EXC_XFER_EE)
739 EXCEPTION(0x2c00, Trap_2c, UnknownException, EXC_XFER_EE) 739 EXCEPTION(0x2c00, Trap_2c, unknown_exception, EXC_XFER_EE)
740 EXCEPTION(0x2d00, Trap_2d, UnknownException, EXC_XFER_EE) 740 EXCEPTION(0x2d00, Trap_2d, unknown_exception, EXC_XFER_EE)
741 EXCEPTION(0x2e00, Trap_2e, UnknownException, EXC_XFER_EE) 741 EXCEPTION(0x2e00, Trap_2e, unknown_exception, EXC_XFER_EE)
742 EXCEPTION(0x2f00, MOLTrampoline, UnknownException, EXC_XFER_EE_LITE) 742 EXCEPTION(0x2f00, MOLTrampoline, unknown_exception, EXC_XFER_EE_LITE)
743 743
744 .globl mol_trampoline 744 .globl mol_trampoline
745 .set mol_trampoline, i0x2f00 745 .set mol_trampoline, i0x2f00
@@ -751,7 +751,7 @@ AltiVecUnavailable:
751#ifdef CONFIG_ALTIVEC 751#ifdef CONFIG_ALTIVEC
752 bne load_up_altivec /* if from user, just load it up */ 752 bne load_up_altivec /* if from user, just load it up */
753#endif /* CONFIG_ALTIVEC */ 753#endif /* CONFIG_ALTIVEC */
754 EXC_XFER_EE_LITE(0xf20, AltivecUnavailException) 754 EXC_XFER_EE_LITE(0xf20, altivec_unavailable_exception)
755 755
756#ifdef CONFIG_PPC64BRIDGE 756#ifdef CONFIG_PPC64BRIDGE
757DataAccess: 757DataAccess:
@@ -767,12 +767,12 @@ DataSegment:
767 addi r3,r1,STACK_FRAME_OVERHEAD 767 addi r3,r1,STACK_FRAME_OVERHEAD
768 mfspr r4,SPRN_DAR 768 mfspr r4,SPRN_DAR
769 stw r4,_DAR(r11) 769 stw r4,_DAR(r11)
770 EXC_XFER_STD(0x380, UnknownException) 770 EXC_XFER_STD(0x380, unknown_exception)
771 771
772InstructionSegment: 772InstructionSegment:
773 EXCEPTION_PROLOG 773 EXCEPTION_PROLOG
774 addi r3,r1,STACK_FRAME_OVERHEAD 774 addi r3,r1,STACK_FRAME_OVERHEAD
775 EXC_XFER_STD(0x480, UnknownException) 775 EXC_XFER_STD(0x480, unknown_exception)
776#endif /* CONFIG_PPC64BRIDGE */ 776#endif /* CONFIG_PPC64BRIDGE */
777 777
778#ifdef CONFIG_ALTIVEC 778#ifdef CONFIG_ALTIVEC
@@ -804,7 +804,7 @@ load_up_altivec:
804 beq 1f 804 beq 1f
805 add r4,r4,r6 805 add r4,r4,r6
806 addi r4,r4,THREAD /* want THREAD of last_task_used_altivec */ 806 addi r4,r4,THREAD /* want THREAD of last_task_used_altivec */
807 SAVE_32VR(0,r10,r4) 807 SAVE_32VRS(0,r10,r4)
808 mfvscr vr0 808 mfvscr vr0
809 li r10,THREAD_VSCR 809 li r10,THREAD_VSCR
810 stvx vr0,r10,r4 810 stvx vr0,r10,r4
@@ -824,7 +824,7 @@ load_up_altivec:
824 stw r4,THREAD_USED_VR(r5) 824 stw r4,THREAD_USED_VR(r5)
825 lvx vr0,r10,r5 825 lvx vr0,r10,r5
826 mtvscr vr0 826 mtvscr vr0
827 REST_32VR(0,r10,r5) 827 REST_32VRS(0,r10,r5)
828#ifndef CONFIG_SMP 828#ifndef CONFIG_SMP
829 subi r4,r5,THREAD 829 subi r4,r5,THREAD
830 sub r4,r4,r6 830 sub r4,r4,r6
@@ -870,7 +870,7 @@ giveup_altivec:
870 addi r3,r3,THREAD /* want THREAD of task */ 870 addi r3,r3,THREAD /* want THREAD of task */
871 lwz r5,PT_REGS(r3) 871 lwz r5,PT_REGS(r3)
872 cmpwi 0,r5,0 872 cmpwi 0,r5,0
873 SAVE_32VR(0, r4, r3) 873 SAVE_32VRS(0, r4, r3)
874 mfvscr vr0 874 mfvscr vr0
875 li r4,THREAD_VSCR 875 li r4,THREAD_VSCR
876 stvx vr0,r4,r3 876 stvx vr0,r4,r3
@@ -916,7 +916,7 @@ relocate_kernel:
916copy_and_flush: 916copy_and_flush:
917 addi r5,r5,-4 917 addi r5,r5,-4
918 addi r6,r6,-4 918 addi r6,r6,-4
9194: li r0,L1_CACHE_LINE_SIZE/4 9194: li r0,L1_CACHE_BYTES/4
920 mtctr r0 920 mtctr r0
9213: addi r6,r6,4 /* copy a cache line */ 9213: addi r6,r6,4 /* copy a cache line */
922 lwzx r0,r6,r4 922 lwzx r0,r6,r4
@@ -1059,7 +1059,6 @@ __secondary_start:
1059 1059
1060 lis r3,-KERNELBASE@h 1060 lis r3,-KERNELBASE@h
1061 mr r4,r24 1061 mr r4,r24
1062 bl identify_cpu
1063 bl call_setup_cpu /* Call setup_cpu for this CPU */ 1062 bl call_setup_cpu /* Call setup_cpu for this CPU */
1064#ifdef CONFIG_6xx 1063#ifdef CONFIG_6xx
1065 lis r3,-KERNELBASE@h 1064 lis r3,-KERNELBASE@h
@@ -1109,11 +1108,6 @@ __secondary_start:
1109 * Those generic dummy functions are kept for CPUs not 1108 * Those generic dummy functions are kept for CPUs not
1110 * included in CONFIG_6xx 1109 * included in CONFIG_6xx
1111 */ 1110 */
1112_GLOBAL(__setup_cpu_power3)
1113 blr
1114_GLOBAL(__setup_cpu_generic)
1115 blr
1116
1117#if !defined(CONFIG_6xx) && !defined(CONFIG_POWER4) 1111#if !defined(CONFIG_6xx) && !defined(CONFIG_POWER4)
1118_GLOBAL(__save_cpu_setup) 1112_GLOBAL(__save_cpu_setup)
1119 blr 1113 blr
diff --git a/arch/ppc/kernel/head_44x.S b/arch/ppc/kernel/head_44x.S
index 599245b0407e..8b49679fad54 100644
--- a/arch/ppc/kernel/head_44x.S
+++ b/arch/ppc/kernel/head_44x.S
@@ -309,13 +309,13 @@ skpinv: addi r4,r4,1 /* Increment */
309 309
310interrupt_base: 310interrupt_base:
311 /* Critical Input Interrupt */ 311 /* Critical Input Interrupt */
312 CRITICAL_EXCEPTION(0x0100, CriticalInput, UnknownException) 312 CRITICAL_EXCEPTION(0x0100, CriticalInput, unknown_exception)
313 313
314 /* Machine Check Interrupt */ 314 /* Machine Check Interrupt */
315#ifdef CONFIG_440A 315#ifdef CONFIG_440A
316 MCHECK_EXCEPTION(0x0200, MachineCheck, MachineCheckException) 316 MCHECK_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
317#else 317#else
318 CRITICAL_EXCEPTION(0x0200, MachineCheck, MachineCheckException) 318 CRITICAL_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
319#endif 319#endif
320 320
321 /* Data Storage Interrupt */ 321 /* Data Storage Interrupt */
@@ -442,7 +442,7 @@ interrupt_base:
442#ifdef CONFIG_PPC_FPU 442#ifdef CONFIG_PPC_FPU
443 FP_UNAVAILABLE_EXCEPTION 443 FP_UNAVAILABLE_EXCEPTION
444#else 444#else
445 EXCEPTION(0x2010, FloatingPointUnavailable, UnknownException, EXC_XFER_EE) 445 EXCEPTION(0x2010, FloatingPointUnavailable, unknown_exception, EXC_XFER_EE)
446#endif 446#endif
447 447
448 /* System Call Interrupt */ 448 /* System Call Interrupt */
@@ -451,21 +451,21 @@ interrupt_base:
451 EXC_XFER_EE_LITE(0x0c00, DoSyscall) 451 EXC_XFER_EE_LITE(0x0c00, DoSyscall)
452 452
453 /* Auxillary Processor Unavailable Interrupt */ 453 /* Auxillary Processor Unavailable Interrupt */
454 EXCEPTION(0x2020, AuxillaryProcessorUnavailable, UnknownException, EXC_XFER_EE) 454 EXCEPTION(0x2020, AuxillaryProcessorUnavailable, unknown_exception, EXC_XFER_EE)
455 455
456 /* Decrementer Interrupt */ 456 /* Decrementer Interrupt */
457 DECREMENTER_EXCEPTION 457 DECREMENTER_EXCEPTION
458 458
459 /* Fixed Internal Timer Interrupt */ 459 /* Fixed Internal Timer Interrupt */
460 /* TODO: Add FIT support */ 460 /* TODO: Add FIT support */
461 EXCEPTION(0x1010, FixedIntervalTimer, UnknownException, EXC_XFER_EE) 461 EXCEPTION(0x1010, FixedIntervalTimer, unknown_exception, EXC_XFER_EE)
462 462
463 /* Watchdog Timer Interrupt */ 463 /* Watchdog Timer Interrupt */
464 /* TODO: Add watchdog support */ 464 /* TODO: Add watchdog support */
465#ifdef CONFIG_BOOKE_WDT 465#ifdef CONFIG_BOOKE_WDT
466 CRITICAL_EXCEPTION(0x1020, WatchdogTimer, WatchdogException) 466 CRITICAL_EXCEPTION(0x1020, WatchdogTimer, WatchdogException)
467#else 467#else
468 CRITICAL_EXCEPTION(0x1020, WatchdogTimer, UnknownException) 468 CRITICAL_EXCEPTION(0x1020, WatchdogTimer, unknown_exception)
469#endif 469#endif
470 470
471 /* Data TLB Error Interrupt */ 471 /* Data TLB Error Interrupt */
@@ -743,14 +743,18 @@ _GLOBAL(set_context)
743 * goes at the beginning of the data segment, which is page-aligned. 743 * goes at the beginning of the data segment, which is page-aligned.
744 */ 744 */
745 .data 745 .data
746_GLOBAL(sdata) 746 .align 12
747_GLOBAL(empty_zero_page) 747 .globl sdata
748sdata:
749 .globl empty_zero_page
750empty_zero_page:
748 .space 4096 751 .space 4096
749 752
750/* 753/*
751 * To support >32-bit physical addresses, we use an 8KB pgdir. 754 * To support >32-bit physical addresses, we use an 8KB pgdir.
752 */ 755 */
753_GLOBAL(swapper_pg_dir) 756 .globl swapper_pg_dir
757swapper_pg_dir:
754 .space 8192 758 .space 8192
755 759
756/* Reserved 4k for the critical exception stack & 4k for the machine 760/* Reserved 4k for the critical exception stack & 4k for the machine
@@ -759,13 +763,15 @@ _GLOBAL(swapper_pg_dir)
759 .align 12 763 .align 12
760exception_stack_bottom: 764exception_stack_bottom:
761 .space BOOKE_EXCEPTION_STACK_SIZE 765 .space BOOKE_EXCEPTION_STACK_SIZE
762_GLOBAL(exception_stack_top) 766 .globl exception_stack_top
767exception_stack_top:
763 768
764/* 769/*
765 * This space gets a copy of optional info passed to us by the bootstrap 770 * This space gets a copy of optional info passed to us by the bootstrap
766 * which is used to pass parameters into the kernel like root=/dev/sda1, etc. 771 * which is used to pass parameters into the kernel like root=/dev/sda1, etc.
767 */ 772 */
768_GLOBAL(cmd_line) 773 .globl cmd_line
774cmd_line:
769 .space 512 775 .space 512
770 776
771/* 777/*
@@ -774,5 +780,3 @@ _GLOBAL(cmd_line)
774 */ 780 */
775abatron_pteptrs: 781abatron_pteptrs:
776 .space 8 782 .space 8
777
778
diff --git a/arch/ppc/kernel/head_4xx.S b/arch/ppc/kernel/head_4xx.S
index 8562b807b37c..10c261c67021 100644
--- a/arch/ppc/kernel/head_4xx.S
+++ b/arch/ppc/kernel/head_4xx.S
@@ -245,12 +245,12 @@ label:
245/* 245/*
246 * 0x0100 - Critical Interrupt Exception 246 * 0x0100 - Critical Interrupt Exception
247 */ 247 */
248 CRITICAL_EXCEPTION(0x0100, CriticalInterrupt, UnknownException) 248 CRITICAL_EXCEPTION(0x0100, CriticalInterrupt, unknown_exception)
249 249
250/* 250/*
251 * 0x0200 - Machine Check Exception 251 * 0x0200 - Machine Check Exception
252 */ 252 */
253 CRITICAL_EXCEPTION(0x0200, MachineCheck, MachineCheckException) 253 CRITICAL_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
254 254
255/* 255/*
256 * 0x0300 - Data Storage Exception 256 * 0x0300 - Data Storage Exception
@@ -405,7 +405,7 @@ label:
405 mfspr r4,SPRN_DEAR /* Grab the DEAR and save it */ 405 mfspr r4,SPRN_DEAR /* Grab the DEAR and save it */
406 stw r4,_DEAR(r11) 406 stw r4,_DEAR(r11)
407 addi r3,r1,STACK_FRAME_OVERHEAD 407 addi r3,r1,STACK_FRAME_OVERHEAD
408 EXC_XFER_EE(0x600, AlignmentException) 408 EXC_XFER_EE(0x600, alignment_exception)
409 409
410/* 0x0700 - Program Exception */ 410/* 0x0700 - Program Exception */
411 START_EXCEPTION(0x0700, ProgramCheck) 411 START_EXCEPTION(0x0700, ProgramCheck)
@@ -413,21 +413,21 @@ label:
413 mfspr r4,SPRN_ESR /* Grab the ESR and save it */ 413 mfspr r4,SPRN_ESR /* Grab the ESR and save it */
414 stw r4,_ESR(r11) 414 stw r4,_ESR(r11)
415 addi r3,r1,STACK_FRAME_OVERHEAD 415 addi r3,r1,STACK_FRAME_OVERHEAD
416 EXC_XFER_STD(0x700, ProgramCheckException) 416 EXC_XFER_STD(0x700, program_check_exception)
417 417
418 EXCEPTION(0x0800, Trap_08, UnknownException, EXC_XFER_EE) 418 EXCEPTION(0x0800, Trap_08, unknown_exception, EXC_XFER_EE)
419 EXCEPTION(0x0900, Trap_09, UnknownException, EXC_XFER_EE) 419 EXCEPTION(0x0900, Trap_09, unknown_exception, EXC_XFER_EE)
420 EXCEPTION(0x0A00, Trap_0A, UnknownException, EXC_XFER_EE) 420 EXCEPTION(0x0A00, Trap_0A, unknown_exception, EXC_XFER_EE)
421 EXCEPTION(0x0B00, Trap_0B, UnknownException, EXC_XFER_EE) 421 EXCEPTION(0x0B00, Trap_0B, unknown_exception, EXC_XFER_EE)
422 422
423/* 0x0C00 - System Call Exception */ 423/* 0x0C00 - System Call Exception */
424 START_EXCEPTION(0x0C00, SystemCall) 424 START_EXCEPTION(0x0C00, SystemCall)
425 NORMAL_EXCEPTION_PROLOG 425 NORMAL_EXCEPTION_PROLOG
426 EXC_XFER_EE_LITE(0xc00, DoSyscall) 426 EXC_XFER_EE_LITE(0xc00, DoSyscall)
427 427
428 EXCEPTION(0x0D00, Trap_0D, UnknownException, EXC_XFER_EE) 428 EXCEPTION(0x0D00, Trap_0D, unknown_exception, EXC_XFER_EE)
429 EXCEPTION(0x0E00, Trap_0E, UnknownException, EXC_XFER_EE) 429 EXCEPTION(0x0E00, Trap_0E, unknown_exception, EXC_XFER_EE)
430 EXCEPTION(0x0F00, Trap_0F, UnknownException, EXC_XFER_EE) 430 EXCEPTION(0x0F00, Trap_0F, unknown_exception, EXC_XFER_EE)
431 431
432/* 0x1000 - Programmable Interval Timer (PIT) Exception */ 432/* 0x1000 - Programmable Interval Timer (PIT) Exception */
433 START_EXCEPTION(0x1000, Decrementer) 433 START_EXCEPTION(0x1000, Decrementer)
@@ -444,14 +444,14 @@ label:
444 444
445/* 0x1010 - Fixed Interval Timer (FIT) Exception 445/* 0x1010 - Fixed Interval Timer (FIT) Exception
446*/ 446*/
447 STND_EXCEPTION(0x1010, FITException, UnknownException) 447 STND_EXCEPTION(0x1010, FITException, unknown_exception)
448 448
449/* 0x1020 - Watchdog Timer (WDT) Exception 449/* 0x1020 - Watchdog Timer (WDT) Exception
450*/ 450*/
451#ifdef CONFIG_BOOKE_WDT 451#ifdef CONFIG_BOOKE_WDT
452 CRITICAL_EXCEPTION(0x1020, WDTException, WatchdogException) 452 CRITICAL_EXCEPTION(0x1020, WDTException, WatchdogException)
453#else 453#else
454 CRITICAL_EXCEPTION(0x1020, WDTException, UnknownException) 454 CRITICAL_EXCEPTION(0x1020, WDTException, unknown_exception)
455#endif 455#endif
456#endif 456#endif
457 457
@@ -656,25 +656,25 @@ label:
656 mfspr r10, SPRN_SPRG0 656 mfspr r10, SPRN_SPRG0
657 b InstructionAccess 657 b InstructionAccess
658 658
659 EXCEPTION(0x1300, Trap_13, UnknownException, EXC_XFER_EE) 659 EXCEPTION(0x1300, Trap_13, unknown_exception, EXC_XFER_EE)
660 EXCEPTION(0x1400, Trap_14, UnknownException, EXC_XFER_EE) 660 EXCEPTION(0x1400, Trap_14, unknown_exception, EXC_XFER_EE)
661 EXCEPTION(0x1500, Trap_15, UnknownException, EXC_XFER_EE) 661 EXCEPTION(0x1500, Trap_15, unknown_exception, EXC_XFER_EE)
662 EXCEPTION(0x1600, Trap_16, UnknownException, EXC_XFER_EE) 662 EXCEPTION(0x1600, Trap_16, unknown_exception, EXC_XFER_EE)
663#ifdef CONFIG_IBM405_ERR51 663#ifdef CONFIG_IBM405_ERR51
664 /* 405GP errata 51 */ 664 /* 405GP errata 51 */
665 START_EXCEPTION(0x1700, Trap_17) 665 START_EXCEPTION(0x1700, Trap_17)
666 b DTLBMiss 666 b DTLBMiss
667#else 667#else
668 EXCEPTION(0x1700, Trap_17, UnknownException, EXC_XFER_EE) 668 EXCEPTION(0x1700, Trap_17, unknown_exception, EXC_XFER_EE)
669#endif 669#endif
670 EXCEPTION(0x1800, Trap_18, UnknownException, EXC_XFER_EE) 670 EXCEPTION(0x1800, Trap_18, unknown_exception, EXC_XFER_EE)
671 EXCEPTION(0x1900, Trap_19, UnknownException, EXC_XFER_EE) 671 EXCEPTION(0x1900, Trap_19, unknown_exception, EXC_XFER_EE)
672 EXCEPTION(0x1A00, Trap_1A, UnknownException, EXC_XFER_EE) 672 EXCEPTION(0x1A00, Trap_1A, unknown_exception, EXC_XFER_EE)
673 EXCEPTION(0x1B00, Trap_1B, UnknownException, EXC_XFER_EE) 673 EXCEPTION(0x1B00, Trap_1B, unknown_exception, EXC_XFER_EE)
674 EXCEPTION(0x1C00, Trap_1C, UnknownException, EXC_XFER_EE) 674 EXCEPTION(0x1C00, Trap_1C, unknown_exception, EXC_XFER_EE)
675 EXCEPTION(0x1D00, Trap_1D, UnknownException, EXC_XFER_EE) 675 EXCEPTION(0x1D00, Trap_1D, unknown_exception, EXC_XFER_EE)
676 EXCEPTION(0x1E00, Trap_1E, UnknownException, EXC_XFER_EE) 676 EXCEPTION(0x1E00, Trap_1E, unknown_exception, EXC_XFER_EE)
677 EXCEPTION(0x1F00, Trap_1F, UnknownException, EXC_XFER_EE) 677 EXCEPTION(0x1F00, Trap_1F, unknown_exception, EXC_XFER_EE)
678 678
679/* Check for a single step debug exception while in an exception 679/* Check for a single step debug exception while in an exception
680 * handler before state has been saved. This is to catch the case 680 * handler before state has been saved. This is to catch the case
@@ -988,10 +988,14 @@ _GLOBAL(set_context)
988 * goes at the beginning of the data segment, which is page-aligned. 988 * goes at the beginning of the data segment, which is page-aligned.
989 */ 989 */
990 .data 990 .data
991_GLOBAL(sdata) 991 .align 12
992_GLOBAL(empty_zero_page) 992 .globl sdata
993sdata:
994 .globl empty_zero_page
995empty_zero_page:
993 .space 4096 996 .space 4096
994_GLOBAL(swapper_pg_dir) 997 .globl swapper_pg_dir
998swapper_pg_dir:
995 .space 4096 999 .space 4096
996 1000
997 1001
@@ -1001,12 +1005,14 @@ _GLOBAL(swapper_pg_dir)
1001exception_stack_bottom: 1005exception_stack_bottom:
1002 .space 4096 1006 .space 4096
1003critical_stack_top: 1007critical_stack_top:
1004_GLOBAL(exception_stack_top) 1008 .globl exception_stack_top
1009exception_stack_top:
1005 1010
1006/* This space gets a copy of optional info passed to us by the bootstrap 1011/* This space gets a copy of optional info passed to us by the bootstrap
1007 * which is used to pass parameters into the kernel like root=/dev/sda1, etc. 1012 * which is used to pass parameters into the kernel like root=/dev/sda1, etc.
1008 */ 1013 */
1009_GLOBAL(cmd_line) 1014 .globl cmd_line
1015cmd_line:
1010 .space 512 1016 .space 512
1011 1017
1012/* Room for two PTE pointers, usually the kernel and current user pointers 1018/* Room for two PTE pointers, usually the kernel and current user pointers
diff --git a/arch/ppc/kernel/head_8xx.S b/arch/ppc/kernel/head_8xx.S
index cb1a3a54a026..de0978742221 100644
--- a/arch/ppc/kernel/head_8xx.S
+++ b/arch/ppc/kernel/head_8xx.S
@@ -203,7 +203,7 @@ i##n: \
203 ret_from_except) 203 ret_from_except)
204 204
205/* System reset */ 205/* System reset */
206 EXCEPTION(0x100, Reset, UnknownException, EXC_XFER_STD) 206 EXCEPTION(0x100, Reset, unknown_exception, EXC_XFER_STD)
207 207
208/* Machine check */ 208/* Machine check */
209 . = 0x200 209 . = 0x200
@@ -214,7 +214,7 @@ MachineCheck:
214 mfspr r5,SPRN_DSISR 214 mfspr r5,SPRN_DSISR
215 stw r5,_DSISR(r11) 215 stw r5,_DSISR(r11)
216 addi r3,r1,STACK_FRAME_OVERHEAD 216 addi r3,r1,STACK_FRAME_OVERHEAD
217 EXC_XFER_STD(0x200, MachineCheckException) 217 EXC_XFER_STD(0x200, machine_check_exception)
218 218
219/* Data access exception. 219/* Data access exception.
220 * This is "never generated" by the MPC8xx. We jump to it for other 220 * This is "never generated" by the MPC8xx. We jump to it for other
@@ -252,20 +252,20 @@ Alignment:
252 mfspr r5,SPRN_DSISR 252 mfspr r5,SPRN_DSISR
253 stw r5,_DSISR(r11) 253 stw r5,_DSISR(r11)
254 addi r3,r1,STACK_FRAME_OVERHEAD 254 addi r3,r1,STACK_FRAME_OVERHEAD
255 EXC_XFER_EE(0x600, AlignmentException) 255 EXC_XFER_EE(0x600, alignment_exception)
256 256
257/* Program check exception */ 257/* Program check exception */
258 EXCEPTION(0x700, ProgramCheck, ProgramCheckException, EXC_XFER_STD) 258 EXCEPTION(0x700, ProgramCheck, program_check_exception, EXC_XFER_STD)
259 259
260/* No FPU on MPC8xx. This exception is not supposed to happen. 260/* No FPU on MPC8xx. This exception is not supposed to happen.
261*/ 261*/
262 EXCEPTION(0x800, FPUnavailable, UnknownException, EXC_XFER_STD) 262 EXCEPTION(0x800, FPUnavailable, unknown_exception, EXC_XFER_STD)
263 263
264/* Decrementer */ 264/* Decrementer */
265 EXCEPTION(0x900, Decrementer, timer_interrupt, EXC_XFER_LITE) 265 EXCEPTION(0x900, Decrementer, timer_interrupt, EXC_XFER_LITE)
266 266
267 EXCEPTION(0xa00, Trap_0a, UnknownException, EXC_XFER_EE) 267 EXCEPTION(0xa00, Trap_0a, unknown_exception, EXC_XFER_EE)
268 EXCEPTION(0xb00, Trap_0b, UnknownException, EXC_XFER_EE) 268 EXCEPTION(0xb00, Trap_0b, unknown_exception, EXC_XFER_EE)
269 269
270/* System call */ 270/* System call */
271 . = 0xc00 271 . = 0xc00
@@ -274,9 +274,9 @@ SystemCall:
274 EXC_XFER_EE_LITE(0xc00, DoSyscall) 274 EXC_XFER_EE_LITE(0xc00, DoSyscall)
275 275
276/* Single step - not used on 601 */ 276/* Single step - not used on 601 */
277 EXCEPTION(0xd00, SingleStep, SingleStepException, EXC_XFER_STD) 277 EXCEPTION(0xd00, SingleStep, single_step_exception, EXC_XFER_STD)
278 EXCEPTION(0xe00, Trap_0e, UnknownException, EXC_XFER_EE) 278 EXCEPTION(0xe00, Trap_0e, unknown_exception, EXC_XFER_EE)
279 EXCEPTION(0xf00, Trap_0f, UnknownException, EXC_XFER_EE) 279 EXCEPTION(0xf00, Trap_0f, unknown_exception, EXC_XFER_EE)
280 280
281/* On the MPC8xx, this is a software emulation interrupt. It occurs 281/* On the MPC8xx, this is a software emulation interrupt. It occurs
282 * for all unimplemented and illegal instructions. 282 * for all unimplemented and illegal instructions.
@@ -540,22 +540,22 @@ DataTLBError:
540#endif 540#endif
541 b DataAccess 541 b DataAccess
542 542
543 EXCEPTION(0x1500, Trap_15, UnknownException, EXC_XFER_EE) 543 EXCEPTION(0x1500, Trap_15, unknown_exception, EXC_XFER_EE)
544 EXCEPTION(0x1600, Trap_16, UnknownException, EXC_XFER_EE) 544 EXCEPTION(0x1600, Trap_16, unknown_exception, EXC_XFER_EE)
545 EXCEPTION(0x1700, Trap_17, UnknownException, EXC_XFER_EE) 545 EXCEPTION(0x1700, Trap_17, unknown_exception, EXC_XFER_EE)
546 EXCEPTION(0x1800, Trap_18, UnknownException, EXC_XFER_EE) 546 EXCEPTION(0x1800, Trap_18, unknown_exception, EXC_XFER_EE)
547 EXCEPTION(0x1900, Trap_19, UnknownException, EXC_XFER_EE) 547 EXCEPTION(0x1900, Trap_19, unknown_exception, EXC_XFER_EE)
548 EXCEPTION(0x1a00, Trap_1a, UnknownException, EXC_XFER_EE) 548 EXCEPTION(0x1a00, Trap_1a, unknown_exception, EXC_XFER_EE)
549 EXCEPTION(0x1b00, Trap_1b, UnknownException, EXC_XFER_EE) 549 EXCEPTION(0x1b00, Trap_1b, unknown_exception, EXC_XFER_EE)
550 550
551/* On the MPC8xx, these next four traps are used for development 551/* On the MPC8xx, these next four traps are used for development
552 * support of breakpoints and such. Someday I will get around to 552 * support of breakpoints and such. Someday I will get around to
553 * using them. 553 * using them.
554 */ 554 */
555 EXCEPTION(0x1c00, Trap_1c, UnknownException, EXC_XFER_EE) 555 EXCEPTION(0x1c00, Trap_1c, unknown_exception, EXC_XFER_EE)
556 EXCEPTION(0x1d00, Trap_1d, UnknownException, EXC_XFER_EE) 556 EXCEPTION(0x1d00, Trap_1d, unknown_exception, EXC_XFER_EE)
557 EXCEPTION(0x1e00, Trap_1e, UnknownException, EXC_XFER_EE) 557 EXCEPTION(0x1e00, Trap_1e, unknown_exception, EXC_XFER_EE)
558 EXCEPTION(0x1f00, Trap_1f, UnknownException, EXC_XFER_EE) 558 EXCEPTION(0x1f00, Trap_1f, unknown_exception, EXC_XFER_EE)
559 559
560 . = 0x2000 560 . = 0x2000
561 561
diff --git a/arch/ppc/kernel/head_booke.h b/arch/ppc/kernel/head_booke.h
index 9342acf12e72..aeb349b47af3 100644
--- a/arch/ppc/kernel/head_booke.h
+++ b/arch/ppc/kernel/head_booke.h
@@ -335,7 +335,7 @@ label:
335 mfspr r4,SPRN_DEAR; /* Grab the DEAR and save it */ \ 335 mfspr r4,SPRN_DEAR; /* Grab the DEAR and save it */ \
336 stw r4,_DEAR(r11); \ 336 stw r4,_DEAR(r11); \
337 addi r3,r1,STACK_FRAME_OVERHEAD; \ 337 addi r3,r1,STACK_FRAME_OVERHEAD; \
338 EXC_XFER_EE(0x0600, AlignmentException) 338 EXC_XFER_EE(0x0600, alignment_exception)
339 339
340#define PROGRAM_EXCEPTION \ 340#define PROGRAM_EXCEPTION \
341 START_EXCEPTION(Program) \ 341 START_EXCEPTION(Program) \
@@ -343,7 +343,7 @@ label:
343 mfspr r4,SPRN_ESR; /* Grab the ESR and save it */ \ 343 mfspr r4,SPRN_ESR; /* Grab the ESR and save it */ \
344 stw r4,_ESR(r11); \ 344 stw r4,_ESR(r11); \
345 addi r3,r1,STACK_FRAME_OVERHEAD; \ 345 addi r3,r1,STACK_FRAME_OVERHEAD; \
346 EXC_XFER_STD(0x0700, ProgramCheckException) 346 EXC_XFER_STD(0x0700, program_check_exception)
347 347
348#define DECREMENTER_EXCEPTION \ 348#define DECREMENTER_EXCEPTION \
349 START_EXCEPTION(Decrementer) \ 349 START_EXCEPTION(Decrementer) \
diff --git a/arch/ppc/kernel/head_fsl_booke.S b/arch/ppc/kernel/head_fsl_booke.S
index 8e52e8408316..5063c603fad4 100644
--- a/arch/ppc/kernel/head_fsl_booke.S
+++ b/arch/ppc/kernel/head_fsl_booke.S
@@ -426,14 +426,14 @@ skpinv: addi r6,r6,1 /* Increment */
426 426
427interrupt_base: 427interrupt_base:
428 /* Critical Input Interrupt */ 428 /* Critical Input Interrupt */
429 CRITICAL_EXCEPTION(0x0100, CriticalInput, UnknownException) 429 CRITICAL_EXCEPTION(0x0100, CriticalInput, unknown_exception)
430 430
431 /* Machine Check Interrupt */ 431 /* Machine Check Interrupt */
432#ifdef CONFIG_E200 432#ifdef CONFIG_E200
433 /* no RFMCI, MCSRRs on E200 */ 433 /* no RFMCI, MCSRRs on E200 */
434 CRITICAL_EXCEPTION(0x0200, MachineCheck, MachineCheckException) 434 CRITICAL_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
435#else 435#else
436 MCHECK_EXCEPTION(0x0200, MachineCheck, MachineCheckException) 436 MCHECK_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
437#endif 437#endif
438 438
439 /* Data Storage Interrupt */ 439 /* Data Storage Interrupt */
@@ -542,9 +542,9 @@ interrupt_base:
542#else 542#else
543#ifdef CONFIG_E200 543#ifdef CONFIG_E200
544 /* E200 treats 'normal' floating point instructions as FP Unavail exception */ 544 /* E200 treats 'normal' floating point instructions as FP Unavail exception */
545 EXCEPTION(0x0800, FloatingPointUnavailable, ProgramCheckException, EXC_XFER_EE) 545 EXCEPTION(0x0800, FloatingPointUnavailable, program_check_exception, EXC_XFER_EE)
546#else 546#else
547 EXCEPTION(0x0800, FloatingPointUnavailable, UnknownException, EXC_XFER_EE) 547 EXCEPTION(0x0800, FloatingPointUnavailable, unknown_exception, EXC_XFER_EE)
548#endif 548#endif
549#endif 549#endif
550 550
@@ -554,20 +554,20 @@ interrupt_base:
554 EXC_XFER_EE_LITE(0x0c00, DoSyscall) 554 EXC_XFER_EE_LITE(0x0c00, DoSyscall)
555 555
556 /* Auxillary Processor Unavailable Interrupt */ 556 /* Auxillary Processor Unavailable Interrupt */
557 EXCEPTION(0x2900, AuxillaryProcessorUnavailable, UnknownException, EXC_XFER_EE) 557 EXCEPTION(0x2900, AuxillaryProcessorUnavailable, unknown_exception, EXC_XFER_EE)
558 558
559 /* Decrementer Interrupt */ 559 /* Decrementer Interrupt */
560 DECREMENTER_EXCEPTION 560 DECREMENTER_EXCEPTION
561 561
562 /* Fixed Internal Timer Interrupt */ 562 /* Fixed Internal Timer Interrupt */
563 /* TODO: Add FIT support */ 563 /* TODO: Add FIT support */
564 EXCEPTION(0x3100, FixedIntervalTimer, UnknownException, EXC_XFER_EE) 564 EXCEPTION(0x3100, FixedIntervalTimer, unknown_exception, EXC_XFER_EE)
565 565
566 /* Watchdog Timer Interrupt */ 566 /* Watchdog Timer Interrupt */
567#ifdef CONFIG_BOOKE_WDT 567#ifdef CONFIG_BOOKE_WDT
568 CRITICAL_EXCEPTION(0x3200, WatchdogTimer, WatchdogException) 568 CRITICAL_EXCEPTION(0x3200, WatchdogTimer, WatchdogException)
569#else 569#else
570 CRITICAL_EXCEPTION(0x3200, WatchdogTimer, UnknownException) 570 CRITICAL_EXCEPTION(0x3200, WatchdogTimer, unknown_exception)
571#endif 571#endif
572 572
573 /* Data TLB Error Interrupt */ 573 /* Data TLB Error Interrupt */
@@ -696,21 +696,21 @@ interrupt_base:
696 addi r3,r1,STACK_FRAME_OVERHEAD 696 addi r3,r1,STACK_FRAME_OVERHEAD
697 EXC_XFER_EE_LITE(0x2010, KernelSPE) 697 EXC_XFER_EE_LITE(0x2010, KernelSPE)
698#else 698#else
699 EXCEPTION(0x2020, SPEUnavailable, UnknownException, EXC_XFER_EE) 699 EXCEPTION(0x2020, SPEUnavailable, unknown_exception, EXC_XFER_EE)
700#endif /* CONFIG_SPE */ 700#endif /* CONFIG_SPE */
701 701
702 /* SPE Floating Point Data */ 702 /* SPE Floating Point Data */
703#ifdef CONFIG_SPE 703#ifdef CONFIG_SPE
704 EXCEPTION(0x2030, SPEFloatingPointData, SPEFloatingPointException, EXC_XFER_EE); 704 EXCEPTION(0x2030, SPEFloatingPointData, SPEFloatingPointException, EXC_XFER_EE);
705#else 705#else
706 EXCEPTION(0x2040, SPEFloatingPointData, UnknownException, EXC_XFER_EE) 706 EXCEPTION(0x2040, SPEFloatingPointData, unknown_exception, EXC_XFER_EE)
707#endif /* CONFIG_SPE */ 707#endif /* CONFIG_SPE */
708 708
709 /* SPE Floating Point Round */ 709 /* SPE Floating Point Round */
710 EXCEPTION(0x2050, SPEFloatingPointRound, UnknownException, EXC_XFER_EE) 710 EXCEPTION(0x2050, SPEFloatingPointRound, unknown_exception, EXC_XFER_EE)
711 711
712 /* Performance Monitor */ 712 /* Performance Monitor */
713 EXCEPTION(0x2060, PerformanceMonitor, PerformanceMonitorException, EXC_XFER_STD) 713 EXCEPTION(0x2060, PerformanceMonitor, performance_monitor_exception, EXC_XFER_STD)
714 714
715 715
716 /* Debug Interrupt */ 716 /* Debug Interrupt */
@@ -853,7 +853,7 @@ load_up_spe:
853 cmpi 0,r4,0 853 cmpi 0,r4,0
854 beq 1f 854 beq 1f
855 addi r4,r4,THREAD /* want THREAD of last_task_used_spe */ 855 addi r4,r4,THREAD /* want THREAD of last_task_used_spe */
856 SAVE_32EVR(0,r10,r4) 856 SAVE_32EVRS(0,r10,r4)
857 evxor evr10, evr10, evr10 /* clear out evr10 */ 857 evxor evr10, evr10, evr10 /* clear out evr10 */
858 evmwumiaa evr10, evr10, evr10 /* evr10 <- ACC = 0 * 0 + ACC */ 858 evmwumiaa evr10, evr10, evr10 /* evr10 <- ACC = 0 * 0 + ACC */
859 li r5,THREAD_ACC 859 li r5,THREAD_ACC
@@ -873,7 +873,7 @@ load_up_spe:
873 stw r4,THREAD_USED_SPE(r5) 873 stw r4,THREAD_USED_SPE(r5)
874 evlddx evr4,r10,r5 874 evlddx evr4,r10,r5
875 evmra evr4,evr4 875 evmra evr4,evr4
876 REST_32EVR(0,r10,r5) 876 REST_32EVRS(0,r10,r5)
877#ifndef CONFIG_SMP 877#ifndef CONFIG_SMP
878 subi r4,r5,THREAD 878 subi r4,r5,THREAD
879 stw r4,last_task_used_spe@l(r3) 879 stw r4,last_task_used_spe@l(r3)
@@ -963,7 +963,7 @@ _GLOBAL(giveup_spe)
963 addi r3,r3,THREAD /* want THREAD of task */ 963 addi r3,r3,THREAD /* want THREAD of task */
964 lwz r5,PT_REGS(r3) 964 lwz r5,PT_REGS(r3)
965 cmpi 0,r5,0 965 cmpi 0,r5,0
966 SAVE_32EVR(0, r4, r3) 966 SAVE_32EVRS(0, r4, r3)
967 evxor evr6, evr6, evr6 /* clear out evr6 */ 967 evxor evr6, evr6, evr6 /* clear out evr6 */
968 evmwumiaa evr6, evr6, evr6 /* evr6 <- ACC = 0 * 0 + ACC */ 968 evmwumiaa evr6, evr6, evr6 /* evr6 <- ACC = 0 * 0 + ACC */
969 li r4,THREAD_ACC 969 li r4,THREAD_ACC
@@ -1028,10 +1028,14 @@ _GLOBAL(set_context)
1028 * goes at the beginning of the data segment, which is page-aligned. 1028 * goes at the beginning of the data segment, which is page-aligned.
1029 */ 1029 */
1030 .data 1030 .data
1031_GLOBAL(sdata) 1031 .align 12
1032_GLOBAL(empty_zero_page) 1032 .globl sdata
1033sdata:
1034 .globl empty_zero_page
1035empty_zero_page:
1033 .space 4096 1036 .space 4096
1034_GLOBAL(swapper_pg_dir) 1037 .globl swapper_pg_dir
1038swapper_pg_dir:
1035 .space 4096 1039 .space 4096
1036 1040
1037/* Reserved 4k for the critical exception stack & 4k for the machine 1041/* Reserved 4k for the critical exception stack & 4k for the machine
@@ -1040,13 +1044,15 @@ _GLOBAL(swapper_pg_dir)
1040 .align 12 1044 .align 12
1041exception_stack_bottom: 1045exception_stack_bottom:
1042 .space BOOKE_EXCEPTION_STACK_SIZE * NR_CPUS 1046 .space BOOKE_EXCEPTION_STACK_SIZE * NR_CPUS
1043_GLOBAL(exception_stack_top) 1047 .globl exception_stack_top
1048exception_stack_top:
1044 1049
1045/* 1050/*
1046 * This space gets a copy of optional info passed to us by the bootstrap 1051 * This space gets a copy of optional info passed to us by the bootstrap
1047 * which is used to pass parameters into the kernel like root=/dev/sda1, etc. 1052 * which is used to pass parameters into the kernel like root=/dev/sda1, etc.
1048 */ 1053 */
1049_GLOBAL(cmd_line) 1054 .globl cmd_line
1055cmd_line:
1050 .space 512 1056 .space 512
1051 1057
1052/* 1058/*
@@ -1055,4 +1061,3 @@ _GLOBAL(cmd_line)
1055 */ 1061 */
1056abatron_pteptrs: 1062abatron_pteptrs:
1057 .space 8 1063 .space 8
1058
diff --git a/arch/ppc/kernel/idle.c b/arch/ppc/kernel/idle.c
index fba29c876b62..11e5b44713f7 100644
--- a/arch/ppc/kernel/idle.c
+++ b/arch/ppc/kernel/idle.c
@@ -32,6 +32,7 @@
32#include <asm/cache.h> 32#include <asm/cache.h>
33#include <asm/cputable.h> 33#include <asm/cputable.h>
34#include <asm/machdep.h> 34#include <asm/machdep.h>
35#include <asm/smp.h>
35 36
36void default_idle(void) 37void default_idle(void)
37{ 38{
@@ -74,7 +75,7 @@ void cpu_idle(void)
74/* 75/*
75 * Register the sysctl to set/clear powersave_nap. 76 * Register the sysctl to set/clear powersave_nap.
76 */ 77 */
77extern unsigned long powersave_nap; 78extern int powersave_nap;
78 79
79static ctl_table powersave_nap_ctl_table[]={ 80static ctl_table powersave_nap_ctl_table[]={
80 { 81 {
diff --git a/arch/ppc/kernel/irq.c b/arch/ppc/kernel/irq.c
index 8843f3af230f..772e428aaa59 100644
--- a/arch/ppc/kernel/irq.c
+++ b/arch/ppc/kernel/irq.c
@@ -57,6 +57,7 @@
57#include <asm/cache.h> 57#include <asm/cache.h>
58#include <asm/prom.h> 58#include <asm/prom.h>
59#include <asm/ptrace.h> 59#include <asm/ptrace.h>
60#include <asm/machdep.h>
60 61
61#define NR_MASK_WORDS ((NR_IRQS + 31) / 32) 62#define NR_MASK_WORDS ((NR_IRQS + 31) / 32)
62 63
diff --git a/arch/ppc/kernel/l2cr.S b/arch/ppc/kernel/l2cr.S
index 861115249b35..d7f4e982b539 100644
--- a/arch/ppc/kernel/l2cr.S
+++ b/arch/ppc/kernel/l2cr.S
@@ -203,7 +203,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_SPEC7450)
203 * L1 icache 203 * L1 icache
204 */ 204 */
205 b 20f 205 b 20f
206 .balign L1_CACHE_LINE_SIZE 206 .balign L1_CACHE_BYTES
20722: 20722:
208 sync 208 sync
209 mtspr SPRN_L2CR,r3 209 mtspr SPRN_L2CR,r3
diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S
index 90d917d2e856..3056ede2424d 100644
--- a/arch/ppc/kernel/misc.S
+++ b/arch/ppc/kernel/misc.S
@@ -125,9 +125,8 @@ _GLOBAL(identify_cpu)
1251: 1251:
126 addis r6,r3,cur_cpu_spec@ha 126 addis r6,r3,cur_cpu_spec@ha
127 addi r6,r6,cur_cpu_spec@l 127 addi r6,r6,cur_cpu_spec@l
128 slwi r4,r4,2
129 sub r8,r8,r3 128 sub r8,r8,r3
130 stwx r8,r4,r6 129 stw r8,0(r6)
131 blr 130 blr
132 131
133/* 132/*
@@ -186,19 +185,18 @@ _GLOBAL(do_cpu_ftr_fixups)
186 * 185 *
187 * Setup function is called with: 186 * Setup function is called with:
188 * r3 = data offset 187 * r3 = data offset
189 * r4 = CPU number 188 * r4 = ptr to CPU spec (relocated)
190 * r5 = ptr to CPU spec (relocated)
191 */ 189 */
192_GLOBAL(call_setup_cpu) 190_GLOBAL(call_setup_cpu)
193 addis r5,r3,cur_cpu_spec@ha 191 addis r4,r3,cur_cpu_spec@ha
194 addi r5,r5,cur_cpu_spec@l 192 addi r4,r4,cur_cpu_spec@l
195 slwi r4,r24,2 193 lwz r4,0(r4)
196 lwzx r5,r4,r5 194 add r4,r4,r3
195 lwz r5,CPU_SPEC_SETUP(r4)
196 cmpi 0,r5,0
197 add r5,r5,r3 197 add r5,r5,r3
198 lwz r6,CPU_SPEC_SETUP(r5) 198 beqlr
199 add r6,r6,r3 199 mtctr r5
200 mtctr r6
201 mr r4,r24
202 bctr 200 bctr
203 201
204#if defined(CONFIG_CPU_FREQ_PMAC) && defined(CONFIG_6xx) 202#if defined(CONFIG_CPU_FREQ_PMAC) && defined(CONFIG_6xx)
@@ -273,134 +271,6 @@ _GLOBAL(low_choose_7447a_dfs)
273 271
274#endif /* CONFIG_CPU_FREQ_PMAC && CONFIG_6xx */ 272#endif /* CONFIG_CPU_FREQ_PMAC && CONFIG_6xx */
275 273
276/* void local_save_flags_ptr(unsigned long *flags) */
277_GLOBAL(local_save_flags_ptr)
278 mfmsr r4
279 stw r4,0(r3)
280 blr
281 /*
282 * Need these nops here for taking over save/restore to
283 * handle lost intrs
284 * -- Cort
285 */
286 nop
287 nop
288 nop
289 nop
290 nop
291 nop
292 nop
293 nop
294 nop
295 nop
296 nop
297 nop
298 nop
299 nop
300 nop
301 nop
302 nop
303_GLOBAL(local_save_flags_ptr_end)
304
305/* void local_irq_restore(unsigned long flags) */
306_GLOBAL(local_irq_restore)
307/*
308 * Just set/clear the MSR_EE bit through restore/flags but do not
309 * change anything else. This is needed by the RT system and makes
310 * sense anyway.
311 * -- Cort
312 */
313 mfmsr r4
314 /* Copy all except the MSR_EE bit from r4 (current MSR value)
315 to r3. This is the sort of thing the rlwimi instruction is
316 designed for. -- paulus. */
317 rlwimi r3,r4,0,17,15
318 /* Check if things are setup the way we want _already_. */
319 cmpw 0,r3,r4
320 beqlr
3211: SYNC
322 mtmsr r3
323 SYNC
324 blr
325 nop
326 nop
327 nop
328 nop
329 nop
330 nop
331 nop
332 nop
333 nop
334 nop
335 nop
336 nop
337 nop
338 nop
339 nop
340 nop
341 nop
342 nop
343 nop
344_GLOBAL(local_irq_restore_end)
345
346_GLOBAL(local_irq_disable)
347 mfmsr r0 /* Get current interrupt state */
348 rlwinm r3,r0,16+1,32-1,31 /* Extract old value of 'EE' */
349 rlwinm r0,r0,0,17,15 /* clear MSR_EE in r0 */
350 SYNC /* Some chip revs have problems here... */
351 mtmsr r0 /* Update machine state */
352 blr /* Done */
353 /*
354 * Need these nops here for taking over save/restore to
355 * handle lost intrs
356 * -- Cort
357 */
358 nop
359 nop
360 nop
361 nop
362 nop
363 nop
364 nop
365 nop
366 nop
367 nop
368 nop
369 nop
370 nop
371 nop
372 nop
373_GLOBAL(local_irq_disable_end)
374
375_GLOBAL(local_irq_enable)
376 mfmsr r3 /* Get current state */
377 ori r3,r3,MSR_EE /* Turn on 'EE' bit */
378 SYNC /* Some chip revs have problems here... */
379 mtmsr r3 /* Update machine state */
380 blr
381 /*
382 * Need these nops here for taking over save/restore to
383 * handle lost intrs
384 * -- Cort
385 */
386 nop
387 nop
388 nop
389 nop
390 nop
391 nop
392 nop
393 nop
394 nop
395 nop
396 nop
397 nop
398 nop
399 nop
400 nop
401 nop
402_GLOBAL(local_irq_enable_end)
403
404/* 274/*
405 * complement mask on the msr then "or" some values on. 275 * complement mask on the msr then "or" some values on.
406 * _nmask_and_or_msr(nmask, value_to_or) 276 * _nmask_and_or_msr(nmask, value_to_or)
@@ -628,21 +498,21 @@ _GLOBAL(flush_icache_range)
628BEGIN_FTR_SECTION 498BEGIN_FTR_SECTION
629 blr /* for 601, do nothing */ 499 blr /* for 601, do nothing */
630END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE) 500END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE)
631 li r5,L1_CACHE_LINE_SIZE-1 501 li r5,L1_CACHE_BYTES-1
632 andc r3,r3,r5 502 andc r3,r3,r5
633 subf r4,r3,r4 503 subf r4,r3,r4
634 add r4,r4,r5 504 add r4,r4,r5
635 srwi. r4,r4,LG_L1_CACHE_LINE_SIZE 505 srwi. r4,r4,L1_CACHE_SHIFT
636 beqlr 506 beqlr
637 mtctr r4 507 mtctr r4
638 mr r6,r3 508 mr r6,r3
6391: dcbst 0,r3 5091: dcbst 0,r3
640 addi r3,r3,L1_CACHE_LINE_SIZE 510 addi r3,r3,L1_CACHE_BYTES
641 bdnz 1b 511 bdnz 1b
642 sync /* wait for dcbst's to get to ram */ 512 sync /* wait for dcbst's to get to ram */
643 mtctr r4 513 mtctr r4
6442: icbi 0,r6 5142: icbi 0,r6
645 addi r6,r6,L1_CACHE_LINE_SIZE 515 addi r6,r6,L1_CACHE_BYTES
646 bdnz 2b 516 bdnz 2b
647 sync /* additional sync needed on g4 */ 517 sync /* additional sync needed on g4 */
648 isync 518 isync
@@ -655,16 +525,16 @@ END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE)
655 * clean_dcache_range(unsigned long start, unsigned long stop) 525 * clean_dcache_range(unsigned long start, unsigned long stop)
656 */ 526 */
657_GLOBAL(clean_dcache_range) 527_GLOBAL(clean_dcache_range)
658 li r5,L1_CACHE_LINE_SIZE-1 528 li r5,L1_CACHE_BYTES-1
659 andc r3,r3,r5 529 andc r3,r3,r5
660 subf r4,r3,r4 530 subf r4,r3,r4
661 add r4,r4,r5 531 add r4,r4,r5
662 srwi. r4,r4,LG_L1_CACHE_LINE_SIZE 532 srwi. r4,r4,L1_CACHE_SHIFT
663 beqlr 533 beqlr
664 mtctr r4 534 mtctr r4
665 535
6661: dcbst 0,r3 5361: dcbst 0,r3
667 addi r3,r3,L1_CACHE_LINE_SIZE 537 addi r3,r3,L1_CACHE_BYTES
668 bdnz 1b 538 bdnz 1b
669 sync /* wait for dcbst's to get to ram */ 539 sync /* wait for dcbst's to get to ram */
670 blr 540 blr
@@ -676,16 +546,16 @@ _GLOBAL(clean_dcache_range)
676 * flush_dcache_range(unsigned long start, unsigned long stop) 546 * flush_dcache_range(unsigned long start, unsigned long stop)
677 */ 547 */
678_GLOBAL(flush_dcache_range) 548_GLOBAL(flush_dcache_range)
679 li r5,L1_CACHE_LINE_SIZE-1 549 li r5,L1_CACHE_BYTES-1
680 andc r3,r3,r5 550 andc r3,r3,r5
681 subf r4,r3,r4 551 subf r4,r3,r4
682 add r4,r4,r5 552 add r4,r4,r5
683 srwi. r4,r4,LG_L1_CACHE_LINE_SIZE 553 srwi. r4,r4,L1_CACHE_SHIFT
684 beqlr 554 beqlr
685 mtctr r4 555 mtctr r4
686 556
6871: dcbf 0,r3 5571: dcbf 0,r3
688 addi r3,r3,L1_CACHE_LINE_SIZE 558 addi r3,r3,L1_CACHE_BYTES
689 bdnz 1b 559 bdnz 1b
690 sync /* wait for dcbst's to get to ram */ 560 sync /* wait for dcbst's to get to ram */
691 blr 561 blr
@@ -698,16 +568,16 @@ _GLOBAL(flush_dcache_range)
698 * invalidate_dcache_range(unsigned long start, unsigned long stop) 568 * invalidate_dcache_range(unsigned long start, unsigned long stop)
699 */ 569 */
700_GLOBAL(invalidate_dcache_range) 570_GLOBAL(invalidate_dcache_range)
701 li r5,L1_CACHE_LINE_SIZE-1 571 li r5,L1_CACHE_BYTES-1
702 andc r3,r3,r5 572 andc r3,r3,r5
703 subf r4,r3,r4 573 subf r4,r3,r4
704 add r4,r4,r5 574 add r4,r4,r5
705 srwi. r4,r4,LG_L1_CACHE_LINE_SIZE 575 srwi. r4,r4,L1_CACHE_SHIFT
706 beqlr 576 beqlr
707 mtctr r4 577 mtctr r4
708 578
7091: dcbi 0,r3 5791: dcbi 0,r3
710 addi r3,r3,L1_CACHE_LINE_SIZE 580 addi r3,r3,L1_CACHE_BYTES
711 bdnz 1b 581 bdnz 1b
712 sync /* wait for dcbi's to get to ram */ 582 sync /* wait for dcbi's to get to ram */
713 blr 583 blr
@@ -728,7 +598,7 @@ _GLOBAL(flush_dcache_all)
728 mtctr r4 598 mtctr r4
729 lis r5, KERNELBASE@h 599 lis r5, KERNELBASE@h
7301: lwz r3, 0(r5) /* Load one word from every line */ 6001: lwz r3, 0(r5) /* Load one word from every line */
731 addi r5, r5, L1_CACHE_LINE_SIZE 601 addi r5, r5, L1_CACHE_BYTES
732 bdnz 1b 602 bdnz 1b
733 blr 603 blr
734#endif /* CONFIG_NOT_COHERENT_CACHE */ 604#endif /* CONFIG_NOT_COHERENT_CACHE */
@@ -746,16 +616,16 @@ BEGIN_FTR_SECTION
746 blr /* for 601, do nothing */ 616 blr /* for 601, do nothing */
747END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE) 617END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE)
748 rlwinm r3,r3,0,0,19 /* Get page base address */ 618 rlwinm r3,r3,0,0,19 /* Get page base address */
749 li r4,4096/L1_CACHE_LINE_SIZE /* Number of lines in a page */ 619 li r4,4096/L1_CACHE_BYTES /* Number of lines in a page */
750 mtctr r4 620 mtctr r4
751 mr r6,r3 621 mr r6,r3
7520: dcbst 0,r3 /* Write line to ram */ 6220: dcbst 0,r3 /* Write line to ram */
753 addi r3,r3,L1_CACHE_LINE_SIZE 623 addi r3,r3,L1_CACHE_BYTES
754 bdnz 0b 624 bdnz 0b
755 sync 625 sync
756 mtctr r4 626 mtctr r4
7571: icbi 0,r6 6271: icbi 0,r6
758 addi r6,r6,L1_CACHE_LINE_SIZE 628 addi r6,r6,L1_CACHE_BYTES
759 bdnz 1b 629 bdnz 1b
760 sync 630 sync
761 isync 631 isync
@@ -778,16 +648,16 @@ END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE)
778 mtmsr r0 648 mtmsr r0
779 isync 649 isync
780 rlwinm r3,r3,0,0,19 /* Get page base address */ 650 rlwinm r3,r3,0,0,19 /* Get page base address */
781 li r4,4096/L1_CACHE_LINE_SIZE /* Number of lines in a page */ 651 li r4,4096/L1_CACHE_BYTES /* Number of lines in a page */
782 mtctr r4 652 mtctr r4
783 mr r6,r3 653 mr r6,r3
7840: dcbst 0,r3 /* Write line to ram */ 6540: dcbst 0,r3 /* Write line to ram */
785 addi r3,r3,L1_CACHE_LINE_SIZE 655 addi r3,r3,L1_CACHE_BYTES
786 bdnz 0b 656 bdnz 0b
787 sync 657 sync
788 mtctr r4 658 mtctr r4
7891: icbi 0,r6 6591: icbi 0,r6
790 addi r6,r6,L1_CACHE_LINE_SIZE 660 addi r6,r6,L1_CACHE_BYTES
791 bdnz 1b 661 bdnz 1b
792 sync 662 sync
793 mtmsr r10 /* restore DR */ 663 mtmsr r10 /* restore DR */
@@ -802,7 +672,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE)
802 * void clear_pages(void *page, int order) ; 672 * void clear_pages(void *page, int order) ;
803 */ 673 */
804_GLOBAL(clear_pages) 674_GLOBAL(clear_pages)
805 li r0,4096/L1_CACHE_LINE_SIZE 675 li r0,4096/L1_CACHE_BYTES
806 slw r0,r0,r4 676 slw r0,r0,r4
807 mtctr r0 677 mtctr r0
808#ifdef CONFIG_8xx 678#ifdef CONFIG_8xx
@@ -814,7 +684,7 @@ _GLOBAL(clear_pages)
814#else 684#else
8151: dcbz 0,r3 6851: dcbz 0,r3
816#endif 686#endif
817 addi r3,r3,L1_CACHE_LINE_SIZE 687 addi r3,r3,L1_CACHE_BYTES
818 bdnz 1b 688 bdnz 1b
819 blr 689 blr
820 690
@@ -840,7 +710,7 @@ _GLOBAL(copy_page)
840 710
841#ifdef CONFIG_8xx 711#ifdef CONFIG_8xx
842 /* don't use prefetch on 8xx */ 712 /* don't use prefetch on 8xx */
843 li r0,4096/L1_CACHE_LINE_SIZE 713 li r0,4096/L1_CACHE_BYTES
844 mtctr r0 714 mtctr r0
8451: COPY_16_BYTES 7151: COPY_16_BYTES
846 bdnz 1b 716 bdnz 1b
@@ -854,13 +724,13 @@ _GLOBAL(copy_page)
854 li r11,4 724 li r11,4
855 mtctr r0 725 mtctr r0
85611: dcbt r11,r4 72611: dcbt r11,r4
857 addi r11,r11,L1_CACHE_LINE_SIZE 727 addi r11,r11,L1_CACHE_BYTES
858 bdnz 11b 728 bdnz 11b
859#else /* MAX_COPY_PREFETCH == 1 */ 729#else /* MAX_COPY_PREFETCH == 1 */
860 dcbt r5,r4 730 dcbt r5,r4
861 li r11,L1_CACHE_LINE_SIZE+4 731 li r11,L1_CACHE_BYTES+4
862#endif /* MAX_COPY_PREFETCH */ 732#endif /* MAX_COPY_PREFETCH */
863 li r0,4096/L1_CACHE_LINE_SIZE - MAX_COPY_PREFETCH 733 li r0,4096/L1_CACHE_BYTES - MAX_COPY_PREFETCH
864 crclr 4*cr0+eq 734 crclr 4*cr0+eq
8652: 7352:
866 mtctr r0 736 mtctr r0
@@ -868,12 +738,12 @@ _GLOBAL(copy_page)
868 dcbt r11,r4 738 dcbt r11,r4
869 dcbz r5,r3 739 dcbz r5,r3
870 COPY_16_BYTES 740 COPY_16_BYTES
871#if L1_CACHE_LINE_SIZE >= 32 741#if L1_CACHE_BYTES >= 32
872 COPY_16_BYTES 742 COPY_16_BYTES
873#if L1_CACHE_LINE_SIZE >= 64 743#if L1_CACHE_BYTES >= 64
874 COPY_16_BYTES 744 COPY_16_BYTES
875 COPY_16_BYTES 745 COPY_16_BYTES
876#if L1_CACHE_LINE_SIZE >= 128 746#if L1_CACHE_BYTES >= 128
877 COPY_16_BYTES 747 COPY_16_BYTES
878 COPY_16_BYTES 748 COPY_16_BYTES
879 COPY_16_BYTES 749 COPY_16_BYTES
@@ -1098,33 +968,6 @@ _GLOBAL(_get_SP)
1098 blr 968 blr
1099 969
1100/* 970/*
1101 * These are used in the alignment trap handler when emulating
1102 * single-precision loads and stores.
1103 * We restore and save the fpscr so the task gets the same result
1104 * and exceptions as if the cpu had performed the load or store.
1105 */
1106
1107#ifdef CONFIG_PPC_FPU
1108_GLOBAL(cvt_fd)
1109 lfd 0,-4(r5) /* load up fpscr value */
1110 mtfsf 0xff,0
1111 lfs 0,0(r3)
1112 stfd 0,0(r4)
1113 mffs 0 /* save new fpscr value */
1114 stfd 0,-4(r5)
1115 blr
1116
1117_GLOBAL(cvt_df)
1118 lfd 0,-4(r5) /* load up fpscr value */
1119 mtfsf 0xff,0
1120 lfd 0,0(r3)
1121 stfs 0,0(r4)
1122 mffs 0 /* save new fpscr value */
1123 stfd 0,-4(r5)
1124 blr
1125#endif
1126
1127/*
1128 * Create a kernel thread 971 * Create a kernel thread
1129 * kernel_thread(fn, arg, flags) 972 * kernel_thread(fn, arg, flags)
1130 */ 973 */
diff --git a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c
index 854e45beb387..e8f4e576750a 100644
--- a/arch/ppc/kernel/pci.c
+++ b/arch/ppc/kernel/pci.c
@@ -21,6 +21,7 @@
21#include <asm/byteorder.h> 21#include <asm/byteorder.h>
22#include <asm/irq.h> 22#include <asm/irq.h>
23#include <asm/uaccess.h> 23#include <asm/uaccess.h>
24#include <asm/machdep.h>
24 25
25#undef DEBUG 26#undef DEBUG
26 27
@@ -53,7 +54,7 @@ static u8* pci_to_OF_bus_map;
53/* By default, we don't re-assign bus numbers. We do this only on 54/* By default, we don't re-assign bus numbers. We do this only on
54 * some pmacs 55 * some pmacs
55 */ 56 */
56int pci_assign_all_busses; 57int pci_assign_all_buses;
57 58
58struct pci_controller* hose_head; 59struct pci_controller* hose_head;
59struct pci_controller** hose_tail = &hose_head; 60struct pci_controller** hose_tail = &hose_head;
@@ -644,7 +645,7 @@ pcibios_alloc_controller(void)
644/* 645/*
645 * Functions below are used on OpenFirmware machines. 646 * Functions below are used on OpenFirmware machines.
646 */ 647 */
647static void __openfirmware 648static void
648make_one_node_map(struct device_node* node, u8 pci_bus) 649make_one_node_map(struct device_node* node, u8 pci_bus)
649{ 650{
650 int *bus_range; 651 int *bus_range;
@@ -678,7 +679,7 @@ make_one_node_map(struct device_node* node, u8 pci_bus)
678 } 679 }
679} 680}
680 681
681void __openfirmware 682void
682pcibios_make_OF_bus_map(void) 683pcibios_make_OF_bus_map(void)
683{ 684{
684 int i; 685 int i;
@@ -720,7 +721,7 @@ pcibios_make_OF_bus_map(void)
720 721
721typedef int (*pci_OF_scan_iterator)(struct device_node* node, void* data); 722typedef int (*pci_OF_scan_iterator)(struct device_node* node, void* data);
722 723
723static struct device_node* __openfirmware 724static struct device_node*
724scan_OF_pci_childs(struct device_node* node, pci_OF_scan_iterator filter, void* data) 725scan_OF_pci_childs(struct device_node* node, pci_OF_scan_iterator filter, void* data)
725{ 726{
726 struct device_node* sub_node; 727 struct device_node* sub_node;
@@ -761,7 +762,7 @@ scan_OF_pci_childs_iterator(struct device_node* node, void* data)
761 return 0; 762 return 0;
762} 763}
763 764
764static struct device_node* __openfirmware 765static struct device_node*
765scan_OF_childs_for_device(struct device_node* node, u8 bus, u8 dev_fn) 766scan_OF_childs_for_device(struct device_node* node, u8 bus, u8 dev_fn)
766{ 767{
767 u8 filter_data[2] = {bus, dev_fn}; 768 u8 filter_data[2] = {bus, dev_fn};
@@ -813,18 +814,20 @@ pci_busdev_to_OF_node(struct pci_bus *bus, int devfn)
813 /* Now, lookup childs of the hose */ 814 /* Now, lookup childs of the hose */
814 return scan_OF_childs_for_device(node->child, busnr, devfn); 815 return scan_OF_childs_for_device(node->child, busnr, devfn);
815} 816}
817EXPORT_SYMBOL(pci_busdev_to_OF_node);
816 818
817struct device_node* 819struct device_node*
818pci_device_to_OF_node(struct pci_dev *dev) 820pci_device_to_OF_node(struct pci_dev *dev)
819{ 821{
820 return pci_busdev_to_OF_node(dev->bus, dev->devfn); 822 return pci_busdev_to_OF_node(dev->bus, dev->devfn);
821} 823}
824EXPORT_SYMBOL(pci_device_to_OF_node);
822 825
823/* This routine is meant to be used early during boot, when the 826/* This routine is meant to be used early during boot, when the
824 * PCI bus numbers have not yet been assigned, and you need to 827 * PCI bus numbers have not yet been assigned, and you need to
825 * issue PCI config cycles to an OF device. 828 * issue PCI config cycles to an OF device.
826 * It could also be used to "fix" RTAS config cycles if you want 829 * It could also be used to "fix" RTAS config cycles if you want
827 * to set pci_assign_all_busses to 1 and still use RTAS for PCI 830 * to set pci_assign_all_buses to 1 and still use RTAS for PCI
828 * config cycles. 831 * config cycles.
829 */ 832 */
830struct pci_controller* 833struct pci_controller*
@@ -842,7 +845,7 @@ pci_find_hose_for_OF_device(struct device_node* node)
842 return NULL; 845 return NULL;
843} 846}
844 847
845static int __openfirmware 848static int
846find_OF_pci_device_filter(struct device_node* node, void* data) 849find_OF_pci_device_filter(struct device_node* node, void* data)
847{ 850{
848 return ((void *)node == data); 851 return ((void *)node == data);
@@ -890,6 +893,7 @@ pci_device_from_OF_node(struct device_node* node, u8* bus, u8* devfn)
890 } 893 }
891 return -ENODEV; 894 return -ENODEV;
892} 895}
896EXPORT_SYMBOL(pci_device_from_OF_node);
893 897
894void __init 898void __init
895pci_process_bridge_OF_ranges(struct pci_controller *hose, 899pci_process_bridge_OF_ranges(struct pci_controller *hose,
@@ -1030,6 +1034,10 @@ static ssize_t pci_show_devspec(struct device *dev, struct device_attribute *att
1030} 1034}
1031static DEVICE_ATTR(devspec, S_IRUGO, pci_show_devspec, NULL); 1035static DEVICE_ATTR(devspec, S_IRUGO, pci_show_devspec, NULL);
1032 1036
1037#else /* CONFIG_PPC_OF */
1038void pcibios_make_OF_bus_map(void)
1039{
1040}
1033#endif /* CONFIG_PPC_OF */ 1041#endif /* CONFIG_PPC_OF */
1034 1042
1035/* Add sysfs properties */ 1043/* Add sysfs properties */
@@ -1262,12 +1270,12 @@ pcibios_init(void)
1262 1270
1263 /* Scan all of the recorded PCI controllers. */ 1271 /* Scan all of the recorded PCI controllers. */
1264 for (next_busno = 0, hose = hose_head; hose; hose = hose->next) { 1272 for (next_busno = 0, hose = hose_head; hose; hose = hose->next) {
1265 if (pci_assign_all_busses) 1273 if (pci_assign_all_buses)
1266 hose->first_busno = next_busno; 1274 hose->first_busno = next_busno;
1267 hose->last_busno = 0xff; 1275 hose->last_busno = 0xff;
1268 bus = pci_scan_bus(hose->first_busno, hose->ops, hose); 1276 bus = pci_scan_bus(hose->first_busno, hose->ops, hose);
1269 hose->last_busno = bus->subordinate; 1277 hose->last_busno = bus->subordinate;
1270 if (pci_assign_all_busses || next_busno <= hose->last_busno) 1278 if (pci_assign_all_buses || next_busno <= hose->last_busno)
1271 next_busno = hose->last_busno + pcibios_assign_bus_offset; 1279 next_busno = hose->last_busno + pcibios_assign_bus_offset;
1272 } 1280 }
1273 pci_bus_count = next_busno; 1281 pci_bus_count = next_busno;
@@ -1276,7 +1284,7 @@ pcibios_init(void)
1276 * numbers vs. kernel bus numbers since we may have to 1284 * numbers vs. kernel bus numbers since we may have to
1277 * remap them. 1285 * remap them.
1278 */ 1286 */
1279 if (pci_assign_all_busses && have_of) 1287 if (pci_assign_all_buses && have_of)
1280 pcibios_make_OF_bus_map(); 1288 pcibios_make_OF_bus_map();
1281 1289
1282 /* Do machine dependent PCI interrupt routing */ 1290 /* Do machine dependent PCI interrupt routing */
@@ -1586,16 +1594,17 @@ static pgprot_t __pci_mmap_set_pgprot(struct pci_dev *dev, struct resource *rp,
1586 * above routine 1594 * above routine
1587 */ 1595 */
1588pgprot_t pci_phys_mem_access_prot(struct file *file, 1596pgprot_t pci_phys_mem_access_prot(struct file *file,
1589 unsigned long offset, 1597 unsigned long pfn,
1590 unsigned long size, 1598 unsigned long size,
1591 pgprot_t protection) 1599 pgprot_t protection)
1592{ 1600{
1593 struct pci_dev *pdev = NULL; 1601 struct pci_dev *pdev = NULL;
1594 struct resource *found = NULL; 1602 struct resource *found = NULL;
1595 unsigned long prot = pgprot_val(protection); 1603 unsigned long prot = pgprot_val(protection);
1604 unsigned long offset = pfn << PAGE_SHIFT;
1596 int i; 1605 int i;
1597 1606
1598 if (page_is_ram(offset >> PAGE_SHIFT)) 1607 if (page_is_ram(pfn))
1599 return prot; 1608 return prot;
1600 1609
1601 prot |= _PAGE_NO_CACHE | _PAGE_GUARDED; 1610 prot |= _PAGE_NO_CACHE | _PAGE_GUARDED;
diff --git a/arch/ppc/kernel/perfmon.c b/arch/ppc/kernel/perfmon.c
deleted file mode 100644
index 22df9a596a0f..000000000000
--- a/arch/ppc/kernel/perfmon.c
+++ /dev/null
@@ -1,96 +0,0 @@
1/* kernel/perfmon.c
2 * PPC 32 Performance Monitor Infrastructure
3 *
4 * Author: Andy Fleming
5 * Copyright (c) 2004 Freescale Semiconductor, Inc
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
10 * 2 of the License, or (at your option) any later version.
11 */
12
13#include <linux/errno.h>
14#include <linux/sched.h>
15#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>
21#include <linux/user.h>
22#include <linux/a.out.h>
23#include <linux/interrupt.h>
24#include <linux/config.h>
25#include <linux/init.h>
26#include <linux/module.h>
27#include <linux/prctl.h>
28
29#include <asm/pgtable.h>
30#include <asm/uaccess.h>
31#include <asm/system.h>
32#include <asm/io.h>
33#include <asm/reg.h>
34#include <asm/xmon.h>
35
36/* A lock to regulate grabbing the interrupt */
37DEFINE_SPINLOCK(perfmon_lock);
38
39#if defined (CONFIG_FSL_BOOKE) && !defined (CONFIG_E200)
40static void dummy_perf(struct pt_regs *regs)
41{
42 unsigned int pmgc0 = mfpmr(PMRN_PMGC0);
43
44 pmgc0 &= ~PMGC0_PMIE;
45 mtpmr(PMRN_PMGC0, pmgc0);
46}
47
48#elif defined(CONFIG_6xx)
49/* Ensure exceptions are disabled */
50static void dummy_perf(struct pt_regs *regs)
51{
52 unsigned int mmcr0 = mfspr(SPRN_MMCR0);
53
54 mmcr0 &= ~MMCR0_PMXE;
55 mtspr(SPRN_MMCR0, mmcr0);
56}
57#else
58static void dummy_perf(struct pt_regs *regs)
59{
60}
61#endif
62
63void (*perf_irq)(struct pt_regs *) = dummy_perf;
64
65/* Grab the interrupt, if it's free.
66 * Returns 0 on success, -1 if the interrupt is taken already */
67int request_perfmon_irq(void (*handler)(struct pt_regs *))
68{
69 int err = 0;
70
71 spin_lock(&perfmon_lock);
72
73 if (perf_irq == dummy_perf)
74 perf_irq = handler;
75 else {
76 pr_info("perfmon irq already handled by %p\n", perf_irq);
77 err = -1;
78 }
79
80 spin_unlock(&perfmon_lock);
81
82 return err;
83}
84
85void free_perfmon_irq(void)
86{
87 spin_lock(&perfmon_lock);
88
89 perf_irq = dummy_perf;
90
91 spin_unlock(&perfmon_lock);
92}
93
94EXPORT_SYMBOL(perf_irq);
95EXPORT_SYMBOL(request_perfmon_irq);
96EXPORT_SYMBOL(free_perfmon_irq);
diff --git a/arch/ppc/kernel/perfmon_fsl_booke.c b/arch/ppc/kernel/perfmon_fsl_booke.c
index 03526bfb0840..32455dfcc36b 100644
--- a/arch/ppc/kernel/perfmon_fsl_booke.c
+++ b/arch/ppc/kernel/perfmon_fsl_booke.c
@@ -32,7 +32,7 @@
32#include <asm/io.h> 32#include <asm/io.h>
33#include <asm/reg.h> 33#include <asm/reg.h>
34#include <asm/xmon.h> 34#include <asm/xmon.h>
35#include <asm/perfmon.h> 35#include <asm/pmc.h>
36 36
37static inline u32 get_pmlca(int ctr); 37static inline u32 get_pmlca(int ctr);
38static inline void set_pmlca(int ctr, u32 pmlca); 38static inline void set_pmlca(int ctr, u32 pmlca);
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
index 88f6bb7b6964..ae24196d78f6 100644
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -53,10 +53,10 @@
53 53
54extern void transfer_to_handler(void); 54extern void transfer_to_handler(void);
55extern void do_IRQ(struct pt_regs *regs); 55extern void do_IRQ(struct pt_regs *regs);
56extern void MachineCheckException(struct pt_regs *regs); 56extern void machine_check_exception(struct pt_regs *regs);
57extern void AlignmentException(struct pt_regs *regs); 57extern void alignment_exception(struct pt_regs *regs);
58extern void ProgramCheckException(struct pt_regs *regs); 58extern void program_check_exception(struct pt_regs *regs);
59extern void SingleStepException(struct pt_regs *regs); 59extern void single_step_exception(struct pt_regs *regs);
60extern int do_signal(sigset_t *, struct pt_regs *); 60extern int do_signal(sigset_t *, struct pt_regs *);
61extern int pmac_newworld; 61extern int pmac_newworld;
62extern int sys_sigreturn(struct pt_regs *regs); 62extern int sys_sigreturn(struct pt_regs *regs);
@@ -72,10 +72,10 @@ EXPORT_SYMBOL(clear_user_page);
72EXPORT_SYMBOL(do_signal); 72EXPORT_SYMBOL(do_signal);
73EXPORT_SYMBOL(transfer_to_handler); 73EXPORT_SYMBOL(transfer_to_handler);
74EXPORT_SYMBOL(do_IRQ); 74EXPORT_SYMBOL(do_IRQ);
75EXPORT_SYMBOL(MachineCheckException); 75EXPORT_SYMBOL(machine_check_exception);
76EXPORT_SYMBOL(AlignmentException); 76EXPORT_SYMBOL(alignment_exception);
77EXPORT_SYMBOL(ProgramCheckException); 77EXPORT_SYMBOL(program_check_exception);
78EXPORT_SYMBOL(SingleStepException); 78EXPORT_SYMBOL(single_step_exception);
79EXPORT_SYMBOL(sys_sigreturn); 79EXPORT_SYMBOL(sys_sigreturn);
80EXPORT_SYMBOL(ppc_n_lost_interrupts); 80EXPORT_SYMBOL(ppc_n_lost_interrupts);
81EXPORT_SYMBOL(ppc_lost_interrupts); 81EXPORT_SYMBOL(ppc_lost_interrupts);
@@ -230,9 +230,6 @@ EXPORT_SYMBOL(find_all_nodes);
230EXPORT_SYMBOL(get_property); 230EXPORT_SYMBOL(get_property);
231EXPORT_SYMBOL(request_OF_resource); 231EXPORT_SYMBOL(request_OF_resource);
232EXPORT_SYMBOL(release_OF_resource); 232EXPORT_SYMBOL(release_OF_resource);
233EXPORT_SYMBOL(pci_busdev_to_OF_node);
234EXPORT_SYMBOL(pci_device_to_OF_node);
235EXPORT_SYMBOL(pci_device_from_OF_node);
236EXPORT_SYMBOL(of_find_node_by_name); 233EXPORT_SYMBOL(of_find_node_by_name);
237EXPORT_SYMBOL(of_find_node_by_type); 234EXPORT_SYMBOL(of_find_node_by_type);
238EXPORT_SYMBOL(of_find_compatible_node); 235EXPORT_SYMBOL(of_find_compatible_node);
@@ -272,16 +269,6 @@ EXPORT_SYMBOL(screen_info);
272#endif 269#endif
273 270
274EXPORT_SYMBOL(__delay); 271EXPORT_SYMBOL(__delay);
275#ifndef INLINE_IRQS
276EXPORT_SYMBOL(local_irq_enable);
277EXPORT_SYMBOL(local_irq_enable_end);
278EXPORT_SYMBOL(local_irq_disable);
279EXPORT_SYMBOL(local_irq_disable_end);
280EXPORT_SYMBOL(local_save_flags_ptr);
281EXPORT_SYMBOL(local_save_flags_ptr_end);
282EXPORT_SYMBOL(local_irq_restore);
283EXPORT_SYMBOL(local_irq_restore_end);
284#endif
285EXPORT_SYMBOL(timer_interrupt); 272EXPORT_SYMBOL(timer_interrupt);
286EXPORT_SYMBOL(irq_desc); 273EXPORT_SYMBOL(irq_desc);
287EXPORT_SYMBOL(tb_ticks_per_jiffy); 274EXPORT_SYMBOL(tb_ticks_per_jiffy);
@@ -335,11 +322,6 @@ EXPORT_SYMBOL(mmu_hash_lock); /* For MOL */
335extern long *intercept_table; 322extern long *intercept_table;
336EXPORT_SYMBOL(intercept_table); 323EXPORT_SYMBOL(intercept_table);
337#endif /* CONFIG_PPC_STD_MMU */ 324#endif /* CONFIG_PPC_STD_MMU */
338EXPORT_SYMBOL(cur_cpu_spec);
339#ifdef CONFIG_PPC_PMAC
340extern unsigned long agp_special_page;
341EXPORT_SYMBOL(agp_special_page);
342#endif
343#if defined(CONFIG_40x) || defined(CONFIG_BOOKE) 325#if defined(CONFIG_40x) || defined(CONFIG_BOOKE)
344EXPORT_SYMBOL(__mtdcr); 326EXPORT_SYMBOL(__mtdcr);
345EXPORT_SYMBOL(__mfdcr); 327EXPORT_SYMBOL(__mfdcr);
diff --git a/arch/ppc/kernel/process.c b/arch/ppc/kernel/process.c
index 82de66e4db6d..cb1c7b92f8c6 100644
--- a/arch/ppc/kernel/process.c
+++ b/arch/ppc/kernel/process.c
@@ -152,18 +152,66 @@ int check_stack(struct task_struct *tsk)
152} 152}
153#endif /* defined(CHECK_STACK) */ 153#endif /* defined(CHECK_STACK) */
154 154
155#ifdef CONFIG_ALTIVEC 155/*
156int 156 * Make sure the floating-point register state in the
157dump_altivec(struct pt_regs *regs, elf_vrregset_t *vrregs) 157 * the thread_struct is up to date for task tsk.
158 */
159void flush_fp_to_thread(struct task_struct *tsk)
158{ 160{
159 if (regs->msr & MSR_VEC) 161 if (tsk->thread.regs) {
160 giveup_altivec(current); 162 /*
161 memcpy(vrregs, &current->thread.vr[0], sizeof(*vrregs)); 163 * We need to disable preemption here because if we didn't,
164 * another process could get scheduled after the regs->msr
165 * test but before we have finished saving the FP registers
166 * to the thread_struct. That process could take over the
167 * FPU, and then when we get scheduled again we would store
168 * bogus values for the remaining FP registers.
169 */
170 preempt_disable();
171 if (tsk->thread.regs->msr & MSR_FP) {
172#ifdef CONFIG_SMP
173 /*
174 * This should only ever be called for current or
175 * for a stopped child process. Since we save away
176 * the FP register state on context switch on SMP,
177 * there is something wrong if a stopped child appears
178 * to still have its FP state in the CPU registers.
179 */
180 BUG_ON(tsk != current);
181#endif
182 giveup_fpu(current);
183 }
184 preempt_enable();
185 }
186}
187
188void enable_kernel_fp(void)
189{
190 WARN_ON(preemptible());
191
192#ifdef CONFIG_SMP
193 if (current->thread.regs && (current->thread.regs->msr & MSR_FP))
194 giveup_fpu(current);
195 else
196 giveup_fpu(NULL); /* just enables FP for kernel */
197#else
198 giveup_fpu(last_task_used_math);
199#endif /* CONFIG_SMP */
200}
201EXPORT_SYMBOL(enable_kernel_fp);
202
203int dump_task_fpu(struct task_struct *tsk, elf_fpregset_t *fpregs)
204{
205 preempt_disable();
206 if (tsk->thread.regs && (tsk->thread.regs->msr & MSR_FP))
207 giveup_fpu(tsk);
208 preempt_enable();
209 memcpy(fpregs, &tsk->thread.fpr[0], sizeof(*fpregs));
162 return 1; 210 return 1;
163} 211}
164 212
165void 213#ifdef CONFIG_ALTIVEC
166enable_kernel_altivec(void) 214void enable_kernel_altivec(void)
167{ 215{
168 WARN_ON(preemptible()); 216 WARN_ON(preemptible());
169 217
@@ -177,19 +225,35 @@ enable_kernel_altivec(void)
177#endif /* __SMP __ */ 225#endif /* __SMP __ */
178} 226}
179EXPORT_SYMBOL(enable_kernel_altivec); 227EXPORT_SYMBOL(enable_kernel_altivec);
180#endif /* CONFIG_ALTIVEC */
181 228
182#ifdef CONFIG_SPE 229/*
183int 230 * Make sure the VMX/Altivec register state in the
184dump_spe(struct pt_regs *regs, elf_vrregset_t *evrregs) 231 * the thread_struct is up to date for task tsk.
232 */
233void flush_altivec_to_thread(struct task_struct *tsk)
185{ 234{
186 if (regs->msr & MSR_SPE) 235 if (tsk->thread.regs) {
187 giveup_spe(current); 236 preempt_disable();
188 /* We copy u32 evr[32] + u64 acc + u32 spefscr -> 35 */ 237 if (tsk->thread.regs->msr & MSR_VEC) {
189 memcpy(evrregs, &current->thread.evr[0], sizeof(u32) * 35); 238#ifdef CONFIG_SMP
239 BUG_ON(tsk != current);
240#endif
241 giveup_altivec(current);
242 }
243 preempt_enable();
244 }
245}
246
247int dump_altivec(struct pt_regs *regs, elf_vrregset_t *vrregs)
248{
249 if (regs->msr & MSR_VEC)
250 giveup_altivec(current);
251 memcpy(vrregs, &current->thread.vr[0], sizeof(*vrregs));
190 return 1; 252 return 1;
191} 253}
254#endif /* CONFIG_ALTIVEC */
192 255
256#ifdef CONFIG_SPE
193void 257void
194enable_kernel_spe(void) 258enable_kernel_spe(void)
195{ 259{
@@ -205,34 +269,30 @@ enable_kernel_spe(void)
205#endif /* __SMP __ */ 269#endif /* __SMP __ */
206} 270}
207EXPORT_SYMBOL(enable_kernel_spe); 271EXPORT_SYMBOL(enable_kernel_spe);
208#endif /* CONFIG_SPE */
209 272
210void 273void flush_spe_to_thread(struct task_struct *tsk)
211enable_kernel_fp(void)
212{ 274{
213 WARN_ON(preemptible()); 275 if (tsk->thread.regs) {
214 276 preempt_disable();
277 if (tsk->thread.regs->msr & MSR_SPE) {
215#ifdef CONFIG_SMP 278#ifdef CONFIG_SMP
216 if (current->thread.regs && (current->thread.regs->msr & MSR_FP)) 279 BUG_ON(tsk != current);
217 giveup_fpu(current); 280#endif
218 else 281 giveup_spe(current);
219 giveup_fpu(NULL); /* just enables FP for kernel */ 282 }
220#else 283 preempt_enable();
221 giveup_fpu(last_task_used_math); 284 }
222#endif /* CONFIG_SMP */
223} 285}
224EXPORT_SYMBOL(enable_kernel_fp);
225 286
226int 287int dump_spe(struct pt_regs *regs, elf_vrregset_t *evrregs)
227dump_task_fpu(struct task_struct *tsk, elf_fpregset_t *fpregs)
228{ 288{
229 preempt_disable(); 289 if (regs->msr & MSR_SPE)
230 if (tsk->thread.regs && (tsk->thread.regs->msr & MSR_FP)) 290 giveup_spe(current);
231 giveup_fpu(tsk); 291 /* We copy u32 evr[32] + u64 acc + u32 spefscr -> 35 */
232 preempt_enable(); 292 memcpy(evrregs, &current->thread.evr[0], sizeof(u32) * 35);
233 memcpy(fpregs, &tsk->thread.fpr[0], sizeof(*fpregs));
234 return 1; 293 return 1;
235} 294}
295#endif /* CONFIG_SPE */
236 296
237struct task_struct *__switch_to(struct task_struct *prev, 297struct task_struct *__switch_to(struct task_struct *prev,
238 struct task_struct *new) 298 struct task_struct *new)
@@ -287,11 +347,13 @@ struct task_struct *__switch_to(struct task_struct *prev,
287#endif /* CONFIG_SPE */ 347#endif /* CONFIG_SPE */
288#endif /* CONFIG_SMP */ 348#endif /* CONFIG_SMP */
289 349
350#ifdef CONFIG_ALTIVEC
290 /* Avoid the trap. On smp this this never happens since 351 /* Avoid the trap. On smp this this never happens since
291 * we don't set last_task_used_altivec -- Cort 352 * we don't set last_task_used_altivec -- Cort
292 */ 353 */
293 if (new->thread.regs && last_task_used_altivec == new) 354 if (new->thread.regs && last_task_used_altivec == new)
294 new->thread.regs->msr |= MSR_VEC; 355 new->thread.regs->msr |= MSR_VEC;
356#endif
295#ifdef CONFIG_SPE 357#ifdef CONFIG_SPE
296 /* Avoid the trap. On smp this this never happens since 358 /* Avoid the trap. On smp this this never happens since
297 * we don't set last_task_used_spe 359 * we don't set last_task_used_spe
@@ -482,7 +544,7 @@ void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp)
482 last_task_used_spe = NULL; 544 last_task_used_spe = NULL;
483#endif 545#endif
484 memset(current->thread.fpr, 0, sizeof(current->thread.fpr)); 546 memset(current->thread.fpr, 0, sizeof(current->thread.fpr));
485 current->thread.fpscr = 0; 547 current->thread.fpscr.val = 0;
486#ifdef CONFIG_ALTIVEC 548#ifdef CONFIG_ALTIVEC
487 memset(current->thread.vr, 0, sizeof(current->thread.vr)); 549 memset(current->thread.vr, 0, sizeof(current->thread.vr));
488 memset(&current->thread.vscr, 0, sizeof(current->thread.vscr)); 550 memset(&current->thread.vscr, 0, sizeof(current->thread.vscr));
@@ -557,14 +619,16 @@ int sys_clone(unsigned long clone_flags, unsigned long usp,
557 return do_fork(clone_flags, usp, regs, 0, parent_tidp, child_tidp); 619 return do_fork(clone_flags, usp, regs, 0, parent_tidp, child_tidp);
558} 620}
559 621
560int sys_fork(int p1, int p2, int p3, int p4, int p5, int p6, 622int sys_fork(unsigned long p1, unsigned long p2, unsigned long p3,
623 unsigned long p4, unsigned long p5, unsigned long p6,
561 struct pt_regs *regs) 624 struct pt_regs *regs)
562{ 625{
563 CHECK_FULL_REGS(regs); 626 CHECK_FULL_REGS(regs);
564 return do_fork(SIGCHLD, regs->gpr[1], regs, 0, NULL, NULL); 627 return do_fork(SIGCHLD, regs->gpr[1], regs, 0, NULL, NULL);
565} 628}
566 629
567int sys_vfork(int p1, int p2, int p3, int p4, int p5, int p6, 630int sys_vfork(unsigned long p1, unsigned long p2, unsigned long p3,
631 unsigned long p4, unsigned long p5, unsigned long p6,
568 struct pt_regs *regs) 632 struct pt_regs *regs)
569{ 633{
570 CHECK_FULL_REGS(regs); 634 CHECK_FULL_REGS(regs);
diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c
index 545cfd0fab59..6bcb85d2b7fd 100644
--- a/arch/ppc/kernel/setup.c
+++ b/arch/ppc/kernel/setup.c
@@ -71,7 +71,8 @@ struct ide_machdep_calls ppc_ide_md;
71unsigned long boot_mem_size; 71unsigned long boot_mem_size;
72 72
73unsigned long ISA_DMA_THRESHOLD; 73unsigned long ISA_DMA_THRESHOLD;
74unsigned long DMA_MODE_READ, DMA_MODE_WRITE; 74unsigned int DMA_MODE_READ;
75unsigned int DMA_MODE_WRITE;
75 76
76#ifdef CONFIG_PPC_MULTIPLATFORM 77#ifdef CONFIG_PPC_MULTIPLATFORM
77int _machine = 0; 78int _machine = 0;
@@ -82,8 +83,18 @@ extern void pmac_init(unsigned long r3, unsigned long r4,
82 unsigned long r5, unsigned long r6, unsigned long r7); 83 unsigned long r5, unsigned long r6, unsigned long r7);
83extern void chrp_init(unsigned long r3, unsigned long r4, 84extern void chrp_init(unsigned long r3, unsigned long r4,
84 unsigned long r5, unsigned long r6, unsigned long r7); 85 unsigned long r5, unsigned long r6, unsigned long r7);
86
87dev_t boot_dev;
85#endif /* CONFIG_PPC_MULTIPLATFORM */ 88#endif /* CONFIG_PPC_MULTIPLATFORM */
86 89
90int have_of;
91EXPORT_SYMBOL(have_of);
92
93#ifdef __DO_IRQ_CANON
94int ppc_do_canonicalize_irqs;
95EXPORT_SYMBOL(ppc_do_canonicalize_irqs);
96#endif
97
87#ifdef CONFIG_MAGIC_SYSRQ 98#ifdef CONFIG_MAGIC_SYSRQ
88unsigned long SYSRQ_KEY = 0x54; 99unsigned long SYSRQ_KEY = 0x54;
89#endif /* CONFIG_MAGIC_SYSRQ */ 100#endif /* CONFIG_MAGIC_SYSRQ */
@@ -185,18 +196,18 @@ int show_cpuinfo(struct seq_file *m, void *v)
185 seq_printf(m, "processor\t: %d\n", i); 196 seq_printf(m, "processor\t: %d\n", i);
186 seq_printf(m, "cpu\t\t: "); 197 seq_printf(m, "cpu\t\t: ");
187 198
188 if (cur_cpu_spec[i]->pvr_mask) 199 if (cur_cpu_spec->pvr_mask)
189 seq_printf(m, "%s", cur_cpu_spec[i]->cpu_name); 200 seq_printf(m, "%s", cur_cpu_spec->cpu_name);
190 else 201 else
191 seq_printf(m, "unknown (%08x)", pvr); 202 seq_printf(m, "unknown (%08x)", pvr);
192#ifdef CONFIG_ALTIVEC 203#ifdef CONFIG_ALTIVEC
193 if (cur_cpu_spec[i]->cpu_features & CPU_FTR_ALTIVEC) 204 if (cur_cpu_spec->cpu_features & CPU_FTR_ALTIVEC)
194 seq_printf(m, ", altivec supported"); 205 seq_printf(m, ", altivec supported");
195#endif 206#endif
196 seq_printf(m, "\n"); 207 seq_printf(m, "\n");
197 208
198#ifdef CONFIG_TAU 209#ifdef CONFIG_TAU
199 if (cur_cpu_spec[i]->cpu_features & CPU_FTR_TAU) { 210 if (cur_cpu_spec->cpu_features & CPU_FTR_TAU) {
200#ifdef CONFIG_TAU_AVERAGE 211#ifdef CONFIG_TAU_AVERAGE
201 /* more straightforward, but potentially misleading */ 212 /* more straightforward, but potentially misleading */
202 seq_printf(m, "temperature \t: %u C (uncalibrated)\n", 213 seq_printf(m, "temperature \t: %u C (uncalibrated)\n",
@@ -339,7 +350,7 @@ early_init(int r3, int r4, int r5)
339 * Assume here that all clock rates are the same in a 350 * Assume here that all clock rates are the same in a
340 * smp system. -- Cort 351 * smp system. -- Cort
341 */ 352 */
342int __openfirmware 353int
343of_show_percpuinfo(struct seq_file *m, int i) 354of_show_percpuinfo(struct seq_file *m, int i)
344{ 355{
345 struct device_node *cpu_node; 356 struct device_node *cpu_node;
@@ -404,11 +415,15 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
404 _machine = _MACH_prep; 415 _machine = _MACH_prep;
405 } 416 }
406 417
418#ifdef CONFIG_PPC_PREP
407 /* not much more to do here, if prep */ 419 /* not much more to do here, if prep */
408 if (_machine == _MACH_prep) { 420 if (_machine == _MACH_prep) {
409 prep_init(r3, r4, r5, r6, r7); 421 prep_init(r3, r4, r5, r6, r7);
410 return; 422 return;
411 } 423 }
424#endif
425
426 have_of = 1;
412 427
413 /* prom_init has already been called from __start */ 428 /* prom_init has already been called from __start */
414 if (boot_infos) 429 if (boot_infos)
@@ -479,12 +494,16 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
479#endif /* CONFIG_ADB */ 494#endif /* CONFIG_ADB */
480 495
481 switch (_machine) { 496 switch (_machine) {
497#ifdef CONFIG_PPC_PMAC
482 case _MACH_Pmac: 498 case _MACH_Pmac:
483 pmac_init(r3, r4, r5, r6, r7); 499 pmac_init(r3, r4, r5, r6, r7);
484 break; 500 break;
501#endif
502#ifdef CONFIG_PPC_CHRP
485 case _MACH_chrp: 503 case _MACH_chrp:
486 chrp_init(r3, r4, r5, r6, r7); 504 chrp_init(r3, r4, r5, r6, r7);
487 break; 505 break;
506#endif
488 } 507 }
489} 508}
490 509
@@ -721,7 +740,7 @@ void __init setup_arch(char **cmdline_p)
721#endif 740#endif
722 741
723#ifdef CONFIG_XMON 742#ifdef CONFIG_XMON
724 xmon_map_scc(); 743 xmon_init(1);
725 if (strstr(cmd_line, "xmon")) 744 if (strstr(cmd_line, "xmon"))
726 xmon(NULL); 745 xmon(NULL);
727#endif /* CONFIG_XMON */ 746#endif /* CONFIG_XMON */
@@ -745,12 +764,12 @@ void __init setup_arch(char **cmdline_p)
745 * for a possibly more accurate value. 764 * for a possibly more accurate value.
746 */ 765 */
747 if (cpu_has_feature(CPU_FTR_SPLIT_ID_CACHE)) { 766 if (cpu_has_feature(CPU_FTR_SPLIT_ID_CACHE)) {
748 dcache_bsize = cur_cpu_spec[0]->dcache_bsize; 767 dcache_bsize = cur_cpu_spec->dcache_bsize;
749 icache_bsize = cur_cpu_spec[0]->icache_bsize; 768 icache_bsize = cur_cpu_spec->icache_bsize;
750 ucache_bsize = 0; 769 ucache_bsize = 0;
751 } else 770 } else
752 ucache_bsize = dcache_bsize = icache_bsize 771 ucache_bsize = dcache_bsize = icache_bsize
753 = cur_cpu_spec[0]->dcache_bsize; 772 = cur_cpu_spec->dcache_bsize;
754 773
755 /* reboot on panic */ 774 /* reboot on panic */
756 panic_timeout = 180; 775 panic_timeout = 180;
diff --git a/arch/ppc/kernel/signal.c b/arch/ppc/kernel/signal.c
deleted file mode 100644
index 2244bf91e593..000000000000
--- a/arch/ppc/kernel/signal.c
+++ /dev/null
@@ -1,771 +0,0 @@
1/*
2 * arch/ppc/kernel/signal.c
3 *
4 * PowerPC version
5 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
6 *
7 * Derived from "arch/i386/kernel/signal.c"
8 * Copyright (C) 1991, 1992 Linus Torvalds
9 * 1997-11-28 Modified for POSIX.1b signals by Richard Henderson
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
17#include <linux/sched.h>
18#include <linux/mm.h>
19#include <linux/smp.h>
20#include <linux/smp_lock.h>
21#include <linux/kernel.h>
22#include <linux/signal.h>
23#include <linux/errno.h>
24#include <linux/wait.h>
25#include <linux/ptrace.h>
26#include <linux/unistd.h>
27#include <linux/stddef.h>
28#include <linux/elf.h>
29#include <linux/tty.h>
30#include <linux/binfmts.h>
31#include <linux/suspend.h>
32#include <asm/ucontext.h>
33#include <asm/uaccess.h>
34#include <asm/pgtable.h>
35#include <asm/cacheflush.h>
36
37#undef DEBUG_SIG
38
39#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
40
41extern void sigreturn_exit(struct pt_regs *);
42
43#define GP_REGS_SIZE min(sizeof(elf_gregset_t), sizeof(struct pt_regs))
44
45int do_signal(sigset_t *oldset, struct pt_regs *regs);
46
47/*
48 * Atomically swap in the new signal mask, and wait for a signal.
49 */
50int
51sys_sigsuspend(old_sigset_t mask, int p2, int p3, int p4, int p6, int p7,
52 struct pt_regs *regs)
53{
54 sigset_t saveset;
55
56 mask &= _BLOCKABLE;
57 spin_lock_irq(&current->sighand->siglock);
58 saveset = current->blocked;
59 siginitset(&current->blocked, mask);
60 recalc_sigpending();
61 spin_unlock_irq(&current->sighand->siglock);
62
63 regs->result = -EINTR;
64 regs->gpr[3] = EINTR;
65 regs->ccr |= 0x10000000;
66 while (1) {
67 current->state = TASK_INTERRUPTIBLE;
68 schedule();
69 if (do_signal(&saveset, regs))
70 sigreturn_exit(regs);
71 }
72}
73
74int
75sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize, int p3, int p4,
76 int p6, int p7, struct pt_regs *regs)
77{
78 sigset_t saveset, newset;
79
80 /* XXX: Don't preclude handling different sized sigset_t's. */
81 if (sigsetsize != sizeof(sigset_t))
82 return -EINVAL;
83
84 if (copy_from_user(&newset, unewset, sizeof(newset)))
85 return -EFAULT;
86 sigdelsetmask(&newset, ~_BLOCKABLE);
87
88 spin_lock_irq(&current->sighand->siglock);
89 saveset = current->blocked;
90 current->blocked = newset;
91 recalc_sigpending();
92 spin_unlock_irq(&current->sighand->siglock);
93
94 regs->result = -EINTR;
95 regs->gpr[3] = EINTR;
96 regs->ccr |= 0x10000000;
97 while (1) {
98 current->state = TASK_INTERRUPTIBLE;
99 schedule();
100 if (do_signal(&saveset, regs))
101 sigreturn_exit(regs);
102 }
103}
104
105
106int
107sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, int r5,
108 int r6, int r7, int r8, struct pt_regs *regs)
109{
110 return do_sigaltstack(uss, uoss, regs->gpr[1]);
111}
112
113int
114sys_sigaction(int sig, const struct old_sigaction __user *act,
115 struct old_sigaction __user *oact)
116{
117 struct k_sigaction new_ka, old_ka;
118 int ret;
119
120 if (act) {
121 old_sigset_t mask;
122 if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
123 __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
124 __get_user(new_ka.sa.sa_restorer, &act->sa_restorer))
125 return -EFAULT;
126 __get_user(new_ka.sa.sa_flags, &act->sa_flags);
127 __get_user(mask, &act->sa_mask);
128 siginitset(&new_ka.sa.sa_mask, mask);
129 }
130
131 ret = do_sigaction(sig, (act? &new_ka: NULL), (oact? &old_ka: NULL));
132
133 if (!ret && oact) {
134 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
135 __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
136 __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer))
137 return -EFAULT;
138 __put_user(old_ka.sa.sa_flags, &oact->sa_flags);
139 __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);
140 }
141
142 return ret;
143}
144
145/*
146 * When we have signals to deliver, we set up on the
147 * user stack, going down from the original stack pointer:
148 * a sigregs struct
149 * a sigcontext struct
150 * a gap of __SIGNAL_FRAMESIZE bytes
151 *
152 * Each of these things must be a multiple of 16 bytes in size.
153 *
154 */
155struct sigregs {
156 struct mcontext mctx; /* all the register values */
157 /* Programs using the rs6000/xcoff abi can save up to 19 gp regs
158 and 18 fp regs below sp before decrementing it. */
159 int abigap[56];
160};
161
162/* We use the mc_pad field for the signal return trampoline. */
163#define tramp mc_pad
164
165/*
166 * When we have rt signals to deliver, we set up on the
167 * user stack, going down from the original stack pointer:
168 * one rt_sigframe struct (siginfo + ucontext + ABI gap)
169 * a gap of __SIGNAL_FRAMESIZE+16 bytes
170 * (the +16 is to get the siginfo and ucontext in the same
171 * positions as in older kernels).
172 *
173 * Each of these things must be a multiple of 16 bytes in size.
174 *
175 */
176struct rt_sigframe
177{
178 struct siginfo info;
179 struct ucontext uc;
180 /* Programs using the rs6000/xcoff abi can save up to 19 gp regs
181 and 18 fp regs below sp before decrementing it. */
182 int abigap[56];
183};
184
185/*
186 * Save the current user registers on the user stack.
187 * We only save the altivec/spe registers if the process has used
188 * altivec/spe instructions at some point.
189 */
190static int
191save_user_regs(struct pt_regs *regs, struct mcontext __user *frame, int sigret)
192{
193 /* save general and floating-point registers */
194 CHECK_FULL_REGS(regs);
195 preempt_disable();
196 if (regs->msr & MSR_FP)
197 giveup_fpu(current);
198#ifdef CONFIG_ALTIVEC
199 if (current->thread.used_vr && (regs->msr & MSR_VEC))
200 giveup_altivec(current);
201#endif /* CONFIG_ALTIVEC */
202#ifdef CONFIG_SPE
203 if (current->thread.used_spe && (regs->msr & MSR_SPE))
204 giveup_spe(current);
205#endif /* CONFIG_ALTIVEC */
206 preempt_enable();
207
208 if (__copy_to_user(&frame->mc_gregs, regs, GP_REGS_SIZE)
209 || __copy_to_user(&frame->mc_fregs, current->thread.fpr,
210 ELF_NFPREG * sizeof(double)))
211 return 1;
212
213 current->thread.fpscr = 0; /* turn off all fp exceptions */
214
215#ifdef CONFIG_ALTIVEC
216 /* save altivec registers */
217 if (current->thread.used_vr) {
218 if (__copy_to_user(&frame->mc_vregs, current->thread.vr,
219 ELF_NVRREG * sizeof(vector128)))
220 return 1;
221 /* set MSR_VEC in the saved MSR value to indicate that
222 frame->mc_vregs contains valid data */
223 if (__put_user(regs->msr | MSR_VEC, &frame->mc_gregs[PT_MSR]))
224 return 1;
225 }
226 /* else assert((regs->msr & MSR_VEC) == 0) */
227
228 /* We always copy to/from vrsave, it's 0 if we don't have or don't
229 * use altivec. Since VSCR only contains 32 bits saved in the least
230 * significant bits of a vector, we "cheat" and stuff VRSAVE in the
231 * most significant bits of that same vector. --BenH
232 */
233 if (__put_user(current->thread.vrsave, (u32 __user *)&frame->mc_vregs[32]))
234 return 1;
235#endif /* CONFIG_ALTIVEC */
236
237#ifdef CONFIG_SPE
238 /* save spe registers */
239 if (current->thread.used_spe) {
240 if (__copy_to_user(&frame->mc_vregs, current->thread.evr,
241 ELF_NEVRREG * sizeof(u32)))
242 return 1;
243 /* set MSR_SPE in the saved MSR value to indicate that
244 frame->mc_vregs contains valid data */
245 if (__put_user(regs->msr | MSR_SPE, &frame->mc_gregs[PT_MSR]))
246 return 1;
247 }
248 /* else assert((regs->msr & MSR_SPE) == 0) */
249
250 /* We always copy to/from spefscr */
251 if (__put_user(current->thread.spefscr, (u32 *)&frame->mc_vregs + ELF_NEVRREG))
252 return 1;
253#endif /* CONFIG_SPE */
254
255 if (sigret) {
256 /* Set up the sigreturn trampoline: li r0,sigret; sc */
257 if (__put_user(0x38000000UL + sigret, &frame->tramp[0])
258 || __put_user(0x44000002UL, &frame->tramp[1]))
259 return 1;
260 flush_icache_range((unsigned long) &frame->tramp[0],
261 (unsigned long) &frame->tramp[2]);
262 }
263
264 return 0;
265}
266
267/*
268 * Restore the current user register values from the user stack,
269 * (except for MSR).
270 */
271static int
272restore_user_regs(struct pt_regs *regs, struct mcontext __user *sr, int sig)
273{
274 unsigned long save_r2 = 0;
275#if defined(CONFIG_ALTIVEC) || defined(CONFIG_SPE)
276 unsigned long msr;
277#endif
278
279 /* backup/restore the TLS as we don't want it to be modified */
280 if (!sig)
281 save_r2 = regs->gpr[2];
282 /* copy up to but not including MSR */
283 if (__copy_from_user(regs, &sr->mc_gregs, PT_MSR * sizeof(elf_greg_t)))
284 return 1;
285 /* copy from orig_r3 (the word after the MSR) up to the end */
286 if (__copy_from_user(&regs->orig_gpr3, &sr->mc_gregs[PT_ORIG_R3],
287 GP_REGS_SIZE - PT_ORIG_R3 * sizeof(elf_greg_t)))
288 return 1;
289 if (!sig)
290 regs->gpr[2] = save_r2;
291
292 /* force the process to reload the FP registers from
293 current->thread when it next does FP instructions */
294 regs->msr &= ~(MSR_FP | MSR_FE0 | MSR_FE1);
295 if (__copy_from_user(current->thread.fpr, &sr->mc_fregs,
296 sizeof(sr->mc_fregs)))
297 return 1;
298
299#ifdef CONFIG_ALTIVEC
300 /* force the process to reload the altivec registers from
301 current->thread when it next does altivec instructions */
302 regs->msr &= ~MSR_VEC;
303 if (!__get_user(msr, &sr->mc_gregs[PT_MSR]) && (msr & MSR_VEC) != 0) {
304 /* restore altivec registers from the stack */
305 if (__copy_from_user(current->thread.vr, &sr->mc_vregs,
306 sizeof(sr->mc_vregs)))
307 return 1;
308 } else if (current->thread.used_vr)
309 memset(&current->thread.vr, 0, ELF_NVRREG * sizeof(vector128));
310
311 /* Always get VRSAVE back */
312 if (__get_user(current->thread.vrsave, (u32 __user *)&sr->mc_vregs[32]))
313 return 1;
314#endif /* CONFIG_ALTIVEC */
315
316#ifdef CONFIG_SPE
317 /* force the process to reload the spe registers from
318 current->thread when it next does spe instructions */
319 regs->msr &= ~MSR_SPE;
320 if (!__get_user(msr, &sr->mc_gregs[PT_MSR]) && (msr & MSR_SPE) != 0) {
321 /* restore spe registers from the stack */
322 if (__copy_from_user(current->thread.evr, &sr->mc_vregs,
323 ELF_NEVRREG * sizeof(u32)))
324 return 1;
325 } else if (current->thread.used_spe)
326 memset(&current->thread.evr, 0, ELF_NEVRREG * sizeof(u32));
327
328 /* Always get SPEFSCR back */
329 if (__get_user(current->thread.spefscr, (u32 *)&sr->mc_vregs + ELF_NEVRREG))
330 return 1;
331#endif /* CONFIG_SPE */
332
333#ifndef CONFIG_SMP
334 preempt_disable();
335 if (last_task_used_math == current)
336 last_task_used_math = NULL;
337 if (last_task_used_altivec == current)
338 last_task_used_altivec = NULL;
339 if (last_task_used_spe == current)
340 last_task_used_spe = NULL;
341 preempt_enable();
342#endif
343 return 0;
344}
345
346/*
347 * Restore the user process's signal mask
348 */
349static void
350restore_sigmask(sigset_t *set)
351{
352 sigdelsetmask(set, ~_BLOCKABLE);
353 spin_lock_irq(&current->sighand->siglock);
354 current->blocked = *set;
355 recalc_sigpending();
356 spin_unlock_irq(&current->sighand->siglock);
357}
358
359/*
360 * Set up a signal frame for a "real-time" signal handler
361 * (one which gets siginfo).
362 */
363static void
364handle_rt_signal(unsigned long sig, struct k_sigaction *ka,
365 siginfo_t *info, sigset_t *oldset, struct pt_regs * regs,
366 unsigned long newsp)
367{
368 struct rt_sigframe __user *rt_sf;
369 struct mcontext __user *frame;
370 unsigned long origsp = newsp;
371
372 /* Set up Signal Frame */
373 /* Put a Real Time Context onto stack */
374 newsp -= sizeof(*rt_sf);
375 rt_sf = (struct rt_sigframe __user *) newsp;
376
377 /* create a stack frame for the caller of the handler */
378 newsp -= __SIGNAL_FRAMESIZE + 16;
379
380 if (!access_ok(VERIFY_WRITE, (void __user *) newsp, origsp - newsp))
381 goto badframe;
382
383 /* Put the siginfo & fill in most of the ucontext */
384 if (copy_siginfo_to_user(&rt_sf->info, info)
385 || __put_user(0, &rt_sf->uc.uc_flags)
386 || __put_user(0, &rt_sf->uc.uc_link)
387 || __put_user(current->sas_ss_sp, &rt_sf->uc.uc_stack.ss_sp)
388 || __put_user(sas_ss_flags(regs->gpr[1]),
389 &rt_sf->uc.uc_stack.ss_flags)
390 || __put_user(current->sas_ss_size, &rt_sf->uc.uc_stack.ss_size)
391 || __put_user(&rt_sf->uc.uc_mcontext, &rt_sf->uc.uc_regs)
392 || __copy_to_user(&rt_sf->uc.uc_sigmask, oldset, sizeof(*oldset)))
393 goto badframe;
394
395 /* Save user registers on the stack */
396 frame = &rt_sf->uc.uc_mcontext;
397 if (save_user_regs(regs, frame, __NR_rt_sigreturn))
398 goto badframe;
399
400 if (put_user(regs->gpr[1], (unsigned long __user *)newsp))
401 goto badframe;
402 regs->gpr[1] = newsp;
403 regs->gpr[3] = sig;
404 regs->gpr[4] = (unsigned long) &rt_sf->info;
405 regs->gpr[5] = (unsigned long) &rt_sf->uc;
406 regs->gpr[6] = (unsigned long) rt_sf;
407 regs->nip = (unsigned long) ka->sa.sa_handler;
408 regs->link = (unsigned long) frame->tramp;
409 regs->trap = 0;
410
411 return;
412
413badframe:
414#ifdef DEBUG_SIG
415 printk("badframe in handle_rt_signal, regs=%p frame=%p newsp=%lx\n",
416 regs, frame, newsp);
417#endif
418 force_sigsegv(sig, current);
419}
420
421static int do_setcontext(struct ucontext __user *ucp, struct pt_regs *regs, int sig)
422{
423 sigset_t set;
424 struct mcontext __user *mcp;
425
426 if (__copy_from_user(&set, &ucp->uc_sigmask, sizeof(set))
427 || __get_user(mcp, &ucp->uc_regs))
428 return -EFAULT;
429 restore_sigmask(&set);
430 if (restore_user_regs(regs, mcp, sig))
431 return -EFAULT;
432
433 return 0;
434}
435
436int sys_swapcontext(struct ucontext __user *old_ctx,
437 struct ucontext __user *new_ctx,
438 int ctx_size, int r6, int r7, int r8, struct pt_regs *regs)
439{
440 unsigned char tmp;
441
442 /* Context size is for future use. Right now, we only make sure
443 * we are passed something we understand
444 */
445 if (ctx_size < sizeof(struct ucontext))
446 return -EINVAL;
447
448 if (old_ctx != NULL) {
449 if (!access_ok(VERIFY_WRITE, old_ctx, sizeof(*old_ctx))
450 || save_user_regs(regs, &old_ctx->uc_mcontext, 0)
451 || __copy_to_user(&old_ctx->uc_sigmask,
452 &current->blocked, sizeof(sigset_t))
453 || __put_user(&old_ctx->uc_mcontext, &old_ctx->uc_regs))
454 return -EFAULT;
455 }
456 if (new_ctx == NULL)
457 return 0;
458 if (!access_ok(VERIFY_READ, new_ctx, sizeof(*new_ctx))
459 || __get_user(tmp, (u8 __user *) new_ctx)
460 || __get_user(tmp, (u8 __user *) (new_ctx + 1) - 1))
461 return -EFAULT;
462
463 /*
464 * If we get a fault copying the context into the kernel's
465 * image of the user's registers, we can't just return -EFAULT
466 * because the user's registers will be corrupted. For instance
467 * the NIP value may have been updated but not some of the
468 * other registers. Given that we have done the access_ok
469 * and successfully read the first and last bytes of the region
470 * above, this should only happen in an out-of-memory situation
471 * or if another thread unmaps the region containing the context.
472 * We kill the task with a SIGSEGV in this situation.
473 */
474 if (do_setcontext(new_ctx, regs, 0))
475 do_exit(SIGSEGV);
476 sigreturn_exit(regs);
477 /* doesn't actually return back to here */
478 return 0;
479}
480
481int sys_rt_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
482 struct pt_regs *regs)
483{
484 struct rt_sigframe __user *rt_sf;
485
486 /* Always make any pending restarted system calls return -EINTR */
487 current_thread_info()->restart_block.fn = do_no_restart_syscall;
488
489 rt_sf = (struct rt_sigframe __user *)
490 (regs->gpr[1] + __SIGNAL_FRAMESIZE + 16);
491 if (!access_ok(VERIFY_READ, rt_sf, sizeof(struct rt_sigframe)))
492 goto bad;
493 if (do_setcontext(&rt_sf->uc, regs, 1))
494 goto bad;
495
496 /*
497 * It's not clear whether or why it is desirable to save the
498 * sigaltstack setting on signal delivery and restore it on
499 * signal return. But other architectures do this and we have
500 * always done it up until now so it is probably better not to
501 * change it. -- paulus
502 */
503 do_sigaltstack(&rt_sf->uc.uc_stack, NULL, regs->gpr[1]);
504
505 sigreturn_exit(regs); /* doesn't return here */
506 return 0;
507
508 bad:
509 force_sig(SIGSEGV, current);
510 return 0;
511}
512
513int sys_debug_setcontext(struct ucontext __user *ctx,
514 int ndbg, struct sig_dbg_op __user *dbg,
515 int r6, int r7, int r8,
516 struct pt_regs *regs)
517{
518 struct sig_dbg_op op;
519 int i;
520 unsigned long new_msr = regs->msr;
521#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
522 unsigned long new_dbcr0 = current->thread.dbcr0;
523#endif
524
525 for (i=0; i<ndbg; i++) {
526 if (__copy_from_user(&op, dbg, sizeof(op)))
527 return -EFAULT;
528 switch (op.dbg_type) {
529 case SIG_DBG_SINGLE_STEPPING:
530#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
531 if (op.dbg_value) {
532 new_msr |= MSR_DE;
533 new_dbcr0 |= (DBCR0_IDM | DBCR0_IC);
534 } else {
535 new_msr &= ~MSR_DE;
536 new_dbcr0 &= ~(DBCR0_IDM | DBCR0_IC);
537 }
538#else
539 if (op.dbg_value)
540 new_msr |= MSR_SE;
541 else
542 new_msr &= ~MSR_SE;
543#endif
544 break;
545 case SIG_DBG_BRANCH_TRACING:
546#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
547 return -EINVAL;
548#else
549 if (op.dbg_value)
550 new_msr |= MSR_BE;
551 else
552 new_msr &= ~MSR_BE;
553#endif
554 break;
555
556 default:
557 return -EINVAL;
558 }
559 }
560
561 /* We wait until here to actually install the values in the
562 registers so if we fail in the above loop, it will not
563 affect the contents of these registers. After this point,
564 failure is a problem, anyway, and it's very unlikely unless
565 the user is really doing something wrong. */
566 regs->msr = new_msr;
567#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
568 current->thread.dbcr0 = new_dbcr0;
569#endif
570
571 /*
572 * If we get a fault copying the context into the kernel's
573 * image of the user's registers, we can't just return -EFAULT
574 * because the user's registers will be corrupted. For instance
575 * the NIP value may have been updated but not some of the
576 * other registers. Given that we have done the access_ok
577 * and successfully read the first and last bytes of the region
578 * above, this should only happen in an out-of-memory situation
579 * or if another thread unmaps the region containing the context.
580 * We kill the task with a SIGSEGV in this situation.
581 */
582 if (do_setcontext(ctx, regs, 1)) {
583 force_sig(SIGSEGV, current);
584 goto out;
585 }
586
587 /*
588 * It's not clear whether or why it is desirable to save the
589 * sigaltstack setting on signal delivery and restore it on
590 * signal return. But other architectures do this and we have
591 * always done it up until now so it is probably better not to
592 * change it. -- paulus
593 */
594 do_sigaltstack(&ctx->uc_stack, NULL, regs->gpr[1]);
595
596 sigreturn_exit(regs);
597 /* doesn't actually return back to here */
598
599 out:
600 return 0;
601}
602
603/*
604 * OK, we're invoking a handler
605 */
606static void
607handle_signal(unsigned long sig, struct k_sigaction *ka,
608 siginfo_t *info, sigset_t *oldset, struct pt_regs * regs,
609 unsigned long newsp)
610{
611 struct sigcontext __user *sc;
612 struct sigregs __user *frame;
613 unsigned long origsp = newsp;
614
615 /* Set up Signal Frame */
616 newsp -= sizeof(struct sigregs);
617 frame = (struct sigregs __user *) newsp;
618
619 /* Put a sigcontext on the stack */
620 newsp -= sizeof(*sc);
621 sc = (struct sigcontext __user *) newsp;
622
623 /* create a stack frame for the caller of the handler */
624 newsp -= __SIGNAL_FRAMESIZE;
625
626 if (!access_ok(VERIFY_WRITE, (void __user *) newsp, origsp - newsp))
627 goto badframe;
628
629#if _NSIG != 64
630#error "Please adjust handle_signal()"
631#endif
632 if (__put_user((unsigned long) ka->sa.sa_handler, &sc->handler)
633 || __put_user(oldset->sig[0], &sc->oldmask)
634 || __put_user(oldset->sig[1], &sc->_unused[3])
635 || __put_user((struct pt_regs __user *)frame, &sc->regs)
636 || __put_user(sig, &sc->signal))
637 goto badframe;
638
639 if (save_user_regs(regs, &frame->mctx, __NR_sigreturn))
640 goto badframe;
641
642 if (put_user(regs->gpr[1], (unsigned long __user *)newsp))
643 goto badframe;
644 regs->gpr[1] = newsp;
645 regs->gpr[3] = sig;
646 regs->gpr[4] = (unsigned long) sc;
647 regs->nip = (unsigned long) ka->sa.sa_handler;
648 regs->link = (unsigned long) frame->mctx.tramp;
649 regs->trap = 0;
650
651 return;
652
653badframe:
654#ifdef DEBUG_SIG
655 printk("badframe in handle_signal, regs=%p frame=%p newsp=%lx\n",
656 regs, frame, newsp);
657#endif
658 force_sigsegv(sig, current);
659}
660
661/*
662 * Do a signal return; undo the signal stack.
663 */
664int sys_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
665 struct pt_regs *regs)
666{
667 struct sigcontext __user *sc;
668 struct sigcontext sigctx;
669 struct mcontext __user *sr;
670 sigset_t set;
671
672 /* Always make any pending restarted system calls return -EINTR */
673 current_thread_info()->restart_block.fn = do_no_restart_syscall;
674
675 sc = (struct sigcontext __user *)(regs->gpr[1] + __SIGNAL_FRAMESIZE);
676 if (copy_from_user(&sigctx, sc, sizeof(sigctx)))
677 goto badframe;
678
679 set.sig[0] = sigctx.oldmask;
680 set.sig[1] = sigctx._unused[3];
681 restore_sigmask(&set);
682
683 sr = (struct mcontext __user *) sigctx.regs;
684 if (!access_ok(VERIFY_READ, sr, sizeof(*sr))
685 || restore_user_regs(regs, sr, 1))
686 goto badframe;
687
688 sigreturn_exit(regs); /* doesn't return */
689 return 0;
690
691badframe:
692 force_sig(SIGSEGV, current);
693 return 0;
694}
695
696/*
697 * Note that 'init' is a special process: it doesn't get signals it doesn't
698 * want to handle. Thus you cannot kill init even with a SIGKILL even by
699 * mistake.
700 */
701int do_signal(sigset_t *oldset, struct pt_regs *regs)
702{
703 siginfo_t info;
704 struct k_sigaction ka;
705 unsigned long frame, newsp;
706 int signr, ret;
707
708 if (try_to_freeze()) {
709 signr = 0;
710 if (!signal_pending(current))
711 goto no_signal;
712 }
713
714 if (!oldset)
715 oldset = &current->blocked;
716
717 newsp = frame = 0;
718
719 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
720 no_signal:
721 if (TRAP(regs) == 0x0C00 /* System Call! */
722 && regs->ccr & 0x10000000 /* error signalled */
723 && ((ret = regs->gpr[3]) == ERESTARTSYS
724 || ret == ERESTARTNOHAND || ret == ERESTARTNOINTR
725 || ret == ERESTART_RESTARTBLOCK)) {
726
727 if (signr > 0
728 && (ret == ERESTARTNOHAND || ret == ERESTART_RESTARTBLOCK
729 || (ret == ERESTARTSYS
730 && !(ka.sa.sa_flags & SA_RESTART)))) {
731 /* make the system call return an EINTR error */
732 regs->result = -EINTR;
733 regs->gpr[3] = EINTR;
734 /* note that the cr0.SO bit is already set */
735 } else {
736 regs->nip -= 4; /* Back up & retry system call */
737 regs->result = 0;
738 regs->trap = 0;
739 if (ret == ERESTART_RESTARTBLOCK)
740 regs->gpr[0] = __NR_restart_syscall;
741 else
742 regs->gpr[3] = regs->orig_gpr3;
743 }
744 }
745
746 if (signr == 0)
747 return 0; /* no signals delivered */
748
749 if ((ka.sa.sa_flags & SA_ONSTACK) && current->sas_ss_size
750 && !on_sig_stack(regs->gpr[1]))
751 newsp = current->sas_ss_sp + current->sas_ss_size;
752 else
753 newsp = regs->gpr[1];
754 newsp &= ~0xfUL;
755
756 /* Whee! Actually deliver the signal. */
757 if (ka.sa.sa_flags & SA_SIGINFO)
758 handle_rt_signal(signr, &ka, &info, oldset, regs, newsp);
759 else
760 handle_signal(signr, &ka, &info, oldset, regs, newsp);
761
762 spin_lock_irq(&current->sighand->siglock);
763 sigorsets(&current->blocked,&current->blocked,&ka.sa.sa_mask);
764 if (!(ka.sa.sa_flags & SA_NODEFER))
765 sigaddset(&current->blocked, signr);
766 recalc_sigpending();
767 spin_unlock_irq(&current->sighand->siglock);
768
769 return 1;
770}
771
diff --git a/arch/ppc/kernel/smp.c b/arch/ppc/kernel/smp.c
index 726fe7ce1747..bc5bf1124836 100644
--- a/arch/ppc/kernel/smp.c
+++ b/arch/ppc/kernel/smp.c
@@ -34,11 +34,11 @@
34#include <asm/thread_info.h> 34#include <asm/thread_info.h>
35#include <asm/tlbflush.h> 35#include <asm/tlbflush.h>
36#include <asm/xmon.h> 36#include <asm/xmon.h>
37#include <asm/machdep.h>
37 38
38volatile int smp_commenced; 39volatile int smp_commenced;
39int smp_tb_synchronized; 40int smp_tb_synchronized;
40struct cpuinfo_PPC cpu_data[NR_CPUS]; 41struct cpuinfo_PPC cpu_data[NR_CPUS];
41struct klock_info_struct klock_info = { KLOCK_CLEAR, 0 };
42atomic_t ipi_recv; 42atomic_t ipi_recv;
43atomic_t ipi_sent; 43atomic_t ipi_sent;
44cpumask_t cpu_online_map; 44cpumask_t cpu_online_map;
@@ -51,7 +51,7 @@ EXPORT_SYMBOL(cpu_online_map);
51EXPORT_SYMBOL(cpu_possible_map); 51EXPORT_SYMBOL(cpu_possible_map);
52 52
53/* SMP operations for this machine */ 53/* SMP operations for this machine */
54static struct smp_ops_t *smp_ops; 54struct smp_ops_t *smp_ops;
55 55
56/* all cpu mappings are 1-1 -- Cort */ 56/* all cpu mappings are 1-1 -- Cort */
57volatile unsigned long cpu_callin_map[NR_CPUS]; 57volatile unsigned long cpu_callin_map[NR_CPUS];
@@ -74,11 +74,11 @@ extern void __save_cpu_setup(void);
74#define PPC_MSG_XMON_BREAK 3 74#define PPC_MSG_XMON_BREAK 3
75 75
76static inline void 76static inline void
77smp_message_pass(int target, int msg, unsigned long data, int wait) 77smp_message_pass(int target, int msg)
78{ 78{
79 if (smp_ops){ 79 if (smp_ops) {
80 atomic_inc(&ipi_sent); 80 atomic_inc(&ipi_sent);
81 smp_ops->message_pass(target,msg,data,wait); 81 smp_ops->message_pass(target, msg);
82 } 82 }
83} 83}
84 84
@@ -119,7 +119,7 @@ void smp_message_recv(int msg, struct pt_regs *regs)
119void smp_send_tlb_invalidate(int cpu) 119void smp_send_tlb_invalidate(int cpu)
120{ 120{
121 if ( PVR_VER(mfspr(SPRN_PVR)) == 8 ) 121 if ( PVR_VER(mfspr(SPRN_PVR)) == 8 )
122 smp_message_pass(MSG_ALL_BUT_SELF, PPC_MSG_INVALIDATE_TLB, 0, 0); 122 smp_message_pass(MSG_ALL_BUT_SELF, PPC_MSG_INVALIDATE_TLB);
123} 123}
124 124
125void smp_send_reschedule(int cpu) 125void smp_send_reschedule(int cpu)
@@ -135,13 +135,13 @@ void smp_send_reschedule(int cpu)
135 */ 135 */
136 /* This is only used if `cpu' is running an idle task, 136 /* This is only used if `cpu' is running an idle task,
137 so it will reschedule itself anyway... */ 137 so it will reschedule itself anyway... */
138 smp_message_pass(cpu, PPC_MSG_RESCHEDULE, 0, 0); 138 smp_message_pass(cpu, PPC_MSG_RESCHEDULE);
139} 139}
140 140
141#ifdef CONFIG_XMON 141#ifdef CONFIG_XMON
142void smp_send_xmon_break(int cpu) 142void smp_send_xmon_break(int cpu)
143{ 143{
144 smp_message_pass(cpu, PPC_MSG_XMON_BREAK, 0, 0); 144 smp_message_pass(cpu, PPC_MSG_XMON_BREAK);
145} 145}
146#endif /* CONFIG_XMON */ 146#endif /* CONFIG_XMON */
147 147
@@ -224,7 +224,7 @@ static int __smp_call_function(void (*func) (void *info), void *info,
224 spin_lock(&call_lock); 224 spin_lock(&call_lock);
225 call_data = &data; 225 call_data = &data;
226 /* Send a message to all other CPUs and wait for them to respond */ 226 /* Send a message to all other CPUs and wait for them to respond */
227 smp_message_pass(target, PPC_MSG_CALL_FUNCTION, 0, 0); 227 smp_message_pass(target, PPC_MSG_CALL_FUNCTION);
228 228
229 /* Wait for response */ 229 /* Wait for response */
230 timeout = 1000000; 230 timeout = 1000000;
@@ -294,7 +294,6 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
294 smp_store_cpu_info(smp_processor_id()); 294 smp_store_cpu_info(smp_processor_id());
295 cpu_callin_map[smp_processor_id()] = 1; 295 cpu_callin_map[smp_processor_id()] = 1;
296 296
297 smp_ops = ppc_md.smp_ops;
298 if (smp_ops == NULL) { 297 if (smp_ops == NULL) {
299 printk("SMP not supported on this machine.\n"); 298 printk("SMP not supported on this machine.\n");
300 return; 299 return;
@@ -308,9 +307,6 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
308 /* Backup CPU 0 state */ 307 /* Backup CPU 0 state */
309 __save_cpu_setup(); 308 __save_cpu_setup();
310 309
311 if (smp_ops->space_timers)
312 smp_ops->space_timers(num_cpus);
313
314 for_each_cpu(cpu) { 310 for_each_cpu(cpu) {
315 if (cpu == smp_processor_id()) 311 if (cpu == smp_processor_id())
316 continue; 312 continue;
diff --git a/arch/ppc/kernel/syscalls.c b/arch/ppc/kernel/syscalls.c
deleted file mode 100644
index 127f040de9de..000000000000
--- a/arch/ppc/kernel/syscalls.c
+++ /dev/null
@@ -1,268 +0,0 @@
1/*
2 * arch/ppc/kernel/sys_ppc.c
3 *
4 * PowerPC version
5 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
6 *
7 * Derived from "arch/i386/kernel/sys_i386.c"
8 * Adapted from the i386 version by Gary Thomas
9 * Modified by Cort Dougan (cort@cs.nmt.edu)
10 * and Paul Mackerras (paulus@cs.anu.edu.au).
11 *
12 * This file contains various random system calls that
13 * have a non-standard calling sequence on the Linux/PPC
14 * platform.
15 *
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version
19 * 2 of the License, or (at your option) any later version.
20 *
21 */
22
23#include <linux/errno.h>
24#include <linux/sched.h>
25#include <linux/mm.h>
26#include <linux/smp.h>
27#include <linux/smp_lock.h>
28#include <linux/sem.h>
29#include <linux/msg.h>
30#include <linux/shm.h>
31#include <linux/stat.h>
32#include <linux/syscalls.h>
33#include <linux/mman.h>
34#include <linux/sys.h>
35#include <linux/ipc.h>
36#include <linux/utsname.h>
37#include <linux/file.h>
38#include <linux/unistd.h>
39
40#include <asm/uaccess.h>
41#include <asm/ipc.h>
42#include <asm/semaphore.h>
43
44
45/*
46 * sys_ipc() is the de-multiplexer for the SysV IPC calls..
47 *
48 * This is really horribly ugly.
49 */
50int
51sys_ipc (uint call, int first, int second, int third, void __user *ptr, long fifth)
52{
53 int version, ret;
54
55 version = call >> 16; /* hack for backward compatibility */
56 call &= 0xffff;
57
58 ret = -ENOSYS;
59 switch (call) {
60 case SEMOP:
61 ret = sys_semtimedop (first, (struct sembuf __user *)ptr,
62 second, NULL);
63 break;
64 case SEMTIMEDOP:
65 ret = sys_semtimedop (first, (struct sembuf __user *)ptr,
66 second, (const struct timespec __user *) fifth);
67 break;
68 case SEMGET:
69 ret = sys_semget (first, second, third);
70 break;
71 case SEMCTL: {
72 union semun fourth;
73
74 if (!ptr)
75 break;
76 if ((ret = access_ok(VERIFY_READ, ptr, sizeof(long)) ? 0 : -EFAULT)
77 || (ret = get_user(fourth.__pad, (void __user *__user *)ptr)))
78 break;
79 ret = sys_semctl (first, second, third, fourth);
80 break;
81 }
82 case MSGSND:
83 ret = sys_msgsnd (first, (struct msgbuf __user *) ptr, second, third);
84 break;
85 case MSGRCV:
86 switch (version) {
87 case 0: {
88 struct ipc_kludge tmp;
89
90 if (!ptr)
91 break;
92 if ((ret = access_ok(VERIFY_READ, ptr, sizeof(tmp)) ? 0 : -EFAULT)
93 || (ret = copy_from_user(&tmp,
94 (struct ipc_kludge __user *) ptr,
95 sizeof (tmp)) ? -EFAULT : 0))
96 break;
97 ret = sys_msgrcv (first, tmp.msgp, second, tmp.msgtyp,
98 third);
99 break;
100 }
101 default:
102 ret = sys_msgrcv (first, (struct msgbuf __user *) ptr,
103 second, fifth, third);
104 break;
105 }
106 break;
107 case MSGGET:
108 ret = sys_msgget ((key_t) first, second);
109 break;
110 case MSGCTL:
111 ret = sys_msgctl (first, second, (struct msqid_ds __user *) ptr);
112 break;
113 case SHMAT: {
114 ulong raddr;
115
116 if ((ret = access_ok(VERIFY_WRITE, (ulong __user *) third,
117 sizeof(ulong)) ? 0 : -EFAULT))
118 break;
119 ret = do_shmat (first, (char __user *) ptr, second, &raddr);
120 if (ret)
121 break;
122 ret = put_user (raddr, (ulong __user *) third);
123 break;
124 }
125 case SHMDT:
126 ret = sys_shmdt ((char __user *)ptr);
127 break;
128 case SHMGET:
129 ret = sys_shmget (first, second, third);
130 break;
131 case SHMCTL:
132 ret = sys_shmctl (first, second, (struct shmid_ds __user *) ptr);
133 break;
134 }
135
136 return ret;
137}
138
139/*
140 * sys_pipe() is the normal C calling standard for creating
141 * a pipe. It's not the way unix traditionally does this, though.
142 */
143int sys_pipe(int __user *fildes)
144{
145 int fd[2];
146 int error;
147
148 error = do_pipe(fd);
149 if (!error) {
150 if (copy_to_user(fildes, fd, 2*sizeof(int)))
151 error = -EFAULT;
152 }
153 return error;
154}
155
156static inline unsigned long
157do_mmap2(unsigned long addr, size_t len,
158 unsigned long prot, unsigned long flags,
159 unsigned long fd, unsigned long pgoff)
160{
161 struct file * file = NULL;
162 int ret = -EBADF;
163
164 flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
165 if (!(flags & MAP_ANONYMOUS)) {
166 if (!(file = fget(fd)))
167 goto out;
168 }
169
170 down_write(&current->mm->mmap_sem);
171 ret = do_mmap_pgoff(file, addr, len, prot, flags, pgoff);
172 up_write(&current->mm->mmap_sem);
173 if (file)
174 fput(file);
175out:
176 return ret;
177}
178
179unsigned long sys_mmap2(unsigned long addr, size_t len,
180 unsigned long prot, unsigned long flags,
181 unsigned long fd, unsigned long pgoff)
182{
183 return do_mmap2(addr, len, prot, flags, fd, pgoff);
184}
185
186unsigned long sys_mmap(unsigned long addr, size_t len,
187 unsigned long prot, unsigned long flags,
188 unsigned long fd, off_t offset)
189{
190 int err = -EINVAL;
191
192 if (offset & ~PAGE_MASK)
193 goto out;
194
195 err = do_mmap2(addr, len, prot, flags, fd, offset >> PAGE_SHIFT);
196out:
197 return err;
198}
199
200/*
201 * Due to some executables calling the wrong select we sometimes
202 * get wrong args. This determines how the args are being passed
203 * (a single ptr to them all args passed) then calls
204 * sys_select() with the appropriate args. -- Cort
205 */
206int
207ppc_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp, struct timeval __user *tvp)
208{
209 if ( (unsigned long)n >= 4096 )
210 {
211 unsigned long __user *buffer = (unsigned long __user *)n;
212 if (!access_ok(VERIFY_READ, buffer, 5*sizeof(unsigned long))
213 || __get_user(n, buffer)
214 || __get_user(inp, ((fd_set __user * __user *)(buffer+1)))
215 || __get_user(outp, ((fd_set __user * __user *)(buffer+2)))
216 || __get_user(exp, ((fd_set __user * __user *)(buffer+3)))
217 || __get_user(tvp, ((struct timeval __user * __user *)(buffer+4))))
218 return -EFAULT;
219 }
220 return sys_select(n, inp, outp, exp, tvp);
221}
222
223int sys_uname(struct old_utsname __user * name)
224{
225 int err = -EFAULT;
226
227 down_read(&uts_sem);
228 if (name && !copy_to_user(name, &system_utsname, sizeof (*name)))
229 err = 0;
230 up_read(&uts_sem);
231 return err;
232}
233
234int sys_olduname(struct oldold_utsname __user * name)
235{
236 int error;
237
238 if (!name)
239 return -EFAULT;
240 if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname)))
241 return -EFAULT;
242
243 down_read(&uts_sem);
244 error = __copy_to_user(&name->sysname,&system_utsname.sysname,__OLD_UTS_LEN);
245 error -= __put_user(0,name->sysname+__OLD_UTS_LEN);
246 error -= __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN);
247 error -= __put_user(0,name->nodename+__OLD_UTS_LEN);
248 error -= __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN);
249 error -= __put_user(0,name->release+__OLD_UTS_LEN);
250 error -= __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN);
251 error -= __put_user(0,name->version+__OLD_UTS_LEN);
252 error -= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN);
253 error = __put_user(0,name->machine+__OLD_UTS_LEN);
254 up_read(&uts_sem);
255
256 error = error ? -EFAULT : 0;
257 return error;
258}
259
260/*
261 * We put the arguments in a different order so we only use 6
262 * registers for arguments, rather than 7 as sys_fadvise64_64 needs
263 * (because `offset' goes in r5/r6).
264 */
265long ppc_fadvise64_64(int fd, int advice, loff_t offset, loff_t len)
266{
267 return sys_fadvise64_64(fd, offset, len, advice);
268}
diff --git a/arch/ppc/kernel/time.c b/arch/ppc/kernel/time.c
index 22d7fd1e0aea..53ea723af60a 100644
--- a/arch/ppc/kernel/time.c
+++ b/arch/ppc/kernel/time.c
@@ -66,11 +66,6 @@
66 66
67#include <asm/time.h> 67#include <asm/time.h>
68 68
69/* XXX false sharing with below? */
70u64 jiffies_64 = INITIAL_JIFFIES;
71
72EXPORT_SYMBOL(jiffies_64);
73
74unsigned long disarm_decr[NR_CPUS]; 69unsigned long disarm_decr[NR_CPUS];
75 70
76extern struct timezone sys_tz; 71extern struct timezone sys_tz;
@@ -121,6 +116,15 @@ unsigned long profile_pc(struct pt_regs *regs)
121EXPORT_SYMBOL(profile_pc); 116EXPORT_SYMBOL(profile_pc);
122#endif 117#endif
123 118
119void wakeup_decrementer(void)
120{
121 set_dec(tb_ticks_per_jiffy);
122 /* No currently-supported powerbook has a 601,
123 * so use get_tbl, not native
124 */
125 last_jiffy_stamp(0) = tb_last_stamp = get_tbl();
126}
127
124/* 128/*
125 * timer_interrupt - gets called when the decrementer overflows, 129 * timer_interrupt - gets called when the decrementer overflows,
126 * with interrupts disabled. 130 * with interrupts disabled.
diff --git a/arch/ppc/kernel/traps.c b/arch/ppc/kernel/traps.c
index 961ede87be72..f265b81e7008 100644
--- a/arch/ppc/kernel/traps.c
+++ b/arch/ppc/kernel/traps.c
@@ -41,9 +41,14 @@
41#ifdef CONFIG_PMAC_BACKLIGHT 41#ifdef CONFIG_PMAC_BACKLIGHT
42#include <asm/backlight.h> 42#include <asm/backlight.h>
43#endif 43#endif
44#include <asm/perfmon.h> 44#include <asm/pmc.h>
45 45
46#ifdef CONFIG_XMON 46#ifdef CONFIG_XMON
47extern int xmon_bpt(struct pt_regs *regs);
48extern int xmon_sstep(struct pt_regs *regs);
49extern int xmon_iabr_match(struct pt_regs *regs);
50extern int xmon_dabr_match(struct pt_regs *regs);
51
47void (*debugger)(struct pt_regs *regs) = xmon; 52void (*debugger)(struct pt_regs *regs) = xmon;
48int (*debugger_bpt)(struct pt_regs *regs) = xmon_bpt; 53int (*debugger_bpt)(struct pt_regs *regs) = xmon_bpt;
49int (*debugger_sstep)(struct pt_regs *regs) = xmon_sstep; 54int (*debugger_sstep)(struct pt_regs *regs) = xmon_sstep;
@@ -74,7 +79,7 @@ void (*debugger_fault_handler)(struct pt_regs *regs);
74 79
75DEFINE_SPINLOCK(die_lock); 80DEFINE_SPINLOCK(die_lock);
76 81
77void die(const char * str, struct pt_regs * fp, long err) 82int die(const char * str, struct pt_regs * fp, long err)
78{ 83{
79 static int die_counter; 84 static int die_counter;
80 int nl = 0; 85 int nl = 0;
@@ -232,7 +237,7 @@ platform_machine_check(struct pt_regs *regs)
232{ 237{
233} 238}
234 239
235void MachineCheckException(struct pt_regs *regs) 240void machine_check_exception(struct pt_regs *regs)
236{ 241{
237 unsigned long reason = get_mc_reason(regs); 242 unsigned long reason = get_mc_reason(regs);
238 243
@@ -393,14 +398,14 @@ void SMIException(struct pt_regs *regs)
393#endif 398#endif
394} 399}
395 400
396void UnknownException(struct pt_regs *regs) 401void unknown_exception(struct pt_regs *regs)
397{ 402{
398 printk("Bad trap at PC: %lx, MSR: %lx, vector=%lx %s\n", 403 printk("Bad trap at PC: %lx, MSR: %lx, vector=%lx %s\n",
399 regs->nip, regs->msr, regs->trap, print_tainted()); 404 regs->nip, regs->msr, regs->trap, print_tainted());
400 _exception(SIGTRAP, regs, 0, 0); 405 _exception(SIGTRAP, regs, 0, 0);
401} 406}
402 407
403void InstructionBreakpoint(struct pt_regs *regs) 408void instruction_breakpoint_exception(struct pt_regs *regs)
404{ 409{
405 if (debugger_iabr_match(regs)) 410 if (debugger_iabr_match(regs))
406 return; 411 return;
@@ -575,7 +580,7 @@ extern struct bug_entry __start___bug_table[], __stop___bug_table[];
575#define module_find_bug(x) NULL 580#define module_find_bug(x) NULL
576#endif 581#endif
577 582
578static struct bug_entry *find_bug(unsigned long bugaddr) 583struct bug_entry *find_bug(unsigned long bugaddr)
579{ 584{
580 struct bug_entry *bug; 585 struct bug_entry *bug;
581 586
@@ -622,7 +627,7 @@ int check_bug_trap(struct pt_regs *regs)
622 return 0; 627 return 0;
623} 628}
624 629
625void ProgramCheckException(struct pt_regs *regs) 630void program_check_exception(struct pt_regs *regs)
626{ 631{
627 unsigned int reason = get_reason(regs); 632 unsigned int reason = get_reason(regs);
628 extern int do_mathemu(struct pt_regs *regs); 633 extern int do_mathemu(struct pt_regs *regs);
@@ -654,7 +659,7 @@ void ProgramCheckException(struct pt_regs *regs)
654 giveup_fpu(current); 659 giveup_fpu(current);
655 preempt_enable(); 660 preempt_enable();
656 661
657 fpscr = current->thread.fpscr; 662 fpscr = current->thread.fpscr.val;
658 fpscr &= fpscr << 22; /* mask summary bits with enables */ 663 fpscr &= fpscr << 22; /* mask summary bits with enables */
659 if (fpscr & FPSCR_VX) 664 if (fpscr & FPSCR_VX)
660 code = FPE_FLTINV; 665 code = FPE_FLTINV;
@@ -701,7 +706,7 @@ void ProgramCheckException(struct pt_regs *regs)
701 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip); 706 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
702} 707}
703 708
704void SingleStepException(struct pt_regs *regs) 709void single_step_exception(struct pt_regs *regs)
705{ 710{
706 regs->msr &= ~(MSR_SE | MSR_BE); /* Turn off 'trace' bits */ 711 regs->msr &= ~(MSR_SE | MSR_BE); /* Turn off 'trace' bits */
707 if (debugger_sstep(regs)) 712 if (debugger_sstep(regs))
@@ -709,7 +714,7 @@ void SingleStepException(struct pt_regs *regs)
709 _exception(SIGTRAP, regs, TRAP_TRACE, 0); 714 _exception(SIGTRAP, regs, TRAP_TRACE, 0);
710} 715}
711 716
712void AlignmentException(struct pt_regs *regs) 717void alignment_exception(struct pt_regs *regs)
713{ 718{
714 int fixed; 719 int fixed;
715 720
@@ -814,7 +819,18 @@ void TAUException(struct pt_regs *regs)
814} 819}
815#endif /* CONFIG_INT_TAU */ 820#endif /* CONFIG_INT_TAU */
816 821
817void AltivecUnavailException(struct pt_regs *regs) 822/*
823 * FP unavailable trap from kernel - print a message, but let
824 * the task use FP in the kernel until it returns to user mode.
825 */
826void kernel_fp_unavailable_exception(struct pt_regs *regs)
827{
828 regs->msr |= MSR_FP;
829 printk(KERN_ERR "floating point used in kernel (task=%p, pc=%lx)\n",
830 current, regs->nip);
831}
832
833void altivec_unavailable_exception(struct pt_regs *regs)
818{ 834{
819 static int kernel_altivec_count; 835 static int kernel_altivec_count;
820 836
@@ -835,7 +851,7 @@ void AltivecUnavailException(struct pt_regs *regs)
835} 851}
836 852
837#ifdef CONFIG_ALTIVEC 853#ifdef CONFIG_ALTIVEC
838void AltivecAssistException(struct pt_regs *regs) 854void altivec_assist_exception(struct pt_regs *regs)
839{ 855{
840 int err; 856 int err;
841 857
@@ -872,7 +888,7 @@ void AltivecAssistException(struct pt_regs *regs)
872#endif /* CONFIG_ALTIVEC */ 888#endif /* CONFIG_ALTIVEC */
873 889
874#ifdef CONFIG_E500 890#ifdef CONFIG_E500
875void PerformanceMonitorException(struct pt_regs *regs) 891void performance_monitor_exception(struct pt_regs *regs)
876{ 892{
877 perf_irq(regs); 893 perf_irq(regs);
878} 894}
diff --git a/arch/ppc/kernel/vector.S b/arch/ppc/kernel/vector.S
deleted file mode 100644
index 82a21346bf80..000000000000
--- a/arch/ppc/kernel/vector.S
+++ /dev/null
@@ -1,217 +0,0 @@
1#include <asm/ppc_asm.h>
2#include <asm/processor.h>
3
4/*
5 * The routines below are in assembler so we can closely control the
6 * usage of floating-point registers. These routines must be called
7 * with preempt disabled.
8 */
9 .data
10fpzero:
11 .long 0
12fpone:
13 .long 0x3f800000 /* 1.0 in single-precision FP */
14fphalf:
15 .long 0x3f000000 /* 0.5 in single-precision FP */
16
17 .text
18/*
19 * Internal routine to enable floating point and set FPSCR to 0.
20 * Don't call it from C; it doesn't use the normal calling convention.
21 */
22fpenable:
23 mfmsr r10
24 ori r11,r10,MSR_FP
25 mtmsr r11
26 isync
27 stfd fr0,24(r1)
28 stfd fr1,16(r1)
29 stfd fr31,8(r1)
30 lis r11,fpzero@ha
31 mffs fr31
32 lfs fr1,fpzero@l(r11)
33 mtfsf 0xff,fr1
34 blr
35
36fpdisable:
37 mtfsf 0xff,fr31
38 lfd fr31,8(r1)
39 lfd fr1,16(r1)
40 lfd fr0,24(r1)
41 mtmsr r10
42 isync
43 blr
44
45/*
46 * Vector add, floating point.
47 */
48 .globl vaddfp
49vaddfp:
50 stwu r1,-32(r1)
51 mflr r0
52 stw r0,36(r1)
53 bl fpenable
54 li r0,4
55 mtctr r0
56 li r6,0
571: lfsx fr0,r4,r6
58 lfsx fr1,r5,r6
59 fadds fr0,fr0,fr1
60 stfsx fr0,r3,r6
61 addi r6,r6,4
62 bdnz 1b
63 bl fpdisable
64 lwz r0,36(r1)
65 mtlr r0
66 addi r1,r1,32
67 blr
68
69/*
70 * Vector subtract, floating point.
71 */
72 .globl vsubfp
73vsubfp:
74 stwu r1,-32(r1)
75 mflr r0
76 stw r0,36(r1)
77 bl fpenable
78 li r0,4
79 mtctr r0
80 li r6,0
811: lfsx fr0,r4,r6
82 lfsx fr1,r5,r6
83 fsubs fr0,fr0,fr1
84 stfsx fr0,r3,r6
85 addi r6,r6,4
86 bdnz 1b
87 bl fpdisable
88 lwz r0,36(r1)
89 mtlr r0
90 addi r1,r1,32
91 blr
92
93/*
94 * Vector multiply and add, floating point.
95 */
96 .globl vmaddfp
97vmaddfp:
98 stwu r1,-48(r1)
99 mflr r0
100 stw r0,52(r1)
101 bl fpenable
102 stfd fr2,32(r1)
103 li r0,4
104 mtctr r0
105 li r7,0
1061: lfsx fr0,r4,r7
107 lfsx fr1,r5,r7
108 lfsx fr2,r6,r7
109 fmadds fr0,fr0,fr2,fr1
110 stfsx fr0,r3,r7
111 addi r7,r7,4
112 bdnz 1b
113 lfd fr2,32(r1)
114 bl fpdisable
115 lwz r0,52(r1)
116 mtlr r0
117 addi r1,r1,48
118 blr
119
120/*
121 * Vector negative multiply and subtract, floating point.
122 */
123 .globl vnmsubfp
124vnmsubfp:
125 stwu r1,-48(r1)
126 mflr r0
127 stw r0,52(r1)
128 bl fpenable
129 stfd fr2,32(r1)
130 li r0,4
131 mtctr r0
132 li r7,0
1331: lfsx fr0,r4,r7
134 lfsx fr1,r5,r7
135 lfsx fr2,r6,r7
136 fnmsubs fr0,fr0,fr2,fr1
137 stfsx fr0,r3,r7
138 addi r7,r7,4
139 bdnz 1b
140 lfd fr2,32(r1)
141 bl fpdisable
142 lwz r0,52(r1)
143 mtlr r0
144 addi r1,r1,48
145 blr
146
147/*
148 * Vector reciprocal estimate. We just compute 1.0/x.
149 * r3 -> destination, r4 -> source.
150 */
151 .globl vrefp
152vrefp:
153 stwu r1,-32(r1)
154 mflr r0
155 stw r0,36(r1)
156 bl fpenable
157 lis r9,fpone@ha
158 li r0,4
159 lfs fr1,fpone@l(r9)
160 mtctr r0
161 li r6,0
1621: lfsx fr0,r4,r6
163 fdivs fr0,fr1,fr0
164 stfsx fr0,r3,r6
165 addi r6,r6,4
166 bdnz 1b
167 bl fpdisable
168 lwz r0,36(r1)
169 mtlr r0
170 addi r1,r1,32
171 blr
172
173/*
174 * Vector reciprocal square-root estimate, floating point.
175 * We use the frsqrte instruction for the initial estimate followed
176 * by 2 iterations of Newton-Raphson to get sufficient accuracy.
177 * r3 -> destination, r4 -> source.
178 */
179 .globl vrsqrtefp
180vrsqrtefp:
181 stwu r1,-48(r1)
182 mflr r0
183 stw r0,52(r1)
184 bl fpenable
185 stfd fr2,32(r1)
186 stfd fr3,40(r1)
187 stfd fr4,48(r1)
188 stfd fr5,56(r1)
189 lis r9,fpone@ha
190 lis r8,fphalf@ha
191 li r0,4
192 lfs fr4,fpone@l(r9)
193 lfs fr5,fphalf@l(r8)
194 mtctr r0
195 li r6,0
1961: lfsx fr0,r4,r6
197 frsqrte fr1,fr0 /* r = frsqrte(s) */
198 fmuls fr3,fr1,fr0 /* r * s */
199 fmuls fr2,fr1,fr5 /* r * 0.5 */
200 fnmsubs fr3,fr1,fr3,fr4 /* 1 - s * r * r */
201 fmadds fr1,fr2,fr3,fr1 /* r = r + 0.5 * r * (1 - s * r * r) */
202 fmuls fr3,fr1,fr0 /* r * s */
203 fmuls fr2,fr1,fr5 /* r * 0.5 */
204 fnmsubs fr3,fr1,fr3,fr4 /* 1 - s * r * r */
205 fmadds fr1,fr2,fr3,fr1 /* r = r + 0.5 * r * (1 - s * r * r) */
206 stfsx fr1,r3,r6
207 addi r6,r6,4
208 bdnz 1b
209 lfd fr5,56(r1)
210 lfd fr4,48(r1)
211 lfd fr3,40(r1)
212 lfd fr2,32(r1)
213 bl fpdisable
214 lwz r0,36(r1)
215 mtlr r0
216 addi r1,r1,32
217 blr
diff --git a/arch/ppc/kernel/vmlinux.lds.S b/arch/ppc/kernel/vmlinux.lds.S
index 17d2db7e537d..09c6525cfa61 100644
--- a/arch/ppc/kernel/vmlinux.lds.S
+++ b/arch/ppc/kernel/vmlinux.lds.S
@@ -149,32 +149,6 @@ SECTIONS
149 149
150 . = ALIGN(4096); 150 . = ALIGN(4096);
151 _sextratext = .; 151 _sextratext = .;
152 __pmac_begin = .;
153 .pmac.text : { *(.pmac.text) }
154 .pmac.data : { *(.pmac.data) }
155 . = ALIGN(4096);
156 __pmac_end = .;
157
158 . = ALIGN(4096);
159 __prep_begin = .;
160 .prep.text : { *(.prep.text) }
161 .prep.data : { *(.prep.data) }
162 . = ALIGN(4096);
163 __prep_end = .;
164
165 . = ALIGN(4096);
166 __chrp_begin = .;
167 .chrp.text : { *(.chrp.text) }
168 .chrp.data : { *(.chrp.data) }
169 . = ALIGN(4096);
170 __chrp_end = .;
171
172 . = ALIGN(4096);
173 __openfirmware_begin = .;
174 .openfirmware.text : { *(.openfirmware.text) }
175 .openfirmware.data : { *(.openfirmware.data) }
176 . = ALIGN(4096);
177 __openfirmware_end = .;
178 _eextratext = .; 152 _eextratext = .;
179 153
180 __bss_start = .; 154 __bss_start = .;
diff --git a/arch/ppc/lib/string.S b/arch/ppc/lib/string.S
index 36c9b97fd92a..2e258c49e8be 100644
--- a/arch/ppc/lib/string.S
+++ b/arch/ppc/lib/string.S
@@ -65,9 +65,9 @@
65 .stabs "arch/ppc/lib/",N_SO,0,0,0f 65 .stabs "arch/ppc/lib/",N_SO,0,0,0f
66 .stabs "string.S",N_SO,0,0,0f 66 .stabs "string.S",N_SO,0,0,0f
67 67
68CACHELINE_BYTES = L1_CACHE_LINE_SIZE 68CACHELINE_BYTES = L1_CACHE_BYTES
69LG_CACHELINE_BYTES = LG_L1_CACHE_LINE_SIZE 69LG_CACHELINE_BYTES = L1_CACHE_SHIFT
70CACHELINE_MASK = (L1_CACHE_LINE_SIZE-1) 70CACHELINE_MASK = (L1_CACHE_BYTES-1)
71 71
72_GLOBAL(strcpy) 72_GLOBAL(strcpy)
73 addi r5,r3,-1 73 addi r5,r3,-1
@@ -265,12 +265,12 @@ _GLOBAL(cacheable_memcpy)
265 dcbz r11,r6 265 dcbz r11,r6
266#endif 266#endif
267 COPY_16_BYTES 267 COPY_16_BYTES
268#if L1_CACHE_LINE_SIZE >= 32 268#if L1_CACHE_BYTES >= 32
269 COPY_16_BYTES 269 COPY_16_BYTES
270#if L1_CACHE_LINE_SIZE >= 64 270#if L1_CACHE_BYTES >= 64
271 COPY_16_BYTES 271 COPY_16_BYTES
272 COPY_16_BYTES 272 COPY_16_BYTES
273#if L1_CACHE_LINE_SIZE >= 128 273#if L1_CACHE_BYTES >= 128
274 COPY_16_BYTES 274 COPY_16_BYTES
275 COPY_16_BYTES 275 COPY_16_BYTES
276 COPY_16_BYTES 276 COPY_16_BYTES
@@ -485,12 +485,12 @@ _GLOBAL(__copy_tofrom_user)
485 .text 485 .text
486/* the main body of the cacheline loop */ 486/* the main body of the cacheline loop */
487 COPY_16_BYTES_WITHEX(0) 487 COPY_16_BYTES_WITHEX(0)
488#if L1_CACHE_LINE_SIZE >= 32 488#if L1_CACHE_BYTES >= 32
489 COPY_16_BYTES_WITHEX(1) 489 COPY_16_BYTES_WITHEX(1)
490#if L1_CACHE_LINE_SIZE >= 64 490#if L1_CACHE_BYTES >= 64
491 COPY_16_BYTES_WITHEX(2) 491 COPY_16_BYTES_WITHEX(2)
492 COPY_16_BYTES_WITHEX(3) 492 COPY_16_BYTES_WITHEX(3)
493#if L1_CACHE_LINE_SIZE >= 128 493#if L1_CACHE_BYTES >= 128
494 COPY_16_BYTES_WITHEX(4) 494 COPY_16_BYTES_WITHEX(4)
495 COPY_16_BYTES_WITHEX(5) 495 COPY_16_BYTES_WITHEX(5)
496 COPY_16_BYTES_WITHEX(6) 496 COPY_16_BYTES_WITHEX(6)
@@ -544,12 +544,12 @@ _GLOBAL(__copy_tofrom_user)
544 * 104f (if in read part) or 105f (if in write part), after updating r5 544 * 104f (if in read part) or 105f (if in write part), after updating r5
545 */ 545 */
546 COPY_16_BYTES_EXCODE(0) 546 COPY_16_BYTES_EXCODE(0)
547#if L1_CACHE_LINE_SIZE >= 32 547#if L1_CACHE_BYTES >= 32
548 COPY_16_BYTES_EXCODE(1) 548 COPY_16_BYTES_EXCODE(1)
549#if L1_CACHE_LINE_SIZE >= 64 549#if L1_CACHE_BYTES >= 64
550 COPY_16_BYTES_EXCODE(2) 550 COPY_16_BYTES_EXCODE(2)
551 COPY_16_BYTES_EXCODE(3) 551 COPY_16_BYTES_EXCODE(3)
552#if L1_CACHE_LINE_SIZE >= 128 552#if L1_CACHE_BYTES >= 128
553 COPY_16_BYTES_EXCODE(4) 553 COPY_16_BYTES_EXCODE(4)
554 COPY_16_BYTES_EXCODE(5) 554 COPY_16_BYTES_EXCODE(5)
555 COPY_16_BYTES_EXCODE(6) 555 COPY_16_BYTES_EXCODE(6)
diff --git a/arch/ppc/math-emu/sfp-machine.h b/arch/ppc/math-emu/sfp-machine.h
index 686e06d29186..4b17d83cfcdd 100644
--- a/arch/ppc/math-emu/sfp-machine.h
+++ b/arch/ppc/math-emu/sfp-machine.h
@@ -166,7 +166,7 @@ extern int fp_pack_ds(void *, long, unsigned long, unsigned long, long, long);
166#include <linux/kernel.h> 166#include <linux/kernel.h>
167#include <linux/sched.h> 167#include <linux/sched.h>
168 168
169#define __FPU_FPSCR (current->thread.fpscr) 169#define __FPU_FPSCR (current->thread.fpscr.val)
170 170
171/* We only actually write to the destination register 171/* We only actually write to the destination register
172 * if exceptions signalled (if any) will not trap. 172 * if exceptions signalled (if any) will not trap.
diff --git a/arch/ppc/mm/4xx_mmu.c b/arch/ppc/mm/4xx_mmu.c
index b7bcbc232f39..4d006aa1a0d1 100644
--- a/arch/ppc/mm/4xx_mmu.c
+++ b/arch/ppc/mm/4xx_mmu.c
@@ -110,13 +110,11 @@ unsigned long __init mmu_mapin_ram(void)
110 pmd_t *pmdp; 110 pmd_t *pmdp;
111 unsigned long val = p | _PMD_SIZE_16M | _PAGE_HWEXEC | _PAGE_HWWRITE; 111 unsigned long val = p | _PMD_SIZE_16M | _PAGE_HWEXEC | _PAGE_HWWRITE;
112 112
113 spin_lock(&init_mm.page_table_lock);
114 pmdp = pmd_offset(pgd_offset_k(v), v); 113 pmdp = pmd_offset(pgd_offset_k(v), v);
115 pmd_val(*pmdp++) = val; 114 pmd_val(*pmdp++) = val;
116 pmd_val(*pmdp++) = val; 115 pmd_val(*pmdp++) = val;
117 pmd_val(*pmdp++) = val; 116 pmd_val(*pmdp++) = val;
118 pmd_val(*pmdp++) = val; 117 pmd_val(*pmdp++) = val;
119 spin_unlock(&init_mm.page_table_lock);
120 118
121 v += LARGE_PAGE_SIZE_16M; 119 v += LARGE_PAGE_SIZE_16M;
122 p += LARGE_PAGE_SIZE_16M; 120 p += LARGE_PAGE_SIZE_16M;
@@ -127,10 +125,8 @@ unsigned long __init mmu_mapin_ram(void)
127 pmd_t *pmdp; 125 pmd_t *pmdp;
128 unsigned long val = p | _PMD_SIZE_4M | _PAGE_HWEXEC | _PAGE_HWWRITE; 126 unsigned long val = p | _PMD_SIZE_4M | _PAGE_HWEXEC | _PAGE_HWWRITE;
129 127
130 spin_lock(&init_mm.page_table_lock);
131 pmdp = pmd_offset(pgd_offset_k(v), v); 128 pmdp = pmd_offset(pgd_offset_k(v), v);
132 pmd_val(*pmdp) = val; 129 pmd_val(*pmdp) = val;
133 spin_unlock(&init_mm.page_table_lock);
134 130
135 v += LARGE_PAGE_SIZE_4M; 131 v += LARGE_PAGE_SIZE_4M;
136 p += LARGE_PAGE_SIZE_4M; 132 p += LARGE_PAGE_SIZE_4M;
diff --git a/arch/ppc/mm/init.c b/arch/ppc/mm/init.c
index f421a4b337f6..99b48abd3296 100644
--- a/arch/ppc/mm/init.c
+++ b/arch/ppc/mm/init.c
@@ -69,15 +69,12 @@ int init_bootmem_done;
69int boot_mapsize; 69int boot_mapsize;
70#ifdef CONFIG_PPC_PMAC 70#ifdef CONFIG_PPC_PMAC
71unsigned long agp_special_page; 71unsigned long agp_special_page;
72EXPORT_SYMBOL(agp_special_page);
72#endif 73#endif
73 74
74extern char _end[]; 75extern char _end[];
75extern char etext[], _stext[]; 76extern char etext[], _stext[];
76extern char __init_begin, __init_end; 77extern char __init_begin, __init_end;
77extern char __prep_begin, __prep_end;
78extern char __chrp_begin, __chrp_end;
79extern char __pmac_begin, __pmac_end;
80extern char __openfirmware_begin, __openfirmware_end;
81 78
82#ifdef CONFIG_HIGHMEM 79#ifdef CONFIG_HIGHMEM
83pte_t *kmap_pte; 80pte_t *kmap_pte;
@@ -167,14 +164,6 @@ void free_initmem(void)
167 164
168 printk ("Freeing unused kernel memory:"); 165 printk ("Freeing unused kernel memory:");
169 FREESEC(init); 166 FREESEC(init);
170 if (_machine != _MACH_Pmac)
171 FREESEC(pmac);
172 if (_machine != _MACH_chrp)
173 FREESEC(chrp);
174 if (_machine != _MACH_prep)
175 FREESEC(prep);
176 if (!have_of)
177 FREESEC(openfirmware);
178 printk("\n"); 167 printk("\n");
179 ppc_md.progress = NULL; 168 ppc_md.progress = NULL;
180#undef FREESEC 169#undef FREESEC
@@ -648,18 +637,16 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
648 */ 637 */
649int page_is_ram(unsigned long pfn) 638int page_is_ram(unsigned long pfn)
650{ 639{
651 unsigned long paddr = (pfn << PAGE_SHIFT); 640 return pfn < max_pfn;
652
653 return paddr < __pa(high_memory);
654} 641}
655 642
656pgprot_t phys_mem_access_prot(struct file *file, unsigned long addr, 643pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
657 unsigned long size, pgprot_t vma_prot) 644 unsigned long size, pgprot_t vma_prot)
658{ 645{
659 if (ppc_md.phys_mem_access_prot) 646 if (ppc_md.phys_mem_access_prot)
660 return ppc_md.phys_mem_access_prot(file, addr, size, vma_prot); 647 return ppc_md.phys_mem_access_prot(file, pfn, size, vma_prot);
661 648
662 if (!page_is_ram(addr >> PAGE_SHIFT)) 649 if (!page_is_ram(pfn))
663 vma_prot = __pgprot(pgprot_val(vma_prot) 650 vma_prot = __pgprot(pgprot_val(vma_prot)
664 | _PAGE_GUARDED | _PAGE_NO_CACHE); 651 | _PAGE_GUARDED | _PAGE_NO_CACHE);
665 return vma_prot; 652 return vma_prot;
diff --git a/arch/ppc/mm/pgtable.c b/arch/ppc/mm/pgtable.c
index 43505b1fc5d8..6ea9185fd120 100644
--- a/arch/ppc/mm/pgtable.c
+++ b/arch/ppc/mm/pgtable.c
@@ -280,18 +280,16 @@ map_page(unsigned long va, phys_addr_t pa, int flags)
280 pte_t *pg; 280 pte_t *pg;
281 int err = -ENOMEM; 281 int err = -ENOMEM;
282 282
283 spin_lock(&init_mm.page_table_lock);
284 /* Use upper 10 bits of VA to index the first level map */ 283 /* Use upper 10 bits of VA to index the first level map */
285 pd = pmd_offset(pgd_offset_k(va), va); 284 pd = pmd_offset(pgd_offset_k(va), va);
286 /* Use middle 10 bits of VA to index the second-level map */ 285 /* Use middle 10 bits of VA to index the second-level map */
287 pg = pte_alloc_kernel(&init_mm, pd, va); 286 pg = pte_alloc_kernel(pd, va);
288 if (pg != 0) { 287 if (pg != 0) {
289 err = 0; 288 err = 0;
290 set_pte_at(&init_mm, va, pg, pfn_pte(pa >> PAGE_SHIFT, __pgprot(flags))); 289 set_pte_at(&init_mm, va, pg, pfn_pte(pa >> PAGE_SHIFT, __pgprot(flags)));
291 if (mem_init_done) 290 if (mem_init_done)
292 flush_HPTE(0, va, pmd_val(*pd)); 291 flush_HPTE(0, va, pmd_val(*pd));
293 } 292 }
294 spin_unlock(&init_mm.page_table_lock);
295 return err; 293 return err;
296} 294}
297 295
diff --git a/arch/ppc/oprofile/common.c b/arch/ppc/oprofile/common.c
deleted file mode 100644
index 3169c67abea7..000000000000
--- a/arch/ppc/oprofile/common.c
+++ /dev/null
@@ -1,161 +0,0 @@
1/*
2 * PPC 32 oprofile support
3 * Based on PPC64 oprofile support
4 * Copyright (C) 2004 Anton Blanchard <anton@au.ibm.com>, IBM
5 *
6 * Copyright (C) Freescale Semiconductor, Inc 2004
7 *
8 * Author: Andy Fleming
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
14 */
15
16#include <linux/oprofile.h>
17#include <linux/slab.h>
18#include <linux/init.h>
19#include <linux/smp.h>
20#include <linux/errno.h>
21#include <asm/ptrace.h>
22#include <asm/system.h>
23#include <asm/perfmon.h>
24#include <asm/cputable.h>
25
26#include "op_impl.h"
27
28static struct op_ppc32_model *model;
29
30static struct op_counter_config ctr[OP_MAX_COUNTER];
31static struct op_system_config sys;
32
33static void op_handle_interrupt(struct pt_regs *regs)
34{
35 model->handle_interrupt(regs, ctr);
36}
37
38static int op_ppc32_setup(void)
39{
40 /* Install our interrupt handler into the existing hook. */
41 if(request_perfmon_irq(&op_handle_interrupt))
42 return -EBUSY;
43
44 mb();
45
46 /* Pre-compute the values to stuff in the hardware registers. */
47 model->reg_setup(ctr, &sys, model->num_counters);
48
49#if 0
50 /* FIXME: Make multi-cpu work */
51 /* Configure the registers on all cpus. */
52 on_each_cpu(model->reg_setup, NULL, 0, 1);
53#endif
54
55 return 0;
56}
57
58static void op_ppc32_shutdown(void)
59{
60 mb();
61
62 /* Remove our interrupt handler. We may be removing this module. */
63 free_perfmon_irq();
64}
65
66static void op_ppc32_cpu_start(void *dummy)
67{
68 model->start(ctr);
69}
70
71static int op_ppc32_start(void)
72{
73 on_each_cpu(op_ppc32_cpu_start, NULL, 0, 1);
74 return 0;
75}
76
77static inline void op_ppc32_cpu_stop(void *dummy)
78{
79 model->stop();
80}
81
82static void op_ppc32_stop(void)
83{
84 on_each_cpu(op_ppc32_cpu_stop, NULL, 0, 1);
85}
86
87static int op_ppc32_create_files(struct super_block *sb, struct dentry *root)
88{
89 int i;
90
91 for (i = 0; i < model->num_counters; ++i) {
92 struct dentry *dir;
93 char buf[3];
94
95 snprintf(buf, sizeof buf, "%d", i);
96 dir = oprofilefs_mkdir(sb, root, buf);
97
98 oprofilefs_create_ulong(sb, dir, "enabled", &ctr[i].enabled);
99 oprofilefs_create_ulong(sb, dir, "event", &ctr[i].event);
100 oprofilefs_create_ulong(sb, dir, "count", &ctr[i].count);
101 oprofilefs_create_ulong(sb, dir, "kernel", &ctr[i].kernel);
102 oprofilefs_create_ulong(sb, dir, "user", &ctr[i].user);
103
104 /* FIXME: Not sure if this is used */
105 oprofilefs_create_ulong(sb, dir, "unit_mask", &ctr[i].unit_mask);
106 }
107
108 oprofilefs_create_ulong(sb, root, "enable_kernel", &sys.enable_kernel);
109 oprofilefs_create_ulong(sb, root, "enable_user", &sys.enable_user);
110
111 /* Default to tracing both kernel and user */
112 sys.enable_kernel = 1;
113 sys.enable_user = 1;
114
115 return 0;
116}
117
118static struct oprofile_operations oprof_ppc32_ops = {
119 .create_files = op_ppc32_create_files,
120 .setup = op_ppc32_setup,
121 .shutdown = op_ppc32_shutdown,
122 .start = op_ppc32_start,
123 .stop = op_ppc32_stop,
124 .cpu_type = NULL /* To be filled in below. */
125};
126
127int __init oprofile_arch_init(struct oprofile_operations *ops)
128{
129 char *name;
130 int cpu_id = smp_processor_id();
131
132#ifdef CONFIG_FSL_BOOKE
133 model = &op_model_fsl_booke;
134#else
135 return -ENODEV;
136#endif
137
138 name = kmalloc(32, GFP_KERNEL);
139
140 if (NULL == name)
141 return -ENOMEM;
142
143 sprintf(name, "ppc/%s", cur_cpu_spec[cpu_id]->cpu_name);
144
145 oprof_ppc32_ops.cpu_type = name;
146
147 model->num_counters = cur_cpu_spec[cpu_id]->num_pmcs;
148
149 *ops = oprof_ppc32_ops;
150
151 printk(KERN_INFO "oprofile: using %s performance monitoring.\n",
152 oprof_ppc32_ops.cpu_type);
153
154 return 0;
155}
156
157void oprofile_arch_exit(void)
158{
159 kfree(oprof_ppc32_ops.cpu_type);
160 oprof_ppc32_ops.cpu_type = NULL;
161}
diff --git a/arch/ppc/oprofile/op_impl.h b/arch/ppc/oprofile/op_impl.h
deleted file mode 100644
index bc336dc971e3..000000000000
--- a/arch/ppc/oprofile/op_impl.h
+++ /dev/null
@@ -1,45 +0,0 @@
1/*
2 * Copyright (C) 2004 Anton Blanchard <anton@au.ibm.com>, IBM
3 *
4 * Based on alpha version.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#ifndef OP_IMPL_H
13#define OP_IMPL_H 1
14
15#define OP_MAX_COUNTER 8
16
17/* Per-counter configuration as set via oprofilefs. */
18struct op_counter_config {
19 unsigned long enabled;
20 unsigned long event;
21 unsigned long count;
22 unsigned long kernel;
23 unsigned long user;
24 unsigned long unit_mask;
25};
26
27/* System-wide configuration as set via oprofilefs. */
28struct op_system_config {
29 unsigned long enable_kernel;
30 unsigned long enable_user;
31};
32
33/* Per-arch configuration */
34struct op_ppc32_model {
35 void (*reg_setup) (struct op_counter_config *,
36 struct op_system_config *,
37 int num_counters);
38 void (*start) (struct op_counter_config *);
39 void (*stop) (void);
40 void (*handle_interrupt) (struct pt_regs *,
41 struct op_counter_config *);
42 int num_counters;
43};
44
45#endif /* OP_IMPL_H */
diff --git a/arch/ppc/platforms/4xx/bamboo.c b/arch/ppc/platforms/4xx/bamboo.c
index 78a403b48dba..159b228eca1e 100644
--- a/arch/ppc/platforms/4xx/bamboo.c
+++ b/arch/ppc/platforms/4xx/bamboo.c
@@ -51,7 +51,7 @@
51#include <syslib/gen550.h> 51#include <syslib/gen550.h>
52#include <syslib/ibm440gx_common.h> 52#include <syslib/ibm440gx_common.h>
53 53
54bd_t __res; 54extern bd_t __res;
55 55
56static struct ibm44x_clocks clocks __initdata; 56static struct ibm44x_clocks clocks __initdata;
57 57
@@ -425,17 +425,7 @@ bamboo_setup_arch(void)
425void __init platform_init(unsigned long r3, unsigned long r4, 425void __init platform_init(unsigned long r3, unsigned long r4,
426 unsigned long r5, unsigned long r6, unsigned long r7) 426 unsigned long r5, unsigned long r6, unsigned long r7)
427{ 427{
428 parse_bootinfo(find_bootinfo()); 428 ibm44x_platform_init(r3, r4, r5, r6, r7);
429
430 /*
431 * If we were passed in a board information, copy it into the
432 * residual data area.
433 */
434 if (r3)
435 __res = *(bd_t *)(r3 + KERNELBASE);
436
437
438 ibm44x_platform_init();
439 429
440 ppc_md.setup_arch = bamboo_setup_arch; 430 ppc_md.setup_arch = bamboo_setup_arch;
441 ppc_md.show_cpuinfo = bamboo_show_cpuinfo; 431 ppc_md.show_cpuinfo = bamboo_show_cpuinfo;
diff --git a/arch/ppc/platforms/4xx/ebony.c b/arch/ppc/platforms/4xx/ebony.c
index 27b778ab903b..64ebae19cdbb 100644
--- a/arch/ppc/platforms/4xx/ebony.c
+++ b/arch/ppc/platforms/4xx/ebony.c
@@ -54,7 +54,7 @@
54#include <syslib/gen550.h> 54#include <syslib/gen550.h>
55#include <syslib/ibm440gp_common.h> 55#include <syslib/ibm440gp_common.h>
56 56
57bd_t __res; 57extern bd_t __res;
58 58
59static struct ibm44x_clocks clocks __initdata; 59static struct ibm44x_clocks clocks __initdata;
60 60
@@ -90,7 +90,7 @@ ebony_calibrate_decr(void)
90 * on Rev. C silicon then errata forces us to 90 * on Rev. C silicon then errata forces us to
91 * use the internal clock. 91 * use the internal clock.
92 */ 92 */
93 if (strcmp(cur_cpu_spec[0]->cpu_name, "440GP Rev. B") == 0) 93 if (strcmp(cur_cpu_spec->cpu_name, "440GP Rev. B") == 0)
94 freq = EBONY_440GP_RB_SYSCLK; 94 freq = EBONY_440GP_RB_SYSCLK;
95 else 95 else
96 freq = EBONY_440GP_RC_SYSCLK; 96 freq = EBONY_440GP_RC_SYSCLK;
@@ -317,16 +317,7 @@ ebony_setup_arch(void)
317void __init platform_init(unsigned long r3, unsigned long r4, 317void __init platform_init(unsigned long r3, unsigned long r4,
318 unsigned long r5, unsigned long r6, unsigned long r7) 318 unsigned long r5, unsigned long r6, unsigned long r7)
319{ 319{
320 parse_bootinfo(find_bootinfo()); 320 ibm44x_platform_init(r3, r4, r5, r6, r7);
321
322 /*
323 * If we were passed in a board information, copy it into the
324 * residual data area.
325 */
326 if (r3)
327 __res = *(bd_t *)(r3 + KERNELBASE);
328
329 ibm44x_platform_init();
330 321
331 ppc_md.setup_arch = ebony_setup_arch; 322 ppc_md.setup_arch = ebony_setup_arch;
332 ppc_md.show_cpuinfo = ebony_show_cpuinfo; 323 ppc_md.show_cpuinfo = ebony_show_cpuinfo;
diff --git a/arch/ppc/platforms/4xx/luan.c b/arch/ppc/platforms/4xx/luan.c
index 16d953bda22c..d810b736d9bf 100644
--- a/arch/ppc/platforms/4xx/luan.c
+++ b/arch/ppc/platforms/4xx/luan.c
@@ -52,7 +52,7 @@
52#include <syslib/ibm440gx_common.h> 52#include <syslib/ibm440gx_common.h>
53#include <syslib/ibm440sp_common.h> 53#include <syslib/ibm440sp_common.h>
54 54
55bd_t __res; 55extern bd_t __res;
56 56
57static struct ibm44x_clocks clocks __initdata; 57static struct ibm44x_clocks clocks __initdata;
58 58
@@ -355,16 +355,7 @@ luan_setup_arch(void)
355void __init platform_init(unsigned long r3, unsigned long r4, 355void __init platform_init(unsigned long r3, unsigned long r4,
356 unsigned long r5, unsigned long r6, unsigned long r7) 356 unsigned long r5, unsigned long r6, unsigned long r7)
357{ 357{
358 parse_bootinfo(find_bootinfo()); 358 ibm44x_platform_init(r3, r4, r5, r6, r7);
359
360 /*
361 * If we were passed in a board information, copy it into the
362 * residual data area.
363 */
364 if (r3)
365 __res = *(bd_t *)(r3 + KERNELBASE);
366
367 ibm44x_platform_init();
368 359
369 ppc_md.setup_arch = luan_setup_arch; 360 ppc_md.setup_arch = luan_setup_arch;
370 ppc_md.show_cpuinfo = luan_show_cpuinfo; 361 ppc_md.show_cpuinfo = luan_show_cpuinfo;
diff --git a/arch/ppc/platforms/4xx/ocotea.c b/arch/ppc/platforms/4xx/ocotea.c
index 506949c5dd29..73b2c98158f6 100644
--- a/arch/ppc/platforms/4xx/ocotea.c
+++ b/arch/ppc/platforms/4xx/ocotea.c
@@ -52,7 +52,7 @@
52#include <syslib/gen550.h> 52#include <syslib/gen550.h>
53#include <syslib/ibm440gx_common.h> 53#include <syslib/ibm440gx_common.h>
54 54
55bd_t __res; 55extern bd_t __res;
56 56
57static struct ibm44x_clocks clocks __initdata; 57static struct ibm44x_clocks clocks __initdata;
58 58
@@ -286,6 +286,15 @@ ocotea_setup_arch(void)
286 286
287 ibm440gx_tah_enable(); 287 ibm440gx_tah_enable();
288 288
289 /*
290 * Determine various clocks.
291 * To be completely correct we should get SysClk
292 * from FPGA, because it can be changed by on-board switches
293 * --ebs
294 */
295 ibm440gx_get_clocks(&clocks, 33333333, 6 * 1843200);
296 ocp_sys_info.opb_bus_freq = clocks.opb;
297
289 /* Setup TODC access */ 298 /* Setup TODC access */
290 TODC_INIT(TODC_TYPE_DS1743, 299 TODC_INIT(TODC_TYPE_DS1743,
291 0, 300 0,
@@ -324,25 +333,7 @@ static void __init ocotea_init(void)
324void __init platform_init(unsigned long r3, unsigned long r4, 333void __init platform_init(unsigned long r3, unsigned long r4,
325 unsigned long r5, unsigned long r6, unsigned long r7) 334 unsigned long r5, unsigned long r6, unsigned long r7)
326{ 335{
327 parse_bootinfo(find_bootinfo()); 336 ibm44x_platform_init(r3, r4, r5, r6, r7);
328
329 /*
330 * If we were passed in a board information, copy it into the
331 * residual data area.
332 */
333 if (r3)
334 __res = *(bd_t *)(r3 + KERNELBASE);
335
336 /*
337 * Determine various clocks.
338 * To be completely correct we should get SysClk
339 * from FPGA, because it can be changed by on-board switches
340 * --ebs
341 */
342 ibm440gx_get_clocks(&clocks, 33333333, 6 * 1843200);
343 ocp_sys_info.opb_bus_freq = clocks.opb;
344
345 ibm44x_platform_init();
346 337
347 ppc_md.setup_arch = ocotea_setup_arch; 338 ppc_md.setup_arch = ocotea_setup_arch;
348 ppc_md.show_cpuinfo = ocotea_show_cpuinfo; 339 ppc_md.show_cpuinfo = ocotea_show_cpuinfo;
diff --git a/arch/ppc/platforms/83xx/mpc834x_sys.h b/arch/ppc/platforms/83xx/mpc834x_sys.h
index 1584cd77a9ef..58e44c042535 100644
--- a/arch/ppc/platforms/83xx/mpc834x_sys.h
+++ b/arch/ppc/platforms/83xx/mpc834x_sys.h
@@ -19,7 +19,6 @@
19 19
20#include <linux/config.h> 20#include <linux/config.h>
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/seq_file.h>
23#include <syslib/ppc83xx_setup.h> 22#include <syslib/ppc83xx_setup.h>
24#include <asm/ppcboot.h> 23#include <asm/ppcboot.h>
25 24
diff --git a/arch/ppc/platforms/85xx/mpc8540_ads.c b/arch/ppc/platforms/85xx/mpc8540_ads.c
index 7dc8a68acfd0..7e952c1228cb 100644
--- a/arch/ppc/platforms/85xx/mpc8540_ads.c
+++ b/arch/ppc/platforms/85xx/mpc8540_ads.c
@@ -52,6 +52,10 @@
52 52
53#include <syslib/ppc85xx_setup.h> 53#include <syslib/ppc85xx_setup.h>
54 54
55static const char *GFAR_PHY_0 = "phy0:0";
56static const char *GFAR_PHY_1 = "phy0:1";
57static const char *GFAR_PHY_3 = "phy0:3";
58
55/* ************************************************************************ 59/* ************************************************************************
56 * 60 *
57 * Setup the architecture 61 * Setup the architecture
@@ -63,6 +67,7 @@ mpc8540ads_setup_arch(void)
63 bd_t *binfo = (bd_t *) __res; 67 bd_t *binfo = (bd_t *) __res;
64 unsigned int freq; 68 unsigned int freq;
65 struct gianfar_platform_data *pdata; 69 struct gianfar_platform_data *pdata;
70 struct gianfar_mdio_data *mdata;
66 71
67 /* get the core frequency */ 72 /* get the core frequency */
68 freq = binfo->bi_intfreq; 73 freq = binfo->bi_intfreq;
@@ -89,34 +94,35 @@ mpc8540ads_setup_arch(void)
89 invalidate_tlbcam_entry(num_tlbcam_entries - 1); 94 invalidate_tlbcam_entry(num_tlbcam_entries - 1);
90#endif 95#endif
91 96
97 /* setup the board related info for the MDIO bus */
98 mdata = (struct gianfar_mdio_data *) ppc_sys_get_pdata(MPC85xx_MDIO);
99
100 mdata->irq[0] = MPC85xx_IRQ_EXT5;
101 mdata->irq[1] = MPC85xx_IRQ_EXT5;
102 mdata->irq[2] = -1;
103 mdata->irq[3] = MPC85xx_IRQ_EXT5;
104 mdata->irq[31] = -1;
105 mdata->paddr += binfo->bi_immr_base;
106
92 /* setup the board related information for the enet controllers */ 107 /* setup the board related information for the enet controllers */
93 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1); 108 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1);
94 if (pdata) { 109 if (pdata) {
95 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; 110 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
96 pdata->interruptPHY = MPC85xx_IRQ_EXT5; 111 pdata->bus_id = GFAR_PHY_0;
97 pdata->phyid = 0;
98 /* fixup phy address */
99 pdata->phy_reg_addr += binfo->bi_immr_base;
100 memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); 112 memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
101 } 113 }
102 114
103 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2); 115 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2);
104 if (pdata) { 116 if (pdata) {
105 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; 117 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
106 pdata->interruptPHY = MPC85xx_IRQ_EXT5; 118 pdata->bus_id = GFAR_PHY_1;
107 pdata->phyid = 1;
108 /* fixup phy address */
109 pdata->phy_reg_addr += binfo->bi_immr_base;
110 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); 119 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
111 } 120 }
112 121
113 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_FEC); 122 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_FEC);
114 if (pdata) { 123 if (pdata) {
115 pdata->board_flags = 0; 124 pdata->board_flags = 0;
116 pdata->interruptPHY = MPC85xx_IRQ_EXT5; 125 pdata->bus_id = GFAR_PHY_3;
117 pdata->phyid = 3;
118 /* fixup phy address */
119 pdata->phy_reg_addr += binfo->bi_immr_base;
120 memcpy(pdata->mac_addr, binfo->bi_enet2addr, 6); 126 memcpy(pdata->mac_addr, binfo->bi_enet2addr, 6);
121 } 127 }
122 128
diff --git a/arch/ppc/platforms/85xx/mpc8560_ads.c b/arch/ppc/platforms/85xx/mpc8560_ads.c
index 8841fd7da6ee..208433f1e93a 100644
--- a/arch/ppc/platforms/85xx/mpc8560_ads.c
+++ b/arch/ppc/platforms/85xx/mpc8560_ads.c
@@ -56,6 +56,10 @@
56#include <syslib/ppc85xx_setup.h> 56#include <syslib/ppc85xx_setup.h>
57 57
58 58
59static const char *GFAR_PHY_0 = "phy0:0";
60static const char *GFAR_PHY_1 = "phy0:1";
61static const char *GFAR_PHY_3 = "phy0:3";
62
59/* ************************************************************************ 63/* ************************************************************************
60 * 64 *
61 * Setup the architecture 65 * Setup the architecture
@@ -68,6 +72,7 @@ mpc8560ads_setup_arch(void)
68 bd_t *binfo = (bd_t *) __res; 72 bd_t *binfo = (bd_t *) __res;
69 unsigned int freq; 73 unsigned int freq;
70 struct gianfar_platform_data *pdata; 74 struct gianfar_platform_data *pdata;
75 struct gianfar_mdio_data *mdata;
71 76
72 cpm2_reset(); 77 cpm2_reset();
73 78
@@ -86,24 +91,28 @@ mpc8560ads_setup_arch(void)
86 mpc85xx_setup_hose(); 91 mpc85xx_setup_hose();
87#endif 92#endif
88 93
94 /* setup the board related info for the MDIO bus */
95 mdata = (struct gianfar_mdio_data *) ppc_sys_get_pdata(MPC85xx_MDIO);
96
97 mdata->irq[0] = MPC85xx_IRQ_EXT5;
98 mdata->irq[1] = MPC85xx_IRQ_EXT5;
99 mdata->irq[2] = -1;
100 mdata->irq[3] = MPC85xx_IRQ_EXT5;
101 mdata->irq[31] = -1;
102 mdata->paddr += binfo->bi_immr_base;
103
89 /* setup the board related information for the enet controllers */ 104 /* setup the board related information for the enet controllers */
90 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1); 105 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1);
91 if (pdata) { 106 if (pdata) {
92 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; 107 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
93 pdata->interruptPHY = MPC85xx_IRQ_EXT5; 108 pdata->bus_id = GFAR_PHY_0;
94 pdata->phyid = 0;
95 /* fixup phy address */
96 pdata->phy_reg_addr += binfo->bi_immr_base;
97 memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); 109 memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
98 } 110 }
99 111
100 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2); 112 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2);
101 if (pdata) { 113 if (pdata) {
102 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; 114 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
103 pdata->interruptPHY = MPC85xx_IRQ_EXT5; 115 pdata->bus_id = GFAR_PHY_1;
104 pdata->phyid = 1;
105 /* fixup phy address */
106 pdata->phy_reg_addr += binfo->bi_immr_base;
107 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); 116 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
108 } 117 }
109 118
diff --git a/arch/ppc/platforms/85xx/mpc85xx_ads_common.h b/arch/ppc/platforms/85xx/mpc85xx_ads_common.h
index 3875e839cff7..84acf6e8d45e 100644
--- a/arch/ppc/platforms/85xx/mpc85xx_ads_common.h
+++ b/arch/ppc/platforms/85xx/mpc85xx_ads_common.h
@@ -19,7 +19,6 @@
19 19
20#include <linux/config.h> 20#include <linux/config.h>
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/seq_file.h>
23#include <asm/ppcboot.h> 22#include <asm/ppcboot.h>
24 23
25#define BOARD_CCSRBAR ((uint)0xe0000000) 24#define BOARD_CCSRBAR ((uint)0xe0000000)
diff --git a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c
index 9f9039498ae5..a21156967a5e 100644
--- a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c
+++ b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c
@@ -173,10 +173,7 @@ mpc85xx_cds_init_IRQ(void)
173#ifdef CONFIG_PCI 173#ifdef CONFIG_PCI
174 openpic_hookup_cascade(PIRQ0A, "82c59 cascade", i8259_irq); 174 openpic_hookup_cascade(PIRQ0A, "82c59 cascade", i8259_irq);
175 175
176 for (i = 0; i < NUM_8259_INTERRUPTS; i++) 176 i8259_init(0, 0);
177 irq_desc[i].handler = &i8259_pic;
178
179 i8259_init(0);
180#endif 177#endif
181 178
182#ifdef CONFIG_CPM2 179#ifdef CONFIG_CPM2
@@ -394,6 +391,9 @@ mpc85xx_cds_pcibios_fixup(void)
394 391
395TODC_ALLOC(); 392TODC_ALLOC();
396 393
394static const char *GFAR_PHY_0 = "phy0:0";
395static const char *GFAR_PHY_1 = "phy0:1";
396
397/* ************************************************************************ 397/* ************************************************************************
398 * 398 *
399 * Setup the architecture 399 * Setup the architecture
@@ -405,6 +405,7 @@ mpc85xx_cds_setup_arch(void)
405 bd_t *binfo = (bd_t *) __res; 405 bd_t *binfo = (bd_t *) __res;
406 unsigned int freq; 406 unsigned int freq;
407 struct gianfar_platform_data *pdata; 407 struct gianfar_platform_data *pdata;
408 struct gianfar_mdio_data *mdata;
408 409
409 /* get the core frequency */ 410 /* get the core frequency */
410 freq = binfo->bi_intfreq; 411 freq = binfo->bi_intfreq;
@@ -448,44 +449,42 @@ mpc85xx_cds_setup_arch(void)
448 invalidate_tlbcam_entry(num_tlbcam_entries - 1); 449 invalidate_tlbcam_entry(num_tlbcam_entries - 1);
449#endif 450#endif
450 451
452 /* setup the board related info for the MDIO bus */
453 mdata = (struct gianfar_mdio_data *) ppc_sys_get_pdata(MPC85xx_MDIO);
454
455 mdata->irq[0] = MPC85xx_IRQ_EXT5;
456 mdata->irq[1] = MPC85xx_IRQ_EXT5;
457 mdata->irq[2] = -1;
458 mdata->irq[3] = -1;
459 mdata->irq[31] = -1;
460 mdata->paddr += binfo->bi_immr_base;
461
451 /* setup the board related information for the enet controllers */ 462 /* setup the board related information for the enet controllers */
452 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1); 463 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1);
453 if (pdata) { 464 if (pdata) {
454 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; 465 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
455 pdata->interruptPHY = MPC85xx_IRQ_EXT5; 466 pdata->bus_id = GFAR_PHY_0;
456 pdata->phyid = 0;
457 /* fixup phy address */
458 pdata->phy_reg_addr += binfo->bi_immr_base;
459 memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); 467 memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
460 } 468 }
461 469
462 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2); 470 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2);
463 if (pdata) { 471 if (pdata) {
464 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; 472 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
465 pdata->interruptPHY = MPC85xx_IRQ_EXT5; 473 pdata->bus_id = GFAR_PHY_1;
466 pdata->phyid = 1;
467 /* fixup phy address */
468 pdata->phy_reg_addr += binfo->bi_immr_base;
469 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); 474 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
470 } 475 }
471 476
472 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_eTSEC1); 477 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_eTSEC1);
473 if (pdata) { 478 if (pdata) {
474 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; 479 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
475 pdata->interruptPHY = MPC85xx_IRQ_EXT5; 480 pdata->bus_id = GFAR_PHY_0;
476 pdata->phyid = 0;
477 /* fixup phy address */
478 pdata->phy_reg_addr += binfo->bi_immr_base;
479 memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); 481 memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
480 } 482 }
481 483
482 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_eTSEC2); 484 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_eTSEC2);
483 if (pdata) { 485 if (pdata) {
484 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; 486 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
485 pdata->interruptPHY = MPC85xx_IRQ_EXT5; 487 pdata->bus_id = GFAR_PHY_1;
486 pdata->phyid = 1;
487 /* fixup phy address */
488 pdata->phy_reg_addr += binfo->bi_immr_base;
489 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); 488 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
490 } 489 }
491 490
diff --git a/arch/ppc/platforms/85xx/sbc8560.c b/arch/ppc/platforms/85xx/sbc8560.c
index c76760a781c1..b4ee1707a836 100644
--- a/arch/ppc/platforms/85xx/sbc8560.c
+++ b/arch/ppc/platforms/85xx/sbc8560.c
@@ -91,6 +91,9 @@ sbc8560_early_serial_map(void)
91} 91}
92#endif 92#endif
93 93
94static const char *GFAR_PHY_25 = "phy0:25";
95static const char *GFAR_PHY_26 = "phy0:26";
96
94/* ************************************************************************ 97/* ************************************************************************
95 * 98 *
96 * Setup the architecture 99 * Setup the architecture
@@ -102,6 +105,7 @@ sbc8560_setup_arch(void)
102 bd_t *binfo = (bd_t *) __res; 105 bd_t *binfo = (bd_t *) __res;
103 unsigned int freq; 106 unsigned int freq;
104 struct gianfar_platform_data *pdata; 107 struct gianfar_platform_data *pdata;
108 struct gianfar_mdio_data *mdata;
105 109
106 /* get the core frequency */ 110 /* get the core frequency */
107 freq = binfo->bi_intfreq; 111 freq = binfo->bi_intfreq;
@@ -126,24 +130,26 @@ sbc8560_setup_arch(void)
126 invalidate_tlbcam_entry(num_tlbcam_entries - 1); 130 invalidate_tlbcam_entry(num_tlbcam_entries - 1);
127#endif 131#endif
128 132
133 /* setup the board related info for the MDIO bus */
134 mdata = (struct gianfar_mdio_data *) ppc_sys_get_pdata(MPC85xx_MDIO);
135
136 mdata->irq[25] = MPC85xx_IRQ_EXT6;
137 mdata->irq[26] = MPC85xx_IRQ_EXT7;
138 mdata->irq[31] = -1;
139 mdata->paddr += binfo->bi_immr_base;
140
129 /* setup the board related information for the enet controllers */ 141 /* setup the board related information for the enet controllers */
130 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1); 142 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1);
131 if (pdata) { 143 if (pdata) {
132 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; 144 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
133 pdata->interruptPHY = MPC85xx_IRQ_EXT6; 145 pdata->bus_id = GFAR_PHY_25;
134 pdata->phyid = 25;
135 /* fixup phy address */
136 pdata->phy_reg_addr += binfo->bi_immr_base;
137 memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); 146 memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
138 } 147 }
139 148
140 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2); 149 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2);
141 if (pdata) { 150 if (pdata) {
142 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; 151 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
143 pdata->interruptPHY = MPC85xx_IRQ_EXT7; 152 pdata->bus_id = GFAR_PHY_26;
144 pdata->phyid = 26;
145 /* fixup phy address */
146 pdata->phy_reg_addr += binfo->bi_immr_base;
147 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); 153 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
148 } 154 }
149 155
diff --git a/arch/ppc/platforms/85xx/stx_gp3.c b/arch/ppc/platforms/85xx/stx_gp3.c
index 20940f4044f4..1e1b85f8193a 100644
--- a/arch/ppc/platforms/85xx/stx_gp3.c
+++ b/arch/ppc/platforms/85xx/stx_gp3.c
@@ -91,6 +91,9 @@ static u8 gp3_openpic_initsenses[] __initdata = {
91 0x0, /* External 11: */ 91 0x0, /* External 11: */
92}; 92};
93 93
94static const char *GFAR_PHY_2 = "phy0:2";
95static const char *GFAR_PHY_4 = "phy0:4";
96
94/* 97/*
95 * Setup the architecture 98 * Setup the architecture
96 */ 99 */
@@ -100,6 +103,7 @@ gp3_setup_arch(void)
100 bd_t *binfo = (bd_t *) __res; 103 bd_t *binfo = (bd_t *) __res;
101 unsigned int freq; 104 unsigned int freq;
102 struct gianfar_platform_data *pdata; 105 struct gianfar_platform_data *pdata;
106 struct gianfar_mdio_data *mdata;
103 107
104 cpm2_reset(); 108 cpm2_reset();
105 109
@@ -118,23 +122,26 @@ gp3_setup_arch(void)
118 mpc85xx_setup_hose(); 122 mpc85xx_setup_hose();
119#endif 123#endif
120 124
125 /* setup the board related info for the MDIO bus */
126 mdata = (struct gianfar_mdio_data *) ppc_sys_get_pdata(MPC85xx_MDIO);
127
128 mdata->irq[2] = MPC85xx_IRQ_EXT5;
129 mdata->irq[4] = MPC85xx_IRQ_EXT5;
130 mdata->irq[31] = -1;
131 mdata->paddr += binfo->bi_immr_base;
132
121 /* setup the board related information for the enet controllers */ 133 /* setup the board related information for the enet controllers */
122 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1); 134 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1);
123 if (pdata) { 135 if (pdata) {
124 /* pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; */ 136 /* pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; */
125 pdata->interruptPHY = MPC85xx_IRQ_EXT5; 137 pdata->bus_id = GFAR_PHY_2;
126 pdata->phyid = 2;
127 pdata->phy_reg_addr += binfo->bi_immr_base;
128 memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); 138 memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
129 } 139 }
130 140
131 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2); 141 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2);
132 if (pdata) { 142 if (pdata) {
133 /* pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; */ 143 /* pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; */
134 pdata->interruptPHY = MPC85xx_IRQ_EXT5; 144 pdata->bus_id = GFAR_PHY_4;
135 pdata->phyid = 4;
136 /* fixup phy address */
137 pdata->phy_reg_addr += binfo->bi_immr_base;
138 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); 145 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
139 } 146 }
140 147
diff --git a/arch/ppc/platforms/85xx/stx_gp3.h b/arch/ppc/platforms/85xx/stx_gp3.h
index 7bcc6c35a417..95fdf4b0680b 100644
--- a/arch/ppc/platforms/85xx/stx_gp3.h
+++ b/arch/ppc/platforms/85xx/stx_gp3.h
@@ -21,7 +21,6 @@
21 21
22#include <linux/config.h> 22#include <linux/config.h>
23#include <linux/init.h> 23#include <linux/init.h>
24#include <linux/seq_file.h>
25#include <asm/ppcboot.h> 24#include <asm/ppcboot.h>
26 25
27#define BOARD_CCSRBAR ((uint)0xe0000000) 26#define BOARD_CCSRBAR ((uint)0xe0000000)
diff --git a/arch/ppc/platforms/Makefile b/arch/ppc/platforms/Makefile
index ff7452e5d8e5..7c5cdabf6f3c 100644
--- a/arch/ppc/platforms/Makefile
+++ b/arch/ppc/platforms/Makefile
@@ -14,6 +14,9 @@ obj-$(CONFIG_PPC_PMAC) += pmac_pic.o pmac_setup.o pmac_time.o \
14 pmac_low_i2c.o pmac_cache.o 14 pmac_low_i2c.o pmac_cache.o
15obj-$(CONFIG_PPC_CHRP) += chrp_setup.o chrp_time.o chrp_pci.o \ 15obj-$(CONFIG_PPC_CHRP) += chrp_setup.o chrp_time.o chrp_pci.o \
16 chrp_pegasos_eth.o 16 chrp_pegasos_eth.o
17ifeq ($(CONFIG_PPC_CHRP),y)
18obj-$(CONFIG_NVRAM) += chrp_nvram.o
19endif
17obj-$(CONFIG_PPC_PREP) += prep_pci.o prep_setup.o 20obj-$(CONFIG_PPC_PREP) += prep_pci.o prep_setup.o
18ifeq ($(CONFIG_PPC_PMAC),y) 21ifeq ($(CONFIG_PPC_PMAC),y)
19obj-$(CONFIG_NVRAM) += pmac_nvram.o 22obj-$(CONFIG_NVRAM) += pmac_nvram.o
diff --git a/arch/ppc/platforms/chestnut.c b/arch/ppc/platforms/chestnut.c
index df6ff98c023a..48a4a510d598 100644
--- a/arch/ppc/platforms/chestnut.c
+++ b/arch/ppc/platforms/chestnut.c
@@ -541,7 +541,6 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
541 541
542 ppc_md.setup_arch = chestnut_setup_arch; 542 ppc_md.setup_arch = chestnut_setup_arch;
543 ppc_md.show_cpuinfo = chestnut_show_cpuinfo; 543 ppc_md.show_cpuinfo = chestnut_show_cpuinfo;
544 ppc_md.irq_canonicalize = NULL;
545 ppc_md.init_IRQ = mv64360_init_irq; 544 ppc_md.init_IRQ = mv64360_init_irq;
546 ppc_md.get_irq = mv64360_get_irq; 545 ppc_md.get_irq = mv64360_get_irq;
547 ppc_md.init = NULL; 546 ppc_md.init = NULL;
diff --git a/arch/ppc/platforms/chrp_nvram.c b/arch/ppc/platforms/chrp_nvram.c
new file mode 100644
index 000000000000..465ba9b090ef
--- /dev/null
+++ b/arch/ppc/platforms/chrp_nvram.c
@@ -0,0 +1,83 @@
1/*
2 * c 2001 PPC 64 Team, 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 * /dev/nvram driver for PPC
10 *
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/slab.h>
16#include <linux/spinlock.h>
17#include <asm/uaccess.h>
18#include <asm/prom.h>
19#include <asm/machdep.h>
20
21static unsigned int nvram_size;
22static unsigned char nvram_buf[4];
23static DEFINE_SPINLOCK(nvram_lock);
24
25static unsigned char chrp_nvram_read(int addr)
26{
27 unsigned long done, flags;
28 unsigned char ret;
29
30 if (addr >= nvram_size) {
31 printk(KERN_DEBUG "%s: read addr %d > nvram_size %u\n",
32 current->comm, addr, nvram_size);
33 return 0xff;
34 }
35 spin_lock_irqsave(&nvram_lock, flags);
36 if ((call_rtas("nvram-fetch", 3, 2, &done, addr, __pa(nvram_buf), 1) != 0) || 1 != done)
37 ret = 0xff;
38 else
39 ret = nvram_buf[0];
40 spin_unlock_irqrestore(&nvram_lock, flags);
41
42 return ret;
43}
44
45static void chrp_nvram_write(int addr, unsigned char val)
46{
47 unsigned long done, flags;
48
49 if (addr >= nvram_size) {
50 printk(KERN_DEBUG "%s: write addr %d > nvram_size %u\n",
51 current->comm, addr, nvram_size);
52 return;
53 }
54 spin_lock_irqsave(&nvram_lock, flags);
55 nvram_buf[0] = val;
56 if ((call_rtas("nvram-store", 3, 2, &done, addr, __pa(nvram_buf), 1) != 0) || 1 != done)
57 printk(KERN_DEBUG "rtas IO error storing 0x%02x at %d", val, addr);
58 spin_unlock_irqrestore(&nvram_lock, flags);
59}
60
61void __init chrp_nvram_init(void)
62{
63 struct device_node *nvram;
64 unsigned int *nbytes_p, proplen;
65
66 nvram = of_find_node_by_type(NULL, "nvram");
67 if (nvram == NULL)
68 return;
69
70 nbytes_p = (unsigned int *)get_property(nvram, "#bytes", &proplen);
71 if (nbytes_p == NULL || proplen != sizeof(unsigned int))
72 return;
73
74 nvram_size = *nbytes_p;
75
76 printk(KERN_INFO "CHRP nvram contains %u bytes\n", nvram_size);
77 of_node_put(nvram);
78
79 ppc_md.nvram_read_val = chrp_nvram_read;
80 ppc_md.nvram_write_val = chrp_nvram_write;
81
82 return;
83}
diff --git a/arch/ppc/platforms/chrp_pci.c b/arch/ppc/platforms/chrp_pci.c
index 7d3fbb5c5db2..bd047aac01b1 100644
--- a/arch/ppc/platforms/chrp_pci.c
+++ b/arch/ppc/platforms/chrp_pci.c
@@ -29,7 +29,7 @@ void __iomem *gg2_pci_config_base;
29 * limit the bus number to 3 bits 29 * limit the bus number to 3 bits
30 */ 30 */
31 31
32int __chrp gg2_read_config(struct pci_bus *bus, unsigned int devfn, int off, 32int gg2_read_config(struct pci_bus *bus, unsigned int devfn, int off,
33 int len, u32 *val) 33 int len, u32 *val)
34{ 34{
35 volatile void __iomem *cfg_data; 35 volatile void __iomem *cfg_data;
@@ -56,7 +56,7 @@ int __chrp gg2_read_config(struct pci_bus *bus, unsigned int devfn, int off,
56 return PCIBIOS_SUCCESSFUL; 56 return PCIBIOS_SUCCESSFUL;
57} 57}
58 58
59int __chrp gg2_write_config(struct pci_bus *bus, unsigned int devfn, int off, 59int gg2_write_config(struct pci_bus *bus, unsigned int devfn, int off,
60 int len, u32 val) 60 int len, u32 val)
61{ 61{
62 volatile void __iomem *cfg_data; 62 volatile void __iomem *cfg_data;
@@ -92,7 +92,7 @@ static struct pci_ops gg2_pci_ops =
92/* 92/*
93 * Access functions for PCI config space using RTAS calls. 93 * Access functions for PCI config space using RTAS calls.
94 */ 94 */
95int __chrp 95int
96rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset, 96rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
97 int len, u32 *val) 97 int len, u32 *val)
98{ 98{
@@ -108,7 +108,7 @@ rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
108 return rval? PCIBIOS_DEVICE_NOT_FOUND: PCIBIOS_SUCCESSFUL; 108 return rval? PCIBIOS_DEVICE_NOT_FOUND: PCIBIOS_SUCCESSFUL;
109} 109}
110 110
111int __chrp 111int
112rtas_write_config(struct pci_bus *bus, unsigned int devfn, int offset, 112rtas_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
113 int len, u32 val) 113 int len, u32 val)
114{ 114{
@@ -203,7 +203,7 @@ static void __init setup_peg2(struct pci_controller *hose, struct device_node *d
203 printk ("RTAS supporting Pegasos OF not found, please upgrade" 203 printk ("RTAS supporting Pegasos OF not found, please upgrade"
204 " your firmware\n"); 204 " your firmware\n");
205 } 205 }
206 pci_assign_all_busses = 1; 206 pci_assign_all_buses = 1;
207} 207}
208 208
209void __init 209void __init
diff --git a/arch/ppc/platforms/chrp_pegasos_eth.c b/arch/ppc/platforms/chrp_pegasos_eth.c
index d1af11c73ea1..108a6e265185 100644
--- a/arch/ppc/platforms/chrp_pegasos_eth.c
+++ b/arch/ppc/platforms/chrp_pegasos_eth.c
@@ -17,7 +17,20 @@
17#include <linux/mv643xx.h> 17#include <linux/mv643xx.h>
18#include <linux/pci.h> 18#include <linux/pci.h>
19 19
20/* Pegasos 2 specific Marvell MV 64361 gigabit ethernet port setup */ 20#define PEGASOS2_MARVELL_REGBASE (0xf1000000)
21#define PEGASOS2_MARVELL_REGSIZE (0x00004000)
22#define PEGASOS2_SRAM_BASE (0xf2000000)
23#define PEGASOS2_SRAM_SIZE (256*1024)
24
25#define PEGASOS2_SRAM_BASE_ETH0 (PEGASOS2_SRAM_BASE)
26#define PEGASOS2_SRAM_BASE_ETH1 (PEGASOS2_SRAM_BASE_ETH0 + (PEGASOS2_SRAM_SIZE / 2) )
27
28
29#define PEGASOS2_SRAM_RXRING_SIZE (PEGASOS2_SRAM_SIZE/4)
30#define PEGASOS2_SRAM_TXRING_SIZE (PEGASOS2_SRAM_SIZE/4)
31
32#undef BE_VERBOSE
33
21static struct resource mv643xx_eth_shared_resources[] = { 34static struct resource mv643xx_eth_shared_resources[] = {
22 [0] = { 35 [0] = {
23 .name = "ethernet shared base", 36 .name = "ethernet shared base",
@@ -44,7 +57,16 @@ static struct resource mv643xx_eth0_resources[] = {
44 }, 57 },
45}; 58};
46 59
47static struct mv643xx_eth_platform_data eth0_pd; 60
61static struct mv643xx_eth_platform_data eth0_pd = {
62 .tx_sram_addr = PEGASOS2_SRAM_BASE_ETH0,
63 .tx_sram_size = PEGASOS2_SRAM_TXRING_SIZE,
64 .tx_queue_size = PEGASOS2_SRAM_TXRING_SIZE/16,
65
66 .rx_sram_addr = PEGASOS2_SRAM_BASE_ETH0 + PEGASOS2_SRAM_TXRING_SIZE,
67 .rx_sram_size = PEGASOS2_SRAM_RXRING_SIZE,
68 .rx_queue_size = PEGASOS2_SRAM_RXRING_SIZE/16,
69};
48 70
49static struct platform_device eth0_device = { 71static struct platform_device eth0_device = {
50 .name = MV643XX_ETH_NAME, 72 .name = MV643XX_ETH_NAME,
@@ -65,7 +87,15 @@ static struct resource mv643xx_eth1_resources[] = {
65 }, 87 },
66}; 88};
67 89
68static struct mv643xx_eth_platform_data eth1_pd; 90static struct mv643xx_eth_platform_data eth1_pd = {
91 .tx_sram_addr = PEGASOS2_SRAM_BASE_ETH1,
92 .tx_sram_size = PEGASOS2_SRAM_TXRING_SIZE,
93 .tx_queue_size = PEGASOS2_SRAM_TXRING_SIZE/16,
94
95 .rx_sram_addr = PEGASOS2_SRAM_BASE_ETH1 + PEGASOS2_SRAM_TXRING_SIZE,
96 .rx_sram_size = PEGASOS2_SRAM_RXRING_SIZE,
97 .rx_queue_size = PEGASOS2_SRAM_RXRING_SIZE/16,
98};
69 99
70static struct platform_device eth1_device = { 100static struct platform_device eth1_device = {
71 .name = MV643XX_ETH_NAME, 101 .name = MV643XX_ETH_NAME,
@@ -83,9 +113,62 @@ static struct platform_device *mv643xx_eth_pd_devs[] __initdata = {
83 &eth1_device, 113 &eth1_device,
84}; 114};
85 115
116/***********/
117/***********/
118#define MV_READ(offset,val) { val = readl(mv643xx_reg_base + offset); }
119#define MV_WRITE(offset,data) writel(data, mv643xx_reg_base + offset)
120
121static void __iomem *mv643xx_reg_base;
122
123static int Enable_SRAM(void)
124{
125 u32 ALong;
126
127 if (mv643xx_reg_base == NULL)
128 mv643xx_reg_base = ioremap(PEGASOS2_MARVELL_REGBASE,
129 PEGASOS2_MARVELL_REGSIZE);
130
131 if (mv643xx_reg_base == NULL)
132 return -ENOMEM;
133
134#ifdef BE_VERBOSE
135 printk("Pegasos II/Marvell MV64361: register remapped from %p to %p\n",
136 (void *)PEGASOS2_MARVELL_REGBASE, (void *)mv643xx_reg_base);
137#endif
138
139 MV_WRITE(MV64340_SRAM_CONFIG, 0);
86 140
87int 141 MV_WRITE(MV64340_INTEGRATED_SRAM_BASE_ADDR, PEGASOS2_SRAM_BASE >> 16);
88mv643xx_eth_add_pds(void) 142
143 MV_READ(MV64340_BASE_ADDR_ENABLE, ALong);
144 ALong &= ~(1 << 19);
145 MV_WRITE(MV64340_BASE_ADDR_ENABLE, ALong);
146
147 ALong = 0x02;
148 ALong |= PEGASOS2_SRAM_BASE & 0xffff0000;
149 MV_WRITE(MV643XX_ETH_BAR_4, ALong);
150
151 MV_WRITE(MV643XX_ETH_SIZE_REG_4, (PEGASOS2_SRAM_SIZE-1) & 0xffff0000);
152
153 MV_READ(MV643XX_ETH_BASE_ADDR_ENABLE_REG, ALong);
154 ALong &= ~(1 << 4);
155 MV_WRITE(MV643XX_ETH_BASE_ADDR_ENABLE_REG, ALong);
156
157#ifdef BE_VERBOSE
158 printk("Pegasos II/Marvell MV64361: register unmapped\n");
159 printk("Pegasos II/Marvell MV64361: SRAM at %p, size=%x\n", (void*) PEGASOS2_SRAM_BASE, PEGASOS2_SRAM_SIZE);
160#endif
161
162 iounmap(mv643xx_reg_base);
163 mv643xx_reg_base = NULL;
164
165 return 1;
166}
167
168
169/***********/
170/***********/
171int mv643xx_eth_add_pds(void)
89{ 172{
90 int ret = 0; 173 int ret = 0;
91 static struct pci_device_id pci_marvell_mv64360[] = { 174 static struct pci_device_id pci_marvell_mv64360[] = {
@@ -93,9 +176,38 @@ mv643xx_eth_add_pds(void)
93 { } 176 { }
94 }; 177 };
95 178
179#ifdef BE_VERBOSE
180 printk("Pegasos II/Marvell MV64361: init\n");
181#endif
182
96 if (pci_dev_present(pci_marvell_mv64360)) { 183 if (pci_dev_present(pci_marvell_mv64360)) {
97 ret = platform_add_devices(mv643xx_eth_pd_devs, ARRAY_SIZE(mv643xx_eth_pd_devs)); 184 ret = platform_add_devices(mv643xx_eth_pd_devs,
185 ARRAY_SIZE(mv643xx_eth_pd_devs));
186
187 if ( Enable_SRAM() < 0)
188 {
189 eth0_pd.tx_sram_addr = 0;
190 eth0_pd.tx_sram_size = 0;
191 eth0_pd.rx_sram_addr = 0;
192 eth0_pd.rx_sram_size = 0;
193
194 eth1_pd.tx_sram_addr = 0;
195 eth1_pd.tx_sram_size = 0;
196 eth1_pd.rx_sram_addr = 0;
197 eth1_pd.rx_sram_size = 0;
198
199#ifdef BE_VERBOSE
200 printk("Pegasos II/Marvell MV64361: Can't enable the "
201 "SRAM\n");
202#endif
203 }
98 } 204 }
205
206#ifdef BE_VERBOSE
207 printk("Pegasos II/Marvell MV64361: init is over\n");
208#endif
209
99 return ret; 210 return ret;
100} 211}
212
101device_initcall(mv643xx_eth_add_pds); 213device_initcall(mv643xx_eth_add_pds);
diff --git a/arch/ppc/platforms/chrp_setup.c b/arch/ppc/platforms/chrp_setup.c
index 66346f0de7ec..f1b70ab3c6fd 100644
--- a/arch/ppc/platforms/chrp_setup.c
+++ b/arch/ppc/platforms/chrp_setup.c
@@ -104,7 +104,7 @@ static const char *gg2_cachemodes[4] = {
104 "Disabled", "Write-Through", "Copy-Back", "Transparent Mode" 104 "Disabled", "Write-Through", "Copy-Back", "Transparent Mode"
105}; 105};
106 106
107int __chrp 107int
108chrp_show_cpuinfo(struct seq_file *m) 108chrp_show_cpuinfo(struct seq_file *m)
109{ 109{
110 int i, sdramen; 110 int i, sdramen;
@@ -302,7 +302,7 @@ void __init chrp_setup_arch(void)
302 pci_create_OF_bus_map(); 302 pci_create_OF_bus_map();
303} 303}
304 304
305void __chrp 305void
306chrp_event_scan(void) 306chrp_event_scan(void)
307{ 307{
308 unsigned char log[1024]; 308 unsigned char log[1024];
@@ -313,7 +313,7 @@ chrp_event_scan(void)
313 ppc_md.heartbeat_count = ppc_md.heartbeat_reset; 313 ppc_md.heartbeat_count = ppc_md.heartbeat_reset;
314} 314}
315 315
316void __chrp 316void
317chrp_restart(char *cmd) 317chrp_restart(char *cmd)
318{ 318{
319 printk("RTAS system-reboot returned %d\n", 319 printk("RTAS system-reboot returned %d\n",
@@ -321,7 +321,7 @@ chrp_restart(char *cmd)
321 for (;;); 321 for (;;);
322} 322}
323 323
324void __chrp 324void
325chrp_power_off(void) 325chrp_power_off(void)
326{ 326{
327 /* allow power on only with power button press */ 327 /* allow power on only with power button press */
@@ -330,20 +330,12 @@ chrp_power_off(void)
330 for (;;); 330 for (;;);
331} 331}
332 332
333void __chrp 333void
334chrp_halt(void) 334chrp_halt(void)
335{ 335{
336 chrp_power_off(); 336 chrp_power_off();
337} 337}
338 338
339u_int __chrp
340chrp_irq_canonicalize(u_int irq)
341{
342 if (irq == 2)
343 return 9;
344 return irq;
345}
346
347/* 339/*
348 * Finds the open-pic node and sets OpenPIC_Addr based on its reg property. 340 * Finds the open-pic node and sets OpenPIC_Addr based on its reg property.
349 * Then checks if it has an interrupt-ranges property. If it does then 341 * Then checks if it has an interrupt-ranges property. If it does then
@@ -444,9 +436,7 @@ void __init chrp_init_IRQ(void)
444 i8259_irq); 436 i8259_irq);
445 437
446 } 438 }
447 for (i = 0; i < NUM_8259_INTERRUPTS; i++) 439 i8259_init(chrp_int_ack, 0);
448 irq_desc[i].handler = &i8259_pic;
449 i8259_init(chrp_int_ack);
450 440
451#if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) && defined(XMON) 441#if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) && defined(XMON)
452 /* see if there is a keyboard in the device tree 442 /* see if there is a keyboard in the device tree
@@ -464,8 +454,7 @@ void __init
464chrp_init2(void) 454chrp_init2(void)
465{ 455{
466#ifdef CONFIG_NVRAM 456#ifdef CONFIG_NVRAM
467// XX replace this in a more saner way 457 chrp_nvram_init();
468// pmac_nvram_init();
469#endif 458#endif
470 459
471 request_region(0x20,0x20,"pic1"); 460 request_region(0x20,0x20,"pic1");
@@ -499,6 +488,7 @@ chrp_init(unsigned long r3, unsigned long r4, unsigned long r5,
499 DMA_MODE_READ = 0x44; 488 DMA_MODE_READ = 0x44;
500 DMA_MODE_WRITE = 0x48; 489 DMA_MODE_WRITE = 0x48;
501 isa_io_base = CHRP_ISA_IO_BASE; /* default value */ 490 isa_io_base = CHRP_ISA_IO_BASE; /* default value */
491 ppc_do_canonicalize_irqs = 1;
502 492
503 if (root) 493 if (root)
504 machine = get_property(root, "model", NULL); 494 machine = get_property(root, "model", NULL);
@@ -517,7 +507,6 @@ chrp_init(unsigned long r3, unsigned long r4, unsigned long r5,
517 ppc_md.show_percpuinfo = of_show_percpuinfo; 507 ppc_md.show_percpuinfo = of_show_percpuinfo;
518 ppc_md.show_cpuinfo = chrp_show_cpuinfo; 508 ppc_md.show_cpuinfo = chrp_show_cpuinfo;
519 509
520 ppc_md.irq_canonicalize = chrp_irq_canonicalize;
521 ppc_md.init_IRQ = chrp_init_IRQ; 510 ppc_md.init_IRQ = chrp_init_IRQ;
522 if (_chrp_type == _CHRP_Pegasos) 511 if (_chrp_type == _CHRP_Pegasos)
523 ppc_md.get_irq = i8259_irq; 512 ppc_md.get_irq = i8259_irq;
@@ -561,7 +550,7 @@ chrp_init(unsigned long r3, unsigned long r4, unsigned long r5,
561#endif 550#endif
562 551
563#ifdef CONFIG_SMP 552#ifdef CONFIG_SMP
564 ppc_md.smp_ops = &chrp_smp_ops; 553 smp_ops = &chrp_smp_ops;
565#endif /* CONFIG_SMP */ 554#endif /* CONFIG_SMP */
566 555
567 /* 556 /*
@@ -571,7 +560,7 @@ chrp_init(unsigned long r3, unsigned long r4, unsigned long r5,
571 if (ppc_md.progress) ppc_md.progress("Linux/PPC "UTS_RELEASE"\n", 0x0); 560 if (ppc_md.progress) ppc_md.progress("Linux/PPC "UTS_RELEASE"\n", 0x0);
572} 561}
573 562
574void __chrp 563void
575rtas_display_progress(char *s, unsigned short hex) 564rtas_display_progress(char *s, unsigned short hex)
576{ 565{
577 int width; 566 int width;
@@ -598,7 +587,7 @@ rtas_display_progress(char *s, unsigned short hex)
598 call_rtas( "display-character", 1, 1, NULL, ' ' ); 587 call_rtas( "display-character", 1, 1, NULL, ' ' );
599} 588}
600 589
601void __chrp 590void
602rtas_indicator_progress(char *s, unsigned short hex) 591rtas_indicator_progress(char *s, unsigned short hex)
603{ 592{
604 call_rtas("set-indicator", 3, 1, NULL, 6, 0, hex); 593 call_rtas("set-indicator", 3, 1, NULL, 6, 0, hex);
diff --git a/arch/ppc/platforms/chrp_smp.c b/arch/ppc/platforms/chrp_smp.c
index 0ea1f7d9e46a..97e539557ecb 100644
--- a/arch/ppc/platforms/chrp_smp.c
+++ b/arch/ppc/platforms/chrp_smp.c
@@ -31,6 +31,7 @@
31#include <asm/residual.h> 31#include <asm/residual.h>
32#include <asm/time.h> 32#include <asm/time.h>
33#include <asm/open_pic.h> 33#include <asm/open_pic.h>
34#include <asm/machdep.h>
34 35
35extern unsigned long smp_chrp_cpu_nr; 36extern unsigned long smp_chrp_cpu_nr;
36 37
@@ -88,7 +89,7 @@ smp_chrp_take_timebase(void)
88} 89}
89 90
90/* CHRP with openpic */ 91/* CHRP with openpic */
91struct smp_ops_t chrp_smp_ops __chrpdata = { 92struct smp_ops_t chrp_smp_ops = {
92 .message_pass = smp_openpic_message_pass, 93 .message_pass = smp_openpic_message_pass,
93 .probe = smp_chrp_probe, 94 .probe = smp_chrp_probe,
94 .kick_cpu = smp_chrp_kick_cpu, 95 .kick_cpu = smp_chrp_kick_cpu,
diff --git a/arch/ppc/platforms/chrp_time.c b/arch/ppc/platforms/chrp_time.c
index 6037ce7796f5..29d074c305f0 100644
--- a/arch/ppc/platforms/chrp_time.c
+++ b/arch/ppc/platforms/chrp_time.c
@@ -52,7 +52,7 @@ long __init chrp_time_init(void)
52 return 0; 52 return 0;
53} 53}
54 54
55int __chrp chrp_cmos_clock_read(int addr) 55int chrp_cmos_clock_read(int addr)
56{ 56{
57 if (nvram_as1 != 0) 57 if (nvram_as1 != 0)
58 outb(addr>>8, nvram_as1); 58 outb(addr>>8, nvram_as1);
@@ -60,7 +60,7 @@ int __chrp chrp_cmos_clock_read(int addr)
60 return (inb(nvram_data)); 60 return (inb(nvram_data));
61} 61}
62 62
63void __chrp chrp_cmos_clock_write(unsigned long val, int addr) 63void chrp_cmos_clock_write(unsigned long val, int addr)
64{ 64{
65 if (nvram_as1 != 0) 65 if (nvram_as1 != 0)
66 outb(addr>>8, nvram_as1); 66 outb(addr>>8, nvram_as1);
@@ -72,7 +72,7 @@ void __chrp chrp_cmos_clock_write(unsigned long val, int addr)
72/* 72/*
73 * Set the hardware clock. -- Cort 73 * Set the hardware clock. -- Cort
74 */ 74 */
75int __chrp chrp_set_rtc_time(unsigned long nowtime) 75int chrp_set_rtc_time(unsigned long nowtime)
76{ 76{
77 unsigned char save_control, save_freq_select; 77 unsigned char save_control, save_freq_select;
78 struct rtc_time tm; 78 struct rtc_time tm;
@@ -118,7 +118,7 @@ int __chrp chrp_set_rtc_time(unsigned long nowtime)
118 return 0; 118 return 0;
119} 119}
120 120
121unsigned long __chrp chrp_get_rtc_time(void) 121unsigned long chrp_get_rtc_time(void)
122{ 122{
123 unsigned int year, mon, day, hour, min, sec; 123 unsigned int year, mon, day, hour, min, sec;
124 int uip, i; 124 int uip, i;
diff --git a/arch/ppc/platforms/ev64360.c b/arch/ppc/platforms/ev64360.c
index 4e6cc64b3efd..b1324564456e 100644
--- a/arch/ppc/platforms/ev64360.c
+++ b/arch/ppc/platforms/ev64360.c
@@ -36,6 +36,7 @@
36#include <asm/bootinfo.h> 36#include <asm/bootinfo.h>
37#include <asm/ppcboot.h> 37#include <asm/ppcboot.h>
38#include <asm/mv64x60.h> 38#include <asm/mv64x60.h>
39#include <asm/machdep.h>
39#include <platforms/ev64360.h> 40#include <platforms/ev64360.h>
40 41
41#define BOARD_VENDOR "Marvell" 42#define BOARD_VENDOR "Marvell"
diff --git a/arch/ppc/platforms/fads.h b/arch/ppc/platforms/fads.h
index b60c56450b67..a48fb8d723e4 100644
--- a/arch/ppc/platforms/fads.h
+++ b/arch/ppc/platforms/fads.h
@@ -25,6 +25,8 @@
25 25
26#if defined(CONFIG_MPC86XADS) 26#if defined(CONFIG_MPC86XADS)
27 27
28#define BOARD_CHIP_NAME "MPC86X"
29
28/* U-Boot maps BCSR to 0xff080000 */ 30/* U-Boot maps BCSR to 0xff080000 */
29#define BCSR_ADDR ((uint)0xff080000) 31#define BCSR_ADDR ((uint)0xff080000)
30 32
diff --git a/arch/ppc/platforms/gemini_setup.c b/arch/ppc/platforms/gemini_setup.c
index 3a5ff9fb71d6..729897c59033 100644
--- a/arch/ppc/platforms/gemini_setup.c
+++ b/arch/ppc/platforms/gemini_setup.c
@@ -35,6 +35,7 @@
35#include <asm/time.h> 35#include <asm/time.h>
36#include <asm/open_pic.h> 36#include <asm/open_pic.h>
37#include <asm/bootinfo.h> 37#include <asm/bootinfo.h>
38#include <asm/machdep.h>
38 39
39void gemini_find_bridges(void); 40void gemini_find_bridges(void);
40static int gemini_get_clock_speed(void); 41static int gemini_get_clock_speed(void);
@@ -555,7 +556,6 @@ void __init platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
555 556
556 ppc_md.setup_arch = gemini_setup_arch; 557 ppc_md.setup_arch = gemini_setup_arch;
557 ppc_md.show_cpuinfo = gemini_show_cpuinfo; 558 ppc_md.show_cpuinfo = gemini_show_cpuinfo;
558 ppc_md.irq_canonicalize = NULL;
559 ppc_md.init_IRQ = gemini_init_IRQ; 559 ppc_md.init_IRQ = gemini_init_IRQ;
560 ppc_md.get_irq = openpic_get_irq; 560 ppc_md.get_irq = openpic_get_irq;
561 ppc_md.init = NULL; 561 ppc_md.init = NULL;
@@ -575,6 +575,6 @@ void __init platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
575 ppc_md.pcibios_fixup_bus = gemini_pcibios_fixup; 575 ppc_md.pcibios_fixup_bus = gemini_pcibios_fixup;
576 576
577#ifdef CONFIG_SMP 577#ifdef CONFIG_SMP
578 ppc_md.smp_ops = &gemini_smp_ops; 578 smp_ops = &gemini_smp_ops;
579#endif /* CONFIG_SMP */ 579#endif /* CONFIG_SMP */
580} 580}
diff --git a/arch/ppc/platforms/hdpu.c b/arch/ppc/platforms/hdpu.c
index 0f07e963de3c..50039a204c24 100644
--- a/arch/ppc/platforms/hdpu.c
+++ b/arch/ppc/platforms/hdpu.c
@@ -610,11 +610,6 @@ static void parse_bootinfo(unsigned long r3,
610} 610}
611 611
612#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) 612#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
613static int hdpu_ide_check_region(ide_ioreg_t from, unsigned int extent)
614{
615 return check_region(from, extent);
616}
617
618static void 613static void
619hdpu_ide_request_region(ide_ioreg_t from, unsigned int extent, const char *name) 614hdpu_ide_request_region(ide_ioreg_t from, unsigned int extent, const char *name)
620{ 615{
@@ -754,7 +749,7 @@ static int smp_hdpu_probe(void)
754} 749}
755 750
756static void 751static void
757smp_hdpu_message_pass(int target, int msg, unsigned long data, int wait) 752smp_hdpu_message_pass(int target, int msg)
758{ 753{
759 if (msg > 0x3) { 754 if (msg > 0x3) {
760 printk("SMP %d: smp_message_pass: unknown msg %d\n", 755 printk("SMP %d: smp_message_pass: unknown msg %d\n",
@@ -950,7 +945,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
950#endif /* CONFIG_SERIAL_TEXT_DEBUG */ 945#endif /* CONFIG_SERIAL_TEXT_DEBUG */
951 946
952#ifdef CONFIG_SMP 947#ifdef CONFIG_SMP
953 ppc_md.smp_ops = &hdpu_smp_ops; 948 smp_ops = &hdpu_smp_ops;
954#endif /* CONFIG_SMP */ 949#endif /* CONFIG_SMP */
955 950
956#if defined(CONFIG_SERIAL_MPSC) || defined(CONFIG_MV643XX_ETH) 951#if defined(CONFIG_SERIAL_MPSC) || defined(CONFIG_MV643XX_ETH)
diff --git a/arch/ppc/platforms/katana.c b/arch/ppc/platforms/katana.c
index beb617141456..6e58e30ceed1 100644
--- a/arch/ppc/platforms/katana.c
+++ b/arch/ppc/platforms/katana.c
@@ -43,6 +43,7 @@
43#include <asm/ppcboot.h> 43#include <asm/ppcboot.h>
44#include <asm/mv64x60.h> 44#include <asm/mv64x60.h>
45#include <platforms/katana.h> 45#include <platforms/katana.h>
46#include <asm/machdep.h>
46 47
47static struct mv64x60_handle bh; 48static struct mv64x60_handle bh;
48static katana_id_t katana_id; 49static katana_id_t katana_id;
@@ -521,7 +522,7 @@ katana_fixup_resources(struct pci_dev *dev)
521{ 522{
522 u16 v16; 523 u16 v16;
523 524
524 pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, L1_CACHE_LINE_SIZE>>2); 525 pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, L1_CACHE_BYTES>>2);
525 526
526 pci_read_config_word(dev, PCI_COMMAND, &v16); 527 pci_read_config_word(dev, PCI_COMMAND, &v16);
527 v16 |= PCI_COMMAND_INVALIDATE | PCI_COMMAND_FAST_BACK; 528 v16 |= PCI_COMMAND_INVALIDATE | PCI_COMMAND_FAST_BACK;
diff --git a/arch/ppc/platforms/lite5200.c b/arch/ppc/platforms/lite5200.c
index b604cf8b3cae..d44cc991179f 100644
--- a/arch/ppc/platforms/lite5200.c
+++ b/arch/ppc/platforms/lite5200.c
@@ -35,6 +35,7 @@
35#include <asm/io.h> 35#include <asm/io.h>
36#include <asm/mpc52xx.h> 36#include <asm/mpc52xx.h>
37#include <asm/ppc_sys.h> 37#include <asm/ppc_sys.h>
38#include <asm/machdep.h>
38 39
39#include <syslib/mpc52xx_pci.h> 40#include <syslib/mpc52xx_pci.h>
40 41
diff --git a/arch/ppc/platforms/lopec.c b/arch/ppc/platforms/lopec.c
index a5569525e0af..06d247c23b82 100644
--- a/arch/ppc/platforms/lopec.c
+++ b/arch/ppc/platforms/lopec.c
@@ -144,15 +144,6 @@ lopec_show_cpuinfo(struct seq_file *m)
144 return 0; 144 return 0;
145} 145}
146 146
147static u32
148lopec_irq_canonicalize(u32 irq)
149{
150 if (irq == 2)
151 return 9;
152 else
153 return irq;
154}
155
156static void 147static void
157lopec_restart(char *cmd) 148lopec_restart(char *cmd)
158{ 149{
@@ -276,15 +267,11 @@ lopec_init_IRQ(void)
276 openpic_hookup_cascade(NUM_8259_INTERRUPTS, "82c59 cascade", 267 openpic_hookup_cascade(NUM_8259_INTERRUPTS, "82c59 cascade",
277 &i8259_irq); 268 &i8259_irq);
278 269
279 /* Map i8259 interrupts */
280 for(i = 0; i < NUM_8259_INTERRUPTS; i++)
281 irq_desc[i].handler = &i8259_pic;
282
283 /* 270 /*
284 * The EPIC allows for a read in the range of 0xFEF00000 -> 271 * The EPIC allows for a read in the range of 0xFEF00000 ->
285 * 0xFEFFFFFF to generate a PCI interrupt-acknowledge transaction. 272 * 0xFEFFFFFF to generate a PCI interrupt-acknowledge transaction.
286 */ 273 */
287 i8259_init(0xfef00000); 274 i8259_init(0xfef00000, 0);
288} 275}
289 276
290static int __init 277static int __init
@@ -379,10 +366,10 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
379 ISA_DMA_THRESHOLD = 0x00ffffff; 366 ISA_DMA_THRESHOLD = 0x00ffffff;
380 DMA_MODE_READ = 0x44; 367 DMA_MODE_READ = 0x44;
381 DMA_MODE_WRITE = 0x48; 368 DMA_MODE_WRITE = 0x48;
369 ppc_do_canonicalize_irqs = 1;
382 370
383 ppc_md.setup_arch = lopec_setup_arch; 371 ppc_md.setup_arch = lopec_setup_arch;
384 ppc_md.show_cpuinfo = lopec_show_cpuinfo; 372 ppc_md.show_cpuinfo = lopec_show_cpuinfo;
385 ppc_md.irq_canonicalize = lopec_irq_canonicalize;
386 ppc_md.init_IRQ = lopec_init_IRQ; 373 ppc_md.init_IRQ = lopec_init_IRQ;
387 ppc_md.get_irq = openpic_get_irq; 374 ppc_md.get_irq = openpic_get_irq;
388 375
diff --git a/arch/ppc/platforms/mpc885ads.h b/arch/ppc/platforms/mpc885ads.h
index eb386635b0fd..a80b7d116b49 100644
--- a/arch/ppc/platforms/mpc885ads.h
+++ b/arch/ppc/platforms/mpc885ads.h
@@ -88,5 +88,7 @@
88#define SICR_ENET_MASK ((uint)0x00ff0000) 88#define SICR_ENET_MASK ((uint)0x00ff0000)
89#define SICR_ENET_CLKRT ((uint)0x002c0000) 89#define SICR_ENET_CLKRT ((uint)0x002c0000)
90 90
91#define BOARD_CHIP_NAME "MPC885"
92
91#endif /* __ASM_MPC885ADS_H__ */ 93#endif /* __ASM_MPC885ADS_H__ */
92#endif /* __KERNEL__ */ 94#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/mvme5100.c b/arch/ppc/platforms/mvme5100.c
index ce2ce88c8033..108eb182dddc 100644
--- a/arch/ppc/platforms/mvme5100.c
+++ b/arch/ppc/platforms/mvme5100.c
@@ -223,11 +223,7 @@ mvme5100_init_IRQ(void)
223 openpic_hookup_cascade(NUM_8259_INTERRUPTS, "82c59 cascade", 223 openpic_hookup_cascade(NUM_8259_INTERRUPTS, "82c59 cascade",
224 &i8259_irq); 224 &i8259_irq);
225 225
226 /* Map i8259 interrupts. */ 226 i8259_init(0, 0);
227 for (i = 0; i < NUM_8259_INTERRUPTS; i++)
228 irq_desc[i].handler = &i8259_pic;
229
230 i8259_init(0);
231#else 227#else
232 openpic_init(0); 228 openpic_init(0);
233#endif 229#endif
diff --git a/arch/ppc/platforms/pal4_setup.c b/arch/ppc/platforms/pal4_setup.c
index 12446b93e38c..f93a3f871932 100644
--- a/arch/ppc/platforms/pal4_setup.c
+++ b/arch/ppc/platforms/pal4_setup.c
@@ -28,6 +28,7 @@
28#include <asm/io.h> 28#include <asm/io.h>
29#include <asm/todc.h> 29#include <asm/todc.h>
30#include <asm/bootinfo.h> 30#include <asm/bootinfo.h>
31#include <asm/machdep.h>
31 32
32#include <syslib/cpc700.h> 33#include <syslib/cpc700.h>
33 34
diff --git a/arch/ppc/platforms/pmac_backlight.c b/arch/ppc/platforms/pmac_backlight.c
index ed2b1cebc19a..8be2f7d071f0 100644
--- a/arch/ppc/platforms/pmac_backlight.c
+++ b/arch/ppc/platforms/pmac_backlight.c
@@ -37,7 +37,7 @@ static int backlight_req_enable = -1;
37static void backlight_callback(void *); 37static void backlight_callback(void *);
38static DECLARE_WORK(backlight_work, backlight_callback, NULL); 38static DECLARE_WORK(backlight_work, backlight_callback, NULL);
39 39
40void __pmac register_backlight_controller(struct backlight_controller *ctrler, 40void register_backlight_controller(struct backlight_controller *ctrler,
41 void *data, char *type) 41 void *data, char *type)
42{ 42{
43 struct device_node* bk_node; 43 struct device_node* bk_node;
@@ -99,7 +99,7 @@ void __pmac register_backlight_controller(struct backlight_controller *ctrler,
99} 99}
100EXPORT_SYMBOL(register_backlight_controller); 100EXPORT_SYMBOL(register_backlight_controller);
101 101
102void __pmac unregister_backlight_controller(struct backlight_controller 102void unregister_backlight_controller(struct backlight_controller
103 *ctrler, void *data) 103 *ctrler, void *data)
104{ 104{
105 /* We keep the current backlight level (for now) */ 105 /* We keep the current backlight level (for now) */
@@ -108,7 +108,7 @@ void __pmac unregister_backlight_controller(struct backlight_controller
108} 108}
109EXPORT_SYMBOL(unregister_backlight_controller); 109EXPORT_SYMBOL(unregister_backlight_controller);
110 110
111static int __pmac __set_backlight_enable(int enable) 111static int __set_backlight_enable(int enable)
112{ 112{
113 int rc; 113 int rc;
114 114
@@ -122,7 +122,7 @@ static int __pmac __set_backlight_enable(int enable)
122 release_console_sem(); 122 release_console_sem();
123 return rc; 123 return rc;
124} 124}
125int __pmac set_backlight_enable(int enable) 125int set_backlight_enable(int enable)
126{ 126{
127 if (!backlighter) 127 if (!backlighter)
128 return -ENODEV; 128 return -ENODEV;
@@ -133,7 +133,7 @@ int __pmac set_backlight_enable(int enable)
133 133
134EXPORT_SYMBOL(set_backlight_enable); 134EXPORT_SYMBOL(set_backlight_enable);
135 135
136int __pmac get_backlight_enable(void) 136int get_backlight_enable(void)
137{ 137{
138 if (!backlighter) 138 if (!backlighter)
139 return -ENODEV; 139 return -ENODEV;
@@ -141,7 +141,7 @@ int __pmac get_backlight_enable(void)
141} 141}
142EXPORT_SYMBOL(get_backlight_enable); 142EXPORT_SYMBOL(get_backlight_enable);
143 143
144static int __pmac __set_backlight_level(int level) 144static int __set_backlight_level(int level)
145{ 145{
146 int rc = 0; 146 int rc = 0;
147 147
@@ -165,7 +165,7 @@ static int __pmac __set_backlight_level(int level)
165 } 165 }
166 return rc; 166 return rc;
167} 167}
168int __pmac set_backlight_level(int level) 168int set_backlight_level(int level)
169{ 169{
170 if (!backlighter) 170 if (!backlighter)
171 return -ENODEV; 171 return -ENODEV;
@@ -176,7 +176,7 @@ int __pmac set_backlight_level(int level)
176 176
177EXPORT_SYMBOL(set_backlight_level); 177EXPORT_SYMBOL(set_backlight_level);
178 178
179int __pmac get_backlight_level(void) 179int get_backlight_level(void)
180{ 180{
181 if (!backlighter) 181 if (!backlighter)
182 return -ENODEV; 182 return -ENODEV;
diff --git a/arch/ppc/platforms/pmac_cpufreq.c b/arch/ppc/platforms/pmac_cpufreq.c
index d4bc5f67ec53..fba7e4d7c0bf 100644
--- a/arch/ppc/platforms/pmac_cpufreq.c
+++ b/arch/ppc/platforms/pmac_cpufreq.c
@@ -136,7 +136,7 @@ static inline void debug_calc_bogomips(void)
136 136
137/* Switch CPU speed under 750FX CPU control 137/* Switch CPU speed under 750FX CPU control
138 */ 138 */
139static int __pmac cpu_750fx_cpu_speed(int low_speed) 139static int cpu_750fx_cpu_speed(int low_speed)
140{ 140{
141 u32 hid2; 141 u32 hid2;
142 142
@@ -172,7 +172,7 @@ static int __pmac cpu_750fx_cpu_speed(int low_speed)
172 return 0; 172 return 0;
173} 173}
174 174
175static unsigned int __pmac cpu_750fx_get_cpu_speed(void) 175static unsigned int cpu_750fx_get_cpu_speed(void)
176{ 176{
177 if (mfspr(SPRN_HID1) & HID1_PS) 177 if (mfspr(SPRN_HID1) & HID1_PS)
178 return low_freq; 178 return low_freq;
@@ -181,7 +181,7 @@ static unsigned int __pmac cpu_750fx_get_cpu_speed(void)
181} 181}
182 182
183/* Switch CPU speed using DFS */ 183/* Switch CPU speed using DFS */
184static int __pmac dfs_set_cpu_speed(int low_speed) 184static int dfs_set_cpu_speed(int low_speed)
185{ 185{
186 if (low_speed == 0) { 186 if (low_speed == 0) {
187 /* ramping up, set voltage first */ 187 /* ramping up, set voltage first */
@@ -205,7 +205,7 @@ static int __pmac dfs_set_cpu_speed(int low_speed)
205 return 0; 205 return 0;
206} 206}
207 207
208static unsigned int __pmac dfs_get_cpu_speed(void) 208static unsigned int dfs_get_cpu_speed(void)
209{ 209{
210 if (mfspr(SPRN_HID1) & HID1_DFS) 210 if (mfspr(SPRN_HID1) & HID1_DFS)
211 return low_freq; 211 return low_freq;
@@ -216,7 +216,7 @@ static unsigned int __pmac dfs_get_cpu_speed(void)
216 216
217/* Switch CPU speed using slewing GPIOs 217/* Switch CPU speed using slewing GPIOs
218 */ 218 */
219static int __pmac gpios_set_cpu_speed(int low_speed) 219static int gpios_set_cpu_speed(int low_speed)
220{ 220{
221 int gpio, timeout = 0; 221 int gpio, timeout = 0;
222 222
@@ -258,7 +258,7 @@ static int __pmac gpios_set_cpu_speed(int low_speed)
258 258
259/* Switch CPU speed under PMU control 259/* Switch CPU speed under PMU control
260 */ 260 */
261static int __pmac pmu_set_cpu_speed(int low_speed) 261static int pmu_set_cpu_speed(int low_speed)
262{ 262{
263 struct adb_request req; 263 struct adb_request req;
264 unsigned long save_l2cr; 264 unsigned long save_l2cr;
@@ -354,7 +354,7 @@ static int __pmac pmu_set_cpu_speed(int low_speed)
354 return 0; 354 return 0;
355} 355}
356 356
357static int __pmac do_set_cpu_speed(int speed_mode, int notify) 357static int do_set_cpu_speed(int speed_mode, int notify)
358{ 358{
359 struct cpufreq_freqs freqs; 359 struct cpufreq_freqs freqs;
360 unsigned long l3cr; 360 unsigned long l3cr;
@@ -391,17 +391,17 @@ static int __pmac do_set_cpu_speed(int speed_mode, int notify)
391 return 0; 391 return 0;
392} 392}
393 393
394static unsigned int __pmac pmac_cpufreq_get_speed(unsigned int cpu) 394static unsigned int pmac_cpufreq_get_speed(unsigned int cpu)
395{ 395{
396 return cur_freq; 396 return cur_freq;
397} 397}
398 398
399static int __pmac pmac_cpufreq_verify(struct cpufreq_policy *policy) 399static int pmac_cpufreq_verify(struct cpufreq_policy *policy)
400{ 400{
401 return cpufreq_frequency_table_verify(policy, pmac_cpu_freqs); 401 return cpufreq_frequency_table_verify(policy, pmac_cpu_freqs);
402} 402}
403 403
404static int __pmac pmac_cpufreq_target( struct cpufreq_policy *policy, 404static int pmac_cpufreq_target( struct cpufreq_policy *policy,
405 unsigned int target_freq, 405 unsigned int target_freq,
406 unsigned int relation) 406 unsigned int relation)
407{ 407{
@@ -414,13 +414,13 @@ static int __pmac pmac_cpufreq_target( struct cpufreq_policy *policy,
414 return do_set_cpu_speed(newstate, 1); 414 return do_set_cpu_speed(newstate, 1);
415} 415}
416 416
417unsigned int __pmac pmac_get_one_cpufreq(int i) 417unsigned int pmac_get_one_cpufreq(int i)
418{ 418{
419 /* Supports only one CPU for now */ 419 /* Supports only one CPU for now */
420 return (i == 0) ? cur_freq : 0; 420 return (i == 0) ? cur_freq : 0;
421} 421}
422 422
423static int __pmac pmac_cpufreq_cpu_init(struct cpufreq_policy *policy) 423static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy)
424{ 424{
425 if (policy->cpu != 0) 425 if (policy->cpu != 0)
426 return -ENODEV; 426 return -ENODEV;
@@ -433,7 +433,7 @@ static int __pmac pmac_cpufreq_cpu_init(struct cpufreq_policy *policy)
433 return cpufreq_frequency_table_cpuinfo(policy, pmac_cpu_freqs); 433 return cpufreq_frequency_table_cpuinfo(policy, pmac_cpu_freqs);
434} 434}
435 435
436static u32 __pmac read_gpio(struct device_node *np) 436static u32 read_gpio(struct device_node *np)
437{ 437{
438 u32 *reg = (u32 *)get_property(np, "reg", NULL); 438 u32 *reg = (u32 *)get_property(np, "reg", NULL);
439 u32 offset; 439 u32 offset;
@@ -452,7 +452,7 @@ static u32 __pmac read_gpio(struct device_node *np)
452 return offset; 452 return offset;
453} 453}
454 454
455static int __pmac pmac_cpufreq_suspend(struct cpufreq_policy *policy, pm_message_t pmsg) 455static int pmac_cpufreq_suspend(struct cpufreq_policy *policy, pm_message_t pmsg)
456{ 456{
457 /* Ok, this could be made a bit smarter, but let's be robust for now. We 457 /* Ok, this could be made a bit smarter, but let's be robust for now. We
458 * always force a speed change to high speed before sleep, to make sure 458 * always force a speed change to high speed before sleep, to make sure
@@ -468,7 +468,7 @@ static int __pmac pmac_cpufreq_suspend(struct cpufreq_policy *policy, pm_message
468 return 0; 468 return 0;
469} 469}
470 470
471static int __pmac pmac_cpufreq_resume(struct cpufreq_policy *policy) 471static int pmac_cpufreq_resume(struct cpufreq_policy *policy)
472{ 472{
473 /* If we resume, first check if we have a get() function */ 473 /* If we resume, first check if we have a get() function */
474 if (get_speed_proc) 474 if (get_speed_proc)
@@ -501,7 +501,7 @@ static struct cpufreq_driver pmac_cpufreq_driver = {
501}; 501};
502 502
503 503
504static int __pmac pmac_cpufreq_init_MacRISC3(struct device_node *cpunode) 504static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode)
505{ 505{
506 struct device_node *volt_gpio_np = of_find_node_by_name(NULL, 506 struct device_node *volt_gpio_np = of_find_node_by_name(NULL,
507 "voltage-gpio"); 507 "voltage-gpio");
@@ -593,7 +593,7 @@ static int __pmac pmac_cpufreq_init_MacRISC3(struct device_node *cpunode)
593 return 0; 593 return 0;
594} 594}
595 595
596static int __pmac pmac_cpufreq_init_7447A(struct device_node *cpunode) 596static int pmac_cpufreq_init_7447A(struct device_node *cpunode)
597{ 597{
598 struct device_node *volt_gpio_np; 598 struct device_node *volt_gpio_np;
599 599
@@ -620,7 +620,7 @@ static int __pmac pmac_cpufreq_init_7447A(struct device_node *cpunode)
620 return 0; 620 return 0;
621} 621}
622 622
623static int __pmac pmac_cpufreq_init_750FX(struct device_node *cpunode) 623static int pmac_cpufreq_init_750FX(struct device_node *cpunode)
624{ 624{
625 struct device_node *volt_gpio_np; 625 struct device_node *volt_gpio_np;
626 u32 pvr, *value; 626 u32 pvr, *value;
diff --git a/arch/ppc/platforms/pmac_feature.c b/arch/ppc/platforms/pmac_feature.c
index dd6d45ae0501..58884a63ebdb 100644
--- a/arch/ppc/platforms/pmac_feature.c
+++ b/arch/ppc/platforms/pmac_feature.c
@@ -63,7 +63,7 @@ extern struct device_node *k2_skiplist[2];
63 * We use a single global lock to protect accesses. Each driver has 63 * We use a single global lock to protect accesses. Each driver has
64 * to take care of its own locking 64 * to take care of its own locking
65 */ 65 */
66static DEFINE_SPINLOCK(feature_lock __pmacdata); 66static DEFINE_SPINLOCK(feature_lock);
67 67
68#define LOCK(flags) spin_lock_irqsave(&feature_lock, flags); 68#define LOCK(flags) spin_lock_irqsave(&feature_lock, flags);
69#define UNLOCK(flags) spin_unlock_irqrestore(&feature_lock, flags); 69#define UNLOCK(flags) spin_unlock_irqrestore(&feature_lock, flags);
@@ -72,9 +72,9 @@ static DEFINE_SPINLOCK(feature_lock __pmacdata);
72/* 72/*
73 * Instance of some macio stuffs 73 * Instance of some macio stuffs
74 */ 74 */
75struct macio_chip macio_chips[MAX_MACIO_CHIPS] __pmacdata; 75struct macio_chip macio_chips[MAX_MACIO_CHIPS];
76 76
77struct macio_chip* __pmac macio_find(struct device_node* child, int type) 77struct macio_chip* macio_find(struct device_node* child, int type)
78{ 78{
79 while(child) { 79 while(child) {
80 int i; 80 int i;
@@ -89,7 +89,7 @@ struct macio_chip* __pmac macio_find(struct device_node* child, int type)
89} 89}
90EXPORT_SYMBOL_GPL(macio_find); 90EXPORT_SYMBOL_GPL(macio_find);
91 91
92static const char* macio_names[] __pmacdata = 92static const char* macio_names[] =
93{ 93{
94 "Unknown", 94 "Unknown",
95 "Grand Central", 95 "Grand Central",
@@ -116,10 +116,10 @@ static const char* macio_names[] __pmacdata =
116#define UN_BIS(r,v) (UN_OUT((r), UN_IN(r) | (v))) 116#define UN_BIS(r,v) (UN_OUT((r), UN_IN(r) | (v)))
117#define UN_BIC(r,v) (UN_OUT((r), UN_IN(r) & ~(v))) 117#define UN_BIC(r,v) (UN_OUT((r), UN_IN(r) & ~(v)))
118 118
119static struct device_node* uninorth_node __pmacdata; 119static struct device_node* uninorth_node;
120static u32 __iomem * uninorth_base __pmacdata; 120static u32 __iomem * uninorth_base;
121static u32 uninorth_rev __pmacdata; 121static u32 uninorth_rev;
122static int uninorth_u3 __pmacdata; 122static int uninorth_u3;
123static void __iomem *u3_ht; 123static void __iomem *u3_ht;
124 124
125/* 125/*
@@ -142,13 +142,13 @@ struct pmac_mb_def
142 struct feature_table_entry* features; 142 struct feature_table_entry* features;
143 unsigned long board_flags; 143 unsigned long board_flags;
144}; 144};
145static struct pmac_mb_def pmac_mb __pmacdata; 145static struct pmac_mb_def pmac_mb;
146 146
147/* 147/*
148 * Here are the chip specific feature functions 148 * Here are the chip specific feature functions
149 */ 149 */
150 150
151static inline int __pmac 151static inline int
152simple_feature_tweak(struct device_node* node, int type, int reg, u32 mask, int value) 152simple_feature_tweak(struct device_node* node, int type, int reg, u32 mask, int value)
153{ 153{
154 struct macio_chip* macio; 154 struct macio_chip* macio;
@@ -170,7 +170,7 @@ simple_feature_tweak(struct device_node* node, int type, int reg, u32 mask, int
170 170
171#ifndef CONFIG_POWER4 171#ifndef CONFIG_POWER4
172 172
173static long __pmac 173static long
174ohare_htw_scc_enable(struct device_node* node, long param, long value) 174ohare_htw_scc_enable(struct device_node* node, long param, long value)
175{ 175{
176 struct macio_chip* macio; 176 struct macio_chip* macio;
@@ -263,21 +263,21 @@ ohare_htw_scc_enable(struct device_node* node, long param, long value)
263 return 0; 263 return 0;
264} 264}
265 265
266static long __pmac 266static long
267ohare_floppy_enable(struct device_node* node, long param, long value) 267ohare_floppy_enable(struct device_node* node, long param, long value)
268{ 268{
269 return simple_feature_tweak(node, macio_ohare, 269 return simple_feature_tweak(node, macio_ohare,
270 OHARE_FCR, OH_FLOPPY_ENABLE, value); 270 OHARE_FCR, OH_FLOPPY_ENABLE, value);
271} 271}
272 272
273static long __pmac 273static long
274ohare_mesh_enable(struct device_node* node, long param, long value) 274ohare_mesh_enable(struct device_node* node, long param, long value)
275{ 275{
276 return simple_feature_tweak(node, macio_ohare, 276 return simple_feature_tweak(node, macio_ohare,
277 OHARE_FCR, OH_MESH_ENABLE, value); 277 OHARE_FCR, OH_MESH_ENABLE, value);
278} 278}
279 279
280static long __pmac 280static long
281ohare_ide_enable(struct device_node* node, long param, long value) 281ohare_ide_enable(struct device_node* node, long param, long value)
282{ 282{
283 switch(param) { 283 switch(param) {
@@ -298,7 +298,7 @@ ohare_ide_enable(struct device_node* node, long param, long value)
298 } 298 }
299} 299}
300 300
301static long __pmac 301static long
302ohare_ide_reset(struct device_node* node, long param, long value) 302ohare_ide_reset(struct device_node* node, long param, long value)
303{ 303{
304 switch(param) { 304 switch(param) {
@@ -313,7 +313,7 @@ ohare_ide_reset(struct device_node* node, long param, long value)
313 } 313 }
314} 314}
315 315
316static long __pmac 316static long
317ohare_sleep_state(struct device_node* node, long param, long value) 317ohare_sleep_state(struct device_node* node, long param, long value)
318{ 318{
319 struct macio_chip* macio = &macio_chips[0]; 319 struct macio_chip* macio = &macio_chips[0];
@@ -329,7 +329,7 @@ ohare_sleep_state(struct device_node* node, long param, long value)
329 return 0; 329 return 0;
330} 330}
331 331
332static long __pmac 332static long
333heathrow_modem_enable(struct device_node* node, long param, long value) 333heathrow_modem_enable(struct device_node* node, long param, long value)
334{ 334{
335 struct macio_chip* macio; 335 struct macio_chip* macio;
@@ -373,7 +373,7 @@ heathrow_modem_enable(struct device_node* node, long param, long value)
373 return 0; 373 return 0;
374} 374}
375 375
376static long __pmac 376static long
377heathrow_floppy_enable(struct device_node* node, long param, long value) 377heathrow_floppy_enable(struct device_node* node, long param, long value)
378{ 378{
379 return simple_feature_tweak(node, macio_unknown, 379 return simple_feature_tweak(node, macio_unknown,
@@ -382,7 +382,7 @@ heathrow_floppy_enable(struct device_node* node, long param, long value)
382 value); 382 value);
383} 383}
384 384
385static long __pmac 385static long
386heathrow_mesh_enable(struct device_node* node, long param, long value) 386heathrow_mesh_enable(struct device_node* node, long param, long value)
387{ 387{
388 struct macio_chip* macio; 388 struct macio_chip* macio;
@@ -411,7 +411,7 @@ heathrow_mesh_enable(struct device_node* node, long param, long value)
411 return 0; 411 return 0;
412} 412}
413 413
414static long __pmac 414static long
415heathrow_ide_enable(struct device_node* node, long param, long value) 415heathrow_ide_enable(struct device_node* node, long param, long value)
416{ 416{
417 switch(param) { 417 switch(param) {
@@ -426,7 +426,7 @@ heathrow_ide_enable(struct device_node* node, long param, long value)
426 } 426 }
427} 427}
428 428
429static long __pmac 429static long
430heathrow_ide_reset(struct device_node* node, long param, long value) 430heathrow_ide_reset(struct device_node* node, long param, long value)
431{ 431{
432 switch(param) { 432 switch(param) {
@@ -441,7 +441,7 @@ heathrow_ide_reset(struct device_node* node, long param, long value)
441 } 441 }
442} 442}
443 443
444static long __pmac 444static long
445heathrow_bmac_enable(struct device_node* node, long param, long value) 445heathrow_bmac_enable(struct device_node* node, long param, long value)
446{ 446{
447 struct macio_chip* macio; 447 struct macio_chip* macio;
@@ -470,7 +470,7 @@ heathrow_bmac_enable(struct device_node* node, long param, long value)
470 return 0; 470 return 0;
471} 471}
472 472
473static long __pmac 473static long
474heathrow_sound_enable(struct device_node* node, long param, long value) 474heathrow_sound_enable(struct device_node* node, long param, long value)
475{ 475{
476 struct macio_chip* macio; 476 struct macio_chip* macio;
@@ -501,16 +501,16 @@ heathrow_sound_enable(struct device_node* node, long param, long value)
501 return 0; 501 return 0;
502} 502}
503 503
504static u32 save_fcr[6] __pmacdata; 504static u32 save_fcr[6];
505static u32 save_mbcr __pmacdata; 505static u32 save_mbcr;
506static u32 save_gpio_levels[2] __pmacdata; 506static u32 save_gpio_levels[2];
507static u8 save_gpio_extint[KEYLARGO_GPIO_EXTINT_CNT] __pmacdata; 507static u8 save_gpio_extint[KEYLARGO_GPIO_EXTINT_CNT];
508static u8 save_gpio_normal[KEYLARGO_GPIO_CNT] __pmacdata; 508static u8 save_gpio_normal[KEYLARGO_GPIO_CNT];
509static u32 save_unin_clock_ctl __pmacdata; 509static u32 save_unin_clock_ctl;
510static struct dbdma_regs save_dbdma[13] __pmacdata; 510static struct dbdma_regs save_dbdma[13];
511static struct dbdma_regs save_alt_dbdma[13] __pmacdata; 511static struct dbdma_regs save_alt_dbdma[13];
512 512
513static void __pmac 513static void
514dbdma_save(struct macio_chip* macio, struct dbdma_regs* save) 514dbdma_save(struct macio_chip* macio, struct dbdma_regs* save)
515{ 515{
516 int i; 516 int i;
@@ -527,7 +527,7 @@ dbdma_save(struct macio_chip* macio, struct dbdma_regs* save)
527 } 527 }
528} 528}
529 529
530static void __pmac 530static void
531dbdma_restore(struct macio_chip* macio, struct dbdma_regs* save) 531dbdma_restore(struct macio_chip* macio, struct dbdma_regs* save)
532{ 532{
533 int i; 533 int i;
@@ -547,7 +547,7 @@ dbdma_restore(struct macio_chip* macio, struct dbdma_regs* save)
547 } 547 }
548} 548}
549 549
550static void __pmac 550static void
551heathrow_sleep(struct macio_chip* macio, int secondary) 551heathrow_sleep(struct macio_chip* macio, int secondary)
552{ 552{
553 if (secondary) { 553 if (secondary) {
@@ -580,7 +580,7 @@ heathrow_sleep(struct macio_chip* macio, int secondary)
580 (void)MACIO_IN32(HEATHROW_FCR); 580 (void)MACIO_IN32(HEATHROW_FCR);
581} 581}
582 582
583static void __pmac 583static void
584heathrow_wakeup(struct macio_chip* macio, int secondary) 584heathrow_wakeup(struct macio_chip* macio, int secondary)
585{ 585{
586 if (secondary) { 586 if (secondary) {
@@ -605,7 +605,7 @@ heathrow_wakeup(struct macio_chip* macio, int secondary)
605 } 605 }
606} 606}
607 607
608static long __pmac 608static long
609heathrow_sleep_state(struct device_node* node, long param, long value) 609heathrow_sleep_state(struct device_node* node, long param, long value)
610{ 610{
611 if ((pmac_mb.board_flags & PMAC_MB_CAN_SLEEP) == 0) 611 if ((pmac_mb.board_flags & PMAC_MB_CAN_SLEEP) == 0)
@@ -622,7 +622,7 @@ heathrow_sleep_state(struct device_node* node, long param, long value)
622 return 0; 622 return 0;
623} 623}
624 624
625static long __pmac 625static long
626core99_scc_enable(struct device_node* node, long param, long value) 626core99_scc_enable(struct device_node* node, long param, long value)
627{ 627{
628 struct macio_chip* macio; 628 struct macio_chip* macio;
@@ -723,7 +723,7 @@ core99_scc_enable(struct device_node* node, long param, long value)
723 return 0; 723 return 0;
724} 724}
725 725
726static long __pmac 726static long
727core99_modem_enable(struct device_node* node, long param, long value) 727core99_modem_enable(struct device_node* node, long param, long value)
728{ 728{
729 struct macio_chip* macio; 729 struct macio_chip* macio;
@@ -775,7 +775,7 @@ core99_modem_enable(struct device_node* node, long param, long value)
775 return 0; 775 return 0;
776} 776}
777 777
778static long __pmac 778static long
779pangea_modem_enable(struct device_node* node, long param, long value) 779pangea_modem_enable(struct device_node* node, long param, long value)
780{ 780{
781 struct macio_chip* macio; 781 struct macio_chip* macio;
@@ -830,7 +830,7 @@ pangea_modem_enable(struct device_node* node, long param, long value)
830 return 0; 830 return 0;
831} 831}
832 832
833static long __pmac 833static long
834core99_ata100_enable(struct device_node* node, long value) 834core99_ata100_enable(struct device_node* node, long value)
835{ 835{
836 unsigned long flags; 836 unsigned long flags;
@@ -860,7 +860,7 @@ core99_ata100_enable(struct device_node* node, long value)
860 return 0; 860 return 0;
861} 861}
862 862
863static long __pmac 863static long
864core99_ide_enable(struct device_node* node, long param, long value) 864core99_ide_enable(struct device_node* node, long param, long value)
865{ 865{
866 /* Bus ID 0 to 2 are KeyLargo based IDE, busID 3 is U2 866 /* Bus ID 0 to 2 are KeyLargo based IDE, busID 3 is U2
@@ -883,7 +883,7 @@ core99_ide_enable(struct device_node* node, long param, long value)
883 } 883 }
884} 884}
885 885
886static long __pmac 886static long
887core99_ide_reset(struct device_node* node, long param, long value) 887core99_ide_reset(struct device_node* node, long param, long value)
888{ 888{
889 switch(param) { 889 switch(param) {
@@ -901,7 +901,7 @@ core99_ide_reset(struct device_node* node, long param, long value)
901 } 901 }
902} 902}
903 903
904static long __pmac 904static long
905core99_gmac_enable(struct device_node* node, long param, long value) 905core99_gmac_enable(struct device_node* node, long param, long value)
906{ 906{
907 unsigned long flags; 907 unsigned long flags;
@@ -918,7 +918,7 @@ core99_gmac_enable(struct device_node* node, long param, long value)
918 return 0; 918 return 0;
919} 919}
920 920
921static long __pmac 921static long
922core99_gmac_phy_reset(struct device_node* node, long param, long value) 922core99_gmac_phy_reset(struct device_node* node, long param, long value)
923{ 923{
924 unsigned long flags; 924 unsigned long flags;
@@ -943,7 +943,7 @@ core99_gmac_phy_reset(struct device_node* node, long param, long value)
943 return 0; 943 return 0;
944} 944}
945 945
946static long __pmac 946static long
947core99_sound_chip_enable(struct device_node* node, long param, long value) 947core99_sound_chip_enable(struct device_node* node, long param, long value)
948{ 948{
949 struct macio_chip* macio; 949 struct macio_chip* macio;
@@ -973,7 +973,7 @@ core99_sound_chip_enable(struct device_node* node, long param, long value)
973 return 0; 973 return 0;
974} 974}
975 975
976static long __pmac 976static long
977core99_airport_enable(struct device_node* node, long param, long value) 977core99_airport_enable(struct device_node* node, long param, long value)
978{ 978{
979 struct macio_chip* macio; 979 struct macio_chip* macio;
@@ -1060,7 +1060,7 @@ core99_airport_enable(struct device_node* node, long param, long value)
1060} 1060}
1061 1061
1062#ifdef CONFIG_SMP 1062#ifdef CONFIG_SMP
1063static long __pmac 1063static long
1064core99_reset_cpu(struct device_node* node, long param, long value) 1064core99_reset_cpu(struct device_node* node, long param, long value)
1065{ 1065{
1066 unsigned int reset_io = 0; 1066 unsigned int reset_io = 0;
@@ -1104,7 +1104,7 @@ core99_reset_cpu(struct device_node* node, long param, long value)
1104} 1104}
1105#endif /* CONFIG_SMP */ 1105#endif /* CONFIG_SMP */
1106 1106
1107static long __pmac 1107static long
1108core99_usb_enable(struct device_node* node, long param, long value) 1108core99_usb_enable(struct device_node* node, long param, long value)
1109{ 1109{
1110 struct macio_chip* macio; 1110 struct macio_chip* macio;
@@ -1257,7 +1257,7 @@ core99_usb_enable(struct device_node* node, long param, long value)
1257 return 0; 1257 return 0;
1258} 1258}
1259 1259
1260static long __pmac 1260static long
1261core99_firewire_enable(struct device_node* node, long param, long value) 1261core99_firewire_enable(struct device_node* node, long param, long value)
1262{ 1262{
1263 unsigned long flags; 1263 unsigned long flags;
@@ -1284,7 +1284,7 @@ core99_firewire_enable(struct device_node* node, long param, long value)
1284 return 0; 1284 return 0;
1285} 1285}
1286 1286
1287static long __pmac 1287static long
1288core99_firewire_cable_power(struct device_node* node, long param, long value) 1288core99_firewire_cable_power(struct device_node* node, long param, long value)
1289{ 1289{
1290 unsigned long flags; 1290 unsigned long flags;
@@ -1315,7 +1315,7 @@ core99_firewire_cable_power(struct device_node* node, long param, long value)
1315 return 0; 1315 return 0;
1316} 1316}
1317 1317
1318static long __pmac 1318static long
1319intrepid_aack_delay_enable(struct device_node* node, long param, long value) 1319intrepid_aack_delay_enable(struct device_node* node, long param, long value)
1320{ 1320{
1321 unsigned long flags; 1321 unsigned long flags;
@@ -1336,7 +1336,7 @@ intrepid_aack_delay_enable(struct device_node* node, long param, long value)
1336 1336
1337#endif /* CONFIG_POWER4 */ 1337#endif /* CONFIG_POWER4 */
1338 1338
1339static long __pmac 1339static long
1340core99_read_gpio(struct device_node* node, long param, long value) 1340core99_read_gpio(struct device_node* node, long param, long value)
1341{ 1341{
1342 struct macio_chip* macio = &macio_chips[0]; 1342 struct macio_chip* macio = &macio_chips[0];
@@ -1345,7 +1345,7 @@ core99_read_gpio(struct device_node* node, long param, long value)
1345} 1345}
1346 1346
1347 1347
1348static long __pmac 1348static long
1349core99_write_gpio(struct device_node* node, long param, long value) 1349core99_write_gpio(struct device_node* node, long param, long value)
1350{ 1350{
1351 struct macio_chip* macio = &macio_chips[0]; 1351 struct macio_chip* macio = &macio_chips[0];
@@ -1356,7 +1356,7 @@ core99_write_gpio(struct device_node* node, long param, long value)
1356 1356
1357#ifdef CONFIG_POWER4 1357#ifdef CONFIG_POWER4
1358 1358
1359static long __pmac 1359static long
1360g5_gmac_enable(struct device_node* node, long param, long value) 1360g5_gmac_enable(struct device_node* node, long param, long value)
1361{ 1361{
1362 struct macio_chip* macio = &macio_chips[0]; 1362 struct macio_chip* macio = &macio_chips[0];
@@ -1380,7 +1380,7 @@ g5_gmac_enable(struct device_node* node, long param, long value)
1380 return 0; 1380 return 0;
1381} 1381}
1382 1382
1383static long __pmac 1383static long
1384g5_fw_enable(struct device_node* node, long param, long value) 1384g5_fw_enable(struct device_node* node, long param, long value)
1385{ 1385{
1386 struct macio_chip* macio = &macio_chips[0]; 1386 struct macio_chip* macio = &macio_chips[0];
@@ -1403,7 +1403,7 @@ g5_fw_enable(struct device_node* node, long param, long value)
1403 return 0; 1403 return 0;
1404} 1404}
1405 1405
1406static long __pmac 1406static long
1407g5_mpic_enable(struct device_node* node, long param, long value) 1407g5_mpic_enable(struct device_node* node, long param, long value)
1408{ 1408{
1409 unsigned long flags; 1409 unsigned long flags;
@@ -1419,7 +1419,7 @@ g5_mpic_enable(struct device_node* node, long param, long value)
1419} 1419}
1420 1420
1421#ifdef CONFIG_SMP 1421#ifdef CONFIG_SMP
1422static long __pmac 1422static long
1423g5_reset_cpu(struct device_node* node, long param, long value) 1423g5_reset_cpu(struct device_node* node, long param, long value)
1424{ 1424{
1425 unsigned int reset_io = 0; 1425 unsigned int reset_io = 0;
@@ -1465,7 +1465,7 @@ g5_reset_cpu(struct device_node* node, long param, long value)
1465 * This takes the second CPU off the bus on dual CPU machines 1465 * This takes the second CPU off the bus on dual CPU machines
1466 * running UP 1466 * running UP
1467 */ 1467 */
1468void __pmac g5_phy_disable_cpu1(void) 1468void g5_phy_disable_cpu1(void)
1469{ 1469{
1470 UN_OUT(U3_API_PHY_CONFIG_1, 0); 1470 UN_OUT(U3_API_PHY_CONFIG_1, 0);
1471} 1471}
@@ -1474,7 +1474,7 @@ void __pmac g5_phy_disable_cpu1(void)
1474 1474
1475#ifndef CONFIG_POWER4 1475#ifndef CONFIG_POWER4
1476 1476
1477static void __pmac 1477static void
1478keylargo_shutdown(struct macio_chip* macio, int sleep_mode) 1478keylargo_shutdown(struct macio_chip* macio, int sleep_mode)
1479{ 1479{
1480 u32 temp; 1480 u32 temp;
@@ -1528,7 +1528,7 @@ keylargo_shutdown(struct macio_chip* macio, int sleep_mode)
1528 (void)MACIO_IN32(KEYLARGO_FCR0); mdelay(1); 1528 (void)MACIO_IN32(KEYLARGO_FCR0); mdelay(1);
1529} 1529}
1530 1530
1531static void __pmac 1531static void
1532pangea_shutdown(struct macio_chip* macio, int sleep_mode) 1532pangea_shutdown(struct macio_chip* macio, int sleep_mode)
1533{ 1533{
1534 u32 temp; 1534 u32 temp;
@@ -1562,7 +1562,7 @@ pangea_shutdown(struct macio_chip* macio, int sleep_mode)
1562 (void)MACIO_IN32(KEYLARGO_FCR0); mdelay(1); 1562 (void)MACIO_IN32(KEYLARGO_FCR0); mdelay(1);
1563} 1563}
1564 1564
1565static void __pmac 1565static void
1566intrepid_shutdown(struct macio_chip* macio, int sleep_mode) 1566intrepid_shutdown(struct macio_chip* macio, int sleep_mode)
1567{ 1567{
1568 u32 temp; 1568 u32 temp;
@@ -1591,7 +1591,7 @@ intrepid_shutdown(struct macio_chip* macio, int sleep_mode)
1591} 1591}
1592 1592
1593 1593
1594void __pmac pmac_tweak_clock_spreading(int enable) 1594void pmac_tweak_clock_spreading(int enable)
1595{ 1595{
1596 struct macio_chip* macio = &macio_chips[0]; 1596 struct macio_chip* macio = &macio_chips[0];
1597 1597
@@ -1698,7 +1698,7 @@ void __pmac pmac_tweak_clock_spreading(int enable)
1698} 1698}
1699 1699
1700 1700
1701static int __pmac 1701static int
1702core99_sleep(void) 1702core99_sleep(void)
1703{ 1703{
1704 struct macio_chip* macio; 1704 struct macio_chip* macio;
@@ -1791,7 +1791,7 @@ core99_sleep(void)
1791 return 0; 1791 return 0;
1792} 1792}
1793 1793
1794static int __pmac 1794static int
1795core99_wake_up(void) 1795core99_wake_up(void)
1796{ 1796{
1797 struct macio_chip* macio; 1797 struct macio_chip* macio;
@@ -1854,7 +1854,7 @@ core99_wake_up(void)
1854 return 0; 1854 return 0;
1855} 1855}
1856 1856
1857static long __pmac 1857static long
1858core99_sleep_state(struct device_node* node, long param, long value) 1858core99_sleep_state(struct device_node* node, long param, long value)
1859{ 1859{
1860 /* Param == 1 means to enter the "fake sleep" mode that is 1860 /* Param == 1 means to enter the "fake sleep" mode that is
@@ -1884,7 +1884,7 @@ core99_sleep_state(struct device_node* node, long param, long value)
1884 1884
1885#endif /* CONFIG_POWER4 */ 1885#endif /* CONFIG_POWER4 */
1886 1886
1887static long __pmac 1887static long
1888generic_dev_can_wake(struct device_node* node, long param, long value) 1888generic_dev_can_wake(struct device_node* node, long param, long value)
1889{ 1889{
1890 /* Todo: eventually check we are really dealing with on-board 1890 /* Todo: eventually check we are really dealing with on-board
@@ -1896,7 +1896,7 @@ generic_dev_can_wake(struct device_node* node, long param, long value)
1896 return 0; 1896 return 0;
1897} 1897}
1898 1898
1899static long __pmac 1899static long
1900generic_get_mb_info(struct device_node* node, long param, long value) 1900generic_get_mb_info(struct device_node* node, long param, long value)
1901{ 1901{
1902 switch(param) { 1902 switch(param) {
@@ -1919,7 +1919,7 @@ generic_get_mb_info(struct device_node* node, long param, long value)
1919 1919
1920/* Used on any machine 1920/* Used on any machine
1921 */ 1921 */
1922static struct feature_table_entry any_features[] __pmacdata = { 1922static struct feature_table_entry any_features[] = {
1923 { PMAC_FTR_GET_MB_INFO, generic_get_mb_info }, 1923 { PMAC_FTR_GET_MB_INFO, generic_get_mb_info },
1924 { PMAC_FTR_DEVICE_CAN_WAKE, generic_dev_can_wake }, 1924 { PMAC_FTR_DEVICE_CAN_WAKE, generic_dev_can_wake },
1925 { 0, NULL } 1925 { 0, NULL }
@@ -1931,7 +1931,7 @@ static struct feature_table_entry any_features[] __pmacdata = {
1931 * 2400,3400 and 3500 series powerbooks. Some older desktops seem 1931 * 2400,3400 and 3500 series powerbooks. Some older desktops seem
1932 * to have issues with turning on/off those asic cells 1932 * to have issues with turning on/off those asic cells
1933 */ 1933 */
1934static struct feature_table_entry ohare_features[] __pmacdata = { 1934static struct feature_table_entry ohare_features[] = {
1935 { PMAC_FTR_SCC_ENABLE, ohare_htw_scc_enable }, 1935 { PMAC_FTR_SCC_ENABLE, ohare_htw_scc_enable },
1936 { PMAC_FTR_SWIM3_ENABLE, ohare_floppy_enable }, 1936 { PMAC_FTR_SWIM3_ENABLE, ohare_floppy_enable },
1937 { PMAC_FTR_MESH_ENABLE, ohare_mesh_enable }, 1937 { PMAC_FTR_MESH_ENABLE, ohare_mesh_enable },
@@ -1945,7 +1945,7 @@ static struct feature_table_entry ohare_features[] __pmacdata = {
1945 * Separated as some features couldn't be properly tested 1945 * Separated as some features couldn't be properly tested
1946 * and the serial port control bits appear to confuse it. 1946 * and the serial port control bits appear to confuse it.
1947 */ 1947 */
1948static struct feature_table_entry heathrow_desktop_features[] __pmacdata = { 1948static struct feature_table_entry heathrow_desktop_features[] = {
1949 { PMAC_FTR_SWIM3_ENABLE, heathrow_floppy_enable }, 1949 { PMAC_FTR_SWIM3_ENABLE, heathrow_floppy_enable },
1950 { PMAC_FTR_MESH_ENABLE, heathrow_mesh_enable }, 1950 { PMAC_FTR_MESH_ENABLE, heathrow_mesh_enable },
1951 { PMAC_FTR_IDE_ENABLE, heathrow_ide_enable }, 1951 { PMAC_FTR_IDE_ENABLE, heathrow_ide_enable },
@@ -1957,7 +1957,7 @@ static struct feature_table_entry heathrow_desktop_features[] __pmacdata = {
1957/* Heathrow based laptop, that is the Wallstreet and mainstreet 1957/* Heathrow based laptop, that is the Wallstreet and mainstreet
1958 * powerbooks. 1958 * powerbooks.
1959 */ 1959 */
1960static struct feature_table_entry heathrow_laptop_features[] __pmacdata = { 1960static struct feature_table_entry heathrow_laptop_features[] = {
1961 { PMAC_FTR_SCC_ENABLE, ohare_htw_scc_enable }, 1961 { PMAC_FTR_SCC_ENABLE, ohare_htw_scc_enable },
1962 { PMAC_FTR_MODEM_ENABLE, heathrow_modem_enable }, 1962 { PMAC_FTR_MODEM_ENABLE, heathrow_modem_enable },
1963 { PMAC_FTR_SWIM3_ENABLE, heathrow_floppy_enable }, 1963 { PMAC_FTR_SWIM3_ENABLE, heathrow_floppy_enable },
@@ -1973,7 +1973,7 @@ static struct feature_table_entry heathrow_laptop_features[] __pmacdata = {
1973/* Paddington based machines 1973/* Paddington based machines
1974 * The lombard (101) powerbook, first iMac models, B&W G3 and Yikes G4. 1974 * The lombard (101) powerbook, first iMac models, B&W G3 and Yikes G4.
1975 */ 1975 */
1976static struct feature_table_entry paddington_features[] __pmacdata = { 1976static struct feature_table_entry paddington_features[] = {
1977 { PMAC_FTR_SCC_ENABLE, ohare_htw_scc_enable }, 1977 { PMAC_FTR_SCC_ENABLE, ohare_htw_scc_enable },
1978 { PMAC_FTR_MODEM_ENABLE, heathrow_modem_enable }, 1978 { PMAC_FTR_MODEM_ENABLE, heathrow_modem_enable },
1979 { PMAC_FTR_SWIM3_ENABLE, heathrow_floppy_enable }, 1979 { PMAC_FTR_SWIM3_ENABLE, heathrow_floppy_enable },
@@ -1991,7 +1991,7 @@ static struct feature_table_entry paddington_features[] __pmacdata = {
1991 * chipset. The pangea chipset is the "combo" UniNorth/KeyLargo 1991 * chipset. The pangea chipset is the "combo" UniNorth/KeyLargo
1992 * used on iBook2 & iMac "flow power". 1992 * used on iBook2 & iMac "flow power".
1993 */ 1993 */
1994static struct feature_table_entry core99_features[] __pmacdata = { 1994static struct feature_table_entry core99_features[] = {
1995 { PMAC_FTR_SCC_ENABLE, core99_scc_enable }, 1995 { PMAC_FTR_SCC_ENABLE, core99_scc_enable },
1996 { PMAC_FTR_MODEM_ENABLE, core99_modem_enable }, 1996 { PMAC_FTR_MODEM_ENABLE, core99_modem_enable },
1997 { PMAC_FTR_IDE_ENABLE, core99_ide_enable }, 1997 { PMAC_FTR_IDE_ENABLE, core99_ide_enable },
@@ -2014,7 +2014,7 @@ static struct feature_table_entry core99_features[] __pmacdata = {
2014 2014
2015/* RackMac 2015/* RackMac
2016 */ 2016 */
2017static struct feature_table_entry rackmac_features[] __pmacdata = { 2017static struct feature_table_entry rackmac_features[] = {
2018 { PMAC_FTR_SCC_ENABLE, core99_scc_enable }, 2018 { PMAC_FTR_SCC_ENABLE, core99_scc_enable },
2019 { PMAC_FTR_IDE_ENABLE, core99_ide_enable }, 2019 { PMAC_FTR_IDE_ENABLE, core99_ide_enable },
2020 { PMAC_FTR_IDE_RESET, core99_ide_reset }, 2020 { PMAC_FTR_IDE_RESET, core99_ide_reset },
@@ -2034,7 +2034,7 @@ static struct feature_table_entry rackmac_features[] __pmacdata = {
2034 2034
2035/* Pangea features 2035/* Pangea features
2036 */ 2036 */
2037static struct feature_table_entry pangea_features[] __pmacdata = { 2037static struct feature_table_entry pangea_features[] = {
2038 { PMAC_FTR_SCC_ENABLE, core99_scc_enable }, 2038 { PMAC_FTR_SCC_ENABLE, core99_scc_enable },
2039 { PMAC_FTR_MODEM_ENABLE, pangea_modem_enable }, 2039 { PMAC_FTR_MODEM_ENABLE, pangea_modem_enable },
2040 { PMAC_FTR_IDE_ENABLE, core99_ide_enable }, 2040 { PMAC_FTR_IDE_ENABLE, core99_ide_enable },
@@ -2054,7 +2054,7 @@ static struct feature_table_entry pangea_features[] __pmacdata = {
2054 2054
2055/* Intrepid features 2055/* Intrepid features
2056 */ 2056 */
2057static struct feature_table_entry intrepid_features[] __pmacdata = { 2057static struct feature_table_entry intrepid_features[] = {
2058 { PMAC_FTR_SCC_ENABLE, core99_scc_enable }, 2058 { PMAC_FTR_SCC_ENABLE, core99_scc_enable },
2059 { PMAC_FTR_MODEM_ENABLE, pangea_modem_enable }, 2059 { PMAC_FTR_MODEM_ENABLE, pangea_modem_enable },
2060 { PMAC_FTR_IDE_ENABLE, core99_ide_enable }, 2060 { PMAC_FTR_IDE_ENABLE, core99_ide_enable },
@@ -2077,7 +2077,7 @@ static struct feature_table_entry intrepid_features[] __pmacdata = {
2077 2077
2078/* G5 features 2078/* G5 features
2079 */ 2079 */
2080static struct feature_table_entry g5_features[] __pmacdata = { 2080static struct feature_table_entry g5_features[] = {
2081 { PMAC_FTR_GMAC_ENABLE, g5_gmac_enable }, 2081 { PMAC_FTR_GMAC_ENABLE, g5_gmac_enable },
2082 { PMAC_FTR_1394_ENABLE, g5_fw_enable }, 2082 { PMAC_FTR_1394_ENABLE, g5_fw_enable },
2083 { PMAC_FTR_ENABLE_MPIC, g5_mpic_enable }, 2083 { PMAC_FTR_ENABLE_MPIC, g5_mpic_enable },
@@ -2091,7 +2091,7 @@ static struct feature_table_entry g5_features[] __pmacdata = {
2091 2091
2092#endif /* CONFIG_POWER4 */ 2092#endif /* CONFIG_POWER4 */
2093 2093
2094static struct pmac_mb_def pmac_mb_defs[] __pmacdata = { 2094static struct pmac_mb_def pmac_mb_defs[] = {
2095#ifndef CONFIG_POWER4 2095#ifndef CONFIG_POWER4
2096 /* 2096 /*
2097 * Desktops 2097 * Desktops
@@ -2356,7 +2356,7 @@ static struct pmac_mb_def pmac_mb_defs[] __pmacdata = {
2356/* 2356/*
2357 * The toplevel feature_call callback 2357 * The toplevel feature_call callback
2358 */ 2358 */
2359long __pmac 2359long
2360pmac_do_feature_call(unsigned int selector, ...) 2360pmac_do_feature_call(unsigned int selector, ...)
2361{ 2361{
2362 struct device_node* node; 2362 struct device_node* node;
@@ -2939,8 +2939,8 @@ void __init pmac_check_ht_link(void)
2939 * Early video resume hook 2939 * Early video resume hook
2940 */ 2940 */
2941 2941
2942static void (*pmac_early_vresume_proc)(void *data) __pmacdata; 2942static void (*pmac_early_vresume_proc)(void *data);
2943static void *pmac_early_vresume_data __pmacdata; 2943static void *pmac_early_vresume_data;
2944 2944
2945void pmac_set_early_video_resume(void (*proc)(void *data), void *data) 2945void pmac_set_early_video_resume(void (*proc)(void *data), void *data)
2946{ 2946{
@@ -2953,7 +2953,7 @@ void pmac_set_early_video_resume(void (*proc)(void *data), void *data)
2953} 2953}
2954EXPORT_SYMBOL(pmac_set_early_video_resume); 2954EXPORT_SYMBOL(pmac_set_early_video_resume);
2955 2955
2956void __pmac pmac_call_early_video_resume(void) 2956void pmac_call_early_video_resume(void)
2957{ 2957{
2958 if (pmac_early_vresume_proc) 2958 if (pmac_early_vresume_proc)
2959 pmac_early_vresume_proc(pmac_early_vresume_data); 2959 pmac_early_vresume_proc(pmac_early_vresume_data);
@@ -2963,11 +2963,11 @@ void __pmac pmac_call_early_video_resume(void)
2963 * AGP related suspend/resume code 2963 * AGP related suspend/resume code
2964 */ 2964 */
2965 2965
2966static struct pci_dev *pmac_agp_bridge __pmacdata; 2966static struct pci_dev *pmac_agp_bridge;
2967static int (*pmac_agp_suspend)(struct pci_dev *bridge) __pmacdata; 2967static int (*pmac_agp_suspend)(struct pci_dev *bridge);
2968static int (*pmac_agp_resume)(struct pci_dev *bridge) __pmacdata; 2968static int (*pmac_agp_resume)(struct pci_dev *bridge);
2969 2969
2970void __pmac pmac_register_agp_pm(struct pci_dev *bridge, 2970void pmac_register_agp_pm(struct pci_dev *bridge,
2971 int (*suspend)(struct pci_dev *bridge), 2971 int (*suspend)(struct pci_dev *bridge),
2972 int (*resume)(struct pci_dev *bridge)) 2972 int (*resume)(struct pci_dev *bridge))
2973{ 2973{
@@ -2984,7 +2984,7 @@ void __pmac pmac_register_agp_pm(struct pci_dev *bridge,
2984} 2984}
2985EXPORT_SYMBOL(pmac_register_agp_pm); 2985EXPORT_SYMBOL(pmac_register_agp_pm);
2986 2986
2987void __pmac pmac_suspend_agp_for_card(struct pci_dev *dev) 2987void pmac_suspend_agp_for_card(struct pci_dev *dev)
2988{ 2988{
2989 if (pmac_agp_bridge == NULL || pmac_agp_suspend == NULL) 2989 if (pmac_agp_bridge == NULL || pmac_agp_suspend == NULL)
2990 return; 2990 return;
@@ -2994,7 +2994,7 @@ void __pmac pmac_suspend_agp_for_card(struct pci_dev *dev)
2994} 2994}
2995EXPORT_SYMBOL(pmac_suspend_agp_for_card); 2995EXPORT_SYMBOL(pmac_suspend_agp_for_card);
2996 2996
2997void __pmac pmac_resume_agp_for_card(struct pci_dev *dev) 2997void pmac_resume_agp_for_card(struct pci_dev *dev)
2998{ 2998{
2999 if (pmac_agp_bridge == NULL || pmac_agp_resume == NULL) 2999 if (pmac_agp_bridge == NULL || pmac_agp_resume == NULL)
3000 return; 3000 return;
diff --git a/arch/ppc/platforms/pmac_nvram.c b/arch/ppc/platforms/pmac_nvram.c
index c9de64205996..8c9b008c7226 100644
--- a/arch/ppc/platforms/pmac_nvram.c
+++ b/arch/ppc/platforms/pmac_nvram.c
@@ -88,17 +88,17 @@ extern int system_running;
88static int (*core99_write_bank)(int bank, u8* datas); 88static int (*core99_write_bank)(int bank, u8* datas);
89static int (*core99_erase_bank)(int bank); 89static int (*core99_erase_bank)(int bank);
90 90
91static char *nvram_image __pmacdata; 91static char *nvram_image;
92 92
93 93
94static unsigned char __pmac core99_nvram_read_byte(int addr) 94static unsigned char core99_nvram_read_byte(int addr)
95{ 95{
96 if (nvram_image == NULL) 96 if (nvram_image == NULL)
97 return 0xff; 97 return 0xff;
98 return nvram_image[addr]; 98 return nvram_image[addr];
99} 99}
100 100
101static void __pmac core99_nvram_write_byte(int addr, unsigned char val) 101static void core99_nvram_write_byte(int addr, unsigned char val)
102{ 102{
103 if (nvram_image == NULL) 103 if (nvram_image == NULL)
104 return; 104 return;
@@ -106,18 +106,18 @@ static void __pmac core99_nvram_write_byte(int addr, unsigned char val)
106} 106}
107 107
108 108
109static unsigned char __openfirmware direct_nvram_read_byte(int addr) 109static unsigned char direct_nvram_read_byte(int addr)
110{ 110{
111 return in_8(&nvram_data[(addr & (NVRAM_SIZE - 1)) * nvram_mult]); 111 return in_8(&nvram_data[(addr & (NVRAM_SIZE - 1)) * nvram_mult]);
112} 112}
113 113
114static void __openfirmware direct_nvram_write_byte(int addr, unsigned char val) 114static void direct_nvram_write_byte(int addr, unsigned char val)
115{ 115{
116 out_8(&nvram_data[(addr & (NVRAM_SIZE - 1)) * nvram_mult], val); 116 out_8(&nvram_data[(addr & (NVRAM_SIZE - 1)) * nvram_mult], val);
117} 117}
118 118
119 119
120static unsigned char __pmac indirect_nvram_read_byte(int addr) 120static unsigned char indirect_nvram_read_byte(int addr)
121{ 121{
122 unsigned char val; 122 unsigned char val;
123 unsigned long flags; 123 unsigned long flags;
@@ -130,7 +130,7 @@ static unsigned char __pmac indirect_nvram_read_byte(int addr)
130 return val; 130 return val;
131} 131}
132 132
133static void __pmac indirect_nvram_write_byte(int addr, unsigned char val) 133static void indirect_nvram_write_byte(int addr, unsigned char val)
134{ 134{
135 unsigned long flags; 135 unsigned long flags;
136 136
@@ -143,13 +143,13 @@ static void __pmac indirect_nvram_write_byte(int addr, unsigned char val)
143 143
144#ifdef CONFIG_ADB_PMU 144#ifdef CONFIG_ADB_PMU
145 145
146static void __pmac pmu_nvram_complete(struct adb_request *req) 146static void pmu_nvram_complete(struct adb_request *req)
147{ 147{
148 if (req->arg) 148 if (req->arg)
149 complete((struct completion *)req->arg); 149 complete((struct completion *)req->arg);
150} 150}
151 151
152static unsigned char __pmac pmu_nvram_read_byte(int addr) 152static unsigned char pmu_nvram_read_byte(int addr)
153{ 153{
154 struct adb_request req; 154 struct adb_request req;
155 DECLARE_COMPLETION(req_complete); 155 DECLARE_COMPLETION(req_complete);
@@ -165,7 +165,7 @@ static unsigned char __pmac pmu_nvram_read_byte(int addr)
165 return req.reply[0]; 165 return req.reply[0];
166} 166}
167 167
168static void __pmac pmu_nvram_write_byte(int addr, unsigned char val) 168static void pmu_nvram_write_byte(int addr, unsigned char val)
169{ 169{
170 struct adb_request req; 170 struct adb_request req;
171 DECLARE_COMPLETION(req_complete); 171 DECLARE_COMPLETION(req_complete);
@@ -183,7 +183,7 @@ static void __pmac pmu_nvram_write_byte(int addr, unsigned char val)
183#endif /* CONFIG_ADB_PMU */ 183#endif /* CONFIG_ADB_PMU */
184 184
185 185
186static u8 __pmac chrp_checksum(struct chrp_header* hdr) 186static u8 chrp_checksum(struct chrp_header* hdr)
187{ 187{
188 u8 *ptr; 188 u8 *ptr;
189 u16 sum = hdr->signature; 189 u16 sum = hdr->signature;
@@ -194,7 +194,7 @@ static u8 __pmac chrp_checksum(struct chrp_header* hdr)
194 return sum; 194 return sum;
195} 195}
196 196
197static u32 __pmac core99_calc_adler(u8 *buffer) 197static u32 core99_calc_adler(u8 *buffer)
198{ 198{
199 int cnt; 199 int cnt;
200 u32 low, high; 200 u32 low, high;
@@ -216,7 +216,7 @@ static u32 __pmac core99_calc_adler(u8 *buffer)
216 return (high << 16) | low; 216 return (high << 16) | low;
217} 217}
218 218
219static u32 __pmac core99_check(u8* datas) 219static u32 core99_check(u8* datas)
220{ 220{
221 struct core99_header* hdr99 = (struct core99_header*)datas; 221 struct core99_header* hdr99 = (struct core99_header*)datas;
222 222
@@ -235,7 +235,7 @@ static u32 __pmac core99_check(u8* datas)
235 return hdr99->generation; 235 return hdr99->generation;
236} 236}
237 237
238static int __pmac sm_erase_bank(int bank) 238static int sm_erase_bank(int bank)
239{ 239{
240 int stat, i; 240 int stat, i;
241 unsigned long timeout; 241 unsigned long timeout;
@@ -267,7 +267,7 @@ static int __pmac sm_erase_bank(int bank)
267 return 0; 267 return 0;
268} 268}
269 269
270static int __pmac sm_write_bank(int bank, u8* datas) 270static int sm_write_bank(int bank, u8* datas)
271{ 271{
272 int i, stat = 0; 272 int i, stat = 0;
273 unsigned long timeout; 273 unsigned long timeout;
@@ -302,7 +302,7 @@ static int __pmac sm_write_bank(int bank, u8* datas)
302 return 0; 302 return 0;
303} 303}
304 304
305static int __pmac amd_erase_bank(int bank) 305static int amd_erase_bank(int bank)
306{ 306{
307 int i, stat = 0; 307 int i, stat = 0;
308 unsigned long timeout; 308 unsigned long timeout;
@@ -349,7 +349,7 @@ static int __pmac amd_erase_bank(int bank)
349 return 0; 349 return 0;
350} 350}
351 351
352static int __pmac amd_write_bank(int bank, u8* datas) 352static int amd_write_bank(int bank, u8* datas)
353{ 353{
354 int i, stat = 0; 354 int i, stat = 0;
355 unsigned long timeout; 355 unsigned long timeout;
@@ -430,7 +430,7 @@ static void __init lookup_partitions(void)
430 DBG("nvram: NR partition at 0x%x\n", nvram_partitions[pmac_nvram_NR]); 430 DBG("nvram: NR partition at 0x%x\n", nvram_partitions[pmac_nvram_NR]);
431} 431}
432 432
433static void __pmac core99_nvram_sync(void) 433static void core99_nvram_sync(void)
434{ 434{
435 struct core99_header* hdr99; 435 struct core99_header* hdr99;
436 unsigned long flags; 436 unsigned long flags;
@@ -554,12 +554,12 @@ void __init pmac_nvram_init(void)
554 lookup_partitions(); 554 lookup_partitions();
555} 555}
556 556
557int __pmac pmac_get_partition(int partition) 557int pmac_get_partition(int partition)
558{ 558{
559 return nvram_partitions[partition]; 559 return nvram_partitions[partition];
560} 560}
561 561
562u8 __pmac pmac_xpram_read(int xpaddr) 562u8 pmac_xpram_read(int xpaddr)
563{ 563{
564 int offset = nvram_partitions[pmac_nvram_XPRAM]; 564 int offset = nvram_partitions[pmac_nvram_XPRAM];
565 565
@@ -569,7 +569,7 @@ u8 __pmac pmac_xpram_read(int xpaddr)
569 return ppc_md.nvram_read_val(xpaddr + offset); 569 return ppc_md.nvram_read_val(xpaddr + offset);
570} 570}
571 571
572void __pmac pmac_xpram_write(int xpaddr, u8 data) 572void pmac_xpram_write(int xpaddr, u8 data)
573{ 573{
574 int offset = nvram_partitions[pmac_nvram_XPRAM]; 574 int offset = nvram_partitions[pmac_nvram_XPRAM];
575 575
diff --git a/arch/ppc/platforms/pmac_pci.c b/arch/ppc/platforms/pmac_pci.c
index 719fb49fe2bc..786295b6ddd0 100644
--- a/arch/ppc/platforms/pmac_pci.c
+++ b/arch/ppc/platforms/pmac_pci.c
@@ -141,7 +141,7 @@ fixup_bus_range(struct device_node *bridge)
141 |(((unsigned long)(off)) & 0xFCUL) \ 141 |(((unsigned long)(off)) & 0xFCUL) \
142 |1UL) 142 |1UL)
143 143
144static void volatile __iomem * __pmac 144static void volatile __iomem *
145macrisc_cfg_access(struct pci_controller* hose, u8 bus, u8 dev_fn, u8 offset) 145macrisc_cfg_access(struct pci_controller* hose, u8 bus, u8 dev_fn, u8 offset)
146{ 146{
147 unsigned int caddr; 147 unsigned int caddr;
@@ -162,7 +162,7 @@ macrisc_cfg_access(struct pci_controller* hose, u8 bus, u8 dev_fn, u8 offset)
162 return hose->cfg_data + offset; 162 return hose->cfg_data + offset;
163} 163}
164 164
165static int __pmac 165static int
166macrisc_read_config(struct pci_bus *bus, unsigned int devfn, int offset, 166macrisc_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
167 int len, u32 *val) 167 int len, u32 *val)
168{ 168{
@@ -190,7 +190,7 @@ macrisc_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
190 return PCIBIOS_SUCCESSFUL; 190 return PCIBIOS_SUCCESSFUL;
191} 191}
192 192
193static int __pmac 193static int
194macrisc_write_config(struct pci_bus *bus, unsigned int devfn, int offset, 194macrisc_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
195 int len, u32 val) 195 int len, u32 val)
196{ 196{
@@ -230,7 +230,7 @@ static struct pci_ops macrisc_pci_ops =
230/* 230/*
231 * Verifiy that a specific (bus, dev_fn) exists on chaos 231 * Verifiy that a specific (bus, dev_fn) exists on chaos
232 */ 232 */
233static int __pmac 233static int
234chaos_validate_dev(struct pci_bus *bus, int devfn, int offset) 234chaos_validate_dev(struct pci_bus *bus, int devfn, int offset)
235{ 235{
236 struct device_node *np; 236 struct device_node *np;
@@ -252,7 +252,7 @@ chaos_validate_dev(struct pci_bus *bus, int devfn, int offset)
252 return PCIBIOS_SUCCESSFUL; 252 return PCIBIOS_SUCCESSFUL;
253} 253}
254 254
255static int __pmac 255static int
256chaos_read_config(struct pci_bus *bus, unsigned int devfn, int offset, 256chaos_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
257 int len, u32 *val) 257 int len, u32 *val)
258{ 258{
@@ -264,7 +264,7 @@ chaos_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
264 return macrisc_read_config(bus, devfn, offset, len, val); 264 return macrisc_read_config(bus, devfn, offset, len, val);
265} 265}
266 266
267static int __pmac 267static int
268chaos_write_config(struct pci_bus *bus, unsigned int devfn, int offset, 268chaos_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
269 int len, u32 val) 269 int len, u32 val)
270{ 270{
@@ -294,7 +294,7 @@ static struct pci_ops chaos_pci_ops =
294 + (((unsigned long)bus) << 16) \ 294 + (((unsigned long)bus) << 16) \
295 + 0x01000000UL) 295 + 0x01000000UL)
296 296
297static void volatile __iomem * __pmac 297static void volatile __iomem *
298u3_ht_cfg_access(struct pci_controller* hose, u8 bus, u8 devfn, u8 offset) 298u3_ht_cfg_access(struct pci_controller* hose, u8 bus, u8 devfn, u8 offset)
299{ 299{
300 if (bus == hose->first_busno) { 300 if (bus == hose->first_busno) {
@@ -307,7 +307,7 @@ u3_ht_cfg_access(struct pci_controller* hose, u8 bus, u8 devfn, u8 offset)
307 return hose->cfg_data + U3_HT_CFA1(bus, devfn, offset); 307 return hose->cfg_data + U3_HT_CFA1(bus, devfn, offset);
308} 308}
309 309
310static int __pmac 310static int
311u3_ht_read_config(struct pci_bus *bus, unsigned int devfn, int offset, 311u3_ht_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
312 int len, u32 *val) 312 int len, u32 *val)
313{ 313{
@@ -357,7 +357,7 @@ u3_ht_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
357 return PCIBIOS_SUCCESSFUL; 357 return PCIBIOS_SUCCESSFUL;
358} 358}
359 359
360static int __pmac 360static int
361u3_ht_write_config(struct pci_bus *bus, unsigned int devfn, int offset, 361u3_ht_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
362 int len, u32 val) 362 int len, u32 val)
363{ 363{
@@ -575,7 +575,7 @@ pmac_find_bridges(void)
575 * some offset between bus number and domains for now when we 575 * some offset between bus number and domains for now when we
576 * assign all busses should help for now 576 * assign all busses should help for now
577 */ 577 */
578 if (pci_assign_all_busses) 578 if (pci_assign_all_buses)
579 pcibios_assign_bus_offset = 0x10; 579 pcibios_assign_bus_offset = 0x10;
580 580
581#ifdef CONFIG_POWER4 581#ifdef CONFIG_POWER4
@@ -643,7 +643,7 @@ static inline void grackle_set_loop_snoop(struct pci_controller *bp, int enable)
643static int __init 643static int __init
644setup_uninorth(struct pci_controller* hose, struct reg_property* addr) 644setup_uninorth(struct pci_controller* hose, struct reg_property* addr)
645{ 645{
646 pci_assign_all_busses = 1; 646 pci_assign_all_buses = 1;
647 has_uninorth = 1; 647 has_uninorth = 1;
648 hose->ops = &macrisc_pci_ops; 648 hose->ops = &macrisc_pci_ops;
649 hose->cfg_addr = ioremap(addr->address + 0x800000, 0x1000); 649 hose->cfg_addr = ioremap(addr->address + 0x800000, 0x1000);
@@ -677,7 +677,7 @@ setup_u3_agp(struct pci_controller* hose, struct reg_property* addr)
677{ 677{
678 /* On G5, we move AGP up to high bus number so we don't need 678 /* On G5, we move AGP up to high bus number so we don't need
679 * to reassign bus numbers for HT. If we ever have P2P bridges 679 * to reassign bus numbers for HT. If we ever have P2P bridges
680 * on AGP, we'll have to move pci_assign_all_busses to the 680 * on AGP, we'll have to move pci_assign_all_buses to the
681 * pci_controller structure so we enable it for AGP and not for 681 * pci_controller structure so we enable it for AGP and not for
682 * HT childs. 682 * HT childs.
683 * We hard code the address because of the different size of 683 * We hard code the address because of the different size of
@@ -899,7 +899,7 @@ pmac_pcibios_fixup(void)
899 pcibios_fixup_OF_interrupts(); 899 pcibios_fixup_OF_interrupts();
900} 900}
901 901
902int __pmac 902int
903pmac_pci_enable_device_hook(struct pci_dev *dev, int initial) 903pmac_pci_enable_device_hook(struct pci_dev *dev, int initial)
904{ 904{
905 struct device_node* node; 905 struct device_node* node;
@@ -1096,7 +1096,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, pmac_pci_fixup_pciata);
1096 * Disable second function on K2-SATA, it's broken 1096 * Disable second function on K2-SATA, it's broken
1097 * and disable IO BARs on first one 1097 * and disable IO BARs on first one
1098 */ 1098 */
1099void __pmac pmac_pci_fixup_k2_sata(struct pci_dev* dev) 1099void pmac_pci_fixup_k2_sata(struct pci_dev* dev)
1100{ 1100{
1101 int i; 1101 int i;
1102 u16 cmd; 1102 u16 cmd;
diff --git a/arch/ppc/platforms/pmac_pic.c b/arch/ppc/platforms/pmac_pic.c
index 2ce058895e03..9f2d95ea8564 100644
--- a/arch/ppc/platforms/pmac_pic.c
+++ b/arch/ppc/platforms/pmac_pic.c
@@ -35,6 +35,7 @@
35#include <asm/open_pic.h> 35#include <asm/open_pic.h>
36#include <asm/xmon.h> 36#include <asm/xmon.h>
37#include <asm/pmac_feature.h> 37#include <asm/pmac_feature.h>
38#include <asm/machdep.h>
38 39
39#include "pmac_pic.h" 40#include "pmac_pic.h"
40 41
@@ -53,7 +54,7 @@ struct pmac_irq_hw {
53}; 54};
54 55
55/* Default addresses */ 56/* Default addresses */
56static volatile struct pmac_irq_hw *pmac_irq_hw[4] __pmacdata = { 57static volatile struct pmac_irq_hw *pmac_irq_hw[4] = {
57 (struct pmac_irq_hw *) 0xf3000020, 58 (struct pmac_irq_hw *) 0xf3000020,
58 (struct pmac_irq_hw *) 0xf3000010, 59 (struct pmac_irq_hw *) 0xf3000010,
59 (struct pmac_irq_hw *) 0xf4000020, 60 (struct pmac_irq_hw *) 0xf4000020,
@@ -64,22 +65,22 @@ static volatile struct pmac_irq_hw *pmac_irq_hw[4] __pmacdata = {
64#define OHARE_LEVEL_MASK 0x1ff00000 65#define OHARE_LEVEL_MASK 0x1ff00000
65#define HEATHROW_LEVEL_MASK 0x1ff00000 66#define HEATHROW_LEVEL_MASK 0x1ff00000
66 67
67static int max_irqs __pmacdata; 68static int max_irqs;
68static int max_real_irqs __pmacdata; 69static int max_real_irqs;
69static u32 level_mask[4] __pmacdata; 70static u32 level_mask[4];
70 71
71static DEFINE_SPINLOCK(pmac_pic_lock __pmacdata); 72static DEFINE_SPINLOCK(pmac_pic_lock);
72 73
73 74
74#define GATWICK_IRQ_POOL_SIZE 10 75#define GATWICK_IRQ_POOL_SIZE 10
75static struct interrupt_info gatwick_int_pool[GATWICK_IRQ_POOL_SIZE] __pmacdata; 76static struct interrupt_info gatwick_int_pool[GATWICK_IRQ_POOL_SIZE];
76 77
77/* 78/*
78 * Mark an irq as "lost". This is only used on the pmac 79 * Mark an irq as "lost". This is only used on the pmac
79 * since it can lose interrupts (see pmac_set_irq_mask). 80 * since it can lose interrupts (see pmac_set_irq_mask).
80 * -- Cort 81 * -- Cort
81 */ 82 */
82void __pmac 83void
83__set_lost(unsigned long irq_nr, int nokick) 84__set_lost(unsigned long irq_nr, int nokick)
84{ 85{
85 if (!test_and_set_bit(irq_nr, ppc_lost_interrupts)) { 86 if (!test_and_set_bit(irq_nr, ppc_lost_interrupts)) {
@@ -89,7 +90,7 @@ __set_lost(unsigned long irq_nr, int nokick)
89 } 90 }
90} 91}
91 92
92static void __pmac 93static void
93pmac_mask_and_ack_irq(unsigned int irq_nr) 94pmac_mask_and_ack_irq(unsigned int irq_nr)
94{ 95{
95 unsigned long bit = 1UL << (irq_nr & 0x1f); 96 unsigned long bit = 1UL << (irq_nr & 0x1f);
@@ -114,7 +115,7 @@ pmac_mask_and_ack_irq(unsigned int irq_nr)
114 spin_unlock_irqrestore(&pmac_pic_lock, flags); 115 spin_unlock_irqrestore(&pmac_pic_lock, flags);
115} 116}
116 117
117static void __pmac pmac_set_irq_mask(unsigned int irq_nr, int nokicklost) 118static void pmac_set_irq_mask(unsigned int irq_nr, int nokicklost)
118{ 119{
119 unsigned long bit = 1UL << (irq_nr & 0x1f); 120 unsigned long bit = 1UL << (irq_nr & 0x1f);
120 int i = irq_nr >> 5; 121 int i = irq_nr >> 5;
@@ -147,7 +148,7 @@ static void __pmac pmac_set_irq_mask(unsigned int irq_nr, int nokicklost)
147/* When an irq gets requested for the first client, if it's an 148/* When an irq gets requested for the first client, if it's an
148 * edge interrupt, we clear any previous one on the controller 149 * edge interrupt, we clear any previous one on the controller
149 */ 150 */
150static unsigned int __pmac pmac_startup_irq(unsigned int irq_nr) 151static unsigned int pmac_startup_irq(unsigned int irq_nr)
151{ 152{
152 unsigned long bit = 1UL << (irq_nr & 0x1f); 153 unsigned long bit = 1UL << (irq_nr & 0x1f);
153 int i = irq_nr >> 5; 154 int i = irq_nr >> 5;
@@ -160,20 +161,20 @@ static unsigned int __pmac pmac_startup_irq(unsigned int irq_nr)
160 return 0; 161 return 0;
161} 162}
162 163
163static void __pmac pmac_mask_irq(unsigned int irq_nr) 164static void pmac_mask_irq(unsigned int irq_nr)
164{ 165{
165 clear_bit(irq_nr, ppc_cached_irq_mask); 166 clear_bit(irq_nr, ppc_cached_irq_mask);
166 pmac_set_irq_mask(irq_nr, 0); 167 pmac_set_irq_mask(irq_nr, 0);
167 mb(); 168 mb();
168} 169}
169 170
170static void __pmac pmac_unmask_irq(unsigned int irq_nr) 171static void pmac_unmask_irq(unsigned int irq_nr)
171{ 172{
172 set_bit(irq_nr, ppc_cached_irq_mask); 173 set_bit(irq_nr, ppc_cached_irq_mask);
173 pmac_set_irq_mask(irq_nr, 0); 174 pmac_set_irq_mask(irq_nr, 0);
174} 175}
175 176
176static void __pmac pmac_end_irq(unsigned int irq_nr) 177static void pmac_end_irq(unsigned int irq_nr)
177{ 178{
178 if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS)) 179 if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS))
179 && irq_desc[irq_nr].action) { 180 && irq_desc[irq_nr].action) {
diff --git a/arch/ppc/platforms/pmac_setup.c b/arch/ppc/platforms/pmac_setup.c
index d6356f480d90..55d2beffe560 100644
--- a/arch/ppc/platforms/pmac_setup.c
+++ b/arch/ppc/platforms/pmac_setup.c
@@ -122,7 +122,7 @@ extern struct smp_ops_t psurge_smp_ops;
122extern struct smp_ops_t core99_smp_ops; 122extern struct smp_ops_t core99_smp_ops;
123#endif /* CONFIG_SMP */ 123#endif /* CONFIG_SMP */
124 124
125static int __pmac 125static int
126pmac_show_cpuinfo(struct seq_file *m) 126pmac_show_cpuinfo(struct seq_file *m)
127{ 127{
128 struct device_node *np; 128 struct device_node *np;
@@ -226,7 +226,7 @@ pmac_show_cpuinfo(struct seq_file *m)
226 return 0; 226 return 0;
227} 227}
228 228
229static int __openfirmware 229static int
230pmac_show_percpuinfo(struct seq_file *m, int i) 230pmac_show_percpuinfo(struct seq_file *m, int i)
231{ 231{
232#ifdef CONFIG_CPU_FREQ_PMAC 232#ifdef CONFIG_CPU_FREQ_PMAC
@@ -330,9 +330,9 @@ pmac_setup_arch(void)
330#ifdef CONFIG_SMP 330#ifdef CONFIG_SMP
331 /* Check for Core99 */ 331 /* Check for Core99 */
332 if (find_devices("uni-n") || find_devices("u3")) 332 if (find_devices("uni-n") || find_devices("u3"))
333 ppc_md.smp_ops = &core99_smp_ops; 333 smp_ops = &core99_smp_ops;
334 else 334 else
335 ppc_md.smp_ops = &psurge_smp_ops; 335 smp_ops = &psurge_smp_ops;
336#endif /* CONFIG_SMP */ 336#endif /* CONFIG_SMP */
337 337
338 pci_create_OF_bus_map(); 338 pci_create_OF_bus_map();
@@ -447,7 +447,7 @@ static int pmac_pm_enter(suspend_state_t state)
447 enable_kernel_fp(); 447 enable_kernel_fp();
448 448
449#ifdef CONFIG_ALTIVEC 449#ifdef CONFIG_ALTIVEC
450 if (cur_cpu_spec[0]->cpu_features & CPU_FTR_ALTIVEC) 450 if (cur_cpu_spec->cpu_features & CPU_FTR_ALTIVEC)
451 enable_kernel_altivec(); 451 enable_kernel_altivec();
452#endif /* CONFIG_ALTIVEC */ 452#endif /* CONFIG_ALTIVEC */
453 453
@@ -485,7 +485,7 @@ static int pmac_late_init(void)
485late_initcall(pmac_late_init); 485late_initcall(pmac_late_init);
486 486
487/* can't be __init - can be called whenever a disk is first accessed */ 487/* can't be __init - can be called whenever a disk is first accessed */
488void __pmac 488void
489note_bootable_part(dev_t dev, int part, int goodness) 489note_bootable_part(dev_t dev, int part, int goodness)
490{ 490{
491 static int found_boot = 0; 491 static int found_boot = 0;
@@ -511,7 +511,7 @@ note_bootable_part(dev_t dev, int part, int goodness)
511 } 511 }
512} 512}
513 513
514static void __pmac 514static void
515pmac_restart(char *cmd) 515pmac_restart(char *cmd)
516{ 516{
517#ifdef CONFIG_ADB_CUDA 517#ifdef CONFIG_ADB_CUDA
@@ -536,7 +536,7 @@ pmac_restart(char *cmd)
536 } 536 }
537} 537}
538 538
539static void __pmac 539static void
540pmac_power_off(void) 540pmac_power_off(void)
541{ 541{
542#ifdef CONFIG_ADB_CUDA 542#ifdef CONFIG_ADB_CUDA
@@ -561,7 +561,7 @@ pmac_power_off(void)
561 } 561 }
562} 562}
563 563
564static void __pmac 564static void
565pmac_halt(void) 565pmac_halt(void)
566{ 566{
567 pmac_power_off(); 567 pmac_power_off();
@@ -661,7 +661,6 @@ pmac_init(unsigned long r3, unsigned long r4, unsigned long r5,
661 ppc_md.setup_arch = pmac_setup_arch; 661 ppc_md.setup_arch = pmac_setup_arch;
662 ppc_md.show_cpuinfo = pmac_show_cpuinfo; 662 ppc_md.show_cpuinfo = pmac_show_cpuinfo;
663 ppc_md.show_percpuinfo = pmac_show_percpuinfo; 663 ppc_md.show_percpuinfo = pmac_show_percpuinfo;
664 ppc_md.irq_canonicalize = NULL;
665 ppc_md.init_IRQ = pmac_pic_init; 664 ppc_md.init_IRQ = pmac_pic_init;
666 ppc_md.get_irq = pmac_get_irq; /* Changed later on ... */ 665 ppc_md.get_irq = pmac_get_irq; /* Changed later on ... */
667 666
diff --git a/arch/ppc/platforms/pmac_sleep.S b/arch/ppc/platforms/pmac_sleep.S
index 88419c77ac43..22b113d19b24 100644
--- a/arch/ppc/platforms/pmac_sleep.S
+++ b/arch/ppc/platforms/pmac_sleep.S
@@ -387,10 +387,10 @@ turn_on_mmu:
387#endif /* defined(CONFIG_PM) || defined(CONFIG_CPU_FREQ) */ 387#endif /* defined(CONFIG_PM) || defined(CONFIG_CPU_FREQ) */
388 388
389 .section .data 389 .section .data
390 .balign L1_CACHE_LINE_SIZE 390 .balign L1_CACHE_BYTES
391sleep_storage: 391sleep_storage:
392 .long 0 392 .long 0
393 .balign L1_CACHE_LINE_SIZE, 0 393 .balign L1_CACHE_BYTES, 0
394 394
395#endif /* CONFIG_6xx */ 395#endif /* CONFIG_6xx */
396 .section .text 396 .section .text
diff --git a/arch/ppc/platforms/pmac_smp.c b/arch/ppc/platforms/pmac_smp.c
index 794a23994b82..26ff26238f03 100644
--- a/arch/ppc/platforms/pmac_smp.c
+++ b/arch/ppc/platforms/pmac_smp.c
@@ -186,7 +186,7 @@ static inline void psurge_clr_ipi(int cpu)
186 */ 186 */
187static unsigned long psurge_smp_message[NR_CPUS]; 187static unsigned long psurge_smp_message[NR_CPUS];
188 188
189void __pmac psurge_smp_message_recv(struct pt_regs *regs) 189void psurge_smp_message_recv(struct pt_regs *regs)
190{ 190{
191 int cpu = smp_processor_id(); 191 int cpu = smp_processor_id();
192 int msg; 192 int msg;
@@ -203,14 +203,13 @@ void __pmac psurge_smp_message_recv(struct pt_regs *regs)
203 smp_message_recv(msg, regs); 203 smp_message_recv(msg, regs);
204} 204}
205 205
206irqreturn_t __pmac psurge_primary_intr(int irq, void *d, struct pt_regs *regs) 206irqreturn_t psurge_primary_intr(int irq, void *d, struct pt_regs *regs)
207{ 207{
208 psurge_smp_message_recv(regs); 208 psurge_smp_message_recv(regs);
209 return IRQ_HANDLED; 209 return IRQ_HANDLED;
210} 210}
211 211
212static void __pmac smp_psurge_message_pass(int target, int msg, unsigned long data, 212static void smp_psurge_message_pass(int target, int msg)
213 int wait)
214{ 213{
215 int i; 214 int i;
216 215
@@ -629,7 +628,7 @@ void smp_core99_give_timebase(void)
629 628
630 629
631/* PowerSurge-style Macs */ 630/* PowerSurge-style Macs */
632struct smp_ops_t psurge_smp_ops __pmacdata = { 631struct smp_ops_t psurge_smp_ops = {
633 .message_pass = smp_psurge_message_pass, 632 .message_pass = smp_psurge_message_pass,
634 .probe = smp_psurge_probe, 633 .probe = smp_psurge_probe,
635 .kick_cpu = smp_psurge_kick_cpu, 634 .kick_cpu = smp_psurge_kick_cpu,
@@ -639,7 +638,7 @@ struct smp_ops_t psurge_smp_ops __pmacdata = {
639}; 638};
640 639
641/* Core99 Macs (dual G4s) */ 640/* Core99 Macs (dual G4s) */
642struct smp_ops_t core99_smp_ops __pmacdata = { 641struct smp_ops_t core99_smp_ops = {
643 .message_pass = smp_openpic_message_pass, 642 .message_pass = smp_openpic_message_pass,
644 .probe = smp_core99_probe, 643 .probe = smp_core99_probe,
645 .kick_cpu = smp_core99_kick_cpu, 644 .kick_cpu = smp_core99_kick_cpu,
diff --git a/arch/ppc/platforms/pmac_time.c b/arch/ppc/platforms/pmac_time.c
index efb819f9490d..edb9fcc64790 100644
--- a/arch/ppc/platforms/pmac_time.c
+++ b/arch/ppc/platforms/pmac_time.c
@@ -77,7 +77,7 @@ pmac_time_init(void)
77#endif 77#endif
78} 78}
79 79
80unsigned long __pmac 80unsigned long
81pmac_get_rtc_time(void) 81pmac_get_rtc_time(void)
82{ 82{
83#if defined(CONFIG_ADB_CUDA) || defined(CONFIG_ADB_PMU) 83#if defined(CONFIG_ADB_CUDA) || defined(CONFIG_ADB_PMU)
@@ -118,7 +118,7 @@ pmac_get_rtc_time(void)
118 return 0; 118 return 0;
119} 119}
120 120
121int __pmac 121int
122pmac_set_rtc_time(unsigned long nowtime) 122pmac_set_rtc_time(unsigned long nowtime)
123{ 123{
124#if defined(CONFIG_ADB_CUDA) || defined(CONFIG_ADB_PMU) 124#if defined(CONFIG_ADB_CUDA) || defined(CONFIG_ADB_PMU)
@@ -210,7 +210,7 @@ via_calibrate_decr(void)
210/* 210/*
211 * Reset the time after a sleep. 211 * Reset the time after a sleep.
212 */ 212 */
213static int __pmac 213static int
214time_sleep_notify(struct pmu_sleep_notifier *self, int when) 214time_sleep_notify(struct pmu_sleep_notifier *self, int when)
215{ 215{
216 static unsigned long time_diff; 216 static unsigned long time_diff;
@@ -235,7 +235,7 @@ time_sleep_notify(struct pmu_sleep_notifier *self, int when)
235 return PBOOK_SLEEP_OK; 235 return PBOOK_SLEEP_OK;
236} 236}
237 237
238static struct pmu_sleep_notifier time_sleep_notifier __pmacdata = { 238static struct pmu_sleep_notifier time_sleep_notifier = {
239 time_sleep_notify, SLEEP_LEVEL_MISC, 239 time_sleep_notify, SLEEP_LEVEL_MISC,
240}; 240};
241#endif /* CONFIG_PM */ 241#endif /* CONFIG_PM */
diff --git a/arch/ppc/platforms/pplus.c b/arch/ppc/platforms/pplus.c
index e70aae20d6f9..22bd40cfb092 100644
--- a/arch/ppc/platforms/pplus.c
+++ b/arch/ppc/platforms/pplus.c
@@ -646,14 +646,6 @@ static void pplus_power_off(void)
646 pplus_halt(); 646 pplus_halt();
647} 647}
648 648
649static unsigned int pplus_irq_canonicalize(u_int irq)
650{
651 if (irq == 2)
652 return 9;
653 else
654 return irq;
655}
656
657static void __init pplus_init_IRQ(void) 649static void __init pplus_init_IRQ(void)
658{ 650{
659 int i; 651 int i;
@@ -673,10 +665,7 @@ static void __init pplus_init_IRQ(void)
673 ppc_md.get_irq = openpic_get_irq; 665 ppc_md.get_irq = openpic_get_irq;
674 } 666 }
675 667
676 for (i = 0; i < NUM_8259_INTERRUPTS; i++) 668 i8259_init(0, 0);
677 irq_desc[i].handler = &i8259_pic;
678
679 i8259_init(0);
680 669
681 if (ppc_md.progress) 670 if (ppc_md.progress)
682 ppc_md.progress("init_irq: exit", 0); 671 ppc_md.progress("init_irq: exit", 0);
@@ -872,10 +861,10 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
872 ISA_DMA_THRESHOLD = 0x00ffffff; 861 ISA_DMA_THRESHOLD = 0x00ffffff;
873 DMA_MODE_READ = 0x44; 862 DMA_MODE_READ = 0x44;
874 DMA_MODE_WRITE = 0x48; 863 DMA_MODE_WRITE = 0x48;
864 ppc_do_canonicalize_irqs = 1;
875 865
876 ppc_md.setup_arch = pplus_setup_arch; 866 ppc_md.setup_arch = pplus_setup_arch;
877 ppc_md.show_cpuinfo = pplus_show_cpuinfo; 867 ppc_md.show_cpuinfo = pplus_show_cpuinfo;
878 ppc_md.irq_canonicalize = pplus_irq_canonicalize;
879 ppc_md.init_IRQ = pplus_init_IRQ; 868 ppc_md.init_IRQ = pplus_init_IRQ;
880 /* this gets changed later on if we have an OpenPIC -- Cort */ 869 /* this gets changed later on if we have an OpenPIC -- Cort */
881 ppc_md.get_irq = i8259_irq; 870 ppc_md.get_irq = i8259_irq;
@@ -911,6 +900,6 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
911 ppc_md.kgdb_map_scc = gen550_kgdb_map_scc; 900 ppc_md.kgdb_map_scc = gen550_kgdb_map_scc;
912#endif 901#endif
913#ifdef CONFIG_SMP 902#ifdef CONFIG_SMP
914 ppc_md.smp_ops = &pplus_smp_ops; 903 smp_ops = &pplus_smp_ops;
915#endif /* CONFIG_SMP */ 904#endif /* CONFIG_SMP */
916} 905}
diff --git a/arch/ppc/platforms/prep_pci.c b/arch/ppc/platforms/prep_pci.c
index 4760cb64251d..e50b9996848c 100644
--- a/arch/ppc/platforms/prep_pci.c
+++ b/arch/ppc/platforms/prep_pci.c
@@ -43,7 +43,7 @@ static unsigned long *ProcInfo;
43/* Tables for known hardware */ 43/* Tables for known hardware */
44 44
45/* Motorola PowerStackII - Utah */ 45/* Motorola PowerStackII - Utah */
46static char Utah_pci_IRQ_map[23] __prepdata = 46static char Utah_pci_IRQ_map[23] =
47{ 47{
48 0, /* Slot 0 - unused */ 48 0, /* Slot 0 - unused */
49 0, /* Slot 1 - unused */ 49 0, /* Slot 1 - unused */
@@ -72,7 +72,7 @@ static char Utah_pci_IRQ_map[23] __prepdata =
72 0, /* Slot 22 - unused */ 72 0, /* Slot 22 - unused */
73}; 73};
74 74
75static char Utah_pci_IRQ_routes[] __prepdata = 75static char Utah_pci_IRQ_routes[] =
76{ 76{
77 0, /* Line 0 - Unused */ 77 0, /* Line 0 - Unused */
78 9, /* Line 1 */ 78 9, /* Line 1 */
@@ -84,7 +84,7 @@ static char Utah_pci_IRQ_routes[] __prepdata =
84 84
85/* Motorola PowerStackII - Omaha */ 85/* Motorola PowerStackII - Omaha */
86/* no integrated SCSI or ethernet */ 86/* no integrated SCSI or ethernet */
87static char Omaha_pci_IRQ_map[23] __prepdata = 87static char Omaha_pci_IRQ_map[23] =
88{ 88{
89 0, /* Slot 0 - unused */ 89 0, /* Slot 0 - unused */
90 0, /* Slot 1 - unused */ 90 0, /* Slot 1 - unused */
@@ -111,7 +111,7 @@ static char Omaha_pci_IRQ_map[23] __prepdata =
111 0, 111 0,
112}; 112};
113 113
114static char Omaha_pci_IRQ_routes[] __prepdata = 114static char Omaha_pci_IRQ_routes[] =
115{ 115{
116 0, /* Line 0 - Unused */ 116 0, /* Line 0 - Unused */
117 9, /* Line 1 */ 117 9, /* Line 1 */
@@ -121,7 +121,7 @@ static char Omaha_pci_IRQ_routes[] __prepdata =
121}; 121};
122 122
123/* Motorola PowerStack */ 123/* Motorola PowerStack */
124static char Blackhawk_pci_IRQ_map[19] __prepdata = 124static char Blackhawk_pci_IRQ_map[19] =
125{ 125{
126 0, /* Slot 0 - unused */ 126 0, /* Slot 0 - unused */
127 0, /* Slot 1 - unused */ 127 0, /* Slot 1 - unused */
@@ -144,7 +144,7 @@ static char Blackhawk_pci_IRQ_map[19] __prepdata =
144 3, /* Slot P5 */ 144 3, /* Slot P5 */
145}; 145};
146 146
147static char Blackhawk_pci_IRQ_routes[] __prepdata = 147static char Blackhawk_pci_IRQ_routes[] =
148{ 148{
149 0, /* Line 0 - Unused */ 149 0, /* Line 0 - Unused */
150 9, /* Line 1 */ 150 9, /* Line 1 */
@@ -154,7 +154,7 @@ static char Blackhawk_pci_IRQ_routes[] __prepdata =
154}; 154};
155 155
156/* Motorola Mesquite */ 156/* Motorola Mesquite */
157static char Mesquite_pci_IRQ_map[23] __prepdata = 157static char Mesquite_pci_IRQ_map[23] =
158{ 158{
159 0, /* Slot 0 - unused */ 159 0, /* Slot 0 - unused */
160 0, /* Slot 1 - unused */ 160 0, /* Slot 1 - unused */
@@ -182,7 +182,7 @@ static char Mesquite_pci_IRQ_map[23] __prepdata =
182}; 182};
183 183
184/* Motorola Sitka */ 184/* Motorola Sitka */
185static char Sitka_pci_IRQ_map[21] __prepdata = 185static char Sitka_pci_IRQ_map[21] =
186{ 186{
187 0, /* Slot 0 - unused */ 187 0, /* Slot 0 - unused */
188 0, /* Slot 1 - unused */ 188 0, /* Slot 1 - unused */
@@ -208,7 +208,7 @@ static char Sitka_pci_IRQ_map[21] __prepdata =
208}; 208};
209 209
210/* Motorola MTX */ 210/* Motorola MTX */
211static char MTX_pci_IRQ_map[23] __prepdata = 211static char MTX_pci_IRQ_map[23] =
212{ 212{
213 0, /* Slot 0 - unused */ 213 0, /* Slot 0 - unused */
214 0, /* Slot 1 - unused */ 214 0, /* Slot 1 - unused */
@@ -237,7 +237,7 @@ static char MTX_pci_IRQ_map[23] __prepdata =
237 237
238/* Motorola MTX Plus */ 238/* Motorola MTX Plus */
239/* Secondary bus interrupt routing is not supported yet */ 239/* Secondary bus interrupt routing is not supported yet */
240static char MTXplus_pci_IRQ_map[23] __prepdata = 240static char MTXplus_pci_IRQ_map[23] =
241{ 241{
242 0, /* Slot 0 - unused */ 242 0, /* Slot 0 - unused */
243 0, /* Slot 1 - unused */ 243 0, /* Slot 1 - unused */
@@ -264,13 +264,13 @@ static char MTXplus_pci_IRQ_map[23] __prepdata =
264 0, /* Slot 22 - unused */ 264 0, /* Slot 22 - unused */
265}; 265};
266 266
267static char Raven_pci_IRQ_routes[] __prepdata = 267static char Raven_pci_IRQ_routes[] =
268{ 268{
269 0, /* This is a dummy structure */ 269 0, /* This is a dummy structure */
270}; 270};
271 271
272/* Motorola MVME16xx */ 272/* Motorola MVME16xx */
273static char Genesis_pci_IRQ_map[16] __prepdata = 273static char Genesis_pci_IRQ_map[16] =
274{ 274{
275 0, /* Slot 0 - unused */ 275 0, /* Slot 0 - unused */
276 0, /* Slot 1 - unused */ 276 0, /* Slot 1 - unused */
@@ -290,7 +290,7 @@ static char Genesis_pci_IRQ_map[16] __prepdata =
290 0, /* Slot 15 - unused */ 290 0, /* Slot 15 - unused */
291}; 291};
292 292
293static char Genesis_pci_IRQ_routes[] __prepdata = 293static char Genesis_pci_IRQ_routes[] =
294{ 294{
295 0, /* Line 0 - Unused */ 295 0, /* Line 0 - Unused */
296 10, /* Line 1 */ 296 10, /* Line 1 */
@@ -299,7 +299,7 @@ static char Genesis_pci_IRQ_routes[] __prepdata =
299 15 /* Line 4 */ 299 15 /* Line 4 */
300}; 300};
301 301
302static char Genesis2_pci_IRQ_map[23] __prepdata = 302static char Genesis2_pci_IRQ_map[23] =
303{ 303{
304 0, /* Slot 0 - unused */ 304 0, /* Slot 0 - unused */
305 0, /* Slot 1 - unused */ 305 0, /* Slot 1 - unused */
@@ -327,7 +327,7 @@ static char Genesis2_pci_IRQ_map[23] __prepdata =
327}; 327};
328 328
329/* Motorola Series-E */ 329/* Motorola Series-E */
330static char Comet_pci_IRQ_map[23] __prepdata = 330static char Comet_pci_IRQ_map[23] =
331{ 331{
332 0, /* Slot 0 - unused */ 332 0, /* Slot 0 - unused */
333 0, /* Slot 1 - unused */ 333 0, /* Slot 1 - unused */
@@ -354,7 +354,7 @@ static char Comet_pci_IRQ_map[23] __prepdata =
354 0, 354 0,
355}; 355};
356 356
357static char Comet_pci_IRQ_routes[] __prepdata = 357static char Comet_pci_IRQ_routes[] =
358{ 358{
359 0, /* Line 0 - Unused */ 359 0, /* Line 0 - Unused */
360 10, /* Line 1 */ 360 10, /* Line 1 */
@@ -364,7 +364,7 @@ static char Comet_pci_IRQ_routes[] __prepdata =
364}; 364};
365 365
366/* Motorola Series-EX */ 366/* Motorola Series-EX */
367static char Comet2_pci_IRQ_map[23] __prepdata = 367static char Comet2_pci_IRQ_map[23] =
368{ 368{
369 0, /* Slot 0 - unused */ 369 0, /* Slot 0 - unused */
370 0, /* Slot 1 - unused */ 370 0, /* Slot 1 - unused */
@@ -391,7 +391,7 @@ static char Comet2_pci_IRQ_map[23] __prepdata =
391 0, 391 0,
392}; 392};
393 393
394static char Comet2_pci_IRQ_routes[] __prepdata = 394static char Comet2_pci_IRQ_routes[] =
395{ 395{
396 0, /* Line 0 - Unused */ 396 0, /* Line 0 - Unused */
397 10, /* Line 1 */ 397 10, /* Line 1 */
@@ -405,7 +405,7 @@ static char Comet2_pci_IRQ_routes[] __prepdata =
405 * This is actually based on the Carolina motherboard 405 * This is actually based on the Carolina motherboard
406 * -- Cort 406 * -- Cort
407 */ 407 */
408static char ibm8xx_pci_IRQ_map[23] __prepdata = { 408static char ibm8xx_pci_IRQ_map[23] = {
409 0, /* Slot 0 - unused */ 409 0, /* Slot 0 - unused */
410 0, /* Slot 1 - unused */ 410 0, /* Slot 1 - unused */
411 0, /* Slot 2 - unused */ 411 0, /* Slot 2 - unused */
@@ -431,7 +431,7 @@ static char ibm8xx_pci_IRQ_map[23] __prepdata = {
431 2, /* Slot 22 - PCI slot 1 PCIINTx# (See below) */ 431 2, /* Slot 22 - PCI slot 1 PCIINTx# (See below) */
432}; 432};
433 433
434static char ibm8xx_pci_IRQ_routes[] __prepdata = { 434static char ibm8xx_pci_IRQ_routes[] = {
435 0, /* Line 0 - unused */ 435 0, /* Line 0 - unused */
436 15, /* Line 1 */ 436 15, /* Line 1 */
437 15, /* Line 2 */ 437 15, /* Line 2 */
@@ -443,7 +443,7 @@ static char ibm8xx_pci_IRQ_routes[] __prepdata = {
443 * a 6015 ibm board 443 * a 6015 ibm board
444 * -- Cort 444 * -- Cort
445 */ 445 */
446static char ibm6015_pci_IRQ_map[23] __prepdata = { 446static char ibm6015_pci_IRQ_map[23] = {
447 0, /* Slot 0 - unused */ 447 0, /* Slot 0 - unused */
448 0, /* Slot 1 - unused */ 448 0, /* Slot 1 - unused */
449 0, /* Slot 2 - unused */ 449 0, /* Slot 2 - unused */
@@ -469,7 +469,7 @@ static char ibm6015_pci_IRQ_map[23] __prepdata = {
469 2, /* Slot 22 - */ 469 2, /* Slot 22 - */
470}; 470};
471 471
472static char ibm6015_pci_IRQ_routes[] __prepdata = { 472static char ibm6015_pci_IRQ_routes[] = {
473 0, /* Line 0 - unused */ 473 0, /* Line 0 - unused */
474 13, /* Line 1 */ 474 13, /* Line 1 */
475 15, /* Line 2 */ 475 15, /* Line 2 */
@@ -479,7 +479,7 @@ static char ibm6015_pci_IRQ_routes[] __prepdata = {
479 479
480 480
481/* IBM Nobis and Thinkpad 850 */ 481/* IBM Nobis and Thinkpad 850 */
482static char Nobis_pci_IRQ_map[23] __prepdata ={ 482static char Nobis_pci_IRQ_map[23] ={
483 0, /* Slot 0 - unused */ 483 0, /* Slot 0 - unused */
484 0, /* Slot 1 - unused */ 484 0, /* Slot 1 - unused */
485 0, /* Slot 2 - unused */ 485 0, /* Slot 2 - unused */
@@ -498,7 +498,7 @@ static char Nobis_pci_IRQ_map[23] __prepdata ={
498 0, /* Slot 15 - unused */ 498 0, /* Slot 15 - unused */
499}; 499};
500 500
501static char Nobis_pci_IRQ_routes[] __prepdata = { 501static char Nobis_pci_IRQ_routes[] = {
502 0, /* Line 0 - Unused */ 502 0, /* Line 0 - Unused */
503 13, /* Line 1 */ 503 13, /* Line 1 */
504 13, /* Line 2 */ 504 13, /* Line 2 */
@@ -510,7 +510,7 @@ static char Nobis_pci_IRQ_routes[] __prepdata = {
510 * IBM RS/6000 43p/140 -- paulus 510 * IBM RS/6000 43p/140 -- paulus
511 * XXX we should get all this from the residual data 511 * XXX we should get all this from the residual data
512 */ 512 */
513static char ibm43p_pci_IRQ_map[23] __prepdata = { 513static char ibm43p_pci_IRQ_map[23] = {
514 0, /* Slot 0 - unused */ 514 0, /* Slot 0 - unused */
515 0, /* Slot 1 - unused */ 515 0, /* Slot 1 - unused */
516 0, /* Slot 2 - unused */ 516 0, /* Slot 2 - unused */
@@ -536,7 +536,7 @@ static char ibm43p_pci_IRQ_map[23] __prepdata = {
536 1, /* Slot 22 - PCI slot 1 PCIINTx# (See below) */ 536 1, /* Slot 22 - PCI slot 1 PCIINTx# (See below) */
537}; 537};
538 538
539static char ibm43p_pci_IRQ_routes[] __prepdata = { 539static char ibm43p_pci_IRQ_routes[] = {
540 0, /* Line 0 - unused */ 540 0, /* Line 0 - unused */
541 15, /* Line 1 */ 541 15, /* Line 1 */
542 15, /* Line 2 */ 542 15, /* Line 2 */
@@ -559,7 +559,7 @@ struct powerplus_irq_list
559 * are routed to OpenPIC inputs 5-8. These values are offset by 559 * are routed to OpenPIC inputs 5-8. These values are offset by
560 * 16 in the table to reflect the Linux kernel interrupt value. 560 * 16 in the table to reflect the Linux kernel interrupt value.
561 */ 561 */
562struct powerplus_irq_list Powerplus_pci_IRQ_list __prepdata = 562struct powerplus_irq_list Powerplus_pci_IRQ_list =
563{ 563{
564 {25, 26, 27, 28}, 564 {25, 26, 27, 28},
565 {21, 22, 23, 24} 565 {21, 22, 23, 24}
@@ -572,7 +572,7 @@ struct powerplus_irq_list Powerplus_pci_IRQ_list __prepdata =
572 * are routed to OpenPIC inputs 12-15. These values are offset by 572 * are routed to OpenPIC inputs 12-15. These values are offset by
573 * 16 in the table to reflect the Linux kernel interrupt value. 573 * 16 in the table to reflect the Linux kernel interrupt value.
574 */ 574 */
575struct powerplus_irq_list Mesquite_pci_IRQ_list __prepdata = 575struct powerplus_irq_list Mesquite_pci_IRQ_list =
576{ 576{
577 {24, 25, 26, 27}, 577 {24, 25, 26, 27},
578 {28, 29, 30, 31} 578 {28, 29, 30, 31}
@@ -582,7 +582,7 @@ struct powerplus_irq_list Mesquite_pci_IRQ_list __prepdata =
582 * This table represents the standard PCI swizzle defined in the 582 * This table represents the standard PCI swizzle defined in the
583 * PCI bus specification. 583 * PCI bus specification.
584 */ 584 */
585static unsigned char prep_pci_intpins[4][4] __prepdata = 585static unsigned char prep_pci_intpins[4][4] =
586{ 586{
587 { 1, 2, 3, 4}, /* Buses 0, 4, 8, ... */ 587 { 1, 2, 3, 4}, /* Buses 0, 4, 8, ... */
588 { 2, 3, 4, 1}, /* Buses 1, 5, 9, ... */ 588 { 2, 3, 4, 1}, /* Buses 1, 5, 9, ... */
@@ -622,7 +622,7 @@ static unsigned char prep_pci_intpins[4][4] __prepdata =
622#define MIN_DEVNR 11 622#define MIN_DEVNR 11
623#define MAX_DEVNR 22 623#define MAX_DEVNR 22
624 624
625static int __prep 625static int
626prep_read_config(struct pci_bus *bus, unsigned int devfn, int offset, 626prep_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
627 int len, u32 *val) 627 int len, u32 *val)
628{ 628{
@@ -652,7 +652,7 @@ prep_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
652 return PCIBIOS_SUCCESSFUL; 652 return PCIBIOS_SUCCESSFUL;
653} 653}
654 654
655static int __prep 655static int
656prep_write_config(struct pci_bus *bus, unsigned int devfn, int offset, 656prep_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
657 int len, u32 val) 657 int len, u32 val)
658{ 658{
@@ -804,7 +804,7 @@ struct mot_info {
804 void (*map_non0_bus)(struct pci_dev *); /* For boards with more than bus 0 devices. */ 804 void (*map_non0_bus)(struct pci_dev *); /* For boards with more than bus 0 devices. */
805 struct powerplus_irq_list *pci_irq_list; /* List of PCI MPIC inputs */ 805 struct powerplus_irq_list *pci_irq_list; /* List of PCI MPIC inputs */
806 unsigned char secondary_bridge_devfn; /* devfn of secondary bus transparent bridge */ 806 unsigned char secondary_bridge_devfn; /* devfn of secondary bus transparent bridge */
807} mot_info[] __prepdata = { 807} mot_info[] = {
808 {0x300, 0x00, 0x00, "MVME 2400", Genesis2_pci_IRQ_map, Raven_pci_IRQ_routes, Powerplus_Map_Non0, &Powerplus_pci_IRQ_list, 0xFF}, 808 {0x300, 0x00, 0x00, "MVME 2400", Genesis2_pci_IRQ_map, Raven_pci_IRQ_routes, Powerplus_Map_Non0, &Powerplus_pci_IRQ_list, 0xFF},
809 {0x010, 0x00, 0x00, "Genesis", Genesis_pci_IRQ_map, Genesis_pci_IRQ_routes, Powerplus_Map_Non0, &Powerplus_pci_IRQ_list, 0x00}, 809 {0x010, 0x00, 0x00, "Genesis", Genesis_pci_IRQ_map, Genesis_pci_IRQ_routes, Powerplus_Map_Non0, &Powerplus_pci_IRQ_list, 0x00},
810 {0x020, 0x00, 0x00, "Powerstack (Series E)", Comet_pci_IRQ_map, Comet_pci_IRQ_routes, NULL, NULL, 0x00}, 810 {0x020, 0x00, 0x00, "Powerstack (Series E)", Comet_pci_IRQ_map, Comet_pci_IRQ_routes, NULL, NULL, 0x00},
diff --git a/arch/ppc/platforms/prep_setup.c b/arch/ppc/platforms/prep_setup.c
index bc926be95472..067d7d53b81e 100644
--- a/arch/ppc/platforms/prep_setup.c
+++ b/arch/ppc/platforms/prep_setup.c
@@ -89,9 +89,6 @@ extern void prep_tiger1_setup_pci(char *irq_edge_mask_lo, char *irq_edge_mask_hi
89#define cached_21 (((char *)(ppc_cached_irq_mask))[3]) 89#define cached_21 (((char *)(ppc_cached_irq_mask))[3])
90#define cached_A1 (((char *)(ppc_cached_irq_mask))[2]) 90#define cached_A1 (((char *)(ppc_cached_irq_mask))[2])
91 91
92/* for the mac fs */
93dev_t boot_dev;
94
95#ifdef CONFIG_SOUND_CS4232 92#ifdef CONFIG_SOUND_CS4232
96long ppc_cs4232_dma, ppc_cs4232_dma2; 93long ppc_cs4232_dma, ppc_cs4232_dma2;
97#endif 94#endif
@@ -173,7 +170,7 @@ prep_carolina_enable_l2(void)
173} 170}
174 171
175/* cpuinfo code common to all IBM PReP */ 172/* cpuinfo code common to all IBM PReP */
176static void __prep 173static void
177prep_ibm_cpuinfo(struct seq_file *m) 174prep_ibm_cpuinfo(struct seq_file *m)
178{ 175{
179 unsigned int equip_reg = inb(PREP_IBM_EQUIPMENT); 176 unsigned int equip_reg = inb(PREP_IBM_EQUIPMENT);
@@ -209,14 +206,14 @@ prep_ibm_cpuinfo(struct seq_file *m)
209 } 206 }
210} 207}
211 208
212static int __prep 209static int
213prep_gen_cpuinfo(struct seq_file *m) 210prep_gen_cpuinfo(struct seq_file *m)
214{ 211{
215 prep_ibm_cpuinfo(m); 212 prep_ibm_cpuinfo(m);
216 return 0; 213 return 0;
217} 214}
218 215
219static int __prep 216static int
220prep_sandalfoot_cpuinfo(struct seq_file *m) 217prep_sandalfoot_cpuinfo(struct seq_file *m)
221{ 218{
222 unsigned int equip_reg = inb(PREP_IBM_EQUIPMENT); 219 unsigned int equip_reg = inb(PREP_IBM_EQUIPMENT);
@@ -243,7 +240,7 @@ prep_sandalfoot_cpuinfo(struct seq_file *m)
243 return 0; 240 return 0;
244} 241}
245 242
246static int __prep 243static int
247prep_thinkpad_cpuinfo(struct seq_file *m) 244prep_thinkpad_cpuinfo(struct seq_file *m)
248{ 245{
249 unsigned int equip_reg = inb(PREP_IBM_EQUIPMENT); 246 unsigned int equip_reg = inb(PREP_IBM_EQUIPMENT);
@@ -314,7 +311,7 @@ prep_thinkpad_cpuinfo(struct seq_file *m)
314 return 0; 311 return 0;
315} 312}
316 313
317static int __prep 314static int
318prep_carolina_cpuinfo(struct seq_file *m) 315prep_carolina_cpuinfo(struct seq_file *m)
319{ 316{
320 unsigned int equip_reg = inb(PREP_IBM_EQUIPMENT); 317 unsigned int equip_reg = inb(PREP_IBM_EQUIPMENT);
@@ -350,7 +347,7 @@ prep_carolina_cpuinfo(struct seq_file *m)
350 return 0; 347 return 0;
351} 348}
352 349
353static int __prep 350static int
354prep_tiger1_cpuinfo(struct seq_file *m) 351prep_tiger1_cpuinfo(struct seq_file *m)
355{ 352{
356 unsigned int l2_reg = inb(PREP_IBM_L2INFO); 353 unsigned int l2_reg = inb(PREP_IBM_L2INFO);
@@ -393,7 +390,7 @@ prep_tiger1_cpuinfo(struct seq_file *m)
393 390
394 391
395/* Used by all Motorola PReP */ 392/* Used by all Motorola PReP */
396static int __prep 393static int
397prep_mot_cpuinfo(struct seq_file *m) 394prep_mot_cpuinfo(struct seq_file *m)
398{ 395{
399 unsigned int cachew = *((unsigned char *)CACHECRBA); 396 unsigned int cachew = *((unsigned char *)CACHECRBA);
@@ -454,7 +451,7 @@ no_l2:
454 return 0; 451 return 0;
455} 452}
456 453
457static void __prep 454static void
458prep_restart(char *cmd) 455prep_restart(char *cmd)
459{ 456{
460#define PREP_SP92 0x92 /* Special Port 92 */ 457#define PREP_SP92 0x92 /* Special Port 92 */
@@ -473,7 +470,7 @@ prep_restart(char *cmd)
473#undef PREP_SP92 470#undef PREP_SP92
474} 471}
475 472
476static void __prep 473static void
477prep_halt(void) 474prep_halt(void)
478{ 475{
479 local_irq_disable(); /* no interrupts */ 476 local_irq_disable(); /* no interrupts */
@@ -488,7 +485,7 @@ prep_halt(void)
488/* Carrera is the power manager in the Thinkpads. Unfortunately not much is 485/* Carrera is the power manager in the Thinkpads. Unfortunately not much is
489 * known about it, so we can't power down. 486 * known about it, so we can't power down.
490 */ 487 */
491static void __prep 488static void
492prep_carrera_poweroff(void) 489prep_carrera_poweroff(void)
493{ 490{
494 prep_halt(); 491 prep_halt();
@@ -501,7 +498,7 @@ prep_carrera_poweroff(void)
501 * somewhat in the IBM Carolina Technical Specification. 498 * somewhat in the IBM Carolina Technical Specification.
502 * -Hollis 499 * -Hollis
503 */ 500 */
504static void __prep 501static void
505utah_sig87c750_setbit(unsigned int bytenum, unsigned int bitnum, int value) 502utah_sig87c750_setbit(unsigned int bytenum, unsigned int bitnum, int value)
506{ 503{
507 /* 504 /*
@@ -539,7 +536,7 @@ utah_sig87c750_setbit(unsigned int bytenum, unsigned int bitnum, int value)
539 udelay(100); /* important: let controller recover */ 536 udelay(100); /* important: let controller recover */
540} 537}
541 538
542static void __prep 539static void
543prep_sig750_poweroff(void) 540prep_sig750_poweroff(void)
544{ 541{
545 /* tweak the power manager found in most IBM PRePs (except Thinkpads) */ 542 /* tweak the power manager found in most IBM PRePs (except Thinkpads) */
@@ -554,7 +551,7 @@ prep_sig750_poweroff(void)
554 /* not reached */ 551 /* not reached */
555} 552}
556 553
557static int __prep 554static int
558prep_show_percpuinfo(struct seq_file *m, int i) 555prep_show_percpuinfo(struct seq_file *m, int i)
559{ 556{
560 /* PREP's without residual data will give incorrect values here */ 557 /* PREP's without residual data will give incorrect values here */
@@ -700,12 +697,12 @@ prep_set_bat(void)
700/* 697/*
701 * IBM 3-digit status LED 698 * IBM 3-digit status LED
702 */ 699 */
703static unsigned int ibm_statusled_base __prepdata; 700static unsigned int ibm_statusled_base;
704 701
705static void __prep 702static void
706ibm_statusled_progress(char *s, unsigned short hex); 703ibm_statusled_progress(char *s, unsigned short hex);
707 704
708static int __prep 705static int
709ibm_statusled_panic(struct notifier_block *dummy1, unsigned long dummy2, 706ibm_statusled_panic(struct notifier_block *dummy1, unsigned long dummy2,
710 void * dummy3) 707 void * dummy3)
711{ 708{
@@ -713,13 +710,13 @@ ibm_statusled_panic(struct notifier_block *dummy1, unsigned long dummy2,
713 return NOTIFY_DONE; 710 return NOTIFY_DONE;
714} 711}
715 712
716static struct notifier_block ibm_statusled_block __prepdata = { 713static struct notifier_block ibm_statusled_block = {
717 ibm_statusled_panic, 714 ibm_statusled_panic,
718 NULL, 715 NULL,
719 INT_MAX /* try to do it first */ 716 INT_MAX /* try to do it first */
720}; 717};
721 718
722static void __prep 719static void
723ibm_statusled_progress(char *s, unsigned short hex) 720ibm_statusled_progress(char *s, unsigned short hex)
724{ 721{
725 static int notifier_installed; 722 static int notifier_installed;
@@ -945,19 +942,6 @@ prep_calibrate_decr(void)
945 todc_calibrate_decr(); 942 todc_calibrate_decr();
946} 943}
947 944
948static unsigned int __prep
949prep_irq_canonicalize(u_int irq)
950{
951 if (irq == 2)
952 {
953 return 9;
954 }
955 else
956 {
957 return irq;
958 }
959}
960
961static void __init 945static void __init
962prep_init_IRQ(void) 946prep_init_IRQ(void)
963{ 947{
@@ -970,11 +954,9 @@ prep_init_IRQ(void)
970 openpic_hookup_cascade(NUM_8259_INTERRUPTS, "82c59 cascade", 954 openpic_hookup_cascade(NUM_8259_INTERRUPTS, "82c59 cascade",
971 i8259_irq); 955 i8259_irq);
972 } 956 }
973 for ( i = 0 ; i < NUM_8259_INTERRUPTS ; i++ )
974 irq_desc[i].handler = &i8259_pic;
975 957
976 if (have_residual_data) { 958 if (have_residual_data) {
977 i8259_init(residual_isapic_addr()); 959 i8259_init(residual_isapic_addr(), 0);
978 return; 960 return;
979 } 961 }
980 962
@@ -985,18 +967,18 @@ prep_init_IRQ(void)
985 if (((pci_viddid & 0xffff) == PCI_VENDOR_ID_MOTOROLA) 967 if (((pci_viddid & 0xffff) == PCI_VENDOR_ID_MOTOROLA)
986 && ((pci_did == PCI_DEVICE_ID_MOTOROLA_RAVEN) 968 && ((pci_did == PCI_DEVICE_ID_MOTOROLA_RAVEN)
987 || (pci_did == PCI_DEVICE_ID_MOTOROLA_HAWK))) 969 || (pci_did == PCI_DEVICE_ID_MOTOROLA_HAWK)))
988 i8259_init(0); 970 i8259_init(0, 0);
989 else 971 else
990 /* PCI interrupt ack address given in section 6.1.8 of the 972 /* PCI interrupt ack address given in section 6.1.8 of the
991 * PReP specification. */ 973 * PReP specification. */
992 i8259_init(MPC10X_MAPA_PCI_INTACK_ADDR); 974 i8259_init(MPC10X_MAPA_PCI_INTACK_ADDR, 0);
993} 975}
994 976
995#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) 977#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
996/* 978/*
997 * IDE stuff. 979 * IDE stuff.
998 */ 980 */
999static int __prep 981static int
1000prep_ide_default_irq(unsigned long base) 982prep_ide_default_irq(unsigned long base)
1001{ 983{
1002 switch (base) { 984 switch (base) {
@@ -1010,7 +992,7 @@ prep_ide_default_irq(unsigned long base)
1010 } 992 }
1011} 993}
1012 994
1013static unsigned long __prep 995static unsigned long
1014prep_ide_default_io_base(int index) 996prep_ide_default_io_base(int index)
1015{ 997{
1016 switch (index) { 998 switch (index) {
@@ -1055,7 +1037,7 @@ smp_prep_setup_cpu(int cpu_nr)
1055 do_openpic_setup_cpu(); 1037 do_openpic_setup_cpu();
1056} 1038}
1057 1039
1058static struct smp_ops_t prep_smp_ops __prepdata = { 1040static struct smp_ops_t prep_smp_ops = {
1059 smp_openpic_message_pass, 1041 smp_openpic_message_pass,
1060 smp_prep_probe, 1042 smp_prep_probe,
1061 smp_prep_kick_cpu, 1043 smp_prep_kick_cpu,
@@ -1113,6 +1095,7 @@ prep_init(unsigned long r3, unsigned long r4, unsigned long r5,
1113 ISA_DMA_THRESHOLD = 0x00ffffff; 1095 ISA_DMA_THRESHOLD = 0x00ffffff;
1114 DMA_MODE_READ = 0x44; 1096 DMA_MODE_READ = 0x44;
1115 DMA_MODE_WRITE = 0x48; 1097 DMA_MODE_WRITE = 0x48;
1098 ppc_do_canonicalize_irqs = 1;
1116 1099
1117 /* figure out what kind of prep workstation we are */ 1100 /* figure out what kind of prep workstation we are */
1118 if (have_residual_data) { 1101 if (have_residual_data) {
@@ -1139,7 +1122,6 @@ prep_init(unsigned long r3, unsigned long r4, unsigned long r5,
1139 ppc_md.setup_arch = prep_setup_arch; 1122 ppc_md.setup_arch = prep_setup_arch;
1140 ppc_md.show_percpuinfo = prep_show_percpuinfo; 1123 ppc_md.show_percpuinfo = prep_show_percpuinfo;
1141 ppc_md.show_cpuinfo = NULL; /* set in prep_setup_arch() */ 1124 ppc_md.show_cpuinfo = NULL; /* set in prep_setup_arch() */
1142 ppc_md.irq_canonicalize = prep_irq_canonicalize;
1143 ppc_md.init_IRQ = prep_init_IRQ; 1125 ppc_md.init_IRQ = prep_init_IRQ;
1144 /* this gets changed later on if we have an OpenPIC -- Cort */ 1126 /* this gets changed later on if we have an OpenPIC -- Cort */
1145 ppc_md.get_irq = i8259_irq; 1127 ppc_md.get_irq = i8259_irq;
@@ -1176,6 +1158,6 @@ prep_init(unsigned long r3, unsigned long r4, unsigned long r5,
1176#endif 1158#endif
1177 1159
1178#ifdef CONFIG_SMP 1160#ifdef CONFIG_SMP
1179 ppc_md.smp_ops = &prep_smp_ops; 1161 smp_ops = &prep_smp_ops;
1180#endif /* CONFIG_SMP */ 1162#endif /* CONFIG_SMP */
1181} 1163}
diff --git a/arch/ppc/platforms/radstone_ppc7d.c b/arch/ppc/platforms/radstone_ppc7d.c
index 7e65b7f1f626..708b8739ecdd 100644
--- a/arch/ppc/platforms/radstone_ppc7d.c
+++ b/arch/ppc/platforms/radstone_ppc7d.c
@@ -515,13 +515,9 @@ static void __init ppc7d_init_irq(void)
515 int irq; 515 int irq;
516 516
517 pr_debug("%s\n", __FUNCTION__); 517 pr_debug("%s\n", __FUNCTION__);
518 i8259_init(0); 518 i8259_init(0, 0);
519 mv64360_init_irq(); 519 mv64360_init_irq();
520 520
521 /* IRQ 0..15 are handled by the cascaded 8259's of the Ali1535 */
522 for (irq = 0; irq < 16; irq++) {
523 irq_desc[irq].handler = &i8259_pic;
524 }
525 /* IRQs 5,6,9,10,11,14,15 are level sensitive */ 521 /* IRQs 5,6,9,10,11,14,15 are level sensitive */
526 irq_desc[5].status |= IRQ_LEVEL; 522 irq_desc[5].status |= IRQ_LEVEL;
527 irq_desc[6].status |= IRQ_LEVEL; 523 irq_desc[6].status |= IRQ_LEVEL;
@@ -1184,18 +1180,18 @@ static void __init ppc7d_setup_arch(void)
1184 ROOT_DEV = Root_HDA1; 1180 ROOT_DEV = Root_HDA1;
1185#endif 1181#endif
1186 1182
1187 if ((cur_cpu_spec[0]->cpu_features & CPU_FTR_SPEC7450) || 1183 if ((cur_cpu_spec->cpu_features & CPU_FTR_SPEC7450) ||
1188 (cur_cpu_spec[0]->cpu_features & CPU_FTR_L3CR)) 1184 (cur_cpu_spec->cpu_features & CPU_FTR_L3CR))
1189 /* 745x is different. We only want to pass along enable. */ 1185 /* 745x is different. We only want to pass along enable. */
1190 _set_L2CR(L2CR_L2E); 1186 _set_L2CR(L2CR_L2E);
1191 else if (cur_cpu_spec[0]->cpu_features & CPU_FTR_L2CR) 1187 else if (cur_cpu_spec->cpu_features & CPU_FTR_L2CR)
1192 /* All modules have 1MB of L2. We also assume that an 1188 /* All modules have 1MB of L2. We also assume that an
1193 * L2 divisor of 3 will work. 1189 * L2 divisor of 3 will work.
1194 */ 1190 */
1195 _set_L2CR(L2CR_L2E | L2CR_L2SIZ_1MB | L2CR_L2CLK_DIV3 1191 _set_L2CR(L2CR_L2E | L2CR_L2SIZ_1MB | L2CR_L2CLK_DIV3
1196 | L2CR_L2RAM_PIPE | L2CR_L2OH_1_0 | L2CR_L2DF); 1192 | L2CR_L2RAM_PIPE | L2CR_L2OH_1_0 | L2CR_L2DF);
1197 1193
1198 if (cur_cpu_spec[0]->cpu_features & CPU_FTR_L3CR) 1194 if (cur_cpu_spec->cpu_features & CPU_FTR_L3CR)
1199 /* No L3 cache */ 1195 /* No L3 cache */
1200 _set_L3CR(0); 1196 _set_L3CR(0);
1201 1197
@@ -1425,6 +1421,7 @@ void __init platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
1425 ppc_md.setup_arch = ppc7d_setup_arch; 1421 ppc_md.setup_arch = ppc7d_setup_arch;
1426 ppc_md.init = ppc7d_init2; 1422 ppc_md.init = ppc7d_init2;
1427 ppc_md.show_cpuinfo = ppc7d_show_cpuinfo; 1423 ppc_md.show_cpuinfo = ppc7d_show_cpuinfo;
1424 /* XXX this is broken... */
1428 ppc_md.irq_canonicalize = ppc7d_irq_canonicalize; 1425 ppc_md.irq_canonicalize = ppc7d_irq_canonicalize;
1429 ppc_md.init_IRQ = ppc7d_init_irq; 1426 ppc_md.init_IRQ = ppc7d_init_irq;
1430 ppc_md.get_irq = ppc7d_get_irq; 1427 ppc_md.get_irq = ppc7d_get_irq;
diff --git a/arch/ppc/platforms/residual.c b/arch/ppc/platforms/residual.c
index 0f84ca603612..c9911601cfdf 100644
--- a/arch/ppc/platforms/residual.c
+++ b/arch/ppc/platforms/residual.c
@@ -47,7 +47,7 @@
47#include <asm/ide.h> 47#include <asm/ide.h>
48 48
49 49
50unsigned char __res[sizeof(RESIDUAL)] __prepdata = {0,}; 50unsigned char __res[sizeof(RESIDUAL)] = {0,};
51RESIDUAL *res = (RESIDUAL *)&__res; 51RESIDUAL *res = (RESIDUAL *)&__res;
52 52
53char * PnP_BASE_TYPES[] __initdata = { 53char * PnP_BASE_TYPES[] __initdata = {
diff --git a/arch/ppc/platforms/sandpoint.c b/arch/ppc/platforms/sandpoint.c
index 5232283c1974..9eeed3572309 100644
--- a/arch/ppc/platforms/sandpoint.c
+++ b/arch/ppc/platforms/sandpoint.c
@@ -494,27 +494,10 @@ sandpoint_init_IRQ(void)
494 i8259_irq); 494 i8259_irq);
495 495
496 /* 496 /*
497 * openpic_init() has set up irq_desc[16-31] to be openpic
498 * interrupts. We need to set irq_desc[0-15] to be i8259
499 * interrupts.
500 */
501 for(i=0; i < NUM_8259_INTERRUPTS; i++)
502 irq_desc[i].handler = &i8259_pic;
503
504 /*
505 * The EPIC allows for a read in the range of 0xFEF00000 -> 497 * The EPIC allows for a read in the range of 0xFEF00000 ->
506 * 0xFEFFFFFF to generate a PCI interrupt-acknowledge transaction. 498 * 0xFEFFFFFF to generate a PCI interrupt-acknowledge transaction.
507 */ 499 */
508 i8259_init(0xfef00000); 500 i8259_init(0xfef00000, 0);
509}
510
511static u32
512sandpoint_irq_canonicalize(u32 irq)
513{
514 if (irq == 2)
515 return 9;
516 else
517 return irq;
518} 501}
519 502
520static unsigned long __init 503static unsigned long __init
@@ -727,10 +710,10 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
727 ISA_DMA_THRESHOLD = 0x00ffffff; 710 ISA_DMA_THRESHOLD = 0x00ffffff;
728 DMA_MODE_READ = 0x44; 711 DMA_MODE_READ = 0x44;
729 DMA_MODE_WRITE = 0x48; 712 DMA_MODE_WRITE = 0x48;
713 ppc_do_canonicalize_irqs = 1;
730 714
731 ppc_md.setup_arch = sandpoint_setup_arch; 715 ppc_md.setup_arch = sandpoint_setup_arch;
732 ppc_md.show_cpuinfo = sandpoint_show_cpuinfo; 716 ppc_md.show_cpuinfo = sandpoint_show_cpuinfo;
733 ppc_md.irq_canonicalize = sandpoint_irq_canonicalize;
734 ppc_md.init_IRQ = sandpoint_init_IRQ; 717 ppc_md.init_IRQ = sandpoint_init_IRQ;
735 ppc_md.get_irq = openpic_get_irq; 718 ppc_md.get_irq = openpic_get_irq;
736 719
diff --git a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile
index b8d08f33f7ee..b4ef15b45c4a 100644
--- a/arch/ppc/syslib/Makefile
+++ b/arch/ppc/syslib/Makefile
@@ -31,52 +31,49 @@ obj-$(CONFIG_GEN_RTC) += todc_time.o
31obj-$(CONFIG_PPC4xx_DMA) += ppc4xx_dma.o 31obj-$(CONFIG_PPC4xx_DMA) += ppc4xx_dma.o
32obj-$(CONFIG_PPC4xx_EDMA) += ppc4xx_sgdma.o 32obj-$(CONFIG_PPC4xx_EDMA) += ppc4xx_sgdma.o
33ifeq ($(CONFIG_40x),y) 33ifeq ($(CONFIG_40x),y)
34obj-$(CONFIG_PCI) += indirect_pci.o pci_auto.o ppc405_pci.o 34obj-$(CONFIG_PCI) += pci_auto.o ppc405_pci.o
35endif 35endif
36endif 36endif
37obj-$(CONFIG_8xx) += m8xx_setup.o ppc8xx_pic.o $(wdt-mpc8xx-y) \ 37obj-$(CONFIG_8xx) += m8xx_setup.o ppc8xx_pic.o $(wdt-mpc8xx-y) \
38 ppc_sys.o mpc8xx_devices.o mpc8xx_sys.o 38 ppc_sys.o mpc8xx_devices.o mpc8xx_sys.o
39ifeq ($(CONFIG_8xx),y) 39obj-$(CONFIG_PCI_QSPAN) += qspan_pci.o
40obj-$(CONFIG_PCI) += qspan_pci.o i8259.o 40obj-$(CONFIG_PPC_OF) += prom_init.o prom.o
41endif 41obj-$(CONFIG_PPC_PMAC) += open_pic.o
42obj-$(CONFIG_PPC_OF) += prom_init.o prom.o of_device.o
43obj-$(CONFIG_PPC_PMAC) += open_pic.o indirect_pci.o
44obj-$(CONFIG_POWER4) += open_pic2.o 42obj-$(CONFIG_POWER4) += open_pic2.o
45obj-$(CONFIG_PPC_CHRP) += open_pic.o indirect_pci.o i8259.o 43obj-$(CONFIG_PPC_CHRP) += open_pic.o
46obj-$(CONFIG_PPC_PREP) += open_pic.o indirect_pci.o i8259.o todc_time.o 44obj-$(CONFIG_PPC_PREP) += open_pic.o todc_time.o
47obj-$(CONFIG_BAMBOO) += indirect_pci.o pci_auto.o todc_time.o 45obj-$(CONFIG_BAMBOO) += pci_auto.o todc_time.o
48obj-$(CONFIG_CPCI690) += todc_time.o pci_auto.o 46obj-$(CONFIG_CPCI690) += todc_time.o pci_auto.o
49obj-$(CONFIG_EBONY) += indirect_pci.o pci_auto.o todc_time.o 47obj-$(CONFIG_EBONY) += pci_auto.o todc_time.o
50obj-$(CONFIG_EV64260) += todc_time.o pci_auto.o 48obj-$(CONFIG_EV64260) += todc_time.o pci_auto.o
51obj-$(CONFIG_CHESTNUT) += mv64360_pic.o pci_auto.o 49obj-$(CONFIG_CHESTNUT) += mv64360_pic.o pci_auto.o
52obj-$(CONFIG_GEMINI) += open_pic.o indirect_pci.o 50obj-$(CONFIG_GEMINI) += open_pic.o
53obj-$(CONFIG_GT64260) += gt64260_pic.o 51obj-$(CONFIG_GT64260) += gt64260_pic.o
54obj-$(CONFIG_LOPEC) += i8259.o pci_auto.o todc_time.o 52obj-$(CONFIG_LOPEC) += pci_auto.o todc_time.o
55obj-$(CONFIG_HDPU) += pci_auto.o 53obj-$(CONFIG_HDPU) += pci_auto.o
56obj-$(CONFIG_LUAN) += indirect_pci.o pci_auto.o todc_time.o 54obj-$(CONFIG_LUAN) += pci_auto.o todc_time.o
57obj-$(CONFIG_KATANA) += pci_auto.o 55obj-$(CONFIG_KATANA) += pci_auto.o
58obj-$(CONFIG_MV64360) += mv64360_pic.o 56obj-$(CONFIG_MV64360) += mv64360_pic.o
59obj-$(CONFIG_MV64X60) += mv64x60.o mv64x60_win.o indirect_pci.o 57obj-$(CONFIG_MV64X60) += mv64x60.o mv64x60_win.o
60obj-$(CONFIG_MVME5100) += open_pic.o todc_time.o indirect_pci.o \ 58obj-$(CONFIG_MVME5100) += open_pic.o todc_time.o \
61 pci_auto.o hawk_common.o 59 pci_auto.o hawk_common.o
62obj-$(CONFIG_MVME5100_IPMC761_PRESENT) += i8259.o 60obj-$(CONFIG_OCOTEA) += pci_auto.o todc_time.o
63obj-$(CONFIG_OCOTEA) += indirect_pci.o pci_auto.o todc_time.o
64obj-$(CONFIG_PAL4) += cpc700_pic.o 61obj-$(CONFIG_PAL4) += cpc700_pic.o
65obj-$(CONFIG_POWERPMC250) += pci_auto.o 62obj-$(CONFIG_POWERPMC250) += pci_auto.o
66obj-$(CONFIG_PPLUS) += hawk_common.o open_pic.o i8259.o \ 63obj-$(CONFIG_PPLUS) += hawk_common.o open_pic.o \
67 indirect_pci.o todc_time.o pci_auto.o 64 todc_time.o pci_auto.o
68obj-$(CONFIG_PRPMC750) += open_pic.o indirect_pci.o pci_auto.o \ 65obj-$(CONFIG_PRPMC750) += open_pic.o pci_auto.o \
69 hawk_common.o 66 hawk_common.o
70obj-$(CONFIG_HARRIER) += harrier.o 67obj-$(CONFIG_HARRIER) += harrier.o
71obj-$(CONFIG_PRPMC800) += open_pic.o indirect_pci.o pci_auto.o 68obj-$(CONFIG_PRPMC800) += open_pic.o pci_auto.o
72obj-$(CONFIG_RADSTONE_PPC7D) += i8259.o pci_auto.o 69obj-$(CONFIG_RADSTONE_PPC7D) += pci_auto.o
73obj-$(CONFIG_SANDPOINT) += i8259.o pci_auto.o todc_time.o 70obj-$(CONFIG_SANDPOINT) += pci_auto.o todc_time.o
74obj-$(CONFIG_SBC82xx) += todc_time.o 71obj-$(CONFIG_SBC82xx) += todc_time.o
75obj-$(CONFIG_SPRUCE) += cpc700_pic.o indirect_pci.o pci_auto.o \ 72obj-$(CONFIG_SPRUCE) += cpc700_pic.o pci_auto.o \
76 todc_time.o 73 todc_time.o
77obj-$(CONFIG_8260) += m8260_setup.o pq2_devices.o pq2_sys.o \ 74obj-$(CONFIG_8260) += m8260_setup.o pq2_devices.o pq2_sys.o \
78 ppc_sys.o 75 ppc_sys.o
79obj-$(CONFIG_PCI_8260) += m82xx_pci.o indirect_pci.o pci_auto.o 76obj-$(CONFIG_PCI_8260) += m82xx_pci.o pci_auto.o
80obj-$(CONFIG_8260_PCI9) += m8260_pci_erratum9.o 77obj-$(CONFIG_8260_PCI9) += m8260_pci_erratum9.o
81obj-$(CONFIG_CPM2) += cpm2_common.o cpm2_pic.o 78obj-$(CONFIG_CPM2) += cpm2_common.o cpm2_pic.o
82ifeq ($(CONFIG_PPC_GEN550),y) 79ifeq ($(CONFIG_PPC_GEN550),y)
@@ -87,20 +84,18 @@ ifeq ($(CONFIG_SERIAL_MPSC_CONSOLE),y)
87obj-$(CONFIG_SERIAL_TEXT_DEBUG) += mv64x60_dbg.o 84obj-$(CONFIG_SERIAL_TEXT_DEBUG) += mv64x60_dbg.o
88endif 85endif
89obj-$(CONFIG_BOOTX_TEXT) += btext.o 86obj-$(CONFIG_BOOTX_TEXT) += btext.o
90obj-$(CONFIG_MPC10X_BRIDGE) += mpc10x_common.o indirect_pci.o ppc_sys.o 87obj-$(CONFIG_MPC10X_BRIDGE) += mpc10x_common.o ppc_sys.o
91obj-$(CONFIG_MPC10X_OPENPIC) += open_pic.o 88obj-$(CONFIG_MPC10X_OPENPIC) += open_pic.o
92obj-$(CONFIG_40x) += dcr.o
93obj-$(CONFIG_BOOKE) += dcr.o
94obj-$(CONFIG_85xx) += open_pic.o ppc85xx_common.o ppc85xx_setup.o \ 89obj-$(CONFIG_85xx) += open_pic.o ppc85xx_common.o ppc85xx_setup.o \
95 ppc_sys.o i8259.o mpc85xx_sys.o \ 90 ppc_sys.o mpc85xx_sys.o \
96 mpc85xx_devices.o 91 mpc85xx_devices.o
97ifeq ($(CONFIG_85xx),y) 92ifeq ($(CONFIG_85xx),y)
98obj-$(CONFIG_PCI) += indirect_pci.o pci_auto.o 93obj-$(CONFIG_PCI) += pci_auto.o
99endif 94endif
100obj-$(CONFIG_83xx) += ipic.o ppc83xx_setup.o ppc_sys.o \ 95obj-$(CONFIG_83xx) += ipic.o ppc83xx_setup.o ppc_sys.o \
101 mpc83xx_sys.o mpc83xx_devices.o 96 mpc83xx_sys.o mpc83xx_devices.o
102ifeq ($(CONFIG_83xx),y) 97ifeq ($(CONFIG_83xx),y)
103obj-$(CONFIG_PCI) += indirect_pci.o pci_auto.o 98obj-$(CONFIG_PCI) += pci_auto.o
104endif 99endif
105obj-$(CONFIG_MPC8548_CDS) += todc_time.o 100obj-$(CONFIG_MPC8548_CDS) += todc_time.o
106obj-$(CONFIG_MPC8555_CDS) += todc_time.o 101obj-$(CONFIG_MPC8555_CDS) += todc_time.o
diff --git a/arch/ppc/syslib/btext.c b/arch/ppc/syslib/btext.c
index 7734f6836174..12fa83e6774a 100644
--- a/arch/ppc/syslib/btext.c
+++ b/arch/ppc/syslib/btext.c
@@ -53,8 +53,8 @@ extern char *klimit;
53 * chrp only uses it during early boot. 53 * chrp only uses it during early boot.
54 */ 54 */
55#ifdef CONFIG_XMON 55#ifdef CONFIG_XMON
56#define BTEXT __pmac 56#define BTEXT
57#define BTDATA __pmacdata 57#define BTDATA
58#else 58#else
59#define BTEXT __init 59#define BTEXT __init
60#define BTDATA __initdata 60#define BTDATA __initdata
@@ -187,7 +187,7 @@ btext_setup_display(int width, int height, int depth, int pitch,
187 * changes. 187 * changes.
188 */ 188 */
189 189
190void __openfirmware 190void
191map_boot_text(void) 191map_boot_text(void)
192{ 192{
193 unsigned long base, offset, size; 193 unsigned long base, offset, size;
diff --git a/arch/ppc/syslib/gt64260_pic.c b/arch/ppc/syslib/gt64260_pic.c
index 44aa87385451..f97b3a9abd1e 100644
--- a/arch/ppc/syslib/gt64260_pic.c
+++ b/arch/ppc/syslib/gt64260_pic.c
@@ -45,6 +45,7 @@
45#include <asm/system.h> 45#include <asm/system.h>
46#include <asm/irq.h> 46#include <asm/irq.h>
47#include <asm/mv64x60.h> 47#include <asm/mv64x60.h>
48#include <asm/machdep.h>
48 49
49#define CPU_INTR_STR "gt64260 cpu interface error" 50#define CPU_INTR_STR "gt64260 cpu interface error"
50#define PCI0_INTR_STR "gt64260 pci 0 error" 51#define PCI0_INTR_STR "gt64260 pci 0 error"
diff --git a/arch/ppc/syslib/ibm440gx_common.c b/arch/ppc/syslib/ibm440gx_common.c
index 0bb919859b8b..c36db279b43d 100644
--- a/arch/ppc/syslib/ibm440gx_common.c
+++ b/arch/ppc/syslib/ibm440gx_common.c
@@ -236,9 +236,9 @@ void __init ibm440gx_l2c_setup(struct ibm44x_clocks* p)
236 /* Disable L2C on rev.A, rev.B and 800MHz version of rev.C, 236 /* Disable L2C on rev.A, rev.B and 800MHz version of rev.C,
237 enable it on all other revisions 237 enable it on all other revisions
238 */ 238 */
239 if (strcmp(cur_cpu_spec[0]->cpu_name, "440GX Rev. A") == 0 || 239 if (strcmp(cur_cpu_spec->cpu_name, "440GX Rev. A") == 0 ||
240 strcmp(cur_cpu_spec[0]->cpu_name, "440GX Rev. B") == 0 240 strcmp(cur_cpu_spec->cpu_name, "440GX Rev. B") == 0
241 || (strcmp(cur_cpu_spec[0]->cpu_name, "440GX Rev. C") 241 || (strcmp(cur_cpu_spec->cpu_name, "440GX Rev. C")
242 == 0 && p->cpu > 667000000)) 242 == 0 && p->cpu > 667000000))
243 ibm440gx_l2c_disable(); 243 ibm440gx_l2c_disable();
244 else 244 else
diff --git a/arch/ppc/syslib/ibm44x_common.c b/arch/ppc/syslib/ibm44x_common.c
index 7612e0623f99..5152c8e41340 100644
--- a/arch/ppc/syslib/ibm44x_common.c
+++ b/arch/ppc/syslib/ibm44x_common.c
@@ -27,9 +27,14 @@
27#include <asm/time.h> 27#include <asm/time.h>
28#include <asm/ppc4xx_pic.h> 28#include <asm/ppc4xx_pic.h>
29#include <asm/param.h> 29#include <asm/param.h>
30#include <asm/bootinfo.h>
31#include <asm/ppcboot.h>
30 32
31#include <syslib/gen550.h> 33#include <syslib/gen550.h>
32 34
35/* Global Variables */
36bd_t __res;
37
33phys_addr_t fixup_bigphys_addr(phys_addr_t addr, phys_addr_t size) 38phys_addr_t fixup_bigphys_addr(phys_addr_t addr, phys_addr_t size)
34{ 39{
35 phys_addr_t page_4gb = 0; 40 phys_addr_t page_4gb = 0;
@@ -150,8 +155,36 @@ static unsigned long __init ibm44x_find_end_of_memory(void)
150 return mem_size; 155 return mem_size;
151} 156}
152 157
153void __init ibm44x_platform_init(void) 158void __init ibm44x_platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
159 unsigned long r6, unsigned long r7)
154{ 160{
161 parse_bootinfo(find_bootinfo());
162
163 /*
164 * If we were passed in a board information, copy it into the
165 * residual data area.
166 */
167 if (r3)
168 __res = *(bd_t *)(r3 + KERNELBASE);
169
170#if defined(CONFIG_BLK_DEV_INITRD)
171 /*
172 * If the init RAM disk has been configured in, and there's a valid
173 * starting address for it, set it up.
174 */
175 if (r4) {
176 initrd_start = r4 + KERNELBASE;
177 initrd_end = r5 + KERNELBASE;
178 }
179#endif /* CONFIG_BLK_DEV_INITRD */
180
181 /* Copy the kernel command line arguments to a safe place. */
182
183 if (r6) {
184 *(char *) (r7 + KERNELBASE) = 0;
185 strcpy(cmd_line, (char *) (r6 + KERNELBASE));
186 }
187
155 ppc_md.init_IRQ = ppc4xx_pic_init; 188 ppc_md.init_IRQ = ppc4xx_pic_init;
156 ppc_md.find_end_of_memory = ibm44x_find_end_of_memory; 189 ppc_md.find_end_of_memory = ibm44x_find_end_of_memory;
157 ppc_md.restart = ibm44x_restart; 190 ppc_md.restart = ibm44x_restart;
@@ -178,7 +211,7 @@ void __init ibm44x_platform_init(void)
178#endif 211#endif
179} 212}
180 213
181/* Called from MachineCheckException */ 214/* Called from machine_check_exception */
182void platform_machine_check(struct pt_regs *regs) 215void platform_machine_check(struct pt_regs *regs)
183{ 216{
184 printk("PLB0: BEAR=0x%08x%08x ACR= 0x%08x BESR= 0x%08x\n", 217 printk("PLB0: BEAR=0x%08x%08x ACR= 0x%08x BESR= 0x%08x\n",
diff --git a/arch/ppc/syslib/ibm44x_common.h b/arch/ppc/syslib/ibm44x_common.h
index c16b6a5ac6ab..b25a8995e4e9 100644
--- a/arch/ppc/syslib/ibm44x_common.h
+++ b/arch/ppc/syslib/ibm44x_common.h
@@ -36,7 +36,8 @@ struct ibm44x_clocks {
36}; 36};
37 37
38/* common 44x platform init */ 38/* common 44x platform init */
39void ibm44x_platform_init(void) __init; 39void ibm44x_platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
40 unsigned long r6, unsigned long r7) __init;
40 41
41/* initialize decrementer and tick-related variables */ 42/* initialize decrementer and tick-related variables */
42void ibm44x_calibrate_decr(unsigned int freq) __init; 43void ibm44x_calibrate_decr(unsigned int freq) __init;
diff --git a/arch/ppc/syslib/m8260_setup.c b/arch/ppc/syslib/m8260_setup.c
index 8f80a42dfdb7..76a2aa4ce65e 100644
--- a/arch/ppc/syslib/m8260_setup.c
+++ b/arch/ppc/syslib/m8260_setup.c
@@ -62,6 +62,10 @@ m8260_setup_arch(void)
62 if (initrd_start) 62 if (initrd_start)
63 ROOT_DEV = Root_RAM0; 63 ROOT_DEV = Root_RAM0;
64#endif 64#endif
65
66 identify_ppc_sys_by_name_and_id(BOARD_CHIP_NAME,
67 in_be32(CPM_MAP_ADDR + CPM_IMMR_OFFSET));
68
65 m82xx_board_setup(); 69 m82xx_board_setup();
66} 70}
67 71
diff --git a/arch/ppc/syslib/m82xx_pci.c b/arch/ppc/syslib/m82xx_pci.c
index 9db58c587b46..1d1c3956c1ae 100644
--- a/arch/ppc/syslib/m82xx_pci.c
+++ b/arch/ppc/syslib/m82xx_pci.c
@@ -302,11 +302,11 @@ pq2ads_setup_pci(struct pci_controller *hose)
302 302
303void __init pq2_find_bridges(void) 303void __init pq2_find_bridges(void)
304{ 304{
305 extern int pci_assign_all_busses; 305 extern int pci_assign_all_buses;
306 struct pci_controller * hose; 306 struct pci_controller * hose;
307 int host_bridge; 307 int host_bridge;
308 308
309 pci_assign_all_busses = 1; 309 pci_assign_all_buses = 1;
310 310
311 hose = pcibios_alloc_controller(); 311 hose = pcibios_alloc_controller();
312 312
diff --git a/arch/ppc/syslib/m8xx_setup.c b/arch/ppc/syslib/m8xx_setup.c
index 4c888da89b3c..97ffbc70574f 100644
--- a/arch/ppc/syslib/m8xx_setup.c
+++ b/arch/ppc/syslib/m8xx_setup.c
@@ -144,12 +144,12 @@ void __init m8xx_calibrate_decr(void)
144 int freq, fp, divisor; 144 int freq, fp, divisor;
145 145
146 /* Unlock the SCCR. */ 146 /* Unlock the SCCR. */
147 ((volatile immap_t *)IMAP_ADDR)->im_clkrstk.cark_sccrk = ~KAPWR_KEY; 147 out_be32(&((immap_t *)IMAP_ADDR)->im_clkrstk.cark_sccrk, ~KAPWR_KEY);
148 ((volatile immap_t *)IMAP_ADDR)->im_clkrstk.cark_sccrk = KAPWR_KEY; 148 out_be32(&((immap_t *)IMAP_ADDR)->im_clkrstk.cark_sccrk, KAPWR_KEY);
149 149
150 /* Force all 8xx processors to use divide by 16 processor clock. */ 150 /* Force all 8xx processors to use divide by 16 processor clock. */
151 ((volatile immap_t *)IMAP_ADDR)->im_clkrst.car_sccr |= 0x02000000; 151 out_be32(&((immap_t *)IMAP_ADDR)->im_clkrst.car_sccr,
152 152 in_be32(&((immap_t *)IMAP_ADDR)->im_clkrst.car_sccr)|0x02000000);
153 /* Processor frequency is MHz. 153 /* Processor frequency is MHz.
154 * The value 'fp' is the number of decrementer ticks per second. 154 * The value 'fp' is the number of decrementer ticks per second.
155 */ 155 */
@@ -175,28 +175,24 @@ void __init m8xx_calibrate_decr(void)
175 * we guarantee the registers are locked, then we unlock them 175 * we guarantee the registers are locked, then we unlock them
176 * for our use. 176 * for our use.
177 */ 177 */
178 ((volatile immap_t *)IMAP_ADDR)->im_sitk.sitk_tbscrk = ~KAPWR_KEY; 178 out_be32(&((immap_t *)IMAP_ADDR)->im_sitk.sitk_tbscrk, ~KAPWR_KEY);
179 ((volatile immap_t *)IMAP_ADDR)->im_sitk.sitk_rtcsck = ~KAPWR_KEY; 179 out_be32(&((immap_t *)IMAP_ADDR)->im_sitk.sitk_rtcsck, ~KAPWR_KEY);
180 ((volatile immap_t *)IMAP_ADDR)->im_sitk.sitk_tbk = ~KAPWR_KEY; 180 out_be32(&((immap_t *)IMAP_ADDR)->im_sitk.sitk_tbk, ~KAPWR_KEY);
181 ((volatile immap_t *)IMAP_ADDR)->im_sitk.sitk_tbscrk = KAPWR_KEY; 181 out_be32(&((immap_t *)IMAP_ADDR)->im_sitk.sitk_tbscrk, KAPWR_KEY);
182 ((volatile immap_t *)IMAP_ADDR)->im_sitk.sitk_rtcsck = KAPWR_KEY; 182 out_be32(&((immap_t *)IMAP_ADDR)->im_sitk.sitk_rtcsck, KAPWR_KEY);
183 ((volatile immap_t *)IMAP_ADDR)->im_sitk.sitk_tbk = KAPWR_KEY; 183 out_be32(&((immap_t *)IMAP_ADDR)->im_sitk.sitk_tbk, KAPWR_KEY);
184 184
185 /* Disable the RTC one second and alarm interrupts. */ 185 /* Disable the RTC one second and alarm interrupts. */
186 ((volatile immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc &= 186 out_be16(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc, in_be16(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc) & ~(RTCSC_SIE | RTCSC_ALE));
187 ~(RTCSC_SIE | RTCSC_ALE);
188 /* Enable the RTC */ 187 /* Enable the RTC */
189 ((volatile immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc |= 188 out_be16(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc, in_be16(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc) | (RTCSC_RTF | RTCSC_RTE));
190 (RTCSC_RTF | RTCSC_RTE);
191 189
192 /* Enabling the decrementer also enables the timebase interrupts 190 /* Enabling the decrementer also enables the timebase interrupts
193 * (or from the other point of view, to get decrementer interrupts 191 * (or from the other point of view, to get decrementer interrupts
194 * we have to enable the timebase). The decrementer interrupt 192 * we have to enable the timebase). The decrementer interrupt
195 * is wired into the vector table, nothing to do here for that. 193 * is wired into the vector table, nothing to do here for that.
196 */ 194 */
197 ((volatile immap_t *)IMAP_ADDR)->im_sit.sit_tbscr = 195 out_be16(&((immap_t *)IMAP_ADDR)->im_sit.sit_tbscr, (mk_int_int_mask(DEC_INTERRUPT) << 8) | (TBSCR_TBF | TBSCR_TBE));
198 ((mk_int_int_mask(DEC_INTERRUPT) << 8) |
199 (TBSCR_TBF | TBSCR_TBE));
200 196
201 if (setup_irq(DEC_INTERRUPT, &tbint_irqaction)) 197 if (setup_irq(DEC_INTERRUPT, &tbint_irqaction))
202 panic("Could not allocate timer IRQ!"); 198 panic("Could not allocate timer IRQ!");
@@ -216,9 +212,9 @@ void __init m8xx_calibrate_decr(void)
216static int 212static int
217m8xx_set_rtc_time(unsigned long time) 213m8xx_set_rtc_time(unsigned long time)
218{ 214{
219 ((volatile immap_t *)IMAP_ADDR)->im_sitk.sitk_rtck = KAPWR_KEY; 215 out_be32(&((immap_t *)IMAP_ADDR)->im_sitk.sitk_rtck, KAPWR_KEY);
220 ((volatile immap_t *)IMAP_ADDR)->im_sit.sit_rtc = time; 216 out_be32(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtc, time);
221 ((volatile immap_t *)IMAP_ADDR)->im_sitk.sitk_rtck = ~KAPWR_KEY; 217 out_be32(&((immap_t *)IMAP_ADDR)->im_sitk.sitk_rtck, ~KAPWR_KEY);
222 return(0); 218 return(0);
223} 219}
224 220
@@ -226,7 +222,7 @@ static unsigned long
226m8xx_get_rtc_time(void) 222m8xx_get_rtc_time(void)
227{ 223{
228 /* Get time from the RTC. */ 224 /* Get time from the RTC. */
229 return((unsigned long)(((immap_t *)IMAP_ADDR)->im_sit.sit_rtc)); 225 return (unsigned long) in_be32(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtc);
230} 226}
231 227
232static void 228static void
@@ -235,13 +231,13 @@ m8xx_restart(char *cmd)
235 __volatile__ unsigned char dummy; 231 __volatile__ unsigned char dummy;
236 232
237 local_irq_disable(); 233 local_irq_disable();
238 ((immap_t *)IMAP_ADDR)->im_clkrst.car_plprcr |= 0x00000080; 234 out_be32(&((immap_t *)IMAP_ADDR)->im_clkrst.car_plprcr, in_be32(&((immap_t *)IMAP_ADDR)->im_clkrst.car_plprcr) | 0x00000080);
239 235
240 /* Clear the ME bit in MSR to cause checkstop on machine check 236 /* Clear the ME bit in MSR to cause checkstop on machine check
241 */ 237 */
242 mtmsr(mfmsr() & ~0x1000); 238 mtmsr(mfmsr() & ~0x1000);
243 239
244 dummy = ((immap_t *)IMAP_ADDR)->im_clkrst.res[0]; 240 dummy = in_8(&((immap_t *)IMAP_ADDR)->im_clkrst.res[0]);
245 printk("Restart failed\n"); 241 printk("Restart failed\n");
246 while(1); 242 while(1);
247} 243}
@@ -306,8 +302,7 @@ m8xx_init_IRQ(void)
306 i8259_init(0); 302 i8259_init(0);
307 303
308 /* The i8259 cascade interrupt must be level sensitive. */ 304 /* The i8259 cascade interrupt must be level sensitive. */
309 ((immap_t *)IMAP_ADDR)->im_siu_conf.sc_siel &= 305 out_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_siel, in_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_siel & ~(0x80000000 >> ISA_BRIDGE_INT)));
310 ~(0x80000000 >> ISA_BRIDGE_INT);
311 306
312 if (setup_irq(ISA_BRIDGE_INT, &mbx_i8259_irqaction)) 307 if (setup_irq(ISA_BRIDGE_INT, &mbx_i8259_irqaction))
313 enable_irq(ISA_BRIDGE_INT); 308 enable_irq(ISA_BRIDGE_INT);
@@ -404,9 +399,10 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
404 strcpy(cmd_line, (char *)(r6+KERNELBASE)); 399 strcpy(cmd_line, (char *)(r6+KERNELBASE));
405 } 400 }
406 401
402 identify_ppc_sys_by_name(BOARD_CHIP_NAME);
403
407 ppc_md.setup_arch = m8xx_setup_arch; 404 ppc_md.setup_arch = m8xx_setup_arch;
408 ppc_md.show_percpuinfo = m8xx_show_percpuinfo; 405 ppc_md.show_percpuinfo = m8xx_show_percpuinfo;
409 ppc_md.irq_canonicalize = NULL;
410 ppc_md.init_IRQ = m8xx_init_IRQ; 406 ppc_md.init_IRQ = m8xx_init_IRQ;
411 ppc_md.get_irq = m8xx_get_irq; 407 ppc_md.get_irq = m8xx_get_irq;
412 ppc_md.init = NULL; 408 ppc_md.init = NULL;
diff --git a/arch/ppc/syslib/m8xx_wdt.c b/arch/ppc/syslib/m8xx_wdt.c
index 2ddc857e7fc7..c5ac5ce5d7d2 100644
--- a/arch/ppc/syslib/m8xx_wdt.c
+++ b/arch/ppc/syslib/m8xx_wdt.c
@@ -29,8 +29,8 @@ void m8xx_wdt_reset(void)
29{ 29{
30 volatile immap_t *imap = (volatile immap_t *)IMAP_ADDR; 30 volatile immap_t *imap = (volatile immap_t *)IMAP_ADDR;
31 31
32 imap->im_siu_conf.sc_swsr = 0x556c; /* write magic1 */ 32 out_be16(imap->im_siu_conf.sc_swsr, 0x556c); /* write magic1 */
33 imap->im_siu_conf.sc_swsr = 0xaa39; /* write magic2 */ 33 out_be16(imap->im_siu_conf.sc_swsr, 0xaa39); /* write magic2 */
34} 34}
35 35
36static irqreturn_t m8xx_wdt_interrupt(int irq, void *dev, struct pt_regs *regs) 36static irqreturn_t m8xx_wdt_interrupt(int irq, void *dev, struct pt_regs *regs)
@@ -39,7 +39,7 @@ static irqreturn_t m8xx_wdt_interrupt(int irq, void *dev, struct pt_regs *regs)
39 39
40 m8xx_wdt_reset(); 40 m8xx_wdt_reset();
41 41
42 imap->im_sit.sit_piscr |= PISCR_PS; /* clear irq */ 42 out_be16(imap->im_sit.sit_piscr, in_be16(imap->im_sit.sit_piscr | PISCR_PS)); /* clear irq */
43 43
44 return IRQ_HANDLED; 44 return IRQ_HANDLED;
45} 45}
@@ -51,7 +51,7 @@ void __init m8xx_wdt_handler_install(bd_t * binfo)
51 u32 sypcr; 51 u32 sypcr;
52 u32 pitrtclk; 52 u32 pitrtclk;
53 53
54 sypcr = imap->im_siu_conf.sc_sypcr; 54 sypcr = in_be32(imap->im_siu_conf.sc_sypcr);
55 55
56 if (!(sypcr & 0x04)) { 56 if (!(sypcr & 0x04)) {
57 printk(KERN_NOTICE "m8xx_wdt: wdt disabled (SYPCR: 0x%08X)\n", 57 printk(KERN_NOTICE "m8xx_wdt: wdt disabled (SYPCR: 0x%08X)\n",
@@ -87,9 +87,9 @@ void __init m8xx_wdt_handler_install(bd_t * binfo)
87 else 87 else
88 pitc = pitrtclk * wdt_timeout / binfo->bi_intfreq / 2; 88 pitc = pitrtclk * wdt_timeout / binfo->bi_intfreq / 2;
89 89
90 imap->im_sit.sit_pitc = pitc << 16; 90 out_be32(imap->im_sit.sit_pitc, pitc << 16);
91 imap->im_sit.sit_piscr = 91
92 (mk_int_int_mask(PIT_INTERRUPT) << 8) | PISCR_PIE | PISCR_PTE; 92 out_be16(imap->im_sit.sit_piscr, (mk_int_int_mask(PIT_INTERRUPT) << 8) | PISCR_PIE | PISCR_PTE);
93 93
94 if (setup_irq(PIT_INTERRUPT, &m8xx_wdt_irqaction)) 94 if (setup_irq(PIT_INTERRUPT, &m8xx_wdt_irqaction))
95 panic("m8xx_wdt: error setting up the watchdog irq!"); 95 panic("m8xx_wdt: error setting up the watchdog irq!");
diff --git a/arch/ppc/syslib/mpc52xx_pci.c b/arch/ppc/syslib/mpc52xx_pci.c
index 59cf3e8bd1a0..4ac19080eb85 100644
--- a/arch/ppc/syslib/mpc52xx_pci.c
+++ b/arch/ppc/syslib/mpc52xx_pci.c
@@ -21,6 +21,7 @@
21#include "mpc52xx_pci.h" 21#include "mpc52xx_pci.h"
22 22
23#include <asm/delay.h> 23#include <asm/delay.h>
24#include <asm/machdep.h>
24 25
25 26
26static int 27static int
@@ -181,7 +182,7 @@ mpc52xx_find_bridges(void)
181 struct mpc52xx_pci __iomem *pci_regs; 182 struct mpc52xx_pci __iomem *pci_regs;
182 struct pci_controller *hose; 183 struct pci_controller *hose;
183 184
184 pci_assign_all_busses = 1; 185 pci_assign_all_buses = 1;
185 186
186 pci_regs = ioremap(MPC52xx_PA(MPC52xx_PCI_OFFSET), MPC52xx_PCI_SIZE); 187 pci_regs = ioremap(MPC52xx_PA(MPC52xx_PCI_OFFSET), MPC52xx_PCI_SIZE);
187 if (!pci_regs) 188 if (!pci_regs)
diff --git a/arch/ppc/syslib/mpc83xx_devices.c b/arch/ppc/syslib/mpc83xx_devices.c
index 95b3b8a7f0ba..dbf8acac507f 100644
--- a/arch/ppc/syslib/mpc83xx_devices.c
+++ b/arch/ppc/syslib/mpc83xx_devices.c
@@ -21,6 +21,7 @@
21#include <asm/mpc83xx.h> 21#include <asm/mpc83xx.h>
22#include <asm/irq.h> 22#include <asm/irq.h>
23#include <asm/ppc_sys.h> 23#include <asm/ppc_sys.h>
24#include <asm/machdep.h>
24 25
25/* We use offsets for IORESOURCE_MEM since we do not know at compile time 26/* We use offsets for IORESOURCE_MEM since we do not know at compile time
26 * what IMMRBAR is, will get fixed up by mach_mpc83xx_fixup 27 * what IMMRBAR is, will get fixed up by mach_mpc83xx_fixup
diff --git a/arch/ppc/syslib/mpc85xx_devices.c b/arch/ppc/syslib/mpc85xx_devices.c
index bbc5ac0de878..2ede677a0a53 100644
--- a/arch/ppc/syslib/mpc85xx_devices.c
+++ b/arch/ppc/syslib/mpc85xx_devices.c
@@ -25,19 +25,20 @@
25/* We use offsets for IORESOURCE_MEM since we do not know at compile time 25/* We use offsets for IORESOURCE_MEM since we do not know at compile time
26 * what CCSRBAR is, will get fixed up by mach_mpc85xx_fixup 26 * what CCSRBAR is, will get fixed up by mach_mpc85xx_fixup
27 */ 27 */
28struct gianfar_mdio_data mpc85xx_mdio_pdata = {
29 .paddr = MPC85xx_MIIM_OFFSET,
30};
28 31
29static struct gianfar_platform_data mpc85xx_tsec1_pdata = { 32static struct gianfar_platform_data mpc85xx_tsec1_pdata = {
30 .device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT | 33 .device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT |
31 FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON | 34 FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON |
32 FSL_GIANFAR_DEV_HAS_MULTI_INTR, 35 FSL_GIANFAR_DEV_HAS_MULTI_INTR,
33 .phy_reg_addr = MPC85xx_ENET1_OFFSET,
34}; 36};
35 37
36static struct gianfar_platform_data mpc85xx_tsec2_pdata = { 38static struct gianfar_platform_data mpc85xx_tsec2_pdata = {
37 .device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT | 39 .device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT |
38 FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON | 40 FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON |
39 FSL_GIANFAR_DEV_HAS_MULTI_INTR, 41 FSL_GIANFAR_DEV_HAS_MULTI_INTR,
40 .phy_reg_addr = MPC85xx_ENET1_OFFSET,
41}; 42};
42 43
43static struct gianfar_platform_data mpc85xx_etsec1_pdata = { 44static struct gianfar_platform_data mpc85xx_etsec1_pdata = {
@@ -46,7 +47,6 @@ static struct gianfar_platform_data mpc85xx_etsec1_pdata = {
46 FSL_GIANFAR_DEV_HAS_MULTI_INTR | 47 FSL_GIANFAR_DEV_HAS_MULTI_INTR |
47 FSL_GIANFAR_DEV_HAS_CSUM | FSL_GIANFAR_DEV_HAS_VLAN | 48 FSL_GIANFAR_DEV_HAS_CSUM | FSL_GIANFAR_DEV_HAS_VLAN |
48 FSL_GIANFAR_DEV_HAS_EXTENDED_HASH, 49 FSL_GIANFAR_DEV_HAS_EXTENDED_HASH,
49 .phy_reg_addr = MPC85xx_ENET1_OFFSET,
50}; 50};
51 51
52static struct gianfar_platform_data mpc85xx_etsec2_pdata = { 52static struct gianfar_platform_data mpc85xx_etsec2_pdata = {
@@ -55,7 +55,6 @@ static struct gianfar_platform_data mpc85xx_etsec2_pdata = {
55 FSL_GIANFAR_DEV_HAS_MULTI_INTR | 55 FSL_GIANFAR_DEV_HAS_MULTI_INTR |
56 FSL_GIANFAR_DEV_HAS_CSUM | FSL_GIANFAR_DEV_HAS_VLAN | 56 FSL_GIANFAR_DEV_HAS_CSUM | FSL_GIANFAR_DEV_HAS_VLAN |
57 FSL_GIANFAR_DEV_HAS_EXTENDED_HASH, 57 FSL_GIANFAR_DEV_HAS_EXTENDED_HASH,
58 .phy_reg_addr = MPC85xx_ENET1_OFFSET,
59}; 58};
60 59
61static struct gianfar_platform_data mpc85xx_etsec3_pdata = { 60static struct gianfar_platform_data mpc85xx_etsec3_pdata = {
@@ -64,7 +63,6 @@ static struct gianfar_platform_data mpc85xx_etsec3_pdata = {
64 FSL_GIANFAR_DEV_HAS_MULTI_INTR | 63 FSL_GIANFAR_DEV_HAS_MULTI_INTR |
65 FSL_GIANFAR_DEV_HAS_CSUM | FSL_GIANFAR_DEV_HAS_VLAN | 64 FSL_GIANFAR_DEV_HAS_CSUM | FSL_GIANFAR_DEV_HAS_VLAN |
66 FSL_GIANFAR_DEV_HAS_EXTENDED_HASH, 65 FSL_GIANFAR_DEV_HAS_EXTENDED_HASH,
67 .phy_reg_addr = MPC85xx_ENET1_OFFSET,
68}; 66};
69 67
70static struct gianfar_platform_data mpc85xx_etsec4_pdata = { 68static struct gianfar_platform_data mpc85xx_etsec4_pdata = {
@@ -73,11 +71,10 @@ static struct gianfar_platform_data mpc85xx_etsec4_pdata = {
73 FSL_GIANFAR_DEV_HAS_MULTI_INTR | 71 FSL_GIANFAR_DEV_HAS_MULTI_INTR |
74 FSL_GIANFAR_DEV_HAS_CSUM | FSL_GIANFAR_DEV_HAS_VLAN | 72 FSL_GIANFAR_DEV_HAS_CSUM | FSL_GIANFAR_DEV_HAS_VLAN |
75 FSL_GIANFAR_DEV_HAS_EXTENDED_HASH, 73 FSL_GIANFAR_DEV_HAS_EXTENDED_HASH,
76 .phy_reg_addr = MPC85xx_ENET1_OFFSET,
77}; 74};
78 75
79static struct gianfar_platform_data mpc85xx_fec_pdata = { 76static struct gianfar_platform_data mpc85xx_fec_pdata = {
80 .phy_reg_addr = MPC85xx_ENET1_OFFSET, 77 .device_flags = 0,
81}; 78};
82 79
83static struct fsl_i2c_platform_data mpc85xx_fsl_i2c_pdata = { 80static struct fsl_i2c_platform_data mpc85xx_fsl_i2c_pdata = {
@@ -719,6 +716,12 @@ struct platform_device ppc_sys_platform_devices[] = {
719 }, 716 },
720 }, 717 },
721 }, 718 },
719 [MPC85xx_MDIO] = {
720 .name = "fsl-gianfar_mdio",
721 .id = 0,
722 .dev.platform_data = &mpc85xx_mdio_pdata,
723 .num_resources = 0,
724 },
722}; 725};
723 726
724static int __init mach_mpc85xx_fixup(struct platform_device *pdev) 727static int __init mach_mpc85xx_fixup(struct platform_device *pdev)
diff --git a/arch/ppc/syslib/mpc85xx_sys.c b/arch/ppc/syslib/mpc85xx_sys.c
index 6e3184ab354f..cb68d8c58348 100644
--- a/arch/ppc/syslib/mpc85xx_sys.c
+++ b/arch/ppc/syslib/mpc85xx_sys.c
@@ -24,19 +24,19 @@ struct ppc_sys_spec ppc_sys_specs[] = {
24 .ppc_sys_name = "8540", 24 .ppc_sys_name = "8540",
25 .mask = 0xFFFF0000, 25 .mask = 0xFFFF0000,
26 .value = 0x80300000, 26 .value = 0x80300000,
27 .num_devices = 10, 27 .num_devices = 11,
28 .device_list = (enum ppc_sys_devices[]) 28 .device_list = (enum ppc_sys_devices[])
29 { 29 {
30 MPC85xx_TSEC1, MPC85xx_TSEC2, MPC85xx_FEC, MPC85xx_IIC1, 30 MPC85xx_TSEC1, MPC85xx_TSEC2, MPC85xx_FEC, MPC85xx_IIC1,
31 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3, 31 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
32 MPC85xx_PERFMON, MPC85xx_DUART, 32 MPC85xx_PERFMON, MPC85xx_DUART, MPC85xx_MDIO,
33 }, 33 },
34 }, 34 },
35 { 35 {
36 .ppc_sys_name = "8560", 36 .ppc_sys_name = "8560",
37 .mask = 0xFFFF0000, 37 .mask = 0xFFFF0000,
38 .value = 0x80700000, 38 .value = 0x80700000,
39 .num_devices = 19, 39 .num_devices = 20,
40 .device_list = (enum ppc_sys_devices[]) 40 .device_list = (enum ppc_sys_devices[])
41 { 41 {
42 MPC85xx_TSEC1, MPC85xx_TSEC2, MPC85xx_IIC1, 42 MPC85xx_TSEC1, MPC85xx_TSEC2, MPC85xx_IIC1,
@@ -45,14 +45,14 @@ struct ppc_sys_spec ppc_sys_specs[] = {
45 MPC85xx_CPM_SPI, MPC85xx_CPM_I2C, MPC85xx_CPM_SCC1, 45 MPC85xx_CPM_SPI, MPC85xx_CPM_I2C, MPC85xx_CPM_SCC1,
46 MPC85xx_CPM_SCC2, MPC85xx_CPM_SCC3, MPC85xx_CPM_SCC4, 46 MPC85xx_CPM_SCC2, MPC85xx_CPM_SCC3, MPC85xx_CPM_SCC4,
47 MPC85xx_CPM_FCC1, MPC85xx_CPM_FCC2, MPC85xx_CPM_FCC3, 47 MPC85xx_CPM_FCC1, MPC85xx_CPM_FCC2, MPC85xx_CPM_FCC3,
48 MPC85xx_CPM_MCC1, MPC85xx_CPM_MCC2, 48 MPC85xx_CPM_MCC1, MPC85xx_CPM_MCC2, MPC85xx_MDIO,
49 }, 49 },
50 }, 50 },
51 { 51 {
52 .ppc_sys_name = "8541", 52 .ppc_sys_name = "8541",
53 .mask = 0xFFFF0000, 53 .mask = 0xFFFF0000,
54 .value = 0x80720000, 54 .value = 0x80720000,
55 .num_devices = 13, 55 .num_devices = 14,
56 .device_list = (enum ppc_sys_devices[]) 56 .device_list = (enum ppc_sys_devices[])
57 { 57 {
58 MPC85xx_TSEC1, MPC85xx_TSEC2, MPC85xx_IIC1, 58 MPC85xx_TSEC1, MPC85xx_TSEC2, MPC85xx_IIC1,
@@ -60,13 +60,14 @@ struct ppc_sys_spec ppc_sys_specs[] = {
60 MPC85xx_PERFMON, MPC85xx_DUART, 60 MPC85xx_PERFMON, MPC85xx_DUART,
61 MPC85xx_CPM_SPI, MPC85xx_CPM_I2C, 61 MPC85xx_CPM_SPI, MPC85xx_CPM_I2C,
62 MPC85xx_CPM_FCC1, MPC85xx_CPM_FCC2, 62 MPC85xx_CPM_FCC1, MPC85xx_CPM_FCC2,
63 MPC85xx_MDIO,
63 }, 64 },
64 }, 65 },
65 { 66 {
66 .ppc_sys_name = "8541E", 67 .ppc_sys_name = "8541E",
67 .mask = 0xFFFF0000, 68 .mask = 0xFFFF0000,
68 .value = 0x807A0000, 69 .value = 0x807A0000,
69 .num_devices = 14, 70 .num_devices = 15,
70 .device_list = (enum ppc_sys_devices[]) 71 .device_list = (enum ppc_sys_devices[])
71 { 72 {
72 MPC85xx_TSEC1, MPC85xx_TSEC2, MPC85xx_IIC1, 73 MPC85xx_TSEC1, MPC85xx_TSEC2, MPC85xx_IIC1,
@@ -74,13 +75,14 @@ struct ppc_sys_spec ppc_sys_specs[] = {
74 MPC85xx_PERFMON, MPC85xx_DUART, MPC85xx_SEC2, 75 MPC85xx_PERFMON, MPC85xx_DUART, MPC85xx_SEC2,
75 MPC85xx_CPM_SPI, MPC85xx_CPM_I2C, 76 MPC85xx_CPM_SPI, MPC85xx_CPM_I2C,
76 MPC85xx_CPM_FCC1, MPC85xx_CPM_FCC2, 77 MPC85xx_CPM_FCC1, MPC85xx_CPM_FCC2,
78 MPC85xx_MDIO,
77 }, 79 },
78 }, 80 },
79 { 81 {
80 .ppc_sys_name = "8555", 82 .ppc_sys_name = "8555",
81 .mask = 0xFFFF0000, 83 .mask = 0xFFFF0000,
82 .value = 0x80710000, 84 .value = 0x80710000,
83 .num_devices = 19, 85 .num_devices = 20,
84 .device_list = (enum ppc_sys_devices[]) 86 .device_list = (enum ppc_sys_devices[])
85 { 87 {
86 MPC85xx_TSEC1, MPC85xx_TSEC2, MPC85xx_IIC1, 88 MPC85xx_TSEC1, MPC85xx_TSEC2, MPC85xx_IIC1,
@@ -91,13 +93,14 @@ struct ppc_sys_spec ppc_sys_specs[] = {
91 MPC85xx_CPM_FCC1, MPC85xx_CPM_FCC2, 93 MPC85xx_CPM_FCC1, MPC85xx_CPM_FCC2,
92 MPC85xx_CPM_SMC1, MPC85xx_CPM_SMC2, 94 MPC85xx_CPM_SMC1, MPC85xx_CPM_SMC2,
93 MPC85xx_CPM_USB, 95 MPC85xx_CPM_USB,
96 MPC85xx_MDIO,
94 }, 97 },
95 }, 98 },
96 { 99 {
97 .ppc_sys_name = "8555E", 100 .ppc_sys_name = "8555E",
98 .mask = 0xFFFF0000, 101 .mask = 0xFFFF0000,
99 .value = 0x80790000, 102 .value = 0x80790000,
100 .num_devices = 20, 103 .num_devices = 21,
101 .device_list = (enum ppc_sys_devices[]) 104 .device_list = (enum ppc_sys_devices[])
102 { 105 {
103 MPC85xx_TSEC1, MPC85xx_TSEC2, MPC85xx_IIC1, 106 MPC85xx_TSEC1, MPC85xx_TSEC2, MPC85xx_IIC1,
@@ -108,6 +111,7 @@ struct ppc_sys_spec ppc_sys_specs[] = {
108 MPC85xx_CPM_FCC1, MPC85xx_CPM_FCC2, 111 MPC85xx_CPM_FCC1, MPC85xx_CPM_FCC2,
109 MPC85xx_CPM_SMC1, MPC85xx_CPM_SMC2, 112 MPC85xx_CPM_SMC1, MPC85xx_CPM_SMC2,
110 MPC85xx_CPM_USB, 113 MPC85xx_CPM_USB,
114 MPC85xx_MDIO,
111 }, 115 },
112 }, 116 },
113 /* SVRs on 8548 rev1.0 matches for 8548/8547/8545 */ 117 /* SVRs on 8548 rev1.0 matches for 8548/8547/8545 */
@@ -115,104 +119,112 @@ struct ppc_sys_spec ppc_sys_specs[] = {
115 .ppc_sys_name = "8548E", 119 .ppc_sys_name = "8548E",
116 .mask = 0xFFFF00F0, 120 .mask = 0xFFFF00F0,
117 .value = 0x80390010, 121 .value = 0x80390010,
118 .num_devices = 13, 122 .num_devices = 14,
119 .device_list = (enum ppc_sys_devices[]) 123 .device_list = (enum ppc_sys_devices[])
120 { 124 {
121 MPC85xx_eTSEC1, MPC85xx_eTSEC2, MPC85xx_eTSEC3, 125 MPC85xx_eTSEC1, MPC85xx_eTSEC2, MPC85xx_eTSEC3,
122 MPC85xx_eTSEC4, MPC85xx_IIC1, MPC85xx_IIC2, 126 MPC85xx_eTSEC4, MPC85xx_IIC1, MPC85xx_IIC2,
123 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3, 127 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
124 MPC85xx_PERFMON, MPC85xx_DUART, MPC85xx_SEC2, 128 MPC85xx_PERFMON, MPC85xx_DUART, MPC85xx_SEC2,
129 MPC85xx_MDIO,
125 }, 130 },
126 }, 131 },
127 { 132 {
128 .ppc_sys_name = "8548", 133 .ppc_sys_name = "8548",
129 .mask = 0xFFFF00F0, 134 .mask = 0xFFFF00F0,
130 .value = 0x80310010, 135 .value = 0x80310010,
131 .num_devices = 12, 136 .num_devices = 13,
132 .device_list = (enum ppc_sys_devices[]) 137 .device_list = (enum ppc_sys_devices[])
133 { 138 {
134 MPC85xx_eTSEC1, MPC85xx_eTSEC2, MPC85xx_eTSEC3, 139 MPC85xx_eTSEC1, MPC85xx_eTSEC2, MPC85xx_eTSEC3,
135 MPC85xx_eTSEC4, MPC85xx_IIC1, MPC85xx_IIC2, 140 MPC85xx_eTSEC4, MPC85xx_IIC1, MPC85xx_IIC2,
136 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3, 141 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
137 MPC85xx_PERFMON, MPC85xx_DUART, 142 MPC85xx_PERFMON, MPC85xx_DUART,
143 MPC85xx_MDIO,
138 }, 144 },
139 }, 145 },
140 { 146 {
141 .ppc_sys_name = "8547E", 147 .ppc_sys_name = "8547E",
142 .mask = 0xFFFF00F0, 148 .mask = 0xFFFF00F0,
143 .value = 0x80390010, 149 .value = 0x80390010,
144 .num_devices = 13, 150 .num_devices = 14,
145 .device_list = (enum ppc_sys_devices[]) 151 .device_list = (enum ppc_sys_devices[])
146 { 152 {
147 MPC85xx_eTSEC1, MPC85xx_eTSEC2, MPC85xx_eTSEC3, 153 MPC85xx_eTSEC1, MPC85xx_eTSEC2, MPC85xx_eTSEC3,
148 MPC85xx_eTSEC4, MPC85xx_IIC1, MPC85xx_IIC2, 154 MPC85xx_eTSEC4, MPC85xx_IIC1, MPC85xx_IIC2,
149 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3, 155 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
150 MPC85xx_PERFMON, MPC85xx_DUART, MPC85xx_SEC2, 156 MPC85xx_PERFMON, MPC85xx_DUART, MPC85xx_SEC2,
157 MPC85xx_MDIO,
151 }, 158 },
152 }, 159 },
153 { 160 {
154 .ppc_sys_name = "8547", 161 .ppc_sys_name = "8547",
155 .mask = 0xFFFF00F0, 162 .mask = 0xFFFF00F0,
156 .value = 0x80310010, 163 .value = 0x80310010,
157 .num_devices = 12, 164 .num_devices = 13,
158 .device_list = (enum ppc_sys_devices[]) 165 .device_list = (enum ppc_sys_devices[])
159 { 166 {
160 MPC85xx_eTSEC1, MPC85xx_eTSEC2, MPC85xx_eTSEC3, 167 MPC85xx_eTSEC1, MPC85xx_eTSEC2, MPC85xx_eTSEC3,
161 MPC85xx_eTSEC4, MPC85xx_IIC1, MPC85xx_IIC2, 168 MPC85xx_eTSEC4, MPC85xx_IIC1, MPC85xx_IIC2,
162 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3, 169 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
163 MPC85xx_PERFMON, MPC85xx_DUART, 170 MPC85xx_PERFMON, MPC85xx_DUART,
171 MPC85xx_MDIO,
164 }, 172 },
165 }, 173 },
166 { 174 {
167 .ppc_sys_name = "8545E", 175 .ppc_sys_name = "8545E",
168 .mask = 0xFFFF00F0, 176 .mask = 0xFFFF00F0,
169 .value = 0x80390010, 177 .value = 0x80390010,
170 .num_devices = 11, 178 .num_devices = 12,
171 .device_list = (enum ppc_sys_devices[]) 179 .device_list = (enum ppc_sys_devices[])
172 { 180 {
173 MPC85xx_eTSEC1, MPC85xx_eTSEC2, 181 MPC85xx_eTSEC1, MPC85xx_eTSEC2,
174 MPC85xx_IIC1, MPC85xx_IIC2, 182 MPC85xx_IIC1, MPC85xx_IIC2,
175 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3, 183 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
176 MPC85xx_PERFMON, MPC85xx_DUART, MPC85xx_SEC2, 184 MPC85xx_PERFMON, MPC85xx_DUART, MPC85xx_SEC2,
185 MPC85xx_MDIO,
177 }, 186 },
178 }, 187 },
179 { 188 {
180 .ppc_sys_name = "8545", 189 .ppc_sys_name = "8545",
181 .mask = 0xFFFF00F0, 190 .mask = 0xFFFF00F0,
182 .value = 0x80310010, 191 .value = 0x80310010,
183 .num_devices = 10, 192 .num_devices = 11,
184 .device_list = (enum ppc_sys_devices[]) 193 .device_list = (enum ppc_sys_devices[])
185 { 194 {
186 MPC85xx_eTSEC1, MPC85xx_eTSEC2, 195 MPC85xx_eTSEC1, MPC85xx_eTSEC2,
187 MPC85xx_IIC1, MPC85xx_IIC2, 196 MPC85xx_IIC1, MPC85xx_IIC2,
188 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3, 197 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
189 MPC85xx_PERFMON, MPC85xx_DUART, 198 MPC85xx_PERFMON, MPC85xx_DUART,
199 MPC85xx_MDIO,
190 }, 200 },
191 }, 201 },
192 { 202 {
193 .ppc_sys_name = "8543E", 203 .ppc_sys_name = "8543E",
194 .mask = 0xFFFF00F0, 204 .mask = 0xFFFF00F0,
195 .value = 0x803A0010, 205 .value = 0x803A0010,
196 .num_devices = 11, 206 .num_devices = 12,
197 .device_list = (enum ppc_sys_devices[]) 207 .device_list = (enum ppc_sys_devices[])
198 { 208 {
199 MPC85xx_eTSEC1, MPC85xx_eTSEC2, 209 MPC85xx_eTSEC1, MPC85xx_eTSEC2,
200 MPC85xx_IIC1, MPC85xx_IIC2, 210 MPC85xx_IIC1, MPC85xx_IIC2,
201 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3, 211 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
202 MPC85xx_PERFMON, MPC85xx_DUART, MPC85xx_SEC2, 212 MPC85xx_PERFMON, MPC85xx_DUART, MPC85xx_SEC2,
213 MPC85xx_MDIO,
203 }, 214 },
204 }, 215 },
205 { 216 {
206 .ppc_sys_name = "8543", 217 .ppc_sys_name = "8543",
207 .mask = 0xFFFF00F0, 218 .mask = 0xFFFF00F0,
208 .value = 0x80320010, 219 .value = 0x80320010,
209 .num_devices = 10, 220 .num_devices = 11,
210 .device_list = (enum ppc_sys_devices[]) 221 .device_list = (enum ppc_sys_devices[])
211 { 222 {
212 MPC85xx_eTSEC1, MPC85xx_eTSEC2, 223 MPC85xx_eTSEC1, MPC85xx_eTSEC2,
213 MPC85xx_IIC1, MPC85xx_IIC2, 224 MPC85xx_IIC1, MPC85xx_IIC2,
214 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3, 225 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
215 MPC85xx_PERFMON, MPC85xx_DUART, 226 MPC85xx_PERFMON, MPC85xx_DUART,
227 MPC85xx_MDIO,
216 }, 228 },
217 }, 229 },
218 { /* default match */ 230 { /* default match */
diff --git a/arch/ppc/syslib/mpc8xx_sys.c b/arch/ppc/syslib/mpc8xx_sys.c
index a532ccc861c0..3cc27d29e3af 100644
--- a/arch/ppc/syslib/mpc8xx_sys.c
+++ b/arch/ppc/syslib/mpc8xx_sys.c
@@ -24,7 +24,7 @@ struct ppc_sys_spec ppc_sys_specs[] = {
24 .ppc_sys_name = "MPC86X", 24 .ppc_sys_name = "MPC86X",
25 .mask = 0xFFFFFFFF, 25 .mask = 0xFFFFFFFF,
26 .value = 0x00000000, 26 .value = 0x00000000,
27 .num_devices = 2, 27 .num_devices = 7,
28 .device_list = (enum ppc_sys_devices[]) 28 .device_list = (enum ppc_sys_devices[])
29 { 29 {
30 MPC8xx_CPM_FEC1, 30 MPC8xx_CPM_FEC1,
@@ -40,7 +40,7 @@ struct ppc_sys_spec ppc_sys_specs[] = {
40 .ppc_sys_name = "MPC885", 40 .ppc_sys_name = "MPC885",
41 .mask = 0xFFFFFFFF, 41 .mask = 0xFFFFFFFF,
42 .value = 0x00000000, 42 .value = 0x00000000,
43 .num_devices = 3, 43 .num_devices = 8,
44 .device_list = (enum ppc_sys_devices[]) 44 .device_list = (enum ppc_sys_devices[])
45 { 45 {
46 MPC8xx_CPM_FEC1, 46 MPC8xx_CPM_FEC1,
diff --git a/arch/ppc/syslib/mv64360_pic.c b/arch/ppc/syslib/mv64360_pic.c
index 8356da4678a2..58b0aa813e85 100644
--- a/arch/ppc/syslib/mv64360_pic.c
+++ b/arch/ppc/syslib/mv64360_pic.c
@@ -48,6 +48,7 @@
48#include <asm/system.h> 48#include <asm/system.h>
49#include <asm/irq.h> 49#include <asm/irq.h>
50#include <asm/mv64x60.h> 50#include <asm/mv64x60.h>
51#include <asm/machdep.h>
51 52
52#ifdef CONFIG_IRQ_ALL_CPUS 53#ifdef CONFIG_IRQ_ALL_CPUS
53#error "The mv64360 does not support distribution of IRQs on all CPUs" 54#error "The mv64360 does not support distribution of IRQs on all CPUs"
diff --git a/arch/ppc/syslib/mv64x60.c b/arch/ppc/syslib/mv64x60.c
index 1227521c0da2..94ea346b7b4b 100644
--- a/arch/ppc/syslib/mv64x60.c
+++ b/arch/ppc/syslib/mv64x60.c
@@ -1305,7 +1305,7 @@ mv64x60_config_pci_params(struct pci_controller *hose,
1305 early_write_config_word(hose, 0, devfn, PCI_COMMAND, u16_val); 1305 early_write_config_word(hose, 0, devfn, PCI_COMMAND, u16_val);
1306 1306
1307 /* Set latency timer, cache line size, clear BIST */ 1307 /* Set latency timer, cache line size, clear BIST */
1308 u16_val = (pi->latency_timer << 8) | (L1_CACHE_LINE_SIZE >> 2); 1308 u16_val = (pi->latency_timer << 8) | (L1_CACHE_BYTES >> 2);
1309 early_write_config_word(hose, 0, devfn, PCI_CACHE_LINE_SIZE, u16_val); 1309 early_write_config_word(hose, 0, devfn, PCI_CACHE_LINE_SIZE, u16_val);
1310 1310
1311 mv64x60_pci_exclude_bridge = save_exclude; 1311 mv64x60_pci_exclude_bridge = save_exclude;
diff --git a/arch/ppc/syslib/mv64x60_dbg.c b/arch/ppc/syslib/mv64x60_dbg.c
index 2927c7adf5e5..fa5b2e45e0ca 100644
--- a/arch/ppc/syslib/mv64x60_dbg.c
+++ b/arch/ppc/syslib/mv64x60_dbg.c
@@ -24,6 +24,7 @@
24#include <linux/irq.h> 24#include <linux/irq.h>
25#include <asm/delay.h> 25#include <asm/delay.h>
26#include <asm/mv64x60.h> 26#include <asm/mv64x60.h>
27#include <asm/machdep.h>
27 28
28 29
29#if defined(CONFIG_SERIAL_TEXT_DEBUG) 30#if defined(CONFIG_SERIAL_TEXT_DEBUG)
diff --git a/arch/ppc/syslib/of_device.c b/arch/ppc/syslib/of_device.c
deleted file mode 100644
index 93c7231ea709..000000000000
--- a/arch/ppc/syslib/of_device.c
+++ /dev/null
@@ -1,276 +0,0 @@
1#include <linux/config.h>
2#include <linux/string.h>
3#include <linux/kernel.h>
4#include <linux/init.h>
5#include <linux/module.h>
6#include <linux/mod_devicetable.h>
7#include <asm/errno.h>
8#include <asm/of_device.h>
9
10/**
11 * of_match_device - Tell if an of_device structure has a matching
12 * of_match structure
13 * @ids: array of of device match structures to search in
14 * @dev: the of device structure to match against
15 *
16 * Used by a driver to check whether an of_device present in the
17 * system is in its list of supported devices.
18 */
19const struct of_device_id * of_match_device(const struct of_device_id *matches,
20 const struct of_device *dev)
21{
22 if (!dev->node)
23 return NULL;
24 while (matches->name[0] || matches->type[0] || matches->compatible[0]) {
25 int match = 1;
26 if (matches->name[0])
27 match &= dev->node->name
28 && !strcmp(matches->name, dev->node->name);
29 if (matches->type[0])
30 match &= dev->node->type
31 && !strcmp(matches->type, dev->node->type);
32 if (matches->compatible[0])
33 match &= device_is_compatible(dev->node,
34 matches->compatible);
35 if (match)
36 return matches;
37 matches++;
38 }
39 return NULL;
40}
41
42static int of_platform_bus_match(struct device *dev, struct device_driver *drv)
43{
44 struct of_device * of_dev = to_of_device(dev);
45 struct of_platform_driver * of_drv = to_of_platform_driver(drv);
46 const struct of_device_id * matches = of_drv->match_table;
47
48 if (!matches)
49 return 0;
50
51 return of_match_device(matches, of_dev) != NULL;
52}
53
54struct of_device *of_dev_get(struct of_device *dev)
55{
56 struct device *tmp;
57
58 if (!dev)
59 return NULL;
60 tmp = get_device(&dev->dev);
61 if (tmp)
62 return to_of_device(tmp);
63 else
64 return NULL;
65}
66
67void of_dev_put(struct of_device *dev)
68{
69 if (dev)
70 put_device(&dev->dev);
71}
72
73
74static int of_device_probe(struct device *dev)
75{
76 int error = -ENODEV;
77 struct of_platform_driver *drv;
78 struct of_device *of_dev;
79 const struct of_device_id *match;
80
81 drv = to_of_platform_driver(dev->driver);
82 of_dev = to_of_device(dev);
83
84 if (!drv->probe)
85 return error;
86
87 of_dev_get(of_dev);
88
89 match = of_match_device(drv->match_table, of_dev);
90 if (match)
91 error = drv->probe(of_dev, match);
92 if (error)
93 of_dev_put(of_dev);
94
95 return error;
96}
97
98static int of_device_remove(struct device *dev)
99{
100 struct of_device * of_dev = to_of_device(dev);
101 struct of_platform_driver * drv = to_of_platform_driver(dev->driver);
102
103 if (dev->driver && drv->remove)
104 drv->remove(of_dev);
105 return 0;
106}
107
108static int of_device_suspend(struct device *dev, pm_message_t state)
109{
110 struct of_device * of_dev = to_of_device(dev);
111 struct of_platform_driver * drv = to_of_platform_driver(dev->driver);
112 int error = 0;
113
114 if (dev->driver && drv->suspend)
115 error = drv->suspend(of_dev, state);
116 return error;
117}
118
119static int of_device_resume(struct device * dev)
120{
121 struct of_device * of_dev = to_of_device(dev);
122 struct of_platform_driver * drv = to_of_platform_driver(dev->driver);
123 int error = 0;
124
125 if (dev->driver && drv->resume)
126 error = drv->resume(of_dev);
127 return error;
128}
129
130struct bus_type of_platform_bus_type = {
131 .name = "of_platform",
132 .match = of_platform_bus_match,
133 .suspend = of_device_suspend,
134 .resume = of_device_resume,
135};
136
137static int __init of_bus_driver_init(void)
138{
139 return bus_register(&of_platform_bus_type);
140}
141
142postcore_initcall(of_bus_driver_init);
143
144int of_register_driver(struct of_platform_driver *drv)
145{
146 int count = 0;
147
148 /* initialize common driver fields */
149 drv->driver.name = drv->name;
150 drv->driver.bus = &of_platform_bus_type;
151 drv->driver.probe = of_device_probe;
152 drv->driver.remove = of_device_remove;
153
154 /* register with core */
155 count = driver_register(&drv->driver);
156 return count ? count : 1;
157}
158
159void of_unregister_driver(struct of_platform_driver *drv)
160{
161 driver_unregister(&drv->driver);
162}
163
164
165static ssize_t dev_show_devspec(struct device *dev, struct device_attribute *attr, char *buf)
166{
167 struct of_device *ofdev;
168
169 ofdev = to_of_device(dev);
170 return sprintf(buf, "%s", ofdev->node->full_name);
171}
172
173static DEVICE_ATTR(devspec, S_IRUGO, dev_show_devspec, NULL);
174
175/**
176 * of_release_dev - free an of device structure when all users of it are finished.
177 * @dev: device that's been disconnected
178 *
179 * Will be called only by the device core when all users of this of device are
180 * done.
181 */
182void of_release_dev(struct device *dev)
183{
184 struct of_device *ofdev;
185
186 ofdev = to_of_device(dev);
187 of_node_put(ofdev->node);
188 kfree(ofdev);
189}
190
191int of_device_register(struct of_device *ofdev)
192{
193 int rc;
194 struct of_device **odprop;
195
196 BUG_ON(ofdev->node == NULL);
197
198 odprop = (struct of_device **)get_property(ofdev->node, "linux,device", NULL);
199 if (!odprop) {
200 struct property *new_prop;
201
202 new_prop = kmalloc(sizeof(struct property) + sizeof(struct of_device *),
203 GFP_KERNEL);
204 if (new_prop == NULL)
205 return -ENOMEM;
206 new_prop->name = "linux,device";
207 new_prop->length = sizeof(sizeof(struct of_device *));
208 new_prop->value = (unsigned char *)&new_prop[1];
209 odprop = (struct of_device **)new_prop->value;
210 *odprop = NULL;
211 prom_add_property(ofdev->node, new_prop);
212 }
213 *odprop = ofdev;
214
215 rc = device_register(&ofdev->dev);
216 if (rc)
217 return rc;
218
219 device_create_file(&ofdev->dev, &dev_attr_devspec);
220
221 return 0;
222}
223
224void of_device_unregister(struct of_device *ofdev)
225{
226 struct of_device **odprop;
227
228 device_remove_file(&ofdev->dev, &dev_attr_devspec);
229
230 odprop = (struct of_device **)get_property(ofdev->node, "linux,device", NULL);
231 if (odprop)
232 *odprop = NULL;
233
234 device_unregister(&ofdev->dev);
235}
236
237struct of_device* of_platform_device_create(struct device_node *np,
238 const char *bus_id,
239 struct device *parent)
240{
241 struct of_device *dev;
242 u32 *reg;
243
244 dev = kmalloc(sizeof(*dev), GFP_KERNEL);
245 if (!dev)
246 return NULL;
247 memset(dev, 0, sizeof(*dev));
248
249 dev->node = of_node_get(np);
250 dev->dma_mask = 0xffffffffUL;
251 dev->dev.dma_mask = &dev->dma_mask;
252 dev->dev.parent = parent;
253 dev->dev.bus = &of_platform_bus_type;
254 dev->dev.release = of_release_dev;
255
256 reg = (u32 *)get_property(np, "reg", NULL);
257 strlcpy(dev->dev.bus_id, bus_id, BUS_ID_SIZE);
258
259 if (of_device_register(dev) != 0) {
260 kfree(dev);
261 return NULL;
262 }
263
264 return dev;
265}
266
267EXPORT_SYMBOL(of_match_device);
268EXPORT_SYMBOL(of_platform_bus_type);
269EXPORT_SYMBOL(of_register_driver);
270EXPORT_SYMBOL(of_unregister_driver);
271EXPORT_SYMBOL(of_device_register);
272EXPORT_SYMBOL(of_device_unregister);
273EXPORT_SYMBOL(of_dev_get);
274EXPORT_SYMBOL(of_dev_put);
275EXPORT_SYMBOL(of_platform_device_create);
276EXPORT_SYMBOL(of_release_dev);
diff --git a/arch/ppc/syslib/open_pic.c b/arch/ppc/syslib/open_pic.c
index 1cf5de21a3fd..894779712b46 100644
--- a/arch/ppc/syslib/open_pic.c
+++ b/arch/ppc/syslib/open_pic.c
@@ -23,6 +23,7 @@
23#include <asm/sections.h> 23#include <asm/sections.h>
24#include <asm/open_pic.h> 24#include <asm/open_pic.h>
25#include <asm/i8259.h> 25#include <asm/i8259.h>
26#include <asm/machdep.h>
26 27
27#include "open_pic_defs.h" 28#include "open_pic_defs.h"
28 29
@@ -889,7 +890,7 @@ openpic_get_irq(struct pt_regs *regs)
889 890
890#ifdef CONFIG_SMP 891#ifdef CONFIG_SMP
891void 892void
892smp_openpic_message_pass(int target, int msg, unsigned long data, int wait) 893smp_openpic_message_pass(int target, int msg)
893{ 894{
894 cpumask_t mask = CPU_MASK_ALL; 895 cpumask_t mask = CPU_MASK_ALL;
895 /* make sure we're sending something that translates to an IPI */ 896 /* make sure we're sending something that translates to an IPI */
diff --git a/arch/ppc/syslib/open_pic2.c b/arch/ppc/syslib/open_pic2.c
index 16cff91d9f41..1c40049b9a45 100644
--- a/arch/ppc/syslib/open_pic2.c
+++ b/arch/ppc/syslib/open_pic2.c
@@ -27,6 +27,7 @@
27#include <asm/sections.h> 27#include <asm/sections.h>
28#include <asm/open_pic.h> 28#include <asm/open_pic.h>
29#include <asm/i8259.h> 29#include <asm/i8259.h>
30#include <asm/machdep.h>
30 31
31#include "open_pic_defs.h" 32#include "open_pic_defs.h"
32 33
diff --git a/arch/ppc/syslib/ppc403_pic.c b/arch/ppc/syslib/ppc403_pic.c
index ce4d1deb86e9..c46043c47225 100644
--- a/arch/ppc/syslib/ppc403_pic.c
+++ b/arch/ppc/syslib/ppc403_pic.c
@@ -26,6 +26,7 @@
26#include <asm/system.h> 26#include <asm/system.h>
27#include <asm/irq.h> 27#include <asm/irq.h>
28#include <asm/ppc4xx_pic.h> 28#include <asm/ppc4xx_pic.h>
29#include <asm/machdep.h>
29 30
30/* Function Prototypes */ 31/* Function Prototypes */
31 32
diff --git a/arch/ppc/syslib/ppc4xx_pic.c b/arch/ppc/syslib/ppc4xx_pic.c
index 40086212b9c3..0b435633a0d1 100644
--- a/arch/ppc/syslib/ppc4xx_pic.c
+++ b/arch/ppc/syslib/ppc4xx_pic.c
@@ -25,6 +25,7 @@
25#include <asm/system.h> 25#include <asm/system.h>
26#include <asm/irq.h> 26#include <asm/irq.h>
27#include <asm/ppc4xx_pic.h> 27#include <asm/ppc4xx_pic.h>
28#include <asm/machdep.h>
28 29
29/* See comment in include/arch-ppc/ppc4xx_pic.h 30/* See comment in include/arch-ppc/ppc4xx_pic.h
30 * for more info about these two variables 31 * for more info about these two variables
diff --git a/arch/ppc/syslib/ppc4xx_setup.c b/arch/ppc/syslib/ppc4xx_setup.c
index bf83240689dc..e83a83fd95e1 100644
--- a/arch/ppc/syslib/ppc4xx_setup.c
+++ b/arch/ppc/syslib/ppc4xx_setup.c
@@ -278,7 +278,7 @@ ppc4xx_init(unsigned long r3, unsigned long r4, unsigned long r5,
278#endif /* defined(CONFIG_PCI) && defined(CONFIG_IDE) */ 278#endif /* defined(CONFIG_PCI) && defined(CONFIG_IDE) */
279} 279}
280 280
281/* Called from MachineCheckException */ 281/* Called from machine_check_exception */
282void platform_machine_check(struct pt_regs *regs) 282void platform_machine_check(struct pt_regs *regs)
283{ 283{
284#if defined(DCRN_PLB0_BEAR) 284#if defined(DCRN_PLB0_BEAR)
diff --git a/arch/ppc/syslib/ppc83xx_setup.c b/arch/ppc/syslib/ppc83xx_setup.c
index 890484e576e7..4da168a6ad03 100644
--- a/arch/ppc/syslib/ppc83xx_setup.c
+++ b/arch/ppc/syslib/ppc83xx_setup.c
@@ -40,6 +40,7 @@
40#include <asm/ppc_sys.h> 40#include <asm/ppc_sys.h>
41#include <asm/kgdb.h> 41#include <asm/kgdb.h>
42#include <asm/delay.h> 42#include <asm/delay.h>
43#include <asm/machdep.h>
43 44
44#include <syslib/ppc83xx_setup.h> 45#include <syslib/ppc83xx_setup.h>
45#if defined(CONFIG_PCI) 46#if defined(CONFIG_PCI)
diff --git a/arch/ppc/syslib/ppc85xx_setup.c b/arch/ppc/syslib/ppc85xx_setup.c
index 832b8bf99ae7..de2f90576577 100644
--- a/arch/ppc/syslib/ppc85xx_setup.c
+++ b/arch/ppc/syslib/ppc85xx_setup.c
@@ -29,6 +29,7 @@
29#include <asm/mmu.h> 29#include <asm/mmu.h>
30#include <asm/ppc_sys.h> 30#include <asm/ppc_sys.h>
31#include <asm/kgdb.h> 31#include <asm/kgdb.h>
32#include <asm/machdep.h>
32 33
33#include <syslib/ppc85xx_setup.h> 34#include <syslib/ppc85xx_setup.h>
34 35
diff --git a/arch/ppc/syslib/ppc8xx_pic.c b/arch/ppc/syslib/ppc8xx_pic.c
index d3b01c6c97de..3e6f51a61d46 100644
--- a/arch/ppc/syslib/ppc8xx_pic.c
+++ b/arch/ppc/syslib/ppc8xx_pic.c
@@ -6,6 +6,7 @@
6#include <linux/signal.h> 6#include <linux/signal.h>
7#include <linux/interrupt.h> 7#include <linux/interrupt.h>
8#include <asm/irq.h> 8#include <asm/irq.h>
9#include <asm/io.h>
9#include <asm/8xx_immap.h> 10#include <asm/8xx_immap.h>
10#include <asm/mpc8xx.h> 11#include <asm/mpc8xx.h>
11#include "ppc8xx_pic.h" 12#include "ppc8xx_pic.h"
@@ -29,8 +30,7 @@ static void m8xx_mask_irq(unsigned int irq_nr)
29 word = irq_nr >> 5; 30 word = irq_nr >> 5;
30 31
31 ppc_cached_irq_mask[word] &= ~(1 << (31-bit)); 32 ppc_cached_irq_mask[word] &= ~(1 << (31-bit));
32 ((immap_t *)IMAP_ADDR)->im_siu_conf.sc_simask = 33 out_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_simask, ppc_cached_irq_mask[word]);
33 ppc_cached_irq_mask[word];
34} 34}
35 35
36static void m8xx_unmask_irq(unsigned int irq_nr) 36static void m8xx_unmask_irq(unsigned int irq_nr)
@@ -41,8 +41,7 @@ static void m8xx_unmask_irq(unsigned int irq_nr)
41 word = irq_nr >> 5; 41 word = irq_nr >> 5;
42 42
43 ppc_cached_irq_mask[word] |= (1 << (31-bit)); 43 ppc_cached_irq_mask[word] |= (1 << (31-bit));
44 ((immap_t *)IMAP_ADDR)->im_siu_conf.sc_simask = 44 out_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_simask, ppc_cached_irq_mask[word]);
45 ppc_cached_irq_mask[word];
46} 45}
47 46
48static void m8xx_end_irq(unsigned int irq_nr) 47static void m8xx_end_irq(unsigned int irq_nr)
@@ -55,8 +54,7 @@ static void m8xx_end_irq(unsigned int irq_nr)
55 word = irq_nr >> 5; 54 word = irq_nr >> 5;
56 55
57 ppc_cached_irq_mask[word] |= (1 << (31-bit)); 56 ppc_cached_irq_mask[word] |= (1 << (31-bit));
58 ((immap_t *)IMAP_ADDR)->im_siu_conf.sc_simask = 57 out_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_simask, ppc_cached_irq_mask[word]);
59 ppc_cached_irq_mask[word];
60 } 58 }
61} 59}
62 60
@@ -69,9 +67,8 @@ static void m8xx_mask_and_ack(unsigned int irq_nr)
69 word = irq_nr >> 5; 67 word = irq_nr >> 5;
70 68
71 ppc_cached_irq_mask[word] &= ~(1 << (31-bit)); 69 ppc_cached_irq_mask[word] &= ~(1 << (31-bit));
72 ((immap_t *)IMAP_ADDR)->im_siu_conf.sc_simask = 70 out_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_simask, ppc_cached_irq_mask[word]);
73 ppc_cached_irq_mask[word]; 71 out_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_sipend, 1 << (31-bit));
74 ((immap_t *)IMAP_ADDR)->im_siu_conf.sc_sipend = 1 << (31-bit);
75} 72}
76 73
77struct hw_interrupt_type ppc8xx_pic = { 74struct hw_interrupt_type ppc8xx_pic = {
@@ -93,7 +90,7 @@ m8xx_get_irq(struct pt_regs *regs)
93 /* For MPC8xx, read the SIVEC register and shift the bits down 90 /* For MPC8xx, read the SIVEC register and shift the bits down
94 * to get the irq number. 91 * to get the irq number.
95 */ 92 */
96 irq = ((immap_t *)IMAP_ADDR)->im_siu_conf.sc_sivec >> 26; 93 irq = in_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_sivec) >> 26;
97 94
98 /* 95 /*
99 * When we read the sivec without an interrupt to process, we will 96 * When we read the sivec without an interrupt to process, we will
diff --git a/arch/ppc/syslib/ppc_sys.c b/arch/ppc/syslib/ppc_sys.c
index 52ba0c68078d..62ee86e80711 100644
--- a/arch/ppc/syslib/ppc_sys.c
+++ b/arch/ppc/syslib/ppc_sys.c
@@ -69,6 +69,9 @@ static int __init find_chip_by_name_and_id(char *name, u32 id)
69 matched[j++] = i; 69 matched[j++] = i;
70 i++; 70 i++;
71 } 71 }
72
73 ret = i;
74
72 if (j != 0) { 75 if (j != 0) {
73 for (i = 0; i < j; i++) { 76 for (i = 0; i < j; i++) {
74 if ((ppc_sys_specs[matched[i]].mask & id) == 77 if ((ppc_sys_specs[matched[i]].mask & id) ==
diff --git a/arch/ppc/syslib/pq2_devices.c b/arch/ppc/syslib/pq2_devices.c
index 61668aad86e2..e960fe935325 100644
--- a/arch/ppc/syslib/pq2_devices.c
+++ b/arch/ppc/syslib/pq2_devices.c
@@ -18,6 +18,7 @@
18#include <asm/cpm2.h> 18#include <asm/cpm2.h>
19#include <asm/irq.h> 19#include <asm/irq.h>
20#include <asm/ppc_sys.h> 20#include <asm/ppc_sys.h>
21#include <asm/machdep.h>
21 22
22struct platform_device ppc_sys_platform_devices[] = { 23struct platform_device ppc_sys_platform_devices[] = {
23 [MPC82xx_CPM_FCC1] = { 24 [MPC82xx_CPM_FCC1] = {
diff --git a/arch/ppc/syslib/prep_nvram.c b/arch/ppc/syslib/prep_nvram.c
index 8599850ca772..2c6364d9641f 100644
--- a/arch/ppc/syslib/prep_nvram.c
+++ b/arch/ppc/syslib/prep_nvram.c
@@ -22,14 +22,14 @@
22static char nvramData[MAX_PREP_NVRAM]; 22static char nvramData[MAX_PREP_NVRAM];
23static NVRAM_MAP *nvram=(NVRAM_MAP *)&nvramData[0]; 23static NVRAM_MAP *nvram=(NVRAM_MAP *)&nvramData[0];
24 24
25unsigned char __prep prep_nvram_read_val(int addr) 25unsigned char prep_nvram_read_val(int addr)
26{ 26{
27 outb(addr, PREP_NVRAM_AS0); 27 outb(addr, PREP_NVRAM_AS0);
28 outb(addr>>8, PREP_NVRAM_AS1); 28 outb(addr>>8, PREP_NVRAM_AS1);
29 return inb(PREP_NVRAM_DATA); 29 return inb(PREP_NVRAM_DATA);
30} 30}
31 31
32void __prep prep_nvram_write_val(int addr, 32void prep_nvram_write_val(int addr,
33 unsigned char val) 33 unsigned char val)
34{ 34{
35 outb(addr, PREP_NVRAM_AS0); 35 outb(addr, PREP_NVRAM_AS0);
@@ -81,8 +81,7 @@ void __init init_prep_nvram(void)
81 } 81 }
82} 82}
83 83
84__prep 84char *prep_nvram_get_var(const char *name)
85char __prep *prep_nvram_get_var(const char *name)
86{ 85{
87 char *cp; 86 char *cp;
88 int namelen; 87 int namelen;
@@ -101,8 +100,7 @@ char __prep *prep_nvram_get_var(const char *name)
101 return NULL; 100 return NULL;
102} 101}
103 102
104__prep 103char *prep_nvram_first_var(void)
105char __prep *prep_nvram_first_var(void)
106{ 104{
107 if (nvram->Header.GELength == 0) { 105 if (nvram->Header.GELength == 0) {
108 return NULL; 106 return NULL;
@@ -112,8 +110,7 @@ char __prep *prep_nvram_first_var(void)
112 } 110 }
113} 111}
114 112
115__prep 113char *prep_nvram_next_var(char *name)
116char __prep *prep_nvram_next_var(char *name)
117{ 114{
118 char *cp; 115 char *cp;
119 116
diff --git a/arch/ppc/syslib/prom.c b/arch/ppc/syslib/prom.c
index 2c64ed627475..278da6ee62ea 100644
--- a/arch/ppc/syslib/prom.c
+++ b/arch/ppc/syslib/prom.c
@@ -89,7 +89,7 @@ extern char cmd_line[512]; /* XXX */
89extern boot_infos_t *boot_infos; 89extern boot_infos_t *boot_infos;
90unsigned long dev_tree_size; 90unsigned long dev_tree_size;
91 91
92void __openfirmware 92void
93phys_call_rtas(int service, int nargs, int nret, ...) 93phys_call_rtas(int service, int nargs, int nret, ...)
94{ 94{
95 va_list list; 95 va_list list;
@@ -862,7 +862,7 @@ find_type_devices(const char *type)
862/* 862/*
863 * Returns all nodes linked together 863 * Returns all nodes linked together
864 */ 864 */
865struct device_node * __openfirmware 865struct device_node *
866find_all_nodes(void) 866find_all_nodes(void)
867{ 867{
868 struct device_node *head, **prevp, *np; 868 struct device_node *head, **prevp, *np;
@@ -1165,7 +1165,7 @@ get_property(struct device_node *np, const char *name, int *lenp)
1165/* 1165/*
1166 * Add a property to a node 1166 * Add a property to a node
1167 */ 1167 */
1168void __openfirmware 1168void
1169prom_add_property(struct device_node* np, struct property* prop) 1169prom_add_property(struct device_node* np, struct property* prop)
1170{ 1170{
1171 struct property **next = &np->properties; 1171 struct property **next = &np->properties;
@@ -1177,7 +1177,7 @@ prom_add_property(struct device_node* np, struct property* prop)
1177} 1177}
1178 1178
1179/* I quickly hacked that one, check against spec ! */ 1179/* I quickly hacked that one, check against spec ! */
1180static inline unsigned long __openfirmware 1180static inline unsigned long
1181bus_space_to_resource_flags(unsigned int bus_space) 1181bus_space_to_resource_flags(unsigned int bus_space)
1182{ 1182{
1183 u8 space = (bus_space >> 24) & 0xf; 1183 u8 space = (bus_space >> 24) & 0xf;
@@ -1194,7 +1194,7 @@ bus_space_to_resource_flags(unsigned int bus_space)
1194 } 1194 }
1195} 1195}
1196 1196
1197static struct resource* __openfirmware 1197static struct resource*
1198find_parent_pci_resource(struct pci_dev* pdev, struct address_range *range) 1198find_parent_pci_resource(struct pci_dev* pdev, struct address_range *range)
1199{ 1199{
1200 unsigned long mask; 1200 unsigned long mask;
@@ -1224,7 +1224,7 @@ find_parent_pci_resource(struct pci_dev* pdev, struct address_range *range)
1224 * or other nodes attached to the root node. Ultimately, put some 1224 * or other nodes attached to the root node. Ultimately, put some
1225 * link to resources in the OF node. 1225 * link to resources in the OF node.
1226 */ 1226 */
1227struct resource* __openfirmware 1227struct resource*
1228request_OF_resource(struct device_node* node, int index, const char* name_postfix) 1228request_OF_resource(struct device_node* node, int index, const char* name_postfix)
1229{ 1229{
1230 struct pci_dev* pcidev; 1230 struct pci_dev* pcidev;
@@ -1280,7 +1280,7 @@ fail:
1280 return NULL; 1280 return NULL;
1281} 1281}
1282 1282
1283int __openfirmware 1283int
1284release_OF_resource(struct device_node* node, int index) 1284release_OF_resource(struct device_node* node, int index)
1285{ 1285{
1286 struct pci_dev* pcidev; 1286 struct pci_dev* pcidev;
@@ -1346,7 +1346,7 @@ release_OF_resource(struct device_node* node, int index)
1346} 1346}
1347 1347
1348#if 0 1348#if 0
1349void __openfirmware 1349void
1350print_properties(struct device_node *np) 1350print_properties(struct device_node *np)
1351{ 1351{
1352 struct property *pp; 1352 struct property *pp;
@@ -1400,7 +1400,7 @@ print_properties(struct device_node *np)
1400static DEFINE_SPINLOCK(rtas_lock); 1400static DEFINE_SPINLOCK(rtas_lock);
1401 1401
1402/* this can be called after setup -- Cort */ 1402/* this can be called after setup -- Cort */
1403int __openfirmware 1403int
1404call_rtas(const char *service, int nargs, int nret, 1404call_rtas(const char *service, int nargs, int nret,
1405 unsigned long *outputs, ...) 1405 unsigned long *outputs, ...)
1406{ 1406{
diff --git a/arch/ppc/syslib/xilinx_pic.c b/arch/ppc/syslib/xilinx_pic.c
index 2cbcad278cef..47f04c71fe9c 100644
--- a/arch/ppc/syslib/xilinx_pic.c
+++ b/arch/ppc/syslib/xilinx_pic.c
@@ -17,6 +17,7 @@
17#include <asm/io.h> 17#include <asm/io.h>
18#include <asm/xparameters.h> 18#include <asm/xparameters.h>
19#include <asm/ibm4xx.h> 19#include <asm/ibm4xx.h>
20#include <asm/machdep.h>
20 21
21/* No one else should require these constants, so define them locally here. */ 22/* No one else should require these constants, so define them locally here. */
22#define ISR 0 /* Interrupt Status Register */ 23#define ISR 0 /* Interrupt Status Register */
diff --git a/arch/ppc/xmon/start.c b/arch/ppc/xmon/start.c
index 507d4eeffe07..98612d420346 100644
--- a/arch/ppc/xmon/start.c
+++ b/arch/ppc/xmon/start.c
@@ -478,8 +478,9 @@ void *xmon_stdout;
478void *xmon_stderr; 478void *xmon_stderr;
479 479
480void 480void
481xmon_init(void) 481xmon_init(int arg)
482{ 482{
483 xmon_map_scc();
483} 484}
484 485
485int 486int
diff --git a/arch/ppc/xmon/xmon.c b/arch/ppc/xmon/xmon.c
index be7869e39465..66bfaa3211a2 100644
--- a/arch/ppc/xmon/xmon.c
+++ b/arch/ppc/xmon/xmon.c
@@ -148,9 +148,14 @@ Commands:\n\
148 r print registers\n\ 148 r print registers\n\
149 S print special registers\n\ 149 S print special registers\n\
150 t print backtrace\n\ 150 t print backtrace\n\
151 la lookup address in system.map\n\ 151 la lookup address\n\
152 ls lookup symbol in system.map\n\ 152 ls lookup symbol\n\
153 C checksum\n\
154 p call function with arguments\n\
155 T print time\n\
153 x exit monitor\n\ 156 x exit monitor\n\
157 zr reboot\n\
158 zh halt\n\
154"; 159";
155 160
156static int xmon_trace[NR_CPUS]; 161static int xmon_trace[NR_CPUS];
diff --git a/arch/ppc64/Kconfig b/arch/ppc64/Kconfig
index c658650af429..42677cc96508 100644
--- a/arch/ppc64/Kconfig
+++ b/arch/ppc64/Kconfig
@@ -10,6 +10,9 @@ config MMU
10 bool 10 bool
11 default y 11 default y
12 12
13config PPC_STD_MMU
14 def_bool y
15
13config UID16 16config UID16
14 bool 17 bool
15 18
@@ -120,6 +123,11 @@ config MPIC
120 bool 123 bool
121 default y 124 default y
122 125
126config PPC_I8259
127 depends on PPC_PSERIES
128 bool
129 default y
130
123config BPA_IIC 131config BPA_IIC
124 depends on PPC_BPA 132 depends on PPC_BPA
125 bool 133 bool
@@ -186,6 +194,12 @@ config BOOTX_TEXT
186 Say Y here to see progress messages from the boot firmware in text 194 Say Y here to see progress messages from the boot firmware in text
187 mode. Requires an Open Firmware compatible video card. 195 mode. Requires an Open Firmware compatible video card.
188 196
197config POWER4
198 def_bool y
199
200config PPC_FPU
201 def_bool y
202
189config POWER4_ONLY 203config POWER4_ONLY
190 bool "Optimize for POWER4" 204 bool "Optimize for POWER4"
191 default n 205 default n
@@ -234,6 +248,10 @@ config HMT
234 This option enables hardware multithreading on RS64 cpus. 248 This option enables hardware multithreading on RS64 cpus.
235 pSeries systems p620 and p660 have such a cpu type. 249 pSeries systems p620 and p660 have such a cpu type.
236 250
251config NUMA
252 bool "NUMA support"
253 default y if SMP && PPC_PSERIES
254
237config ARCH_SELECT_MEMORY_MODEL 255config ARCH_SELECT_MEMORY_MODEL
238 def_bool y 256 def_bool y
239 257
@@ -249,9 +267,6 @@ config ARCH_DISCONTIGMEM_DEFAULT
249 def_bool y 267 def_bool y
250 depends on ARCH_DISCONTIGMEM_ENABLE 268 depends on ARCH_DISCONTIGMEM_ENABLE
251 269
252config ARCH_FLATMEM_ENABLE
253 def_bool y
254
255config ARCH_SPARSEMEM_ENABLE 270config ARCH_SPARSEMEM_ENABLE
256 def_bool y 271 def_bool y
257 depends on ARCH_DISCONTIGMEM_ENABLE 272 depends on ARCH_DISCONTIGMEM_ENABLE
@@ -274,10 +289,6 @@ config NODES_SPAN_OTHER_NODES
274 def_bool y 289 def_bool y
275 depends on NEED_MULTIPLE_NODES 290 depends on NEED_MULTIPLE_NODES
276 291
277config NUMA
278 bool "NUMA support"
279 default y if DISCONTIGMEM || SPARSEMEM
280
281config SCHED_SMT 292config SCHED_SMT
282 bool "SMT (Hyperthreading) scheduler support" 293 bool "SMT (Hyperthreading) scheduler support"
283 depends on SMP 294 depends on SMP
@@ -307,6 +318,11 @@ config PPC_RTAS
307 depends on PPC_PSERIES || PPC_BPA 318 depends on PPC_PSERIES || PPC_BPA
308 default y 319 default y
309 320
321config RTAS_ERROR_LOGGING
322 bool
323 depends on PPC_RTAS
324 default y
325
310config RTAS_PROC 326config RTAS_PROC
311 bool "Proc interface to RTAS" 327 bool "Proc interface to RTAS"
312 depends on PPC_RTAS 328 depends on PPC_RTAS
@@ -357,7 +373,6 @@ config HOTPLUG_CPU
357 373
358config PROC_DEVICETREE 374config PROC_DEVICETREE
359 bool "Support for Open Firmware device tree in /proc" 375 bool "Support for Open Firmware device tree in /proc"
360 depends on !PPC_ISERIES
361 help 376 help
362 This option adds a device-tree directory under /proc which contains 377 This option adds a device-tree directory under /proc which contains
363 an image of the device tree that the kernel copies from Open 378 an image of the device tree that the kernel copies from Open
@@ -461,7 +476,7 @@ config VIOPATH
461 depends on VIOCONS || VIODASD || VIOCD || VIOTAPE || VETH 476 depends on VIOCONS || VIODASD || VIOCD || VIOTAPE || VETH
462 default y 477 default y
463 478
464source "arch/ppc64/oprofile/Kconfig" 479source "arch/powerpc/oprofile/Kconfig"
465 480
466source "arch/ppc64/Kconfig.debug" 481source "arch/ppc64/Kconfig.debug"
467 482
diff --git a/arch/ppc64/Makefile b/arch/ppc64/Makefile
index 521c2a5a2862..fdbd6f44adc0 100644
--- a/arch/ppc64/Makefile
+++ b/arch/ppc64/Makefile
@@ -75,17 +75,25 @@ else
75 CFLAGS += $(call cc-option,-mtune=power4) 75 CFLAGS += $(call cc-option,-mtune=power4)
76endif 76endif
77 77
78# No AltiVec instruction when building kernel
79CFLAGS += $(call cc-option, -mno-altivec)
80
78# Enable unit-at-a-time mode when possible. It shrinks the 81# Enable unit-at-a-time mode when possible. It shrinks the
79# kernel considerably. 82# kernel considerably.
80CFLAGS += $(call cc-option,-funit-at-a-time) 83CFLAGS += $(call cc-option,-funit-at-a-time)
81 84
82head-y := arch/ppc64/kernel/head.o 85head-y := arch/ppc64/kernel/head.o
86head-y += arch/powerpc/kernel/fpu.o
87head-y += arch/powerpc/kernel/entry_64.o
83 88
84libs-y += arch/ppc64/lib/ 89libs-y += arch/ppc64/lib/
85core-y += arch/ppc64/kernel/ 90core-y += arch/ppc64/kernel/ arch/powerpc/kernel/
86core-y += arch/ppc64/mm/ 91core-y += arch/powerpc/mm/
87core-$(CONFIG_XMON) += arch/ppc64/xmon/ 92core-y += arch/powerpc/sysdev/
88drivers-$(CONFIG_OPROFILE) += arch/ppc64/oprofile/ 93core-y += arch/powerpc/platforms/
94core-y += arch/powerpc/lib/
95core-$(CONFIG_XMON) += arch/powerpc/xmon/
96drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/
89 97
90boot := arch/ppc64/boot 98boot := arch/ppc64/boot
91 99
@@ -100,7 +108,7 @@ $(boottargets-y): vmlinux
100bootimage-$(CONFIG_PPC_PSERIES) := $(boot)/zImage 108bootimage-$(CONFIG_PPC_PSERIES) := $(boot)/zImage
101bootimage-$(CONFIG_PPC_PMAC) := vmlinux 109bootimage-$(CONFIG_PPC_PMAC) := vmlinux
102bootimage-$(CONFIG_PPC_MAPLE) := $(boot)/zImage 110bootimage-$(CONFIG_PPC_MAPLE) := $(boot)/zImage
103bootimage-$(CONFIG_PPC_BPA) := zImage 111bootimage-$(CONFIG_PPC_BPA) := $(boot)/zImage
104bootimage-$(CONFIG_PPC_ISERIES) := vmlinux 112bootimage-$(CONFIG_PPC_ISERIES) := vmlinux
105BOOTIMAGE := $(bootimage-y) 113BOOTIMAGE := $(bootimage-y)
106install: vmlinux 114install: vmlinux
diff --git a/arch/ppc64/boot/Makefile b/arch/ppc64/boot/Makefile
index 33fdc8710891..301bc1536c49 100644
--- a/arch/ppc64/boot/Makefile
+++ b/arch/ppc64/boot/Makefile
@@ -22,15 +22,46 @@
22 22
23 23
24HOSTCC := gcc 24HOSTCC := gcc
25BOOTCFLAGS := $(HOSTCFLAGS) -fno-builtin -nostdinc -isystem $(shell $(CROSS32CC) -print-file-name=include) 25BOOTCFLAGS := $(HOSTCFLAGS) -fno-builtin -nostdinc -isystem $(shell $(CROSS32CC) -print-file-name=include) -fPIC
26BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc 26BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc
27BOOTLFLAGS := -Ttext 0x00400000 -e _start -T $(srctree)/$(src)/zImage.lds 27BOOTLFLAGS := -T $(srctree)/$(src)/zImage.lds
28OBJCOPYFLAGS := contents,alloc,load,readonly,data 28OBJCOPYFLAGS := contents,alloc,load,readonly,data
29 29
30src-boot := crt0.S string.S prom.c main.c zlib.c imagesize.c div64.S 30zlib := infblock.c infcodes.c inffast.c inflate.c inftrees.c infutil.c
31zlibheader := infblock.h infcodes.h inffast.h inftrees.h infutil.h
32zliblinuxheader := zlib.h zconf.h zutil.h
33
34$(addprefix $(obj)/,$(zlib) main.o): $(addprefix $(obj)/,$(zliblinuxheader)) $(addprefix $(obj)/,$(zlibheader))
35#$(addprefix $(obj)/,main.o): $(addprefix $(obj)/,zlib.h)
36
37src-boot := string.S prom.c main.c div64.S crt0.S
38src-boot += $(zlib)
31src-boot := $(addprefix $(obj)/, $(src-boot)) 39src-boot := $(addprefix $(obj)/, $(src-boot))
32obj-boot := $(addsuffix .o, $(basename $(src-boot))) 40obj-boot := $(addsuffix .o, $(basename $(src-boot)))
33 41
42BOOTCFLAGS += -I$(obj) -I$(srctree)/$(obj)
43
44quiet_cmd_copy_zlib = COPY $@
45 cmd_copy_zlib = sed "s@__attribute_used__@@;s@<linux/\([^>]\+\).*@\"\1\"@" $< > $@
46
47quiet_cmd_copy_zlibheader = COPY $@
48 cmd_copy_zlibheader = sed "s@<linux/\([^>]\+\).*@\"\1\"@" $< > $@
49# stddef.h for NULL
50quiet_cmd_copy_zliblinuxheader = COPY $@
51 cmd_copy_zliblinuxheader = sed "s@<linux/string.h>@\"string.h\"@;s@<linux/kernel.h>@<stddef.h>@;s@<linux/\([^>]\+\).*@\"\1\"@" $< > $@
52
53$(addprefix $(obj)/,$(zlib)): $(obj)/%: $(srctree)/lib/zlib_inflate/%
54 $(call cmd,copy_zlib)
55
56$(addprefix $(obj)/,$(zlibheader)): $(obj)/%: $(srctree)/lib/zlib_inflate/%
57 $(call cmd,copy_zlibheader)
58
59$(addprefix $(obj)/,$(zliblinuxheader)): $(obj)/%: $(srctree)/include/linux/%
60 $(call cmd,copy_zliblinuxheader)
61
62clean-files := $(zlib) $(zlibheader) $(zliblinuxheader)
63
64
34quiet_cmd_bootcc = BOOTCC $@ 65quiet_cmd_bootcc = BOOTCC $@
35 cmd_bootcc = $(CROSS32CC) -Wp,-MD,$(depfile) $(BOOTCFLAGS) -c -o $@ $< 66 cmd_bootcc = $(CROSS32CC) -Wp,-MD,$(depfile) $(BOOTCFLAGS) -c -o $@ $<
36 67
@@ -56,7 +87,7 @@ src-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.c, $(section)))
56gz-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.gz, $(section))) 87gz-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.gz, $(section)))
57 88
58hostprogs-y := addnote addRamDisk 89hostprogs-y := addnote addRamDisk
59targets += zImage.vmode zImage.initrd.vmode zImage zImage.initrd imagesize.c \ 90targets += zImage.vmode zImage.initrd.vmode zImage zImage.initrd \
60 $(patsubst $(obj)/%,%, $(call obj-sec, $(required) $(initrd))) \ 91 $(patsubst $(obj)/%,%, $(call obj-sec, $(required) $(initrd))) \
61 $(patsubst $(obj)/%,%, $(call src-sec, $(required) $(initrd))) \ 92 $(patsubst $(obj)/%,%, $(call src-sec, $(required) $(initrd))) \
62 $(patsubst $(obj)/%,%, $(call gz-sec, $(required) $(initrd))) \ 93 $(patsubst $(obj)/%,%, $(call gz-sec, $(required) $(initrd))) \
@@ -69,9 +100,9 @@ quiet_cmd_ramdisk = RAMDISK $@
69quiet_cmd_stripvm = STRIP $@ 100quiet_cmd_stripvm = STRIP $@
70 cmd_stripvm = $(STRIP) -s $< -o $@ 101 cmd_stripvm = $(STRIP) -s $< -o $@
71 102
72vmlinux.strip: vmlinux FORCE 103vmlinux.strip: vmlinux
73 $(call if_changed,stripvm) 104 $(call if_changed,stripvm)
74$(obj)/vmlinux.initrd: vmlinux.strip $(obj)/addRamDisk $(obj)/ramdisk.image.gz FORCE 105$(obj)/vmlinux.initrd: vmlinux.strip $(obj)/addRamDisk $(obj)/ramdisk.image.gz
75 $(call if_changed,ramdisk) 106 $(call if_changed,ramdisk)
76 107
77quiet_cmd_addsection = ADDSEC $@ 108quiet_cmd_addsection = ADDSEC $@
@@ -79,48 +110,38 @@ quiet_cmd_addsection = ADDSEC $@
79 --add-section=.kernel:$(strip $(patsubst $(obj)/kernel-%.o,%, $@))=$(patsubst %.o,%.gz, $@) \ 110 --add-section=.kernel:$(strip $(patsubst $(obj)/kernel-%.o,%, $@))=$(patsubst %.o,%.gz, $@) \
80 --set-section-flags=.kernel:$(strip $(patsubst $(obj)/kernel-%.o,%, $@))=$(OBJCOPYFLAGS) 111 --set-section-flags=.kernel:$(strip $(patsubst $(obj)/kernel-%.o,%, $@))=$(OBJCOPYFLAGS)
81 112
82quiet_cmd_imagesize = GENSIZE $@
83 cmd_imagesize = ls -l vmlinux.strip | \
84 awk '{printf "/* generated -- do not edit! */\n" "unsigned long vmlinux_filesize = %d;\n", $$5}' \
85 > $(obj)/imagesize.c && \
86 $(CROSS_COMPILE)nm -n vmlinux | tail -n 1 | \
87 awk '{printf "unsigned long vmlinux_memsize = 0x%s;\n", substr($$1,8)}' >> $(obj)/imagesize.c
88
89quiet_cmd_addnote = ADDNOTE $@ 113quiet_cmd_addnote = ADDNOTE $@
90 cmd_addnote = $(obj)/addnote $@ 114 cmd_addnote = $(obj)/addnote $@
91 115
92$(call gz-sec, $(required)): $(obj)/kernel-%.gz: % FORCE 116$(call gz-sec, $(required)): $(obj)/kernel-%.gz: %
93 $(call if_changed,gzip) 117 $(call if_changed,gzip)
94 118
95$(obj)/kernel-initrd.gz: $(obj)/ramdisk.image.gz 119$(obj)/kernel-initrd.gz: $(obj)/ramdisk.image.gz
96 cp -f $(obj)/ramdisk.image.gz $@ 120 cp -f $(obj)/ramdisk.image.gz $@
97 121
98$(call src-sec, $(required) $(initrd)): $(obj)/kernel-%.c: $(obj)/kernel-%.gz FORCE 122$(call src-sec, $(required) $(initrd)): $(obj)/kernel-%.c: $(obj)/kernel-%.gz
99 @touch $@ 123 @touch $@
100 124
101$(call obj-sec, $(required) $(initrd)): $(obj)/kernel-%.o: $(obj)/kernel-%.c FORCE 125$(call obj-sec, $(required) $(initrd)): $(obj)/kernel-%.o: $(obj)/kernel-%.c
102 $(call if_changed_dep,bootcc) 126 $(call if_changed_dep,bootcc)
103 $(call cmd,addsection) 127 $(call cmd,addsection)
104 128
105$(obj)/zImage.vmode: obj-boot += $(call obj-sec, $(required)) 129$(obj)/zImage.vmode: obj-boot += $(call obj-sec, $(required))
106$(obj)/zImage.vmode: $(call obj-sec, $(required)) $(obj-boot) FORCE 130$(obj)/zImage.vmode: $(call obj-sec, $(required)) $(obj-boot) $(srctree)/$(src)/zImage.lds
107 $(call cmd,bootld,$(obj-boot)) 131 $(call cmd,bootld,$(obj-boot))
108 132
109$(obj)/zImage.initrd.vmode: obj-boot += $(call obj-sec, $(required) $(initrd)) 133$(obj)/zImage.initrd.vmode: obj-boot += $(call obj-sec, $(required) $(initrd))
110$(obj)/zImage.initrd.vmode: $(call obj-sec, $(required) $(initrd)) $(obj-boot) FORCE 134$(obj)/zImage.initrd.vmode: $(call obj-sec, $(required) $(initrd)) $(obj-boot) $(srctree)/$(src)/zImage.lds
111 $(call cmd,bootld,$(obj-boot)) 135 $(call cmd,bootld,$(obj-boot))
112 136
113$(obj)/zImage: $(obj)/zImage.vmode $(obj)/addnote FORCE 137$(obj)/zImage: $(obj)/zImage.vmode $(obj)/addnote
114 @cp -f $< $@ 138 @cp -f $< $@
115 $(call if_changed,addnote) 139 $(call if_changed,addnote)
116 140
117$(obj)/zImage.initrd: $(obj)/zImage.initrd.vmode $(obj)/addnote FORCE 141$(obj)/zImage.initrd: $(obj)/zImage.initrd.vmode $(obj)/addnote
118 @cp -f $< $@ 142 @cp -f $< $@
119 $(call if_changed,addnote) 143 $(call if_changed,addnote)
120 144
121$(obj)/imagesize.c: vmlinux.strip
122 $(call cmd,imagesize)
123
124install: $(CONFIGURE) $(BOOTIMAGE) 145install: $(CONFIGURE) $(BOOTIMAGE)
125 sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" "$(BOOTIMAGE)" 146 sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" "$(BOOTIMAGE)"
126 147
diff --git a/arch/ppc64/boot/crt0.S b/arch/ppc64/boot/crt0.S
index 3861e7f9cf19..9cc442263939 100644
--- a/arch/ppc64/boot/crt0.S
+++ b/arch/ppc64/boot/crt0.S
@@ -12,11 +12,40 @@
12#include "ppc_asm.h" 12#include "ppc_asm.h"
13 13
14 .text 14 .text
15 .globl _start 15 .globl _zimage_start
16_start: 16_zimage_start:
17 bl reloc_offset
18
19reloc_offset:
20 mflr r0
21 lis r9,reloc_offset@ha
22 addi r9,r9,reloc_offset@l
23 subf. r0,r9,r0
24 beq clear_caches
25
26reloc_got2:
27 lis r9,__got2_start@ha
28 addi r9,r9,__got2_start@l
29 lis r8,__got2_end@ha
30 addi r8,r8,__got2_end@l
31 subf. r8,r9,r8
32 beq clear_caches
33 srwi. r8,r8,2
34 mtctr r8
35 add r9,r0,r9
36reloc_got2_loop:
37 lwz r8,0(r9)
38 add r8,r8,r0
39 stw r8,0(r9)
40 addi r9,r9,4
41 bdnz reloc_got2_loop
42
43clear_caches:
17 lis r9,_start@h 44 lis r9,_start@h
45 add r9,r0,r9
18 lis r8,_etext@ha 46 lis r8,_etext@ha
19 addi r8,r8,_etext@l 47 addi r8,r8,_etext@l
48 add r8,r0,r8
201: dcbf r0,r9 491: dcbf r0,r9
21 icbi r0,r9 50 icbi r0,r9
22 addi r9,r9,0x20 51 addi r9,r9,0x20
@@ -25,24 +54,6 @@ _start:
25 sync 54 sync
26 isync 55 isync
27 56
28 ## Clear out the BSS as per ANSI C requirements 57 mr r6,r1
29
30 lis r7,_end@ha
31 addi r7,r7,_end@l # r7 = &_end
32 lis r8,__bss_start@ha #
33 addi r8,r8,__bss_start@l # r8 = &_bss_start
34
35 ## Determine how large an area, in number of words, to clear
36
37 subf r7,r8,r7 # r7 = &_end - &_bss_start + 1
38 addi r7,r7,3 # r7 += 3
39 srwi. r7,r7,2 # r7 = size in words.
40 beq 3f # If the size is zero, don't bother
41 addi r8,r8,-4 # r8 -= 4
42 mtctr r7 # SPRN_CTR = number of words to clear
43 li r0,0 # r0 = 0
442: stwu r0,4(r8) # Clear out a word
45 bdnz 2b # Keep clearing until done
463:
47 b start 58 b start
48 59
diff --git a/arch/ppc64/boot/install.sh b/arch/ppc64/boot/install.sh
index cb2d6626b555..eacce9590816 100644
--- a/arch/ppc64/boot/install.sh
+++ b/arch/ppc64/boot/install.sh
@@ -28,7 +28,7 @@ if [ -x /sbin/${CROSS_COMPILE}installkernel ]; then exec /sbin/${CROSS_COMPILE}i
28# Default install 28# Default install
29 29
30# this should work for both the pSeries zImage and the iSeries vmlinux.sm 30# this should work for both the pSeries zImage and the iSeries vmlinux.sm
31image_name=`basename $5` 31image_name=`basename $2`
32 32
33if [ -f $4/$image_name ]; then 33if [ -f $4/$image_name ]; then
34 mv $4/$image_name $4/$image_name.old 34 mv $4/$image_name $4/$image_name.old
diff --git a/arch/ppc64/boot/main.c b/arch/ppc64/boot/main.c
index f7ec19a2d0b0..c1dc876bccab 100644
--- a/arch/ppc64/boot/main.c
+++ b/arch/ppc64/boot/main.c
@@ -17,7 +17,6 @@
17#include "prom.h" 17#include "prom.h"
18#include "zlib.h" 18#include "zlib.h"
19 19
20static void gunzip(void *, int, unsigned char *, int *);
21extern void flush_cache(void *, unsigned long); 20extern void flush_cache(void *, unsigned long);
22 21
23 22
@@ -26,31 +25,26 @@ extern void flush_cache(void *, unsigned long);
26#define RAM_END (512<<20) // Fixme: use OF */ 25#define RAM_END (512<<20) // Fixme: use OF */
27#define ONE_MB 0x100000 26#define ONE_MB 0x100000
28 27
29static char *avail_ram;
30static char *begin_avail, *end_avail;
31static char *avail_high;
32static unsigned int heap_use;
33static unsigned int heap_max;
34
35extern char _start[]; 28extern char _start[];
29extern char __bss_start[];
36extern char _end[]; 30extern char _end[];
37extern char _vmlinux_start[]; 31extern char _vmlinux_start[];
38extern char _vmlinux_end[]; 32extern char _vmlinux_end[];
39extern char _initrd_start[]; 33extern char _initrd_start[];
40extern char _initrd_end[]; 34extern char _initrd_end[];
41extern unsigned long vmlinux_filesize;
42extern unsigned long vmlinux_memsize;
43 35
44struct addr_range { 36struct addr_range {
45 unsigned long addr; 37 unsigned long addr;
46 unsigned long size; 38 unsigned long size;
47 unsigned long memsize; 39 unsigned long memsize;
48}; 40};
49static struct addr_range vmlinux = {0, 0, 0}; 41static struct addr_range vmlinux;
50static struct addr_range vmlinuz = {0, 0, 0}; 42static struct addr_range vmlinuz;
51static struct addr_range initrd = {0, 0, 0}; 43static struct addr_range initrd;
44
45static char scratch[46912]; /* scratch space for gunzip, from zlib_inflate_workspacesize() */
46static char elfheader[256];
52 47
53static char scratch[128<<10]; /* 128kB of scratch space for gunzip */
54 48
55typedef void (*kernel_entry_t)( unsigned long, 49typedef void (*kernel_entry_t)( unsigned long,
56 unsigned long, 50 unsigned long,
@@ -62,6 +56,63 @@ typedef void (*kernel_entry_t)( unsigned long,
62 56
63static unsigned long claim_base; 57static unsigned long claim_base;
64 58
59#define HEAD_CRC 2
60#define EXTRA_FIELD 4
61#define ORIG_NAME 8
62#define COMMENT 0x10
63#define RESERVED 0xe0
64
65static void gunzip(void *dst, int dstlen, unsigned char *src, int *lenp)
66{
67 z_stream s;
68 int r, i, flags;
69
70 /* skip header */
71 i = 10;
72 flags = src[3];
73 if (src[2] != Z_DEFLATED || (flags & RESERVED) != 0) {
74 printf("bad gzipped data\n\r");
75 exit();
76 }
77 if ((flags & EXTRA_FIELD) != 0)
78 i = 12 + src[10] + (src[11] << 8);
79 if ((flags & ORIG_NAME) != 0)
80 while (src[i++] != 0)
81 ;
82 if ((flags & COMMENT) != 0)
83 while (src[i++] != 0)
84 ;
85 if ((flags & HEAD_CRC) != 0)
86 i += 2;
87 if (i >= *lenp) {
88 printf("gunzip: ran out of data in header\n\r");
89 exit();
90 }
91
92 if (zlib_inflate_workspacesize() > sizeof(scratch)) {
93 printf("gunzip needs more mem\n");
94 exit();
95 }
96 memset(&s, 0, sizeof(s));
97 s.workspace = scratch;
98 r = zlib_inflateInit2(&s, -MAX_WBITS);
99 if (r != Z_OK) {
100 printf("inflateInit2 returned %d\n\r", r);
101 exit();
102 }
103 s.next_in = src + i;
104 s.avail_in = *lenp - i;
105 s.next_out = dst;
106 s.avail_out = dstlen;
107 r = zlib_inflate(&s, Z_FULL_FLUSH);
108 if (r != Z_OK && r != Z_STREAM_END) {
109 printf("inflate returned %d msg: %s\n\r", r, s.msg);
110 exit();
111 }
112 *lenp = s.next_out - (unsigned char *) dst;
113 zlib_inflateEnd(&s);
114}
115
65static unsigned long try_claim(unsigned long size) 116static unsigned long try_claim(unsigned long size)
66{ 117{
67 unsigned long addr = 0; 118 unsigned long addr = 0;
@@ -80,13 +131,16 @@ static unsigned long try_claim(unsigned long size)
80 return addr; 131 return addr;
81} 132}
82 133
83void start(unsigned long a1, unsigned long a2, void *promptr) 134void start(unsigned long a1, unsigned long a2, void *promptr, void *sp)
84{ 135{
85 unsigned long i; 136 unsigned long i;
137 int len;
86 kernel_entry_t kernel_entry; 138 kernel_entry_t kernel_entry;
87 Elf64_Ehdr *elf64; 139 Elf64_Ehdr *elf64;
88 Elf64_Phdr *elf64ph; 140 Elf64_Phdr *elf64ph;
89 141
142 memset(__bss_start, 0, _end - __bss_start);
143
90 prom = (int (*)(void *)) promptr; 144 prom = (int (*)(void *)) promptr;
91 chosen_handle = finddevice("/chosen"); 145 chosen_handle = finddevice("/chosen");
92 if (chosen_handle == (void *) -1) 146 if (chosen_handle == (void *) -1)
@@ -97,7 +151,7 @@ void start(unsigned long a1, unsigned long a2, void *promptr)
97 if (getprop(chosen_handle, "stdin", &stdin, sizeof(stdin)) != 4) 151 if (getprop(chosen_handle, "stdin", &stdin, sizeof(stdin)) != 4)
98 exit(); 152 exit();
99 153
100 printf("\n\rzImage starting: loaded at 0x%lx\n\r", (unsigned long) _start); 154 printf("\n\rzImage starting: loaded at 0x%p (sp: 0x%p)\n\r", _start, sp);
101 155
102 /* 156 /*
103 * The first available claim_base must be above the end of the 157 * The first available claim_base must be above the end of the
@@ -118,25 +172,45 @@ void start(unsigned long a1, unsigned long a2, void *promptr)
118 claim_base = PROG_START; 172 claim_base = PROG_START;
119#endif 173#endif
120 174
121 /* 175 vmlinuz.addr = (unsigned long)_vmlinux_start;
122 * Now we try to claim some memory for the kernel itself 176 vmlinuz.size = (unsigned long)(_vmlinux_end - _vmlinux_start);
123 * our "vmlinux_memsize" is the memory footprint in RAM, _HOWEVER_, what 177
124 * our Makefile stuffs in is an image containing all sort of junk including 178 /* gunzip the ELF header of the kernel */
125 * an ELF header. We need to do some calculations here to find the right 179 if (*(unsigned short *)vmlinuz.addr == 0x1f8b) {
126 * size... In practice we add 1Mb, that is enough, but we should really 180 len = vmlinuz.size;
127 * consider fixing the Makefile to put a _raw_ kernel in there ! 181 gunzip(elfheader, sizeof(elfheader),
128 */ 182 (unsigned char *)vmlinuz.addr, &len);
129 vmlinux_memsize += ONE_MB; 183 } else
130 printf("Allocating 0x%lx bytes for kernel ...\n\r", vmlinux_memsize); 184 memcpy(elfheader, (const void *)vmlinuz.addr, sizeof(elfheader));
131 vmlinux.addr = try_claim(vmlinux_memsize); 185
186 elf64 = (Elf64_Ehdr *)elfheader;
187 if ( elf64->e_ident[EI_MAG0] != ELFMAG0 ||
188 elf64->e_ident[EI_MAG1] != ELFMAG1 ||
189 elf64->e_ident[EI_MAG2] != ELFMAG2 ||
190 elf64->e_ident[EI_MAG3] != ELFMAG3 ||
191 elf64->e_ident[EI_CLASS] != ELFCLASS64 ||
192 elf64->e_ident[EI_DATA] != ELFDATA2MSB ||
193 elf64->e_type != ET_EXEC ||
194 elf64->e_machine != EM_PPC64 )
195 {
196 printf("Error: not a valid PPC64 ELF file!\n\r");
197 exit();
198 }
199
200 elf64ph = (Elf64_Phdr *)((unsigned long)elf64 +
201 (unsigned long)elf64->e_phoff);
202 for(i=0; i < (unsigned int)elf64->e_phnum ;i++,elf64ph++) {
203 if (elf64ph->p_type == PT_LOAD && elf64ph->p_offset != 0)
204 break;
205 }
206 vmlinux.size = (unsigned long)elf64ph->p_filesz;
207 vmlinux.memsize = (unsigned long)elf64ph->p_memsz;
208 printf("Allocating 0x%lx bytes for kernel ...\n\r", vmlinux.memsize);
209 vmlinux.addr = try_claim(vmlinux.memsize);
132 if (vmlinux.addr == 0) { 210 if (vmlinux.addr == 0) {
133 printf("Can't allocate memory for kernel image !\n\r"); 211 printf("Can't allocate memory for kernel image !\n\r");
134 exit(); 212 exit();
135 } 213 }
136 vmlinuz.addr = (unsigned long)_vmlinux_start;
137 vmlinuz.size = (unsigned long)(_vmlinux_end - _vmlinux_start);
138 vmlinux.size = PAGE_ALIGN(vmlinux_filesize);
139 vmlinux.memsize = vmlinux_memsize;
140 214
141 /* 215 /*
142 * Now we try to claim memory for the initrd (and copy it there) 216 * Now we try to claim memory for the initrd (and copy it there)
@@ -160,49 +234,22 @@ void start(unsigned long a1, unsigned long a2, void *promptr)
160 234
161 /* Eventually gunzip the kernel */ 235 /* Eventually gunzip the kernel */
162 if (*(unsigned short *)vmlinuz.addr == 0x1f8b) { 236 if (*(unsigned short *)vmlinuz.addr == 0x1f8b) {
163 int len;
164 avail_ram = scratch;
165 begin_avail = avail_high = avail_ram;
166 end_avail = scratch + sizeof(scratch);
167 printf("gunzipping (0x%lx <- 0x%lx:0x%0lx)...", 237 printf("gunzipping (0x%lx <- 0x%lx:0x%0lx)...",
168 vmlinux.addr, vmlinuz.addr, vmlinuz.addr+vmlinuz.size); 238 vmlinux.addr, vmlinuz.addr, vmlinuz.addr+vmlinuz.size);
169 len = vmlinuz.size; 239 len = vmlinuz.size;
170 gunzip((void *)vmlinux.addr, vmlinux.size, 240 gunzip((void *)vmlinux.addr, vmlinux.memsize,
171 (unsigned char *)vmlinuz.addr, &len); 241 (unsigned char *)vmlinuz.addr, &len);
172 printf("done 0x%lx bytes\n\r", len); 242 printf("done 0x%lx bytes\n\r", len);
173 printf("0x%x bytes of heap consumed, max in use 0x%x\n\r",
174 (unsigned)(avail_high - begin_avail), heap_max);
175 } else { 243 } else {
176 memmove((void *)vmlinux.addr,(void *)vmlinuz.addr,vmlinuz.size); 244 memmove((void *)vmlinux.addr,(void *)vmlinuz.addr,vmlinuz.size);
177 } 245 }
178 246
179 /* Skip over the ELF header */ 247 /* Skip over the ELF header */
180 elf64 = (Elf64_Ehdr *)vmlinux.addr;
181 if ( elf64->e_ident[EI_MAG0] != ELFMAG0 ||
182 elf64->e_ident[EI_MAG1] != ELFMAG1 ||
183 elf64->e_ident[EI_MAG2] != ELFMAG2 ||
184 elf64->e_ident[EI_MAG3] != ELFMAG3 ||
185 elf64->e_ident[EI_CLASS] != ELFCLASS64 ||
186 elf64->e_ident[EI_DATA] != ELFDATA2MSB ||
187 elf64->e_type != ET_EXEC ||
188 elf64->e_machine != EM_PPC64 )
189 {
190 printf("Error: not a valid PPC64 ELF file!\n\r");
191 exit();
192 }
193
194 elf64ph = (Elf64_Phdr *)((unsigned long)elf64 +
195 (unsigned long)elf64->e_phoff);
196 for(i=0; i < (unsigned int)elf64->e_phnum ;i++,elf64ph++) {
197 if (elf64ph->p_type == PT_LOAD && elf64ph->p_offset != 0)
198 break;
199 }
200#ifdef DEBUG 248#ifdef DEBUG
201 printf("... skipping 0x%lx bytes of ELF header\n\r", 249 printf("... skipping 0x%lx bytes of ELF header\n\r",
202 (unsigned long)elf64ph->p_offset); 250 (unsigned long)elf64ph->p_offset);
203#endif 251#endif
204 vmlinux.addr += (unsigned long)elf64ph->p_offset; 252 vmlinux.addr += (unsigned long)elf64ph->p_offset;
205 vmlinux.size -= (unsigned long)elf64ph->p_offset;
206 253
207 flush_cache((void *)vmlinux.addr, vmlinux.size); 254 flush_cache((void *)vmlinux.addr, vmlinux.size);
208 255
@@ -225,108 +272,3 @@ void start(unsigned long a1, unsigned long a2, void *promptr)
225 exit(); 272 exit();
226} 273}
227 274
228struct memchunk {
229 unsigned int size;
230 unsigned int pad;
231 struct memchunk *next;
232};
233
234static struct memchunk *freechunks;
235
236void *zalloc(void *x, unsigned items, unsigned size)
237{
238 void *p;
239 struct memchunk **mpp, *mp;
240
241 size *= items;
242 size = _ALIGN(size, sizeof(struct memchunk));
243 heap_use += size;
244 if (heap_use > heap_max)
245 heap_max = heap_use;
246 for (mpp = &freechunks; (mp = *mpp) != 0; mpp = &mp->next) {
247 if (mp->size == size) {
248 *mpp = mp->next;
249 return mp;
250 }
251 }
252 p = avail_ram;
253 avail_ram += size;
254 if (avail_ram > avail_high)
255 avail_high = avail_ram;
256 if (avail_ram > end_avail) {
257 printf("oops... out of memory\n\r");
258 pause();
259 }
260 return p;
261}
262
263void zfree(void *x, void *addr, unsigned nb)
264{
265 struct memchunk *mp = addr;
266
267 nb = _ALIGN(nb, sizeof(struct memchunk));
268 heap_use -= nb;
269 if (avail_ram == addr + nb) {
270 avail_ram = addr;
271 return;
272 }
273 mp->size = nb;
274 mp->next = freechunks;
275 freechunks = mp;
276}
277
278#define HEAD_CRC 2
279#define EXTRA_FIELD 4
280#define ORIG_NAME 8
281#define COMMENT 0x10
282#define RESERVED 0xe0
283
284#define DEFLATED 8
285
286static void gunzip(void *dst, int dstlen, unsigned char *src, int *lenp)
287{
288 z_stream s;
289 int r, i, flags;
290
291 /* skip header */
292 i = 10;
293 flags = src[3];
294 if (src[2] != DEFLATED || (flags & RESERVED) != 0) {
295 printf("bad gzipped data\n\r");
296 exit();
297 }
298 if ((flags & EXTRA_FIELD) != 0)
299 i = 12 + src[10] + (src[11] << 8);
300 if ((flags & ORIG_NAME) != 0)
301 while (src[i++] != 0)
302 ;
303 if ((flags & COMMENT) != 0)
304 while (src[i++] != 0)
305 ;
306 if ((flags & HEAD_CRC) != 0)
307 i += 2;
308 if (i >= *lenp) {
309 printf("gunzip: ran out of data in header\n\r");
310 exit();
311 }
312
313 s.zalloc = zalloc;
314 s.zfree = zfree;
315 r = inflateInit2(&s, -MAX_WBITS);
316 if (r != Z_OK) {
317 printf("inflateInit2 returned %d\n\r", r);
318 exit();
319 }
320 s.next_in = src + i;
321 s.avail_in = *lenp - i;
322 s.next_out = dst;
323 s.avail_out = dstlen;
324 r = inflate(&s, Z_FINISH);
325 if (r != Z_OK && r != Z_STREAM_END) {
326 printf("inflate returned %d msg: %s\n\r", r, s.msg);
327 exit();
328 }
329 *lenp = s.next_out - (unsigned char *) dst;
330 inflateEnd(&s);
331}
332
diff --git a/arch/ppc64/boot/string.S b/arch/ppc64/boot/string.S
index 7ade87ae7718..b1eeaed7db17 100644
--- a/arch/ppc64/boot/string.S
+++ b/arch/ppc64/boot/string.S
@@ -104,7 +104,7 @@ memmove:
104 104
105 .globl memcpy 105 .globl memcpy
106memcpy: 106memcpy:
107 rlwinm. r7,r5,32-3,3,31 /* r0 = r5 >> 3 */ 107 rlwinm. r7,r5,32-3,3,31 /* r7 = r5 >> 3 */
108 addi r6,r3,-4 108 addi r6,r3,-4
109 addi r4,r4,-4 109 addi r4,r4,-4
110 beq 2f /* if less than 8 bytes to do */ 110 beq 2f /* if less than 8 bytes to do */
@@ -146,7 +146,7 @@ memcpy:
146 146
147 .globl backwards_memcpy 147 .globl backwards_memcpy
148backwards_memcpy: 148backwards_memcpy:
149 rlwinm. r7,r5,32-3,3,31 /* r0 = r5 >> 3 */ 149 rlwinm. r7,r5,32-3,3,31 /* r7 = r5 >> 3 */
150 add r6,r3,r5 150 add r6,r3,r5
151 add r4,r4,r5 151 add r4,r4,r5
152 beq 2f 152 beq 2f
diff --git a/arch/ppc64/boot/string.h b/arch/ppc64/boot/string.h
index 9289258bcbd6..9fdff1cc0d70 100644
--- a/arch/ppc64/boot/string.h
+++ b/arch/ppc64/boot/string.h
@@ -1,5 +1,6 @@
1#ifndef _PPC_BOOT_STRING_H_ 1#ifndef _PPC_BOOT_STRING_H_
2#define _PPC_BOOT_STRING_H_ 2#define _PPC_BOOT_STRING_H_
3#include <stddef.h>
3 4
4extern char *strcpy(char *dest, const char *src); 5extern char *strcpy(char *dest, const char *src);
5extern char *strncpy(char *dest, const char *src, size_t n); 6extern char *strncpy(char *dest, const char *src, size_t n);
diff --git a/arch/ppc64/boot/zImage.lds b/arch/ppc64/boot/zImage.lds
index 8fe5e7071f54..4b6bb3ffe3dc 100644
--- a/arch/ppc64/boot/zImage.lds
+++ b/arch/ppc64/boot/zImage.lds
@@ -1,62 +1,24 @@
1OUTPUT_ARCH(powerpc:common) 1OUTPUT_ARCH(powerpc:common)
2SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib); 2ENTRY(_zimage_start)
3/* Do we need any of these for elf?
4 __DYNAMIC = 0; */
5SECTIONS 3SECTIONS
6{ 4{
7 /* Read-only sections, merged into text segment: */ 5 . = (4*1024*1024);
8 . = + SIZEOF_HEADERS; 6 _start = .;
9 .interp : { *(.interp) }
10 .hash : { *(.hash) }
11 .dynsym : { *(.dynsym) }
12 .dynstr : { *(.dynstr) }
13 .rel.text : { *(.rel.text) }
14 .rela.text : { *(.rela.text) }
15 .rel.data : { *(.rel.data) }
16 .rela.data : { *(.rela.data) }
17 .rel.rodata : { *(.rel.rodata) }
18 .rela.rodata : { *(.rela.rodata) }
19 .rel.got : { *(.rel.got) }
20 .rela.got : { *(.rela.got) }
21 .rel.ctors : { *(.rel.ctors) }
22 .rela.ctors : { *(.rela.ctors) }
23 .rel.dtors : { *(.rel.dtors) }
24 .rela.dtors : { *(.rela.dtors) }
25 .rel.bss : { *(.rel.bss) }
26 .rela.bss : { *(.rela.bss) }
27 .rel.plt : { *(.rel.plt) }
28 .rela.plt : { *(.rela.plt) }
29 .plt : { *(.plt) }
30 .text : 7 .text :
31 { 8 {
32 *(.text) 9 *(.text)
33 *(.fixup) 10 *(.fixup)
34 *(.got1)
35 } 11 }
36 . = ALIGN(4096);
37 _etext = .; 12 _etext = .;
38 PROVIDE (etext = .);
39 .rodata :
40 {
41 *(.rodata)
42 *(.rodata1)
43 }
44 .kstrtab : { *(.kstrtab) }
45 __vermagic : { *(__vermagic) }
46 .fini : { *(.fini) } =0
47 .ctors : { *(.ctors) }
48 .dtors : { *(.dtors) }
49 /* Read-write section, merged into data segment: */
50 . = ALIGN(4096); 13 . = ALIGN(4096);
51 .data : 14 .data :
52 { 15 {
53 *(.data) 16 *(.rodata*)
54 *(.data1) 17 *(.data*)
55 *(.sdata) 18 *(.sdata*)
56 *(.sdata2) 19 __got2_start = .;
57 *(.got.plt) *(.got) 20 *(.got2)
58 *(.dynamic) 21 __got2_end = .;
59 CONSTRUCTORS
60 } 22 }
61 23
62 . = ALIGN(4096); 24 . = ALIGN(4096);
@@ -71,20 +33,14 @@ SECTIONS
71 33
72 . = ALIGN(4096); 34 . = ALIGN(4096);
73 _edata = .; 35 _edata = .;
74 PROVIDE (edata = .);
75
76 .fixup : { *(.fixup) }
77 36
78 . = ALIGN(4096); 37 . = ALIGN(4096);
79 __bss_start = .; 38 __bss_start = .;
80 .bss : 39 .bss :
81 { 40 {
82 *(.sbss) *(.scommon) 41 *(.sbss)
83 *(.dynbss)
84 *(.bss) 42 *(.bss)
85 *(COMMON)
86 } 43 }
87 . = ALIGN(4096); 44 . = ALIGN(4096);
88 _end = . ; 45 _end = . ;
89 PROVIDE (end = .);
90} 46}
diff --git a/arch/ppc64/boot/zlib.c b/arch/ppc64/boot/zlib.c
deleted file mode 100644
index 0d910cd2079d..000000000000
--- a/arch/ppc64/boot/zlib.c
+++ /dev/null
@@ -1,2195 +0,0 @@
1/*
2 * This file is derived from various .h and .c files from the zlib-0.95
3 * distribution by Jean-loup Gailly and Mark Adler, with some additions
4 * by Paul Mackerras to aid in implementing Deflate compression and
5 * decompression for PPP packets. See zlib.h for conditions of
6 * distribution and use.
7 *
8 * Changes that have been made include:
9 * - changed functions not used outside this file to "local"
10 * - added minCompression parameter to deflateInit2
11 * - added Z_PACKET_FLUSH (see zlib.h for details)
12 * - added inflateIncomp
13 *
14 Copyright (C) 1995 Jean-loup Gailly and Mark Adler
15
16 This software is provided 'as-is', without any express or implied
17 warranty. In no event will the authors be held liable for any damages
18 arising from the use of this software.
19
20 Permission is granted to anyone to use this software for any purpose,
21 including commercial applications, and to alter it and redistribute it
22 freely, subject to the following restrictions:
23
24 1. The origin of this software must not be misrepresented; you must not
25 claim that you wrote the original software. If you use this software
26 in a product, an acknowledgment in the product documentation would be
27 appreciated but is not required.
28 2. Altered source versions must be plainly marked as such, and must not be
29 misrepresented as being the original software.
30 3. This notice may not be removed or altered from any source distribution.
31
32 Jean-loup Gailly Mark Adler
33 gzip@prep.ai.mit.edu madler@alumni.caltech.edu
34
35 *
36 *
37 */
38
39/*+++++*/
40/* zutil.h -- internal interface and configuration of the compression library
41 * Copyright (C) 1995 Jean-loup Gailly.
42 * For conditions of distribution and use, see copyright notice in zlib.h
43 */
44
45/* WARNING: this file should *not* be used by applications. It is
46 part of the implementation of the compression library and is
47 subject to change. Applications should only use zlib.h.
48 */
49
50/* From: zutil.h,v 1.9 1995/05/03 17:27:12 jloup Exp */
51
52#define _Z_UTIL_H
53
54#include "zlib.h"
55
56#ifndef local
57# define local static
58#endif
59/* compile with -Dlocal if your debugger can't find static symbols */
60
61#define FAR
62
63typedef unsigned char uch;
64typedef uch FAR uchf;
65typedef unsigned short ush;
66typedef ush FAR ushf;
67typedef unsigned long ulg;
68
69extern char *z_errmsg[]; /* indexed by 1-zlib_error */
70
71#define ERR_RETURN(strm,err) return (strm->msg=z_errmsg[1-err], err)
72/* To be used only when the state is known to be valid */
73
74#ifndef NULL
75#define NULL ((void *) 0)
76#endif
77
78 /* common constants */
79
80#define DEFLATED 8
81
82#ifndef DEF_WBITS
83# define DEF_WBITS MAX_WBITS
84#endif
85/* default windowBits for decompression. MAX_WBITS is for compression only */
86
87#if MAX_MEM_LEVEL >= 8
88# define DEF_MEM_LEVEL 8
89#else
90# define DEF_MEM_LEVEL MAX_MEM_LEVEL
91#endif
92/* default memLevel */
93
94#define STORED_BLOCK 0
95#define STATIC_TREES 1
96#define DYN_TREES 2
97/* The three kinds of block type */
98
99#define MIN_MATCH 3
100#define MAX_MATCH 258
101/* The minimum and maximum match lengths */
102
103 /* functions */
104
105extern void *memcpy(void *, const void *, unsigned long);
106#define zmemcpy memcpy
107
108/* Diagnostic functions */
109#ifdef DEBUG_ZLIB
110# include "stdio.h"
111# ifndef verbose
112# define verbose 0
113# endif
114# define Assert(cond,msg) {if(!(cond)) z_error(msg);}
115# define Trace(x) fprintf x
116# define Tracev(x) {if (verbose) fprintf x ;}
117# define Tracevv(x) {if (verbose>1) fprintf x ;}
118# define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
119# define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
120#else
121# define Assert(cond,msg)
122# define Trace(x)
123# define Tracev(x)
124# define Tracevv(x)
125# define Tracec(c,x)
126# define Tracecv(c,x)
127#endif
128
129
130typedef uLong (*check_func) OF((uLong check, Bytef *buf, uInt len));
131
132/* voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size)); */
133/* void zcfree OF((voidpf opaque, voidpf ptr)); */
134
135#define ZALLOC(strm, items, size) \
136 (*((strm)->zalloc))((strm)->opaque, (items), (size))
137#define ZFREE(strm, addr, size) \
138 (*((strm)->zfree))((strm)->opaque, (voidpf)(addr), (size))
139#define TRY_FREE(s, p, n) {if (p) ZFREE(s, p, n);}
140
141/* deflate.h -- internal compression state
142 * Copyright (C) 1995 Jean-loup Gailly
143 * For conditions of distribution and use, see copyright notice in zlib.h
144 */
145
146/* WARNING: this file should *not* be used by applications. It is
147 part of the implementation of the compression library and is
148 subject to change. Applications should only use zlib.h.
149 */
150
151/*+++++*/
152/* infblock.h -- header to use infblock.c
153 * Copyright (C) 1995 Mark Adler
154 * For conditions of distribution and use, see copyright notice in zlib.h
155 */
156
157/* WARNING: this file should *not* be used by applications. It is
158 part of the implementation of the compression library and is
159 subject to change. Applications should only use zlib.h.
160 */
161
162struct inflate_blocks_state;
163typedef struct inflate_blocks_state FAR inflate_blocks_statef;
164
165local inflate_blocks_statef * inflate_blocks_new OF((
166 z_stream *z,
167 check_func c, /* check function */
168 uInt w)); /* window size */
169
170local int inflate_blocks OF((
171 inflate_blocks_statef *,
172 z_stream *,
173 int)); /* initial return code */
174
175local void inflate_blocks_reset OF((
176 inflate_blocks_statef *,
177 z_stream *,
178 uLongf *)); /* check value on output */
179
180local int inflate_blocks_free OF((
181 inflate_blocks_statef *,
182 z_stream *,
183 uLongf *)); /* check value on output */
184
185local int inflate_addhistory OF((
186 inflate_blocks_statef *,
187 z_stream *));
188
189local int inflate_packet_flush OF((
190 inflate_blocks_statef *));
191
192/*+++++*/
193/* inftrees.h -- header to use inftrees.c
194 * Copyright (C) 1995 Mark Adler
195 * For conditions of distribution and use, see copyright notice in zlib.h
196 */
197
198/* WARNING: this file should *not* be used by applications. It is
199 part of the implementation of the compression library and is
200 subject to change. Applications should only use zlib.h.
201 */
202
203/* Huffman code lookup table entry--this entry is four bytes for machines
204 that have 16-bit pointers (e.g. PC's in the small or medium model). */
205
206typedef struct inflate_huft_s FAR inflate_huft;
207
208struct inflate_huft_s {
209 union {
210 struct {
211 Byte Exop; /* number of extra bits or operation */
212 Byte Bits; /* number of bits in this code or subcode */
213 } what;
214 uInt Nalloc; /* number of these allocated here */
215 Bytef *pad; /* pad structure to a power of 2 (4 bytes for */
216 } word; /* 16-bit, 8 bytes for 32-bit machines) */
217 union {
218 uInt Base; /* literal, length base, or distance base */
219 inflate_huft *Next; /* pointer to next level of table */
220 } more;
221};
222
223#ifdef DEBUG_ZLIB
224 local uInt inflate_hufts;
225#endif
226
227local int inflate_trees_bits OF((
228 uIntf *, /* 19 code lengths */
229 uIntf *, /* bits tree desired/actual depth */
230 inflate_huft * FAR *, /* bits tree result */
231 z_stream *)); /* for zalloc, zfree functions */
232
233local int inflate_trees_dynamic OF((
234 uInt, /* number of literal/length codes */
235 uInt, /* number of distance codes */
236 uIntf *, /* that many (total) code lengths */
237 uIntf *, /* literal desired/actual bit depth */
238 uIntf *, /* distance desired/actual bit depth */
239 inflate_huft * FAR *, /* literal/length tree result */
240 inflate_huft * FAR *, /* distance tree result */
241 z_stream *)); /* for zalloc, zfree functions */
242
243local int inflate_trees_fixed OF((
244 uIntf *, /* literal desired/actual bit depth */
245 uIntf *, /* distance desired/actual bit depth */
246 inflate_huft * FAR *, /* literal/length tree result */
247 inflate_huft * FAR *)); /* distance tree result */
248
249local int inflate_trees_free OF((
250 inflate_huft *, /* tables to free */
251 z_stream *)); /* for zfree function */
252
253
254/*+++++*/
255/* infcodes.h -- header to use infcodes.c
256 * Copyright (C) 1995 Mark Adler
257 * For conditions of distribution and use, see copyright notice in zlib.h
258 */
259
260/* WARNING: this file should *not* be used by applications. It is
261 part of the implementation of the compression library and is
262 subject to change. Applications should only use zlib.h.
263 */
264
265struct inflate_codes_state;
266typedef struct inflate_codes_state FAR inflate_codes_statef;
267
268local inflate_codes_statef *inflate_codes_new OF((
269 uInt, uInt,
270 inflate_huft *, inflate_huft *,
271 z_stream *));
272
273local int inflate_codes OF((
274 inflate_blocks_statef *,
275 z_stream *,
276 int));
277
278local void inflate_codes_free OF((
279 inflate_codes_statef *,
280 z_stream *));
281
282
283/*+++++*/
284/* inflate.c -- zlib interface to inflate modules
285 * Copyright (C) 1995 Mark Adler
286 * For conditions of distribution and use, see copyright notice in zlib.h
287 */
288
289/* inflate private state */
290struct internal_state {
291
292 /* mode */
293 enum {
294 METHOD, /* waiting for method byte */
295 FLAG, /* waiting for flag byte */
296 BLOCKS, /* decompressing blocks */
297 CHECK4, /* four check bytes to go */
298 CHECK3, /* three check bytes to go */
299 CHECK2, /* two check bytes to go */
300 CHECK1, /* one check byte to go */
301 DONE, /* finished check, done */
302 BAD} /* got an error--stay here */
303 mode; /* current inflate mode */
304
305 /* mode dependent information */
306 union {
307 uInt method; /* if FLAGS, method byte */
308 struct {
309 uLong was; /* computed check value */
310 uLong need; /* stream check value */
311 } check; /* if CHECK, check values to compare */
312 uInt marker; /* if BAD, inflateSync's marker bytes count */
313 } sub; /* submode */
314
315 /* mode independent information */
316 int nowrap; /* flag for no wrapper */
317 uInt wbits; /* log2(window size) (8..15, defaults to 15) */
318 inflate_blocks_statef
319 *blocks; /* current inflate_blocks state */
320
321};
322
323
324int inflateReset(
325 z_stream *z
326)
327{
328 uLong c;
329
330 if (z == Z_NULL || z->state == Z_NULL)
331 return Z_STREAM_ERROR;
332 z->total_in = z->total_out = 0;
333 z->msg = Z_NULL;
334 z->state->mode = z->state->nowrap ? BLOCKS : METHOD;
335 inflate_blocks_reset(z->state->blocks, z, &c);
336 Trace((stderr, "inflate: reset\n"));
337 return Z_OK;
338}
339
340
341int inflateEnd(
342 z_stream *z
343)
344{
345 uLong c;
346
347 if (z == Z_NULL || z->state == Z_NULL || z->zfree == Z_NULL)
348 return Z_STREAM_ERROR;
349 if (z->state->blocks != Z_NULL)
350 inflate_blocks_free(z->state->blocks, z, &c);
351 ZFREE(z, z->state, sizeof(struct internal_state));
352 z->state = Z_NULL;
353 Trace((stderr, "inflate: end\n"));
354 return Z_OK;
355}
356
357
358int inflateInit2(
359 z_stream *z,
360 int w
361)
362{
363 /* initialize state */
364 if (z == Z_NULL)
365 return Z_STREAM_ERROR;
366/* if (z->zalloc == Z_NULL) z->zalloc = zcalloc; */
367/* if (z->zfree == Z_NULL) z->zfree = zcfree; */
368 if ((z->state = (struct internal_state FAR *)
369 ZALLOC(z,1,sizeof(struct internal_state))) == Z_NULL)
370 return Z_MEM_ERROR;
371 z->state->blocks = Z_NULL;
372
373 /* handle undocumented nowrap option (no zlib header or check) */
374 z->state->nowrap = 0;
375 if (w < 0)
376 {
377 w = - w;
378 z->state->nowrap = 1;
379 }
380
381 /* set window size */
382 if (w < 8 || w > 15)
383 {
384 inflateEnd(z);
385 return Z_STREAM_ERROR;
386 }
387 z->state->wbits = (uInt)w;
388
389 /* create inflate_blocks state */
390 if ((z->state->blocks =
391 inflate_blocks_new(z, z->state->nowrap ? Z_NULL : adler32, 1 << w))
392 == Z_NULL)
393 {
394 inflateEnd(z);
395 return Z_MEM_ERROR;
396 }
397 Trace((stderr, "inflate: allocated\n"));
398
399 /* reset state */
400 inflateReset(z);
401 return Z_OK;
402}
403
404
405int inflateInit(
406 z_stream *z
407)
408{
409 return inflateInit2(z, DEF_WBITS);
410}
411
412
413#define NEEDBYTE {if(z->avail_in==0)goto empty;r=Z_OK;}
414#define NEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++)
415
416int inflate(
417 z_stream *z,
418 int f
419)
420{
421 int r;
422 uInt b;
423
424 if (z == Z_NULL || z->next_in == Z_NULL)
425 return Z_STREAM_ERROR;
426 r = Z_BUF_ERROR;
427 while (1) switch (z->state->mode)
428 {
429 case METHOD:
430 NEEDBYTE
431 if (((z->state->sub.method = NEXTBYTE) & 0xf) != DEFLATED)
432 {
433 z->state->mode = BAD;
434 z->msg = "unknown compression method";
435 z->state->sub.marker = 5; /* can't try inflateSync */
436 break;
437 }
438 if ((z->state->sub.method >> 4) + 8 > z->state->wbits)
439 {
440 z->state->mode = BAD;
441 z->msg = "invalid window size";
442 z->state->sub.marker = 5; /* can't try inflateSync */
443 break;
444 }
445 z->state->mode = FLAG;
446 case FLAG:
447 NEEDBYTE
448 if ((b = NEXTBYTE) & 0x20)
449 {
450 z->state->mode = BAD;
451 z->msg = "invalid reserved bit";
452 z->state->sub.marker = 5; /* can't try inflateSync */
453 break;
454 }
455 if (((z->state->sub.method << 8) + b) % 31)
456 {
457 z->state->mode = BAD;
458 z->msg = "incorrect header check";
459 z->state->sub.marker = 5; /* can't try inflateSync */
460 break;
461 }
462 Trace((stderr, "inflate: zlib header ok\n"));
463 z->state->mode = BLOCKS;
464 case BLOCKS:
465 r = inflate_blocks(z->state->blocks, z, r);
466 if (f == Z_PACKET_FLUSH && z->avail_in == 0 && z->avail_out != 0)
467 r = inflate_packet_flush(z->state->blocks);
468 if (r == Z_DATA_ERROR)
469 {
470 z->state->mode = BAD;
471 z->state->sub.marker = 0; /* can try inflateSync */
472 break;
473 }
474 if (r != Z_STREAM_END)
475 return r;
476 r = Z_OK;
477 inflate_blocks_reset(z->state->blocks, z, &z->state->sub.check.was);
478 if (z->state->nowrap)
479 {
480 z->state->mode = DONE;
481 break;
482 }
483 z->state->mode = CHECK4;
484 case CHECK4:
485 NEEDBYTE
486 z->state->sub.check.need = (uLong)NEXTBYTE << 24;
487 z->state->mode = CHECK3;
488 case CHECK3:
489 NEEDBYTE
490 z->state->sub.check.need += (uLong)NEXTBYTE << 16;
491 z->state->mode = CHECK2;
492 case CHECK2:
493 NEEDBYTE
494 z->state->sub.check.need += (uLong)NEXTBYTE << 8;
495 z->state->mode = CHECK1;
496 case CHECK1:
497 NEEDBYTE
498 z->state->sub.check.need += (uLong)NEXTBYTE;
499
500 if (z->state->sub.check.was != z->state->sub.check.need)
501 {
502 z->state->mode = BAD;
503 z->msg = "incorrect data check";
504 z->state->sub.marker = 5; /* can't try inflateSync */
505 break;
506 }
507 Trace((stderr, "inflate: zlib check ok\n"));
508 z->state->mode = DONE;
509 case DONE:
510 return Z_STREAM_END;
511 case BAD:
512 return Z_DATA_ERROR;
513 default:
514 return Z_STREAM_ERROR;
515 }
516
517 empty:
518 if (f != Z_PACKET_FLUSH)
519 return r;
520 z->state->mode = BAD;
521 z->state->sub.marker = 0; /* can try inflateSync */
522 return Z_DATA_ERROR;
523}
524
525/*
526 * This subroutine adds the data at next_in/avail_in to the output history
527 * without performing any output. The output buffer must be "caught up";
528 * i.e. no pending output (hence s->read equals s->write), and the state must
529 * be BLOCKS (i.e. we should be willing to see the start of a series of
530 * BLOCKS). On exit, the output will also be caught up, and the checksum
531 * will have been updated if need be.
532 */
533
534int inflateIncomp(
535 z_stream *z
536)
537{
538 if (z->state->mode != BLOCKS)
539 return Z_DATA_ERROR;
540 return inflate_addhistory(z->state->blocks, z);
541}
542
543
544int inflateSync(
545 z_stream *z
546)
547{
548 uInt n; /* number of bytes to look at */
549 Bytef *p; /* pointer to bytes */
550 uInt m; /* number of marker bytes found in a row */
551 uLong r, w; /* temporaries to save total_in and total_out */
552
553 /* set up */
554 if (z == Z_NULL || z->state == Z_NULL)
555 return Z_STREAM_ERROR;
556 if (z->state->mode != BAD)
557 {
558 z->state->mode = BAD;
559 z->state->sub.marker = 0;
560 }
561 if ((n = z->avail_in) == 0)
562 return Z_BUF_ERROR;
563 p = z->next_in;
564 m = z->state->sub.marker;
565
566 /* search */
567 while (n && m < 4)
568 {
569 if (*p == (Byte)(m < 2 ? 0 : 0xff))
570 m++;
571 else if (*p)
572 m = 0;
573 else
574 m = 4 - m;
575 p++, n--;
576 }
577
578 /* restore */
579 z->total_in += p - z->next_in;
580 z->next_in = p;
581 z->avail_in = n;
582 z->state->sub.marker = m;
583
584 /* return no joy or set up to restart on a new block */
585 if (m != 4)
586 return Z_DATA_ERROR;
587 r = z->total_in; w = z->total_out;
588 inflateReset(z);
589 z->total_in = r; z->total_out = w;
590 z->state->mode = BLOCKS;
591 return Z_OK;
592}
593
594#undef NEEDBYTE
595#undef NEXTBYTE
596
597/*+++++*/
598/* infutil.h -- types and macros common to blocks and codes
599 * Copyright (C) 1995 Mark Adler
600 * For conditions of distribution and use, see copyright notice in zlib.h
601 */
602
603/* WARNING: this file should *not* be used by applications. It is
604 part of the implementation of the compression library and is
605 subject to change. Applications should only use zlib.h.
606 */
607
608/* inflate blocks semi-private state */
609struct inflate_blocks_state {
610
611 /* mode */
612 enum {
613 TYPE, /* get type bits (3, including end bit) */
614 LENS, /* get lengths for stored */
615 STORED, /* processing stored block */
616 TABLE, /* get table lengths */
617 BTREE, /* get bit lengths tree for a dynamic block */
618 DTREE, /* get length, distance trees for a dynamic block */
619 CODES, /* processing fixed or dynamic block */
620 DRY, /* output remaining window bytes */
621 DONEB, /* finished last block, done */
622 BADB} /* got a data error--stuck here */
623 mode; /* current inflate_block mode */
624
625 /* mode dependent information */
626 union {
627 uInt left; /* if STORED, bytes left to copy */
628 struct {
629 uInt table; /* table lengths (14 bits) */
630 uInt index; /* index into blens (or border) */
631 uIntf *blens; /* bit lengths of codes */
632 uInt bb; /* bit length tree depth */
633 inflate_huft *tb; /* bit length decoding tree */
634 int nblens; /* # elements allocated at blens */
635 } trees; /* if DTREE, decoding info for trees */
636 struct {
637 inflate_huft *tl, *td; /* trees to free */
638 inflate_codes_statef
639 *codes;
640 } decode; /* if CODES, current state */
641 } sub; /* submode */
642 uInt last; /* true if this block is the last block */
643
644 /* mode independent information */
645 uInt bitk; /* bits in bit buffer */
646 uLong bitb; /* bit buffer */
647 Bytef *window; /* sliding window */
648 Bytef *end; /* one byte after sliding window */
649 Bytef *read; /* window read pointer */
650 Bytef *write; /* window write pointer */
651 check_func checkfn; /* check function */
652 uLong check; /* check on output */
653
654};
655
656
657/* defines for inflate input/output */
658/* update pointers and return */
659#define UPDBITS {s->bitb=b;s->bitk=k;}
660#define UPDIN {z->avail_in=n;z->total_in+=p-z->next_in;z->next_in=p;}
661#define UPDOUT {s->write=q;}
662#define UPDATE {UPDBITS UPDIN UPDOUT}
663#define LEAVE {UPDATE return inflate_flush(s,z,r);}
664/* get bytes and bits */
665#define LOADIN {p=z->next_in;n=z->avail_in;b=s->bitb;k=s->bitk;}
666#define NEEDBYTE {if(n)r=Z_OK;else LEAVE}
667#define NEXTBYTE (n--,*p++)
668#define NEEDBITS(j) {while(k<(j)){NEEDBYTE;b|=((uLong)NEXTBYTE)<<k;k+=8;}}
669#define DUMPBITS(j) {b>>=(j);k-=(j);}
670/* output bytes */
671#define WAVAIL (q<s->read?s->read-q-1:s->end-q)
672#define LOADOUT {q=s->write;m=WAVAIL;}
673#define WRAP {if(q==s->end&&s->read!=s->window){q=s->window;m=WAVAIL;}}
674#define FLUSH {UPDOUT r=inflate_flush(s,z,r); LOADOUT}
675#define NEEDOUT {if(m==0){WRAP if(m==0){FLUSH WRAP if(m==0) LEAVE}}r=Z_OK;}
676#define OUTBYTE(a) {*q++=(Byte)(a);m--;}
677/* load local pointers */
678#define LOAD {LOADIN LOADOUT}
679
680/* And'ing with mask[n] masks the lower n bits */
681local uInt inflate_mask[] = {
682 0x0000,
683 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,
684 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
685};
686
687/* copy as much as possible from the sliding window to the output area */
688local int inflate_flush OF((
689 inflate_blocks_statef *,
690 z_stream *,
691 int));
692
693/*+++++*/
694/* inffast.h -- header to use inffast.c
695 * Copyright (C) 1995 Mark Adler
696 * For conditions of distribution and use, see copyright notice in zlib.h
697 */
698
699/* WARNING: this file should *not* be used by applications. It is
700 part of the implementation of the compression library and is
701 subject to change. Applications should only use zlib.h.
702 */
703
704local int inflate_fast OF((
705 uInt,
706 uInt,
707 inflate_huft *,
708 inflate_huft *,
709 inflate_blocks_statef *,
710 z_stream *));
711
712
713/*+++++*/
714/* infblock.c -- interpret and process block types to last block
715 * Copyright (C) 1995 Mark Adler
716 * For conditions of distribution and use, see copyright notice in zlib.h
717 */
718
719/* Table for deflate from PKZIP's appnote.txt. */
720local uInt border[] = { /* Order of the bit length code lengths */
721 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
722
723/*
724 Notes beyond the 1.93a appnote.txt:
725
726 1. Distance pointers never point before the beginning of the output
727 stream.
728 2. Distance pointers can point back across blocks, up to 32k away.
729 3. There is an implied maximum of 7 bits for the bit length table and
730 15 bits for the actual data.
731 4. If only one code exists, then it is encoded using one bit. (Zero
732 would be more efficient, but perhaps a little confusing.) If two
733 codes exist, they are coded using one bit each (0 and 1).
734 5. There is no way of sending zero distance codes--a dummy must be
735 sent if there are none. (History: a pre 2.0 version of PKZIP would
736 store blocks with no distance codes, but this was discovered to be
737 too harsh a criterion.) Valid only for 1.93a. 2.04c does allow
738 zero distance codes, which is sent as one code of zero bits in
739 length.
740 6. There are up to 286 literal/length codes. Code 256 represents the
741 end-of-block. Note however that the static length tree defines
742 288 codes just to fill out the Huffman codes. Codes 286 and 287
743 cannot be used though, since there is no length base or extra bits
744 defined for them. Similarily, there are up to 30 distance codes.
745 However, static trees define 32 codes (all 5 bits) to fill out the
746 Huffman codes, but the last two had better not show up in the data.
747 7. Unzip can check dynamic Huffman blocks for complete code sets.
748 The exception is that a single code would not be complete (see #4).
749 8. The five bits following the block type is really the number of
750 literal codes sent minus 257.
751 9. Length codes 8,16,16 are interpreted as 13 length codes of 8 bits
752 (1+6+6). Therefore, to output three times the length, you output
753 three codes (1+1+1), whereas to output four times the same length,
754 you only need two codes (1+3). Hmm.
755 10. In the tree reconstruction algorithm, Code = Code + Increment
756 only if BitLength(i) is not zero. (Pretty obvious.)
757 11. Correction: 4 Bits: # of Bit Length codes - 4 (4 - 19)
758 12. Note: length code 284 can represent 227-258, but length code 285
759 really is 258. The last length deserves its own, short code
760 since it gets used a lot in very redundant files. The length
761 258 is special since 258 - 3 (the min match length) is 255.
762 13. The literal/length and distance code bit lengths are read as a
763 single stream of lengths. It is possible (and advantageous) for
764 a repeat code (16, 17, or 18) to go across the boundary between
765 the two sets of lengths.
766 */
767
768
769local void inflate_blocks_reset(
770 inflate_blocks_statef *s,
771 z_stream *z,
772 uLongf *c
773)
774{
775 if (s->checkfn != Z_NULL)
776 *c = s->check;
777 if (s->mode == BTREE || s->mode == DTREE)
778 ZFREE(z, s->sub.trees.blens, s->sub.trees.nblens * sizeof(uInt));
779 if (s->mode == CODES)
780 {
781 inflate_codes_free(s->sub.decode.codes, z);
782 inflate_trees_free(s->sub.decode.td, z);
783 inflate_trees_free(s->sub.decode.tl, z);
784 }
785 s->mode = TYPE;
786 s->bitk = 0;
787 s->bitb = 0;
788 s->read = s->write = s->window;
789 if (s->checkfn != Z_NULL)
790 s->check = (*s->checkfn)(0L, Z_NULL, 0);
791 Trace((stderr, "inflate: blocks reset\n"));
792}
793
794
795local inflate_blocks_statef *inflate_blocks_new(
796 z_stream *z,
797 check_func c,
798 uInt w
799)
800{
801 inflate_blocks_statef *s;
802
803 if ((s = (inflate_blocks_statef *)ZALLOC
804 (z,1,sizeof(struct inflate_blocks_state))) == Z_NULL)
805 return s;
806 if ((s->window = (Bytef *)ZALLOC(z, 1, w)) == Z_NULL)
807 {
808 ZFREE(z, s, sizeof(struct inflate_blocks_state));
809 return Z_NULL;
810 }
811 s->end = s->window + w;
812 s->checkfn = c;
813 s->mode = TYPE;
814 Trace((stderr, "inflate: blocks allocated\n"));
815 inflate_blocks_reset(s, z, &s->check);
816 return s;
817}
818
819
820local int inflate_blocks(
821 inflate_blocks_statef *s,
822 z_stream *z,
823 int r
824)
825{
826 uInt t; /* temporary storage */
827 uLong b; /* bit buffer */
828 uInt k; /* bits in bit buffer */
829 Bytef *p; /* input data pointer */
830 uInt n; /* bytes available there */
831 Bytef *q; /* output window write pointer */
832 uInt m; /* bytes to end of window or read pointer */
833
834 /* copy input/output information to locals (UPDATE macro restores) */
835 LOAD
836
837 /* process input based on current state */
838 while (1) switch (s->mode)
839 {
840 case TYPE:
841 NEEDBITS(3)
842 t = (uInt)b & 7;
843 s->last = t & 1;
844 switch (t >> 1)
845 {
846 case 0: /* stored */
847 Trace((stderr, "inflate: stored block%s\n",
848 s->last ? " (last)" : ""));
849 DUMPBITS(3)
850 t = k & 7; /* go to byte boundary */
851 DUMPBITS(t)
852 s->mode = LENS; /* get length of stored block */
853 break;
854 case 1: /* fixed */
855 Trace((stderr, "inflate: fixed codes block%s\n",
856 s->last ? " (last)" : ""));
857 {
858 uInt bl, bd;
859 inflate_huft *tl, *td;
860
861 inflate_trees_fixed(&bl, &bd, &tl, &td);
862 s->sub.decode.codes = inflate_codes_new(bl, bd, tl, td, z);
863 if (s->sub.decode.codes == Z_NULL)
864 {
865 r = Z_MEM_ERROR;
866 LEAVE
867 }
868 s->sub.decode.tl = Z_NULL; /* don't try to free these */
869 s->sub.decode.td = Z_NULL;
870 }
871 DUMPBITS(3)
872 s->mode = CODES;
873 break;
874 case 2: /* dynamic */
875 Trace((stderr, "inflate: dynamic codes block%s\n",
876 s->last ? " (last)" : ""));
877 DUMPBITS(3)
878 s->mode = TABLE;
879 break;
880 case 3: /* illegal */
881 DUMPBITS(3)
882 s->mode = BADB;
883 z->msg = "invalid block type";
884 r = Z_DATA_ERROR;
885 LEAVE
886 }
887 break;
888 case LENS:
889 NEEDBITS(32)
890 if (((~b) >> 16) != (b & 0xffff))
891 {
892 s->mode = BADB;
893 z->msg = "invalid stored block lengths";
894 r = Z_DATA_ERROR;
895 LEAVE
896 }
897 s->sub.left = (uInt)b & 0xffff;
898 b = k = 0; /* dump bits */
899 Tracev((stderr, "inflate: stored length %u\n", s->sub.left));
900 s->mode = s->sub.left ? STORED : TYPE;
901 break;
902 case STORED:
903 if (n == 0)
904 LEAVE
905 NEEDOUT
906 t = s->sub.left;
907 if (t > n) t = n;
908 if (t > m) t = m;
909 zmemcpy(q, p, t);
910 p += t; n -= t;
911 q += t; m -= t;
912 if ((s->sub.left -= t) != 0)
913 break;
914 Tracev((stderr, "inflate: stored end, %lu total out\n",
915 z->total_out + (q >= s->read ? q - s->read :
916 (s->end - s->read) + (q - s->window))));
917 s->mode = s->last ? DRY : TYPE;
918 break;
919 case TABLE:
920 NEEDBITS(14)
921 s->sub.trees.table = t = (uInt)b & 0x3fff;
922#ifndef PKZIP_BUG_WORKAROUND
923 if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29)
924 {
925 s->mode = BADB;
926 z->msg = "too many length or distance symbols";
927 r = Z_DATA_ERROR;
928 LEAVE
929 }
930#endif
931 t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f);
932 if (t < 19)
933 t = 19;
934 if ((s->sub.trees.blens = (uIntf*)ZALLOC(z, t, sizeof(uInt))) == Z_NULL)
935 {
936 r = Z_MEM_ERROR;
937 LEAVE
938 }
939 s->sub.trees.nblens = t;
940 DUMPBITS(14)
941 s->sub.trees.index = 0;
942 Tracev((stderr, "inflate: table sizes ok\n"));
943 s->mode = BTREE;
944 case BTREE:
945 while (s->sub.trees.index < 4 + (s->sub.trees.table >> 10))
946 {
947 NEEDBITS(3)
948 s->sub.trees.blens[border[s->sub.trees.index++]] = (uInt)b & 7;
949 DUMPBITS(3)
950 }
951 while (s->sub.trees.index < 19)
952 s->sub.trees.blens[border[s->sub.trees.index++]] = 0;
953 s->sub.trees.bb = 7;
954 t = inflate_trees_bits(s->sub.trees.blens, &s->sub.trees.bb,
955 &s->sub.trees.tb, z);
956 if (t != Z_OK)
957 {
958 r = t;
959 if (r == Z_DATA_ERROR)
960 s->mode = BADB;
961 LEAVE
962 }
963 s->sub.trees.index = 0;
964 Tracev((stderr, "inflate: bits tree ok\n"));
965 s->mode = DTREE;
966 case DTREE:
967 while (t = s->sub.trees.table,
968 s->sub.trees.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f))
969 {
970 inflate_huft *h;
971 uInt i, j, c;
972
973 t = s->sub.trees.bb;
974 NEEDBITS(t)
975 h = s->sub.trees.tb + ((uInt)b & inflate_mask[t]);
976 t = h->word.what.Bits;
977 c = h->more.Base;
978 if (c < 16)
979 {
980 DUMPBITS(t)
981 s->sub.trees.blens[s->sub.trees.index++] = c;
982 }
983 else /* c == 16..18 */
984 {
985 i = c == 18 ? 7 : c - 14;
986 j = c == 18 ? 11 : 3;
987 NEEDBITS(t + i)
988 DUMPBITS(t)
989 j += (uInt)b & inflate_mask[i];
990 DUMPBITS(i)
991 i = s->sub.trees.index;
992 t = s->sub.trees.table;
993 if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) ||
994 (c == 16 && i < 1))
995 {
996 s->mode = BADB;
997 z->msg = "invalid bit length repeat";
998 r = Z_DATA_ERROR;
999 LEAVE
1000 }
1001 c = c == 16 ? s->sub.trees.blens[i - 1] : 0;
1002 do {
1003 s->sub.trees.blens[i++] = c;
1004 } while (--j);
1005 s->sub.trees.index = i;
1006 }
1007 }
1008 inflate_trees_free(s->sub.trees.tb, z);
1009 s->sub.trees.tb = Z_NULL;
1010 {
1011 uInt bl, bd;
1012 inflate_huft *tl, *td;
1013 inflate_codes_statef *c;
1014
1015 bl = 9; /* must be <= 9 for lookahead assumptions */
1016 bd = 6; /* must be <= 9 for lookahead assumptions */
1017 t = s->sub.trees.table;
1018 t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f),
1019 s->sub.trees.blens, &bl, &bd, &tl, &td, z);
1020 if (t != Z_OK)
1021 {
1022 if (t == (uInt)Z_DATA_ERROR)
1023 s->mode = BADB;
1024 r = t;
1025 LEAVE
1026 }
1027 Tracev((stderr, "inflate: trees ok\n"));
1028 if ((c = inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL)
1029 {
1030 inflate_trees_free(td, z);
1031 inflate_trees_free(tl, z);
1032 r = Z_MEM_ERROR;
1033 LEAVE
1034 }
1035 ZFREE(z, s->sub.trees.blens, s->sub.trees.nblens * sizeof(uInt));
1036 s->sub.decode.codes = c;
1037 s->sub.decode.tl = tl;
1038 s->sub.decode.td = td;
1039 }
1040 s->mode = CODES;
1041 case CODES:
1042 UPDATE
1043 if ((r = inflate_codes(s, z, r)) != Z_STREAM_END)
1044 return inflate_flush(s, z, r);
1045 r = Z_OK;
1046 inflate_codes_free(s->sub.decode.codes, z);
1047 inflate_trees_free(s->sub.decode.td, z);
1048 inflate_trees_free(s->sub.decode.tl, z);
1049 LOAD
1050 Tracev((stderr, "inflate: codes end, %lu total out\n",
1051 z->total_out + (q >= s->read ? q - s->read :
1052 (s->end - s->read) + (q - s->window))));
1053 if (!s->last)
1054 {
1055 s->mode = TYPE;
1056 break;
1057 }
1058 if (k > 7) /* return unused byte, if any */
1059 {
1060 Assert(k < 16, "inflate_codes grabbed too many bytes")
1061 k -= 8;
1062 n++;
1063 p--; /* can always return one */
1064 }
1065 s->mode = DRY;
1066 case DRY:
1067 FLUSH
1068 if (s->read != s->write)
1069 LEAVE
1070 s->mode = DONEB;
1071 case DONEB:
1072 r = Z_STREAM_END;
1073 LEAVE
1074 case BADB:
1075 r = Z_DATA_ERROR;
1076 LEAVE
1077 default:
1078 r = Z_STREAM_ERROR;
1079 LEAVE
1080 }
1081}
1082
1083
1084local int inflate_blocks_free(
1085 inflate_blocks_statef *s,
1086 z_stream *z,
1087 uLongf *c
1088)
1089{
1090 inflate_blocks_reset(s, z, c);
1091 ZFREE(z, s->window, s->end - s->window);
1092 ZFREE(z, s, sizeof(struct inflate_blocks_state));
1093 Trace((stderr, "inflate: blocks freed\n"));
1094 return Z_OK;
1095}
1096
1097/*
1098 * This subroutine adds the data at next_in/avail_in to the output history
1099 * without performing any output. The output buffer must be "caught up";
1100 * i.e. no pending output (hence s->read equals s->write), and the state must
1101 * be BLOCKS (i.e. we should be willing to see the start of a series of
1102 * BLOCKS). On exit, the output will also be caught up, and the checksum
1103 * will have been updated if need be.
1104 */
1105local int inflate_addhistory(
1106 inflate_blocks_statef *s,
1107 z_stream *z
1108)
1109{
1110 uLong b; /* bit buffer */ /* NOT USED HERE */
1111 uInt k; /* bits in bit buffer */ /* NOT USED HERE */
1112 uInt t; /* temporary storage */
1113 Bytef *p; /* input data pointer */
1114 uInt n; /* bytes available there */
1115 Bytef *q; /* output window write pointer */
1116 uInt m; /* bytes to end of window or read pointer */
1117
1118 if (s->read != s->write)
1119 return Z_STREAM_ERROR;
1120 if (s->mode != TYPE)
1121 return Z_DATA_ERROR;
1122
1123 /* we're ready to rock */
1124 LOAD
1125 /* while there is input ready, copy to output buffer, moving
1126 * pointers as needed.
1127 */
1128 while (n) {
1129 t = n; /* how many to do */
1130 /* is there room until end of buffer? */
1131 if (t > m) t = m;
1132 /* update check information */
1133 if (s->checkfn != Z_NULL)
1134 s->check = (*s->checkfn)(s->check, q, t);
1135 zmemcpy(q, p, t);
1136 q += t;
1137 p += t;
1138 n -= t;
1139 z->total_out += t;
1140 s->read = q; /* drag read pointer forward */
1141/* WRAP */ /* expand WRAP macro by hand to handle s->read */
1142 if (q == s->end) {
1143 s->read = q = s->window;
1144 m = WAVAIL;
1145 }
1146 }
1147 UPDATE
1148 return Z_OK;
1149}
1150
1151
1152/*
1153 * At the end of a Deflate-compressed PPP packet, we expect to have seen
1154 * a `stored' block type value but not the (zero) length bytes.
1155 */
1156local int inflate_packet_flush(
1157 inflate_blocks_statef *s
1158)
1159{
1160 if (s->mode != LENS)
1161 return Z_DATA_ERROR;
1162 s->mode = TYPE;
1163 return Z_OK;
1164}
1165
1166
1167/*+++++*/
1168/* inftrees.c -- generate Huffman trees for efficient decoding
1169 * Copyright (C) 1995 Mark Adler
1170 * For conditions of distribution and use, see copyright notice in zlib.h
1171 */
1172
1173/* simplify the use of the inflate_huft type with some defines */
1174#define base more.Base
1175#define next more.Next
1176#define exop word.what.Exop
1177#define bits word.what.Bits
1178
1179
1180local int huft_build OF((
1181 uIntf *, /* code lengths in bits */
1182 uInt, /* number of codes */
1183 uInt, /* number of "simple" codes */
1184 uIntf *, /* list of base values for non-simple codes */
1185 uIntf *, /* list of extra bits for non-simple codes */
1186 inflate_huft * FAR*,/* result: starting table */
1187 uIntf *, /* maximum lookup bits (returns actual) */
1188 z_stream *)); /* for zalloc function */
1189
1190local voidpf falloc OF((
1191 voidpf, /* opaque pointer (not used) */
1192 uInt, /* number of items */
1193 uInt)); /* size of item */
1194
1195local void ffree OF((
1196 voidpf q, /* opaque pointer (not used) */
1197 voidpf p, /* what to free (not used) */
1198 uInt n)); /* number of bytes (not used) */
1199
1200/* Tables for deflate from PKZIP's appnote.txt. */
1201local uInt cplens[] = { /* Copy lengths for literal codes 257..285 */
1202 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
1203 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
1204 /* actually lengths - 2; also see note #13 above about 258 */
1205local uInt cplext[] = { /* Extra bits for literal codes 257..285 */
1206 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
1207 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 192, 192}; /* 192==invalid */
1208local uInt cpdist[] = { /* Copy offsets for distance codes 0..29 */
1209 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
1210 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
1211 8193, 12289, 16385, 24577};
1212local uInt cpdext[] = { /* Extra bits for distance codes */
1213 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
1214 7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
1215 12, 12, 13, 13};
1216
1217/*
1218 Huffman code decoding is performed using a multi-level table lookup.
1219 The fastest way to decode is to simply build a lookup table whose
1220 size is determined by the longest code. However, the time it takes
1221 to build this table can also be a factor if the data being decoded
1222 is not very long. The most common codes are necessarily the
1223 shortest codes, so those codes dominate the decoding time, and hence
1224 the speed. The idea is you can have a shorter table that decodes the
1225 shorter, more probable codes, and then point to subsidiary tables for
1226 the longer codes. The time it costs to decode the longer codes is
1227 then traded against the time it takes to make longer tables.
1228
1229 This results of this trade are in the variables lbits and dbits
1230 below. lbits is the number of bits the first level table for literal/
1231 length codes can decode in one step, and dbits is the same thing for
1232 the distance codes. Subsequent tables are also less than or equal to
1233 those sizes. These values may be adjusted either when all of the
1234 codes are shorter than that, in which case the longest code length in
1235 bits is used, or when the shortest code is *longer* than the requested
1236 table size, in which case the length of the shortest code in bits is
1237 used.
1238
1239 There are two different values for the two tables, since they code a
1240 different number of possibilities each. The literal/length table
1241 codes 286 possible values, or in a flat code, a little over eight
1242 bits. The distance table codes 30 possible values, or a little less
1243 than five bits, flat. The optimum values for speed end up being
1244 about one bit more than those, so lbits is 8+1 and dbits is 5+1.
1245 The optimum values may differ though from machine to machine, and
1246 possibly even between compilers. Your mileage may vary.
1247 */
1248
1249
1250/* If BMAX needs to be larger than 16, then h and x[] should be uLong. */
1251#define BMAX 15 /* maximum bit length of any code */
1252#define N_MAX 288 /* maximum number of codes in any set */
1253
1254#ifdef DEBUG_ZLIB
1255 uInt inflate_hufts;
1256#endif
1257
1258local int huft_build(
1259 uIntf *b, /* code lengths in bits (all assumed <= BMAX) */
1260 uInt n, /* number of codes (assumed <= N_MAX) */
1261 uInt s, /* number of simple-valued codes (0..s-1) */
1262 uIntf *d, /* list of base values for non-simple codes */
1263 uIntf *e, /* list of extra bits for non-simple codes */
1264 inflate_huft * FAR *t, /* result: starting table */
1265 uIntf *m, /* maximum lookup bits, returns actual */
1266 z_stream *zs /* for zalloc function */
1267)
1268/* Given a list of code lengths and a maximum table size, make a set of
1269 tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR
1270 if the given code set is incomplete (the tables are still built in this
1271 case), Z_DATA_ERROR if the input is invalid (all zero length codes or an
1272 over-subscribed set of lengths), or Z_MEM_ERROR if not enough memory. */
1273{
1274
1275 uInt a; /* counter for codes of length k */
1276 uInt c[BMAX+1]; /* bit length count table */
1277 uInt f; /* i repeats in table every f entries */
1278 int g; /* maximum code length */
1279 int h; /* table level */
1280 register uInt i; /* counter, current code */
1281 register uInt j; /* counter */
1282 register int k; /* number of bits in current code */
1283 int l; /* bits per table (returned in m) */
1284 register uIntf *p; /* pointer into c[], b[], or v[] */
1285 inflate_huft *q; /* points to current table */
1286 struct inflate_huft_s r; /* table entry for structure assignment */
1287 inflate_huft *u[BMAX]; /* table stack */
1288 uInt v[N_MAX]; /* values in order of bit length */
1289 register int w; /* bits before this table == (l * h) */
1290 uInt x[BMAX+1]; /* bit offsets, then code stack */
1291 uIntf *xp; /* pointer into x */
1292 int y; /* number of dummy codes added */
1293 uInt z; /* number of entries in current table */
1294
1295
1296 /* Generate counts for each bit length */
1297 p = c;
1298#define C0 *p++ = 0;
1299#define C2 C0 C0 C0 C0
1300#define C4 C2 C2 C2 C2
1301 C4 /* clear c[]--assume BMAX+1 is 16 */
1302 p = b; i = n;
1303 do {
1304 c[*p++]++; /* assume all entries <= BMAX */
1305 } while (--i);
1306 if (c[0] == n) /* null input--all zero length codes */
1307 {
1308 *t = (inflate_huft *)Z_NULL;
1309 *m = 0;
1310 return Z_DATA_ERROR;
1311 }
1312
1313
1314 /* Find minimum and maximum length, bound *m by those */
1315 l = *m;
1316 for (j = 1; j <= BMAX; j++)
1317 if (c[j])
1318 break;
1319 k = j; /* minimum code length */
1320 if ((uInt)l < j)
1321 l = j;
1322 for (i = BMAX; i; i--)
1323 if (c[i])
1324 break;
1325 g = i; /* maximum code length */
1326 if ((uInt)l > i)
1327 l = i;
1328 *m = l;
1329
1330
1331 /* Adjust last length count to fill out codes, if needed */
1332 for (y = 1 << j; j < i; j++, y <<= 1)
1333 if ((y -= c[j]) < 0)
1334 return Z_DATA_ERROR;
1335 if ((y -= c[i]) < 0)
1336 return Z_DATA_ERROR;
1337 c[i] += y;
1338
1339
1340 /* Generate starting offsets into the value table for each length */
1341 x[1] = j = 0;
1342 p = c + 1; xp = x + 2;
1343 while (--i) { /* note that i == g from above */
1344 *xp++ = (j += *p++);
1345 }
1346
1347
1348 /* Make a table of values in order of bit lengths */
1349 p = b; i = 0;
1350 do {
1351 if ((j = *p++) != 0)
1352 v[x[j]++] = i;
1353 } while (++i < n);
1354 n = x[g]; /* set n to length of v */
1355
1356
1357 /* Generate the Huffman codes and for each, make the table entries */
1358 x[0] = i = 0; /* first Huffman code is zero */
1359 p = v; /* grab values in bit order */
1360 h = -1; /* no tables yet--level -1 */
1361 w = -l; /* bits decoded == (l * h) */
1362 u[0] = (inflate_huft *)Z_NULL; /* just to keep compilers happy */
1363 q = (inflate_huft *)Z_NULL; /* ditto */
1364 z = 0; /* ditto */
1365
1366 /* go through the bit lengths (k already is bits in shortest code) */
1367 for (; k <= g; k++)
1368 {
1369 a = c[k];
1370 while (a--)
1371 {
1372 /* here i is the Huffman code of length k bits for value *p */
1373 /* make tables up to required level */
1374 while (k > w + l)
1375 {
1376 h++;
1377 w += l; /* previous table always l bits */
1378
1379 /* compute minimum size table less than or equal to l bits */
1380 z = (z = g - w) > (uInt)l ? l : z; /* table size upper limit */
1381 if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */
1382 { /* too few codes for k-w bit table */
1383 f -= a + 1; /* deduct codes from patterns left */
1384 xp = c + k;
1385 if (j < z)
1386 while (++j < z) /* try smaller tables up to z bits */
1387 {
1388 if ((f <<= 1) <= *++xp)
1389 break; /* enough codes to use up j bits */
1390 f -= *xp; /* else deduct codes from patterns */
1391 }
1392 }
1393 z = 1 << j; /* table entries for j-bit table */
1394
1395 /* allocate and link in new table */
1396 if ((q = (inflate_huft *)ZALLOC
1397 (zs,z + 1,sizeof(inflate_huft))) == Z_NULL)
1398 {
1399 if (h)
1400 inflate_trees_free(u[0], zs);
1401 return Z_MEM_ERROR; /* not enough memory */
1402 }
1403 q->word.Nalloc = z + 1;
1404#ifdef DEBUG_ZLIB
1405 inflate_hufts += z + 1;
1406#endif
1407 *t = q + 1; /* link to list for huft_free() */
1408 *(t = &(q->next)) = Z_NULL;
1409 u[h] = ++q; /* table starts after link */
1410
1411 /* connect to last table, if there is one */
1412 if (h)
1413 {
1414 x[h] = i; /* save pattern for backing up */
1415 r.bits = (Byte)l; /* bits to dump before this table */
1416 r.exop = (Byte)j; /* bits in this table */
1417 r.next = q; /* pointer to this table */
1418 j = i >> (w - l); /* (get around Turbo C bug) */
1419 u[h-1][j] = r; /* connect to last table */
1420 }
1421 }
1422
1423 /* set up table entry in r */
1424 r.bits = (Byte)(k - w);
1425 if (p >= v + n)
1426 r.exop = 128 + 64; /* out of values--invalid code */
1427 else if (*p < s)
1428 {
1429 r.exop = (Byte)(*p < 256 ? 0 : 32 + 64); /* 256 is end-of-block */
1430 r.base = *p++; /* simple code is just the value */
1431 }
1432 else
1433 {
1434 r.exop = (Byte)e[*p - s] + 16 + 64; /* non-simple--look up in lists */
1435 r.base = d[*p++ - s];
1436 }
1437
1438 /* fill code-like entries with r */
1439 f = 1 << (k - w);
1440 for (j = i >> w; j < z; j += f)
1441 q[j] = r;
1442
1443 /* backwards increment the k-bit code i */
1444 for (j = 1 << (k - 1); i & j; j >>= 1)
1445 i ^= j;
1446 i ^= j;
1447
1448 /* backup over finished tables */
1449 while ((i & ((1 << w) - 1)) != x[h])
1450 {
1451 h--; /* don't need to update q */
1452 w -= l;
1453 }
1454 }
1455 }
1456
1457
1458 /* Return Z_BUF_ERROR if we were given an incomplete table */
1459 return y != 0 && g != 1 ? Z_BUF_ERROR : Z_OK;
1460}
1461
1462
1463local int inflate_trees_bits(
1464 uIntf *c, /* 19 code lengths */
1465 uIntf *bb, /* bits tree desired/actual depth */
1466 inflate_huft * FAR *tb, /* bits tree result */
1467 z_stream *z /* for zfree function */
1468)
1469{
1470 int r;
1471
1472 r = huft_build(c, 19, 19, (uIntf*)Z_NULL, (uIntf*)Z_NULL, tb, bb, z);
1473 if (r == Z_DATA_ERROR)
1474 z->msg = "oversubscribed dynamic bit lengths tree";
1475 else if (r == Z_BUF_ERROR)
1476 {
1477 inflate_trees_free(*tb, z);
1478 z->msg = "incomplete dynamic bit lengths tree";
1479 r = Z_DATA_ERROR;
1480 }
1481 return r;
1482}
1483
1484
1485local int inflate_trees_dynamic(
1486 uInt nl, /* number of literal/length codes */
1487 uInt nd, /* number of distance codes */
1488 uIntf *c, /* that many (total) code lengths */
1489 uIntf *bl, /* literal desired/actual bit depth */
1490 uIntf *bd, /* distance desired/actual bit depth */
1491 inflate_huft * FAR *tl, /* literal/length tree result */
1492 inflate_huft * FAR *td, /* distance tree result */
1493 z_stream *z /* for zfree function */
1494)
1495{
1496 int r;
1497
1498 /* build literal/length tree */
1499 if ((r = huft_build(c, nl, 257, cplens, cplext, tl, bl, z)) != Z_OK)
1500 {
1501 if (r == Z_DATA_ERROR)
1502 z->msg = "oversubscribed literal/length tree";
1503 else if (r == Z_BUF_ERROR)
1504 {
1505 inflate_trees_free(*tl, z);
1506 z->msg = "incomplete literal/length tree";
1507 r = Z_DATA_ERROR;
1508 }
1509 return r;
1510 }
1511
1512 /* build distance tree */
1513 if ((r = huft_build(c + nl, nd, 0, cpdist, cpdext, td, bd, z)) != Z_OK)
1514 {
1515 if (r == Z_DATA_ERROR)
1516 z->msg = "oversubscribed literal/length tree";
1517 else if (r == Z_BUF_ERROR) {
1518#ifdef PKZIP_BUG_WORKAROUND
1519 r = Z_OK;
1520 }
1521#else
1522 inflate_trees_free(*td, z);
1523 z->msg = "incomplete literal/length tree";
1524 r = Z_DATA_ERROR;
1525 }
1526 inflate_trees_free(*tl, z);
1527 return r;
1528#endif
1529 }
1530
1531 /* done */
1532 return Z_OK;
1533}
1534
1535
1536/* build fixed tables only once--keep them here */
1537local int fixed_lock = 0;
1538local int fixed_built = 0;
1539#define FIXEDH 530 /* number of hufts used by fixed tables */
1540local uInt fixed_left = FIXEDH;
1541local inflate_huft fixed_mem[FIXEDH];
1542local uInt fixed_bl;
1543local uInt fixed_bd;
1544local inflate_huft *fixed_tl;
1545local inflate_huft *fixed_td;
1546
1547
1548local voidpf falloc(
1549 voidpf q, /* opaque pointer (not used) */
1550 uInt n, /* number of items */
1551 uInt s /* size of item */
1552)
1553{
1554 Assert(s == sizeof(inflate_huft) && n <= fixed_left,
1555 "inflate_trees falloc overflow");
1556 if (q) s++; /* to make some compilers happy */
1557 fixed_left -= n;
1558 return (voidpf)(fixed_mem + fixed_left);
1559}
1560
1561
1562local void ffree(
1563 voidpf q,
1564 voidpf p,
1565 uInt n
1566)
1567{
1568 Assert(0, "inflate_trees ffree called!");
1569 if (q) q = p; /* to make some compilers happy */
1570}
1571
1572
1573local int inflate_trees_fixed(
1574 uIntf *bl, /* literal desired/actual bit depth */
1575 uIntf *bd, /* distance desired/actual bit depth */
1576 inflate_huft * FAR *tl, /* literal/length tree result */
1577 inflate_huft * FAR *td /* distance tree result */
1578)
1579{
1580 /* build fixed tables if not built already--lock out other instances */
1581 while (++fixed_lock > 1)
1582 fixed_lock--;
1583 if (!fixed_built)
1584 {
1585 int k; /* temporary variable */
1586 unsigned c[288]; /* length list for huft_build */
1587 z_stream z; /* for falloc function */
1588
1589 /* set up fake z_stream for memory routines */
1590 z.zalloc = falloc;
1591 z.zfree = ffree;
1592 z.opaque = Z_NULL;
1593
1594 /* literal table */
1595 for (k = 0; k < 144; k++)
1596 c[k] = 8;
1597 for (; k < 256; k++)
1598 c[k] = 9;
1599 for (; k < 280; k++)
1600 c[k] = 7;
1601 for (; k < 288; k++)
1602 c[k] = 8;
1603 fixed_bl = 7;
1604 huft_build(c, 288, 257, cplens, cplext, &fixed_tl, &fixed_bl, &z);
1605
1606 /* distance table */
1607 for (k = 0; k < 30; k++)
1608 c[k] = 5;
1609 fixed_bd = 5;
1610 huft_build(c, 30, 0, cpdist, cpdext, &fixed_td, &fixed_bd, &z);
1611
1612 /* done */
1613 fixed_built = 1;
1614 }
1615 fixed_lock--;
1616 *bl = fixed_bl;
1617 *bd = fixed_bd;
1618 *tl = fixed_tl;
1619 *td = fixed_td;
1620 return Z_OK;
1621}
1622
1623
1624local int inflate_trees_free(
1625 inflate_huft *t, /* table to free */
1626 z_stream *z /* for zfree function */
1627)
1628/* Free the malloc'ed tables built by huft_build(), which makes a linked
1629 list of the tables it made, with the links in a dummy first entry of
1630 each table. */
1631{
1632 register inflate_huft *p, *q;
1633
1634 /* Go through linked list, freeing from the malloced (t[-1]) address. */
1635 p = t;
1636 while (p != Z_NULL)
1637 {
1638 q = (--p)->next;
1639 ZFREE(z, p, p->word.Nalloc * sizeof(inflate_huft));
1640 p = q;
1641 }
1642 return Z_OK;
1643}
1644
1645/*+++++*/
1646/* infcodes.c -- process literals and length/distance pairs
1647 * Copyright (C) 1995 Mark Adler
1648 * For conditions of distribution and use, see copyright notice in zlib.h
1649 */
1650
1651/* simplify the use of the inflate_huft type with some defines */
1652#define base more.Base
1653#define next more.Next
1654#define exop word.what.Exop
1655#define bits word.what.Bits
1656
1657/* inflate codes private state */
1658struct inflate_codes_state {
1659
1660 /* mode */
1661 enum { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */
1662 START, /* x: set up for LEN */
1663 LEN, /* i: get length/literal/eob next */
1664 LENEXT, /* i: getting length extra (have base) */
1665 DIST, /* i: get distance next */
1666 DISTEXT, /* i: getting distance extra */
1667 COPY, /* o: copying bytes in window, waiting for space */
1668 LIT, /* o: got literal, waiting for output space */
1669 WASH, /* o: got eob, possibly still output waiting */
1670 END, /* x: got eob and all data flushed */
1671 BADCODE} /* x: got error */
1672 mode; /* current inflate_codes mode */
1673
1674 /* mode dependent information */
1675 uInt len;
1676 union {
1677 struct {
1678 inflate_huft *tree; /* pointer into tree */
1679 uInt need; /* bits needed */
1680 } code; /* if LEN or DIST, where in tree */
1681 uInt lit; /* if LIT, literal */
1682 struct {
1683 uInt get; /* bits to get for extra */
1684 uInt dist; /* distance back to copy from */
1685 } copy; /* if EXT or COPY, where and how much */
1686 } sub; /* submode */
1687
1688 /* mode independent information */
1689 Byte lbits; /* ltree bits decoded per branch */
1690 Byte dbits; /* dtree bits decoder per branch */
1691 inflate_huft *ltree; /* literal/length/eob tree */
1692 inflate_huft *dtree; /* distance tree */
1693
1694};
1695
1696
1697local inflate_codes_statef *inflate_codes_new(
1698 uInt bl,
1699 uInt bd,
1700 inflate_huft *tl,
1701 inflate_huft *td,
1702 z_stream *z
1703)
1704{
1705 inflate_codes_statef *c;
1706
1707 if ((c = (inflate_codes_statef *)
1708 ZALLOC(z,1,sizeof(struct inflate_codes_state))) != Z_NULL)
1709 {
1710 c->mode = START;
1711 c->lbits = (Byte)bl;
1712 c->dbits = (Byte)bd;
1713 c->ltree = tl;
1714 c->dtree = td;
1715 Tracev((stderr, "inflate: codes new\n"));
1716 }
1717 return c;
1718}
1719
1720
1721local int inflate_codes(
1722 inflate_blocks_statef *s,
1723 z_stream *z,
1724 int r
1725)
1726{
1727 uInt j; /* temporary storage */
1728 inflate_huft *t; /* temporary pointer */
1729 uInt e; /* extra bits or operation */
1730 uLong b; /* bit buffer */
1731 uInt k; /* bits in bit buffer */
1732 Bytef *p; /* input data pointer */
1733 uInt n; /* bytes available there */
1734 Bytef *q; /* output window write pointer */
1735 uInt m; /* bytes to end of window or read pointer */
1736 Bytef *f; /* pointer to copy strings from */
1737 inflate_codes_statef *c = s->sub.decode.codes; /* codes state */
1738
1739 /* copy input/output information to locals (UPDATE macro restores) */
1740 LOAD
1741
1742 /* process input and output based on current state */
1743 while (1) switch (c->mode)
1744 { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */
1745 case START: /* x: set up for LEN */
1746#ifndef SLOW
1747 if (m >= 258 && n >= 10)
1748 {
1749 UPDATE
1750 r = inflate_fast(c->lbits, c->dbits, c->ltree, c->dtree, s, z);
1751 LOAD
1752 if (r != Z_OK)
1753 {
1754 c->mode = r == Z_STREAM_END ? WASH : BADCODE;
1755 break;
1756 }
1757 }
1758#endif /* !SLOW */
1759 c->sub.code.need = c->lbits;
1760 c->sub.code.tree = c->ltree;
1761 c->mode = LEN;
1762 case LEN: /* i: get length/literal/eob next */
1763 j = c->sub.code.need;
1764 NEEDBITS(j)
1765 t = c->sub.code.tree + ((uInt)b & inflate_mask[j]);
1766 DUMPBITS(t->bits)
1767 e = (uInt)(t->exop);
1768 if (e == 0) /* literal */
1769 {
1770 c->sub.lit = t->base;
1771 Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
1772 "inflate: literal '%c'\n" :
1773 "inflate: literal 0x%02x\n", t->base));
1774 c->mode = LIT;
1775 break;
1776 }
1777 if (e & 16) /* length */
1778 {
1779 c->sub.copy.get = e & 15;
1780 c->len = t->base;
1781 c->mode = LENEXT;
1782 break;
1783 }
1784 if ((e & 64) == 0) /* next table */
1785 {
1786 c->sub.code.need = e;
1787 c->sub.code.tree = t->next;
1788 break;
1789 }
1790 if (e & 32) /* end of block */
1791 {
1792 Tracevv((stderr, "inflate: end of block\n"));
1793 c->mode = WASH;
1794 break;
1795 }
1796 c->mode = BADCODE; /* invalid code */
1797 z->msg = "invalid literal/length code";
1798 r = Z_DATA_ERROR;
1799 LEAVE
1800 case LENEXT: /* i: getting length extra (have base) */
1801 j = c->sub.copy.get;
1802 NEEDBITS(j)
1803 c->len += (uInt)b & inflate_mask[j];
1804 DUMPBITS(j)
1805 c->sub.code.need = c->dbits;
1806 c->sub.code.tree = c->dtree;
1807 Tracevv((stderr, "inflate: length %u\n", c->len));
1808 c->mode = DIST;
1809 case DIST: /* i: get distance next */
1810 j = c->sub.code.need;
1811 NEEDBITS(j)
1812 t = c->sub.code.tree + ((uInt)b & inflate_mask[j]);
1813 DUMPBITS(t->bits)
1814 e = (uInt)(t->exop);
1815 if (e & 16) /* distance */
1816 {
1817 c->sub.copy.get = e & 15;
1818 c->sub.copy.dist = t->base;
1819 c->mode = DISTEXT;
1820 break;
1821 }
1822 if ((e & 64) == 0) /* next table */
1823 {
1824 c->sub.code.need = e;
1825 c->sub.code.tree = t->next;
1826 break;
1827 }
1828 c->mode = BADCODE; /* invalid code */
1829 z->msg = "invalid distance code";
1830 r = Z_DATA_ERROR;
1831 LEAVE
1832 case DISTEXT: /* i: getting distance extra */
1833 j = c->sub.copy.get;
1834 NEEDBITS(j)
1835 c->sub.copy.dist += (uInt)b & inflate_mask[j];
1836 DUMPBITS(j)
1837 Tracevv((stderr, "inflate: distance %u\n", c->sub.copy.dist));
1838 c->mode = COPY;
1839 case COPY: /* o: copying bytes in window, waiting for space */
1840#ifndef __TURBOC__ /* Turbo C bug for following expression */
1841 f = (uInt)(q - s->window) < c->sub.copy.dist ?
1842 s->end - (c->sub.copy.dist - (q - s->window)) :
1843 q - c->sub.copy.dist;
1844#else
1845 f = q - c->sub.copy.dist;
1846 if ((uInt)(q - s->window) < c->sub.copy.dist)
1847 f = s->end - (c->sub.copy.dist - (q - s->window));
1848#endif
1849 while (c->len)
1850 {
1851 NEEDOUT
1852 OUTBYTE(*f++)
1853 if (f == s->end)
1854 f = s->window;
1855 c->len--;
1856 }
1857 c->mode = START;
1858 break;
1859 case LIT: /* o: got literal, waiting for output space */
1860 NEEDOUT
1861 OUTBYTE(c->sub.lit)
1862 c->mode = START;
1863 break;
1864 case WASH: /* o: got eob, possibly more output */
1865 FLUSH
1866 if (s->read != s->write)
1867 LEAVE
1868 c->mode = END;
1869 case END:
1870 r = Z_STREAM_END;
1871 LEAVE
1872 case BADCODE: /* x: got error */
1873 r = Z_DATA_ERROR;
1874 LEAVE
1875 default:
1876 r = Z_STREAM_ERROR;
1877 LEAVE
1878 }
1879}
1880
1881
1882local void inflate_codes_free(
1883 inflate_codes_statef *c,
1884 z_stream *z
1885)
1886{
1887 ZFREE(z, c, sizeof(struct inflate_codes_state));
1888 Tracev((stderr, "inflate: codes free\n"));
1889}
1890
1891/*+++++*/
1892/* inflate_util.c -- data and routines common to blocks and codes
1893 * Copyright (C) 1995 Mark Adler
1894 * For conditions of distribution and use, see copyright notice in zlib.h
1895 */
1896
1897/* copy as much as possible from the sliding window to the output area */
1898local int inflate_flush(
1899 inflate_blocks_statef *s,
1900 z_stream *z,
1901 int r
1902)
1903{
1904 uInt n;
1905 Bytef *p, *q;
1906
1907 /* local copies of source and destination pointers */
1908 p = z->next_out;
1909 q = s->read;
1910
1911 /* compute number of bytes to copy as far as end of window */
1912 n = (uInt)((q <= s->write ? s->write : s->end) - q);
1913 if (n > z->avail_out) n = z->avail_out;
1914 if (n && r == Z_BUF_ERROR) r = Z_OK;
1915
1916 /* update counters */
1917 z->avail_out -= n;
1918 z->total_out += n;
1919
1920 /* update check information */
1921 if (s->checkfn != Z_NULL)
1922 s->check = (*s->checkfn)(s->check, q, n);
1923
1924 /* copy as far as end of window */
1925 zmemcpy(p, q, n);
1926 p += n;
1927 q += n;
1928
1929 /* see if more to copy at beginning of window */
1930 if (q == s->end)
1931 {
1932 /* wrap pointers */
1933 q = s->window;
1934 if (s->write == s->end)
1935 s->write = s->window;
1936
1937 /* compute bytes to copy */
1938 n = (uInt)(s->write - q);
1939 if (n > z->avail_out) n = z->avail_out;
1940 if (n && r == Z_BUF_ERROR) r = Z_OK;
1941
1942 /* update counters */
1943 z->avail_out -= n;
1944 z->total_out += n;
1945
1946 /* update check information */
1947 if (s->checkfn != Z_NULL)
1948 s->check = (*s->checkfn)(s->check, q, n);
1949
1950 /* copy */
1951 zmemcpy(p, q, n);
1952 p += n;
1953 q += n;
1954 }
1955
1956 /* update pointers */
1957 z->next_out = p;
1958 s->read = q;
1959
1960 /* done */
1961 return r;
1962}
1963
1964
1965/*+++++*/
1966/* inffast.c -- process literals and length/distance pairs fast
1967 * Copyright (C) 1995 Mark Adler
1968 * For conditions of distribution and use, see copyright notice in zlib.h
1969 */
1970
1971/* simplify the use of the inflate_huft type with some defines */
1972#define base more.Base
1973#define next more.Next
1974#define exop word.what.Exop
1975#define bits word.what.Bits
1976
1977/* macros for bit input with no checking and for returning unused bytes */
1978#define GRABBITS(j) {while(k<(j)){b|=((uLong)NEXTBYTE)<<k;k+=8;}}
1979#define UNGRAB {n+=(c=k>>3);p-=c;k&=7;}
1980
1981/* Called with number of bytes left to write in window at least 258
1982 (the maximum string length) and number of input bytes available
1983 at least ten. The ten bytes are six bytes for the longest length/
1984 distance pair plus four bytes for overloading the bit buffer. */
1985
1986local int inflate_fast(
1987 uInt bl,
1988 uInt bd,
1989 inflate_huft *tl,
1990 inflate_huft *td,
1991 inflate_blocks_statef *s,
1992 z_stream *z
1993)
1994{
1995 inflate_huft *t; /* temporary pointer */
1996 uInt e; /* extra bits or operation */
1997 uLong b; /* bit buffer */
1998 uInt k; /* bits in bit buffer */
1999 Bytef *p; /* input data pointer */
2000 uInt n; /* bytes available there */
2001 Bytef *q; /* output window write pointer */
2002 uInt m; /* bytes to end of window or read pointer */
2003 uInt ml; /* mask for literal/length tree */
2004 uInt md; /* mask for distance tree */
2005 uInt c; /* bytes to copy */
2006 uInt d; /* distance back to copy from */
2007 Bytef *r; /* copy source pointer */
2008
2009 /* load input, output, bit values */
2010 LOAD
2011
2012 /* initialize masks */
2013 ml = inflate_mask[bl];
2014 md = inflate_mask[bd];
2015
2016 /* do until not enough input or output space for fast loop */
2017 do { /* assume called with m >= 258 && n >= 10 */
2018 /* get literal/length code */
2019 GRABBITS(20) /* max bits for literal/length code */
2020 if ((e = (t = tl + ((uInt)b & ml))->exop) == 0)
2021 {
2022 DUMPBITS(t->bits)
2023 Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
2024 "inflate: * literal '%c'\n" :
2025 "inflate: * literal 0x%02x\n", t->base));
2026 *q++ = (Byte)t->base;
2027 m--;
2028 continue;
2029 }
2030 do {
2031 DUMPBITS(t->bits)
2032 if (e & 16)
2033 {
2034 /* get extra bits for length */
2035 e &= 15;
2036 c = t->base + ((uInt)b & inflate_mask[e]);
2037 DUMPBITS(e)
2038 Tracevv((stderr, "inflate: * length %u\n", c));
2039
2040 /* decode distance base of block to copy */
2041 GRABBITS(15); /* max bits for distance code */
2042 e = (t = td + ((uInt)b & md))->exop;
2043 do {
2044 DUMPBITS(t->bits)
2045 if (e & 16)
2046 {
2047 /* get extra bits to add to distance base */
2048 e &= 15;
2049 GRABBITS(e) /* get extra bits (up to 13) */
2050 d = t->base + ((uInt)b & inflate_mask[e]);
2051 DUMPBITS(e)
2052 Tracevv((stderr, "inflate: * distance %u\n", d));
2053
2054 /* do the copy */
2055 m -= c;
2056 if ((uInt)(q - s->window) >= d) /* offset before dest */
2057 { /* just copy */
2058 r = q - d;
2059 *q++ = *r++; c--; /* minimum count is three, */
2060 *q++ = *r++; c--; /* so unroll loop a little */
2061 }
2062 else /* else offset after destination */
2063 {
2064 e = d - (q - s->window); /* bytes from offset to end */
2065 r = s->end - e; /* pointer to offset */
2066 if (c > e) /* if source crosses, */
2067 {
2068 c -= e; /* copy to end of window */
2069 do {
2070 *q++ = *r++;
2071 } while (--e);
2072 r = s->window; /* copy rest from start of window */
2073 }
2074 }
2075 do { /* copy all or what's left */
2076 *q++ = *r++;
2077 } while (--c);
2078 break;
2079 }
2080 else if ((e & 64) == 0)
2081 e = (t = t->next + ((uInt)b & inflate_mask[e]))->exop;
2082 else
2083 {
2084 z->msg = "invalid distance code";
2085 UNGRAB
2086 UPDATE
2087 return Z_DATA_ERROR;
2088 }
2089 } while (1);
2090 break;
2091 }
2092 if ((e & 64) == 0)
2093 {
2094 if ((e = (t = t->next + ((uInt)b & inflate_mask[e]))->exop) == 0)
2095 {
2096 DUMPBITS(t->bits)
2097 Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
2098 "inflate: * literal '%c'\n" :
2099 "inflate: * literal 0x%02x\n", t->base));
2100 *q++ = (Byte)t->base;
2101 m--;
2102 break;
2103 }
2104 }
2105 else if (e & 32)
2106 {
2107 Tracevv((stderr, "inflate: * end of block\n"));
2108 UNGRAB
2109 UPDATE
2110 return Z_STREAM_END;
2111 }
2112 else
2113 {
2114 z->msg = "invalid literal/length code";
2115 UNGRAB
2116 UPDATE
2117 return Z_DATA_ERROR;
2118 }
2119 } while (1);
2120 } while (m >= 258 && n >= 10);
2121
2122 /* not enough input or output--restore pointers and return */
2123 UNGRAB
2124 UPDATE
2125 return Z_OK;
2126}
2127
2128
2129/*+++++*/
2130/* zutil.c -- target dependent utility functions for the compression library
2131 * Copyright (C) 1995 Jean-loup Gailly.
2132 * For conditions of distribution and use, see copyright notice in zlib.h
2133 */
2134
2135/* From: zutil.c,v 1.8 1995/05/03 17:27:12 jloup Exp */
2136
2137char *zlib_version = ZLIB_VERSION;
2138
2139char *z_errmsg[] = {
2140"stream end", /* Z_STREAM_END 1 */
2141"", /* Z_OK 0 */
2142"file error", /* Z_ERRNO (-1) */
2143"stream error", /* Z_STREAM_ERROR (-2) */
2144"data error", /* Z_DATA_ERROR (-3) */
2145"insufficient memory", /* Z_MEM_ERROR (-4) */
2146"buffer error", /* Z_BUF_ERROR (-5) */
2147""};
2148
2149
2150/*+++++*/
2151/* adler32.c -- compute the Adler-32 checksum of a data stream
2152 * Copyright (C) 1995 Mark Adler
2153 * For conditions of distribution and use, see copyright notice in zlib.h
2154 */
2155
2156/* From: adler32.c,v 1.6 1995/05/03 17:27:08 jloup Exp */
2157
2158#define BASE 65521L /* largest prime smaller than 65536 */
2159#define NMAX 5552
2160/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
2161
2162#define DO1(buf) {s1 += *buf++; s2 += s1;}
2163#define DO2(buf) DO1(buf); DO1(buf);
2164#define DO4(buf) DO2(buf); DO2(buf);
2165#define DO8(buf) DO4(buf); DO4(buf);
2166#define DO16(buf) DO8(buf); DO8(buf);
2167
2168/* ========================================================================= */
2169uLong adler32(
2170 uLong adler,
2171 Bytef *buf,
2172 uInt len
2173)
2174{
2175 unsigned long s1 = adler & 0xffff;
2176 unsigned long s2 = (adler >> 16) & 0xffff;
2177 int k;
2178
2179 if (buf == Z_NULL) return 1L;
2180
2181 while (len > 0) {
2182 k = len < NMAX ? len : NMAX;
2183 len -= k;
2184 while (k >= 16) {
2185 DO16(buf);
2186 k -= 16;
2187 }
2188 if (k != 0) do {
2189 DO1(buf);
2190 } while (--k);
2191 s1 %= BASE;
2192 s2 %= BASE;
2193 }
2194 return (s2 << 16) | s1;
2195}
diff --git a/arch/ppc64/boot/zlib.h b/arch/ppc64/boot/zlib.h
deleted file mode 100644
index f0b996c6864f..000000000000
--- a/arch/ppc64/boot/zlib.h
+++ /dev/null
@@ -1,432 +0,0 @@
1/* */
2
3/*
4 * This file is derived from zlib.h and zconf.h from the zlib-0.95
5 * distribution by Jean-loup Gailly and Mark Adler, with some additions
6 * by Paul Mackerras to aid in implementing Deflate compression and
7 * decompression for PPP packets.
8 */
9
10/*
11 * ==FILEVERSION 960122==
12 *
13 * This marker is used by the Linux installation script to determine
14 * whether an up-to-date version of this file is already installed.
15 */
16
17/* zlib.h -- interface of the 'zlib' general purpose compression library
18 version 0.95, Aug 16th, 1995.
19
20 Copyright (C) 1995 Jean-loup Gailly and Mark Adler
21
22 This software is provided 'as-is', without any express or implied
23 warranty. In no event will the authors be held liable for any damages
24 arising from the use of this software.
25
26 Permission is granted to anyone to use this software for any purpose,
27 including commercial applications, and to alter it and redistribute it
28 freely, subject to the following restrictions:
29
30 1. The origin of this software must not be misrepresented; you must not
31 claim that you wrote the original software. If you use this software
32 in a product, an acknowledgment in the product documentation would be
33 appreciated but is not required.
34 2. Altered source versions must be plainly marked as such, and must not be
35 misrepresented as being the original software.
36 3. This notice may not be removed or altered from any source distribution.
37
38 Jean-loup Gailly Mark Adler
39 gzip@prep.ai.mit.edu madler@alumni.caltech.edu
40 */
41
42#ifndef _ZLIB_H
43#define _ZLIB_H
44
45/* #include "zconf.h" */ /* included directly here */
46
47/* zconf.h -- configuration of the zlib compression library
48 * Copyright (C) 1995 Jean-loup Gailly.
49 * For conditions of distribution and use, see copyright notice in zlib.h
50 */
51
52/* From: zconf.h,v 1.12 1995/05/03 17:27:12 jloup Exp */
53
54/*
55 The library does not install any signal handler. It is recommended to
56 add at least a handler for SIGSEGV when decompressing; the library checks
57 the consistency of the input data whenever possible but may go nuts
58 for some forms of corrupted input.
59 */
60
61/*
62 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
63 * than 64k bytes at a time (needed on systems with 16-bit int).
64 * Compile with -DUNALIGNED_OK if it is OK to access shorts or ints
65 * at addresses which are not a multiple of their size.
66 * Under DOS, -DFAR=far or -DFAR=__far may be needed.
67 */
68
69#ifndef STDC
70# if defined(MSDOS) || defined(__STDC__) || defined(__cplusplus)
71# define STDC
72# endif
73#endif
74
75#ifdef __MWERKS__ /* Metrowerks CodeWarrior declares fileno() in unix.h */
76# include <unix.h>
77#endif
78
79/* Maximum value for memLevel in deflateInit2 */
80#ifndef MAX_MEM_LEVEL
81# ifdef MAXSEG_64K
82# define MAX_MEM_LEVEL 8
83# else
84# define MAX_MEM_LEVEL 9
85# endif
86#endif
87
88#ifndef FAR
89# define FAR
90#endif
91
92/* Maximum value for windowBits in deflateInit2 and inflateInit2 */
93#ifndef MAX_WBITS
94# define MAX_WBITS 15 /* 32K LZ77 window */
95#endif
96
97/* The memory requirements for deflate are (in bytes):
98 1 << (windowBits+2) + 1 << (memLevel+9)
99 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
100 plus a few kilobytes for small objects. For example, if you want to reduce
101 the default memory requirements from 256K to 128K, compile with
102 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
103 Of course this will generally degrade compression (there's no free lunch).
104
105 The memory requirements for inflate are (in bytes) 1 << windowBits
106 that is, 32K for windowBits=15 (default value) plus a few kilobytes
107 for small objects.
108*/
109
110 /* Type declarations */
111
112#ifndef OF /* function prototypes */
113# ifdef STDC
114# define OF(args) args
115# else
116# define OF(args) ()
117# endif
118#endif
119
120typedef unsigned char Byte; /* 8 bits */
121typedef unsigned int uInt; /* 16 bits or more */
122typedef unsigned long uLong; /* 32 bits or more */
123
124typedef Byte FAR Bytef;
125typedef char FAR charf;
126typedef int FAR intf;
127typedef uInt FAR uIntf;
128typedef uLong FAR uLongf;
129
130#ifdef STDC
131 typedef void FAR *voidpf;
132 typedef void *voidp;
133#else
134 typedef Byte FAR *voidpf;
135 typedef Byte *voidp;
136#endif
137
138/* end of original zconf.h */
139
140#define ZLIB_VERSION "0.95P"
141
142/*
143 The 'zlib' compression library provides in-memory compression and
144 decompression functions, including integrity checks of the uncompressed
145 data. This version of the library supports only one compression method
146 (deflation) but other algorithms may be added later and will have the same
147 stream interface.
148
149 For compression the application must provide the output buffer and
150 may optionally provide the input buffer for optimization. For decompression,
151 the application must provide the input buffer and may optionally provide
152 the output buffer for optimization.
153
154 Compression can be done in a single step if the buffers are large
155 enough (for example if an input file is mmap'ed), or can be done by
156 repeated calls of the compression function. In the latter case, the
157 application must provide more input and/or consume the output
158 (providing more output space) before each call.
159*/
160
161typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
162typedef void (*free_func) OF((voidpf opaque, voidpf address, uInt nbytes));
163
164struct internal_state;
165
166typedef struct z_stream_s {
167 Bytef *next_in; /* next input byte */
168 uInt avail_in; /* number of bytes available at next_in */
169 uLong total_in; /* total nb of input bytes read so far */
170
171 Bytef *next_out; /* next output byte should be put there */
172 uInt avail_out; /* remaining free space at next_out */
173 uLong total_out; /* total nb of bytes output so far */
174
175 char *msg; /* last error message, NULL if no error */
176 struct internal_state FAR *state; /* not visible by applications */
177
178 alloc_func zalloc; /* used to allocate the internal state */
179 free_func zfree; /* used to free the internal state */
180 voidp opaque; /* private data object passed to zalloc and zfree */
181
182 Byte data_type; /* best guess about the data type: ascii or binary */
183
184} z_stream;
185
186/*
187 The application must update next_in and avail_in when avail_in has
188 dropped to zero. It must update next_out and avail_out when avail_out
189 has dropped to zero. The application must initialize zalloc, zfree and
190 opaque before calling the init function. All other fields are set by the
191 compression library and must not be updated by the application.
192
193 The opaque value provided by the application will be passed as the first
194 parameter for calls of zalloc and zfree. This can be useful for custom
195 memory management. The compression library attaches no meaning to the
196 opaque value.
197
198 zalloc must return Z_NULL if there is not enough memory for the object.
199 On 16-bit systems, the functions zalloc and zfree must be able to allocate
200 exactly 65536 bytes, but will not be required to allocate more than this
201 if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,
202 pointers returned by zalloc for objects of exactly 65536 bytes *must*
203 have their offset normalized to zero. The default allocation function
204 provided by this library ensures this (see zutil.c). To reduce memory
205 requirements and avoid any allocation of 64K objects, at the expense of
206 compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h).
207
208 The fields total_in and total_out can be used for statistics or
209 progress reports. After compression, total_in holds the total size of
210 the uncompressed data and may be saved for use in the decompressor
211 (particularly if the decompressor wants to decompress everything in
212 a single step).
213*/
214
215 /* constants */
216
217#define Z_NO_FLUSH 0
218#define Z_PARTIAL_FLUSH 1
219#define Z_FULL_FLUSH 2
220#define Z_SYNC_FLUSH 3 /* experimental: partial_flush + byte align */
221#define Z_FINISH 4
222#define Z_PACKET_FLUSH 5
223/* See deflate() below for the usage of these constants */
224
225#define Z_OK 0
226#define Z_STREAM_END 1
227#define Z_ERRNO (-1)
228#define Z_STREAM_ERROR (-2)
229#define Z_DATA_ERROR (-3)
230#define Z_MEM_ERROR (-4)
231#define Z_BUF_ERROR (-5)
232/* error codes for the compression/decompression functions */
233
234#define Z_BEST_SPEED 1
235#define Z_BEST_COMPRESSION 9
236#define Z_DEFAULT_COMPRESSION (-1)
237/* compression levels */
238
239#define Z_FILTERED 1
240#define Z_HUFFMAN_ONLY 2
241#define Z_DEFAULT_STRATEGY 0
242
243#define Z_BINARY 0
244#define Z_ASCII 1
245#define Z_UNKNOWN 2
246/* Used to set the data_type field */
247
248#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
249
250extern char *zlib_version;
251/* The application can compare zlib_version and ZLIB_VERSION for consistency.
252 If the first character differs, the library code actually used is
253 not compatible with the zlib.h header file used by the application.
254 */
255
256 /* basic functions */
257
258extern int inflateInit OF((z_stream *strm));
259/*
260 Initializes the internal stream state for decompression. The fields
261 zalloc and zfree must be initialized before by the caller. If zalloc and
262 zfree are set to Z_NULL, inflateInit updates them to use default allocation
263 functions.
264
265 inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not
266 enough memory. msg is set to null if there is no error message.
267 inflateInit does not perform any decompression: this will be done by
268 inflate().
269*/
270
271
272extern int inflate OF((z_stream *strm, int flush));
273/*
274 Performs one or both of the following actions:
275
276 - Decompress more input starting at next_in and update next_in and avail_in
277 accordingly. If not all input can be processed (because there is not
278 enough room in the output buffer), next_in is updated and processing
279 will resume at this point for the next call of inflate().
280
281 - Provide more output starting at next_out and update next_out and avail_out
282 accordingly. inflate() always provides as much output as possible
283 (until there is no more input data or no more space in the output buffer).
284
285 Before the call of inflate(), the application should ensure that at least
286 one of the actions is possible, by providing more input and/or consuming
287 more output, and updating the next_* and avail_* values accordingly.
288 The application can consume the uncompressed output when it wants, for
289 example when the output buffer is full (avail_out == 0), or after each
290 call of inflate().
291
292 If the parameter flush is set to Z_PARTIAL_FLUSH or Z_PACKET_FLUSH,
293 inflate flushes as much output as possible to the output buffer. The
294 flushing behavior of inflate is not specified for values of the flush
295 parameter other than Z_PARTIAL_FLUSH, Z_PACKET_FLUSH or Z_FINISH, but the
296 current implementation actually flushes as much output as possible
297 anyway. For Z_PACKET_FLUSH, inflate checks that once all the input data
298 has been consumed, it is expecting to see the length field of a stored
299 block; if not, it returns Z_DATA_ERROR.
300
301 inflate() should normally be called until it returns Z_STREAM_END or an
302 error. However if all decompression is to be performed in a single step
303 (a single call of inflate), the parameter flush should be set to
304 Z_FINISH. In this case all pending input is processed and all pending
305 output is flushed; avail_out must be large enough to hold all the
306 uncompressed data. (The size of the uncompressed data may have been saved
307 by the compressor for this purpose.) The next operation on this stream must
308 be inflateEnd to deallocate the decompression state. The use of Z_FINISH
309 is never required, but can be used to inform inflate that a faster routine
310 may be used for the single inflate() call.
311
312 inflate() returns Z_OK if some progress has been made (more input
313 processed or more output produced), Z_STREAM_END if the end of the
314 compressed data has been reached and all uncompressed output has been
315 produced, Z_DATA_ERROR if the input data was corrupted, Z_STREAM_ERROR if
316 the stream structure was inconsistent (for example if next_in or next_out
317 was NULL), Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if no
318 progress is possible or if there was not enough room in the output buffer
319 when Z_FINISH is used. In the Z_DATA_ERROR case, the application may then
320 call inflateSync to look for a good compression block. */
321
322
323extern int inflateEnd OF((z_stream *strm));
324/*
325 All dynamically allocated data structures for this stream are freed.
326 This function discards any unprocessed input and does not flush any
327 pending output.
328
329 inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
330 was inconsistent. In the error case, msg may be set but then points to a
331 static string (which must not be deallocated).
332*/
333
334 /* advanced functions */
335
336extern int inflateInit2 OF((z_stream *strm,
337 int windowBits));
338/*
339 This is another version of inflateInit with more compression options. The
340 fields next_out, zalloc and zfree must be initialized before by the caller.
341
342 The windowBits parameter is the base two logarithm of the maximum window
343 size (the size of the history buffer). It should be in the range 8..15 for
344 this version of the library (the value 16 will be allowed soon). The
345 default value is 15 if inflateInit is used instead. If a compressed stream
346 with a larger window size is given as input, inflate() will return with
347 the error code Z_DATA_ERROR instead of trying to allocate a larger window.
348
349 If next_out is not null, the library will use this buffer for the history
350 buffer; the buffer must either be large enough to hold the entire output
351 data, or have at least 1<<windowBits bytes. If next_out is null, the
352 library will allocate its own buffer (and leave next_out null). next_in
353 need not be provided here but must be provided by the application for the
354 next call of inflate().
355
356 If the history buffer is provided by the application, next_out must
357 never be changed by the application since the decompressor maintains
358 history information inside this buffer from call to call; the application
359 can only reset next_out to the beginning of the history buffer when
360 avail_out is zero and all output has been consumed.
361
362 inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was
363 not enough memory, Z_STREAM_ERROR if a parameter is invalid (such as
364 windowBits < 8). msg is set to null if there is no error message.
365 inflateInit2 does not perform any decompression: this will be done by
366 inflate().
367*/
368
369extern int inflateSync OF((z_stream *strm));
370/*
371 Skips invalid compressed data until the special marker (see deflate()
372 above) can be found, or until all available input is skipped. No output
373 is provided.
374
375 inflateSync returns Z_OK if the special marker has been found, Z_BUF_ERROR
376 if no more input was provided, Z_DATA_ERROR if no marker has been found,
377 or Z_STREAM_ERROR if the stream structure was inconsistent. In the success
378 case, the application may save the current current value of total_in which
379 indicates where valid compressed data was found. In the error case, the
380 application may repeatedly call inflateSync, providing more input each time,
381 until success or end of the input data.
382*/
383
384extern int inflateReset OF((z_stream *strm));
385/*
386 This function is equivalent to inflateEnd followed by inflateInit,
387 but does not free and reallocate all the internal decompression state.
388 The stream will keep attributes that may have been set by inflateInit2.
389
390 inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
391 stream state was inconsistent (such as zalloc or state being NULL).
392*/
393
394extern int inflateIncomp OF((z_stream *strm));
395/*
396 This function adds the data at next_in (avail_in bytes) to the output
397 history without performing any output. There must be no pending output,
398 and the decompressor must be expecting to see the start of a block.
399 Calling this function is equivalent to decompressing a stored block
400 containing the data at next_in (except that the data is not output).
401*/
402
403 /* checksum functions */
404
405/*
406 This function is not related to compression but is exported
407 anyway because it might be useful in applications using the
408 compression library.
409*/
410
411extern uLong adler32 OF((uLong adler, Bytef *buf, uInt len));
412
413/*
414 Update a running Adler-32 checksum with the bytes buf[0..len-1] and
415 return the updated checksum. If buf is NULL, this function returns
416 the required initial value for the checksum.
417 An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
418 much faster. Usage example:
419
420 uLong adler = adler32(0L, Z_NULL, 0);
421
422 while (read_buffer(buffer, length) != EOF) {
423 adler = adler32(adler, buffer, length);
424 }
425 if (adler != original_adler) error();
426*/
427
428#ifndef _Z_UTIL_H
429 struct internal_state {int dummy;}; /* hack for buggy compilers */
430#endif
431
432#endif /* _ZLIB_H */
diff --git a/arch/ppc64/defconfig b/arch/ppc64/defconfig
index 37c157c93cef..e79fd60bc122 100644
--- a/arch/ppc64/defconfig
+++ b/arch/ppc64/defconfig
@@ -1318,7 +1318,7 @@ CONFIG_MSDOS_PARTITION=y
1318# 1318#
1319CONFIG_NLS=y 1319CONFIG_NLS=y
1320CONFIG_NLS_DEFAULT="iso8859-1" 1320CONFIG_NLS_DEFAULT="iso8859-1"
1321CONFIG_NLS_CODEPAGE_437=m 1321CONFIG_NLS_CODEPAGE_437=y
1322CONFIG_NLS_CODEPAGE_737=m 1322CONFIG_NLS_CODEPAGE_737=m
1323CONFIG_NLS_CODEPAGE_775=m 1323CONFIG_NLS_CODEPAGE_775=m
1324CONFIG_NLS_CODEPAGE_850=m 1324CONFIG_NLS_CODEPAGE_850=m
@@ -1342,7 +1342,7 @@ CONFIG_NLS_ISO8859_8=m
1342CONFIG_NLS_CODEPAGE_1250=m 1342CONFIG_NLS_CODEPAGE_1250=m
1343CONFIG_NLS_CODEPAGE_1251=m 1343CONFIG_NLS_CODEPAGE_1251=m
1344CONFIG_NLS_ASCII=m 1344CONFIG_NLS_ASCII=m
1345CONFIG_NLS_ISO8859_1=m 1345CONFIG_NLS_ISO8859_1=y
1346CONFIG_NLS_ISO8859_2=m 1346CONFIG_NLS_ISO8859_2=m
1347CONFIG_NLS_ISO8859_3=m 1347CONFIG_NLS_ISO8859_3=m
1348CONFIG_NLS_ISO8859_4=m 1348CONFIG_NLS_ISO8859_4=m
diff --git a/arch/ppc64/kernel/HvLpEvent.c b/arch/ppc64/kernel/HvLpEvent.c
deleted file mode 100644
index 90032b138902..000000000000
--- a/arch/ppc64/kernel/HvLpEvent.c
+++ /dev/null
@@ -1,88 +0,0 @@
1/*
2 * Copyright 2001 Mike Corrigan 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 <linux/stddef.h>
10#include <linux/kernel.h>
11#include <linux/module.h>
12#include <asm/system.h>
13#include <asm/iSeries/HvLpEvent.h>
14#include <asm/iSeries/HvCallEvent.h>
15#include <asm/iSeries/ItLpNaca.h>
16
17/* Array of LpEvent handler functions */
18LpEventHandler lpEventHandler[HvLpEvent_Type_NumTypes];
19unsigned lpEventHandlerPaths[HvLpEvent_Type_NumTypes];
20
21/* Register a handler for an LpEvent type */
22
23int HvLpEvent_registerHandler( HvLpEvent_Type eventType, LpEventHandler handler )
24{
25 int rc = 1;
26 if ( eventType < HvLpEvent_Type_NumTypes ) {
27 lpEventHandler[eventType] = handler;
28 rc = 0;
29 }
30 return rc;
31
32}
33
34int HvLpEvent_unregisterHandler( HvLpEvent_Type eventType )
35{
36 int rc = 1;
37
38 might_sleep();
39
40 if ( eventType < HvLpEvent_Type_NumTypes ) {
41 if ( !lpEventHandlerPaths[eventType] ) {
42 lpEventHandler[eventType] = NULL;
43 rc = 0;
44
45 /* We now sleep until all other CPUs have scheduled. This ensures that
46 * the deletion is seen by all other CPUs, and that the deleted handler
47 * isn't still running on another CPU when we return. */
48 synchronize_rcu();
49 }
50 }
51 return rc;
52}
53EXPORT_SYMBOL(HvLpEvent_registerHandler);
54EXPORT_SYMBOL(HvLpEvent_unregisterHandler);
55
56/* (lpIndex is the partition index of the target partition.
57 * needed only for VirtualIo, VirtualLan and SessionMgr. Zero
58 * indicates to use our partition index - for the other types)
59 */
60int HvLpEvent_openPath( HvLpEvent_Type eventType, HvLpIndex lpIndex )
61{
62 int rc = 1;
63 if ( eventType < HvLpEvent_Type_NumTypes &&
64 lpEventHandler[eventType] ) {
65 if ( lpIndex == 0 )
66 lpIndex = itLpNaca.xLpIndex;
67 HvCallEvent_openLpEventPath( lpIndex, eventType );
68 ++lpEventHandlerPaths[eventType];
69 rc = 0;
70 }
71 return rc;
72}
73
74int HvLpEvent_closePath( HvLpEvent_Type eventType, HvLpIndex lpIndex )
75{
76 int rc = 1;
77 if ( eventType < HvLpEvent_Type_NumTypes &&
78 lpEventHandler[eventType] &&
79 lpEventHandlerPaths[eventType] ) {
80 if ( lpIndex == 0 )
81 lpIndex = itLpNaca.xLpIndex;
82 HvCallEvent_closeLpEventPath( lpIndex, eventType );
83 --lpEventHandlerPaths[eventType];
84 rc = 0;
85 }
86 return rc;
87}
88
diff --git a/arch/ppc64/kernel/Makefile b/arch/ppc64/kernel/Makefile
index ae60eb1193c6..327c08ce4291 100644
--- a/arch/ppc64/kernel/Makefile
+++ b/arch/ppc64/kernel/Makefile
@@ -2,36 +2,34 @@
2# Makefile for the linux ppc64 kernel. 2# Makefile for the linux ppc64 kernel.
3# 3#
4 4
5ifneq ($(CONFIG_PPC_MERGE),y)
6
5EXTRA_CFLAGS += -mno-minimal-toc 7EXTRA_CFLAGS += -mno-minimal-toc
6extra-y := head.o vmlinux.lds 8extra-y := head.o vmlinux.lds
7 9
8obj-y := setup.o entry.o traps.o irq.o idle.o dma.o \ 10obj-y := misc.o prom.o
9 time.o process.o signal.o syscalls.o misc.o ptrace.o \ 11
10 align.o semaphore.o bitops.o pacaData.o \ 12endif
11 udbg.o binfmt_elf32.o sys_ppc32.o ioctl32.o \
12 ptrace32.o signal32.o rtc.o init_task.o \
13 lmb.o cputable.o cpu_setup_power4.o idle_power4.o \
14 iommu.o sysfs.o vdso.o pmc.o firmware.o
15obj-y += vdso32/ vdso64/
16 13
17obj-$(CONFIG_PPC_OF) += of_device.o 14obj-y += irq.o idle.o dma.o \
15 signal.o \
16 align.o bitops.o pacaData.o \
17 udbg.o ioctl32.o \
18 rtc.o \
19 cpu_setup_power4.o \
20 iommu.o sysfs.o vdso.o firmware.o
21obj-y += vdso32/ vdso64/
18 22
19pci-obj-$(CONFIG_PPC_ISERIES) += iSeries_pci.o iSeries_irq.o \
20 iSeries_VpdInfo.o
21pci-obj-$(CONFIG_PPC_MULTIPLATFORM) += pci_dn.o pci_direct_iommu.o 23pci-obj-$(CONFIG_PPC_MULTIPLATFORM) += pci_dn.o pci_direct_iommu.o
22 24
23obj-$(CONFIG_PCI) += pci.o pci_iommu.o iomap.o $(pci-obj-y) 25obj-$(CONFIG_PCI) += pci.o pci_iommu.o iomap.o $(pci-obj-y)
24 26
25obj-$(CONFIG_PPC_ISERIES) += HvCall.o HvLpConfig.o LparData.o \ 27obj-$(CONFIG_PPC_MULTIPLATFORM) += nvram.o
26 iSeries_setup.o ItLpQueue.o hvCall.o \ 28ifneq ($(CONFIG_PPC_MERGE),y)
27 mf.o HvLpEvent.o iSeries_proc.o iSeries_htab.o \ 29obj-$(CONFIG_PPC_MULTIPLATFORM) += prom_init.o
28 iSeries_iommu.o 30endif
29
30obj-$(CONFIG_PPC_MULTIPLATFORM) += nvram.o i8259.o prom_init.o prom.o
31 31
32obj-$(CONFIG_PPC_PSERIES) += pSeries_pci.o pSeries_lpar.o pSeries_hvCall.o \ 32obj-$(CONFIG_PPC_PSERIES) += rtasd.o udbg_16550.o
33 pSeries_nvram.o rtasd.o ras.o pSeries_reconfig.o \
34 pSeries_setup.o pSeries_iommu.o udbg_16550.o
35 33
36obj-$(CONFIG_PPC_BPA) += bpa_setup.o bpa_iommu.o bpa_nvram.o \ 34obj-$(CONFIG_PPC_BPA) += bpa_setup.o bpa_iommu.o bpa_nvram.o \
37 bpa_iic.o spider-pic.o 35 bpa_iic.o spider-pic.o
@@ -41,45 +39,36 @@ obj-$(CONFIG_EEH) += eeh.o
41obj-$(CONFIG_PROC_FS) += proc_ppc64.o 39obj-$(CONFIG_PROC_FS) += proc_ppc64.o
42obj-$(CONFIG_RTAS_FLASH) += rtas_flash.o 40obj-$(CONFIG_RTAS_FLASH) += rtas_flash.o
43obj-$(CONFIG_SMP) += smp.o 41obj-$(CONFIG_SMP) += smp.o
44obj-$(CONFIG_MODULES) += module.o ppc_ksyms.o 42obj-$(CONFIG_MODULES) += module.o
45obj-$(CONFIG_PPC_RTAS) += rtas.o rtas_pci.o 43ifneq ($(CONFIG_PPC_MERGE),y)
44obj-$(CONFIG_MODULES) += ppc_ksyms.o
45endif
46obj-$(CONFIG_PPC_RTAS) += rtas_pci.o
46obj-$(CONFIG_RTAS_PROC) += rtas-proc.o 47obj-$(CONFIG_RTAS_PROC) += rtas-proc.o
47obj-$(CONFIG_SCANLOG) += scanlog.o 48obj-$(CONFIG_SCANLOG) += scanlog.o
48obj-$(CONFIG_VIOPATH) += viopath.o
49obj-$(CONFIG_LPARCFG) += lparcfg.o 49obj-$(CONFIG_LPARCFG) += lparcfg.o
50obj-$(CONFIG_HVC_CONSOLE) += hvconsole.o 50obj-$(CONFIG_HVC_CONSOLE) += hvconsole.o
51ifneq ($(CONFIG_PPC_MERGE),y)
51obj-$(CONFIG_BOOTX_TEXT) += btext.o 52obj-$(CONFIG_BOOTX_TEXT) += btext.o
53endif
52obj-$(CONFIG_HVCS) += hvcserver.o 54obj-$(CONFIG_HVCS) += hvcserver.o
53 55
54vio-obj-$(CONFIG_PPC_PSERIES) += pSeries_vio.o 56obj-$(CONFIG_PPC_PMAC) += udbg_scc.o
55vio-obj-$(CONFIG_PPC_ISERIES) += iSeries_vio.o
56obj-$(CONFIG_IBMVIO) += vio.o $(vio-obj-y)
57obj-$(CONFIG_XICS) += xics.o
58obj-$(CONFIG_MPIC) += mpic.o
59 57
60obj-$(CONFIG_PPC_PMAC) += pmac_setup.o pmac_feature.o pmac_pci.o \ 58obj-$(CONFIG_PPC_MAPLE) += udbg_16550.o
61 pmac_time.o pmac_nvram.o pmac_low_i2c.o \
62 udbg_scc.o
63
64obj-$(CONFIG_PPC_MAPLE) += maple_setup.o maple_pci.o maple_time.o \
65 udbg_16550.o
66
67obj-$(CONFIG_U3_DART) += u3_iommu.o
68 59
69ifdef CONFIG_SMP 60ifdef CONFIG_SMP
70obj-$(CONFIG_PPC_PMAC) += pmac_smp.o smp-tbsync.o 61obj-$(CONFIG_PPC_PMAC) += smp-tbsync.o
71obj-$(CONFIG_PPC_ISERIES) += iSeries_smp.o
72obj-$(CONFIG_PPC_PSERIES) += pSeries_smp.o
73obj-$(CONFIG_PPC_BPA) += pSeries_smp.o
74obj-$(CONFIG_PPC_MAPLE) += smp-tbsync.o 62obj-$(CONFIG_PPC_MAPLE) += smp-tbsync.o
75endif 63endif
76 64
77obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o
78obj-$(CONFIG_KPROBES) += kprobes.o 65obj-$(CONFIG_KPROBES) += kprobes.o
79 66
80CFLAGS_ioctl32.o += -Ifs/ 67CFLAGS_ioctl32.o += -Ifs/
81 68
69ifneq ($(CONFIG_PPC_MERGE),y)
82ifeq ($(CONFIG_PPC_ISERIES),y) 70ifeq ($(CONFIG_PPC_ISERIES),y)
83arch/ppc64/kernel/head.o: arch/ppc64/kernel/lparmap.s 71arch/ppc64/kernel/head.o: arch/powerpc/kernel/lparmap.s
84AFLAGS_head.o += -Iarch/ppc64/kernel 72AFLAGS_head.o += -Iarch/powerpc/kernel
73endif
85endif 74endif
diff --git a/arch/ppc64/kernel/align.c b/arch/ppc64/kernel/align.c
index 330e7ef81427..256d5b592aa1 100644
--- a/arch/ppc64/kernel/align.c
+++ b/arch/ppc64/kernel/align.c
@@ -313,7 +313,7 @@ fix_alignment(struct pt_regs *regs)
313 /* Doing stfs, have to convert to single */ 313 /* Doing stfs, have to convert to single */
314 preempt_disable(); 314 preempt_disable();
315 enable_kernel_fp(); 315 enable_kernel_fp();
316 cvt_df(&current->thread.fpr[reg], (float *)&data.v[4], &current->thread.fpscr); 316 cvt_df(&current->thread.fpr[reg], (float *)&data.v[4], &current->thread);
317 disable_kernel_fp(); 317 disable_kernel_fp();
318 preempt_enable(); 318 preempt_enable();
319 } 319 }
@@ -349,7 +349,7 @@ fix_alignment(struct pt_regs *regs)
349 /* Doing lfs, have to convert to double */ 349 /* Doing lfs, have to convert to double */
350 preempt_disable(); 350 preempt_disable();
351 enable_kernel_fp(); 351 enable_kernel_fp();
352 cvt_fd((float *)&data.v[4], &current->thread.fpr[reg], &current->thread.fpscr); 352 cvt_fd((float *)&data.v[4], &current->thread.fpr[reg], &current->thread);
353 disable_kernel_fp(); 353 disable_kernel_fp();
354 preempt_enable(); 354 preempt_enable();
355 } 355 }
diff --git a/arch/ppc64/kernel/asm-offsets.c b/arch/ppc64/kernel/asm-offsets.c
index 1ff4fa05a973..5e6046cb414e 100644
--- a/arch/ppc64/kernel/asm-offsets.c
+++ b/arch/ppc64/kernel/asm-offsets.c
@@ -46,8 +46,6 @@
46int main(void) 46int main(void)
47{ 47{
48 /* thread struct on stack */ 48 /* thread struct on stack */
49 DEFINE(THREAD_SHIFT, THREAD_SHIFT);
50 DEFINE(THREAD_SIZE, THREAD_SIZE);
51 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); 49 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
52 DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); 50 DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
53 DEFINE(TI_SC_NOERR, offsetof(struct thread_info, syscall_noerror)); 51 DEFINE(TI_SC_NOERR, offsetof(struct thread_info, syscall_noerror));
@@ -77,6 +75,7 @@ int main(void)
77 DEFINE(ICACHEL1LOGLINESIZE, offsetof(struct ppc64_caches, log_iline_size)); 75 DEFINE(ICACHEL1LOGLINESIZE, offsetof(struct ppc64_caches, log_iline_size));
78 DEFINE(ICACHEL1LINESPERPAGE, offsetof(struct ppc64_caches, ilines_per_page)); 76 DEFINE(ICACHEL1LINESPERPAGE, offsetof(struct ppc64_caches, ilines_per_page));
79 DEFINE(PLATFORM, offsetof(struct systemcfg, platform)); 77 DEFINE(PLATFORM, offsetof(struct systemcfg, platform));
78 DEFINE(PLATFORM_LPAR, PLATFORM_LPAR);
80 79
81 /* paca */ 80 /* paca */
82 DEFINE(PACA_SIZE, sizeof(struct paca_struct)); 81 DEFINE(PACA_SIZE, sizeof(struct paca_struct));
diff --git a/arch/ppc64/kernel/bpa_iommu.c b/arch/ppc64/kernel/bpa_iommu.c
index 5f2460090e03..da1b4b7a3269 100644
--- a/arch/ppc64/kernel/bpa_iommu.c
+++ b/arch/ppc64/kernel/bpa_iommu.c
@@ -39,8 +39,8 @@
39#include <asm/pmac_feature.h> 39#include <asm/pmac_feature.h>
40#include <asm/abs_addr.h> 40#include <asm/abs_addr.h>
41#include <asm/system.h> 41#include <asm/system.h>
42#include <asm/ppc-pci.h>
42 43
43#include "pci.h"
44#include "bpa_iommu.h" 44#include "bpa_iommu.h"
45 45
46static inline unsigned long 46static inline unsigned long
diff --git a/arch/ppc64/kernel/bpa_setup.c b/arch/ppc64/kernel/bpa_setup.c
index 57b3db66f458..c2dc8f282eb8 100644
--- a/arch/ppc64/kernel/bpa_setup.c
+++ b/arch/ppc64/kernel/bpa_setup.c
@@ -43,8 +43,9 @@
43#include <asm/time.h> 43#include <asm/time.h>
44#include <asm/nvram.h> 44#include <asm/nvram.h>
45#include <asm/cputable.h> 45#include <asm/cputable.h>
46#include <asm/ppc-pci.h>
47#include <asm/irq.h>
46 48
47#include "pci.h"
48#include "bpa_iic.h" 49#include "bpa_iic.h"
49#include "bpa_iommu.h" 50#include "bpa_iommu.h"
50 51
@@ -54,7 +55,7 @@
54#define DBG(fmt...) 55#define DBG(fmt...)
55#endif 56#endif
56 57
57void bpa_get_cpuinfo(struct seq_file *m) 58void bpa_show_cpuinfo(struct seq_file *m)
58{ 59{
59 struct device_node *root; 60 struct device_node *root;
60 const char *model = ""; 61 const char *model = "";
@@ -128,7 +129,7 @@ struct machdep_calls __initdata bpa_md = {
128 .probe = bpa_probe, 129 .probe = bpa_probe,
129 .setup_arch = bpa_setup_arch, 130 .setup_arch = bpa_setup_arch,
130 .init_early = bpa_init_early, 131 .init_early = bpa_init_early,
131 .get_cpuinfo = bpa_get_cpuinfo, 132 .show_cpuinfo = bpa_show_cpuinfo,
132 .restart = rtas_restart, 133 .restart = rtas_restart,
133 .power_off = rtas_power_off, 134 .power_off = rtas_power_off,
134 .halt = rtas_halt, 135 .halt = rtas_halt,
diff --git a/arch/ppc64/kernel/btext.c b/arch/ppc64/kernel/btext.c
index b6fbfbe9032d..506a37885c5c 100644
--- a/arch/ppc64/kernel/btext.c
+++ b/arch/ppc64/kernel/btext.c
@@ -18,6 +18,7 @@
18#include <asm/io.h> 18#include <asm/io.h>
19#include <asm/lmb.h> 19#include <asm/lmb.h>
20#include <asm/processor.h> 20#include <asm/processor.h>
21#include <asm/udbg.h>
21 22
22#undef NO_SCROLL 23#undef NO_SCROLL
23 24
@@ -131,6 +132,47 @@ int btext_initialize(struct device_node *np)
131 return 0; 132 return 0;
132} 133}
133 134
135static void btext_putc(unsigned char c)
136{
137 btext_drawchar(c);
138}
139
140void __init init_boot_display(void)
141{
142 char *name;
143 struct device_node *np = NULL;
144 int rc = -ENODEV;
145
146 printk("trying to initialize btext ...\n");
147
148 name = (char *)get_property(of_chosen, "linux,stdout-path", NULL);
149 if (name != NULL) {
150 np = of_find_node_by_path(name);
151 if (np != NULL) {
152 if (strcmp(np->type, "display") != 0) {
153 printk("boot stdout isn't a display !\n");
154 of_node_put(np);
155 np = NULL;
156 }
157 }
158 }
159 if (np)
160 rc = btext_initialize(np);
161 if (rc) {
162 for (np = NULL; (np = of_find_node_by_type(np, "display"));) {
163 if (get_property(np, "linux,opened", NULL)) {
164 printk("trying %s ...\n", np->full_name);
165 rc = btext_initialize(np);
166 printk("result: %d\n", rc);
167 }
168 if (rc == 0)
169 break;
170 }
171 }
172 if (rc == 0 && udbg_putc == NULL)
173 udbg_putc = btext_putc;
174}
175
134 176
135/* Calc the base address of a given point (x,y) */ 177/* Calc the base address of a given point (x,y) */
136static unsigned char * calc_base(int x, int y) 178static unsigned char * calc_base(int x, int y)
diff --git a/arch/ppc64/kernel/cputable.c b/arch/ppc64/kernel/cputable.c
deleted file mode 100644
index 8831a28c3c4e..000000000000
--- a/arch/ppc64/kernel/cputable.c
+++ /dev/null
@@ -1,308 +0,0 @@
1/*
2 * arch/ppc64/kernel/cputable.c
3 *
4 * Copyright (C) 2001 Ben. Herrenschmidt (benh@kernel.crashing.org)
5 *
6 * Modifications for ppc64:
7 * Copyright (C) 2003 Dave Engebretsen <engebret@us.ibm.com>
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#include <linux/config.h>
16#include <linux/string.h>
17#include <linux/sched.h>
18#include <linux/threads.h>
19#include <linux/init.h>
20#include <linux/module.h>
21
22#include <asm/oprofile_impl.h>
23#include <asm/cputable.h>
24
25struct cpu_spec* cur_cpu_spec = NULL;
26EXPORT_SYMBOL(cur_cpu_spec);
27
28/* NOTE:
29 * Unlike ppc32, ppc64 will only call this once for the boot CPU, it's
30 * the responsibility of the appropriate CPU save/restore functions to
31 * eventually copy these settings over. Those save/restore aren't yet
32 * part of the cputable though. That has to be fixed for both ppc32
33 * and ppc64
34 */
35extern void __setup_cpu_power3(unsigned long offset, struct cpu_spec* spec);
36extern void __setup_cpu_power4(unsigned long offset, struct cpu_spec* spec);
37extern void __setup_cpu_ppc970(unsigned long offset, struct cpu_spec* spec);
38extern void __setup_cpu_be(unsigned long offset, struct cpu_spec* spec);
39
40
41/* We only set the altivec features if the kernel was compiled with altivec
42 * support
43 */
44#ifdef CONFIG_ALTIVEC
45#define CPU_FTR_ALTIVEC_COMP CPU_FTR_ALTIVEC
46#define PPC_FEATURE_HAS_ALTIVEC_COMP PPC_FEATURE_HAS_ALTIVEC
47#else
48#define CPU_FTR_ALTIVEC_COMP 0
49#define PPC_FEATURE_HAS_ALTIVEC_COMP 0
50#endif
51
52struct cpu_spec cpu_specs[] = {
53 { /* Power3 */
54 .pvr_mask = 0xffff0000,
55 .pvr_value = 0x00400000,
56 .cpu_name = "POWER3 (630)",
57 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
58 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR,
59 .cpu_user_features = COMMON_USER_PPC64,
60 .icache_bsize = 128,
61 .dcache_bsize = 128,
62 .num_pmcs = 8,
63 .cpu_setup = __setup_cpu_power3,
64#ifdef CONFIG_OPROFILE
65 .oprofile_cpu_type = "ppc64/power3",
66 .oprofile_model = &op_model_rs64,
67#endif
68 },
69 { /* Power3+ */
70 .pvr_mask = 0xffff0000,
71 .pvr_value = 0x00410000,
72 .cpu_name = "POWER3 (630+)",
73 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
74 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR,
75 .cpu_user_features = COMMON_USER_PPC64,
76 .icache_bsize = 128,
77 .dcache_bsize = 128,
78 .num_pmcs = 8,
79 .cpu_setup = __setup_cpu_power3,
80#ifdef CONFIG_OPROFILE
81 .oprofile_cpu_type = "ppc64/power3",
82 .oprofile_model = &op_model_rs64,
83#endif
84 },
85 { /* Northstar */
86 .pvr_mask = 0xffff0000,
87 .pvr_value = 0x00330000,
88 .cpu_name = "RS64-II (northstar)",
89 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
90 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR |
91 CPU_FTR_MMCRA | CPU_FTR_CTRL,
92 .cpu_user_features = COMMON_USER_PPC64,
93 .icache_bsize = 128,
94 .dcache_bsize = 128,
95 .num_pmcs = 8,
96 .cpu_setup = __setup_cpu_power3,
97#ifdef CONFIG_OPROFILE
98 .oprofile_cpu_type = "ppc64/rs64",
99 .oprofile_model = &op_model_rs64,
100#endif
101 },
102 { /* Pulsar */
103 .pvr_mask = 0xffff0000,
104 .pvr_value = 0x00340000,
105 .cpu_name = "RS64-III (pulsar)",
106 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
107 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR |
108 CPU_FTR_MMCRA | CPU_FTR_CTRL,
109 .cpu_user_features = COMMON_USER_PPC64,
110 .icache_bsize = 128,
111 .dcache_bsize = 128,
112 .num_pmcs = 8,
113 .cpu_setup = __setup_cpu_power3,
114#ifdef CONFIG_OPROFILE
115 .oprofile_cpu_type = "ppc64/rs64",
116 .oprofile_model = &op_model_rs64,
117#endif
118 },
119 { /* I-star */
120 .pvr_mask = 0xffff0000,
121 .pvr_value = 0x00360000,
122 .cpu_name = "RS64-III (icestar)",
123 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
124 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR |
125 CPU_FTR_MMCRA | CPU_FTR_CTRL,
126 .cpu_user_features = COMMON_USER_PPC64,
127 .icache_bsize = 128,
128 .dcache_bsize = 128,
129 .num_pmcs = 8,
130 .cpu_setup = __setup_cpu_power3,
131#ifdef CONFIG_OPROFILE
132 .oprofile_cpu_type = "ppc64/rs64",
133 .oprofile_model = &op_model_rs64,
134#endif
135 },
136 { /* S-star */
137 .pvr_mask = 0xffff0000,
138 .pvr_value = 0x00370000,
139 .cpu_name = "RS64-IV (sstar)",
140 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
141 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR |
142 CPU_FTR_MMCRA | CPU_FTR_CTRL,
143 .cpu_user_features = COMMON_USER_PPC64,
144 .icache_bsize = 128,
145 .dcache_bsize = 128,
146 .num_pmcs = 8,
147 .cpu_setup = __setup_cpu_power3,
148#ifdef CONFIG_OPROFILE
149 .oprofile_cpu_type = "ppc64/rs64",
150 .oprofile_model = &op_model_rs64,
151#endif
152 },
153 { /* Power4 */
154 .pvr_mask = 0xffff0000,
155 .pvr_value = 0x00350000,
156 .cpu_name = "POWER4 (gp)",
157 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
158 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
159 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_MMCRA,
160 .cpu_user_features = COMMON_USER_PPC64,
161 .icache_bsize = 128,
162 .dcache_bsize = 128,
163 .num_pmcs = 8,
164 .cpu_setup = __setup_cpu_power4,
165#ifdef CONFIG_OPROFILE
166 .oprofile_cpu_type = "ppc64/power4",
167 .oprofile_model = &op_model_rs64,
168#endif
169 },
170 { /* Power4+ */
171 .pvr_mask = 0xffff0000,
172 .pvr_value = 0x00380000,
173 .cpu_name = "POWER4+ (gq)",
174 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
175 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
176 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_MMCRA,
177 .cpu_user_features = COMMON_USER_PPC64,
178 .icache_bsize = 128,
179 .dcache_bsize = 128,
180 .num_pmcs = 8,
181 .cpu_setup = __setup_cpu_power4,
182#ifdef CONFIG_OPROFILE
183 .oprofile_cpu_type = "ppc64/power4",
184 .oprofile_model = &op_model_power4,
185#endif
186 },
187 { /* PPC970 */
188 .pvr_mask = 0xffff0000,
189 .pvr_value = 0x00390000,
190 .cpu_name = "PPC970",
191 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
192 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
193 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_ALTIVEC_COMP |
194 CPU_FTR_CAN_NAP | CPU_FTR_MMCRA,
195 .cpu_user_features = COMMON_USER_PPC64 |
196 PPC_FEATURE_HAS_ALTIVEC_COMP,
197 .icache_bsize = 128,
198 .dcache_bsize = 128,
199 .num_pmcs = 8,
200 .cpu_setup = __setup_cpu_ppc970,
201#ifdef CONFIG_OPROFILE
202 .oprofile_cpu_type = "ppc64/970",
203 .oprofile_model = &op_model_power4,
204#endif
205 },
206 { /* PPC970FX */
207 .pvr_mask = 0xffff0000,
208 .pvr_value = 0x003c0000,
209 .cpu_name = "PPC970FX",
210 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
211 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
212 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_ALTIVEC_COMP |
213 CPU_FTR_CAN_NAP | CPU_FTR_MMCRA,
214 .cpu_user_features = COMMON_USER_PPC64 |
215 PPC_FEATURE_HAS_ALTIVEC_COMP,
216 .icache_bsize = 128,
217 .dcache_bsize = 128,
218 .num_pmcs = 8,
219 .cpu_setup = __setup_cpu_ppc970,
220#ifdef CONFIG_OPROFILE
221 .oprofile_cpu_type = "ppc64/970",
222 .oprofile_model = &op_model_power4,
223#endif
224 },
225 { /* PPC970MP */
226 .pvr_mask = 0xffff0000,
227 .pvr_value = 0x00440000,
228 .cpu_name = "PPC970MP",
229 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
230 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
231 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_ALTIVEC_COMP |
232 CPU_FTR_CAN_NAP | CPU_FTR_MMCRA,
233 .cpu_user_features = COMMON_USER_PPC64 |
234 PPC_FEATURE_HAS_ALTIVEC_COMP,
235 .icache_bsize = 128,
236 .dcache_bsize = 128,
237 .cpu_setup = __setup_cpu_ppc970,
238#ifdef CONFIG_OPROFILE
239 .oprofile_cpu_type = "ppc64/970",
240 .oprofile_model = &op_model_power4,
241#endif
242 },
243 { /* Power5 */
244 .pvr_mask = 0xffff0000,
245 .pvr_value = 0x003a0000,
246 .cpu_name = "POWER5 (gr)",
247 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
248 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
249 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_MMCRA | CPU_FTR_SMT |
250 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE |
251 CPU_FTR_MMCRA_SIHV,
252 .cpu_user_features = COMMON_USER_PPC64,
253 .icache_bsize = 128,
254 .dcache_bsize = 128,
255 .num_pmcs = 6,
256 .cpu_setup = __setup_cpu_power4,
257#ifdef CONFIG_OPROFILE
258 .oprofile_cpu_type = "ppc64/power5",
259 .oprofile_model = &op_model_power4,
260#endif
261 },
262 { /* Power5 */
263 .pvr_mask = 0xffff0000,
264 .pvr_value = 0x003b0000,
265 .cpu_name = "POWER5 (gs)",
266 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
267 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
268 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_MMCRA | CPU_FTR_SMT |
269 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE |
270 CPU_FTR_MMCRA_SIHV,
271 .cpu_user_features = COMMON_USER_PPC64,
272 .icache_bsize = 128,
273 .dcache_bsize = 128,
274 .num_pmcs = 6,
275 .cpu_setup = __setup_cpu_power4,
276#ifdef CONFIG_OPROFILE
277 .oprofile_cpu_type = "ppc64/power5",
278 .oprofile_model = &op_model_power4,
279#endif
280 },
281 { /* BE DD1.x */
282 .pvr_mask = 0xffff0000,
283 .pvr_value = 0x00700000,
284 .cpu_name = "Broadband Engine",
285 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
286 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
287 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_ALTIVEC_COMP |
288 CPU_FTR_SMT,
289 .cpu_user_features = COMMON_USER_PPC64 |
290 PPC_FEATURE_HAS_ALTIVEC_COMP,
291 .icache_bsize = 128,
292 .dcache_bsize = 128,
293 .cpu_setup = __setup_cpu_be,
294 },
295 { /* default match */
296 .pvr_mask = 0x00000000,
297 .pvr_value = 0x00000000,
298 .cpu_name = "POWER4 (compatible)",
299 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
300 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
301 CPU_FTR_PPCAS_ARCH_V2,
302 .cpu_user_features = COMMON_USER_PPC64,
303 .icache_bsize = 128,
304 .dcache_bsize = 128,
305 .num_pmcs = 6,
306 .cpu_setup = __setup_cpu_power4,
307 }
308};
diff --git a/arch/ppc64/kernel/eeh.c b/arch/ppc64/kernel/eeh.c
index ba93fd731222..035d1b14a207 100644
--- a/arch/ppc64/kernel/eeh.c
+++ b/arch/ppc64/kernel/eeh.c
@@ -33,7 +33,7 @@
33#include <asm/rtas.h> 33#include <asm/rtas.h>
34#include <asm/atomic.h> 34#include <asm/atomic.h>
35#include <asm/systemcfg.h> 35#include <asm/systemcfg.h>
36#include "pci.h" 36#include <asm/ppc-pci.h>
37 37
38#undef DEBUG 38#undef DEBUG
39 39
diff --git a/arch/ppc64/kernel/head.S b/arch/ppc64/kernel/head.S
index 72c61041151a..929f9f42cf7a 100644
--- a/arch/ppc64/kernel/head.S
+++ b/arch/ppc64/kernel/head.S
@@ -36,6 +36,7 @@
36#include <asm/setup.h> 36#include <asm/setup.h>
37#include <asm/hvcall.h> 37#include <asm/hvcall.h>
38#include <asm/iSeries/LparMap.h> 38#include <asm/iSeries/LparMap.h>
39#include <asm/thread_info.h>
39 40
40#ifdef CONFIG_PPC_ISERIES 41#ifdef CONFIG_PPC_ISERIES
41#define DO_SOFT_DISABLE 42#define DO_SOFT_DISABLE
@@ -80,7 +81,7 @@ _stext:
80_GLOBAL(__start) 81_GLOBAL(__start)
81 /* NOP this out unconditionally */ 82 /* NOP this out unconditionally */
82BEGIN_FTR_SECTION 83BEGIN_FTR_SECTION
83 b .__start_initialization_multiplatform 84 b .__start_initialization_multiplatform
84END_FTR_SECTION(0, 1) 85END_FTR_SECTION(0, 1)
85#endif /* CONFIG_PPC_MULTIPLATFORM */ 86#endif /* CONFIG_PPC_MULTIPLATFORM */
86 87
@@ -201,22 +202,22 @@ exception_marker:
201#define EX_CCR 60 202#define EX_CCR 60
202 203
203#define EXCEPTION_PROLOG_PSERIES(area, label) \ 204#define EXCEPTION_PROLOG_PSERIES(area, label) \
204 mfspr r13,SPRG3; /* get paca address into r13 */ \ 205 mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \
205 std r9,area+EX_R9(r13); /* save r9 - r12 */ \ 206 std r9,area+EX_R9(r13); /* save r9 - r12 */ \
206 std r10,area+EX_R10(r13); \ 207 std r10,area+EX_R10(r13); \
207 std r11,area+EX_R11(r13); \ 208 std r11,area+EX_R11(r13); \
208 std r12,area+EX_R12(r13); \ 209 std r12,area+EX_R12(r13); \
209 mfspr r9,SPRG1; \ 210 mfspr r9,SPRN_SPRG1; \
210 std r9,area+EX_R13(r13); \ 211 std r9,area+EX_R13(r13); \
211 mfcr r9; \ 212 mfcr r9; \
212 clrrdi r12,r13,32; /* get high part of &label */ \ 213 clrrdi r12,r13,32; /* get high part of &label */ \
213 mfmsr r10; \ 214 mfmsr r10; \
214 mfspr r11,SRR0; /* save SRR0 */ \ 215 mfspr r11,SPRN_SRR0; /* save SRR0 */ \
215 ori r12,r12,(label)@l; /* virt addr of handler */ \ 216 ori r12,r12,(label)@l; /* virt addr of handler */ \
216 ori r10,r10,MSR_IR|MSR_DR|MSR_RI; \ 217 ori r10,r10,MSR_IR|MSR_DR|MSR_RI; \
217 mtspr SRR0,r12; \ 218 mtspr SPRN_SRR0,r12; \
218 mfspr r12,SRR1; /* and SRR1 */ \ 219 mfspr r12,SPRN_SRR1; /* and SRR1 */ \
219 mtspr SRR1,r10; \ 220 mtspr SPRN_SRR1,r10; \
220 rfid; \ 221 rfid; \
221 b . /* prevent speculative execution */ 222 b . /* prevent speculative execution */
222 223
@@ -225,12 +226,12 @@ exception_marker:
225 * This code runs with relocation on. 226 * This code runs with relocation on.
226 */ 227 */
227#define EXCEPTION_PROLOG_ISERIES_1(area) \ 228#define EXCEPTION_PROLOG_ISERIES_1(area) \
228 mfspr r13,SPRG3; /* get paca address into r13 */ \ 229 mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \
229 std r9,area+EX_R9(r13); /* save r9 - r12 */ \ 230 std r9,area+EX_R9(r13); /* save r9 - r12 */ \
230 std r10,area+EX_R10(r13); \ 231 std r10,area+EX_R10(r13); \
231 std r11,area+EX_R11(r13); \ 232 std r11,area+EX_R11(r13); \
232 std r12,area+EX_R12(r13); \ 233 std r12,area+EX_R12(r13); \
233 mfspr r9,SPRG1; \ 234 mfspr r9,SPRN_SPRG1; \
234 std r9,area+EX_R13(r13); \ 235 std r9,area+EX_R13(r13); \
235 mfcr r9 236 mfcr r9
236 237
@@ -283,7 +284,7 @@ exception_marker:
283 std r9,_LINK(r1); \ 284 std r9,_LINK(r1); \
284 mfctr r10; /* save CTR in stackframe */ \ 285 mfctr r10; /* save CTR in stackframe */ \
285 std r10,_CTR(r1); \ 286 std r10,_CTR(r1); \
286 mfspr r11,XER; /* save XER in stackframe */ \ 287 mfspr r11,SPRN_XER; /* save XER in stackframe */ \
287 std r11,_XER(r1); \ 288 std r11,_XER(r1); \
288 li r9,(n)+1; \ 289 li r9,(n)+1; \
289 std r9,_TRAP(r1); /* set trap number */ \ 290 std r9,_TRAP(r1); /* set trap number */ \
@@ -300,7 +301,7 @@ exception_marker:
300 .globl label##_pSeries; \ 301 .globl label##_pSeries; \
301label##_pSeries: \ 302label##_pSeries: \
302 HMT_MEDIUM; \ 303 HMT_MEDIUM; \
303 mtspr SPRG1,r13; /* save r13 */ \ 304 mtspr SPRN_SPRG1,r13; /* save r13 */ \
304 RUNLATCH_ON(r13); \ 305 RUNLATCH_ON(r13); \
305 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common) 306 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common)
306 307
@@ -308,7 +309,7 @@ label##_pSeries: \
308 .globl label##_iSeries; \ 309 .globl label##_iSeries; \
309label##_iSeries: \ 310label##_iSeries: \
310 HMT_MEDIUM; \ 311 HMT_MEDIUM; \
311 mtspr SPRG1,r13; /* save r13 */ \ 312 mtspr SPRN_SPRG1,r13; /* save r13 */ \
312 RUNLATCH_ON(r13); \ 313 RUNLATCH_ON(r13); \
313 EXCEPTION_PROLOG_ISERIES_1(area); \ 314 EXCEPTION_PROLOG_ISERIES_1(area); \
314 EXCEPTION_PROLOG_ISERIES_2; \ 315 EXCEPTION_PROLOG_ISERIES_2; \
@@ -318,7 +319,7 @@ label##_iSeries: \
318 .globl label##_iSeries; \ 319 .globl label##_iSeries; \
319label##_iSeries: \ 320label##_iSeries: \
320 HMT_MEDIUM; \ 321 HMT_MEDIUM; \
321 mtspr SPRG1,r13; /* save r13 */ \ 322 mtspr SPRN_SPRG1,r13; /* save r13 */ \
322 RUNLATCH_ON(r13); \ 323 RUNLATCH_ON(r13); \
323 EXCEPTION_PROLOG_ISERIES_1(PACA_EXGEN); \ 324 EXCEPTION_PROLOG_ISERIES_1(PACA_EXGEN); \
324 lbz r10,PACAPROCENABLED(r13); \ 325 lbz r10,PACAPROCENABLED(r13); \
@@ -388,7 +389,7 @@ __start_interrupts:
388 . = 0x200 389 . = 0x200
389_machine_check_pSeries: 390_machine_check_pSeries:
390 HMT_MEDIUM 391 HMT_MEDIUM
391 mtspr SPRG1,r13 /* save r13 */ 392 mtspr SPRN_SPRG1,r13 /* save r13 */
392 RUNLATCH_ON(r13) 393 RUNLATCH_ON(r13)
393 EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common) 394 EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common)
394 395
@@ -396,18 +397,18 @@ _machine_check_pSeries:
396 .globl data_access_pSeries 397 .globl data_access_pSeries
397data_access_pSeries: 398data_access_pSeries:
398 HMT_MEDIUM 399 HMT_MEDIUM
399 mtspr SPRG1,r13 400 mtspr SPRN_SPRG1,r13
400BEGIN_FTR_SECTION 401BEGIN_FTR_SECTION
401 mtspr SPRG2,r12 402 mtspr SPRN_SPRG2,r12
402 mfspr r13,DAR 403 mfspr r13,SPRN_DAR
403 mfspr r12,DSISR 404 mfspr r12,SPRN_DSISR
404 srdi r13,r13,60 405 srdi r13,r13,60
405 rlwimi r13,r12,16,0x20 406 rlwimi r13,r12,16,0x20
406 mfcr r12 407 mfcr r12
407 cmpwi r13,0x2c 408 cmpwi r13,0x2c
408 beq .do_stab_bolted_pSeries 409 beq .do_stab_bolted_pSeries
409 mtcrf 0x80,r12 410 mtcrf 0x80,r12
410 mfspr r12,SPRG2 411 mfspr r12,SPRN_SPRG2
411END_FTR_SECTION_IFCLR(CPU_FTR_SLB) 412END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
412 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, data_access_common) 413 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, data_access_common)
413 414
@@ -415,19 +416,19 @@ END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
415 .globl data_access_slb_pSeries 416 .globl data_access_slb_pSeries
416data_access_slb_pSeries: 417data_access_slb_pSeries:
417 HMT_MEDIUM 418 HMT_MEDIUM
418 mtspr SPRG1,r13 419 mtspr SPRN_SPRG1,r13
419 RUNLATCH_ON(r13) 420 RUNLATCH_ON(r13)
420 mfspr r13,SPRG3 /* get paca address into r13 */ 421 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */
421 std r9,PACA_EXSLB+EX_R9(r13) /* save r9 - r12 */ 422 std r9,PACA_EXSLB+EX_R9(r13) /* save r9 - r12 */
422 std r10,PACA_EXSLB+EX_R10(r13) 423 std r10,PACA_EXSLB+EX_R10(r13)
423 std r11,PACA_EXSLB+EX_R11(r13) 424 std r11,PACA_EXSLB+EX_R11(r13)
424 std r12,PACA_EXSLB+EX_R12(r13) 425 std r12,PACA_EXSLB+EX_R12(r13)
425 std r3,PACA_EXSLB+EX_R3(r13) 426 std r3,PACA_EXSLB+EX_R3(r13)
426 mfspr r9,SPRG1 427 mfspr r9,SPRN_SPRG1
427 std r9,PACA_EXSLB+EX_R13(r13) 428 std r9,PACA_EXSLB+EX_R13(r13)
428 mfcr r9 429 mfcr r9
429 mfspr r12,SRR1 /* and SRR1 */ 430 mfspr r12,SPRN_SRR1 /* and SRR1 */
430 mfspr r3,DAR 431 mfspr r3,SPRN_DAR
431 b .do_slb_miss /* Rel. branch works in real mode */ 432 b .do_slb_miss /* Rel. branch works in real mode */
432 433
433 STD_EXCEPTION_PSERIES(0x400, instruction_access) 434 STD_EXCEPTION_PSERIES(0x400, instruction_access)
@@ -436,19 +437,19 @@ data_access_slb_pSeries:
436 .globl instruction_access_slb_pSeries 437 .globl instruction_access_slb_pSeries
437instruction_access_slb_pSeries: 438instruction_access_slb_pSeries:
438 HMT_MEDIUM 439 HMT_MEDIUM
439 mtspr SPRG1,r13 440 mtspr SPRN_SPRG1,r13
440 RUNLATCH_ON(r13) 441 RUNLATCH_ON(r13)
441 mfspr r13,SPRG3 /* get paca address into r13 */ 442 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */
442 std r9,PACA_EXSLB+EX_R9(r13) /* save r9 - r12 */ 443 std r9,PACA_EXSLB+EX_R9(r13) /* save r9 - r12 */
443 std r10,PACA_EXSLB+EX_R10(r13) 444 std r10,PACA_EXSLB+EX_R10(r13)
444 std r11,PACA_EXSLB+EX_R11(r13) 445 std r11,PACA_EXSLB+EX_R11(r13)
445 std r12,PACA_EXSLB+EX_R12(r13) 446 std r12,PACA_EXSLB+EX_R12(r13)
446 std r3,PACA_EXSLB+EX_R3(r13) 447 std r3,PACA_EXSLB+EX_R3(r13)
447 mfspr r9,SPRG1 448 mfspr r9,SPRN_SPRG1
448 std r9,PACA_EXSLB+EX_R13(r13) 449 std r9,PACA_EXSLB+EX_R13(r13)
449 mfcr r9 450 mfcr r9
450 mfspr r12,SRR1 /* and SRR1 */ 451 mfspr r12,SPRN_SRR1 /* and SRR1 */
451 mfspr r3,SRR0 /* SRR0 is faulting address */ 452 mfspr r3,SPRN_SRR0 /* SRR0 is faulting address */
452 b .do_slb_miss /* Rel. branch works in real mode */ 453 b .do_slb_miss /* Rel. branch works in real mode */
453 454
454 STD_EXCEPTION_PSERIES(0x500, hardware_interrupt) 455 STD_EXCEPTION_PSERIES(0x500, hardware_interrupt)
@@ -466,15 +467,15 @@ system_call_pSeries:
466 RUNLATCH_ON(r9) 467 RUNLATCH_ON(r9)
467 mr r9,r13 468 mr r9,r13
468 mfmsr r10 469 mfmsr r10
469 mfspr r13,SPRG3 470 mfspr r13,SPRN_SPRG3
470 mfspr r11,SRR0 471 mfspr r11,SPRN_SRR0
471 clrrdi r12,r13,32 472 clrrdi r12,r13,32
472 oris r12,r12,system_call_common@h 473 oris r12,r12,system_call_common@h
473 ori r12,r12,system_call_common@l 474 ori r12,r12,system_call_common@l
474 mtspr SRR0,r12 475 mtspr SPRN_SRR0,r12
475 ori r10,r10,MSR_IR|MSR_DR|MSR_RI 476 ori r10,r10,MSR_IR|MSR_DR|MSR_RI
476 mfspr r12,SRR1 477 mfspr r12,SPRN_SRR1
477 mtspr SRR1,r10 478 mtspr SPRN_SRR1,r10
478 rfid 479 rfid
479 b . /* prevent speculative execution */ 480 b . /* prevent speculative execution */
480 481
@@ -504,25 +505,25 @@ system_call_pSeries:
504 .align 7 505 .align 7
505_GLOBAL(do_stab_bolted_pSeries) 506_GLOBAL(do_stab_bolted_pSeries)
506 mtcrf 0x80,r12 507 mtcrf 0x80,r12
507 mfspr r12,SPRG2 508 mfspr r12,SPRN_SPRG2
508 EXCEPTION_PROLOG_PSERIES(PACA_EXSLB, .do_stab_bolted) 509 EXCEPTION_PROLOG_PSERIES(PACA_EXSLB, .do_stab_bolted)
509 510
510/* 511/*
511 * Vectors for the FWNMI option. Share common code. 512 * Vectors for the FWNMI option. Share common code.
512 */ 513 */
513 .globl system_reset_fwnmi 514 .globl system_reset_fwnmi
514system_reset_fwnmi: 515system_reset_fwnmi:
515 HMT_MEDIUM 516 HMT_MEDIUM
516 mtspr SPRG1,r13 /* save r13 */ 517 mtspr SPRN_SPRG1,r13 /* save r13 */
517 RUNLATCH_ON(r13) 518 RUNLATCH_ON(r13)
518 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common) 519 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common)
519 520
520 .globl machine_check_fwnmi 521 .globl machine_check_fwnmi
521machine_check_fwnmi: 522machine_check_fwnmi:
522 HMT_MEDIUM 523 HMT_MEDIUM
523 mtspr SPRG1,r13 /* save r13 */ 524 mtspr SPRN_SPRG1,r13 /* save r13 */
524 RUNLATCH_ON(r13) 525 RUNLATCH_ON(r13)
525 EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common) 526 EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common)
526 527
527#ifdef CONFIG_PPC_ISERIES 528#ifdef CONFIG_PPC_ISERIES
528/*** ISeries-LPAR interrupt handlers ***/ 529/*** ISeries-LPAR interrupt handlers ***/
@@ -531,18 +532,18 @@ machine_check_fwnmi:
531 532
532 .globl data_access_iSeries 533 .globl data_access_iSeries
533data_access_iSeries: 534data_access_iSeries:
534 mtspr SPRG1,r13 535 mtspr SPRN_SPRG1,r13
535BEGIN_FTR_SECTION 536BEGIN_FTR_SECTION
536 mtspr SPRG2,r12 537 mtspr SPRN_SPRG2,r12
537 mfspr r13,DAR 538 mfspr r13,SPRN_DAR
538 mfspr r12,DSISR 539 mfspr r12,SPRN_DSISR
539 srdi r13,r13,60 540 srdi r13,r13,60
540 rlwimi r13,r12,16,0x20 541 rlwimi r13,r12,16,0x20
541 mfcr r12 542 mfcr r12
542 cmpwi r13,0x2c 543 cmpwi r13,0x2c
543 beq .do_stab_bolted_iSeries 544 beq .do_stab_bolted_iSeries
544 mtcrf 0x80,r12 545 mtcrf 0x80,r12
545 mfspr r12,SPRG2 546 mfspr r12,SPRN_SPRG2
546END_FTR_SECTION_IFCLR(CPU_FTR_SLB) 547END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
547 EXCEPTION_PROLOG_ISERIES_1(PACA_EXGEN) 548 EXCEPTION_PROLOG_ISERIES_1(PACA_EXGEN)
548 EXCEPTION_PROLOG_ISERIES_2 549 EXCEPTION_PROLOG_ISERIES_2
@@ -550,25 +551,25 @@ END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
550 551
551.do_stab_bolted_iSeries: 552.do_stab_bolted_iSeries:
552 mtcrf 0x80,r12 553 mtcrf 0x80,r12
553 mfspr r12,SPRG2 554 mfspr r12,SPRN_SPRG2
554 EXCEPTION_PROLOG_ISERIES_1(PACA_EXSLB) 555 EXCEPTION_PROLOG_ISERIES_1(PACA_EXSLB)
555 EXCEPTION_PROLOG_ISERIES_2 556 EXCEPTION_PROLOG_ISERIES_2
556 b .do_stab_bolted 557 b .do_stab_bolted
557 558
558 .globl data_access_slb_iSeries 559 .globl data_access_slb_iSeries
559data_access_slb_iSeries: 560data_access_slb_iSeries:
560 mtspr SPRG1,r13 /* save r13 */ 561 mtspr SPRN_SPRG1,r13 /* save r13 */
561 EXCEPTION_PROLOG_ISERIES_1(PACA_EXSLB) 562 EXCEPTION_PROLOG_ISERIES_1(PACA_EXSLB)
562 std r3,PACA_EXSLB+EX_R3(r13) 563 std r3,PACA_EXSLB+EX_R3(r13)
563 ld r12,PACALPPACA+LPPACASRR1(r13) 564 ld r12,PACALPPACA+LPPACASRR1(r13)
564 mfspr r3,DAR 565 mfspr r3,SPRN_DAR
565 b .do_slb_miss 566 b .do_slb_miss
566 567
567 STD_EXCEPTION_ISERIES(0x400, instruction_access, PACA_EXGEN) 568 STD_EXCEPTION_ISERIES(0x400, instruction_access, PACA_EXGEN)
568 569
569 .globl instruction_access_slb_iSeries 570 .globl instruction_access_slb_iSeries
570instruction_access_slb_iSeries: 571instruction_access_slb_iSeries:
571 mtspr SPRG1,r13 /* save r13 */ 572 mtspr SPRN_SPRG1,r13 /* save r13 */
572 EXCEPTION_PROLOG_ISERIES_1(PACA_EXSLB) 573 EXCEPTION_PROLOG_ISERIES_1(PACA_EXSLB)
573 std r3,PACA_EXSLB+EX_R3(r13) 574 std r3,PACA_EXSLB+EX_R3(r13)
574 ld r12,PACALPPACA+LPPACASRR1(r13) 575 ld r12,PACALPPACA+LPPACASRR1(r13)
@@ -586,7 +587,7 @@ instruction_access_slb_iSeries:
586 .globl system_call_iSeries 587 .globl system_call_iSeries
587system_call_iSeries: 588system_call_iSeries:
588 mr r9,r13 589 mr r9,r13
589 mfspr r13,SPRG3 590 mfspr r13,SPRN_SPRG3
590 EXCEPTION_PROLOG_ISERIES_2 591 EXCEPTION_PROLOG_ISERIES_2
591 b system_call_common 592 b system_call_common
592 593
@@ -596,7 +597,7 @@ system_call_iSeries:
596 597
597 .globl system_reset_iSeries 598 .globl system_reset_iSeries
598system_reset_iSeries: 599system_reset_iSeries:
599 mfspr r13,SPRG3 /* Get paca address */ 600 mfspr r13,SPRN_SPRG3 /* Get paca address */
600 mfmsr r24 601 mfmsr r24
601 ori r24,r24,MSR_RI 602 ori r24,r24,MSR_RI
602 mtmsrd r24 /* RI on */ 603 mtmsrd r24 /* RI on */
@@ -639,7 +640,7 @@ iSeries_secondary_smp_loop:
639#endif /* CONFIG_SMP */ 640#endif /* CONFIG_SMP */
640 li r0,-1 /* r0=-1 indicates a Hypervisor call */ 641 li r0,-1 /* r0=-1 indicates a Hypervisor call */
641 sc /* Invoke the hypervisor via a system call */ 642 sc /* Invoke the hypervisor via a system call */
642 mfspr r13,SPRG3 /* Put r13 back ???? */ 643 mfspr r13,SPRN_SPRG3 /* Put r13 back ???? */
643 b 1b /* If SMP not configured, secondaries 644 b 1b /* If SMP not configured, secondaries
644 * loop forever */ 645 * loop forever */
645 646
@@ -656,8 +657,8 @@ hardware_interrupt_iSeries_masked:
656 mtcrf 0x80,r9 /* Restore regs */ 657 mtcrf 0x80,r9 /* Restore regs */
657 ld r11,PACALPPACA+LPPACASRR0(r13) 658 ld r11,PACALPPACA+LPPACASRR0(r13)
658 ld r12,PACALPPACA+LPPACASRR1(r13) 659 ld r12,PACALPPACA+LPPACASRR1(r13)
659 mtspr SRR0,r11 660 mtspr SPRN_SRR0,r11
660 mtspr SRR1,r12 661 mtspr SPRN_SRR1,r12
661 ld r9,PACA_EXGEN+EX_R9(r13) 662 ld r9,PACA_EXGEN+EX_R9(r13)
662 ld r10,PACA_EXGEN+EX_R10(r13) 663 ld r10,PACA_EXGEN+EX_R10(r13)
663 ld r11,PACA_EXGEN+EX_R11(r13) 664 ld r11,PACA_EXGEN+EX_R11(r13)
@@ -713,8 +714,8 @@ bad_stack:
713 std r10,GPR1(r1) 714 std r10,GPR1(r1)
714 std r11,_NIP(r1) 715 std r11,_NIP(r1)
715 std r12,_MSR(r1) 716 std r12,_MSR(r1)
716 mfspr r11,DAR 717 mfspr r11,SPRN_DAR
717 mfspr r12,DSISR 718 mfspr r12,SPRN_DSISR
718 std r11,_DAR(r1) 719 std r11,_DAR(r1)
719 std r12,_DSISR(r1) 720 std r12,_DSISR(r1)
720 mflr r10 721 mflr r10
@@ -746,6 +747,7 @@ bad_stack:
746 * any task or sent any task a signal, you should use 747 * any task or sent any task a signal, you should use
747 * ret_from_except or ret_from_except_lite instead of this. 748 * ret_from_except or ret_from_except_lite instead of this.
748 */ 749 */
750 .globl fast_exception_return
749fast_exception_return: 751fast_exception_return:
750 ld r12,_MSR(r1) 752 ld r12,_MSR(r1)
751 ld r11,_NIP(r1) 753 ld r11,_NIP(r1)
@@ -766,8 +768,8 @@ fast_exception_return:
766 clrrdi r10,r10,2 /* clear RI (LE is 0 already) */ 768 clrrdi r10,r10,2 /* clear RI (LE is 0 already) */
767 mtmsrd r10,1 769 mtmsrd r10,1
768 770
769 mtspr SRR1,r12 771 mtspr SPRN_SRR1,r12
770 mtspr SRR0,r11 772 mtspr SPRN_SRR0,r11
771 REST_4GPRS(10, r1) 773 REST_4GPRS(10, r1)
772 ld r1,GPR1(r1) 774 ld r1,GPR1(r1)
773 rfid 775 rfid
@@ -788,9 +790,9 @@ unrecov_fer:
788 .globl data_access_common 790 .globl data_access_common
789data_access_common: 791data_access_common:
790 RUNLATCH_ON(r10) /* It wont fit in the 0x300 handler */ 792 RUNLATCH_ON(r10) /* It wont fit in the 0x300 handler */
791 mfspr r10,DAR 793 mfspr r10,SPRN_DAR
792 std r10,PACA_EXGEN+EX_DAR(r13) 794 std r10,PACA_EXGEN+EX_DAR(r13)
793 mfspr r10,DSISR 795 mfspr r10,SPRN_DSISR
794 stw r10,PACA_EXGEN+EX_DSISR(r13) 796 stw r10,PACA_EXGEN+EX_DSISR(r13)
795 EXCEPTION_PROLOG_COMMON(0x300, PACA_EXGEN) 797 EXCEPTION_PROLOG_COMMON(0x300, PACA_EXGEN)
796 ld r3,PACA_EXGEN+EX_DAR(r13) 798 ld r3,PACA_EXGEN+EX_DAR(r13)
@@ -821,9 +823,9 @@ hardware_interrupt_entry:
821 .align 7 823 .align 7
822 .globl alignment_common 824 .globl alignment_common
823alignment_common: 825alignment_common:
824 mfspr r10,DAR 826 mfspr r10,SPRN_DAR
825 std r10,PACA_EXGEN+EX_DAR(r13) 827 std r10,PACA_EXGEN+EX_DAR(r13)
826 mfspr r10,DSISR 828 mfspr r10,SPRN_DSISR
827 stw r10,PACA_EXGEN+EX_DSISR(r13) 829 stw r10,PACA_EXGEN+EX_DSISR(r13)
828 EXCEPTION_PROLOG_COMMON(0x600, PACA_EXGEN) 830 EXCEPTION_PROLOG_COMMON(0x600, PACA_EXGEN)
829 ld r3,PACA_EXGEN+EX_DAR(r13) 831 ld r3,PACA_EXGEN+EX_DAR(r13)
@@ -857,62 +859,6 @@ fp_unavailable_common:
857 bl .kernel_fp_unavailable_exception 859 bl .kernel_fp_unavailable_exception
858 BUG_OPCODE 860 BUG_OPCODE
859 861
860/*
861 * load_up_fpu(unused, unused, tsk)
862 * Disable FP for the task which had the FPU previously,
863 * and save its floating-point registers in its thread_struct.
864 * Enables the FPU for use in the kernel on return.
865 * On SMP we know the fpu is free, since we give it up every
866 * switch (ie, no lazy save of the FP registers).
867 * On entry: r13 == 'current' && last_task_used_math != 'current'
868 */
869_STATIC(load_up_fpu)
870 mfmsr r5 /* grab the current MSR */
871 ori r5,r5,MSR_FP
872 mtmsrd r5 /* enable use of fpu now */
873 isync
874/*
875 * For SMP, we don't do lazy FPU switching because it just gets too
876 * horrendously complex, especially when a task switches from one CPU
877 * to another. Instead we call giveup_fpu in switch_to.
878 *
879 */
880#ifndef CONFIG_SMP
881 ld r3,last_task_used_math@got(r2)
882 ld r4,0(r3)
883 cmpdi 0,r4,0
884 beq 1f
885 /* Save FP state to last_task_used_math's THREAD struct */
886 addi r4,r4,THREAD
887 SAVE_32FPRS(0, r4)
888 mffs fr0
889 stfd fr0,THREAD_FPSCR(r4)
890 /* Disable FP for last_task_used_math */
891 ld r5,PT_REGS(r4)
892 ld r4,_MSR-STACK_FRAME_OVERHEAD(r5)
893 li r6,MSR_FP|MSR_FE0|MSR_FE1
894 andc r4,r4,r6
895 std r4,_MSR-STACK_FRAME_OVERHEAD(r5)
8961:
897#endif /* CONFIG_SMP */
898 /* enable use of FP after return */
899 ld r4,PACACURRENT(r13)
900 addi r5,r4,THREAD /* Get THREAD */
901 ld r4,THREAD_FPEXC_MODE(r5)
902 ori r12,r12,MSR_FP
903 or r12,r12,r4
904 std r12,_MSR(r1)
905 lfd fr0,THREAD_FPSCR(r5)
906 mtfsf 0xff,fr0
907 REST_32FPRS(0, r5)
908#ifndef CONFIG_SMP
909 /* Update last_task_used_math to 'current' */
910 subi r4,r5,THREAD /* Back to 'current' */
911 std r4,0(r3)
912#endif /* CONFIG_SMP */
913 /* restore registers and return */
914 b fast_exception_return
915
916 .align 7 862 .align 7
917 .globl altivec_unavailable_common 863 .globl altivec_unavailable_common
918altivec_unavailable_common: 864altivec_unavailable_common:
@@ -1120,7 +1066,7 @@ _GLOBAL(do_stab_bolted)
1120 1066
1121 /* Hash to the primary group */ 1067 /* Hash to the primary group */
1122 ld r10,PACASTABVIRT(r13) 1068 ld r10,PACASTABVIRT(r13)
1123 mfspr r11,DAR 1069 mfspr r11,SPRN_DAR
1124 srdi r11,r11,28 1070 srdi r11,r11,28
1125 rldimi r10,r11,7,52 /* r10 = first ste of the group */ 1071 rldimi r10,r11,7,52 /* r10 = first ste of the group */
1126 1072
@@ -1162,7 +1108,7 @@ _GLOBAL(do_stab_bolted)
11622: std r9,8(r10) /* Store the vsid part of the ste */ 11082: std r9,8(r10) /* Store the vsid part of the ste */
1163 eieio 1109 eieio
1164 1110
1165 mfspr r11,DAR /* Get the new esid */ 1111 mfspr r11,SPRN_DAR /* Get the new esid */
1166 clrrdi r11,r11,28 /* Permits a full 32b of ESID */ 1112 clrrdi r11,r11,28 /* Permits a full 32b of ESID */
1167 ori r11,r11,0x90 /* Turn on valid and kp */ 1113 ori r11,r11,0x90 /* Turn on valid and kp */
1168 std r11,0(r10) /* Put new entry back into the stab */ 1114 std r11,0(r10) /* Put new entry back into the stab */
@@ -1182,8 +1128,8 @@ _GLOBAL(do_stab_bolted)
1182 clrrdi r10,r10,2 1128 clrrdi r10,r10,2
1183 mtmsrd r10,1 1129 mtmsrd r10,1
1184 1130
1185 mtspr SRR0,r11 1131 mtspr SPRN_SRR0,r11
1186 mtspr SRR1,r12 1132 mtspr SPRN_SRR1,r12
1187 ld r9,PACA_EXSLB+EX_R9(r13) 1133 ld r9,PACA_EXSLB+EX_R9(r13)
1188 ld r10,PACA_EXSLB+EX_R10(r13) 1134 ld r10,PACA_EXSLB+EX_R10(r13)
1189 ld r11,PACA_EXSLB+EX_R11(r13) 1135 ld r11,PACA_EXSLB+EX_R11(r13)
@@ -1229,8 +1175,8 @@ _GLOBAL(do_slb_miss)
1229.machine pop 1175.machine pop
1230 1176
1231#ifdef CONFIG_PPC_ISERIES 1177#ifdef CONFIG_PPC_ISERIES
1232 mtspr SRR0,r11 1178 mtspr SPRN_SRR0,r11
1233 mtspr SRR1,r12 1179 mtspr SPRN_SRR1,r12
1234#endif /* CONFIG_PPC_ISERIES */ 1180#endif /* CONFIG_PPC_ISERIES */
1235 ld r9,PACA_EXSLB+EX_R9(r13) 1181 ld r9,PACA_EXSLB+EX_R9(r13)
1236 ld r10,PACA_EXSLB+EX_R10(r13) 1182 ld r10,PACA_EXSLB+EX_R10(r13)
@@ -1253,7 +1199,7 @@ unrecov_slb:
1253 * 1199 *
1254 * On iSeries, the hypervisor must fill in at least one entry before 1200 * On iSeries, the hypervisor must fill in at least one entry before
1255 * we get control (with relocate on). The address is give to the hv 1201 * we get control (with relocate on). The address is give to the hv
1256 * as a page number (see xLparMap in LparData.c), so this must be at a 1202 * as a page number (see xLparMap in lpardata.c), so this must be at a
1257 * fixed address (the linker can't compute (u64)&initial_stab >> 1203 * fixed address (the linker can't compute (u64)&initial_stab >>
1258 * PAGE_SHIFT). 1204 * PAGE_SHIFT).
1259 */ 1205 */
@@ -1316,7 +1262,7 @@ _GLOBAL(pSeries_secondary_smp_init)
1316 mr r3,r24 /* not found, copy phys to r3 */ 1262 mr r3,r24 /* not found, copy phys to r3 */
1317 b .kexec_wait /* next kernel might do better */ 1263 b .kexec_wait /* next kernel might do better */
1318 1264
13192: mtspr SPRG3,r13 /* Save vaddr of paca in SPRG3 */ 12652: mtspr SPRN_SPRG3,r13 /* Save vaddr of paca in SPRG3 */
1320 /* From now on, r24 is expected to be logical cpuid */ 1266 /* From now on, r24 is expected to be logical cpuid */
1321 mr r24,r5 1267 mr r24,r5
13223: HMT_LOW 12683: HMT_LOW
@@ -1364,6 +1310,7 @@ _STATIC(__start_initialization_iSeries)
1364 addi r2,r2,0x4000 1310 addi r2,r2,0x4000
1365 1311
1366 bl .iSeries_early_setup 1312 bl .iSeries_early_setup
1313 bl .early_setup
1367 1314
1368 /* relocation is on at this point */ 1315 /* relocation is on at this point */
1369 1316
@@ -1554,20 +1501,17 @@ copy_to_here:
1554 .section ".text"; 1501 .section ".text";
1555 .align 2 ; 1502 .align 2 ;
1556 1503
1557 .globl pmac_secondary_start_1 1504 .globl __secondary_start_pmac_0
1558pmac_secondary_start_1: 1505__secondary_start_pmac_0:
1559 li r24, 1 1506 /* NB the entries for cpus 0, 1, 2 must each occupy 8 bytes. */
1560 b .pmac_secondary_start 1507 li r24,0
1561 1508 b 1f
1562 .globl pmac_secondary_start_2 1509 li r24,1
1563pmac_secondary_start_2: 1510 b 1f
1564 li r24, 2 1511 li r24,2
1565 b .pmac_secondary_start 1512 b 1f
1566 1513 li r24,3
1567 .globl pmac_secondary_start_3 15141:
1568pmac_secondary_start_3:
1569 li r24, 3
1570 b .pmac_secondary_start
1571 1515
1572_GLOBAL(pmac_secondary_start) 1516_GLOBAL(pmac_secondary_start)
1573 /* turn on 64-bit mode */ 1517 /* turn on 64-bit mode */
@@ -1586,7 +1530,7 @@ _GLOBAL(pmac_secondary_start)
1586 LOADADDR(r4, paca) /* Get base vaddr of paca array */ 1530 LOADADDR(r4, paca) /* Get base vaddr of paca array */
1587 mulli r13,r24,PACA_SIZE /* Calculate vaddr of right paca */ 1531 mulli r13,r24,PACA_SIZE /* Calculate vaddr of right paca */
1588 add r13,r13,r4 /* for this processor. */ 1532 add r13,r13,r4 /* for this processor. */
1589 mtspr SPRG3,r13 /* Save vaddr of paca in SPRG3 */ 1533 mtspr SPRN_SPRG3,r13 /* Save vaddr of paca in SPRG3 */
1590 1534
1591 /* Create a temp kernel stack for use before relocation is on. */ 1535 /* Create a temp kernel stack for use before relocation is on. */
1592 ld r1,PACAEMERGSP(r13) 1536 ld r1,PACAEMERGSP(r13)
@@ -1621,7 +1565,7 @@ _GLOBAL(__secondary_start)
1621 /* Initialize the page table pointer register. */ 1565 /* Initialize the page table pointer register. */
1622 LOADADDR(r6,_SDR1) 1566 LOADADDR(r6,_SDR1)
1623 ld r6,0(r6) /* get the value of _SDR1 */ 1567 ld r6,0(r6) /* get the value of _SDR1 */
1624 mtspr SDR1,r6 /* set the htab location */ 1568 mtspr SPRN_SDR1,r6 /* set the htab location */
1625#endif 1569#endif
1626 /* Initialize the first segment table (or SLB) entry */ 1570 /* Initialize the first segment table (or SLB) entry */
1627 ld r3,PACASTABVIRT(r13) /* get addr of segment table */ 1571 ld r3,PACASTABVIRT(r13) /* get addr of segment table */
@@ -1650,7 +1594,7 @@ _GLOBAL(__secondary_start)
1650 lwz r3,PLATFORM(r3) /* r3 = platform flags */ 1594 lwz r3,PLATFORM(r3) /* r3 = platform flags */
1651 andi. r3,r3,PLATFORM_LPAR /* Test if bit 0 is set (LPAR bit) */ 1595 andi. r3,r3,PLATFORM_LPAR /* Test if bit 0 is set (LPAR bit) */
1652 beq 98f /* branch if result is 0 */ 1596 beq 98f /* branch if result is 0 */
1653 mfspr r3,PVR 1597 mfspr r3,SPRN_PVR
1654 srwi r3,r3,16 1598 srwi r3,r3,16
1655 cmpwi r3,0x37 /* SStar */ 1599 cmpwi r3,0x37 /* SStar */
1656 beq 97f 1600 beq 97f
@@ -1674,8 +1618,8 @@ _GLOBAL(__secondary_start)
1674#ifdef DO_SOFT_DISABLE 1618#ifdef DO_SOFT_DISABLE
1675 ori r4,r4,MSR_EE 1619 ori r4,r4,MSR_EE
1676#endif 1620#endif
1677 mtspr SRR0,r3 1621 mtspr SPRN_SRR0,r3
1678 mtspr SRR1,r4 1622 mtspr SPRN_SRR1,r4
1679 rfid 1623 rfid
1680 b . /* prevent speculative execution */ 1624 b . /* prevent speculative execution */
1681 1625
@@ -1737,7 +1681,7 @@ _STATIC(start_here_multiplatform)
1737 1681
1738#ifdef CONFIG_HMT 1682#ifdef CONFIG_HMT
1739 /* Start up the second thread on cpu 0 */ 1683 /* Start up the second thread on cpu 0 */
1740 mfspr r3,PVR 1684 mfspr r3,SPRN_PVR
1741 srwi r3,r3,16 1685 srwi r3,r3,16
1742 cmpwi r3,0x34 /* Pulsar */ 1686 cmpwi r3,0x34 /* Pulsar */
1743 beq 90f 1687 beq 90f
@@ -1797,7 +1741,7 @@ _STATIC(start_here_multiplatform)
1797 mulli r13,r27,PACA_SIZE /* Calculate vaddr of right paca */ 1741 mulli r13,r27,PACA_SIZE /* Calculate vaddr of right paca */
1798 add r13,r13,r24 /* for this processor. */ 1742 add r13,r13,r24 /* for this processor. */
1799 sub r13,r13,r26 /* convert to physical addr */ 1743 sub r13,r13,r26 /* convert to physical addr */
1800 mtspr SPRG3,r13 /* PPPBBB: Temp... -Peter */ 1744 mtspr SPRN_SPRG3,r13 /* PPPBBB: Temp... -Peter */
1801 1745
1802 /* Do very early kernel initializations, including initial hash table, 1746 /* Do very early kernel initializations, including initial hash table,
1803 * stab and slb setup before we turn on relocation. */ 1747 * stab and slb setup before we turn on relocation. */
@@ -1814,7 +1758,7 @@ _STATIC(start_here_multiplatform)
1814 lwz r3,PLATFORM(r3) /* r3 = platform flags */ 1758 lwz r3,PLATFORM(r3) /* r3 = platform flags */
1815 andi. r3,r3,PLATFORM_LPAR /* Test if bit 0 is set (LPAR bit) */ 1759 andi. r3,r3,PLATFORM_LPAR /* Test if bit 0 is set (LPAR bit) */
1816 beq 98f /* branch if result is 0 */ 1760 beq 98f /* branch if result is 0 */
1817 mfspr r3,PVR 1761 mfspr r3,SPRN_PVR
1818 srwi r3,r3,16 1762 srwi r3,r3,16
1819 cmpwi r3,0x37 /* SStar */ 1763 cmpwi r3,0x37 /* SStar */
1820 beq 97f 1764 beq 97f
@@ -1838,12 +1782,12 @@ _STATIC(start_here_multiplatform)
1838 LOADADDR(r6,_SDR1) /* Only if NOT LPAR */ 1782 LOADADDR(r6,_SDR1) /* Only if NOT LPAR */
1839 sub r6,r6,r26 1783 sub r6,r6,r26
1840 ld r6,0(r6) /* get the value of _SDR1 */ 1784 ld r6,0(r6) /* get the value of _SDR1 */
1841 mtspr SDR1,r6 /* set the htab location */ 1785 mtspr SPRN_SDR1,r6 /* set the htab location */
184298: 178698:
1843 LOADADDR(r3,.start_here_common) 1787 LOADADDR(r3,.start_here_common)
1844 SET_REG_TO_CONST(r4, MSR_KERNEL) 1788 SET_REG_TO_CONST(r4, MSR_KERNEL)
1845 mtspr SRR0,r3 1789 mtspr SPRN_SRR0,r3
1846 mtspr SRR1,r4 1790 mtspr SPRN_SRR1,r4
1847 rfid 1791 rfid
1848 b . /* prevent speculative execution */ 1792 b . /* prevent speculative execution */
1849#endif /* CONFIG_PPC_MULTIPLATFORM */ 1793#endif /* CONFIG_PPC_MULTIPLATFORM */
@@ -1874,7 +1818,7 @@ _STATIC(start_here_common)
1874 LOADADDR(r24, paca) /* Get base vaddr of paca array */ 1818 LOADADDR(r24, paca) /* Get base vaddr of paca array */
1875 mulli r13,r26,PACA_SIZE /* Calculate vaddr of right paca */ 1819 mulli r13,r26,PACA_SIZE /* Calculate vaddr of right paca */
1876 add r13,r13,r24 /* for this processor. */ 1820 add r13,r13,r24 /* for this processor. */
1877 mtspr SPRG3,r13 1821 mtspr SPRN_SPRG3,r13
1878 1822
1879 /* ptr to current */ 1823 /* ptr to current */
1880 LOADADDR(r4,init_task) 1824 LOADADDR(r4,init_task)
@@ -1901,7 +1845,7 @@ _STATIC(start_here_common)
1901_GLOBAL(hmt_init) 1845_GLOBAL(hmt_init)
1902#ifdef CONFIG_HMT 1846#ifdef CONFIG_HMT
1903 LOADADDR(r5, hmt_thread_data) 1847 LOADADDR(r5, hmt_thread_data)
1904 mfspr r7,PVR 1848 mfspr r7,SPRN_PVR
1905 srwi r7,r7,16 1849 srwi r7,r7,16
1906 cmpwi r7,0x34 /* Pulsar */ 1850 cmpwi r7,0x34 /* Pulsar */
1907 beq 90f 1851 beq 90f
@@ -1910,10 +1854,10 @@ _GLOBAL(hmt_init)
1910 cmpwi r7,0x37 /* SStar */ 1854 cmpwi r7,0x37 /* SStar */
1911 beq 91f 1855 beq 91f
1912 b 101f 1856 b 101f
191390: mfspr r6,PIR 185790: mfspr r6,SPRN_PIR
1914 andi. r6,r6,0x1f 1858 andi. r6,r6,0x1f
1915 b 92f 1859 b 92f
191691: mfspr r6,PIR 186091: mfspr r6,SPRN_PIR
1917 andi. r6,r6,0x3ff 1861 andi. r6,r6,0x3ff
191892: sldi r4,r24,3 186292: sldi r4,r24,3
1919 stwx r6,r5,r4 1863 stwx r6,r5,r4
@@ -1924,8 +1868,8 @@ __hmt_secondary_hold:
1924 LOADADDR(r5, hmt_thread_data) 1868 LOADADDR(r5, hmt_thread_data)
1925 clrldi r5,r5,4 1869 clrldi r5,r5,4
1926 li r7,0 1870 li r7,0
1927 mfspr r6,PIR 1871 mfspr r6,SPRN_PIR
1928 mfspr r8,PVR 1872 mfspr r8,SPRN_PVR
1929 srwi r8,r8,16 1873 srwi r8,r8,16
1930 cmpwi r8,0x34 1874 cmpwi r8,0x34
1931 bne 93f 1875 bne 93f
@@ -1951,39 +1895,41 @@ __hmt_secondary_hold:
1951_GLOBAL(hmt_start_secondary) 1895_GLOBAL(hmt_start_secondary)
1952 LOADADDR(r4,__hmt_secondary_hold) 1896 LOADADDR(r4,__hmt_secondary_hold)
1953 clrldi r4,r4,4 1897 clrldi r4,r4,4
1954 mtspr NIADORM, r4 1898 mtspr SPRN_NIADORM, r4
1955 mfspr r4, MSRDORM 1899 mfspr r4, SPRN_MSRDORM
1956 li r5, -65 1900 li r5, -65
1957 and r4, r4, r5 1901 and r4, r4, r5
1958 mtspr MSRDORM, r4 1902 mtspr SPRN_MSRDORM, r4
1959 lis r4,0xffef 1903 lis r4,0xffef
1960 ori r4,r4,0x7403 1904 ori r4,r4,0x7403
1961 mtspr TSC, r4 1905 mtspr SPRN_TSC, r4
1962 li r4,0x1f4 1906 li r4,0x1f4
1963 mtspr TST, r4 1907 mtspr SPRN_TST, r4
1964 mfspr r4, HID0 1908 mfspr r4, SPRN_HID0
1965 ori r4, r4, 0x1 1909 ori r4, r4, 0x1
1966 mtspr HID0, r4 1910 mtspr SPRN_HID0, r4
1967 mfspr r4, SPRN_CTRLF 1911 mfspr r4, SPRN_CTRLF
1968 oris r4, r4, 0x40 1912 oris r4, r4, 0x40
1969 mtspr SPRN_CTRLT, r4 1913 mtspr SPRN_CTRLT, r4
1970 blr 1914 blr
1971#endif 1915#endif
1972 1916
1973#if defined(CONFIG_KEXEC) || (defined(CONFIG_SMP) && !defined(CONFIG_PPC_ISERIES)) 1917#if defined(CONFIG_KEXEC) || defined(CONFIG_SMP)
1974_GLOBAL(smp_release_cpus) 1918_GLOBAL(smp_release_cpus)
1975 /* All secondary cpus are spinning on a common 1919 /* All secondary cpus are spinning on a common
1976 * spinloop, release them all now so they can start 1920 * spinloop, release them all now so they can start
1977 * to spin on their individual paca spinloops. 1921 * to spin on their individual paca spinloops.
1978 * For non SMP kernels, the secondary cpus never 1922 * For non SMP kernels, the secondary cpus never
1979 * get out of the common spinloop. 1923 * get out of the common spinloop.
1924 * XXX This does nothing useful on iSeries, secondaries are
1925 * already waiting on their paca.
1980 */ 1926 */
1981 li r3,1 1927 li r3,1
1982 LOADADDR(r5,__secondary_hold_spinloop) 1928 LOADADDR(r5,__secondary_hold_spinloop)
1983 std r3,0(r5) 1929 std r3,0(r5)
1984 sync 1930 sync
1985 blr 1931 blr
1986#endif /* CONFIG_SMP && !CONFIG_PPC_ISERIES */ 1932#endif /* CONFIG_SMP */
1987 1933
1988 1934
1989/* 1935/*
@@ -1992,7 +1938,7 @@ _GLOBAL(smp_release_cpus)
1992 */ 1938 */
1993 .section ".bss" 1939 .section ".bss"
1994 1940
1995 .align 12 1941 .align PAGE_SHIFT
1996 1942
1997 .globl empty_zero_page 1943 .globl empty_zero_page
1998empty_zero_page: 1944empty_zero_page:
diff --git a/arch/ppc64/kernel/hvcserver.c b/arch/ppc64/kernel/hvcserver.c
index bde8f42da854..4d584172055a 100644
--- a/arch/ppc64/kernel/hvcserver.c
+++ b/arch/ppc64/kernel/hvcserver.c
@@ -22,6 +22,8 @@
22#include <linux/kernel.h> 22#include <linux/kernel.h>
23#include <linux/list.h> 23#include <linux/list.h>
24#include <linux/module.h> 24#include <linux/module.h>
25#include <linux/slab.h>
26
25#include <asm/hvcall.h> 27#include <asm/hvcall.h>
26#include <asm/hvcserver.h> 28#include <asm/hvcserver.h>
27#include <asm/io.h> 29#include <asm/io.h>
diff --git a/arch/ppc64/kernel/i8259.c b/arch/ppc64/kernel/i8259.c
deleted file mode 100644
index 74dcfd68fc75..000000000000
--- a/arch/ppc64/kernel/i8259.c
+++ /dev/null
@@ -1,177 +0,0 @@
1/*
2 * c 2001 PPC64 Team, 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 <linux/stddef.h>
10#include <linux/init.h>
11#include <linux/sched.h>
12#include <linux/signal.h>
13#include <linux/cache.h>
14#include <linux/irq.h>
15#include <linux/interrupt.h>
16#include <asm/io.h>
17#include <asm/ppcdebug.h>
18#include "i8259.h"
19
20unsigned char cached_8259[2] = { 0xff, 0xff };
21#define cached_A1 (cached_8259[0])
22#define cached_21 (cached_8259[1])
23
24static __cacheline_aligned_in_smp DEFINE_SPINLOCK(i8259_lock);
25
26static int i8259_pic_irq_offset;
27static int i8259_present;
28
29int i8259_irq(int cpu)
30{
31 int irq;
32
33 spin_lock/*_irqsave*/(&i8259_lock/*, flags*/);
34 /*
35 * Perform an interrupt acknowledge cycle on controller 1
36 */
37 outb(0x0C, 0x20);
38 irq = inb(0x20) & 7;
39 if (irq == 2)
40 {
41 /*
42 * Interrupt is cascaded so perform interrupt
43 * acknowledge on controller 2
44 */
45 outb(0x0C, 0xA0);
46 irq = (inb(0xA0) & 7) + 8;
47 }
48 else if (irq==7)
49 {
50 /*
51 * This may be a spurious interrupt
52 *
53 * Read the interrupt status register. If the most
54 * significant bit is not set then there is no valid
55 * interrupt
56 */
57 outb(0x0b, 0x20);
58 if(~inb(0x20)&0x80) {
59 spin_unlock/*_irqrestore*/(&i8259_lock/*, flags*/);
60 return -1;
61 }
62 }
63 spin_unlock/*_irqrestore*/(&i8259_lock/*, flags*/);
64 return irq;
65}
66
67static void i8259_mask_and_ack_irq(unsigned int irq_nr)
68{
69 unsigned long flags;
70
71 spin_lock_irqsave(&i8259_lock, flags);
72 if ( irq_nr >= i8259_pic_irq_offset )
73 irq_nr -= i8259_pic_irq_offset;
74
75 if (irq_nr > 7) {
76 cached_A1 |= 1 << (irq_nr-8);
77 inb(0xA1); /* DUMMY */
78 outb(cached_A1,0xA1);
79 outb(0x20,0xA0); /* Non-specific EOI */
80 outb(0x20,0x20); /* Non-specific EOI to cascade */
81 } else {
82 cached_21 |= 1 << irq_nr;
83 inb(0x21); /* DUMMY */
84 outb(cached_21,0x21);
85 outb(0x20,0x20); /* Non-specific EOI */
86 }
87 spin_unlock_irqrestore(&i8259_lock, flags);
88}
89
90static void i8259_set_irq_mask(int irq_nr)
91{
92 outb(cached_A1,0xA1);
93 outb(cached_21,0x21);
94}
95
96static void i8259_mask_irq(unsigned int irq_nr)
97{
98 unsigned long flags;
99
100 spin_lock_irqsave(&i8259_lock, flags);
101 if ( irq_nr >= i8259_pic_irq_offset )
102 irq_nr -= i8259_pic_irq_offset;
103 if ( irq_nr < 8 )
104 cached_21 |= 1 << irq_nr;
105 else
106 cached_A1 |= 1 << (irq_nr-8);
107 i8259_set_irq_mask(irq_nr);
108 spin_unlock_irqrestore(&i8259_lock, flags);
109}
110
111static void i8259_unmask_irq(unsigned int irq_nr)
112{
113 unsigned long flags;
114
115 spin_lock_irqsave(&i8259_lock, flags);
116 if ( irq_nr >= i8259_pic_irq_offset )
117 irq_nr -= i8259_pic_irq_offset;
118 if ( irq_nr < 8 )
119 cached_21 &= ~(1 << irq_nr);
120 else
121 cached_A1 &= ~(1 << (irq_nr-8));
122 i8259_set_irq_mask(irq_nr);
123 spin_unlock_irqrestore(&i8259_lock, flags);
124}
125
126static void i8259_end_irq(unsigned int irq)
127{
128 if (!(get_irq_desc(irq)->status & (IRQ_DISABLED|IRQ_INPROGRESS)) &&
129 get_irq_desc(irq)->action)
130 i8259_unmask_irq(irq);
131}
132
133struct hw_interrupt_type i8259_pic = {
134 .typename = " i8259 ",
135 .enable = i8259_unmask_irq,
136 .disable = i8259_mask_irq,
137 .ack = i8259_mask_and_ack_irq,
138 .end = i8259_end_irq,
139};
140
141void __init i8259_init(int offset)
142{
143 unsigned long flags;
144
145 spin_lock_irqsave(&i8259_lock, flags);
146 i8259_pic_irq_offset = offset;
147 i8259_present = 1;
148 /* init master interrupt controller */
149 outb(0x11, 0x20); /* Start init sequence */
150 outb(0x00, 0x21); /* Vector base */
151 outb(0x04, 0x21); /* edge tiggered, Cascade (slave) on IRQ2 */
152 outb(0x01, 0x21); /* Select 8086 mode */
153 outb(0xFF, 0x21); /* Mask all */
154 /* init slave interrupt controller */
155 outb(0x11, 0xA0); /* Start init sequence */
156 outb(0x08, 0xA1); /* Vector base */
157 outb(0x02, 0xA1); /* edge triggered, Cascade (slave) on IRQ2 */
158 outb(0x01, 0xA1); /* Select 8086 mode */
159 outb(0xFF, 0xA1); /* Mask all */
160 outb(cached_A1, 0xA1);
161 outb(cached_21, 0x21);
162 spin_unlock_irqrestore(&i8259_lock, flags);
163
164}
165
166static int i8259_request_cascade(void)
167{
168 if (!i8259_present)
169 return -ENODEV;
170
171 request_irq( i8259_pic_irq_offset + 2, no_action, SA_INTERRUPT,
172 "82c59 secondary cascade", NULL );
173
174 return 0;
175}
176
177arch_initcall(i8259_request_cascade);
diff --git a/arch/ppc64/kernel/i8259.h b/arch/ppc64/kernel/i8259.h
deleted file mode 100644
index f74764ba0bfa..000000000000
--- a/arch/ppc64/kernel/i8259.h
+++ /dev/null
@@ -1,17 +0,0 @@
1/*
2 * c 2001 PPC 64 Team, 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#ifndef _PPC_KERNEL_i8259_H
10#define _PPC_KERNEL_i8259_H
11
12extern struct hw_interrupt_type i8259_pic;
13
14extern void i8259_init(int offset);
15extern int i8259_irq(int);
16
17#endif /* _PPC_KERNEL_i8259_H */
diff --git a/arch/ppc64/kernel/idle.c b/arch/ppc64/kernel/idle.c
index 954395d42636..8abd2ad92832 100644
--- a/arch/ppc64/kernel/idle.c
+++ b/arch/ppc64/kernel/idle.c
@@ -31,7 +31,7 @@
31 31
32extern void power4_idle(void); 32extern void power4_idle(void);
33 33
34int default_idle(void) 34void default_idle(void)
35{ 35{
36 long oldval; 36 long oldval;
37 unsigned int cpu = smp_processor_id(); 37 unsigned int cpu = smp_processor_id();
@@ -64,11 +64,9 @@ int default_idle(void)
64 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING) 64 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING)
65 cpu_die(); 65 cpu_die();
66 } 66 }
67
68 return 0;
69} 67}
70 68
71int native_idle(void) 69void native_idle(void)
72{ 70{
73 while (1) { 71 while (1) {
74 ppc64_runlatch_off(); 72 ppc64_runlatch_off();
@@ -85,8 +83,6 @@ int native_idle(void)
85 system_state == SYSTEM_RUNNING) 83 system_state == SYSTEM_RUNNING)
86 cpu_die(); 84 cpu_die();
87 } 85 }
88
89 return 0;
90} 86}
91 87
92void cpu_idle(void) 88void cpu_idle(void)
diff --git a/arch/ppc64/kernel/ioctl32.c b/arch/ppc64/kernel/ioctl32.c
index a8005db23ec5..ba4a899045c2 100644
--- a/arch/ppc64/kernel/ioctl32.c
+++ b/arch/ppc64/kernel/ioctl32.c
@@ -39,9 +39,7 @@ IOCTL_TABLE_START
39#include <linux/compat_ioctl.h> 39#include <linux/compat_ioctl.h>
40#define DECLARES 40#define DECLARES
41#include "compat_ioctl.c" 41#include "compat_ioctl.c"
42COMPATIBLE_IOCTL(TIOCSTART) 42
43COMPATIBLE_IOCTL(TIOCSTOP)
44COMPATIBLE_IOCTL(TIOCSLTC)
45/* Little p (/dev/rtc, /dev/envctrl, etc.) */ 43/* Little p (/dev/rtc, /dev/envctrl, etc.) */
46COMPATIBLE_IOCTL(_IOR('p', 20, int[7])) /* RTCGET */ 44COMPATIBLE_IOCTL(_IOR('p', 20, int[7])) /* RTCGET */
47COMPATIBLE_IOCTL(_IOW('p', 21, int[7])) /* RTCSET */ 45COMPATIBLE_IOCTL(_IOW('p', 21, int[7])) /* RTCSET */
diff --git a/arch/ppc64/kernel/kprobes.c b/arch/ppc64/kernel/kprobes.c
index 9c6facc24f70..ed876a5178ae 100644
--- a/arch/ppc64/kernel/kprobes.c
+++ b/arch/ppc64/kernel/kprobes.c
@@ -395,7 +395,6 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
395 if (post_kprobe_handler(args->regs)) 395 if (post_kprobe_handler(args->regs))
396 ret = NOTIFY_STOP; 396 ret = NOTIFY_STOP;
397 break; 397 break;
398 case DIE_GPF:
399 case DIE_PAGE_FAULT: 398 case DIE_PAGE_FAULT:
400 if (kprobe_running() && 399 if (kprobe_running() &&
401 kprobe_fault_handler(args->regs, args->trapnr)) 400 kprobe_fault_handler(args->regs, args->trapnr))
diff --git a/arch/ppc64/kernel/misc.S b/arch/ppc64/kernel/misc.S
index e7241ad80a08..077507ffbab8 100644
--- a/arch/ppc64/kernel/misc.S
+++ b/arch/ppc64/kernel/misc.S
@@ -28,6 +28,7 @@
28#include <asm/ppc_asm.h> 28#include <asm/ppc_asm.h>
29#include <asm/asm-offsets.h> 29#include <asm/asm-offsets.h>
30#include <asm/cputable.h> 30#include <asm/cputable.h>
31#include <asm/thread_info.h>
31 32
32 .text 33 .text
33 34
@@ -64,44 +65,6 @@ _GLOBAL(get_srr1)
64_GLOBAL(get_sp) 65_GLOBAL(get_sp)
65 mr r3,r1 66 mr r3,r1
66 blr 67 blr
67
68#ifdef CONFIG_PPC_ISERIES
69/* unsigned long local_save_flags(void) */
70_GLOBAL(local_get_flags)
71 lbz r3,PACAPROCENABLED(r13)
72 blr
73
74/* unsigned long local_irq_disable(void) */
75_GLOBAL(local_irq_disable)
76 lbz r3,PACAPROCENABLED(r13)
77 li r4,0
78 stb r4,PACAPROCENABLED(r13)
79 blr /* Done */
80
81/* void local_irq_restore(unsigned long flags) */
82_GLOBAL(local_irq_restore)
83 lbz r5,PACAPROCENABLED(r13)
84 /* Check if things are setup the way we want _already_. */
85 cmpw 0,r3,r5
86 beqlr
87 /* are we enabling interrupts? */
88 cmpdi 0,r3,0
89 stb r3,PACAPROCENABLED(r13)
90 beqlr
91 /* Check pending interrupts */
92 /* A decrementer, IPI or PMC interrupt may have occurred
93 * while we were in the hypervisor (which enables) */
94 ld r4,PACALPPACA+LPPACAANYINT(r13)
95 cmpdi r4,0
96 beqlr
97
98 /*
99 * Handle pending interrupts in interrupt context
100 */
101 li r0,0x5555
102 sc
103 blr
104#endif /* CONFIG_PPC_ISERIES */
105 68
106#ifdef CONFIG_IRQSTACKS 69#ifdef CONFIG_IRQSTACKS
107_GLOBAL(call_do_softirq) 70_GLOBAL(call_do_softirq)
@@ -329,7 +292,7 @@ _GLOBAL(__flush_dcache_icache)
329 292
330/* Flush the dcache */ 293/* Flush the dcache */
331 ld r7,PPC64_CACHES@toc(r2) 294 ld r7,PPC64_CACHES@toc(r2)
332 clrrdi r3,r3,12 /* Page align */ 295 clrrdi r3,r3,PAGE_SHIFT /* Page align */
333 lwz r4,DCACHEL1LINESPERPAGE(r7) /* Get # dcache lines per page */ 296 lwz r4,DCACHEL1LINESPERPAGE(r7) /* Get # dcache lines per page */
334 lwz r5,DCACHEL1LINESIZE(r7) /* Get dcache line size */ 297 lwz r5,DCACHEL1LINESIZE(r7) /* Get dcache line size */
335 mr r6,r3 298 mr r6,r3
@@ -488,25 +451,6 @@ _GLOBAL(_outsl_ns)
488 sync 451 sync
489 blr 452 blr
490 453
491
492_GLOBAL(cvt_fd)
493 lfd 0,0(r5) /* load up fpscr value */
494 mtfsf 0xff,0
495 lfs 0,0(r3)
496 stfd 0,0(r4)
497 mffs 0 /* save new fpscr value */
498 stfd 0,0(r5)
499 blr
500
501_GLOBAL(cvt_df)
502 lfd 0,0(r5) /* load up fpscr value */
503 mtfsf 0xff,0
504 lfd 0,0(r3)
505 stfs 0,0(r4)
506 mffs 0 /* save new fpscr value */
507 stfd 0,0(r5)
508 blr
509
510/* 454/*
511 * identify_cpu and calls setup_cpu 455 * identify_cpu and calls setup_cpu
512 * In: r3 = base of the cpu_specs array 456 * In: r3 = base of the cpu_specs array
@@ -692,38 +636,6 @@ _GLOBAL(disable_kernel_fp)
692 isync 636 isync
693 blr 637 blr
694 638
695/*
696 * giveup_fpu(tsk)
697 * Disable FP for the task given as the argument,
698 * and save the floating-point registers in its thread_struct.
699 * Enables the FPU for use in the kernel on return.
700 */
701_GLOBAL(giveup_fpu)
702 mfmsr r5
703 ori r5,r5,MSR_FP
704 mtmsrd r5 /* enable use of fpu now */
705 isync
706 cmpdi 0,r3,0
707 beqlr- /* if no previous owner, done */
708 addi r3,r3,THREAD /* want THREAD of task */
709 ld r5,PT_REGS(r3)
710 cmpdi 0,r5,0
711 SAVE_32FPRS(0, r3)
712 mffs fr0
713 stfd fr0,THREAD_FPSCR(r3)
714 beq 1f
715 ld r4,_MSR-STACK_FRAME_OVERHEAD(r5)
716 li r3,MSR_FP|MSR_FE0|MSR_FE1
717 andc r4,r4,r3 /* disable FP for previous task */
718 std r4,_MSR-STACK_FRAME_OVERHEAD(r5)
7191:
720#ifndef CONFIG_SMP
721 li r5,0
722 ld r4,last_task_used_math@got(r2)
723 std r5,0(r4)
724#endif /* CONFIG_SMP */
725 blr
726
727#ifdef CONFIG_ALTIVEC 639#ifdef CONFIG_ALTIVEC
728 640
729#if 0 /* this has no callers for now */ 641#if 0 /* this has no callers for now */
@@ -778,6 +690,13 @@ _GLOBAL(giveup_altivec)
778_GLOBAL(__setup_cpu_power3) 690_GLOBAL(__setup_cpu_power3)
779 blr 691 blr
780 692
693_GLOBAL(execve)
694 li r0,__NR_execve
695 sc
696 bnslr
697 neg r3,r3
698 blr
699
781/* kexec_wait(phys_cpu) 700/* kexec_wait(phys_cpu)
782 * 701 *
783 * wait for the flag to change, indicating this kernel is going away but 702 * wait for the flag to change, indicating this kernel is going away but
@@ -948,566 +867,3 @@ _GLOBAL(kexec_sequence)
948 li r5,0 867 li r5,0
949 blr /* image->start(physid, image->start, 0); */ 868 blr /* image->start(physid, image->start, 0); */
950#endif /* CONFIG_KEXEC */ 869#endif /* CONFIG_KEXEC */
951
952/* Why isn't this a) automatic, b) written in 'C'? */
953 .balign 8
954_GLOBAL(sys_call_table32)
955 .llong .sys_restart_syscall /* 0 */
956 .llong .sys_exit
957 .llong .ppc_fork
958 .llong .sys_read
959 .llong .sys_write
960 .llong .compat_sys_open /* 5 */
961 .llong .sys_close
962 .llong .sys32_waitpid
963 .llong .sys32_creat
964 .llong .sys_link
965 .llong .sys_unlink /* 10 */
966 .llong .sys32_execve
967 .llong .sys_chdir
968 .llong .compat_sys_time
969 .llong .sys_mknod
970 .llong .sys_chmod /* 15 */
971 .llong .sys_lchown
972 .llong .sys_ni_syscall /* old break syscall */
973 .llong .sys_ni_syscall /* old stat syscall */
974 .llong .ppc32_lseek
975 .llong .sys_getpid /* 20 */
976 .llong .compat_sys_mount
977 .llong .sys_oldumount
978 .llong .sys_setuid
979 .llong .sys_getuid
980 .llong .compat_sys_stime /* 25 */
981 .llong .sys32_ptrace
982 .llong .sys_alarm
983 .llong .sys_ni_syscall /* old fstat syscall */
984 .llong .sys32_pause
985 .llong .compat_sys_utime /* 30 */
986 .llong .sys_ni_syscall /* old stty syscall */
987 .llong .sys_ni_syscall /* old gtty syscall */
988 .llong .sys32_access
989 .llong .sys32_nice
990 .llong .sys_ni_syscall /* 35 - old ftime syscall */
991 .llong .sys_sync
992 .llong .sys32_kill
993 .llong .sys_rename
994 .llong .sys32_mkdir
995 .llong .sys_rmdir /* 40 */
996 .llong .sys_dup
997 .llong .sys_pipe
998 .llong .compat_sys_times
999 .llong .sys_ni_syscall /* old prof syscall */
1000 .llong .sys_brk /* 45 */
1001 .llong .sys_setgid
1002 .llong .sys_getgid
1003 .llong .sys_signal
1004 .llong .sys_geteuid
1005 .llong .sys_getegid /* 50 */
1006 .llong .sys_acct
1007 .llong .sys_umount
1008 .llong .sys_ni_syscall /* old lock syscall */
1009 .llong .compat_sys_ioctl
1010 .llong .compat_sys_fcntl /* 55 */
1011 .llong .sys_ni_syscall /* old mpx syscall */
1012 .llong .sys32_setpgid
1013 .llong .sys_ni_syscall /* old ulimit syscall */
1014 .llong .sys32_olduname
1015 .llong .sys32_umask /* 60 */
1016 .llong .sys_chroot
1017 .llong .sys_ustat
1018 .llong .sys_dup2
1019 .llong .sys_getppid
1020 .llong .sys_getpgrp /* 65 */
1021 .llong .sys_setsid
1022 .llong .sys32_sigaction
1023 .llong .sys_sgetmask
1024 .llong .sys32_ssetmask
1025 .llong .sys_setreuid /* 70 */
1026 .llong .sys_setregid
1027 .llong .ppc32_sigsuspend
1028 .llong .compat_sys_sigpending
1029 .llong .sys32_sethostname
1030 .llong .compat_sys_setrlimit /* 75 */
1031 .llong .compat_sys_old_getrlimit
1032 .llong .compat_sys_getrusage
1033 .llong .sys32_gettimeofday
1034 .llong .sys32_settimeofday
1035 .llong .sys32_getgroups /* 80 */
1036 .llong .sys32_setgroups
1037 .llong .sys_ni_syscall /* old select syscall */
1038 .llong .sys_symlink
1039 .llong .sys_ni_syscall /* old lstat syscall */
1040 .llong .sys32_readlink /* 85 */
1041 .llong .sys_uselib
1042 .llong .sys_swapon
1043 .llong .sys_reboot
1044 .llong .old32_readdir
1045 .llong .sys_mmap /* 90 */
1046 .llong .sys_munmap
1047 .llong .sys_truncate
1048 .llong .sys_ftruncate
1049 .llong .sys_fchmod
1050 .llong .sys_fchown /* 95 */
1051 .llong .sys32_getpriority
1052 .llong .sys32_setpriority
1053 .llong .sys_ni_syscall /* old profil syscall */
1054 .llong .compat_sys_statfs
1055 .llong .compat_sys_fstatfs /* 100 */
1056 .llong .sys_ni_syscall /* old ioperm syscall */
1057 .llong .compat_sys_socketcall
1058 .llong .sys32_syslog
1059 .llong .compat_sys_setitimer
1060 .llong .compat_sys_getitimer /* 105 */
1061 .llong .compat_sys_newstat
1062 .llong .compat_sys_newlstat
1063 .llong .compat_sys_newfstat
1064 .llong .sys32_uname
1065 .llong .sys_ni_syscall /* 110 old iopl syscall */
1066 .llong .sys_vhangup
1067 .llong .sys_ni_syscall /* old idle syscall */
1068 .llong .sys_ni_syscall /* old vm86 syscall */
1069 .llong .compat_sys_wait4
1070 .llong .sys_swapoff /* 115 */
1071 .llong .sys32_sysinfo
1072 .llong .sys32_ipc
1073 .llong .sys_fsync
1074 .llong .ppc32_sigreturn
1075 .llong .ppc_clone /* 120 */
1076 .llong .sys32_setdomainname
1077 .llong .ppc64_newuname
1078 .llong .sys_ni_syscall /* old modify_ldt syscall */
1079 .llong .sys32_adjtimex
1080 .llong .sys_mprotect /* 125 */
1081 .llong .compat_sys_sigprocmask
1082 .llong .sys_ni_syscall /* old create_module syscall */
1083 .llong .sys_init_module
1084 .llong .sys_delete_module
1085 .llong .sys_ni_syscall /* 130 old get_kernel_syms syscall */
1086 .llong .sys_quotactl
1087 .llong .sys32_getpgid
1088 .llong .sys_fchdir
1089 .llong .sys_bdflush
1090 .llong .sys32_sysfs /* 135 */
1091 .llong .ppc64_personality
1092 .llong .sys_ni_syscall /* for afs_syscall */
1093 .llong .sys_setfsuid
1094 .llong .sys_setfsgid
1095 .llong .sys_llseek /* 140 */
1096 .llong .sys32_getdents
1097 .llong .ppc32_select
1098 .llong .sys_flock
1099 .llong .sys_msync
1100 .llong .compat_sys_readv /* 145 */
1101 .llong .compat_sys_writev
1102 .llong .sys32_getsid
1103 .llong .sys_fdatasync
1104 .llong .sys32_sysctl
1105 .llong .sys_mlock /* 150 */
1106 .llong .sys_munlock
1107 .llong .sys_mlockall
1108 .llong .sys_munlockall
1109 .llong .sys32_sched_setparam
1110 .llong .sys32_sched_getparam /* 155 */
1111 .llong .sys32_sched_setscheduler
1112 .llong .sys32_sched_getscheduler
1113 .llong .sys_sched_yield
1114 .llong .sys32_sched_get_priority_max
1115 .llong .sys32_sched_get_priority_min /* 160 */
1116 .llong .sys32_sched_rr_get_interval
1117 .llong .compat_sys_nanosleep
1118 .llong .sys_mremap
1119 .llong .sys_setresuid
1120 .llong .sys_getresuid /* 165 */
1121 .llong .sys_ni_syscall /* old query_module syscall */
1122 .llong .sys_poll
1123 .llong .compat_sys_nfsservctl
1124 .llong .sys_setresgid
1125 .llong .sys_getresgid /* 170 */
1126 .llong .sys32_prctl
1127 .llong .ppc32_rt_sigreturn
1128 .llong .sys32_rt_sigaction
1129 .llong .sys32_rt_sigprocmask
1130 .llong .sys32_rt_sigpending /* 175 */
1131 .llong .compat_sys_rt_sigtimedwait
1132 .llong .sys32_rt_sigqueueinfo
1133 .llong .ppc32_rt_sigsuspend
1134 .llong .sys32_pread64
1135 .llong .sys32_pwrite64 /* 180 */
1136 .llong .sys_chown
1137 .llong .sys_getcwd
1138 .llong .sys_capget
1139 .llong .sys_capset
1140 .llong .sys32_sigaltstack /* 185 */
1141 .llong .sys32_sendfile
1142 .llong .sys_ni_syscall /* reserved for streams1 */
1143 .llong .sys_ni_syscall /* reserved for streams2 */
1144 .llong .ppc_vfork
1145 .llong .compat_sys_getrlimit /* 190 */
1146 .llong .sys32_readahead
1147 .llong .sys32_mmap2
1148 .llong .sys32_truncate64
1149 .llong .sys32_ftruncate64
1150 .llong .sys_stat64 /* 195 */
1151 .llong .sys_lstat64
1152 .llong .sys_fstat64
1153 .llong .sys32_pciconfig_read
1154 .llong .sys32_pciconfig_write
1155 .llong .sys32_pciconfig_iobase /* 200 - pciconfig_iobase */
1156 .llong .sys_ni_syscall /* reserved for MacOnLinux */
1157 .llong .sys_getdents64
1158 .llong .sys_pivot_root
1159 .llong .compat_sys_fcntl64
1160 .llong .sys_madvise /* 205 */
1161 .llong .sys_mincore
1162 .llong .sys_gettid
1163 .llong .sys_tkill
1164 .llong .sys_setxattr
1165 .llong .sys_lsetxattr /* 210 */
1166 .llong .sys_fsetxattr
1167 .llong .sys_getxattr
1168 .llong .sys_lgetxattr
1169 .llong .sys_fgetxattr
1170 .llong .sys_listxattr /* 215 */
1171 .llong .sys_llistxattr
1172 .llong .sys_flistxattr
1173 .llong .sys_removexattr
1174 .llong .sys_lremovexattr
1175 .llong .sys_fremovexattr /* 220 */
1176 .llong .compat_sys_futex
1177 .llong .compat_sys_sched_setaffinity
1178 .llong .compat_sys_sched_getaffinity
1179 .llong .sys_ni_syscall
1180 .llong .sys_ni_syscall /* 225 - reserved for tux */
1181 .llong .sys32_sendfile64
1182 .llong .compat_sys_io_setup
1183 .llong .sys_io_destroy
1184 .llong .compat_sys_io_getevents
1185 .llong .compat_sys_io_submit
1186 .llong .sys_io_cancel
1187 .llong .sys_set_tid_address
1188 .llong .ppc32_fadvise64
1189 .llong .sys_exit_group
1190 .llong .ppc32_lookup_dcookie /* 235 */
1191 .llong .sys_epoll_create
1192 .llong .sys_epoll_ctl
1193 .llong .sys_epoll_wait
1194 .llong .sys_remap_file_pages
1195 .llong .ppc32_timer_create /* 240 */
1196 .llong .compat_sys_timer_settime
1197 .llong .compat_sys_timer_gettime
1198 .llong .sys_timer_getoverrun
1199 .llong .sys_timer_delete
1200 .llong .compat_sys_clock_settime /* 245 */
1201 .llong .compat_sys_clock_gettime
1202 .llong .compat_sys_clock_getres
1203 .llong .compat_sys_clock_nanosleep
1204 .llong .ppc32_swapcontext
1205 .llong .sys32_tgkill /* 250 */
1206 .llong .sys32_utimes
1207 .llong .compat_sys_statfs64
1208 .llong .compat_sys_fstatfs64
1209 .llong .ppc32_fadvise64_64 /* 32bit only fadvise64_64 */
1210 .llong .ppc_rtas /* 255 */
1211 .llong .sys_ni_syscall /* 256 reserved for sys_debug_setcontext */
1212 .llong .sys_ni_syscall /* 257 reserved for vserver */
1213 .llong .sys_ni_syscall /* 258 reserved for new sys_remap_file_pages */
1214 .llong .compat_sys_mbind
1215 .llong .compat_sys_get_mempolicy /* 260 */
1216 .llong .compat_sys_set_mempolicy
1217 .llong .compat_sys_mq_open
1218 .llong .sys_mq_unlink
1219 .llong .compat_sys_mq_timedsend
1220 .llong .compat_sys_mq_timedreceive /* 265 */
1221 .llong .compat_sys_mq_notify
1222 .llong .compat_sys_mq_getsetattr
1223 .llong .compat_sys_kexec_load
1224 .llong .sys32_add_key
1225 .llong .sys32_request_key /* 270 */
1226 .llong .compat_sys_keyctl
1227 .llong .compat_sys_waitid
1228 .llong .sys32_ioprio_set
1229 .llong .sys32_ioprio_get
1230 .llong .sys_inotify_init /* 275 */
1231 .llong .sys_inotify_add_watch
1232 .llong .sys_inotify_rm_watch
1233
1234 .balign 8
1235_GLOBAL(sys_call_table)
1236 .llong .sys_restart_syscall /* 0 */
1237 .llong .sys_exit
1238 .llong .ppc_fork
1239 .llong .sys_read
1240 .llong .sys_write
1241 .llong .sys_open /* 5 */
1242 .llong .sys_close
1243 .llong .sys_waitpid
1244 .llong .sys_creat
1245 .llong .sys_link
1246 .llong .sys_unlink /* 10 */
1247 .llong .sys_execve
1248 .llong .sys_chdir
1249 .llong .sys64_time
1250 .llong .sys_mknod
1251 .llong .sys_chmod /* 15 */
1252 .llong .sys_lchown
1253 .llong .sys_ni_syscall /* old break syscall */
1254 .llong .sys_ni_syscall /* old stat syscall */
1255 .llong .sys_lseek
1256 .llong .sys_getpid /* 20 */
1257 .llong .sys_mount
1258 .llong .sys_ni_syscall /* old umount syscall */
1259 .llong .sys_setuid
1260 .llong .sys_getuid
1261 .llong .sys_stime /* 25 */
1262 .llong .sys_ptrace
1263 .llong .sys_alarm
1264 .llong .sys_ni_syscall /* old fstat syscall */
1265 .llong .sys_pause
1266 .llong .sys_utime /* 30 */
1267 .llong .sys_ni_syscall /* old stty syscall */
1268 .llong .sys_ni_syscall /* old gtty syscall */
1269 .llong .sys_access
1270 .llong .sys_nice
1271 .llong .sys_ni_syscall /* 35 - old ftime syscall */
1272 .llong .sys_sync
1273 .llong .sys_kill
1274 .llong .sys_rename
1275 .llong .sys_mkdir
1276 .llong .sys_rmdir /* 40 */
1277 .llong .sys_dup
1278 .llong .sys_pipe
1279 .llong .sys_times
1280 .llong .sys_ni_syscall /* old prof syscall */
1281 .llong .sys_brk /* 45 */
1282 .llong .sys_setgid
1283 .llong .sys_getgid
1284 .llong .sys_signal
1285 .llong .sys_geteuid
1286 .llong .sys_getegid /* 50 */
1287 .llong .sys_acct
1288 .llong .sys_umount
1289 .llong .sys_ni_syscall /* old lock syscall */
1290 .llong .sys_ioctl
1291 .llong .sys_fcntl /* 55 */
1292 .llong .sys_ni_syscall /* old mpx syscall */
1293 .llong .sys_setpgid
1294 .llong .sys_ni_syscall /* old ulimit syscall */
1295 .llong .sys_ni_syscall /* old uname syscall */
1296 .llong .sys_umask /* 60 */
1297 .llong .sys_chroot
1298 .llong .sys_ustat
1299 .llong .sys_dup2
1300 .llong .sys_getppid
1301 .llong .sys_getpgrp /* 65 */
1302 .llong .sys_setsid
1303 .llong .sys_ni_syscall
1304 .llong .sys_sgetmask
1305 .llong .sys_ssetmask
1306 .llong .sys_setreuid /* 70 */
1307 .llong .sys_setregid
1308 .llong .sys_ni_syscall
1309 .llong .sys_ni_syscall
1310 .llong .sys_sethostname
1311 .llong .sys_setrlimit /* 75 */
1312 .llong .sys_ni_syscall /* old getrlimit syscall */
1313 .llong .sys_getrusage
1314 .llong .sys_gettimeofday
1315 .llong .sys_settimeofday
1316 .llong .sys_getgroups /* 80 */
1317 .llong .sys_setgroups
1318 .llong .sys_ni_syscall /* old select syscall */
1319 .llong .sys_symlink
1320 .llong .sys_ni_syscall /* old lstat syscall */
1321 .llong .sys_readlink /* 85 */
1322 .llong .sys_uselib
1323 .llong .sys_swapon
1324 .llong .sys_reboot
1325 .llong .sys_ni_syscall /* old readdir syscall */
1326 .llong .sys_mmap /* 90 */
1327 .llong .sys_munmap
1328 .llong .sys_truncate
1329 .llong .sys_ftruncate
1330 .llong .sys_fchmod
1331 .llong .sys_fchown /* 95 */
1332 .llong .sys_getpriority
1333 .llong .sys_setpriority
1334 .llong .sys_ni_syscall /* old profil syscall holder */
1335 .llong .sys_statfs
1336 .llong .sys_fstatfs /* 100 */
1337 .llong .sys_ni_syscall /* old ioperm syscall */
1338 .llong .sys_socketcall
1339 .llong .sys_syslog
1340 .llong .sys_setitimer
1341 .llong .sys_getitimer /* 105 */
1342 .llong .sys_newstat
1343 .llong .sys_newlstat
1344 .llong .sys_newfstat
1345 .llong .sys_ni_syscall /* old uname syscall */
1346 .llong .sys_ni_syscall /* 110 old iopl syscall */
1347 .llong .sys_vhangup
1348 .llong .sys_ni_syscall /* old idle syscall */
1349 .llong .sys_ni_syscall /* old vm86 syscall */
1350 .llong .sys_wait4
1351 .llong .sys_swapoff /* 115 */
1352 .llong .sys_sysinfo
1353 .llong .sys_ipc
1354 .llong .sys_fsync
1355 .llong .sys_ni_syscall
1356 .llong .ppc_clone /* 120 */
1357 .llong .sys_setdomainname
1358 .llong .ppc64_newuname
1359 .llong .sys_ni_syscall /* old modify_ldt syscall */
1360 .llong .sys_adjtimex
1361 .llong .sys_mprotect /* 125 */
1362 .llong .sys_ni_syscall
1363 .llong .sys_ni_syscall /* old create_module syscall */
1364 .llong .sys_init_module
1365 .llong .sys_delete_module
1366 .llong .sys_ni_syscall /* 130 old get_kernel_syms syscall */
1367 .llong .sys_quotactl
1368 .llong .sys_getpgid
1369 .llong .sys_fchdir
1370 .llong .sys_bdflush
1371 .llong .sys_sysfs /* 135 */
1372 .llong .ppc64_personality
1373 .llong .sys_ni_syscall /* for afs_syscall */
1374 .llong .sys_setfsuid
1375 .llong .sys_setfsgid
1376 .llong .sys_llseek /* 140 */
1377 .llong .sys_getdents
1378 .llong .sys_select
1379 .llong .sys_flock
1380 .llong .sys_msync
1381 .llong .sys_readv /* 145 */
1382 .llong .sys_writev
1383 .llong .sys_getsid
1384 .llong .sys_fdatasync
1385 .llong .sys_sysctl
1386 .llong .sys_mlock /* 150 */
1387 .llong .sys_munlock
1388 .llong .sys_mlockall
1389 .llong .sys_munlockall
1390 .llong .sys_sched_setparam
1391 .llong .sys_sched_getparam /* 155 */
1392 .llong .sys_sched_setscheduler
1393 .llong .sys_sched_getscheduler
1394 .llong .sys_sched_yield
1395 .llong .sys_sched_get_priority_max
1396 .llong .sys_sched_get_priority_min /* 160 */
1397 .llong .sys_sched_rr_get_interval
1398 .llong .sys_nanosleep
1399 .llong .sys_mremap
1400 .llong .sys_setresuid
1401 .llong .sys_getresuid /* 165 */
1402 .llong .sys_ni_syscall /* old query_module syscall */
1403 .llong .sys_poll
1404 .llong .sys_nfsservctl
1405 .llong .sys_setresgid
1406 .llong .sys_getresgid /* 170 */
1407 .llong .sys_prctl
1408 .llong .ppc64_rt_sigreturn
1409 .llong .sys_rt_sigaction
1410 .llong .sys_rt_sigprocmask
1411 .llong .sys_rt_sigpending /* 175 */
1412 .llong .sys_rt_sigtimedwait
1413 .llong .sys_rt_sigqueueinfo
1414 .llong .ppc64_rt_sigsuspend
1415 .llong .sys_pread64
1416 .llong .sys_pwrite64 /* 180 */
1417 .llong .sys_chown
1418 .llong .sys_getcwd
1419 .llong .sys_capget
1420 .llong .sys_capset
1421 .llong .sys_sigaltstack /* 185 */
1422 .llong .sys_sendfile64
1423 .llong .sys_ni_syscall /* reserved for streams1 */
1424 .llong .sys_ni_syscall /* reserved for streams2 */
1425 .llong .ppc_vfork
1426 .llong .sys_getrlimit /* 190 */
1427 .llong .sys_readahead
1428 .llong .sys_ni_syscall /* 32bit only mmap2 */
1429 .llong .sys_ni_syscall /* 32bit only truncate64 */
1430 .llong .sys_ni_syscall /* 32bit only ftruncate64 */
1431 .llong .sys_ni_syscall /* 195 - 32bit only stat64 */
1432 .llong .sys_ni_syscall /* 32bit only lstat64 */
1433 .llong .sys_ni_syscall /* 32bit only fstat64 */
1434 .llong .sys_pciconfig_read
1435 .llong .sys_pciconfig_write
1436 .llong .sys_pciconfig_iobase /* 200 - pciconfig_iobase */
1437 .llong .sys_ni_syscall /* reserved for MacOnLinux */
1438 .llong .sys_getdents64
1439 .llong .sys_pivot_root
1440 .llong .sys_ni_syscall /* 32bit only fcntl64 */
1441 .llong .sys_madvise /* 205 */
1442 .llong .sys_mincore
1443 .llong .sys_gettid
1444 .llong .sys_tkill
1445 .llong .sys_setxattr
1446 .llong .sys_lsetxattr /* 210 */
1447 .llong .sys_fsetxattr
1448 .llong .sys_getxattr
1449 .llong .sys_lgetxattr
1450 .llong .sys_fgetxattr
1451 .llong .sys_listxattr /* 215 */
1452 .llong .sys_llistxattr
1453 .llong .sys_flistxattr
1454 .llong .sys_removexattr
1455 .llong .sys_lremovexattr
1456 .llong .sys_fremovexattr /* 220 */
1457 .llong .sys_futex
1458 .llong .sys_sched_setaffinity
1459 .llong .sys_sched_getaffinity
1460 .llong .sys_ni_syscall
1461 .llong .sys_ni_syscall /* 225 - reserved for tux */
1462 .llong .sys_ni_syscall /* 32bit only sendfile64 */
1463 .llong .sys_io_setup
1464 .llong .sys_io_destroy
1465 .llong .sys_io_getevents
1466 .llong .sys_io_submit /* 230 */
1467 .llong .sys_io_cancel
1468 .llong .sys_set_tid_address
1469 .llong .sys_fadvise64
1470 .llong .sys_exit_group
1471 .llong .sys_lookup_dcookie /* 235 */
1472 .llong .sys_epoll_create
1473 .llong .sys_epoll_ctl
1474 .llong .sys_epoll_wait
1475 .llong .sys_remap_file_pages
1476 .llong .sys_timer_create /* 240 */
1477 .llong .sys_timer_settime
1478 .llong .sys_timer_gettime
1479 .llong .sys_timer_getoverrun
1480 .llong .sys_timer_delete
1481 .llong .sys_clock_settime /* 245 */
1482 .llong .sys_clock_gettime
1483 .llong .sys_clock_getres
1484 .llong .sys_clock_nanosleep
1485 .llong .ppc64_swapcontext
1486 .llong .sys_tgkill /* 250 */
1487 .llong .sys_utimes
1488 .llong .sys_statfs64
1489 .llong .sys_fstatfs64
1490 .llong .sys_ni_syscall /* 32bit only fadvise64_64 */
1491 .llong .ppc_rtas /* 255 */
1492 .llong .sys_ni_syscall /* 256 reserved for sys_debug_setcontext */
1493 .llong .sys_ni_syscall /* 257 reserved for vserver */
1494 .llong .sys_ni_syscall /* 258 reserved for new sys_remap_file_pages */
1495 .llong .sys_mbind
1496 .llong .sys_get_mempolicy /* 260 */
1497 .llong .sys_set_mempolicy
1498 .llong .sys_mq_open
1499 .llong .sys_mq_unlink
1500 .llong .sys_mq_timedsend
1501 .llong .sys_mq_timedreceive /* 265 */
1502 .llong .sys_mq_notify
1503 .llong .sys_mq_getsetattr
1504 .llong .sys_kexec_load
1505 .llong .sys_add_key
1506 .llong .sys_request_key /* 270 */
1507 .llong .sys_keyctl
1508 .llong .sys_waitid
1509 .llong .sys_ioprio_set
1510 .llong .sys_ioprio_get
1511 .llong .sys_inotify_init /* 275 */
1512 .llong .sys_inotify_add_watch
1513 .llong .sys_inotify_rm_watch
diff --git a/arch/ppc64/kernel/mpic.h b/arch/ppc64/kernel/mpic.h
deleted file mode 100644
index ca78a7f10528..000000000000
--- a/arch/ppc64/kernel/mpic.h
+++ /dev/null
@@ -1,273 +0,0 @@
1#include <linux/irq.h>
2
3/*
4 * Global registers
5 */
6
7#define MPIC_GREG_BASE 0x01000
8
9#define MPIC_GREG_FEATURE_0 0x00000
10#define MPIC_GREG_FEATURE_LAST_SRC_MASK 0x07ff0000
11#define MPIC_GREG_FEATURE_LAST_SRC_SHIFT 16
12#define MPIC_GREG_FEATURE_LAST_CPU_MASK 0x00001f00
13#define MPIC_GREG_FEATURE_LAST_CPU_SHIFT 8
14#define MPIC_GREG_FEATURE_VERSION_MASK 0xff
15#define MPIC_GREG_FEATURE_1 0x00010
16#define MPIC_GREG_GLOBAL_CONF_0 0x00020
17#define MPIC_GREG_GCONF_RESET 0x80000000
18#define MPIC_GREG_GCONF_8259_PTHROU_DIS 0x20000000
19#define MPIC_GREG_GCONF_BASE_MASK 0x000fffff
20#define MPIC_GREG_GLOBAL_CONF_1 0x00030
21#define MPIC_GREG_VENDOR_0 0x00040
22#define MPIC_GREG_VENDOR_1 0x00050
23#define MPIC_GREG_VENDOR_2 0x00060
24#define MPIC_GREG_VENDOR_3 0x00070
25#define MPIC_GREG_VENDOR_ID 0x00080
26#define MPIC_GREG_VENDOR_ID_STEPPING_MASK 0x00ff0000
27#define MPIC_GREG_VENDOR_ID_STEPPING_SHIFT 16
28#define MPIC_GREG_VENDOR_ID_DEVICE_ID_MASK 0x0000ff00
29#define MPIC_GREG_VENDOR_ID_DEVICE_ID_SHIFT 8
30#define MPIC_GREG_VENDOR_ID_VENDOR_ID_MASK 0x000000ff
31#define MPIC_GREG_PROCESSOR_INIT 0x00090
32#define MPIC_GREG_IPI_VECTOR_PRI_0 0x000a0
33#define MPIC_GREG_IPI_VECTOR_PRI_1 0x000b0
34#define MPIC_GREG_IPI_VECTOR_PRI_2 0x000c0
35#define MPIC_GREG_IPI_VECTOR_PRI_3 0x000d0
36#define MPIC_GREG_SPURIOUS 0x000e0
37#define MPIC_GREG_TIMER_FREQ 0x000f0
38
39/*
40 *
41 * Timer registers
42 */
43#define MPIC_TIMER_BASE 0x01100
44#define MPIC_TIMER_STRIDE 0x40
45
46#define MPIC_TIMER_CURRENT_CNT 0x00000
47#define MPIC_TIMER_BASE_CNT 0x00010
48#define MPIC_TIMER_VECTOR_PRI 0x00020
49#define MPIC_TIMER_DESTINATION 0x00030
50
51/*
52 * Per-Processor registers
53 */
54
55#define MPIC_CPU_THISBASE 0x00000
56#define MPIC_CPU_BASE 0x20000
57#define MPIC_CPU_STRIDE 0x01000
58
59#define MPIC_CPU_IPI_DISPATCH_0 0x00040
60#define MPIC_CPU_IPI_DISPATCH_1 0x00050
61#define MPIC_CPU_IPI_DISPATCH_2 0x00060
62#define MPIC_CPU_IPI_DISPATCH_3 0x00070
63#define MPIC_CPU_CURRENT_TASK_PRI 0x00080
64#define MPIC_CPU_TASKPRI_MASK 0x0000000f
65#define MPIC_CPU_WHOAMI 0x00090
66#define MPIC_CPU_WHOAMI_MASK 0x0000001f
67#define MPIC_CPU_INTACK 0x000a0
68#define MPIC_CPU_EOI 0x000b0
69
70/*
71 * Per-source registers
72 */
73
74#define MPIC_IRQ_BASE 0x10000
75#define MPIC_IRQ_STRIDE 0x00020
76#define MPIC_IRQ_VECTOR_PRI 0x00000
77#define MPIC_VECPRI_MASK 0x80000000
78#define MPIC_VECPRI_ACTIVITY 0x40000000 /* Read Only */
79#define MPIC_VECPRI_PRIORITY_MASK 0x000f0000
80#define MPIC_VECPRI_PRIORITY_SHIFT 16
81#define MPIC_VECPRI_VECTOR_MASK 0x000007ff
82#define MPIC_VECPRI_POLARITY_POSITIVE 0x00800000
83#define MPIC_VECPRI_POLARITY_NEGATIVE 0x00000000
84#define MPIC_VECPRI_POLARITY_MASK 0x00800000
85#define MPIC_VECPRI_SENSE_LEVEL 0x00400000
86#define MPIC_VECPRI_SENSE_EDGE 0x00000000
87#define MPIC_VECPRI_SENSE_MASK 0x00400000
88#define MPIC_IRQ_DESTINATION 0x00010
89
90#define MPIC_MAX_IRQ_SOURCES 2048
91#define MPIC_MAX_CPUS 32
92#define MPIC_MAX_ISU 32
93
94/*
95 * Special vector numbers (internal use only)
96 */
97#define MPIC_VEC_SPURRIOUS 255
98#define MPIC_VEC_IPI_3 254
99#define MPIC_VEC_IPI_2 253
100#define MPIC_VEC_IPI_1 252
101#define MPIC_VEC_IPI_0 251
102
103/* unused */
104#define MPIC_VEC_TIMER_3 250
105#define MPIC_VEC_TIMER_2 249
106#define MPIC_VEC_TIMER_1 248
107#define MPIC_VEC_TIMER_0 247
108
109/* Type definition of the cascade handler */
110typedef int (*mpic_cascade_t)(struct pt_regs *regs, void *data);
111
112#ifdef CONFIG_MPIC_BROKEN_U3
113/* Fixup table entry */
114struct mpic_irq_fixup
115{
116 u8 __iomem *base;
117 unsigned int irq;
118};
119#endif /* CONFIG_MPIC_BROKEN_U3 */
120
121
122/* The instance data of a given MPIC */
123struct mpic
124{
125 /* The "linux" controller struct */
126 hw_irq_controller hc_irq;
127#ifdef CONFIG_SMP
128 hw_irq_controller hc_ipi;
129#endif
130 const char *name;
131 /* Flags */
132 unsigned int flags;
133 /* How many irq sources in a given ISU */
134 unsigned int isu_size;
135 unsigned int isu_shift;
136 unsigned int isu_mask;
137 /* Offset of irq vector numbers */
138 unsigned int irq_offset;
139 unsigned int irq_count;
140 /* Offset of ipi vector numbers */
141 unsigned int ipi_offset;
142 /* Number of sources */
143 unsigned int num_sources;
144 /* Number of CPUs */
145 unsigned int num_cpus;
146 /* cascade handler */
147 mpic_cascade_t cascade;
148 void *cascade_data;
149 unsigned int cascade_vec;
150 /* senses array */
151 unsigned char *senses;
152 unsigned int senses_count;
153
154#ifdef CONFIG_MPIC_BROKEN_U3
155 /* The fixup table */
156 struct mpic_irq_fixup *fixups;
157 spinlock_t fixup_lock;
158#endif
159
160 /* The various ioremap'ed bases */
161 volatile u32 __iomem *gregs;
162 volatile u32 __iomem *tmregs;
163 volatile u32 __iomem *cpuregs[MPIC_MAX_CPUS];
164 volatile u32 __iomem *isus[MPIC_MAX_ISU];
165
166 /* link */
167 struct mpic *next;
168};
169
170/* This is the primary controller, only that one has IPIs and
171 * has afinity control. A non-primary MPIC always uses CPU0
172 * registers only
173 */
174#define MPIC_PRIMARY 0x00000001
175/* Set this for a big-endian MPIC */
176#define MPIC_BIG_ENDIAN 0x00000002
177/* Broken U3 MPIC */
178#define MPIC_BROKEN_U3 0x00000004
179/* Broken IPI registers (autodetected) */
180#define MPIC_BROKEN_IPI 0x00000008
181/* MPIC wants a reset */
182#define MPIC_WANTS_RESET 0x00000010
183
184/* Allocate the controller structure and setup the linux irq descs
185 * for the range if interrupts passed in. No HW initialization is
186 * actually performed.
187 *
188 * @phys_addr: physial base address of the MPIC
189 * @flags: flags, see constants above
190 * @isu_size: number of interrupts in an ISU. Use 0 to use a
191 * standard ISU-less setup (aka powermac)
192 * @irq_offset: first irq number to assign to this mpic
193 * @irq_count: number of irqs to use with this mpic IRQ sources. Pass 0
194 * to match the number of sources
195 * @ipi_offset: first irq number to assign to this mpic IPI sources,
196 * used only on primary mpic
197 * @senses: array of sense values
198 * @senses_num: number of entries in the array
199 *
200 * Note about the sense array. If none is passed, all interrupts are
201 * setup to be level negative unless MPIC_BROKEN_U3 is set in which
202 * case they are edge positive (and the array is ignored anyway).
203 * The values in the array start at the first source of the MPIC,
204 * that is senses[0] correspond to linux irq "irq_offset".
205 */
206extern struct mpic *mpic_alloc(unsigned long phys_addr,
207 unsigned int flags,
208 unsigned int isu_size,
209 unsigned int irq_offset,
210 unsigned int irq_count,
211 unsigned int ipi_offset,
212 unsigned char *senses,
213 unsigned int senses_num,
214 const char *name);
215
216/* Assign ISUs, to call before mpic_init()
217 *
218 * @mpic: controller structure as returned by mpic_alloc()
219 * @isu_num: ISU number
220 * @phys_addr: physical address of the ISU
221 */
222extern void mpic_assign_isu(struct mpic *mpic, unsigned int isu_num,
223 unsigned long phys_addr);
224
225/* Initialize the controller. After this has been called, none of the above
226 * should be called again for this mpic
227 */
228extern void mpic_init(struct mpic *mpic);
229
230/* Setup a cascade. Currently, only one cascade is supported this
231 * way, though you can always do a normal request_irq() and add
232 * other cascades this way. You should call this _after_ having
233 * added all the ISUs
234 *
235 * @irq_no: "linux" irq number of the cascade (that is offset'ed vector)
236 * @handler: cascade handler function
237 */
238extern void mpic_setup_cascade(unsigned int irq_no, mpic_cascade_t hanlder,
239 void *data);
240
241/*
242 * All of the following functions must only be used after the
243 * ISUs have been assigned and the controller fully initialized
244 * with mpic_init()
245 */
246
247
248/* Change/Read the priority of an interrupt. Default is 8 for irqs and
249 * 10 for IPIs. You can call this on both IPIs and IRQ numbers, but the
250 * IPI number is then the offset'ed (linux irq number mapped to the IPI)
251 */
252extern void mpic_irq_set_priority(unsigned int irq, unsigned int pri);
253extern unsigned int mpic_irq_get_priority(unsigned int irq);
254
255/* Setup a non-boot CPU */
256extern void mpic_setup_this_cpu(void);
257
258/* Clean up for kexec (or cpu offline or ...) */
259extern void mpic_teardown_this_cpu(int secondary);
260
261/* Request IPIs on primary mpic */
262extern void mpic_request_ipis(void);
263
264/* Send an IPI (non offseted number 0..3) */
265extern void mpic_send_ipi(unsigned int ipi_no, unsigned int cpu_mask);
266
267/* Fetch interrupt from a given mpic */
268extern int mpic_get_one_irq(struct mpic *mpic, struct pt_regs *regs);
269/* This one gets to the primary mpic */
270extern int mpic_get_irq(struct pt_regs *regs);
271
272/* global mpic for pSeries */
273extern struct mpic *pSeries_mpic;
diff --git a/arch/ppc64/kernel/pci.c b/arch/ppc64/kernel/pci.c
index ff4be1da69d5..3d2106b022a1 100644
--- a/arch/ppc64/kernel/pci.c
+++ b/arch/ppc64/kernel/pci.c
@@ -31,8 +31,7 @@
31#include <asm/irq.h> 31#include <asm/irq.h>
32#include <asm/machdep.h> 32#include <asm/machdep.h>
33#include <asm/udbg.h> 33#include <asm/udbg.h>
34 34#include <asm/ppc-pci.h>
35#include "pci.h"
36 35
37#ifdef DEBUG 36#ifdef DEBUG
38#define DBG(fmt...) udbg_printf(fmt) 37#define DBG(fmt...) udbg_printf(fmt)
@@ -727,16 +726,17 @@ static pgprot_t __pci_mmap_set_pgprot(struct pci_dev *dev, struct resource *rp,
727 * above routine 726 * above routine
728 */ 727 */
729pgprot_t pci_phys_mem_access_prot(struct file *file, 728pgprot_t pci_phys_mem_access_prot(struct file *file,
730 unsigned long offset, 729 unsigned long pfn,
731 unsigned long size, 730 unsigned long size,
732 pgprot_t protection) 731 pgprot_t protection)
733{ 732{
734 struct pci_dev *pdev = NULL; 733 struct pci_dev *pdev = NULL;
735 struct resource *found = NULL; 734 struct resource *found = NULL;
736 unsigned long prot = pgprot_val(protection); 735 unsigned long prot = pgprot_val(protection);
736 unsigned long offset = pfn << PAGE_SHIFT;
737 int i; 737 int i;
738 738
739 if (page_is_ram(offset >> PAGE_SHIFT)) 739 if (page_is_ram(pfn))
740 return __pgprot(prot); 740 return __pgprot(prot);
741 741
742 prot |= _PAGE_NO_CACHE | _PAGE_GUARDED; 742 prot |= _PAGE_NO_CACHE | _PAGE_GUARDED;
@@ -881,9 +881,9 @@ static void __devinit pci_process_ISA_OF_ranges(struct device_node *isa_node,
881} 881}
882 882
883void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose, 883void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose,
884 struct device_node *dev) 884 struct device_node *dev, int prim)
885{ 885{
886 unsigned int *ranges; 886 unsigned int *ranges, pci_space;
887 unsigned long size; 887 unsigned long size;
888 int rlen = 0; 888 int rlen = 0;
889 int memno = 0; 889 int memno = 0;
@@ -906,16 +906,39 @@ void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose,
906 ranges = (unsigned int *) get_property(dev, "ranges", &rlen); 906 ranges = (unsigned int *) get_property(dev, "ranges", &rlen);
907 while ((rlen -= np * sizeof(unsigned int)) >= 0) { 907 while ((rlen -= np * sizeof(unsigned int)) >= 0) {
908 res = NULL; 908 res = NULL;
909 pci_addr = (unsigned long)ranges[1] << 32 | ranges[2]; 909 pci_space = ranges[0];
910 pci_addr = ((unsigned long)ranges[1] << 32) | ranges[2];
910 911
911 cpu_phys_addr = ranges[3]; 912 cpu_phys_addr = ranges[3];
912 if (na == 2) 913 if (na >= 2)
913 cpu_phys_addr = cpu_phys_addr << 32 | ranges[4]; 914 cpu_phys_addr = (cpu_phys_addr << 32) | ranges[4];
914 915
915 size = (unsigned long)ranges[na+3] << 32 | ranges[na+4]; 916 size = ((unsigned long)ranges[na+3] << 32) | ranges[na+4];
917 ranges += np;
916 if (size == 0) 918 if (size == 0)
917 continue; 919 continue;
918 switch ((ranges[0] >> 24) & 0x3) { 920
921 /* Now consume following elements while they are contiguous */
922 while (rlen >= np * sizeof(unsigned int)) {
923 unsigned long addr, phys;
924
925 if (ranges[0] != pci_space)
926 break;
927 addr = ((unsigned long)ranges[1] << 32) | ranges[2];
928 phys = ranges[3];
929 if (na >= 2)
930 phys = (phys << 32) | ranges[4];
931 if (addr != pci_addr + size ||
932 phys != cpu_phys_addr + size)
933 break;
934
935 size += ((unsigned long)ranges[na+3] << 32)
936 | ranges[na+4];
937 ranges += np;
938 rlen -= np * sizeof(unsigned int);
939 }
940
941 switch ((pci_space >> 24) & 0x3) {
919 case 1: /* I/O space */ 942 case 1: /* I/O space */
920 hose->io_base_phys = cpu_phys_addr; 943 hose->io_base_phys = cpu_phys_addr;
921 hose->pci_io_size = size; 944 hose->pci_io_size = size;
@@ -949,7 +972,6 @@ void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose,
949 res->sibling = NULL; 972 res->sibling = NULL;
950 res->child = NULL; 973 res->child = NULL;
951 } 974 }
952 ranges += np;
953 } 975 }
954} 976}
955 977
diff --git a/arch/ppc64/kernel/pci.h b/arch/ppc64/kernel/pci.h
deleted file mode 100644
index 5eb2cc320566..000000000000
--- a/arch/ppc64/kernel/pci.h
+++ /dev/null
@@ -1,54 +0,0 @@
1/*
2 * c 2001 PPC 64 Team, 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#ifndef __PPC_KERNEL_PCI_H__
10#define __PPC_KERNEL_PCI_H__
11
12#include <linux/pci.h>
13#include <asm/pci-bridge.h>
14
15extern unsigned long isa_io_base;
16
17extern void pci_setup_pci_controller(struct pci_controller *hose);
18extern void pci_setup_phb_io(struct pci_controller *hose, int primary);
19extern void pci_setup_phb_io_dynamic(struct pci_controller *hose, int primary);
20
21
22extern struct list_head hose_list;
23extern int global_phb_number;
24
25extern unsigned long find_and_init_phbs(void);
26
27extern struct pci_dev *ppc64_isabridge_dev; /* may be NULL if no ISA bus */
28
29/* PCI device_node operations */
30struct device_node;
31typedef void *(*traverse_func)(struct device_node *me, void *data);
32void *traverse_pci_devices(struct device_node *start, traverse_func pre,
33 void *data);
34
35void pci_devs_phb_init(void);
36void pci_devs_phb_init_dynamic(struct pci_controller *phb);
37
38/* PCI address cache management routines */
39void pci_addr_cache_insert_device(struct pci_dev *dev);
40void pci_addr_cache_remove_device(struct pci_dev *dev);
41
42/* From rtas_pci.h */
43void init_pci_config_tokens (void);
44unsigned long get_phb_buid (struct device_node *);
45
46/* From pSeries_pci.h */
47extern void pSeries_final_fixup(void);
48extern void pSeries_irq_bus_setup(struct pci_bus *bus);
49
50extern unsigned long pci_probe_only;
51extern unsigned long pci_assign_all_buses;
52extern int pci_read_irq_line(struct pci_dev *pci_dev);
53
54#endif /* __PPC_KERNEL_PCI_H__ */
diff --git a/arch/ppc64/kernel/pci_direct_iommu.c b/arch/ppc64/kernel/pci_direct_iommu.c
index 54055c81017a..e1a32f802c0b 100644
--- a/arch/ppc64/kernel/pci_direct_iommu.c
+++ b/arch/ppc64/kernel/pci_direct_iommu.c
@@ -27,8 +27,7 @@
27#include <asm/machdep.h> 27#include <asm/machdep.h>
28#include <asm/pmac_feature.h> 28#include <asm/pmac_feature.h>
29#include <asm/abs_addr.h> 29#include <asm/abs_addr.h>
30 30#include <asm/ppc-pci.h>
31#include "pci.h"
32 31
33static void *pci_direct_alloc_coherent(struct device *hwdev, size_t size, 32static void *pci_direct_alloc_coherent(struct device *hwdev, size_t size,
34 dma_addr_t *dma_handle, gfp_t flag) 33 dma_addr_t *dma_handle, gfp_t flag)
diff --git a/arch/ppc64/kernel/pci_dn.c b/arch/ppc64/kernel/pci_dn.c
index a86389d07d57..493bbe43f5b4 100644
--- a/arch/ppc64/kernel/pci_dn.c
+++ b/arch/ppc64/kernel/pci_dn.c
@@ -30,8 +30,7 @@
30#include <asm/prom.h> 30#include <asm/prom.h>
31#include <asm/pci-bridge.h> 31#include <asm/pci-bridge.h>
32#include <asm/pSeries_reconfig.h> 32#include <asm/pSeries_reconfig.h>
33 33#include <asm/ppc-pci.h>
34#include "pci.h"
35 34
36/* 35/*
37 * Traverse_func that inits the PCI fields of the device node. 36 * Traverse_func that inits the PCI fields of the device node.
diff --git a/arch/ppc64/kernel/pci_iommu.c b/arch/ppc64/kernel/pci_iommu.c
index d9e33b7d4203..bdf15dbbf4f0 100644
--- a/arch/ppc64/kernel/pci_iommu.c
+++ b/arch/ppc64/kernel/pci_iommu.c
@@ -1,8 +1,8 @@
1/* 1/*
2 * arch/ppc64/kernel/pci_iommu.c 2 * arch/ppc64/kernel/pci_iommu.c
3 * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation 3 * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation
4 * 4 *
5 * Rewrite, cleanup, new allocation schemes: 5 * Rewrite, cleanup, new allocation schemes:
6 * Copyright (C) 2004 Olof Johansson, IBM Corporation 6 * Copyright (C) 2004 Olof Johansson, IBM Corporation
7 * 7 *
8 * Dynamic DMA mapping support, platform-independent parts. 8 * Dynamic DMA mapping support, platform-independent parts.
@@ -11,19 +11,18 @@
11 * it under the terms of the GNU General Public License as published by 11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or 12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version. 13 * (at your option) any later version.
14 * 14 *
15 * This program is distributed in the hope that it will be useful, 15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details. 18 * GNU General Public License for more details.
19 * 19 *
20 * You should have received a copy of the GNU General Public License 20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software 21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */ 23 */
24 24
25 25
26#include <linux/config.h>
27#include <linux/init.h> 26#include <linux/init.h>
28#include <linux/types.h> 27#include <linux/types.h>
29#include <linux/slab.h> 28#include <linux/slab.h>
@@ -37,11 +36,7 @@
37#include <asm/iommu.h> 36#include <asm/iommu.h>
38#include <asm/pci-bridge.h> 37#include <asm/pci-bridge.h>
39#include <asm/machdep.h> 38#include <asm/machdep.h>
40#include "pci.h" 39#include <asm/ppc-pci.h>
41
42#ifdef CONFIG_PPC_ISERIES
43#include <asm/iSeries/iSeries_pci.h>
44#endif /* CONFIG_PPC_ISERIES */
45 40
46/* 41/*
47 * We can use ->sysdata directly and avoid the extra work in 42 * We can use ->sysdata directly and avoid the extra work in
@@ -61,13 +56,7 @@ static inline struct iommu_table *devnode_table(struct device *dev)
61 } else 56 } else
62 pdev = to_pci_dev(dev); 57 pdev = to_pci_dev(dev);
63 58
64#ifdef CONFIG_PPC_ISERIES
65 return ISERIES_DEVNODE(pdev)->iommu_table;
66#endif /* CONFIG_PPC_ISERIES */
67
68#ifdef CONFIG_PPC_MULTIPLATFORM
69 return PCI_DN(PCI_GET_DN(pdev))->iommu_table; 59 return PCI_DN(PCI_GET_DN(pdev))->iommu_table;
70#endif /* CONFIG_PPC_MULTIPLATFORM */
71} 60}
72 61
73 62
diff --git a/arch/ppc64/kernel/pmac.h b/arch/ppc64/kernel/pmac.h
deleted file mode 100644
index 40e1c5030f74..000000000000
--- a/arch/ppc64/kernel/pmac.h
+++ /dev/null
@@ -1,31 +0,0 @@
1#ifndef __PMAC_H__
2#define __PMAC_H__
3
4#include <linux/pci.h>
5#include <linux/ide.h>
6
7/*
8 * Declaration for the various functions exported by the
9 * pmac_* files. Mostly for use by pmac_setup
10 */
11
12extern void pmac_get_boot_time(struct rtc_time *tm);
13extern void pmac_get_rtc_time(struct rtc_time *tm);
14extern int pmac_set_rtc_time(struct rtc_time *tm);
15extern void pmac_read_rtc_time(void);
16extern void pmac_calibrate_decr(void);
17
18extern void pmac_pcibios_fixup(void);
19extern void pmac_pci_init(void);
20extern void pmac_setup_pci_dma(void);
21extern void pmac_check_ht_link(void);
22
23extern void pmac_setup_smp(void);
24
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
29extern void pmac_nvram_init(void);
30
31#endif /* __PMAC_H__ */
diff --git a/arch/ppc64/kernel/pmac_feature.c b/arch/ppc64/kernel/pmac_feature.c
deleted file mode 100644
index eb4e6c3f694d..000000000000
--- a/arch/ppc64/kernel/pmac_feature.c
+++ /dev/null
@@ -1,767 +0,0 @@
1/*
2 * arch/ppc/platforms/pmac_feature.c
3 *
4 * Copyright (C) 1996-2001 Paul Mackerras (paulus@cs.anu.edu.au)
5 * Ben. Herrenschmidt (benh@kernel.crashing.org)
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
10 * 2 of the License, or (at your option) any later version.
11 *
12 * TODO:
13 *
14 * - Replace mdelay with some schedule loop if possible
15 * - Shorten some obfuscated delays on some routines (like modem
16 * power)
17 * - Refcount some clocks (see darwin)
18 * - Split split split...
19 *
20 */
21#include <linux/config.h>
22#include <linux/types.h>
23#include <linux/init.h>
24#include <linux/delay.h>
25#include <linux/kernel.h>
26#include <linux/sched.h>
27#include <linux/spinlock.h>
28#include <linux/adb.h>
29#include <linux/pmu.h>
30#include <linux/ioport.h>
31#include <linux/pci.h>
32#include <asm/sections.h>
33#include <asm/errno.h>
34#include <asm/keylargo.h>
35#include <asm/uninorth.h>
36#include <asm/io.h>
37#include <asm/prom.h>
38#include <asm/machdep.h>
39#include <asm/pmac_feature.h>
40#include <asm/dbdma.h>
41#include <asm/pci-bridge.h>
42#include <asm/pmac_low_i2c.h>
43
44#undef DEBUG_FEATURE
45
46#ifdef DEBUG_FEATURE
47#define DBG(fmt...) printk(KERN_DEBUG fmt)
48#else
49#define DBG(fmt...)
50#endif
51
52/*
53 * We use a single global lock to protect accesses. Each driver has
54 * to take care of its own locking
55 */
56static DEFINE_SPINLOCK(feature_lock __pmacdata);
57
58#define LOCK(flags) spin_lock_irqsave(&feature_lock, flags);
59#define UNLOCK(flags) spin_unlock_irqrestore(&feature_lock, flags);
60
61
62/*
63 * Instance of some macio stuffs
64 */
65struct macio_chip macio_chips[MAX_MACIO_CHIPS] __pmacdata;
66
67struct macio_chip* __pmac macio_find(struct device_node* child, int type)
68{
69 while(child) {
70 int i;
71
72 for (i=0; i < MAX_MACIO_CHIPS && macio_chips[i].of_node; i++)
73 if (child == macio_chips[i].of_node &&
74 (!type || macio_chips[i].type == type))
75 return &macio_chips[i];
76 child = child->parent;
77 }
78 return NULL;
79}
80EXPORT_SYMBOL_GPL(macio_find);
81
82static const char* macio_names[] __pmacdata =
83{
84 "Unknown",
85 "Grand Central",
86 "OHare",
87 "OHareII",
88 "Heathrow",
89 "Gatwick",
90 "Paddington",
91 "Keylargo",
92 "Pangea",
93 "Intrepid",
94 "K2"
95};
96
97
98
99/*
100 * Uninorth reg. access. Note that Uni-N regs are big endian
101 */
102
103#define UN_REG(r) (uninorth_base + ((r) >> 2))
104#define UN_IN(r) (in_be32(UN_REG(r)))
105#define UN_OUT(r,v) (out_be32(UN_REG(r), (v)))
106#define UN_BIS(r,v) (UN_OUT((r), UN_IN(r) | (v)))
107#define UN_BIC(r,v) (UN_OUT((r), UN_IN(r) & ~(v)))
108
109static struct device_node* uninorth_node __pmacdata;
110static u32* uninorth_base __pmacdata;
111static u32 uninorth_rev __pmacdata;
112static void *u3_ht;
113
114extern struct device_node *k2_skiplist[2];
115
116/*
117 * For each motherboard family, we have a table of functions pointers
118 * that handle the various features.
119 */
120
121typedef long (*feature_call)(struct device_node* node, long param, long value);
122
123struct feature_table_entry {
124 unsigned int selector;
125 feature_call function;
126};
127
128struct pmac_mb_def
129{
130 const char* model_string;
131 const char* model_name;
132 int model_id;
133 struct feature_table_entry* features;
134 unsigned long board_flags;
135};
136static struct pmac_mb_def pmac_mb __pmacdata;
137
138/*
139 * Here are the chip specific feature functions
140 */
141
142
143static long __pmac g5_read_gpio(struct device_node* node, long param, long value)
144{
145 struct macio_chip* macio = &macio_chips[0];
146
147 return MACIO_IN8(param);
148}
149
150
151static long __pmac g5_write_gpio(struct device_node* node, long param, long value)
152{
153 struct macio_chip* macio = &macio_chips[0];
154
155 MACIO_OUT8(param, (u8)(value & 0xff));
156 return 0;
157}
158
159static long __pmac g5_gmac_enable(struct device_node* node, long param, long value)
160{
161 struct macio_chip* macio = &macio_chips[0];
162 unsigned long flags;
163
164 if (node == NULL)
165 return -ENODEV;
166
167 LOCK(flags);
168 if (value) {
169 MACIO_BIS(KEYLARGO_FCR1, K2_FCR1_GMAC_CLK_ENABLE);
170 mb();
171 k2_skiplist[0] = NULL;
172 } else {
173 k2_skiplist[0] = node;
174 mb();
175 MACIO_BIC(KEYLARGO_FCR1, K2_FCR1_GMAC_CLK_ENABLE);
176 }
177
178 UNLOCK(flags);
179 mdelay(1);
180
181 return 0;
182}
183
184static long __pmac g5_fw_enable(struct device_node* node, long param, long value)
185{
186 struct macio_chip* macio = &macio_chips[0];
187 unsigned long flags;
188
189 if (node == NULL)
190 return -ENODEV;
191
192 LOCK(flags);
193 if (value) {
194 MACIO_BIS(KEYLARGO_FCR1, K2_FCR1_FW_CLK_ENABLE);
195 mb();
196 k2_skiplist[1] = NULL;
197 } else {
198 k2_skiplist[1] = node;
199 mb();
200 MACIO_BIC(KEYLARGO_FCR1, K2_FCR1_FW_CLK_ENABLE);
201 }
202
203 UNLOCK(flags);
204 mdelay(1);
205
206 return 0;
207}
208
209static long __pmac g5_mpic_enable(struct device_node* node, long param, long value)
210{
211 unsigned long flags;
212
213 if (node->parent == NULL || strcmp(node->parent->name, "u3"))
214 return 0;
215
216 LOCK(flags);
217 UN_BIS(U3_TOGGLE_REG, U3_MPIC_RESET | U3_MPIC_OUTPUT_ENABLE);
218 UNLOCK(flags);
219
220 return 0;
221}
222
223static long __pmac g5_eth_phy_reset(struct device_node* node, long param, long value)
224{
225 struct macio_chip* macio = &macio_chips[0];
226 struct device_node *phy;
227 int need_reset;
228
229 /*
230 * We must not reset the combo PHYs, only the BCM5221 found in
231 * the iMac G5.
232 */
233 phy = of_get_next_child(node, NULL);
234 if (!phy)
235 return -ENODEV;
236 need_reset = device_is_compatible(phy, "B5221");
237 of_node_put(phy);
238 if (!need_reset)
239 return 0;
240
241 /* PHY reset is GPIO 29, not in device-tree unfortunately */
242 MACIO_OUT8(K2_GPIO_EXTINT_0 + 29,
243 KEYLARGO_GPIO_OUTPUT_ENABLE | KEYLARGO_GPIO_OUTOUT_DATA);
244 /* Thankfully, this is now always called at a time when we can
245 * schedule by sungem.
246 */
247 msleep(10);
248 MACIO_OUT8(K2_GPIO_EXTINT_0 + 29, 0);
249
250 return 0;
251}
252
253static long __pmac g5_i2s_enable(struct device_node *node, long param, long value)
254{
255 /* Very crude implementation for now */
256 struct macio_chip* macio = &macio_chips[0];
257 unsigned long flags;
258
259 if (value == 0)
260 return 0; /* don't disable yet */
261
262 LOCK(flags);
263 MACIO_BIS(KEYLARGO_FCR3, KL3_CLK45_ENABLE | KL3_CLK49_ENABLE |
264 KL3_I2S0_CLK18_ENABLE);
265 udelay(10);
266 MACIO_BIS(KEYLARGO_FCR1, K2_FCR1_I2S0_CELL_ENABLE |
267 K2_FCR1_I2S0_CLK_ENABLE_BIT | K2_FCR1_I2S0_ENABLE);
268 udelay(10);
269 MACIO_BIC(KEYLARGO_FCR1, K2_FCR1_I2S0_RESET);
270 UNLOCK(flags);
271 udelay(10);
272
273 return 0;
274}
275
276
277#ifdef CONFIG_SMP
278static long __pmac g5_reset_cpu(struct device_node* node, long param, long value)
279{
280 unsigned int reset_io = 0;
281 unsigned long flags;
282 struct macio_chip* macio;
283 struct device_node* np;
284
285 macio = &macio_chips[0];
286 if (macio->type != macio_keylargo2)
287 return -ENODEV;
288
289 np = find_path_device("/cpus");
290 if (np == NULL)
291 return -ENODEV;
292 for (np = np->child; np != NULL; np = np->sibling) {
293 u32* num = (u32 *)get_property(np, "reg", NULL);
294 u32* rst = (u32 *)get_property(np, "soft-reset", NULL);
295 if (num == NULL || rst == NULL)
296 continue;
297 if (param == *num) {
298 reset_io = *rst;
299 break;
300 }
301 }
302 if (np == NULL || reset_io == 0)
303 return -ENODEV;
304
305 LOCK(flags);
306 MACIO_OUT8(reset_io, KEYLARGO_GPIO_OUTPUT_ENABLE);
307 (void)MACIO_IN8(reset_io);
308 udelay(1);
309 MACIO_OUT8(reset_io, 0);
310 (void)MACIO_IN8(reset_io);
311 UNLOCK(flags);
312
313 return 0;
314}
315#endif /* CONFIG_SMP */
316
317/*
318 * This can be called from pmac_smp so isn't static
319 *
320 * This takes the second CPU off the bus on dual CPU machines
321 * running UP
322 */
323void __pmac g5_phy_disable_cpu1(void)
324{
325 UN_OUT(U3_API_PHY_CONFIG_1, 0);
326}
327
328static long __pmac generic_get_mb_info(struct device_node* node, long param, long value)
329{
330 switch(param) {
331 case PMAC_MB_INFO_MODEL:
332 return pmac_mb.model_id;
333 case PMAC_MB_INFO_FLAGS:
334 return pmac_mb.board_flags;
335 case PMAC_MB_INFO_NAME:
336 /* hack hack hack... but should work */
337 *((const char **)value) = pmac_mb.model_name;
338 return 0;
339 }
340 return -EINVAL;
341}
342
343
344/*
345 * Table definitions
346 */
347
348/* Used on any machine
349 */
350static struct feature_table_entry any_features[] __pmacdata = {
351 { PMAC_FTR_GET_MB_INFO, generic_get_mb_info },
352 { 0, NULL }
353};
354
355/* G5 features
356 */
357static struct feature_table_entry g5_features[] __pmacdata = {
358 { PMAC_FTR_GMAC_ENABLE, g5_gmac_enable },
359 { PMAC_FTR_1394_ENABLE, g5_fw_enable },
360 { PMAC_FTR_ENABLE_MPIC, g5_mpic_enable },
361 { PMAC_FTR_READ_GPIO, g5_read_gpio },
362 { PMAC_FTR_WRITE_GPIO, g5_write_gpio },
363 { PMAC_FTR_GMAC_PHY_RESET, g5_eth_phy_reset },
364 { PMAC_FTR_SOUND_CHIP_ENABLE, g5_i2s_enable },
365#ifdef CONFIG_SMP
366 { PMAC_FTR_RESET_CPU, g5_reset_cpu },
367#endif /* CONFIG_SMP */
368 { 0, NULL }
369};
370
371static struct pmac_mb_def pmac_mb_defs[] __pmacdata = {
372 { "PowerMac7,2", "PowerMac G5",
373 PMAC_TYPE_POWERMAC_G5, g5_features,
374 0,
375 },
376 { "PowerMac7,3", "PowerMac G5",
377 PMAC_TYPE_POWERMAC_G5, g5_features,
378 0,
379 },
380 { "PowerMac8,1", "iMac G5",
381 PMAC_TYPE_IMAC_G5, g5_features,
382 0,
383 },
384 { "PowerMac9,1", "PowerMac G5",
385 PMAC_TYPE_POWERMAC_G5_U3L, g5_features,
386 0,
387 },
388 { "RackMac3,1", "XServe G5",
389 PMAC_TYPE_XSERVE_G5, g5_features,
390 0,
391 },
392};
393
394/*
395 * The toplevel feature_call callback
396 */
397long __pmac pmac_do_feature_call(unsigned int selector, ...)
398{
399 struct device_node* node;
400 long param, value;
401 int i;
402 feature_call func = NULL;
403 va_list args;
404
405 if (pmac_mb.features)
406 for (i=0; pmac_mb.features[i].function; i++)
407 if (pmac_mb.features[i].selector == selector) {
408 func = pmac_mb.features[i].function;
409 break;
410 }
411 if (!func)
412 for (i=0; any_features[i].function; i++)
413 if (any_features[i].selector == selector) {
414 func = any_features[i].function;
415 break;
416 }
417 if (!func)
418 return -ENODEV;
419
420 va_start(args, selector);
421 node = (struct device_node*)va_arg(args, void*);
422 param = va_arg(args, long);
423 value = va_arg(args, long);
424 va_end(args);
425
426 return func(node, param, value);
427}
428
429static int __init probe_motherboard(void)
430{
431 int i;
432 struct macio_chip* macio = &macio_chips[0];
433 const char* model = NULL;
434 struct device_node *dt;
435
436 /* Lookup known motherboard type in device-tree. First try an
437 * exact match on the "model" property, then try a "compatible"
438 * match is none is found.
439 */
440 dt = find_devices("device-tree");
441 if (dt != NULL)
442 model = (const char *) get_property(dt, "model", NULL);
443 for(i=0; model && i<(sizeof(pmac_mb_defs)/sizeof(struct pmac_mb_def)); i++) {
444 if (strcmp(model, pmac_mb_defs[i].model_string) == 0) {
445 pmac_mb = pmac_mb_defs[i];
446 goto found;
447 }
448 }
449 for(i=0; i<(sizeof(pmac_mb_defs)/sizeof(struct pmac_mb_def)); i++) {
450 if (machine_is_compatible(pmac_mb_defs[i].model_string)) {
451 pmac_mb = pmac_mb_defs[i];
452 goto found;
453 }
454 }
455
456 /* Fallback to selection depending on mac-io chip type */
457 switch(macio->type) {
458 case macio_keylargo2:
459 pmac_mb.model_id = PMAC_TYPE_UNKNOWN_K2;
460 pmac_mb.model_name = "Unknown K2-based";
461 pmac_mb.features = g5_features;
462
463 default:
464 return -ENODEV;
465 }
466found:
467 /* Check for "mobile" machine */
468 if (model && (strncmp(model, "PowerBook", 9) == 0
469 || strncmp(model, "iBook", 5) == 0))
470 pmac_mb.board_flags |= PMAC_MB_MOBILE;
471
472
473 printk(KERN_INFO "PowerMac motherboard: %s\n", pmac_mb.model_name);
474 return 0;
475}
476
477/* Initialize the Core99 UniNorth host bridge and memory controller
478 */
479static void __init probe_uninorth(void)
480{
481 uninorth_node = of_find_node_by_name(NULL, "u3");
482 if (uninorth_node && uninorth_node->n_addrs > 0) {
483 /* Small hack until I figure out if parsing in prom.c is correct. I should
484 * get rid of those pre-parsed junk anyway
485 */
486 unsigned long address = uninorth_node->addrs[0].address;
487 uninorth_base = ioremap(address, 0x40000);
488 uninorth_rev = in_be32(UN_REG(UNI_N_VERSION));
489 u3_ht = ioremap(address + U3_HT_CONFIG_BASE, 0x1000);
490 } else
491 uninorth_node = NULL;
492
493 if (!uninorth_node)
494 return;
495
496 printk(KERN_INFO "Found U3 memory controller & host bridge, revision: %d\n",
497 uninorth_rev);
498 printk(KERN_INFO "Mapped at 0x%08lx\n", (unsigned long)uninorth_base);
499
500}
501
502static void __init probe_one_macio(const char* name, const char* compat, int type)
503{
504 struct device_node* node;
505 int i;
506 volatile u32* base;
507 u32* revp;
508
509 node = find_devices(name);
510 if (!node || !node->n_addrs)
511 return;
512 if (compat)
513 do {
514 if (device_is_compatible(node, compat))
515 break;
516 node = node->next;
517 } while (node);
518 if (!node)
519 return;
520 for(i=0; i<MAX_MACIO_CHIPS; i++) {
521 if (!macio_chips[i].of_node)
522 break;
523 if (macio_chips[i].of_node == node)
524 return;
525 }
526 if (i >= MAX_MACIO_CHIPS) {
527 printk(KERN_ERR "pmac_feature: Please increase MAX_MACIO_CHIPS !\n");
528 printk(KERN_ERR "pmac_feature: %s skipped\n", node->full_name);
529 return;
530 }
531 base = (volatile u32*)ioremap(node->addrs[0].address, node->addrs[0].size);
532 if (!base) {
533 printk(KERN_ERR "pmac_feature: Can't map mac-io chip !\n");
534 return;
535 }
536 if (type == macio_keylargo) {
537 u32* did = (u32 *)get_property(node, "device-id", NULL);
538 if (*did == 0x00000025)
539 type = macio_pangea;
540 if (*did == 0x0000003e)
541 type = macio_intrepid;
542 }
543 macio_chips[i].of_node = node;
544 macio_chips[i].type = type;
545 macio_chips[i].base = base;
546 macio_chips[i].flags = MACIO_FLAG_SCCB_ON | MACIO_FLAG_SCCB_ON;
547 macio_chips[i].name = macio_names[type];
548 revp = (u32 *)get_property(node, "revision-id", NULL);
549 if (revp)
550 macio_chips[i].rev = *revp;
551 printk(KERN_INFO "Found a %s mac-io controller, rev: %d, mapped at 0x%p\n",
552 macio_names[type], macio_chips[i].rev, macio_chips[i].base);
553}
554
555static int __init
556probe_macios(void)
557{
558 probe_one_macio("mac-io", "K2-Keylargo", macio_keylargo2);
559
560 macio_chips[0].lbus.index = 0;
561 macio_chips[1].lbus.index = 1;
562
563 return (macio_chips[0].of_node == NULL) ? -ENODEV : 0;
564}
565
566static void __init
567set_initial_features(void)
568{
569 struct device_node *np;
570
571 if (macio_chips[0].type == macio_keylargo2) {
572#ifndef CONFIG_SMP
573 /* On SMP machines running UP, we have the second CPU eating
574 * bus cycles. We need to take it off the bus. This is done
575 * from pmac_smp for SMP kernels running on one CPU
576 */
577 np = of_find_node_by_type(NULL, "cpu");
578 if (np != NULL)
579 np = of_find_node_by_type(np, "cpu");
580 if (np != NULL) {
581 g5_phy_disable_cpu1();
582 of_node_put(np);
583 }
584#endif /* CONFIG_SMP */
585 /* Enable GMAC for now for PCI probing. It will be disabled
586 * later on after PCI probe
587 */
588 np = of_find_node_by_name(NULL, "ethernet");
589 while(np) {
590 if (device_is_compatible(np, "K2-GMAC"))
591 g5_gmac_enable(np, 0, 1);
592 np = of_find_node_by_name(np, "ethernet");
593 }
594
595 /* Enable FW before PCI probe. Will be disabled later on
596 * Note: We should have a batter way to check that we are
597 * dealing with uninorth internal cell and not a PCI cell
598 * on the external PCI. The code below works though.
599 */
600 np = of_find_node_by_name(NULL, "firewire");
601 while(np) {
602 if (device_is_compatible(np, "pci106b,5811")) {
603 macio_chips[0].flags |= MACIO_FLAG_FW_SUPPORTED;
604 g5_fw_enable(np, 0, 1);
605 }
606 np = of_find_node_by_name(np, "firewire");
607 }
608 }
609}
610
611void __init
612pmac_feature_init(void)
613{
614 /* Detect the UniNorth memory controller */
615 probe_uninorth();
616
617 /* Probe mac-io controllers */
618 if (probe_macios()) {
619 printk(KERN_WARNING "No mac-io chip found\n");
620 return;
621 }
622
623 /* Setup low-level i2c stuffs */
624 pmac_init_low_i2c();
625
626 /* Probe machine type */
627 if (probe_motherboard())
628 printk(KERN_WARNING "Unknown PowerMac !\n");
629
630 /* Set some initial features (turn off some chips that will
631 * be later turned on)
632 */
633 set_initial_features();
634}
635
636int __init pmac_feature_late_init(void)
637{
638#if 0
639 struct device_node* np;
640
641 /* Request some resources late */
642 if (uninorth_node)
643 request_OF_resource(uninorth_node, 0, NULL);
644 np = find_devices("hammerhead");
645 if (np)
646 request_OF_resource(np, 0, NULL);
647 np = find_devices("interrupt-controller");
648 if (np)
649 request_OF_resource(np, 0, NULL);
650#endif
651 return 0;
652}
653
654device_initcall(pmac_feature_late_init);
655
656#if 0
657static void dump_HT_speeds(char *name, u32 cfg, u32 frq)
658{
659 int freqs[16] = { 200,300,400,500,600,800,1000,0,0,0,0,0,0,0,0,0 };
660 int bits[8] = { 8,16,0,32,2,4,0,0 };
661 int freq = (frq >> 8) & 0xf;
662
663 if (freqs[freq] == 0)
664 printk("%s: Unknown HT link frequency %x\n", name, freq);
665 else
666 printk("%s: %d MHz on main link, (%d in / %d out) bits width\n",
667 name, freqs[freq],
668 bits[(cfg >> 28) & 0x7], bits[(cfg >> 24) & 0x7]);
669}
670#endif
671
672void __init pmac_check_ht_link(void)
673{
674#if 0 /* Disabled for now */
675 u32 ufreq, freq, ucfg, cfg;
676 struct device_node *pcix_node;
677 struct pci_dn *pdn;
678 u8 px_bus, px_devfn;
679 struct pci_controller *px_hose;
680
681 (void)in_be32(u3_ht + U3_HT_LINK_COMMAND);
682 ucfg = cfg = in_be32(u3_ht + U3_HT_LINK_CONFIG);
683 ufreq = freq = in_be32(u3_ht + U3_HT_LINK_FREQ);
684 dump_HT_speeds("U3 HyperTransport", cfg, freq);
685
686 pcix_node = of_find_compatible_node(NULL, "pci", "pci-x");
687 if (pcix_node == NULL) {
688 printk("No PCI-X bridge found\n");
689 return;
690 }
691 pdn = pcix_node->data;
692 px_hose = pdn->phb;
693 px_bus = pdn->busno;
694 px_devfn = pdn->devfn;
695
696 early_read_config_dword(px_hose, px_bus, px_devfn, 0xc4, &cfg);
697 early_read_config_dword(px_hose, px_bus, px_devfn, 0xcc, &freq);
698 dump_HT_speeds("PCI-X HT Uplink", cfg, freq);
699 early_read_config_dword(px_hose, px_bus, px_devfn, 0xc8, &cfg);
700 early_read_config_dword(px_hose, px_bus, px_devfn, 0xd0, &freq);
701 dump_HT_speeds("PCI-X HT Downlink", cfg, freq);
702#endif
703}
704
705/*
706 * Early video resume hook
707 */
708
709static void (*pmac_early_vresume_proc)(void *data) __pmacdata;
710static void *pmac_early_vresume_data __pmacdata;
711
712void pmac_set_early_video_resume(void (*proc)(void *data), void *data)
713{
714 if (_machine != _MACH_Pmac)
715 return;
716 preempt_disable();
717 pmac_early_vresume_proc = proc;
718 pmac_early_vresume_data = data;
719 preempt_enable();
720}
721EXPORT_SYMBOL(pmac_set_early_video_resume);
722
723
724/*
725 * AGP related suspend/resume code
726 */
727
728static struct pci_dev *pmac_agp_bridge __pmacdata;
729static int (*pmac_agp_suspend)(struct pci_dev *bridge) __pmacdata;
730static int (*pmac_agp_resume)(struct pci_dev *bridge) __pmacdata;
731
732void __pmac pmac_register_agp_pm(struct pci_dev *bridge,
733 int (*suspend)(struct pci_dev *bridge),
734 int (*resume)(struct pci_dev *bridge))
735{
736 if (suspend || resume) {
737 pmac_agp_bridge = bridge;
738 pmac_agp_suspend = suspend;
739 pmac_agp_resume = resume;
740 return;
741 }
742 if (bridge != pmac_agp_bridge)
743 return;
744 pmac_agp_suspend = pmac_agp_resume = NULL;
745 return;
746}
747EXPORT_SYMBOL(pmac_register_agp_pm);
748
749void __pmac pmac_suspend_agp_for_card(struct pci_dev *dev)
750{
751 if (pmac_agp_bridge == NULL || pmac_agp_suspend == NULL)
752 return;
753 if (pmac_agp_bridge->bus != dev->bus)
754 return;
755 pmac_agp_suspend(pmac_agp_bridge);
756}
757EXPORT_SYMBOL(pmac_suspend_agp_for_card);
758
759void __pmac pmac_resume_agp_for_card(struct pci_dev *dev)
760{
761 if (pmac_agp_bridge == NULL || pmac_agp_resume == NULL)
762 return;
763 if (pmac_agp_bridge->bus != dev->bus)
764 return;
765 pmac_agp_resume(pmac_agp_bridge);
766}
767EXPORT_SYMBOL(pmac_resume_agp_for_card);
diff --git a/arch/ppc64/kernel/pmac_pci.c b/arch/ppc64/kernel/pmac_pci.c
deleted file mode 100644
index dc40a0cad0b4..000000000000
--- a/arch/ppc64/kernel/pmac_pci.c
+++ /dev/null
@@ -1,793 +0,0 @@
1/*
2 * Support for PCI bridges found on Power Macintoshes.
3 * At present the "bandit" and "chaos" bridges are supported.
4 * Fortunately you access configuration space in the same
5 * way with either bridge.
6 *
7 * Copyright (C) 2003 Benjamin Herrenschmuidt (benh@kernel.crashing.org)
8 * Copyright (C) 1997 Paul Mackerras (paulus@samba.org)
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
14 */
15
16#include <linux/kernel.h>
17#include <linux/pci.h>
18#include <linux/delay.h>
19#include <linux/string.h>
20#include <linux/init.h>
21#include <linux/bootmem.h>
22
23#include <asm/sections.h>
24#include <asm/io.h>
25#include <asm/prom.h>
26#include <asm/pci-bridge.h>
27#include <asm/machdep.h>
28#include <asm/pmac_feature.h>
29#include <asm/iommu.h>
30
31#include "pci.h"
32#include "pmac.h"
33
34#define DEBUG
35
36#ifdef DEBUG
37#define DBG(x...) printk(x)
38#else
39#define DBG(x...)
40#endif
41
42/* XXX Could be per-controller, but I don't think we risk anything by
43 * assuming we won't have both UniNorth and Bandit */
44static int has_uninorth;
45static struct pci_controller *u3_agp;
46struct device_node *k2_skiplist[2];
47
48static int __init fixup_one_level_bus_range(struct device_node *node, int higher)
49{
50 for (; node != 0;node = node->sibling) {
51 int * bus_range;
52 unsigned int *class_code;
53 int len;
54
55 /* For PCI<->PCI bridges or CardBus bridges, we go down */
56 class_code = (unsigned int *) get_property(node, "class-code", NULL);
57 if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
58 (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS))
59 continue;
60 bus_range = (int *) get_property(node, "bus-range", &len);
61 if (bus_range != NULL && len > 2 * sizeof(int)) {
62 if (bus_range[1] > higher)
63 higher = bus_range[1];
64 }
65 higher = fixup_one_level_bus_range(node->child, higher);
66 }
67 return higher;
68}
69
70/* This routine fixes the "bus-range" property of all bridges in the
71 * system since they tend to have their "last" member wrong on macs
72 *
73 * Note that the bus numbers manipulated here are OF bus numbers, they
74 * are not Linux bus numbers.
75 */
76static void __init fixup_bus_range(struct device_node *bridge)
77{
78 int * bus_range;
79 int len;
80
81 /* Lookup the "bus-range" property for the hose */
82 bus_range = (int *) get_property(bridge, "bus-range", &len);
83 if (bus_range == NULL || len < 2 * sizeof(int)) {
84 printk(KERN_WARNING "Can't get bus-range for %s\n",
85 bridge->full_name);
86 return;
87 }
88 bus_range[1] = fixup_one_level_bus_range(bridge->child, bus_range[1]);
89}
90
91/*
92 * Apple MacRISC (U3, UniNorth, Bandit, Chaos) PCI controllers.
93 *
94 * The "Bandit" version is present in all early PCI PowerMacs,
95 * and up to the first ones using Grackle. Some machines may
96 * have 2 bandit controllers (2 PCI busses).
97 *
98 * "Chaos" is used in some "Bandit"-type machines as a bridge
99 * for the separate display bus. It is accessed the same
100 * way as bandit, but cannot be probed for devices. It therefore
101 * has its own config access functions.
102 *
103 * The "UniNorth" version is present in all Core99 machines
104 * (iBook, G4, new IMacs, and all the recent Apple machines).
105 * It contains 3 controllers in one ASIC.
106 *
107 * The U3 is the bridge used on G5 machines. It contains on
108 * AGP bus which is dealt with the old UniNorth access routines
109 * and an HyperTransport bus which uses its own set of access
110 * functions.
111 */
112
113#define MACRISC_CFA0(devfn, off) \
114 ((1 << (unsigned long)PCI_SLOT(dev_fn)) \
115 | (((unsigned long)PCI_FUNC(dev_fn)) << 8) \
116 | (((unsigned long)(off)) & 0xFCUL))
117
118#define MACRISC_CFA1(bus, devfn, off) \
119 ((((unsigned long)(bus)) << 16) \
120 |(((unsigned long)(devfn)) << 8) \
121 |(((unsigned long)(off)) & 0xFCUL) \
122 |1UL)
123
124static unsigned long __pmac macrisc_cfg_access(struct pci_controller* hose,
125 u8 bus, u8 dev_fn, u8 offset)
126{
127 unsigned int caddr;
128
129 if (bus == hose->first_busno) {
130 if (dev_fn < (11 << 3))
131 return 0;
132 caddr = MACRISC_CFA0(dev_fn, offset);
133 } else
134 caddr = MACRISC_CFA1(bus, dev_fn, offset);
135
136 /* Uninorth will return garbage if we don't read back the value ! */
137 do {
138 out_le32(hose->cfg_addr, caddr);
139 } while (in_le32(hose->cfg_addr) != caddr);
140
141 offset &= has_uninorth ? 0x07 : 0x03;
142 return ((unsigned long)hose->cfg_data) + offset;
143}
144
145static int __pmac macrisc_read_config(struct pci_bus *bus, unsigned int devfn,
146 int offset, int len, u32 *val)
147{
148 struct pci_controller *hose;
149 unsigned long addr;
150
151 hose = pci_bus_to_host(bus);
152 if (hose == NULL)
153 return PCIBIOS_DEVICE_NOT_FOUND;
154
155 addr = macrisc_cfg_access(hose, bus->number, devfn, offset);
156 if (!addr)
157 return PCIBIOS_DEVICE_NOT_FOUND;
158 /*
159 * Note: the caller has already checked that offset is
160 * suitably aligned and that len is 1, 2 or 4.
161 */
162 switch (len) {
163 case 1:
164 *val = in_8((u8 *)addr);
165 break;
166 case 2:
167 *val = in_le16((u16 *)addr);
168 break;
169 default:
170 *val = in_le32((u32 *)addr);
171 break;
172 }
173 return PCIBIOS_SUCCESSFUL;
174}
175
176static int __pmac macrisc_write_config(struct pci_bus *bus, unsigned int devfn,
177 int offset, int len, u32 val)
178{
179 struct pci_controller *hose;
180 unsigned long addr;
181
182 hose = pci_bus_to_host(bus);
183 if (hose == NULL)
184 return PCIBIOS_DEVICE_NOT_FOUND;
185
186 addr = macrisc_cfg_access(hose, bus->number, devfn, offset);
187 if (!addr)
188 return PCIBIOS_DEVICE_NOT_FOUND;
189 /*
190 * Note: the caller has already checked that offset is
191 * suitably aligned and that len is 1, 2 or 4.
192 */
193 switch (len) {
194 case 1:
195 out_8((u8 *)addr, val);
196 (void) in_8((u8 *)addr);
197 break;
198 case 2:
199 out_le16((u16 *)addr, val);
200 (void) in_le16((u16 *)addr);
201 break;
202 default:
203 out_le32((u32 *)addr, val);
204 (void) in_le32((u32 *)addr);
205 break;
206 }
207 return PCIBIOS_SUCCESSFUL;
208}
209
210static struct pci_ops macrisc_pci_ops =
211{
212 macrisc_read_config,
213 macrisc_write_config
214};
215
216/*
217 * These versions of U3 HyperTransport config space access ops do not
218 * implement self-view of the HT host yet
219 */
220
221/*
222 * This function deals with some "special cases" devices.
223 *
224 * 0 -> No special case
225 * 1 -> Skip the device but act as if the access was successfull
226 * (return 0xff's on reads, eventually, cache config space
227 * accesses in a later version)
228 * -1 -> Hide the device (unsuccessful acess)
229 */
230static int u3_ht_skip_device(struct pci_controller *hose,
231 struct pci_bus *bus, unsigned int devfn)
232{
233 struct device_node *busdn, *dn;
234 int i;
235
236 /* We only allow config cycles to devices that are in OF device-tree
237 * as we are apparently having some weird things going on with some
238 * revs of K2 on recent G5s
239 */
240 if (bus->self)
241 busdn = pci_device_to_OF_node(bus->self);
242 else
243 busdn = hose->arch_data;
244 for (dn = busdn->child; dn; dn = dn->sibling)
245 if (dn->data && PCI_DN(dn)->devfn == devfn)
246 break;
247 if (dn == NULL)
248 return -1;
249
250 /*
251 * When a device in K2 is powered down, we die on config
252 * cycle accesses. Fix that here.
253 */
254 for (i=0; i<2; i++)
255 if (k2_skiplist[i] == dn)
256 return 1;
257
258 return 0;
259}
260
261#define U3_HT_CFA0(devfn, off) \
262 ((((unsigned long)devfn) << 8) | offset)
263#define U3_HT_CFA1(bus, devfn, off) \
264 (U3_HT_CFA0(devfn, off) \
265 + (((unsigned long)bus) << 16) \
266 + 0x01000000UL)
267
268static unsigned long __pmac u3_ht_cfg_access(struct pci_controller* hose,
269 u8 bus, u8 devfn, u8 offset)
270{
271 if (bus == hose->first_busno) {
272 /* For now, we don't self probe U3 HT bridge */
273 if (PCI_SLOT(devfn) == 0)
274 return 0;
275 return ((unsigned long)hose->cfg_data) + U3_HT_CFA0(devfn, offset);
276 } else
277 return ((unsigned long)hose->cfg_data) + U3_HT_CFA1(bus, devfn, offset);
278}
279
280static int __pmac u3_ht_read_config(struct pci_bus *bus, unsigned int devfn,
281 int offset, int len, u32 *val)
282{
283 struct pci_controller *hose;
284 unsigned long addr;
285
286
287 hose = pci_bus_to_host(bus);
288 if (hose == NULL)
289 return PCIBIOS_DEVICE_NOT_FOUND;
290
291 addr = u3_ht_cfg_access(hose, bus->number, devfn, offset);
292 if (!addr)
293 return PCIBIOS_DEVICE_NOT_FOUND;
294
295 switch (u3_ht_skip_device(hose, bus, devfn)) {
296 case 0:
297 break;
298 case 1:
299 switch (len) {
300 case 1:
301 *val = 0xff; break;
302 case 2:
303 *val = 0xffff; break;
304 default:
305 *val = 0xfffffffful; break;
306 }
307 return PCIBIOS_SUCCESSFUL;
308 default:
309 return PCIBIOS_DEVICE_NOT_FOUND;
310 }
311
312 /*
313 * Note: the caller has already checked that offset is
314 * suitably aligned and that len is 1, 2 or 4.
315 */
316 switch (len) {
317 case 1:
318 *val = in_8((u8 *)addr);
319 break;
320 case 2:
321 *val = in_le16((u16 *)addr);
322 break;
323 default:
324 *val = in_le32((u32 *)addr);
325 break;
326 }
327 return PCIBIOS_SUCCESSFUL;
328}
329
330static int __pmac u3_ht_write_config(struct pci_bus *bus, unsigned int devfn,
331 int offset, int len, u32 val)
332{
333 struct pci_controller *hose;
334 unsigned long addr;
335
336 hose = pci_bus_to_host(bus);
337 if (hose == NULL)
338 return PCIBIOS_DEVICE_NOT_FOUND;
339
340 addr = u3_ht_cfg_access(hose, bus->number, devfn, offset);
341 if (!addr)
342 return PCIBIOS_DEVICE_NOT_FOUND;
343
344 switch (u3_ht_skip_device(hose, bus, devfn)) {
345 case 0:
346 break;
347 case 1:
348 return PCIBIOS_SUCCESSFUL;
349 default:
350 return PCIBIOS_DEVICE_NOT_FOUND;
351 }
352
353 /*
354 * Note: the caller has already checked that offset is
355 * suitably aligned and that len is 1, 2 or 4.
356 */
357 switch (len) {
358 case 1:
359 out_8((u8 *)addr, val);
360 (void) in_8((u8 *)addr);
361 break;
362 case 2:
363 out_le16((u16 *)addr, val);
364 (void) in_le16((u16 *)addr);
365 break;
366 default:
367 out_le32((u32 *)addr, val);
368 (void) in_le32((u32 *)addr);
369 break;
370 }
371 return PCIBIOS_SUCCESSFUL;
372}
373
374static struct pci_ops u3_ht_pci_ops =
375{
376 u3_ht_read_config,
377 u3_ht_write_config
378};
379
380static void __init setup_u3_agp(struct pci_controller* hose)
381{
382 /* On G5, we move AGP up to high bus number so we don't need
383 * to reassign bus numbers for HT. If we ever have P2P bridges
384 * on AGP, we'll have to move pci_assign_all_busses to the
385 * pci_controller structure so we enable it for AGP and not for
386 * HT childs.
387 * We hard code the address because of the different size of
388 * the reg address cell, we shall fix that by killing struct
389 * reg_property and using some accessor functions instead
390 */
391 hose->first_busno = 0xf0;
392 hose->last_busno = 0xff;
393 has_uninorth = 1;
394 hose->ops = &macrisc_pci_ops;
395 hose->cfg_addr = ioremap(0xf0000000 + 0x800000, 0x1000);
396 hose->cfg_data = ioremap(0xf0000000 + 0xc00000, 0x1000);
397
398 u3_agp = hose;
399}
400
401static void __init setup_u3_ht(struct pci_controller* hose)
402{
403 struct device_node *np = (struct device_node *)hose->arch_data;
404 int i, cur;
405
406 hose->ops = &u3_ht_pci_ops;
407
408 /* We hard code the address because of the different size of
409 * the reg address cell, we shall fix that by killing struct
410 * reg_property and using some accessor functions instead
411 */
412 hose->cfg_data = (volatile unsigned char *)ioremap(0xf2000000, 0x02000000);
413
414 /*
415 * /ht node doesn't expose a "ranges" property, so we "remove" regions that
416 * have been allocated to AGP. So far, this version of the code doesn't assign
417 * any of the 0xfxxxxxxx "fine" memory regions to /ht.
418 * We need to fix that sooner or later by either parsing all child "ranges"
419 * properties or figuring out the U3 address space decoding logic and
420 * then read it's configuration register (if any).
421 */
422 hose->io_base_phys = 0xf4000000;
423 hose->io_base_virt = ioremap(hose->io_base_phys, 0x00400000);
424 isa_io_base = pci_io_base = (unsigned long) hose->io_base_virt;
425 hose->io_resource.name = np->full_name;
426 hose->io_resource.start = 0;
427 hose->io_resource.end = 0x003fffff;
428 hose->io_resource.flags = IORESOURCE_IO;
429 hose->pci_mem_offset = 0;
430 hose->first_busno = 0;
431 hose->last_busno = 0xef;
432 hose->mem_resources[0].name = np->full_name;
433 hose->mem_resources[0].start = 0x80000000;
434 hose->mem_resources[0].end = 0xefffffff;
435 hose->mem_resources[0].flags = IORESOURCE_MEM;
436
437 if (u3_agp == NULL) {
438 DBG("U3 has no AGP, using full resource range\n");
439 return;
440 }
441
442 /* We "remove" the AGP resources from the resources allocated to HT, that
443 * is we create "holes". However, that code does assumptions that so far
444 * happen to be true (cross fingers...), typically that resources in the
445 * AGP node are properly ordered
446 */
447 cur = 0;
448 for (i=0; i<3; i++) {
449 struct resource *res = &u3_agp->mem_resources[i];
450 if (res->flags != IORESOURCE_MEM)
451 continue;
452 /* We don't care about "fine" resources */
453 if (res->start >= 0xf0000000)
454 continue;
455 /* Check if it's just a matter of "shrinking" us in one direction */
456 if (hose->mem_resources[cur].start == res->start) {
457 DBG("U3/HT: shrink start of %d, %08lx -> %08lx\n",
458 cur, hose->mem_resources[cur].start, res->end + 1);
459 hose->mem_resources[cur].start = res->end + 1;
460 continue;
461 }
462 if (hose->mem_resources[cur].end == res->end) {
463 DBG("U3/HT: shrink end of %d, %08lx -> %08lx\n",
464 cur, hose->mem_resources[cur].end, res->start - 1);
465 hose->mem_resources[cur].end = res->start - 1;
466 continue;
467 }
468 /* No, it's not the case, we need a hole */
469 if (cur == 2) {
470 /* not enough resources for a hole, we drop part of the range */
471 printk(KERN_WARNING "Running out of resources for /ht host !\n");
472 hose->mem_resources[cur].end = res->start - 1;
473 continue;
474 }
475 cur++;
476 DBG("U3/HT: hole, %d end at %08lx, %d start at %08lx\n",
477 cur-1, res->start - 1, cur, res->end + 1);
478 hose->mem_resources[cur].name = np->full_name;
479 hose->mem_resources[cur].flags = IORESOURCE_MEM;
480 hose->mem_resources[cur].start = res->end + 1;
481 hose->mem_resources[cur].end = hose->mem_resources[cur-1].end;
482 hose->mem_resources[cur-1].end = res->start - 1;
483 }
484}
485
486static void __init pmac_process_bridge_OF_ranges(struct pci_controller *hose,
487 struct device_node *dev, int primary)
488{
489 static unsigned int static_lc_ranges[2024];
490 unsigned int *dt_ranges, *lc_ranges, *ranges, *prev;
491 unsigned int size;
492 int rlen = 0, orig_rlen;
493 int memno = 0;
494 struct resource *res;
495 int np, na = prom_n_addr_cells(dev);
496
497 np = na + 5;
498
499 /* First we try to merge ranges to fix a problem with some pmacs
500 * that can have more than 3 ranges, fortunately using contiguous
501 * addresses -- BenH
502 */
503 dt_ranges = (unsigned int *) get_property(dev, "ranges", &rlen);
504 if (!dt_ranges)
505 return;
506 /* lc_ranges = alloc_bootmem(rlen);*/
507 lc_ranges = static_lc_ranges;
508 if (!lc_ranges)
509 return; /* what can we do here ? */
510 memcpy(lc_ranges, dt_ranges, rlen);
511 orig_rlen = rlen;
512
513 /* Let's work on a copy of the "ranges" property instead of damaging
514 * the device-tree image in memory
515 */
516 ranges = lc_ranges;
517 prev = NULL;
518 while ((rlen -= np * sizeof(unsigned int)) >= 0) {
519 if (prev) {
520 if (prev[0] == ranges[0] && prev[1] == ranges[1] &&
521 (prev[2] + prev[na+4]) == ranges[2] &&
522 (prev[na+2] + prev[na+4]) == ranges[na+2]) {
523 prev[na+4] += ranges[na+4];
524 ranges[0] = 0;
525 ranges += np;
526 continue;
527 }
528 }
529 prev = ranges;
530 ranges += np;
531 }
532
533 /*
534 * The ranges property is laid out as an array of elements,
535 * each of which comprises:
536 * cells 0 - 2: a PCI address
537 * cells 3 or 3+4: a CPU physical address
538 * (size depending on dev->n_addr_cells)
539 * cells 4+5 or 5+6: the size of the range
540 */
541 ranges = lc_ranges;
542 rlen = orig_rlen;
543 while (ranges && (rlen -= np * sizeof(unsigned int)) >= 0) {
544 res = NULL;
545 size = ranges[na+4];
546 switch (ranges[0] >> 24) {
547 case 1: /* I/O space */
548 if (ranges[2] != 0)
549 break;
550 hose->io_base_phys = ranges[na+2];
551 /* limit I/O space to 16MB */
552 if (size > 0x01000000)
553 size = 0x01000000;
554 hose->io_base_virt = ioremap(ranges[na+2], size);
555 if (primary)
556 isa_io_base = (unsigned long) hose->io_base_virt;
557 res = &hose->io_resource;
558 res->flags = IORESOURCE_IO;
559 res->start = ranges[2];
560 break;
561 case 2: /* memory space */
562 memno = 0;
563 if (ranges[1] == 0 && ranges[2] == 0
564 && ranges[na+4] <= (16 << 20)) {
565 /* 1st 16MB, i.e. ISA memory area */
566#if 0
567 if (primary)
568 isa_mem_base = ranges[na+2];
569#endif
570 memno = 1;
571 }
572 while (memno < 3 && hose->mem_resources[memno].flags)
573 ++memno;
574 if (memno == 0)
575 hose->pci_mem_offset = ranges[na+2] - ranges[2];
576 if (memno < 3) {
577 res = &hose->mem_resources[memno];
578 res->flags = IORESOURCE_MEM;
579 res->start = ranges[na+2];
580 }
581 break;
582 }
583 if (res != NULL) {
584 res->name = dev->full_name;
585 res->end = res->start + size - 1;
586 res->parent = NULL;
587 res->sibling = NULL;
588 res->child = NULL;
589 }
590 ranges += np;
591 }
592}
593
594/*
595 * We assume that if we have a G3 powermac, we have one bridge called
596 * "pci" (a MPC106) and no bandit or chaos bridges, and contrariwise,
597 * if we have one or more bandit or chaos bridges, we don't have a MPC106.
598 */
599static int __init add_bridge(struct device_node *dev)
600{
601 int len;
602 struct pci_controller *hose;
603 char* disp_name;
604 int *bus_range;
605 int primary = 1;
606 struct property *of_prop;
607
608 DBG("Adding PCI host bridge %s\n", dev->full_name);
609
610 bus_range = (int *) get_property(dev, "bus-range", &len);
611 if (bus_range == NULL || len < 2 * sizeof(int)) {
612 printk(KERN_WARNING "Can't get bus-range for %s, assume bus 0\n",
613 dev->full_name);
614 }
615
616 hose = alloc_bootmem(sizeof(struct pci_controller));
617 if (hose == NULL)
618 return -ENOMEM;
619 pci_setup_pci_controller(hose);
620
621 hose->arch_data = dev;
622 hose->first_busno = bus_range ? bus_range[0] : 0;
623 hose->last_busno = bus_range ? bus_range[1] : 0xff;
624
625 of_prop = alloc_bootmem(sizeof(struct property) +
626 sizeof(hose->global_number));
627 if (of_prop) {
628 memset(of_prop, 0, sizeof(struct property));
629 of_prop->name = "linux,pci-domain";
630 of_prop->length = sizeof(hose->global_number);
631 of_prop->value = (unsigned char *)&of_prop[1];
632 memcpy(of_prop->value, &hose->global_number, sizeof(hose->global_number));
633 prom_add_property(dev, of_prop);
634 }
635
636 disp_name = NULL;
637 if (device_is_compatible(dev, "u3-agp")) {
638 setup_u3_agp(hose);
639 disp_name = "U3-AGP";
640 primary = 0;
641 } else if (device_is_compatible(dev, "u3-ht")) {
642 setup_u3_ht(hose);
643 disp_name = "U3-HT";
644 primary = 1;
645 }
646 printk(KERN_INFO "Found %s PCI host bridge. Firmware bus number: %d->%d\n",
647 disp_name, hose->first_busno, hose->last_busno);
648
649 /* Interpret the "ranges" property */
650 /* This also maps the I/O region and sets isa_io/mem_base */
651 pmac_process_bridge_OF_ranges(hose, dev, primary);
652
653 /* Fixup "bus-range" OF property */
654 fixup_bus_range(dev);
655
656 return 0;
657}
658
659/*
660 * We use our own read_irq_line here because PCI_INTERRUPT_PIN is
661 * crap on some of Apple ASICs. We unconditionally use the Open Firmware
662 * interrupt number as this is always right.
663 */
664static int pmac_pci_read_irq_line(struct pci_dev *pci_dev)
665{
666 struct device_node *node;
667
668 node = pci_device_to_OF_node(pci_dev);
669 if (node == NULL)
670 return -1;
671 if (node->n_intrs == 0)
672 return -1;
673 pci_dev->irq = node->intrs[0].line;
674 pci_write_config_byte(pci_dev, PCI_INTERRUPT_LINE, pci_dev->irq);
675
676 return 0;
677}
678
679void __init pmac_pcibios_fixup(void)
680{
681 struct pci_dev *dev = NULL;
682
683 for_each_pci_dev(dev)
684 pmac_pci_read_irq_line(dev);
685}
686
687static void __init pmac_fixup_phb_resources(void)
688{
689 struct pci_controller *hose, *tmp;
690
691 list_for_each_entry_safe(hose, tmp, &hose_list, list_node) {
692 unsigned long offset = (unsigned long)hose->io_base_virt - pci_io_base;
693 hose->io_resource.start += offset;
694 hose->io_resource.end += offset;
695 printk(KERN_INFO "PCI Host %d, io start: %lx; io end: %lx\n",
696 hose->global_number,
697 hose->io_resource.start, hose->io_resource.end);
698 }
699}
700
701void __init pmac_pci_init(void)
702{
703 struct device_node *np, *root;
704 struct device_node *ht = NULL;
705
706 /* Probe root PCI hosts, that is on U3 the AGP host and the
707 * HyperTransport host. That one is actually "kept" around
708 * and actually added last as it's resource management relies
709 * on the AGP resources to have been setup first
710 */
711 root = of_find_node_by_path("/");
712 if (root == NULL) {
713 printk(KERN_CRIT "pmac_find_bridges: can't find root of device tree\n");
714 return;
715 }
716 for (np = NULL; (np = of_get_next_child(root, np)) != NULL;) {
717 if (np->name == NULL)
718 continue;
719 if (strcmp(np->name, "pci") == 0) {
720 if (add_bridge(np) == 0)
721 of_node_get(np);
722 }
723 if (strcmp(np->name, "ht") == 0) {
724 of_node_get(np);
725 ht = np;
726 }
727 }
728 of_node_put(root);
729
730 /* Now setup the HyperTransport host if we found any
731 */
732 if (ht && add_bridge(ht) != 0)
733 of_node_put(ht);
734
735 /* Fixup the IO resources on our host bridges as the common code
736 * does it only for childs of the host bridges
737 */
738 pmac_fixup_phb_resources();
739
740 /* Setup the linkage between OF nodes and PHBs */
741 pci_devs_phb_init();
742
743 /* Fixup the PCI<->OF mapping for U3 AGP due to bus renumbering. We
744 * assume there is no P2P bridge on the AGP bus, which should be a
745 * safe assumptions hopefully.
746 */
747 if (u3_agp) {
748 struct device_node *np = u3_agp->arch_data;
749 PCI_DN(np)->busno = 0xf0;
750 for (np = np->child; np; np = np->sibling)
751 PCI_DN(np)->busno = 0xf0;
752 }
753
754 pmac_check_ht_link();
755
756 /* Tell pci.c to not use the common resource allocation mecanism */
757 pci_probe_only = 1;
758
759 /* Allow all IO */
760 io_page_mask = -1;
761}
762
763/*
764 * Disable second function on K2-SATA, it's broken
765 * and disable IO BARs on first one
766 */
767static void fixup_k2_sata(struct pci_dev* dev)
768{
769 int i;
770 u16 cmd;
771
772 if (PCI_FUNC(dev->devfn) > 0) {
773 pci_read_config_word(dev, PCI_COMMAND, &cmd);
774 cmd &= ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY);
775 pci_write_config_word(dev, PCI_COMMAND, cmd);
776 for (i = 0; i < 6; i++) {
777 dev->resource[i].start = dev->resource[i].end = 0;
778 dev->resource[i].flags = 0;
779 pci_write_config_dword(dev, PCI_BASE_ADDRESS_0 + 4 * i, 0);
780 }
781 } else {
782 pci_read_config_word(dev, PCI_COMMAND, &cmd);
783 cmd &= ~PCI_COMMAND_IO;
784 pci_write_config_word(dev, PCI_COMMAND, cmd);
785 for (i = 0; i < 5; i++) {
786 dev->resource[i].start = dev->resource[i].end = 0;
787 dev->resource[i].flags = 0;
788 pci_write_config_dword(dev, PCI_BASE_ADDRESS_0 + 4 * i, 0);
789 }
790 }
791}
792DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SERVERWORKS, 0x0240, fixup_k2_sata);
793
diff --git a/arch/ppc64/kernel/pmac_setup.c b/arch/ppc64/kernel/pmac_setup.c
deleted file mode 100644
index fa8121d53b89..000000000000
--- a/arch/ppc64/kernel/pmac_setup.c
+++ /dev/null
@@ -1,525 +0,0 @@
1/*
2 * arch/ppc/platforms/setup.c
3 *
4 * PowerPC version
5 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
6 *
7 * Adapted for Power Macintosh by Paul Mackerras
8 * Copyright (C) 1996 Paul Mackerras (paulus@cs.anu.edu.au)
9 *
10 * Derived from "arch/alpha/kernel/setup.c"
11 * Copyright (C) 1995 Linus Torvalds
12 *
13 * Maintained by Benjamin Herrenschmidt (benh@kernel.crashing.org)
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version
18 * 2 of the License, or (at your option) any later version.
19 *
20 */
21
22/*
23 * bootup setup stuff..
24 */
25
26#undef DEBUG
27
28#include <linux/config.h>
29#include <linux/init.h>
30#include <linux/errno.h>
31#include <linux/sched.h>
32#include <linux/kernel.h>
33#include <linux/mm.h>
34#include <linux/stddef.h>
35#include <linux/unistd.h>
36#include <linux/ptrace.h>
37#include <linux/slab.h>
38#include <linux/user.h>
39#include <linux/a.out.h>
40#include <linux/tty.h>
41#include <linux/string.h>
42#include <linux/delay.h>
43#include <linux/ioport.h>
44#include <linux/major.h>
45#include <linux/initrd.h>
46#include <linux/vt_kern.h>
47#include <linux/console.h>
48#include <linux/ide.h>
49#include <linux/pci.h>
50#include <linux/adb.h>
51#include <linux/cuda.h>
52#include <linux/pmu.h>
53#include <linux/irq.h>
54#include <linux/seq_file.h>
55#include <linux/root_dev.h>
56#include <linux/bitops.h>
57
58#include <asm/processor.h>
59#include <asm/sections.h>
60#include <asm/prom.h>
61#include <asm/system.h>
62#include <asm/io.h>
63#include <asm/pci-bridge.h>
64#include <asm/iommu.h>
65#include <asm/machdep.h>
66#include <asm/dma.h>
67#include <asm/btext.h>
68#include <asm/cputable.h>
69#include <asm/pmac_feature.h>
70#include <asm/time.h>
71#include <asm/of_device.h>
72#include <asm/lmb.h>
73#include <asm/smu.h>
74#include <asm/pmc.h>
75
76#include "pmac.h"
77#include "mpic.h"
78
79#ifdef DEBUG
80#define DBG(fmt...) udbg_printf(fmt)
81#else
82#define DBG(fmt...)
83#endif
84
85static int current_root_goodness = -1;
86#define DEFAULT_ROOT_DEVICE Root_SDA1 /* sda1 - slightly silly choice */
87
88extern int powersave_nap;
89int sccdbg;
90
91sys_ctrler_t sys_ctrler;
92EXPORT_SYMBOL(sys_ctrler);
93
94#ifdef CONFIG_PMAC_SMU
95unsigned long smu_cmdbuf_abs;
96EXPORT_SYMBOL(smu_cmdbuf_abs);
97#endif
98
99extern void udbg_init_scc(struct device_node *np);
100
101static void __pmac pmac_show_cpuinfo(struct seq_file *m)
102{
103 struct device_node *np;
104 char *pp;
105 int plen;
106 char* mbname;
107 int mbmodel = pmac_call_feature(PMAC_FTR_GET_MB_INFO, NULL,
108 PMAC_MB_INFO_MODEL, 0);
109 unsigned int mbflags = pmac_call_feature(PMAC_FTR_GET_MB_INFO, NULL,
110 PMAC_MB_INFO_FLAGS, 0);
111
112 if (pmac_call_feature(PMAC_FTR_GET_MB_INFO, NULL, PMAC_MB_INFO_NAME,
113 (long)&mbname) != 0)
114 mbname = "Unknown";
115
116 /* find motherboard type */
117 seq_printf(m, "machine\t\t: ");
118 np = of_find_node_by_path("/");
119 if (np != NULL) {
120 pp = (char *) get_property(np, "model", NULL);
121 if (pp != NULL)
122 seq_printf(m, "%s\n", pp);
123 else
124 seq_printf(m, "PowerMac\n");
125 pp = (char *) get_property(np, "compatible", &plen);
126 if (pp != NULL) {
127 seq_printf(m, "motherboard\t:");
128 while (plen > 0) {
129 int l = strlen(pp) + 1;
130 seq_printf(m, " %s", pp);
131 plen -= l;
132 pp += l;
133 }
134 seq_printf(m, "\n");
135 }
136 of_node_put(np);
137 } else
138 seq_printf(m, "PowerMac\n");
139
140 /* print parsed model */
141 seq_printf(m, "detected as\t: %d (%s)\n", mbmodel, mbname);
142 seq_printf(m, "pmac flags\t: %08x\n", mbflags);
143
144 /* Indicate newworld */
145 seq_printf(m, "pmac-generation\t: NewWorld\n");
146}
147
148
149static void __init pmac_setup_arch(void)
150{
151 /* init to some ~sane value until calibrate_delay() runs */
152 loops_per_jiffy = 50000000;
153
154 /* Probe motherboard chipset */
155 pmac_feature_init();
156#if 0
157 /* Lock-enable the SCC channel used for debug */
158 if (sccdbg) {
159 np = of_find_node_by_name(NULL, "escc");
160 if (np)
161 pmac_call_feature(PMAC_FTR_SCC_ENABLE, np,
162 PMAC_SCC_ASYNC | PMAC_SCC_FLAG_XMON, 1);
163 }
164#endif
165 /* We can NAP */
166 powersave_nap = 1;
167
168#ifdef CONFIG_ADB_PMU
169 /* Initialize the PMU if any */
170 find_via_pmu();
171#endif
172#ifdef CONFIG_PMAC_SMU
173 /* Initialize the SMU if any */
174 smu_init();
175#endif
176
177 /* Init NVRAM access */
178 pmac_nvram_init();
179
180 /* Setup SMP callback */
181#ifdef CONFIG_SMP
182 pmac_setup_smp();
183#endif
184
185 /* Lookup PCI hosts */
186 pmac_pci_init();
187
188#ifdef CONFIG_DUMMY_CONSOLE
189 conswitchp = &dummy_con;
190#endif
191
192 printk(KERN_INFO "Using native/NAP idle loop\n");
193}
194
195#ifdef CONFIG_SCSI
196void note_scsi_host(struct device_node *node, void *host)
197{
198 /* Obsolete */
199}
200#endif
201
202
203static int initializing = 1;
204
205static int pmac_late_init(void)
206{
207 initializing = 0;
208 return 0;
209}
210
211late_initcall(pmac_late_init);
212
213/* can't be __init - can be called whenever a disk is first accessed */
214void __pmac note_bootable_part(dev_t dev, int part, int goodness)
215{
216 extern dev_t boot_dev;
217 char *p;
218
219 if (!initializing)
220 return;
221 if ((goodness <= current_root_goodness) &&
222 ROOT_DEV != DEFAULT_ROOT_DEVICE)
223 return;
224 p = strstr(saved_command_line, "root=");
225 if (p != NULL && (p == saved_command_line || p[-1] == ' '))
226 return;
227
228 if (!boot_dev || dev == boot_dev) {
229 ROOT_DEV = dev + part;
230 boot_dev = 0;
231 current_root_goodness = goodness;
232 }
233}
234
235static void __pmac pmac_restart(char *cmd)
236{
237 switch(sys_ctrler) {
238#ifdef CONFIG_ADB_PMU
239 case SYS_CTRLER_PMU:
240 pmu_restart();
241 break;
242#endif
243
244#ifdef CONFIG_PMAC_SMU
245 case SYS_CTRLER_SMU:
246 smu_restart();
247 break;
248#endif
249 default:
250 ;
251 }
252}
253
254static void __pmac pmac_power_off(void)
255{
256 switch(sys_ctrler) {
257#ifdef CONFIG_ADB_PMU
258 case SYS_CTRLER_PMU:
259 pmu_shutdown();
260 break;
261#endif
262#ifdef CONFIG_PMAC_SMU
263 case SYS_CTRLER_SMU:
264 smu_shutdown();
265 break;
266#endif
267 default:
268 ;
269 }
270}
271
272static void __pmac pmac_halt(void)
273{
274 pmac_power_off();
275}
276
277#ifdef CONFIG_BOOTX_TEXT
278static void btext_putc(unsigned char c)
279{
280 btext_drawchar(c);
281}
282
283static void __init init_boot_display(void)
284{
285 char *name;
286 struct device_node *np = NULL;
287 int rc = -ENODEV;
288
289 printk("trying to initialize btext ...\n");
290
291 name = (char *)get_property(of_chosen, "linux,stdout-path", NULL);
292 if (name != NULL) {
293 np = of_find_node_by_path(name);
294 if (np != NULL) {
295 if (strcmp(np->type, "display") != 0) {
296 printk("boot stdout isn't a display !\n");
297 of_node_put(np);
298 np = NULL;
299 }
300 }
301 }
302 if (np)
303 rc = btext_initialize(np);
304 if (rc == 0)
305 return;
306
307 for (np = NULL; (np = of_find_node_by_type(np, "display"));) {
308 if (get_property(np, "linux,opened", NULL)) {
309 printk("trying %s ...\n", np->full_name);
310 rc = btext_initialize(np);
311 printk("result: %d\n", rc);
312 }
313 if (rc == 0)
314 return;
315 }
316}
317#endif /* CONFIG_BOOTX_TEXT */
318
319/*
320 * Early initialization.
321 */
322static void __init pmac_init_early(void)
323{
324 DBG(" -> pmac_init_early\n");
325
326 /* Initialize hash table, from now on, we can take hash faults
327 * and call ioremap
328 */
329 hpte_init_native();
330
331 /* Init SCC */
332 if (strstr(cmd_line, "sccdbg")) {
333 sccdbg = 1;
334 udbg_init_scc(NULL);
335 }
336#ifdef CONFIG_BOOTX_TEXT
337 else {
338 init_boot_display();
339
340 udbg_putc = btext_putc;
341 }
342#endif /* CONFIG_BOOTX_TEXT */
343
344 /* Setup interrupt mapping options */
345 ppc64_interrupt_controller = IC_OPEN_PIC;
346
347 iommu_init_early_u3();
348
349 DBG(" <- pmac_init_early\n");
350}
351
352static int pmac_u3_cascade(struct pt_regs *regs, void *data)
353{
354 return mpic_get_one_irq((struct mpic *)data, regs);
355}
356
357static __init void pmac_init_IRQ(void)
358{
359 struct device_node *irqctrler = NULL;
360 struct device_node *irqctrler2 = NULL;
361 struct device_node *np = NULL;
362 struct mpic *mpic1, *mpic2;
363
364 /* We first try to detect Apple's new Core99 chipset, since mac-io
365 * is quite different on those machines and contains an IBM MPIC2.
366 */
367 while ((np = of_find_node_by_type(np, "open-pic")) != NULL) {
368 struct device_node *parent = of_get_parent(np);
369 if (parent && !strcmp(parent->name, "u3"))
370 irqctrler2 = of_node_get(np);
371 else
372 irqctrler = of_node_get(np);
373 of_node_put(parent);
374 }
375 if (irqctrler != NULL && irqctrler->n_addrs > 0) {
376 unsigned char senses[128];
377
378 printk(KERN_INFO "PowerMac using OpenPIC irq controller at 0x%08x\n",
379 (unsigned int)irqctrler->addrs[0].address);
380
381 prom_get_irq_senses(senses, 0, 128);
382 mpic1 = mpic_alloc(irqctrler->addrs[0].address,
383 MPIC_PRIMARY | MPIC_WANTS_RESET,
384 0, 0, 128, 256, senses, 128, " K2-MPIC ");
385 BUG_ON(mpic1 == NULL);
386 mpic_init(mpic1);
387
388 if (irqctrler2 != NULL && irqctrler2->n_intrs > 0 &&
389 irqctrler2->n_addrs > 0) {
390 printk(KERN_INFO "Slave OpenPIC at 0x%08x hooked on IRQ %d\n",
391 (u32)irqctrler2->addrs[0].address,
392 irqctrler2->intrs[0].line);
393
394 pmac_call_feature(PMAC_FTR_ENABLE_MPIC, irqctrler2, 0, 0);
395 prom_get_irq_senses(senses, 128, 128 + 128);
396
397 /* We don't need to set MPIC_BROKEN_U3 here since we don't have
398 * hypertransport interrupts routed to it
399 */
400 mpic2 = mpic_alloc(irqctrler2->addrs[0].address,
401 MPIC_BIG_ENDIAN | MPIC_WANTS_RESET,
402 0, 128, 128, 0, senses, 128, " U3-MPIC ");
403 BUG_ON(mpic2 == NULL);
404 mpic_init(mpic2);
405 mpic_setup_cascade(irqctrler2->intrs[0].line,
406 pmac_u3_cascade, mpic2);
407 }
408 }
409 of_node_put(irqctrler);
410 of_node_put(irqctrler2);
411}
412
413static void __init pmac_progress(char *s, unsigned short hex)
414{
415 if (sccdbg) {
416 udbg_puts(s);
417 udbg_puts("\n");
418 }
419#ifdef CONFIG_BOOTX_TEXT
420 else if (boot_text_mapped) {
421 btext_drawstring(s);
422 btext_drawstring("\n");
423 }
424#endif /* CONFIG_BOOTX_TEXT */
425}
426
427/*
428 * pmac has no legacy IO, anything calling this function has to
429 * fail or bad things will happen
430 */
431static int pmac_check_legacy_ioport(unsigned int baseport)
432{
433 return -ENODEV;
434}
435
436static int __init pmac_declare_of_platform_devices(void)
437{
438 struct device_node *np, *npp;
439
440 npp = of_find_node_by_name(NULL, "u3");
441 if (npp) {
442 for (np = NULL; (np = of_get_next_child(npp, np)) != NULL;) {
443 if (strncmp(np->name, "i2c", 3) == 0) {
444 of_platform_device_create(np, "u3-i2c", NULL);
445 of_node_put(np);
446 break;
447 }
448 }
449 of_node_put(npp);
450 }
451 npp = of_find_node_by_type(NULL, "smu");
452 if (npp) {
453 of_platform_device_create(npp, "smu", NULL);
454 of_node_put(npp);
455 }
456
457 return 0;
458}
459
460device_initcall(pmac_declare_of_platform_devices);
461
462/*
463 * Called very early, MMU is off, device-tree isn't unflattened
464 */
465static int __init pmac_probe(int platform)
466{
467 if (platform != PLATFORM_POWERMAC)
468 return 0;
469 /*
470 * On U3, the DART (iommu) must be allocated now since it
471 * has an impact on htab_initialize (due to the large page it
472 * occupies having to be broken up so the DART itself is not
473 * part of the cacheable linar mapping
474 */
475 alloc_u3_dart_table();
476
477#ifdef CONFIG_PMAC_SMU
478 /*
479 * SMU based G5s need some memory below 2Gb, at least the current
480 * driver needs that. We have to allocate it now. We allocate 4k
481 * (1 small page) for now.
482 */
483 smu_cmdbuf_abs = lmb_alloc_base(4096, 4096, 0x80000000UL);
484#endif /* CONFIG_PMAC_SMU */
485
486 return 1;
487}
488
489static int pmac_probe_mode(struct pci_bus *bus)
490{
491 struct device_node *node = bus->sysdata;
492
493 /* We need to use normal PCI probing for the AGP bus,
494 since the device for the AGP bridge isn't in the tree. */
495 if (bus->self == NULL && device_is_compatible(node, "u3-agp"))
496 return PCI_PROBE_NORMAL;
497
498 return PCI_PROBE_DEVTREE;
499}
500
501struct machdep_calls __initdata pmac_md = {
502#ifdef CONFIG_HOTPLUG_CPU
503 .cpu_die = generic_mach_cpu_die,
504#endif
505 .probe = pmac_probe,
506 .setup_arch = pmac_setup_arch,
507 .init_early = pmac_init_early,
508 .get_cpuinfo = pmac_show_cpuinfo,
509 .init_IRQ = pmac_init_IRQ,
510 .get_irq = mpic_get_irq,
511 .pcibios_fixup = pmac_pcibios_fixup,
512 .pci_probe_mode = pmac_probe_mode,
513 .restart = pmac_restart,
514 .power_off = pmac_power_off,
515 .halt = pmac_halt,
516 .get_boot_time = pmac_get_boot_time,
517 .set_rtc_time = pmac_set_rtc_time,
518 .get_rtc_time = pmac_get_rtc_time,
519 .calibrate_decr = pmac_calibrate_decr,
520 .feature_call = pmac_do_feature_call,
521 .progress = pmac_progress,
522 .check_legacy_ioport = pmac_check_legacy_ioport,
523 .idle_loop = native_idle,
524 .enable_pmcs = power4_enable_pmcs,
525};
diff --git a/arch/ppc64/kernel/pmac_smp.c b/arch/ppc64/kernel/pmac_smp.c
deleted file mode 100644
index a23de37227bf..000000000000
--- a/arch/ppc64/kernel/pmac_smp.c
+++ /dev/null
@@ -1,330 +0,0 @@
1/*
2 * SMP support for power macintosh.
3 *
4 * We support both the old "powersurge" SMP architecture
5 * and the current Core99 (G4 PowerMac) machines.
6 *
7 * Note that we don't support the very first rev. of
8 * Apple/DayStar 2 CPUs board, the one with the funky
9 * watchdog. Hopefully, none of these should be there except
10 * maybe internally to Apple. I should probably still add some
11 * code to detect this card though and disable SMP. --BenH.
12 *
13 * Support Macintosh G4 SMP by Troy Benjegerdes (hozer@drgw.net)
14 * and Ben Herrenschmidt <benh@kernel.crashing.org>.
15 *
16 * Support for DayStar quad CPU cards
17 * Copyright (C) XLR8, Inc. 1994-2000
18 *
19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License
21 * as published by the Free Software Foundation; either version
22 * 2 of the License, or (at your option) any later version.
23 */
24
25#undef DEBUG
26
27#include <linux/config.h>
28#include <linux/kernel.h>
29#include <linux/sched.h>
30#include <linux/smp.h>
31#include <linux/smp_lock.h>
32#include <linux/interrupt.h>
33#include <linux/kernel_stat.h>
34#include <linux/init.h>
35#include <linux/spinlock.h>
36#include <linux/errno.h>
37#include <linux/irq.h>
38
39#include <asm/ptrace.h>
40#include <asm/atomic.h>
41#include <asm/irq.h>
42#include <asm/page.h>
43#include <asm/pgtable.h>
44#include <asm/sections.h>
45#include <asm/io.h>
46#include <asm/prom.h>
47#include <asm/smp.h>
48#include <asm/machdep.h>
49#include <asm/pmac_feature.h>
50#include <asm/time.h>
51#include <asm/cacheflush.h>
52#include <asm/keylargo.h>
53#include <asm/pmac_low_i2c.h>
54
55#include "mpic.h"
56
57#ifdef DEBUG
58#define DBG(fmt...) udbg_printf(fmt)
59#else
60#define DBG(fmt...)
61#endif
62
63extern void pmac_secondary_start_1(void);
64extern void pmac_secondary_start_2(void);
65extern void pmac_secondary_start_3(void);
66
67extern struct smp_ops_t *smp_ops;
68
69static void (*pmac_tb_freeze)(int freeze);
70static struct device_node *pmac_tb_clock_chip_host;
71static u8 pmac_tb_pulsar_addr;
72static DEFINE_SPINLOCK(timebase_lock);
73static unsigned long timebase;
74
75static void smp_core99_cypress_tb_freeze(int freeze)
76{
77 u8 data;
78 int rc;
79
80 /* Strangely, the device-tree says address is 0xd2, but darwin
81 * accesses 0xd0 ...
82 */
83 pmac_low_i2c_setmode(pmac_tb_clock_chip_host, pmac_low_i2c_mode_combined);
84 rc = pmac_low_i2c_xfer(pmac_tb_clock_chip_host,
85 0xd0 | pmac_low_i2c_read,
86 0x81, &data, 1);
87 if (rc != 0)
88 goto bail;
89
90 data = (data & 0xf3) | (freeze ? 0x00 : 0x0c);
91
92 pmac_low_i2c_setmode(pmac_tb_clock_chip_host, pmac_low_i2c_mode_stdsub);
93 rc = pmac_low_i2c_xfer(pmac_tb_clock_chip_host,
94 0xd0 | pmac_low_i2c_write,
95 0x81, &data, 1);
96
97 bail:
98 if (rc != 0) {
99 printk("Cypress Timebase %s rc: %d\n",
100 freeze ? "freeze" : "unfreeze", rc);
101 panic("Timebase freeze failed !\n");
102 }
103}
104
105static void smp_core99_pulsar_tb_freeze(int freeze)
106{
107 u8 data;
108 int rc;
109
110 pmac_low_i2c_setmode(pmac_tb_clock_chip_host, pmac_low_i2c_mode_combined);
111 rc = pmac_low_i2c_xfer(pmac_tb_clock_chip_host,
112 pmac_tb_pulsar_addr | pmac_low_i2c_read,
113 0x2e, &data, 1);
114 if (rc != 0)
115 goto bail;
116
117 data = (data & 0x88) | (freeze ? 0x11 : 0x22);
118
119 pmac_low_i2c_setmode(pmac_tb_clock_chip_host, pmac_low_i2c_mode_stdsub);
120 rc = pmac_low_i2c_xfer(pmac_tb_clock_chip_host,
121 pmac_tb_pulsar_addr | pmac_low_i2c_write,
122 0x2e, &data, 1);
123 bail:
124 if (rc != 0) {
125 printk(KERN_ERR "Pulsar Timebase %s rc: %d\n",
126 freeze ? "freeze" : "unfreeze", rc);
127 panic("Timebase freeze failed !\n");
128 }
129}
130
131
132static void smp_core99_give_timebase(void)
133{
134 /* Open i2c bus for synchronous access */
135 if (pmac_low_i2c_open(pmac_tb_clock_chip_host, 0))
136 panic("Can't open i2c for TB sync !\n");
137
138 spin_lock(&timebase_lock);
139 (*pmac_tb_freeze)(1);
140 mb();
141 timebase = get_tb();
142 spin_unlock(&timebase_lock);
143
144 while (timebase)
145 barrier();
146
147 spin_lock(&timebase_lock);
148 (*pmac_tb_freeze)(0);
149 spin_unlock(&timebase_lock);
150
151 /* Close i2c bus */
152 pmac_low_i2c_close(pmac_tb_clock_chip_host);
153}
154
155
156static void __devinit smp_core99_take_timebase(void)
157{
158 while (!timebase)
159 barrier();
160 spin_lock(&timebase_lock);
161 set_tb(timebase >> 32, timebase & 0xffffffff);
162 timebase = 0;
163 spin_unlock(&timebase_lock);
164}
165
166
167static int __init smp_core99_probe(void)
168{
169 struct device_node *cpus;
170 struct device_node *cc;
171 int ncpus = 0;
172
173 /* Maybe use systemconfiguration here ? */
174 if (ppc_md.progress) ppc_md.progress("smp_core99_probe", 0x345);
175
176 /* Count CPUs in the device-tree */
177 for (cpus = NULL; (cpus = of_find_node_by_type(cpus, "cpu")) != NULL;)
178 ++ncpus;
179
180 printk(KERN_INFO "PowerMac SMP probe found %d cpus\n", ncpus);
181
182 /* Nothing more to do if less than 2 of them */
183 if (ncpus <= 1)
184 return 1;
185
186 /* HW sync only on these platforms */
187 if (!machine_is_compatible("PowerMac7,2") &&
188 !machine_is_compatible("PowerMac7,3") &&
189 !machine_is_compatible("RackMac3,1"))
190 goto nohwsync;
191
192 /* Look for the clock chip */
193 for (cc = NULL; (cc = of_find_node_by_name(cc, "i2c-hwclock")) != NULL;) {
194 struct device_node *p = of_get_parent(cc);
195 u32 *reg;
196 int ok;
197 ok = p && device_is_compatible(p, "uni-n-i2c");
198 if (!ok)
199 goto next;
200 reg = (u32 *)get_property(cc, "reg", NULL);
201 if (reg == NULL)
202 goto next;
203 switch (*reg) {
204 case 0xd2:
205 if (device_is_compatible(cc, "pulsar-legacy-slewing")) {
206 pmac_tb_freeze = smp_core99_pulsar_tb_freeze;
207 pmac_tb_pulsar_addr = 0xd2;
208 printk(KERN_INFO "Timebase clock is Pulsar chip\n");
209 } else if (device_is_compatible(cc, "cy28508")) {
210 pmac_tb_freeze = smp_core99_cypress_tb_freeze;
211 printk(KERN_INFO "Timebase clock is Cypress chip\n");
212 }
213 break;
214 case 0xd4:
215 pmac_tb_freeze = smp_core99_pulsar_tb_freeze;
216 pmac_tb_pulsar_addr = 0xd4;
217 printk(KERN_INFO "Timebase clock is Pulsar chip\n");
218 break;
219 }
220 if (pmac_tb_freeze != NULL) {
221 pmac_tb_clock_chip_host = p;
222 smp_ops->give_timebase = smp_core99_give_timebase;
223 smp_ops->take_timebase = smp_core99_take_timebase;
224 of_node_put(cc);
225 of_node_put(p);
226 break;
227 }
228 next:
229 of_node_put(p);
230 }
231
232 nohwsync:
233 mpic_request_ipis();
234
235 return ncpus;
236}
237
238static void __init smp_core99_kick_cpu(int nr)
239{
240 int save_vector, j;
241 unsigned long new_vector;
242 unsigned long flags;
243 volatile unsigned int *vector
244 = ((volatile unsigned int *)(KERNELBASE+0x100));
245
246 if (nr < 1 || nr > 3)
247 return;
248 if (ppc_md.progress) ppc_md.progress("smp_core99_kick_cpu", 0x346);
249
250 local_irq_save(flags);
251 local_irq_disable();
252
253 /* Save reset vector */
254 save_vector = *vector;
255
256 /* Setup fake reset vector that does
257 * b .pmac_secondary_start - KERNELBASE
258 */
259 switch(nr) {
260 case 1:
261 new_vector = (unsigned long)pmac_secondary_start_1;
262 break;
263 case 2:
264 new_vector = (unsigned long)pmac_secondary_start_2;
265 break;
266 case 3:
267 default:
268 new_vector = (unsigned long)pmac_secondary_start_3;
269 break;
270 }
271 *vector = 0x48000002 + (new_vector - KERNELBASE);
272
273 /* flush data cache and inval instruction cache */
274 flush_icache_range((unsigned long) vector, (unsigned long) vector + 4);
275
276 /* Put some life in our friend */
277 pmac_call_feature(PMAC_FTR_RESET_CPU, NULL, nr, 0);
278 paca[nr].cpu_start = 1;
279
280 /* FIXME: We wait a bit for the CPU to take the exception, I should
281 * instead wait for the entry code to set something for me. Well,
282 * ideally, all that crap will be done in prom.c and the CPU left
283 * in a RAM-based wait loop like CHRP.
284 */
285 for (j = 1; j < 1000000; j++)
286 mb();
287
288 /* Restore our exception vector */
289 *vector = save_vector;
290 flush_icache_range((unsigned long) vector, (unsigned long) vector + 4);
291
292 local_irq_restore(flags);
293 if (ppc_md.progress) ppc_md.progress("smp_core99_kick_cpu done", 0x347);
294}
295
296static void __init smp_core99_setup_cpu(int cpu_nr)
297{
298 /* Setup MPIC */
299 mpic_setup_this_cpu();
300
301 if (cpu_nr == 0) {
302 extern void g5_phy_disable_cpu1(void);
303
304 /* If we didn't start the second CPU, we must take
305 * it off the bus
306 */
307 if (num_online_cpus() < 2)
308 g5_phy_disable_cpu1();
309 if (ppc_md.progress) ppc_md.progress("smp_core99_setup_cpu 0 done", 0x349);
310 }
311}
312
313struct smp_ops_t core99_smp_ops __pmacdata = {
314 .message_pass = smp_mpic_message_pass,
315 .probe = smp_core99_probe,
316 .kick_cpu = smp_core99_kick_cpu,
317 .setup_cpu = smp_core99_setup_cpu,
318 .give_timebase = smp_generic_give_timebase,
319 .take_timebase = smp_generic_take_timebase,
320};
321
322void __init pmac_setup_smp(void)
323{
324 smp_ops = &core99_smp_ops;
325#ifdef CONFIG_HOTPLUG_CPU
326 smp_ops->cpu_enable = generic_cpu_enable;
327 smp_ops->cpu_disable = generic_cpu_disable;
328 smp_ops->cpu_die = generic_cpu_die;
329#endif
330}
diff --git a/arch/ppc64/kernel/pmac_time.c b/arch/ppc64/kernel/pmac_time.c
deleted file mode 100644
index 41bbb8c59697..000000000000
--- a/arch/ppc64/kernel/pmac_time.c
+++ /dev/null
@@ -1,195 +0,0 @@
1/*
2 * Support for periodic interrupts (100 per second) and for getting
3 * the current time from the RTC on Power Macintoshes.
4 *
5 * We use the decrementer register for our periodic interrupts.
6 *
7 * Paul Mackerras August 1996.
8 * Copyright (C) 1996 Paul Mackerras.
9 * Copyright (C) 2003-2005 Benjamin Herrenschmidt.
10 *
11 */
12#include <linux/config.h>
13#include <linux/errno.h>
14#include <linux/sched.h>
15#include <linux/kernel.h>
16#include <linux/param.h>
17#include <linux/string.h>
18#include <linux/mm.h>
19#include <linux/init.h>
20#include <linux/time.h>
21#include <linux/adb.h>
22#include <linux/pmu.h>
23#include <linux/interrupt.h>
24
25#include <asm/sections.h>
26#include <asm/prom.h>
27#include <asm/system.h>
28#include <asm/io.h>
29#include <asm/pgtable.h>
30#include <asm/machdep.h>
31#include <asm/time.h>
32#include <asm/nvram.h>
33#include <asm/smu.h>
34
35#undef DEBUG
36
37#ifdef DEBUG
38#define DBG(x...) printk(x)
39#else
40#define DBG(x...)
41#endif
42
43/* Apparently the RTC stores seconds since 1 Jan 1904 */
44#define RTC_OFFSET 2082844800
45
46/*
47 * Calibrate the decrementer frequency with the VIA timer 1.
48 */
49#define VIA_TIMER_FREQ_6 4700000 /* time 1 frequency * 6 */
50
51extern struct timezone sys_tz;
52extern void to_tm(int tim, struct rtc_time * tm);
53
54void __pmac pmac_get_rtc_time(struct rtc_time *tm)
55{
56 switch(sys_ctrler) {
57#ifdef CONFIG_ADB_PMU
58 case SYS_CTRLER_PMU: {
59 /* TODO: Move that to a function in the PMU driver */
60 struct adb_request req;
61 unsigned int now;
62
63 if (pmu_request(&req, NULL, 1, PMU_READ_RTC) < 0)
64 return;
65 pmu_wait_complete(&req);
66 if (req.reply_len != 4)
67 printk(KERN_ERR "pmac_get_rtc_time: PMU returned a %d"
68 " bytes reply\n", req.reply_len);
69 now = (req.reply[0] << 24) + (req.reply[1] << 16)
70 + (req.reply[2] << 8) + req.reply[3];
71 DBG("get: %u -> %u\n", (int)now, (int)(now - RTC_OFFSET));
72 now -= RTC_OFFSET;
73
74 to_tm(now, tm);
75 tm->tm_year -= 1900;
76 tm->tm_mon -= 1;
77
78 DBG("-> tm_mday: %d, tm_mon: %d, tm_year: %d, %d:%02d:%02d\n",
79 tm->tm_mday, tm->tm_mon, tm->tm_year,
80 tm->tm_hour, tm->tm_min, tm->tm_sec);
81 break;
82 }
83#endif /* CONFIG_ADB_PMU */
84
85#ifdef CONFIG_PMAC_SMU
86 case SYS_CTRLER_SMU:
87 smu_get_rtc_time(tm, 1);
88 break;
89#endif /* CONFIG_PMAC_SMU */
90 default:
91 ;
92 }
93}
94
95int __pmac pmac_set_rtc_time(struct rtc_time *tm)
96{
97 switch(sys_ctrler) {
98#ifdef CONFIG_ADB_PMU
99 case SYS_CTRLER_PMU: {
100 /* TODO: Move that to a function in the PMU driver */
101 struct adb_request req;
102 unsigned int nowtime;
103
104 DBG("set: tm_mday: %d, tm_mon: %d, tm_year: %d,"
105 " %d:%02d:%02d\n",
106 tm->tm_mday, tm->tm_mon, tm->tm_year,
107 tm->tm_hour, tm->tm_min, tm->tm_sec);
108
109 nowtime = mktime(tm->tm_year + 1900, tm->tm_mon + 1,
110 tm->tm_mday, tm->tm_hour, tm->tm_min,
111 tm->tm_sec);
112
113 DBG("-> %u -> %u\n", (int)nowtime,
114 (int)(nowtime + RTC_OFFSET));
115 nowtime += RTC_OFFSET;
116
117 if (pmu_request(&req, NULL, 5, PMU_SET_RTC,
118 nowtime >> 24, nowtime >> 16,
119 nowtime >> 8, nowtime) < 0)
120 return -ENXIO;
121 pmu_wait_complete(&req);
122 if (req.reply_len != 0)
123 printk(KERN_ERR "pmac_set_rtc_time: PMU returned a %d"
124 " bytes reply\n", req.reply_len);
125 return 0;
126 }
127#endif /* CONFIG_ADB_PMU */
128
129#ifdef CONFIG_PMAC_SMU
130 case SYS_CTRLER_SMU:
131 return smu_set_rtc_time(tm, 1);
132#endif /* CONFIG_PMAC_SMU */
133 default:
134 return -ENODEV;
135 }
136}
137
138void __init pmac_get_boot_time(struct rtc_time *tm)
139{
140 pmac_get_rtc_time(tm);
141
142#ifdef disabled__CONFIG_NVRAM
143 s32 delta = 0;
144 int dst;
145
146 delta = ((s32)pmac_xpram_read(PMAC_XPRAM_MACHINE_LOC + 0x9)) << 16;
147 delta |= ((s32)pmac_xpram_read(PMAC_XPRAM_MACHINE_LOC + 0xa)) << 8;
148 delta |= pmac_xpram_read(PMAC_XPRAM_MACHINE_LOC + 0xb);
149 if (delta & 0x00800000UL)
150 delta |= 0xFF000000UL;
151 dst = ((pmac_xpram_read(PMAC_XPRAM_MACHINE_LOC + 0x8) & 0x80) != 0);
152 printk("GMT Delta read from XPRAM: %d minutes, DST: %s\n", delta/60,
153 dst ? "on" : "off");
154#endif
155}
156
157/*
158 * Query the OF and get the decr frequency.
159 * FIXME: merge this with generic_calibrate_decr
160 */
161void __init pmac_calibrate_decr(void)
162{
163 struct device_node *cpu;
164 unsigned int freq, *fp;
165 struct div_result divres;
166
167 /*
168 * The cpu node should have a timebase-frequency property
169 * to tell us the rate at which the decrementer counts.
170 */
171 cpu = find_type_devices("cpu");
172 if (cpu == 0)
173 panic("can't find cpu node in time_init");
174 fp = (unsigned int *) get_property(cpu, "timebase-frequency", NULL);
175 if (fp == 0)
176 panic("can't get cpu timebase frequency");
177 freq = *fp;
178 printk("time_init: decrementer frequency = %u.%.6u MHz\n",
179 freq/1000000, freq%1000000);
180 tb_ticks_per_jiffy = freq / HZ;
181 tb_ticks_per_sec = tb_ticks_per_jiffy * HZ;
182 tb_ticks_per_usec = freq / 1000000;
183 tb_to_us = mulhwu_scale_factor(freq, 1000000);
184 div128_by_32( 1024*1024, 0, tb_ticks_per_sec, &divres );
185 tb_to_xs = divres.result_low;
186 ppc_tb_freq = freq;
187
188 fp = (unsigned int *)get_property(cpu, "clock-frequency", NULL);
189 if (fp == 0)
190 panic("can't get cpu processor frequency");
191 ppc_proc_freq = *fp;
192
193 setup_default_decr();
194}
195
diff --git a/arch/ppc64/kernel/ppc_ksyms.c b/arch/ppc64/kernel/ppc_ksyms.c
index 705742f4eec6..84006e26342c 100644
--- a/arch/ppc64/kernel/ppc_ksyms.c
+++ b/arch/ppc64/kernel/ppc_ksyms.c
@@ -19,7 +19,6 @@
19#include <asm/hw_irq.h> 19#include <asm/hw_irq.h>
20#include <asm/abs_addr.h> 20#include <asm/abs_addr.h>
21#include <asm/cacheflush.h> 21#include <asm/cacheflush.h>
22#include <asm/iSeries/HvCallSc.h>
23 22
24EXPORT_SYMBOL(strcpy); 23EXPORT_SYMBOL(strcpy);
25EXPORT_SYMBOL(strncpy); 24EXPORT_SYMBOL(strncpy);
@@ -46,17 +45,6 @@ EXPORT_SYMBOL(__strnlen_user);
46 45
47EXPORT_SYMBOL(reloc_offset); 46EXPORT_SYMBOL(reloc_offset);
48 47
49#ifdef CONFIG_PPC_ISERIES
50EXPORT_SYMBOL(HvCall0);
51EXPORT_SYMBOL(HvCall1);
52EXPORT_SYMBOL(HvCall2);
53EXPORT_SYMBOL(HvCall3);
54EXPORT_SYMBOL(HvCall4);
55EXPORT_SYMBOL(HvCall5);
56EXPORT_SYMBOL(HvCall6);
57EXPORT_SYMBOL(HvCall7);
58#endif
59
60EXPORT_SYMBOL(_insb); 48EXPORT_SYMBOL(_insb);
61EXPORT_SYMBOL(_outsb); 49EXPORT_SYMBOL(_outsb);
62EXPORT_SYMBOL(_insw); 50EXPORT_SYMBOL(_insw);
@@ -77,14 +65,6 @@ EXPORT_SYMBOL(giveup_altivec);
77EXPORT_SYMBOL(__flush_icache_range); 65EXPORT_SYMBOL(__flush_icache_range);
78EXPORT_SYMBOL(flush_dcache_range); 66EXPORT_SYMBOL(flush_dcache_range);
79 67
80#ifdef CONFIG_SMP
81#ifdef CONFIG_PPC_ISERIES
82EXPORT_SYMBOL(local_get_flags);
83EXPORT_SYMBOL(local_irq_disable);
84EXPORT_SYMBOL(local_irq_restore);
85#endif
86#endif
87
88EXPORT_SYMBOL(memcpy); 68EXPORT_SYMBOL(memcpy);
89EXPORT_SYMBOL(memset); 69EXPORT_SYMBOL(memset);
90EXPORT_SYMBOL(memmove); 70EXPORT_SYMBOL(memmove);
diff --git a/arch/ppc64/kernel/prom.c b/arch/ppc64/kernel/prom.c
index 7035deb6de92..97bfceb5353b 100644
--- a/arch/ppc64/kernel/prom.c
+++ b/arch/ppc64/kernel/prom.c
@@ -46,7 +46,6 @@
46#include <asm/pgtable.h> 46#include <asm/pgtable.h>
47#include <asm/pci.h> 47#include <asm/pci.h>
48#include <asm/iommu.h> 48#include <asm/iommu.h>
49#include <asm/bootinfo.h>
50#include <asm/ppcdebug.h> 49#include <asm/ppcdebug.h>
51#include <asm/btext.h> 50#include <asm/btext.h>
52#include <asm/sections.h> 51#include <asm/sections.h>
@@ -78,11 +77,14 @@ typedef int interpret_func(struct device_node *, unsigned long *,
78extern struct rtas_t rtas; 77extern struct rtas_t rtas;
79extern struct lmb lmb; 78extern struct lmb lmb;
80extern unsigned long klimit; 79extern unsigned long klimit;
80extern unsigned long memory_limit;
81 81
82static int __initdata dt_root_addr_cells; 82static int __initdata dt_root_addr_cells;
83static int __initdata dt_root_size_cells; 83static int __initdata dt_root_size_cells;
84static int __initdata iommu_is_off; 84static int __initdata iommu_is_off;
85int __initdata iommu_force_on; 85int __initdata iommu_force_on;
86unsigned long tce_alloc_start, tce_alloc_end;
87
86typedef u32 cell_t; 88typedef u32 cell_t;
87 89
88#if 0 90#if 0
@@ -1063,7 +1065,6 @@ static int __init early_init_dt_scan_chosen(unsigned long node,
1063{ 1065{
1064 u32 *prop; 1066 u32 *prop;
1065 u64 *prop64; 1067 u64 *prop64;
1066 extern unsigned long memory_limit, tce_alloc_start, tce_alloc_end;
1067 1068
1068 DBG("search \"chosen\", depth: %d, uname: %s\n", depth, uname); 1069 DBG("search \"chosen\", depth: %d, uname: %s\n", depth, uname);
1069 1070
@@ -1237,7 +1238,7 @@ void __init early_init_devtree(void *params)
1237 lmb_init(); 1238 lmb_init();
1238 scan_flat_dt(early_init_dt_scan_root, NULL); 1239 scan_flat_dt(early_init_dt_scan_root, NULL);
1239 scan_flat_dt(early_init_dt_scan_memory, NULL); 1240 scan_flat_dt(early_init_dt_scan_memory, NULL);
1240 lmb_enforce_memory_limit(); 1241 lmb_enforce_memory_limit(memory_limit);
1241 lmb_analyze(); 1242 lmb_analyze();
1242 systemcfg->physicalMemorySize = lmb_phys_mem_size(); 1243 systemcfg->physicalMemorySize = lmb_phys_mem_size();
1243 lmb_reserve(0, __pa(klimit)); 1244 lmb_reserve(0, __pa(klimit));
diff --git a/arch/ppc64/kernel/prom_init.c b/arch/ppc64/kernel/prom_init.c
index f252670874a4..69924ba4d7d9 100644
--- a/arch/ppc64/kernel/prom_init.c
+++ b/arch/ppc64/kernel/prom_init.c
@@ -44,7 +44,6 @@
44#include <asm/pgtable.h> 44#include <asm/pgtable.h>
45#include <asm/pci.h> 45#include <asm/pci.h>
46#include <asm/iommu.h> 46#include <asm/iommu.h>
47#include <asm/bootinfo.h>
48#include <asm/ppcdebug.h> 47#include <asm/ppcdebug.h>
49#include <asm/btext.h> 48#include <asm/btext.h>
50#include <asm/sections.h> 49#include <asm/sections.h>
diff --git a/arch/ppc64/kernel/ptrace.c b/arch/ppc64/kernel/ptrace.c
deleted file mode 100644
index b1c044ca5756..000000000000
--- a/arch/ppc64/kernel/ptrace.c
+++ /dev/null
@@ -1,363 +0,0 @@
1/*
2 * linux/arch/ppc64/kernel/ptrace.c
3 *
4 * PowerPC version
5 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
6 *
7 * Derived from "arch/m68k/kernel/ptrace.c"
8 * Copyright (C) 1994 by Hamish Macdonald
9 * Taken from linux/kernel/ptrace.c and modified for M680x0.
10 * linux/kernel/ptrace.c is by Ross Biro 1/23/92, edited by Linus Torvalds
11 *
12 * Modified by Cort Dougan (cort@hq.fsmlabs.com)
13 * and Paul Mackerras (paulus@linuxcare.com.au).
14 *
15 * This file is subject to the terms and conditions of the GNU General
16 * Public License. See the file README.legal in the main directory of
17 * this archive for more details.
18 */
19
20#include <linux/config.h>
21#include <linux/kernel.h>
22#include <linux/sched.h>
23#include <linux/mm.h>
24#include <linux/smp.h>
25#include <linux/smp_lock.h>
26#include <linux/errno.h>
27#include <linux/ptrace.h>
28#include <linux/user.h>
29#include <linux/security.h>
30#include <linux/audit.h>
31#include <linux/seccomp.h>
32#include <linux/signal.h>
33
34#include <asm/uaccess.h>
35#include <asm/page.h>
36#include <asm/pgtable.h>
37#include <asm/system.h>
38#include <asm/ptrace-common.h>
39
40/*
41 * does not yet catch signals sent when the child dies.
42 * in exit.c or in signal.c.
43 */
44
45/*
46 * Called by kernel/ptrace.c when detaching..
47 *
48 * Make sure single step bits etc are not set.
49 */
50void ptrace_disable(struct task_struct *child)
51{
52 /* make sure the single step bit is not set. */
53 clear_single_step(child);
54}
55
56int sys_ptrace(long request, long pid, long addr, long data)
57{
58 struct task_struct *child;
59 int ret = -EPERM;
60
61 lock_kernel();
62 if (request == PTRACE_TRACEME) {
63 /* are we already being traced? */
64 if (current->ptrace & PT_PTRACED)
65 goto out;
66 ret = security_ptrace(current->parent, current);
67 if (ret)
68 goto out;
69 /* set the ptrace bit in the process flags. */
70 current->ptrace |= PT_PTRACED;
71 ret = 0;
72 goto out;
73 }
74 ret = -ESRCH;
75 read_lock(&tasklist_lock);
76 child = find_task_by_pid(pid);
77 if (child)
78 get_task_struct(child);
79 read_unlock(&tasklist_lock);
80 if (!child)
81 goto out;
82
83 ret = -EPERM;
84 if (pid == 1) /* you may not mess with init */
85 goto out_tsk;
86
87 if (request == PTRACE_ATTACH) {
88 ret = ptrace_attach(child);
89 goto out_tsk;
90 }
91
92 ret = ptrace_check_attach(child, request == PTRACE_KILL);
93 if (ret < 0)
94 goto out_tsk;
95
96 switch (request) {
97 /* when I and D space are separate, these will need to be fixed. */
98 case PTRACE_PEEKTEXT: /* read word at location addr. */
99 case PTRACE_PEEKDATA: {
100 unsigned long tmp;
101 int copied;
102
103 copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0);
104 ret = -EIO;
105 if (copied != sizeof(tmp))
106 break;
107 ret = put_user(tmp,(unsigned long __user *) data);
108 break;
109 }
110
111 /* read the word at location addr in the USER area. */
112 case PTRACE_PEEKUSR: {
113 unsigned long index;
114 unsigned long tmp;
115
116 ret = -EIO;
117 /* convert to index and check */
118 index = (unsigned long) addr >> 3;
119 if ((addr & 7) || (index > PT_FPSCR))
120 break;
121
122 if (index < PT_FPR0) {
123 tmp = get_reg(child, (int)index);
124 } else {
125 flush_fp_to_thread(child);
126 tmp = ((unsigned long *)child->thread.fpr)[index - PT_FPR0];
127 }
128 ret = put_user(tmp,(unsigned long __user *) data);
129 break;
130 }
131
132 /* If I and D space are separate, this will have to be fixed. */
133 case PTRACE_POKETEXT: /* write the word at location addr. */
134 case PTRACE_POKEDATA:
135 ret = 0;
136 if (access_process_vm(child, addr, &data, sizeof(data), 1)
137 == sizeof(data))
138 break;
139 ret = -EIO;
140 break;
141
142 /* write the word at location addr in the USER area */
143 case PTRACE_POKEUSR: {
144 unsigned long index;
145
146 ret = -EIO;
147 /* convert to index and check */
148 index = (unsigned long) addr >> 3;
149 if ((addr & 7) || (index > PT_FPSCR))
150 break;
151
152 if (index == PT_ORIG_R3)
153 break;
154 if (index < PT_FPR0) {
155 ret = put_reg(child, index, data);
156 } else {
157 flush_fp_to_thread(child);
158 ((unsigned long *)child->thread.fpr)[index - PT_FPR0] = data;
159 ret = 0;
160 }
161 break;
162 }
163
164 case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
165 case PTRACE_CONT: { /* restart after signal. */
166 ret = -EIO;
167 if (!valid_signal(data))
168 break;
169 if (request == PTRACE_SYSCALL)
170 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
171 else
172 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
173 child->exit_code = data;
174 /* make sure the single step bit is not set. */
175 clear_single_step(child);
176 wake_up_process(child);
177 ret = 0;
178 break;
179 }
180
181 /*
182 * make the child exit. Best I can do is send it a sigkill.
183 * perhaps it should be put in the status that it wants to
184 * exit.
185 */
186 case PTRACE_KILL: {
187 ret = 0;
188 if (child->exit_state == EXIT_ZOMBIE) /* already dead */
189 break;
190 child->exit_code = SIGKILL;
191 /* make sure the single step bit is not set. */
192 clear_single_step(child);
193 wake_up_process(child);
194 break;
195 }
196
197 case PTRACE_SINGLESTEP: { /* set the trap flag. */
198 ret = -EIO;
199 if (!valid_signal(data))
200 break;
201 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
202 set_single_step(child);
203 child->exit_code = data;
204 /* give it a chance to run. */
205 wake_up_process(child);
206 ret = 0;
207 break;
208 }
209
210 case PTRACE_GET_DEBUGREG: {
211 ret = -EINVAL;
212 /* We only support one DABR and no IABRS at the moment */
213 if (addr > 0)
214 break;
215 ret = put_user(child->thread.dabr,
216 (unsigned long __user *)data);
217 break;
218 }
219
220 case PTRACE_SET_DEBUGREG:
221 ret = ptrace_set_debugreg(child, addr, data);
222 break;
223
224 case PTRACE_DETACH:
225 ret = ptrace_detach(child, data);
226 break;
227
228 case PPC_PTRACE_GETREGS: { /* Get GPRs 0 - 31. */
229 int i;
230 unsigned long *reg = &((unsigned long *)child->thread.regs)[0];
231 unsigned long __user *tmp = (unsigned long __user *)addr;
232
233 for (i = 0; i < 32; i++) {
234 ret = put_user(*reg, tmp);
235 if (ret)
236 break;
237 reg++;
238 tmp++;
239 }
240 break;
241 }
242
243 case PPC_PTRACE_SETREGS: { /* Set GPRs 0 - 31. */
244 int i;
245 unsigned long *reg = &((unsigned long *)child->thread.regs)[0];
246 unsigned long __user *tmp = (unsigned long __user *)addr;
247
248 for (i = 0; i < 32; i++) {
249 ret = get_user(*reg, tmp);
250 if (ret)
251 break;
252 reg++;
253 tmp++;
254 }
255 break;
256 }
257
258 case PPC_PTRACE_GETFPREGS: { /* Get FPRs 0 - 31. */
259 int i;
260 unsigned long *reg = &((unsigned long *)child->thread.fpr)[0];
261 unsigned long __user *tmp = (unsigned long __user *)addr;
262
263 flush_fp_to_thread(child);
264
265 for (i = 0; i < 32; i++) {
266 ret = put_user(*reg, tmp);
267 if (ret)
268 break;
269 reg++;
270 tmp++;
271 }
272 break;
273 }
274
275 case PPC_PTRACE_SETFPREGS: { /* Get FPRs 0 - 31. */
276 int i;
277 unsigned long *reg = &((unsigned long *)child->thread.fpr)[0];
278 unsigned long __user *tmp = (unsigned long __user *)addr;
279
280 flush_fp_to_thread(child);
281
282 for (i = 0; i < 32; i++) {
283 ret = get_user(*reg, tmp);
284 if (ret)
285 break;
286 reg++;
287 tmp++;
288 }
289 break;
290 }
291
292#ifdef CONFIG_ALTIVEC
293 case PTRACE_GETVRREGS:
294 /* Get the child altivec register state. */
295 flush_altivec_to_thread(child);
296 ret = get_vrregs((unsigned long __user *)data, child);
297 break;
298
299 case PTRACE_SETVRREGS:
300 /* Set the child altivec register state. */
301 flush_altivec_to_thread(child);
302 ret = set_vrregs(child, (unsigned long __user *)data);
303 break;
304#endif
305
306 default:
307 ret = ptrace_request(child, request, addr, data);
308 break;
309 }
310out_tsk:
311 put_task_struct(child);
312out:
313 unlock_kernel();
314 return ret;
315}
316
317static void do_syscall_trace(void)
318{
319 /* the 0x80 provides a way for the tracing parent to distinguish
320 between a syscall stop and SIGTRAP delivery */
321 ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
322 ? 0x80 : 0));
323
324 /*
325 * this isn't the same as continuing with a signal, but it will do
326 * for normal use. strace only continues with a signal if the
327 * stopping signal is not SIGTRAP. -brl
328 */
329 if (current->exit_code) {
330 send_sig(current->exit_code, current, 1);
331 current->exit_code = 0;
332 }
333}
334
335void do_syscall_trace_enter(struct pt_regs *regs)
336{
337 secure_computing(regs->gpr[0]);
338
339 if (test_thread_flag(TIF_SYSCALL_TRACE)
340 && (current->ptrace & PT_PTRACED))
341 do_syscall_trace();
342
343 if (unlikely(current->audit_context))
344 audit_syscall_entry(current,
345 test_thread_flag(TIF_32BIT)?AUDIT_ARCH_PPC:AUDIT_ARCH_PPC64,
346 regs->gpr[0],
347 regs->gpr[3], regs->gpr[4],
348 regs->gpr[5], regs->gpr[6]);
349
350}
351
352void do_syscall_trace_leave(struct pt_regs *regs)
353{
354 if (unlikely(current->audit_context))
355 audit_syscall_exit(current,
356 (regs->ccr&0x1000)?AUDITSC_FAILURE:AUDITSC_SUCCESS,
357 regs->result);
358
359 if ((test_thread_flag(TIF_SYSCALL_TRACE)
360 || test_thread_flag(TIF_SINGLESTEP))
361 && (current->ptrace & PT_PTRACED))
362 do_syscall_trace();
363}
diff --git a/arch/ppc64/kernel/rtas-proc.c b/arch/ppc64/kernel/rtas-proc.c
index 1f3ff860fdf0..5bdd5b079d96 100644
--- a/arch/ppc64/kernel/rtas-proc.c
+++ b/arch/ppc64/kernel/rtas-proc.c
@@ -23,6 +23,7 @@
23#include <linux/init.h> 23#include <linux/init.h>
24#include <linux/seq_file.h> 24#include <linux/seq_file.h>
25#include <linux/bitops.h> 25#include <linux/bitops.h>
26#include <linux/rtc.h>
26 27
27#include <asm/uaccess.h> 28#include <asm/uaccess.h>
28#include <asm/processor.h> 29#include <asm/processor.h>
diff --git a/arch/ppc64/kernel/rtas_pci.c b/arch/ppc64/kernel/rtas_pci.c
index 4a9719b48abe..3ad15c90fbbd 100644
--- a/arch/ppc64/kernel/rtas_pci.c
+++ b/arch/ppc64/kernel/rtas_pci.c
@@ -38,9 +38,8 @@
38#include <asm/pci-bridge.h> 38#include <asm/pci-bridge.h>
39#include <asm/iommu.h> 39#include <asm/iommu.h>
40#include <asm/rtas.h> 40#include <asm/rtas.h>
41 41#include <asm/mpic.h>
42#include "mpic.h" 42#include <asm/ppc-pci.h>
43#include "pci.h"
44 43
45/* RTAS tokens */ 44/* RTAS tokens */
46static int read_pci_config; 45static int read_pci_config;
@@ -401,7 +400,7 @@ unsigned long __init find_and_init_phbs(void)
401 if (!phb) 400 if (!phb)
402 continue; 401 continue;
403 402
404 pci_process_bridge_OF_ranges(phb, node); 403 pci_process_bridge_OF_ranges(phb, node, 0);
405 pci_setup_phb_io(phb, index == 0); 404 pci_setup_phb_io(phb, index == 0);
406#ifdef CONFIG_PPC_PSERIES 405#ifdef CONFIG_PPC_PSERIES
407 if (ppc64_interrupt_controller == IC_OPEN_PIC && pSeries_mpic) { 406 if (ppc64_interrupt_controller == IC_OPEN_PIC && pSeries_mpic) {
@@ -451,7 +450,7 @@ struct pci_controller * __devinit init_phb_dynamic(struct device_node *dn)
451 if (!phb) 450 if (!phb)
452 return NULL; 451 return NULL;
453 452
454 pci_process_bridge_OF_ranges(phb, dn); 453 pci_process_bridge_OF_ranges(phb, dn, primary);
455 454
456 pci_setup_phb_io_dynamic(phb, primary); 455 pci_setup_phb_io_dynamic(phb, primary);
457 of_node_put(root); 456 of_node_put(root);
diff --git a/arch/ppc64/kernel/rtc.c b/arch/ppc64/kernel/rtc.c
index 6ff52bc61325..79e7ed2858dd 100644
--- a/arch/ppc64/kernel/rtc.c
+++ b/arch/ppc64/kernel/rtc.c
@@ -43,11 +43,8 @@
43#include <asm/time.h> 43#include <asm/time.h>
44#include <asm/rtas.h> 44#include <asm/rtas.h>
45 45
46#include <asm/iSeries/mf.h>
47#include <asm/machdep.h> 46#include <asm/machdep.h>
48 47
49extern int piranha_simulator;
50
51/* 48/*
52 * We sponge a minor off of the misc major. No need slurping 49 * We sponge a minor off of the misc major. No need slurping
53 * up another valuable major dev number for this. If you add 50 * up another valuable major dev number for this. If you add
@@ -265,44 +262,10 @@ static int rtc_read_proc(char *page, char **start, off_t off,
265 return len; 262 return len;
266} 263}
267 264
268#ifdef CONFIG_PPC_ISERIES
269/*
270 * Get the RTC from the virtual service processor
271 * This requires flowing LpEvents to the primary partition
272 */
273void iSeries_get_rtc_time(struct rtc_time *rtc_tm)
274{
275 if (piranha_simulator)
276 return;
277
278 mf_get_rtc(rtc_tm);
279 rtc_tm->tm_mon--;
280}
281
282/*
283 * Set the RTC in the virtual service processor
284 * This requires flowing LpEvents to the primary partition
285 */
286int iSeries_set_rtc_time(struct rtc_time *tm)
287{
288 mf_set_rtc(tm);
289 return 0;
290}
291
292void iSeries_get_boot_time(struct rtc_time *tm)
293{
294 if ( piranha_simulator )
295 return;
296
297 mf_get_boot_rtc(tm);
298 tm->tm_mon -= 1;
299}
300#endif
301
302#ifdef CONFIG_PPC_RTAS 265#ifdef CONFIG_PPC_RTAS
303#define MAX_RTC_WAIT 5000 /* 5 sec */ 266#define MAX_RTC_WAIT 5000 /* 5 sec */
304#define RTAS_CLOCK_BUSY (-2) 267#define RTAS_CLOCK_BUSY (-2)
305void rtas_get_boot_time(struct rtc_time *rtc_tm) 268unsigned long rtas_get_boot_time(void)
306{ 269{
307 int ret[8]; 270 int ret[8];
308 int error, wait_time; 271 int error, wait_time;
@@ -322,15 +285,10 @@ void rtas_get_boot_time(struct rtc_time *rtc_tm)
322 if (error != 0 && printk_ratelimit()) { 285 if (error != 0 && printk_ratelimit()) {
323 printk(KERN_WARNING "error: reading the clock failed (%d)\n", 286 printk(KERN_WARNING "error: reading the clock failed (%d)\n",
324 error); 287 error);
325 return; 288 return 0;
326 } 289 }
327 290
328 rtc_tm->tm_sec = ret[5]; 291 return mktime(ret[0], ret[1], ret[2], ret[3], ret[4], ret[5]);
329 rtc_tm->tm_min = ret[4];
330 rtc_tm->tm_hour = ret[3];
331 rtc_tm->tm_mday = ret[2];
332 rtc_tm->tm_mon = ret[1] - 1;
333 rtc_tm->tm_year = ret[0] - 1900;
334} 292}
335 293
336/* NOTE: get_rtc_time will get an error if executed in interrupt context 294/* NOTE: get_rtc_time will get an error if executed in interrupt context
diff --git a/arch/ppc64/kernel/signal.c b/arch/ppc64/kernel/signal.c
index 347112cca3c0..ec9d0984b6a0 100644
--- a/arch/ppc64/kernel/signal.c
+++ b/arch/ppc64/kernel/signal.c
@@ -133,7 +133,7 @@ static long setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
133 flush_fp_to_thread(current); 133 flush_fp_to_thread(current);
134 134
135 /* Make sure signal doesn't get spurrious FP exceptions */ 135 /* Make sure signal doesn't get spurrious FP exceptions */
136 current->thread.fpscr = 0; 136 current->thread.fpscr.val = 0;
137 137
138#ifdef CONFIG_ALTIVEC 138#ifdef CONFIG_ALTIVEC
139 err |= __put_user(v_regs, &sc->v_regs); 139 err |= __put_user(v_regs, &sc->v_regs);
diff --git a/arch/ppc64/kernel/smp.c b/arch/ppc64/kernel/smp.c
index 793b562da653..017c12919832 100644
--- a/arch/ppc64/kernel/smp.c
+++ b/arch/ppc64/kernel/smp.c
@@ -45,8 +45,7 @@
45#include <asm/cputable.h> 45#include <asm/cputable.h>
46#include <asm/system.h> 46#include <asm/system.h>
47#include <asm/abs_addr.h> 47#include <asm/abs_addr.h>
48 48#include <asm/mpic.h>
49#include "mpic.h"
50 49
51#ifdef DEBUG 50#ifdef DEBUG
52#define DBG(fmt...) udbg_printf(fmt) 51#define DBG(fmt...) udbg_printf(fmt)
@@ -70,28 +69,6 @@ void smp_call_function_interrupt(void);
70int smt_enabled_at_boot = 1; 69int smt_enabled_at_boot = 1;
71 70
72#ifdef CONFIG_MPIC 71#ifdef CONFIG_MPIC
73void smp_mpic_message_pass(int target, int msg)
74{
75 /* make sure we're sending something that translates to an IPI */
76 if ( msg > 0x3 ){
77 printk("SMP %d: smp_message_pass: unknown msg %d\n",
78 smp_processor_id(), msg);
79 return;
80 }
81 switch ( target )
82 {
83 case MSG_ALL:
84 mpic_send_ipi(msg, 0xffffffff);
85 break;
86 case MSG_ALL_BUT_SELF:
87 mpic_send_ipi(msg, 0xffffffff & ~(1 << smp_processor_id()));
88 break;
89 default:
90 mpic_send_ipi(msg, 1 << target);
91 break;
92 }
93}
94
95int __init smp_mpic_probe(void) 72int __init smp_mpic_probe(void)
96{ 73{
97 int nr_cpus; 74 int nr_cpus;
@@ -128,21 +105,6 @@ void __devinit smp_generic_kick_cpu(int nr)
128 105
129#endif /* CONFIG_MPIC */ 106#endif /* CONFIG_MPIC */
130 107
131static void __init smp_space_timers(unsigned int max_cpus)
132{
133 int i;
134 unsigned long offset = tb_ticks_per_jiffy / max_cpus;
135 unsigned long previous_tb = paca[boot_cpuid].next_jiffy_update_tb;
136
137 for_each_cpu(i) {
138 if (i != boot_cpuid) {
139 paca[i].next_jiffy_update_tb =
140 previous_tb + offset;
141 previous_tb = paca[i].next_jiffy_update_tb;
142 }
143 }
144}
145
146void smp_message_recv(int msg, struct pt_regs *regs) 108void smp_message_recv(int msg, struct pt_regs *regs)
147{ 109{
148 switch(msg) { 110 switch(msg) {
diff --git a/arch/ppc64/kernel/traps.c b/arch/ppc64/kernel/traps.c
deleted file mode 100644
index 7467ae508e6e..000000000000
--- a/arch/ppc64/kernel/traps.c
+++ /dev/null
@@ -1,568 +0,0 @@
1/*
2 * linux/arch/ppc64/kernel/traps.c
3 *
4 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 *
11 * Modified by Cort Dougan (cort@cs.nmt.edu)
12 * and Paul Mackerras (paulus@cs.anu.edu.au)
13 */
14
15/*
16 * This file handles the architecture-dependent parts of hardware exceptions
17 */
18
19#include <linux/config.h>
20#include <linux/errno.h>
21#include <linux/sched.h>
22#include <linux/kernel.h>
23#include <linux/mm.h>
24#include <linux/stddef.h>
25#include <linux/unistd.h>
26#include <linux/slab.h>
27#include <linux/user.h>
28#include <linux/a.out.h>
29#include <linux/interrupt.h>
30#include <linux/init.h>
31#include <linux/module.h>
32#include <linux/delay.h>
33#include <linux/kprobes.h>
34#include <asm/kdebug.h>
35
36#include <asm/pgtable.h>
37#include <asm/uaccess.h>
38#include <asm/system.h>
39#include <asm/io.h>
40#include <asm/processor.h>
41#include <asm/ppcdebug.h>
42#include <asm/rtas.h>
43#include <asm/systemcfg.h>
44#include <asm/machdep.h>
45#include <asm/pmc.h>
46
47#ifdef CONFIG_DEBUGGER
48int (*__debugger)(struct pt_regs *regs);
49int (*__debugger_ipi)(struct pt_regs *regs);
50int (*__debugger_bpt)(struct pt_regs *regs);
51int (*__debugger_sstep)(struct pt_regs *regs);
52int (*__debugger_iabr_match)(struct pt_regs *regs);
53int (*__debugger_dabr_match)(struct pt_regs *regs);
54int (*__debugger_fault_handler)(struct pt_regs *regs);
55
56EXPORT_SYMBOL(__debugger);
57EXPORT_SYMBOL(__debugger_ipi);
58EXPORT_SYMBOL(__debugger_bpt);
59EXPORT_SYMBOL(__debugger_sstep);
60EXPORT_SYMBOL(__debugger_iabr_match);
61EXPORT_SYMBOL(__debugger_dabr_match);
62EXPORT_SYMBOL(__debugger_fault_handler);
63#endif
64
65struct notifier_block *ppc64_die_chain;
66static DEFINE_SPINLOCK(die_notifier_lock);
67
68int register_die_notifier(struct notifier_block *nb)
69{
70 int err = 0;
71 unsigned long flags;
72
73 spin_lock_irqsave(&die_notifier_lock, flags);
74 err = notifier_chain_register(&ppc64_die_chain, nb);
75 spin_unlock_irqrestore(&die_notifier_lock, flags);
76 return err;
77}
78
79/*
80 * Trap & Exception support
81 */
82
83static DEFINE_SPINLOCK(die_lock);
84
85int die(const char *str, struct pt_regs *regs, long err)
86{
87 static int die_counter;
88 int nl = 0;
89
90 if (debugger(regs))
91 return 1;
92
93 console_verbose();
94 spin_lock_irq(&die_lock);
95 bust_spinlocks(1);
96 printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter);
97#ifdef CONFIG_PREEMPT
98 printk("PREEMPT ");
99 nl = 1;
100#endif
101#ifdef CONFIG_SMP
102 printk("SMP NR_CPUS=%d ", NR_CPUS);
103 nl = 1;
104#endif
105#ifdef CONFIG_DEBUG_PAGEALLOC
106 printk("DEBUG_PAGEALLOC ");
107 nl = 1;
108#endif
109#ifdef CONFIG_NUMA
110 printk("NUMA ");
111 nl = 1;
112#endif
113 switch(systemcfg->platform) {
114 case PLATFORM_PSERIES:
115 printk("PSERIES ");
116 nl = 1;
117 break;
118 case PLATFORM_PSERIES_LPAR:
119 printk("PSERIES LPAR ");
120 nl = 1;
121 break;
122 case PLATFORM_ISERIES_LPAR:
123 printk("ISERIES LPAR ");
124 nl = 1;
125 break;
126 case PLATFORM_POWERMAC:
127 printk("POWERMAC ");
128 nl = 1;
129 break;
130 case PLATFORM_BPA:
131 printk("BPA ");
132 nl = 1;
133 break;
134 }
135 if (nl)
136 printk("\n");
137 print_modules();
138 show_regs(regs);
139 bust_spinlocks(0);
140 spin_unlock_irq(&die_lock);
141
142 if (in_interrupt())
143 panic("Fatal exception in interrupt");
144
145 if (panic_on_oops) {
146 printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n");
147 ssleep(5);
148 panic("Fatal exception");
149 }
150 do_exit(SIGSEGV);
151
152 return 0;
153}
154
155void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
156{
157 siginfo_t info;
158
159 if (!user_mode(regs)) {
160 if (die("Exception in kernel mode", regs, signr))
161 return;
162 }
163
164 memset(&info, 0, sizeof(info));
165 info.si_signo = signr;
166 info.si_code = code;
167 info.si_addr = (void __user *) addr;
168 force_sig_info(signr, &info, current);
169}
170
171void system_reset_exception(struct pt_regs *regs)
172{
173 /* See if any machine dependent calls */
174 if (ppc_md.system_reset_exception)
175 ppc_md.system_reset_exception(regs);
176
177 die("System Reset", regs, 0);
178
179 /* Must die if the interrupt is not recoverable */
180 if (!(regs->msr & MSR_RI))
181 panic("Unrecoverable System Reset");
182
183 /* What should we do here? We could issue a shutdown or hard reset. */
184}
185
186void machine_check_exception(struct pt_regs *regs)
187{
188 int recover = 0;
189
190 /* See if any machine dependent calls */
191 if (ppc_md.machine_check_exception)
192 recover = ppc_md.machine_check_exception(regs);
193
194 if (recover)
195 return;
196
197 if (debugger_fault_handler(regs))
198 return;
199 die("Machine check", regs, 0);
200
201 /* Must die if the interrupt is not recoverable */
202 if (!(regs->msr & MSR_RI))
203 panic("Unrecoverable Machine check");
204}
205
206void unknown_exception(struct pt_regs *regs)
207{
208 printk("Bad trap at PC: %lx, SR: %lx, vector=%lx\n",
209 regs->nip, regs->msr, regs->trap);
210
211 _exception(SIGTRAP, regs, 0, 0);
212}
213
214void instruction_breakpoint_exception(struct pt_regs *regs)
215{
216 if (notify_die(DIE_IABR_MATCH, "iabr_match", regs, 5,
217 5, SIGTRAP) == NOTIFY_STOP)
218 return;
219 if (debugger_iabr_match(regs))
220 return;
221 _exception(SIGTRAP, regs, TRAP_BRKPT, regs->nip);
222}
223
224void __kprobes single_step_exception(struct pt_regs *regs)
225{
226 regs->msr &= ~MSR_SE; /* Turn off 'trace' bit */
227
228 if (notify_die(DIE_SSTEP, "single_step", regs, 5,
229 5, SIGTRAP) == NOTIFY_STOP)
230 return;
231 if (debugger_sstep(regs))
232 return;
233
234 _exception(SIGTRAP, regs, TRAP_TRACE, regs->nip);
235}
236
237/*
238 * After we have successfully emulated an instruction, we have to
239 * check if the instruction was being single-stepped, and if so,
240 * pretend we got a single-step exception. This was pointed out
241 * by Kumar Gala. -- paulus
242 */
243static inline void emulate_single_step(struct pt_regs *regs)
244{
245 if (regs->msr & MSR_SE)
246 single_step_exception(regs);
247}
248
249static void parse_fpe(struct pt_regs *regs)
250{
251 int code = 0;
252 unsigned long fpscr;
253
254 flush_fp_to_thread(current);
255
256 fpscr = current->thread.fpscr;
257
258 /* Invalid operation */
259 if ((fpscr & FPSCR_VE) && (fpscr & FPSCR_VX))
260 code = FPE_FLTINV;
261
262 /* Overflow */
263 else if ((fpscr & FPSCR_OE) && (fpscr & FPSCR_OX))
264 code = FPE_FLTOVF;
265
266 /* Underflow */
267 else if ((fpscr & FPSCR_UE) && (fpscr & FPSCR_UX))
268 code = FPE_FLTUND;
269
270 /* Divide by zero */
271 else if ((fpscr & FPSCR_ZE) && (fpscr & FPSCR_ZX))
272 code = FPE_FLTDIV;
273
274 /* Inexact result */
275 else if ((fpscr & FPSCR_XE) && (fpscr & FPSCR_XX))
276 code = FPE_FLTRES;
277
278 _exception(SIGFPE, regs, code, regs->nip);
279}
280
281/*
282 * Illegal instruction emulation support. Return non-zero if we can't
283 * emulate, or -EFAULT if the associated memory access caused an access
284 * fault. Return zero on success.
285 */
286
287#define INST_MFSPR_PVR 0x7c1f42a6
288#define INST_MFSPR_PVR_MASK 0xfc1fffff
289
290#define INST_DCBA 0x7c0005ec
291#define INST_DCBA_MASK 0x7c0007fe
292
293#define INST_MCRXR 0x7c000400
294#define INST_MCRXR_MASK 0x7c0007fe
295
296static int emulate_instruction(struct pt_regs *regs)
297{
298 unsigned int instword;
299
300 if (!user_mode(regs))
301 return -EINVAL;
302
303 CHECK_FULL_REGS(regs);
304
305 if (get_user(instword, (unsigned int __user *)(regs->nip)))
306 return -EFAULT;
307
308 /* Emulate the mfspr rD, PVR. */
309 if ((instword & INST_MFSPR_PVR_MASK) == INST_MFSPR_PVR) {
310 unsigned int rd;
311
312 rd = (instword >> 21) & 0x1f;
313 regs->gpr[rd] = mfspr(SPRN_PVR);
314 return 0;
315 }
316
317 /* Emulating the dcba insn is just a no-op. */
318 if ((instword & INST_DCBA_MASK) == INST_DCBA) {
319 static int warned;
320
321 if (!warned) {
322 printk(KERN_WARNING
323 "process %d (%s) uses obsolete 'dcba' insn\n",
324 current->pid, current->comm);
325 warned = 1;
326 }
327 return 0;
328 }
329
330 /* Emulate the mcrxr insn. */
331 if ((instword & INST_MCRXR_MASK) == INST_MCRXR) {
332 static int warned;
333 unsigned int shift;
334
335 if (!warned) {
336 printk(KERN_WARNING
337 "process %d (%s) uses obsolete 'mcrxr' insn\n",
338 current->pid, current->comm);
339 warned = 1;
340 }
341
342 shift = (instword >> 21) & 0x1c;
343 regs->ccr &= ~(0xf0000000 >> shift);
344 regs->ccr |= (regs->xer & 0xf0000000) >> shift;
345 regs->xer &= ~0xf0000000;
346 return 0;
347 }
348
349 return -EINVAL;
350}
351
352/*
353 * Look through the list of trap instructions that are used for BUG(),
354 * BUG_ON() and WARN_ON() and see if we hit one. At this point we know
355 * that the exception was caused by a trap instruction of some kind.
356 * Returns 1 if we should continue (i.e. it was a WARN_ON) or 0
357 * otherwise.
358 */
359extern struct bug_entry __start___bug_table[], __stop___bug_table[];
360
361#ifndef CONFIG_MODULES
362#define module_find_bug(x) NULL
363#endif
364
365struct bug_entry *find_bug(unsigned long bugaddr)
366{
367 struct bug_entry *bug;
368
369 for (bug = __start___bug_table; bug < __stop___bug_table; ++bug)
370 if (bugaddr == bug->bug_addr)
371 return bug;
372 return module_find_bug(bugaddr);
373}
374
375static int
376check_bug_trap(struct pt_regs *regs)
377{
378 struct bug_entry *bug;
379 unsigned long addr;
380
381 if (regs->msr & MSR_PR)
382 return 0; /* not in kernel */
383 addr = regs->nip; /* address of trap instruction */
384 if (addr < PAGE_OFFSET)
385 return 0;
386 bug = find_bug(regs->nip);
387 if (bug == NULL)
388 return 0;
389 if (bug->line & BUG_WARNING_TRAP) {
390 /* this is a WARN_ON rather than BUG/BUG_ON */
391 printk(KERN_ERR "Badness in %s at %s:%d\n",
392 bug->function, bug->file,
393 (unsigned int)bug->line & ~BUG_WARNING_TRAP);
394 show_stack(current, (void *)regs->gpr[1]);
395 return 1;
396 }
397 printk(KERN_CRIT "kernel BUG in %s at %s:%d!\n",
398 bug->function, bug->file, (unsigned int)bug->line);
399 return 0;
400}
401
402void __kprobes program_check_exception(struct pt_regs *regs)
403{
404 if (debugger_fault_handler(regs))
405 return;
406
407 if (regs->msr & 0x100000) {
408 /* IEEE FP exception */
409 parse_fpe(regs);
410 } else if (regs->msr & 0x20000) {
411 /* trap exception */
412
413 if (notify_die(DIE_BPT, "breakpoint", regs, 5,
414 5, SIGTRAP) == NOTIFY_STOP)
415 return;
416 if (debugger_bpt(regs))
417 return;
418
419 if (check_bug_trap(regs)) {
420 regs->nip += 4;
421 return;
422 }
423 _exception(SIGTRAP, regs, TRAP_BRKPT, regs->nip);
424
425 } else {
426 /* Privileged or illegal instruction; try to emulate it. */
427 switch (emulate_instruction(regs)) {
428 case 0:
429 regs->nip += 4;
430 emulate_single_step(regs);
431 break;
432
433 case -EFAULT:
434 _exception(SIGSEGV, regs, SEGV_MAPERR, regs->nip);
435 break;
436
437 default:
438 if (regs->msr & 0x40000)
439 /* priveleged */
440 _exception(SIGILL, regs, ILL_PRVOPC, regs->nip);
441 else
442 /* illegal */
443 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
444 break;
445 }
446 }
447}
448
449void kernel_fp_unavailable_exception(struct pt_regs *regs)
450{
451 printk(KERN_EMERG "Unrecoverable FP Unavailable Exception "
452 "%lx at %lx\n", regs->trap, regs->nip);
453 die("Unrecoverable FP Unavailable Exception", regs, SIGABRT);
454}
455
456void altivec_unavailable_exception(struct pt_regs *regs)
457{
458 if (user_mode(regs)) {
459 /* A user program has executed an altivec instruction,
460 but this kernel doesn't support altivec. */
461 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
462 return;
463 }
464 printk(KERN_EMERG "Unrecoverable VMX/Altivec Unavailable Exception "
465 "%lx at %lx\n", regs->trap, regs->nip);
466 die("Unrecoverable VMX/Altivec Unavailable Exception", regs, SIGABRT);
467}
468
469extern perf_irq_t perf_irq;
470
471void performance_monitor_exception(struct pt_regs *regs)
472{
473 perf_irq(regs);
474}
475
476void alignment_exception(struct pt_regs *regs)
477{
478 int fixed;
479
480 fixed = fix_alignment(regs);
481
482 if (fixed == 1) {
483 regs->nip += 4; /* skip over emulated instruction */
484 emulate_single_step(regs);
485 return;
486 }
487
488 /* Operand address was bad */
489 if (fixed == -EFAULT) {
490 if (user_mode(regs)) {
491 _exception(SIGSEGV, regs, SEGV_MAPERR, regs->dar);
492 } else {
493 /* Search exception table */
494 bad_page_fault(regs, regs->dar, SIGSEGV);
495 }
496
497 return;
498 }
499
500 _exception(SIGBUS, regs, BUS_ADRALN, regs->nip);
501}
502
503#ifdef CONFIG_ALTIVEC
504void altivec_assist_exception(struct pt_regs *regs)
505{
506 int err;
507 siginfo_t info;
508
509 if (!user_mode(regs)) {
510 printk(KERN_EMERG "VMX/Altivec assist exception in kernel mode"
511 " at %lx\n", regs->nip);
512 die("Kernel VMX/Altivec assist exception", regs, SIGILL);
513 }
514
515 flush_altivec_to_thread(current);
516
517 err = emulate_altivec(regs);
518 if (err == 0) {
519 regs->nip += 4; /* skip emulated instruction */
520 emulate_single_step(regs);
521 return;
522 }
523
524 if (err == -EFAULT) {
525 /* got an error reading the instruction */
526 info.si_signo = SIGSEGV;
527 info.si_errno = 0;
528 info.si_code = SEGV_MAPERR;
529 info.si_addr = (void __user *) regs->nip;
530 force_sig_info(SIGSEGV, &info, current);
531 } else {
532 /* didn't recognize the instruction */
533 /* XXX quick hack for now: set the non-Java bit in the VSCR */
534 if (printk_ratelimit())
535 printk(KERN_ERR "Unrecognized altivec instruction "
536 "in %s at %lx\n", current->comm, regs->nip);
537 current->thread.vscr.u[3] |= 0x10000;
538 }
539}
540#endif /* CONFIG_ALTIVEC */
541
542/*
543 * We enter here if we get an unrecoverable exception, that is, one
544 * that happened at a point where the RI (recoverable interrupt) bit
545 * in the MSR is 0. This indicates that SRR0/1 are live, and that
546 * we therefore lost state by taking this exception.
547 */
548void unrecoverable_exception(struct pt_regs *regs)
549{
550 printk(KERN_EMERG "Unrecoverable exception %lx at %lx\n",
551 regs->trap, regs->nip);
552 die("Unrecoverable exception", regs, SIGABRT);
553}
554
555/*
556 * We enter here if we discover during exception entry that we are
557 * running in supervisor mode with a userspace value in the stack pointer.
558 */
559void kernel_bad_stack(struct pt_regs *regs)
560{
561 printk(KERN_EMERG "Bad kernel stack pointer %lx at %lx\n",
562 regs->gpr[1], regs->nip);
563 die("Bad kernel stack pointer", regs, SIGABRT);
564}
565
566void __init trap_init(void)
567{
568}
diff --git a/arch/ppc64/kernel/vdso.c b/arch/ppc64/kernel/vdso.c
index efa985f05aca..4aacf521e3e4 100644
--- a/arch/ppc64/kernel/vdso.c
+++ b/arch/ppc64/kernel/vdso.c
@@ -176,13 +176,13 @@ static struct page * vdso_vma_nopage(struct vm_area_struct * vma,
176 return NOPAGE_SIGBUS; 176 return NOPAGE_SIGBUS;
177 177
178 /* 178 /*
179 * Last page is systemcfg, special handling here, no get_page() a 179 * Last page is systemcfg.
180 * this is a reserved page
181 */ 180 */
182 if ((vma->vm_end - address) <= PAGE_SIZE) 181 if ((vma->vm_end - address) <= PAGE_SIZE)
183 return virt_to_page(systemcfg); 182 pg = virt_to_page(systemcfg);
183 else
184 pg = virt_to_page(vbase + offset);
184 185
185 pg = virt_to_page(vbase + offset);
186 get_page(pg); 186 get_page(pg);
187 DBG(" ->page count: %d\n", page_count(pg)); 187 DBG(" ->page count: %d\n", page_count(pg));
188 188
@@ -259,7 +259,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int executable_stack)
259 * gettimeofday will be totally dead. It's fine to use that for setting 259 * gettimeofday will be totally dead. It's fine to use that for setting
260 * breakpoints in the vDSO code pages though 260 * breakpoints in the vDSO code pages though
261 */ 261 */
262 vma->vm_flags = VM_READ | VM_EXEC | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC; 262 vma->vm_flags = VM_READ | VM_EXEC | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC | VM_RESERVED;
263 vma->vm_flags |= mm->def_flags; 263 vma->vm_flags |= mm->def_flags;
264 vma->vm_page_prot = protection_map[vma->vm_flags & 0x7]; 264 vma->vm_page_prot = protection_map[vma->vm_flags & 0x7];
265 vma->vm_ops = &vdso_vmops; 265 vma->vm_ops = &vdso_vmops;
@@ -603,6 +603,8 @@ void __init vdso_init(void)
603 ClearPageReserved(pg); 603 ClearPageReserved(pg);
604 get_page(pg); 604 get_page(pg);
605 } 605 }
606
607 get_page(virt_to_page(systemcfg));
606} 608}
607 609
608int in_gate_area_no_task(unsigned long addr) 610int in_gate_area_no_task(unsigned long addr)
diff --git a/arch/ppc64/kernel/vdso64/sigtramp.S b/arch/ppc64/kernel/vdso64/sigtramp.S
index 8ae8f205e470..31b604ab56de 100644
--- a/arch/ppc64/kernel/vdso64/sigtramp.S
+++ b/arch/ppc64/kernel/vdso64/sigtramp.S
@@ -15,6 +15,7 @@
15#include <asm/ppc_asm.h> 15#include <asm/ppc_asm.h>
16#include <asm/unistd.h> 16#include <asm/unistd.h>
17#include <asm/vdso.h> 17#include <asm/vdso.h>
18#include <asm/ptrace.h> /* XXX for __SIGNAL_FRAMESIZE */
18 19
19 .text 20 .text
20 21
diff --git a/arch/ppc64/kernel/vecemu.c b/arch/ppc64/kernel/vecemu.c
deleted file mode 100644
index cb207629f21f..000000000000
--- a/arch/ppc64/kernel/vecemu.c
+++ /dev/null
@@ -1,346 +0,0 @@
1/*
2 * Routines to emulate some Altivec/VMX instructions, specifically
3 * those that can trap when given denormalized operands in Java mode.
4 */
5#include <linux/kernel.h>
6#include <linux/errno.h>
7#include <linux/sched.h>
8#include <asm/ptrace.h>
9#include <asm/processor.h>
10#include <asm/uaccess.h>
11
12/* Functions in vector.S */
13extern void vaddfp(vector128 *dst, vector128 *a, vector128 *b);
14extern void vsubfp(vector128 *dst, vector128 *a, vector128 *b);
15extern void vmaddfp(vector128 *dst, vector128 *a, vector128 *b, vector128 *c);
16extern void vnmsubfp(vector128 *dst, vector128 *a, vector128 *b, vector128 *c);
17extern void vrefp(vector128 *dst, vector128 *src);
18extern void vrsqrtefp(vector128 *dst, vector128 *src);
19extern void vexptep(vector128 *dst, vector128 *src);
20
21static unsigned int exp2s[8] = {
22 0x800000,
23 0x8b95c2,
24 0x9837f0,
25 0xa5fed7,
26 0xb504f3,
27 0xc5672a,
28 0xd744fd,
29 0xeac0c7
30};
31
32/*
33 * Computes an estimate of 2^x. The `s' argument is the 32-bit
34 * single-precision floating-point representation of x.
35 */
36static unsigned int eexp2(unsigned int s)
37{
38 int exp, pwr;
39 unsigned int mant, frac;
40
41 /* extract exponent field from input */
42 exp = ((s >> 23) & 0xff) - 127;
43 if (exp > 7) {
44 /* check for NaN input */
45 if (exp == 128 && (s & 0x7fffff) != 0)
46 return s | 0x400000; /* return QNaN */
47 /* 2^-big = 0, 2^+big = +Inf */
48 return (s & 0x80000000)? 0: 0x7f800000; /* 0 or +Inf */
49 }
50 if (exp < -23)
51 return 0x3f800000; /* 1.0 */
52
53 /* convert to fixed point integer in 9.23 representation */
54 pwr = (s & 0x7fffff) | 0x800000;
55 if (exp > 0)
56 pwr <<= exp;
57 else
58 pwr >>= -exp;
59 if (s & 0x80000000)
60 pwr = -pwr;
61
62 /* extract integer part, which becomes exponent part of result */
63 exp = (pwr >> 23) + 126;
64 if (exp >= 254)
65 return 0x7f800000;
66 if (exp < -23)
67 return 0;
68
69 /* table lookup on top 3 bits of fraction to get mantissa */
70 mant = exp2s[(pwr >> 20) & 7];
71
72 /* linear interpolation using remaining 20 bits of fraction */
73 asm("mulhwu %0,%1,%2" : "=r" (frac)
74 : "r" (pwr << 12), "r" (0x172b83ff));
75 asm("mulhwu %0,%1,%2" : "=r" (frac) : "r" (frac), "r" (mant));
76 mant += frac;
77
78 if (exp >= 0)
79 return mant + (exp << 23);
80
81 /* denormalized result */
82 exp = -exp;
83 mant += 1 << (exp - 1);
84 return mant >> exp;
85}
86
87/*
88 * Computes an estimate of log_2(x). The `s' argument is the 32-bit
89 * single-precision floating-point representation of x.
90 */
91static unsigned int elog2(unsigned int s)
92{
93 int exp, mant, lz, frac;
94
95 exp = s & 0x7f800000;
96 mant = s & 0x7fffff;
97 if (exp == 0x7f800000) { /* Inf or NaN */
98 if (mant != 0)
99 s |= 0x400000; /* turn NaN into QNaN */
100 return s;
101 }
102 if ((exp | mant) == 0) /* +0 or -0 */
103 return 0xff800000; /* return -Inf */
104
105 if (exp == 0) {
106 /* denormalized */
107 asm("cntlzw %0,%1" : "=r" (lz) : "r" (mant));
108 mant <<= lz - 8;
109 exp = (-118 - lz) << 23;
110 } else {
111 mant |= 0x800000;
112 exp -= 127 << 23;
113 }
114
115 if (mant >= 0xb504f3) { /* 2^0.5 * 2^23 */
116 exp |= 0x400000; /* 0.5 * 2^23 */
117 asm("mulhwu %0,%1,%2" : "=r" (mant)
118 : "r" (mant), "r" (0xb504f334)); /* 2^-0.5 * 2^32 */
119 }
120 if (mant >= 0x9837f0) { /* 2^0.25 * 2^23 */
121 exp |= 0x200000; /* 0.25 * 2^23 */
122 asm("mulhwu %0,%1,%2" : "=r" (mant)
123 : "r" (mant), "r" (0xd744fccb)); /* 2^-0.25 * 2^32 */
124 }
125 if (mant >= 0x8b95c2) { /* 2^0.125 * 2^23 */
126 exp |= 0x100000; /* 0.125 * 2^23 */
127 asm("mulhwu %0,%1,%2" : "=r" (mant)
128 : "r" (mant), "r" (0xeac0c6e8)); /* 2^-0.125 * 2^32 */
129 }
130 if (mant > 0x800000) { /* 1.0 * 2^23 */
131 /* calculate (mant - 1) * 1.381097463 */
132 /* 1.381097463 == 0.125 / (2^0.125 - 1) */
133 asm("mulhwu %0,%1,%2" : "=r" (frac)
134 : "r" ((mant - 0x800000) << 1), "r" (0xb0c7cd3a));
135 exp += frac;
136 }
137 s = exp & 0x80000000;
138 if (exp != 0) {
139 if (s)
140 exp = -exp;
141 asm("cntlzw %0,%1" : "=r" (lz) : "r" (exp));
142 lz = 8 - lz;
143 if (lz > 0)
144 exp >>= lz;
145 else if (lz < 0)
146 exp <<= -lz;
147 s += ((lz + 126) << 23) + exp;
148 }
149 return s;
150}
151
152#define VSCR_SAT 1
153
154static int ctsxs(unsigned int x, int scale, unsigned int *vscrp)
155{
156 int exp, mant;
157
158 exp = (x >> 23) & 0xff;
159 mant = x & 0x7fffff;
160 if (exp == 255 && mant != 0)
161 return 0; /* NaN -> 0 */
162 exp = exp - 127 + scale;
163 if (exp < 0)
164 return 0; /* round towards zero */
165 if (exp >= 31) {
166 /* saturate, unless the result would be -2^31 */
167 if (x + (scale << 23) != 0xcf000000)
168 *vscrp |= VSCR_SAT;
169 return (x & 0x80000000)? 0x80000000: 0x7fffffff;
170 }
171 mant |= 0x800000;
172 mant = (mant << 7) >> (30 - exp);
173 return (x & 0x80000000)? -mant: mant;
174}
175
176static unsigned int ctuxs(unsigned int x, int scale, unsigned int *vscrp)
177{
178 int exp;
179 unsigned int mant;
180
181 exp = (x >> 23) & 0xff;
182 mant = x & 0x7fffff;
183 if (exp == 255 && mant != 0)
184 return 0; /* NaN -> 0 */
185 exp = exp - 127 + scale;
186 if (exp < 0)
187 return 0; /* round towards zero */
188 if (x & 0x80000000) {
189 /* negative => saturate to 0 */
190 *vscrp |= VSCR_SAT;
191 return 0;
192 }
193 if (exp >= 32) {
194 /* saturate */
195 *vscrp |= VSCR_SAT;
196 return 0xffffffff;
197 }
198 mant |= 0x800000;
199 mant = (mant << 8) >> (31 - exp);
200 return mant;
201}
202
203/* Round to floating integer, towards 0 */
204static unsigned int rfiz(unsigned int x)
205{
206 int exp;
207
208 exp = ((x >> 23) & 0xff) - 127;
209 if (exp == 128 && (x & 0x7fffff) != 0)
210 return x | 0x400000; /* NaN -> make it a QNaN */
211 if (exp >= 23)
212 return x; /* it's an integer already (or Inf) */
213 if (exp < 0)
214 return x & 0x80000000; /* |x| < 1.0 rounds to 0 */
215 return x & ~(0x7fffff >> exp);
216}
217
218/* Round to floating integer, towards +/- Inf */
219static unsigned int rfii(unsigned int x)
220{
221 int exp, mask;
222
223 exp = ((x >> 23) & 0xff) - 127;
224 if (exp == 128 && (x & 0x7fffff) != 0)
225 return x | 0x400000; /* NaN -> make it a QNaN */
226 if (exp >= 23)
227 return x; /* it's an integer already (or Inf) */
228 if ((x & 0x7fffffff) == 0)
229 return x; /* +/-0 -> +/-0 */
230 if (exp < 0)
231 /* 0 < |x| < 1.0 rounds to +/- 1.0 */
232 return (x & 0x80000000) | 0x3f800000;
233 mask = 0x7fffff >> exp;
234 /* mantissa overflows into exponent - that's OK,
235 it can't overflow into the sign bit */
236 return (x + mask) & ~mask;
237}
238
239/* Round to floating integer, to nearest */
240static unsigned int rfin(unsigned int x)
241{
242 int exp, half;
243
244 exp = ((x >> 23) & 0xff) - 127;
245 if (exp == 128 && (x & 0x7fffff) != 0)
246 return x | 0x400000; /* NaN -> make it a QNaN */
247 if (exp >= 23)
248 return x; /* it's an integer already (or Inf) */
249 if (exp < -1)
250 return x & 0x80000000; /* |x| < 0.5 -> +/-0 */
251 if (exp == -1)
252 /* 0.5 <= |x| < 1.0 rounds to +/- 1.0 */
253 return (x & 0x80000000) | 0x3f800000;
254 half = 0x400000 >> exp;
255 /* add 0.5 to the magnitude and chop off the fraction bits */
256 return (x + half) & ~(0x7fffff >> exp);
257}
258
259int
260emulate_altivec(struct pt_regs *regs)
261{
262 unsigned int instr, i;
263 unsigned int va, vb, vc, vd;
264 vector128 *vrs;
265
266 if (get_user(instr, (unsigned int __user *) regs->nip))
267 return -EFAULT;
268 if ((instr >> 26) != 4)
269 return -EINVAL; /* not an altivec instruction */
270 vd = (instr >> 21) & 0x1f;
271 va = (instr >> 16) & 0x1f;
272 vb = (instr >> 11) & 0x1f;
273 vc = (instr >> 6) & 0x1f;
274
275 vrs = current->thread.vr;
276 switch (instr & 0x3f) {
277 case 10:
278 switch (vc) {
279 case 0: /* vaddfp */
280 vaddfp(&vrs[vd], &vrs[va], &vrs[vb]);
281 break;
282 case 1: /* vsubfp */
283 vsubfp(&vrs[vd], &vrs[va], &vrs[vb]);
284 break;
285 case 4: /* vrefp */
286 vrefp(&vrs[vd], &vrs[vb]);
287 break;
288 case 5: /* vrsqrtefp */
289 vrsqrtefp(&vrs[vd], &vrs[vb]);
290 break;
291 case 6: /* vexptefp */
292 for (i = 0; i < 4; ++i)
293 vrs[vd].u[i] = eexp2(vrs[vb].u[i]);
294 break;
295 case 7: /* vlogefp */
296 for (i = 0; i < 4; ++i)
297 vrs[vd].u[i] = elog2(vrs[vb].u[i]);
298 break;
299 case 8: /* vrfin */
300 for (i = 0; i < 4; ++i)
301 vrs[vd].u[i] = rfin(vrs[vb].u[i]);
302 break;
303 case 9: /* vrfiz */
304 for (i = 0; i < 4; ++i)
305 vrs[vd].u[i] = rfiz(vrs[vb].u[i]);
306 break;
307 case 10: /* vrfip */
308 for (i = 0; i < 4; ++i) {
309 u32 x = vrs[vb].u[i];
310 x = (x & 0x80000000)? rfiz(x): rfii(x);
311 vrs[vd].u[i] = x;
312 }
313 break;
314 case 11: /* vrfim */
315 for (i = 0; i < 4; ++i) {
316 u32 x = vrs[vb].u[i];
317 x = (x & 0x80000000)? rfii(x): rfiz(x);
318 vrs[vd].u[i] = x;
319 }
320 break;
321 case 14: /* vctuxs */
322 for (i = 0; i < 4; ++i)
323 vrs[vd].u[i] = ctuxs(vrs[vb].u[i], va,
324 &current->thread.vscr.u[3]);
325 break;
326 case 15: /* vctsxs */
327 for (i = 0; i < 4; ++i)
328 vrs[vd].u[i] = ctsxs(vrs[vb].u[i], va,
329 &current->thread.vscr.u[3]);
330 break;
331 default:
332 return -EINVAL;
333 }
334 break;
335 case 46: /* vmaddfp */
336 vmaddfp(&vrs[vd], &vrs[va], &vrs[vb], &vrs[vc]);
337 break;
338 case 47: /* vnmsubfp */
339 vnmsubfp(&vrs[vd], &vrs[va], &vrs[vb], &vrs[vc]);
340 break;
341 default:
342 return -EINVAL;
343 }
344
345 return 0;
346}
diff --git a/arch/ppc64/kernel/vmlinux.lds.S b/arch/ppc64/kernel/vmlinux.lds.S
index 0306510bc4ff..022f220e772f 100644
--- a/arch/ppc64/kernel/vmlinux.lds.S
+++ b/arch/ppc64/kernel/vmlinux.lds.S
@@ -1,3 +1,4 @@
1#include <asm/page.h>
1#include <asm-generic/vmlinux.lds.h> 2#include <asm-generic/vmlinux.lds.h>
2 3
3OUTPUT_ARCH(powerpc:common64) 4OUTPUT_ARCH(powerpc:common64)
@@ -17,7 +18,7 @@ SECTIONS
17 LOCK_TEXT 18 LOCK_TEXT
18 KPROBES_TEXT 19 KPROBES_TEXT
19 *(.fixup) 20 *(.fixup)
20 . = ALIGN(4096); 21 . = ALIGN(PAGE_SIZE);
21 _etext = .; 22 _etext = .;
22 } 23 }
23 24
@@ -43,7 +44,7 @@ SECTIONS
43 44
44 45
45 /* will be freed after init */ 46 /* will be freed after init */
46 . = ALIGN(4096); 47 . = ALIGN(PAGE_SIZE);
47 __init_begin = .; 48 __init_begin = .;
48 49
49 .init.text : { 50 .init.text : {
@@ -83,7 +84,7 @@ SECTIONS
83 84
84 SECURITY_INIT 85 SECURITY_INIT
85 86
86 . = ALIGN(4096); 87 . = ALIGN(PAGE_SIZE);
87 .init.ramfs : { 88 .init.ramfs : {
88 __initramfs_start = .; 89 __initramfs_start = .;
89 *(.init.ramfs) 90 *(.init.ramfs)
@@ -96,18 +97,22 @@ SECTIONS
96 __per_cpu_end = .; 97 __per_cpu_end = .;
97 } 98 }
98 99
100 . = ALIGN(PAGE_SIZE);
99 . = ALIGN(16384); 101 . = ALIGN(16384);
100 __init_end = .; 102 __init_end = .;
101 /* freed after init ends here */ 103 /* freed after init ends here */
102 104
103 105
104 /* Read/write sections */ 106 /* Read/write sections */
107 . = ALIGN(PAGE_SIZE);
105 . = ALIGN(16384); 108 . = ALIGN(16384);
109 _sdata = .;
106 /* The initial task and kernel stack */ 110 /* The initial task and kernel stack */
107 .data.init_task : { 111 .data.init_task : {
108 *(.data.init_task) 112 *(.data.init_task)
109 } 113 }
110 114
115 . = ALIGN(PAGE_SIZE);
111 .data.page_aligned : { 116 .data.page_aligned : {
112 *(.data.page_aligned) 117 *(.data.page_aligned)
113 } 118 }
@@ -129,18 +134,18 @@ SECTIONS
129 __toc_start = .; 134 __toc_start = .;
130 *(.got) 135 *(.got)
131 *(.toc) 136 *(.toc)
132 . = ALIGN(4096); 137 . = ALIGN(PAGE_SIZE);
133 _edata = .; 138 _edata = .;
134 } 139 }
135 140
136 141
137 . = ALIGN(4096); 142 . = ALIGN(PAGE_SIZE);
138 .bss : { 143 .bss : {
139 __bss_start = .; 144 __bss_start = .;
140 *(.bss) 145 *(.bss)
141 __bss_stop = .; 146 __bss_stop = .;
142 } 147 }
143 148
144 . = ALIGN(4096); 149 . = ALIGN(PAGE_SIZE);
145 _end = . ; 150 _end = . ;
146} 151}
diff --git a/arch/ppc64/lib/Makefile b/arch/ppc64/lib/Makefile
index 0b6e967de948..42d5295bf345 100644
--- a/arch/ppc64/lib/Makefile
+++ b/arch/ppc64/lib/Makefile
@@ -2,17 +2,4 @@
2# Makefile for ppc64-specific library files.. 2# Makefile for ppc64-specific library files..
3# 3#
4 4
5lib-y := checksum.o string.o strcase.o 5lib-y := string.o
6lib-y += copypage.o memcpy.o copyuser.o usercopy.o
7
8# Lock primitives are defined as no-ops in include/linux/spinlock.h
9# for non-SMP configs. Don't build the real versions.
10
11lib-$(CONFIG_SMP) += locks.o
12
13# e2a provides EBCDIC to ASCII conversions.
14ifdef CONFIG_PPC_ISERIES
15obj-y += e2a.o
16endif
17
18lib-$(CONFIG_DEBUG_KERNEL) += sstep.o
diff --git a/arch/ppc64/lib/string.S b/arch/ppc64/lib/string.S
index 813587e5c2ec..e21a0038a4d6 100644
--- a/arch/ppc64/lib/string.S
+++ b/arch/ppc64/lib/string.S
@@ -65,112 +65,6 @@ _GLOBAL(strlen)
65 subf r3,r3,r4 65 subf r3,r3,r4
66 blr 66 blr
67 67
68_GLOBAL(memset)
69 neg r0,r3
70 rlwimi r4,r4,8,16,23
71 andi. r0,r0,7 /* # bytes to be 8-byte aligned */
72 rlwimi r4,r4,16,0,15
73 cmplw cr1,r5,r0 /* do we get that far? */
74 rldimi r4,r4,32,0
75 mtcrf 1,r0
76 mr r6,r3
77 blt cr1,8f
78 beq+ 3f /* if already 8-byte aligned */
79 subf r5,r0,r5
80 bf 31,1f
81 stb r4,0(r6)
82 addi r6,r6,1
831: bf 30,2f
84 sth r4,0(r6)
85 addi r6,r6,2
862: bf 29,3f
87 stw r4,0(r6)
88 addi r6,r6,4
893: srdi. r0,r5,6
90 clrldi r5,r5,58
91 mtctr r0
92 beq 5f
934: std r4,0(r6)
94 std r4,8(r6)
95 std r4,16(r6)
96 std r4,24(r6)
97 std r4,32(r6)
98 std r4,40(r6)
99 std r4,48(r6)
100 std r4,56(r6)
101 addi r6,r6,64
102 bdnz 4b
1035: srwi. r0,r5,3
104 clrlwi r5,r5,29
105 mtcrf 1,r0
106 beq 8f
107 bf 29,6f
108 std r4,0(r6)
109 std r4,8(r6)
110 std r4,16(r6)
111 std r4,24(r6)
112 addi r6,r6,32
1136: bf 30,7f
114 std r4,0(r6)
115 std r4,8(r6)
116 addi r6,r6,16
1177: bf 31,8f
118 std r4,0(r6)
119 addi r6,r6,8
1208: cmpwi r5,0
121 mtcrf 1,r5
122 beqlr+
123 bf 29,9f
124 stw r4,0(r6)
125 addi r6,r6,4
1269: bf 30,10f
127 sth r4,0(r6)
128 addi r6,r6,2
12910: bflr 31
130 stb r4,0(r6)
131 blr
132
133_GLOBAL(memmove)
134 cmplw 0,r3,r4
135 bgt .backwards_memcpy
136 b .memcpy
137
138_GLOBAL(backwards_memcpy)
139 rlwinm. r7,r5,32-3,3,31 /* r0 = r5 >> 3 */
140 add r6,r3,r5
141 add r4,r4,r5
142 beq 2f
143 andi. r0,r6,3
144 mtctr r7
145 bne 5f
1461: lwz r7,-4(r4)
147 lwzu r8,-8(r4)
148 stw r7,-4(r6)
149 stwu r8,-8(r6)
150 bdnz 1b
151 andi. r5,r5,7
1522: cmplwi 0,r5,4
153 blt 3f
154 lwzu r0,-4(r4)
155 subi r5,r5,4
156 stwu r0,-4(r6)
1573: cmpwi 0,r5,0
158 beqlr
159 mtctr r5
1604: lbzu r0,-1(r4)
161 stbu r0,-1(r6)
162 bdnz 4b
163 blr
1645: mtctr r0
1656: lbzu r7,-1(r4)
166 stbu r7,-1(r6)
167 bdnz 6b
168 subf r5,r0,r5
169 rlwinm. r7,r5,32-3,3,31
170 beq 2b
171 mtctr r7
172 b 1b
173
174_GLOBAL(memcmp) 68_GLOBAL(memcmp)
175 cmpwi 0,r5,0 69 cmpwi 0,r5,0
176 ble- 2f 70 ble- 2f
diff --git a/arch/ppc64/mm/Makefile b/arch/ppc64/mm/Makefile
deleted file mode 100644
index 3695d00d347f..000000000000
--- a/arch/ppc64/mm/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
1#
2# Makefile for the linux ppc-specific parts of the memory manager.
3#
4
5EXTRA_CFLAGS += -mno-minimal-toc
6
7obj-y := fault.o init.o imalloc.o hash_utils.o hash_low.o tlb.o \
8 slb_low.o slb.o stab.o mmap.o
9obj-$(CONFIG_NEED_MULTIPLE_NODES) += numa.o
10obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
11obj-$(CONFIG_PPC_MULTIPLATFORM) += hash_native.o
diff --git a/arch/ppc64/mm/init.c b/arch/ppc64/mm/init.c
deleted file mode 100644
index be64b157afce..000000000000
--- a/arch/ppc64/mm/init.c
+++ /dev/null
@@ -1,869 +0,0 @@
1/*
2 * PowerPC version
3 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
4 *
5 * Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
6 * and Cort Dougan (PReP) (cort@cs.nmt.edu)
7 * Copyright (C) 1996 Paul Mackerras
8 * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk).
9 *
10 * Derived from "arch/i386/mm/init.c"
11 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
12 *
13 * Dave Engebretsen <engebret@us.ibm.com>
14 * Rework for PPC64 port.
15 *
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version
19 * 2 of the License, or (at your option) any later version.
20 *
21 */
22
23#include <linux/config.h>
24#include <linux/signal.h>
25#include <linux/sched.h>
26#include <linux/kernel.h>
27#include <linux/errno.h>
28#include <linux/string.h>
29#include <linux/types.h>
30#include <linux/mman.h>
31#include <linux/mm.h>
32#include <linux/swap.h>
33#include <linux/stddef.h>
34#include <linux/vmalloc.h>
35#include <linux/init.h>
36#include <linux/delay.h>
37#include <linux/bootmem.h>
38#include <linux/highmem.h>
39#include <linux/idr.h>
40#include <linux/nodemask.h>
41#include <linux/module.h>
42
43#include <asm/pgalloc.h>
44#include <asm/page.h>
45#include <asm/prom.h>
46#include <asm/lmb.h>
47#include <asm/rtas.h>
48#include <asm/io.h>
49#include <asm/mmu_context.h>
50#include <asm/pgtable.h>
51#include <asm/mmu.h>
52#include <asm/uaccess.h>
53#include <asm/smp.h>
54#include <asm/machdep.h>
55#include <asm/tlb.h>
56#include <asm/eeh.h>
57#include <asm/processor.h>
58#include <asm/mmzone.h>
59#include <asm/cputable.h>
60#include <asm/ppcdebug.h>
61#include <asm/sections.h>
62#include <asm/system.h>
63#include <asm/iommu.h>
64#include <asm/abs_addr.h>
65#include <asm/vdso.h>
66#include <asm/imalloc.h>
67
68#if PGTABLE_RANGE > USER_VSID_RANGE
69#warning Limited user VSID range means pagetable space is wasted
70#endif
71
72#if (TASK_SIZE_USER64 < PGTABLE_RANGE) && (TASK_SIZE_USER64 < USER_VSID_RANGE)
73#warning TASK_SIZE is smaller than it needs to be.
74#endif
75
76int mem_init_done;
77unsigned long ioremap_bot = IMALLOC_BASE;
78static unsigned long phbs_io_bot = PHBS_IO_BASE;
79
80extern pgd_t swapper_pg_dir[];
81extern struct task_struct *current_set[NR_CPUS];
82
83unsigned long klimit = (unsigned long)_end;
84
85unsigned long _SDR1=0;
86unsigned long _ASR=0;
87
88/* max amount of RAM to use */
89unsigned long __max_memory;
90
91/* info on what we think the IO hole is */
92unsigned long io_hole_start;
93unsigned long io_hole_size;
94
95void show_mem(void)
96{
97 unsigned long total = 0, reserved = 0;
98 unsigned long shared = 0, cached = 0;
99 struct page *page;
100 pg_data_t *pgdat;
101 unsigned long i;
102
103 printk("Mem-info:\n");
104 show_free_areas();
105 printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
106 for_each_pgdat(pgdat) {
107 for (i = 0; i < pgdat->node_spanned_pages; i++) {
108 page = pgdat_page_nr(pgdat, i);
109 total++;
110 if (PageReserved(page))
111 reserved++;
112 else if (PageSwapCache(page))
113 cached++;
114 else if (page_count(page))
115 shared += page_count(page) - 1;
116 }
117 }
118 printk("%ld pages of RAM\n", total);
119 printk("%ld reserved pages\n", reserved);
120 printk("%ld pages shared\n", shared);
121 printk("%ld pages swap cached\n", cached);
122}
123
124#ifdef CONFIG_PPC_ISERIES
125
126void __iomem *ioremap(unsigned long addr, unsigned long size)
127{
128 return (void __iomem *)addr;
129}
130
131extern void __iomem *__ioremap(unsigned long addr, unsigned long size,
132 unsigned long flags)
133{
134 return (void __iomem *)addr;
135}
136
137void iounmap(volatile void __iomem *addr)
138{
139 return;
140}
141
142#else
143
144/*
145 * map_io_page currently only called by __ioremap
146 * map_io_page adds an entry to the ioremap page table
147 * and adds an entry to the HPT, possibly bolting it
148 */
149static int map_io_page(unsigned long ea, unsigned long pa, int flags)
150{
151 pgd_t *pgdp;
152 pud_t *pudp;
153 pmd_t *pmdp;
154 pte_t *ptep;
155 unsigned long vsid;
156
157 if (mem_init_done) {
158 spin_lock(&init_mm.page_table_lock);
159 pgdp = pgd_offset_k(ea);
160 pudp = pud_alloc(&init_mm, pgdp, ea);
161 if (!pudp)
162 return -ENOMEM;
163 pmdp = pmd_alloc(&init_mm, pudp, ea);
164 if (!pmdp)
165 return -ENOMEM;
166 ptep = pte_alloc_kernel(&init_mm, pmdp, ea);
167 if (!ptep)
168 return -ENOMEM;
169 set_pte_at(&init_mm, ea, ptep, pfn_pte(pa >> PAGE_SHIFT,
170 __pgprot(flags)));
171 spin_unlock(&init_mm.page_table_lock);
172 } else {
173 unsigned long va, vpn, hash, hpteg;
174
175 /*
176 * If the mm subsystem is not fully up, we cannot create a
177 * linux page table entry for this mapping. Simply bolt an
178 * entry in the hardware page table.
179 */
180 vsid = get_kernel_vsid(ea);
181 va = (vsid << 28) | (ea & 0xFFFFFFF);
182 vpn = va >> PAGE_SHIFT;
183
184 hash = hpt_hash(vpn, 0);
185
186 hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP);
187
188 /* Panic if a pte grpup is full */
189 if (ppc_md.hpte_insert(hpteg, va, pa >> PAGE_SHIFT,
190 HPTE_V_BOLTED,
191 _PAGE_NO_CACHE|_PAGE_GUARDED|PP_RWXX)
192 == -1) {
193 panic("map_io_page: could not insert mapping");
194 }
195 }
196 return 0;
197}
198
199
200static void __iomem * __ioremap_com(unsigned long addr, unsigned long pa,
201 unsigned long ea, unsigned long size,
202 unsigned long flags)
203{
204 unsigned long i;
205
206 if ((flags & _PAGE_PRESENT) == 0)
207 flags |= pgprot_val(PAGE_KERNEL);
208
209 for (i = 0; i < size; i += PAGE_SIZE)
210 if (map_io_page(ea+i, pa+i, flags))
211 return NULL;
212
213 return (void __iomem *) (ea + (addr & ~PAGE_MASK));
214}
215
216
217void __iomem *
218ioremap(unsigned long addr, unsigned long size)
219{
220 return __ioremap(addr, size, _PAGE_NO_CACHE | _PAGE_GUARDED);
221}
222
223void __iomem * __ioremap(unsigned long addr, unsigned long size,
224 unsigned long flags)
225{
226 unsigned long pa, ea;
227 void __iomem *ret;
228
229 /*
230 * Choose an address to map it to.
231 * Once the imalloc system is running, we use it.
232 * Before that, we map using addresses going
233 * up from ioremap_bot. imalloc will use
234 * the addresses from ioremap_bot through
235 * IMALLOC_END
236 *
237 */
238 pa = addr & PAGE_MASK;
239 size = PAGE_ALIGN(addr + size) - pa;
240
241 if (size == 0)
242 return NULL;
243
244 if (mem_init_done) {
245 struct vm_struct *area;
246 area = im_get_free_area(size);
247 if (area == NULL)
248 return NULL;
249 ea = (unsigned long)(area->addr);
250 ret = __ioremap_com(addr, pa, ea, size, flags);
251 if (!ret)
252 im_free(area->addr);
253 } else {
254 ea = ioremap_bot;
255 ret = __ioremap_com(addr, pa, ea, size, flags);
256 if (ret)
257 ioremap_bot += size;
258 }
259 return ret;
260}
261
262#define IS_PAGE_ALIGNED(_val) ((_val) == ((_val) & PAGE_MASK))
263
264int __ioremap_explicit(unsigned long pa, unsigned long ea,
265 unsigned long size, unsigned long flags)
266{
267 struct vm_struct *area;
268 void __iomem *ret;
269
270 /* For now, require page-aligned values for pa, ea, and size */
271 if (!IS_PAGE_ALIGNED(pa) || !IS_PAGE_ALIGNED(ea) ||
272 !IS_PAGE_ALIGNED(size)) {
273 printk(KERN_ERR "unaligned value in %s\n", __FUNCTION__);
274 return 1;
275 }
276
277 if (!mem_init_done) {
278 /* Two things to consider in this case:
279 * 1) No records will be kept (imalloc, etc) that the region
280 * has been remapped
281 * 2) It won't be easy to iounmap() the region later (because
282 * of 1)
283 */
284 ;
285 } else {
286 area = im_get_area(ea, size,
287 IM_REGION_UNUSED|IM_REGION_SUBSET|IM_REGION_EXISTS);
288 if (area == NULL) {
289 /* Expected when PHB-dlpar is in play */
290 return 1;
291 }
292 if (ea != (unsigned long) area->addr) {
293 printk(KERN_ERR "unexpected addr return from "
294 "im_get_area\n");
295 return 1;
296 }
297 }
298
299 ret = __ioremap_com(pa, pa, ea, size, flags);
300 if (ret == NULL) {
301 printk(KERN_ERR "ioremap_explicit() allocation failure !\n");
302 return 1;
303 }
304 if (ret != (void *) ea) {
305 printk(KERN_ERR "__ioremap_com() returned unexpected addr\n");
306 return 1;
307 }
308
309 return 0;
310}
311
312/*
313 * Unmap an IO region and remove it from imalloc'd list.
314 * Access to IO memory should be serialized by driver.
315 * This code is modeled after vmalloc code - unmap_vm_area()
316 *
317 * XXX what about calls before mem_init_done (ie python_countermeasures())
318 */
319void iounmap(volatile void __iomem *token)
320{
321 void *addr;
322
323 if (!mem_init_done)
324 return;
325
326 addr = (void *) ((unsigned long __force) token & PAGE_MASK);
327
328 im_free(addr);
329}
330
331static int iounmap_subset_regions(unsigned long addr, unsigned long size)
332{
333 struct vm_struct *area;
334
335 /* Check whether subsets of this region exist */
336 area = im_get_area(addr, size, IM_REGION_SUPERSET);
337 if (area == NULL)
338 return 1;
339
340 while (area) {
341 iounmap((void __iomem *) area->addr);
342 area = im_get_area(addr, size,
343 IM_REGION_SUPERSET);
344 }
345
346 return 0;
347}
348
349int iounmap_explicit(volatile void __iomem *start, unsigned long size)
350{
351 struct vm_struct *area;
352 unsigned long addr;
353 int rc;
354
355 addr = (unsigned long __force) start & PAGE_MASK;
356
357 /* Verify that the region either exists or is a subset of an existing
358 * region. In the latter case, split the parent region to create
359 * the exact region
360 */
361 area = im_get_area(addr, size,
362 IM_REGION_EXISTS | IM_REGION_SUBSET);
363 if (area == NULL) {
364 /* Determine whether subset regions exist. If so, unmap */
365 rc = iounmap_subset_regions(addr, size);
366 if (rc) {
367 printk(KERN_ERR
368 "%s() cannot unmap nonexistent range 0x%lx\n",
369 __FUNCTION__, addr);
370 return 1;
371 }
372 } else {
373 iounmap((void __iomem *) area->addr);
374 }
375 /*
376 * FIXME! This can't be right:
377 iounmap(area->addr);
378 * Maybe it should be "iounmap(area);"
379 */
380 return 0;
381}
382
383#endif
384
385EXPORT_SYMBOL(ioremap);
386EXPORT_SYMBOL(__ioremap);
387EXPORT_SYMBOL(iounmap);
388
389void free_initmem(void)
390{
391 unsigned long addr;
392
393 addr = (unsigned long)__init_begin;
394 for (; addr < (unsigned long)__init_end; addr += PAGE_SIZE) {
395 memset((void *)addr, 0xcc, PAGE_SIZE);
396 ClearPageReserved(virt_to_page(addr));
397 set_page_count(virt_to_page(addr), 1);
398 free_page(addr);
399 totalram_pages++;
400 }
401 printk ("Freeing unused kernel memory: %luk freed\n",
402 ((unsigned long)__init_end - (unsigned long)__init_begin) >> 10);
403}
404
405#ifdef CONFIG_BLK_DEV_INITRD
406void free_initrd_mem(unsigned long start, unsigned long end)
407{
408 if (start < end)
409 printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
410 for (; start < end; start += PAGE_SIZE) {
411 ClearPageReserved(virt_to_page(start));
412 set_page_count(virt_to_page(start), 1);
413 free_page(start);
414 totalram_pages++;
415 }
416}
417#endif
418
419static DEFINE_SPINLOCK(mmu_context_lock);
420static DEFINE_IDR(mmu_context_idr);
421
422int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
423{
424 int index;
425 int err;
426
427again:
428 if (!idr_pre_get(&mmu_context_idr, GFP_KERNEL))
429 return -ENOMEM;
430
431 spin_lock(&mmu_context_lock);
432 err = idr_get_new_above(&mmu_context_idr, NULL, 1, &index);
433 spin_unlock(&mmu_context_lock);
434
435 if (err == -EAGAIN)
436 goto again;
437 else if (err)
438 return err;
439
440 if (index > MAX_CONTEXT) {
441 idr_remove(&mmu_context_idr, index);
442 return -ENOMEM;
443 }
444
445 mm->context.id = index;
446
447 return 0;
448}
449
450void destroy_context(struct mm_struct *mm)
451{
452 spin_lock(&mmu_context_lock);
453 idr_remove(&mmu_context_idr, mm->context.id);
454 spin_unlock(&mmu_context_lock);
455
456 mm->context.id = NO_CONTEXT;
457}
458
459/*
460 * Do very early mm setup.
461 */
462void __init mm_init_ppc64(void)
463{
464#ifndef CONFIG_PPC_ISERIES
465 unsigned long i;
466#endif
467
468 ppc64_boot_msg(0x100, "MM Init");
469
470 /* This is the story of the IO hole... please, keep seated,
471 * unfortunately, we are out of oxygen masks at the moment.
472 * So we need some rough way to tell where your big IO hole
473 * is. On pmac, it's between 2G and 4G, on POWER3, it's around
474 * that area as well, on POWER4 we don't have one, etc...
475 * We need that as a "hint" when sizing the TCE table on POWER3
476 * So far, the simplest way that seem work well enough for us it
477 * to just assume that the first discontinuity in our physical
478 * RAM layout is the IO hole. That may not be correct in the future
479 * (and isn't on iSeries but then we don't care ;)
480 */
481
482#ifndef CONFIG_PPC_ISERIES
483 for (i = 1; i < lmb.memory.cnt; i++) {
484 unsigned long base, prevbase, prevsize;
485
486 prevbase = lmb.memory.region[i-1].base;
487 prevsize = lmb.memory.region[i-1].size;
488 base = lmb.memory.region[i].base;
489 if (base > (prevbase + prevsize)) {
490 io_hole_start = prevbase + prevsize;
491 io_hole_size = base - (prevbase + prevsize);
492 break;
493 }
494 }
495#endif /* CONFIG_PPC_ISERIES */
496 if (io_hole_start)
497 printk("IO Hole assumed to be %lx -> %lx\n",
498 io_hole_start, io_hole_start + io_hole_size - 1);
499
500 ppc64_boot_msg(0x100, "MM Init Done");
501}
502
503/*
504 * This is called by /dev/mem to know if a given address has to
505 * be mapped non-cacheable or not
506 */
507int page_is_ram(unsigned long pfn)
508{
509 int i;
510 unsigned long paddr = (pfn << PAGE_SHIFT);
511
512 for (i=0; i < lmb.memory.cnt; i++) {
513 unsigned long base;
514
515 base = lmb.memory.region[i].base;
516
517 if ((paddr >= base) &&
518 (paddr < (base + lmb.memory.region[i].size))) {
519 return 1;
520 }
521 }
522
523 return 0;
524}
525EXPORT_SYMBOL(page_is_ram);
526
527/*
528 * Initialize the bootmem system and give it all the memory we
529 * have available.
530 */
531#ifndef CONFIG_NEED_MULTIPLE_NODES
532void __init do_init_bootmem(void)
533{
534 unsigned long i;
535 unsigned long start, bootmap_pages;
536 unsigned long total_pages = lmb_end_of_DRAM() >> PAGE_SHIFT;
537 int boot_mapsize;
538
539 /*
540 * Find an area to use for the bootmem bitmap. Calculate the size of
541 * bitmap required as (Total Memory) / PAGE_SIZE / BITS_PER_BYTE.
542 * Add 1 additional page in case the address isn't page-aligned.
543 */
544 bootmap_pages = bootmem_bootmap_pages(total_pages);
545
546 start = lmb_alloc(bootmap_pages<<PAGE_SHIFT, PAGE_SIZE);
547 BUG_ON(!start);
548
549 boot_mapsize = init_bootmem(start >> PAGE_SHIFT, total_pages);
550
551 max_pfn = max_low_pfn;
552
553 /* Add all physical memory to the bootmem map, mark each area
554 * present.
555 */
556 for (i=0; i < lmb.memory.cnt; i++)
557 free_bootmem(lmb.memory.region[i].base,
558 lmb_size_bytes(&lmb.memory, i));
559
560 /* reserve the sections we're already using */
561 for (i=0; i < lmb.reserved.cnt; i++)
562 reserve_bootmem(lmb.reserved.region[i].base,
563 lmb_size_bytes(&lmb.reserved, i));
564
565 for (i=0; i < lmb.memory.cnt; i++)
566 memory_present(0, lmb_start_pfn(&lmb.memory, i),
567 lmb_end_pfn(&lmb.memory, i));
568}
569
570/*
571 * paging_init() sets up the page tables - in fact we've already done this.
572 */
573void __init paging_init(void)
574{
575 unsigned long zones_size[MAX_NR_ZONES];
576 unsigned long zholes_size[MAX_NR_ZONES];
577 unsigned long total_ram = lmb_phys_mem_size();
578 unsigned long top_of_ram = lmb_end_of_DRAM();
579
580 printk(KERN_INFO "Top of RAM: 0x%lx, Total RAM: 0x%lx\n",
581 top_of_ram, total_ram);
582 printk(KERN_INFO "Memory hole size: %ldMB\n",
583 (top_of_ram - total_ram) >> 20);
584 /*
585 * All pages are DMA-able so we put them all in the DMA zone.
586 */
587 memset(zones_size, 0, sizeof(zones_size));
588 memset(zholes_size, 0, sizeof(zholes_size));
589
590 zones_size[ZONE_DMA] = top_of_ram >> PAGE_SHIFT;
591 zholes_size[ZONE_DMA] = (top_of_ram - total_ram) >> PAGE_SHIFT;
592
593 free_area_init_node(0, NODE_DATA(0), zones_size,
594 __pa(PAGE_OFFSET) >> PAGE_SHIFT, zholes_size);
595}
596#endif /* ! CONFIG_NEED_MULTIPLE_NODES */
597
598static struct kcore_list kcore_vmem;
599
600static int __init setup_kcore(void)
601{
602 int i;
603
604 for (i=0; i < lmb.memory.cnt; i++) {
605 unsigned long base, size;
606 struct kcore_list *kcore_mem;
607
608 base = lmb.memory.region[i].base;
609 size = lmb.memory.region[i].size;
610
611 /* GFP_ATOMIC to avoid might_sleep warnings during boot */
612 kcore_mem = kmalloc(sizeof(struct kcore_list), GFP_ATOMIC);
613 if (!kcore_mem)
614 panic("mem_init: kmalloc failed\n");
615
616 kclist_add(kcore_mem, __va(base), size);
617 }
618
619 kclist_add(&kcore_vmem, (void *)VMALLOC_START, VMALLOC_END-VMALLOC_START);
620
621 return 0;
622}
623module_init(setup_kcore);
624
625void __init mem_init(void)
626{
627#ifdef CONFIG_NEED_MULTIPLE_NODES
628 int nid;
629#endif
630 pg_data_t *pgdat;
631 unsigned long i;
632 struct page *page;
633 unsigned long reservedpages = 0, codesize, initsize, datasize, bsssize;
634
635 num_physpages = max_low_pfn; /* RAM is assumed contiguous */
636 high_memory = (void *) __va(max_low_pfn * PAGE_SIZE);
637
638#ifdef CONFIG_NEED_MULTIPLE_NODES
639 for_each_online_node(nid) {
640 if (NODE_DATA(nid)->node_spanned_pages != 0) {
641 printk("freeing bootmem node %x\n", nid);
642 totalram_pages +=
643 free_all_bootmem_node(NODE_DATA(nid));
644 }
645 }
646#else
647 max_mapnr = num_physpages;
648 totalram_pages += free_all_bootmem();
649#endif
650
651 for_each_pgdat(pgdat) {
652 for (i = 0; i < pgdat->node_spanned_pages; i++) {
653 page = pgdat_page_nr(pgdat, i);
654 if (PageReserved(page))
655 reservedpages++;
656 }
657 }
658
659 codesize = (unsigned long)&_etext - (unsigned long)&_stext;
660 initsize = (unsigned long)&__init_end - (unsigned long)&__init_begin;
661 datasize = (unsigned long)&_edata - (unsigned long)&__init_end;
662 bsssize = (unsigned long)&__bss_stop - (unsigned long)&__bss_start;
663
664 printk(KERN_INFO "Memory: %luk/%luk available (%luk kernel code, "
665 "%luk reserved, %luk data, %luk bss, %luk init)\n",
666 (unsigned long)nr_free_pages() << (PAGE_SHIFT-10),
667 num_physpages << (PAGE_SHIFT-10),
668 codesize >> 10,
669 reservedpages << (PAGE_SHIFT-10),
670 datasize >> 10,
671 bsssize >> 10,
672 initsize >> 10);
673
674 mem_init_done = 1;
675
676 /* Initialize the vDSO */
677 vdso_init();
678}
679
680/*
681 * This is called when a page has been modified by the kernel.
682 * It just marks the page as not i-cache clean. We do the i-cache
683 * flush later when the page is given to a user process, if necessary.
684 */
685void flush_dcache_page(struct page *page)
686{
687 if (cpu_has_feature(CPU_FTR_COHERENT_ICACHE))
688 return;
689 /* avoid an atomic op if possible */
690 if (test_bit(PG_arch_1, &page->flags))
691 clear_bit(PG_arch_1, &page->flags);
692}
693EXPORT_SYMBOL(flush_dcache_page);
694
695void clear_user_page(void *page, unsigned long vaddr, struct page *pg)
696{
697 clear_page(page);
698
699 if (cpu_has_feature(CPU_FTR_COHERENT_ICACHE))
700 return;
701 /*
702 * We shouldnt have to do this, but some versions of glibc
703 * require it (ld.so assumes zero filled pages are icache clean)
704 * - Anton
705 */
706
707 /* avoid an atomic op if possible */
708 if (test_bit(PG_arch_1, &pg->flags))
709 clear_bit(PG_arch_1, &pg->flags);
710}
711EXPORT_SYMBOL(clear_user_page);
712
713void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
714 struct page *pg)
715{
716 copy_page(vto, vfrom);
717
718 /*
719 * We should be able to use the following optimisation, however
720 * there are two problems.
721 * Firstly a bug in some versions of binutils meant PLT sections
722 * were not marked executable.
723 * Secondly the first word in the GOT section is blrl, used
724 * to establish the GOT address. Until recently the GOT was
725 * not marked executable.
726 * - Anton
727 */
728#if 0
729 if (!vma->vm_file && ((vma->vm_flags & VM_EXEC) == 0))
730 return;
731#endif
732
733 if (cpu_has_feature(CPU_FTR_COHERENT_ICACHE))
734 return;
735
736 /* avoid an atomic op if possible */
737 if (test_bit(PG_arch_1, &pg->flags))
738 clear_bit(PG_arch_1, &pg->flags);
739}
740
741void flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
742 unsigned long addr, int len)
743{
744 unsigned long maddr;
745
746 maddr = (unsigned long)page_address(page) + (addr & ~PAGE_MASK);
747 flush_icache_range(maddr, maddr + len);
748}
749EXPORT_SYMBOL(flush_icache_user_range);
750
751/*
752 * This is called at the end of handling a user page fault, when the
753 * fault has been handled by updating a PTE in the linux page tables.
754 * We use it to preload an HPTE into the hash table corresponding to
755 * the updated linux PTE.
756 *
757 * This must always be called with the mm->page_table_lock held
758 */
759void update_mmu_cache(struct vm_area_struct *vma, unsigned long ea,
760 pte_t pte)
761{
762 unsigned long vsid;
763 void *pgdir;
764 pte_t *ptep;
765 int local = 0;
766 cpumask_t tmp;
767 unsigned long flags;
768
769 /* handle i-cache coherency */
770 if (!cpu_has_feature(CPU_FTR_COHERENT_ICACHE) &&
771 !cpu_has_feature(CPU_FTR_NOEXECUTE)) {
772 unsigned long pfn = pte_pfn(pte);
773 if (pfn_valid(pfn)) {
774 struct page *page = pfn_to_page(pfn);
775 if (!PageReserved(page)
776 && !test_bit(PG_arch_1, &page->flags)) {
777 __flush_dcache_icache(page_address(page));
778 set_bit(PG_arch_1, &page->flags);
779 }
780 }
781 }
782
783 /* We only want HPTEs for linux PTEs that have _PAGE_ACCESSED set */
784 if (!pte_young(pte))
785 return;
786
787 pgdir = vma->vm_mm->pgd;
788 if (pgdir == NULL)
789 return;
790
791 ptep = find_linux_pte(pgdir, ea);
792 if (!ptep)
793 return;
794
795 vsid = get_vsid(vma->vm_mm->context.id, ea);
796
797 local_irq_save(flags);
798 tmp = cpumask_of_cpu(smp_processor_id());
799 if (cpus_equal(vma->vm_mm->cpu_vm_mask, tmp))
800 local = 1;
801
802 __hash_page(ea, 0, vsid, ptep, 0x300, local);
803 local_irq_restore(flags);
804}
805
806void __iomem * reserve_phb_iospace(unsigned long size)
807{
808 void __iomem *virt_addr;
809
810 if (phbs_io_bot >= IMALLOC_BASE)
811 panic("reserve_phb_iospace(): phb io space overflow\n");
812
813 virt_addr = (void __iomem *) phbs_io_bot;
814 phbs_io_bot += size;
815
816 return virt_addr;
817}
818
819static void zero_ctor(void *addr, kmem_cache_t *cache, unsigned long flags)
820{
821 memset(addr, 0, kmem_cache_size(cache));
822}
823
824static const int pgtable_cache_size[2] = {
825 PTE_TABLE_SIZE, PMD_TABLE_SIZE
826};
827static const char *pgtable_cache_name[ARRAY_SIZE(pgtable_cache_size)] = {
828 "pgd_pte_cache", "pud_pmd_cache",
829};
830
831kmem_cache_t *pgtable_cache[ARRAY_SIZE(pgtable_cache_size)];
832
833void pgtable_cache_init(void)
834{
835 int i;
836
837 BUILD_BUG_ON(PTE_TABLE_SIZE != pgtable_cache_size[PTE_CACHE_NUM]);
838 BUILD_BUG_ON(PMD_TABLE_SIZE != pgtable_cache_size[PMD_CACHE_NUM]);
839 BUILD_BUG_ON(PUD_TABLE_SIZE != pgtable_cache_size[PUD_CACHE_NUM]);
840 BUILD_BUG_ON(PGD_TABLE_SIZE != pgtable_cache_size[PGD_CACHE_NUM]);
841
842 for (i = 0; i < ARRAY_SIZE(pgtable_cache_size); i++) {
843 int size = pgtable_cache_size[i];
844 const char *name = pgtable_cache_name[i];
845
846 pgtable_cache[i] = kmem_cache_create(name,
847 size, size,
848 SLAB_HWCACHE_ALIGN
849 | SLAB_MUST_HWCACHE_ALIGN,
850 zero_ctor,
851 NULL);
852 if (! pgtable_cache[i])
853 panic("pgtable_cache_init(): could not create %s!\n",
854 name);
855 }
856}
857
858pgprot_t phys_mem_access_prot(struct file *file, unsigned long addr,
859 unsigned long size, pgprot_t vma_prot)
860{
861 if (ppc_md.phys_mem_access_prot)
862 return ppc_md.phys_mem_access_prot(file, addr, size, vma_prot);
863
864 if (!page_is_ram(addr >> PAGE_SHIFT))
865 vma_prot = __pgprot(pgprot_val(vma_prot)
866 | _PAGE_GUARDED | _PAGE_NO_CACHE);
867 return vma_prot;
868}
869EXPORT_SYMBOL(phys_mem_access_prot);
diff --git a/arch/ppc64/oprofile/Kconfig b/arch/ppc64/oprofile/Kconfig
deleted file mode 100644
index 5ade19801b97..000000000000
--- a/arch/ppc64/oprofile/Kconfig
+++ /dev/null
@@ -1,23 +0,0 @@
1
2menu "Profiling support"
3 depends on EXPERIMENTAL
4
5config PROFILING
6 bool "Profiling support (EXPERIMENTAL)"
7 help
8 Say Y here to enable the extended profiling support mechanisms used
9 by profilers such as OProfile.
10
11
12config OPROFILE
13 tristate "OProfile system profiling (EXPERIMENTAL)"
14 depends on PROFILING
15 help
16 OProfile is a profiling system capable of profiling the
17 whole system, include the kernel, kernel modules, libraries,
18 and applications.
19
20 If unsure, say N.
21
22endmenu
23
diff --git a/arch/ppc64/oprofile/Makefile b/arch/ppc64/oprofile/Makefile
deleted file mode 100644
index 162dbf06c142..000000000000
--- a/arch/ppc64/oprofile/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
1obj-$(CONFIG_OPROFILE) += oprofile.o
2
3DRIVER_OBJS := $(addprefix ../../../drivers/oprofile/, \
4 oprof.o cpu_buffer.o buffer_sync.o \
5 event_buffer.o oprofile_files.o \
6 oprofilefs.o oprofile_stats.o \
7 timer_int.o )
8
9oprofile-y := $(DRIVER_OBJS) common.o op_model_rs64.o op_model_power4.o
diff --git a/arch/ppc64/xmon/Makefile b/arch/ppc64/xmon/Makefile
deleted file mode 100644
index fb21a7088d3e..000000000000
--- a/arch/ppc64/xmon/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
1# Makefile for xmon
2
3EXTRA_CFLAGS += -mno-minimal-toc
4
5obj-y := start.o xmon.o ppc-dis.o ppc-opc.o subr_prf.o setjmp.o
diff --git a/arch/ppc64/xmon/setjmp.S b/arch/ppc64/xmon/setjmp.S
deleted file mode 100644
index 30ee643d557c..000000000000
--- a/arch/ppc64/xmon/setjmp.S
+++ /dev/null
@@ -1,73 +0,0 @@
1/*
2 * Copyright (C) 1996 Paul Mackerras.
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 * NOTE: assert(sizeof(buf) > 184)
10 */
11#include <asm/processor.h>
12#include <asm/ppc_asm.h>
13
14_GLOBAL(xmon_setjmp)
15 mflr r0
16 std r0,0(r3)
17 std r1,8(r3)
18 std r2,16(r3)
19 mfcr r0
20 std r0,24(r3)
21 std r13,32(r3)
22 std r14,40(r3)
23 std r15,48(r3)
24 std r16,56(r3)
25 std r17,64(r3)
26 std r18,72(r3)
27 std r19,80(r3)
28 std r20,88(r3)
29 std r21,96(r3)
30 std r22,104(r3)
31 std r23,112(r3)
32 std r24,120(r3)
33 std r25,128(r3)
34 std r26,136(r3)
35 std r27,144(r3)
36 std r28,152(r3)
37 std r29,160(r3)
38 std r30,168(r3)
39 std r31,176(r3)
40 li r3,0
41 blr
42
43_GLOBAL(xmon_longjmp)
44 cmpdi r4,0
45 bne 1f
46 li r4,1
471: ld r13,32(r3)
48 ld r14,40(r3)
49 ld r15,48(r3)
50 ld r16,56(r3)
51 ld r17,64(r3)
52 ld r18,72(r3)
53 ld r19,80(r3)
54 ld r20,88(r3)
55 ld r21,96(r3)
56 ld r22,104(r3)
57 ld r23,112(r3)
58 ld r24,120(r3)
59 ld r25,128(r3)
60 ld r26,136(r3)
61 ld r27,144(r3)
62 ld r28,152(r3)
63 ld r29,160(r3)
64 ld r30,168(r3)
65 ld r31,176(r3)
66 ld r0,24(r3)
67 mtcrf 56,r0
68 ld r0,0(r3)
69 ld r1,8(r3)
70 ld r2,16(r3)
71 mtlr r0
72 mr r3,r4
73 blr
diff --git a/arch/s390/kernel/compat_ioctl.c b/arch/s390/kernel/compat_ioctl.c
index 24a1e9f069a7..6504c4e69986 100644
--- a/arch/s390/kernel/compat_ioctl.c
+++ b/arch/s390/kernel/compat_ioctl.c
@@ -18,6 +18,8 @@
18#include <asm/dasd.h> 18#include <asm/dasd.h>
19#include <asm/cmb.h> 19#include <asm/cmb.h>
20#include <asm/tape390.h> 20#include <asm/tape390.h>
21#include <asm/ccwdev.h>
22#include "../../../drivers/s390/char/raw3270.h"
21 23
22static int do_ioctl32_pointer(unsigned int fd, unsigned int cmd, 24static int do_ioctl32_pointer(unsigned int fd, unsigned int cmd,
23 unsigned long arg, struct file *f) 25 unsigned long arg, struct file *f)
@@ -62,6 +64,13 @@ COMPATIBLE_IOCTL(BIODASDCMFENABLE)
62COMPATIBLE_IOCTL(BIODASDCMFDISABLE) 64COMPATIBLE_IOCTL(BIODASDCMFDISABLE)
63COMPATIBLE_IOCTL(BIODASDREADALLCMB) 65COMPATIBLE_IOCTL(BIODASDREADALLCMB)
64 66
67COMPATIBLE_IOCTL(TUBICMD)
68COMPATIBLE_IOCTL(TUBOCMD)
69COMPATIBLE_IOCTL(TUBGETI)
70COMPATIBLE_IOCTL(TUBGETO)
71COMPATIBLE_IOCTL(TUBSETMOD)
72COMPATIBLE_IOCTL(TUBGETMOD)
73
65COMPATIBLE_IOCTL(TAPE390_DISPLAY) 74COMPATIBLE_IOCTL(TAPE390_DISPLAY)
66 75
67/* s390 doesn't need handlers here */ 76/* s390 doesn't need handlers here */
diff --git a/arch/s390/kernel/head.S b/arch/s390/kernel/head.S
index 55654b6e16dc..039354d72348 100644
--- a/arch/s390/kernel/head.S
+++ b/arch/s390/kernel/head.S
@@ -485,7 +485,9 @@ start:
485# 485#
486 .org 0x10000 486 .org 0x10000
487startup:basr %r13,0 # get base 487startup:basr %r13,0 # get base
488.LPG1: lctl %c0,%c15,.Lctl-.LPG1(%r13) # load control registers 488.LPG1: l %r1, .Lget_ipl_device_addr-.LPG1(%r13)
489 basr %r14, %r1
490 lctl %c0,%c15,.Lctl-.LPG1(%r13) # load control registers
489 la %r12,_pstart-.LPG1(%r13) # pointer to parameter area 491 la %r12,_pstart-.LPG1(%r13) # pointer to parameter area
490 # move IPL device to lowcore 492 # move IPL device to lowcore
491 mvc __LC_IPLDEV(4),IPL_DEVICE-PARMAREA(%r12) 493 mvc __LC_IPLDEV(4),IPL_DEVICE-PARMAREA(%r12)
@@ -560,6 +562,9 @@ startup:basr %r13,0 # get base
560 mr %r2,%r1 # mem size in bytes in %r3 562 mr %r2,%r1 # mem size in bytes in %r3
561 b .Lfchunk-.LPG1(%r13) 563 b .Lfchunk-.LPG1(%r13)
562 564
565 .align 4
566.Lget_ipl_device_addr:
567 .long .Lget_ipl_device
563.Lpmask: 568.Lpmask:
564 .byte 0 569 .byte 0
565.align 8 570.align 8
@@ -755,6 +760,63 @@ _pstart:
755 .global _pend 760 .global _pend
756_pend: 761_pend:
757 762
763.Lget_ipl_device:
764 basr %r12,0
765.LPG2: l %r1,0xb8 # get sid
766 sll %r1,15 # test if subchannel is enabled
767 srl %r1,31
768 ltr %r1,%r1
769 bz 0(%r14) # subchannel disabled
770 l %r1,0xb8
771 la %r5,.Lipl_schib-.LPG2(%r12)
772 stsch 0(%r5) # get schib of subchannel
773 bnz 0(%r14) # schib not available
774 tm 5(%r5),0x01 # devno valid?
775 bno 0(%r14)
776 la %r6,ipl_parameter_flags-.LPG2(%r12)
777 oi 3(%r6),0x01 # set flag
778 la %r2,ipl_devno-.LPG2(%r12)
779 mvc 0(2,%r2),6(%r5) # store devno
780 tm 4(%r5),0x80 # qdio capable device?
781 bno 0(%r14)
782 oi 3(%r6),0x02 # set flag
783
784 # copy ipl parameters
785
786 lhi %r0,4096
787 l %r2,20(%r0) # get address of parameter list
788 lhi %r3,IPL_PARMBLOCK_ORIGIN
789 st %r3,20(%r0)
790 lhi %r4,1
791 cr %r2,%r3 # start parameters < destination ?
792 jl 0f
793 lhi %r1,1 # copy direction is upwards
794 j 1f
7950: lhi %r1,-1 # copy direction is downwards
796 ar %r2,%r0
797 ar %r3,%r0
798 ar %r2,%r1
799 ar %r3,%r1
8001: mvc 0(1,%r3),0(%r2) # finally copy ipl parameters
801 ar %r3,%r1
802 ar %r2,%r1
803 sr %r0,%r4
804 jne 1b
805 b 0(%r14)
806
807 .align 4
808.Lipl_schib:
809 .rept 13
810 .long 0
811 .endr
812
813 .globl ipl_parameter_flags
814ipl_parameter_flags:
815 .long 0
816 .globl ipl_devno
817ipl_devno:
818 .word 0
819
758#ifdef CONFIG_SHARED_KERNEL 820#ifdef CONFIG_SHARED_KERNEL
759 .org 0x100000 821 .org 0x100000
760#endif 822#endif
@@ -764,11 +826,11 @@ _pend:
764# 826#
765 .globl _stext 827 .globl _stext
766_stext: basr %r13,0 # get base 828_stext: basr %r13,0 # get base
767.LPG2: 829.LPG3:
768# 830#
769# Setup stack 831# Setup stack
770# 832#
771 l %r15,.Linittu-.LPG2(%r13) 833 l %r15,.Linittu-.LPG3(%r13)
772 mvc __LC_CURRENT(4),__TI_task(%r15) 834 mvc __LC_CURRENT(4),__TI_task(%r15)
773 ahi %r15,1<<(PAGE_SHIFT+THREAD_ORDER) # init_task_union + THREAD_SIZE 835 ahi %r15,1<<(PAGE_SHIFT+THREAD_ORDER) # init_task_union + THREAD_SIZE
774 st %r15,__LC_KERNEL_STACK # set end of kernel stack 836 st %r15,__LC_KERNEL_STACK # set end of kernel stack
@@ -782,8 +844,8 @@ _stext: basr %r13,0 # get base
782 lctl %c0,%c15,0(%r15) 844 lctl %c0,%c15,0(%r15)
783 845
784# 846#
785 lam 0,15,.Laregs-.LPG2(%r13) # load access regs needed by uaccess 847 lam 0,15,.Laregs-.LPG3(%r13) # load access regs needed by uaccess
786 l %r14,.Lstart-.LPG2(%r13) 848 l %r14,.Lstart-.LPG3(%r13)
787 basr %r14,%r14 # call start_kernel 849 basr %r14,%r14 # call start_kernel
788# 850#
789# We returned from start_kernel ?!? PANIK 851# We returned from start_kernel ?!? PANIK
diff --git a/arch/s390/kernel/head64.S b/arch/s390/kernel/head64.S
index c9ff0404c875..193aafa72f54 100644
--- a/arch/s390/kernel/head64.S
+++ b/arch/s390/kernel/head64.S
@@ -484,6 +484,8 @@ start:
484startup:basr %r13,0 # get base 484startup:basr %r13,0 # get base
485.LPG1: sll %r13,1 # remove high order bit 485.LPG1: sll %r13,1 # remove high order bit
486 srl %r13,1 486 srl %r13,1
487 l %r1,.Lget_ipl_device_addr-.LPG1(%r13)
488 basr %r14,%r1
487 lhi %r1,1 # mode 1 = esame 489 lhi %r1,1 # mode 1 = esame
488 slr %r0,%r0 # set cpuid to zero 490 slr %r0,%r0 # set cpuid to zero
489 sigp %r1,%r0,0x12 # switch to esame mode 491 sigp %r1,%r0,0x12 # switch to esame mode
@@ -556,6 +558,9 @@ startup:basr %r13,0 # get base
556 mlgr %r2,%r1 # mem size in bytes in %r3 558 mlgr %r2,%r1 # mem size in bytes in %r3
557 b .Lfchunk-.LPG1(%r13) 559 b .Lfchunk-.LPG1(%r13)
558 560
561 .align 4
562.Lget_ipl_device_addr:
563 .long .Lget_ipl_device
559.Lpmask: 564.Lpmask:
560 .byte 0 565 .byte 0
561 .align 8 566 .align 8
@@ -746,6 +751,63 @@ _pstart:
746 .global _pend 751 .global _pend
747_pend: 752_pend:
748 753
754.Lget_ipl_device:
755 basr %r12,0
756.LPG2: l %r1,0xb8 # get sid
757 sll %r1,15 # test if subchannel is enabled
758 srl %r1,31
759 ltr %r1,%r1
760 bz 0(%r14) # subchannel disabled
761 l %r1,0xb8
762 la %r5,.Lipl_schib-.LPG2(%r12)
763 stsch 0(%r5) # get schib of subchannel
764 bnz 0(%r14) # schib not available
765 tm 5(%r5),0x01 # devno valid?
766 bno 0(%r14)
767 la %r6,ipl_parameter_flags-.LPG2(%r12)
768 oi 3(%r6),0x01 # set flag
769 la %r2,ipl_devno-.LPG2(%r12)
770 mvc 0(2,%r2),6(%r5) # store devno
771 tm 4(%r5),0x80 # qdio capable device?
772 bno 0(%r14)
773 oi 3(%r6),0x02 # set flag
774
775 # copy ipl parameters
776
777 lhi %r0,4096
778 l %r2,20(%r0) # get address of parameter list
779 lhi %r3,IPL_PARMBLOCK_ORIGIN
780 st %r3,20(%r0)
781 lhi %r4,1
782 cr %r2,%r3 # start parameters < destination ?
783 jl 0f
784 lhi %r1,1 # copy direction is upwards
785 j 1f
7860: lhi %r1,-1 # copy direction is downwards
787 ar %r2,%r0
788 ar %r3,%r0
789 ar %r2,%r1
790 ar %r3,%r1
7911: mvc 0(1,%r3),0(%r2) # finally copy ipl parameters
792 ar %r3,%r1
793 ar %r2,%r1
794 sr %r0,%r4
795 jne 1b
796 b 0(%r14)
797
798 .align 4
799.Lipl_schib:
800 .rept 13
801 .long 0
802 .endr
803
804 .globl ipl_parameter_flags
805ipl_parameter_flags:
806 .long 0
807 .globl ipl_devno
808ipl_devno:
809 .word 0
810
749#ifdef CONFIG_SHARED_KERNEL 811#ifdef CONFIG_SHARED_KERNEL
750 .org 0x100000 812 .org 0x100000
751#endif 813#endif
@@ -755,7 +817,7 @@ _pend:
755# 817#
756 .globl _stext 818 .globl _stext
757_stext: basr %r13,0 # get base 819_stext: basr %r13,0 # get base
758.LPG2: 820.LPG3:
759# 821#
760# Setup stack 822# Setup stack
761# 823#
@@ -774,7 +836,7 @@ _stext: basr %r13,0 # get base
774 lctlg %c0,%c15,0(%r15) 836 lctlg %c0,%c15,0(%r15)
775 837
776# 838#
777 lam 0,15,.Laregs-.LPG2(%r13) # load access regs needed by uaccess 839 lam 0,15,.Laregs-.LPG3(%r13) # load access regs needed by uaccess
778 brasl %r14,start_kernel # go to C code 840 brasl %r14,start_kernel # go to C code
779# 841#
780# We returned from start_kernel ?!? PANIK 842# We returned from start_kernel ?!? PANIK
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index 5204778b8e5e..31e7b19348b7 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -36,6 +36,7 @@
36#include <linux/console.h> 36#include <linux/console.h>
37#include <linux/seq_file.h> 37#include <linux/seq_file.h>
38#include <linux/kernel_stat.h> 38#include <linux/kernel_stat.h>
39#include <linux/device.h>
39 40
40#include <asm/uaccess.h> 41#include <asm/uaccess.h>
41#include <asm/system.h> 42#include <asm/system.h>
@@ -685,3 +686,188 @@ struct seq_operations cpuinfo_op = {
685 .show = show_cpuinfo, 686 .show = show_cpuinfo,
686}; 687};
687 688
689#define DEFINE_IPL_ATTR(_name, _format, _value) \
690static ssize_t ipl_##_name##_show(struct subsystem *subsys, \
691 char *page) \
692{ \
693 return sprintf(page, _format, _value); \
694} \
695static struct subsys_attribute ipl_##_name##_attr = \
696 __ATTR(_name, S_IRUGO, ipl_##_name##_show, NULL);
697
698DEFINE_IPL_ATTR(wwpn, "0x%016llx\n", (unsigned long long)
699 IPL_PARMBLOCK_START->fcp.wwpn);
700DEFINE_IPL_ATTR(lun, "0x%016llx\n", (unsigned long long)
701 IPL_PARMBLOCK_START->fcp.lun);
702DEFINE_IPL_ATTR(bootprog, "%lld\n", (unsigned long long)
703 IPL_PARMBLOCK_START->fcp.bootprog);
704DEFINE_IPL_ATTR(br_lba, "%lld\n", (unsigned long long)
705 IPL_PARMBLOCK_START->fcp.br_lba);
706
707enum ipl_type_type {
708 ipl_type_unknown,
709 ipl_type_ccw,
710 ipl_type_fcp,
711};
712
713static enum ipl_type_type
714get_ipl_type(void)
715{
716 struct ipl_parameter_block *ipl = IPL_PARMBLOCK_START;
717
718 if (!IPL_DEVNO_VALID)
719 return ipl_type_unknown;
720 if (!IPL_PARMBLOCK_VALID)
721 return ipl_type_ccw;
722 if (ipl->hdr.header.version > IPL_MAX_SUPPORTED_VERSION)
723 return ipl_type_unknown;
724 if (ipl->fcp.pbt != IPL_TYPE_FCP)
725 return ipl_type_unknown;
726 return ipl_type_fcp;
727}
728
729static ssize_t
730ipl_type_show(struct subsystem *subsys, char *page)
731{
732 switch (get_ipl_type()) {
733 case ipl_type_ccw:
734 return sprintf(page, "ccw\n");
735 case ipl_type_fcp:
736 return sprintf(page, "fcp\n");
737 default:
738 return sprintf(page, "unknown\n");
739 }
740}
741
742static struct subsys_attribute ipl_type_attr = __ATTR_RO(ipl_type);
743
744static ssize_t
745ipl_device_show(struct subsystem *subsys, char *page)
746{
747 struct ipl_parameter_block *ipl = IPL_PARMBLOCK_START;
748
749 switch (get_ipl_type()) {
750 case ipl_type_ccw:
751 return sprintf(page, "0.0.%04x\n", ipl_devno);
752 case ipl_type_fcp:
753 return sprintf(page, "0.0.%04x\n", ipl->fcp.devno);
754 default:
755 return 0;
756 }
757}
758
759static struct subsys_attribute ipl_device_attr =
760 __ATTR(device, S_IRUGO, ipl_device_show, NULL);
761
762static struct attribute *ipl_fcp_attrs[] = {
763 &ipl_type_attr.attr,
764 &ipl_device_attr.attr,
765 &ipl_wwpn_attr.attr,
766 &ipl_lun_attr.attr,
767 &ipl_bootprog_attr.attr,
768 &ipl_br_lba_attr.attr,
769 NULL,
770};
771
772static struct attribute_group ipl_fcp_attr_group = {
773 .attrs = ipl_fcp_attrs,
774};
775
776static struct attribute *ipl_ccw_attrs[] = {
777 &ipl_type_attr.attr,
778 &ipl_device_attr.attr,
779 NULL,
780};
781
782static struct attribute_group ipl_ccw_attr_group = {
783 .attrs = ipl_ccw_attrs,
784};
785
786static struct attribute *ipl_unknown_attrs[] = {
787 &ipl_type_attr.attr,
788 NULL,
789};
790
791static struct attribute_group ipl_unknown_attr_group = {
792 .attrs = ipl_unknown_attrs,
793};
794
795static ssize_t
796ipl_parameter_read(struct kobject *kobj, char *buf, loff_t off, size_t count)
797{
798 unsigned int size = IPL_PARMBLOCK_SIZE;
799
800 if (off > size)
801 return 0;
802 if (off + count > size)
803 count = size - off;
804
805 memcpy(buf, (void *) IPL_PARMBLOCK_START + off, count);
806 return count;
807}
808
809static struct bin_attribute ipl_parameter_attr = {
810 .attr = {
811 .name = "binary_parameter",
812 .mode = S_IRUGO,
813 .owner = THIS_MODULE,
814 },
815 .size = PAGE_SIZE,
816 .read = &ipl_parameter_read,
817};
818
819static ssize_t
820ipl_scp_data_read(struct kobject *kobj, char *buf, loff_t off, size_t count)
821{
822 unsigned int size = IPL_PARMBLOCK_START->fcp.scp_data_len;
823 void *scp_data = &IPL_PARMBLOCK_START->fcp.scp_data;
824
825 if (off > size)
826 return 0;
827 if (off + count > size)
828 count = size - off;
829
830 memcpy(buf, scp_data + off, count);
831 return count;
832}
833
834static struct bin_attribute ipl_scp_data_attr = {
835 .attr = {
836 .name = "scp_data",
837 .mode = S_IRUGO,
838 .owner = THIS_MODULE,
839 },
840 .size = PAGE_SIZE,
841 .read = &ipl_scp_data_read,
842};
843
844static decl_subsys(ipl, NULL, NULL);
845
846static int __init
847ipl_device_sysfs_register(void) {
848 int rc;
849
850 rc = firmware_register(&ipl_subsys);
851 if (rc)
852 return rc;
853
854 switch (get_ipl_type()) {
855 case ipl_type_ccw:
856 sysfs_create_group(&ipl_subsys.kset.kobj, &ipl_ccw_attr_group);
857 break;
858 case ipl_type_fcp:
859 sysfs_create_group(&ipl_subsys.kset.kobj, &ipl_fcp_attr_group);
860 sysfs_create_bin_file(&ipl_subsys.kset.kobj,
861 &ipl_parameter_attr);
862 sysfs_create_bin_file(&ipl_subsys.kset.kobj,
863 &ipl_scp_data_attr);
864 break;
865 default:
866 sysfs_create_group(&ipl_subsys.kset.kobj,
867 &ipl_unknown_attr_group);
868 break;
869 }
870 return 0;
871}
872
873__initcall(ipl_device_sysfs_register);
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index 2fd75da15495..9a1d95894f3d 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -49,10 +49,6 @@
49 49
50#define TICK_SIZE tick 50#define TICK_SIZE tick
51 51
52u64 jiffies_64 = INITIAL_JIFFIES;
53
54EXPORT_SYMBOL(jiffies_64);
55
56static ext_int_info_t ext_int_info_cc; 52static ext_int_info_t ext_int_info_cc;
57static u64 init_timer_cc; 53static u64 init_timer_cc;
58static u64 jiffies_timer_cc; 54static u64 jiffies_timer_cc;
diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c
index fa0726507b3d..22a895ecb7a4 100644
--- a/arch/s390/kernel/vtime.c
+++ b/arch/s390/kernel/vtime.c
@@ -24,7 +24,6 @@
24#include <asm/s390_ext.h> 24#include <asm/s390_ext.h>
25#include <asm/timer.h> 25#include <asm/timer.h>
26 26
27#define VTIMER_MAGIC (TIMER_MAGIC + 1)
28static ext_int_info_t ext_int_info_timer; 27static ext_int_info_t ext_int_info_timer;
29DEFINE_PER_CPU(struct vtimer_queue, virt_cpu_timer); 28DEFINE_PER_CPU(struct vtimer_queue, virt_cpu_timer);
30 29
@@ -277,20 +276,12 @@ static void do_cpu_timer_interrupt(struct pt_regs *regs, __u16 error_code)
277 276
278void init_virt_timer(struct vtimer_list *timer) 277void init_virt_timer(struct vtimer_list *timer)
279{ 278{
280 timer->magic = VTIMER_MAGIC;
281 timer->function = NULL; 279 timer->function = NULL;
282 INIT_LIST_HEAD(&timer->entry); 280 INIT_LIST_HEAD(&timer->entry);
283 spin_lock_init(&timer->lock); 281 spin_lock_init(&timer->lock);
284} 282}
285EXPORT_SYMBOL(init_virt_timer); 283EXPORT_SYMBOL(init_virt_timer);
286 284
287static inline int check_vtimer(struct vtimer_list *timer)
288{
289 if (timer->magic != VTIMER_MAGIC)
290 return -EINVAL;
291 return 0;
292}
293
294static inline int vtimer_pending(struct vtimer_list *timer) 285static inline int vtimer_pending(struct vtimer_list *timer)
295{ 286{
296 return (!list_empty(&timer->entry)); 287 return (!list_empty(&timer->entry));
@@ -346,7 +337,7 @@ static void internal_add_vtimer(struct vtimer_list *timer)
346 337
347static inline int prepare_vtimer(struct vtimer_list *timer) 338static inline int prepare_vtimer(struct vtimer_list *timer)
348{ 339{
349 if (check_vtimer(timer) || !timer->function) { 340 if (!timer->function) {
350 printk("add_virt_timer: uninitialized timer\n"); 341 printk("add_virt_timer: uninitialized timer\n");
351 return -EINVAL; 342 return -EINVAL;
352 } 343 }
@@ -414,7 +405,7 @@ int mod_virt_timer(struct vtimer_list *timer, __u64 expires)
414 unsigned long flags; 405 unsigned long flags;
415 int cpu; 406 int cpu;
416 407
417 if (check_vtimer(timer) || !timer->function) { 408 if (!timer->function) {
418 printk("mod_virt_timer: uninitialized timer\n"); 409 printk("mod_virt_timer: uninitialized timer\n");
419 return -EINVAL; 410 return -EINVAL;
420 } 411 }
@@ -481,11 +472,6 @@ int del_virt_timer(struct vtimer_list *timer)
481 unsigned long flags; 472 unsigned long flags;
482 struct vtimer_queue *vt_list; 473 struct vtimer_queue *vt_list;
483 474
484 if (check_vtimer(timer)) {
485 printk("del_virt_timer: timer not initialized\n");
486 return -EINVAL;
487 }
488
489 /* check if timer is pending */ 475 /* check if timer is pending */
490 if (!vtimer_pending(timer)) 476 if (!vtimer_pending(timer))
491 return 0; 477 return 0;
diff --git a/arch/s390/mm/ioremap.c b/arch/s390/mm/ioremap.c
index c6c39d868bc8..0f6e9ecbefe2 100644
--- a/arch/s390/mm/ioremap.c
+++ b/arch/s390/mm/ioremap.c
@@ -58,7 +58,7 @@ static inline int remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned lo
58 if (address >= end) 58 if (address >= end)
59 BUG(); 59 BUG();
60 do { 60 do {
61 pte_t * pte = pte_alloc_kernel(&init_mm, pmd, address); 61 pte_t * pte = pte_alloc_kernel(pmd, address);
62 if (!pte) 62 if (!pte)
63 return -ENOMEM; 63 return -ENOMEM;
64 remap_area_pte(pte, address, end - address, address + phys_addr, flags); 64 remap_area_pte(pte, address, end - address, address + phys_addr, flags);
@@ -80,7 +80,6 @@ static int remap_area_pages(unsigned long address, unsigned long phys_addr,
80 flush_cache_all(); 80 flush_cache_all();
81 if (address >= end) 81 if (address >= end)
82 BUG(); 82 BUG();
83 spin_lock(&init_mm.page_table_lock);
84 do { 83 do {
85 pmd_t *pmd; 84 pmd_t *pmd;
86 pmd = pmd_alloc(&init_mm, dir, address); 85 pmd = pmd_alloc(&init_mm, dir, address);
@@ -94,7 +93,6 @@ static int remap_area_pages(unsigned long address, unsigned long phys_addr,
94 address = (address + PGDIR_SIZE) & PGDIR_MASK; 93 address = (address + PGDIR_SIZE) & PGDIR_MASK;
95 dir++; 94 dir++;
96 } while (address && (address < end)); 95 } while (address && (address < end));
97 spin_unlock(&init_mm.page_table_lock);
98 flush_tlb_all(); 96 flush_tlb_all();
99 return 0; 97 return 0;
100} 98}
diff --git a/arch/sh/drivers/dma/dma-sysfs.c b/arch/sh/drivers/dma/dma-sysfs.c
index 71a6d4e7809f..6e3b58bd8795 100644
--- a/arch/sh/drivers/dma/dma-sysfs.c
+++ b/arch/sh/drivers/dma/dma-sysfs.c
@@ -13,6 +13,7 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/sysdev.h> 14#include <linux/sysdev.h>
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/string.h>
16#include <asm/dma.h> 17#include <asm/dma.h>
17 18
18static struct sysdev_class dma_sysclass = { 19static struct sysdev_class dma_sysclass = {
diff --git a/arch/sh/kernel/cpufreq.c b/arch/sh/kernel/cpufreq.c
index e0b384bef55f..47abf6e49dfb 100644
--- a/arch/sh/kernel/cpufreq.c
+++ b/arch/sh/kernel/cpufreq.c
@@ -20,6 +20,7 @@
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/cpumask.h> 21#include <linux/cpumask.h>
22#include <linux/smp.h> 22#include <linux/smp.h>
23#include <linux/sched.h> /* set_cpus_allowed() */
23 24
24#include <asm/processor.h> 25#include <asm/processor.h>
25#include <asm/watchdog.h> 26#include <asm/watchdog.h>
diff --git a/arch/sh/kernel/ptrace.c b/arch/sh/kernel/ptrace.c
index b28919b65682..1fbe5a428e31 100644
--- a/arch/sh/kernel/ptrace.c
+++ b/arch/sh/kernel/ptrace.c
@@ -80,7 +80,7 @@ void ptrace_disable(struct task_struct *child)
80 /* nothing to do.. */ 80 /* nothing to do.. */
81} 81}
82 82
83asmlinkage int sys_ptrace(long request, long pid, long addr, long data) 83asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
84{ 84{
85 struct task_struct *child; 85 struct task_struct *child;
86 struct user * dummy = NULL; 86 struct user * dummy = NULL;
diff --git a/arch/sh/kernel/time.c b/arch/sh/kernel/time.c
index 02ca69918d7c..671b876416bf 100644
--- a/arch/sh/kernel/time.c
+++ b/arch/sh/kernel/time.c
@@ -56,10 +56,6 @@ extern unsigned long wall_jiffies;
56#define TICK_SIZE (tick_nsec / 1000) 56#define TICK_SIZE (tick_nsec / 1000)
57DEFINE_SPINLOCK(tmu0_lock); 57DEFINE_SPINLOCK(tmu0_lock);
58 58
59u64 jiffies_64 = INITIAL_JIFFIES;
60
61EXPORT_SYMBOL(jiffies_64);
62
63/* XXX: Can we initialize this in a routine somewhere? Dreamcast doesn't want 59/* XXX: Can we initialize this in a routine somewhere? Dreamcast doesn't want
64 * these routines anywhere... */ 60 * these routines anywhere... */
65#ifdef CONFIG_SH_RTC 61#ifdef CONFIG_SH_RTC
diff --git a/arch/sh/mm/fault.c b/arch/sh/mm/fault.c
index 7abba2161da6..775f86cd3fe8 100644
--- a/arch/sh/mm/fault.c
+++ b/arch/sh/mm/fault.c
@@ -194,10 +194,13 @@ asmlinkage int __do_page_fault(struct pt_regs *regs, unsigned long writeaccess,
194 unsigned long address) 194 unsigned long address)
195{ 195{
196 unsigned long addrmax = P4SEG; 196 unsigned long addrmax = P4SEG;
197 pgd_t *dir; 197 pgd_t *pgd;
198 pmd_t *pmd; 198 pmd_t *pmd;
199 pte_t *pte; 199 pte_t *pte;
200 pte_t entry; 200 pte_t entry;
201 struct mm_struct *mm;
202 spinlock_t *ptl;
203 int ret = 1;
201 204
202#ifdef CONFIG_SH_KGDB 205#ifdef CONFIG_SH_KGDB
203 if (kgdb_nofault && kgdb_bus_err_hook) 206 if (kgdb_nofault && kgdb_bus_err_hook)
@@ -208,28 +211,28 @@ asmlinkage int __do_page_fault(struct pt_regs *regs, unsigned long writeaccess,
208 addrmax = P4SEG_STORE_QUE + 0x04000000; 211 addrmax = P4SEG_STORE_QUE + 0x04000000;
209#endif 212#endif
210 213
211 if (address >= P3SEG && address < addrmax) 214 if (address >= P3SEG && address < addrmax) {
212 dir = pgd_offset_k(address); 215 pgd = pgd_offset_k(address);
213 else if (address >= TASK_SIZE) 216 mm = NULL;
217 } else if (address >= TASK_SIZE)
214 return 1; 218 return 1;
215 else if (!current->mm) 219 else if (!(mm = current->mm))
216 return 1; 220 return 1;
217 else 221 else
218 dir = pgd_offset(current->mm, address); 222 pgd = pgd_offset(mm, address);
219 223
220 pmd = pmd_offset(dir, address); 224 pmd = pmd_offset(pgd, address);
221 if (pmd_none(*pmd)) 225 if (pmd_none_or_clear_bad(pmd))
222 return 1;
223 if (pmd_bad(*pmd)) {
224 pmd_ERROR(*pmd);
225 pmd_clear(pmd);
226 return 1; 226 return 1;
227 } 227 if (mm)
228 pte = pte_offset_kernel(pmd, address); 228 pte = pte_offset_map_lock(mm, pmd, address, &ptl);
229 else
230 pte = pte_offset_kernel(pmd, address);
231
229 entry = *pte; 232 entry = *pte;
230 if (pte_none(entry) || pte_not_present(entry) 233 if (pte_none(entry) || pte_not_present(entry)
231 || (writeaccess && !pte_write(entry))) 234 || (writeaccess && !pte_write(entry)))
232 return 1; 235 goto unlock;
233 236
234 if (writeaccess) 237 if (writeaccess)
235 entry = pte_mkdirty(entry); 238 entry = pte_mkdirty(entry);
@@ -251,8 +254,11 @@ asmlinkage int __do_page_fault(struct pt_regs *regs, unsigned long writeaccess,
251 254
252 set_pte(pte, entry); 255 set_pte(pte, entry);
253 update_mmu_cache(NULL, address, entry); 256 update_mmu_cache(NULL, address, entry);
254 257 ret = 0;
255 return 0; 258unlock:
259 if (mm)
260 pte_unmap_unlock(pte, ptl);
261 return ret;
256} 262}
257 263
258void flush_tlb_page(struct vm_area_struct *vma, unsigned long page) 264void flush_tlb_page(struct vm_area_struct *vma, unsigned long page)
diff --git a/arch/sh/mm/hugetlbpage.c b/arch/sh/mm/hugetlbpage.c
index 95bb1a6c6060..6b7a7688c98e 100644
--- a/arch/sh/mm/hugetlbpage.c
+++ b/arch/sh/mm/hugetlbpage.c
@@ -54,8 +54,6 @@ pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
54 return pte; 54 return pte;
55} 55}
56 56
57#define mk_pte_huge(entry) do { pte_val(entry) |= _PAGE_SZHUGE; } while (0)
58
59void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, 57void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
60 pte_t *ptep, pte_t entry) 58 pte_t *ptep, pte_t entry)
61{ 59{
diff --git a/arch/sh/mm/ioremap.c b/arch/sh/mm/ioremap.c
index 9f490c2742f0..e794e27a72f1 100644
--- a/arch/sh/mm/ioremap.c
+++ b/arch/sh/mm/ioremap.c
@@ -57,7 +57,7 @@ static inline int remap_area_pmd(pmd_t * pmd, unsigned long address,
57 if (address >= end) 57 if (address >= end)
58 BUG(); 58 BUG();
59 do { 59 do {
60 pte_t * pte = pte_alloc_kernel(&init_mm, pmd, address); 60 pte_t * pte = pte_alloc_kernel(pmd, address);
61 if (!pte) 61 if (!pte)
62 return -ENOMEM; 62 return -ENOMEM;
63 remap_area_pte(pte, address, end - address, address + phys_addr, flags); 63 remap_area_pte(pte, address, end - address, address + phys_addr, flags);
@@ -79,7 +79,6 @@ int remap_area_pages(unsigned long address, unsigned long phys_addr,
79 flush_cache_all(); 79 flush_cache_all();
80 if (address >= end) 80 if (address >= end)
81 BUG(); 81 BUG();
82 spin_lock(&init_mm.page_table_lock);
83 do { 82 do {
84 pmd_t *pmd; 83 pmd_t *pmd;
85 pmd = pmd_alloc(&init_mm, dir, address); 84 pmd = pmd_alloc(&init_mm, dir, address);
@@ -93,7 +92,6 @@ int remap_area_pages(unsigned long address, unsigned long phys_addr,
93 address = (address + PGDIR_SIZE) & PGDIR_MASK; 92 address = (address + PGDIR_SIZE) & PGDIR_MASK;
94 dir++; 93 dir++;
95 } while (address && (address < end)); 94 } while (address && (address < end));
96 spin_unlock(&init_mm.page_table_lock);
97 flush_tlb_all(); 95 flush_tlb_all();
98 return error; 96 return error;
99} 97}
diff --git a/arch/sh64/kernel/ptrace.c b/arch/sh64/kernel/ptrace.c
index fd2000956dae..71f2eec00b99 100644
--- a/arch/sh64/kernel/ptrace.c
+++ b/arch/sh64/kernel/ptrace.c
@@ -121,7 +121,7 @@ put_fpu_long(struct task_struct *task, unsigned long addr, unsigned long data)
121 return 0; 121 return 0;
122} 122}
123 123
124asmlinkage int sys_ptrace(long request, long pid, long addr, long data) 124asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
125{ 125{
126 struct task_struct *child; 126 struct task_struct *child;
127 extern void poke_real_address_q(unsigned long long addr, unsigned long long data); 127 extern void poke_real_address_q(unsigned long long addr, unsigned long long data);
diff --git a/arch/sh64/kernel/time.c b/arch/sh64/kernel/time.c
index f4a62a10053c..870fe5327e09 100644
--- a/arch/sh64/kernel/time.c
+++ b/arch/sh64/kernel/time.c
@@ -116,8 +116,6 @@
116 116
117extern unsigned long wall_jiffies; 117extern unsigned long wall_jiffies;
118 118
119u64 jiffies_64 = INITIAL_JIFFIES;
120
121static unsigned long tmu_base, rtc_base; 119static unsigned long tmu_base, rtc_base;
122unsigned long cprc_base; 120unsigned long cprc_base;
123 121
@@ -253,6 +251,7 @@ int do_settimeofday(struct timespec *tv)
253 251
254 return 0; 252 return 0;
255} 253}
254EXPORT_SYMBOL(do_settimeofday);
256 255
257static int set_rtc_time(unsigned long nowtime) 256static int set_rtc_time(unsigned long nowtime)
258{ 257{
diff --git a/arch/sh64/mm/cache.c b/arch/sh64/mm/cache.c
index 3b87e25ea773..c0c1b21350d8 100644
--- a/arch/sh64/mm/cache.c
+++ b/arch/sh64/mm/cache.c
@@ -584,32 +584,36 @@ static void sh64_dcache_purge_phy_page(unsigned long paddr)
584 } 584 }
585} 585}
586 586
587static void sh64_dcache_purge_user_page(struct mm_struct *mm, unsigned long eaddr) 587static void sh64_dcache_purge_user_pages(struct mm_struct *mm,
588 unsigned long addr, unsigned long end)
588{ 589{
589 pgd_t *pgd; 590 pgd_t *pgd;
590 pmd_t *pmd; 591 pmd_t *pmd;
591 pte_t *pte; 592 pte_t *pte;
592 pte_t entry; 593 pte_t entry;
594 spinlock_t *ptl;
593 unsigned long paddr; 595 unsigned long paddr;
594 596
595 /* NOTE : all the callers of this have mm->page_table_lock held, so the 597 if (!mm)
596 following page table traversal is safe even on SMP/pre-emptible. */ 598 return; /* No way to find physical address of page */
597 599
598 if (!mm) return; /* No way to find physical address of page */ 600 pgd = pgd_offset(mm, addr);
599 pgd = pgd_offset(mm, eaddr); 601 if (pgd_bad(*pgd))
600 if (pgd_bad(*pgd)) return; 602 return;
601 603
602 pmd = pmd_offset(pgd, eaddr); 604 pmd = pmd_offset(pgd, addr);
603 if (pmd_none(*pmd) || pmd_bad(*pmd)) return; 605 if (pmd_none(*pmd) || pmd_bad(*pmd))
604 606 return;
605 pte = pte_offset_kernel(pmd, eaddr); 607
606 entry = *pte; 608 pte = pte_offset_map_lock(mm, pmd, addr, &ptl);
607 if (pte_none(entry) || !pte_present(entry)) return; 609 do {
608 610 entry = *pte;
609 paddr = pte_val(entry) & PAGE_MASK; 611 if (pte_none(entry) || !pte_present(entry))
610 612 continue;
611 sh64_dcache_purge_coloured_phy_page(paddr, eaddr); 613 paddr = pte_val(entry) & PAGE_MASK;
612 614 sh64_dcache_purge_coloured_phy_page(paddr, addr);
615 } while (pte++, addr += PAGE_SIZE, addr != end);
616 pte_unmap_unlock(pte - 1, ptl);
613} 617}
614/****************************************************************************/ 618/****************************************************************************/
615 619
@@ -668,7 +672,7 @@ static void sh64_dcache_purge_user_range(struct mm_struct *mm,
668 int n_pages; 672 int n_pages;
669 673
670 n_pages = ((end - start) >> PAGE_SHIFT); 674 n_pages = ((end - start) >> PAGE_SHIFT);
671 if (n_pages >= 64) { 675 if (n_pages >= 64 || ((start ^ (end - 1)) & PMD_MASK)) {
672#if 1 676#if 1
673 sh64_dcache_purge_all(); 677 sh64_dcache_purge_all();
674#else 678#else
@@ -707,20 +711,10 @@ static void sh64_dcache_purge_user_range(struct mm_struct *mm,
707 } 711 }
708#endif 712#endif
709 } else { 713 } else {
710 /* 'Small' range */ 714 /* Small range, covered by a single page table page */
711 unsigned long aligned_start; 715 start &= PAGE_MASK; /* should already be so */
712 unsigned long eaddr; 716 end = PAGE_ALIGN(end); /* should already be so */
713 unsigned long last_page_start; 717 sh64_dcache_purge_user_pages(mm, start, end);
714
715 aligned_start = start & PAGE_MASK;
716 /* 'end' is 1 byte beyond the end of the range */
717 last_page_start = (end - 1) & PAGE_MASK;
718
719 eaddr = aligned_start;
720 while (eaddr <= last_page_start) {
721 sh64_dcache_purge_user_page(mm, eaddr);
722 eaddr += PAGE_SIZE;
723 }
724 } 718 }
725 return; 719 return;
726} 720}
@@ -880,9 +874,7 @@ void flush_cache_range(struct vm_area_struct *vma, unsigned long start,
880 addresses from the user address space specified by mm, after writing 874 addresses from the user address space specified by mm, after writing
881 back any dirty data. 875 back any dirty data.
882 876
883 Note(1), 'end' is 1 byte beyond the end of the range to flush. 877 Note, 'end' is 1 byte beyond the end of the range to flush. */
884
885 Note(2), this is called with mm->page_table_lock held.*/
886 878
887 sh64_dcache_purge_user_range(mm, start, end); 879 sh64_dcache_purge_user_range(mm, start, end);
888 sh64_icache_inv_user_page_range(mm, start, end); 880 sh64_icache_inv_user_page_range(mm, start, end);
@@ -898,7 +890,7 @@ void flush_cache_page(struct vm_area_struct *vma, unsigned long eaddr, unsigned
898 the I-cache must be searched too in case the page in question is 890 the I-cache must be searched too in case the page in question is
899 both writable and being executed from (e.g. stack trampolines.) 891 both writable and being executed from (e.g. stack trampolines.)
900 892
901 Note(1), this is called with mm->page_table_lock held. 893 Note, this is called with pte lock held.
902 */ 894 */
903 895
904 sh64_dcache_purge_phy_page(pfn << PAGE_SHIFT); 896 sh64_dcache_purge_phy_page(pfn << PAGE_SHIFT);
diff --git a/arch/sh64/mm/hugetlbpage.c b/arch/sh64/mm/hugetlbpage.c
index dcd9c8a8baf8..ed6a505b3ee2 100644
--- a/arch/sh64/mm/hugetlbpage.c
+++ b/arch/sh64/mm/hugetlbpage.c
@@ -54,41 +54,31 @@ pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
54 return pte; 54 return pte;
55} 55}
56 56
57#define mk_pte_huge(entry) do { pte_val(entry) |= _PAGE_SZHUGE; } while (0) 57void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
58 58 pte_t *ptep, pte_t entry)
59static void set_huge_pte(struct mm_struct *mm, struct vm_area_struct *vma,
60 struct page *page, pte_t * page_table, int write_access)
61{ 59{
62 unsigned long i; 60 int i;
63 pte_t entry;
64
65 add_mm_counter(mm, rss, HPAGE_SIZE / PAGE_SIZE);
66
67 if (write_access)
68 entry = pte_mkwrite(pte_mkdirty(mk_pte(page,
69 vma->vm_page_prot)));
70 else
71 entry = pte_wrprotect(mk_pte(page, vma->vm_page_prot));
72 entry = pte_mkyoung(entry);
73 mk_pte_huge(entry);
74 61
75 for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) { 62 for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) {
76 set_pte(page_table, entry); 63 set_pte_at(mm, addr, ptep, entry);
77 page_table++; 64 ptep++;
78 65 addr += PAGE_SIZE;
79 pte_val(entry) += PAGE_SIZE; 66 pte_val(entry) += PAGE_SIZE;
80 } 67 }
81} 68}
82 69
83pte_t huge_ptep_get_and_clear(pte_t *ptep) 70pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
71 pte_t *ptep)
84{ 72{
85 pte_t entry; 73 pte_t entry;
74 int i;
86 75
87 entry = *ptep; 76 entry = *ptep;
88 77
89 for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) { 78 for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) {
90 pte_clear(pte); 79 pte_clear(mm, addr, ptep);
91 pte++; 80 addr += PAGE_SIZE;
81 ptep++;
92 } 82 }
93 83
94 return entry; 84 return entry;
@@ -106,79 +96,6 @@ int is_aligned_hugepage_range(unsigned long addr, unsigned long len)
106 return 0; 96 return 0;
107} 97}
108 98
109int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src,
110 struct vm_area_struct *vma)
111{
112 pte_t *src_pte, *dst_pte, entry;
113 struct page *ptepage;
114 unsigned long addr = vma->vm_start;
115 unsigned long end = vma->vm_end;
116 int i;
117
118 while (addr < end) {
119 dst_pte = huge_pte_alloc(dst, addr);
120 if (!dst_pte)
121 goto nomem;
122 src_pte = huge_pte_offset(src, addr);
123 BUG_ON(!src_pte || pte_none(*src_pte));
124 entry = *src_pte;
125 ptepage = pte_page(entry);
126 get_page(ptepage);
127 for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) {
128 set_pte(dst_pte, entry);
129 pte_val(entry) += PAGE_SIZE;
130 dst_pte++;
131 }
132 add_mm_counter(dst, rss, HPAGE_SIZE / PAGE_SIZE);
133 addr += HPAGE_SIZE;
134 }
135 return 0;
136
137nomem:
138 return -ENOMEM;
139}
140
141int follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,
142 struct page **pages, struct vm_area_struct **vmas,
143 unsigned long *position, int *length, int i)
144{
145 unsigned long vaddr = *position;
146 int remainder = *length;
147
148 WARN_ON(!is_vm_hugetlb_page(vma));
149
150 while (vaddr < vma->vm_end && remainder) {
151 if (pages) {
152 pte_t *pte;
153 struct page *page;
154
155 pte = huge_pte_offset(mm, vaddr);
156
157 /* hugetlb should be locked, and hence, prefaulted */
158 BUG_ON(!pte || pte_none(*pte));
159
160 page = pte_page(*pte);
161
162 WARN_ON(!PageCompound(page));
163
164 get_page(page);
165 pages[i] = page;
166 }
167
168 if (vmas)
169 vmas[i] = vma;
170
171 vaddr += PAGE_SIZE;
172 --remainder;
173 ++i;
174 }
175
176 *length = remainder;
177 *position = vaddr;
178
179 return i;
180}
181
182struct page *follow_huge_addr(struct mm_struct *mm, 99struct page *follow_huge_addr(struct mm_struct *mm,
183 unsigned long address, int write) 100 unsigned long address, int write)
184{ 101{
@@ -195,84 +112,3 @@ struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address,
195{ 112{
196 return NULL; 113 return NULL;
197} 114}
198
199void unmap_hugepage_range(struct vm_area_struct *vma,
200 unsigned long start, unsigned long end)
201{
202 struct mm_struct *mm = vma->vm_mm;
203 unsigned long address;
204 pte_t *pte;
205 struct page *page;
206 int i;
207
208 BUG_ON(start & (HPAGE_SIZE - 1));
209 BUG_ON(end & (HPAGE_SIZE - 1));
210
211 for (address = start; address < end; address += HPAGE_SIZE) {
212 pte = huge_pte_offset(mm, address);
213 BUG_ON(!pte);
214 if (pte_none(*pte))
215 continue;
216 page = pte_page(*pte);
217 put_page(page);
218 for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) {
219 pte_clear(mm, address+(i*PAGE_SIZE), pte);
220 pte++;
221 }
222 }
223 add_mm_counter(mm, rss, -((end - start) >> PAGE_SHIFT));
224 flush_tlb_range(vma, start, end);
225}
226
227int hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma)
228{
229 struct mm_struct *mm = current->mm;
230 unsigned long addr;
231 int ret = 0;
232
233 BUG_ON(vma->vm_start & ~HPAGE_MASK);
234 BUG_ON(vma->vm_end & ~HPAGE_MASK);
235
236 spin_lock(&mm->page_table_lock);
237 for (addr = vma->vm_start; addr < vma->vm_end; addr += HPAGE_SIZE) {
238 unsigned long idx;
239 pte_t *pte = huge_pte_alloc(mm, addr);
240 struct page *page;
241
242 if (!pte) {
243 ret = -ENOMEM;
244 goto out;
245 }
246 if (!pte_none(*pte))
247 continue;
248
249 idx = ((addr - vma->vm_start) >> HPAGE_SHIFT)
250 + (vma->vm_pgoff >> (HPAGE_SHIFT - PAGE_SHIFT));
251 page = find_get_page(mapping, idx);
252 if (!page) {
253 /* charge the fs quota first */
254 if (hugetlb_get_quota(mapping)) {
255 ret = -ENOMEM;
256 goto out;
257 }
258 page = alloc_huge_page();
259 if (!page) {
260 hugetlb_put_quota(mapping);
261 ret = -ENOMEM;
262 goto out;
263 }
264 ret = add_to_page_cache(page, mapping, idx, GFP_ATOMIC);
265 if (! ret) {
266 unlock_page(page);
267 } else {
268 hugetlb_put_quota(mapping);
269 free_huge_page(page);
270 goto out;
271 }
272 }
273 set_huge_pte(mm, vma, page, pte, vma->vm_flags & VM_WRITE);
274 }
275out:
276 spin_unlock(&mm->page_table_lock);
277 return ret;
278}
diff --git a/arch/sh64/mm/ioremap.c b/arch/sh64/mm/ioremap.c
index f4003da556bc..fb1866fa2c9d 100644
--- a/arch/sh64/mm/ioremap.c
+++ b/arch/sh64/mm/ioremap.c
@@ -79,7 +79,7 @@ static inline int remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned lo
79 BUG(); 79 BUG();
80 80
81 do { 81 do {
82 pte_t * pte = pte_alloc_kernel(&init_mm, pmd, address); 82 pte_t * pte = pte_alloc_kernel(pmd, address);
83 if (!pte) 83 if (!pte)
84 return -ENOMEM; 84 return -ENOMEM;
85 remap_area_pte(pte, address, end - address, address + phys_addr, flags); 85 remap_area_pte(pte, address, end - address, address + phys_addr, flags);
@@ -101,7 +101,6 @@ static int remap_area_pages(unsigned long address, unsigned long phys_addr,
101 flush_cache_all(); 101 flush_cache_all();
102 if (address >= end) 102 if (address >= end)
103 BUG(); 103 BUG();
104 spin_lock(&init_mm.page_table_lock);
105 do { 104 do {
106 pmd_t *pmd = pmd_alloc(&init_mm, dir, address); 105 pmd_t *pmd = pmd_alloc(&init_mm, dir, address);
107 error = -ENOMEM; 106 error = -ENOMEM;
@@ -115,7 +114,6 @@ static int remap_area_pages(unsigned long address, unsigned long phys_addr,
115 address = (address + PGDIR_SIZE) & PGDIR_MASK; 114 address = (address + PGDIR_SIZE) & PGDIR_MASK;
116 dir++; 115 dir++;
117 } while (address && (address < end)); 116 } while (address && (address < end));
118 spin_unlock(&init_mm.page_table_lock);
119 flush_tlb_all(); 117 flush_tlb_all();
120 return 0; 118 return 0;
121} 119}
diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c
index 36a40697b8d6..25e31d5ec99b 100644
--- a/arch/sparc/kernel/pcic.c
+++ b/arch/sparc/kernel/pcic.c
@@ -497,8 +497,8 @@ static void pcic_map_pci_device(struct linux_pcic *pcic,
497 * CheerIO makes a similar conversion. 497 * CheerIO makes a similar conversion.
498 * See ebus.c for details. 498 * See ebus.c for details.
499 * 499 *
500 * Note that check_region()/request_region() 500 * Note that request_region()
501 * work for these devices. 501 * works for these devices.
502 * 502 *
503 * XXX Neat trick, but it's a *bad* idea 503 * XXX Neat trick, but it's a *bad* idea
504 * to shit into regions like that. 504 * to shit into regions like that.
diff --git a/arch/sparc/kernel/time.c b/arch/sparc/kernel/time.c
index 279a62627c10..24814d58f9e1 100644
--- a/arch/sparc/kernel/time.c
+++ b/arch/sparc/kernel/time.c
@@ -45,10 +45,6 @@
45 45
46extern unsigned long wall_jiffies; 46extern unsigned long wall_jiffies;
47 47
48u64 jiffies_64 = INITIAL_JIFFIES;
49
50EXPORT_SYMBOL(jiffies_64);
51
52DEFINE_SPINLOCK(rtc_lock); 48DEFINE_SPINLOCK(rtc_lock);
53enum sparc_clock_type sp_clock_typ; 49enum sparc_clock_type sp_clock_typ;
54DEFINE_SPINLOCK(mostek_lock); 50DEFINE_SPINLOCK(mostek_lock);
diff --git a/arch/sparc/mm/generic.c b/arch/sparc/mm/generic.c
index 20ccb957fb77..9604893ffdbd 100644
--- a/arch/sparc/mm/generic.c
+++ b/arch/sparc/mm/generic.c
@@ -73,14 +73,16 @@ int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
73 int space = GET_IOSPACE(pfn); 73 int space = GET_IOSPACE(pfn);
74 unsigned long offset = GET_PFN(pfn) << PAGE_SHIFT; 74 unsigned long offset = GET_PFN(pfn) << PAGE_SHIFT;
75 75
76 /* See comment in mm/memory.c remap_pfn_range */
77 vma->vm_flags |= VM_IO | VM_RESERVED;
78
76 prot = __pgprot(pg_iobits); 79 prot = __pgprot(pg_iobits);
77 offset -= from; 80 offset -= from;
78 dir = pgd_offset(mm, from); 81 dir = pgd_offset(mm, from);
79 flush_cache_range(vma, beg, end); 82 flush_cache_range(vma, beg, end);
80 83
81 spin_lock(&mm->page_table_lock);
82 while (from < end) { 84 while (from < end) {
83 pmd_t *pmd = pmd_alloc(current->mm, dir, from); 85 pmd_t *pmd = pmd_alloc(mm, dir, from);
84 error = -ENOMEM; 86 error = -ENOMEM;
85 if (!pmd) 87 if (!pmd)
86 break; 88 break;
@@ -90,7 +92,6 @@ int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
90 from = (from + PGDIR_SIZE) & PGDIR_MASK; 92 from = (from + PGDIR_SIZE) & PGDIR_MASK;
91 dir++; 93 dir++;
92 } 94 }
93 spin_unlock(&mm->page_table_lock);
94 95
95 flush_tlb_range(vma, beg, end); 96 flush_tlb_range(vma, beg, end);
96 return error; 97 return error;
diff --git a/arch/sparc64/kernel/binfmt_aout32.c b/arch/sparc64/kernel/binfmt_aout32.c
index b2854ef221d0..edf52d06b280 100644
--- a/arch/sparc64/kernel/binfmt_aout32.c
+++ b/arch/sparc64/kernel/binfmt_aout32.c
@@ -241,7 +241,6 @@ static int load_aout32_binary(struct linux_binprm * bprm, struct pt_regs * regs)
241 current->mm->brk = ex.a_bss + 241 current->mm->brk = ex.a_bss +
242 (current->mm->start_brk = N_BSSADDR(ex)); 242 (current->mm->start_brk = N_BSSADDR(ex));
243 243
244 set_mm_counter(current->mm, rss, 0);
245 current->mm->mmap = NULL; 244 current->mm->mmap = NULL;
246 compute_creds(bprm); 245 compute_creds(bprm);
247 current->flags &= ~PF_FORKNOEXEC; 246 current->flags &= ~PF_FORKNOEXEC;
diff --git a/arch/sparc64/kernel/ioctl32.c b/arch/sparc64/kernel/ioctl32.c
index 43fc3173d480..e6a00325075a 100644
--- a/arch/sparc64/kernel/ioctl32.c
+++ b/arch/sparc64/kernel/ioctl32.c
@@ -475,9 +475,6 @@ IOCTL_TABLE_START
475#include <linux/compat_ioctl.h> 475#include <linux/compat_ioctl.h>
476#define DECLARES 476#define DECLARES
477#include "compat_ioctl.c" 477#include "compat_ioctl.c"
478COMPATIBLE_IOCTL(TIOCSTART)
479COMPATIBLE_IOCTL(TIOCSTOP)
480COMPATIBLE_IOCTL(TIOCSLTC)
481COMPATIBLE_IOCTL(FBIOGTYPE) 478COMPATIBLE_IOCTL(FBIOGTYPE)
482COMPATIBLE_IOCTL(FBIOSATTR) 479COMPATIBLE_IOCTL(FBIOSATTR)
483COMPATIBLE_IOCTL(FBIOGATTR) 480COMPATIBLE_IOCTL(FBIOGATTR)
diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c
index 3f08a32f51a1..38c5525087a2 100644
--- a/arch/sparc64/kernel/time.c
+++ b/arch/sparc64/kernel/time.c
@@ -55,10 +55,6 @@ unsigned long ds1287_regs = 0UL;
55 55
56extern unsigned long wall_jiffies; 56extern unsigned long wall_jiffies;
57 57
58u64 jiffies_64 = INITIAL_JIFFIES;
59
60EXPORT_SYMBOL(jiffies_64);
61
62static void __iomem *mstk48t08_regs; 58static void __iomem *mstk48t08_regs;
63static void __iomem *mstk48t59_regs; 59static void __iomem *mstk48t59_regs;
64 60
diff --git a/arch/sparc64/mm/generic.c b/arch/sparc64/mm/generic.c
index c954d91f01d0..112c316e7cd2 100644
--- a/arch/sparc64/mm/generic.c
+++ b/arch/sparc64/mm/generic.c
@@ -127,14 +127,16 @@ int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
127 int space = GET_IOSPACE(pfn); 127 int space = GET_IOSPACE(pfn);
128 unsigned long offset = GET_PFN(pfn) << PAGE_SHIFT; 128 unsigned long offset = GET_PFN(pfn) << PAGE_SHIFT;
129 129
130 /* See comment in mm/memory.c remap_pfn_range */
131 vma->vm_flags |= VM_IO | VM_RESERVED;
132
130 prot = __pgprot(pg_iobits); 133 prot = __pgprot(pg_iobits);
131 offset -= from; 134 offset -= from;
132 dir = pgd_offset(mm, from); 135 dir = pgd_offset(mm, from);
133 flush_cache_range(vma, beg, end); 136 flush_cache_range(vma, beg, end);
134 137
135 spin_lock(&mm->page_table_lock);
136 while (from < end) { 138 while (from < end) {
137 pud_t *pud = pud_alloc(current->mm, dir, from); 139 pud_t *pud = pud_alloc(mm, dir, from);
138 error = -ENOMEM; 140 error = -ENOMEM;
139 if (!pud) 141 if (!pud)
140 break; 142 break;
@@ -144,8 +146,7 @@ int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
144 from = (from + PGDIR_SIZE) & PGDIR_MASK; 146 from = (from + PGDIR_SIZE) & PGDIR_MASK;
145 dir++; 147 dir++;
146 } 148 }
147 flush_tlb_range(vma, beg, end);
148 spin_unlock(&mm->page_table_lock);
149 149
150 flush_tlb_range(vma, beg, end);
150 return error; 151 return error;
151} 152}
diff --git a/arch/sparc64/mm/tlb.c b/arch/sparc64/mm/tlb.c
index 90ca99d0b89c..8b104be4662b 100644
--- a/arch/sparc64/mm/tlb.c
+++ b/arch/sparc64/mm/tlb.c
@@ -18,8 +18,7 @@
18 18
19/* Heavily inspired by the ppc64 code. */ 19/* Heavily inspired by the ppc64 code. */
20 20
21DEFINE_PER_CPU(struct mmu_gather, mmu_gathers) = 21DEFINE_PER_CPU(struct mmu_gather, mmu_gathers) = { 0, };
22 { NULL, 0, 0, 0, 0, 0, { 0 }, { NULL }, };
23 22
24void flush_tlb_pending(void) 23void flush_tlb_pending(void)
25{ 24{
@@ -72,7 +71,7 @@ void tlb_batch_add(struct mm_struct *mm, unsigned long vaddr, pte_t *ptep, pte_t
72 71
73no_cache_flush: 72no_cache_flush:
74 73
75 if (mp->tlb_frozen) 74 if (mp->fullmm)
76 return; 75 return;
77 76
78 nr = mp->tlb_nr; 77 nr = mp->tlb_nr;
@@ -97,7 +96,7 @@ void flush_tlb_pgtables(struct mm_struct *mm, unsigned long start, unsigned long
97 unsigned long nr = mp->tlb_nr; 96 unsigned long nr = mp->tlb_nr;
98 long s = start, e = end, vpte_base; 97 long s = start, e = end, vpte_base;
99 98
100 if (mp->tlb_frozen) 99 if (mp->fullmm)
101 return; 100 return;
102 101
103 /* If start is greater than end, that is a real problem. */ 102 /* If start is greater than end, that is a real problem. */
diff --git a/arch/um/Kconfig b/arch/um/Kconfig
index 684e1f8b2755..cd06ed7d842d 100644
--- a/arch/um/Kconfig
+++ b/arch/um/Kconfig
@@ -27,10 +27,6 @@ config UID16
27 bool 27 bool
28 default y 28 default y
29 29
30config RWSEM_GENERIC_SPINLOCK
31 bool
32 default y
33
34config GENERIC_CALIBRATE_DELAY 30config GENERIC_CALIBRATE_DELAY
35 bool 31 bool
36 default y 32 default y
@@ -40,6 +36,12 @@ config IRQ_RELEASE_METHOD
40 bool 36 bool
41 default y 37 default y
42 38
39menu "Host processor type and features"
40
41source "arch/i386/Kconfig.cpu"
42
43endmenu
44
43menu "UML-specific options" 45menu "UML-specific options"
44 46
45config MODE_TT 47config MODE_TT
diff --git a/arch/um/Kconfig.x86_64 b/arch/um/Kconfig.x86_64
index bd35e59419c8..aae19bc4b06a 100644
--- a/arch/um/Kconfig.x86_64
+++ b/arch/um/Kconfig.x86_64
@@ -6,6 +6,11 @@ config 64BIT
6 bool 6 bool
7 default y 7 default y
8 8
9#XXX: this is so in the underlying arch, but it's wrong!!!
10config RWSEM_GENERIC_SPINLOCK
11 bool
12 default y
13
9config SEMAPHORE_SLEEPERS 14config SEMAPHORE_SLEEPERS
10 bool 15 bool
11 default y 16 default y
diff --git a/arch/um/Makefile-i386 b/arch/um/Makefile-i386
index 2ee8a2858117..aef7c50f8e13 100644
--- a/arch/um/Makefile-i386
+++ b/arch/um/Makefile-i386
@@ -29,6 +29,12 @@ endif
29 29
30CFLAGS += -U__$(SUBARCH)__ -U$(SUBARCH) 30CFLAGS += -U__$(SUBARCH)__ -U$(SUBARCH)
31 31
32ifneq ($(CONFIG_GPROF),y) 32# First of all, tune CFLAGS for the specific CPU. This actually sets cflags-y.
33ARCH_CFLAGS += -DUM_FASTCALL 33include $(srctree)/arch/i386/Makefile.cpu
34endif 34
35# prevent gcc from keeping the stack 16 byte aligned. Taken from i386.
36cflags-y += $(call cc-option,-mpreferred-stack-boundary=2)
37
38CFLAGS += $(cflags-y)
39USER_CFLAGS += $(cflags-y)
40
diff --git a/arch/um/include/sysdep-i386/syscalls.h b/arch/um/include/sysdep-i386/syscalls.h
index a0d5b74d3731..57bd79efbee3 100644
--- a/arch/um/include/sysdep-i386/syscalls.h
+++ b/arch/um/include/sysdep-i386/syscalls.h
@@ -11,7 +11,6 @@ typedef long syscall_handler_t(struct pt_regs);
11/* Not declared on x86, incompatible declarations on x86_64, so these have 11/* Not declared on x86, incompatible declarations on x86_64, so these have
12 * to go here rather than in sys_call_table.c 12 * to go here rather than in sys_call_table.c
13 */ 13 */
14extern syscall_handler_t sys_ptrace;
15extern syscall_handler_t sys_rt_sigaction; 14extern syscall_handler_t sys_rt_sigaction;
16 15
17extern syscall_handler_t old_mmap_i386; 16extern syscall_handler_t old_mmap_i386;
diff --git a/arch/um/include/tlb.h b/arch/um/include/tlb.h
index 45d7da6c3b2c..8efc1e0f1b84 100644
--- a/arch/um/include/tlb.h
+++ b/arch/um/include/tlb.h
@@ -34,7 +34,6 @@ struct host_vm_op {
34 } u; 34 } u;
35}; 35};
36 36
37extern void mprotect_kernel_vm(int w);
38extern void force_flush_all(void); 37extern void force_flush_all(void);
39extern void fix_range_common(struct mm_struct *mm, unsigned long start_addr, 38extern void fix_range_common(struct mm_struct *mm, unsigned long start_addr,
40 unsigned long end_addr, int force, 39 unsigned long end_addr, int force,
diff --git a/arch/um/kernel/process_kern.c b/arch/um/kernel/process_kern.c
index 0d73ceeece72..34b54a3e2132 100644
--- a/arch/um/kernel/process_kern.c
+++ b/arch/um/kernel/process_kern.c
@@ -222,6 +222,7 @@ void *um_virt_to_phys(struct task_struct *task, unsigned long addr,
222 pud_t *pud; 222 pud_t *pud;
223 pmd_t *pmd; 223 pmd_t *pmd;
224 pte_t *pte; 224 pte_t *pte;
225 pte_t ptent;
225 226
226 if(task->mm == NULL) 227 if(task->mm == NULL)
227 return(ERR_PTR(-EINVAL)); 228 return(ERR_PTR(-EINVAL));
@@ -238,12 +239,13 @@ void *um_virt_to_phys(struct task_struct *task, unsigned long addr,
238 return(ERR_PTR(-EINVAL)); 239 return(ERR_PTR(-EINVAL));
239 240
240 pte = pte_offset_kernel(pmd, addr); 241 pte = pte_offset_kernel(pmd, addr);
241 if(!pte_present(*pte)) 242 ptent = *pte;
243 if(!pte_present(ptent))
242 return(ERR_PTR(-EINVAL)); 244 return(ERR_PTR(-EINVAL));
243 245
244 if(pte_out != NULL) 246 if(pte_out != NULL)
245 *pte_out = *pte; 247 *pte_out = ptent;
246 return((void *) (pte_val(*pte) & PAGE_MASK) + (addr & ~PAGE_MASK)); 248 return((void *) (pte_val(ptent) & PAGE_MASK) + (addr & ~PAGE_MASK));
247} 249}
248 250
249char *current_cmd(void) 251char *current_cmd(void)
diff --git a/arch/um/kernel/skas/mmu.c b/arch/um/kernel/skas/mmu.c
index 240143b616a2..9e5e39cea821 100644
--- a/arch/um/kernel/skas/mmu.c
+++ b/arch/um/kernel/skas/mmu.c
@@ -28,7 +28,6 @@ static int init_stub_pte(struct mm_struct *mm, unsigned long proc,
28 pmd_t *pmd; 28 pmd_t *pmd;
29 pte_t *pte; 29 pte_t *pte;
30 30
31 spin_lock(&mm->page_table_lock);
32 pgd = pgd_offset(mm, proc); 31 pgd = pgd_offset(mm, proc);
33 pud = pud_alloc(mm, pgd, proc); 32 pud = pud_alloc(mm, pgd, proc);
34 if (!pud) 33 if (!pud)
@@ -63,7 +62,6 @@ static int init_stub_pte(struct mm_struct *mm, unsigned long proc,
63 *pte = mk_pte(virt_to_page(kernel), __pgprot(_PAGE_PRESENT)); 62 *pte = mk_pte(virt_to_page(kernel), __pgprot(_PAGE_PRESENT));
64 *pte = pte_mkexec(*pte); 63 *pte = pte_mkexec(*pte);
65 *pte = pte_wrprotect(*pte); 64 *pte = pte_wrprotect(*pte);
66 spin_unlock(&mm->page_table_lock);
67 return(0); 65 return(0);
68 66
69 out_pmd: 67 out_pmd:
@@ -71,7 +69,6 @@ static int init_stub_pte(struct mm_struct *mm, unsigned long proc,
71 out_pte: 69 out_pte:
72 pmd_free(pmd); 70 pmd_free(pmd);
73 out: 71 out:
74 spin_unlock(&mm->page_table_lock);
75 return(-ENOMEM); 72 return(-ENOMEM);
76} 73}
77 74
@@ -147,6 +144,7 @@ void destroy_context_skas(struct mm_struct *mm)
147 144
148 if(!proc_mm || !ptrace_faultinfo){ 145 if(!proc_mm || !ptrace_faultinfo){
149 free_page(mmu->id.stack); 146 free_page(mmu->id.stack);
147 pte_lock_deinit(virt_to_page(mmu->last_page_table));
150 pte_free_kernel((pte_t *) mmu->last_page_table); 148 pte_free_kernel((pte_t *) mmu->last_page_table);
151 dec_page_state(nr_page_table_pages); 149 dec_page_state(nr_page_table_pages);
152#ifdef CONFIG_3_LEVEL_PGTABLES 150#ifdef CONFIG_3_LEVEL_PGTABLES
diff --git a/arch/um/kernel/time_kern.c b/arch/um/kernel/time_kern.c
index 4e08f7545d63..020ca79b8d33 100644
--- a/arch/um/kernel/time_kern.c
+++ b/arch/um/kernel/time_kern.c
@@ -22,10 +22,6 @@
22#include "mode.h" 22#include "mode.h"
23#include "os.h" 23#include "os.h"
24 24
25u64 jiffies_64 = INITIAL_JIFFIES;
26
27EXPORT_SYMBOL(jiffies_64);
28
29int hz(void) 25int hz(void)
30{ 26{
31 return(HZ); 27 return(HZ);
diff --git a/arch/um/kernel/tt/tlb.c b/arch/um/kernel/tt/tlb.c
index f1d85dbb45b9..ae6217c86135 100644
--- a/arch/um/kernel/tt/tlb.c
+++ b/arch/um/kernel/tt/tlb.c
@@ -74,42 +74,6 @@ void flush_tlb_kernel_range_tt(unsigned long start, unsigned long end)
74 atomic_inc(&vmchange_seq); 74 atomic_inc(&vmchange_seq);
75} 75}
76 76
77static void protect_vm_page(unsigned long addr, int w, int must_succeed)
78{
79 int err;
80
81 err = protect_memory(addr, PAGE_SIZE, 1, w, 1, must_succeed);
82 if(err == 0) return;
83 else if((err == -EFAULT) || (err == -ENOMEM)){
84 flush_tlb_kernel_range(addr, addr + PAGE_SIZE);
85 protect_vm_page(addr, w, 1);
86 }
87 else panic("protect_vm_page : protect failed, errno = %d\n", err);
88}
89
90void mprotect_kernel_vm(int w)
91{
92 struct mm_struct *mm;
93 pgd_t *pgd;
94 pud_t *pud;
95 pmd_t *pmd;
96 pte_t *pte;
97 unsigned long addr;
98
99 mm = &init_mm;
100 for(addr = start_vm; addr < end_vm;){
101 pgd = pgd_offset(mm, addr);
102 pud = pud_offset(pgd, addr);
103 pmd = pmd_offset(pud, addr);
104 if(pmd_present(*pmd)){
105 pte = pte_offset_kernel(pmd, addr);
106 if(pte_present(*pte)) protect_vm_page(addr, w, 0);
107 addr += PAGE_SIZE;
108 }
109 else addr += PMD_SIZE;
110 }
111}
112
113void flush_tlb_kernel_vm_tt(void) 77void flush_tlb_kernel_vm_tt(void)
114{ 78{
115 flush_tlb_kernel_range(start_vm, end_vm); 79 flush_tlb_kernel_range(start_vm, end_vm);
diff --git a/arch/v850/kernel/ptrace.c b/arch/v850/kernel/ptrace.c
index 4726b87f5e5a..d6077ff47d22 100644
--- a/arch/v850/kernel/ptrace.c
+++ b/arch/v850/kernel/ptrace.c
@@ -113,7 +113,7 @@ static int set_single_step (struct task_struct *t, int val)
113 return 1; 113 return 1;
114} 114}
115 115
116int sys_ptrace(long request, long pid, long addr, long data) 116long sys_ptrace(long request, long pid, long addr, long data)
117{ 117{
118 struct task_struct *child; 118 struct task_struct *child;
119 int rval; 119 int rval;
diff --git a/arch/v850/kernel/time.c b/arch/v850/kernel/time.c
index ea3fd8844ff0..c1e85c2aef65 100644
--- a/arch/v850/kernel/time.c
+++ b/arch/v850/kernel/time.c
@@ -26,10 +26,6 @@
26 26
27#include "mach.h" 27#include "mach.h"
28 28
29u64 jiffies_64 = INITIAL_JIFFIES;
30
31EXPORT_SYMBOL(jiffies_64);
32
33#define TICK_SIZE (tick_nsec / 1000) 29#define TICK_SIZE (tick_nsec / 1000)
34 30
35/* 31/*
diff --git a/arch/x86_64/ia32/ia32_aout.c b/arch/x86_64/ia32/ia32_aout.c
index 3e6780fa0186..93c60f4aa47a 100644
--- a/arch/x86_64/ia32/ia32_aout.c
+++ b/arch/x86_64/ia32/ia32_aout.c
@@ -314,7 +314,6 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
314 current->mm->free_area_cache = TASK_UNMAPPED_BASE; 314 current->mm->free_area_cache = TASK_UNMAPPED_BASE;
315 current->mm->cached_hole_size = 0; 315 current->mm->cached_hole_size = 0;
316 316
317 set_mm_counter(current->mm, rss, 0);
318 current->mm->mmap = NULL; 317 current->mm->mmap = NULL;
319 compute_creds(bprm); 318 compute_creds(bprm);
320 current->flags &= ~PF_FORKNOEXEC; 319 current->flags &= ~PF_FORKNOEXEC;
diff --git a/arch/x86_64/ia32/ia32_ioctl.c b/arch/x86_64/ia32/ia32_ioctl.c
index 419758f19ca4..4ba0e293d5e5 100644
--- a/arch/x86_64/ia32/ia32_ioctl.c
+++ b/arch/x86_64/ia32/ia32_ioctl.c
@@ -12,40 +12,11 @@
12#define INCLUDES 12#define INCLUDES
13#include <linux/syscalls.h> 13#include <linux/syscalls.h>
14#include "compat_ioctl.c" 14#include "compat_ioctl.c"
15#include <asm/mtrr.h>
16#include <asm/ia32.h> 15#include <asm/ia32.h>
17 16
18#define CODE 17#define CODE
19#include "compat_ioctl.c" 18#include "compat_ioctl.c"
20 19
21#ifndef TIOCGDEV
22#define TIOCGDEV _IOR('T',0x32, unsigned int)
23#endif
24static int tiocgdev(unsigned fd, unsigned cmd, unsigned int __user *ptr)
25{
26
27 struct file *file;
28 struct tty_struct *real_tty;
29 int fput_needed, ret;
30
31 file = fget_light(fd, &fput_needed);
32 if (!file)
33 return -EBADF;
34
35 ret = -EINVAL;
36 if (file->f_op->ioctl != tty_ioctl)
37 goto out;
38 real_tty = (struct tty_struct *)file->private_data;
39 if (!real_tty)
40 goto out;
41
42 ret = put_user(new_encode_dev(tty_devnum(real_tty)), ptr);
43
44out:
45 fput_light(file, fput_needed);
46 return ret;
47}
48
49#define RTC_IRQP_READ32 _IOR('p', 0x0b, unsigned int) /* Read IRQ rate */ 20#define RTC_IRQP_READ32 _IOR('p', 0x0b, unsigned int) /* Read IRQ rate */
50#define RTC_IRQP_SET32 _IOW('p', 0x0c, unsigned int) /* Set IRQ rate */ 21#define RTC_IRQP_SET32 _IOW('p', 0x0c, unsigned int) /* Set IRQ rate */
51#define RTC_EPOCH_READ32 _IOR('p', 0x0d, unsigned) /* Read epoch */ 22#define RTC_EPOCH_READ32 _IOR('p', 0x0d, unsigned) /* Read epoch */
@@ -85,90 +56,6 @@ static int rtc32_ioctl(unsigned fd, unsigned cmd, unsigned long arg)
85 return sys_ioctl(fd,cmd,arg); 56 return sys_ioctl(fd,cmd,arg);
86} 57}
87 58
88/* /proc/mtrr ioctls */
89
90
91struct mtrr_sentry32
92{
93 compat_ulong_t base; /* Base address */
94 compat_uint_t size; /* Size of region */
95 compat_uint_t type; /* Type of region */
96};
97
98struct mtrr_gentry32
99{
100 compat_ulong_t regnum; /* Register number */
101 compat_uint_t base; /* Base address */
102 compat_uint_t size; /* Size of region */
103 compat_uint_t type; /* Type of region */
104};
105
106#define MTRR_IOCTL_BASE 'M'
107
108#define MTRRIOC32_ADD_ENTRY _IOW(MTRR_IOCTL_BASE, 0, struct mtrr_sentry32)
109#define MTRRIOC32_SET_ENTRY _IOW(MTRR_IOCTL_BASE, 1, struct mtrr_sentry32)
110#define MTRRIOC32_DEL_ENTRY _IOW(MTRR_IOCTL_BASE, 2, struct mtrr_sentry32)
111#define MTRRIOC32_GET_ENTRY _IOWR(MTRR_IOCTL_BASE, 3, struct mtrr_gentry32)
112#define MTRRIOC32_KILL_ENTRY _IOW(MTRR_IOCTL_BASE, 4, struct mtrr_sentry32)
113#define MTRRIOC32_ADD_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 5, struct mtrr_sentry32)
114#define MTRRIOC32_SET_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 6, struct mtrr_sentry32)
115#define MTRRIOC32_DEL_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 7, struct mtrr_sentry32)
116#define MTRRIOC32_GET_PAGE_ENTRY _IOWR(MTRR_IOCTL_BASE, 8, struct mtrr_gentry32)
117#define MTRRIOC32_KILL_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 9, struct mtrr_sentry32)
118
119
120static int mtrr_ioctl32(unsigned int fd, unsigned int cmd, unsigned long arg)
121{
122 struct mtrr_gentry g;
123 struct mtrr_sentry s;
124 int get = 0, err = 0;
125 struct mtrr_gentry32 __user *g32 = (struct mtrr_gentry32 __user *)arg;
126 mm_segment_t oldfs = get_fs();
127
128 switch (cmd) {
129#define SET(x) case MTRRIOC32_ ## x ## _ENTRY: cmd = MTRRIOC_ ## x ## _ENTRY; break
130#define GET(x) case MTRRIOC32_ ## x ## _ENTRY: cmd = MTRRIOC_ ## x ## _ENTRY; get=1; break
131 SET(ADD);
132 SET(SET);
133 SET(DEL);
134 GET(GET);
135 SET(KILL);
136 SET(ADD_PAGE);
137 SET(SET_PAGE);
138 SET(DEL_PAGE);
139 GET(GET_PAGE);
140 SET(KILL_PAGE);
141 }
142
143 if (get) {
144 err = get_user(g.regnum, &g32->regnum);
145 err |= get_user(g.base, &g32->base);
146 err |= get_user(g.size, &g32->size);
147 err |= get_user(g.type, &g32->type);
148
149 arg = (unsigned long)&g;
150 } else {
151 struct mtrr_sentry32 __user *s32 = (struct mtrr_sentry32 __user *)arg;
152 err = get_user(s.base, &s32->base);
153 err |= get_user(s.size, &s32->size);
154 err |= get_user(s.type, &s32->type);
155
156 arg = (unsigned long)&s;
157 }
158 if (err) return err;
159
160 set_fs(KERNEL_DS);
161 err = sys_ioctl(fd, cmd, arg);
162 set_fs(oldfs);
163
164 if (!err && get) {
165 err = put_user(g.base, &g32->base);
166 err |= put_user(g.size, &g32->size);
167 err |= put_user(g.regnum, &g32->regnum);
168 err |= put_user(g.type, &g32->type);
169 }
170 return err;
171}
172 59
173#define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl_trans_handler_t)(handler) }, 60#define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl_trans_handler_t)(handler) },
174#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL(cmd,sys_ioctl) 61#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL(cmd,sys_ioctl)
@@ -185,7 +72,6 @@ COMPATIBLE_IOCTL(0x4B51) /* KDSHWCLK - not in the kernel, but don't complain *
185COMPATIBLE_IOCTL(FIOQSIZE) 72COMPATIBLE_IOCTL(FIOQSIZE)
186 73
187/* And these ioctls need translation */ 74/* And these ioctls need translation */
188HANDLE_IOCTL(TIOCGDEV, tiocgdev)
189/* realtime device */ 75/* realtime device */
190HANDLE_IOCTL(RTC_IRQP_READ, rtc32_ioctl) 76HANDLE_IOCTL(RTC_IRQP_READ, rtc32_ioctl)
191HANDLE_IOCTL(RTC_IRQP_READ32,rtc32_ioctl) 77HANDLE_IOCTL(RTC_IRQP_READ32,rtc32_ioctl)
@@ -193,17 +79,6 @@ HANDLE_IOCTL(RTC_IRQP_SET32, rtc32_ioctl)
193HANDLE_IOCTL(RTC_EPOCH_READ32, rtc32_ioctl) 79HANDLE_IOCTL(RTC_EPOCH_READ32, rtc32_ioctl)
194HANDLE_IOCTL(RTC_EPOCH_SET32, rtc32_ioctl) 80HANDLE_IOCTL(RTC_EPOCH_SET32, rtc32_ioctl)
195/* take care of sizeof(sizeof()) breakage */ 81/* take care of sizeof(sizeof()) breakage */
196/* mtrr */
197HANDLE_IOCTL(MTRRIOC32_ADD_ENTRY, mtrr_ioctl32)
198HANDLE_IOCTL(MTRRIOC32_SET_ENTRY, mtrr_ioctl32)
199HANDLE_IOCTL(MTRRIOC32_DEL_ENTRY, mtrr_ioctl32)
200HANDLE_IOCTL(MTRRIOC32_GET_ENTRY, mtrr_ioctl32)
201HANDLE_IOCTL(MTRRIOC32_KILL_ENTRY, mtrr_ioctl32)
202HANDLE_IOCTL(MTRRIOC32_ADD_PAGE_ENTRY, mtrr_ioctl32)
203HANDLE_IOCTL(MTRRIOC32_SET_PAGE_ENTRY, mtrr_ioctl32)
204HANDLE_IOCTL(MTRRIOC32_DEL_PAGE_ENTRY, mtrr_ioctl32)
205HANDLE_IOCTL(MTRRIOC32_GET_PAGE_ENTRY, mtrr_ioctl32)
206HANDLE_IOCTL(MTRRIOC32_KILL_PAGE_ENTRY, mtrr_ioctl32)
207}; 82};
208 83
209int ioctl_table_size = ARRAY_SIZE(ioctl_start); 84int ioctl_table_size = ARRAY_SIZE(ioctl_start);
diff --git a/arch/x86_64/kernel/i8259.c b/arch/x86_64/kernel/i8259.c
index b2a238b5a17e..c6c9791d77c1 100644
--- a/arch/x86_64/kernel/i8259.c
+++ b/arch/x86_64/kernel/i8259.c
@@ -494,7 +494,7 @@ void invalidate_interrupt7(void);
494void thermal_interrupt(void); 494void thermal_interrupt(void);
495void i8254_timer_resume(void); 495void i8254_timer_resume(void);
496 496
497static void setup_timer(void) 497static void setup_timer_hardware(void)
498{ 498{
499 outb_p(0x34,0x43); /* binary, mode 2, LSB/MSB, ch 0 */ 499 outb_p(0x34,0x43); /* binary, mode 2, LSB/MSB, ch 0 */
500 udelay(10); 500 udelay(10);
@@ -505,13 +505,13 @@ static void setup_timer(void)
505 505
506static int timer_resume(struct sys_device *dev) 506static int timer_resume(struct sys_device *dev)
507{ 507{
508 setup_timer(); 508 setup_timer_hardware();
509 return 0; 509 return 0;
510} 510}
511 511
512void i8254_timer_resume(void) 512void i8254_timer_resume(void)
513{ 513{
514 setup_timer(); 514 setup_timer_hardware();
515} 515}
516 516
517static struct sysdev_class timer_sysclass = { 517static struct sysdev_class timer_sysclass = {
@@ -594,7 +594,7 @@ void __init init_IRQ(void)
594 * Set the clock to HZ Hz, we already have a valid 594 * Set the clock to HZ Hz, we already have a valid
595 * vector now: 595 * vector now:
596 */ 596 */
597 setup_timer(); 597 setup_timer_hardware();
598 598
599 if (!acpi_ioapic) 599 if (!acpi_ioapic)
600 setup_irq(2, &irq2); 600 setup_irq(2, &irq2);
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
index cb28df14ff6f..da0bc3e7bdf5 100644
--- a/arch/x86_64/kernel/setup.c
+++ b/arch/x86_64/kernel/setup.c
@@ -1213,7 +1213,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
1213 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1213 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
1214 1214
1215 /* Intel-defined (#2) */ 1215 /* Intel-defined (#2) */
1216 "pni", NULL, NULL, "monitor", "ds_cpl", NULL, NULL, "est", 1216 "pni", NULL, NULL, "monitor", "ds_cpl", "vmx", NULL, "est",
1217 "tm2", NULL, "cid", NULL, NULL, "cx16", "xtpr", NULL, 1217 "tm2", NULL, "cid", NULL, NULL, "cx16", "xtpr", NULL,
1218 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1218 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
1219 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1219 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
diff --git a/arch/x86_64/kernel/suspend.c b/arch/x86_64/kernel/suspend.c
index f066c6ab3618..fd2bef780882 100644
--- a/arch/x86_64/kernel/suspend.c
+++ b/arch/x86_64/kernel/suspend.c
@@ -63,13 +63,12 @@ void save_processor_state(void)
63 __save_processor_state(&saved_context); 63 __save_processor_state(&saved_context);
64} 64}
65 65
66static void 66static void do_fpu_end(void)
67do_fpu_end(void)
68{ 67{
69 /* restore FPU regs if necessary */ 68 /*
70 /* Do it out of line so that gcc does not move cr0 load to some stupid place */ 69 * Restore FPU regs if necessary
71 kernel_fpu_end(); 70 */
72 mxcsr_feature_mask_init(); 71 kernel_fpu_end();
73} 72}
74 73
75void __restore_processor_state(struct saved_context *ctxt) 74void __restore_processor_state(struct saved_context *ctxt)
@@ -148,57 +147,7 @@ extern int restore_image(void);
148 147
149pgd_t *temp_level4_pgt; 148pgd_t *temp_level4_pgt;
150 149
151static void **pages; 150static int res_phys_pud_init(pud_t *pud, unsigned long address, unsigned long end)
152
153static inline void *__add_page(void)
154{
155 void **c;
156
157 c = (void **)get_usable_page(GFP_ATOMIC);
158 if (c) {
159 *c = pages;
160 pages = c;
161 }
162 return c;
163}
164
165static inline void *__next_page(void)
166{
167 void **c;
168
169 c = pages;
170 if (c) {
171 pages = *c;
172 *c = NULL;
173 }
174 return c;
175}
176
177/*
178 * Try to allocate as many usable pages as needed and daisy chain them.
179 * If one allocation fails, free the pages allocated so far
180 */
181static int alloc_usable_pages(unsigned long n)
182{
183 void *p;
184
185 pages = NULL;
186 do
187 if (!__add_page())
188 break;
189 while (--n);
190 if (n) {
191 p = __next_page();
192 while (p) {
193 free_page((unsigned long)p);
194 p = __next_page();
195 }
196 return -ENOMEM;
197 }
198 return 0;
199}
200
201static void res_phys_pud_init(pud_t *pud, unsigned long address, unsigned long end)
202{ 151{
203 long i, j; 152 long i, j;
204 153
@@ -212,7 +161,9 @@ static void res_phys_pud_init(pud_t *pud, unsigned long address, unsigned long e
212 if (paddr >= end) 161 if (paddr >= end)
213 break; 162 break;
214 163
215 pmd = (pmd_t *)__next_page(); 164 pmd = (pmd_t *)get_safe_page(GFP_ATOMIC);
165 if (!pmd)
166 return -ENOMEM;
216 set_pud(pud, __pud(__pa(pmd) | _KERNPG_TABLE)); 167 set_pud(pud, __pud(__pa(pmd) | _KERNPG_TABLE));
217 for (j = 0; j < PTRS_PER_PMD; pmd++, j++, paddr += PMD_SIZE) { 168 for (j = 0; j < PTRS_PER_PMD; pmd++, j++, paddr += PMD_SIZE) {
218 unsigned long pe; 169 unsigned long pe;
@@ -224,13 +175,17 @@ static void res_phys_pud_init(pud_t *pud, unsigned long address, unsigned long e
224 set_pmd(pmd, __pmd(pe)); 175 set_pmd(pmd, __pmd(pe));
225 } 176 }
226 } 177 }
178 return 0;
227} 179}
228 180
229static void set_up_temporary_mappings(void) 181static int set_up_temporary_mappings(void)
230{ 182{
231 unsigned long start, end, next; 183 unsigned long start, end, next;
184 int error;
232 185
233 temp_level4_pgt = (pgd_t *)__next_page(); 186 temp_level4_pgt = (pgd_t *)get_safe_page(GFP_ATOMIC);
187 if (!temp_level4_pgt)
188 return -ENOMEM;
234 189
235 /* It is safe to reuse the original kernel mapping */ 190 /* It is safe to reuse the original kernel mapping */
236 set_pgd(temp_level4_pgt + pgd_index(__START_KERNEL_map), 191 set_pgd(temp_level4_pgt + pgd_index(__START_KERNEL_map),
@@ -241,29 +196,27 @@ static void set_up_temporary_mappings(void)
241 end = (unsigned long)pfn_to_kaddr(end_pfn); 196 end = (unsigned long)pfn_to_kaddr(end_pfn);
242 197
243 for (; start < end; start = next) { 198 for (; start < end; start = next) {
244 pud_t *pud = (pud_t *)__next_page(); 199 pud_t *pud = (pud_t *)get_safe_page(GFP_ATOMIC);
200 if (!pud)
201 return -ENOMEM;
245 next = start + PGDIR_SIZE; 202 next = start + PGDIR_SIZE;
246 if (next > end) 203 if (next > end)
247 next = end; 204 next = end;
248 res_phys_pud_init(pud, __pa(start), __pa(next)); 205 if ((error = res_phys_pud_init(pud, __pa(start), __pa(next))))
206 return error;
249 set_pgd(temp_level4_pgt + pgd_index(start), 207 set_pgd(temp_level4_pgt + pgd_index(start),
250 mk_kernel_pgd(__pa(pud))); 208 mk_kernel_pgd(__pa(pud)));
251 } 209 }
210 return 0;
252} 211}
253 212
254int swsusp_arch_resume(void) 213int swsusp_arch_resume(void)
255{ 214{
256 unsigned long n; 215 int error;
257 216
258 n = ((end_pfn << PAGE_SHIFT) + PUD_SIZE - 1) >> PUD_SHIFT;
259 n += (n + PTRS_PER_PUD - 1) / PTRS_PER_PUD + 1;
260 pr_debug("swsusp_arch_resume(): pages needed = %lu\n", n);
261 if (alloc_usable_pages(n)) {
262 free_eaten_memory();
263 return -ENOMEM;
264 }
265 /* We have got enough memory and from now on we cannot recover */ 217 /* We have got enough memory and from now on we cannot recover */
266 set_up_temporary_mappings(); 218 if ((error = set_up_temporary_mappings()))
219 return error;
267 restore_image(); 220 restore_image();
268 return 0; 221 return 0;
269} 222}
diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c
index 703acde2a1a5..fdaddc4e5284 100644
--- a/arch/x86_64/kernel/time.c
+++ b/arch/x86_64/kernel/time.c
@@ -42,10 +42,6 @@
42#include <asm/apic.h> 42#include <asm/apic.h>
43#endif 43#endif
44 44
45u64 jiffies_64 = INITIAL_JIFFIES;
46
47EXPORT_SYMBOL(jiffies_64);
48
49#ifdef CONFIG_CPU_FREQ 45#ifdef CONFIG_CPU_FREQ
50static void cpufreq_delayed_get(void); 46static void cpufreq_delayed_get(void);
51#endif 47#endif
@@ -481,9 +477,9 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
481static unsigned int cyc2ns_scale; 477static unsigned int cyc2ns_scale;
482#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */ 478#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */
483 479
484static inline void set_cyc2ns_scale(unsigned long cpu_mhz) 480static inline void set_cyc2ns_scale(unsigned long cpu_khz)
485{ 481{
486 cyc2ns_scale = (1000 << CYC2NS_SCALE_FACTOR)/cpu_mhz; 482 cyc2ns_scale = (1000000 << CYC2NS_SCALE_FACTOR)/cpu_khz;
487} 483}
488 484
489static inline unsigned long long cycles_2_ns(unsigned long long cyc) 485static inline unsigned long long cycles_2_ns(unsigned long long cyc)
@@ -655,7 +651,7 @@ static int time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
655 vxtime.tsc_quot = (1000L << 32) / cpu_khz; 651 vxtime.tsc_quot = (1000L << 32) / cpu_khz;
656 } 652 }
657 653
658 set_cyc2ns_scale(cpu_khz_ref / 1000); 654 set_cyc2ns_scale(cpu_khz_ref);
659 655
660 return 0; 656 return 0;
661} 657}
@@ -939,7 +935,7 @@ void __init time_init(void)
939 rdtscll_sync(&vxtime.last_tsc); 935 rdtscll_sync(&vxtime.last_tsc);
940 setup_irq(0, &irq0); 936 setup_irq(0, &irq0);
941 937
942 set_cyc2ns_scale(cpu_khz / 1000); 938 set_cyc2ns_scale(cpu_khz);
943 939
944#ifndef CONFIG_SMP 940#ifndef CONFIG_SMP
945 time_init_gtod(); 941 time_init_gtod();
@@ -1093,6 +1089,7 @@ static unsigned long PIE_freq = DEFAULT_RTC_INT_FREQ;
1093static unsigned long PIE_count; 1089static unsigned long PIE_count;
1094 1090
1095static unsigned long hpet_rtc_int_freq; /* RTC interrupt frequency */ 1091static unsigned long hpet_rtc_int_freq; /* RTC interrupt frequency */
1092static unsigned int hpet_t1_cmp; /* cached comparator register */
1096 1093
1097int is_hpet_enabled(void) 1094int is_hpet_enabled(void)
1098{ 1095{
@@ -1129,10 +1126,12 @@ int hpet_rtc_timer_init(void)
1129 cnt = hpet_readl(HPET_COUNTER); 1126 cnt = hpet_readl(HPET_COUNTER);
1130 cnt += ((hpet_tick*HZ)/hpet_rtc_int_freq); 1127 cnt += ((hpet_tick*HZ)/hpet_rtc_int_freq);
1131 hpet_writel(cnt, HPET_T1_CMP); 1128 hpet_writel(cnt, HPET_T1_CMP);
1129 hpet_t1_cmp = cnt;
1132 local_irq_restore(flags); 1130 local_irq_restore(flags);
1133 1131
1134 cfg = hpet_readl(HPET_T1_CFG); 1132 cfg = hpet_readl(HPET_T1_CFG);
1135 cfg |= HPET_TN_ENABLE | HPET_TN_SETVAL | HPET_TN_32BIT; 1133 cfg &= ~HPET_TN_PERIODIC;
1134 cfg |= HPET_TN_ENABLE | HPET_TN_32BIT;
1136 hpet_writel(cfg, HPET_T1_CFG); 1135 hpet_writel(cfg, HPET_T1_CFG);
1137 1136
1138 return 1; 1137 return 1;
@@ -1142,8 +1141,12 @@ static void hpet_rtc_timer_reinit(void)
1142{ 1141{
1143 unsigned int cfg, cnt; 1142 unsigned int cfg, cnt;
1144 1143
1145 if (!(PIE_on | AIE_on | UIE_on)) 1144 if (unlikely(!(PIE_on | AIE_on | UIE_on))) {
1145 cfg = hpet_readl(HPET_T1_CFG);
1146 cfg &= ~HPET_TN_ENABLE;
1147 hpet_writel(cfg, HPET_T1_CFG);
1146 return; 1148 return;
1149 }
1147 1150
1148 if (PIE_on && (PIE_freq > DEFAULT_RTC_INT_FREQ)) 1151 if (PIE_on && (PIE_freq > DEFAULT_RTC_INT_FREQ))
1149 hpet_rtc_int_freq = PIE_freq; 1152 hpet_rtc_int_freq = PIE_freq;
@@ -1151,15 +1154,10 @@ static void hpet_rtc_timer_reinit(void)
1151 hpet_rtc_int_freq = DEFAULT_RTC_INT_FREQ; 1154 hpet_rtc_int_freq = DEFAULT_RTC_INT_FREQ;
1152 1155
1153 /* It is more accurate to use the comparator value than current count.*/ 1156 /* It is more accurate to use the comparator value than current count.*/
1154 cnt = hpet_readl(HPET_T1_CMP); 1157 cnt = hpet_t1_cmp;
1155 cnt += hpet_tick*HZ/hpet_rtc_int_freq; 1158 cnt += hpet_tick*HZ/hpet_rtc_int_freq;
1156 hpet_writel(cnt, HPET_T1_CMP); 1159 hpet_writel(cnt, HPET_T1_CMP);
1157 1160 hpet_t1_cmp = cnt;
1158 cfg = hpet_readl(HPET_T1_CFG);
1159 cfg |= HPET_TN_ENABLE | HPET_TN_SETVAL | HPET_TN_32BIT;
1160 hpet_writel(cfg, HPET_T1_CFG);
1161
1162 return;
1163} 1161}
1164 1162
1165/* 1163/*
diff --git a/arch/x86_64/mm/ioremap.c b/arch/x86_64/mm/ioremap.c
index 6972df480d2b..ecf7acb5db9b 100644
--- a/arch/x86_64/mm/ioremap.c
+++ b/arch/x86_64/mm/ioremap.c
@@ -60,7 +60,7 @@ static inline int remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned lo
60 if (address >= end) 60 if (address >= end)
61 BUG(); 61 BUG();
62 do { 62 do {
63 pte_t * pte = pte_alloc_kernel(&init_mm, pmd, address); 63 pte_t * pte = pte_alloc_kernel(pmd, address);
64 if (!pte) 64 if (!pte)
65 return -ENOMEM; 65 return -ENOMEM;
66 remap_area_pte(pte, address, end - address, address + phys_addr, flags); 66 remap_area_pte(pte, address, end - address, address + phys_addr, flags);
@@ -105,7 +105,6 @@ static int remap_area_pages(unsigned long address, unsigned long phys_addr,
105 flush_cache_all(); 105 flush_cache_all();
106 if (address >= end) 106 if (address >= end)
107 BUG(); 107 BUG();
108 spin_lock(&init_mm.page_table_lock);
109 do { 108 do {
110 pud_t *pud; 109 pud_t *pud;
111 pud = pud_alloc(&init_mm, pgd, address); 110 pud = pud_alloc(&init_mm, pgd, address);
@@ -119,7 +118,6 @@ static int remap_area_pages(unsigned long address, unsigned long phys_addr,
119 address = (address + PGDIR_SIZE) & PGDIR_MASK; 118 address = (address + PGDIR_SIZE) & PGDIR_MASK;
120 pgd++; 119 pgd++;
121 } while (address && (address < end)); 120 } while (address && (address < end));
122 spin_unlock(&init_mm.page_table_lock);
123 flush_tlb_all(); 121 flush_tlb_all();
124 return error; 122 return error;
125} 123}
diff --git a/arch/xtensa/kernel/platform.c b/arch/xtensa/kernel/platform.c
index 03674daabc66..a17930747f20 100644
--- a/arch/xtensa/kernel/platform.c
+++ b/arch/xtensa/kernel/platform.c
@@ -18,6 +18,7 @@
18#include <linux/time.h> 18#include <linux/time.h>
19#include <asm/platform.h> 19#include <asm/platform.h>
20#include <asm/timex.h> 20#include <asm/timex.h>
21#include <asm/param.h> /* HZ */
21 22
22#define _F(r,f,a,b) \ 23#define _F(r,f,a,b) \
23 r __platform_##f a b; \ 24 r __platform_##f a b; \
diff --git a/arch/xtensa/kernel/ptrace.c b/arch/xtensa/kernel/ptrace.c
index 2659efdd4e99..14460743de07 100644
--- a/arch/xtensa/kernel/ptrace.c
+++ b/arch/xtensa/kernel/ptrace.c
@@ -45,7 +45,7 @@ void ptrace_disable(struct task_struct *child)
45 /* Nothing to do.. */ 45 /* Nothing to do.. */
46} 46}
47 47
48int sys_ptrace(long request, long pid, long addr, long data) 48long sys_ptrace(long request, long pid, long addr, long data)
49{ 49{
50 struct task_struct *child; 50 struct task_struct *child;
51 int ret = -EPERM; 51 int ret = -EPERM;
diff --git a/arch/xtensa/kernel/time.c b/arch/xtensa/kernel/time.c
index 8e423d1335ce..cb6e38ed2b1d 100644
--- a/arch/xtensa/kernel/time.c
+++ b/arch/xtensa/kernel/time.c
@@ -29,9 +29,6 @@
29 29
30extern volatile unsigned long wall_jiffies; 30extern volatile unsigned long wall_jiffies;
31 31
32u64 jiffies_64 = INITIAL_JIFFIES;
33EXPORT_SYMBOL(jiffies_64);
34
35spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED; 32spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED;
36EXPORT_SYMBOL(rtc_lock); 33EXPORT_SYMBOL(rtc_lock);
37 34